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

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

+142 -52
+4 -5
drivers/bluetooth/btmrvl_main.c
··· 498 498 add_wait_queue(&thread->wait_q, &wait); 499 499 500 500 set_current_state(TASK_INTERRUPTIBLE); 501 + if (kthread_should_stop()) { 502 + BT_DBG("main_thread: break from main thread"); 503 + break; 504 + } 501 505 502 506 if (adapter->wakeup_tries || 503 507 ((!adapter->int_count) && ··· 516 512 remove_wait_queue(&thread->wait_q, &wait); 517 513 518 514 BT_DBG("main_thread woke up"); 519 - 520 - if (kthread_should_stop()) { 521 - BT_DBG("main_thread: break from main thread"); 522 - break; 523 - } 524 515 525 516 spin_lock_irqsave(&priv->driver_lock, flags); 526 517 if (adapter->int_count) {
+4
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
··· 930 930 brcmf_fws_del_interface(ifp); 931 931 brcmf_fws_deinit(drvr); 932 932 } 933 + if (drvr->iflist[0]) { 934 + free_netdev(ifp->ndev); 935 + drvr->iflist[0] = NULL; 936 + } 933 937 if (p2p_ifp) { 934 938 free_netdev(p2p_ifp->ndev); 935 939 drvr->iflist[1] = NULL;
+2 -15
drivers/net/wireless/brcm80211/brcmsmac/main.c
··· 3074 3074 */ 3075 3075 static bool brcms_c_ps_allowed(struct brcms_c_info *wlc) 3076 3076 { 3077 - /* disallow PS when one of the following global conditions meets */ 3078 - if (!wlc->pub->associated) 3079 - return false; 3080 - 3081 - /* disallow PS when one of these meets when not scanning */ 3082 - if (wlc->filter_flags & FIF_PROMISC_IN_BSS) 3083 - return false; 3084 - 3085 - if (wlc->bsscfg->type == BRCMS_TYPE_AP) 3086 - return false; 3087 - 3088 - if (wlc->bsscfg->type == BRCMS_TYPE_ADHOC) 3089 - return false; 3090 - 3091 - return true; 3077 + /* not supporting PS so always return false for now */ 3078 + return false; 3092 3079 } 3093 3080 3094 3081 static void brcms_c_statsupd(struct brcms_c_info *wlc)
+1
drivers/net/wireless/iwlegacy/3945-rs.c
··· 816 816 rs_sta->last_txrate_idx = idx; 817 817 info->control.rates[0].idx = rs_sta->last_txrate_idx; 818 818 } 819 + info->control.rates[0].count = 1; 819 820 820 821 D_RATE("leave: %d\n", idx); 821 822 }
+1 -1
drivers/net/wireless/iwlegacy/4965-rs.c
··· 2268 2268 info->control.rates[0].flags = 0; 2269 2269 } 2270 2270 info->control.rates[0].idx = rate_idx; 2271 - 2271 + info->control.rates[0].count = 1; 2272 2272 } 2273 2273 2274 2274 static void *
+1 -1
drivers/net/wireless/iwlwifi/dvm/rs.c
··· 2799 2799 info->control.rates[0].flags = 0; 2800 2800 } 2801 2801 info->control.rates[0].idx = rate_idx; 2802 - 2802 + info->control.rates[0].count = 1; 2803 2803 } 2804 2804 2805 2805 static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
+1 -1
drivers/net/wireless/iwlwifi/dvm/rxon.c
··· 1378 1378 struct iwl_chain_noise_data *data = &priv->chain_noise_data; 1379 1379 int ret; 1380 1380 1381 - if (!(priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED)) 1381 + if (priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED) 1382 1382 return; 1383 1383 1384 1384 if ((data->state == IWL_CHAIN_NOISE_ALIVE) &&
+2
drivers/net/wireless/iwlwifi/iwl-drv.c
··· 1000 1000 */ 1001 1001 if (load_module) { 1002 1002 err = request_module("%s", op->name); 1003 + #ifdef CONFIG_IWLWIFI_OPMODE_MODULAR 1003 1004 if (err) 1004 1005 IWL_ERR(drv, 1005 1006 "failed to load module %s (error %d), is dynamic loading enabled?\n", 1006 1007 op->name, err); 1008 + #endif 1007 1009 } 1008 1010 return; 1009 1011
+1
drivers/net/wireless/iwlwifi/mvm/rs.c
··· 2546 2546 info->control.rates[0].flags = 0; 2547 2547 } 2548 2548 info->control.rates[0].idx = rate_idx; 2549 + info->control.rates[0].count = 1; 2549 2550 } 2550 2551 2551 2552 static void *rs_alloc_sta(void *mvm_rate, struct ieee80211_sta *sta,
+2 -1
drivers/net/wireless/iwlwifi/mvm/tx.c
··· 180 180 tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); 181 181 return; 182 182 } else if (ieee80211_is_back_req(fc)) { 183 - tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); 183 + tx_cmd->tx_flags |= 184 + cpu_to_le32(TX_CMD_FLG_ACK | TX_CMD_FLG_BAR); 184 185 } 185 186 186 187 /* HT rate doesn't make sense for a non data frame */
+18 -11
drivers/net/wireless/rt2x00/rt2800lib.c
··· 3027 3027 * TODO: we do not use +6 dBm option to do not increase power beyond 3028 3028 * regulatory limit, however this could be utilized for devices with 3029 3029 * CAPABILITY_POWER_LIMIT. 3030 + * 3031 + * TODO: add different temperature compensation code for RT3290 & RT5390 3032 + * to allow to use BBP_R1 for those chips. 3030 3033 */ 3031 - rt2800_bbp_read(rt2x00dev, 1, &r1); 3032 - if (delta <= -12) { 3033 - power_ctrl = 2; 3034 - delta += 12; 3035 - } else if (delta <= -6) { 3036 - power_ctrl = 1; 3037 - delta += 6; 3038 - } else { 3039 - power_ctrl = 0; 3034 + if (!rt2x00_rt(rt2x00dev, RT3290) && 3035 + !rt2x00_rt(rt2x00dev, RT5390)) { 3036 + rt2800_bbp_read(rt2x00dev, 1, &r1); 3037 + if (delta <= -12) { 3038 + power_ctrl = 2; 3039 + delta += 12; 3040 + } else if (delta <= -6) { 3041 + power_ctrl = 1; 3042 + delta += 6; 3043 + } else { 3044 + power_ctrl = 0; 3045 + } 3046 + rt2x00_set_field8(&r1, BBP1_TX_POWER_CTRL, power_ctrl); 3047 + rt2800_bbp_write(rt2x00dev, 1, r1); 3040 3048 } 3041 - rt2x00_set_field8(&r1, BBP1_TX_POWER_CTRL, power_ctrl); 3042 - rt2800_bbp_write(rt2x00dev, 1, r1); 3049 + 3043 3050 offset = TX_PWR_CFG_0; 3044 3051 3045 3052 for (i = 0; i < EEPROM_TXPOWER_BYRATE_SIZE; i += 2) {
+10 -5
net/bluetooth/hci_core.c
··· 341 341 342 342 static void bredr_setup(struct hci_request *req) 343 343 { 344 - struct hci_cp_delete_stored_link_key cp; 345 344 __le16 param; 346 345 __u8 flt_type; 347 346 ··· 363 364 /* Connection accept timeout ~20 secs */ 364 365 param = __constant_cpu_to_le16(0x7d00); 365 366 hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, &param); 366 - 367 - bacpy(&cp.bdaddr, BDADDR_ANY); 368 - cp.delete_all = 0x01; 369 - hci_req_add(req, HCI_OP_DELETE_STORED_LINK_KEY, sizeof(cp), &cp); 370 367 371 368 /* Read page scan parameters */ 372 369 if (req->hdev->hci_ver > BLUETOOTH_VER_1_1) { ··· 596 601 { 597 602 struct hci_dev *hdev = req->hdev; 598 603 u8 p; 604 + 605 + /* Only send HCI_Delete_Stored_Link_Key if it is supported */ 606 + if (hdev->commands[6] & 0x80) { 607 + struct hci_cp_delete_stored_link_key cp; 608 + 609 + bacpy(&cp.bdaddr, BDADDR_ANY); 610 + cp.delete_all = 0x01; 611 + hci_req_add(req, HCI_OP_DELETE_STORED_LINK_KEY, 612 + sizeof(cp), &cp); 613 + } 599 614 600 615 if (hdev->commands[5] & 0x10) 601 616 hci_setup_link_policy(req);
+3
net/bluetooth/l2cap_core.c
··· 2852 2852 BT_DBG("conn %p, code 0x%2.2x, ident 0x%2.2x, len %u", 2853 2853 conn, code, ident, dlen); 2854 2854 2855 + if (conn->mtu < L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE) 2856 + return NULL; 2857 + 2855 2858 len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen; 2856 2859 count = min_t(unsigned int, conn->mtu, len); 2857 2860
+6
net/mac80211/cfg.c
··· 1057 1057 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); 1058 1058 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); 1059 1059 1060 + if (sdata->wdev.cac_started) { 1061 + cancel_delayed_work_sync(&sdata->dfs_cac_timer_work); 1062 + cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED, 1063 + GFP_KERNEL); 1064 + } 1065 + 1060 1066 drv_stop_ap(sdata->local, sdata); 1061 1067 1062 1068 /* free all potentially still buffered bcast frames */
+3 -2
net/mac80211/ieee80211_i.h
··· 1497 1497 ieee80211_tx_skb_tid(sdata, skb, 7); 1498 1498 } 1499 1499 1500 - u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, bool action, 1500 + u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, 1501 1501 struct ieee802_11_elems *elems, 1502 1502 u64 filter, u32 crc); 1503 - static inline void ieee802_11_parse_elems(u8 *start, size_t len, bool action, 1503 + static inline void ieee802_11_parse_elems(const u8 *start, size_t len, 1504 + bool action, 1504 1505 struct ieee802_11_elems *elems) 1505 1506 { 1506 1507 ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0);
+80 -7
net/mac80211/mlme.c
··· 2522 2522 u16 capab_info, aid; 2523 2523 struct ieee802_11_elems elems; 2524 2524 struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf; 2525 + const struct cfg80211_bss_ies *bss_ies = NULL; 2526 + struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data; 2525 2527 u32 changed = 0; 2526 2528 int err; 2529 + bool ret; 2527 2530 2528 2531 /* AssocResp and ReassocResp have identical structure */ 2529 2532 ··· 2558 2555 ifmgd->aid = aid; 2559 2556 2560 2557 /* 2558 + * Some APs are erroneously not including some information in their 2559 + * (re)association response frames. Try to recover by using the data 2560 + * from the beacon or probe response. This seems to afflict mobile 2561 + * 2G/3G/4G wifi routers, reported models include the "Onda PN51T", 2562 + * "Vodafone PocketWiFi 2", "ZTE MF60" and a similar T-Mobile device. 2563 + */ 2564 + if ((assoc_data->wmm && !elems.wmm_param) || 2565 + (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && 2566 + (!elems.ht_cap_elem || !elems.ht_operation)) || 2567 + (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) && 2568 + (!elems.vht_cap_elem || !elems.vht_operation))) { 2569 + const struct cfg80211_bss_ies *ies; 2570 + struct ieee802_11_elems bss_elems; 2571 + 2572 + rcu_read_lock(); 2573 + ies = rcu_dereference(cbss->ies); 2574 + if (ies) 2575 + bss_ies = kmemdup(ies, sizeof(*ies) + ies->len, 2576 + GFP_ATOMIC); 2577 + rcu_read_unlock(); 2578 + if (!bss_ies) 2579 + return false; 2580 + 2581 + ieee802_11_parse_elems(bss_ies->data, bss_ies->len, 2582 + false, &bss_elems); 2583 + if (assoc_data->wmm && 2584 + !elems.wmm_param && bss_elems.wmm_param) { 2585 + elems.wmm_param = bss_elems.wmm_param; 2586 + sdata_info(sdata, 2587 + "AP bug: WMM param missing from AssocResp\n"); 2588 + } 2589 + 2590 + /* 2591 + * Also check if we requested HT/VHT, otherwise the AP doesn't 2592 + * have to include the IEs in the (re)association response. 2593 + */ 2594 + if (!elems.ht_cap_elem && bss_elems.ht_cap_elem && 2595 + !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) { 2596 + elems.ht_cap_elem = bss_elems.ht_cap_elem; 2597 + sdata_info(sdata, 2598 + "AP bug: HT capability missing from AssocResp\n"); 2599 + } 2600 + if (!elems.ht_operation && bss_elems.ht_operation && 2601 + !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) { 2602 + elems.ht_operation = bss_elems.ht_operation; 2603 + sdata_info(sdata, 2604 + "AP bug: HT operation missing from AssocResp\n"); 2605 + } 2606 + if (!elems.vht_cap_elem && bss_elems.vht_cap_elem && 2607 + !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) { 2608 + elems.vht_cap_elem = bss_elems.vht_cap_elem; 2609 + sdata_info(sdata, 2610 + "AP bug: VHT capa missing from AssocResp\n"); 2611 + } 2612 + if (!elems.vht_operation && bss_elems.vht_operation && 2613 + !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) { 2614 + elems.vht_operation = bss_elems.vht_operation; 2615 + sdata_info(sdata, 2616 + "AP bug: VHT operation missing from AssocResp\n"); 2617 + } 2618 + } 2619 + 2620 + /* 2561 2621 * We previously checked these in the beacon/probe response, so 2562 2622 * they should be present here. This is just a safety net. 2563 2623 */ 2564 2624 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && 2565 2625 (!elems.wmm_param || !elems.ht_cap_elem || !elems.ht_operation)) { 2566 2626 sdata_info(sdata, 2567 - "HT AP is missing WMM params or HT capability/operation in AssocResp\n"); 2568 - return false; 2627 + "HT AP is missing WMM params or HT capability/operation\n"); 2628 + ret = false; 2629 + goto out; 2569 2630 } 2570 2631 2571 2632 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) && 2572 2633 (!elems.vht_cap_elem || !elems.vht_operation)) { 2573 2634 sdata_info(sdata, 2574 - "VHT AP is missing VHT capability/operation in AssocResp\n"); 2575 - return false; 2635 + "VHT AP is missing VHT capability/operation\n"); 2636 + ret = false; 2637 + goto out; 2576 2638 } 2577 2639 2578 2640 mutex_lock(&sdata->local->sta_mtx); ··· 2648 2580 sta = sta_info_get(sdata, cbss->bssid); 2649 2581 if (WARN_ON(!sta)) { 2650 2582 mutex_unlock(&sdata->local->sta_mtx); 2651 - return false; 2583 + ret = false; 2584 + goto out; 2652 2585 } 2653 2586 2654 2587 sband = local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)]; ··· 2702 2633 sta->sta.addr); 2703 2634 WARN_ON(__sta_info_destroy(sta)); 2704 2635 mutex_unlock(&sdata->local->sta_mtx); 2705 - return false; 2636 + ret = false; 2637 + goto out; 2706 2638 } 2707 2639 2708 2640 mutex_unlock(&sdata->local->sta_mtx); ··· 2743 2673 ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt); 2744 2674 ieee80211_sta_reset_beacon_monitor(sdata); 2745 2675 2746 - return true; 2676 + ret = true; 2677 + out: 2678 + kfree(bss_ies); 2679 + return ret; 2747 2680 } 2748 2681 2749 2682 static enum rx_mgmt_action __must_check
+1 -1
net/mac80211/rate.c
··· 615 615 if (rates[i].idx < 0) 616 616 break; 617 617 618 - rate_idx_match_mask(&rates[i], sband, mask, chan_width, 618 + rate_idx_match_mask(&rates[i], sband, chan_width, mask, 619 619 mcs_mask); 620 620 } 621 621 }
+2 -2
net/mac80211/util.c
··· 661 661 } 662 662 EXPORT_SYMBOL(ieee80211_queue_delayed_work); 663 663 664 - u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, bool action, 664 + u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, 665 665 struct ieee802_11_elems *elems, 666 666 u64 filter, u32 crc) 667 667 { 668 668 size_t left = len; 669 - u8 *pos = start; 669 + const u8 *pos = start; 670 670 bool calc_crc = filter != 0; 671 671 DECLARE_BITMAP(seen_elems, 256); 672 672 const u8 *ie;