aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-16 20:01:24 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-16 20:01:24 -0400
commitc127bdf9f6c8a8aaa531321721b29ab15f250a72 (patch)
tree1799546ce128e5425002ea9a0893cf86a2747490
parent4e36a95e591e9c58dd10bb4103c00993917c27fd (diff)
parentbbac31f4c0339f6c51afbd0edfb4959df9b53fa9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
-rw-r--r--drivers/net/wireless/Kconfig1
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c6
-rw-r--r--drivers/net/wireless/b43/main.c8
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c24
-rw-r--r--drivers/net/wireless/p54/p54usb.c1
-rw-r--r--drivers/ssb/pci.c1
-rw-r--r--drivers/ssb/sdio.c6
-rw-r--r--net/mac80211/rc80211_minstrel.c2
-rw-r--r--net/wireless/scan.c7
-rw-r--r--net/wireless/sme.c21
17 files changed, 88 insertions, 42 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index ad89d23968df..49ea9c92b7e6 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -5,6 +5,7 @@
5menuconfig WLAN 5menuconfig WLAN
6 bool "Wireless LAN" 6 bool "Wireless LAN"
7 depends on !S390 7 depends on !S390
8 default y
8 ---help--- 9 ---help---
9 This section contains all the pre 802.11 and 802.11 wireless 10 This section contains all the pre 802.11 and 802.11 wireless
10 device drivers. For a complete list of drivers and documentation 11 device drivers. For a complete list of drivers and documentation
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index a7cbb07988cf..2b493742ef10 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -327,7 +327,8 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
327 aniState->firstepLevel + 1); 327 aniState->firstepLevel + 1);
328 return; 328 return;
329 } else { 329 } else {
330 if (conf->channel->band == IEEE80211_BAND_2GHZ) { 330 if ((conf->channel->band == IEEE80211_BAND_2GHZ) &&
331 !conf_is_ht(conf)) {
331 if (!aniState->ofdmWeakSigDetectOff) 332 if (!aniState->ofdmWeakSigDetectOff)
332 ath9k_hw_ani_control(ah, 333 ath9k_hw_ani_control(ah,
333 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 334 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
@@ -369,7 +370,8 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
369 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 370 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL,
370 aniState->firstepLevel + 1); 371 aniState->firstepLevel + 1);
371 } else { 372 } else {
372 if (conf->channel->band == IEEE80211_BAND_2GHZ) { 373 if ((conf->channel->band == IEEE80211_BAND_2GHZ) &&
374 !conf_is_ht(conf)) {
373 if (aniState->firstepLevel > 0) 375 if (aniState->firstepLevel > 0)
374 ath9k_hw_ani_control(ah, 376 ath9k_hw_ani_control(ah,
375 ATH9K_ANI_FIRSTEP_LEVEL, 0); 377 ATH9K_ANI_FIRSTEP_LEVEL, 0);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 7a9a3fa55425..e789792a36bc 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2289,11 +2289,7 @@ static int b43_upload_microcode(struct b43_wldev *dev)
2289 err = -ENODEV; 2289 err = -ENODEV;
2290 goto error; 2290 goto error;
2291 } 2291 }
2292 msleep_interruptible(50); 2292 msleep(50);
2293 if (signal_pending(current)) {
2294 err = -EINTR;
2295 goto error;
2296 }
2297 } 2293 }
2298 b43_read32(dev, B43_MMIO_GEN_IRQ_REASON); /* dummy read */ 2294 b43_read32(dev, B43_MMIO_GEN_IRQ_REASON); /* dummy read */
2299 2295
@@ -4287,6 +4283,8 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4287 if (!dev->suspend_in_progress) 4283 if (!dev->suspend_in_progress)
4288 b43_rng_init(wl); 4284 b43_rng_init(wl);
4289 4285
4286 ieee80211_wake_queues(dev->wl->hw);
4287
4290 b43_set_status(dev, B43_STAT_INITIALIZED); 4288 b43_set_status(dev, B43_STAT_INITIALIZED);
4291 4289
4292 if (!dev->suspend_in_progress) 4290 if (!dev->suspend_in_progress)
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 6fe122f18c0d..eb57d1ea361f 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -875,15 +875,16 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
875 875
876 switch(type) { 876 switch(type) {
877 case HOSTAP_INTERFACE_AP: 877 case HOSTAP_INTERFACE_AP:
878 dev->tx_queue_len = 0; /* use main radio device queue */
878 dev->netdev_ops = &hostap_mgmt_netdev_ops; 879 dev->netdev_ops = &hostap_mgmt_netdev_ops;
879 dev->type = ARPHRD_IEEE80211; 880 dev->type = ARPHRD_IEEE80211;
880 dev->header_ops = &hostap_80211_ops; 881 dev->header_ops = &hostap_80211_ops;
881 break; 882 break;
882 case HOSTAP_INTERFACE_MASTER: 883 case HOSTAP_INTERFACE_MASTER:
883 dev->tx_queue_len = 0; /* use main radio device queue */
884 dev->netdev_ops = &hostap_master_ops; 884 dev->netdev_ops = &hostap_master_ops;
885 break; 885 break;
886 default: 886 default:
887 dev->tx_queue_len = 0; /* use main radio device queue */
887 dev->netdev_ops = &hostap_netdev_ops; 888 dev->netdev_ops = &hostap_netdev_ops;
888 } 889 }
889 890
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 6a13bfbc9d98..ca61d3796cef 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2346,6 +2346,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
2346 .mod_params = &iwl4965_mod_params, 2346 .mod_params = &iwl4965_mod_params,
2347 .use_isr_legacy = true, 2347 .use_isr_legacy = true,
2348 .ht_greenfield_support = false, 2348 .ht_greenfield_support = false,
2349 .broken_powersave = true,
2349}; 2350};
2350 2351
2351/* Module firmware */ 2352/* Module firmware */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 40b207aa8fef..346dc06fa7b7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -760,6 +760,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
760 u16 high_low; 760 u16 high_low;
761 u8 switch_to_legacy = 0; 761 u8 switch_to_legacy = 0;
762 u8 is_green = lq_sta->is_green; 762 u8 is_green = lq_sta->is_green;
763 struct iwl_priv *priv = lq_sta->drv;
763 764
764 /* check if we need to switch from HT to legacy rates. 765 /* check if we need to switch from HT to legacy rates.
765 * assumption is that mandatory rates (1Mbps or 6Mbps) 766 * assumption is that mandatory rates (1Mbps or 6Mbps)
@@ -773,7 +774,8 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
773 tbl->lq_type = LQ_G; 774 tbl->lq_type = LQ_G;
774 775
775 if (num_of_ant(tbl->ant_type) > 1) 776 if (num_of_ant(tbl->ant_type) > 1)
776 tbl->ant_type = ANT_A;/*FIXME:RS*/ 777 tbl->ant_type =
778 first_antenna(priv->hw_params.valid_tx_ant);
777 779
778 tbl->is_ht40 = 0; 780 tbl->is_ht40 = 0;
779 tbl->is_SGI = 0; 781 tbl->is_SGI = 0;
@@ -883,6 +885,12 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
883 mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */ 885 mac_index &= RATE_MCS_CODE_MSK; /* Remove # of streams */
884 if (mac_index >= (IWL_RATE_9M_INDEX - IWL_FIRST_OFDM_RATE)) 886 if (mac_index >= (IWL_RATE_9M_INDEX - IWL_FIRST_OFDM_RATE))
885 mac_index++; 887 mac_index++;
888 /*
889 * mac80211 HT index is always zero-indexed; we need to move
890 * HT OFDM rates after CCK rates in 2.4 GHz band
891 */
892 if (priv->band == IEEE80211_BAND_2GHZ)
893 mac_index += IWL_FIRST_OFDM_RATE;
886 } 894 }
887 895
888 if ((mac_index < 0) || 896 if ((mac_index < 0) ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index acfd7b40afb8..fd26c0dc9c54 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1585,9 +1585,12 @@ int iwl_setup_mac(struct iwl_priv *priv)
1585 hw->flags = IEEE80211_HW_SIGNAL_DBM | 1585 hw->flags = IEEE80211_HW_SIGNAL_DBM |
1586 IEEE80211_HW_NOISE_DBM | 1586 IEEE80211_HW_NOISE_DBM |
1587 IEEE80211_HW_AMPDU_AGGREGATION | 1587 IEEE80211_HW_AMPDU_AGGREGATION |
1588 IEEE80211_HW_SPECTRUM_MGMT | 1588 IEEE80211_HW_SPECTRUM_MGMT;
1589 IEEE80211_HW_SUPPORTS_PS | 1589
1590 IEEE80211_HW_SUPPORTS_DYNAMIC_PS; 1590 if (!priv->cfg->broken_powersave)
1591 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
1592 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
1593
1591 hw->wiphy->interface_modes = 1594 hw->wiphy->interface_modes =
1592 BIT(NL80211_IFTYPE_STATION) | 1595 BIT(NL80211_IFTYPE_STATION) |
1593 BIT(NL80211_IFTYPE_ADHOC); 1596 BIT(NL80211_IFTYPE_ADHOC);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index c04d2a270819..7ff9ffb2b702 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -252,6 +252,7 @@ struct iwl_cfg {
252 const u16 max_ll_items; 252 const u16 max_ll_items;
253 const bool shadow_ram_support; 253 const bool shadow_ram_support;
254 const bool ht_greenfield_support; 254 const bool ht_greenfield_support;
255 const bool broken_powersave;
255}; 256};
256 257
257/*************************** 258/***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 4ec6a8307cc6..60be976afff8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -292,8 +292,9 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
292 else 292 else
293 dtimper = 1; 293 dtimper = 1;
294 294
295 /* TT power setting overwrites everything */ 295 if (priv->cfg->broken_powersave)
296 if (tt->state >= IWL_TI_1) 296 iwl_power_sleep_cam_cmd(priv, &cmd);
297 else if (tt->state >= IWL_TI_1)
297 iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper); 298 iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper);
298 else if (!enabled) 299 else if (!enabled)
299 iwl_power_sleep_cam_cmd(priv, &cmd); 300 iwl_power_sleep_cam_cmd(priv, &cmd);
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 8150c5c3a16b..b90adcb73b06 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -239,26 +239,22 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority)
239 struct iwl_rx_queue *rxq = &priv->rxq; 239 struct iwl_rx_queue *rxq = &priv->rxq;
240 struct list_head *element; 240 struct list_head *element;
241 struct iwl_rx_mem_buffer *rxb; 241 struct iwl_rx_mem_buffer *rxb;
242 struct sk_buff *skb;
242 unsigned long flags; 243 unsigned long flags;
243 244
244 while (1) { 245 while (1) {
245 spin_lock_irqsave(&rxq->lock, flags); 246 spin_lock_irqsave(&rxq->lock, flags);
246
247 if (list_empty(&rxq->rx_used)) { 247 if (list_empty(&rxq->rx_used)) {
248 spin_unlock_irqrestore(&rxq->lock, flags); 248 spin_unlock_irqrestore(&rxq->lock, flags);
249 return; 249 return;
250 } 250 }
251 element = rxq->rx_used.next;
252 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
253 list_del(element);
254
255 spin_unlock_irqrestore(&rxq->lock, flags); 251 spin_unlock_irqrestore(&rxq->lock, flags);
256 252
257 /* Alloc a new receive buffer */ 253 /* Alloc a new receive buffer */
258 rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256, 254 skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
259 priority); 255 priority);
260 256
261 if (!rxb->skb) { 257 if (!skb) {
262 IWL_CRIT(priv, "Can not allocate SKB buffers\n"); 258 IWL_CRIT(priv, "Can not allocate SKB buffers\n");
263 /* We don't reschedule replenish work here -- we will 259 /* We don't reschedule replenish work here -- we will
264 * call the restock method and if it still needs 260 * call the restock method and if it still needs
@@ -266,6 +262,20 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority)
266 break; 262 break;
267 } 263 }
268 264
265 spin_lock_irqsave(&rxq->lock, flags);
266
267 if (list_empty(&rxq->rx_used)) {
268 spin_unlock_irqrestore(&rxq->lock, flags);
269 dev_kfree_skb_any(skb);
270 return;
271 }
272 element = rxq->rx_used.next;
273 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
274 list_del(element);
275
276 spin_unlock_irqrestore(&rxq->lock, flags);
277
278 rxb->skb = skb;
269 /* Get physical address of RB/SKB */ 279 /* Get physical address of RB/SKB */
270 rxb->real_dma_addr = pci_map_single( 280 rxb->real_dma_addr = pci_map_single(
271 priv->pci_dev, 281 priv->pci_dev,
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 2238c9f2018c..090966837f3c 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1134,6 +1134,7 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1134 struct iwl_rx_queue *rxq = &priv->rxq; 1134 struct iwl_rx_queue *rxq = &priv->rxq;
1135 struct list_head *element; 1135 struct list_head *element;
1136 struct iwl_rx_mem_buffer *rxb; 1136 struct iwl_rx_mem_buffer *rxb;
1137 struct sk_buff *skb;
1137 unsigned long flags; 1138 unsigned long flags;
1138 1139
1139 while (1) { 1140 while (1) {
@@ -1143,17 +1144,11 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1143 spin_unlock_irqrestore(&rxq->lock, flags); 1144 spin_unlock_irqrestore(&rxq->lock, flags);
1144 return; 1145 return;
1145 } 1146 }
1146
1147 element = rxq->rx_used.next;
1148 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1149 list_del(element);
1150 spin_unlock_irqrestore(&rxq->lock, flags); 1147 spin_unlock_irqrestore(&rxq->lock, flags);
1151 1148
1152 /* Alloc a new receive buffer */ 1149 /* Alloc a new receive buffer */
1153 rxb->skb = 1150 skb = alloc_skb(priv->hw_params.rx_buf_size, priority);
1154 alloc_skb(priv->hw_params.rx_buf_size, 1151 if (!skb) {
1155 priority);
1156 if (!rxb->skb) {
1157 if (net_ratelimit()) 1152 if (net_ratelimit())
1158 IWL_CRIT(priv, ": Can not allocate SKB buffers\n"); 1153 IWL_CRIT(priv, ": Can not allocate SKB buffers\n");
1159 /* We don't reschedule replenish work here -- we will 1154 /* We don't reschedule replenish work here -- we will
@@ -1162,6 +1157,19 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1162 break; 1157 break;
1163 } 1158 }
1164 1159
1160 spin_lock_irqsave(&rxq->lock, flags);
1161 if (list_empty(&rxq->rx_used)) {
1162 spin_unlock_irqrestore(&rxq->lock, flags);
1163 dev_kfree_skb_any(skb);
1164 return;
1165 }
1166 element = rxq->rx_used.next;
1167 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1168 list_del(element);
1169 spin_unlock_irqrestore(&rxq->lock, flags);
1170
1171 rxb->skb = skb;
1172
1165 /* If radiotap head is required, reserve some headroom here. 1173 /* If radiotap head is required, reserve some headroom here.
1166 * The physical head count is a variable rx_stats->phy_count. 1174 * The physical head count is a variable rx_stats->phy_count.
1167 * We reserve 4 bytes here. Plus these extra bytes, the 1175 * We reserve 4 bytes here. Plus these extra bytes, the
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index e44460ff149c..17e199546eeb 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -67,6 +67,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
67 {USB_DEVICE(0x0bf8, 0x1009)}, /* FUJITSU E-5400 USB D1700*/ 67 {USB_DEVICE(0x0bf8, 0x1009)}, /* FUJITSU E-5400 USB D1700*/
68 {USB_DEVICE(0x0cde, 0x0006)}, /* Medion MD40900 */ 68 {USB_DEVICE(0x0cde, 0x0006)}, /* Medion MD40900 */
69 {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */ 69 {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */
70 {USB_DEVICE(0x0cde, 0x0015)}, /* Zcomax XG-705A */
70 {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */ 71 {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */
71 {USB_DEVICE(0x124a, 0x4025)}, /* IOGear GWU513 (GW3887IK chip) */ 72 {USB_DEVICE(0x124a, 0x4025)}, /* IOGear GWU513 (GW3887IK chip) */
72 {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */ 73 {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index f853d5600ca7..9e50896233aa 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -600,6 +600,7 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
600 ssb_printk(KERN_WARNING PFX "Unsupported SPROM" 600 ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
601 " revision %d detected. Will extract" 601 " revision %d detected. Will extract"
602 " v1\n", out->revision); 602 " v1\n", out->revision);
603 out->revision = 1;
603 sprom_extract_r123(out, in); 604 sprom_extract_r123(out, in);
604 } 605 }
605 } 606 }
diff --git a/drivers/ssb/sdio.c b/drivers/ssb/sdio.c
index 114051056b52..65a6080cb02a 100644
--- a/drivers/ssb/sdio.c
+++ b/drivers/ssb/sdio.c
@@ -21,7 +21,7 @@
21#include "ssb_private.h" 21#include "ssb_private.h"
22 22
23/* Define the following to 1 to enable a printk on each coreswitch. */ 23/* Define the following to 1 to enable a printk on each coreswitch. */
24#define SSB_VERBOSE_SDIOCORESWITCH_DEBUG 1 24#define SSB_VERBOSE_SDIOCORESWITCH_DEBUG 0
25 25
26 26
27/* Hardware invariants CIS tuples */ 27/* Hardware invariants CIS tuples */
@@ -333,7 +333,7 @@ static void ssb_sdio_block_read(struct ssb_device *dev, void *buffer,
333 goto out; 333 goto out;
334 334
335err_out: 335err_out:
336 dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%u), error %d\n", 336 dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%zu), error %d\n",
337 bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error); 337 bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error);
338out: 338out:
339 sdio_release_host(bus->host_sdio); 339 sdio_release_host(bus->host_sdio);
@@ -440,7 +440,7 @@ static void ssb_sdio_block_write(struct ssb_device *dev, const void *buffer,
440 goto out; 440 goto out;
441 441
442err_out: 442err_out:
443 dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%u), error %d\n", 443 dev_dbg(ssb_sdio_dev(bus), "%04X:%04X (width=%u, len=%zu), error %d\n",
444 bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error); 444 bus->sdio_sbaddr >> 16, offset, reg_width, saved_count, error);
445out: 445out:
446 sdio_release_host(bus->host_sdio); 446 sdio_release_host(bus->host_sdio);
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 7c5142988bbb..6e5d68b4e427 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -418,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
418 418
419 /* contention window */ 419 /* contention window */
420 tx_time_single += t_slot + min(cw, mp->cw_max); 420 tx_time_single += t_slot + min(cw, mp->cw_max);
421 cw = (cw + 1) << 1; 421 cw = (cw << 1) | 1;
422 422
423 tx_time += tx_time_single; 423 tx_time += tx_time_single;
424 tx_time_cts += tx_time_single + mi->sp_ack_dur; 424 tx_time_cts += tx_time_single + mi->sp_ack_dur;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 4c210c2debc6..e5f92ee758f4 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -662,7 +662,7 @@ int cfg80211_wext_siwscan(struct net_device *dev,
662 int k; 662 int k;
663 int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; 663 int wiphy_freq = wiphy->bands[band]->channels[j].center_freq;
664 for (k = 0; k < wreq->num_channels; k++) { 664 for (k = 0; k < wreq->num_channels; k++) {
665 int wext_freq = wreq->channel_list[k].m / 100000; 665 int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]);
666 if (wext_freq == wiphy_freq) 666 if (wext_freq == wiphy_freq)
667 goto wext_freq_found; 667 goto wext_freq_found;
668 } 668 }
@@ -675,6 +675,11 @@ int cfg80211_wext_siwscan(struct net_device *dev,
675 wext_freq_not_found: ; 675 wext_freq_not_found: ;
676 } 676 }
677 } 677 }
678 /* No channels found? */
679 if (!i) {
680 err = -EINVAL;
681 goto out;
682 }
678 683
679 /* Set real number of channels specified in creq->channels[] */ 684 /* Set real number of channels specified in creq->channels[] */
680 creq->n_channels = i; 685 creq->n_channels = i;
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 68307883ec87..7fae7eee65de 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -188,7 +188,7 @@ void cfg80211_conn_work(struct work_struct *work)
188 rtnl_unlock(); 188 rtnl_unlock();
189} 189}
190 190
191static bool cfg80211_get_conn_bss(struct wireless_dev *wdev) 191static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
192{ 192{
193 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 193 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
194 struct cfg80211_bss *bss; 194 struct cfg80211_bss *bss;
@@ -205,7 +205,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
205 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY, 205 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY,
206 capa); 206 capa);
207 if (!bss) 207 if (!bss)
208 return false; 208 return NULL;
209 209
210 memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN); 210 memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN);
211 wdev->conn->params.bssid = wdev->conn->bssid; 211 wdev->conn->params.bssid = wdev->conn->bssid;
@@ -213,14 +213,14 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
213 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 213 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
214 schedule_work(&rdev->conn_work); 214 schedule_work(&rdev->conn_work);
215 215
216 cfg80211_put_bss(bss); 216 return bss;
217 return true;
218} 217}
219 218
220static void __cfg80211_sme_scan_done(struct net_device *dev) 219static void __cfg80211_sme_scan_done(struct net_device *dev)
221{ 220{
222 struct wireless_dev *wdev = dev->ieee80211_ptr; 221 struct wireless_dev *wdev = dev->ieee80211_ptr;
223 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 222 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
223 struct cfg80211_bss *bss;
224 224
225 ASSERT_WDEV_LOCK(wdev); 225 ASSERT_WDEV_LOCK(wdev);
226 226
@@ -234,7 +234,10 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
234 wdev->conn->state != CFG80211_CONN_SCAN_AGAIN) 234 wdev->conn->state != CFG80211_CONN_SCAN_AGAIN)
235 return; 235 return;
236 236
237 if (!cfg80211_get_conn_bss(wdev)) { 237 bss = cfg80211_get_conn_bss(wdev);
238 if (bss) {
239 cfg80211_put_bss(bss);
240 } else {
238 /* not found */ 241 /* not found */
239 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN) 242 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
240 schedule_work(&rdev->conn_work); 243 schedule_work(&rdev->conn_work);
@@ -670,6 +673,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
670{ 673{
671 struct wireless_dev *wdev = dev->ieee80211_ptr; 674 struct wireless_dev *wdev = dev->ieee80211_ptr;
672 struct ieee80211_channel *chan; 675 struct ieee80211_channel *chan;
676 struct cfg80211_bss *bss = NULL;
673 int err; 677 int err;
674 678
675 ASSERT_WDEV_LOCK(wdev); 679 ASSERT_WDEV_LOCK(wdev);
@@ -760,7 +764,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
760 764
761 /* don't care about result -- but fill bssid & channel */ 765 /* don't care about result -- but fill bssid & channel */
762 if (!wdev->conn->params.bssid || !wdev->conn->params.channel) 766 if (!wdev->conn->params.bssid || !wdev->conn->params.channel)
763 cfg80211_get_conn_bss(wdev); 767 bss = cfg80211_get_conn_bss(wdev);
764 768
765 wdev->sme_state = CFG80211_SME_CONNECTING; 769 wdev->sme_state = CFG80211_SME_CONNECTING;
766 wdev->connect_keys = connkeys; 770 wdev->connect_keys = connkeys;
@@ -770,10 +774,11 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
770 wdev->conn->prev_bssid_valid = true; 774 wdev->conn->prev_bssid_valid = true;
771 } 775 }
772 776
773 /* we're good if we have both BSSID and channel */ 777 /* we're good if we have a matching bss struct */
774 if (wdev->conn->params.bssid && wdev->conn->params.channel) { 778 if (bss) {
775 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 779 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
776 err = cfg80211_conn_do_work(wdev); 780 err = cfg80211_conn_do_work(wdev);
781 cfg80211_put_bss(bss);
777 } else { 782 } else {
778 /* otherwise we'll need to scan for the AP first */ 783 /* otherwise we'll need to scan for the AP first */
779 err = cfg80211_conn_scan(wdev); 784 err = cfg80211_conn_scan(wdev);