Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

John Linville says:
====================
Amitkumar Karwar gives us a cfg80211 fix that changes some state
tracking in order to avoid a WARNING.

Arik Nemtsov provide a mac80211 fix for an RCU-related race.

Avinash Patil shares a pair of mwifiex fixes, one which invalidates
some stale configuration data before a channel change and another to
restrict hidden SSID support to zero-length SSIDs only.

Chun-Yeow Yeoh brings a mac80211 fix for a mesh problem triggered
when combining multiple mesh networks into one.

Felix Fietkau provides a mac80211 lockdep fix.

Joe Perches fixes a couple of thinkos related to bitwise operations.

Johannes Berg comes through with a flurry of fixes. The iwlwifi ones
address a problem Linus recently reported, and some of the fallout
discovered while fixing it. The mac80211 fix properly cleans-up
remain-on-channel work on an interface that is stopped. The others
are clean-ups for regressions caused by stricter checking of possible
virtual interfaces supported by wireless drivers.

Meenakshi Venkataraman provides a mac80211 fix for an off-by-one error.

Seth Forshee provides a fix to make the wireless adapters used in
some Mac boxes work after being in S3 power saving state.

Stanislaw Gruszka offers a copule of fixes, a fix for a mac80211
scanning regression and an rt2x00 fix to avoid some lockdep spew.

Last but not least, Vinicius Costa Gomes provides a bluetooth fix
for a typo that "was preventing important features of Bluetooth
from working".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+180 -48
+3 -1
drivers/bcma/driver_chipcommon_pmu.c
··· 139 139 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); 140 140 break; 141 141 case 0x4331: 142 - /* BCM4331 workaround is SPROM-related, we put it in sprom.c */ 142 + case 43431: 143 + /* Ext PA lines must be enabled for tx on BCM4331 */ 144 + bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true); 143 145 break; 144 146 case 43224: 145 147 if (bus->chipinfo.rev == 0) {
+2 -2
drivers/bcma/sprom.c
··· 579 579 if (!sprom) 580 580 return -ENOMEM; 581 581 582 - if (bus->chipinfo.id == 0x4331) 582 + if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) 583 583 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); 584 584 585 585 pr_debug("SPROM offset 0x%x\n", offset); 586 586 bcma_sprom_read(bus, offset, sprom); 587 587 588 - if (bus->chipinfo.id == 0x4331) 588 + if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) 589 589 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); 590 590 591 591 err = bcma_sprom_valid(sprom);
+2 -2
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
··· 89 89 data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; 90 90 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret); 91 91 92 - /* redirect, configure ane enable io for interrupt signal */ 92 + /* redirect, configure and enable io for interrupt signal */ 93 93 data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; 94 - if (sdiodev->irq_flags | IRQF_TRIGGER_HIGH) 94 + if (sdiodev->irq_flags & IRQF_TRIGGER_HIGH) 95 95 data |= SDIO_SEPINT_ACT_HI; 96 96 brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); 97 97
+7 -2
drivers/net/wireless/iwlwifi/iwl-drv.c
··· 861 861 862 862 /* We have our copies now, allow OS release its copies */ 863 863 release_firmware(ucode_raw); 864 - complete(&drv->request_firmware_complete); 865 864 866 865 drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); 867 866 868 867 if (!drv->op_mode) 869 - goto out_free_fw; 868 + goto out_unbind; 870 869 870 + /* 871 + * Complete the firmware request last so that 872 + * a driver unbind (stop) doesn't run while we 873 + * are doing the start() above. 874 + */ 875 + complete(&drv->request_firmware_complete); 871 876 return; 872 877 873 878 try_again:
+9 -9
drivers/net/wireless/iwlwifi/iwl-eeprom.c
··· 568 568 * iwl_get_max_txpower_avg - get the highest tx power from all chains. 569 569 * find the highest tx power from all chains for the channel 570 570 */ 571 - static s8 iwl_get_max_txpower_avg(const struct iwl_cfg *cfg, 571 + static s8 iwl_get_max_txpower_avg(struct iwl_priv *priv, 572 572 struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, 573 573 int element, s8 *max_txpower_in_half_dbm) 574 574 { 575 575 s8 max_txpower_avg = 0; /* (dBm) */ 576 576 577 577 /* Take the highest tx power from any valid chains */ 578 - if ((cfg->valid_tx_ant & ANT_A) && 578 + if ((priv->hw_params.valid_tx_ant & ANT_A) && 579 579 (enhanced_txpower[element].chain_a_max > max_txpower_avg)) 580 580 max_txpower_avg = enhanced_txpower[element].chain_a_max; 581 - if ((cfg->valid_tx_ant & ANT_B) && 581 + if ((priv->hw_params.valid_tx_ant & ANT_B) && 582 582 (enhanced_txpower[element].chain_b_max > max_txpower_avg)) 583 583 max_txpower_avg = enhanced_txpower[element].chain_b_max; 584 - if ((cfg->valid_tx_ant & ANT_C) && 584 + if ((priv->hw_params.valid_tx_ant & ANT_C) && 585 585 (enhanced_txpower[element].chain_c_max > max_txpower_avg)) 586 586 max_txpower_avg = enhanced_txpower[element].chain_c_max; 587 - if (((cfg->valid_tx_ant == ANT_AB) | 588 - (cfg->valid_tx_ant == ANT_BC) | 589 - (cfg->valid_tx_ant == ANT_AC)) && 587 + if (((priv->hw_params.valid_tx_ant == ANT_AB) | 588 + (priv->hw_params.valid_tx_ant == ANT_BC) | 589 + (priv->hw_params.valid_tx_ant == ANT_AC)) && 590 590 (enhanced_txpower[element].mimo2_max > max_txpower_avg)) 591 591 max_txpower_avg = enhanced_txpower[element].mimo2_max; 592 - if ((cfg->valid_tx_ant == ANT_ABC) && 592 + if ((priv->hw_params.valid_tx_ant == ANT_ABC) && 593 593 (enhanced_txpower[element].mimo3_max > max_txpower_avg)) 594 594 max_txpower_avg = enhanced_txpower[element].mimo3_max; 595 595 ··· 691 691 ((txp->delta_20_in_40 & 0xf0) >> 4), 692 692 (txp->delta_20_in_40 & 0x0f)); 693 693 694 - max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, 694 + max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, 695 695 &max_txp_avg_halfdbm); 696 696 697 697 /*
+3
drivers/net/wireless/iwlwifi/iwl-mac80211.c
··· 199 199 WIPHY_FLAG_DISABLE_BEACON_HINTS | 200 200 WIPHY_FLAG_IBSS_RSN; 201 201 202 + #ifdef CONFIG_PM_SLEEP 202 203 if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && 203 204 priv->trans->ops->wowlan_suspend && 204 205 device_can_wakeup(priv->trans->dev)) { ··· 218 217 hw->wiphy->wowlan.pattern_max_len = 219 218 IWLAGN_WOWLAN_MAX_PATTERN_LEN; 220 219 } 220 + #endif 221 221 222 222 if (iwlwifi_mod_params.power_save) 223 223 hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; ··· 251 249 ret = ieee80211_register_hw(priv->hw); 252 250 if (ret) { 253 251 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret); 252 + iwl_leds_exit(priv); 254 253 return ret; 255 254 } 256 255 priv->mac80211_registered = 1;
+21
drivers/net/wireless/mac80211_hwsim.c
··· 1721 1721 "unregister family %i\n", ret); 1722 1722 } 1723 1723 1724 + static const struct ieee80211_iface_limit hwsim_if_limits[] = { 1725 + { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) }, 1726 + { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) | 1727 + BIT(NL80211_IFTYPE_P2P_CLIENT) | 1728 + #ifdef CONFIG_MAC80211_MESH 1729 + BIT(NL80211_IFTYPE_MESH_POINT) | 1730 + #endif 1731 + BIT(NL80211_IFTYPE_AP) | 1732 + BIT(NL80211_IFTYPE_P2P_GO) }, 1733 + }; 1734 + 1735 + static const struct ieee80211_iface_combination hwsim_if_comb = { 1736 + .limits = hwsim_if_limits, 1737 + .n_limits = ARRAY_SIZE(hwsim_if_limits), 1738 + .max_interfaces = 2048, 1739 + .num_different_channels = 1, 1740 + }; 1741 + 1724 1742 static int __init init_mac80211_hwsim(void) 1725 1743 { 1726 1744 int i, err = 0; ··· 1799 1781 data->addresses[1].addr[0] |= 0x40; 1800 1782 hw->wiphy->n_addresses = 2; 1801 1783 hw->wiphy->addresses = data->addresses; 1784 + 1785 + hw->wiphy->iface_combinations = &hwsim_if_comb; 1786 + hw->wiphy->n_iface_combinations = 1; 1802 1787 1803 1788 if (fake_hw_scan) { 1804 1789 hw->wiphy->max_scan_ssids = 255;
+13
drivers/net/wireless/mwifiex/cfg80211.c
··· 948 948 bss_cfg->ssid.ssid_len = params->ssid_len; 949 949 } 950 950 951 + switch (params->hidden_ssid) { 952 + case NL80211_HIDDEN_SSID_NOT_IN_USE: 953 + bss_cfg->bcast_ssid_ctl = 1; 954 + break; 955 + case NL80211_HIDDEN_SSID_ZERO_LEN: 956 + bss_cfg->bcast_ssid_ctl = 0; 957 + break; 958 + case NL80211_HIDDEN_SSID_ZERO_CONTENTS: 959 + /* firmware doesn't support this type of hidden SSID */ 960 + default: 961 + return -EINVAL; 962 + } 963 + 951 964 if (mwifiex_set_secure_params(priv, bss_cfg, params)) { 952 965 kfree(bss_cfg); 953 966 wiphy_err(wiphy, "Failed to parse secuirty parameters!\n");
+6
drivers/net/wireless/mwifiex/fw.h
··· 122 122 #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42) 123 123 #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44) 124 124 #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45) 125 + #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48) 125 126 #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51) 126 127 #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60) 127 128 #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64) ··· 1208 1207 struct host_cmd_tlv_ssid { 1209 1208 struct host_cmd_tlv tlv; 1210 1209 u8 ssid[0]; 1210 + } __packed; 1211 + 1212 + struct host_cmd_tlv_bcast_ssid { 1213 + struct host_cmd_tlv tlv; 1214 + u8 bcast_ctl; 1211 1215 } __packed; 1212 1216 1213 1217 struct host_cmd_tlv_beacon_period {
+10
drivers/net/wireless/mwifiex/uap_cmd.c
··· 132 132 struct host_cmd_tlv_dtim_period *dtim_period; 133 133 struct host_cmd_tlv_beacon_period *beacon_period; 134 134 struct host_cmd_tlv_ssid *ssid; 135 + struct host_cmd_tlv_bcast_ssid *bcast_ssid; 135 136 struct host_cmd_tlv_channel_band *chan_band; 136 137 struct host_cmd_tlv_frag_threshold *frag_threshold; 137 138 struct host_cmd_tlv_rts_threshold *rts_threshold; ··· 154 153 cmd_size += sizeof(struct host_cmd_tlv) + 155 154 bss_cfg->ssid.ssid_len; 156 155 tlv += sizeof(struct host_cmd_tlv) + bss_cfg->ssid.ssid_len; 156 + 157 + bcast_ssid = (struct host_cmd_tlv_bcast_ssid *)tlv; 158 + bcast_ssid->tlv.type = cpu_to_le16(TLV_TYPE_UAP_BCAST_SSID); 159 + bcast_ssid->tlv.len = 160 + cpu_to_le16(sizeof(bcast_ssid->bcast_ctl)); 161 + bcast_ssid->bcast_ctl = bss_cfg->bcast_ssid_ctl; 162 + cmd_size += sizeof(struct host_cmd_tlv_bcast_ssid); 163 + tlv += sizeof(struct host_cmd_tlv_bcast_ssid); 157 164 } 158 165 if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) { 159 166 chan_band = (struct host_cmd_tlv_channel_band *)tlv; ··· 425 416 if (!bss_cfg) 426 417 return -ENOMEM; 427 418 419 + mwifiex_set_sys_config_invalid_data(bss_cfg); 428 420 bss_cfg->band_cfg = BAND_CONFIG_MANUAL; 429 421 bss_cfg->channel = channel; 430 422
+1 -2
drivers/net/wireless/rt2x00/rt2x00.h
··· 396 396 * for hardware which doesn't support hardware 397 397 * sequence counting. 398 398 */ 399 - spinlock_t seqlock; 400 - u16 seqno; 399 + atomic_t seqno; 401 400 }; 402 401 403 402 static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
-1
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 277 277 else 278 278 rt2x00dev->intf_sta_count++; 279 279 280 - spin_lock_init(&intf->seqlock); 281 280 mutex_init(&intf->beacon_skb_mutex); 282 281 intf->beacon = entry; 283 282
+6 -7
drivers/net/wireless/rt2x00/rt2x00queue.c
··· 207 207 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 208 208 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 209 209 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); 210 + u16 seqno; 210 211 211 212 if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) 212 213 return; ··· 239 238 * sequence counting per-frame, since those will override the 240 239 * sequence counter given by mac80211. 241 240 */ 242 - spin_lock(&intf->seqlock); 243 - 244 241 if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) 245 - intf->seqno += 0x10; 242 + seqno = atomic_add_return(0x10, &intf->seqno); 243 + else 244 + seqno = atomic_read(&intf->seqno); 245 + 246 246 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); 247 - hdr->seq_ctrl |= cpu_to_le16(intf->seqno); 248 - 249 - spin_unlock(&intf->seqlock); 250 - 247 + hdr->seq_ctrl |= cpu_to_le16(seqno); 251 248 } 252 249 253 250 static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev,
+1 -1
net/bluetooth/af_bluetooth.c
··· 210 210 } 211 211 212 212 if (sk->sk_state == BT_CONNECTED || !newsock || 213 - test_bit(BT_DEFER_SETUP, &bt_sk(parent)->flags)) { 213 + test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) { 214 214 bt_accept_unlink(sk); 215 215 if (newsock) 216 216 sock_graft(sk, newsock);
+6 -1
net/mac80211/agg-rx.c
··· 145 145 struct tid_ampdu_rx *tid_rx; 146 146 unsigned long timeout; 147 147 148 + rcu_read_lock(); 148 149 tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[*ptid]); 149 - if (!tid_rx) 150 + if (!tid_rx) { 151 + rcu_read_unlock(); 150 152 return; 153 + } 151 154 152 155 timeout = tid_rx->last_rx + TU_TO_JIFFIES(tid_rx->timeout); 153 156 if (time_is_after_jiffies(timeout)) { 154 157 mod_timer(&tid_rx->session_timer, timeout); 158 + rcu_read_unlock(); 155 159 return; 156 160 } 161 + rcu_read_unlock(); 157 162 158 163 #ifdef CONFIG_MAC80211_HT_DEBUG 159 164 printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid);
+3 -3
net/mac80211/cfg.c
··· 533 533 sinfo.filled = 0; 534 534 sta_set_sinfo(sta, &sinfo); 535 535 536 - if (sinfo.filled | STATION_INFO_TX_BITRATE) 536 + if (sinfo.filled & STATION_INFO_TX_BITRATE) 537 537 data[i] = 100000 * 538 538 cfg80211_calculate_bitrate(&sinfo.txrate); 539 539 i++; 540 - if (sinfo.filled | STATION_INFO_RX_BITRATE) 540 + if (sinfo.filled & STATION_INFO_RX_BITRATE) 541 541 data[i] = 100000 * 542 542 cfg80211_calculate_bitrate(&sinfo.rxrate); 543 543 i++; 544 544 545 - if (sinfo.filled | STATION_INFO_SIGNAL_AVG) 545 + if (sinfo.filled & STATION_INFO_SIGNAL_AVG) 546 546 data[i] = (u8)sinfo.signal_avg; 547 547 i++; 548 548 } else {
+12
net/mac80211/iface.c
··· 637 637 ieee80211_configure_filter(local); 638 638 break; 639 639 default: 640 + mutex_lock(&local->mtx); 641 + if (local->hw_roc_dev == sdata->dev && 642 + local->hw_roc_channel) { 643 + /* ignore return value since this is racy */ 644 + drv_cancel_remain_on_channel(local); 645 + ieee80211_queue_work(&local->hw, &local->hw_roc_done); 646 + } 647 + mutex_unlock(&local->mtx); 648 + 649 + flush_work(&local->hw_roc_start); 650 + flush_work(&local->hw_roc_done); 651 + 640 652 flush_work(&sdata->work); 641 653 /* 642 654 * When we get here, the interface is marked down.
+27 -9
net/mac80211/mlme.c
··· 1220 1220 sdata->vif.bss_conf.qos = true; 1221 1221 } 1222 1222 1223 + static void __ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) 1224 + { 1225 + lockdep_assert_held(&sdata->local->mtx); 1226 + 1227 + sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | 1228 + IEEE80211_STA_BEACON_POLL); 1229 + ieee80211_run_deferred_scan(sdata->local); 1230 + } 1231 + 1232 + static void ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) 1233 + { 1234 + mutex_lock(&sdata->local->mtx); 1235 + __ieee80211_stop_poll(sdata); 1236 + mutex_unlock(&sdata->local->mtx); 1237 + } 1238 + 1223 1239 static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, 1224 1240 u16 capab, bool erp_valid, u8 erp) 1225 1241 { ··· 1301 1285 sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE; 1302 1286 1303 1287 /* just to be sure */ 1304 - sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | 1305 - IEEE80211_STA_BEACON_POLL); 1288 + ieee80211_stop_poll(sdata); 1306 1289 1307 1290 ieee80211_led_assoc(local, 1); 1308 1291 ··· 1471 1456 return; 1472 1457 } 1473 1458 1474 - ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL | 1475 - IEEE80211_STA_BEACON_POLL); 1459 + __ieee80211_stop_poll(sdata); 1476 1460 1477 1461 mutex_lock(&local->iflist_mtx); 1478 1462 ieee80211_recalc_ps(local, -1); ··· 1491 1477 round_jiffies_up(jiffies + 1492 1478 IEEE80211_CONNECTION_IDLE_TIME)); 1493 1479 out: 1494 - ieee80211_run_deferred_scan(local); 1495 1480 mutex_unlock(&local->mtx); 1496 1481 } 1497 1482 ··· 2421 2408 net_dbg_ratelimited("%s: cancelling probereq poll due to a received beacon\n", 2422 2409 sdata->name); 2423 2410 #endif 2411 + mutex_lock(&local->mtx); 2424 2412 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; 2413 + ieee80211_run_deferred_scan(local); 2414 + mutex_unlock(&local->mtx); 2415 + 2425 2416 mutex_lock(&local->iflist_mtx); 2426 2417 ieee80211_recalc_ps(local, -1); 2427 2418 mutex_unlock(&local->iflist_mtx); ··· 2612 2595 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 2613 2596 u8 frame_buf[DEAUTH_DISASSOC_LEN]; 2614 2597 2615 - ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL | 2616 - IEEE80211_STA_BEACON_POLL); 2598 + ieee80211_stop_poll(sdata); 2617 2599 2618 2600 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, 2619 2601 false, frame_buf); ··· 2890 2874 u32 flags; 2891 2875 2892 2876 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 2893 - sdata->u.mgd.flags &= ~(IEEE80211_STA_BEACON_POLL | 2894 - IEEE80211_STA_CONNECTION_POLL); 2877 + __ieee80211_stop_poll(sdata); 2895 2878 2896 2879 /* let's probe the connection once */ 2897 2880 flags = sdata->local->hw.flags; ··· 2959 2944 if (test_and_clear_bit(TMR_RUNNING_CHANSW, &ifmgd->timers_running)) 2960 2945 add_timer(&ifmgd->chswitch_timer); 2961 2946 ieee80211_sta_reset_beacon_monitor(sdata); 2947 + 2948 + mutex_lock(&sdata->local->mtx); 2962 2949 ieee80211_restart_sta_timer(sdata); 2950 + mutex_unlock(&sdata->local->mtx); 2963 2951 } 2964 2952 #endif 2965 2953
+16
net/mac80211/offchannel.c
··· 234 234 return; 235 235 } 236 236 237 + /* was never transmitted */ 238 + if (local->hw_roc_skb) { 239 + u64 cookie; 240 + 241 + cookie = local->hw_roc_cookie ^ 2; 242 + 243 + cfg80211_mgmt_tx_status(local->hw_roc_dev, cookie, 244 + local->hw_roc_skb->data, 245 + local->hw_roc_skb->len, false, 246 + GFP_KERNEL); 247 + 248 + kfree_skb(local->hw_roc_skb); 249 + local->hw_roc_skb = NULL; 250 + local->hw_roc_skb_for_status = NULL; 251 + } 252 + 237 253 if (!local->hw_roc_for_tx) 238 254 cfg80211_remain_on_channel_expired(local->hw_roc_dev, 239 255 local->hw_roc_cookie,
+2 -2
net/mac80211/sta_info.c
··· 378 378 /* make the station visible */ 379 379 sta_info_hash_add(local, sta); 380 380 381 - list_add(&sta->list, &local->sta_list); 381 + list_add_rcu(&sta->list, &local->sta_list); 382 382 383 383 set_sta_flag(sta, WLAN_STA_INSERTED); 384 384 ··· 688 688 if (ret) 689 689 return ret; 690 690 691 - list_del(&sta->list); 691 + list_del_rcu(&sta->list); 692 692 693 693 mutex_lock(&local->key_mtx); 694 694 for (i = 0; i < NUM_DEFAULT_KEYS; i++)
+6 -3
net/mac80211/tx.c
··· 1737 1737 __le16 fc; 1738 1738 struct ieee80211_hdr hdr; 1739 1739 struct ieee80211s_hdr mesh_hdr __maybe_unused; 1740 - struct mesh_path __maybe_unused *mppath = NULL; 1740 + struct mesh_path __maybe_unused *mppath = NULL, *mpath = NULL; 1741 1741 const u8 *encaps_data; 1742 1742 int encaps_len, skip_header_bytes; 1743 1743 int nh_pos, h_pos; ··· 1803 1803 goto fail; 1804 1804 } 1805 1805 rcu_read_lock(); 1806 - if (!is_multicast_ether_addr(skb->data)) 1807 - mppath = mpp_path_lookup(skb->data, sdata); 1806 + if (!is_multicast_ether_addr(skb->data)) { 1807 + mpath = mesh_path_lookup(skb->data, sdata); 1808 + if (!mpath) 1809 + mppath = mpp_path_lookup(skb->data, sdata); 1810 + } 1808 1811 1809 1812 /* 1810 1813 * Use address extension if it is a packet from
+1 -1
net/mac80211/util.c
··· 1271 1271 enum ieee80211_sta_state state; 1272 1272 1273 1273 for (state = IEEE80211_STA_NOTEXIST; 1274 - state < sta->sta_state - 1; state++) 1274 + state < sta->sta_state; state++) 1275 1275 WARN_ON(drv_sta_state(local, sta->sdata, sta, 1276 1276 state, state + 1)); 1277 1277 }
+5 -1
net/wireless/ibss.c
··· 42 42 cfg80211_hold_bss(bss_from_pub(bss)); 43 43 wdev->current_bss = bss_from_pub(bss); 44 44 45 + wdev->sme_state = CFG80211_SME_CONNECTED; 45 46 cfg80211_upload_connect_keys(wdev); 46 47 47 48 nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid, ··· 61 60 struct cfg80211_event *ev; 62 61 unsigned long flags; 63 62 64 - CFG80211_DEV_WARN_ON(!wdev->ssid_len); 63 + CFG80211_DEV_WARN_ON(wdev->sme_state != CFG80211_SME_CONNECTING); 65 64 66 65 ev = kzalloc(sizeof(*ev), gfp); 67 66 if (!ev) ··· 116 115 #ifdef CONFIG_CFG80211_WEXT 117 116 wdev->wext.ibss.channel = params->channel; 118 117 #endif 118 + wdev->sme_state = CFG80211_SME_CONNECTING; 119 119 err = rdev->ops->join_ibss(&rdev->wiphy, dev, params); 120 120 if (err) { 121 121 wdev->connect_keys = NULL; 122 + wdev->sme_state = CFG80211_SME_IDLE; 122 123 return err; 123 124 } 124 125 ··· 172 169 } 173 170 174 171 wdev->current_bss = NULL; 172 + wdev->sme_state = CFG80211_SME_IDLE; 175 173 wdev->ssid_len = 0; 176 174 #ifdef CONFIG_CFG80211_WEXT 177 175 if (!nowext)
+18 -1
net/wireless/util.c
··· 935 935 enum nl80211_iftype iftype) 936 936 { 937 937 struct wireless_dev *wdev_iter; 938 + u32 used_iftypes = BIT(iftype); 938 939 int num[NUM_NL80211_IFTYPES]; 939 940 int total = 1; 940 941 int i, j; ··· 962 961 963 962 num[wdev_iter->iftype]++; 964 963 total++; 964 + used_iftypes |= BIT(wdev_iter->iftype); 965 965 } 966 966 mutex_unlock(&rdev->devlist_mtx); 967 967 ··· 972 970 for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) { 973 971 const struct ieee80211_iface_combination *c; 974 972 struct ieee80211_iface_limit *limits; 973 + u32 all_iftypes = 0; 975 974 976 975 c = &rdev->wiphy.iface_combinations[i]; 977 976 ··· 987 984 if (rdev->wiphy.software_iftypes & BIT(iftype)) 988 985 continue; 989 986 for (j = 0; j < c->n_limits; j++) { 987 + all_iftypes |= limits[j].types; 990 988 if (!(limits[j].types & BIT(iftype))) 991 989 continue; 992 990 if (limits[j].max < num[iftype]) ··· 995 991 limits[j].max -= num[iftype]; 996 992 } 997 993 } 998 - /* yay, it fits */ 994 + 995 + /* 996 + * Finally check that all iftypes that we're currently 997 + * using are actually part of this combination. If they 998 + * aren't then we can't use this combination and have 999 + * to continue to the next. 1000 + */ 1001 + if ((all_iftypes & used_iftypes) != used_iftypes) 1002 + goto cont; 1003 + 1004 + /* 1005 + * This combination covered all interface types and 1006 + * supported the requested numbers, so we're good. 1007 + */ 999 1008 kfree(limits); 1000 1009 return 0; 1001 1010 cont: