Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

+60 -40
+19 -8
drivers/net/wireless/ath5k/base.c
··· 340 } 341 342 /* Interrupt handling */ 343 - static int ath5k_init(struct ath5k_softc *sc); 344 static int ath5k_stop_locked(struct ath5k_softc *sc); 345 - static int ath5k_stop_hw(struct ath5k_softc *sc); 346 static irqreturn_t ath5k_intr(int irq, void *dev_id); 347 static void ath5k_tasklet_reset(unsigned long data); 348 ··· 646 647 ath5k_led_off(sc); 648 649 - ath5k_stop_hw(sc); 650 651 free_irq(pdev->irq, sc); 652 pci_save_state(pdev); ··· 683 goto err_no_irq; 684 } 685 686 - err = ath5k_init(sc); 687 if (err) 688 goto err_irq; 689 ath5k_led_enable(sc); ··· 2200 \********************/ 2201 2202 static int 2203 - ath5k_init(struct ath5k_softc *sc) 2204 { 2205 int ret; 2206 2207 mutex_lock(&sc->lock); 2208 2209 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); 2210 ··· 2235 if (ret) 2236 goto done; 2237 2238 /* Set ack to be sent at low bit-rates */ 2239 ath5k_hw_set_ack_bitrate_high(sc->ah, false); 2240 2241 mod_timer(&sc->calib_tim, round_jiffies(jiffies + 2242 msecs_to_jiffies(ath5k_calinterval * 1000))); 2243 2244 ret = 0; 2245 done: 2246 mmiowb(); ··· 2298 * stop is preempted). 2299 */ 2300 static int 2301 - ath5k_stop_hw(struct ath5k_softc *sc) 2302 { 2303 int ret; 2304 ··· 2329 } 2330 } 2331 ath5k_txbuf_free(sc, sc->bbuf); 2332 mmiowb(); 2333 mutex_unlock(&sc->lock); 2334 ··· 2729 2730 static int ath5k_start(struct ieee80211_hw *hw) 2731 { 2732 - return ath5k_init(hw->priv); 2733 } 2734 2735 static void ath5k_stop(struct ieee80211_hw *hw) 2736 { 2737 - ath5k_stop_hw(hw->priv); 2738 } 2739 2740 static int ath5k_add_interface(struct ieee80211_hw *hw,
··· 340 } 341 342 /* Interrupt handling */ 343 + static int ath5k_init(struct ath5k_softc *sc, bool is_resume); 344 static int ath5k_stop_locked(struct ath5k_softc *sc); 345 + static int ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend); 346 static irqreturn_t ath5k_intr(int irq, void *dev_id); 347 static void ath5k_tasklet_reset(unsigned long data); 348 ··· 646 647 ath5k_led_off(sc); 648 649 + ath5k_stop_hw(sc, true); 650 651 free_irq(pdev->irq, sc); 652 pci_save_state(pdev); ··· 683 goto err_no_irq; 684 } 685 686 + err = ath5k_init(sc, true); 687 if (err) 688 goto err_irq; 689 ath5k_led_enable(sc); ··· 2200 \********************/ 2201 2202 static int 2203 + ath5k_init(struct ath5k_softc *sc, bool is_resume) 2204 { 2205 int ret; 2206 2207 mutex_lock(&sc->lock); 2208 + 2209 + if (is_resume && !test_bit(ATH_STAT_STARTED, sc->status)) 2210 + goto out_ok; 2211 + 2212 + __clear_bit(ATH_STAT_STARTED, sc->status); 2213 2214 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); 2215 ··· 2230 if (ret) 2231 goto done; 2232 2233 + __set_bit(ATH_STAT_STARTED, sc->status); 2234 + 2235 /* Set ack to be sent at low bit-rates */ 2236 ath5k_hw_set_ack_bitrate_high(sc->ah, false); 2237 2238 mod_timer(&sc->calib_tim, round_jiffies(jiffies + 2239 msecs_to_jiffies(ath5k_calinterval * 1000))); 2240 2241 + out_ok: 2242 ret = 0; 2243 done: 2244 mmiowb(); ··· 2290 * stop is preempted). 2291 */ 2292 static int 2293 + ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend) 2294 { 2295 int ret; 2296 ··· 2321 } 2322 } 2323 ath5k_txbuf_free(sc, sc->bbuf); 2324 + if (!is_suspend) 2325 + __clear_bit(ATH_STAT_STARTED, sc->status); 2326 + 2327 mmiowb(); 2328 mutex_unlock(&sc->lock); 2329 ··· 2718 2719 static int ath5k_start(struct ieee80211_hw *hw) 2720 { 2721 + return ath5k_init(hw->priv, false); 2722 } 2723 2724 static void ath5k_stop(struct ieee80211_hw *hw) 2725 { 2726 + ath5k_stop_hw(hw->priv, false); 2727 } 2728 2729 static int ath5k_add_interface(struct ieee80211_hw *hw,
+2 -1
drivers/net/wireless/ath5k/base.h
··· 128 size_t desc_len; /* size of TX/RX descriptors */ 129 u16 cachelsz; /* cache line size */ 130 131 - DECLARE_BITMAP(status, 4); 132 #define ATH_STAT_INVALID 0 /* disable hardware accesses */ 133 #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ 134 #define ATH_STAT_PROMISC 2 135 #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ 136 137 unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ 138 unsigned int curmode; /* current phy mode */
··· 128 size_t desc_len; /* size of TX/RX descriptors */ 129 u16 cachelsz; /* cache line size */ 130 131 + DECLARE_BITMAP(status, 5); 132 #define ATH_STAT_INVALID 0 /* disable hardware accesses */ 133 #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ 134 #define ATH_STAT_PROMISC 2 135 #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ 136 + #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ 137 138 unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ 139 unsigned int curmode; /* current phy mode */
+29 -13
drivers/net/wireless/orinoco.c
··· 433 const static struct fw_info orinoco_fw[] = { 434 { "", "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 }, 435 { "", "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 }, 436 - { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 0x100 } 437 }; 438 439 /* Structure used to access fields in FW ··· 458 int ap) 459 { 460 /* Plug Data Area (PDA) */ 461 - __le16 pda[512] = { 0 }; 462 463 hermes_t *hw = &priv->hw; 464 const struct firmware *fw_entry; ··· 467 const unsigned char *end; 468 const char *firmware; 469 struct net_device *dev = priv->ndev; 470 - int err; 471 472 if (ap) 473 firmware = fw->ap_fw; ··· 482 dev->name, firmware); 483 484 /* Read current plug data */ 485 - err = hermes_read_pda(hw, pda, fw->pda_addr, 486 - min_t(u16, fw->pda_size, sizeof(pda)), 0); 487 printk(KERN_DEBUG "%s: Read PDA returned %d\n", dev->name, err); 488 if (err) 489 - return err; 490 491 err = request_firmware(&fw_entry, firmware, priv->dev); 492 if (err) { 493 printk(KERN_ERR "%s: Cannot find firmware %s\n", 494 dev->name, firmware); 495 - return -ENOENT; 496 } 497 498 hdr = (const struct orinoco_fw_header *) fw_entry->data; ··· 536 537 abort: 538 release_firmware(fw_entry); 539 return err; 540 } 541 ··· 556 int secondary) 557 { 558 hermes_t *hw = &priv->hw; 559 - int ret; 560 const unsigned char *ptr; 561 const unsigned char *first_block; 562 563 /* Plug Data Area (PDA) */ 564 - __le16 pda[256]; 565 566 /* Binary block begins after the 0x1A marker */ 567 ptr = image; ··· 570 571 /* Read the PDA from EEPROM */ 572 if (secondary) { 573 - ret = hermes_read_pda(hw, pda, fw->pda_addr, sizeof(pda), 1); 574 if (ret) 575 - return ret; 576 } 577 578 /* Stop the firmware, so that it can be safely rewritten */ 579 if (priv->stop_fw) { 580 ret = priv->stop_fw(priv, 1); 581 if (ret) 582 - return ret; 583 } 584 585 /* Program the adapter with new firmware */ 586 ret = hermes_program(hw, first_block, end); 587 if (ret) 588 - return ret; 589 590 /* Write the PDA to the adapter */ 591 if (secondary) { 592 size_t len = hermes_blocks_length(first_block); 593 ptr = first_block + len; 594 ret = hermes_apply_pda(hw, ptr, pda); 595 if (ret) 596 return ret; 597 } ··· 620 return -ENODEV; 621 622 return 0; 623 } 624 625
··· 433 const static struct fw_info orinoco_fw[] = { 434 { "", "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 }, 435 { "", "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 }, 436 + { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 512 } 437 }; 438 439 /* Structure used to access fields in FW ··· 458 int ap) 459 { 460 /* Plug Data Area (PDA) */ 461 + __le16 *pda; 462 463 hermes_t *hw = &priv->hw; 464 const struct firmware *fw_entry; ··· 467 const unsigned char *end; 468 const char *firmware; 469 struct net_device *dev = priv->ndev; 470 + int err = 0; 471 + 472 + pda = kzalloc(fw->pda_size, GFP_KERNEL); 473 + if (!pda) 474 + return -ENOMEM; 475 476 if (ap) 477 firmware = fw->ap_fw; ··· 478 dev->name, firmware); 479 480 /* Read current plug data */ 481 + err = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 0); 482 printk(KERN_DEBUG "%s: Read PDA returned %d\n", dev->name, err); 483 if (err) 484 + goto free; 485 486 err = request_firmware(&fw_entry, firmware, priv->dev); 487 if (err) { 488 printk(KERN_ERR "%s: Cannot find firmware %s\n", 489 dev->name, firmware); 490 + err = -ENOENT; 491 + goto free; 492 } 493 494 hdr = (const struct orinoco_fw_header *) fw_entry->data; ··· 532 533 abort: 534 release_firmware(fw_entry); 535 + 536 + free: 537 + kfree(pda); 538 return err; 539 } 540 ··· 549 int secondary) 550 { 551 hermes_t *hw = &priv->hw; 552 + int ret = 0; 553 const unsigned char *ptr; 554 const unsigned char *first_block; 555 556 /* Plug Data Area (PDA) */ 557 + __le16 *pda = NULL; 558 559 /* Binary block begins after the 0x1A marker */ 560 ptr = image; ··· 563 564 /* Read the PDA from EEPROM */ 565 if (secondary) { 566 + pda = kzalloc(fw->pda_size, GFP_KERNEL); 567 + if (!pda) 568 + return -ENOMEM; 569 + 570 + ret = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 1); 571 if (ret) 572 + goto free; 573 } 574 575 /* Stop the firmware, so that it can be safely rewritten */ 576 if (priv->stop_fw) { 577 ret = priv->stop_fw(priv, 1); 578 if (ret) 579 + goto free; 580 } 581 582 /* Program the adapter with new firmware */ 583 ret = hermes_program(hw, first_block, end); 584 if (ret) 585 + goto free; 586 587 /* Write the PDA to the adapter */ 588 if (secondary) { 589 size_t len = hermes_blocks_length(first_block); 590 ptr = first_block + len; 591 ret = hermes_apply_pda(hw, ptr, pda); 592 + kfree(pda); 593 if (ret) 594 return ret; 595 } ··· 608 return -ENODEV; 609 610 return 0; 611 + 612 + free: 613 + kfree(pda); 614 + return ret; 615 } 616 617
+10 -18
drivers/net/wireless/p54/p54common.c
··· 306 return 0; 307 } 308 309 - static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette", 310 - "Frisbee", "Xbow", "Longbow" }; 311 static int p54_init_xbow_synth(struct ieee80211_hw *dev); 312 313 static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ··· 319 void *tmp; 320 int err; 321 u8 *end = (u8 *)eeprom + len; 322 DECLARE_MAC_BUF(mac); 323 324 wrap = (struct eeprom_pda_wrap *) eeprom; ··· 401 tmp = entry->data; 402 while ((u8 *)tmp < entry->data + data_len) { 403 struct bootrec_exp_if *exp_if = tmp; 404 - if (le16_to_cpu(exp_if->if_id) == 0xF) 405 - priv->rxhw = le16_to_cpu(exp_if->variant) & 0x07; 406 tmp += sizeof(struct bootrec_exp_if); 407 } 408 break; ··· 428 goto err; 429 } 430 431 - switch (priv->rxhw) { 432 - case 4: /* XBow */ 433 p54_init_xbow_synth(dev); 434 - case 1: /* Indigo? */ 435 - case 2: /* Duette */ 436 - dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 437 - case 3: /* Frisbee */ 438 - case 5: /* Longbow */ 439 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; 440 - break; 441 - default: 442 - printk(KERN_ERR "%s: unsupported RF-Chip\n", 443 - wiphy_name(dev->wiphy)); 444 - err = -EINVAL; 445 - goto err; 446 - } 447 448 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { 449 u8 perm_addr[ETH_ALEN];
··· 306 return 0; 307 } 308 309 + static const char *p54_rf_chips[] = { "NULL", "Duette3", "Duette2", 310 + "Frisbee", "Xbow", "Longbow", "NULL", "NULL" }; 311 static int p54_init_xbow_synth(struct ieee80211_hw *dev); 312 313 static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ··· 319 void *tmp; 320 int err; 321 u8 *end = (u8 *)eeprom + len; 322 + u16 synth; 323 DECLARE_MAC_BUF(mac); 324 325 wrap = (struct eeprom_pda_wrap *) eeprom; ··· 400 tmp = entry->data; 401 while ((u8 *)tmp < entry->data + data_len) { 402 struct bootrec_exp_if *exp_if = tmp; 403 + if (le16_to_cpu(exp_if->if_id) == 0xf) 404 + synth = le16_to_cpu(exp_if->variant); 405 tmp += sizeof(struct bootrec_exp_if); 406 } 407 break; ··· 427 goto err; 428 } 429 430 + priv->rxhw = synth & 0x07; 431 + if (priv->rxhw == 4) 432 p54_init_xbow_synth(dev); 433 + if (!(synth & 0x40)) 434 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; 435 + if (!(synth & 0x80)) 436 + dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 437 438 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { 439 u8 perm_addr[ETH_ALEN];