aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 23:35:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 23:35:20 -0400
commit9abbf7d028b1598b40ebdc81c48f30da7f3d5bf5 (patch)
tree61a56ec39f4b7d438d7e08fc3f32d636828d9f7a /drivers/net/wireless
parentb3d9d6be035a7d1cc6740cee695301bf37caedcd (diff)
parentfe2520094d88018423dfc42b3cd0015f74e8adea (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (21 commits) Fix build break in tsi108.c qeth: remove header_ops bug ir-functions.c:(.text+0xbce18): undefined reference to `input_event' NAPI: kconfig prompt and deleted doc file phy/bitbang: missing MODULE_LICENSE DM9000 initialization fix [PATCH] rt2x00: Add new rt73usb USB ID [PATCH] rt2x00: Fix residual check in PLCP calculations. [PATCH] iwlwifi: Fix rate setting in probe request for HW sacn [PATCH] b43: Make b43_stop() static [PATCH] drivers/net/wireless/b43/main.c: fix an uninitialized variable [PATCH] iwlwifi: set correct base rate for A band in rs_dbgfs_set_mcs [PATCH] zd1211rw, fix oops when ejecting install media [PATCH] b43legacy: Fix potential return of uninitialized variable [PATCH] iwl4965-base.c: fix off-by-one errors [PATCH] p54: Make filter configuration atomic [PATCH] rtl8187: remove NICMAC setting in configure_filters callback [PATCH] janitorial: fix all double includes in drivers/net/wireless [PATCH] rtl8187: Fix more frag bit checking, rts duration calc [PATCH] ipw2100: send WEXT scan events ...
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/ipw2100.c39
-rw-r--r--drivers/net/wireless/ipw2100.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c44
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c52
-rw-r--r--drivers/net/wireless/iwlwifi/iwlwifi.h7
-rw-r--r--drivers/net/wireless/p54common.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
-rw-r--r--drivers/net/wireless/rtl8187_dev.c35
-rw-r--r--drivers/net/wireless/zd1201.c4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c7
17 files changed, 137 insertions, 86 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c141a264ac45..9d9ff76a9bc6 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -49,7 +49,6 @@
49#include "pio.h" 49#include "pio.h"
50#include "sysfs.h" 50#include "sysfs.h"
51#include "xmit.h" 51#include "xmit.h"
52#include "sysfs.h"
53#include "lo.h" 52#include "lo.h"
54#include "pcmcia.h" 53#include "pcmcia.h"
55 54
@@ -3495,7 +3494,7 @@ static int b43_start(struct ieee80211_hw *hw)
3495 struct b43_wl *wl = hw_to_b43_wl(hw); 3494 struct b43_wl *wl = hw_to_b43_wl(hw);
3496 struct b43_wldev *dev = wl->current_dev; 3495 struct b43_wldev *dev = wl->current_dev;
3497 int did_init = 0; 3496 int did_init = 0;
3498 int err; 3497 int err = 0;
3499 3498
3500 mutex_lock(&wl->mutex); 3499 mutex_lock(&wl->mutex);
3501 3500
@@ -3521,7 +3520,7 @@ static int b43_start(struct ieee80211_hw *hw)
3521 return err; 3520 return err;
3522} 3521}
3523 3522
3524void b43_stop(struct ieee80211_hw *hw) 3523static void b43_stop(struct ieee80211_hw *hw)
3525{ 3524{
3526 struct b43_wl *wl = hw_to_b43_wl(hw); 3525 struct b43_wl *wl = hw_to_b43_wl(hw);
3527 struct b43_wldev *dev = wl->current_dev; 3526 struct b43_wldev *dev = wl->current_dev;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index f0749510bcd7..d09479e816cd 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3306,7 +3306,7 @@ static int b43legacy_start(struct ieee80211_hw *hw)
3306 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 3306 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3307 struct b43legacy_wldev *dev = wl->current_dev; 3307 struct b43legacy_wldev *dev = wl->current_dev;
3308 int did_init = 0; 3308 int did_init = 0;
3309 int err; 3309 int err = 0;
3310 3310
3311 mutex_lock(&wl->mutex); 3311 mutex_lock(&wl->mutex);
3312 3312
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index c144e3cdb890..7a7797560a23 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2089,12 +2089,46 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
2089 queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ)); 2089 queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
2090} 2090}
2091 2091
2092static void send_scan_event(void *data)
2093{
2094 struct ipw2100_priv *priv = data;
2095 union iwreq_data wrqu;
2096
2097 wrqu.data.length = 0;
2098 wrqu.data.flags = 0;
2099 wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
2100}
2101
2102static void ipw2100_scan_event_later(struct work_struct *work)
2103{
2104 send_scan_event(container_of(work, struct ipw2100_priv,
2105 scan_event_later.work));
2106}
2107
2108static void ipw2100_scan_event_now(struct work_struct *work)
2109{
2110 send_scan_event(container_of(work, struct ipw2100_priv,
2111 scan_event_now));
2112}
2113
2092static void isr_scan_complete(struct ipw2100_priv *priv, u32 status) 2114static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
2093{ 2115{
2094 IPW_DEBUG_SCAN("scan complete\n"); 2116 IPW_DEBUG_SCAN("scan complete\n");
2095 /* Age the scan results... */ 2117 /* Age the scan results... */
2096 priv->ieee->scans++; 2118 priv->ieee->scans++;
2097 priv->status &= ~STATUS_SCANNING; 2119 priv->status &= ~STATUS_SCANNING;
2120
2121 /* Only userspace-requested scan completion events go out immediately */
2122 if (!priv->user_requested_scan) {
2123 if (!delayed_work_pending(&priv->scan_event_later))
2124 queue_delayed_work(priv->workqueue,
2125 &priv->scan_event_later,
2126 round_jiffies(msecs_to_jiffies(4000)));
2127 } else {
2128 priv->user_requested_scan = 0;
2129 cancel_delayed_work(&priv->scan_event_later);
2130 queue_work(priv->workqueue, &priv->scan_event_now);
2131 }
2098} 2132}
2099 2133
2100#ifdef CONFIG_IPW2100_DEBUG 2134#ifdef CONFIG_IPW2100_DEBUG
@@ -4349,6 +4383,7 @@ static void ipw2100_kill_workqueue(struct ipw2100_priv *priv)
4349 cancel_delayed_work(&priv->wx_event_work); 4383 cancel_delayed_work(&priv->wx_event_work);
4350 cancel_delayed_work(&priv->hang_check); 4384 cancel_delayed_work(&priv->hang_check);
4351 cancel_delayed_work(&priv->rf_kill); 4385 cancel_delayed_work(&priv->rf_kill);
4386 cancel_delayed_work(&priv->scan_event_later);
4352 destroy_workqueue(priv->workqueue); 4387 destroy_workqueue(priv->workqueue);
4353 priv->workqueue = NULL; 4388 priv->workqueue = NULL;
4354 } 4389 }
@@ -6092,6 +6127,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6092 INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); 6127 INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
6093 INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); 6128 INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
6094 INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); 6129 INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
6130 INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
6131 INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);
6095 6132
6096 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) 6133 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
6097 ipw2100_irq_tasklet, (unsigned long)priv); 6134 ipw2100_irq_tasklet, (unsigned long)priv);
@@ -7396,6 +7433,8 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7396 } 7433 }
7397 7434
7398 IPW_DEBUG_WX("Initiating scan...\n"); 7435 IPW_DEBUG_WX("Initiating scan...\n");
7436
7437 priv->user_requested_scan = 1;
7399 if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) { 7438 if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
7400 IPW_DEBUG_WX("Start scan failed.\n"); 7439 IPW_DEBUG_WX("Start scan failed.\n");
7401 7440
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
index 2b8be2418fa7..bbf1ddcafba8 100644
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -586,6 +586,10 @@ struct ipw2100_priv {
586 struct delayed_work wx_event_work; 586 struct delayed_work wx_event_work;
587 struct delayed_work hang_check; 587 struct delayed_work hang_check;
588 struct delayed_work rf_kill; 588 struct delayed_work rf_kill;
589 struct work_struct scan_event_now;
590 struct delayed_work scan_event_later;
591
592 int user_requested_scan;
589 593
590 u32 interrupts; 594 u32 interrupts;
591 int tx_interrupts; 595 int tx_interrupts;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index f4aabcf480e4..262ab0b55824 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -37,9 +37,6 @@
37 37
38#include <linux/workqueue.h> 38#include <linux/workqueue.h>
39 39
40#include <net/mac80211.h>
41#include <linux/wireless.h>
42
43#define IWL 3945 40#define IWL 3945
44 41
45#include "../net/mac80211/ieee80211_rate.h" 42#include "../net/mac80211/ieee80211_rate.h"
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index acb38750535f..19bcb01e2784 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -38,7 +38,6 @@
38#include <net/mac80211.h> 38#include <net/mac80211.h>
39 39
40#include <linux/etherdevice.h> 40#include <linux/etherdevice.h>
41#include <linux/delay.h>
42 41
43#define IWL 3945 42#define IWL 3945
44 43
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 287c75705c44..8dc78c0bf1ff 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -36,9 +36,6 @@
36 36
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38 38
39#include <net/mac80211.h>
40#include <linux/wireless.h>
41
42#define IWL 4965 39#define IWL 4965
43 40
44#include "../net/mac80211/ieee80211_rate.h" 41#include "../net/mac80211/ieee80211_rate.h"
@@ -2024,12 +2021,18 @@ static int open_file_generic(struct inode *inode, struct file *file)
2024static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, 2021static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
2025 struct iwl_rate *mcs, int index) 2022 struct iwl_rate *mcs, int index)
2026{ 2023{
2027 const u32 cck_rate = 0x820A; 2024 u32 base_rate;
2025
2026 if (rs_priv->phymode == (u8) MODE_IEEE80211A)
2027 base_rate = 0x800D;
2028 else
2029 base_rate = 0x820A;
2030
2028 if (rs_priv->dbg_fixed.rate_n_flags) { 2031 if (rs_priv->dbg_fixed.rate_n_flags) {
2029 if (index < 12) 2032 if (index < 12)
2030 mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags; 2033 mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
2031 else 2034 else
2032 mcs->rate_n_flags = cck_rate; 2035 mcs->rate_n_flags = base_rate;
2033 IWL_DEBUG_RATE("Fixed rate ON\n"); 2036 IWL_DEBUG_RATE("Fixed rate ON\n");
2034 return; 2037 return;
2035 } 2038 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index b50d20267c8a..557deebca1b9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -35,9 +35,7 @@
35#include <linux/netdevice.h> 35#include <linux/netdevice.h>
36#include <linux/wireless.h> 36#include <linux/wireless.h>
37#include <net/mac80211.h> 37#include <net/mac80211.h>
38#include <linux/netdevice.h>
39#include <linux/etherdevice.h> 38#include <linux/etherdevice.h>
40#include <linux/delay.h>
41 39
42#define IWL 4965 40#define IWL 4965
43 41
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 75e3b5c3f155..83019d1d7ccc 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -48,8 +48,6 @@
48#include <linux/netdevice.h> 48#include <linux/netdevice.h>
49#include <linux/wireless.h> 49#include <linux/wireless.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51#include <linux/skbuff.h>
52#include <linux/netdevice.h>
53#include <linux/etherdevice.h> 51#include <linux/etherdevice.h>
54#include <linux/if_arp.h> 52#include <linux/if_arp.h>
55 53
@@ -1749,21 +1747,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
1749 * return : set the bit for each supported rate insert in ie 1747 * return : set the bit for each supported rate insert in ie
1750 */ 1748 */
1751static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate, 1749static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1752 u16 basic_rate, int max_count) 1750 u16 basic_rate, int *left)
1753{ 1751{
1754 u16 ret_rates = 0, bit; 1752 u16 ret_rates = 0, bit;
1755 int i; 1753 int i;
1756 u8 *rates; 1754 u8 *cnt = ie;
1757 1755 u8 *rates = ie + 1;
1758 rates = &(ie[1]);
1759 1756
1760 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) { 1757 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
1761 if (bit & supported_rate) { 1758 if (bit & supported_rate) {
1762 ret_rates |= bit; 1759 ret_rates |= bit;
1763 rates[*ie] = iwl_rates[i].ieee | 1760 rates[*cnt] = iwl_rates[i].ieee |
1764 ((bit & basic_rate) ? 0x80 : 0x00); 1761 ((bit & basic_rate) ? 0x80 : 0x00);
1765 *ie = *ie + 1; 1762 (*cnt)++;
1766 if (*ie >= max_count) 1763 (*left)--;
1764 if ((*left <= 0) ||
1765 (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
1767 break; 1766 break;
1768 } 1767 }
1769 } 1768 }
@@ -1780,7 +1779,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1780{ 1779{
1781 int len = 0; 1780 int len = 0;
1782 u8 *pos = NULL; 1781 u8 *pos = NULL;
1783 u16 ret_rates; 1782 u16 active_rates, ret_rates, cck_rates;
1784 1783
1785 /* Make sure there is enough space for the probe request, 1784 /* Make sure there is enough space for the probe request,
1786 * two mandatory IEs and the data */ 1785 * two mandatory IEs and the data */
@@ -1825,19 +1824,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1825 left -= 2; 1824 left -= 2;
1826 if (left < 0) 1825 if (left < 0)
1827 return 0; 1826 return 0;
1827
1828 /* ... fill it in... */ 1828 /* ... fill it in... */
1829 *pos++ = WLAN_EID_SUPP_RATES; 1829 *pos++ = WLAN_EID_SUPP_RATES;
1830 *pos = 0; 1830 *pos = 0;
1831 ret_rates = priv->active_rate = priv->rates_mask; 1831
1832 priv->active_rate = priv->rates_mask;
1833 active_rates = priv->active_rate;
1832 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; 1834 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
1833 1835
1834 iwl_supported_rate_to_ie(pos, priv->active_rate, 1836 cck_rates = IWL_CCK_RATES_MASK & active_rates;
1835 priv->active_rate_basic, left); 1837 ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
1838 priv->active_rate_basic, &left);
1839 active_rates &= ~ret_rates;
1840
1841 ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
1842 priv->active_rate_basic, &left);
1843 active_rates &= ~ret_rates;
1844
1836 len += 2 + *pos; 1845 len += 2 + *pos;
1837 pos += (*pos) + 1; 1846 pos += (*pos) + 1;
1838 ret_rates = ~ret_rates & priv->active_rate; 1847 if (active_rates == 0)
1839
1840 if (ret_rates == 0)
1841 goto fill_end; 1848 goto fill_end;
1842 1849
1843 /* fill in supported extended rate */ 1850 /* fill in supported extended rate */
@@ -1848,7 +1855,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1848 /* ... fill it in... */ 1855 /* ... fill it in... */
1849 *pos++ = WLAN_EID_EXT_SUPP_RATES; 1856 *pos++ = WLAN_EID_EXT_SUPP_RATES;
1850 *pos = 0; 1857 *pos = 0;
1851 iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left); 1858 iwl_supported_rate_to_ie(pos, active_rates,
1859 priv->active_rate_basic, &left);
1852 if (*pos > 0) 1860 if (*pos > 0)
1853 len += 2 + *pos; 1861 len += 2 + *pos;
1854 1862
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index b1a6e39f7821..5e1279263b22 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -48,8 +48,6 @@
48#include <linux/netdevice.h> 48#include <linux/netdevice.h>
49#include <linux/wireless.h> 49#include <linux/wireless.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51#include <linux/skbuff.h>
52#include <linux/netdevice.h>
53#include <linux/etherdevice.h> 51#include <linux/etherdevice.h>
54#include <linux/if_arp.h> 52#include <linux/if_arp.h>
55 53
@@ -1802,21 +1800,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
1802 * return : set the bit for each supported rate insert in ie 1800 * return : set the bit for each supported rate insert in ie
1803 */ 1801 */
1804static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate, 1802static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1805 u16 basic_rate, int max_count) 1803 u16 basic_rate, int *left)
1806{ 1804{
1807 u16 ret_rates = 0, bit; 1805 u16 ret_rates = 0, bit;
1808 int i; 1806 int i;
1809 u8 *rates; 1807 u8 *cnt = ie;
1810 1808 u8 *rates = ie + 1;
1811 rates = &(ie[1]);
1812 1809
1813 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) { 1810 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
1814 if (bit & supported_rate) { 1811 if (bit & supported_rate) {
1815 ret_rates |= bit; 1812 ret_rates |= bit;
1816 rates[*ie] = iwl_rates[i].ieee | 1813 rates[*cnt] = iwl_rates[i].ieee |
1817 ((bit & basic_rate) ? 0x80 : 0x00); 1814 ((bit & basic_rate) ? 0x80 : 0x00);
1818 *ie = *ie + 1; 1815 (*cnt)++;
1819 if (*ie >= max_count) 1816 (*left)--;
1817 if ((*left <= 0) ||
1818 (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
1820 break; 1819 break;
1821 } 1820 }
1822 } 1821 }
@@ -1839,7 +1838,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1839{ 1838{
1840 int len = 0; 1839 int len = 0;
1841 u8 *pos = NULL; 1840 u8 *pos = NULL;
1842 u16 ret_rates; 1841 u16 active_rates, ret_rates, cck_rates;
1843 1842
1844 /* Make sure there is enough space for the probe request, 1843 /* Make sure there is enough space for the probe request,
1845 * two mandatory IEs and the data */ 1844 * two mandatory IEs and the data */
@@ -1884,19 +1883,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1884 left -= 2; 1883 left -= 2;
1885 if (left < 0) 1884 if (left < 0)
1886 return 0; 1885 return 0;
1886
1887 /* ... fill it in... */ 1887 /* ... fill it in... */
1888 *pos++ = WLAN_EID_SUPP_RATES; 1888 *pos++ = WLAN_EID_SUPP_RATES;
1889 *pos = 0; 1889 *pos = 0;
1890 ret_rates = priv->active_rate = priv->rates_mask; 1890
1891 priv->active_rate = priv->rates_mask;
1892 active_rates = priv->active_rate;
1891 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; 1893 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
1892 1894
1893 iwl_supported_rate_to_ie(pos, priv->active_rate, 1895 cck_rates = IWL_CCK_RATES_MASK & active_rates;
1894 priv->active_rate_basic, left); 1896 ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
1897 priv->active_rate_basic, &left);
1898 active_rates &= ~ret_rates;
1899
1900 ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
1901 priv->active_rate_basic, &left);
1902 active_rates &= ~ret_rates;
1903
1895 len += 2 + *pos; 1904 len += 2 + *pos;
1896 pos += (*pos) + 1; 1905 pos += (*pos) + 1;
1897 ret_rates = ~ret_rates & priv->active_rate; 1906 if (active_rates == 0)
1898
1899 if (ret_rates == 0)
1900 goto fill_end; 1907 goto fill_end;
1901 1908
1902 /* fill in supported extended rate */ 1909 /* fill in supported extended rate */
@@ -1907,7 +1914,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1907 /* ... fill it in... */ 1914 /* ... fill it in... */
1908 *pos++ = WLAN_EID_EXT_SUPP_RATES; 1915 *pos++ = WLAN_EID_EXT_SUPP_RATES;
1909 *pos = 0; 1916 *pos = 0;
1910 iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left); 1917 iwl_supported_rate_to_ie(pos, active_rates,
1918 priv->active_rate_basic, &left);
1911 if (*pos > 0) 1919 if (*pos > 0)
1912 len += 2 + *pos; 1920 len += 2 + *pos;
1913 1921
@@ -4494,13 +4502,13 @@ static u8 ratio2dB[100] = {
4494 * Conversion assumes that levels are voltages (20*log), not powers (10*log). */ 4502 * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
4495int iwl_calc_db_from_ratio(int sig_ratio) 4503int iwl_calc_db_from_ratio(int sig_ratio)
4496{ 4504{
4497 /* Anything above 1000:1 just report as 60 dB */ 4505 /* 1000:1 or higher just report as 60 dB */
4498 if (sig_ratio > 1000) 4506 if (sig_ratio >= 1000)
4499 return 60; 4507 return 60;
4500 4508
4501 /* Above 100:1, divide by 10 and use table, 4509 /* 100:1 or higher, divide by 10 and use table,
4502 * add 20 dB to make up for divide by 10 */ 4510 * add 20 dB to make up for divide by 10 */
4503 if (sig_ratio > 100) 4511 if (sig_ratio >= 100)
4504 return (20 + (int)ratio2dB[sig_ratio/10]); 4512 return (20 + (int)ratio2dB[sig_ratio/10]);
4505 4513
4506 /* We shouldn't see this */ 4514 /* We shouldn't see this */
diff --git a/drivers/net/wireless/iwlwifi/iwlwifi.h b/drivers/net/wireless/iwlwifi/iwlwifi.h
index e0b97c341215..432ce887807f 100644
--- a/drivers/net/wireless/iwlwifi/iwlwifi.h
+++ b/drivers/net/wireless/iwlwifi/iwlwifi.h
@@ -39,18 +39,13 @@ struct iwl_priv;
39/* Hardware specific file defines the PCI IDs table for that hardware module */ 39/* Hardware specific file defines the PCI IDs table for that hardware module */
40extern struct pci_device_id iwl_hw_card_ids[]; 40extern struct pci_device_id iwl_hw_card_ids[];
41 41
42#include "iwl-hw.h"
42#if IWL == 3945 43#if IWL == 3945
43
44#define DRV_NAME "iwl3945" 44#define DRV_NAME "iwl3945"
45#include "iwl-hw.h"
46#include "iwl-3945-hw.h" 45#include "iwl-3945-hw.h"
47
48#elif IWL == 4965 46#elif IWL == 4965
49
50#define DRV_NAME "iwl4965" 47#define DRV_NAME "iwl4965"
51#include "iwl-hw.h"
52#include "iwl-4965-hw.h" 48#include "iwl-4965-hw.h"
53
54#endif 49#endif
55 50
56#include "iwl-prph.h" 51#include "iwl-prph.h"
diff --git a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
index 2c63cf0ad2cd..1437db0cf4b2 100644
--- a/drivers/net/wireless/p54common.c
+++ b/drivers/net/wireless/p54common.c
@@ -577,7 +577,7 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
577 struct p54_tx_control_filter *filter; 577 struct p54_tx_control_filter *filter;
578 578
579 hdr = kzalloc(sizeof(*hdr) + sizeof(*filter) + 579 hdr = kzalloc(sizeof(*hdr) + sizeof(*filter) +
580 priv->tx_hdr_len, GFP_KERNEL); 580 priv->tx_hdr_len, GFP_ATOMIC);
581 if (!hdr) 581 if (!hdr)
582 return -ENOMEM; 582 return -ENOMEM;
583 583
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index bb6f46cfbb9f..ff399f8083e9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -550,7 +550,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
550 /* 550 /*
551 * Check if we need to set the Length Extension 551 * Check if we need to set the Length Extension
552 */ 552 */
553 if (bitrate == 110 && residual <= 3) 553 if (bitrate == 110 && residual <= 30)
554 desc.service |= 0x80; 554 desc.service |= 0x80;
555 } 555 }
556 556
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 3e42759473c3..46c8c0840a65 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2029,6 +2029,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2029 { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) }, 2029 { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) },
2030 { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, 2030 { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) },
2031 { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, 2031 { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) },
2032 { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) },
2032 /* Billionton */ 2033 /* Billionton */
2033 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) }, 2034 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) },
2034 /* Buffalo */ 2035 /* Buffalo */
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 0ef887dd2867..de61c8fe6492 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -131,7 +131,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
131 struct rtl8187_tx_hdr *hdr; 131 struct rtl8187_tx_hdr *hdr;
132 struct rtl8187_tx_info *info; 132 struct rtl8187_tx_info *info;
133 struct urb *urb; 133 struct urb *urb;
134 u32 tmp; 134 __le16 rts_dur = 0;
135 u32 flags;
135 136
136 urb = usb_alloc_urb(0, GFP_ATOMIC); 137 urb = usb_alloc_urb(0, GFP_ATOMIC);
137 if (!urb) { 138 if (!urb) {
@@ -139,24 +140,24 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
139 return 0; 140 return 0;
140 } 141 }
141 142
142 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 143 flags = skb->len;
143 tmp = skb->len - sizeof(*hdr); 144 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
144 tmp |= RTL8187_TX_FLAG_NO_ENCRYPT; 145 flags |= control->rts_cts_rate << 19;
145 tmp |= control->rts_cts_rate << 19; 146 flags |= control->tx_rate << 24;
146 tmp |= control->tx_rate << 24; 147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb)) 148 flags |= RTL8187_TX_FLAG_MORE_FRAG;
148 tmp |= RTL8187_TX_FLAG_MORE_FRAG;
149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
150 tmp |= RTL8187_TX_FLAG_RTS; 150 flags |= RTL8187_TX_FLAG_RTS;
151 hdr->rts_duration = 151 rts_dur = ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
152 ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
153 } 152 }
154 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 153 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
155 tmp |= RTL8187_TX_FLAG_CTS; 154 flags |= RTL8187_TX_FLAG_CTS;
156 hdr->flags = cpu_to_le32(tmp); 155
156 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
157 hdr->flags = cpu_to_le32(flags);
157 hdr->len = 0; 158 hdr->len = 0;
158 tmp = control->retry_limit << 8; 159 hdr->rts_duration = rts_dur;
159 hdr->retry = cpu_to_le32(tmp); 160 hdr->retry = cpu_to_le32(control->retry_limit << 8);
160 161
161 info = (struct rtl8187_tx_info *)skb->cb; 162 info = (struct rtl8187_tx_info *)skb->cb;
162 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); 163 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
@@ -587,8 +588,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
587 588
588 *total_flags = 0; 589 *total_flags = 0;
589 590
590 if (changed_flags & FIF_PROMISC_IN_BSS)
591 priv->rx_conf ^= RTL818X_RX_CONF_NICMAC;
592 if (changed_flags & FIF_ALLMULTI) 591 if (changed_flags & FIF_ALLMULTI)
593 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST; 592 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST;
594 if (changed_flags & FIF_FCSFAIL) 593 if (changed_flags & FIF_FCSFAIL)
@@ -601,8 +600,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
601 if (mc_count > 0) 600 if (mc_count > 0)
602 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST; 601 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
603 602
604 if (priv->rx_conf & RTL818X_RX_CONF_NICMAC)
605 *total_flags |= FIF_PROMISC_IN_BSS;
606 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST) 603 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
607 *total_flags |= FIF_ALLMULTI; 604 *total_flags |= FIF_ALLMULTI;
608 if (priv->rx_conf & RTL818X_RX_CONF_FCS) 605 if (priv->rx_conf & RTL818X_RX_CONF_FCS)
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 935b144d9b56..d5c0c66188ca 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -327,8 +327,8 @@ static void zd1201_usbrx(struct urb *urb)
327 memcpy(skb_put(skb, 6), &data[datalen-8], 6); 327 memcpy(skb_put(skb, 6), &data[datalen-8], 6);
328 memcpy(skb_put(skb, 2), &data[datalen-24], 2); 328 memcpy(skb_put(skb, 2), &data[datalen-24], 2);
329 memcpy(skb_put(skb, len), data, len); 329 memcpy(skb_put(skb, len), data, len);
330 skb->dev->last_rx = jiffies;
331 skb->protocol = eth_type_trans(skb, zd->dev); 330 skb->protocol = eth_type_trans(skb, zd->dev);
331 skb->dev->last_rx = jiffies;
332 zd->stats.rx_packets++; 332 zd->stats.rx_packets++;
333 zd->stats.rx_bytes += skb->len; 333 zd->stats.rx_bytes += skb->len;
334 netif_rx(skb); 334 netif_rx(skb);
@@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb)
384 memcpy(skb_put(skb, 2), &data[6], 2); 384 memcpy(skb_put(skb, 2), &data[6], 2);
385 memcpy(skb_put(skb, len), data+8, len); 385 memcpy(skb_put(skb, len), data+8, len);
386 } 386 }
387 skb->dev->last_rx = jiffies;
388 skb->protocol = eth_type_trans(skb, zd->dev); 387 skb->protocol = eth_type_trans(skb, zd->dev);
388 skb->dev->last_rx = jiffies;
389 zd->stats.rx_packets++; 389 zd->stats.rx_packets++;
390 zd->stats.rx_bytes += skb->len; 390 zd->stats.rx_bytes += skb->len;
391 netif_rx(skb); 391 netif_rx(skb);
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index b0684f965761..c755b6923812 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -1044,14 +1044,17 @@ error:
1044static void disconnect(struct usb_interface *intf) 1044static void disconnect(struct usb_interface *intf)
1045{ 1045{
1046 struct net_device *netdev = zd_intf_to_netdev(intf); 1046 struct net_device *netdev = zd_intf_to_netdev(intf);
1047 struct zd_mac *mac = zd_netdev_mac(netdev); 1047 struct zd_mac *mac;
1048 struct zd_usb *usb = &mac->chip.usb; 1048 struct zd_usb *usb;
1049 1049
1050 /* Either something really bad happened, or we're just dealing with 1050 /* Either something really bad happened, or we're just dealing with
1051 * a DEVICE_INSTALLER. */ 1051 * a DEVICE_INSTALLER. */
1052 if (netdev == NULL) 1052 if (netdev == NULL)
1053 return; 1053 return;
1054 1054
1055 mac = zd_netdev_mac(netdev);
1056 usb = &mac->chip.usb;
1057
1055 dev_dbg_f(zd_usb_dev(usb), "\n"); 1058 dev_dbg_f(zd_usb_dev(usb), "\n");
1056 1059
1057 zd_netdev_disconnect(netdev); 1060 zd_netdev_disconnect(netdev);