Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+85 -41
+1 -5
drivers/net/wireless/ath/ath9k/ar9002_hw.c
··· 309 309 u8 i; 310 310 u32 val; 311 311 312 - if (ah->is_pciexpress != true) 313 - return; 314 - 315 - /* Do not touch SerDes registers */ 316 - if (ah->config.pcie_powersave_enable == 2) 312 + if (ah->is_pciexpress != true || ah->aspm_enabled != true) 317 313 return; 318 314 319 315 /* Nothing to do on restore for 11N */
+1 -5
drivers/net/wireless/ath/ath9k/ar9003_hw.c
··· 519 519 int restore, 520 520 int power_off) 521 521 { 522 - if (ah->is_pciexpress != true) 523 - return; 524 - 525 - /* Do not touch SerDes registers */ 526 - if (ah->config.pcie_powersave_enable == 2) 522 + if (ah->is_pciexpress != true || ah->aspm_enabled != true) 527 523 return; 528 524 529 525 /* Nothing to do on restore for 11N */
+9 -2
drivers/net/wireless/ath/ath9k/hw.c
··· 318 318 REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); 319 319 } 320 320 321 + static void ath9k_hw_aspm_init(struct ath_hw *ah) 322 + { 323 + struct ath_common *common = ath9k_hw_common(ah); 324 + 325 + if (common->bus_ops->aspm_init) 326 + common->bus_ops->aspm_init(common); 327 + } 328 + 321 329 /* This should work for all families including legacy */ 322 330 static bool ath9k_hw_chip_test(struct ath_hw *ah) 323 331 { ··· 386 378 ah->config.additional_swba_backoff = 0; 387 379 ah->config.ack_6mb = 0x0; 388 380 ah->config.cwm_ignore_extcca = 0; 389 - ah->config.pcie_powersave_enable = 0; 390 381 ah->config.pcie_clock_req = 0; 391 382 ah->config.pcie_waen = 0; 392 383 ah->config.analog_shiftreg = 1; ··· 605 598 606 599 607 600 if (ah->is_pciexpress) 608 - ath9k_hw_configpcipowersave(ah, 0, 0); 601 + ath9k_hw_aspm_init(ah); 609 602 else 610 603 ath9k_hw_disablepcie(ah); 611 604
+2 -1
drivers/net/wireless/ath/ath9k/hw.h
··· 219 219 int additional_swba_backoff; 220 220 int ack_6mb; 221 221 u32 cwm_ignore_extcca; 222 - u8 pcie_powersave_enable; 223 222 bool pcieSerDesWrite; 224 223 u8 pcie_clock_req; 225 224 u32 pcie_waen; ··· 672 673 673 674 bool sw_mgmt_crypto; 674 675 bool is_pciexpress; 676 + bool aspm_enabled; 675 677 bool is_monitoring; 676 678 bool need_an_top2_fixup; 677 679 u16 tx_trig_level; ··· 874 874 bool (*eeprom_read)(struct ath_common *common, u32 off, u16 *data); 875 875 void (*bt_coex_prep)(struct ath_common *common); 876 876 void (*extn_synch_en)(struct ath_common *common); 877 + void (*aspm_init)(struct ath_common *common); 877 878 }; 878 879 879 880 static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
+2
drivers/net/wireless/ath/ath9k/init.c
··· 670 670 static void ath9k_init_txpower_limits(struct ath_softc *sc) 671 671 { 672 672 struct ath_hw *ah = sc->sc_ah; 673 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 673 674 struct ath9k_channel *curchan = ah->curchan; 674 675 676 + ah->txchainmask = common->tx_chainmask; 675 677 if (ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) 676 678 ath9k_init_band_txpower(sc, IEEE80211_BAND_2GHZ); 677 679 if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
+27
drivers/net/wireless/ath/ath9k/pci.c
··· 16 16 17 17 #include <linux/nl80211.h> 18 18 #include <linux/pci.h> 19 + #include <linux/pci-aspm.h> 19 20 #include <linux/ath9k_platform.h> 20 21 #include "ath9k.h" 21 22 ··· 116 115 pci_write_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, lnkctl); 117 116 } 118 117 118 + static void ath_pci_aspm_init(struct ath_common *common) 119 + { 120 + struct ath_softc *sc = (struct ath_softc *) common->priv; 121 + struct ath_hw *ah = sc->sc_ah; 122 + struct pci_dev *pdev = to_pci_dev(sc->dev); 123 + struct pci_dev *parent; 124 + int pos; 125 + u8 aspm; 126 + 127 + if (!pci_is_pcie(pdev)) 128 + return; 129 + 130 + parent = pdev->bus->self; 131 + if (WARN_ON(!parent)) 132 + return; 133 + 134 + pos = pci_pcie_cap(parent); 135 + pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm); 136 + if (aspm & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) { 137 + ah->aspm_enabled = true; 138 + /* Initialize PCIe PM and SERDES registers. */ 139 + ath9k_hw_configpcipowersave(ah, 0, 0); 140 + } 141 + } 142 + 119 143 static const struct ath_bus_ops ath_pci_bus_ops = { 120 144 .ath_bus_type = ATH_PCI, 121 145 .read_cachesize = ath_pci_read_cachesize, 122 146 .eeprom_read = ath_pci_eeprom_read, 123 147 .bt_coex_prep = ath_pci_bt_coex_prep, 124 148 .extn_synch_en = ath_pci_extn_synch_enable, 149 + .aspm_init = ath_pci_aspm_init, 125 150 }; 126 151 127 152 static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+5 -1
drivers/net/wireless/iwlegacy/iwl-3945.c
··· 1746 1746 } 1747 1747 1748 1748 memcpy(active_rxon, staging_rxon, sizeof(*active_rxon)); 1749 - 1749 + /* 1750 + * We do not commit tx power settings while channel changing, 1751 + * do it now if tx power changed. 1752 + */ 1753 + iwl_legacy_set_tx_power(priv, priv->tx_power_next, false); 1750 1754 return 0; 1751 1755 } 1752 1756
+6 -2
drivers/net/wireless/iwlegacy/iwl-4965.c
··· 1235 1235 1236 1236 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); 1237 1237 iwl_legacy_print_rx_config_cmd(priv, ctx); 1238 - goto set_tx_power; 1238 + /* 1239 + * We do not commit tx power settings while channel changing, 1240 + * do it now if tx power changed. 1241 + */ 1242 + iwl_legacy_set_tx_power(priv, priv->tx_power_next, false); 1243 + return 0; 1239 1244 } 1240 1245 1241 1246 /* If we are currently associated and the new config requires ··· 1320 1315 1321 1316 iwl4965_init_sensitivity(priv); 1322 1317 1323 - set_tx_power: 1324 1318 /* If we issue a new RXON command which required a tune then we must 1325 1319 * send a new TXPOWER command or we won't be able to Tx any frames */ 1326 1320 ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true);
+1
drivers/net/wireless/iwlwifi/iwl-5000.c
··· 365 365 .chain_noise_scale = 1000, 366 366 .wd_timeout = IWL_LONG_WD_TIMEOUT, 367 367 .max_event_log_size = 512, 368 + .no_idle_support = true, 368 369 }; 369 370 static struct iwl_ht_params iwl5000_ht_params = { 370 371 .ht_greenfield_support = true,
+2
drivers/net/wireless/iwlwifi/iwl-core.h
··· 135 135 * @temperature_kelvin: temperature report by uCode in kelvin 136 136 * @max_event_log_size: size of event log buffer size for ucode event logging 137 137 * @shadow_reg_enable: HW shadhow register bit 138 + * @no_idle_support: do not support idle mode 138 139 */ 139 140 struct iwl_base_params { 140 141 int eeprom_size; ··· 157 156 bool temperature_kelvin; 158 157 u32 max_event_log_size; 159 158 const bool shadow_reg_enable; 159 + const bool no_idle_support; 160 160 }; 161 161 /* 162 162 * @advanced_bt_coexist: support advanced bt coexist
+9 -9
drivers/net/wireless/iwlwifi/iwl-pci.c
··· 134 134 static void iwl_pci_set_drv_data(struct iwl_bus *bus, void *drv_data) 135 135 { 136 136 bus->drv_data = drv_data; 137 + pci_set_drvdata(IWL_BUS_GET_PCI_DEV(bus), drv_data); 137 138 } 138 139 139 140 static void iwl_pci_get_hw_id(struct iwl_bus *bus, char buf[], ··· 455 454 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); 456 455 } 457 456 458 - pci_set_drvdata(pdev, bus); 459 - 460 457 bus->dev = &pdev->dev; 461 458 bus->irq = pdev->irq; 462 459 bus->ops = &pci_ops; ··· 493 494 494 495 static void __devexit iwl_pci_remove(struct pci_dev *pdev) 495 496 { 496 - struct iwl_bus *bus = pci_get_drvdata(pdev); 497 + struct iwl_priv *priv = pci_get_drvdata(pdev); 498 + void *bus_specific = priv->bus->bus_specific; 497 499 498 - iwl_remove(bus->drv_data); 500 + iwl_remove(priv); 499 501 500 - iwl_pci_down(bus); 502 + iwl_pci_down(bus_specific); 501 503 } 502 504 503 505 #ifdef CONFIG_PM ··· 506 506 static int iwl_pci_suspend(struct device *device) 507 507 { 508 508 struct pci_dev *pdev = to_pci_dev(device); 509 - struct iwl_bus *bus = pci_get_drvdata(pdev); 509 + struct iwl_priv *priv = pci_get_drvdata(pdev); 510 510 511 511 /* Before you put code here, think about WoWLAN. You cannot check here 512 512 * whether WoWLAN is enabled or not, and your code will run even if 513 513 * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx. 514 514 */ 515 515 516 - return iwl_suspend(bus->drv_data); 516 + return iwl_suspend(priv); 517 517 } 518 518 519 519 static int iwl_pci_resume(struct device *device) 520 520 { 521 521 struct pci_dev *pdev = to_pci_dev(device); 522 - struct iwl_bus *bus = pci_get_drvdata(pdev); 522 + struct iwl_priv *priv = pci_get_drvdata(pdev); 523 523 524 524 /* Before you put code here, think about WoWLAN. You cannot check here 525 525 * whether WoWLAN is enabled or not, and your code will run even if ··· 532 532 */ 533 533 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); 534 534 535 - return iwl_resume(bus->drv_data); 535 + return iwl_resume(priv); 536 536 } 537 537 538 538 static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume);
+2 -1
drivers/net/wireless/iwlwifi/iwl-power.c
··· 349 349 350 350 if (priv->wowlan) 351 351 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); 352 - else if (priv->hw->conf.flags & IEEE80211_CONF_IDLE) 352 + else if (!priv->cfg->base_params->no_idle_support && 353 + priv->hw->conf.flags & IEEE80211_CONF_IDLE) 353 354 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); 354 355 else if (iwl_tt_is_low_power_state(priv)) { 355 356 /* in thermal throttling low power state */
+1 -2
drivers/net/wireless/rt2x00/rt2800lib.c
··· 703 703 /* 704 704 * Add space for the TXWI in front of the skb. 705 705 */ 706 - skb_push(entry->skb, TXWI_DESC_SIZE); 707 - memset(entry->skb, 0, TXWI_DESC_SIZE); 706 + memset(skb_push(entry->skb, TXWI_DESC_SIZE), 0, TXWI_DESC_SIZE); 708 707 709 708 /* 710 709 * Register descriptor details in skb frame descriptor.
+2 -1
drivers/net/wireless/rt2x00/rt2x00lib.h
··· 355 355 return CIPHER_NONE; 356 356 } 357 357 358 - static inline void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, 358 + static inline void rt2x00crypto_create_tx_descriptor(struct rt2x00_dev *rt2x00dev, 359 + struct sk_buff *skb, 359 360 struct txentry_desc *txdesc) 360 361 { 361 362 }
+3 -2
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 113 113 * due to possible race conditions in mac80211. 114 114 */ 115 115 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 116 - goto exit_fail; 116 + goto exit_free_skb; 117 117 118 118 /* 119 119 * Use the ATIM queue if appropriate and present. ··· 127 127 ERROR(rt2x00dev, 128 128 "Attempt to send packet over invalid queue %d.\n" 129 129 "Please file bug report to %s.\n", qid, DRV_PROJECT); 130 - goto exit_fail; 130 + goto exit_free_skb; 131 131 } 132 132 133 133 /* ··· 159 159 160 160 exit_fail: 161 161 rt2x00queue_pause_queue(queue); 162 + exit_free_skb: 162 163 dev_kfree_skb_any(skb); 163 164 } 164 165 EXPORT_SYMBOL_GPL(rt2x00mac_tx);
+11 -9
drivers/net/wireless/rtlwifi/pci.c
··· 1696 1696 pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn); 1697 1697 pcipriv->ndis_adapter.funcnumber = PCI_FUNC(pdev->devfn); 1698 1698 1699 - /*find bridge info */ 1700 - pcipriv->ndis_adapter.pcibridge_vendorid = bridge_pdev->vendor; 1701 - for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) { 1702 - if (bridge_pdev->vendor == pcibridge_vendors[tmp]) { 1703 - pcipriv->ndis_adapter.pcibridge_vendor = tmp; 1704 - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1705 - ("Pci Bridge Vendor is found index: %d\n", 1706 - tmp)); 1707 - break; 1699 + if (bridge_pdev) { 1700 + /*find bridge info if available */ 1701 + pcipriv->ndis_adapter.pcibridge_vendorid = bridge_pdev->vendor; 1702 + for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) { 1703 + if (bridge_pdev->vendor == pcibridge_vendors[tmp]) { 1704 + pcipriv->ndis_adapter.pcibridge_vendor = tmp; 1705 + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1706 + ("Pci Bridge Vendor is found index:" 1707 + " %d\n", tmp)); 1708 + break; 1709 + } 1708 1710 } 1709 1711 } 1710 1712
+1 -1
net/wireless/nl80211.c
··· 3464 3464 tmp) { 3465 3465 enum ieee80211_band band = nla_type(attr); 3466 3466 3467 - if (band < 0 || band > IEEE80211_NUM_BANDS) { 3467 + if (band < 0 || band >= IEEE80211_NUM_BANDS) { 3468 3468 err = -EINVAL; 3469 3469 goto out_free; 3470 3470 }