aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-02-14 14:23:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-02-14 14:23:33 -0500
commitb90af3b8c69730fb25646c04866dfccec2f1314b (patch)
treefb4a7dd23f5d8b7803d89f1e3fb1ab075f1c06a0 /drivers
parent5171f7a0b79dfbc61a6e12f20f6eef6d7dd5b2a8 (diff)
parentd786f67e5c587a4de8245336cb64cf4dd06871a7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/iwlwifi/dvm/tx.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bcma/bcma_private.h5
-rw-r--r--drivers/bcma/driver_chipcommon_nflash.c2
-rw-r--r--drivers/bcma/driver_gpio.c5
-rw-r--r--drivers/bcma/main.c7
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c35
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h3
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c40
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/pub.h3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c17
-rw-r--r--drivers/net/wireless/mwifiex/scan.c9
-rw-r--r--drivers/net/wireless/mwl8k.c36
-rw-r--r--drivers/net/wireless/rtlwifi/base.c7
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c4
-rw-r--r--drivers/ssb/driver_gpio.c12
-rw-r--r--drivers/ssb/main.c9
-rw-r--r--drivers/ssb/ssb_private.h5
16 files changed, 116 insertions, 83 deletions
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 16c1dddfda00..9cb929dc3397 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -97,11 +97,16 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
97#ifdef CONFIG_BCMA_DRIVER_GPIO 97#ifdef CONFIG_BCMA_DRIVER_GPIO
98/* driver_gpio.c */ 98/* driver_gpio.c */
99int bcma_gpio_init(struct bcma_drv_cc *cc); 99int bcma_gpio_init(struct bcma_drv_cc *cc);
100int bcma_gpio_unregister(struct bcma_drv_cc *cc);
100#else 101#else
101static inline int bcma_gpio_init(struct bcma_drv_cc *cc) 102static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
102{ 103{
103 return -ENOTSUPP; 104 return -ENOTSUPP;
104} 105}
106static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc)
107{
108 return 0;
109}
105#endif /* CONFIG_BCMA_DRIVER_GPIO */ 110#endif /* CONFIG_BCMA_DRIVER_GPIO */
106 111
107#endif 112#endif
diff --git a/drivers/bcma/driver_chipcommon_nflash.c b/drivers/bcma/driver_chipcommon_nflash.c
index 19fafcf78840..d4f699aef8c4 100644
--- a/drivers/bcma/driver_chipcommon_nflash.c
+++ b/drivers/bcma/driver_chipcommon_nflash.c
@@ -21,7 +21,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc)
21 struct bcma_bus *bus = cc->core->bus; 21 struct bcma_bus *bus = cc->core->bus;
22 22
23 if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && 23 if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 &&
24 cc->core->id.rev != 0x38) { 24 cc->core->id.rev != 38) {
25 bcma_err(bus, "NAND flash on unsupported board!\n"); 25 bcma_err(bus, "NAND flash on unsupported board!\n");
26 return -ENOTSUPP; 26 return -ENOTSUPP;
27 } 27 }
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index 0b5df538dfd9..45f0996a3752 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -107,3 +107,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
107 107
108 return gpiochip_add(chip); 108 return gpiochip_add(chip);
109} 109}
110
111int bcma_gpio_unregister(struct bcma_drv_cc *cc)
112{
113 return gpiochip_remove(&cc->gpio);
114}
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 95ba5756c67e..360c41f2b509 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -276,6 +276,13 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
276void bcma_bus_unregister(struct bcma_bus *bus) 276void bcma_bus_unregister(struct bcma_bus *bus)
277{ 277{
278 struct bcma_device *cores[3]; 278 struct bcma_device *cores[3];
279 int err;
280
281 err = bcma_gpio_unregister(&bus->drv_cc);
282 if (err == -EBUSY)
283 bcma_err(bus, "Some GPIOs are still in use.\n");
284 else if (err)
285 bcma_err(bus, "Can not unregister GPIO driver: %i\n", err);
279 286
280 cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); 287 cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
281 cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); 288 cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index b1dd5600fd02..c6451c61407a 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -36,6 +36,7 @@
36#include "debug.h" 36#include "debug.h"
37 37
38#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ 38#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */
39#define BRCMS_FLUSH_TIMEOUT 500 /* msec */
39 40
40/* Flags we support */ 41/* Flags we support */
41#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ 42#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \
@@ -712,16 +713,29 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
712 wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); 713 wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
713} 714}
714 715
716static bool brcms_tx_flush_completed(struct brcms_info *wl)
717{
718 bool result;
719
720 spin_lock_bh(&wl->lock);
721 result = brcms_c_tx_flush_completed(wl->wlc);
722 spin_unlock_bh(&wl->lock);
723 return result;
724}
725
715static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) 726static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop)
716{ 727{
717 struct brcms_info *wl = hw->priv; 728 struct brcms_info *wl = hw->priv;
729 int ret;
718 730
719 no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); 731 no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
720 732
721 /* wait for packet queue and dma fifos to run empty */ 733 ret = wait_event_timeout(wl->tx_flush_wq,
722 spin_lock_bh(&wl->lock); 734 brcms_tx_flush_completed(wl),
723 brcms_c_wait_for_tx_completion(wl->wlc, drop); 735 msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT));
724 spin_unlock_bh(&wl->lock); 736
737 brcms_dbg_mac80211(wl->wlc->hw->d11core,
738 "ret=%d\n", jiffies_to_msecs(ret));
725} 739}
726 740
727static const struct ieee80211_ops brcms_ops = { 741static const struct ieee80211_ops brcms_ops = {
@@ -776,6 +790,7 @@ void brcms_dpc(unsigned long data)
776 790
777 done: 791 done:
778 spin_unlock_bh(&wl->lock); 792 spin_unlock_bh(&wl->lock);
793 wake_up(&wl->tx_flush_wq);
779} 794}
780 795
781/* 796/*
@@ -1024,6 +1039,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev)
1024 1039
1025 atomic_set(&wl->callbacks, 0); 1040 atomic_set(&wl->callbacks, 0);
1026 1041
1042 init_waitqueue_head(&wl->tx_flush_wq);
1043
1027 /* setup the bottom half handler */ 1044 /* setup the bottom half handler */
1028 tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); 1045 tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);
1029 1046
@@ -1613,13 +1630,3 @@ bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
1613 spin_lock_bh(&wl->lock); 1630 spin_lock_bh(&wl->lock);
1614 return blocked; 1631 return blocked;
1615} 1632}
1616
1617/*
1618 * precondition: perimeter lock has been acquired
1619 */
1620void brcms_msleep(struct brcms_info *wl, uint ms)
1621{
1622 spin_unlock_bh(&wl->lock);
1623 msleep(ms);
1624 spin_lock_bh(&wl->lock);
1625}
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
index 9358bd5ebd35..947ccacf43e6 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
@@ -68,6 +68,8 @@ struct brcms_info {
68 spinlock_t lock; /* per-device perimeter lock */ 68 spinlock_t lock; /* per-device perimeter lock */
69 spinlock_t isr_lock; /* per-device ISR synchronization lock */ 69 spinlock_t isr_lock; /* per-device ISR synchronization lock */
70 70
71 /* tx flush */
72 wait_queue_head_t tx_flush_wq;
71 73
72 /* timer related fields */ 74 /* timer related fields */
73 atomic_t callbacks; /* # outstanding callback functions */ 75 atomic_t callbacks; /* # outstanding callback functions */
@@ -100,7 +102,6 @@ extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
100extern void brcms_free_timer(struct brcms_timer *timer); 102extern void brcms_free_timer(struct brcms_timer *timer);
101extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); 103extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
102extern bool brcms_del_timer(struct brcms_timer *timer); 104extern bool brcms_del_timer(struct brcms_timer *timer);
103extern void brcms_msleep(struct brcms_info *wl, uint ms);
104extern void brcms_dpc(unsigned long data); 105extern void brcms_dpc(unsigned long data);
105extern void brcms_timer(struct brcms_timer *t); 106extern void brcms_timer(struct brcms_timer *t);
106extern void brcms_fatal_error(struct brcms_info *wl); 107extern void brcms_fatal_error(struct brcms_info *wl);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 0985925cd3f4..e80825e39c6e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -1025,7 +1025,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
1025static bool 1025static bool
1026brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) 1026brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1027{ 1027{
1028 bool morepending = false;
1029 struct bcma_device *core; 1028 struct bcma_device *core;
1030 struct tx_status txstatus, *txs; 1029 struct tx_status txstatus, *txs;
1031 u32 s1, s2; 1030 u32 s1, s2;
@@ -1039,23 +1038,20 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1039 txs = &txstatus; 1038 txs = &txstatus;
1040 core = wlc_hw->d11core; 1039 core = wlc_hw->d11core;
1041 *fatal = false; 1040 *fatal = false;
1042 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus));
1043 while (!(*fatal)
1044 && (s1 & TXS_V)) {
1045 /* !give others some time to run! */
1046 if (n >= max_tx_num) {
1047 morepending = true;
1048 break;
1049 }
1050 1041
1042 while (n < max_tx_num) {
1043 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus));
1051 if (s1 == 0xffffffff) { 1044 if (s1 == 0xffffffff) {
1052 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit, 1045 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
1053 __func__); 1046 __func__);
1054 *fatal = true; 1047 *fatal = true;
1055 return false; 1048 return false;
1056 } 1049 }
1057 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2)); 1050 /* only process when valid */
1051 if (!(s1 & TXS_V))
1052 break;
1058 1053
1054 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2));
1059 txs->status = s1 & TXS_STATUS_MASK; 1055 txs->status = s1 & TXS_STATUS_MASK;
1060 txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT; 1056 txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT;
1061 txs->sequence = s2 & TXS_SEQ_MASK; 1057 txs->sequence = s2 & TXS_SEQ_MASK;
@@ -1063,15 +1059,12 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1063 txs->lasttxtime = 0; 1059 txs->lasttxtime = 0;
1064 1060
1065 *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs); 1061 *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs);
1066 1062 if (*fatal == true)
1067 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus)); 1063 return false;
1068 n++; 1064 n++;
1069 } 1065 }
1070 1066
1071 if (*fatal) 1067 return n >= max_tx_num;
1072 return false;
1073
1074 return morepending;
1075} 1068}
1076 1069
1077static void brcms_c_tbtt(struct brcms_c_info *wlc) 1070static void brcms_c_tbtt(struct brcms_c_info *wlc)
@@ -7520,25 +7513,16 @@ int brcms_c_get_curband(struct brcms_c_info *wlc)
7520 return wlc->band->bandunit; 7513 return wlc->band->bandunit;
7521} 7514}
7522 7515
7523void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, bool drop) 7516bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc)
7524{ 7517{
7525 int timeout = 20;
7526 int i; 7518 int i;
7527 7519
7528 /* Kick DMA to send any pending AMPDU */ 7520 /* Kick DMA to send any pending AMPDU */
7529 for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++) 7521 for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++)
7530 if (wlc->hw->di[i]) 7522 if (wlc->hw->di[i])
7531 dma_txflush(wlc->hw->di[i]); 7523 dma_kick_tx(wlc->hw->di[i]);
7532
7533 /* wait for queue and DMA fifos to run dry */
7534 while (brcms_txpktpendtot(wlc) > 0) {
7535 brcms_msleep(wlc->wl, 1);
7536
7537 if (--timeout == 0)
7538 break;
7539 }
7540 7524
7541 WARN_ON_ONCE(timeout == 0); 7525 return !brcms_txpktpendtot(wlc);
7542} 7526}
7543 7527
7544void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval) 7528void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
index 4fb2834f4e64..b0f14b7b8616 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
@@ -314,8 +314,6 @@ extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
314extern void brcms_c_scan_start(struct brcms_c_info *wlc); 314extern void brcms_c_scan_start(struct brcms_c_info *wlc);
315extern void brcms_c_scan_stop(struct brcms_c_info *wlc); 315extern void brcms_c_scan_stop(struct brcms_c_info *wlc);
316extern int brcms_c_get_curband(struct brcms_c_info *wlc); 316extern int brcms_c_get_curband(struct brcms_c_info *wlc);
317extern void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc,
318 bool drop);
319extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel); 317extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
320extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl); 318extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
321extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc, 319extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
@@ -332,5 +330,6 @@ extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
332extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); 330extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
333extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); 331extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
334extern void brcms_c_mute(struct brcms_c_info *wlc, bool on); 332extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
333extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
335 334
336#endif /* _BRCM_PUB_H_ */ 335#endif /* _BRCM_PUB_H_ */
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index 4ece5ea81b86..d1dccb361391 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -1145,6 +1145,13 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
1145 next_reclaimed = ssn; 1145 next_reclaimed = ssn;
1146 } 1146 }
1147 1147
1148 if (tid != IWL_TID_NON_QOS) {
1149 priv->tid_data[sta_id][tid].next_reclaimed =
1150 next_reclaimed;
1151 IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n",
1152 next_reclaimed);
1153 }
1154
1148 iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); 1155 iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs);
1149 1156
1150 iwlagn_check_ratid_empty(priv, sta_id, tid); 1157 iwlagn_check_ratid_empty(priv, sta_id, tid);
@@ -1195,16 +1202,6 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
1195 if (!is_agg) 1202 if (!is_agg)
1196 iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1); 1203 iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1);
1197 1204
1198 /*
1199 * W/A for FW bug - the seq_ctl isn't updated when the
1200 * queues are flushed. Fetch it from the packet itself
1201 */
1202 if (!is_agg && status == TX_STATUS_FAIL_FIFO_FLUSHED) {
1203 next_reclaimed = le16_to_cpu(hdr->seq_ctrl);
1204 next_reclaimed =
1205 SEQ_TO_SN(next_reclaimed + 0x10);
1206 }
1207
1208 is_offchannel_skb = 1205 is_offchannel_skb =
1209 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN); 1206 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN);
1210 freed++; 1207 freed++;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 232492487527..949234fcf8c6 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1563,7 +1563,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1563 dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", 1563 dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n",
1564 scan_rsp->number_of_sets); 1564 scan_rsp->number_of_sets);
1565 ret = -1; 1565 ret = -1;
1566 goto done; 1566 goto check_next_scan;
1567 } 1567 }
1568 1568
1569 bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); 1569 bytes_left = le16_to_cpu(scan_rsp->bss_descript_size);
@@ -1634,7 +1634,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1634 if (!beacon_size || beacon_size > bytes_left) { 1634 if (!beacon_size || beacon_size > bytes_left) {
1635 bss_info += bytes_left; 1635 bss_info += bytes_left;
1636 bytes_left = 0; 1636 bytes_left = 0;
1637 return -1; 1637 ret = -1;
1638 goto check_next_scan;
1638 } 1639 }
1639 1640
1640 /* Initialize the current working beacon pointer for this BSS 1641 /* Initialize the current working beacon pointer for this BSS
@@ -1690,7 +1691,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1690 dev_err(priv->adapter->dev, 1691 dev_err(priv->adapter->dev,
1691 "%s: bytes left < IE length\n", 1692 "%s: bytes left < IE length\n",
1692 __func__); 1693 __func__);
1693 goto done; 1694 goto check_next_scan;
1694 } 1695 }
1695 if (element_id == WLAN_EID_DS_PARAMS) { 1696 if (element_id == WLAN_EID_DS_PARAMS) {
1696 channel = *(current_ptr + sizeof(struct ieee_types_header)); 1697 channel = *(current_ptr + sizeof(struct ieee_types_header));
@@ -1753,6 +1754,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1753 } 1754 }
1754 } 1755 }
1755 1756
1757check_next_scan:
1756 spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); 1758 spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
1757 if (list_empty(&adapter->scan_pending_q)) { 1759 if (list_empty(&adapter->scan_pending_q)) {
1758 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); 1760 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
@@ -1813,7 +1815,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1813 } 1815 }
1814 } 1816 }
1815 1817
1816done:
1817 return ret; 1818 return ret;
1818} 1819}
1819 1820
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 8186af4ed47b..091d9a64080a 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -334,20 +334,20 @@ struct mwl8k_sta {
334#define MWL8K_STA(_sta) ((struct mwl8k_sta *)&((_sta)->drv_priv)) 334#define MWL8K_STA(_sta) ((struct mwl8k_sta *)&((_sta)->drv_priv))
335 335
336static const struct ieee80211_channel mwl8k_channels_24[] = { 336static const struct ieee80211_channel mwl8k_channels_24[] = {
337 { .center_freq = 2412, .hw_value = 1, }, 337 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, },
338 { .center_freq = 2417, .hw_value = 2, }, 338 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, },
339 { .center_freq = 2422, .hw_value = 3, }, 339 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, },
340 { .center_freq = 2427, .hw_value = 4, }, 340 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, },
341 { .center_freq = 2432, .hw_value = 5, }, 341 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, },
342 { .center_freq = 2437, .hw_value = 6, }, 342 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, },
343 { .center_freq = 2442, .hw_value = 7, }, 343 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, },
344 { .center_freq = 2447, .hw_value = 8, }, 344 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, },
345 { .center_freq = 2452, .hw_value = 9, }, 345 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, },
346 { .center_freq = 2457, .hw_value = 10, }, 346 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, },
347 { .center_freq = 2462, .hw_value = 11, }, 347 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, },
348 { .center_freq = 2467, .hw_value = 12, }, 348 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, },
349 { .center_freq = 2472, .hw_value = 13, }, 349 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, },
350 { .center_freq = 2484, .hw_value = 14, }, 350 { .band = IEEE80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, },
351}; 351};
352 352
353static const struct ieee80211_rate mwl8k_rates_24[] = { 353static const struct ieee80211_rate mwl8k_rates_24[] = {
@@ -368,10 +368,10 @@ static const struct ieee80211_rate mwl8k_rates_24[] = {
368}; 368};
369 369
370static const struct ieee80211_channel mwl8k_channels_50[] = { 370static const struct ieee80211_channel mwl8k_channels_50[] = {
371 { .center_freq = 5180, .hw_value = 36, }, 371 { .band = IEEE80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, },
372 { .center_freq = 5200, .hw_value = 40, }, 372 { .band = IEEE80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, },
373 { .center_freq = 5220, .hw_value = 44, }, 373 { .band = IEEE80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, },
374 { .center_freq = 5240, .hw_value = 48, }, 374 { .band = IEEE80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, },
375}; 375};
376 376
377static const struct ieee80211_rate mwl8k_rates_50[] = { 377static const struct ieee80211_rate mwl8k_rates_50[] = {
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 4494d130b37c..0f8b05185eda 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1004,7 +1004,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
1004 is_tx ? "Tx" : "Rx"); 1004 is_tx ? "Tx" : "Rx");
1005 1005
1006 if (is_tx) { 1006 if (is_tx) {
1007 rtl_lps_leave(hw); 1007 schedule_work(&rtlpriv->
1008 works.lps_leave_work);
1008 ppsc->last_delaylps_stamp_jiffies = 1009 ppsc->last_delaylps_stamp_jiffies =
1009 jiffies; 1010 jiffies;
1010 } 1011 }
@@ -1014,7 +1015,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
1014 } 1015 }
1015 } else if (ETH_P_ARP == ether_type) { 1016 } else if (ETH_P_ARP == ether_type) {
1016 if (is_tx) { 1017 if (is_tx) {
1017 rtl_lps_leave(hw); 1018 schedule_work(&rtlpriv->works.lps_leave_work);
1018 ppsc->last_delaylps_stamp_jiffies = jiffies; 1019 ppsc->last_delaylps_stamp_jiffies = jiffies;
1019 } 1020 }
1020 1021
@@ -1024,7 +1025,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
1024 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx"); 1025 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
1025 1026
1026 if (is_tx) { 1027 if (is_tx) {
1027 rtl_lps_leave(hw); 1028 schedule_work(&rtlpriv->works.lps_leave_work);
1028 ppsc->last_delaylps_stamp_jiffies = jiffies; 1029 ppsc->last_delaylps_stamp_jiffies = jiffies;
1029 } 1030 }
1030 1031
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 80730c72e0d6..476eaef5e4a9 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -542,8 +542,8 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb)
542 WARN_ON(skb_queue_empty(&rx_queue)); 542 WARN_ON(skb_queue_empty(&rx_queue));
543 while (!skb_queue_empty(&rx_queue)) { 543 while (!skb_queue_empty(&rx_queue)) {
544 _skb = skb_dequeue(&rx_queue); 544 _skb = skb_dequeue(&rx_queue);
545 _rtl_usb_rx_process_agg(hw, skb); 545 _rtl_usb_rx_process_agg(hw, _skb);
546 ieee80211_rx_irqsafe(hw, skb); 546 ieee80211_rx_irqsafe(hw, _skb);
547 } 547 }
548} 548}
549 549
diff --git a/drivers/ssb/driver_gpio.c b/drivers/ssb/driver_gpio.c
index accabe39b320..dc109de228c6 100644
--- a/drivers/ssb/driver_gpio.c
+++ b/drivers/ssb/driver_gpio.c
@@ -196,3 +196,15 @@ int ssb_gpio_init(struct ssb_bus *bus)
196 196
197 return -1; 197 return -1;
198} 198}
199
200int ssb_gpio_unregister(struct ssb_bus *bus)
201{
202 if (ssb_chipco_available(&bus->chipco) ||
203 ssb_extif_available(&bus->extif)) {
204 return gpiochip_remove(&bus->gpio);
205 } else {
206 SSB_WARN_ON(1);
207 }
208
209 return -1;
210}
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index db7705743a8f..4be144a99e03 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -443,6 +443,15 @@ static void ssb_devices_unregister(struct ssb_bus *bus)
443 443
444void ssb_bus_unregister(struct ssb_bus *bus) 444void ssb_bus_unregister(struct ssb_bus *bus)
445{ 445{
446 int err;
447
448 err = ssb_gpio_unregister(bus);
449 if (err == -EBUSY)
450 ssb_dprintk(KERN_ERR PFX "Some GPIOs are still in use.\n");
451 else if (err)
452 ssb_dprintk(KERN_ERR PFX
453 "Can not unregister GPIO driver: %i\n", err);
454
446 ssb_buses_lock(); 455 ssb_buses_lock();
447 ssb_devices_unregister(bus); 456 ssb_devices_unregister(bus);
448 list_del(&bus->list); 457 list_del(&bus->list);
diff --git a/drivers/ssb/ssb_private.h b/drivers/ssb/ssb_private.h
index 53198dcec90e..466171b77f68 100644
--- a/drivers/ssb/ssb_private.h
+++ b/drivers/ssb/ssb_private.h
@@ -267,11 +267,16 @@ static inline void ssb_extif_init(struct ssb_extif *extif)
267 267
268#ifdef CONFIG_SSB_DRIVER_GPIO 268#ifdef CONFIG_SSB_DRIVER_GPIO
269extern int ssb_gpio_init(struct ssb_bus *bus); 269extern int ssb_gpio_init(struct ssb_bus *bus);
270extern int ssb_gpio_unregister(struct ssb_bus *bus);
270#else /* CONFIG_SSB_DRIVER_GPIO */ 271#else /* CONFIG_SSB_DRIVER_GPIO */
271static inline int ssb_gpio_init(struct ssb_bus *bus) 272static inline int ssb_gpio_init(struct ssb_bus *bus)
272{ 273{
273 return -ENOTSUPP; 274 return -ENOTSUPP;
274} 275}
276static inline int ssb_gpio_unregister(struct ssb_bus *bus)
277{
278 return 0;
279}
275#endif /* CONFIG_SSB_DRIVER_GPIO */ 280#endif /* CONFIG_SSB_DRIVER_GPIO */
276 281
277#endif /* LINUX_SSB_PRIVATE_H_ */ 282#endif /* LINUX_SSB_PRIVATE_H_ */