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

+258 -174
+2
drivers/bcma/driver_pci_host.c
··· 404 404 return; 405 405 } 406 406 407 + spin_lock_init(&pc_host->cfgspace_lock); 408 + 407 409 pc->host_controller = pc_host; 408 410 pc_host->pci_controller.io_resource = &pc_host->io_resource; 409 411 pc_host->pci_controller.mem_resource = &pc_host->mem_resource;
+1 -1
drivers/net/wireless/ath/ath9k/common.h
··· 27 27 #define WME_MAX_BA WME_BA_BMP_SIZE 28 28 #define ATH_TID_MAX_BUFS (2 * WME_MAX_BA) 29 29 30 - #define ATH_RSSI_DUMMY_MARKER 0x127 30 + #define ATH_RSSI_DUMMY_MARKER 127 31 31 #define ATH_RSSI_LPF_LEN 10 32 32 #define RSSI_LPF_THRESHOLD -20 33 33 #define ATH_RSSI_EP_MULTIPLIER (1<<7)
+1
drivers/net/wireless/ath/ath9k/htc.h
··· 22 22 #include <linux/firmware.h> 23 23 #include <linux/skbuff.h> 24 24 #include <linux/netdevice.h> 25 + #include <linux/etherdevice.h> 25 26 #include <linux/leds.h> 26 27 #include <linux/slab.h> 27 28 #include <net/mac80211.h>
+11 -7
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
··· 1067 1067 1068 1068 last_rssi = priv->rx.last_rssi; 1069 1069 1070 - if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) 1071 - rxbuf->rxstatus.rs_rssi = ATH_EP_RND(last_rssi, 1072 - ATH_RSSI_EP_MULTIPLIER); 1070 + if (ieee80211_is_beacon(hdr->frame_control) && 1071 + !is_zero_ether_addr(common->curbssid) && 1072 + ether_addr_equal(hdr->addr3, common->curbssid)) { 1073 + s8 rssi = rxbuf->rxstatus.rs_rssi; 1073 1074 1074 - if (rxbuf->rxstatus.rs_rssi < 0) 1075 - rxbuf->rxstatus.rs_rssi = 0; 1075 + if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) 1076 + rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER); 1076 1077 1077 - if (ieee80211_is_beacon(fc)) 1078 - priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi; 1078 + if (rssi < 0) 1079 + rssi = 0; 1080 + 1081 + priv->ah->stats.avgbrssi = rssi; 1082 + } 1079 1083 1080 1084 rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); 1081 1085 rx_status->band = hw->conf.channel->band;
+3 -1
drivers/net/wireless/ath/ath9k/hw.c
··· 1463 1463 reset_type = ATH9K_RESET_POWER_ON; 1464 1464 else 1465 1465 reset_type = ATH9K_RESET_COLD; 1466 - } 1466 + } else if (ah->chip_fullsleep || REG_READ(ah, AR_Q_TXE) || 1467 + (REG_READ(ah, AR_CR) & AR_CR_RXE)) 1468 + reset_type = ATH9K_RESET_COLD; 1467 1469 1468 1470 if (!ath9k_hw_set_reset_reg(ah, reset_type)) 1469 1471 return false;
+4 -6
drivers/net/wireless/iwlwifi/iwl-devtrace.h
··· 349 349 TRACE_EVENT(iwlwifi_dev_hcmd, 350 350 TP_PROTO(const struct device *dev, 351 351 struct iwl_host_cmd *cmd, u16 total_size, 352 - const void *hdr, size_t hdr_len), 353 - TP_ARGS(dev, cmd, total_size, hdr, hdr_len), 352 + struct iwl_cmd_header *hdr), 353 + TP_ARGS(dev, cmd, total_size, hdr), 354 354 TP_STRUCT__entry( 355 355 DEV_ENTRY 356 356 __dynamic_array(u8, hcmd, total_size) 357 357 __field(u32, flags) 358 358 ), 359 359 TP_fast_assign( 360 - int i, offset = hdr_len; 360 + int i, offset = sizeof(*hdr); 361 361 362 362 DEV_ASSIGN; 363 363 __entry->flags = cmd->flags; 364 - memcpy(__get_dynamic_array(hcmd), hdr, hdr_len); 364 + memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr)); 365 365 366 366 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { 367 367 if (!cmd->len[i]) 368 - continue; 369 - if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) 370 368 continue; 371 369 memcpy((u8 *)__get_dynamic_array(hcmd) + offset, 372 370 cmd->data[i], cmd->len[i]);
-16
drivers/net/wireless/iwlwifi/iwl-phy-db.c
··· 136 136 u8 data[]; 137 137 } __packed; 138 138 139 - #define IWL_PHY_DB_STATIC_PIC cpu_to_le32(0x21436587) 140 - static inline void iwl_phy_db_test_pic(__le32 pic) 141 - { 142 - WARN_ON(IWL_PHY_DB_STATIC_PIC != pic); 143 - } 144 - 145 139 struct iwl_phy_db *iwl_phy_db_init(struct iwl_trans *trans) 146 140 { 147 141 struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db), ··· 254 260 (size - CHANNEL_NUM_SIZE) / phy_db->channel_num; 255 261 } 256 262 257 - /* Test PIC */ 258 - if (type != IWL_PHY_DB_CFG) 259 - iwl_phy_db_test_pic(*(((__le32 *)phy_db_notif->data) + 260 - (size / sizeof(__le32)) - 1)); 261 - 262 263 IWL_DEBUG_INFO(phy_db->trans, 263 264 "%s(%d): [PHYDB]SET: Type %d , Size: %d\n", 264 265 __func__, __LINE__, type, size); ··· 360 371 *data = entry->data; 361 372 *size = entry->size; 362 373 } 363 - 364 - /* Test PIC */ 365 - if (type != IWL_PHY_DB_CFG) 366 - iwl_phy_db_test_pic(*(((__le32 *)*data) + 367 - (*size / sizeof(__le32)) - 1)); 368 374 369 375 IWL_DEBUG_INFO(phy_db->trans, 370 376 "%s(%d): [PHYDB] GET: Type %d , Size: %d\n",
+77 -27
drivers/net/wireless/iwlwifi/mvm/d3.c
··· 61 61 * 62 62 *****************************************************************************/ 63 63 64 + #include <linux/etherdevice.h> 64 65 #include <net/cfg80211.h> 65 66 #include <net/ipv6.h> 66 67 #include "iwl-modparams.h" ··· 193 192 sizeof(wkc), &wkc); 194 193 data->error = ret != 0; 195 194 195 + mvm->ptk_ivlen = key->iv_len; 196 + mvm->ptk_icvlen = key->icv_len; 197 + mvm->gtk_ivlen = key->iv_len; 198 + mvm->gtk_icvlen = key->icv_len; 199 + 196 200 /* don't upload key again */ 197 201 goto out_unlock; 198 202 } ··· 310 304 */ 311 305 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { 312 306 key->hw_key_idx = 0; 307 + mvm->ptk_ivlen = key->iv_len; 308 + mvm->ptk_icvlen = key->icv_len; 313 309 } else { 314 310 data->gtk_key_idx++; 315 311 key->hw_key_idx = data->gtk_key_idx; 312 + mvm->gtk_ivlen = key->iv_len; 313 + mvm->gtk_icvlen = key->icv_len; 316 314 } 317 315 318 316 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, true); ··· 659 649 /* We reprogram keys and shouldn't allocate new key indices */ 660 650 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); 661 651 652 + mvm->ptk_ivlen = 0; 653 + mvm->ptk_icvlen = 0; 654 + mvm->ptk_ivlen = 0; 655 + mvm->ptk_icvlen = 0; 656 + 662 657 /* 663 658 * The D3 firmware still hardcodes the AP station ID for the 664 659 * BSS we're associated with as 0. As a result, we have to move ··· 798 783 struct iwl_wowlan_status *status; 799 784 u32 reasons; 800 785 int ret, len; 801 - bool pkt8023 = false; 802 786 struct sk_buff *pkt = NULL; 803 787 804 788 iwl_trans_read_mem_bytes(mvm->trans, base, ··· 838 824 status = (void *)cmd.resp_pkt->data; 839 825 840 826 if (len - sizeof(struct iwl_cmd_header) != 841 - sizeof(*status) + le32_to_cpu(status->wake_packet_bufsize)) { 827 + sizeof(*status) + 828 + ALIGN(le32_to_cpu(status->wake_packet_bufsize), 4)) { 842 829 IWL_ERR(mvm, "Invalid WoWLAN status response!\n"); 843 830 goto out; 844 831 } ··· 851 836 goto report; 852 837 } 853 838 854 - if (reasons & IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET) { 839 + if (reasons & IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET) 855 840 wakeup.magic_pkt = true; 856 - pkt8023 = true; 857 - } 858 841 859 - if (reasons & IWL_WOWLAN_WAKEUP_BY_PATTERN) { 842 + if (reasons & IWL_WOWLAN_WAKEUP_BY_PATTERN) 860 843 wakeup.pattern_idx = 861 844 le16_to_cpu(status->pattern_number); 862 - pkt8023 = true; 863 - } 864 845 865 846 if (reasons & (IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON | 866 847 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH)) 867 848 wakeup.disconnect = true; 868 849 869 - if (reasons & IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE) { 850 + if (reasons & IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE) 870 851 wakeup.gtk_rekey_failure = true; 871 - pkt8023 = true; 872 - } 873 852 874 - if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED) { 853 + if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED) 875 854 wakeup.rfkill_release = true; 876 - pkt8023 = true; 877 - } 878 855 879 - if (reasons & IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST) { 856 + if (reasons & IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST) 880 857 wakeup.eap_identity_req = true; 881 - pkt8023 = true; 882 - } 883 858 884 - if (reasons & IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE) { 859 + if (reasons & IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE) 885 860 wakeup.four_way_handshake = true; 886 - pkt8023 = true; 887 - } 888 861 889 862 if (status->wake_packet_bufsize) { 890 - u32 pktsize = le32_to_cpu(status->wake_packet_bufsize); 891 - u32 pktlen = le32_to_cpu(status->wake_packet_length); 863 + int pktsize = le32_to_cpu(status->wake_packet_bufsize); 864 + int pktlen = le32_to_cpu(status->wake_packet_length); 865 + const u8 *pktdata = status->wake_packet; 866 + struct ieee80211_hdr *hdr = (void *)pktdata; 867 + int truncated = pktlen - pktsize; 892 868 893 - if (pkt8023) { 869 + /* this would be a firmware bug */ 870 + if (WARN_ON_ONCE(truncated < 0)) 871 + truncated = 0; 872 + 873 + if (ieee80211_is_data(hdr->frame_control)) { 874 + int hdrlen = ieee80211_hdrlen(hdr->frame_control); 875 + int ivlen = 0, icvlen = 4; /* also FCS */ 876 + 894 877 pkt = alloc_skb(pktsize, GFP_KERNEL); 895 878 if (!pkt) 896 879 goto report; 897 - memcpy(skb_put(pkt, pktsize), status->wake_packet, 898 - pktsize); 880 + 881 + memcpy(skb_put(pkt, hdrlen), pktdata, hdrlen); 882 + pktdata += hdrlen; 883 + pktsize -= hdrlen; 884 + 885 + if (ieee80211_has_protected(hdr->frame_control)) { 886 + if (is_multicast_ether_addr(hdr->addr1)) { 887 + ivlen = mvm->gtk_ivlen; 888 + icvlen += mvm->gtk_icvlen; 889 + } else { 890 + ivlen = mvm->ptk_ivlen; 891 + icvlen += mvm->ptk_icvlen; 892 + } 893 + } 894 + 895 + /* if truncated, FCS/ICV is (partially) gone */ 896 + if (truncated >= icvlen) { 897 + icvlen = 0; 898 + truncated -= icvlen; 899 + } else { 900 + icvlen -= truncated; 901 + truncated = 0; 902 + } 903 + 904 + pktsize -= ivlen + icvlen; 905 + pktdata += ivlen; 906 + 907 + memcpy(skb_put(pkt, pktsize), pktdata, pktsize); 908 + 899 909 if (ieee80211_data_to_8023(pkt, vif->addr, vif->type)) 900 910 goto report; 901 911 wakeup.packet = pkt->data; 902 912 wakeup.packet_present_len = pkt->len; 903 - wakeup.packet_len = pkt->len - (pktlen - pktsize); 913 + wakeup.packet_len = pkt->len - truncated; 904 914 wakeup.packet_80211 = false; 905 915 } else { 916 + int fcslen = 4; 917 + 918 + if (truncated >= 4) { 919 + truncated -= 4; 920 + fcslen = 0; 921 + } else { 922 + fcslen -= truncated; 923 + truncated = 0; 924 + } 925 + pktsize -= fcslen; 906 926 wakeup.packet = status->wake_packet; 907 927 wakeup.packet_present_len = pktsize; 908 - wakeup.packet_len = pktlen; 928 + wakeup.packet_len = pktlen - truncated; 909 929 wakeup.packet_80211 = true; 910 930 } 911 931 }
+14 -5
drivers/net/wireless/iwlwifi/mvm/mac80211.c
··· 557 557 return ret; 558 558 } 559 559 560 - static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, 561 - struct ieee80211_vif *vif) 560 + static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, 561 + struct ieee80211_vif *vif) 562 562 { 563 - struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 564 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 565 563 u32 tfd_msk = 0, ac; 566 564 567 565 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) ··· 592 594 */ 593 595 flush_work(&mvm->sta_drained_wk); 594 596 } 597 + } 598 + 599 + static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, 600 + struct ieee80211_vif *vif) 601 + { 602 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 603 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 604 + 605 + iwl_mvm_prepare_mac_removal(mvm, vif); 595 606 596 607 mutex_lock(&mvm->mutex); 597 608 598 609 /* 599 610 * For AP/GO interface, the tear down of the resources allocated to the 600 - * interface should be handled as part of the bss_info_changed flow. 611 + * interface is be handled as part of the stop_ap flow. 601 612 */ 602 613 if (vif->type == NL80211_IFTYPE_AP) { 603 614 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->bcast_sta); ··· 769 762 { 770 763 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 771 764 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 765 + 766 + iwl_mvm_prepare_mac_removal(mvm, vif); 772 767 773 768 mutex_lock(&mvm->mutex); 774 769
+4
drivers/net/wireless/iwlwifi/mvm/mvm.h
··· 327 327 struct led_classdev led; 328 328 329 329 struct ieee80211_vif *p2p_device_vif; 330 + 331 + #ifdef CONFIG_PM_SLEEP 332 + int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen; 333 + #endif 330 334 }; 331 335 332 336 /* Extract MVM priv from op_mode and _hw */
+9
drivers/net/wireless/iwlwifi/pcie/internal.h
··· 182 182 #define TFD_TX_CMD_SLOTS 256 183 183 #define TFD_CMD_SLOTS 32 184 184 185 + /* 186 + * The FH will write back to the first TB only, so we need 187 + * to copy some data into the buffer regardless of whether 188 + * it should be mapped or not. This indicates how much to 189 + * copy, even for HCMDs it must be big enough to fit the 190 + * DRAM scratch from the TX cmd, at least 16 bytes. 191 + */ 192 + #define IWL_HCMD_MIN_COPY_SIZE 16 193 + 185 194 struct iwl_pcie_txq_entry { 186 195 struct iwl_device_cmd *cmd; 187 196 struct iwl_device_cmd *copy_cmd;
+58 -17
drivers/net/wireless/iwlwifi/pcie/tx.c
··· 1152 1152 void *dup_buf = NULL; 1153 1153 dma_addr_t phys_addr; 1154 1154 int idx; 1155 - u16 copy_size, cmd_size; 1155 + u16 copy_size, cmd_size, dma_size; 1156 1156 bool had_nocopy = false; 1157 1157 int i; 1158 1158 u32 cmd_pos; 1159 + const u8 *cmddata[IWL_MAX_CMD_TFDS]; 1160 + u16 cmdlen[IWL_MAX_CMD_TFDS]; 1159 1161 1160 1162 copy_size = sizeof(out_cmd->hdr); 1161 1163 cmd_size = sizeof(out_cmd->hdr); ··· 1166 1164 BUILD_BUG_ON(IWL_MAX_CMD_TFDS > IWL_NUM_OF_TBS - 1); 1167 1165 1168 1166 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { 1167 + cmddata[i] = cmd->data[i]; 1168 + cmdlen[i] = cmd->len[i]; 1169 + 1169 1170 if (!cmd->len[i]) 1170 1171 continue; 1172 + 1173 + /* need at least IWL_HCMD_MIN_COPY_SIZE copied */ 1174 + if (copy_size < IWL_HCMD_MIN_COPY_SIZE) { 1175 + int copy = IWL_HCMD_MIN_COPY_SIZE - copy_size; 1176 + 1177 + if (copy > cmdlen[i]) 1178 + copy = cmdlen[i]; 1179 + cmdlen[i] -= copy; 1180 + cmddata[i] += copy; 1181 + copy_size += copy; 1182 + } 1183 + 1171 1184 if (cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY) { 1172 1185 had_nocopy = true; 1173 1186 if (WARN_ON(cmd->dataflags[i] & IWL_HCMD_DFL_DUP)) { ··· 1202 1185 goto free_dup_buf; 1203 1186 } 1204 1187 1205 - dup_buf = kmemdup(cmd->data[i], cmd->len[i], 1188 + dup_buf = kmemdup(cmddata[i], cmdlen[i], 1206 1189 GFP_ATOMIC); 1207 1190 if (!dup_buf) 1208 1191 return -ENOMEM; ··· 1212 1195 idx = -EINVAL; 1213 1196 goto free_dup_buf; 1214 1197 } 1215 - copy_size += cmd->len[i]; 1198 + copy_size += cmdlen[i]; 1216 1199 } 1217 1200 cmd_size += cmd->len[i]; 1218 1201 } ··· 1259 1242 1260 1243 /* and copy the data that needs to be copied */ 1261 1244 cmd_pos = offsetof(struct iwl_device_cmd, payload); 1245 + copy_size = sizeof(out_cmd->hdr); 1262 1246 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { 1263 - if (!cmd->len[i]) 1247 + int copy = 0; 1248 + 1249 + if (!cmd->len) 1264 1250 continue; 1265 - if (cmd->dataflags[i] & (IWL_HCMD_DFL_NOCOPY | 1266 - IWL_HCMD_DFL_DUP)) 1267 - break; 1268 - memcpy((u8 *)out_cmd + cmd_pos, cmd->data[i], cmd->len[i]); 1269 - cmd_pos += cmd->len[i]; 1251 + 1252 + /* need at least IWL_HCMD_MIN_COPY_SIZE copied */ 1253 + if (copy_size < IWL_HCMD_MIN_COPY_SIZE) { 1254 + copy = IWL_HCMD_MIN_COPY_SIZE - copy_size; 1255 + 1256 + if (copy > cmd->len[i]) 1257 + copy = cmd->len[i]; 1258 + } 1259 + 1260 + /* copy everything if not nocopy/dup */ 1261 + if (!(cmd->dataflags[i] & (IWL_HCMD_DFL_NOCOPY | 1262 + IWL_HCMD_DFL_DUP))) 1263 + copy = cmd->len[i]; 1264 + 1265 + if (copy) { 1266 + memcpy((u8 *)out_cmd + cmd_pos, cmd->data[i], copy); 1267 + cmd_pos += copy; 1268 + copy_size += copy; 1269 + } 1270 1270 } 1271 1271 1272 1272 WARN_ON_ONCE(txq->entries[idx].copy_cmd); ··· 1309 1275 out_cmd->hdr.cmd, le16_to_cpu(out_cmd->hdr.sequence), 1310 1276 cmd_size, q->write_ptr, idx, trans_pcie->cmd_queue); 1311 1277 1312 - phys_addr = dma_map_single(trans->dev, &out_cmd->hdr, copy_size, 1278 + /* 1279 + * If the entire command is smaller than IWL_HCMD_MIN_COPY_SIZE, we must 1280 + * still map at least that many bytes for the hardware to write back to. 1281 + * We have enough space, so that's not a problem. 1282 + */ 1283 + dma_size = max_t(u16, copy_size, IWL_HCMD_MIN_COPY_SIZE); 1284 + 1285 + phys_addr = dma_map_single(trans->dev, &out_cmd->hdr, dma_size, 1313 1286 DMA_BIDIRECTIONAL); 1314 1287 if (unlikely(dma_mapping_error(trans->dev, phys_addr))) { 1315 1288 idx = -ENOMEM; ··· 1324 1283 } 1325 1284 1326 1285 dma_unmap_addr_set(out_meta, mapping, phys_addr); 1327 - dma_unmap_len_set(out_meta, len, copy_size); 1286 + dma_unmap_len_set(out_meta, len, dma_size); 1328 1287 1329 1288 iwl_pcie_txq_build_tfd(trans, txq, phys_addr, copy_size, 1); 1330 1289 1290 + /* map the remaining (adjusted) nocopy/dup fragments */ 1331 1291 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { 1332 - const void *data = cmd->data[i]; 1292 + const void *data = cmddata[i]; 1333 1293 1334 - if (!cmd->len[i]) 1294 + if (!cmdlen[i]) 1335 1295 continue; 1336 1296 if (!(cmd->dataflags[i] & (IWL_HCMD_DFL_NOCOPY | 1337 1297 IWL_HCMD_DFL_DUP))) ··· 1340 1298 if (cmd->dataflags[i] & IWL_HCMD_DFL_DUP) 1341 1299 data = dup_buf; 1342 1300 phys_addr = dma_map_single(trans->dev, (void *)data, 1343 - cmd->len[i], DMA_BIDIRECTIONAL); 1301 + cmdlen[i], DMA_BIDIRECTIONAL); 1344 1302 if (dma_mapping_error(trans->dev, phys_addr)) { 1345 1303 iwl_pcie_tfd_unmap(trans, out_meta, 1346 1304 &txq->tfds[q->write_ptr], ··· 1349 1307 goto out; 1350 1308 } 1351 1309 1352 - iwl_pcie_txq_build_tfd(trans, txq, phys_addr, cmd->len[i], 0); 1310 + iwl_pcie_txq_build_tfd(trans, txq, phys_addr, cmdlen[i], 0); 1353 1311 } 1354 1312 1355 1313 out_meta->flags = cmd->flags; ··· 1359 1317 1360 1318 txq->need_update = 1; 1361 1319 1362 - trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, 1363 - &out_cmd->hdr, copy_size); 1320 + trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, &out_cmd->hdr); 1364 1321 1365 1322 /* start timer if queue currently empty */ 1366 1323 if (q->read_ptr == q->write_ptr && trans_pcie->wd_timeout)
+5 -1
drivers/net/wireless/libertas/if_sdio.c
··· 825 825 826 826 sdio_release_host(func); 827 827 828 + /* Set fw_ready before queuing any commands so that 829 + * lbs_thread won't block from sending them to firmware. 830 + */ 831 + priv->fw_ready = 1; 832 + 828 833 /* 829 834 * FUNC_INIT is required for SD8688 WLAN/BT multiple functions 830 835 */ ··· 844 839 netdev_alert(priv->dev, "CMD_FUNC_INIT cmd failed\n"); 845 840 } 846 841 847 - priv->fw_ready = 1; 848 842 wake_up(&card->pwron_waitq); 849 843 850 844 if (!card->started) {
+1 -1
drivers/net/wireless/mwifiex/pcie.c
··· 302 302 i++; 303 303 usleep_range(10, 20); 304 304 /* 50ms max wait */ 305 - if (i == 50000) 305 + if (i == 5000) 306 306 break; 307 307 } 308 308
+6 -2
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 1236 1236 */ 1237 1237 if_limit = &rt2x00dev->if_limits_ap; 1238 1238 if_limit->max = rt2x00dev->ops->max_ap_intf; 1239 - if_limit->types = BIT(NL80211_IFTYPE_AP) | 1240 - BIT(NL80211_IFTYPE_MESH_POINT); 1239 + if_limit->types = BIT(NL80211_IFTYPE_AP); 1240 + #ifdef CONFIG_MAC80211_MESH 1241 + if_limit->types |= BIT(NL80211_IFTYPE_MESH_POINT); 1242 + #endif 1241 1243 1242 1244 /* 1243 1245 * Build up AP interface combinations structure. ··· 1311 1309 rt2x00dev->hw->wiphy->interface_modes |= 1312 1310 BIT(NL80211_IFTYPE_ADHOC) | 1313 1311 BIT(NL80211_IFTYPE_AP) | 1312 + #ifdef CONFIG_MAC80211_MESH 1314 1313 BIT(NL80211_IFTYPE_MESH_POINT) | 1314 + #endif 1315 1315 BIT(NL80211_IFTYPE_WDS); 1316 1316 1317 1317 rt2x00dev->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+9 -3
net/mac80211/cfg.c
··· 3285 3285 struct cfg80211_chan_def *chandef) 3286 3286 { 3287 3287 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 3288 + struct ieee80211_local *local = wiphy_priv(wiphy); 3288 3289 struct ieee80211_chanctx_conf *chanctx_conf; 3289 3290 int ret = -ENODATA; 3290 3291 3291 3292 rcu_read_lock(); 3292 - chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 3293 - if (chanctx_conf) { 3294 - *chandef = chanctx_conf->def; 3293 + if (local->use_chanctx) { 3294 + chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 3295 + if (chanctx_conf) { 3296 + *chandef = chanctx_conf->def; 3297 + ret = 0; 3298 + } 3299 + } else if (local->open_count == local->monitors) { 3300 + *chandef = local->monitor_chandef; 3295 3301 ret = 0; 3296 3302 } 3297 3303 rcu_read_unlock();
+1 -1
net/mac80211/iface.c
··· 107 107 108 108 lockdep_assert_held(&local->mtx); 109 109 110 - active = !list_empty(&local->chanctx_list); 110 + active = !list_empty(&local->chanctx_list) || local->monitors; 111 111 112 112 if (!local->ops->remain_on_channel) { 113 113 list_for_each_entry(roc, &local->roc_list, list) {
+49 -28
net/mac80211/tx.c
··· 1231 1231 if (local->queue_stop_reasons[q] || 1232 1232 (!txpending && !skb_queue_empty(&local->pending[q]))) { 1233 1233 if (unlikely(info->flags & 1234 - IEEE80211_TX_INTFL_OFFCHAN_TX_OK && 1235 - local->queue_stop_reasons[q] & 1236 - ~BIT(IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL))) { 1234 + IEEE80211_TX_INTFL_OFFCHAN_TX_OK)) { 1235 + if (local->queue_stop_reasons[q] & 1236 + ~BIT(IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL)) { 1237 + /* 1238 + * Drop off-channel frames if queues 1239 + * are stopped for any reason other 1240 + * than off-channel operation. Never 1241 + * queue them. 1242 + */ 1243 + spin_unlock_irqrestore( 1244 + &local->queue_stop_reason_lock, 1245 + flags); 1246 + ieee80211_purge_tx_queue(&local->hw, 1247 + skbs); 1248 + return true; 1249 + } 1250 + } else { 1251 + 1237 1252 /* 1238 - * Drop off-channel frames if queues are stopped 1239 - * for any reason other than off-channel 1240 - * operation. Never queue them. 1253 + * Since queue is stopped, queue up frames for 1254 + * later transmission from the tx-pending 1255 + * tasklet when the queue is woken again. 1241 1256 */ 1242 - spin_unlock_irqrestore( 1243 - &local->queue_stop_reason_lock, flags); 1244 - ieee80211_purge_tx_queue(&local->hw, skbs); 1245 - return true; 1257 + if (txpending) 1258 + skb_queue_splice_init(skbs, 1259 + &local->pending[q]); 1260 + else 1261 + skb_queue_splice_tail_init(skbs, 1262 + &local->pending[q]); 1263 + 1264 + spin_unlock_irqrestore(&local->queue_stop_reason_lock, 1265 + flags); 1266 + return false; 1246 1267 } 1247 - 1248 - /* 1249 - * Since queue is stopped, queue up frames for later 1250 - * transmission from the tx-pending tasklet when the 1251 - * queue is woken again. 1252 - */ 1253 - if (txpending) 1254 - skb_queue_splice_init(skbs, &local->pending[q]); 1255 - else 1256 - skb_queue_splice_tail_init(skbs, 1257 - &local->pending[q]); 1258 - 1259 - spin_unlock_irqrestore(&local->queue_stop_reason_lock, 1260 - flags); 1261 - return false; 1262 1268 } 1263 1269 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); 1264 1270 ··· 1850 1844 } 1851 1845 1852 1846 if (!is_multicast_ether_addr(skb->data)) { 1847 + struct sta_info *next_hop; 1848 + bool mpp_lookup = true; 1849 + 1853 1850 mpath = mesh_path_lookup(sdata, skb->data); 1854 - if (!mpath) 1851 + if (mpath) { 1852 + mpp_lookup = false; 1853 + next_hop = rcu_dereference(mpath->next_hop); 1854 + if (!next_hop || 1855 + !(mpath->flags & (MESH_PATH_ACTIVE | 1856 + MESH_PATH_RESOLVING))) 1857 + mpp_lookup = true; 1858 + } 1859 + 1860 + if (mpp_lookup) 1855 1861 mppath = mpp_path_lookup(sdata, skb->data); 1862 + 1863 + if (mppath && mpath) 1864 + mesh_path_del(mpath->sdata, mpath->dst); 1856 1865 } 1857 1866 1858 1867 /* ··· 2381 2360 if (local->tim_in_locked_section) { 2382 2361 __ieee80211_beacon_add_tim(sdata, ps, skb); 2383 2362 } else { 2384 - spin_lock(&local->tim_lock); 2363 + spin_lock_bh(&local->tim_lock); 2385 2364 __ieee80211_beacon_add_tim(sdata, ps, skb); 2386 - spin_unlock(&local->tim_lock); 2365 + spin_unlock_bh(&local->tim_lock); 2387 2366 } 2388 2367 2389 2368 return 0;
+3 -58
net/wireless/nl80211.c
··· 554 554 if ((chan->flags & IEEE80211_CHAN_NO_IBSS) && 555 555 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IBSS)) 556 556 goto nla_put_failure; 557 - if (chan->flags & IEEE80211_CHAN_RADAR) { 558 - u32 time = elapsed_jiffies_msecs(chan->dfs_state_entered); 559 - if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR)) 560 - goto nla_put_failure; 561 - if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_STATE, 562 - chan->dfs_state)) 563 - goto nla_put_failure; 564 - if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME, time)) 565 - goto nla_put_failure; 566 - } 557 + if ((chan->flags & IEEE80211_CHAN_RADAR) && 558 + nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR)) 559 + goto nla_put_failure; 567 560 if ((chan->flags & IEEE80211_CHAN_NO_HT40MINUS) && 568 561 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS)) 569 562 goto nla_put_failure; ··· 893 900 nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM, 894 901 c->max_interfaces)) 895 902 goto nla_put_failure; 896 - if (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, 897 - c->radar_detect_widths)) 898 - goto nla_put_failure; 899 903 900 904 nla_nest_end(msg, nl_combi); 901 905 } ··· 903 913 nla_put_failure: 904 914 return -ENOBUFS; 905 915 } 906 - 907 - #ifdef CONFIG_PM 908 - static int nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev, 909 - struct sk_buff *msg) 910 - { 911 - const struct wiphy_wowlan_tcp_support *tcp = rdev->wiphy.wowlan.tcp; 912 - struct nlattr *nl_tcp; 913 - 914 - if (!tcp) 915 - return 0; 916 - 917 - nl_tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION); 918 - if (!nl_tcp) 919 - return -ENOBUFS; 920 - 921 - if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, 922 - tcp->data_payload_max)) 923 - return -ENOBUFS; 924 - 925 - if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, 926 - tcp->data_payload_max)) 927 - return -ENOBUFS; 928 - 929 - if (tcp->seq && nla_put_flag(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ)) 930 - return -ENOBUFS; 931 - 932 - if (tcp->tok && nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, 933 - sizeof(*tcp->tok), tcp->tok)) 934 - return -ENOBUFS; 935 - 936 - if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL, 937 - tcp->data_interval_max)) 938 - return -ENOBUFS; 939 - 940 - if (nla_put_u32(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, 941 - tcp->wake_payload_max)) 942 - return -ENOBUFS; 943 - 944 - nla_nest_end(msg, nl_tcp); 945 - return 0; 946 - } 947 - #endif 948 916 949 917 static int nl80211_send_wiphy(struct sk_buff *msg, u32 portid, u32 seq, int flags, 950 918 struct cfg80211_registered_device *dev) ··· 1277 1329 sizeof(pat), &pat)) 1278 1330 goto nla_put_failure; 1279 1331 } 1280 - 1281 - if (nl80211_send_wowlan_tcp_caps(dev, msg)) 1282 - goto nla_put_failure; 1283 1332 1284 1333 nla_nest_end(msg, nl_wowlan); 1285 1334 }