diff options
author | David S. Miller <davem@davemloft.net> | 2009-08-03 22:05:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-03 22:05:50 -0400 |
commit | eca4c3d2dd66d0230140c9af05dee591df6f0e42 (patch) | |
tree | 59167ea2ac39a78f626bb3905e495963af326b77 | |
parent | f6caa14aa0b126d4a2933907d1519611b2a8524a (diff) | |
parent | 99f1b01562b7dcae75b043114f76163fbf84fcab (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/commands.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/11d.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 2 | ||||
-rw-r--r-- | include/net/cfg80211.h | 5 | ||||
-rw-r--r-- | net/wireless/reg.c | 9 | ||||
-rw-r--r-- | net/wireless/reg.h | 3 | ||||
-rw-r--r-- | net/wireless/scan.c | 4 |
11 files changed, 42 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 6ab07165ea28..18b135f510e5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1332,6 +1332,9 @@ int iwl_setup_mac(struct iwl_priv *priv) | |||
1332 | 1332 | ||
1333 | hw->wiphy->custom_regulatory = true; | 1333 | hw->wiphy->custom_regulatory = true; |
1334 | 1334 | ||
1335 | /* Firmware does not support this */ | ||
1336 | hw->wiphy->disable_beacon_hints = true; | ||
1337 | |||
1335 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; | 1338 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; |
1336 | /* we create the 802.11 header and a zero-length SSID element */ | 1339 | /* we create the 802.11 header and a zero-length SSID element */ |
1337 | hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; | 1340 | hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 11e08c068917..ca00cc8ad4c7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -308,18 +308,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, | |||
308 | return -ENODATA; | 308 | return -ENODATA; |
309 | } | 309 | } |
310 | 310 | ||
311 | ptr = priv->eeprom; | ||
312 | if (!ptr) { | ||
313 | IWL_ERR(priv, "Invalid EEPROM/OTP memory\n"); | ||
314 | return -ENOMEM; | ||
315 | } | ||
316 | |||
311 | /* 4 characters for byte 0xYY */ | 317 | /* 4 characters for byte 0xYY */ |
312 | buf = kzalloc(buf_size, GFP_KERNEL); | 318 | buf = kzalloc(buf_size, GFP_KERNEL); |
313 | if (!buf) { | 319 | if (!buf) { |
314 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 320 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
315 | return -ENOMEM; | 321 | return -ENOMEM; |
316 | } | 322 | } |
317 | |||
318 | ptr = priv->eeprom; | ||
319 | if (!ptr) { | ||
320 | IWL_ERR(priv, "Invalid EEPROM/OTP memory\n"); | ||
321 | return -ENOMEM; | ||
322 | } | ||
323 | pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", | 323 | pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", |
324 | (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) | 324 | (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) |
325 | ? "OTP" : "EEPROM"); | 325 | ? "OTP" : "EEPROM"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 2addf735b193..ffd5c61a7553 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -566,6 +566,8 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, | |||
566 | unsigned long flags; | 566 | unsigned long flags; |
567 | 567 | ||
568 | spin_lock_irqsave(&priv->sta_lock, flags); | 568 | spin_lock_irqsave(&priv->sta_lock, flags); |
569 | IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", | ||
570 | keyconf->keyidx); | ||
569 | 571 | ||
570 | if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table)) | 572 | if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table)) |
571 | IWL_ERR(priv, "index %d not used in uCode key table.\n", | 573 | IWL_ERR(priv, "index %d not used in uCode key table.\n", |
@@ -573,6 +575,11 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, | |||
573 | 575 | ||
574 | priv->default_wep_key--; | 576 | priv->default_wep_key--; |
575 | memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); | 577 | memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); |
578 | if (iwl_is_rfkill(priv)) { | ||
579 | IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); | ||
580 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
581 | return 0; | ||
582 | } | ||
576 | ret = iwl_send_static_wepkey_cmd(priv, 1); | 583 | ret = iwl_send_static_wepkey_cmd(priv, 1); |
577 | IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n", | 584 | IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n", |
578 | keyconf->keyidx, ret); | 585 | keyconf->keyidx, ret); |
@@ -853,6 +860,11 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
853 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 860 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
854 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 861 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
855 | 862 | ||
863 | if (iwl_is_rfkill(priv)) { | ||
864 | IWL_DEBUG_WEP(priv, "Not sending REPLY_ADD_STA command because RFKILL enabled. \n"); | ||
865 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
866 | return 0; | ||
867 | } | ||
856 | ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | 868 | ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); |
857 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 869 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
858 | return ret; | 870 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 2f50ab60bfdf..523843369ca2 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3968,6 +3968,9 @@ static int iwl3945_setup_mac(struct iwl_priv *priv) | |||
3968 | 3968 | ||
3969 | hw->wiphy->custom_regulatory = true; | 3969 | hw->wiphy->custom_regulatory = true; |
3970 | 3970 | ||
3971 | /* Firmware does not support this */ | ||
3972 | hw->wiphy->disable_beacon_hints = true; | ||
3973 | |||
3971 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945; | 3974 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945; |
3972 | /* we create the 802.11 header and a zero-length SSID element */ | 3975 | /* we create the 802.11 header and a zero-length SSID element */ |
3973 | hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; | 3976 | hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; |
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index 834a7f544e5d..e2334d123599 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c | |||
@@ -220,6 +220,7 @@ int iwm_store_rxiq_calib_result(struct iwm_priv *iwm) | |||
220 | eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ); | 220 | eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ); |
221 | if (IS_ERR(eeprom_rxiq)) { | 221 | if (IS_ERR(eeprom_rxiq)) { |
222 | IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n"); | 222 | IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n"); |
223 | kfree(rxiq); | ||
223 | return PTR_ERR(eeprom_rxiq); | 224 | return PTR_ERR(eeprom_rxiq); |
224 | } | 225 | } |
225 | 226 | ||
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c index 9a5408e7d94a..5c6968101f0d 100644 --- a/drivers/net/wireless/libertas/11d.c +++ b/drivers/net/wireless/libertas/11d.c | |||
@@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region) | |||
47 | { | 47 | { |
48 | u8 i; | 48 | u8 i; |
49 | 49 | ||
50 | for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++) | 50 | for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++) |
51 | region[i] = toupper(region[i]); | 51 | region[i] = toupper(region[i]); |
52 | 52 | ||
53 | for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { | 53 | for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 40b07b988224..3bd3c779fff3 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -698,7 +698,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length) | |||
698 | && !mac->pass_ctrl) | 698 | && !mac->pass_ctrl) |
699 | return 0; | 699 | return 0; |
700 | 700 | ||
701 | fc = *(__le16 *)buffer; | 701 | fc = get_unaligned((__le16*)buffer); |
702 | need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc); | 702 | need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc); |
703 | 703 | ||
704 | skb = dev_alloc_skb(length + (need_padding ? 2 : 0)); | 704 | skb = dev_alloc_skb(length + (need_padding ? 2 : 0)); |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1a21895b732b..d1892d66701a 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -979,6 +979,10 @@ struct cfg80211_ops { | |||
979 | * channels at a later time. This can be used for devices which do not | 979 | * channels at a later time. This can be used for devices which do not |
980 | * have calibration information gauranteed for frequencies or settings | 980 | * have calibration information gauranteed for frequencies or settings |
981 | * outside of its regulatory domain. | 981 | * outside of its regulatory domain. |
982 | * @disable_beacon_hints: enable this if your driver needs to ensure that | ||
983 | * passive scan flags and beaconing flags may not be lifted by cfg80211 | ||
984 | * due to regulatory beacon hints. For more information on beacon | ||
985 | * hints read the documenation for regulatory_hint_found_beacon() | ||
982 | * @reg_notifier: the driver's regulatory notification callback | 986 | * @reg_notifier: the driver's regulatory notification callback |
983 | * @regd: the driver's regulatory domain, if one was requested via | 987 | * @regd: the driver's regulatory domain, if one was requested via |
984 | * the regulatory_hint() API. This can be used by the driver | 988 | * the regulatory_hint() API. This can be used by the driver |
@@ -1004,6 +1008,7 @@ struct wiphy { | |||
1004 | 1008 | ||
1005 | bool custom_regulatory; | 1009 | bool custom_regulatory; |
1006 | bool strict_regulatory; | 1010 | bool strict_regulatory; |
1011 | bool disable_beacon_hints; | ||
1007 | 1012 | ||
1008 | enum cfg80211_signal_type signal_type; | 1013 | enum cfg80211_signal_type signal_type; |
1009 | 1014 | ||
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 5e14371cda70..75a406d33619 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1089,17 +1089,18 @@ static void handle_reg_beacon(struct wiphy *wiphy, | |||
1089 | 1089 | ||
1090 | chan->beacon_found = true; | 1090 | chan->beacon_found = true; |
1091 | 1091 | ||
1092 | if (wiphy->disable_beacon_hints) | ||
1093 | return; | ||
1094 | |||
1092 | chan_before.center_freq = chan->center_freq; | 1095 | chan_before.center_freq = chan->center_freq; |
1093 | chan_before.flags = chan->flags; | 1096 | chan_before.flags = chan->flags; |
1094 | 1097 | ||
1095 | if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) && | 1098 | if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) { |
1096 | !(chan->orig_flags & IEEE80211_CHAN_PASSIVE_SCAN)) { | ||
1097 | chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; | 1099 | chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
1098 | channel_changed = true; | 1100 | channel_changed = true; |
1099 | } | 1101 | } |
1100 | 1102 | ||
1101 | if ((chan->flags & IEEE80211_CHAN_NO_IBSS) && | 1103 | if (chan->flags & IEEE80211_CHAN_NO_IBSS) { |
1102 | !(chan->orig_flags & IEEE80211_CHAN_NO_IBSS)) { | ||
1103 | chan->flags &= ~IEEE80211_CHAN_NO_IBSS; | 1104 | chan->flags &= ~IEEE80211_CHAN_NO_IBSS; |
1104 | channel_changed = true; | 1105 | channel_changed = true; |
1105 | } | 1106 | } |
diff --git a/net/wireless/reg.h b/net/wireless/reg.h index e37829a49dc4..4e167a8e11be 100644 --- a/net/wireless/reg.h +++ b/net/wireless/reg.h | |||
@@ -30,7 +30,8 @@ int set_regdom(const struct ieee80211_regdomain *rd); | |||
30 | * non-radar 5 GHz channels. | 30 | * non-radar 5 GHz channels. |
31 | * | 31 | * |
32 | * Drivers do not need to call this, cfg80211 will do it for after a scan | 32 | * Drivers do not need to call this, cfg80211 will do it for after a scan |
33 | * on a newly found BSS. | 33 | * on a newly found BSS. If you cannot make use of this feature you can |
34 | * set the wiphy->disable_beacon_hints to true. | ||
34 | */ | 35 | */ |
35 | int regulatory_hint_found_beacon(struct wiphy *wiphy, | 36 | int regulatory_hint_found_beacon(struct wiphy *wiphy, |
36 | struct ieee80211_channel *beacon_chan, | 37 | struct ieee80211_channel *beacon_chan, |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 9271118e1fc4..7e595ce24eeb 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -118,7 +118,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2) | |||
118 | 118 | ||
119 | if (!ie1 && !ie2) | 119 | if (!ie1 && !ie2) |
120 | return 0; | 120 | return 0; |
121 | if (!ie1) | 121 | if (!ie1 || !ie2) |
122 | return -1; | 122 | return -1; |
123 | 123 | ||
124 | r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); | 124 | r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); |
@@ -171,6 +171,8 @@ static bool is_mesh(struct cfg80211_bss *a, | |||
171 | ie = find_ie(WLAN_EID_MESH_CONFIG, | 171 | ie = find_ie(WLAN_EID_MESH_CONFIG, |
172 | a->information_elements, | 172 | a->information_elements, |
173 | a->len_information_elements); | 173 | a->len_information_elements); |
174 | if (!ie) | ||
175 | return false; | ||
174 | if (ie[1] != IEEE80211_MESH_CONFIG_LEN) | 176 | if (ie[1] != IEEE80211_MESH_CONFIG_LEN) |
175 | return false; | 177 | return false; |
176 | 178 | ||