diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
commit | fc05505b77f7900a1bb74fb3f3a4343dee4265a4 (patch) | |
tree | 6517919cb60bd9465078512cacbefd8c77f94b76 /drivers/net/wireless | |
parent | a2ab67fae1ab9226679495a8d260f4e6555efc5f (diff) | |
parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) |
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 into devel
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/airo.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/debug.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187.h | 57 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_rtl8225.c | 8 |
12 files changed, 113 insertions, 50 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index c36d3a3d655f..d73475739127 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -6501,7 +6501,10 @@ static int airo_get_encode(struct net_device *dev, | |||
6501 | 6501 | ||
6502 | /* Copy the key to the user buffer */ | 6502 | /* Copy the key to the user buffer */ |
6503 | dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); | 6503 | dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); |
6504 | memcpy(extra, buf, dwrq->length); | 6504 | if (dwrq->length != -1) |
6505 | memcpy(extra, buf, dwrq->length); | ||
6506 | else | ||
6507 | dwrq->length = 0; | ||
6505 | 6508 | ||
6506 | return 0; | 6509 | return 0; |
6507 | } | 6510 | } |
@@ -6659,7 +6662,10 @@ static int airo_get_encodeext(struct net_device *dev, | |||
6659 | 6662 | ||
6660 | /* Copy the key to the user buffer */ | 6663 | /* Copy the key to the user buffer */ |
6661 | ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); | 6664 | ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); |
6662 | memcpy(extra, buf, ext->key_len); | 6665 | if (ext->key_len != -1) |
6666 | memcpy(extra, buf, ext->key_len); | ||
6667 | else | ||
6668 | ext->key_len = 0; | ||
6663 | 6669 | ||
6664 | return 0; | 6670 | return 0; |
6665 | } | 6671 | } |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index a08bc8a4fb69..32df27a9c7a2 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -214,7 +214,7 @@ static struct pci_driver ath5k_pci_driver = { | |||
214 | * Prototypes - MAC 802.11 stack related functions | 214 | * Prototypes - MAC 802.11 stack related functions |
215 | */ | 215 | */ |
216 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); | 216 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
217 | static int ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel); | 217 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); |
218 | static int ath5k_reset_wake(struct ath5k_softc *sc); | 218 | static int ath5k_reset_wake(struct ath5k_softc *sc); |
219 | static int ath5k_start(struct ieee80211_hw *hw); | 219 | static int ath5k_start(struct ieee80211_hw *hw); |
220 | static void ath5k_stop(struct ieee80211_hw *hw); | 220 | static void ath5k_stop(struct ieee80211_hw *hw); |
@@ -1038,16 +1038,13 @@ ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) | |||
1038 | if (chan->center_freq != sc->curchan->center_freq || | 1038 | if (chan->center_freq != sc->curchan->center_freq || |
1039 | chan->hw_value != sc->curchan->hw_value) { | 1039 | chan->hw_value != sc->curchan->hw_value) { |
1040 | 1040 | ||
1041 | sc->curchan = chan; | ||
1042 | sc->curband = &sc->sbands[chan->band]; | ||
1043 | |||
1044 | /* | 1041 | /* |
1045 | * To switch channels clear any pending DMA operations; | 1042 | * To switch channels clear any pending DMA operations; |
1046 | * wait long enough for the RX fifo to drain, reset the | 1043 | * wait long enough for the RX fifo to drain, reset the |
1047 | * hardware at the new frequency, and then re-enable | 1044 | * hardware at the new frequency, and then re-enable |
1048 | * the relevant bits of the h/w. | 1045 | * the relevant bits of the h/w. |
1049 | */ | 1046 | */ |
1050 | return ath5k_reset(sc, true, true); | 1047 | return ath5k_reset(sc, chan); |
1051 | } | 1048 | } |
1052 | 1049 | ||
1053 | return 0; | 1050 | return 0; |
@@ -2314,7 +2311,7 @@ ath5k_init(struct ath5k_softc *sc) | |||
2314 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | | 2311 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | |
2315 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | | 2312 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | |
2316 | AR5K_INT_FATAL | AR5K_INT_GLOBAL; | 2313 | AR5K_INT_FATAL | AR5K_INT_GLOBAL; |
2317 | ret = ath5k_reset(sc, false, false); | 2314 | ret = ath5k_reset(sc, NULL); |
2318 | if (ret) | 2315 | if (ret) |
2319 | goto done; | 2316 | goto done; |
2320 | 2317 | ||
@@ -2599,18 +2596,25 @@ drop_packet: | |||
2599 | return NETDEV_TX_OK; | 2596 | return NETDEV_TX_OK; |
2600 | } | 2597 | } |
2601 | 2598 | ||
2599 | /* | ||
2600 | * Reset the hardware. If chan is not NULL, then also pause rx/tx | ||
2601 | * and change to the given channel. | ||
2602 | */ | ||
2602 | static int | 2603 | static int |
2603 | ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel) | 2604 | ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan) |
2604 | { | 2605 | { |
2605 | struct ath5k_hw *ah = sc->ah; | 2606 | struct ath5k_hw *ah = sc->ah; |
2606 | int ret; | 2607 | int ret; |
2607 | 2608 | ||
2608 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); | 2609 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); |
2609 | 2610 | ||
2610 | if (stop) { | 2611 | if (chan) { |
2611 | ath5k_hw_set_imr(ah, 0); | 2612 | ath5k_hw_set_imr(ah, 0); |
2612 | ath5k_txq_cleanup(sc); | 2613 | ath5k_txq_cleanup(sc); |
2613 | ath5k_rx_stop(sc); | 2614 | ath5k_rx_stop(sc); |
2615 | |||
2616 | sc->curchan = chan; | ||
2617 | sc->curband = &sc->sbands[chan->band]; | ||
2614 | } | 2618 | } |
2615 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true); | 2619 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true); |
2616 | if (ret) { | 2620 | if (ret) { |
@@ -2648,7 +2652,7 @@ ath5k_reset_wake(struct ath5k_softc *sc) | |||
2648 | { | 2652 | { |
2649 | int ret; | 2653 | int ret; |
2650 | 2654 | ||
2651 | ret = ath5k_reset(sc, true, true); | 2655 | ret = ath5k_reset(sc, sc->curchan); |
2652 | if (!ret) | 2656 | if (!ret) |
2653 | ieee80211_wake_queues(sc->hw); | 2657 | ieee80211_wake_queues(sc->hw); |
2654 | 2658 | ||
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 9770bb3d40f9..4904a07e4b59 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -424,7 +424,7 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc) | |||
424 | 424 | ||
425 | for (b = 0; b < IEEE80211_NUM_BANDS; b++) { | 425 | for (b = 0; b < IEEE80211_NUM_BANDS; b++) { |
426 | struct ieee80211_supported_band *band = &sc->sbands[b]; | 426 | struct ieee80211_supported_band *band = &sc->sbands[b]; |
427 | char bname[5]; | 427 | char bname[6]; |
428 | switch (band->band) { | 428 | switch (band->band) { |
429 | case IEEE80211_BAND_2GHZ: | 429 | case IEEE80211_BAND_2GHZ: |
430 | strcpy(bname, "2 GHz"); | 430 | strcpy(bname, "2 GHz"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index edfa5e149f71..bd438d8acf55 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -101,8 +101,8 @@ struct iwl_cfg iwl6000_2agn_cfg = { | |||
101 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 101 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
102 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 102 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
103 | .mod_params = &iwl50_mod_params, | 103 | .mod_params = &iwl50_mod_params, |
104 | .valid_tx_ant = ANT_BC, | 104 | .valid_tx_ant = ANT_AB, |
105 | .valid_rx_ant = ANT_BC, | 105 | .valid_rx_ant = ANT_AB, |
106 | .need_pll_cfg = false, | 106 | .need_pll_cfg = false, |
107 | }; | 107 | }; |
108 | 108 | ||
@@ -117,8 +117,8 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
117 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 117 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
118 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 118 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
119 | .mod_params = &iwl50_mod_params, | 119 | .mod_params = &iwl50_mod_params, |
120 | .valid_tx_ant = ANT_BC, | 120 | .valid_tx_ant = ANT_AB, |
121 | .valid_rx_ant = ANT_BC, | 121 | .valid_rx_ant = ANT_AB, |
122 | .need_pll_cfg = false, | 122 | .need_pll_cfg = false, |
123 | }; | 123 | }; |
124 | 124 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 1ef4192207a5..3bb28db4a40f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3636,7 +3636,9 @@ static struct pci_device_id iwl_hw_card_ids[] = { | |||
3636 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, | 3636 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, |
3637 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, | 3637 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, |
3638 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3638 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3639 | {IWL_PCI_DEVICE(0x422C, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3639 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3640 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3641 | {IWL_PCI_DEVICE(0x4239, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3640 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, | 3642 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, |
3641 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3643 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3642 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, | 3644 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 23644cf884f1..e7c65c4f741b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -925,11 +925,11 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
925 | 925 | ||
926 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); | 926 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); |
927 | 927 | ||
928 | ieee80211_scan_completed(priv->hw, false); | ||
929 | |||
928 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 930 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
929 | return; | 931 | return; |
930 | 932 | ||
931 | ieee80211_scan_completed(priv->hw, false); | ||
932 | |||
933 | /* Since setting the TXPOWER may have been deferred while | 933 | /* Since setting the TXPOWER may have been deferred while |
934 | * performing the scan, fire one off */ | 934 | * performing the scan, fire one off */ |
935 | mutex_lock(&priv->mutex); | 935 | mutex_lock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 5798fe49c771..44ab03a12e40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
719 | { | 719 | { |
720 | unsigned long flags; | 720 | unsigned long flags; |
721 | int ret = 0; | 721 | int ret = 0; |
722 | __le16 key_flags = 0; | ||
723 | |||
724 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | ||
725 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | ||
726 | key_flags &= ~STA_KEY_FLG_INVALID; | ||
727 | |||
728 | if (sta_id == priv->hw_params.bcast_sta_id) | ||
729 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
722 | 730 | ||
723 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 731 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
724 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | 732 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; |
@@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
738 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | 746 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, |
739 | "no space for a new key"); | 747 | "no space for a new key"); |
740 | 748 | ||
749 | priv->stations[sta_id].sta.key.key_flags = key_flags; | ||
750 | |||
751 | |||
741 | /* This copy is acutally not needed: we get the key with each TX */ | 752 | /* This copy is acutally not needed: we get the key with each TX */ |
742 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); | 753 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); |
743 | 754 | ||
@@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv, | |||
754 | { | 765 | { |
755 | u8 sta_id = IWL_INVALID_STATION; | 766 | u8 sta_id = IWL_INVALID_STATION; |
756 | unsigned long flags; | 767 | unsigned long flags; |
757 | __le16 key_flags = 0; | ||
758 | int i; | 768 | int i; |
759 | DECLARE_MAC_BUF(mac); | ||
760 | 769 | ||
761 | sta_id = iwl_find_station(priv, addr); | 770 | sta_id = iwl_find_station(priv, addr); |
762 | if (sta_id == IWL_INVALID_STATION) { | 771 | if (sta_id == IWL_INVALID_STATION) { |
@@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv, | |||
771 | return; | 780 | return; |
772 | } | 781 | } |
773 | 782 | ||
774 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | ||
775 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | ||
776 | key_flags &= ~STA_KEY_FLG_INVALID; | ||
777 | |||
778 | if (sta_id == priv->hw_params.bcast_sta_id) | ||
779 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
780 | |||
781 | spin_lock_irqsave(&priv->sta_lock, flags); | 783 | spin_lock_irqsave(&priv->sta_lock, flags); |
782 | 784 | ||
783 | priv->stations[sta_id].sta.key.key_flags = key_flags; | ||
784 | priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; | 785 | priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; |
785 | 786 | ||
786 | for (i = 0; i < 5; i++) | 787 | for (i = 0; i < 5; i++) |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 617c4235d971..4cce66133500 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1694,7 +1694,6 @@ void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
1694 | rxq->free_count = 0; | 1694 | rxq->free_count = 0; |
1695 | spin_unlock_irqrestore(&rxq->lock, flags); | 1695 | spin_unlock_irqrestore(&rxq->lock, flags); |
1696 | } | 1696 | } |
1697 | EXPORT_SYMBOL(iwl3945_rx_queue_reset); | ||
1698 | 1697 | ||
1699 | /* | 1698 | /* |
1700 | * this should be called while priv->lock is locked | 1699 | * this should be called while priv->lock is locked |
@@ -1745,7 +1744,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx | |||
1745 | rxq->bd = NULL; | 1744 | rxq->bd = NULL; |
1746 | rxq->rb_stts = NULL; | 1745 | rxq->rb_stts = NULL; |
1747 | } | 1746 | } |
1748 | EXPORT_SYMBOL(iwl3945_rx_queue_free); | ||
1749 | 1747 | ||
1750 | 1748 | ||
1751 | /* Convert linear signal-to-noise ratio into dB */ | 1749 | /* Convert linear signal-to-noise ratio into dB */ |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index db91db776508..bebf735cd4bd 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -2558,6 +2558,11 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf) | |||
2558 | mutex_init(&priv->command_lock); | 2558 | mutex_init(&priv->command_lock); |
2559 | spin_lock_init(&priv->stats_lock); | 2559 | spin_lock_init(&priv->stats_lock); |
2560 | 2560 | ||
2561 | /* because rndis_command() sleeps we need to use workqueue */ | ||
2562 | priv->workqueue = create_singlethread_workqueue("rndis_wlan"); | ||
2563 | INIT_WORK(&priv->work, rndis_wext_worker); | ||
2564 | INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats); | ||
2565 | |||
2561 | /* try bind rndis_host */ | 2566 | /* try bind rndis_host */ |
2562 | retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); | 2567 | retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); |
2563 | if (retval < 0) | 2568 | if (retval < 0) |
@@ -2603,16 +2608,17 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf) | |||
2603 | disassociate(usbdev, 1); | 2608 | disassociate(usbdev, 1); |
2604 | netif_carrier_off(usbdev->net); | 2609 | netif_carrier_off(usbdev->net); |
2605 | 2610 | ||
2606 | /* because rndis_command() sleeps we need to use workqueue */ | ||
2607 | priv->workqueue = create_singlethread_workqueue("rndis_wlan"); | ||
2608 | INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats); | ||
2609 | queue_delayed_work(priv->workqueue, &priv->stats_work, | 2611 | queue_delayed_work(priv->workqueue, &priv->stats_work, |
2610 | round_jiffies_relative(STATS_UPDATE_JIFFIES)); | 2612 | round_jiffies_relative(STATS_UPDATE_JIFFIES)); |
2611 | INIT_WORK(&priv->work, rndis_wext_worker); | ||
2612 | 2613 | ||
2613 | return 0; | 2614 | return 0; |
2614 | 2615 | ||
2615 | fail: | 2616 | fail: |
2617 | cancel_delayed_work_sync(&priv->stats_work); | ||
2618 | cancel_work_sync(&priv->work); | ||
2619 | flush_workqueue(priv->workqueue); | ||
2620 | destroy_workqueue(priv->workqueue); | ||
2621 | |||
2616 | kfree(priv); | 2622 | kfree(priv); |
2617 | return retval; | 2623 | return retval; |
2618 | } | 2624 | } |
diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h index 9718f61809cf..edeff82a4d06 100644 --- a/drivers/net/wireless/rtl818x/rtl8187.h +++ b/drivers/net/wireless/rtl818x/rtl8187.h | |||
@@ -120,6 +120,12 @@ struct rtl8187_priv { | |||
120 | __le64 buf; | 120 | __le64 buf; |
121 | struct sk_buff_head queue; | 121 | struct sk_buff_head queue; |
122 | } b_tx_status; /* This queue is used by both -b and non-b devices */ | 122 | } b_tx_status; /* This queue is used by both -b and non-b devices */ |
123 | struct mutex io_mutex; | ||
124 | union { | ||
125 | u8 bits8; | ||
126 | __le16 bits16; | ||
127 | __le32 bits32; | ||
128 | } *io_dmabuf; | ||
123 | }; | 129 | }; |
124 | 130 | ||
125 | void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); | 131 | void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); |
@@ -129,10 +135,14 @@ static inline u8 rtl818x_ioread8_idx(struct rtl8187_priv *priv, | |||
129 | { | 135 | { |
130 | u8 val; | 136 | u8 val; |
131 | 137 | ||
138 | mutex_lock(&priv->io_mutex); | ||
132 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 139 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
133 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 140 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
134 | (unsigned long)addr, idx & 0x03, &val, | 141 | (unsigned long)addr, idx & 0x03, |
135 | sizeof(val), HZ / 2); | 142 | &priv->io_dmabuf->bits8, sizeof(val), HZ / 2); |
143 | |||
144 | val = priv->io_dmabuf->bits8; | ||
145 | mutex_unlock(&priv->io_mutex); | ||
136 | 146 | ||
137 | return val; | 147 | return val; |
138 | } | 148 | } |
@@ -147,10 +157,14 @@ static inline u16 rtl818x_ioread16_idx(struct rtl8187_priv *priv, | |||
147 | { | 157 | { |
148 | __le16 val; | 158 | __le16 val; |
149 | 159 | ||
160 | mutex_lock(&priv->io_mutex); | ||
150 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 161 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
151 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 162 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
152 | (unsigned long)addr, idx & 0x03, &val, | 163 | (unsigned long)addr, idx & 0x03, |
153 | sizeof(val), HZ / 2); | 164 | &priv->io_dmabuf->bits16, sizeof(val), HZ / 2); |
165 | |||
166 | val = priv->io_dmabuf->bits16; | ||
167 | mutex_unlock(&priv->io_mutex); | ||
154 | 168 | ||
155 | return le16_to_cpu(val); | 169 | return le16_to_cpu(val); |
156 | } | 170 | } |
@@ -165,10 +179,14 @@ static inline u32 rtl818x_ioread32_idx(struct rtl8187_priv *priv, | |||
165 | { | 179 | { |
166 | __le32 val; | 180 | __le32 val; |
167 | 181 | ||
182 | mutex_lock(&priv->io_mutex); | ||
168 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 183 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
169 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 184 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
170 | (unsigned long)addr, idx & 0x03, &val, | 185 | (unsigned long)addr, idx & 0x03, |
171 | sizeof(val), HZ / 2); | 186 | &priv->io_dmabuf->bits32, sizeof(val), HZ / 2); |
187 | |||
188 | val = priv->io_dmabuf->bits32; | ||
189 | mutex_unlock(&priv->io_mutex); | ||
172 | 190 | ||
173 | return le32_to_cpu(val); | 191 | return le32_to_cpu(val); |
174 | } | 192 | } |
@@ -181,10 +199,15 @@ static inline u32 rtl818x_ioread32(struct rtl8187_priv *priv, __le32 *addr) | |||
181 | static inline void rtl818x_iowrite8_idx(struct rtl8187_priv *priv, | 199 | static inline void rtl818x_iowrite8_idx(struct rtl8187_priv *priv, |
182 | u8 *addr, u8 val, u8 idx) | 200 | u8 *addr, u8 val, u8 idx) |
183 | { | 201 | { |
202 | mutex_lock(&priv->io_mutex); | ||
203 | |||
204 | priv->io_dmabuf->bits8 = val; | ||
184 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 205 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
185 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 206 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
186 | (unsigned long)addr, idx & 0x03, &val, | 207 | (unsigned long)addr, idx & 0x03, |
187 | sizeof(val), HZ / 2); | 208 | &priv->io_dmabuf->bits8, sizeof(val), HZ / 2); |
209 | |||
210 | mutex_unlock(&priv->io_mutex); | ||
188 | } | 211 | } |
189 | 212 | ||
190 | static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) | 213 | static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) |
@@ -195,12 +218,15 @@ static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) | |||
195 | static inline void rtl818x_iowrite16_idx(struct rtl8187_priv *priv, | 218 | static inline void rtl818x_iowrite16_idx(struct rtl8187_priv *priv, |
196 | __le16 *addr, u16 val, u8 idx) | 219 | __le16 *addr, u16 val, u8 idx) |
197 | { | 220 | { |
198 | __le16 buf = cpu_to_le16(val); | 221 | mutex_lock(&priv->io_mutex); |
199 | 222 | ||
223 | priv->io_dmabuf->bits16 = cpu_to_le16(val); | ||
200 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 224 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
201 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 225 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
202 | (unsigned long)addr, idx & 0x03, &buf, sizeof(buf), | 226 | (unsigned long)addr, idx & 0x03, |
203 | HZ / 2); | 227 | &priv->io_dmabuf->bits16, sizeof(val), HZ / 2); |
228 | |||
229 | mutex_unlock(&priv->io_mutex); | ||
204 | } | 230 | } |
205 | 231 | ||
206 | static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, | 232 | static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, |
@@ -212,12 +238,15 @@ static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, | |||
212 | static inline void rtl818x_iowrite32_idx(struct rtl8187_priv *priv, | 238 | static inline void rtl818x_iowrite32_idx(struct rtl8187_priv *priv, |
213 | __le32 *addr, u32 val, u8 idx) | 239 | __le32 *addr, u32 val, u8 idx) |
214 | { | 240 | { |
215 | __le32 buf = cpu_to_le32(val); | 241 | mutex_lock(&priv->io_mutex); |
216 | 242 | ||
243 | priv->io_dmabuf->bits32 = cpu_to_le32(val); | ||
217 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 244 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
218 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 245 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
219 | (unsigned long)addr, idx & 0x03, &buf, sizeof(buf), | 246 | (unsigned long)addr, idx & 0x03, |
220 | HZ / 2); | 247 | &priv->io_dmabuf->bits32, sizeof(val), HZ / 2); |
248 | |||
249 | mutex_unlock(&priv->io_mutex); | ||
221 | } | 250 | } |
222 | 251 | ||
223 | static inline void rtl818x_iowrite32(struct rtl8187_priv *priv, __le32 *addr, | 252 | static inline void rtl818x_iowrite32(struct rtl8187_priv *priv, __le32 *addr, |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index fd81884b9c7d..bac6cfba6abd 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -1329,6 +1329,14 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1329 | priv = dev->priv; | 1329 | priv = dev->priv; |
1330 | priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); | 1330 | priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); |
1331 | 1331 | ||
1332 | /* allocate "DMA aware" buffer for register accesses */ | ||
1333 | priv->io_dmabuf = kmalloc(sizeof(*priv->io_dmabuf), GFP_KERNEL); | ||
1334 | if (!priv->io_dmabuf) { | ||
1335 | err = -ENOMEM; | ||
1336 | goto err_free_dev; | ||
1337 | } | ||
1338 | mutex_init(&priv->io_mutex); | ||
1339 | |||
1332 | SET_IEEE80211_DEV(dev, &intf->dev); | 1340 | SET_IEEE80211_DEV(dev, &intf->dev); |
1333 | usb_set_intfdata(intf, dev); | 1341 | usb_set_intfdata(intf, dev); |
1334 | priv->udev = udev; | 1342 | priv->udev = udev; |
@@ -1495,7 +1503,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1495 | err = ieee80211_register_hw(dev); | 1503 | err = ieee80211_register_hw(dev); |
1496 | if (err) { | 1504 | if (err) { |
1497 | printk(KERN_ERR "rtl8187: Cannot register device\n"); | 1505 | printk(KERN_ERR "rtl8187: Cannot register device\n"); |
1498 | goto err_free_dev; | 1506 | goto err_free_dmabuf; |
1499 | } | 1507 | } |
1500 | mutex_init(&priv->conf_mutex); | 1508 | mutex_init(&priv->conf_mutex); |
1501 | skb_queue_head_init(&priv->b_tx_status.queue); | 1509 | skb_queue_head_init(&priv->b_tx_status.queue); |
@@ -1506,6 +1514,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1506 | 1514 | ||
1507 | return 0; | 1515 | return 0; |
1508 | 1516 | ||
1517 | err_free_dmabuf: | ||
1518 | kfree(priv->io_dmabuf); | ||
1509 | err_free_dev: | 1519 | err_free_dev: |
1510 | ieee80211_free_hw(dev); | 1520 | ieee80211_free_hw(dev); |
1511 | usb_set_intfdata(intf, NULL); | 1521 | usb_set_intfdata(intf, NULL); |
@@ -1526,6 +1536,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1526 | priv = dev->priv; | 1536 | priv = dev->priv; |
1527 | usb_reset_device(priv->udev); | 1537 | usb_reset_device(priv->udev); |
1528 | usb_put_dev(interface_to_usbdev(intf)); | 1538 | usb_put_dev(interface_to_usbdev(intf)); |
1539 | kfree(priv->io_dmabuf); | ||
1529 | ieee80211_free_hw(dev); | 1540 | ieee80211_free_hw(dev); |
1530 | } | 1541 | } |
1531 | 1542 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c index 78df281b297a..a09819386a1e 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c +++ b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c | |||
@@ -88,9 +88,15 @@ static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data) | |||
88 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); | 88 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); |
89 | udelay(10); | 89 | udelay(10); |
90 | 90 | ||
91 | mutex_lock(&priv->io_mutex); | ||
92 | |||
93 | priv->io_dmabuf->bits16 = data; | ||
91 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 94 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
92 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 95 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
93 | addr, 0x8225, &data, sizeof(data), HZ / 2); | 96 | addr, 0x8225, &priv->io_dmabuf->bits16, sizeof(data), |
97 | HZ / 2); | ||
98 | |||
99 | mutex_unlock(&priv->io_mutex); | ||
94 | 100 | ||
95 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); | 101 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); |
96 | udelay(10); | 102 | udelay(10); |