aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-07-22 14:18:40 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-22 14:18:40 -0400
commitd14a7679ae9b7d4eb4b92e81f5039b719fd98c4d (patch)
treecb12e313178092e92136704660d68f7ce6578d19
parentde72e5de062e48a992d6cafe2291a82fe498d641 (diff)
parent154839962a582b8eb661cde94ef3af0e03b374d7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c12
-rw-r--r--drivers/net/wireless/ath/regd.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c2
-rw-r--r--drivers/net/wireless/libertas/cmd.c8
-rw-r--r--drivers/net/wireless/libertas/defs.h2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c6
-rw-r--r--drivers/net/wireless/p54/p54spi.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_leds.c3
-rw-r--r--drivers/platform/x86/acer-wmi.c2
-rw-r--r--include/linux/rfkill.h2
-rw-r--r--net/mac80211/Kconfig1
-rw-r--r--net/mac80211/mesh_pathtbl.c11
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/rfkill/core.c31
-rw-r--r--net/wireless/nl80211.c5
-rw-r--r--net/wireless/scan.c3
21 files changed, 94 insertions, 33 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ea045151f95..029c1bc7468 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2970,6 +2970,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2970 if (modparam_nohwcrypt) 2970 if (modparam_nohwcrypt)
2971 return -EOPNOTSUPP; 2971 return -EOPNOTSUPP;
2972 2972
2973 if (sc->opmode == NL80211_IFTYPE_AP)
2974 return -EOPNOTSUPP;
2975
2973 switch (key->alg) { 2976 switch (key->alg) {
2974 case ALG_WEP: 2977 case ALG_WEP:
2975 case ALG_TKIP: 2978 case ALG_TKIP:
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 1aeafb511dd..aad259b4c19 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
478 "Reset ANI state opmode %u\n", ah->opmode); 478 "Reset ANI state opmode %u\n", ah->opmode);
479 ah->stats.ast_ani_reset++; 479 ah->stats.ast_ani_reset++;
480 480
481 if (ah->opmode == NL80211_IFTYPE_AP) {
482 /*
483 * ath9k_hw_ani_control() will only process items set on
484 * ah->ani_function
485 */
486 if (IS_CHAN_2GHZ(chan))
487 ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
488 ATH9K_ANI_FIRSTEP_LEVEL);
489 else
490 ah->ani_function = 0;
491 }
492
481 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); 493 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
482 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 494 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
483 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); 495 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index eef370bd121..bf3d25ba7be 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -474,6 +474,21 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
474 return 0; 474 return 0;
475} 475}
476 476
477/*
478 * Some users have reported their EEPROM programmed with
479 * 0x8000 set, this is not a supported regulatory domain
480 * but since we have more than one user with it we need
481 * a solution for them. We default to 0x64, which is the
482 * default Atheros world regulatory domain.
483 */
484static void ath_regd_sanitize(struct ath_regulatory *reg)
485{
486 if (reg->current_rd != COUNTRY_ERD_FLAG)
487 return;
488 printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
489 reg->current_rd = 0x64;
490}
491
477int 492int
478ath_regd_init(struct ath_regulatory *reg, 493ath_regd_init(struct ath_regulatory *reg,
479 struct wiphy *wiphy, 494 struct wiphy *wiphy,
@@ -486,6 +501,8 @@ ath_regd_init(struct ath_regulatory *reg,
486 if (!reg) 501 if (!reg)
487 return -EINVAL; 502 return -EINVAL;
488 503
504 ath_regd_sanitize(reg);
505
489 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd); 506 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
490 507
491 if (!ath_regd_is_eeprom_valid(reg)) { 508 if (!ath_regd_is_eeprom_valid(reg)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6d1519e1f01..355f50ea7fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2675,12 +2675,10 @@ static ssize_t show_power_level(struct device *d,
2675 struct device_attribute *attr, char *buf) 2675 struct device_attribute *attr, char *buf)
2676{ 2676{
2677 struct iwl_priv *priv = dev_get_drvdata(d); 2677 struct iwl_priv *priv = dev_get_drvdata(d);
2678 int mode = priv->power_data.user_power_setting;
2679 int level = priv->power_data.power_mode; 2678 int level = priv->power_data.power_mode;
2680 char *p = buf; 2679 char *p = buf;
2681 2680
2682 p += sprintf(p, "INDEX:%d\t", level); 2681 p += sprintf(p, "%d\n", level);
2683 p += sprintf(p, "USER:%d\n", mode);
2684 return p - buf + 1; 2682 return p - buf + 1;
2685} 2683}
2686 2684
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 85ae7a62109..9bbeec9427f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -872,7 +872,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len);
873 873
874 /* Set up entry for this TFD in Tx byte-count array */ 874 /* Set up entry for this TFD in Tx byte-count array */
875 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 875 if (info->flags & IEEE80211_TX_CTL_AMPDU)
876 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq,
876 le16_to_cpu(tx_cmd->len)); 877 le16_to_cpu(tx_cmd->len));
877 878
878 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, 879 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys,
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cb9bd4c8f25..956798f2c80 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3643,12 +3643,10 @@ static ssize_t show_power_level(struct device *d,
3643 struct device_attribute *attr, char *buf) 3643 struct device_attribute *attr, char *buf)
3644{ 3644{
3645 struct iwl_priv *priv = dev_get_drvdata(d); 3645 struct iwl_priv *priv = dev_get_drvdata(d);
3646 int mode = priv->power_data.user_power_setting;
3647 int level = priv->power_data.power_mode; 3646 int level = priv->power_data.power_mode;
3648 char *p = buf; 3647 char *p = buf;
3649 3648
3650 p += sprintf(p, "INDEX:%d\t", level); 3649 p += sprintf(p, "%d\n", level);
3651 p += sprintf(p, "USER:%d\n", mode);
3652 return p - buf + 1; 3650 return p - buf + 1;
3653} 3651}
3654 3652
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index aaa20c6885c..aea5ccf24cc 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -151,8 +151,8 @@ void iwm_if_free(struct iwm_priv *iwm)
151 return; 151 return;
152 152
153 free_netdev(iwm_to_ndev(iwm)); 153 free_netdev(iwm_to_ndev(iwm));
154 iwm_wdev_free(iwm);
155 iwm_priv_deinit(iwm); 154 iwm_priv_deinit(iwm);
155 iwm_wdev_free(iwm);
156} 156}
157 157
158int iwm_if_add(struct iwm_priv *iwm) 158int iwm_if_add(struct iwm_priv *iwm)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 01db705a38e..685098148e1 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -135,8 +135,14 @@ int lbs_update_hw_spec(struct lbs_private *priv)
135 /* Clamp region code to 8-bit since FW spec indicates that it should 135 /* Clamp region code to 8-bit since FW spec indicates that it should
136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware 136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware
137 * returns non-zero high 8 bits here. 137 * returns non-zero high 8 bits here.
138 *
139 * Firmware version 4.0.102 used in CF8381 has region code shifted. We
140 * need to check for this problem and handle it properly.
138 */ 141 */
139 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; 142 if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4)
143 priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF;
144 else
145 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF;
140 146
141 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { 147 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
142 /* use the region code to search for the index */ 148 /* use the region code to search for the index */
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 48da157d6cd..72f3479a4d7 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
234/** Mesh enable bit in FW capability */ 234/** Mesh enable bit in FW capability */
235#define MESH_CAPINFO_ENABLE_MASK (1<<16) 235#define MESH_CAPINFO_ENABLE_MASK (1<<16)
236 236
237/** FW definition from Marvell v4 */
238#define MRVL_FW_V4 (0x04)
237/** FW definition from Marvell v5 */ 239/** FW definition from Marvell v5 */
238#define MRVL_FW_V5 (0x05) 240#define MRVL_FW_V5 (0x05)
239/** FW definition from Marvell v10 */ 241/** FW definition from Marvell v10 */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a111bda392e..7916ca3f84c 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -709,7 +709,7 @@ static const struct ieee80211_ops mac80211_hwsim_ops =
709static void mac80211_hwsim_free(void) 709static void mac80211_hwsim_free(void)
710{ 710{
711 struct list_head tmplist, *i, *tmp; 711 struct list_head tmplist, *i, *tmp;
712 struct mac80211_hwsim_data *data; 712 struct mac80211_hwsim_data *data, *tmpdata;
713 713
714 INIT_LIST_HEAD(&tmplist); 714 INIT_LIST_HEAD(&tmplist);
715 715
@@ -718,7 +718,7 @@ static void mac80211_hwsim_free(void)
718 list_move(i, &tmplist); 718 list_move(i, &tmplist);
719 spin_unlock_bh(&hwsim_radio_lock); 719 spin_unlock_bh(&hwsim_radio_lock);
720 720
721 list_for_each_entry(data, &tmplist, list) { 721 list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
722 debugfs_remove(data->debugfs_group); 722 debugfs_remove(data->debugfs_group);
723 debugfs_remove(data->debugfs_ps); 723 debugfs_remove(data->debugfs_ps);
724 debugfs_remove(data->debugfs); 724 debugfs_remove(data->debugfs);
@@ -1167,8 +1167,8 @@ static void __exit exit_mac80211_hwsim(void)
1167{ 1167{
1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n"); 1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n");
1169 1169
1170 unregister_netdev(hwsim_mon);
1171 mac80211_hwsim_free(); 1170 mac80211_hwsim_free();
1171 unregister_netdev(hwsim_mon);
1172} 1172}
1173 1173
1174 1174
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 83116baeb11..72c7dbd39d0 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -635,7 +635,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
635 635
636 hw = p54_init_common(sizeof(*priv)); 636 hw = p54_init_common(sizeof(*priv));
637 if (!hw) { 637 if (!hw) {
638 dev_err(&priv->spi->dev, "could not alloc ieee80211_hw"); 638 dev_err(&spi->dev, "could not alloc ieee80211_hw");
639 return -ENOMEM; 639 return -ENOMEM;
640 } 640 }
641 641
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 66daf68ff0e..ce75426764a 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1550,7 +1550,9 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg); 1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
1552 1552
1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) { 1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
1554 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
1555
1554 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1556 ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
1555 return -ENODEV; 1557 return -ENODEV;
1556 } 1558 }
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
index b4425359224..cf9f899fe0e 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -208,11 +208,12 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
208{ 208{
209 struct rtl8187_priv *priv = dev->priv; 209 struct rtl8187_priv *priv = dev->priv;
210 210
211 rtl8187_unregister_led(&priv->led_tx);
212 /* turn the LED off before exiting */ 211 /* turn the LED off before exiting */
213 queue_delayed_work(dev->workqueue, &priv->led_off, 0); 212 queue_delayed_work(dev->workqueue, &priv->led_off, 0);
214 cancel_delayed_work_sync(&priv->led_off); 213 cancel_delayed_work_sync(&priv->led_off);
214 cancel_delayed_work_sync(&priv->led_on);
215 rtl8187_unregister_led(&priv->led_rx); 215 rtl8187_unregister_led(&priv->led_rx);
216 rtl8187_unregister_led(&priv->led_tx);
216} 217}
217#endif /* def CONFIG_RTL8187_LED */ 218#endif /* def CONFIG_RTL8187_LED */
218 219
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index be2fd6f9163..fb45f5ee8df 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -973,7 +973,7 @@ static int acer_rfkill_set(void *data, bool blocked)
973{ 973{
974 acpi_status status; 974 acpi_status status;
975 u32 cap = (unsigned long)data; 975 u32 cap = (unsigned long)data;
976 status = set_u32(!!blocked, cap); 976 status = set_u32(!blocked, cap);
977 if (ACPI_FAILURE(status)) 977 if (ACPI_FAILURE(status))
978 return -ENODEV; 978 return -ENODEV;
979 return 0; 979 return 0;
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 2ce29831feb..278777fa8a3 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -224,7 +224,7 @@ void rfkill_destroy(struct rfkill *rfkill);
224 * should be blocked) so that drivers need not keep track of the soft 224 * should be blocked) so that drivers need not keep track of the soft
225 * block state -- which they might not be able to. 225 * block state -- which they might not be able to.
226 */ 226 */
227bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); 227bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
228 228
229/** 229/**
230 * rfkill_set_sw_state - Set the internal rfkill software block state 230 * rfkill_set_sw_state - Set the internal rfkill software block state
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index ba2643a43c7..7836ee92898 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -83,6 +83,7 @@ endmenu
83config MAC80211_MESH 83config MAC80211_MESH
84 bool "Enable mac80211 mesh networking (pre-802.11s) support" 84 bool "Enable mac80211 mesh networking (pre-802.11s) support"
85 depends on MAC80211 && EXPERIMENTAL 85 depends on MAC80211 && EXPERIMENTAL
86 depends on BROKEN
86 ---help--- 87 ---help---
87 This options enables support of Draft 802.11s mesh networking. 88 This options enables support of Draft 802.11s mesh networking.
88 The implementation is based on Draft 1.08 of the Mesh Networking 89 The implementation is based on Draft 1.08 of the Mesh Networking
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 3c72557df45..479597e8858 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -175,6 +175,8 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
175 int err = 0; 175 int err = 0;
176 u32 hash_idx; 176 u32 hash_idx;
177 177
178 might_sleep();
179
178 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 180 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
179 /* never add ourselves as neighbours */ 181 /* never add ourselves as neighbours */
180 return -ENOTSUPP; 182 return -ENOTSUPP;
@@ -265,6 +267,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
265 int err = 0; 267 int err = 0;
266 u32 hash_idx; 268 u32 hash_idx;
267 269
270 might_sleep();
268 271
269 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 272 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
270 /* never add ourselves as neighbours */ 273 /* never add ourselves as neighbours */
@@ -491,8 +494,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath)
491 * @skb: frame to discard 494 * @skb: frame to discard
492 * @sdata: network subif the frame was to be sent through 495 * @sdata: network subif the frame was to be sent through
493 * 496 *
494 * If the frame was beign forwarded from another MP, a PERR frame will be sent 497 * If the frame was being forwarded from another MP, a PERR frame will be sent
495 * to the precursor. 498 * to the precursor. The precursor's address (i.e. the previous hop) was saved
499 * in addr1 of the frame-to-be-forwarded, and would only be overwritten once
500 * the destination is successfully resolved.
496 * 501 *
497 * Locking: the function must me called within a rcu_read_lock region 502 * Locking: the function must me called within a rcu_read_lock region
498 */ 503 */
@@ -507,7 +512,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
507 u8 *ra, *da; 512 u8 *ra, *da;
508 513
509 da = hdr->addr3; 514 da = hdr->addr3;
510 ra = hdr->addr2; 515 ra = hdr->addr1;
511 mpath = mesh_path_lookup(da, sdata); 516 mpath = mesh_path_lookup(da, sdata);
512 if (mpath) 517 if (mpath)
513 dsn = ++mpath->dsn; 518 dsn = ++mpath->dsn;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d238a8939a0..3a8922cd103 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1455,7 +1455,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
1455 monitor_iface = UNKNOWN_ADDRESS; 1455 monitor_iface = UNKNOWN_ADDRESS;
1456 1456
1457 len_rthdr = ieee80211_get_radiotap_len(skb->data); 1457 len_rthdr = ieee80211_get_radiotap_len(skb->data);
1458 hdr = (struct ieee80211_hdr *)skb->data + len_rthdr; 1458 hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
1459 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1459 hdrlen = ieee80211_hdrlen(hdr->frame_control);
1460 1460
1461 /* check the header is complete in the frame */ 1461 /* check the header is complete in the frame */
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 79693fe2001..2fc4a1724eb 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -549,6 +549,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW); 549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW);
550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW); 550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW);
551 __rfkill_set_sw_state(rfkill, sw); 551 __rfkill_set_sw_state(rfkill, sw);
552 if (hw)
553 rfkill->state |= RFKILL_BLOCK_HW;
554 else
555 rfkill->state &= ~RFKILL_BLOCK_HW;
552 556
553 spin_unlock_irqrestore(&rfkill->lock, flags); 557 spin_unlock_irqrestore(&rfkill->lock, flags);
554 558
@@ -648,15 +652,26 @@ static ssize_t rfkill_state_store(struct device *dev,
648 struct device_attribute *attr, 652 struct device_attribute *attr,
649 const char *buf, size_t count) 653 const char *buf, size_t count)
650{ 654{
651 /* 655 struct rfkill *rfkill = to_rfkill(dev);
652 * The intention was that userspace can only take control over 656 unsigned long state;
653 * a given device when/if rfkill-input doesn't control it due 657 int err;
654 * to user_claim. Since user_claim is currently unsupported, 658
655 * we never support changing the state from userspace -- this 659 if (!capable(CAP_NET_ADMIN))
656 * can be implemented again later. 660 return -EPERM;
657 */ 661
662 err = strict_strtoul(buf, 0, &state);
663 if (err)
664 return err;
665
666 if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
667 state != RFKILL_USER_STATE_UNBLOCKED)
668 return -EINVAL;
669
670 mutex_lock(&rfkill_global_mutex);
671 rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
672 mutex_unlock(&rfkill_global_mutex);
658 673
659 return -EPERM; 674 return err ?: count;
660} 675}
661 676
662static ssize_t rfkill_claim_show(struct device *dev, 677static ssize_t rfkill_claim_show(struct device *dev,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 43bdb1372ca..634496b3ed7 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
997 997
998 if (IS_ERR(hdr)) { 998 if (IS_ERR(hdr)) {
999 err = PTR_ERR(hdr); 999 err = PTR_ERR(hdr);
1000 goto out; 1000 goto free_msg;
1001 } 1001 }
1002 1002
1003 cookie.msg = msg; 1003 cookie.msg = msg;
@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1011 &cookie, get_key_callback); 1011 &cookie, get_key_callback);
1012 1012
1013 if (err) 1013 if (err)
1014 goto out; 1014 goto free_msg;
1015 1015
1016 if (cookie.error) 1016 if (cookie.error)
1017 goto nla_put_failure; 1017 goto nla_put_failure;
@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1022 1022
1023 nla_put_failure: 1023 nla_put_failure:
1024 err = -ENOBUFS; 1024 err = -ENOBUFS;
1025 free_msg:
1025 nlmsg_free(msg); 1026 nlmsg_free(msg);
1026 out: 1027 out:
1027 cfg80211_put_dev(drv); 1028 cfg80211_put_dev(drv);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index f8e71b30000..9271118e1fc 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -35,8 +35,6 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
35 else 35 else
36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev); 36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev);
37 37
38 wiphy_to_dev(request->wiphy)->scan_req = NULL;
39
40#ifdef CONFIG_WIRELESS_EXT 38#ifdef CONFIG_WIRELESS_EXT
41 if (!aborted) { 39 if (!aborted) {
42 memset(&wrqu, 0, sizeof(wrqu)); 40 memset(&wrqu, 0, sizeof(wrqu));
@@ -48,6 +46,7 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
48 dev_put(dev); 46 dev_put(dev);
49 47
50 out: 48 out:
49 wiphy_to_dev(request->wiphy)->scan_req = NULL;
51 kfree(request); 50 kfree(request);
52} 51}
53EXPORT_SYMBOL(cfg80211_scan_done); 52EXPORT_SYMBOL(cfg80211_scan_done);