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

Merge tag 'wireless-drivers-next-for-davem-2019-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valu says:

====================
wireless-drivers-next patches for 5.3

First set of patches for 5.3, but not that many patches this time.

This pull request fails to compile with the tip tree due to
ktime_get_boot_ns() API changes there. It should be easy for Linus to
fix it in p54 driver once he pulls this, an example resolution here:

https://lkml.kernel.org/r/20190625160432.533aa140@canb.auug.org.au

Major changes:

airo

* switch to use skcipher interface

p54

* support boottime in scan results

rtw88

* add fast xmit support

* add random mac address on scan support

rt2x00

* add software watchdog to detect hangs, it's disabled by default
====================

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

+2869 -2306
+1 -1
drivers/net/wireless/ath/ath10k/ahb.c
··· 740 740 enum ath10k_hw_rev hw_rev; 741 741 size_t size; 742 742 int ret; 743 - struct ath10k_bus_params bus_params; 743 + struct ath10k_bus_params bus_params = {}; 744 744 745 745 of_id = of_match_device(ath10k_ahb_of_match, &pdev->dev); 746 746 if (!of_id) {
+44 -4
drivers/net/wireless/ath/ath10k/core.c
··· 154 154 .fw_diag_ce_download = false, 155 155 }, 156 156 { 157 + .id = QCA6174_HW_3_2_VERSION, 158 + .dev_id = QCA6174_3_2_DEVICE_ID, 159 + .bus = ATH10K_BUS_SDIO, 160 + .name = "qca6174 hw3.2 sdio", 161 + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, 162 + .uart_pin = 19, 163 + .otp_exe_param = 0, 164 + .channel_counters_freq_hz = 88000, 165 + .max_probe_resp_desc_thres = 0, 166 + .cal_data_len = 0, 167 + .fw = { 168 + .dir = QCA6174_HW_3_0_FW_DIR, 169 + .board = QCA6174_HW_3_0_BOARD_DATA_FILE, 170 + .board_size = QCA6174_BOARD_DATA_SZ, 171 + .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, 172 + }, 173 + .hw_ops = &qca6174_ops, 174 + .hw_clk = qca6174_clk, 175 + .target_cpu_freq = 176000000, 176 + .decap_align_bytes = 4, 177 + .n_cipher_suites = 8, 178 + .num_peers = 10, 179 + .ast_skid_limit = 0x10, 180 + .num_wds_entries = 0x20, 181 + .uart_pin_workaround = true, 182 + }, 183 + { 157 184 .id = QCA6174_HW_2_1_VERSION, 158 185 .dev_id = QCA6164_2_1_DEVICE_ID, 159 186 .bus = ATH10K_BUS_PCI, ··· 656 629 complete(&ar->target_suspend); 657 630 } 658 631 659 - static void ath10k_init_sdio(struct ath10k *ar) 632 + static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) 660 633 { 661 634 u32 param = 0; 662 635 ··· 673 646 * not big enough for mac80211 / native wifi frames. disable it 674 647 */ 675 648 param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; 676 - param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; 649 + 650 + if (mode == ATH10K_FIRMWARE_MODE_UTF) 651 + param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; 652 + else 653 + param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; 654 + 677 655 ath10k_bmi_write32(ar, hi_acs_flags, param); 678 656 679 657 /* Explicitly set fwlog prints to zero as target may turn it on ··· 2097 2065 return ret; 2098 2066 } 2099 2067 2100 - if (!uart_print) 2068 + if (!uart_print && ar->hw_params.uart_pin_workaround) { 2069 + ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, 2070 + ar->hw_params.uart_pin); 2071 + if (ret) { 2072 + ath10k_warn(ar, "failed to set UART TX pin: %d", ret); 2073 + return ret; 2074 + } 2075 + 2101 2076 return 0; 2077 + } 2102 2078 2103 2079 ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, ar->hw_params.uart_pin); 2104 2080 if (ret) { ··· 2541 2501 goto err; 2542 2502 2543 2503 if (ar->hif.bus == ATH10K_BUS_SDIO) 2544 - ath10k_init_sdio(ar); 2504 + ath10k_init_sdio(ar, mode); 2545 2505 } 2546 2506 2547 2507 ar->htc.htc_ops.target_send_suspend_complete =
+11 -1
drivers/net/wireless/ath/ath10k/core.h
··· 196 196 struct list_head list; 197 197 198 198 u8 peer_macaddr[ETH_ALEN]; 199 - u32 rx_duration; 199 + u64 rx_duration; 200 200 }; 201 201 202 202 struct ath10k_fw_stats_vdev { ··· 400 400 401 401 /* protected by ar->data_lock */ 402 402 struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1]; 403 + union htt_rx_pn_t tids_last_pn[ATH10K_TXRX_NUM_EXT_TIDS]; 404 + bool tids_last_pn_valid[ATH10K_TXRX_NUM_EXT_TIDS]; 405 + union htt_rx_pn_t frag_tids_last_pn[ATH10K_TXRX_NUM_EXT_TIDS]; 406 + u32 frag_tids_seq[ATH10K_TXRX_NUM_EXT_TIDS]; 407 + struct { 408 + enum htt_security_types sec_type; 409 + int pn_len; 410 + } rx_pn[ATH10K_HTT_TXRX_PEER_SECURITY_MAX]; 403 411 }; 404 412 405 413 struct ath10k_txq { ··· 622 614 bool fw_stats_done; 623 615 624 616 unsigned long htt_stats_mask; 617 + unsigned long reset_htt_stats; 625 618 struct delayed_work htt_stats_dwork; 626 619 struct ath10k_dfs_stats dfs_stats; 627 620 struct ath_dfs_pool_stats dfs_pool_stats; ··· 928 919 u32 chip_id; 929 920 enum ath10k_dev_type dev_type; 930 921 bool link_can_suspend; 922 + bool hl_msdu_ids; 931 923 }; 932 924 933 925 struct ath10k {
+2 -2
drivers/net/wireless/ath/ath10k/coredump.c
··· 1192 1192 if (test_bit(ATH10K_FW_CRASH_DUMP_CE_DATA, &ath10k_coredump_mask)) { 1193 1193 dump_tlv = (struct ath10k_tlv_dump_data *)(buf + sofar); 1194 1194 dump_tlv->type = cpu_to_le32(ATH10K_FW_CRASH_DUMP_CE_DATA); 1195 - dump_tlv->tlv_len = cpu_to_le32(sizeof(*ce_hdr) + 1196 - CE_COUNT * sizeof(ce_hdr->entries[0])); 1195 + dump_tlv->tlv_len = cpu_to_le32(struct_size(ce_hdr, entries, 1196 + CE_COUNT)); 1197 1197 ce_hdr = (struct ath10k_ce_crash_hdr *)(dump_tlv->tlv_data); 1198 1198 ce_hdr->ce_count = cpu_to_le32(CE_COUNT); 1199 1199 memset(ce_hdr->reserved, 0, sizeof(ce_hdr->reserved));
+47 -3
drivers/net/wireless/ath/ath10k/debug.c
··· 305 305 if (is_end) 306 306 ar->debug.fw_stats_done = true; 307 307 308 + if (stats.extended) 309 + ar->debug.fw_stats.extended = true; 310 + 308 311 is_started = !list_empty(&ar->debug.fw_stats.pdevs); 309 312 310 313 if (is_started && !is_end) { ··· 876 873 cookie = get_jiffies_64(); 877 874 878 875 ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask, 879 - cookie); 876 + ar->debug.reset_htt_stats, cookie); 880 877 if (ret) { 881 878 ath10k_warn(ar, "failed to send htt stats request: %d\n", ret); 882 879 return ret; ··· 925 922 if (ret) 926 923 return ret; 927 924 928 - /* max 8 bit masks (for now) */ 929 - if (mask > 0xff) 925 + /* max 17 bit masks (for now) */ 926 + if (mask > HTT_STATS_BIT_MASK) 930 927 return -E2BIG; 931 928 932 929 mutex_lock(&ar->conf_mutex); ··· 2472 2469 .llseek = default_llseek, 2473 2470 }; 2474 2471 2472 + static ssize_t ath10k_write_reset_htt_stats(struct file *file, 2473 + const char __user *user_buf, 2474 + size_t count, loff_t *ppos) 2475 + { 2476 + struct ath10k *ar = file->private_data; 2477 + unsigned long reset; 2478 + int ret; 2479 + 2480 + ret = kstrtoul_from_user(user_buf, count, 0, &reset); 2481 + if (ret) 2482 + return ret; 2483 + 2484 + if (reset == 0 || reset > 0x1ffff) 2485 + return -EINVAL; 2486 + 2487 + mutex_lock(&ar->conf_mutex); 2488 + 2489 + ar->debug.reset_htt_stats = reset; 2490 + 2491 + ret = ath10k_debug_htt_stats_req(ar); 2492 + if (ret) 2493 + goto out; 2494 + 2495 + ar->debug.reset_htt_stats = 0; 2496 + ret = count; 2497 + 2498 + out: 2499 + mutex_unlock(&ar->conf_mutex); 2500 + return ret; 2501 + } 2502 + 2503 + static const struct file_operations fops_reset_htt_stats = { 2504 + .write = ath10k_write_reset_htt_stats, 2505 + .owner = THIS_MODULE, 2506 + .open = simple_open, 2507 + .llseek = default_llseek, 2508 + }; 2509 + 2475 2510 int ath10k_debug_create(struct ath10k *ar) 2476 2511 { 2477 2512 ar->debug.cal_data = vzalloc(ATH10K_DEBUG_CAL_DATA_LEN); ··· 2649 2608 2650 2609 debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar, 2651 2610 &fops_ps_state_enable); 2611 + 2612 + debugfs_create_file("reset_htt_stats", 0200, ar->debug.debugfs_phy, ar, 2613 + &fops_reset_htt_stats); 2652 2614 2653 2615 return 0; 2654 2616 }
+7
drivers/net/wireless/ath/ath10k/debugfs_sta.c
··· 663 663 664 664 mutex_lock(&ar->conf_mutex); 665 665 666 + if (!arsta->tx_stats) { 667 + ath10k_warn(ar, "failed to get tx stats"); 668 + mutex_unlock(&ar->conf_mutex); 669 + kfree(buf); 670 + return 0; 671 + } 672 + 666 673 spin_lock_bh(&ar->data_lock); 667 674 for (k = 0; k < ATH10K_STATS_TYPE_MAX; k++) { 668 675 for (j = 0; j < ATH10K_COUNTER_TYPE_MAX; j++) {
+1
drivers/net/wireless/ath/ath10k/htc.c
··· 73 73 struct ath10k_htc_hdr *hdr; 74 74 75 75 hdr = (struct ath10k_htc_hdr *)skb->data; 76 + memset(hdr, 0, sizeof(struct ath10k_htc_hdr)); 76 77 77 78 hdr->eid = ep->eid; 78 79 hdr->len = __cpu_to_le16(skb->len - sizeof(*hdr));
+55 -5
drivers/net/wireless/ath/ath10k/htt.h
··· 315 315 } __packed; 316 316 317 317 #define HTT_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff 318 + #define HTT_STATS_BIT_MASK GENMASK(16, 0) 318 319 319 320 /* 320 321 * htt_oob_sync_req - request out-of-band sync ··· 734 733 struct htt_rx_indication_mpdu_range mpdu_ranges[0]; 735 734 } __packed; 736 735 736 + struct htt_hl_rx_desc { 737 + __le32 info; 738 + __le32 pn_31_0; 739 + union { 740 + struct { 741 + __le16 pn_47_32; 742 + __le16 pn_63_48; 743 + } pn16; 744 + __le32 pn_63_32; 745 + } u0; 746 + __le32 pn_95_64; 747 + __le32 pn_127_96; 748 + } __packed; 749 + 737 750 static inline struct htt_rx_indication_mpdu_range * 738 751 htt_rx_ind_get_mpdu_ranges(struct htt_rx_indication *rx_ind) 739 752 { ··· 805 790 __le16 peer_id; 806 791 } __packed; 807 792 793 + enum htt_txrx_sec_cast_type { 794 + HTT_TXRX_SEC_MCAST = 0, 795 + HTT_TXRX_SEC_UCAST 796 + }; 797 + 798 + enum htt_rx_pn_check_type { 799 + HTT_RX_NON_PN_CHECK = 0, 800 + HTT_RX_PN_CHECK 801 + }; 802 + 803 + enum htt_rx_tkip_demic_type { 804 + HTT_RX_NON_TKIP_MIC = 0, 805 + HTT_RX_TKIP_MIC 806 + }; 807 + 808 808 enum htt_security_types { 809 809 HTT_SECURITY_NONE, 810 810 HTT_SECURITY_WEP128, ··· 832 802 833 803 HTT_NUM_SECURITY_TYPES /* keep this last! */ 834 804 }; 805 + 806 + #define ATH10K_HTT_TXRX_PEER_SECURITY_MAX 2 807 + #define ATH10K_TXRX_NUM_EXT_TIDS 19 835 808 836 809 enum htt_security_flags { 837 810 #define HTT_SECURITY_TYPE_MASK 0x7F ··· 1042 1009 1043 1010 u8 fw_msdu_rx_desc[0]; 1044 1011 } __packed; 1012 + 1013 + #define ATH10K_IEEE80211_EXTIV BIT(5) 1014 + #define ATH10K_IEEE80211_TKIP_MICLEN 8 /* trailing MIC */ 1015 + 1016 + #define HTT_RX_FRAG_IND_INFO0_HEADER_LEN 16 1045 1017 1046 1018 #define HTT_RX_FRAG_IND_INFO0_EXT_TID_MASK 0x1F 1047 1019 #define HTT_RX_FRAG_IND_INFO0_EXT_TID_LSB 0 ··· 2093 2055 int idx); 2094 2056 void* (*htt_get_vaddr_ring)(struct ath10k_htt *htt); 2095 2057 void (*htt_reset_paddrs_ring)(struct ath10k_htt *htt, int idx); 2058 + bool (*htt_rx_proc_rx_frag_ind)(struct ath10k_htt *htt, 2059 + struct htt_rx_fragment_indication *rx, 2060 + struct sk_buff *skb); 2096 2061 }; 2097 2062 2098 2063 static inline size_t ath10k_htt_get_rx_ring_size(struct ath10k_htt *htt) ··· 2135 2094 htt->rx_ops->htt_reset_paddrs_ring(htt, idx); 2136 2095 } 2137 2096 2097 + static inline bool ath10k_htt_rx_proc_rx_frag_ind(struct ath10k_htt *htt, 2098 + struct htt_rx_fragment_indication *rx, 2099 + struct sk_buff *skb) 2100 + { 2101 + if (!htt->rx_ops->htt_rx_proc_rx_frag_ind) 2102 + return true; 2103 + 2104 + return htt->rx_ops->htt_rx_proc_rx_frag_ind(htt, rx, skb); 2105 + } 2106 + 2138 2107 #define RX_HTT_HDR_STATUS_LEN 64 2139 2108 2140 2109 /* This structure layout is programmed via rx ring setup ··· 2179 2128 #define HTT_RX_DESC_HL_INFO_ENCRYPTED_LSB 12 2180 2129 #define HTT_RX_DESC_HL_INFO_CHAN_INFO_PRESENT_MASK 0x00002000 2181 2130 #define HTT_RX_DESC_HL_INFO_CHAN_INFO_PRESENT_LSB 13 2182 - #define HTT_RX_DESC_HL_INFO_MCAST_BCAST_MASK 0x00008000 2183 - #define HTT_RX_DESC_HL_INFO_MCAST_BCAST_LSB 15 2184 - #define HTT_RX_DESC_HL_INFO_FRAGMENT_MASK 0x00010000 2185 - #define HTT_RX_DESC_HL_INFO_FRAGMENT_LSB 16 2131 + #define HTT_RX_DESC_HL_INFO_MCAST_BCAST_MASK 0x00010000 2132 + #define HTT_RX_DESC_HL_INFO_MCAST_BCAST_LSB 16 2186 2133 #define HTT_RX_DESC_HL_INFO_KEY_ID_OCT_MASK 0x01fe0000 2187 2134 #define HTT_RX_DESC_HL_INFO_KEY_ID_OCT_LSB 17 2188 2135 ··· 2244 2195 void ath10k_htt_htc_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb); 2245 2196 bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb); 2246 2197 int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt); 2247 - int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie); 2198 + int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u32 mask, u32 reset_mask, 2199 + u64 cookie); 2248 2200 int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, 2249 2201 u8 max_subfrms_ampdu, 2250 2202 u8 max_subfrms_amsdu);
+378 -9
drivers/net/wireless/ath/ath10k/htt_rx.c
··· 2061 2061 return 0; 2062 2062 } 2063 2063 2064 + static void ath10k_htt_rx_mpdu_desc_pn_hl(struct htt_hl_rx_desc *rx_desc, 2065 + union htt_rx_pn_t *pn, 2066 + int pn_len_bits) 2067 + { 2068 + switch (pn_len_bits) { 2069 + case 48: 2070 + pn->pn48 = __le32_to_cpu(rx_desc->pn_31_0) + 2071 + ((u64)(__le32_to_cpu(rx_desc->u0.pn_63_32) & 0xFFFF) << 32); 2072 + break; 2073 + case 24: 2074 + pn->pn24 = __le32_to_cpu(rx_desc->pn_31_0); 2075 + break; 2076 + }; 2077 + } 2078 + 2079 + static bool ath10k_htt_rx_pn_cmp48(union htt_rx_pn_t *new_pn, 2080 + union htt_rx_pn_t *old_pn) 2081 + { 2082 + return ((new_pn->pn48 & 0xffffffffffffULL) <= 2083 + (old_pn->pn48 & 0xffffffffffffULL)); 2084 + } 2085 + 2086 + static bool ath10k_htt_rx_pn_check_replay_hl(struct ath10k *ar, 2087 + struct ath10k_peer *peer, 2088 + struct htt_rx_indication_hl *rx) 2089 + { 2090 + bool last_pn_valid, pn_invalid = false; 2091 + enum htt_txrx_sec_cast_type sec_index; 2092 + enum htt_security_types sec_type; 2093 + union htt_rx_pn_t new_pn = {0}; 2094 + struct htt_hl_rx_desc *rx_desc; 2095 + union htt_rx_pn_t *last_pn; 2096 + u32 rx_desc_info, tid; 2097 + int num_mpdu_ranges; 2098 + 2099 + lockdep_assert_held(&ar->data_lock); 2100 + 2101 + if (!peer) 2102 + return false; 2103 + 2104 + if (!(rx->fw_desc.flags & FW_RX_DESC_FLAGS_FIRST_MSDU)) 2105 + return false; 2106 + 2107 + num_mpdu_ranges = MS(__le32_to_cpu(rx->hdr.info1), 2108 + HTT_RX_INDICATION_INFO1_NUM_MPDU_RANGES); 2109 + 2110 + rx_desc = (struct htt_hl_rx_desc *)&rx->mpdu_ranges[num_mpdu_ranges]; 2111 + rx_desc_info = __le32_to_cpu(rx_desc->info); 2112 + 2113 + if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) 2114 + return false; 2115 + 2116 + tid = MS(rx->hdr.info0, HTT_RX_INDICATION_INFO0_EXT_TID); 2117 + last_pn_valid = peer->tids_last_pn_valid[tid]; 2118 + last_pn = &peer->tids_last_pn[tid]; 2119 + 2120 + if (MS(rx_desc_info, HTT_RX_DESC_HL_INFO_MCAST_BCAST)) 2121 + sec_index = HTT_TXRX_SEC_MCAST; 2122 + else 2123 + sec_index = HTT_TXRX_SEC_UCAST; 2124 + 2125 + sec_type = peer->rx_pn[sec_index].sec_type; 2126 + ath10k_htt_rx_mpdu_desc_pn_hl(rx_desc, &new_pn, peer->rx_pn[sec_index].pn_len); 2127 + 2128 + if (sec_type != HTT_SECURITY_AES_CCMP && 2129 + sec_type != HTT_SECURITY_TKIP && 2130 + sec_type != HTT_SECURITY_TKIP_NOMIC) 2131 + return false; 2132 + 2133 + if (last_pn_valid) 2134 + pn_invalid = ath10k_htt_rx_pn_cmp48(&new_pn, last_pn); 2135 + else 2136 + peer->tids_last_pn_valid[tid] = 1; 2137 + 2138 + if (!pn_invalid) 2139 + last_pn->pn48 = new_pn.pn48; 2140 + 2141 + return pn_invalid; 2142 + } 2143 + 2064 2144 static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt, 2065 2145 struct htt_rx_indication_hl *rx, 2066 - struct sk_buff *skb) 2146 + struct sk_buff *skb, 2147 + enum htt_rx_pn_check_type check_pn_type, 2148 + enum htt_rx_tkip_demic_type tkip_mic_type) 2067 2149 { 2068 2150 struct ath10k *ar = htt->ar; 2069 2151 struct ath10k_peer *peer; ··· 2189 2107 goto err; 2190 2108 } 2191 2109 2110 + if (check_pn_type == HTT_RX_PN_CHECK && 2111 + ath10k_htt_rx_pn_check_replay_hl(ar, peer, rx)) 2112 + goto err; 2113 + 2192 2114 /* Strip off all headers before the MAC header before delivery to 2193 2115 * mac80211 2194 2116 */ ··· 2200 2114 sizeof(rx->ppdu) + sizeof(rx->prefix) + 2201 2115 sizeof(rx->fw_desc) + 2202 2116 sizeof(*mpdu_ranges) * num_mpdu_ranges + rx_desc_len; 2117 + 2203 2118 skb_pull(skb, tot_hdr_len); 2204 2119 2205 2120 hdr = (struct ieee80211_hdr *)skb->data; ··· 2249 2162 RX_FLAG_MMIC_STRIPPED; 2250 2163 } 2251 2164 2165 + if (tkip_mic_type == HTT_RX_TKIP_MIC) 2166 + rx_status->flag &= ~RX_FLAG_IV_STRIPPED & 2167 + ~RX_FLAG_MMIC_STRIPPED; 2168 + 2252 2169 ieee80211_rx_ni(ar->hw, skb); 2253 2170 2254 2171 /* We have delivered the skb to the upper layers (mac80211) so we ··· 2260 2169 */ 2261 2170 return false; 2262 2171 err: 2172 + /* Tell the caller that it must free the skb since we have not 2173 + * consumed it 2174 + */ 2175 + return true; 2176 + } 2177 + 2178 + static int ath10k_htt_rx_frag_tkip_decap_nomic(struct sk_buff *skb, 2179 + u16 head_len, 2180 + u16 hdr_len) 2181 + { 2182 + u8 *ivp, *orig_hdr; 2183 + 2184 + orig_hdr = skb->data; 2185 + ivp = orig_hdr + hdr_len + head_len; 2186 + 2187 + /* the ExtIV bit is always set to 1 for TKIP */ 2188 + if (!(ivp[IEEE80211_WEP_IV_LEN - 1] & ATH10K_IEEE80211_EXTIV)) 2189 + return -EINVAL; 2190 + 2191 + memmove(orig_hdr + IEEE80211_TKIP_IV_LEN, orig_hdr, head_len + hdr_len); 2192 + skb_pull(skb, IEEE80211_TKIP_IV_LEN); 2193 + skb_trim(skb, skb->len - ATH10K_IEEE80211_TKIP_MICLEN); 2194 + return 0; 2195 + } 2196 + 2197 + static int ath10k_htt_rx_frag_tkip_decap_withmic(struct sk_buff *skb, 2198 + u16 head_len, 2199 + u16 hdr_len) 2200 + { 2201 + u8 *ivp, *orig_hdr; 2202 + 2203 + orig_hdr = skb->data; 2204 + ivp = orig_hdr + hdr_len + head_len; 2205 + 2206 + /* the ExtIV bit is always set to 1 for TKIP */ 2207 + if (!(ivp[IEEE80211_WEP_IV_LEN - 1] & ATH10K_IEEE80211_EXTIV)) 2208 + return -EINVAL; 2209 + 2210 + memmove(orig_hdr + IEEE80211_TKIP_IV_LEN, orig_hdr, head_len + hdr_len); 2211 + skb_pull(skb, IEEE80211_TKIP_IV_LEN); 2212 + skb_trim(skb, skb->len - IEEE80211_TKIP_ICV_LEN); 2213 + return 0; 2214 + } 2215 + 2216 + static int ath10k_htt_rx_frag_ccmp_decap(struct sk_buff *skb, 2217 + u16 head_len, 2218 + u16 hdr_len) 2219 + { 2220 + u8 *ivp, *orig_hdr; 2221 + 2222 + orig_hdr = skb->data; 2223 + ivp = orig_hdr + hdr_len + head_len; 2224 + 2225 + /* the ExtIV bit is always set to 1 for CCMP */ 2226 + if (!(ivp[IEEE80211_WEP_IV_LEN - 1] & ATH10K_IEEE80211_EXTIV)) 2227 + return -EINVAL; 2228 + 2229 + skb_trim(skb, skb->len - IEEE80211_CCMP_MIC_LEN); 2230 + memmove(orig_hdr + IEEE80211_CCMP_HDR_LEN, orig_hdr, head_len + hdr_len); 2231 + skb_pull(skb, IEEE80211_CCMP_HDR_LEN); 2232 + return 0; 2233 + } 2234 + 2235 + static int ath10k_htt_rx_frag_wep_decap(struct sk_buff *skb, 2236 + u16 head_len, 2237 + u16 hdr_len) 2238 + { 2239 + u8 *orig_hdr; 2240 + 2241 + orig_hdr = skb->data; 2242 + 2243 + memmove(orig_hdr + IEEE80211_WEP_IV_LEN, 2244 + orig_hdr, head_len + hdr_len); 2245 + skb_pull(skb, IEEE80211_WEP_IV_LEN); 2246 + skb_trim(skb, skb->len - IEEE80211_WEP_ICV_LEN); 2247 + return 0; 2248 + } 2249 + 2250 + static bool ath10k_htt_rx_proc_rx_frag_ind_hl(struct ath10k_htt *htt, 2251 + struct htt_rx_fragment_indication *rx, 2252 + struct sk_buff *skb) 2253 + { 2254 + struct ath10k *ar = htt->ar; 2255 + enum htt_rx_tkip_demic_type tkip_mic = HTT_RX_NON_TKIP_MIC; 2256 + enum htt_txrx_sec_cast_type sec_index; 2257 + struct htt_rx_indication_hl *rx_hl; 2258 + enum htt_security_types sec_type; 2259 + u32 tid, frag, seq, rx_desc_info; 2260 + union htt_rx_pn_t new_pn = {0}; 2261 + struct htt_hl_rx_desc *rx_desc; 2262 + u16 peer_id, sc, hdr_space; 2263 + union htt_rx_pn_t *last_pn; 2264 + struct ieee80211_hdr *hdr; 2265 + int ret, num_mpdu_ranges; 2266 + struct ath10k_peer *peer; 2267 + struct htt_resp *resp; 2268 + size_t tot_hdr_len; 2269 + 2270 + resp = (struct htt_resp *)(skb->data + HTT_RX_FRAG_IND_INFO0_HEADER_LEN); 2271 + skb_pull(skb, HTT_RX_FRAG_IND_INFO0_HEADER_LEN); 2272 + skb_trim(skb, skb->len - FCS_LEN); 2273 + 2274 + peer_id = __le16_to_cpu(rx->peer_id); 2275 + rx_hl = (struct htt_rx_indication_hl *)(&resp->rx_ind_hl); 2276 + 2277 + spin_lock_bh(&ar->data_lock); 2278 + peer = ath10k_peer_find_by_id(ar, peer_id); 2279 + if (!peer) { 2280 + ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid peer: %u\n", peer_id); 2281 + goto err; 2282 + } 2283 + 2284 + num_mpdu_ranges = MS(__le32_to_cpu(rx_hl->hdr.info1), 2285 + HTT_RX_INDICATION_INFO1_NUM_MPDU_RANGES); 2286 + 2287 + tot_hdr_len = sizeof(struct htt_resp_hdr) + 2288 + sizeof(rx_hl->hdr) + 2289 + sizeof(rx_hl->ppdu) + 2290 + sizeof(rx_hl->prefix) + 2291 + sizeof(rx_hl->fw_desc) + 2292 + sizeof(struct htt_rx_indication_mpdu_range) * num_mpdu_ranges; 2293 + 2294 + tid = MS(rx_hl->hdr.info0, HTT_RX_INDICATION_INFO0_EXT_TID); 2295 + rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len); 2296 + rx_desc_info = __le32_to_cpu(rx_desc->info); 2297 + 2298 + if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) { 2299 + spin_unlock_bh(&ar->data_lock); 2300 + return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb, 2301 + HTT_RX_NON_PN_CHECK, 2302 + HTT_RX_NON_TKIP_MIC); 2303 + } 2304 + 2305 + hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len); 2306 + 2307 + if (ieee80211_has_retry(hdr->frame_control)) 2308 + goto err; 2309 + 2310 + hdr_space = ieee80211_hdrlen(hdr->frame_control); 2311 + sc = __le16_to_cpu(hdr->seq_ctrl); 2312 + seq = (sc & IEEE80211_SCTL_SEQ) >> 4; 2313 + frag = sc & IEEE80211_SCTL_FRAG; 2314 + 2315 + sec_index = MS(rx_desc_info, HTT_RX_DESC_HL_INFO_MCAST_BCAST) ? 2316 + HTT_TXRX_SEC_MCAST : HTT_TXRX_SEC_UCAST; 2317 + sec_type = peer->rx_pn[sec_index].sec_type; 2318 + ath10k_htt_rx_mpdu_desc_pn_hl(rx_desc, &new_pn, peer->rx_pn[sec_index].pn_len); 2319 + 2320 + switch (sec_type) { 2321 + case HTT_SECURITY_TKIP: 2322 + tkip_mic = HTT_RX_TKIP_MIC; 2323 + ret = ath10k_htt_rx_frag_tkip_decap_withmic(skb, 2324 + tot_hdr_len + 2325 + rx_hl->fw_desc.len, 2326 + hdr_space); 2327 + if (ret) 2328 + goto err; 2329 + break; 2330 + case HTT_SECURITY_TKIP_NOMIC: 2331 + ret = ath10k_htt_rx_frag_tkip_decap_nomic(skb, 2332 + tot_hdr_len + 2333 + rx_hl->fw_desc.len, 2334 + hdr_space); 2335 + if (ret) 2336 + goto err; 2337 + break; 2338 + case HTT_SECURITY_AES_CCMP: 2339 + ret = ath10k_htt_rx_frag_ccmp_decap(skb, 2340 + tot_hdr_len + rx_hl->fw_desc.len, 2341 + hdr_space); 2342 + if (ret) 2343 + goto err; 2344 + break; 2345 + case HTT_SECURITY_WEP128: 2346 + case HTT_SECURITY_WEP104: 2347 + case HTT_SECURITY_WEP40: 2348 + ret = ath10k_htt_rx_frag_wep_decap(skb, 2349 + tot_hdr_len + rx_hl->fw_desc.len, 2350 + hdr_space); 2351 + if (ret) 2352 + goto err; 2353 + break; 2354 + default: 2355 + break; 2356 + } 2357 + 2358 + resp = (struct htt_resp *)(skb->data); 2359 + 2360 + if (sec_type != HTT_SECURITY_AES_CCMP && 2361 + sec_type != HTT_SECURITY_TKIP && 2362 + sec_type != HTT_SECURITY_TKIP_NOMIC) { 2363 + spin_unlock_bh(&ar->data_lock); 2364 + return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb, 2365 + HTT_RX_NON_PN_CHECK, 2366 + HTT_RX_NON_TKIP_MIC); 2367 + } 2368 + 2369 + last_pn = &peer->frag_tids_last_pn[tid]; 2370 + 2371 + if (frag == 0) { 2372 + if (ath10k_htt_rx_pn_check_replay_hl(ar, peer, &resp->rx_ind_hl)) 2373 + goto err; 2374 + 2375 + last_pn->pn48 = new_pn.pn48; 2376 + peer->frag_tids_seq[tid] = seq; 2377 + } else if (sec_type == HTT_SECURITY_AES_CCMP) { 2378 + if (seq != peer->frag_tids_seq[tid]) 2379 + goto err; 2380 + 2381 + if (new_pn.pn48 != last_pn->pn48 + 1) 2382 + goto err; 2383 + 2384 + last_pn->pn48 = new_pn.pn48; 2385 + last_pn = &peer->tids_last_pn[tid]; 2386 + last_pn->pn48 = new_pn.pn48; 2387 + } 2388 + 2389 + spin_unlock_bh(&ar->data_lock); 2390 + 2391 + return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb, 2392 + HTT_RX_NON_PN_CHECK, tkip_mic); 2393 + 2394 + err: 2395 + spin_unlock_bh(&ar->data_lock); 2396 + 2263 2397 /* Tell the caller that it must free the skb since we have not 2264 2398 * consumed it 2265 2399 */ ··· 2509 2193 mpdu_ranges = htt_rx_ind_get_mpdu_ranges(rx); 2510 2194 2511 2195 ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt rx ind: ", 2512 - rx, sizeof(*rx) + 2513 - (sizeof(struct htt_rx_indication_mpdu_range) * 2514 - num_mpdu_ranges)); 2196 + rx, struct_size(rx, mpdu_ranges, num_mpdu_ranges)); 2515 2197 2516 2198 for (i = 0; i < num_mpdu_ranges; i++) 2517 2199 mpdu_count += mpdu_ranges[i].mpdu_count; ··· 2591 2277 * Note that with only one concurrent reader and one concurrent 2592 2278 * writer, you don't need extra locking to use these macro. 2593 2279 */ 2594 - if (!kfifo_put(&htt->txdone_fifo, tx_done)) { 2280 + if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) { 2281 + ath10k_txrx_tx_unref(htt, &tx_done); 2282 + } else if (!kfifo_put(&htt->txdone_fifo, tx_done)) { 2595 2283 ath10k_warn(ar, "txdone fifo overrun, msdu_id %d status %d\n", 2596 2284 tx_done.msdu_id, tx_done.status); 2597 2285 ath10k_txrx_tx_unref(htt, &tx_done); ··· 3254 2938 3255 2939 #define STATS_OP_FMT(name) tx_stats->stats[ATH10K_STATS_TYPE_##name] 3256 2940 3257 - if (txrate->flags == RATE_INFO_FLAGS_VHT_MCS) { 2941 + if (txrate->flags & RATE_INFO_FLAGS_VHT_MCS) { 3258 2942 STATS_OP_FMT(SUCC).vht[0][mcs] += pstats->succ_bytes; 3259 2943 STATS_OP_FMT(SUCC).vht[1][mcs] += pstats->succ_pkts; 3260 2944 STATS_OP_FMT(FAIL).vht[0][mcs] += pstats->failed_bytes; 3261 2945 STATS_OP_FMT(FAIL).vht[1][mcs] += pstats->failed_pkts; 3262 2946 STATS_OP_FMT(RETRY).vht[0][mcs] += pstats->retry_bytes; 3263 2947 STATS_OP_FMT(RETRY).vht[1][mcs] += pstats->retry_pkts; 3264 - } else if (txrate->flags == RATE_INFO_FLAGS_MCS) { 2948 + } else if (txrate->flags & RATE_INFO_FLAGS_MCS) { 3265 2949 STATS_OP_FMT(SUCC).ht[0][ht_idx] += pstats->succ_bytes; 3266 2950 STATS_OP_FMT(SUCC).ht[1][ht_idx] += pstats->succ_pkts; 3267 2951 STATS_OP_FMT(FAIL).ht[0][ht_idx] += pstats->failed_bytes; ··· 3282 2966 if (ATH10K_HW_AMPDU(pstats->flags)) { 3283 2967 tx_stats->ba_fails += ATH10K_HW_BA_FAIL(pstats->flags); 3284 2968 3285 - if (txrate->flags == RATE_INFO_FLAGS_MCS) { 2969 + if (txrate->flags & RATE_INFO_FLAGS_MCS) { 3286 2970 STATS_OP_FMT(AMPDU).ht[0][ht_idx] += 3287 2971 pstats->succ_bytes + pstats->retry_bytes; 3288 2972 STATS_OP_FMT(AMPDU).ht[1][ht_idx] += ··· 3581 3265 rcu_read_unlock(); 3582 3266 } 3583 3267 3268 + static int ath10k_htt_rx_pn_len(enum htt_security_types sec_type) 3269 + { 3270 + switch (sec_type) { 3271 + case HTT_SECURITY_TKIP: 3272 + case HTT_SECURITY_TKIP_NOMIC: 3273 + case HTT_SECURITY_AES_CCMP: 3274 + return 48; 3275 + default: 3276 + return 0; 3277 + } 3278 + } 3279 + 3280 + static void ath10k_htt_rx_sec_ind_handler(struct ath10k *ar, 3281 + struct htt_security_indication *ev) 3282 + { 3283 + enum htt_txrx_sec_cast_type sec_index; 3284 + enum htt_security_types sec_type; 3285 + struct ath10k_peer *peer; 3286 + 3287 + spin_lock_bh(&ar->data_lock); 3288 + 3289 + peer = ath10k_peer_find_by_id(ar, __le16_to_cpu(ev->peer_id)); 3290 + if (!peer) { 3291 + ath10k_warn(ar, "failed to find peer id %d for security indication", 3292 + __le16_to_cpu(ev->peer_id)); 3293 + goto out; 3294 + } 3295 + 3296 + sec_type = MS(ev->flags, HTT_SECURITY_TYPE); 3297 + 3298 + if (ev->flags & HTT_SECURITY_IS_UNICAST) 3299 + sec_index = HTT_TXRX_SEC_UCAST; 3300 + else 3301 + sec_index = HTT_TXRX_SEC_MCAST; 3302 + 3303 + peer->rx_pn[sec_index].sec_type = sec_type; 3304 + peer->rx_pn[sec_index].pn_len = ath10k_htt_rx_pn_len(sec_type); 3305 + 3306 + memset(peer->tids_last_pn_valid, 0, sizeof(peer->tids_last_pn_valid)); 3307 + memset(peer->tids_last_pn, 0, sizeof(peer->tids_last_pn)); 3308 + 3309 + out: 3310 + spin_unlock_bh(&ar->data_lock); 3311 + } 3312 + 3584 3313 bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) 3585 3314 { 3586 3315 struct ath10k_htt *htt = &ar->htt; ··· 3657 3296 if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) 3658 3297 return ath10k_htt_rx_proc_rx_ind_hl(htt, 3659 3298 &resp->rx_ind_hl, 3660 - skb); 3299 + skb, 3300 + HTT_RX_PN_CHECK, 3301 + HTT_RX_NON_TKIP_MIC); 3661 3302 else 3662 3303 ath10k_htt_rx_proc_rx_ind_ll(htt, &resp->rx_ind); 3663 3304 break; ··· 3721 3358 struct ath10k *ar = htt->ar; 3722 3359 struct htt_security_indication *ev = &resp->security_indication; 3723 3360 3361 + ath10k_htt_rx_sec_ind_handler(ar, ev); 3724 3362 ath10k_dbg(ar, ATH10K_DBG_HTT, 3725 3363 "sec ind peer_id %d unicast %d type %d\n", 3726 3364 __le16_to_cpu(ev->peer_id), ··· 3734 3370 ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt event: ", 3735 3371 skb->data, skb->len); 3736 3372 atomic_inc(&htt->num_mpdus_ready); 3373 + 3374 + return ath10k_htt_rx_proc_rx_frag_ind(htt, 3375 + &resp->rx_frag_ind, 3376 + skb); 3737 3377 break; 3738 3378 } 3739 3379 case HTT_T2H_MSG_TYPE_TEST: ··· 3951 3583 }; 3952 3584 3953 3585 static const struct ath10k_htt_rx_ops htt_rx_ops_hl = { 3586 + .htt_rx_proc_rx_frag_ind = ath10k_htt_rx_proc_rx_frag_ind_hl, 3954 3587 }; 3955 3588 3956 3589 void ath10k_htt_set_rx_ops(struct ath10k_htt *htt)
+24 -5
drivers/net/wireless/ath/ath10k/htt_tx.c
··· 580 580 return 0; 581 581 } 582 582 583 - int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) 583 + int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u32 mask, u32 reset_mask, 584 + u64 cookie) 584 585 { 585 586 struct ath10k *ar = htt->ar; 586 587 struct htt_stats_req *req; ··· 604 603 605 604 memset(req, 0, sizeof(*req)); 606 605 607 - /* currently we support only max 8 bit masks so no need to worry 606 + /* currently we support only max 24 bit masks so no need to worry 608 607 * about endian support 609 608 */ 610 - req->upload_types[0] = mask; 611 - req->reset_types[0] = mask; 609 + memcpy(req->upload_types, &mask, 3); 610 + memcpy(req->reset_types, &reset_mask, 3); 612 611 req->stat_type = HTT_STATS_REQ_CFG_STAT_TYPE_INVALID; 613 612 req->cookie_lsb = cpu_to_le32(cookie & 0xffffffff); 614 613 req->cookie_msb = cpu_to_le32((cookie & 0xffffffff00000000ULL) >> 32); ··· 1245 1244 u8 tid = ath10k_htt_tx_get_tid(msdu, is_eth); 1246 1245 u8 flags0 = 0; 1247 1246 u16 flags1 = 0; 1247 + u16 msdu_id = 0; 1248 1248 1249 1249 data_len = msdu->len; 1250 1250 ··· 1293 1291 } 1294 1292 } 1295 1293 1294 + if (ar->bus_param.hl_msdu_ids) { 1295 + flags1 |= HTT_DATA_TX_DESC_FLAGS1_POSTPONED; 1296 + res = ath10k_htt_tx_alloc_msdu_id(htt, msdu); 1297 + if (res < 0) { 1298 + ath10k_err(ar, "msdu_id allocation failed %d\n", res); 1299 + goto out; 1300 + } 1301 + msdu_id = res; 1302 + } 1303 + 1304 + /* As msdu is freed by mac80211 (in ieee80211_tx_status()) and by 1305 + * ath10k (in ath10k_htt_htc_tx_complete()) we have to increase 1306 + * reference by one to avoid a use-after-free case and a double 1307 + * free. 1308 + */ 1309 + skb_get(msdu); 1310 + 1296 1311 skb_push(msdu, sizeof(*cmd_hdr)); 1297 1312 skb_push(msdu, sizeof(*tx_desc)); 1298 1313 cmd_hdr = (struct htt_cmd_hdr *)msdu->data; ··· 1319 1300 tx_desc->flags0 = flags0; 1320 1301 tx_desc->flags1 = __cpu_to_le16(flags1); 1321 1302 tx_desc->len = __cpu_to_le16(data_len); 1322 - tx_desc->id = 0; 1303 + tx_desc->id = __cpu_to_le16(msdu_id); 1323 1304 tx_desc->frags_paddr = 0; /* always zero */ 1324 1305 /* Initialize peer_id to INVALID_PEER because this is NOT 1325 1306 * Reinjection path
+6
drivers/net/wireless/ath/ath10k/hw.h
··· 24 24 #define QCA988X_2_0_DEVICE_ID (0x003c) 25 25 #define QCA6164_2_1_DEVICE_ID (0x0041) 26 26 #define QCA6174_2_1_DEVICE_ID (0x003e) 27 + #define QCA6174_3_2_DEVICE_ID (0x0042) 27 28 #define QCA99X0_2_0_DEVICE_ID (0x0040) 28 29 #define QCA9888_2_0_DEVICE_ID (0x0056) 29 30 #define QCA9984_1_0_DEVICE_ID (0x0046) ··· 607 606 608 607 /* target supporting fw download via diag ce */ 609 608 bool fw_diag_ce_download; 609 + 610 + /* need to set uart pin if disable uart print, workaround for a 611 + * firmware bug 612 + */ 613 + bool uart_pin_workaround; 610 614 }; 611 615 612 616 struct htt_rx_desc;
+11 -3
drivers/net/wireless/ath/ath10k/mac.c
··· 1630 1630 if (arvif->vdev_type != WMI_VDEV_TYPE_AP) 1631 1631 return 0; 1632 1632 1633 + /* For mesh, probe response and beacon share the same template */ 1634 + if (ieee80211_vif_is_mesh(vif)) 1635 + return 0; 1636 + 1633 1637 prb = ieee80211_proberesp_get(hw, vif); 1634 1638 if (!prb) { 1635 1639 ath10k_warn(ar, "failed to get probe resp template from mac80211\n"); ··· 5592 5588 struct cfg80211_chan_def def; 5593 5589 u32 vdev_param, pdev_param, slottime, preamble; 5594 5590 u16 bitrate, hw_value; 5595 - u8 rate, basic_rate_idx; 5596 - int rateidx, ret = 0, hw_rate_code; 5591 + u8 rate, basic_rate_idx, rateidx; 5592 + int ret = 0, hw_rate_code, mcast_rate; 5597 5593 enum nl80211_band band; 5598 5594 const struct ieee80211_supported_band *sband; 5599 5595 ··· 5780 5776 if (changed & BSS_CHANGED_MCAST_RATE && 5781 5777 !ath10k_mac_vif_chan(arvif->vif, &def)) { 5782 5778 band = def.chan->band; 5783 - rateidx = vif->bss_conf.mcast_rate[band] - 1; 5779 + mcast_rate = vif->bss_conf.mcast_rate[band]; 5780 + if (mcast_rate > 0) 5781 + rateidx = mcast_rate - 1; 5782 + else 5783 + rateidx = ffs(vif->bss_conf.basic_rates) - 1; 5784 5784 5785 5785 if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) 5786 5786 rateidx += ATH10K_MAC_FIRST_OFDM_RATE_IDX;
+1 -1
drivers/net/wireless/ath/ath10k/pci.c
··· 3492 3492 struct ath10k *ar; 3493 3493 struct ath10k_pci *ar_pci; 3494 3494 enum ath10k_hw_rev hw_rev; 3495 - struct ath10k_bus_params bus_params; 3495 + struct ath10k_bus_params bus_params = {}; 3496 3496 bool pci_ps; 3497 3497 int (*pci_soft_reset)(struct ath10k *ar); 3498 3498 int (*pci_hard_reset)(struct ath10k *ar);
+8 -7
drivers/net/wireless/ath/ath10k/qmi.c
··· 506 506 struct wlfw_cap_resp_msg_v01 *resp; 507 507 struct wlfw_cap_req_msg_v01 req = {}; 508 508 struct ath10k *ar = qmi->ar; 509 + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); 509 510 struct qmi_txn txn; 510 511 int ret; 511 512 ··· 561 560 strlcpy(qmi->fw_build_id, resp->fw_build_id, 562 561 MAX_BUILD_ID_LEN + 1); 563 562 564 - ath10k_dbg(ar, ATH10K_DBG_QMI, 565 - "qmi chip_id 0x%x chip_family 0x%x board_id 0x%x soc_id 0x%x", 566 - qmi->chip_info.chip_id, qmi->chip_info.chip_family, 567 - qmi->board_info.board_id, qmi->soc_info.soc_id); 568 - ath10k_dbg(ar, ATH10K_DBG_QMI, 569 - "qmi fw_version 0x%x fw_build_timestamp %s fw_build_id %s", 570 - qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); 563 + if (!test_bit(ATH10K_SNOC_FLAG_REGISTERED, &ar_snoc->flags)) { 564 + ath10k_info(ar, "qmi chip_id 0x%x chip_family 0x%x board_id 0x%x soc_id 0x%x", 565 + qmi->chip_info.chip_id, qmi->chip_info.chip_family, 566 + qmi->board_info.board_id, qmi->soc_info.soc_id); 567 + ath10k_info(ar, "qmi fw_version 0x%x fw_build_timestamp %s fw_build_id %s", 568 + qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); 569 + } 571 570 572 571 kfree(resp); 573 572 return 0;
+14 -4
drivers/net/wireless/ath/ath10k/sdio.c
··· 584 584 act_len, 585 585 &bndl_cnt); 586 586 587 + if (ret) { 588 + ath10k_warn(ar, "alloc_bundle error %d\n", ret); 589 + goto err; 590 + } 591 + 587 592 n_lookaheads += bndl_cnt; 588 593 i += bndl_cnt; 589 594 /*Next buffer will be the last in the bundle */ ··· 1642 1637 ath10k_dbg(ar, ATH10K_DBG_SDIO, 1643 1638 "sdio mailbox swap service enabled\n"); 1644 1639 ar_sdio->swap_mbox = true; 1640 + } else { 1641 + ath10k_dbg(ar, ATH10K_DBG_SDIO, 1642 + "sdio mailbox swap service disabled\n"); 1643 + ar_sdio->swap_mbox = false; 1645 1644 } 1645 + 1646 1646 return 0; 1647 1647 } 1648 1648 ··· 1964 1954 struct ath10k *ar; 1965 1955 enum ath10k_hw_rev hw_rev; 1966 1956 u32 dev_id_base; 1967 - struct ath10k_bus_params bus_params; 1957 + struct ath10k_bus_params bus_params = {}; 1968 1958 int ret, i; 1969 1959 1970 1960 /* Assumption: All SDIO based chipsets (so far) are QCA6174 based. ··· 2055 2045 bus_params.dev_type = ATH10K_DEV_TYPE_HL; 2056 2046 /* TODO: don't know yet how to get chip_id with SDIO */ 2057 2047 bus_params.chip_id = 0; 2048 + bus_params.hl_msdu_ids = true; 2049 + 2058 2050 ret = ath10k_core_register(ar, &bus_params); 2059 2051 if (ret) { 2060 2052 ath10k_err(ar, "failed to register driver core: %d\n", ret); ··· 2064 2052 } 2065 2053 2066 2054 /* TODO: remove this once SDIO support is fully implemented */ 2067 - ath10k_warn(ar, "WARNING: ath10k SDIO support is incomplete, don't expect anything to work!\n"); 2055 + ath10k_warn(ar, "WARNING: ath10k SDIO support is work-in-progress, problems may arise!\n"); 2068 2056 2069 2057 return 0; 2070 2058 ··· 2085 2073 "sdio removed func %d vendor 0x%x device 0x%x\n", 2086 2074 func->num, func->vendor, func->device); 2087 2075 2088 - (void)ath10k_sdio_hif_disable_intrs(ar); 2089 - cancel_work_sync(&ar_sdio->wr_async_work); 2090 2076 ath10k_core_unregister(ar); 2091 2077 ath10k_core_destroy(ar); 2092 2078 }
+2 -2
drivers/net/wireless/ath/ath10k/snoc.c
··· 165 165 /* CE4: host->target HTT */ 166 166 { 167 167 .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, 168 - .src_nentries = 256, 168 + .src_nentries = 2048, 169 169 .src_sz_max = 256, 170 170 .dest_nentries = 0, 171 171 .send_cb = ath10k_snoc_htt_tx_cb, ··· 1249 1249 int ath10k_snoc_fw_indication(struct ath10k *ar, u64 type) 1250 1250 { 1251 1251 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); 1252 - struct ath10k_bus_params bus_params; 1252 + struct ath10k_bus_params bus_params = {}; 1253 1253 int ret; 1254 1254 1255 1255 if (test_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags))
+3
drivers/net/wireless/ath/ath10k/txrx.c
··· 150 150 { 151 151 struct ath10k_peer *peer; 152 152 153 + if (peer_id >= BITS_PER_TYPE(peer->peer_ids)) 154 + return NULL; 155 + 153 156 lockdep_assert_held(&ar->data_lock); 154 157 155 158 list_for_each_entry(peer, &ar->peers, list)
+1 -1
drivers/net/wireless/ath/ath10k/usb.c
··· 973 973 struct usb_device *dev = interface_to_usbdev(interface); 974 974 int ret, vendor_id, product_id; 975 975 enum ath10k_hw_rev hw_rev; 976 - struct ath10k_bus_params bus_params; 976 + struct ath10k_bus_params bus_params = {}; 977 977 978 978 /* Assumption: All USB based chipsets (so far) are QCA9377 based. 979 979 * If there will be newer chipsets that does not use the hw reg
+26 -2
drivers/net/wireless/ath/ath10k/wmi-tlv.c
··· 1905 1905 return skb; 1906 1906 } 1907 1907 1908 + static int ath10k_wmi_tlv_op_get_vdev_subtype(struct ath10k *ar, 1909 + enum wmi_vdev_subtype subtype) 1910 + { 1911 + switch (subtype) { 1912 + case WMI_VDEV_SUBTYPE_NONE: 1913 + return WMI_TLV_VDEV_SUBTYPE_NONE; 1914 + case WMI_VDEV_SUBTYPE_P2P_DEVICE: 1915 + return WMI_TLV_VDEV_SUBTYPE_P2P_DEV; 1916 + case WMI_VDEV_SUBTYPE_P2P_CLIENT: 1917 + return WMI_TLV_VDEV_SUBTYPE_P2P_CLI; 1918 + case WMI_VDEV_SUBTYPE_P2P_GO: 1919 + return WMI_TLV_VDEV_SUBTYPE_P2P_GO; 1920 + case WMI_VDEV_SUBTYPE_PROXY_STA: 1921 + return WMI_TLV_VDEV_SUBTYPE_PROXY_STA; 1922 + case WMI_VDEV_SUBTYPE_MESH_11S: 1923 + return WMI_TLV_VDEV_SUBTYPE_MESH_11S; 1924 + case WMI_VDEV_SUBTYPE_MESH_NON_11S: 1925 + return -ENOTSUPP; 1926 + } 1927 + return -ENOTSUPP; 1928 + } 1929 + 1908 1930 static struct sk_buff * 1909 1931 ath10k_wmi_tlv_op_gen_vdev_create(struct ath10k *ar, 1910 1932 u32 vdev_id, ··· 2862 2840 if ((ieee80211_is_action(hdr->frame_control) || 2863 2841 ieee80211_is_deauth(hdr->frame_control) || 2864 2842 ieee80211_is_disassoc(hdr->frame_control)) && 2865 - ieee80211_has_protected(hdr->frame_control)) 2843 + ieee80211_has_protected(hdr->frame_control)) { 2844 + skb_put(msdu, IEEE80211_CCMP_MIC_LEN); 2866 2845 buf_len += IEEE80211_CCMP_MIC_LEN; 2846 + } 2867 2847 2868 2848 buf_len = min_t(u32, buf_len, WMI_TLV_MGMT_TX_FRAME_MAX_LEN); 2869 2849 buf_len = round_up(buf_len, 4); ··· 4329 4305 .gen_tdls_peer_update = ath10k_wmi_tlv_op_gen_tdls_peer_update, 4330 4306 .gen_adaptive_qcs = ath10k_wmi_tlv_op_gen_adaptive_qcs, 4331 4307 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, 4332 - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, 4308 + .get_vdev_subtype = ath10k_wmi_tlv_op_get_vdev_subtype, 4333 4309 .gen_echo = ath10k_wmi_tlv_op_gen_echo, 4334 4310 .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, 4335 4311 .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
+12
drivers/net/wireless/ath/ath10k/wmi-tlv.h
··· 1567 1567 WMI_SERVICE_SAP_AUTH_OFFLOAD, len); 1568 1568 SVCMAP(WMI_TLV_SERVICE_MGMT_TX_WMI, 1569 1569 WMI_SERVICE_MGMT_TX_WMI, len); 1570 + SVCMAP(WMI_TLV_SERVICE_MESH_11S, 1571 + WMI_SERVICE_MESH_11S, len); 1570 1572 } 1571 1573 1572 1574 static inline void ··· 1776 1774 struct wmi_mac_addr mac_addr; 1777 1775 struct wmi_mac_addr mac_mask; 1778 1776 } __packed; 1777 + 1778 + enum wmi_tlv_vdev_subtype { 1779 + WMI_TLV_VDEV_SUBTYPE_NONE = 0, 1780 + WMI_TLV_VDEV_SUBTYPE_P2P_DEV = 1, 1781 + WMI_TLV_VDEV_SUBTYPE_P2P_CLI = 2, 1782 + WMI_TLV_VDEV_SUBTYPE_P2P_GO = 3, 1783 + WMI_TLV_VDEV_SUBTYPE_PROXY_STA = 4, 1784 + WMI_TLV_VDEV_SUBTYPE_MESH = 5, 1785 + WMI_TLV_VDEV_SUBTYPE_MESH_11S = 6, 1786 + }; 1779 1787 1780 1788 struct wmi_tlv_vdev_start_cmd { 1781 1789 __le32 vdev_id;
+31 -6
drivers/net/wireless/ath/ath10k/wmi.c
··· 8309 8309 8310 8310 static void 8311 8311 ath10k_wmi_fw_peer_stats_fill(const struct ath10k_fw_stats_peer *peer, 8312 - char *buf, u32 *length) 8312 + char *buf, u32 *length, bool extended_peer) 8313 8313 { 8314 8314 u32 len = *length; 8315 8315 u32 buf_len = ATH10K_FW_STATS_BUF_SIZE; ··· 8322 8322 "Peer TX rate", peer->peer_tx_rate); 8323 8323 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", 8324 8324 "Peer RX rate", peer->peer_rx_rate); 8325 - len += scnprintf(buf + len, buf_len - len, "%30s %llu\n", 8326 - "Peer RX duration", peer->rx_duration); 8325 + if (!extended_peer) 8326 + len += scnprintf(buf + len, buf_len - len, "%30s %llu\n", 8327 + "Peer RX duration", peer->rx_duration); 8327 8328 8328 8329 len += scnprintf(buf + len, buf_len - len, "\n"); 8329 8330 *length = len; 8331 + } 8332 + 8333 + static void 8334 + ath10k_wmi_fw_extd_peer_stats_fill(const struct ath10k_fw_extd_stats_peer *peer, 8335 + char *buf, u32 *length) 8336 + { 8337 + u32 len = *length; 8338 + u32 buf_len = ATH10K_FW_STATS_BUF_SIZE; 8339 + 8340 + len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", 8341 + "Peer MAC address", peer->peer_macaddr); 8342 + len += scnprintf(buf + len, buf_len - len, "%30s %llu\n", 8343 + "Peer RX duration", peer->rx_duration); 8330 8344 } 8331 8345 8332 8346 void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar, ··· 8388 8374 "================="); 8389 8375 8390 8376 list_for_each_entry(peer, &fw_stats->peers, list) { 8391 - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); 8377 + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, 8378 + fw_stats->extended); 8392 8379 } 8393 8380 8394 8381 unlock: ··· 8447 8432 "================="); 8448 8433 8449 8434 list_for_each_entry(peer, &fw_stats->peers, list) { 8450 - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); 8435 + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, 8436 + fw_stats->extended); 8451 8437 } 8452 8438 8453 8439 unlock: ··· 8557 8541 const struct ath10k_fw_stats_pdev *pdev; 8558 8542 const struct ath10k_fw_stats_vdev_extd *vdev; 8559 8543 const struct ath10k_fw_stats_peer *peer; 8544 + const struct ath10k_fw_extd_stats_peer *extd_peer; 8560 8545 size_t num_peers; 8561 8546 size_t num_vdevs; 8562 8547 ··· 8620 8603 "================="); 8621 8604 8622 8605 list_for_each_entry(peer, &fw_stats->peers, list) { 8623 - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); 8606 + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, 8607 + fw_stats->extended); 8608 + } 8609 + 8610 + if (fw_stats->extended) { 8611 + list_for_each_entry(extd_peer, &fw_stats->peers_extd, list) { 8612 + ath10k_wmi_fw_extd_peer_stats_fill(extd_peer, buf, 8613 + &len); 8614 + } 8624 8615 } 8625 8616 8626 8617 unlock:
+4 -3
drivers/net/wireless/ath/ath10k/wmi.h
··· 4535 4535 }; 4536 4536 4537 4537 enum wmi_tlv_stats_id { 4538 - WMI_TLV_STAT_PDEV = BIT(0), 4539 - WMI_TLV_STAT_VDEV = BIT(1), 4540 - WMI_TLV_STAT_PEER = BIT(2), 4538 + WMI_TLV_STAT_PEER = BIT(0), 4539 + WMI_TLV_STAT_AP = BIT(1), 4540 + WMI_TLV_STAT_PDEV = BIT(2), 4541 + WMI_TLV_STAT_VDEV = BIT(3), 4541 4542 WMI_TLV_STAT_PEER_EXTD = BIT(10), 4542 4543 }; 4543 4544
+1 -2
drivers/net/wireless/ath/ath6kl/debug.c
··· 1132 1132 1133 1133 tbl = (const struct wmi_target_roam_tbl *) buf; 1134 1134 num_entries = le16_to_cpu(tbl->num_entries); 1135 - if (sizeof(*tbl) + num_entries * sizeof(struct wmi_bss_roam_info) > 1136 - len) 1135 + if (struct_size(tbl, info, num_entries) > len) 1137 1136 return -EINVAL; 1138 1137 1139 1138 if (ar->debug.roam_tbl == NULL ||
-3
drivers/net/wireless/ath/ath6kl/htc_pipe.c
··· 898 898 break; 899 899 } 900 900 901 - if (status != 0) 902 - break; 903 - 904 901 /* advance buffer past this record for next time around */ 905 902 buffer += record->len; 906 903 len -= record->len;
+10 -3
drivers/net/wireless/ath/ath6kl/wmi.c
··· 1176 1176 return -EINVAL; 1177 1177 1178 1178 ev = (struct wmi_pstream_timeout_event *) datap; 1179 + if (ev->traffic_class >= WMM_NUM_AC) { 1180 + ath6kl_err("invalid traffic class: %d\n", ev->traffic_class); 1181 + return -EINVAL; 1182 + } 1179 1183 1180 1184 /* 1181 1185 * When the pstream (fat pipe == AC) timesout, it means there were ··· 1299 1295 if (len < sizeof(*ev)) 1300 1296 return -EINVAL; 1301 1297 ev = (struct wmi_neighbor_report_event *) datap; 1302 - if (sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info) 1303 - > len) { 1298 + if (struct_size(ev, neighbor, ev->num_neighbors) > len) { 1304 1299 ath6kl_dbg(ATH6KL_DBG_WMI, 1305 1300 "truncated neighbor event (num=%d len=%d)\n", 1306 1301 ev->num_neighbors, len); ··· 1520 1517 return -EINVAL; 1521 1518 1522 1519 reply = (struct wmi_cac_event *) datap; 1520 + if (reply->ac >= WMM_NUM_AC) { 1521 + ath6kl_err("invalid AC: %d\n", reply->ac); 1522 + return -EINVAL; 1523 + } 1523 1524 1524 1525 if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) && 1525 1526 (reply->status_code != IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED)) { ··· 2640 2633 u16 active_tsids = 0; 2641 2634 int ret; 2642 2635 2643 - if (traffic_class > 3) { 2636 + if (traffic_class >= WMM_NUM_AC) { 2644 2637 ath6kl_err("invalid traffic class: %d\n", traffic_class); 2645 2638 return -EINVAL; 2646 2639 }
+3 -21
drivers/net/wireless/ath/ath9k/ar9003_phy.c
··· 157 157 freq = centers.synth_center; 158 158 159 159 if (freq < 4800) { /* 2 GHz, fractional mode */ 160 - if (AR_SREV_9330(ah)) { 160 + if (AR_SREV_9330(ah) || AR_SREV_9485(ah) || 161 + AR_SREV_9531(ah) || AR_SREV_9550(ah) || 162 + AR_SREV_9561(ah) || AR_SREV_9565(ah)) { 161 163 if (ah->is_clk_25mhz) 162 164 div = 75; 163 165 else ··· 167 165 168 166 channelSel = (freq * 4) / div; 169 167 chan_frac = (((freq * 4) % div) * 0x20000) / div; 170 - channelSel = (channelSel << 17) | chan_frac; 171 - } else if (AR_SREV_9485(ah) || AR_SREV_9565(ah)) { 172 - /* 173 - * freq_ref = 40 / (refdiva >> amoderefsel); 174 - * where refdiva=1 and amoderefsel=0 175 - * ndiv = ((chan_mhz * 4) / 3) / freq_ref; 176 - * chansel = int(ndiv), chanfrac = (ndiv - chansel) * 0x20000 177 - */ 178 - channelSel = (freq * 4) / 120; 179 - chan_frac = (((freq * 4) % 120) * 0x20000) / 120; 180 168 channelSel = (channelSel << 17) | chan_frac; 181 169 } else if (AR_SREV_9340(ah)) { 182 170 if (ah->is_clk_25mhz) { ··· 176 184 } else { 177 185 channelSel = CHANSEL_2G(freq) >> 1; 178 186 } 179 - } else if (AR_SREV_9550(ah) || AR_SREV_9531(ah) || 180 - AR_SREV_9561(ah)) { 181 - if (ah->is_clk_25mhz) 182 - div = 75; 183 - else 184 - div = 120; 185 - 186 - channelSel = (freq * 4) / div; 187 - chan_frac = (((freq * 4) % div) * 0x20000) / div; 188 - channelSel = (channelSel << 17) | chan_frac; 189 187 } else { 190 188 channelSel = CHANSEL_2G(freq); 191 189 }
+1 -1
drivers/net/wireless/ath/ath9k/eeprom.c
··· 428 428 else 429 429 power_limit = 0; 430 430 431 - return power_limit; 431 + return min_t(u16, power_limit, MAX_RATE_POWER); 432 432 } 433 433 434 434 void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah)
+1
drivers/net/wireless/ath/ath9k/eeprom_4k.c
··· 424 424 ath9k_hw_get_channel_centers(ah, chan, &centers); 425 425 426 426 scaledPower = powerLimit - antenna_reduction; 427 + scaledPower = min_t(u16, scaledPower, MAX_RATE_POWER); 427 428 numCtlModes = ARRAY_SIZE(ctlModesFor11g) - SUB_NUM_CTL_MODES_AT_2G_40; 428 429 pCtlMode = ctlModesFor11g; 429 430
+27 -13
drivers/net/wireless/ath/ath9k/hw.c
··· 252 252 /* Chip Revisions */ 253 253 /******************/ 254 254 255 - static void ath9k_hw_read_revisions(struct ath_hw *ah) 255 + static bool ath9k_hw_read_revisions(struct ath_hw *ah) 256 256 { 257 + u32 srev; 257 258 u32 val; 258 259 259 260 if (ah->get_mac_revision) ··· 270 269 val = REG_READ(ah, AR_SREV); 271 270 ah->hw_version.macRev = MS(val, AR_SREV_REVISION2); 272 271 } 273 - return; 272 + return true; 274 273 case AR9300_DEVID_AR9340: 275 274 ah->hw_version.macVersion = AR_SREV_VERSION_9340; 276 - return; 275 + return true; 277 276 case AR9300_DEVID_QCA955X: 278 277 ah->hw_version.macVersion = AR_SREV_VERSION_9550; 279 - return; 278 + return true; 280 279 case AR9300_DEVID_AR953X: 281 280 ah->hw_version.macVersion = AR_SREV_VERSION_9531; 282 - return; 281 + return true; 283 282 case AR9300_DEVID_QCA956X: 284 283 ah->hw_version.macVersion = AR_SREV_VERSION_9561; 285 - return; 284 + return true; 286 285 } 287 286 288 - val = REG_READ(ah, AR_SREV) & AR_SREV_ID; 287 + srev = REG_READ(ah, AR_SREV); 288 + 289 + if (srev == -EIO) { 290 + ath_err(ath9k_hw_common(ah), 291 + "Failed to read SREV register"); 292 + return false; 293 + } 294 + 295 + val = srev & AR_SREV_ID; 289 296 290 297 if (val == 0xFF) { 291 - val = REG_READ(ah, AR_SREV); 298 + val = srev; 292 299 ah->hw_version.macVersion = 293 300 (val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S; 294 301 ah->hw_version.macRev = MS(val, AR_SREV_REVISION2); ··· 315 306 if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) 316 307 ah->is_pciexpress = true; 317 308 } 309 + 310 + return true; 318 311 } 319 312 320 313 /************************************/ ··· 457 446 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); 458 447 459 448 regulatory->country_code = CTRY_DEFAULT; 460 - regulatory->power_limit = MAX_RATE_POWER; 449 + regulatory->power_limit = MAX_COMBINED_POWER; 461 450 462 451 ah->hw_version.magic = AR5416_MAGIC; 463 452 ah->hw_version.subvendorid = 0; ··· 570 559 struct ath_common *common = ath9k_hw_common(ah); 571 560 int r = 0; 572 561 573 - ath9k_hw_read_revisions(ah); 562 + if (!ath9k_hw_read_revisions(ah)) { 563 + ath_err(common, "Could not read hardware revisions"); 564 + return -EOPNOTSUPP; 565 + } 574 566 575 567 switch (ah->hw_version.macVersion) { 576 568 case AR_SREV_VERSION_5416_PCI: ··· 2966 2952 ctl = ath9k_regd_get_ctl(reg, chan); 2967 2953 2968 2954 channel = chan->chan; 2969 - chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER); 2955 + chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER); 2970 2956 new_pwr = min_t(int, chan_pwr, reg->power_limit); 2971 2957 2972 2958 ah->eep_ops->set_txpower(ah, chan, ctl, ··· 2979 2965 struct ath9k_channel *chan = ah->curchan; 2980 2966 struct ieee80211_channel *channel = chan->chan; 2981 2967 2982 - reg->power_limit = min_t(u32, limit, MAX_RATE_POWER); 2968 + reg->power_limit = min_t(u32, limit, MAX_COMBINED_POWER); 2983 2969 if (test) 2984 - channel->max_power = MAX_RATE_POWER / 2; 2970 + channel->max_power = MAX_COMBINED_POWER / 2; 2985 2971 2986 2972 ath9k_hw_apply_txpower(ah, chan, test); 2987 2973
+1
drivers/net/wireless/ath/ath9k/hw.h
··· 173 173 #define ATH9K_NUM_QUEUES 10 174 174 175 175 #define MAX_RATE_POWER 63 176 + #define MAX_COMBINED_POWER 254 /* 128 dBm, chosen to fit in u8 */ 176 177 #define AH_WAIT_TIMEOUT 100000 /* (us) */ 177 178 #define AH_TSF_WRITE_TIMEOUT 100 /* (us) */ 178 179 #define AH_TIME_QUANTUM 10
+1 -1
drivers/net/wireless/ath/ath9k/init.c
··· 805 805 ah->curchan = &ah->channels[chan->hw_value]; 806 806 cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20); 807 807 ath9k_cmn_get_channel(sc->hw, ah, &chandef); 808 - ath9k_hw_set_txpowerlimit(ah, MAX_RATE_POWER, true); 808 + ath9k_hw_set_txpowerlimit(ah, MAX_COMBINED_POWER, true); 809 809 } 810 810 } 811 811
+4 -14
drivers/net/wireless/ath/ath9k/xmit.c
··· 410 410 struct ath_tx_status *ts, int txok, 411 411 int *nframes, int *nbad) 412 412 { 413 - struct ath_frame_info *fi; 414 413 u16 seq_st = 0; 415 414 u32 ba[WME_BA_BMP_SIZE >> 5]; 416 415 int ba_index; ··· 425 426 } 426 427 427 428 while (bf) { 428 - fi = get_frame_info(bf->bf_mpdu); 429 429 ba_index = ATH_BA_INDEX(seq_st, bf->bf_state.seqno); 430 430 431 431 (*nframes)++; ··· 444 446 { 445 447 struct ath_node *an = NULL; 446 448 struct sk_buff *skb; 447 - struct ieee80211_hdr *hdr; 448 449 struct ieee80211_tx_info *tx_info; 449 450 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; 450 451 struct list_head bf_head; ··· 460 463 int bar_index = -1; 461 464 462 465 skb = bf->bf_mpdu; 463 - hdr = (struct ieee80211_hdr *)skb->data; 464 - 465 466 tx_info = IEEE80211_SKB_CB(skb); 466 467 467 468 memcpy(rates, bf->rates, sizeof(rates)); ··· 663 668 static void ath_tx_count_airtime(struct ath_softc *sc, 664 669 struct ieee80211_sta *sta, 665 670 struct ath_buf *bf, 666 - struct ath_tx_status *ts) 671 + struct ath_tx_status *ts, 672 + u8 tid) 667 673 { 668 674 u32 airtime = 0; 669 675 int i; ··· 675 679 airtime += rate_dur * bf->rates[i].count; 676 680 } 677 681 678 - ieee80211_sta_register_airtime(sta, ts->tid, airtime, 0); 682 + ieee80211_sta_register_airtime(sta, tid, airtime, 0); 679 683 } 680 684 681 685 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, ··· 705 709 if (sta) { 706 710 struct ath_node *an = (struct ath_node *)sta->drv_priv; 707 711 tid = ath_get_skb_tid(sc, an, bf->bf_mpdu); 708 - ath_tx_count_airtime(sc, sta, bf, ts); 712 + ath_tx_count_airtime(sc, sta, bf, ts, tid->tidno); 709 713 if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY)) 710 714 tid->clear_ps_filter = true; 711 715 } ··· 2265 2269 int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, 2266 2270 struct ath_tx_control *txctl) 2267 2271 { 2268 - struct ieee80211_hdr *hdr; 2269 2272 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 2270 2273 struct ieee80211_sta *sta = txctl->sta; 2271 2274 struct ieee80211_vif *vif = info->control.vif; 2272 2275 struct ath_frame_info *fi = get_frame_info(skb); 2273 - struct ath_vif *avp = NULL; 2274 2276 struct ath_softc *sc = hw->priv; 2275 2277 struct ath_txq *txq = txctl->txq; 2276 2278 struct ath_atx_tid *tid = NULL; ··· 2277 2283 bool ps_resp; 2278 2284 int q, ret; 2279 2285 2280 - if (vif) 2281 - avp = (void *)vif->drv_priv; 2282 - 2283 2286 ps_resp = !!(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE); 2284 2287 2285 2288 ret = ath_tx_prepare(hw, skb, txctl); 2286 2289 if (ret) 2287 2290 return ret; 2288 2291 2289 - hdr = (struct ieee80211_hdr *) skb->data; 2290 2292 /* 2291 2293 * At this point, the vif, hw_key and sta pointers in the tx control 2292 2294 * info are no longer valid (overwritten by the ath_frame_info data.
+1 -1
drivers/net/wireless/ath/carl9170/mac.c
··· 519 519 power = ar->power_5G_leg[0] & 0x3f; 520 520 break; 521 521 default: 522 - BUG_ON(1); 522 + BUG(); 523 523 } 524 524 525 525 power = min_t(unsigned int, power, ar->hw->conf.power_level * 2);
+1 -1
drivers/net/wireless/ath/carl9170/rx.c
··· 795 795 break; 796 796 797 797 default: 798 - BUG_ON(1); 798 + BUG(); 799 799 break; 800 800 } 801 801
+1 -1
drivers/net/wireless/ath/dfs_pattern_detector.c
··· 111 111 JP_PATTERN(0, 0, 1, 1428, 1428, 1, 18, 29, false), 112 112 JP_PATTERN(1, 2, 3, 3846, 3846, 1, 18, 29, false), 113 113 JP_PATTERN(2, 0, 1, 1388, 1388, 1, 18, 50, false), 114 - JP_PATTERN(3, 1, 2, 4000, 4000, 1, 18, 50, false), 114 + JP_PATTERN(3, 0, 4, 4000, 4000, 1, 18, 50, false), 115 115 JP_PATTERN(4, 0, 5, 150, 230, 1, 23, 50, false), 116 116 JP_PATTERN(5, 6, 10, 200, 500, 1, 16, 50, false), 117 117 JP_PATTERN(6, 11, 20, 200, 500, 1, 12, 50, false),
-1
drivers/net/wireless/ath/regd.h
··· 28 28 CTL_ETSI = 0x30, 29 29 }; 30 30 31 - #define NO_CTL 0xff 32 31 #define SD_NO_CTL 0xE0 33 32 #define NO_CTL 0xff 34 33 #define CTL_11A 0
+2 -2
drivers/net/wireless/ath/wil6210/cfg80211.c
··· 395 395 { 396 396 int i; 397 397 398 - for (i = 0; i < max_assoc_sta; i++) { 398 + for (i = 0; i < wil->max_assoc_sta; i++) { 399 399 if (wil->sta[i].status == wil_sta_unused) 400 400 continue; 401 401 if (wil->sta[i].mid != mid) ··· 3022 3022 wil, vif->mid, WMI_INVALID_RF_SECTOR_INDEX, 3023 3023 sector_type, WIL_CID_ALL); 3024 3024 if (rc == -EINVAL) { 3025 - for (i = 0; i < max_assoc_sta; i++) { 3025 + for (i = 0; i < wil->max_assoc_sta; i++) { 3026 3026 if (wil->sta[i].mid != vif->mid) 3027 3027 continue; 3028 3028 rc = wil_rf_sector_wmi_set_selected(
+49 -21
drivers/net/wireless/ath/wil6210/debugfs.c
··· 63 63 &ring->va[idx].rx.enhanced; 64 64 u16 buff_id = le16_to_cpu(rx_d->mac.buff_id); 65 65 66 - has_skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb; 66 + if (wil->rx_buff_mgmt.buff_arr && 67 + wil_val_in_range(buff_id, 0, wil->rx_buff_mgmt.size)) 68 + has_skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb; 67 69 seq_printf(s, "%c", (has_skb) ? _h : _s); 68 70 } else { 69 71 struct wil_tx_enhanced_desc *d = ··· 73 71 &ring->va[idx].tx.enhanced; 74 72 75 73 num_of_descs = (u8)d->mac.d[2]; 76 - has_skb = ring->ctx[idx].skb; 74 + has_skb = ring->ctx && ring->ctx[idx].skb; 77 75 if (num_of_descs >= 1) 78 - seq_printf(s, "%c", ring->ctx[idx].skb ? _h : _s); 76 + seq_printf(s, "%c", has_skb ? _h : _s); 79 77 else 80 78 /* num_of_descs == 0, it's a frag in a list of descs */ 81 79 seq_printf(s, "%c", has_skb ? 'h' : _s); ··· 86 84 const char *name, struct wil_ring *ring, 87 85 char _s, char _h) 88 86 { 89 - void __iomem *x = wmi_addr(wil, ring->hwtail); 87 + void __iomem *x; 90 88 u32 v; 91 89 92 90 seq_printf(s, "RING %s = {\n", name); ··· 98 96 else 99 97 seq_printf(s, " swtail = %d\n", ring->swtail); 100 98 seq_printf(s, " swhead = %d\n", ring->swhead); 99 + if (wil->use_enhanced_dma_hw) { 100 + int ring_id = ring->is_rx ? 101 + WIL_RX_DESC_RING_ID : ring - wil->ring_tx; 102 + /* SUBQ_CONS is a table of 32 entries, one for each Q pair. 103 + * lower 16bits are for even ring_id and upper 16bits are for 104 + * odd ring_id 105 + */ 106 + x = wmi_addr(wil, RGF_DMA_SCM_SUBQ_CONS + 4 * (ring_id / 2)); 107 + v = readl_relaxed(x); 108 + 109 + v = (ring_id % 2 ? (v >> 16) : (v & 0xffff)); 110 + seq_printf(s, " hwhead = %u\n", v); 111 + } 101 112 seq_printf(s, " hwtail = [0x%08x] -> ", ring->hwtail); 113 + x = wmi_addr(wil, ring->hwtail); 102 114 if (x) { 103 115 v = readl(x); 104 116 seq_printf(s, "0x%08x = %d\n", v, v); ··· 178 162 179 163 snprintf(name, sizeof(name), "tx_%2d", i); 180 164 181 - if (cid < max_assoc_sta) 165 + if (cid < wil->max_assoc_sta) 182 166 seq_printf(s, 183 167 "\n%pM CID %d TID %d 1x%s BACK([%u] %u TU A%s) [%3d|%3d] idle %s\n", 184 168 wil->sta[cid].addr, cid, tid, ··· 204 188 static void wil_print_sring(struct seq_file *s, struct wil6210_priv *wil, 205 189 struct wil_status_ring *sring) 206 190 { 207 - void __iomem *x = wmi_addr(wil, sring->hwtail); 191 + void __iomem *x; 208 192 int sring_idx = sring - wil->srings; 209 193 u32 v; 210 194 ··· 215 199 seq_printf(s, " size = %d\n", sring->size); 216 200 seq_printf(s, " elem_size = %zu\n", sring->elem_size); 217 201 seq_printf(s, " swhead = %d\n", sring->swhead); 202 + if (wil->use_enhanced_dma_hw) { 203 + /* COMPQ_PROD is a table of 32 entries, one for each Q pair. 204 + * lower 16bits are for even ring_id and upper 16bits are for 205 + * odd ring_id 206 + */ 207 + x = wmi_addr(wil, RGF_DMA_SCM_COMPQ_PROD + 4 * (sring_idx / 2)); 208 + v = readl_relaxed(x); 209 + 210 + v = (sring_idx % 2 ? (v >> 16) : (v & 0xffff)); 211 + seq_printf(s, " hwhead = %u\n", v); 212 + } 218 213 seq_printf(s, " hwtail = [0x%08x] -> ", sring->hwtail); 214 + x = wmi_addr(wil, sring->hwtail); 219 215 if (x) { 220 216 v = readl_relaxed(x); 221 217 seq_printf(s, "0x%08x = %d\n", v, v); ··· 839 811 "BACK: del_rx require at least 2 params\n"); 840 812 return -EINVAL; 841 813 } 842 - if (p1 < 0 || p1 >= max_assoc_sta) { 814 + if (p1 < 0 || p1 >= wil->max_assoc_sta) { 843 815 wil_err(wil, "BACK: invalid CID %d\n", p1); 844 816 return -EINVAL; 845 817 } ··· 1119 1091 1120 1092 if (wil->use_enhanced_dma_hw) { 1121 1093 if (tx) { 1122 - skb = ring->ctx[txdesc_idx].skb; 1123 - } else { 1094 + skb = ring->ctx ? ring->ctx[txdesc_idx].skb : NULL; 1095 + } else if (wil->rx_buff_mgmt.buff_arr) { 1124 1096 struct wil_rx_enhanced_desc *rx_d = 1125 1097 (struct wil_rx_enhanced_desc *) 1126 1098 &ring->va[txdesc_idx].rx.enhanced; 1127 1099 u16 buff_id = le16_to_cpu(rx_d->mac.buff_id); 1128 1100 1129 1101 if (!wil_val_in_range(buff_id, 0, 1130 - wil->rx_buff_mgmt.size)) { 1102 + wil->rx_buff_mgmt.size)) 1131 1103 seq_printf(s, "invalid buff_id %d\n", buff_id); 1132 - return 0; 1133 - } 1134 - skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb; 1104 + else 1105 + skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb; 1135 1106 } 1136 1107 } else { 1137 1108 skb = ring->ctx[txdesc_idx].skb; ··· 1163 1136 struct wil6210_priv *wil = s->private; 1164 1137 int sring_idx = dbg_sring_index; 1165 1138 struct wil_status_ring *sring; 1166 - bool tx = sring_idx == wil->tx_sring_idx ? 1 : 0; 1139 + bool tx; 1167 1140 u32 status_msg_idx = dbg_status_msg_index; 1168 1141 u32 *u; 1169 1142 ··· 1173 1146 } 1174 1147 1175 1148 sring = &wil->srings[sring_idx]; 1149 + tx = !sring->is_rx; 1176 1150 1177 1151 if (!sring->va) { 1178 1152 seq_printf(s, "No %cX status ring\n", tx ? 'T' : 'R'); ··· 1290 1262 1291 1263 memset(&reply, 0, sizeof(reply)); 1292 1264 1293 - for (i = 0; i < max_assoc_sta; i++) { 1265 + for (i = 0; i < wil->max_assoc_sta; i++) { 1294 1266 u32 status; 1295 1267 1296 1268 cmd.cid = i; ··· 1387 1359 if (!sinfo) 1388 1360 return -ENOMEM; 1389 1361 1390 - for (i = 0; i < max_assoc_sta; i++) { 1362 + for (i = 0; i < wil->max_assoc_sta; i++) { 1391 1363 struct wil_sta_info *p = &wil->sta[i]; 1392 1364 char *status = "unknown"; 1393 1365 struct wil6210_vif *vif; ··· 1589 1561 struct wil6210_priv *wil = s->private; 1590 1562 int i, tid, mcs; 1591 1563 1592 - for (i = 0; i < max_assoc_sta; i++) { 1564 + for (i = 0; i < wil->max_assoc_sta; i++) { 1593 1565 struct wil_sta_info *p = &wil->sta[i]; 1594 1566 char *status = "unknown"; 1595 1567 u8 aid = 0; ··· 1698 1670 struct wil6210_priv *wil = s->private; 1699 1671 int i, bin; 1700 1672 1701 - for (i = 0; i < max_assoc_sta; i++) { 1673 + for (i = 0; i < wil->max_assoc_sta; i++) { 1702 1674 struct wil_sta_info *p = &wil->sta[i]; 1703 1675 char *status = "unknown"; 1704 1676 u8 aid = 0; ··· 1787 1759 size_t sz = sizeof(u64) * WIL_NUM_LATENCY_BINS; 1788 1760 1789 1761 wil->tx_latency_res = val; 1790 - for (i = 0; i < max_assoc_sta; i++) { 1762 + for (i = 0; i < wil->max_assoc_sta; i++) { 1791 1763 struct wil_sta_info *sta = &wil->sta[i]; 1792 1764 1793 1765 kfree(sta->tx_latency_bins); ··· 1872 1844 } 1873 1845 1874 1846 seq_printf(s, "TSF %lld\n", vif->fw_stats_tsf); 1875 - for (i = 0; i < max_assoc_sta; i++) { 1847 + for (i = 0; i < wil->max_assoc_sta; i++) { 1876 1848 if (wil->sta[i].status == wil_sta_unused) 1877 1849 continue; 1878 1850 if (wil->sta[i].mid != vif->mid) ··· 2488 2460 wil->debug = NULL; 2489 2461 2490 2462 kfree(wil->dbg_data.data_arr); 2491 - for (i = 0; i < max_assoc_sta; i++) 2463 + for (i = 0; i < wil->max_assoc_sta; i++) 2492 2464 kfree(wil->sta[i].tx_latency_bins); 2493 2465 2494 2466 /* free pmc memory without sending command to fw, as it will
+8 -3
drivers/net/wireless/ath/wil6210/fw.h
··· 1 1 /* 2 2 * Copyright (c) 2014,2016 Qualcomm Atheros, Inc. 3 - * Copyright (c) 2018, The Linux Foundation. All rights reserved. 3 + * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. 4 4 * 5 5 * Permission to use, copy, modify, and/or distribute this software for any 6 6 * purpose with or without fee is hereby granted, provided that the above ··· 109 109 110 110 /* brd file info encoded inside a comment record */ 111 111 #define WIL_BRD_FILE_MAGIC (0xabcddcbb) 112 + 113 + struct brd_info { 114 + __le32 base_addr; 115 + __le32 max_size_bytes; 116 + } __packed; 117 + 112 118 struct wil_fw_record_brd_file { /* type == wil_fw_type_comment */ 113 119 /* identifies brd file record */ 114 120 struct wil_fw_record_comment_hdr hdr; 115 121 __le32 version; 116 - __le32 base_addr; 117 - __le32 max_size_bytes; 122 + struct brd_info brd_info[0]; 118 123 } __packed; 119 124 120 125 /* perform action
+110 -40
drivers/net/wireless/ath/wil6210/fw_inc.c
··· 156 156 size_t size) 157 157 { 158 158 const struct wil_fw_record_brd_file *rec = data; 159 + u32 max_num_ent, i, ent_size; 159 160 160 - if (size < sizeof(*rec)) { 161 - wil_err_fw(wil, "brd_file record too short: %zu\n", size); 162 - return 0; 161 + if (size <= offsetof(struct wil_fw_record_brd_file, brd_info)) { 162 + wil_err(wil, "board record too short, size %zu\n", size); 163 + return -EINVAL; 163 164 } 164 165 165 - wil->brd_file_addr = le32_to_cpu(rec->base_addr); 166 - wil->brd_file_max_size = le32_to_cpu(rec->max_size_bytes); 166 + ent_size = size - offsetof(struct wil_fw_record_brd_file, brd_info); 167 + max_num_ent = ent_size / sizeof(struct brd_info); 167 168 168 - wil_dbg_fw(wil, "brd_file_addr 0x%x, brd_file_max_size %d\n", 169 - wil->brd_file_addr, wil->brd_file_max_size); 169 + if (!max_num_ent) { 170 + wil_err(wil, "brd info entries are missing\n"); 171 + return -EINVAL; 172 + } 173 + 174 + wil->brd_info = kcalloc(max_num_ent, sizeof(struct wil_brd_info), 175 + GFP_KERNEL); 176 + if (!wil->brd_info) 177 + return -ENOMEM; 178 + 179 + for (i = 0; i < max_num_ent; i++) { 180 + wil->brd_info[i].file_addr = 181 + le32_to_cpu(rec->brd_info[i].base_addr); 182 + wil->brd_info[i].file_max_size = 183 + le32_to_cpu(rec->brd_info[i].max_size_bytes); 184 + 185 + if (!wil->brd_info[i].file_addr) 186 + break; 187 + 188 + wil_dbg_fw(wil, 189 + "brd info %d: file_addr 0x%x, file_max_size %d\n", 190 + i, wil->brd_info[i].file_addr, 191 + wil->brd_info[i].file_max_size); 192 + } 193 + 194 + wil->num_of_brd_entries = i; 195 + if (wil->num_of_brd_entries == 0) { 196 + kfree(wil->brd_info); 197 + wil->brd_info = NULL; 198 + wil_dbg_fw(wil, 199 + "no valid brd info entries, using brd file addr\n"); 200 + 201 + } else { 202 + wil_dbg_fw(wil, "num of brd info entries %d\n", 203 + wil->num_of_brd_entries); 204 + } 170 205 171 206 return 0; 172 207 } ··· 669 634 } 670 635 wil_dbg_fw(wil, "Loading <%s>, %zu bytes\n", name, fw->size); 671 636 637 + /* re-initialize board info params */ 638 + wil->num_of_brd_entries = 0; 639 + kfree(wil->brd_info); 640 + wil->brd_info = NULL; 641 + 672 642 for (sz = fw->size, d = fw->data; sz; sz -= rc1, d += rc1) { 673 643 rc1 = wil_fw_verify(wil, d, sz); 674 644 if (rc1 < 0) { ··· 702 662 { 703 663 int rc = 0; 704 664 const struct wil_fw_record_head *hdr = data; 705 - size_t s, hdr_sz; 665 + size_t s, hdr_sz = 0; 706 666 u16 type; 667 + int i = 0; 707 668 708 - /* Assuming the board file includes only one header record and one data 709 - * record. Each record starts with wil_fw_record_head. 669 + /* Assuming the board file includes only one file header 670 + * and one or several data records. 671 + * Each record starts with wil_fw_record_head. 710 672 */ 711 673 if (size < sizeof(*hdr)) 712 674 return -EINVAL; ··· 716 674 if (s > size) 717 675 return -EINVAL; 718 676 719 - /* Skip the header record and handle the data record */ 720 - hdr = (const void *)hdr + s; 677 + /* Skip the header record and handle the data records */ 721 678 size -= s; 722 - if (size < sizeof(*hdr)) 723 - return -EINVAL; 724 - hdr_sz = le32_to_cpu(hdr->size); 725 679 726 - if (wil->brd_file_max_size && hdr_sz > wil->brd_file_max_size) 727 - return -EINVAL; 728 - if (sizeof(*hdr) + hdr_sz > size) 729 - return -EINVAL; 730 - if (hdr_sz % 4) { 731 - wil_err_fw(wil, "unaligned record size: %zu\n", 732 - hdr_sz); 680 + for (hdr = data + s;; hdr = (const void *)hdr + s, size -= s, i++) { 681 + if (size < sizeof(*hdr)) 682 + break; 683 + 684 + if (i >= wil->num_of_brd_entries) { 685 + wil_err_fw(wil, 686 + "Too many brd records: %d, num of expected entries %d\n", 687 + i, wil->num_of_brd_entries); 688 + break; 689 + } 690 + 691 + hdr_sz = le32_to_cpu(hdr->size); 692 + s = sizeof(*hdr) + hdr_sz; 693 + if (wil->brd_info[i].file_max_size && 694 + hdr_sz > wil->brd_info[i].file_max_size) 695 + return -EINVAL; 696 + if (sizeof(*hdr) + hdr_sz > size) 697 + return -EINVAL; 698 + if (hdr_sz % 4) { 699 + wil_err_fw(wil, "unaligned record size: %zu\n", 700 + hdr_sz); 701 + return -EINVAL; 702 + } 703 + type = le16_to_cpu(hdr->type); 704 + if (type != wil_fw_type_data) { 705 + wil_err_fw(wil, 706 + "invalid record type for board file: %d\n", 707 + type); 708 + return -EINVAL; 709 + } 710 + if (hdr_sz < sizeof(struct wil_fw_record_data)) { 711 + wil_err_fw(wil, "data record too short: %zu\n", hdr_sz); 712 + return -EINVAL; 713 + } 714 + 715 + wil_dbg_fw(wil, 716 + "using info from fw file for record %d: addr[0x%08x], max size %d\n", 717 + i, wil->brd_info[i].file_addr, 718 + wil->brd_info[i].file_max_size); 719 + 720 + rc = __fw_handle_data(wil, &hdr[1], hdr_sz, 721 + cpu_to_le32(wil->brd_info[i].file_addr)); 722 + if (rc) 723 + return rc; 724 + } 725 + 726 + if (size) { 727 + wil_err_fw(wil, "unprocessed bytes: %zu\n", size); 728 + if (size >= sizeof(*hdr)) { 729 + wil_err_fw(wil, 730 + "Stop at offset %ld record type %d [%zd bytes]\n", 731 + (long)((const void *)hdr - data), 732 + le16_to_cpu(hdr->type), hdr_sz); 733 + } 733 734 return -EINVAL; 734 735 } 735 - type = le16_to_cpu(hdr->type); 736 - if (type != wil_fw_type_data) { 737 - wil_err_fw(wil, "invalid record type for board file: %d\n", 738 - type); 739 - return -EINVAL; 740 - } 741 - if (hdr_sz < sizeof(struct wil_fw_record_data)) { 742 - wil_err_fw(wil, "data record too short: %zu\n", hdr_sz); 743 - return -EINVAL; 744 - } 745 736 746 - wil_dbg_fw(wil, "using addr from fw file: [0x%08x]\n", 747 - wil->brd_file_addr); 748 - 749 - rc = __fw_handle_data(wil, &hdr[1], hdr_sz, 750 - cpu_to_le32(wil->brd_file_addr)); 751 - 752 - return rc; 737 + return 0; 753 738 } 754 739 755 740 /** ··· 807 738 rc = dlen; 808 739 goto out; 809 740 } 810 - /* Process the data record */ 741 + 742 + /* Process the data records */ 811 743 rc = wil_brd_process(wil, brd->data, dlen); 812 744 813 745 out:
+41 -26
drivers/net/wireless/ath/wil6210/interrupt.c
··· 296 296 static irqreturn_t wil6210_irq_rx(int irq, void *cookie) 297 297 { 298 298 struct wil6210_priv *wil = cookie; 299 - u32 isr = wil_ioread32_and_clear(wil->csr + 300 - HOSTADDR(RGF_DMA_EP_RX_ICR) + 301 - offsetof(struct RGF_ICR, ICR)); 299 + u32 isr; 302 300 bool need_unmask = true; 301 + 302 + wil6210_mask_irq_rx(wil); 303 + 304 + isr = wil_ioread32_and_clear(wil->csr + 305 + HOSTADDR(RGF_DMA_EP_RX_ICR) + 306 + offsetof(struct RGF_ICR, ICR)); 303 307 304 308 trace_wil6210_irq_rx(isr); 305 309 wil_dbg_irq(wil, "ISR RX 0x%08x\n", isr); 306 310 307 311 if (unlikely(!isr)) { 308 312 wil_err_ratelimited(wil, "spurious IRQ: RX\n"); 313 + wil6210_unmask_irq_rx(wil); 309 314 return IRQ_NONE; 310 315 } 311 - 312 - wil6210_mask_irq_rx(wil); 313 316 314 317 /* RX_DONE and RX_HTRSH interrupts are the same if interrupt 315 318 * moderation is not used. Interrupt moderation may cause RX ··· 358 355 static irqreturn_t wil6210_irq_rx_edma(int irq, void *cookie) 359 356 { 360 357 struct wil6210_priv *wil = cookie; 361 - u32 isr = wil_ioread32_and_clear(wil->csr + 362 - HOSTADDR(RGF_INT_GEN_RX_ICR) + 363 - offsetof(struct RGF_ICR, ICR)); 358 + u32 isr; 364 359 bool need_unmask = true; 360 + 361 + wil6210_mask_irq_rx_edma(wil); 362 + 363 + isr = wil_ioread32_and_clear(wil->csr + 364 + HOSTADDR(RGF_INT_GEN_RX_ICR) + 365 + offsetof(struct RGF_ICR, ICR)); 365 366 366 367 trace_wil6210_irq_rx(isr); 367 368 wil_dbg_irq(wil, "ISR RX 0x%08x\n", isr); 368 369 369 370 if (unlikely(!isr)) { 370 371 wil_err(wil, "spurious IRQ: RX\n"); 372 + wil6210_unmask_irq_rx_edma(wil); 371 373 return IRQ_NONE; 372 374 } 373 - 374 - wil6210_mask_irq_rx_edma(wil); 375 375 376 376 if (likely(isr & BIT_RX_STATUS_IRQ)) { 377 377 wil_dbg_irq(wil, "RX status ring\n"); ··· 409 403 static irqreturn_t wil6210_irq_tx_edma(int irq, void *cookie) 410 404 { 411 405 struct wil6210_priv *wil = cookie; 412 - u32 isr = wil_ioread32_and_clear(wil->csr + 413 - HOSTADDR(RGF_INT_GEN_TX_ICR) + 414 - offsetof(struct RGF_ICR, ICR)); 406 + u32 isr; 415 407 bool need_unmask = true; 408 + 409 + wil6210_mask_irq_tx_edma(wil); 410 + 411 + isr = wil_ioread32_and_clear(wil->csr + 412 + HOSTADDR(RGF_INT_GEN_TX_ICR) + 413 + offsetof(struct RGF_ICR, ICR)); 416 414 417 415 trace_wil6210_irq_tx(isr); 418 416 wil_dbg_irq(wil, "ISR TX 0x%08x\n", isr); 419 417 420 418 if (unlikely(!isr)) { 421 419 wil_err(wil, "spurious IRQ: TX\n"); 420 + wil6210_unmask_irq_tx_edma(wil); 422 421 return IRQ_NONE; 423 422 } 424 - 425 - wil6210_mask_irq_tx_edma(wil); 426 423 427 424 if (likely(isr & BIT_TX_STATUS_IRQ)) { 428 425 wil_dbg_irq(wil, "TX status ring\n"); ··· 455 446 static irqreturn_t wil6210_irq_tx(int irq, void *cookie) 456 447 { 457 448 struct wil6210_priv *wil = cookie; 458 - u32 isr = wil_ioread32_and_clear(wil->csr + 459 - HOSTADDR(RGF_DMA_EP_TX_ICR) + 460 - offsetof(struct RGF_ICR, ICR)); 449 + u32 isr; 461 450 bool need_unmask = true; 451 + 452 + wil6210_mask_irq_tx(wil); 453 + 454 + isr = wil_ioread32_and_clear(wil->csr + 455 + HOSTADDR(RGF_DMA_EP_TX_ICR) + 456 + offsetof(struct RGF_ICR, ICR)); 462 457 463 458 trace_wil6210_irq_tx(isr); 464 459 wil_dbg_irq(wil, "ISR TX 0x%08x\n", isr); 465 460 466 461 if (unlikely(!isr)) { 467 462 wil_err_ratelimited(wil, "spurious IRQ: TX\n"); 463 + wil6210_unmask_irq_tx(wil); 468 464 return IRQ_NONE; 469 465 } 470 - 471 - wil6210_mask_irq_tx(wil); 472 466 473 467 if (likely(isr & BIT_DMA_EP_TX_ICR_TX_DONE)) { 474 468 wil_dbg_irq(wil, "TX done\n"); ··· 544 532 static irqreturn_t wil6210_irq_misc(int irq, void *cookie) 545 533 { 546 534 struct wil6210_priv *wil = cookie; 547 - u32 isr = wil_ioread32_and_clear(wil->csr + 548 - HOSTADDR(RGF_DMA_EP_MISC_ICR) + 549 - offsetof(struct RGF_ICR, ICR)); 535 + u32 isr; 536 + 537 + wil6210_mask_irq_misc(wil, false); 538 + 539 + isr = wil_ioread32_and_clear(wil->csr + 540 + HOSTADDR(RGF_DMA_EP_MISC_ICR) + 541 + offsetof(struct RGF_ICR, ICR)); 550 542 551 543 trace_wil6210_irq_misc(isr); 552 544 wil_dbg_irq(wil, "ISR MISC 0x%08x\n", isr); 553 545 554 546 if (!isr) { 555 547 wil_err(wil, "spurious IRQ: MISC\n"); 548 + wil6210_unmask_irq_misc(wil, false); 556 549 return IRQ_NONE; 557 550 } 558 - 559 - wil6210_mask_irq_misc(wil, false); 560 551 561 552 if (isr & ISR_MISC_FW_ERROR) { 562 553 u32 fw_assert_code = wil_r(wil, wil->rgf_fw_assert_code_addr); ··· 595 580 /* no need to handle HALP ICRs until next vote */ 596 581 wil->halp.handle_icr = false; 597 582 wil_dbg_irq(wil, "irq_misc: HALP IRQ invoked\n"); 598 - wil6210_mask_halp(wil); 583 + wil6210_mask_irq_misc(wil, true); 599 584 complete(&wil->halp.comp); 600 585 } 601 586 }
+13 -5
drivers/net/wireless/ath/wil6210/main.c
··· 241 241 { 242 242 int i; 243 243 244 - for (i = 0; i < max_assoc_sta; i++) { 244 + for (i = 0; i < wil->max_assoc_sta; i++) { 245 245 if (wil->sta[i].mid == mid && 246 246 wil->sta[i].status == wil_sta_connected) 247 247 return true; ··· 344 344 wil_disconnect_cid_complete(vif, cid, reason_code); 345 345 } else { /* all */ 346 346 wil_dbg_misc(wil, "Disconnect complete all\n"); 347 - for (cid = 0; cid < max_assoc_sta; cid++) 347 + for (cid = 0; cid < wil->max_assoc_sta; cid++) 348 348 wil_disconnect_cid_complete(vif, cid, reason_code); 349 349 } 350 350 ··· 456 456 wil_disconnect_cid(vif, cid, reason_code); 457 457 } else { /* all */ 458 458 wil_dbg_misc(wil, "Disconnect all\n"); 459 - for (cid = 0; cid < max_assoc_sta; cid++) 459 + for (cid = 0; cid < wil->max_assoc_sta; cid++) 460 460 wil_disconnect_cid(vif, cid, reason_code); 461 461 } 462 462 ··· 753 753 754 754 wil->reply_mid = U8_MAX; 755 755 wil->max_vifs = 1; 756 + wil->max_assoc_sta = max_assoc_sta; 756 757 757 758 /* edma configuration can be updated via debugfs before allocation */ 758 759 wil->num_rx_status_rings = WIL_DEFAULT_NUM_RX_STATUS_RINGS; ··· 839 838 wmi_event_flush(wil); 840 839 destroy_workqueue(wil->wq_service); 841 840 destroy_workqueue(wil->wmi_wq); 841 + kfree(wil->brd_info); 842 842 } 843 843 844 844 static void wil_shutdown_bl(struct wil6210_priv *wil) ··· 1711 1709 rc = wil_request_firmware(wil, wil->wil_fw_name, true); 1712 1710 if (rc) 1713 1711 goto out; 1714 - if (wil->brd_file_addr) 1712 + if (wil->num_of_brd_entries) 1715 1713 rc = wil_request_board(wil, board_file); 1716 1714 else 1717 1715 rc = wil_request_firmware(wil, board_file, true); ··· 1923 1921 int i; 1924 1922 int rc = -ENOENT; 1925 1923 1926 - for (i = 0; i < max_assoc_sta; i++) { 1924 + for (i = 0; i < wil->max_assoc_sta; i++) { 1927 1925 if (wil->sta[i].mid == mid && 1928 1926 wil->sta[i].status != wil_sta_unused && 1929 1927 ether_addr_equal(wil->sta[i].addr, mac)) { ··· 1939 1937 { 1940 1938 unsigned long rc; 1941 1939 unsigned long to_jiffies = msecs_to_jiffies(WAIT_FOR_HALP_VOTE_MS); 1940 + 1941 + if (wil->hw_version >= HW_VER_TALYN_MB) 1942 + return; 1942 1943 1943 1944 mutex_lock(&wil->halp.lock); 1944 1945 ··· 1974 1969 1975 1970 void wil_halp_unvote(struct wil6210_priv *wil) 1976 1971 { 1972 + if (wil->hw_version >= HW_VER_TALYN_MB) 1973 + return; 1974 + 1977 1975 WARN_ON(wil->halp.ref_cnt == 0); 1978 1976 1979 1977 mutex_lock(&wil->halp.lock);
+2
drivers/net/wireless/ath/wil6210/pcie_bus.c
··· 142 142 min(sizeof(wil->platform_capa), sizeof(platform_capa))); 143 143 } 144 144 145 + wil_info(wil, "platform_capa 0x%lx\n", *wil->platform_capa); 146 + 145 147 /* extract FW capabilities from file without loading the FW */ 146 148 wil_request_firmware(wil, wil->wil_fw_name, false); 147 149 wil_refresh_fw_capabilities(wil);
+1 -1
drivers/net/wireless/ath/wil6210/rx_reorder.c
··· 336 336 might_sleep(); 337 337 338 338 /* sanity checks */ 339 - if (cid >= max_assoc_sta) { 339 + if (cid >= wil->max_assoc_sta) { 340 340 wil_err(wil, "BACK: invalid CID %d\n", cid); 341 341 rc = -EINVAL; 342 342 goto out;
+15 -11
drivers/net/wireless/ath/wil6210/txrx.c
··· 411 411 ta = hdr->addr2; 412 412 } 413 413 414 - if (max_assoc_sta <= WIL6210_RX_DESC_MAX_CID) 414 + if (wil->max_assoc_sta <= WIL6210_RX_DESC_MAX_CID) 415 415 return cid; 416 416 417 417 /* assuming no concurrency between AP interfaces and STA interfaces. ··· 426 426 * to find the real cid, compare transmitter address with the stored 427 427 * stations mac address in the driver sta array 428 428 */ 429 - for (i = cid; i < max_assoc_sta; i += WIL6210_RX_DESC_MAX_CID) { 429 + for (i = cid; i < wil->max_assoc_sta; i += WIL6210_RX_DESC_MAX_CID) { 430 430 if (wil->sta[i].status != wil_sta_unused && 431 431 ether_addr_equal(wil->sta[i].addr, ta)) { 432 432 cid = i; 433 433 break; 434 434 } 435 435 } 436 - if (i >= max_assoc_sta) { 436 + if (i >= wil->max_assoc_sta) { 437 437 wil_err_ratelimited(wil, "Could not find cid for frame with transmit addr = %pM, iftype = %d, frametype = %d, len = %d\n", 438 438 ta, vif->wdev.iftype, ftype, skb->len); 439 439 cid = -ENOENT; ··· 750 750 [GRO_HELD] = "GRO_HELD", 751 751 [GRO_NORMAL] = "GRO_NORMAL", 752 752 [GRO_DROP] = "GRO_DROP", 753 + [GRO_CONSUMED] = "GRO_CONSUMED", 753 754 }; 754 755 755 756 wil->txrx_ops.get_netif_rx_params(skb, &cid, &security); ··· 1064 1063 txdata->enabled = 0; 1065 1064 spin_unlock_bh(&txdata->lock); 1066 1065 wil_vring_free(wil, vring); 1067 - wil->ring2cid_tid[id][0] = max_assoc_sta; 1066 + wil->ring2cid_tid[id][0] = wil->max_assoc_sta; 1068 1067 wil->ring2cid_tid[id][1] = 0; 1069 1068 1070 1069 out: ··· 1149 1148 txdata->dot1x_open = false; 1150 1149 txdata->enabled = 0; 1151 1150 spin_unlock_bh(&txdata->lock); 1152 - wil->ring2cid_tid[ring_id][0] = max_assoc_sta; 1151 + wil->ring2cid_tid[ring_id][0] = wil->max_assoc_sta; 1153 1152 wil->ring2cid_tid[ring_id][1] = 0; 1154 1153 return rc; 1155 1154 } ··· 1196 1195 if (rc) 1197 1196 goto out; 1198 1197 1199 - wil->ring2cid_tid[id][0] = max_assoc_sta; /* CID */ 1198 + wil->ring2cid_tid[id][0] = wil->max_assoc_sta; /* CID */ 1200 1199 wil->ring2cid_tid[id][1] = 0; /* TID */ 1201 1200 1202 1201 cmd.vring_cfg.tx_sw_ring.ring_mem_base = cpu_to_le64(vring->pa); ··· 1244 1243 1245 1244 cid = wil_find_cid(wil, vif->mid, da); 1246 1245 1247 - if (cid < 0 || cid >= max_assoc_sta) 1246 + if (cid < 0 || cid >= wil->max_assoc_sta) 1248 1247 return NULL; 1249 1248 1250 1249 /* TODO: fix for multiple TID */ ··· 1296 1295 continue; 1297 1296 1298 1297 cid = wil->ring2cid_tid[i][0]; 1299 - if (cid >= max_assoc_sta) /* skip BCAST */ 1298 + if (cid >= wil->max_assoc_sta) /* skip BCAST */ 1300 1299 continue; 1301 1300 1302 1301 if (!wil->ring_tx_data[i].dot1x_open && ··· 1374 1373 continue; 1375 1374 1376 1375 cid = wil->ring2cid_tid[i][0]; 1377 - if (cid >= max_assoc_sta) /* skip BCAST */ 1376 + if (cid >= wil->max_assoc_sta) /* skip BCAST */ 1378 1377 continue; 1379 1378 if (!wil->ring_tx_data[i].dot1x_open && 1380 1379 skb->protocol != cpu_to_be16(ETH_P_PAE)) ··· 1402 1401 if (!v2->va || txdata2->mid != vif->mid) 1403 1402 continue; 1404 1403 cid = wil->ring2cid_tid[i][0]; 1405 - if (cid >= max_assoc_sta) /* skip BCAST */ 1404 + if (cid >= wil->max_assoc_sta) /* skip BCAST */ 1406 1405 continue; 1407 1406 if (!wil->ring_tx_data[i].dot1x_open && 1408 1407 skb->protocol != cpu_to_be16(ETH_P_PAE)) ··· 1760 1759 *_desc = *d; 1761 1760 } 1762 1761 } 1762 + 1763 + if (!_desc) 1764 + goto mem_error; 1763 1765 1764 1766 /* first descriptor may also be the last. 1765 1767 * in this case d pointer is invalid ··· 2258 2254 2259 2255 used_before_complete = wil_ring_used_tx(vring); 2260 2256 2261 - if (cid < max_assoc_sta) 2257 + if (cid < wil->max_assoc_sta) 2262 2258 stats = &wil->sta[cid].stats; 2263 2259 2264 2260 while (!wil_ring_is_empty(vring)) {
+7 -3
drivers/net/wireless/ath/wil6210/txrx_edma.c
··· 269 269 struct list_head *active = &wil->rx_buff_mgmt.active; 270 270 dma_addr_t pa; 271 271 272 + if (!wil->rx_buff_mgmt.buff_arr) 273 + return; 274 + 272 275 while (!list_empty(active)) { 273 276 struct wil_rx_buff *rx_buff = 274 277 list_first_entry(active, struct wil_rx_buff, list); ··· 737 734 txdata->enabled = 0; 738 735 spin_unlock_bh(&txdata->lock); 739 736 wil_ring_free_edma(wil, ring); 740 - wil->ring2cid_tid[ring_id][0] = max_assoc_sta; 737 + wil->ring2cid_tid[ring_id][0] = wil->max_assoc_sta; 741 738 wil->ring2cid_tid[ring_id][1] = 0; 742 739 743 740 out: ··· 947 944 eop = wil_rx_status_get_eop(msg); 948 945 949 946 cid = wil_rx_status_get_cid(msg); 950 - if (unlikely(!wil_val_in_range(cid, 0, max_assoc_sta))) { 947 + if (unlikely(!wil_val_in_range(cid, 0, wil->max_assoc_sta))) { 951 948 wil_err(wil, "Corrupt cid=%d, sring->swhead=%d\n", 952 949 cid, sring->swhead); 953 950 rxdata->skipping = true; ··· 1202 1199 ndev = vif_to_ndev(vif); 1203 1200 1204 1201 cid = wil->ring2cid_tid[ring_id][0]; 1205 - stats = (cid < max_assoc_sta ? &wil->sta[cid].stats : NULL); 1202 + stats = (cid < wil->max_assoc_sta) ? &wil->sta[cid].stats : 1203 + NULL; 1206 1204 1207 1205 wil_dbg_txrx(wil, 1208 1206 "tx_status: completed desc_ring (%d), num_descs (%d)\n",
+22 -11
drivers/net/wireless/ath/wil6210/wil6210.h
··· 335 335 #define BIT_BOOT_FROM_ROM BIT(31) 336 336 337 337 /* eDMA */ 338 + #define RGF_SCM_PTRS_SUBQ_RD_PTR (0x8b4000) 339 + #define RGF_SCM_PTRS_COMPQ_RD_PTR (0x8b4100) 340 + #define RGF_DMA_SCM_SUBQ_CONS (0x8b60ec) 341 + #define RGF_DMA_SCM_COMPQ_PROD (0x8b616c) 342 + 338 343 #define RGF_INT_COUNT_ON_SPECIAL_EVT (0x8b62d8) 339 344 340 345 #define RGF_INT_CTRL_INT_GEN_CFG_0 (0x8bc000) ··· 459 454 { 460 455 *cid = cidxtid & 0xf; 461 456 *tid = (cidxtid >> 4) & 0xf; 462 - } 463 - 464 - /** 465 - * wil_cid_valid - check cid is valid 466 - * @cid: CID value 467 - */ 468 - static inline bool wil_cid_valid(u8 cid) 469 - { 470 - return (cid >= 0 && cid < max_assoc_sta); 471 457 } 472 458 473 459 struct wil6210_mbox_ring { ··· 909 913 struct wmi_link_stats_global stats; 910 914 }; 911 915 916 + struct wil_brd_info { 917 + u32 file_addr; 918 + u32 file_max_size; 919 + }; 920 + 912 921 struct wil6210_priv { 913 922 struct pci_dev *pdev; 914 923 u32 bar_size; ··· 928 927 const char *hw_name; 929 928 const char *wil_fw_name; 930 929 char *board_file; 931 - u32 brd_file_addr; 932 - u32 brd_file_max_size; 930 + u32 num_of_brd_entries; 931 + struct wil_brd_info *brd_info; 933 932 DECLARE_BITMAP(hw_capa, hw_capa_last); 934 933 DECLARE_BITMAP(fw_capabilities, WMI_FW_CAPABILITY_MAX); 935 934 DECLARE_BITMAP(platform_capa, WIL_PLATFORM_CAPA_MAX); ··· 941 940 struct wil6210_vif *vifs[WIL_MAX_VIFS]; 942 941 struct mutex vif_mutex; /* protects access to VIF entries */ 943 942 atomic_t connected_vifs; 943 + u32 max_assoc_sta; /* max sta's supported by the driver and the FW */ 944 + 944 945 /* profile */ 945 946 struct cfg80211_chan_def monitor_chandef; 946 947 u32 monitor_flags; ··· 1138 1135 static inline void wil_c(struct wil6210_priv *wil, u32 reg, u32 val) 1139 1136 { 1140 1137 wil_w(wil, reg, wil_r(wil, reg) & ~val); 1138 + } 1139 + 1140 + /** 1141 + * wil_cid_valid - check cid is valid 1142 + */ 1143 + static inline bool wil_cid_valid(struct wil6210_priv *wil, u8 cid) 1144 + { 1145 + return (cid >= 0 && cid < wil->max_assoc_sta); 1141 1146 } 1142 1147 1143 1148 void wil_get_board_file(struct wil6210_priv *wil, char *buf, size_t len);
+7 -7
drivers/net/wireless/ath/wil6210/wmi.c
··· 806 806 } 807 807 } 808 808 809 - max_assoc_sta = min_t(uint, max_assoc_sta, fw_max_assoc_sta); 810 - wil_dbg_wmi(wil, "setting max assoc sta to %d\n", max_assoc_sta); 809 + wil->max_assoc_sta = min_t(uint, max_assoc_sta, fw_max_assoc_sta); 810 + wil_dbg_wmi(wil, "setting max assoc sta to %d\n", wil->max_assoc_sta); 811 811 812 812 wil_set_recovery_state(wil, fw_recovery_idle); 813 813 set_bit(wil_status_fwready, wil->status); ··· 974 974 evt->assoc_req_len, evt->assoc_resp_len); 975 975 return; 976 976 } 977 - if (evt->cid >= max_assoc_sta) { 977 + if (evt->cid >= wil->max_assoc_sta) { 978 978 wil_err(wil, "Connect CID invalid : %d\n", evt->cid); 979 979 return; 980 980 } ··· 1236 1236 return; 1237 1237 1238 1238 cid = wil->ring2cid_tid[vri][0]; 1239 - if (!wil_cid_valid(cid)) { 1239 + if (!wil_cid_valid(wil, cid)) { 1240 1240 wil_err(wil, "invalid cid %d for vring %d\n", cid, vri); 1241 1241 return; 1242 1242 } ··· 1439 1439 u8 cid = basic->cid; 1440 1440 struct wil_sta_info *sta; 1441 1441 1442 - if (cid < 0 || cid >= max_assoc_sta) { 1442 + if (cid < 0 || cid >= wil->max_assoc_sta) { 1443 1443 wil_err(wil, "invalid cid %d\n", cid); 1444 1444 return; 1445 1445 } ··· 1589 1589 continue; 1590 1590 1591 1591 lcid = wil->ring2cid_tid[i][0]; 1592 - if (lcid >= max_assoc_sta) /* skip BCAST */ 1592 + if (lcid >= wil->max_assoc_sta) /* skip BCAST */ 1593 1593 continue; 1594 1594 1595 1595 wil_dbg_wmi(wil, "find sta -> ringid %d cid %d\n", i, lcid); ··· 2135 2135 .network_type = wmi_nettype, 2136 2136 .disable_sec_offload = 1, 2137 2137 .channel = chan - 1, 2138 - .pcp_max_assoc_sta = max_assoc_sta, 2138 + .pcp_max_assoc_sta = wil->max_assoc_sta, 2139 2139 .hidden_ssid = hidden_ssid, 2140 2140 .is_go = is_go, 2141 2141 .ap_sme_offload_mode = disable_ap_sme ?
+1 -6
drivers/net/wireless/broadcom/b43/main.c
··· 2590 2590 2591 2591 err = ieee80211_register_hw(wl->hw); 2592 2592 if (err) 2593 - goto err_one_core_detach; 2593 + goto out; 2594 2594 wl->hw_registered = true; 2595 2595 b43_leds_register(wl->current_dev); 2596 2596 2597 2597 /* Register HW RNG driver */ 2598 2598 b43_rng_init(wl); 2599 - 2600 - goto out; 2601 - 2602 - err_one_core_detach: 2603 - b43_one_core_detach(dev->dev); 2604 2599 2605 2600 out: 2606 2601 kfree(ctx);
+2 -50
drivers/net/wireless/broadcom/brcm80211/Kconfig
··· 18 18 be available if you select BCMA_DRIVER_GPIO. If you choose to build a 19 19 module, the driver will be called brcmsmac.ko. 20 20 21 - config BRCMFMAC 22 - tristate "Broadcom FullMAC WLAN driver" 23 - depends on CFG80211 24 - select BRCMUTIL 25 - ---help--- 26 - This module adds support for wireless adapters based on Broadcom 27 - FullMAC chipsets. It has to work with at least one of the bus 28 - interface support. If you choose to build a module, it'll be called 29 - brcmfmac.ko. 30 - 31 - config BRCMFMAC_PROTO_BCDC 32 - bool 33 - 34 - config BRCMFMAC_PROTO_MSGBUF 35 - bool 36 - 37 - config BRCMFMAC_SDIO 38 - bool "SDIO bus interface support for FullMAC driver" 39 - depends on (MMC = y || MMC = BRCMFMAC) 40 - depends on BRCMFMAC 41 - select BRCMFMAC_PROTO_BCDC 42 - select FW_LOADER 43 - default y 44 - ---help--- 45 - This option enables the SDIO bus interface support for Broadcom 46 - IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to 47 - use the driver for a SDIO wireless card. 48 - 49 - config BRCMFMAC_USB 50 - bool "USB bus interface support for FullMAC driver" 51 - depends on (USB = y || USB = BRCMFMAC) 52 - depends on BRCMFMAC 53 - select BRCMFMAC_PROTO_BCDC 54 - select FW_LOADER 55 - ---help--- 56 - This option enables the USB bus interface support for Broadcom 57 - IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to 58 - use the driver for an USB wireless card. 59 - 60 - config BRCMFMAC_PCIE 61 - bool "PCIE bus interface support for FullMAC driver" 62 - depends on BRCMFMAC 63 - depends on PCI 64 - select BRCMFMAC_PROTO_MSGBUF 65 - select FW_LOADER 66 - ---help--- 67 - This option enables the PCIE bus interface support for Broadcom 68 - IEEE802.11ac embedded FullMAC WLAN driver. Say Y if you want to 69 - use the driver for an PCIE wireless card. 21 + source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig" 70 22 71 23 config BRCM_TRACING 72 24 bool "Broadcom device tracing" ··· 34 82 config BRCMDBG 35 83 bool "Broadcom driver debug functions" 36 84 depends on BRCMSMAC || BRCMFMAC 37 - select WANT_DEV_COREDUMP 85 + select WANT_DEV_COREDUMP if BRCMFMAC 38 86 ---help--- 39 87 Selecting this enables additional code for debug purposes.
+2 -12
drivers/net/wireless/broadcom/brcm80211/Makefile
··· 1 + # SPDX-License-Identifier: ISC 1 2 # 2 - # Makefile fragment for Broadcom 802.11n Networking Device Driver 3 + # Makefile fragment for Broadcom 802.11 Networking Device Driver 3 4 # 4 5 # Copyright (c) 2010 Broadcom Corporation 5 6 # 6 - # Permission to use, copy, modify, and/or distribute this software for any 7 - # purpose with or without fee is hereby granted, provided that the above 8 - # copyright notice and this permission notice appear in all copies. 9 - # 10 - # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 - # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 - # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 - # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 - # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 - # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 - # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 7 18 8 # common flags 19 9 subdir-ccflags-$(CONFIG_BRCMDBG) += -DDEBUG
+50
drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig
··· 1 + config BRCMFMAC 2 + tristate "Broadcom FullMAC WLAN driver" 3 + depends on CFG80211 4 + select BRCMUTIL 5 + help 6 + This module adds support for wireless adapters based on Broadcom 7 + FullMAC chipsets. It has to work with at least one of the bus 8 + interface support. If you choose to build a module, it'll be called 9 + brcmfmac.ko. 10 + 11 + config BRCMFMAC_PROTO_BCDC 12 + bool 13 + 14 + config BRCMFMAC_PROTO_MSGBUF 15 + bool 16 + 17 + config BRCMFMAC_SDIO 18 + bool "SDIO bus interface support for FullMAC driver" 19 + depends on (MMC = y || MMC = BRCMFMAC) 20 + depends on BRCMFMAC 21 + select BRCMFMAC_PROTO_BCDC 22 + select FW_LOADER 23 + default y 24 + help 25 + This option enables the SDIO bus interface support for Broadcom 26 + IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to 27 + use the driver for a SDIO wireless card. 28 + 29 + config BRCMFMAC_USB 30 + bool "USB bus interface support for FullMAC driver" 31 + depends on (USB = y || USB = BRCMFMAC) 32 + depends on BRCMFMAC 33 + select BRCMFMAC_PROTO_BCDC 34 + select FW_LOADER 35 + help 36 + This option enables the USB bus interface support for Broadcom 37 + IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to 38 + use the driver for an USB wireless card. 39 + 40 + config BRCMFMAC_PCIE 41 + bool "PCIE bus interface support for FullMAC driver" 42 + depends on BRCMFMAC 43 + depends on PCI 44 + select BRCMFMAC_PROTO_MSGBUF 45 + select FW_LOADER 46 + help 47 + This option enables the PCIE bus interface support for Broadcom 48 + IEEE802.11ac embedded FullMAC WLAN driver. Say Y if you want to 49 + use the driver for an PCIE wireless card. 50 +
+2 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
··· 1 + # SPDX-License-Identifier: ISC 1 2 # 2 - # Makefile fragment for Broadcom 802.11n Networking Device Driver 3 + # Makefile fragment for Broadcom 802.11 Networking Device Driver 3 4 # 4 5 # Copyright (c) 2010 Broadcom Corporation 5 6 # 6 - # Permission to use, copy, modify, and/or distribute this software for any 7 - # purpose with or without fee is hereby granted, provided that the above 8 - # copyright notice and this permission notice appear in all copies. 9 - # 10 - # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 - # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 - # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 - # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 - # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 - # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 - # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 7 18 8 ccflags-y += \ 19 9 -I $(srctree)/$(src) \
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 /*******************************************************************************
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef BRCMFMAC_BCDC_H 17 6 #define BRCMFMAC_BCDC_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 /* ****************** SDIO CARD Interface Functions **************************/ 17 6
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/slab.h> 17 6 #include <linux/netdevice.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef WL_BTCOEX_H_ 17 6 #define WL_BTCOEX_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef BRCMFMAC_BUS_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 /* Toplevel file. Relies on dhd_linux.c to send commands to the dongle. */
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef BRCMFMAC_CFG80211_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/kernel.h> 17 6 #include <linux/delay.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef BRCMF_CHIP_H 17 6 #define BRCMF_CHIP_H
+2 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/kernel.h> ··· 258 269 259 270 /* query for 'ver' to get version info from firmware */ 260 271 memset(buf, 0, sizeof(buf)); 261 - strcpy(buf, "ver"); 272 + strlcpy(buf, "ver", sizeof(buf)); 262 273 err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf)); 263 274 if (err < 0) { 264 275 bphy_err(drvr, "Retrieving version information failed, %d\n",
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 #ifndef BRCMFMAC_COMMON_H 16 6 #define BRCMFMAC_COMMON_H
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/commonring.c
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 16 6 #include <linux/types.h>
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/commonring.h
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 #ifndef BRCMFMAC_COMMONRING_H 16 6 #define BRCMFMAC_COMMONRING_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/kernel.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 /****************
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/debugfs.h> 17 6 #include <linux/netdevice.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef BRCMFMAC_DEBUG_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright 2018 Hans de Goede <hdegoede@redhat.com> 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/dmi.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/netdevice.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef _BRCMF_FEATURE_H 17 6 #define _BRCMF_FEATURE_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/efi.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef BRCMFMAC_FIRMWARE_H 17 6 #define BRCMFMAC_FIRMWARE_H
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 16 6
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.h
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 #ifndef BRCMFMAC_FLOWRING_H 16 6 #define BRCMFMAC_FLOWRING_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/netdevice.h> 17 6
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6
+2 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 /* FWIL is the Firmware Interface Layer. In this module the support functions ··· 303 314 return brcmf_create_iovar(name, data, datalen, buf, buflen); 304 315 305 316 prefixlen = strlen(prefix); 306 - namelen = strlen(name) + 1; /* lengh of iovar name + null */ 317 + namelen = strlen(name) + 1; /* length of iovar name + null */ 307 318 iolen = prefixlen + namelen + sizeof(bsscfgidx_le) + datalen; 308 319 309 320 if (buflen < iolen) {
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _fwil_h_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/types.h> 17 6 #include <linux/module.h>
+1 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 - 17 5 18 6 #ifndef FWSIGNAL_H_ 19 7 #define FWSIGNAL_H_
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 16 6 /*******************************************************************************
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.h
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 #ifndef BRCMFMAC_MSGBUF_H 16 6 #define BRCMFMAC_MSGBUF_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/init.h> 17 6 #include <linux/of.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifdef CONFIG_OF 17 6 void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/slab.h> 17 6 #include <linux/netdevice.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef WL_CFGP2P_H_ 17 6 #define WL_CFGP2P_H_
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 16 6 #include <linux/kernel.h>
+3 -13
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h
··· 1 - /* Copyright (c) 2014 Broadcom Corporation 2 - * 3 - * Permission to use, copy, modify, and/or distribute this software for any 4 - * purpose with or without fee is hereby granted, provided that the above 5 - * copyright notice and this permission notice appear in all copies. 6 - * 7 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Copyright (c) 2014 Broadcom Corporation 14 4 */ 15 5 #ifndef BRCMFMAC_PCIE_H 16 6 #define BRCMFMAC_PCIE_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2016 Broadcom 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/netdevice.h> 17 6 #include <linux/gcd.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2016 Broadcom 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef _BRCMF_PNO_H 17 6 #define _BRCMF_PNO_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef BRCMFMAC_PROTO_H 17 6 #define BRCMFMAC_PROTO_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/types.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef BRCMFMAC_SDIO_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2012 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/device.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #if !defined(BRCMF_TRACEPOINT_H_) || defined(TRACE_HEADER_MULTI_READ) 17 6 #define BRCMF_TRACEPOINT_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2011 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/kernel.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2011 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #ifndef BRCMFMAC_USB_H 17 6 #define BRCMFMAC_USB_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/vmalloc.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2014 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _vendor_h_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 #include <linux/kernel.h> 17 6 #include <linux/delay.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_hal.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 /*
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_int.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_PHY_INT_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/kernel.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_PHY_LCN_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include "phy_qmath.h"
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_QMATH_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_radio.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_PHY_RADIO_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phyreg_n.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #define NPHY_TBL_ID_GAIN1 0
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <types.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <types.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_n.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #include <linux/kernel.h>
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_n.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #define ANT_SWCTRL_TBL_REV3_IDX (0)
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmutil/Makefile
··· 1 + # SPDX-License-Identifier: ISC 1 2 # 2 3 # Makefile fragment for Broadcom 802.11n Networking Device Driver Utilities 3 4 # 4 5 # Copyright (c) 2011 Broadcom Corporation 5 6 # 6 - # Permission to use, copy, modify, and/or distribute this software for any 7 - # purpose with or without fee is hereby granted, provided that the above 8 - # copyright notice and this permission notice appear in all copies. 9 - # 10 - # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 - # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 - # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 - # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 - # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 - # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 - # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 - 18 7 ccflags-y := -I $(srctree)/$(src)/../include 19 8 20 9 obj-$(CONFIG_BRCMUTIL) += brcmutil.o
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2013 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 /*********************channel spec common functions*********************/ 17 6
+1 -12
drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_HW_IDS_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCMU_D11_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCMU_UTILS_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCMU_WIFI_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _SBCHIPC_H
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/defs.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_DEFS_H_
+1 -12
drivers/net/wireless/broadcom/brcm80211/include/soc.h
··· 1 + // SPDX-License-Identifier: ISC 1 2 /* 2 3 * Copyright (c) 2010 Broadcom Corporation 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 4 */ 16 5 17 6 #ifndef _BRCM_SOC_H
+2
drivers/net/wireless/cisco/Kconfig
··· 17 17 depends on CFG80211 && ISA_DMA_API && (PCI || BROKEN) 18 18 select WIRELESS_EXT 19 19 select CRYPTO 20 + select CRYPTO_BLKCIPHER 20 21 select WEXT_SPY 21 22 select WEXT_PRIV 22 23 ---help--- ··· 41 40 select WEXT_PRIV 42 41 select CRYPTO 43 42 select CRYPTO_AES 43 + select CRYPTO_CTR 44 44 ---help--- 45 45 This is the standard Linux driver to support Cisco/Aironet PCMCIA 46 46 802.11 wireless cards. This driver is the same as the Aironet
+26 -29
drivers/net/wireless/cisco/airo.c
··· 49 49 #include <linux/kthread.h> 50 50 #include <linux/freezer.h> 51 51 52 + #include <crypto/aes.h> 53 + #include <crypto/skcipher.h> 54 + 52 55 #include <net/cfg80211.h> 53 56 #include <net/iw_handler.h> 54 57 ··· 954 951 } mic_statistics; 955 952 956 953 typedef struct { 957 - u32 coeff[((EMMH32_MSGLEN_MAX)+3)>>2]; 954 + __be32 coeff[((EMMH32_MSGLEN_MAX)+3)>>2]; 958 955 u64 accum; // accumulated mic, reduced to u32 in final() 959 956 int position; // current position (byte offset) in message 960 957 union { ··· 1219 1216 struct iw_spy_data spy_data; 1220 1217 struct iw_public_data wireless_data; 1221 1218 /* MIC stuff */ 1222 - struct crypto_cipher *tfm; 1219 + struct crypto_sync_skcipher *tfm; 1223 1220 mic_module mod[2]; 1224 1221 mic_statistics micstats; 1225 1222 HostRxDesc rxfids[MPI_MAX_FIDS]; // rx/tx/config MPI350 descriptors ··· 1294 1291 static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq); 1295 1292 static void MoveWindow(miccntx *context, u32 micSeq); 1296 1293 static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, 1297 - struct crypto_cipher *tfm); 1294 + struct crypto_sync_skcipher *tfm); 1298 1295 static void emmh32_init(emmh32_context *context); 1299 1296 static void emmh32_update(emmh32_context *context, u8 *pOctets, int len); 1300 1297 static void emmh32_final(emmh32_context *context, u8 digest[4]); 1301 1298 static int flashpchar(struct airo_info *ai,int byte,int dwelltime); 1302 1299 1303 1300 static void age_mic_context(miccntx *cur, miccntx *old, u8 *key, int key_len, 1304 - struct crypto_cipher *tfm) 1301 + struct crypto_sync_skcipher *tfm) 1305 1302 { 1306 1303 /* If the current MIC context is valid and its key is the same as 1307 1304 * the MIC register, there's nothing to do. ··· 1362 1359 int i; 1363 1360 1364 1361 if (ai->tfm == NULL) 1365 - ai->tfm = crypto_alloc_cipher("aes", 0, 0); 1362 + ai->tfm = crypto_alloc_sync_skcipher("ctr(aes)", 0, 0); 1366 1363 1367 1364 if (IS_ERR(ai->tfm)) { 1368 1365 airo_print_err(ai->dev->name, "failed to load transform for AES"); ··· 1627 1624 1628 1625 /* mic accumulate */ 1629 1626 #define MIC_ACCUM(val) \ 1630 - context->accum += (u64)(val) * context->coeff[coeff_position++]; 1631 - 1632 - static unsigned char aes_counter[16]; 1627 + context->accum += (u64)(val) * be32_to_cpu(context->coeff[coeff_position++]); 1633 1628 1634 1629 /* expand the key to fill the MMH coefficient array */ 1635 1630 static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, 1636 - struct crypto_cipher *tfm) 1631 + struct crypto_sync_skcipher *tfm) 1637 1632 { 1638 1633 /* take the keying material, expand if necessary, truncate at 16-bytes */ 1639 1634 /* run through AES counter mode to generate context->coeff[] */ 1640 1635 1641 - int i,j; 1642 - u32 counter; 1643 - u8 *cipher, plain[16]; 1636 + SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm); 1637 + struct scatterlist sg; 1638 + u8 iv[AES_BLOCK_SIZE] = {}; 1639 + int ret; 1644 1640 1645 - crypto_cipher_setkey(tfm, pkey, 16); 1646 - counter = 0; 1647 - for (i = 0; i < ARRAY_SIZE(context->coeff); ) { 1648 - aes_counter[15] = (u8)(counter >> 0); 1649 - aes_counter[14] = (u8)(counter >> 8); 1650 - aes_counter[13] = (u8)(counter >> 16); 1651 - aes_counter[12] = (u8)(counter >> 24); 1652 - counter++; 1653 - memcpy (plain, aes_counter, 16); 1654 - crypto_cipher_encrypt_one(tfm, plain, plain); 1655 - cipher = plain; 1656 - for (j = 0; (j < 16) && (i < ARRAY_SIZE(context->coeff)); ) { 1657 - context->coeff[i++] = ntohl(*(__be32 *)&cipher[j]); 1658 - j += 4; 1659 - } 1660 - } 1641 + crypto_sync_skcipher_setkey(tfm, pkey, 16); 1642 + 1643 + memset(context->coeff, 0, sizeof(context->coeff)); 1644 + sg_init_one(&sg, context->coeff, sizeof(context->coeff)); 1645 + 1646 + skcipher_request_set_sync_tfm(req, tfm); 1647 + skcipher_request_set_callback(req, 0, NULL, NULL); 1648 + skcipher_request_set_crypt(req, &sg, &sg, sizeof(context->coeff), iv); 1649 + 1650 + ret = crypto_skcipher_encrypt(req); 1651 + WARN_ON_ONCE(ret); 1661 1652 } 1662 1653 1663 1654 /* prepare for calculation of a new mic */ ··· 2412 2415 ai->shared, ai->shared_dma); 2413 2416 } 2414 2417 } 2415 - crypto_free_cipher(ai->tfm); 2418 + crypto_free_sync_skcipher(ai->tfm); 2416 2419 del_airo_dev(ai); 2417 2420 free_netdev( dev ); 2418 2421 }
+2 -12
drivers/net/wireless/intel/iwlegacy/3945-rs.c
··· 843 843 { 844 844 struct il3945_rs_sta *lq_sta = il_sta; 845 845 846 - lq_sta->rs_sta_dbgfs_stats_table_file = 847 - debugfs_create_file("rate_stats_table", 0600, dir, lq_sta, 848 - &rs_sta_dbgfs_stats_table_ops); 849 - 850 - } 851 - 852 - static void 853 - il3945_remove_debugfs(void *il, void *il_sta) 854 - { 855 - struct il3945_rs_sta *lq_sta = il_sta; 856 - debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); 846 + debugfs_create_file("rate_stats_table", 0600, dir, lq_sta, 847 + &rs_sta_dbgfs_stats_table_ops); 857 848 } 858 849 #endif 859 850 ··· 871 880 .free_sta = il3945_rs_free_sta, 872 881 #ifdef CONFIG_MAC80211_DEBUGFS 873 882 .add_sta_debugfs = il3945_add_debugfs, 874 - .remove_sta_debugfs = il3945_remove_debugfs, 875 883 #endif 876 884 877 885 };
-3
drivers/net/wireless/intel/iwlegacy/3945.h
··· 72 72 u8 start_rate; 73 73 struct timer_list rate_scale_flush; 74 74 struct il3945_rate_scale_data win[RATE_COUNT_3945]; 75 - #ifdef CONFIG_MAC80211_DEBUGFS 76 - struct dentry *rs_sta_dbgfs_stats_table_file; 77 - #endif 78 75 79 76 /* used to be in sta_info */ 80 77 int last_txrate_idx;
+8 -23
drivers/net/wireless/intel/iwlegacy/4965-rs.c
··· 2748 2748 il4965_rs_add_debugfs(void *il, void *il_sta, struct dentry *dir) 2749 2749 { 2750 2750 struct il_lq_sta *lq_sta = il_sta; 2751 - lq_sta->rs_sta_dbgfs_scale_table_file = 2752 - debugfs_create_file("rate_scale_table", 0600, dir, 2753 - lq_sta, &rs_sta_dbgfs_scale_table_ops); 2754 - lq_sta->rs_sta_dbgfs_stats_table_file = 2755 - debugfs_create_file("rate_stats_table", 0400, dir, lq_sta, 2756 - &rs_sta_dbgfs_stats_table_ops); 2757 - lq_sta->rs_sta_dbgfs_rate_scale_data_file = 2758 - debugfs_create_file("rate_scale_data", 0400, dir, lq_sta, 2759 - &rs_sta_dbgfs_rate_scale_data_ops); 2760 - lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file = 2761 - debugfs_create_u8("tx_agg_tid_enable", 0600, dir, 2762 - &lq_sta->tx_agg_tid_en); 2763 2751 2764 - } 2765 - 2766 - static void 2767 - il4965_rs_remove_debugfs(void *il, void *il_sta) 2768 - { 2769 - struct il_lq_sta *lq_sta = il_sta; 2770 - debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file); 2771 - debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); 2772 - debugfs_remove(lq_sta->rs_sta_dbgfs_rate_scale_data_file); 2773 - debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file); 2752 + debugfs_create_file("rate_scale_table", 0600, dir, lq_sta, 2753 + &rs_sta_dbgfs_scale_table_ops); 2754 + debugfs_create_file("rate_stats_table", 0400, dir, lq_sta, 2755 + &rs_sta_dbgfs_stats_table_ops); 2756 + debugfs_create_file("rate_scale_data", 0400, dir, lq_sta, 2757 + &rs_sta_dbgfs_rate_scale_data_ops); 2758 + debugfs_create_u8("tx_agg_tid_enable", 0600, dir, 2759 + &lq_sta->tx_agg_tid_en); 2774 2760 } 2775 2761 #endif 2776 2762 ··· 2783 2797 .free_sta = il4965_rs_free_sta, 2784 2798 #ifdef CONFIG_MAC80211_DEBUGFS 2785 2799 .add_sta_debugfs = il4965_rs_add_debugfs, 2786 - .remove_sta_debugfs = il4965_rs_remove_debugfs, 2787 2800 #endif 2788 2801 }; 2789 2802
-4
drivers/net/wireless/intel/iwlegacy/common.h
··· 2807 2807 struct il_traffic_load load[TID_MAX_LOAD_COUNT]; 2808 2808 u8 tx_agg_tid_en; 2809 2809 #ifdef CONFIG_MAC80211_DEBUGFS 2810 - struct dentry *rs_sta_dbgfs_scale_table_file; 2811 - struct dentry *rs_sta_dbgfs_stats_table_file; 2812 - struct dentry *rs_sta_dbgfs_rate_scale_data_file; 2813 - struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file; 2814 2810 u32 dbg_fixed_rate; 2815 2811 #endif 2816 2812 struct il_priv *drv;
+3 -6
drivers/net/wireless/intersil/p54/main.c
··· 411 411 int ret; 412 412 413 413 mutex_lock(&priv->conf_mutex); 414 - if (queue < dev->queues) { 415 - P54_SET_QUEUE(priv->qos_params[queue], params->aifs, 416 - params->cw_min, params->cw_max, params->txop); 417 - ret = p54_set_edcf(priv); 418 - } else 419 - ret = -EINVAL; 414 + P54_SET_QUEUE(priv->qos_params[queue], params->aifs, 415 + params->cw_min, params->cw_max, params->txop); 416 + ret = p54_set_edcf(priv); 420 417 mutex_unlock(&priv->conf_mutex); 421 418 return ret; 422 419 }
+18 -25
drivers/net/wireless/intersil/p54/p54usb.c
··· 30 30 MODULE_FIRMWARE("isl3886usb"); 31 31 MODULE_FIRMWARE("isl3887usb"); 32 32 33 + static struct usb_driver p54u_driver; 34 + 33 35 /* 34 36 * Note: 35 37 * ··· 920 918 { 921 919 struct p54u_priv *priv = context; 922 920 struct usb_device *udev = priv->udev; 921 + struct usb_interface *intf = priv->intf; 923 922 int err; 924 923 925 - complete(&priv->fw_wait_load); 926 924 if (firmware) { 927 925 priv->fw = firmware; 928 926 err = p54u_start_ops(priv); ··· 931 929 dev_err(&udev->dev, "Firmware not found.\n"); 932 930 } 933 931 932 + complete(&priv->fw_wait_load); 933 + /* 934 + * At this point p54u_disconnect may have already freed 935 + * the "priv" context. Do not use it anymore! 936 + */ 937 + priv = NULL; 938 + 934 939 if (err) { 935 - struct device *parent = priv->udev->dev.parent; 940 + dev_err(&intf->dev, "failed to initialize device (%d)\n", err); 936 941 937 - dev_err(&udev->dev, "failed to initialize device (%d)\n", err); 938 - 939 - if (parent) 940 - device_lock(parent); 941 - 942 - device_release_driver(&udev->dev); 943 - /* 944 - * At this point p54u_disconnect has already freed 945 - * the "priv" context. Do not use it anymore! 946 - */ 947 - priv = NULL; 948 - 949 - if (parent) 950 - device_unlock(parent); 942 + usb_lock_device(udev); 943 + usb_driver_release_interface(&p54u_driver, intf); 944 + usb_unlock_device(udev); 951 945 } 952 946 953 - usb_put_dev(udev); 947 + usb_put_intf(intf); 954 948 } 955 949 956 950 static int p54u_load_firmware(struct ieee80211_hw *dev, ··· 967 969 dev_info(&priv->udev->dev, "Loading firmware file %s\n", 968 970 p54u_fwlist[i].fw); 969 971 970 - usb_get_dev(udev); 972 + usb_get_intf(intf); 971 973 err = request_firmware_nowait(THIS_MODULE, 1, p54u_fwlist[i].fw, 972 974 device, GFP_KERNEL, priv, 973 975 p54u_load_firmware_cb); 974 976 if (err) { 975 977 dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " 976 978 "(%d)!\n", p54u_fwlist[i].fw, err); 977 - usb_put_dev(udev); 979 + usb_put_intf(intf); 978 980 } 979 981 980 982 return err; ··· 1005 1007 priv->intf = intf; 1006 1008 skb_queue_head_init(&priv->rx_queue); 1007 1009 init_usb_anchor(&priv->submitted); 1008 - 1009 - usb_get_dev(udev); 1010 1010 1011 1011 /* really lazy and simple way of figuring out if we're a 3887 */ 1012 1012 /* TODO: should just stick the identification in the device table */ ··· 1046 1050 priv->upload_fw = p54u_upload_firmware_net2280; 1047 1051 } 1048 1052 err = p54u_load_firmware(dev, intf); 1049 - if (err) { 1050 - usb_put_dev(udev); 1053 + if (err) 1051 1054 p54_free_common(dev); 1052 - } 1053 1055 return err; 1054 1056 } 1055 1057 ··· 1063 1069 wait_for_completion(&priv->fw_wait_load); 1064 1070 p54_unregister_common(dev); 1065 1071 1066 - usb_put_dev(interface_to_usbdev(intf)); 1067 1072 release_firmware(priv->fw); 1068 1073 p54_free_common(dev); 1069 1074 }
+10 -1
drivers/net/wireless/intersil/p54/txrx.c
··· 139 139 unlikely(GET_HW_QUEUE(skb) == P54_QUEUE_BEACON)) 140 140 priv->beacon_req_id = data->req_id; 141 141 142 - __skb_queue_after(&priv->tx_queue, target_skb, skb); 142 + if (target_skb) 143 + __skb_queue_after(&priv->tx_queue, target_skb, skb); 144 + else 145 + __skb_queue_head(&priv->tx_queue, skb); 143 146 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 144 147 return 0; 145 148 } ··· 331 328 u16 freq = le16_to_cpu(hdr->freq); 332 329 size_t header_len = sizeof(*hdr); 333 330 u32 tsf32; 331 + __le16 fc; 334 332 u8 rate = hdr->rate & 0xf; 335 333 336 334 /* ··· 380 376 381 377 skb_pull(skb, header_len); 382 378 skb_trim(skb, le16_to_cpu(hdr->len)); 379 + 380 + fc = ((struct ieee80211_hdr *)skb->data)->frame_control; 381 + if (ieee80211_is_probe_resp(fc) || ieee80211_is_beacon(fc)) 382 + rx_status->boottime_ns = ktime_get_boot_ns(); 383 + 383 384 if (unlikely(priv->hw->conf.flags & IEEE80211_CONF_PS)) 384 385 p54_pspoll_workaround(priv, skb); 385 386
+1 -1
drivers/net/wireless/marvell/libertas/if_usb.c
··· 368 368 cardp->fwseqnum, cardp->totalbytes); 369 369 } else if (fwdata->hdr.dnldcmd == cpu_to_le32(FW_HAS_LAST_BLOCK)) { 370 370 lbs_deb_usb2(&cardp->udev->dev, "Host has finished FW downloading\n"); 371 - lbs_deb_usb2(&cardp->udev->dev, "Donwloading FW JUMP BLOCK\n"); 371 + lbs_deb_usb2(&cardp->udev->dev, "Downloading FW JUMP BLOCK\n"); 372 372 373 373 cardp->fwfinalblk = 1; 374 374 }
+1 -1
drivers/net/wireless/marvell/libertas_tf/if_usb.c
··· 315 315 } else if (fwdata->hdr.dnldcmd == cpu_to_le32(FW_HAS_LAST_BLOCK)) { 316 316 lbtf_deb_usb2(&cardp->udev->dev, 317 317 "Host has finished FW downloading\n"); 318 - lbtf_deb_usb2(&cardp->udev->dev, "Donwloading FW JUMP BLOCK\n"); 318 + lbtf_deb_usb2(&cardp->udev->dev, "Downloading FW JUMP BLOCK\n"); 319 319 320 320 /* Host has finished FW downloading 321 321 * Donwloading FW JUMP BLOCK
+18 -9
drivers/net/wireless/marvell/mwifiex/cmdevt.c
··· 39 39 static void 40 40 mwifiex_init_cmd_node(struct mwifiex_private *priv, 41 41 struct cmd_ctrl_node *cmd_node, 42 - u32 cmd_oid, void *data_buf, bool sync) 42 + u32 cmd_no, void *data_buf, bool sync) 43 43 { 44 44 cmd_node->priv = priv; 45 - cmd_node->cmd_oid = cmd_oid; 45 + cmd_node->cmd_no = cmd_no; 46 + 46 47 if (sync) { 47 48 cmd_node->wait_q_enabled = true; 48 49 cmd_node->cmd_wait_q_woken = false; ··· 93 92 mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter, 94 93 struct cmd_ctrl_node *cmd_node) 95 94 { 96 - cmd_node->cmd_oid = 0; 95 + cmd_node->cmd_no = 0; 97 96 cmd_node->cmd_flag = 0; 98 97 cmd_node->data_buf = NULL; 99 98 cmd_node->wait_q_enabled = false; ··· 202 201 } 203 202 204 203 cmd_code = le16_to_cpu(host_cmd->command); 204 + cmd_node->cmd_no = cmd_code; 205 205 cmd_size = le16_to_cpu(host_cmd->size); 206 206 207 207 if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && ··· 623 621 } 624 622 625 623 /* Initialize the command node */ 626 - mwifiex_init_cmd_node(priv, cmd_node, cmd_oid, data_buf, sync); 624 + mwifiex_init_cmd_node(priv, cmd_node, cmd_no, data_buf, sync); 627 625 628 626 if (!cmd_node->cmd_skb) { 629 627 mwifiex_dbg(adapter, ERROR, ··· 824 822 uint16_t cmdresp_result; 825 823 unsigned long flags; 826 824 827 - /* Now we got response from FW, cancel the command timer */ 828 - del_timer_sync(&adapter->cmd_timer); 829 - 830 825 if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) { 831 826 resp = (struct host_cmd_ds_command *) adapter->upld_buf; 832 827 mwifiex_dbg(adapter, ERROR, ··· 832 833 return -1; 833 834 } 834 835 836 + resp = (struct host_cmd_ds_command *)adapter->curr_cmd->resp_skb->data; 837 + orig_cmdresp_no = le16_to_cpu(resp->command); 838 + cmdresp_no = (orig_cmdresp_no & HostCmd_CMD_ID_MASK); 839 + 840 + if (adapter->curr_cmd->cmd_no != cmdresp_no) { 841 + mwifiex_dbg(adapter, ERROR, 842 + "cmdresp error: cmd=0x%x cmd_resp=0x%x\n", 843 + adapter->curr_cmd->cmd_no, cmdresp_no); 844 + return -1; 845 + } 846 + /* Now we got response from FW, cancel the command timer */ 847 + del_timer_sync(&adapter->cmd_timer); 835 848 clear_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags); 836 849 837 - resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data; 838 850 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { 839 851 /* Copy original response back to response buffer */ 840 852 struct mwifiex_ds_misc_cmd *hostcmd; ··· 859 849 memcpy(hostcmd->cmd, resp, size); 860 850 } 861 851 } 862 - orig_cmdresp_no = le16_to_cpu(resp->command); 863 852 864 853 /* Get BSS number and corresponding priv */ 865 854 priv = mwifiex_get_priv_by_id(adapter,
+3 -3
drivers/net/wireless/marvell/mwifiex/main.c
··· 960 960 961 961 mac_addr = old_mac_addr; 962 962 963 - if (priv->bss_type == MWIFIEX_BSS_TYPE_P2P) 963 + if (priv->bss_type == MWIFIEX_BSS_TYPE_P2P) { 964 964 mac_addr |= BIT_ULL(MWIFIEX_MAC_LOCAL_ADMIN_BIT); 965 - 966 - if (mwifiex_get_intf_num(priv->adapter, priv->bss_type) > 1) { 965 + mac_addr += priv->bss_num; 966 + } else if (priv->adapter->priv[0] != priv) { 967 967 /* Set mac address based on bss_type/bss_num */ 968 968 mac_addr ^= BIT_ULL(priv->bss_type + 8); 969 969 mac_addr += priv->bss_num;
+1 -1
drivers/net/wireless/marvell/mwifiex/main.h
··· 747 747 struct cmd_ctrl_node { 748 748 struct list_head list; 749 749 struct mwifiex_private *priv; 750 - u32 cmd_oid; 750 + u32 cmd_no; 751 751 u32 cmd_flag; 752 752 struct sk_buff *cmd_skb; 753 753 struct sk_buff *resp_skb;
+2 -3
drivers/net/wireless/marvell/mwifiex/pcie.c
··· 2924 2924 2925 2925 pci_set_master(pdev); 2926 2926 2927 - pr_notice("try set_consistent_dma_mask(32)\n"); 2928 2927 ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 2929 2928 if (ret) { 2930 - pr_err("set_dma_mask(32) failed\n"); 2929 + pr_err("set_dma_mask(32) failed: %d\n", ret); 2931 2930 goto err_set_dma_mask; 2932 2931 } 2933 2932 ··· 2959 2960 goto err_iomap2; 2960 2961 } 2961 2962 2962 - pr_notice("PCI memory map Virt0: %p PCI memory map Virt2: %p\n", 2963 + pr_notice("PCI memory map Virt0: %pK PCI memory map Virt2: %pK\n", 2963 2964 card->pci_mmap, card->pci_mmap1); 2964 2965 2965 2966 ret = mwifiex_pcie_alloc_buffers(adapter);
+34 -20
drivers/net/wireless/mediatek/mt7601u/dma.c
··· 185 185 struct mt7601u_rx_queue *q = &dev->rx_q; 186 186 unsigned long flags; 187 187 188 - spin_lock_irqsave(&dev->rx_lock, flags); 188 + /* do no schedule rx tasklet if urb has been unlinked 189 + * or the device has been removed 190 + */ 191 + switch (urb->status) { 192 + case -ECONNRESET: 193 + case -ESHUTDOWN: 194 + case -ENOENT: 195 + return; 196 + default: 197 + dev_err_ratelimited(dev->dev, "rx urb failed: %d\n", 198 + urb->status); 199 + /* fall through */ 200 + case 0: 201 + break; 202 + } 189 203 190 - if (mt7601u_urb_has_error(urb)) 191 - dev_err(dev->dev, "Error: RX urb failed:%d\n", urb->status); 204 + spin_lock_irqsave(&dev->rx_lock, flags); 192 205 if (WARN_ONCE(q->e[q->end].urb != urb, "RX urb mismatch")) 193 206 goto out; 194 207 ··· 233 220 struct sk_buff *skb; 234 221 unsigned long flags; 235 222 236 - spin_lock_irqsave(&dev->tx_lock, flags); 223 + switch (urb->status) { 224 + case -ECONNRESET: 225 + case -ESHUTDOWN: 226 + case -ENOENT: 227 + return; 228 + default: 229 + dev_err_ratelimited(dev->dev, "tx urb failed: %d\n", 230 + urb->status); 231 + /* fall through */ 232 + case 0: 233 + break; 234 + } 237 235 238 - if (mt7601u_urb_has_error(urb)) 239 - dev_err(dev->dev, "Error: TX urb failed:%d\n", urb->status); 236 + spin_lock_irqsave(&dev->tx_lock, flags); 240 237 if (WARN_ONCE(q->e[q->start].urb != urb, "TX urb mismatch")) 241 238 goto out; 242 239 243 240 skb = q->e[q->start].skb; 241 + q->e[q->start].skb = NULL; 244 242 trace_mt_tx_dma_done(dev, skb); 245 243 246 244 __skb_queue_tail(&dev->tx_skb_done, skb); ··· 379 355 static void mt7601u_kill_rx(struct mt7601u_dev *dev) 380 356 { 381 357 int i; 382 - unsigned long flags; 383 358 384 - spin_lock_irqsave(&dev->rx_lock, flags); 385 - 386 - for (i = 0; i < dev->rx_q.entries; i++) { 387 - int next = dev->rx_q.end; 388 - 389 - spin_unlock_irqrestore(&dev->rx_lock, flags); 390 - usb_poison_urb(dev->rx_q.e[next].urb); 391 - spin_lock_irqsave(&dev->rx_lock, flags); 392 - } 393 - 394 - spin_unlock_irqrestore(&dev->rx_lock, flags); 359 + for (i = 0; i < dev->rx_q.entries; i++) 360 + usb_poison_urb(dev->rx_q.e[i].urb); 395 361 } 396 362 397 363 static int mt7601u_submit_rx_buf(struct mt7601u_dev *dev, ··· 451 437 { 452 438 int i; 453 439 454 - WARN_ON(q->used); 455 - 456 440 for (i = 0; i < q->entries; i++) { 457 441 usb_poison_urb(q->e[i].urb); 442 + if (q->e[i].skb) 443 + mt7601u_tx_status(q->dev, q->e[i].skb); 458 444 usb_free_urb(q->e[i].urb); 459 445 } 460 446 }
+2 -2
drivers/net/wireless/mediatek/mt7601u/tx.c
··· 109 109 info->status.rates[0].idx = -1; 110 110 info->flags |= IEEE80211_TX_STAT_ACK; 111 111 112 - spin_lock(&dev->mac_lock); 112 + spin_lock_bh(&dev->mac_lock); 113 113 ieee80211_tx_status(dev->hw, skb); 114 - spin_unlock(&dev->mac_lock); 114 + spin_unlock_bh(&dev->mac_lock); 115 115 } 116 116 117 117 static int mt7601u_skb_rooms(struct mt7601u_dev *dev, struct sk_buff *skb)
+2 -3
drivers/net/wireless/quantenna/qtnfmac/commands.c
··· 1011 1011 if (WARN_ON(resp->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) 1012 1012 return -E2BIG; 1013 1013 1014 - mac->rd = kzalloc(sizeof(*mac->rd) + 1015 - sizeof(struct ieee80211_reg_rule) * 1016 - resp->n_reg_rules, GFP_KERNEL); 1014 + mac->rd = kzalloc(struct_size(mac->rd, reg_rules, resp->n_reg_rules), 1015 + GFP_KERNEL); 1017 1016 if (!mac->rd) 1018 1017 return -ENOMEM; 1019 1018
+91 -5
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
··· 30 30 #include "rt2800lib.h" 31 31 #include "rt2800.h" 32 32 33 + static bool modparam_watchdog; 34 + module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO); 35 + MODULE_PARM_DESC(watchdog, "Enable watchdog to detect tx/rx hangs and reset hardware if detected"); 36 + 33 37 /* 34 38 * Register access. 35 39 * All access to the CSR registers will go through the methods ··· 1216 1212 } 1217 1213 EXPORT_SYMBOL_GPL(rt2800_txdone_nostatus); 1218 1214 1215 + static int rt2800_check_hung(struct data_queue *queue) 1216 + { 1217 + unsigned int cur_idx = rt2800_drv_get_dma_done(queue); 1218 + 1219 + if (queue->wd_idx != cur_idx) 1220 + queue->wd_count = 0; 1221 + else 1222 + queue->wd_count++; 1223 + 1224 + return queue->wd_count > 16; 1225 + } 1226 + 1227 + void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) 1228 + { 1229 + struct data_queue *queue; 1230 + bool hung_tx = false; 1231 + bool hung_rx = false; 1232 + 1233 + if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) 1234 + return; 1235 + 1236 + queue_for_each(rt2x00dev, queue) { 1237 + switch (queue->qid) { 1238 + case QID_AC_VO: 1239 + case QID_AC_VI: 1240 + case QID_AC_BE: 1241 + case QID_AC_BK: 1242 + case QID_MGMT: 1243 + if (rt2x00queue_empty(queue)) 1244 + continue; 1245 + hung_tx = rt2800_check_hung(queue); 1246 + break; 1247 + case QID_RX: 1248 + /* For station mode we should reactive at least 1249 + * beacons. TODO: need to find good way detect 1250 + * RX hung for AP mode. 1251 + */ 1252 + if (rt2x00dev->intf_sta_count == 0) 1253 + continue; 1254 + hung_rx = rt2800_check_hung(queue); 1255 + break; 1256 + default: 1257 + break; 1258 + } 1259 + } 1260 + 1261 + if (hung_tx) 1262 + rt2x00_warn(rt2x00dev, "Watchdog TX hung detected\n"); 1263 + 1264 + if (hung_rx) 1265 + rt2x00_warn(rt2x00dev, "Watchdog RX hung detected\n"); 1266 + 1267 + if (hung_tx || hung_rx) 1268 + ieee80211_restart_hw(rt2x00dev->hw); 1269 + } 1270 + EXPORT_SYMBOL_GPL(rt2800_watchdog); 1271 + 1219 1272 static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev, 1220 1273 unsigned int index) 1221 1274 { ··· 1654 1593 1655 1594 offset = MAC_IVEIV_ENTRY(key->hw_key_idx); 1656 1595 1657 - memset(&iveiv_entry, 0, sizeof(iveiv_entry)); 1596 + rt2800_register_multiread(rt2x00dev, offset, 1597 + &iveiv_entry, sizeof(iveiv_entry)); 1658 1598 if ((crypto->cipher == CIPHER_TKIP) || 1659 1599 (crypto->cipher == CIPHER_TKIP_NO_MIC) || 1660 1600 (crypto->cipher == CIPHER_AES)) 1661 1601 iveiv_entry.iv[3] |= 0x20; 1662 1602 iveiv_entry.iv[3] |= key->keyidx << 6; 1663 1603 rt2800_register_multiwrite(rt2x00dev, offset, 1664 - &iveiv_entry, sizeof(iveiv_entry)); 1604 + &iveiv_entry, sizeof(iveiv_entry)); 1665 1605 } 1666 1606 1667 1607 int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev, ··· 1850 1788 return 0; 1851 1789 } 1852 1790 EXPORT_SYMBOL_GPL(rt2800_sta_remove); 1791 + 1792 + void rt2800_pre_reset_hw(struct rt2x00_dev *rt2x00dev) 1793 + { 1794 + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; 1795 + struct data_queue *queue = rt2x00dev->bcn; 1796 + struct queue_entry *entry; 1797 + int i, wcid; 1798 + 1799 + for (wcid = WCID_START; wcid < WCID_END; wcid++) { 1800 + drv_data->wcid_to_sta[wcid - WCID_START] = NULL; 1801 + __clear_bit(wcid - WCID_START, drv_data->sta_ids); 1802 + } 1803 + 1804 + for (i = 0; i < queue->limit; i++) { 1805 + entry = &queue->entries[i]; 1806 + clear_bit(ENTRY_BCN_ASSIGNED, &entry->flags); 1807 + } 1808 + } 1809 + EXPORT_SYMBOL_GPL(rt2800_pre_reset_hw); 1853 1810 1854 1811 void rt2800_config_filter(struct rt2x00_dev *rt2x00dev, 1855 1812 const unsigned int filter_flags) ··· 6087 6006 * ASIC will keep garbage value after boot, clear encryption keys. 6088 6007 */ 6089 6008 for (i = 0; i < 4; i++) 6090 - rt2800_register_write(rt2x00dev, 6091 - SHARED_KEY_MODE_ENTRY(i), 0); 6009 + rt2800_register_write(rt2x00dev, SHARED_KEY_MODE_ENTRY(i), 0); 6092 6010 6093 6011 for (i = 0; i < 256; i++) { 6094 6012 rt2800_config_wcid(rt2x00dev, NULL, i); 6095 6013 rt2800_delete_wcid_attr(rt2x00dev, i); 6096 - rt2800_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0); 6097 6014 } 6098 6015 6099 6016 /* ··· 10288 10209 else { 10289 10210 __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags); 10290 10211 __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); 10212 + } 10213 + 10214 + if (modparam_watchdog) { 10215 + __set_bit(CAPABILITY_RESTART_HW, &rt2x00dev->cap_flags); 10216 + rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100); 10217 + } else { 10218 + rt2x00dev->link.watchdog_disabled = true; 10291 10219 } 10292 10220 10293 10221 /*
+11
drivers/net/wireless/ralink/rt2x00/rt2800lib.h
··· 65 65 const u8 *data, const size_t len); 66 66 int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); 67 67 __le32 *(*drv_get_txwi)(struct queue_entry *entry); 68 + unsigned int (*drv_get_dma_done)(struct data_queue *queue); 68 69 }; 69 70 70 71 static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev, ··· 167 166 return rt2800ops->drv_get_txwi(entry); 168 167 } 169 168 169 + static inline unsigned int rt2800_drv_get_dma_done(struct data_queue *queue) 170 + { 171 + const struct rt2800_ops *rt2800ops = queue->rt2x00dev->ops->drv; 172 + 173 + return rt2800ops->drv_get_dma_done(queue); 174 + } 175 + 170 176 void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, 171 177 const u8 command, const u8 token, 172 178 const u8 arg0, const u8 arg1); ··· 196 188 void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev); 197 189 bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev); 198 190 bool rt2800_txstatus_pending(struct rt2x00_dev *rt2x00dev); 191 + 192 + void rt2800_watchdog(struct rt2x00_dev *rt2x00dev); 199 193 200 194 void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc); 201 195 void rt2800_clear_beacon(struct queue_entry *entry); ··· 257 247 void rt2800_get_txwi_rxwi_size(struct rt2x00_dev *rt2x00dev, 258 248 unsigned short *txwi_size, 259 249 unsigned short *rxwi_size); 250 + void rt2800_pre_reset_hw(struct rt2x00_dev *rt2x00dev); 260 251 261 252 #endif /* RT2800LIB_H */
+31
drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
··· 24 24 #include "rt2800lib.h" 25 25 #include "rt2800mmio.h" 26 26 27 + unsigned int rt2800mmio_get_dma_done(struct data_queue *queue) 28 + { 29 + struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; 30 + struct queue_entry *entry; 31 + int idx, qid; 32 + 33 + switch (queue->qid) { 34 + case QID_AC_VO: 35 + case QID_AC_VI: 36 + case QID_AC_BE: 37 + case QID_AC_BK: 38 + qid = queue->qid; 39 + idx = rt2x00mmio_register_read(rt2x00dev, TX_DTX_IDX(qid)); 40 + break; 41 + case QID_MGMT: 42 + idx = rt2x00mmio_register_read(rt2x00dev, TX_DTX_IDX(5)); 43 + break; 44 + case QID_RX: 45 + entry = rt2x00queue_get_entry(queue, Q_INDEX_DMA_DONE); 46 + idx = entry->entry_idx; 47 + break; 48 + default: 49 + WARN_ON_ONCE(1); 50 + idx = 0; 51 + break; 52 + } 53 + 54 + return idx; 55 + } 56 + EXPORT_SYMBOL_GPL(rt2800mmio_get_dma_done); 57 + 27 58 /* 28 59 * TX descriptor initialization 29 60 */
+2
drivers/net/wireless/ralink/rt2x00/rt2800mmio.h
··· 114 114 #define RXD_W3_PLCP_SIGNAL FIELD32(0x00020000) 115 115 #define RXD_W3_PLCP_RSSI FIELD32(0x00040000) 116 116 117 + unsigned int rt2800mmio_get_dma_done(struct data_queue *queue); 118 + 117 119 /* TX descriptor initialization */ 118 120 __le32 *rt2800mmio_get_txwi(struct queue_entry *entry); 119 121 void rt2800mmio_write_tx_desc(struct queue_entry *entry,
+3
drivers/net/wireless/ralink/rt2x00/rt2800pci.c
··· 326 326 .drv_write_firmware = rt2800pci_write_firmware, 327 327 .drv_init_registers = rt2800mmio_init_registers, 328 328 .drv_get_txwi = rt2800mmio_get_txwi, 329 + .drv_get_dma_done = rt2800mmio_get_dma_done, 329 330 }; 330 331 331 332 static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { ··· 351 350 .link_tuner = rt2800_link_tuner, 352 351 .gain_calibration = rt2800_gain_calibration, 353 352 .vco_calibration = rt2800_vco_calibration, 353 + .watchdog = rt2800_watchdog, 354 354 .start_queue = rt2800mmio_start_queue, 355 355 .kick_queue = rt2800mmio_kick_queue, 356 356 .stop_queue = rt2800mmio_stop_queue, ··· 368 366 .config_erp = rt2800_config_erp, 369 367 .config_ant = rt2800_config_ant, 370 368 .config = rt2800_config, 369 + .pre_reset_hw = rt2800_pre_reset_hw, 371 370 }; 372 371 373 372 static const struct rt2x00_ops rt2800pci_ops = {
+3
drivers/net/wireless/ralink/rt2x00/rt2800soc.c
··· 171 171 .drv_write_firmware = rt2800soc_write_firmware, 172 172 .drv_init_registers = rt2800mmio_init_registers, 173 173 .drv_get_txwi = rt2800mmio_get_txwi, 174 + .drv_get_dma_done = rt2800mmio_get_dma_done, 174 175 }; 175 176 176 177 static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = { ··· 196 195 .link_tuner = rt2800_link_tuner, 197 196 .gain_calibration = rt2800_gain_calibration, 198 197 .vco_calibration = rt2800_vco_calibration, 198 + .watchdog = rt2800_watchdog, 199 199 .start_queue = rt2800mmio_start_queue, 200 200 .kick_queue = rt2800mmio_kick_queue, 201 201 .stop_queue = rt2800mmio_stop_queue, ··· 213 211 .config_erp = rt2800_config_erp, 214 212 .config_ant = rt2800_config_ant, 215 213 .config = rt2800_config, 214 + .pre_reset_hw = rt2800_pre_reset_hw, 216 215 }; 217 216 218 217 static const struct rt2x00_ops rt2800soc_ops = {
+11
drivers/net/wireless/ralink/rt2x00/rt2800usb.c
··· 379 379 return retval; 380 380 } 381 381 382 + static unsigned int rt2800usb_get_dma_done(struct data_queue *queue) 383 + { 384 + struct queue_entry *entry; 385 + 386 + entry = rt2x00queue_get_entry(queue, Q_INDEX_DMA_DONE); 387 + return entry->entry_idx; 388 + } 389 + 382 390 /* 383 391 * TX descriptor initialization 384 392 */ ··· 669 661 .drv_write_firmware = rt2800usb_write_firmware, 670 662 .drv_init_registers = rt2800usb_init_registers, 671 663 .drv_get_txwi = rt2800usb_get_txwi, 664 + .drv_get_dma_done = rt2800usb_get_dma_done, 672 665 }; 673 666 674 667 static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { ··· 687 678 .link_tuner = rt2800_link_tuner, 688 679 .gain_calibration = rt2800_gain_calibration, 689 680 .vco_calibration = rt2800_vco_calibration, 681 + .watchdog = rt2800_watchdog, 690 682 .start_queue = rt2800usb_start_queue, 691 683 .kick_queue = rt2x00usb_kick_queue, 692 684 .stop_queue = rt2800usb_stop_queue, ··· 706 696 .config_erp = rt2800_config_erp, 707 697 .config_ant = rt2800_config_ant, 708 698 .config = rt2800_config, 699 + .pre_reset_hw = rt2800_pre_reset_hw, 709 700 }; 710 701 711 702 static void rt2800usb_queue_init(struct data_queue *queue)
+10
drivers/net/wireless/ralink/rt2x00/rt2x00.h
··· 325 325 * to bring the device/driver back into the desired state. 326 326 */ 327 327 struct delayed_work watchdog_work; 328 + unsigned int watchdog_interval; 329 + bool watchdog_disabled; 328 330 329 331 /* 330 332 * Work structure for scheduling periodic AGC adjustments. ··· 617 615 void (*config) (struct rt2x00_dev *rt2x00dev, 618 616 struct rt2x00lib_conf *libconf, 619 617 const unsigned int changed_flags); 618 + void (*pre_reset_hw) (struct rt2x00_dev *rt2x00dev); 620 619 int (*sta_add) (struct rt2x00_dev *rt2x00dev, 621 620 struct ieee80211_vif *vif, 622 621 struct ieee80211_sta *sta); ··· 713 710 CAPABILITY_VCO_RECALIBRATION, 714 711 CAPABILITY_EXTERNAL_PA_TX0, 715 712 CAPABILITY_EXTERNAL_PA_TX1, 713 + CAPABILITY_RESTART_HW, 716 714 }; 717 715 718 716 /* ··· 1268 1264 rt2x00_has_cap_vco_recalibration(struct rt2x00_dev *rt2x00dev) 1269 1265 { 1270 1266 return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_VCO_RECALIBRATION); 1267 + } 1268 + 1269 + static inline bool 1270 + rt2x00_has_cap_restart_hw(struct rt2x00_dev *rt2x00dev) 1271 + { 1272 + return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_RESTART_HW); 1271 1273 } 1272 1274 1273 1275 /**
+35
drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
··· 52 52 * - chipset file 53 53 * - device state flags file 54 54 * - device capability flags file 55 + * - hardware restart file 55 56 * - register folder 56 57 * - csr offset/value files 57 58 * - eeprom offset/value files ··· 69 68 struct dentry *chipset_entry; 70 69 struct dentry *dev_flags; 71 70 struct dentry *cap_flags; 71 + struct dentry *restart_hw; 72 72 struct dentry *register_folder; 73 73 struct dentry *csr_off_entry; 74 74 struct dentry *csr_val_entry; ··· 568 566 .llseek = default_llseek, 569 567 }; 570 568 569 + static ssize_t rt2x00debug_write_restart_hw(struct file *file, 570 + const char __user *buf, 571 + size_t length, 572 + loff_t *offset) 573 + { 574 + struct rt2x00debug_intf *intf = file->private_data; 575 + struct rt2x00_dev *rt2x00dev = intf->rt2x00dev; 576 + static unsigned long last_reset; 577 + 578 + if (!rt2x00_has_cap_restart_hw(rt2x00dev)) 579 + return -EOPNOTSUPP; 580 + 581 + if (time_before(jiffies, last_reset + msecs_to_jiffies(2000))) 582 + return -EBUSY; 583 + 584 + last_reset = jiffies; 585 + 586 + ieee80211_restart_hw(rt2x00dev->hw); 587 + return length; 588 + } 589 + 590 + static const struct file_operations rt2x00debug_restart_hw = { 591 + .owner = THIS_MODULE, 592 + .write = rt2x00debug_write_restart_hw, 593 + .open = simple_open, 594 + .llseek = generic_file_llseek, 595 + }; 596 + 571 597 static struct dentry *rt2x00debug_create_file_driver(const char *name, 572 598 struct rt2x00debug_intf 573 599 *intf, ··· 691 661 intf->driver_folder, intf, 692 662 &rt2x00debug_fop_cap_flags); 693 663 664 + intf->restart_hw = debugfs_create_file("restart_hw", 0200, 665 + intf->driver_folder, intf, 666 + &rt2x00debug_restart_hw); 667 + 694 668 intf->register_folder = 695 669 debugfs_create_dir("register", intf->driver_folder); 696 670 ··· 776 742 debugfs_remove(intf->csr_off_entry); 777 743 debugfs_remove(intf->register_folder); 778 744 debugfs_remove(intf->dev_flags); 745 + debugfs_remove(intf->restart_hw); 779 746 debugfs_remove(intf->cap_flags); 780 747 debugfs_remove(intf->chipset_entry); 781 748 debugfs_remove(intf->driver_entry);
+8 -2
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
··· 1258 1258 { 1259 1259 int retval; 1260 1260 1261 - if (test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) 1262 - return 0; 1261 + if (test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) { 1262 + /* 1263 + * This is special case for ieee80211_restart_hw(), otherwise 1264 + * mac80211 never call start() two times in row without stop(); 1265 + */ 1266 + rt2x00dev->ops->lib->pre_reset_hw(rt2x00dev); 1267 + rt2x00lib_stop(rt2x00dev); 1268 + } 1263 1269 1264 1270 /* 1265 1271 * If this is the first interface which is added,
+10 -5
drivers/net/wireless/ralink/rt2x00/rt2x00link.c
··· 384 384 struct link *link = &rt2x00dev->link; 385 385 386 386 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && 387 - rt2x00dev->ops->lib->watchdog) 387 + rt2x00dev->ops->lib->watchdog && !link->watchdog_disabled) 388 388 ieee80211_queue_delayed_work(rt2x00dev->hw, 389 389 &link->watchdog_work, 390 - WATCHDOG_INTERVAL); 390 + link->watchdog_interval); 391 391 } 392 392 393 393 void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev) ··· 413 413 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 414 414 ieee80211_queue_delayed_work(rt2x00dev->hw, 415 415 &link->watchdog_work, 416 - WATCHDOG_INTERVAL); 416 + link->watchdog_interval); 417 417 } 418 418 419 419 void rt2x00link_register(struct rt2x00_dev *rt2x00dev) 420 420 { 421 - INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog); 422 - INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner); 421 + struct link *link = &rt2x00dev->link; 422 + 423 + INIT_DELAYED_WORK(&link->work, rt2x00link_tuner); 424 + INIT_DELAYED_WORK(&link->watchdog_work, rt2x00link_watchdog); 425 + 426 + if (link->watchdog_interval == 0) 427 + link->watchdog_interval = WATCHDOG_INTERVAL; 423 428 }
+6
drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
··· 435 435 * @length: Number of frames in queue. 436 436 * @index: Index pointers to entry positions in the queue, 437 437 * use &enum queue_index to get a specific index field. 438 + * @wd_count: watchdog counter number of times entry does change 439 + * in the queue 440 + * @wd_idx: index of queue entry saved by watchdog 438 441 * @txop: maximum burst time. 439 442 * @aifs: The aifs value for outgoing frames (field ignored in RX queue). 440 443 * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). ··· 464 461 unsigned short threshold; 465 462 unsigned short length; 466 463 unsigned short index[Q_INDEX_MAX]; 464 + 465 + unsigned short wd_count; 466 + unsigned int wd_idx; 467 467 468 468 unsigned short txop; 469 469 unsigned short aifs;
+3 -32
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
··· 1578 1578 1579 1579 void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action) 1580 1580 { 1581 - u8 asso_type, asso_type_v2; 1581 + u8 asso_type; 1582 1582 bool wifi_under_5g; 1583 1583 1584 1584 if (!halbtc_is_bt_coexist_available(btcoexist)) ··· 1589 1589 1590 1590 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); 1591 1591 1592 - if (action) { 1592 + if (action) 1593 1593 asso_type = BTC_ASSOCIATE_START; 1594 - asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_START : 1595 - BTC_ASSOCIATE_START; 1596 - } else { 1594 + else 1597 1595 asso_type = BTC_ASSOCIATE_FINISH; 1598 - asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_FINISH : 1599 - BTC_ASSOCIATE_FINISH; 1600 - } 1601 1596 1602 1597 halbtc_leave_low_power(btcoexist); 1603 1598 ··· 1738 1743 if (btcoexist->board_info.btdm_ant_num == 1) 1739 1744 ex_btc8723b1ant_rf_status_notify(btcoexist, type); 1740 1745 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { 1741 - } 1742 - } 1743 - 1744 - void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type) 1745 - { 1746 - u8 stack_op_type; 1747 - 1748 - if (!halbtc_is_bt_coexist_available(btcoexist)) 1749 - return; 1750 - btcoexist->statistics.cnt_stack_operation_notify++; 1751 - if (btcoexist->manual_control) 1752 - return; 1753 - 1754 - if ((type == HCI_BT_OP_INQUIRY_START) || 1755 - (type == HCI_BT_OP_PAGING_START) || 1756 - (type == HCI_BT_OP_PAIRING_START)) { 1757 - stack_op_type = BTC_STACK_OP_INQ_PAGE_PAIR_START; 1758 - } else if ((type == HCI_BT_OP_INQUIRY_FINISH) || 1759 - (type == HCI_BT_OP_PAGING_SUCCESS) || 1760 - (type == HCI_BT_OP_PAGING_UNSUCCESS) || 1761 - (type == HCI_BT_OP_PAIRING_FINISH)) { 1762 - stack_op_type = BTC_STACK_OP_INQ_PAGE_PAIR_FINISH; 1763 - } else { 1764 - stack_op_type = BTC_STACK_OP_NONE; 1765 1746 } 1766 1747 } 1767 1748
-1
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
··· 764 764 void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, u8 *tmp_buf, 765 765 u8 length); 766 766 void exhalbtc_rf_status_notify(struct btc_coexist *btcoexist, u8 type); 767 - void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type); 768 767 void exhalbtc_halt_notify(struct btc_coexist *btcoexist); 769 768 void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); 770 769 void exhalbtc_coex_dm_switch(struct btc_coexist *btcoexist);
+1 -2
drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
··· 316 316 void rtl_btc_btmpinfo_notify(struct rtl_priv *rtlpriv, u8 *tmp_buf, u8 length) 317 317 { 318 318 struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv); 319 - u8 extid, seq, len; 319 + u8 extid, seq; 320 320 u16 bt_real_fw_ver; 321 321 u8 bt_fw_ver; 322 322 u8 *data; ··· 332 332 if (extid != 1) /* C2H_TRIG_BY_BT_FW = 1 */ 333 333 return; 334 334 335 - len = tmp_buf[1] >> 4; 336 335 seq = tmp_buf[2] >> 4; 337 336 data = &tmp_buf[3]; 338 337
+1 -4
drivers/net/wireless/realtek/rtlwifi/efuse.c
··· 117 117 rtlpriv->cfg-> 118 118 maps[EFUSE_CTRL] + 3); 119 119 k++; 120 - if (k == 1000) { 121 - k = 0; 120 + if (k == 1000) 122 121 break; 123 - } 124 122 } 125 123 data = rtl_read_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL]); 126 124 return data; ··· 984 986 } else if (write_state == PG_STATE_DATA) { 985 987 RTPRINT(rtlpriv, FEEPROM, EFUSE_PG, 986 988 "efuse PG_STATE_DATA\n"); 987 - badworden = 0x0f; 988 989 badworden = 989 990 enable_efuse_data_write(hw, efuse_addr + 1, 990 991 target_pkt.word_en,
+1 -1
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
··· 1039 1039 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 1040 1040 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1041 1041 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 1042 - bool rtstatus = true; 1042 + bool rtstatus; 1043 1043 int err = 0; 1044 1044 u8 tmp_u1b, u1byte; 1045 1045 unsigned long flags;
+341 -376
drivers/net/wireless/realtek/rtlwifi/rtl8192de/dm.c
··· 680 680 int i; 681 681 unsigned long flag = 0; 682 682 long temp_cck; 683 + const u8 *cckswing; 683 684 684 685 /* Query CCK default setting From 0xa24 */ 685 686 rtl92d_acquire_cckandrw_pagea_ctl(hw, &flag); ··· 688 687 MASKDWORD) & MASKCCK; 689 688 rtl92d_release_cckandrw_pagea_ctl(hw, &flag); 690 689 for (i = 0; i < CCK_TABLE_LENGTH; i++) { 691 - if (rtlpriv->dm.cck_inch14) { 692 - if (!memcmp((void *)&temp_cck, 693 - (void *)&cckswing_table_ch14[i][2], 4)) { 694 - *cck_index_old = (u8) i; 695 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 696 - "Initial reg0x%x = 0x%lx, cck_index=0x%x, ch 14 %d\n", 697 - RCCK0_TXFILTER2, temp_cck, 698 - *cck_index_old, 699 - rtlpriv->dm.cck_inch14); 700 - break; 701 - } 702 - } else { 703 - if (!memcmp((void *) &temp_cck, 704 - &cckswing_table_ch1ch13[i][2], 4)) { 705 - *cck_index_old = (u8) i; 706 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 707 - "Initial reg0x%x = 0x%lx, cck_index = 0x%x, ch14 %d\n", 708 - RCCK0_TXFILTER2, temp_cck, 709 - *cck_index_old, 710 - rtlpriv->dm.cck_inch14); 711 - break; 712 - } 690 + if (rtlpriv->dm.cck_inch14) 691 + cckswing = &cckswing_table_ch14[i][2]; 692 + else 693 + cckswing = &cckswing_table_ch1ch13[i][2]; 694 + 695 + if (temp_cck == le32_to_cpu(*((__le32 *)cckswing))) { 696 + *cck_index_old = (u8)i; 697 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 698 + "Initial reg0x%x = 0x%lx, cck_index = 0x%x, ch14 %d\n", 699 + RCCK0_TXFILTER2, temp_cck, 700 + *cck_index_old, 701 + rtlpriv->dm.cck_inch14); 702 + break; 713 703 } 714 704 } 715 705 *temp_cckg = temp_cck; ··· 710 718 bool *internal_pa, u8 thermalvalue, u8 delta, 711 719 u8 rf, struct rtl_efuse *rtlefuse, 712 720 struct rtl_priv *rtlpriv, struct rtl_phy *rtlphy, 713 - u8 index_mapping[5][INDEX_MAPPING_NUM], 714 - u8 index_mapping_pa[8][INDEX_MAPPING_NUM]) 721 + const u8 index_mapping[5][INDEX_MAPPING_NUM], 722 + const u8 index_mapping_pa[8][INDEX_MAPPING_NUM]) 715 723 { 716 724 int i; 717 725 u8 index; ··· 779 787 bool internal_pa = false; 780 788 long ele_a = 0, ele_d, temp_cck, val_x, value32; 781 789 long val_y, ele_c = 0; 782 - u8 ofdm_index[3]; 790 + u8 ofdm_index[2]; 783 791 s8 cck_index = 0; 784 - u8 ofdm_index_old[3] = {0, 0, 0}; 792 + u8 ofdm_index_old[2] = {0, 0}; 785 793 s8 cck_index_old = 0; 786 794 u8 index; 787 795 int i; ··· 789 797 u8 ofdm_min_index = 6, ofdm_min_index_internal_pa = 3, rf; 790 798 u8 indexforchannel = 791 799 rtl92d_get_rightchnlplace_for_iqk(rtlphy->current_channel); 792 - u8 index_mapping[5][INDEX_MAPPING_NUM] = { 800 + static const u8 index_mapping[5][INDEX_MAPPING_NUM] = { 793 801 /* 5G, path A/MAC 0, decrease power */ 794 802 {0, 1, 3, 6, 8, 9, 11, 13, 14, 16, 17, 18, 18}, 795 803 /* 5G, path A/MAC 0, increase power */ ··· 801 809 /* 2.4G, for decreas power */ 802 810 {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 10}, 803 811 }; 804 - u8 index_mapping_internal_pa[8][INDEX_MAPPING_NUM] = { 812 + static const u8 index_mapping_internal_pa[8][INDEX_MAPPING_NUM] = { 805 813 /* 5G, path A/MAC 0, ch36-64, decrease power */ 806 814 {0, 1, 2, 4, 6, 7, 9, 11, 12, 14, 15, 16, 16}, 807 815 /* 5G, path A/MAC 0, ch36-64, increase power */ ··· 829 837 rtlpriv->dm.thermalvalue, rtlefuse->eeprom_thermalmeter); 830 838 rtl92d_phy_ap_calibrate(hw, (thermalvalue - 831 839 rtlefuse->eeprom_thermalmeter)); 840 + 841 + if (!thermalvalue) 842 + goto exit; 843 + 832 844 if (is2t) 833 845 rf = 2; 834 846 else 835 847 rf = 1; 836 - if (thermalvalue) { 837 - ele_d = rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 848 + 849 + if (rtlpriv->dm.thermalvalue && !rtlhal->reloadtxpowerindex) 850 + goto old_index_done; 851 + 852 + ele_d = rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE, MASKDWORD) & MASKOFDM_D; 853 + for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { 854 + if (ele_d == (ofdmswing_table[i] & MASKOFDM_D)) { 855 + ofdm_index_old[0] = (u8)i; 856 + 857 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 858 + "Initial pathA ele_d reg0x%x = 0x%lx, ofdm_index=0x%x\n", 859 + ROFDM0_XATXIQIMBALANCE, 860 + ele_d, ofdm_index_old[0]); 861 + break; 862 + } 863 + } 864 + if (is2t) { 865 + ele_d = rtl_get_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, 838 866 MASKDWORD) & MASKOFDM_D; 839 867 for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { 840 - if (ele_d == (ofdmswing_table[i] & MASKOFDM_D)) { 841 - ofdm_index_old[0] = (u8) i; 842 - 843 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 844 - "Initial pathA ele_d reg0x%x = 0x%lx, ofdm_index=0x%x\n", 845 - ROFDM0_XATXIQIMBALANCE, 846 - ele_d, ofdm_index_old[0]); 868 + if (ele_d == 869 + (ofdmswing_table[i] & MASKOFDM_D)) { 870 + ofdm_index_old[1] = (u8)i; 871 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 872 + DBG_LOUD, 873 + "Initial pathB ele_d reg 0x%x = 0x%lx, ofdm_index = 0x%x\n", 874 + ROFDM0_XBTXIQIMBALANCE, ele_d, 875 + ofdm_index_old[1]); 847 876 break; 848 877 } 849 878 } 850 - if (is2t) { 851 - ele_d = rtl_get_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, 852 - MASKDWORD) & MASKOFDM_D; 853 - for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { 854 - if (ele_d == 855 - (ofdmswing_table[i] & MASKOFDM_D)) { 856 - ofdm_index_old[1] = (u8) i; 857 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 858 - DBG_LOUD, 859 - "Initial pathB ele_d reg 0x%x = 0x%lx, ofdm_index = 0x%x\n", 860 - ROFDM0_XBTXIQIMBALANCE, ele_d, 861 - ofdm_index_old[1]); 862 - break; 863 - } 864 - } 865 - } 866 - if (rtlhal->current_bandtype == BAND_ON_2_4G) { 867 - rtl92d_bandtype_2_4G(hw, &temp_cck, &cck_index_old); 868 - } else { 869 - temp_cck = 0x090e1317; 870 - cck_index_old = 12; 871 - } 872 - 873 - if (!rtlpriv->dm.thermalvalue) { 874 - rtlpriv->dm.thermalvalue = 875 - rtlefuse->eeprom_thermalmeter; 876 - rtlpriv->dm.thermalvalue_lck = thermalvalue; 877 - rtlpriv->dm.thermalvalue_iqk = thermalvalue; 878 - rtlpriv->dm.thermalvalue_rxgain = 879 - rtlefuse->eeprom_thermalmeter; 880 - for (i = 0; i < rf; i++) 881 - rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i]; 882 - rtlpriv->dm.cck_index = cck_index_old; 883 - } 884 - if (rtlhal->reloadtxpowerindex) { 885 - for (i = 0; i < rf; i++) 886 - rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i]; 887 - rtlpriv->dm.cck_index = cck_index_old; 888 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 889 - "reload ofdm index for band switch\n"); 890 - } 891 - rtlpriv->dm.thermalvalue_avg 892 - [rtlpriv->dm.thermalvalue_avg_index] = thermalvalue; 893 - rtlpriv->dm.thermalvalue_avg_index++; 894 - if (rtlpriv->dm.thermalvalue_avg_index == AVG_THERMAL_NUM) 895 - rtlpriv->dm.thermalvalue_avg_index = 0; 896 - for (i = 0; i < AVG_THERMAL_NUM; i++) { 897 - if (rtlpriv->dm.thermalvalue_avg[i]) { 898 - thermalvalue_avg += 899 - rtlpriv->dm.thermalvalue_avg[i]; 900 - thermalvalue_avg_count++; 901 - } 902 - } 903 - if (thermalvalue_avg_count) 904 - thermalvalue = (u8) (thermalvalue_avg / 905 - thermalvalue_avg_count); 906 - if (rtlhal->reloadtxpowerindex) { 907 - delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 908 - (thermalvalue - rtlefuse->eeprom_thermalmeter) : 909 - (rtlefuse->eeprom_thermalmeter - thermalvalue); 910 - rtlhal->reloadtxpowerindex = false; 911 - rtlpriv->dm.done_txpower = false; 912 - } else if (rtlpriv->dm.done_txpower) { 913 - delta = (thermalvalue > rtlpriv->dm.thermalvalue) ? 914 - (thermalvalue - rtlpriv->dm.thermalvalue) : 915 - (rtlpriv->dm.thermalvalue - thermalvalue); 916 - } else { 917 - delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 918 - (thermalvalue - rtlefuse->eeprom_thermalmeter) : 919 - (rtlefuse->eeprom_thermalmeter - thermalvalue); 920 - } 921 - delta_lck = (thermalvalue > rtlpriv->dm.thermalvalue_lck) ? 922 - (thermalvalue - rtlpriv->dm.thermalvalue_lck) : 923 - (rtlpriv->dm.thermalvalue_lck - thermalvalue); 924 - delta_iqk = (thermalvalue > rtlpriv->dm.thermalvalue_iqk) ? 925 - (thermalvalue - rtlpriv->dm.thermalvalue_iqk) : 926 - (rtlpriv->dm.thermalvalue_iqk - thermalvalue); 927 - delta_rxgain = 928 - (thermalvalue > rtlpriv->dm.thermalvalue_rxgain) ? 929 - (thermalvalue - rtlpriv->dm.thermalvalue_rxgain) : 930 - (rtlpriv->dm.thermalvalue_rxgain - thermalvalue); 931 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 932 - "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x delta 0x%x delta_lck 0x%x delta_iqk 0x%x\n", 933 - thermalvalue, rtlpriv->dm.thermalvalue, 934 - rtlefuse->eeprom_thermalmeter, delta, delta_lck, 935 - delta_iqk); 936 - if ((delta_lck > rtlefuse->delta_lck) && 937 - (rtlefuse->delta_lck != 0)) { 938 - rtlpriv->dm.thermalvalue_lck = thermalvalue; 939 - rtl92d_phy_lc_calibrate(hw); 940 - } 941 - if (delta > 0 && rtlpriv->dm.txpower_track_control) { 942 - rtlpriv->dm.done_txpower = true; 943 - delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 944 - (thermalvalue - rtlefuse->eeprom_thermalmeter) : 945 - (rtlefuse->eeprom_thermalmeter - thermalvalue); 946 - if (rtlhal->current_bandtype == BAND_ON_2_4G) { 947 - offset = 4; 948 - if (delta > INDEX_MAPPING_NUM - 1) 949 - index = index_mapping[offset] 950 - [INDEX_MAPPING_NUM - 1]; 951 - else 952 - index = index_mapping[offset][delta]; 953 - if (thermalvalue > rtlpriv->dm.thermalvalue) { 954 - for (i = 0; i < rf; i++) 955 - ofdm_index[i] -= delta; 956 - cck_index -= delta; 957 - } else { 958 - for (i = 0; i < rf; i++) 959 - ofdm_index[i] += index; 960 - cck_index += index; 961 - } 962 - } else if (rtlhal->current_bandtype == BAND_ON_5G) { 963 - rtl92d_bandtype_5G(rtlhal, ofdm_index, 964 - &internal_pa, thermalvalue, 965 - delta, rf, rtlefuse, rtlpriv, 966 - rtlphy, index_mapping, 967 - index_mapping_internal_pa); 968 - } 969 - if (is2t) { 970 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 971 - "temp OFDM_A_index=0x%x, OFDM_B_index = 0x%x,cck_index=0x%x\n", 972 - rtlpriv->dm.ofdm_index[0], 973 - rtlpriv->dm.ofdm_index[1], 974 - rtlpriv->dm.cck_index); 975 - } else { 976 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 977 - "temp OFDM_A_index=0x%x,cck_index = 0x%x\n", 978 - rtlpriv->dm.ofdm_index[0], 979 - rtlpriv->dm.cck_index); 980 - } 981 - for (i = 0; i < rf; i++) { 982 - if (ofdm_index[i] > OFDM_TABLE_SIZE_92D - 1) 983 - ofdm_index[i] = OFDM_TABLE_SIZE_92D - 1; 984 - else if (ofdm_index[i] < ofdm_min_index) 985 - ofdm_index[i] = ofdm_min_index; 986 - } 987 - if (rtlhal->current_bandtype == BAND_ON_2_4G) { 988 - if (cck_index > CCK_TABLE_SIZE - 1) { 989 - cck_index = CCK_TABLE_SIZE - 1; 990 - } else if (internal_pa || 991 - rtlhal->current_bandtype == 992 - BAND_ON_2_4G) { 993 - if (ofdm_index[i] < 994 - ofdm_min_index_internal_pa) 995 - ofdm_index[i] = 996 - ofdm_min_index_internal_pa; 997 - } else if (cck_index < 0) { 998 - cck_index = 0; 999 - } 1000 - } 1001 - if (is2t) { 1002 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1003 - "new OFDM_A_index=0x%x, OFDM_B_index = 0x%x, cck_index=0x%x\n", 1004 - ofdm_index[0], ofdm_index[1], 1005 - cck_index); 1006 - } else { 1007 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1008 - "new OFDM_A_index=0x%x,cck_index = 0x%x\n", 1009 - ofdm_index[0], cck_index); 1010 - } 1011 - ele_d = (ofdmswing_table[(u8) ofdm_index[0]] & 1012 - 0xFFC00000) >> 22; 1013 - val_x = rtlphy->iqk_matrix 1014 - [indexforchannel].value[0][0]; 1015 - val_y = rtlphy->iqk_matrix 1016 - [indexforchannel].value[0][1]; 1017 - if (val_x != 0) { 1018 - if ((val_x & 0x00000200) != 0) 1019 - val_x = val_x | 0xFFFFFC00; 1020 - ele_a = 1021 - ((val_x * ele_d) >> 8) & 0x000003FF; 1022 - 1023 - /* new element C = element D x Y */ 1024 - if ((val_y & 0x00000200) != 0) 1025 - val_y = val_y | 0xFFFFFC00; 1026 - ele_c = ((val_y * ele_d) >> 8) & 0x000003FF; 1027 - 1028 - /* wirte new elements A, C, D to regC80 and 1029 - * regC94, element B is always 0 */ 1030 - value32 = (ele_d << 22) | ((ele_c & 0x3F) << 1031 - 16) | ele_a; 1032 - rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 1033 - MASKDWORD, value32); 1034 - 1035 - value32 = (ele_c & 0x000003C0) >> 6; 1036 - rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, 1037 - value32); 1038 - 1039 - value32 = ((val_x * ele_d) >> 7) & 0x01; 1040 - rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(24), 1041 - value32); 1042 - 1043 - } else { 1044 - rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 1045 - MASKDWORD, 1046 - ofdmswing_table 1047 - [(u8)ofdm_index[0]]); 1048 - rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, 1049 - 0x00); 1050 - rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1051 - BIT(24), 0x00); 1052 - } 1053 - 1054 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1055 - "TxPwrTracking for interface %d path A: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xe94 = 0x%lx 0xe9c = 0x%lx\n", 1056 - rtlhal->interfaceindex, 1057 - val_x, val_y, ele_a, ele_c, ele_d, 1058 - val_x, val_y); 1059 - 1060 - if (cck_index >= CCK_TABLE_SIZE) 1061 - cck_index = CCK_TABLE_SIZE - 1; 1062 - if (cck_index < 0) 1063 - cck_index = 0; 1064 - if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1065 - /* Adjust CCK according to IQK result */ 1066 - if (!rtlpriv->dm.cck_inch14) { 1067 - rtl_write_byte(rtlpriv, 0xa22, 1068 - cckswing_table_ch1ch13 1069 - [(u8)cck_index][0]); 1070 - rtl_write_byte(rtlpriv, 0xa23, 1071 - cckswing_table_ch1ch13 1072 - [(u8)cck_index][1]); 1073 - rtl_write_byte(rtlpriv, 0xa24, 1074 - cckswing_table_ch1ch13 1075 - [(u8)cck_index][2]); 1076 - rtl_write_byte(rtlpriv, 0xa25, 1077 - cckswing_table_ch1ch13 1078 - [(u8)cck_index][3]); 1079 - rtl_write_byte(rtlpriv, 0xa26, 1080 - cckswing_table_ch1ch13 1081 - [(u8)cck_index][4]); 1082 - rtl_write_byte(rtlpriv, 0xa27, 1083 - cckswing_table_ch1ch13 1084 - [(u8)cck_index][5]); 1085 - rtl_write_byte(rtlpriv, 0xa28, 1086 - cckswing_table_ch1ch13 1087 - [(u8)cck_index][6]); 1088 - rtl_write_byte(rtlpriv, 0xa29, 1089 - cckswing_table_ch1ch13 1090 - [(u8)cck_index][7]); 1091 - } else { 1092 - rtl_write_byte(rtlpriv, 0xa22, 1093 - cckswing_table_ch14 1094 - [(u8)cck_index][0]); 1095 - rtl_write_byte(rtlpriv, 0xa23, 1096 - cckswing_table_ch14 1097 - [(u8)cck_index][1]); 1098 - rtl_write_byte(rtlpriv, 0xa24, 1099 - cckswing_table_ch14 1100 - [(u8)cck_index][2]); 1101 - rtl_write_byte(rtlpriv, 0xa25, 1102 - cckswing_table_ch14 1103 - [(u8)cck_index][3]); 1104 - rtl_write_byte(rtlpriv, 0xa26, 1105 - cckswing_table_ch14 1106 - [(u8)cck_index][4]); 1107 - rtl_write_byte(rtlpriv, 0xa27, 1108 - cckswing_table_ch14 1109 - [(u8)cck_index][5]); 1110 - rtl_write_byte(rtlpriv, 0xa28, 1111 - cckswing_table_ch14 1112 - [(u8)cck_index][6]); 1113 - rtl_write_byte(rtlpriv, 0xa29, 1114 - cckswing_table_ch14 1115 - [(u8)cck_index][7]); 1116 - } 1117 - } 1118 - if (is2t) { 1119 - ele_d = (ofdmswing_table[(u8) ofdm_index[1]] & 1120 - 0xFFC00000) >> 22; 1121 - val_x = rtlphy->iqk_matrix 1122 - [indexforchannel].value[0][4]; 1123 - val_y = rtlphy->iqk_matrix 1124 - [indexforchannel].value[0][5]; 1125 - if (val_x != 0) { 1126 - if ((val_x & 0x00000200) != 0) 1127 - /* consider minus */ 1128 - val_x = val_x | 0xFFFFFC00; 1129 - ele_a = ((val_x * ele_d) >> 8) & 1130 - 0x000003FF; 1131 - /* new element C = element D x Y */ 1132 - if ((val_y & 0x00000200) != 0) 1133 - val_y = 1134 - val_y | 0xFFFFFC00; 1135 - ele_c = 1136 - ((val_y * 1137 - ele_d) >> 8) & 0x00003FF; 1138 - /* write new elements A, C, D to regC88 1139 - * and regC9C, element B is always 0 1140 - */ 1141 - value32 = (ele_d << 22) | 1142 - ((ele_c & 0x3F) << 16) | 1143 - ele_a; 1144 - rtl_set_bbreg(hw, 1145 - ROFDM0_XBTXIQIMBALANCE, 1146 - MASKDWORD, value32); 1147 - value32 = (ele_c & 0x000003C0) >> 6; 1148 - rtl_set_bbreg(hw, ROFDM0_XDTXAFE, 1149 - MASKH4BITS, value32); 1150 - value32 = ((val_x * ele_d) >> 7) & 0x01; 1151 - rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1152 - BIT(28), value32); 1153 - } else { 1154 - rtl_set_bbreg(hw, 1155 - ROFDM0_XBTXIQIMBALANCE, 1156 - MASKDWORD, 1157 - ofdmswing_table 1158 - [(u8) ofdm_index[1]]); 1159 - rtl_set_bbreg(hw, ROFDM0_XDTXAFE, 1160 - MASKH4BITS, 0x00); 1161 - rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1162 - BIT(28), 0x00); 1163 - } 1164 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1165 - "TxPwrTracking path B: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xeb4 = 0x%lx 0xebc = 0x%lx\n", 1166 - val_x, val_y, ele_a, ele_c, 1167 - ele_d, val_x, val_y); 1168 - } 1169 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1170 - "TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n", 1171 - rtl_get_bbreg(hw, 0xc80, MASKDWORD), 1172 - rtl_get_bbreg(hw, 0xc94, MASKDWORD), 1173 - rtl_get_rfreg(hw, RF90_PATH_A, 0x24, 1174 - RFREG_OFFSET_MASK)); 1175 - } 1176 - if ((delta_iqk > rtlefuse->delta_iqk) && 1177 - (rtlefuse->delta_iqk != 0)) { 1178 - rtl92d_phy_reset_iqk_result(hw); 1179 - rtlpriv->dm.thermalvalue_iqk = thermalvalue; 1180 - rtl92d_phy_iq_calibrate(hw); 1181 - } 1182 - if (delta_rxgain > 0 && rtlhal->current_bandtype == BAND_ON_5G 1183 - && thermalvalue <= rtlefuse->eeprom_thermalmeter) { 1184 - rtlpriv->dm.thermalvalue_rxgain = thermalvalue; 1185 - rtl92d_dm_rxgain_tracking_thermalmeter(hw); 1186 - } 1187 - if (rtlpriv->dm.txpower_track_control) 1188 - rtlpriv->dm.thermalvalue = thermalvalue; 879 + } 880 + if (rtlhal->current_bandtype == BAND_ON_2_4G) { 881 + rtl92d_bandtype_2_4G(hw, &temp_cck, &cck_index_old); 882 + } else { 883 + temp_cck = 0x090e1317; 884 + cck_index_old = 12; 1189 885 } 1190 886 887 + if (!rtlpriv->dm.thermalvalue) { 888 + rtlpriv->dm.thermalvalue = rtlefuse->eeprom_thermalmeter; 889 + rtlpriv->dm.thermalvalue_lck = thermalvalue; 890 + rtlpriv->dm.thermalvalue_iqk = thermalvalue; 891 + rtlpriv->dm.thermalvalue_rxgain = rtlefuse->eeprom_thermalmeter; 892 + for (i = 0; i < rf; i++) 893 + rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i]; 894 + rtlpriv->dm.cck_index = cck_index_old; 895 + } 896 + if (rtlhal->reloadtxpowerindex) { 897 + for (i = 0; i < rf; i++) 898 + rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i]; 899 + rtlpriv->dm.cck_index = cck_index_old; 900 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 901 + "reload ofdm index for band switch\n"); 902 + } 903 + old_index_done: 904 + for (i = 0; i < rf; i++) 905 + ofdm_index[i] = rtlpriv->dm.ofdm_index[i]; 906 + 907 + rtlpriv->dm.thermalvalue_avg 908 + [rtlpriv->dm.thermalvalue_avg_index] = thermalvalue; 909 + rtlpriv->dm.thermalvalue_avg_index++; 910 + if (rtlpriv->dm.thermalvalue_avg_index == AVG_THERMAL_NUM) 911 + rtlpriv->dm.thermalvalue_avg_index = 0; 912 + for (i = 0; i < AVG_THERMAL_NUM; i++) { 913 + if (rtlpriv->dm.thermalvalue_avg[i]) { 914 + thermalvalue_avg += rtlpriv->dm.thermalvalue_avg[i]; 915 + thermalvalue_avg_count++; 916 + } 917 + } 918 + if (thermalvalue_avg_count) 919 + thermalvalue = (u8)(thermalvalue_avg / thermalvalue_avg_count); 920 + if (rtlhal->reloadtxpowerindex) { 921 + delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 922 + (thermalvalue - rtlefuse->eeprom_thermalmeter) : 923 + (rtlefuse->eeprom_thermalmeter - thermalvalue); 924 + rtlhal->reloadtxpowerindex = false; 925 + rtlpriv->dm.done_txpower = false; 926 + } else if (rtlpriv->dm.done_txpower) { 927 + delta = (thermalvalue > rtlpriv->dm.thermalvalue) ? 928 + (thermalvalue - rtlpriv->dm.thermalvalue) : 929 + (rtlpriv->dm.thermalvalue - thermalvalue); 930 + } else { 931 + delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 932 + (thermalvalue - rtlefuse->eeprom_thermalmeter) : 933 + (rtlefuse->eeprom_thermalmeter - thermalvalue); 934 + } 935 + delta_lck = (thermalvalue > rtlpriv->dm.thermalvalue_lck) ? 936 + (thermalvalue - rtlpriv->dm.thermalvalue_lck) : 937 + (rtlpriv->dm.thermalvalue_lck - thermalvalue); 938 + delta_iqk = (thermalvalue > rtlpriv->dm.thermalvalue_iqk) ? 939 + (thermalvalue - rtlpriv->dm.thermalvalue_iqk) : 940 + (rtlpriv->dm.thermalvalue_iqk - thermalvalue); 941 + delta_rxgain = 942 + (thermalvalue > rtlpriv->dm.thermalvalue_rxgain) ? 943 + (thermalvalue - rtlpriv->dm.thermalvalue_rxgain) : 944 + (rtlpriv->dm.thermalvalue_rxgain - thermalvalue); 945 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 946 + "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x delta 0x%x delta_lck 0x%x delta_iqk 0x%x\n", 947 + thermalvalue, rtlpriv->dm.thermalvalue, 948 + rtlefuse->eeprom_thermalmeter, delta, delta_lck, 949 + delta_iqk); 950 + if (delta_lck > rtlefuse->delta_lck && rtlefuse->delta_lck != 0) { 951 + rtlpriv->dm.thermalvalue_lck = thermalvalue; 952 + rtl92d_phy_lc_calibrate(hw); 953 + } 954 + 955 + if (delta == 0 || !rtlpriv->dm.txpower_track_control) 956 + goto check_delta; 957 + 958 + rtlpriv->dm.done_txpower = true; 959 + delta = (thermalvalue > rtlefuse->eeprom_thermalmeter) ? 960 + (thermalvalue - rtlefuse->eeprom_thermalmeter) : 961 + (rtlefuse->eeprom_thermalmeter - thermalvalue); 962 + if (rtlhal->current_bandtype == BAND_ON_2_4G) { 963 + offset = 4; 964 + if (delta > INDEX_MAPPING_NUM - 1) 965 + index = index_mapping[offset][INDEX_MAPPING_NUM - 1]; 966 + else 967 + index = index_mapping[offset][delta]; 968 + if (thermalvalue > rtlpriv->dm.thermalvalue) { 969 + for (i = 0; i < rf; i++) 970 + ofdm_index[i] -= delta; 971 + cck_index -= delta; 972 + } else { 973 + for (i = 0; i < rf; i++) 974 + ofdm_index[i] += index; 975 + cck_index += index; 976 + } 977 + } else if (rtlhal->current_bandtype == BAND_ON_5G) { 978 + rtl92d_bandtype_5G(rtlhal, ofdm_index, 979 + &internal_pa, thermalvalue, 980 + delta, rf, rtlefuse, rtlpriv, 981 + rtlphy, index_mapping, 982 + index_mapping_internal_pa); 983 + } 984 + if (is2t) { 985 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 986 + "temp OFDM_A_index=0x%x, OFDM_B_index = 0x%x,cck_index=0x%x\n", 987 + rtlpriv->dm.ofdm_index[0], 988 + rtlpriv->dm.ofdm_index[1], 989 + rtlpriv->dm.cck_index); 990 + } else { 991 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 992 + "temp OFDM_A_index=0x%x,cck_index = 0x%x\n", 993 + rtlpriv->dm.ofdm_index[0], 994 + rtlpriv->dm.cck_index); 995 + } 996 + for (i = 0; i < rf; i++) { 997 + if (ofdm_index[i] > OFDM_TABLE_SIZE_92D - 1) 998 + ofdm_index[i] = OFDM_TABLE_SIZE_92D - 1; 999 + else if (ofdm_index[i] < ofdm_min_index) 1000 + ofdm_index[i] = ofdm_min_index; 1001 + } 1002 + if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1003 + if (cck_index > CCK_TABLE_SIZE - 1) { 1004 + cck_index = CCK_TABLE_SIZE - 1; 1005 + } else if (internal_pa || 1006 + rtlhal->current_bandtype == BAND_ON_2_4G) { 1007 + if (ofdm_index[i] < ofdm_min_index_internal_pa) 1008 + ofdm_index[i] = ofdm_min_index_internal_pa; 1009 + } else if (cck_index < 0) { 1010 + cck_index = 0; 1011 + } 1012 + } 1013 + if (is2t) { 1014 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1015 + "new OFDM_A_index=0x%x, OFDM_B_index = 0x%x, cck_index=0x%x\n", 1016 + ofdm_index[0], ofdm_index[1], 1017 + cck_index); 1018 + } else { 1019 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1020 + "new OFDM_A_index=0x%x,cck_index = 0x%x\n", 1021 + ofdm_index[0], cck_index); 1022 + } 1023 + ele_d = (ofdmswing_table[ofdm_index[0]] & 0xFFC00000) >> 22; 1024 + val_x = rtlphy->iqk_matrix[indexforchannel].value[0][0]; 1025 + val_y = rtlphy->iqk_matrix[indexforchannel].value[0][1]; 1026 + if (val_x != 0) { 1027 + if ((val_x & 0x00000200) != 0) 1028 + val_x = val_x | 0xFFFFFC00; 1029 + ele_a = ((val_x * ele_d) >> 8) & 0x000003FF; 1030 + 1031 + /* new element C = element D x Y */ 1032 + if ((val_y & 0x00000200) != 0) 1033 + val_y = val_y | 0xFFFFFC00; 1034 + ele_c = ((val_y * ele_d) >> 8) & 0x000003FF; 1035 + 1036 + /* write new elements A, C, D to regC80 and 1037 + * regC94, element B is always 0 1038 + */ 1039 + value32 = (ele_d << 22) | ((ele_c & 0x3F) << 16) | ele_a; 1040 + rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 1041 + MASKDWORD, value32); 1042 + 1043 + value32 = (ele_c & 0x000003C0) >> 6; 1044 + rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, 1045 + value32); 1046 + 1047 + value32 = ((val_x * ele_d) >> 7) & 0x01; 1048 + rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(24), 1049 + value32); 1050 + 1051 + } else { 1052 + rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 1053 + MASKDWORD, 1054 + ofdmswing_table[(u8)ofdm_index[0]]); 1055 + rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, 1056 + 0x00); 1057 + rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1058 + BIT(24), 0x00); 1059 + } 1060 + 1061 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1062 + "TxPwrTracking for interface %d path A: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xe94 = 0x%lx 0xe9c = 0x%lx\n", 1063 + rtlhal->interfaceindex, 1064 + val_x, val_y, ele_a, ele_c, ele_d, 1065 + val_x, val_y); 1066 + 1067 + if (cck_index >= CCK_TABLE_SIZE) 1068 + cck_index = CCK_TABLE_SIZE - 1; 1069 + if (cck_index < 0) 1070 + cck_index = 0; 1071 + if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1072 + /* Adjust CCK according to IQK result */ 1073 + if (!rtlpriv->dm.cck_inch14) { 1074 + rtl_write_byte(rtlpriv, 0xa22, 1075 + cckswing_table_ch1ch13[cck_index][0]); 1076 + rtl_write_byte(rtlpriv, 0xa23, 1077 + cckswing_table_ch1ch13[cck_index][1]); 1078 + rtl_write_byte(rtlpriv, 0xa24, 1079 + cckswing_table_ch1ch13[cck_index][2]); 1080 + rtl_write_byte(rtlpriv, 0xa25, 1081 + cckswing_table_ch1ch13[cck_index][3]); 1082 + rtl_write_byte(rtlpriv, 0xa26, 1083 + cckswing_table_ch1ch13[cck_index][4]); 1084 + rtl_write_byte(rtlpriv, 0xa27, 1085 + cckswing_table_ch1ch13[cck_index][5]); 1086 + rtl_write_byte(rtlpriv, 0xa28, 1087 + cckswing_table_ch1ch13[cck_index][6]); 1088 + rtl_write_byte(rtlpriv, 0xa29, 1089 + cckswing_table_ch1ch13[cck_index][7]); 1090 + } else { 1091 + rtl_write_byte(rtlpriv, 0xa22, 1092 + cckswing_table_ch14[cck_index][0]); 1093 + rtl_write_byte(rtlpriv, 0xa23, 1094 + cckswing_table_ch14[cck_index][1]); 1095 + rtl_write_byte(rtlpriv, 0xa24, 1096 + cckswing_table_ch14[cck_index][2]); 1097 + rtl_write_byte(rtlpriv, 0xa25, 1098 + cckswing_table_ch14[cck_index][3]); 1099 + rtl_write_byte(rtlpriv, 0xa26, 1100 + cckswing_table_ch14[cck_index][4]); 1101 + rtl_write_byte(rtlpriv, 0xa27, 1102 + cckswing_table_ch14[cck_index][5]); 1103 + rtl_write_byte(rtlpriv, 0xa28, 1104 + cckswing_table_ch14[cck_index][6]); 1105 + rtl_write_byte(rtlpriv, 0xa29, 1106 + cckswing_table_ch14[cck_index][7]); 1107 + } 1108 + } 1109 + if (is2t) { 1110 + ele_d = (ofdmswing_table[ofdm_index[1]] & 0xFFC00000) >> 22; 1111 + val_x = rtlphy->iqk_matrix[indexforchannel].value[0][4]; 1112 + val_y = rtlphy->iqk_matrix[indexforchannel].value[0][5]; 1113 + if (val_x != 0) { 1114 + if ((val_x & 0x00000200) != 0) 1115 + /* consider minus */ 1116 + val_x = val_x | 0xFFFFFC00; 1117 + ele_a = ((val_x * ele_d) >> 8) & 0x000003FF; 1118 + /* new element C = element D x Y */ 1119 + if ((val_y & 0x00000200) != 0) 1120 + val_y = val_y | 0xFFFFFC00; 1121 + ele_c = ((val_y * ele_d) >> 8) & 0x00003FF; 1122 + /* write new elements A, C, D to regC88 1123 + * and regC9C, element B is always 0 1124 + */ 1125 + value32 = (ele_d << 22) | ((ele_c & 0x3F) << 16) | ele_a; 1126 + rtl_set_bbreg(hw, 1127 + ROFDM0_XBTXIQIMBALANCE, 1128 + MASKDWORD, value32); 1129 + value32 = (ele_c & 0x000003C0) >> 6; 1130 + rtl_set_bbreg(hw, ROFDM0_XDTXAFE, 1131 + MASKH4BITS, value32); 1132 + value32 = ((val_x * ele_d) >> 7) & 0x01; 1133 + rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1134 + BIT(28), value32); 1135 + } else { 1136 + rtl_set_bbreg(hw, 1137 + ROFDM0_XBTXIQIMBALANCE, 1138 + MASKDWORD, 1139 + ofdmswing_table[ofdm_index[1]]); 1140 + rtl_set_bbreg(hw, ROFDM0_XDTXAFE, 1141 + MASKH4BITS, 0x00); 1142 + rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, 1143 + BIT(28), 0x00); 1144 + } 1145 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1146 + "TxPwrTracking path B: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xeb4 = 0x%lx 0xebc = 0x%lx\n", 1147 + val_x, val_y, ele_a, ele_c, 1148 + ele_d, val_x, val_y); 1149 + } 1150 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1151 + "TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n", 1152 + rtl_get_bbreg(hw, 0xc80, MASKDWORD), 1153 + rtl_get_bbreg(hw, 0xc94, MASKDWORD), 1154 + rtl_get_rfreg(hw, RF90_PATH_A, 0x24, 1155 + RFREG_OFFSET_MASK)); 1156 + 1157 + check_delta: 1158 + if (delta_iqk > rtlefuse->delta_iqk && rtlefuse->delta_iqk != 0) { 1159 + rtl92d_phy_reset_iqk_result(hw); 1160 + rtlpriv->dm.thermalvalue_iqk = thermalvalue; 1161 + rtl92d_phy_iq_calibrate(hw); 1162 + } 1163 + if (delta_rxgain > 0 && rtlhal->current_bandtype == BAND_ON_5G && 1164 + thermalvalue <= rtlefuse->eeprom_thermalmeter) { 1165 + rtlpriv->dm.thermalvalue_rxgain = thermalvalue; 1166 + rtl92d_dm_rxgain_tracking_thermalmeter(hw); 1167 + } 1168 + if (rtlpriv->dm.txpower_track_control) 1169 + rtlpriv->dm.thermalvalue = thermalvalue; 1170 + 1171 + exit: 1191 1172 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===\n"); 1192 1173 } 1193 1174
+3 -5
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
··· 655 655 u8 h2c_parameter[4] = { 0 }; 656 656 long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff; 657 657 u8 stbc_tx = 0; 658 - u64 cur_txokcnt = 0, cur_rxokcnt = 0; 658 + u64 cur_rxokcnt = 0; 659 659 static u64 last_txokcnt = 0, last_rxokcnt; 660 660 661 - cur_txokcnt = rtlpriv->stats.txbytesunicast - last_txokcnt; 662 661 cur_rxokcnt = rtlpriv->stats.rxbytesunicast - last_rxokcnt; 663 662 last_txokcnt = rtlpriv->stats.txbytesunicast; 664 663 last_rxokcnt = rtlpriv->stats.rxbytesunicast; ··· 2653 2654 u32 edca_be = 0x5ea42b; 2654 2655 u8 iot_peer = 0; 2655 2656 bool *pb_is_cur_rdl_state = NULL; 2656 - bool b_last_is_cur_rdl_state = false; 2657 2657 bool b_bias_on_rx = false; 2658 2658 bool b_edca_turbo_on = false; 2659 2659 ··· 2670 2672 * list paramter for different platform 2671 2673 *=============================== 2672 2674 */ 2673 - b_last_is_cur_rdl_state = rtlpriv->dm.is_cur_rdlstate; 2674 2675 pb_is_cur_rdl_state = &rtlpriv->dm.is_cur_rdlstate; 2675 2676 2676 2677 cur_tx_ok_cnt = rtlpriv->stats.txbytesunicast - rtldm->last_tx_ok_cnt; ··· 2955 2958 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 2956 2959 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); 2957 2960 struct fast_ant_training *pfat_table = &rtldm->fat_table; 2961 + __le32 *pdesc32 = (__le32 *)pdesc; 2958 2962 2959 2963 if (rtlhal->hw_type != HARDWARE_TYPE_RTL8812AE) 2960 2964 return; 2961 2965 2962 2966 if (rtlefuse->antenna_div_type == CG_TRX_HW_ANTDIV) 2963 - SET_TX_DESC_TX_ANT(pdesc, pfat_table->antsel_a[mac_id]); 2967 + set_tx_desc_tx_ant(pdesc32, pfat_table->antsel_a[mac_id]); 2964 2968 }
+130 -123
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
··· 56 56 } 57 57 58 58 static void query_rxphystatus(struct ieee80211_hw *hw, 59 - struct rtl_stats *pstatus, u8 *pdesc, 59 + struct rtl_stats *pstatus, __le32 *pdesc, 60 60 struct rx_fwinfo_8821ae *p_drvinfo, 61 61 bool bpacket_match_bssid, 62 62 bool bpacket_toself, bool packet_beacon) ··· 274 274 275 275 static void translate_rx_signal_stuff(struct ieee80211_hw *hw, 276 276 struct sk_buff *skb, 277 - struct rtl_stats *pstatus, u8 *pdesc, 277 + struct rtl_stats *pstatus, __le32 *pdesc, 278 278 struct rx_fwinfo_8821ae *p_drvinfo) 279 279 { 280 280 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); ··· 332 332 rtl_process_phyinfo(hw, tmp_buf, pstatus); 333 333 } 334 334 335 - static void _rtl8821ae_insert_emcontent(struct rtl_tcb_desc *ptcb_desc, 336 - u8 *virtualaddress) 335 + static void rtl8821ae_insert_emcontent(struct rtl_tcb_desc *ptcb_desc, 336 + __le32 *virtualaddress) 337 337 { 338 338 u32 dwtmp = 0; 339 339 340 340 memset(virtualaddress, 0, 8); 341 341 342 - SET_EARLYMODE_PKTNUM(virtualaddress, ptcb_desc->empkt_num); 342 + set_earlymode_pktnum(virtualaddress, ptcb_desc->empkt_num); 343 343 if (ptcb_desc->empkt_num == 1) { 344 344 dwtmp = ptcb_desc->empkt_len[0]; 345 345 } else { ··· 347 347 dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; 348 348 dwtmp += ptcb_desc->empkt_len[1]; 349 349 } 350 - SET_EARLYMODE_LEN0(virtualaddress, dwtmp); 350 + set_earlymode_len0(virtualaddress, dwtmp); 351 351 352 352 if (ptcb_desc->empkt_num <= 3) { 353 353 dwtmp = ptcb_desc->empkt_len[2]; ··· 356 356 dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; 357 357 dwtmp += ptcb_desc->empkt_len[3]; 358 358 } 359 - SET_EARLYMODE_LEN1(virtualaddress, dwtmp); 359 + set_earlymode_len1(virtualaddress, dwtmp); 360 360 if (ptcb_desc->empkt_num <= 5) { 361 361 dwtmp = ptcb_desc->empkt_len[4]; 362 362 } else { ··· 364 364 dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; 365 365 dwtmp += ptcb_desc->empkt_len[5]; 366 366 } 367 - SET_EARLYMODE_LEN2_1(virtualaddress, dwtmp & 0xF); 368 - SET_EARLYMODE_LEN2_2(virtualaddress, dwtmp >> 4); 367 + set_earlymode_len2_1(virtualaddress, dwtmp & 0xF); 368 + set_earlymode_len2_2(virtualaddress, dwtmp >> 4); 369 369 if (ptcb_desc->empkt_num <= 7) { 370 370 dwtmp = ptcb_desc->empkt_len[6]; 371 371 } else { ··· 373 373 dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; 374 374 dwtmp += ptcb_desc->empkt_len[7]; 375 375 } 376 - SET_EARLYMODE_LEN3(virtualaddress, dwtmp); 376 + set_earlymode_len3(virtualaddress, dwtmp); 377 377 if (ptcb_desc->empkt_num <= 9) { 378 378 dwtmp = ptcb_desc->empkt_len[8]; 379 379 } else { ··· 381 381 dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; 382 382 dwtmp += ptcb_desc->empkt_len[9]; 383 383 } 384 - SET_EARLYMODE_LEN4(virtualaddress, dwtmp); 384 + set_earlymode_len4(virtualaddress, dwtmp); 385 385 } 386 386 387 - static bool rtl8821ae_get_rxdesc_is_ht(struct ieee80211_hw *hw, u8 *pdesc) 387 + static bool rtl8821ae_get_rxdesc_is_ht(struct ieee80211_hw *hw, __le32 *pdesc) 388 388 { 389 389 struct rtl_priv *rtlpriv = rtl_priv(hw); 390 390 u8 rx_rate = 0; 391 391 392 - rx_rate = GET_RX_DESC_RXMCS(pdesc); 392 + rx_rate = get_rx_desc_rxmcs(pdesc); 393 393 394 394 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); 395 395 ··· 398 398 return false; 399 399 } 400 400 401 - static bool rtl8821ae_get_rxdesc_is_vht(struct ieee80211_hw *hw, u8 *pdesc) 401 + static bool rtl8821ae_get_rxdesc_is_vht(struct ieee80211_hw *hw, __le32 *pdesc) 402 402 { 403 403 struct rtl_priv *rtlpriv = rtl_priv(hw); 404 404 u8 rx_rate = 0; 405 405 406 - rx_rate = GET_RX_DESC_RXMCS(pdesc); 406 + rx_rate = get_rx_desc_rxmcs(pdesc); 407 407 408 408 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); 409 409 ··· 412 412 return false; 413 413 } 414 414 415 - static u8 rtl8821ae_get_rx_vht_nss(struct ieee80211_hw *hw, u8 *pdesc) 415 + static u8 rtl8821ae_get_rx_vht_nss(struct ieee80211_hw *hw, __le32 *pdesc) 416 416 { 417 417 u8 rx_rate = 0; 418 418 u8 vht_nss = 0; 419 419 420 - rx_rate = GET_RX_DESC_RXMCS(pdesc); 420 + rx_rate = get_rx_desc_rxmcs(pdesc); 421 421 if ((rx_rate >= DESC_RATEVHT1SS_MCS0) && 422 422 (rx_rate <= DESC_RATEVHT1SS_MCS9)) 423 423 vht_nss = 1; ··· 431 431 bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, 432 432 struct rtl_stats *status, 433 433 struct ieee80211_rx_status *rx_status, 434 - u8 *pdesc, struct sk_buff *skb) 434 + u8 *pdesc8, struct sk_buff *skb) 435 435 { 436 436 struct rtl_priv *rtlpriv = rtl_priv(hw); 437 437 struct rx_fwinfo_8821ae *p_drvinfo; 438 438 struct ieee80211_hdr *hdr; 439 439 u8 wake_match; 440 - u32 phystatus = GET_RX_DESC_PHYST(pdesc); 440 + __le32 *pdesc = (__le32 *)pdesc8; 441 + u32 phystatus = get_rx_desc_physt(pdesc); 441 442 442 - status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc); 443 - status->rx_drvinfo_size = (u8)GET_RX_DESC_DRV_INFO_SIZE(pdesc) * 443 + status->length = (u16)get_rx_desc_pkt_len(pdesc); 444 + status->rx_drvinfo_size = (u8)get_rx_desc_drv_info_size(pdesc) * 444 445 RX_DRV_INFO_SIZE_UNIT; 445 - status->rx_bufshift = (u8)(GET_RX_DESC_SHIFT(pdesc) & 0x03); 446 - status->icv = (u16)GET_RX_DESC_ICV(pdesc); 447 - status->crc = (u16)GET_RX_DESC_CRC32(pdesc); 446 + status->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03); 447 + status->icv = (u16)get_rx_desc_icv(pdesc); 448 + status->crc = (u16)get_rx_desc_crc32(pdesc); 448 449 status->hwerror = (status->crc | status->icv); 449 - status->decrypted = !GET_RX_DESC_SWDEC(pdesc); 450 - status->rate = (u8)GET_RX_DESC_RXMCS(pdesc); 451 - status->shortpreamble = (u16)GET_RX_DESC_SPLCP(pdesc); 452 - status->isampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1); 453 - status->isfirst_ampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1); 454 - status->timestamp_low = GET_RX_DESC_TSFL(pdesc); 455 - status->rx_packet_bw = GET_RX_DESC_BW(pdesc); 456 - status->macid = GET_RX_DESC_MACID(pdesc); 457 - status->is_short_gi = !(bool)GET_RX_DESC_SPLCP(pdesc); 450 + status->decrypted = !get_rx_desc_swdec(pdesc); 451 + status->rate = (u8)get_rx_desc_rxmcs(pdesc); 452 + status->shortpreamble = (u16)get_rx_desc_splcp(pdesc); 453 + status->isampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); 454 + status->isfirst_ampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); 455 + status->timestamp_low = get_rx_desc_tsfl(pdesc); 456 + status->rx_packet_bw = get_rx_desc_bw(pdesc); 457 + status->macid = get_rx_desc_macid(pdesc); 458 + status->is_short_gi = !(bool)get_rx_desc_splcp(pdesc); 458 459 status->is_ht = rtl8821ae_get_rxdesc_is_ht(hw, pdesc); 459 460 status->is_vht = rtl8821ae_get_rxdesc_is_vht(hw, pdesc); 460 461 status->vht_nss = rtl8821ae_get_rx_vht_nss(hw, pdesc); ··· 468 467 status->is_ht, status->is_vht, status->vht_nss, 469 468 status->is_short_gi); 470 469 471 - if (GET_RX_STATUS_DESC_RPT_SEL(pdesc)) 470 + if (get_rx_status_desc_rpt_sel(pdesc)) 472 471 status->packet_report_type = C2H_PACKET; 473 472 else 474 473 status->packet_report_type = NORMAL_RX; 475 474 476 - if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) 475 + if (get_rx_status_desc_pattern_match(pdesc)) 477 476 wake_match = BIT(2); 478 - else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 477 + else if (get_rx_status_desc_magic_match(pdesc)) 479 478 wake_match = BIT(1); 480 - else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) 479 + else if (get_rx_status_desc_unicast_match(pdesc)) 481 480 wake_match = BIT(0); 482 481 else 483 482 wake_match = 0; ··· 544 543 rx_status->signal = status->recvsignalpower + 10; 545 544 if (status->packet_report_type == TX_REPORT2) { 546 545 status->macid_valid_entry[0] = 547 - GET_RX_RPT2_DESC_MACID_VALID_1(pdesc); 546 + get_rx_rpt2_desc_macid_valid_1(pdesc); 548 547 status->macid_valid_entry[1] = 549 - GET_RX_RPT2_DESC_MACID_VALID_2(pdesc); 548 + get_rx_rpt2_desc_macid_valid_2(pdesc); 550 549 } 551 550 return true; 552 551 } ··· 657 656 } 658 657 659 658 void rtl8821ae_tx_fill_desc(struct ieee80211_hw *hw, 660 - struct ieee80211_hdr *hdr, u8 *pdesc_tx, u8 *txbd, 659 + struct ieee80211_hdr *hdr, u8 *pdesc8, u8 *txbd, 661 660 struct ieee80211_tx_info *info, 662 661 struct ieee80211_sta *sta, 663 662 struct sk_buff *skb, ··· 668 667 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 669 668 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); 670 669 struct rtlwifi_tx_info *tx_info = rtl_tx_skb_cb_info(skb); 671 - u8 *pdesc = (u8 *)pdesc_tx; 672 670 u16 seq_number; 673 671 __le16 fc = hdr->frame_control; 674 672 unsigned int buf_len = 0; ··· 679 679 cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0); 680 680 dma_addr_t mapping; 681 681 u8 short_gi = 0; 682 + bool tmp_bool; 683 + __le32 *pdesc = (__le32 *)pdesc8; 682 684 683 685 seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; 684 686 rtl_get_tcb_desc(hw, info, sta, skb, ptcb_desc); ··· 697 695 "DMA mapping error\n"); 698 696 return; 699 697 } 700 - CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_8821ae)); 698 + clear_pci_tx_desc_content(pdesc, sizeof(struct tx_desc_8821ae)); 701 699 if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) { 702 700 firstseg = true; 703 701 lastseg = true; 704 702 } 705 703 if (firstseg) { 706 704 if (rtlhal->earlymode_enable) { 707 - SET_TX_DESC_PKT_OFFSET(pdesc, 1); 708 - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN + 705 + set_tx_desc_pkt_offset(pdesc, 1); 706 + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN + 709 707 EM_HDR_LEN); 710 708 if (ptcb_desc->empkt_num) { 711 709 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 712 710 "Insert 8 byte.pTcb->EMPktNum:%d\n", 713 711 ptcb_desc->empkt_num); 714 - _rtl8821ae_insert_emcontent(ptcb_desc, 715 - (u8 *)(skb->data)); 712 + rtl8821ae_insert_emcontent(ptcb_desc, 713 + (__le32 *)skb->data); 716 714 } 717 715 } else { 718 - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); 716 + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN); 719 717 } 720 718 721 719 722 720 /* ptcb_desc->use_driver_rate = true; */ 723 - SET_TX_DESC_TX_RATE(pdesc, ptcb_desc->hw_rate); 721 + set_tx_desc_tx_rate(pdesc, ptcb_desc->hw_rate); 724 722 if (ptcb_desc->hw_rate > DESC_RATEMCS0) 725 723 short_gi = (ptcb_desc->use_shortgi) ? 1 : 0; 726 724 else 727 725 short_gi = (ptcb_desc->use_shortpreamble) ? 1 : 0; 728 726 729 - SET_TX_DESC_DATA_SHORTGI(pdesc, short_gi); 727 + set_tx_desc_data_shortgi(pdesc, short_gi); 730 728 731 729 if (info->flags & IEEE80211_TX_CTL_AMPDU) { 732 - SET_TX_DESC_AGG_ENABLE(pdesc, 1); 733 - SET_TX_DESC_MAX_AGG_NUM(pdesc, 0x1f); 730 + set_tx_desc_agg_enable(pdesc, 1); 731 + set_tx_desc_max_agg_num(pdesc, 0x1f); 734 732 } 735 - SET_TX_DESC_SEQ(pdesc, seq_number); 736 - SET_TX_DESC_RTS_ENABLE(pdesc, ((ptcb_desc->rts_enable && 733 + set_tx_desc_seq(pdesc, seq_number); 734 + set_tx_desc_rts_enable(pdesc, 735 + ((ptcb_desc->rts_enable && 737 736 !ptcb_desc->cts_enable) ? 1 : 0)); 738 - SET_TX_DESC_HW_RTS_ENABLE(pdesc, 0); 739 - SET_TX_DESC_CTS2SELF(pdesc, ((ptcb_desc->cts_enable) ? 1 : 0)); 737 + set_tx_desc_hw_rts_enable(pdesc, 0); 738 + set_tx_desc_cts2self(pdesc, ((ptcb_desc->cts_enable) ? 1 : 0)); 740 739 741 - SET_TX_DESC_RTS_RATE(pdesc, ptcb_desc->rts_rate); 742 - SET_TX_DESC_RTS_SC(pdesc, ptcb_desc->rts_sc); 743 - SET_TX_DESC_RTS_SHORT(pdesc, 744 - ((ptcb_desc->rts_rate <= DESC_RATE54M) ? 745 - (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : 746 - (ptcb_desc->rts_use_shortgi ? 1 : 0))); 740 + set_tx_desc_rts_rate(pdesc, ptcb_desc->rts_rate); 741 + set_tx_desc_rts_sc(pdesc, ptcb_desc->rts_sc); 742 + tmp_bool = ((ptcb_desc->rts_rate <= DESC_RATE54M) ? 743 + (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : 744 + (ptcb_desc->rts_use_shortgi ? 1 : 0)); 745 + set_tx_desc_rts_short(pdesc, tmp_bool); 747 746 748 747 if (ptcb_desc->tx_enable_sw_calc_duration) 749 - SET_TX_DESC_NAV_USE_HDR(pdesc, 1); 748 + set_tx_desc_nav_use_hdr(pdesc, 1); 750 749 751 - SET_TX_DESC_DATA_BW(pdesc, 752 - rtl8821ae_bw_mapping(hw, ptcb_desc)); 750 + set_tx_desc_data_bw(pdesc, 751 + rtl8821ae_bw_mapping(hw, ptcb_desc)); 753 752 754 - SET_TX_DESC_TX_SUB_CARRIER(pdesc, 755 - rtl8821ae_sc_mapping(hw, ptcb_desc)); 753 + set_tx_desc_tx_sub_carrier(pdesc, 754 + rtl8821ae_sc_mapping(hw, ptcb_desc)); 756 755 757 - SET_TX_DESC_LINIP(pdesc, 0); 758 - SET_TX_DESC_PKT_SIZE(pdesc, (u16)skb_len); 756 + set_tx_desc_linip(pdesc, 0); 757 + set_tx_desc_pkt_size(pdesc, (u16)skb_len); 759 758 if (sta) { 760 759 u8 ampdu_density = sta->ht_cap.ampdu_density; 761 760 762 - SET_TX_DESC_AMPDU_DENSITY(pdesc, ampdu_density); 761 + set_tx_desc_ampdu_density(pdesc, ampdu_density); 763 762 } 764 763 if (info->control.hw_key) { 765 764 struct ieee80211_key_conf *keyconf = ··· 769 766 case WLAN_CIPHER_SUITE_WEP40: 770 767 case WLAN_CIPHER_SUITE_WEP104: 771 768 case WLAN_CIPHER_SUITE_TKIP: 772 - SET_TX_DESC_SEC_TYPE(pdesc, 0x1); 769 + set_tx_desc_sec_type(pdesc, 0x1); 773 770 break; 774 771 case WLAN_CIPHER_SUITE_CCMP: 775 - SET_TX_DESC_SEC_TYPE(pdesc, 0x3); 772 + set_tx_desc_sec_type(pdesc, 0x3); 776 773 break; 777 774 default: 778 - SET_TX_DESC_SEC_TYPE(pdesc, 0x0); 775 + set_tx_desc_sec_type(pdesc, 0x0); 779 776 break; 780 777 } 781 778 } 782 779 783 - SET_TX_DESC_QUEUE_SEL(pdesc, fw_qsel); 784 - SET_TX_DESC_DATA_RATE_FB_LIMIT(pdesc, 0x1F); 785 - SET_TX_DESC_RTS_RATE_FB_LIMIT(pdesc, 0xF); 786 - SET_TX_DESC_DISABLE_FB(pdesc, ptcb_desc->disable_ratefallback ? 780 + set_tx_desc_queue_sel(pdesc, fw_qsel); 781 + set_tx_desc_data_rate_fb_limit(pdesc, 0x1F); 782 + set_tx_desc_rts_rate_fb_limit(pdesc, 0xF); 783 + set_tx_desc_disable_fb(pdesc, ptcb_desc->disable_ratefallback ? 787 784 1 : 0); 788 - SET_TX_DESC_USE_RATE(pdesc, ptcb_desc->use_driver_rate ? 1 : 0); 785 + set_tx_desc_use_rate(pdesc, ptcb_desc->use_driver_rate ? 1 : 0); 789 786 790 787 if (ieee80211_is_data_qos(fc)) { 791 788 if (mac->rdg_en) { 792 789 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 793 790 "Enable RDG function.\n"); 794 - SET_TX_DESC_RDG_ENABLE(pdesc, 1); 795 - SET_TX_DESC_HTC(pdesc, 1); 791 + set_tx_desc_rdg_enable(pdesc, 1); 792 + set_tx_desc_htc(pdesc, 1); 796 793 } 797 794 } 798 795 /* tx report */ 799 - rtl_set_tx_report(ptcb_desc, pdesc, hw, tx_info); 796 + rtl_set_tx_report(ptcb_desc, pdesc8, hw, tx_info); 800 797 } 801 798 802 - SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0)); 803 - SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0)); 804 - SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)buf_len); 805 - SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); 799 + set_tx_desc_first_seg(pdesc, (firstseg ? 1 : 0)); 800 + set_tx_desc_last_seg(pdesc, (lastseg ? 1 : 0)); 801 + set_tx_desc_tx_buffer_size(pdesc, buf_len); 802 + set_tx_desc_tx_buffer_address(pdesc, mapping); 806 803 /* if (rtlpriv->dm.useramask) { */ 807 804 if (1) { 808 - SET_TX_DESC_RATE_ID(pdesc, ptcb_desc->ratr_index); 809 - SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id); 805 + set_tx_desc_rate_id(pdesc, ptcb_desc->ratr_index); 806 + set_tx_desc_macid(pdesc, ptcb_desc->mac_id); 810 807 } else { 811 - SET_TX_DESC_RATE_ID(pdesc, 0xC + ptcb_desc->ratr_index); 812 - SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id); 808 + set_tx_desc_rate_id(pdesc, 0xC + ptcb_desc->ratr_index); 809 + set_tx_desc_macid(pdesc, ptcb_desc->mac_id); 813 810 } 814 811 if (!ieee80211_is_data_qos(fc)) { 815 - SET_TX_DESC_HWSEQ_EN(pdesc, 1); 816 - SET_TX_DESC_HWSEQ_SEL(pdesc, 0); 812 + set_tx_desc_hwseq_en(pdesc, 1); 813 + set_tx_desc_hwseq_sel(pdesc, 0); 817 814 } 818 - SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1)); 815 + set_tx_desc_more_frag(pdesc, (lastseg ? 0 : 1)); 819 816 if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || 820 817 is_broadcast_ether_addr(ieee80211_get_DA(hdr))) { 821 - SET_TX_DESC_BMC(pdesc, 1); 818 + set_tx_desc_bmc(pdesc, 1); 822 819 } 823 820 824 - rtl8821ae_dm_set_tx_ant_by_tx_info(hw, pdesc, ptcb_desc->mac_id); 821 + rtl8821ae_dm_set_tx_ant_by_tx_info(hw, pdesc8, ptcb_desc->mac_id); 825 822 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); 826 823 } 827 824 828 825 void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw *hw, 829 - u8 *pdesc, bool firstseg, 826 + u8 *pdesc8, bool firstseg, 830 827 bool lastseg, struct sk_buff *skb) 831 828 { 832 829 struct rtl_priv *rtlpriv = rtl_priv(hw); 833 830 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 834 831 u8 fw_queue = QSLT_BEACON; 832 + __le32 *pdesc = (__le32 *)pdesc8; 835 833 836 834 dma_addr_t mapping = pci_map_single(rtlpci->pdev, 837 835 skb->data, skb->len, ··· 843 839 "DMA mapping error\n"); 844 840 return; 845 841 } 846 - CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); 842 + clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE); 847 843 848 - SET_TX_DESC_FIRST_SEG(pdesc, 1); 849 - SET_TX_DESC_LAST_SEG(pdesc, 1); 844 + set_tx_desc_first_seg(pdesc, 1); 845 + set_tx_desc_last_seg(pdesc, 1); 850 846 851 - SET_TX_DESC_PKT_SIZE((u8 *)pdesc, (u16)(skb->len)); 847 + set_tx_desc_pkt_size(pdesc, (u16)(skb->len)); 852 848 853 - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); 849 + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN); 854 850 855 - SET_TX_DESC_USE_RATE(pdesc, 1); 856 - SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); 857 - SET_TX_DESC_DISABLE_FB(pdesc, 1); 851 + set_tx_desc_use_rate(pdesc, 1); 852 + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); 853 + set_tx_desc_disable_fb(pdesc, 1); 858 854 859 - SET_TX_DESC_DATA_BW(pdesc, 0); 855 + set_tx_desc_data_bw(pdesc, 0); 860 856 861 - SET_TX_DESC_HWSEQ_EN(pdesc, 1); 857 + set_tx_desc_hwseq_en(pdesc, 1); 862 858 863 - SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); 859 + set_tx_desc_queue_sel(pdesc, fw_queue); 864 860 865 - SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); 861 + set_tx_desc_tx_buffer_size(pdesc, skb->len); 866 862 867 - SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); 863 + set_tx_desc_tx_buffer_address(pdesc, mapping); 868 864 869 - SET_TX_DESC_MACID(pdesc, 0); 865 + set_tx_desc_macid(pdesc, 0); 870 866 871 - SET_TX_DESC_OWN(pdesc, 1); 867 + set_tx_desc_own(pdesc, 1); 872 868 873 869 RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD, 874 870 "H2C Tx Cmd Content\n", 875 - pdesc, TX_DESC_SIZE); 871 + pdesc8, TX_DESC_SIZE); 876 872 } 877 873 878 - void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc, 874 + void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc8, 879 875 bool istx, u8 desc_name, u8 *val) 880 876 { 877 + __le32 *pdesc = (__le32 *)pdesc8; 878 + 881 879 if (istx) { 882 880 switch (desc_name) { 883 881 case HW_DESC_OWN: 884 - SET_TX_DESC_OWN(pdesc, 1); 882 + set_tx_desc_own(pdesc, 1); 885 883 break; 886 884 case HW_DESC_TX_NEXTDESC_ADDR: 887 - SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val); 885 + set_tx_desc_next_desc_address(pdesc, *(u32 *)val); 888 886 break; 889 887 default: 890 888 WARN_ONCE(true, ··· 897 891 } else { 898 892 switch (desc_name) { 899 893 case HW_DESC_RXOWN: 900 - SET_RX_DESC_OWN(pdesc, 1); 894 + set_rx_desc_own(pdesc, 1); 901 895 break; 902 896 case HW_DESC_RXBUFF_ADDR: 903 - SET_RX_DESC_BUFF_ADDR(pdesc, *(u32 *)val); 897 + set_rx_desc_buff_addr(pdesc, *(u32 *)val); 904 898 break; 905 899 case HW_DESC_RXPKT_LEN: 906 - SET_RX_DESC_PKT_LEN(pdesc, *(u32 *)val); 900 + set_rx_desc_pkt_len(pdesc, *(u32 *)val); 907 901 break; 908 902 case HW_DESC_RXERO: 909 - SET_RX_DESC_EOR(pdesc, 1); 903 + set_rx_desc_eor(pdesc, 1); 910 904 break; 911 905 default: 912 906 WARN_ONCE(true, ··· 918 912 } 919 913 920 914 u64 rtl8821ae_get_desc(struct ieee80211_hw *hw, 921 - u8 *pdesc, bool istx, u8 desc_name) 915 + u8 *pdesc8, bool istx, u8 desc_name) 922 916 { 923 917 u32 ret = 0; 918 + __le32 *pdesc = (__le32 *)pdesc8; 924 919 925 920 if (istx) { 926 921 switch (desc_name) { 927 922 case HW_DESC_OWN: 928 - ret = GET_TX_DESC_OWN(pdesc); 923 + ret = get_tx_desc_own(pdesc); 929 924 break; 930 925 case HW_DESC_TXBUFF_ADDR: 931 - ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc); 926 + ret = get_tx_desc_tx_buffer_address(pdesc); 932 927 break; 933 928 default: 934 929 WARN_ONCE(true, ··· 940 933 } else { 941 934 switch (desc_name) { 942 935 case HW_DESC_OWN: 943 - ret = GET_RX_DESC_OWN(pdesc); 936 + ret = get_rx_desc_own(pdesc); 944 937 break; 945 938 case HW_DESC_RXPKT_LEN: 946 - ret = GET_RX_DESC_PKT_LEN(pdesc); 939 + ret = get_rx_desc_pkt_len(pdesc); 947 940 break; 948 941 case HW_DESC_RXBUFF_ADDR: 949 - ret = GET_RX_DESC_BUFF_ADDR(pdesc); 942 + ret = get_rx_desc_buff_addr(pdesc); 950 943 break; 951 944 default: 952 945 WARN_ONCE(true,
+349 -305
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
··· 14 14 #define USB_HWDESC_HEADER_LEN 40 15 15 #define CRCLENGTH 4 16 16 17 - #define SET_TX_DESC_PKT_SIZE(__pdesc, __val) \ 18 - SET_BITS_TO_LE_4BYTE(__pdesc, 0, 16, __val) 19 - #define SET_TX_DESC_OFFSET(__pdesc, __val) \ 20 - SET_BITS_TO_LE_4BYTE(__pdesc, 16, 8, __val) 21 - #define SET_TX_DESC_BMC(__pdesc, __val) \ 22 - SET_BITS_TO_LE_4BYTE(__pdesc, 24, 1, __val) 23 - #define SET_TX_DESC_HTC(__pdesc, __val) \ 24 - SET_BITS_TO_LE_4BYTE(__pdesc, 25, 1, __val) 25 - #define SET_TX_DESC_LAST_SEG(__pdesc, __val) \ 26 - SET_BITS_TO_LE_4BYTE(__pdesc, 26, 1, __val) 27 - #define SET_TX_DESC_FIRST_SEG(__pdesc, __val) \ 28 - SET_BITS_TO_LE_4BYTE(__pdesc, 27, 1, __val) 29 - #define SET_TX_DESC_LINIP(__pdesc, __val) \ 30 - SET_BITS_TO_LE_4BYTE(__pdesc, 28, 1, __val) 31 - #define SET_TX_DESC_NO_ACM(__pdesc, __val) \ 32 - SET_BITS_TO_LE_4BYTE(__pdesc, 29, 1, __val) 33 - #define SET_TX_DESC_GF(__pdesc, __val) \ 34 - SET_BITS_TO_LE_4BYTE(__pdesc, 30, 1, __val) 35 - #define SET_TX_DESC_OWN(__pdesc, __val) \ 36 - SET_BITS_TO_LE_4BYTE(__pdesc, 31, 1, __val) 17 + static inline void set_tx_desc_pkt_size(__le32 *__pdesc, u32 __val) 18 + { 19 + le32p_replace_bits(__pdesc, __val, GENMASK(15, 0)); 20 + } 37 21 38 - #define GET_TX_DESC_PKT_SIZE(__pdesc) \ 39 - LE_BITS_TO_4BYTE(__pdesc, 0, 16) 40 - #define GET_TX_DESC_OFFSET(__pdesc) \ 41 - LE_BITS_TO_4BYTE(__pdesc, 16, 8) 42 - #define GET_TX_DESC_BMC(__pdesc) \ 43 - LE_BITS_TO_4BYTE(__pdesc, 24, 1) 44 - #define GET_TX_DESC_HTC(__pdesc) \ 45 - LE_BITS_TO_4BYTE(__pdesc, 25, 1) 46 - #define GET_TX_DESC_LAST_SEG(__pdesc) \ 47 - LE_BITS_TO_4BYTE(__pdesc, 26, 1) 48 - #define GET_TX_DESC_FIRST_SEG(__pdesc) \ 49 - LE_BITS_TO_4BYTE(__pdesc, 27, 1) 50 - #define GET_TX_DESC_LINIP(__pdesc) \ 51 - LE_BITS_TO_4BYTE(__pdesc, 28, 1) 52 - #define GET_TX_DESC_NO_ACM(__pdesc) \ 53 - LE_BITS_TO_4BYTE(__pdesc, 29, 1) 54 - #define GET_TX_DESC_GF(__pdesc) \ 55 - LE_BITS_TO_4BYTE(__pdesc, 30, 1) 56 - #define GET_TX_DESC_OWN(__pdesc) \ 57 - LE_BITS_TO_4BYTE(__pdesc, 31, 1) 22 + static inline void set_tx_desc_offset(__le32 *__pdesc, u32 __val) 23 + { 24 + le32p_replace_bits(__pdesc, __val, GENMASK(23, 16)); 25 + } 58 26 59 - #define SET_TX_DESC_MACID(__pdesc, __val) \ 60 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 0, 7, __val) 61 - #define SET_TX_DESC_QUEUE_SEL(__pdesc, __val) \ 62 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 8, 5, __val) 63 - #define SET_TX_DESC_RDG_NAV_EXT(__pdesc, __val) \ 64 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 13, 1, __val) 65 - #define SET_TX_DESC_LSIG_TXOP_EN(__pdesc, __val) \ 66 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 14, 1, __val) 67 - #define SET_TX_DESC_PIFS(__pdesc, __val) \ 68 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 15, 1, __val) 69 - #define SET_TX_DESC_RATE_ID(__pdesc, __val) \ 70 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 16, 5, __val) 71 - #define SET_TX_DESC_EN_DESC_ID(__pdesc, __val) \ 72 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 21, 1, __val) 73 - #define SET_TX_DESC_SEC_TYPE(__pdesc, __val) \ 74 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 22, 2, __val) 75 - #define SET_TX_DESC_PKT_OFFSET(__pdesc, __val) \ 76 - SET_BITS_TO_LE_4BYTE(__pdesc+4, 24, 5, __val) 27 + static inline void set_tx_desc_bmc(__le32 *__pdesc, u32 __val) 28 + { 29 + le32p_replace_bits(__pdesc, __val, BIT(24)); 30 + } 77 31 78 - #define SET_TX_DESC_PAID(__pdesc, __val) \ 79 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 0, 9, __val) 80 - #define SET_TX_DESC_CCA_RTS(__pdesc, __val) \ 81 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 10, 2, __val) 82 - #define SET_TX_DESC_AGG_ENABLE(__pdesc, __val) \ 83 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 12, 1, __val) 84 - #define SET_TX_DESC_RDG_ENABLE(__pdesc, __val) \ 85 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 13, 1, __val) 86 - #define SET_TX_DESC_BAR_RTY_TH(__pdesc, __val) \ 87 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 14, 2, __val) 88 - #define SET_TX_DESC_AGG_BREAK(__pdesc, __val) \ 89 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 16, 1, __val) 90 - #define SET_TX_DESC_MORE_FRAG(__pdesc, __val) \ 91 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 17, 1, __val) 92 - #define SET_TX_DESC_RAW(__pdesc, __val) \ 93 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 18, 1, __val) 94 - #define SET_TX_DESC_SPE_RPT(__pdesc, __val) \ 95 - SET_BITS_TO_LE_4BYTE((__pdesc) + 8, 19, 1, __val) 96 - #define SET_TX_DESC_AMPDU_DENSITY(__pdesc, __val) \ 97 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 20, 3, __val) 98 - #define SET_TX_DESC_BT_INT(__pdesc, __val) \ 99 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 23, 1, __val) 100 - #define SET_TX_DESC_GID(__pdesc, __val) \ 101 - SET_BITS_TO_LE_4BYTE(__pdesc+8, 24, 6, __val) 32 + static inline void set_tx_desc_htc(__le32 *__pdesc, u32 __val) 33 + { 34 + le32p_replace_bits(__pdesc, __val, BIT(25)); 35 + } 102 36 103 - #define SET_TX_DESC_WHEADER_LEN(__pdesc, __val) \ 104 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 0, 4, __val) 105 - #define SET_TX_DESC_CHK_EN(__pdesc, __val) \ 106 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 4, 1, __val) 107 - #define SET_TX_DESC_EARLY_MODE(__pdesc, __val) \ 108 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 5, 1, __val) 109 - #define SET_TX_DESC_HWSEQ_SEL(__pdesc, __val) \ 110 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 6, 2, __val) 111 - #define SET_TX_DESC_USE_RATE(__pdesc, __val) \ 112 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 8, 1, __val) 113 - #define SET_TX_DESC_DISABLE_RTS_FB(__pdesc, __val) \ 114 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 9, 1, __val) 115 - #define SET_TX_DESC_DISABLE_FB(__pdesc, __val) \ 116 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 10, 1, __val) 117 - #define SET_TX_DESC_CTS2SELF(__pdesc, __val) \ 118 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 11, 1, __val) 119 - #define SET_TX_DESC_RTS_ENABLE(__pdesc, __val) \ 120 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 12, 1, __val) 121 - #define SET_TX_DESC_HW_RTS_ENABLE(__pdesc, __val) \ 122 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 13, 1, __val) 123 - #define SET_TX_DESC_NAV_USE_HDR(__pdesc, __val) \ 124 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 15, 1, __val) 125 - #define SET_TX_DESC_USE_MAX_LEN(__pdesc, __val) \ 126 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 16, 1, __val) 127 - #define SET_TX_DESC_MAX_AGG_NUM(__pdesc, __val) \ 128 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 17, 5, __val) 129 - #define SET_TX_DESC_NDPA(__pdesc, __val) \ 130 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 22, 2, __val) 131 - #define SET_TX_DESC_AMPDU_MAX_TIME(__pdesc, __val) \ 132 - SET_BITS_TO_LE_4BYTE(__pdesc+12, 24, 8, __val) 133 - #define SET_TX_DESC_TX_ANT(__pdesc, __val) \ 134 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 24, 4, __val) 37 + static inline void set_tx_desc_last_seg(__le32 *__pdesc, u32 __val) 38 + { 39 + le32p_replace_bits(__pdesc, __val, BIT(26)); 40 + } 135 41 136 - #define SET_TX_DESC_TX_RATE(__pdesc, __val) \ 137 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 0, 7, __val) 138 - #define SET_TX_DESC_DATA_RATE_FB_LIMIT(__pdesc, __val) \ 139 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 8, 5, __val) 140 - #define SET_TX_DESC_RTS_RATE_FB_LIMIT(__pdesc, __val) \ 141 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 13, 4, __val) 142 - #define SET_TX_DESC_RETRY_LIMIT_ENABLE(__pdesc, __val) \ 143 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 17, 1, __val) 144 - #define SET_TX_DESC_DATA_RETRY_LIMIT(__pdesc, __val) \ 145 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 18, 6, __val) 146 - #define SET_TX_DESC_RTS_RATE(__pdesc, __val) \ 147 - SET_BITS_TO_LE_4BYTE(__pdesc+16, 24, 5, __val) 42 + static inline void set_tx_desc_first_seg(__le32 *__pdesc, u32 __val) 43 + { 44 + le32p_replace_bits(__pdesc, __val, BIT(27)); 45 + } 148 46 149 - #define SET_TX_DESC_TX_SUB_CARRIER(__pdesc, __val) \ 150 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 0, 4, __val) 151 - #define SET_TX_DESC_DATA_SHORTGI(__pdesc, __val) \ 152 - SET_BITS_TO_LE_1BYTE(__pdesc+20, 4, 1, __val) 153 - #define SET_TX_DESC_DATA_BW(__pdesc, __val) \ 154 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 5, 2, __val) 155 - #define SET_TX_DESC_DATA_LDPC(__pdesc, __val) \ 156 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 7, 1, __val) 157 - #define SET_TX_DESC_DATA_STBC(__pdesc, __val) \ 158 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 8, 2, __val) 159 - #define SET_TX_DESC_CTROL_STBC(__pdesc, __val) \ 160 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 10, 2, __val) 161 - #define SET_TX_DESC_RTS_SHORT(__pdesc, __val) \ 162 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 12, 1, __val) 163 - #define SET_TX_DESC_RTS_SC(__pdesc, __val) \ 164 - SET_BITS_TO_LE_4BYTE(__pdesc+20, 13, 4, __val) 47 + static inline void set_tx_desc_linip(__le32 *__pdesc, u32 __val) 48 + { 49 + le32p_replace_bits(__pdesc, __val, BIT(28)); 50 + } 165 51 166 - #define SET_TX_DESC_SW_DEFINE(__pdesc, __val) \ 167 - SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 0, 12, __val) 168 - #define SET_TX_DESC_ANTSEL_A(__pdesc, __val) \ 169 - SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 16, 3, __val) 170 - #define SET_TX_DESC_ANTSEL_B(__pdesc, __val) \ 171 - SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 19, 3, __val) 172 - #define SET_TX_DESC_ANTSEL_C(__pdesc, __val) \ 173 - SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 22, 3, __val) 174 - #define SET_TX_DESC_ANTSEL_D(__pdesc, __val) \ 175 - SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 25, 3, __val) 176 - #define SET_TX_DESC_MBSSID(__pdesc, __val) \ 177 - SET_BITS_TO_LE_4BYTE(i(__pdesc) + 24, 12, 4, __val) 52 + static inline void set_tx_desc_own(__le32 *__pdesc, u32 __val) 53 + { 54 + le32p_replace_bits(__pdesc, __val, BIT(31)); 55 + } 178 56 179 - #define SET_TX_DESC_TX_BUFFER_SIZE(__pdesc, __val) \ 180 - SET_BITS_TO_LE_4BYTE((__pdesc) + 28, 0, 16, __val) 57 + static inline int get_tx_desc_own(__le32 *__pdesc) 58 + { 59 + return le32_get_bits(*(__pdesc), BIT(31)); 60 + } 181 61 182 - #define GET_TX_DESC_TX_BUFFER_SIZE(__pdesc) \ 183 - LE_BITS_TO_4BYTE(__pdesc+28, 0, 16) 62 + static inline void set_tx_desc_macid(__le32 *__pdesc, u32 __val) 63 + { 64 + le32p_replace_bits(__pdesc + 1, __val, GENMASK(6, 0)); 65 + } 184 66 185 - #define SET_TX_DESC_HWSEQ_EN(__pdesc, __val) \ 186 - SET_BITS_TO_LE_4BYTE(__pdesc+32, 15, 1, __val) 67 + static inline void set_tx_desc_queue_sel(__le32 *__pdesc, u32 __val) 68 + { 69 + le32p_replace_bits(__pdesc + 1, __val, GENMASK(12, 8)); 70 + } 187 71 188 - #define SET_TX_DESC_SEQ(__pdesc, __val) \ 189 - SET_BITS_TO_LE_4BYTE(__pdesc+36, 12, 12, __val) 72 + static inline void set_tx_desc_rate_id(__le32 *__pdesc, u32 __val) 73 + { 74 + le32p_replace_bits(__pdesc + 1, __val, GENMASK(20, 16)); 75 + } 190 76 191 - #define SET_TX_DESC_TX_BUFFER_ADDRESS(__pdesc, __val) \ 192 - SET_BITS_TO_LE_4BYTE(__pdesc+40, 0, 32, __val) 77 + static inline void set_tx_desc_sec_type(__le32 *__pdesc, u32 __val) 78 + { 79 + le32p_replace_bits(__pdesc + 1, __val, GENMASK(23, 22)); 80 + } 193 81 194 - #define GET_TX_DESC_TX_BUFFER_ADDRESS(__pdesc) \ 195 - LE_BITS_TO_4BYTE(__pdesc+40, 0, 32) 82 + static inline void set_tx_desc_pkt_offset(__le32 *__pdesc, u32 __val) 83 + { 84 + le32p_replace_bits(__pdesc + 1, __val, GENMASK(28, 24)); 85 + } 196 86 197 - #define SET_TX_DESC_NEXT_DESC_ADDRESS(__pdesc, __val) \ 198 - SET_BITS_TO_LE_4BYTE(__pdesc+48, 0, 32, __val) 87 + static inline void set_tx_desc_agg_enable(__le32 *__pdesc, u32 __val) 88 + { 89 + le32p_replace_bits(__pdesc + 2, __val, BIT(12)); 90 + } 199 91 200 - #define GET_TX_DESC_NEXT_DESC_ADDRESS(__pdesc) \ 201 - LE_BITS_TO_4BYTE(__pdesc+48, 0, 32) 92 + static inline void set_tx_desc_rdg_enable(__le32 *__pdesc, u32 __val) 93 + { 94 + le32p_replace_bits(__pdesc + 2, __val, BIT(13)); 95 + } 202 96 203 - #define GET_RX_DESC_PKT_LEN(__pdesc) \ 204 - LE_BITS_TO_4BYTE(__pdesc, 0, 14) 205 - #define GET_RX_DESC_CRC32(__pdesc) \ 206 - LE_BITS_TO_4BYTE(__pdesc, 14, 1) 207 - #define GET_RX_DESC_ICV(__pdesc) \ 208 - LE_BITS_TO_4BYTE(__pdesc, 15, 1) 209 - #define GET_RX_DESC_DRV_INFO_SIZE(__pdesc) \ 210 - LE_BITS_TO_4BYTE(__pdesc, 16, 4) 211 - #define GET_RX_DESC_SECURITY(__pdesc) \ 212 - LE_BITS_TO_4BYTE(__pdesc, 20, 3) 213 - #define GET_RX_DESC_QOS(__pdesc) \ 214 - LE_BITS_TO_4BYTE(__pdesc, 23, 1) 215 - #define GET_RX_DESC_SHIFT(__pdesc) \ 216 - LE_BITS_TO_4BYTE(__pdesc, 24, 2) 217 - #define GET_RX_DESC_PHYST(__pdesc) \ 218 - LE_BITS_TO_4BYTE(__pdesc, 26, 1) 219 - #define GET_RX_DESC_SWDEC(__pdesc) \ 220 - LE_BITS_TO_4BYTE(__pdesc, 27, 1) 221 - #define GET_RX_DESC_LS(__pdesc) \ 222 - LE_BITS_TO_4BYTE(__pdesc, 28, 1) 223 - #define GET_RX_DESC_FS(__pdesc) \ 224 - LE_BITS_TO_4BYTE(__pdesc, 29, 1) 225 - #define GET_RX_DESC_EOR(__pdesc) \ 226 - LE_BITS_TO_4BYTE(__pdesc, 30, 1) 227 - #define GET_RX_DESC_OWN(__pdesc) \ 228 - LE_BITS_TO_4BYTE(__pdesc, 31, 1) 97 + static inline void set_tx_desc_more_frag(__le32 *__pdesc, u32 __val) 98 + { 99 + le32p_replace_bits(__pdesc + 2, __val, BIT(17)); 100 + } 229 101 230 - #define SET_RX_DESC_PKT_LEN(__pdesc, __val) \ 231 - SET_BITS_TO_LE_4BYTE(__pdesc, 0, 14, __val) 232 - #define SET_RX_DESC_EOR(__pdesc, __val) \ 233 - SET_BITS_TO_LE_4BYTE(__pdesc, 30, 1, __val) 234 - #define SET_RX_DESC_OWN(__pdesc, __val) \ 235 - SET_BITS_TO_LE_4BYTE(__pdesc, 31, 1, __val) 102 + static inline void set_tx_desc_ampdu_density(__le32 *__pdesc, u32 __val) 103 + { 104 + le32p_replace_bits(__pdesc + 2, __val, GENMASK(22, 20)); 105 + } 236 106 237 - #define GET_RX_DESC_MACID(__pdesc) \ 238 - LE_BITS_TO_4BYTE(__pdesc+4, 0, 7) 239 - #define GET_RX_DESC_TID(__pdesc) \ 240 - LE_BITS_TO_4BYTE(__pdesc+4, 8, 4) 241 - #define GET_RX_DESC_AMSDU(__pdesc) \ 242 - LE_BITS_TO_4BYTE(__pdesc+4, 13, 1) 243 - #define GET_RX_STATUS_DESC_RXID_MATCH(__pdesc) \ 244 - LE_BITS_TO_4BYTE(__pdesc+4, 14, 1) 245 - #define GET_RX_DESC_PAGGR(__pdesc) \ 246 - LE_BITS_TO_4BYTE(__pdesc+4, 15, 1) 247 - #define GET_RX_DESC_A1_FIT(__pdesc) \ 248 - LE_BITS_TO_4BYTE(__pdesc+4, 16, 4) 249 - #define GET_RX_DESC_CHKERR(__pdesc) \ 250 - LE_BITS_TO_4BYTE(__pdesc+4, 20, 1) 251 - #define GET_RX_DESC_IPVER(__pdesc) \ 252 - LE_BITS_TO_4BYTE(__pdesc+4, 21, 1) 253 - #define GET_RX_STATUS_DESC_IS_TCPUDP(__pdesc) \ 254 - LE_BITS_TO_4BYTE(__pdesc+4, 22, 1) 255 - #define GET_RX_STATUS_DESC_CHK_VLD(__pdesc) \ 256 - LE_BITS_TO_4BYTE(__pdesc+4, 23, 1) 257 - #define GET_RX_DESC_PAM(__pdesc) \ 258 - LE_BITS_TO_4BYTE(__pdesc+4, 24, 1) 259 - #define GET_RX_DESC_PWR(__pdesc) \ 260 - LE_BITS_TO_4BYTE(__pdesc+4, 25, 1) 261 - #define GET_RX_DESC_MD(__pdesc) \ 262 - LE_BITS_TO_4BYTE(__pdesc+4, 26, 1) 263 - #define GET_RX_DESC_MF(__pdesc) \ 264 - LE_BITS_TO_4BYTE(__pdesc+4, 27, 1) 265 - #define GET_RX_DESC_TYPE(__pdesc) \ 266 - LE_BITS_TO_4BYTE(__pdesc+4, 28, 2) 267 - #define GET_RX_DESC_MC(__pdesc) \ 268 - LE_BITS_TO_4BYTE(__pdesc+4, 30, 1) 269 - #define GET_RX_DESC_BC(__pdesc) \ 270 - LE_BITS_TO_4BYTE(__pdesc+4, 31, 1) 107 + static inline void set_tx_desc_hwseq_sel(__le32 *__pdesc, u32 __val) 108 + { 109 + le32p_replace_bits(__pdesc + 3, __val, GENMASK(7, 6)); 110 + } 271 111 272 - #define GET_RX_DESC_SEQ(__pdesc) \ 273 - LE_BITS_TO_4BYTE(__pdesc+8, 0, 12) 274 - #define GET_RX_DESC_FRAG(__pdesc) \ 275 - LE_BITS_TO_4BYTE(__pdesc+8, 12, 4) 276 - #define GET_RX_STATUS_DESC_RX_IS_QOS(__pdesc) \ 277 - LE_BITS_TO_4BYTE(__pdesc+8, 16, 1) 278 - #define GET_RX_STATUS_DESC_WLANHD_IV_LEN(__pdesc) \ 279 - LE_BITS_TO_4BYTE(__pdesc+8, 18, 6) 280 - #define GET_RX_STATUS_DESC_RPT_SEL(__pdesc) \ 281 - LE_BITS_TO_4BYTE(__pdesc+8, 28, 1) 112 + static inline void set_tx_desc_use_rate(__le32 *__pdesc, u32 __val) 113 + { 114 + le32p_replace_bits(__pdesc + 3, __val, BIT(8)); 115 + } 282 116 283 - #define GET_RX_DESC_RXMCS(__pdesc) \ 284 - LE_BITS_TO_4BYTE(__pdesc+12, 0, 7) 285 - #define GET_RX_DESC_HTC(__pdesc) \ 286 - LE_BITS_TO_4BYTE(__pdesc+12, 10, 1) 287 - #define GET_RX_STATUS_DESC_EOSP(__pdesc) \ 288 - LE_BITS_TO_4BYTE(__pdesc+12, 11, 1) 289 - #define GET_RX_STATUS_DESC_BSSID_FIT(__pdesc) \ 290 - LE_BITS_TO_4BYTE(__pdesc+12, 12, 2) 117 + static inline void set_tx_desc_disable_fb(__le32 *__pdesc, u32 __val) 118 + { 119 + le32p_replace_bits(__pdesc + 3, __val, BIT(10)); 120 + } 291 121 292 - #define GET_RX_STATUS_DESC_PATTERN_MATCH(__pdesc) \ 293 - LE_BITS_TO_4BYTE(__pdesc+12, 29, 1) 294 - #define GET_RX_STATUS_DESC_UNICAST_MATCH(__pdesc) \ 295 - LE_BITS_TO_4BYTE(__pdesc+12, 30, 1) 296 - #define GET_RX_STATUS_DESC_MAGIC_MATCH(__pdesc) \ 297 - LE_BITS_TO_4BYTE(__pdesc+12, 31, 1) 122 + static inline void set_tx_desc_cts2self(__le32 *__pdesc, u32 __val) 123 + { 124 + le32p_replace_bits(__pdesc + 3, __val, BIT(11)); 125 + } 298 126 299 - #define GET_RX_DESC_SPLCP(__pdesc) \ 300 - LE_BITS_TO_4BYTE(__pdesc+16, 0, 1) 301 - #define GET_RX_STATUS_DESC_LDPC(__pdesc) \ 302 - LE_BITS_TO_4BYTE(__pdesc+16, 1, 1) 303 - #define GET_RX_STATUS_DESC_STBC(__pdesc) \ 304 - LE_BITS_TO_4BYTE(__pdesc+16, 2, 1) 305 - #define GET_RX_DESC_BW(__pdesc) \ 306 - LE_BITS_TO_4BYTE(__pdesc+16, 4, 2) 127 + static inline void set_tx_desc_rts_enable(__le32 *__pdesc, u32 __val) 128 + { 129 + le32p_replace_bits(__pdesc + 3, __val, BIT(12)); 130 + } 307 131 308 - #define GET_RX_DESC_TSFL(__pdesc) \ 309 - LE_BITS_TO_4BYTE(__pdesc+20, 0, 32) 132 + static inline void set_tx_desc_hw_rts_enable(__le32 *__pdesc, u32 __val) 133 + { 134 + le32p_replace_bits(__pdesc + 3, __val, BIT(13)); 135 + } 310 136 311 - #define GET_RX_DESC_BUFF_ADDR(__pdesc) \ 312 - LE_BITS_TO_4BYTE(__pdesc+24, 0, 32) 313 - #define GET_RX_DESC_BUFF_ADDR64(__pdesc) \ 314 - LE_BITS_TO_4BYTE(__pdesc+28, 0, 32) 137 + static inline void set_tx_desc_nav_use_hdr(__le32 *__pdesc, u32 __val) 138 + { 139 + le32p_replace_bits(__pdesc + 3, __val, BIT(15)); 140 + } 315 141 316 - #define SET_RX_DESC_BUFF_ADDR(__pdesc, __val) \ 317 - SET_BITS_TO_LE_4BYTE(__pdesc+24, 0, 32, __val) 318 - #define SET_RX_DESC_BUFF_ADDR64(__pdesc, __val) \ 319 - SET_BITS_TO_LE_4BYTE(__pdesc+28, 0, 32, __val) 142 + static inline void set_tx_desc_max_agg_num(__le32 *__pdesc, u32 __val) 143 + { 144 + le32p_replace_bits(__pdesc + 3, __val, GENMASK(21, 17)); 145 + } 146 + 147 + static inline void set_tx_desc_tx_ant(__le32 *__pdesc, u32 __val) 148 + { 149 + le32p_replace_bits(__pdesc + 5, __val, GENMASK(27, 24)); 150 + } 151 + 152 + static inline void set_tx_desc_tx_rate(__le32 *__pdesc, u32 __val) 153 + { 154 + le32p_replace_bits(__pdesc + 4, __val, GENMASK(6, 0)); 155 + } 156 + 157 + static inline void set_tx_desc_data_rate_fb_limit(__le32 *__pdesc, u32 __val) 158 + { 159 + le32p_replace_bits(__pdesc + 4, __val, GENMASK(12, 8)); 160 + } 161 + 162 + static inline void set_tx_desc_rts_rate_fb_limit(__le32 *__pdesc, u32 __val) 163 + { 164 + le32p_replace_bits(__pdesc + 4, __val, GENMASK(16, 13)); 165 + } 166 + 167 + static inline void set_tx_desc_rts_rate(__le32 *__pdesc, u32 __val) 168 + { 169 + le32p_replace_bits(__pdesc + 4, __val, GENMASK(28, 24)); 170 + } 171 + 172 + static inline void set_tx_desc_tx_sub_carrier(__le32 *__pdesc, u32 __val) 173 + { 174 + le32p_replace_bits(__pdesc + 5, __val, GENMASK(3, 0)); 175 + } 176 + 177 + static inline void set_tx_desc_data_shortgi(__le32 *__pdesc, u32 __val) 178 + { 179 + le32p_replace_bits(__pdesc + 5, __val, BIT(4)); 180 + } 181 + 182 + static inline void set_tx_desc_data_bw(__le32 *__pdesc, u32 __val) 183 + { 184 + le32p_replace_bits(__pdesc + 5, __val, GENMASK(6, 5)); 185 + } 186 + 187 + static inline void set_tx_desc_rts_short(__le32 *__pdesc, u32 __val) 188 + { 189 + le32p_replace_bits(__pdesc + 5, __val, BIT(12)); 190 + } 191 + 192 + static inline void set_tx_desc_rts_sc(__le32 *__pdesc, u32 __val) 193 + { 194 + le32p_replace_bits(__pdesc + 5, __val, GENMASK(16, 13)); 195 + } 196 + 197 + static inline void set_tx_desc_tx_buffer_size(__le32 *__pdesc, u32 __val) 198 + { 199 + le32p_replace_bits(__pdesc + 7, __val, GENMASK(15, 0)); 200 + } 201 + 202 + static inline void set_tx_desc_hwseq_en(__le32 *__pdesc, u32 __val) 203 + { 204 + le32p_replace_bits(__pdesc + 8, __val, BIT(15)); 205 + } 206 + 207 + static inline void set_tx_desc_seq(__le32 *__pdesc, u32 __val) 208 + { 209 + le32p_replace_bits(__pdesc + 9, __val, GENMASK(23, 12)); 210 + } 211 + 212 + static inline void set_tx_desc_tx_buffer_address(__le32 *__pdesc, u32 __val) 213 + { 214 + *(__pdesc + 10) = cpu_to_le32(__val); 215 + } 216 + 217 + static inline int get_tx_desc_tx_buffer_address(__le32 *__pdesc) 218 + { 219 + return le32_to_cpu(*(__pdesc + 10)); 220 + } 221 + 222 + static inline void set_tx_desc_next_desc_address(__le32 *__pdesc, u32 __val) 223 + { 224 + *(__pdesc + 12) = cpu_to_le32(__val); 225 + } 226 + 227 + static inline int get_rx_desc_pkt_len(__le32 *__pdesc) 228 + { 229 + return le32_get_bits(*(__pdesc), GENMASK(13, 0)); 230 + } 231 + 232 + static inline int get_rx_desc_crc32(__le32 *__pdesc) 233 + { 234 + return le32_get_bits(*(__pdesc), BIT(14)); 235 + } 236 + 237 + static inline int get_rx_desc_icv(__le32 *__pdesc) 238 + { 239 + return le32_get_bits(*(__pdesc), BIT(15)); 240 + } 241 + 242 + static inline int get_rx_desc_drv_info_size(__le32 *__pdesc) 243 + { 244 + return le32_get_bits(*(__pdesc), GENMASK(19, 16)); 245 + } 246 + 247 + static inline int get_rx_desc_shift(__le32 *__pdesc) 248 + { 249 + return le32_get_bits(*(__pdesc), GENMASK(25, 24)); 250 + } 251 + 252 + static inline int get_rx_desc_physt(__le32 *__pdesc) 253 + { 254 + return le32_get_bits(*(__pdesc), BIT(26)); 255 + } 256 + 257 + static inline int get_rx_desc_swdec(__le32 *__pdesc) 258 + { 259 + return le32_get_bits(*(__pdesc), BIT(27)); 260 + } 261 + 262 + static inline int get_rx_desc_own(__le32 *__pdesc) 263 + { 264 + return le32_get_bits(*(__pdesc), BIT(31)); 265 + } 266 + 267 + static inline void set_rx_desc_pkt_len(__le32 *__pdesc, u32 __val) 268 + { 269 + le32p_replace_bits(__pdesc, __val, GENMASK(13, 0)); 270 + } 271 + 272 + static inline void set_rx_desc_eor(__le32 *__pdesc, u32 __val) 273 + { 274 + le32p_replace_bits(__pdesc, __val, BIT(30)); 275 + } 276 + 277 + static inline void set_rx_desc_own(__le32 *__pdesc, u32 __val) 278 + { 279 + le32p_replace_bits(__pdesc, __val, BIT(31)); 280 + } 281 + 282 + static inline int get_rx_desc_macid(__le32 *__pdesc) 283 + { 284 + return le32_get_bits(*(__pdesc + 1), GENMASK(6, 0)); 285 + } 286 + 287 + static inline int get_rx_desc_paggr(__le32 *__pdesc) 288 + { 289 + return le32_get_bits(*(__pdesc + 1), BIT(15)); 290 + } 291 + 292 + static inline int get_rx_status_desc_rpt_sel(__le32 *__pdesc) 293 + { 294 + return le32_get_bits(*(__pdesc + 1), BIT(28)); 295 + } 296 + 297 + static inline int get_rx_desc_rxmcs(__le32 *__pdesc) 298 + { 299 + return le32_get_bits(*(__pdesc + 3), GENMASK(6, 0)); 300 + } 301 + 302 + static inline int get_rx_status_desc_pattern_match(__le32 *__pdesc) 303 + { 304 + return le32_get_bits(*(__pdesc + 3), BIT(29)); 305 + } 306 + 307 + static inline int get_rx_status_desc_unicast_match(__le32 *__pdesc) 308 + { 309 + return le32_get_bits(*(__pdesc + 3), BIT(30)); 310 + } 311 + 312 + static inline int get_rx_status_desc_magic_match(__le32 *__pdesc) 313 + { 314 + return le32_get_bits(*(__pdesc + 3), BIT(31)); 315 + } 316 + 317 + static inline int get_rx_desc_splcp(__le32 *__pdesc) 318 + { 319 + return le32_get_bits(*(__pdesc + 4), BIT(0)); 320 + } 321 + 322 + static inline int get_rx_desc_bw(__le32 *__pdesc) 323 + { 324 + return le32_get_bits(*(__pdesc + 4), GENMASK(5, 4)); 325 + } 326 + 327 + static inline int get_rx_desc_tsfl(__le32 *__pdesc) 328 + { 329 + return le32_to_cpu(*(__pdesc + 5)); 330 + } 331 + 332 + static inline int get_rx_desc_buff_addr(__le32 *__pdesc) 333 + { 334 + return le32_to_cpu(*(__pdesc + 6)); 335 + } 336 + 337 + static inline void set_rx_desc_buff_addr(__le32 *__pdesc, u32 __val) 338 + { 339 + *(__pdesc + 6) = cpu_to_le32(__val); 340 + } 320 341 321 342 /* TX report 2 format in Rx desc*/ 322 343 323 - #define GET_RX_RPT2_DESC_PKT_LEN(__status) \ 324 - LE_BITS_TO_4BYTE(__status, 0, 9) 325 - #define GET_RX_RPT2_DESC_MACID_VALID_1(__status) \ 326 - LE_BITS_TO_4BYTE(__status+16, 0, 32) 327 - #define GET_RX_RPT2_DESC_MACID_VALID_2(__status) \ 328 - LE_BITS_TO_4BYTE(__status+20, 0, 32) 344 + static inline int get_rx_rpt2_desc_macid_valid_1(__le32 *__status) 345 + { 346 + return le32_to_cpu(*(__status + 4)); 347 + } 329 348 330 - #define SET_EARLYMODE_PKTNUM(__paddr, __value) \ 331 - SET_BITS_TO_LE_4BYTE(__paddr, 0, 4, __value) 332 - #define SET_EARLYMODE_LEN0(__paddr, __value) \ 333 - SET_BITS_TO_LE_4BYTE(__paddr, 4, 12, __value) 334 - #define SET_EARLYMODE_LEN1(__paddr, __value) \ 335 - SET_BITS_TO_LE_4BYTE(__paddr, 16, 12, __value) 336 - #define SET_EARLYMODE_LEN2_1(__paddr, __value) \ 337 - SET_BITS_TO_LE_4BYTE(__paddr, 28, 4, __value) 338 - #define SET_EARLYMODE_LEN2_2(__paddr, __value) \ 339 - SET_BITS_TO_LE_4BYTE(__paddr+4, 0, 8, __value) 340 - #define SET_EARLYMODE_LEN3(__paddr, __value) \ 341 - SET_BITS_TO_LE_4BYTE(__paddr+4, 8, 12, __value) 342 - #define SET_EARLYMODE_LEN4(__paddr, __value) \ 343 - SET_BITS_TO_LE_4BYTE(__paddr+4, 20, 12, __value) 349 + static inline int get_rx_rpt2_desc_macid_valid_2(__le32 *__status) 350 + { 351 + return le32_to_cpu(*(__status + 5)); 352 + } 344 353 345 - #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ 346 - do { \ 347 - if (_size > TX_DESC_NEXT_DESC_OFFSET) \ 348 - memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \ 349 - else \ 350 - memset(__pdesc, 0, _size); \ 351 - } while (0) 354 + static inline void set_earlymode_pktnum(__le32 *__paddr, u32 __value) 355 + { 356 + le32p_replace_bits(__paddr, __value, GENMASK(3, 0)); 357 + } 358 + 359 + static inline void set_earlymode_len0(__le32 *__paddr, u32 __value) 360 + { 361 + le32p_replace_bits(__paddr, __value, GENMASK(15, 4)); 362 + } 363 + 364 + static inline void set_earlymode_len1(__le32 *__paddr, u32 __value) 365 + { 366 + le32p_replace_bits(__paddr, __value, GENMASK(27, 16)); 367 + } 368 + 369 + static inline void set_earlymode_len2_1(__le32 *__paddr, u32 __value) 370 + { 371 + le32p_replace_bits(__paddr, __value, GENMASK(31, 28)); 372 + } 373 + 374 + static inline void set_earlymode_len2_2(__le32 *__paddr, u32 __value) 375 + { 376 + le32p_replace_bits(__paddr, __value, GENMASK(7, 0)); 377 + } 378 + 379 + static inline void set_earlymode_len3(__le32 *__paddr, u32 __value) 380 + { 381 + le32p_replace_bits((__paddr + 1), __value, GENMASK(19, 8)); 382 + } 383 + 384 + static inline void set_earlymode_len4(__le32 *__paddr, u32 __value) 385 + { 386 + le32p_replace_bits((__paddr + 1), __value, GENMASK(31, 20)); 387 + } 388 + 389 + static inline void clear_pci_tx_desc_content(__le32 *__pdesc, int _size) 390 + { 391 + if (_size > TX_DESC_NEXT_DESC_OFFSET) 392 + memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); 393 + else 394 + memset(__pdesc, 0, _size); 395 + } 352 396 353 397 #define RTL8821AE_RX_HAL_IS_CCK_RATE(rxmcs)\ 354 398 (rxmcs == DESC_RATE1M ||\
+3 -2
drivers/net/wireless/realtek/rtlwifi/usb.c
··· 1064 1064 rtlpriv->cfg->ops->read_eeprom_info(hw); 1065 1065 err = _rtl_usb_init(hw); 1066 1066 if (err) 1067 - goto error_out; 1067 + goto error_out2; 1068 1068 rtl_usb_init_sw(hw); 1069 1069 /* Init mac80211 sw */ 1070 1070 err = rtl_init_core(hw); 1071 1071 if (err) { 1072 1072 pr_err("Can't allocate sw for mac80211\n"); 1073 - goto error_out; 1073 + goto error_out2; 1074 1074 } 1075 1075 if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 1076 1076 pr_err("Can't init_sw_vars\n"); ··· 1091 1091 1092 1092 error_out: 1093 1093 rtl_deinit_core(hw); 1094 + error_out2: 1094 1095 _rtl_usb_io_handler_release(hw); 1095 1096 usb_put_dev(udev); 1096 1097 complete(&rtlpriv->firmware_loading_complete);
+1
drivers/net/wireless/realtek/rtlwifi/wifi.h
··· 13 13 #include <linux/usb.h> 14 14 #include <net/mac80211.h> 15 15 #include <linux/completion.h> 16 + #include <linux/bitfield.h> 16 17 #include "debug.h" 17 18 18 19 #define MASKBYTE0 0xff
+1 -1
drivers/net/wireless/realtek/rtw88/hci.h
··· 97 97 rtw_write8(rtwdev, addr, val | bit); 98 98 } 99 99 100 - static inline void rtw_writ16_set(struct rtw_dev *rtwdev, u32 addr, u16 bit) 100 + static inline void rtw_write16_set(struct rtw_dev *rtwdev, u32 addr, u16 bit) 101 101 { 102 102 u16 val; 103 103
+7 -1
drivers/net/wireless/realtek/rtw88/mac.c
··· 285 285 goto err; 286 286 287 287 ret = rtw_mac_power_switch(rtwdev, true); 288 - if (ret) 288 + if (ret == -EALREADY) { 289 + rtw_mac_power_switch(rtwdev, false); 290 + ret = rtw_mac_power_switch(rtwdev, true); 291 + if (ret) 292 + goto err; 293 + } else if (ret) { 289 294 goto err; 295 + } 290 296 291 297 ret = rtw_mac_init_system_cfg(rtwdev); 292 298 if (ret)
+32
drivers/net/wireless/realtek/rtw88/mac80211.c
··· 85 85 .bssid = {.addr = 0x0618}, 86 86 .net_type = {.addr = 0x0100, .mask = 0x30000}, 87 87 .aid = {.addr = 0x06a8, .mask = 0x7ff}, 88 + .bcn_ctrl = {.addr = 0x0550, .mask = 0xff}, 88 89 }, 89 90 [1] = { 90 91 .mac_addr = {.addr = 0x0700}, 91 92 .bssid = {.addr = 0x0708}, 92 93 .net_type = {.addr = 0x0100, .mask = 0xc0000}, 93 94 .aid = {.addr = 0x0710, .mask = 0x7ff}, 95 + .bcn_ctrl = {.addr = 0x0551, .mask = 0xff}, 94 96 }, 95 97 [2] = { 96 98 .mac_addr = {.addr = 0x1620}, 97 99 .bssid = {.addr = 0x1628}, 98 100 .net_type = {.addr = 0x1100, .mask = 0x3}, 99 101 .aid = {.addr = 0x1600, .mask = 0x7ff}, 102 + .bcn_ctrl = {.addr = 0x0578, .mask = 0xff}, 100 103 }, 101 104 [3] = { 102 105 .mac_addr = {.addr = 0x1630}, 103 106 .bssid = {.addr = 0x1638}, 104 107 .net_type = {.addr = 0x1100, .mask = 0xc}, 105 108 .aid = {.addr = 0x1604, .mask = 0x7ff}, 109 + .bcn_ctrl = {.addr = 0x0579, .mask = 0xff}, 106 110 }, 107 111 [4] = { 108 112 .mac_addr = {.addr = 0x1640}, 109 113 .bssid = {.addr = 0x1648}, 110 114 .net_type = {.addr = 0x1100, .mask = 0x30}, 111 115 .aid = {.addr = 0x1608, .mask = 0x7ff}, 116 + .bcn_ctrl = {.addr = 0x057a, .mask = 0xff}, 112 117 }, 113 118 }; 114 119 ··· 125 120 enum rtw_net_type net_type; 126 121 u32 config = 0; 127 122 u8 port = 0; 123 + u8 bcn_ctrl = 0; 128 124 129 125 rtwvif->port = port; 130 126 rtwvif->vif = vif; ··· 142 136 case NL80211_IFTYPE_AP: 143 137 case NL80211_IFTYPE_MESH_POINT: 144 138 net_type = RTW_NET_AP_MODE; 139 + bcn_ctrl = BIT_EN_BCN_FUNCTION | BIT_DIS_TSF_UDT; 145 140 break; 146 141 case NL80211_IFTYPE_ADHOC: 147 142 net_type = RTW_NET_AD_HOC; 143 + bcn_ctrl = BIT_EN_BCN_FUNCTION | BIT_DIS_TSF_UDT; 148 144 break; 149 145 case NL80211_IFTYPE_STATION: 150 146 default: 151 147 net_type = RTW_NET_NO_LINK; 148 + bcn_ctrl = BIT_EN_BCN_FUNCTION; 152 149 break; 153 150 } 154 151 ··· 159 150 config |= PORT_SET_MAC_ADDR; 160 151 rtwvif->net_type = net_type; 161 152 config |= PORT_SET_NET_TYPE; 153 + rtwvif->bcn_ctrl = bcn_ctrl; 154 + config |= PORT_SET_BCN_CTRL; 162 155 rtw_vif_port_config(rtwdev, rtwvif, config); 163 156 164 157 mutex_unlock(&rtwdev->mutex); ··· 184 173 config |= PORT_SET_MAC_ADDR; 185 174 rtwvif->net_type = RTW_NET_NO_LINK; 186 175 config |= PORT_SET_NET_TYPE; 176 + rtwvif->bcn_ctrl = 0; 177 + config |= PORT_SET_BCN_CTRL; 187 178 rtw_vif_port_config(rtwdev, rtwvif, config); 188 179 189 180 mutex_unlock(&rtwdev->mutex); ··· 459 446 { 460 447 struct rtw_dev *rtwdev = hw->priv; 461 448 struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; 449 + u32 config = 0; 462 450 463 451 rtw_leave_lps(rtwdev, rtwvif); 464 452 453 + mutex_lock(&rtwdev->mutex); 454 + 455 + ether_addr_copy(rtwvif->mac_addr, mac_addr); 456 + config |= PORT_SET_MAC_ADDR; 457 + rtw_vif_port_config(rtwdev, rtwvif, config); 458 + 465 459 rtw_flag_set(rtwdev, RTW_FLAG_DIG_DISABLE); 466 460 rtw_flag_set(rtwdev, RTW_FLAG_SCANNING); 461 + 462 + mutex_unlock(&rtwdev->mutex); 467 463 } 468 464 469 465 static void rtw_ops_sw_scan_complete(struct ieee80211_hw *hw, 470 466 struct ieee80211_vif *vif) 471 467 { 472 468 struct rtw_dev *rtwdev = hw->priv; 469 + struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; 470 + u32 config = 0; 471 + 472 + mutex_lock(&rtwdev->mutex); 473 473 474 474 rtw_flag_clear(rtwdev, RTW_FLAG_SCANNING); 475 475 rtw_flag_clear(rtwdev, RTW_FLAG_DIG_DISABLE); 476 + 477 + ether_addr_copy(rtwvif->mac_addr, vif->addr); 478 + config |= PORT_SET_MAC_ADDR; 479 + rtw_vif_port_config(rtwdev, rtwvif, config); 480 + 481 + mutex_unlock(&rtwdev->mutex); 476 482 } 477 483 478 484 const struct ieee80211_ops rtw_ops = {
+9 -1
drivers/net/wireless/realtek/rtw88/main.c
··· 20 20 module_param_named(support_lps, rtw_fw_support_lps, bool, 0644); 21 21 module_param_named(debug_mask, rtw_debug_mask, uint, 0644); 22 22 23 - MODULE_PARM_DESC(support_lps, "Set Y to enable LPS support"); 23 + MODULE_PARM_DESC(support_lps, "Set Y to enable Leisure Power Save support, to turn radio off between beacons"); 24 24 MODULE_PARM_DESC(debug_mask, "Debugging mask"); 25 25 26 26 static struct ieee80211_channel rtw_channeltable_2g[] = { ··· 308 308 addr = rtwvif->conf->aid.addr; 309 309 mask = rtwvif->conf->aid.mask; 310 310 rtw_write32_mask(rtwdev, addr, mask, rtwvif->aid); 311 + } 312 + if (config & PORT_SET_BCN_CTRL) { 313 + addr = rtwvif->conf->bcn_ctrl.addr; 314 + mask = rtwvif->conf->bcn_ctrl.mask; 315 + rtw_write8_mask(rtwdev, addr, mask, rtwvif->bcn_ctrl); 311 316 } 312 317 } 313 318 ··· 1174 1169 ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); 1175 1170 ieee80211_hw_set(hw, SUPPORTS_PS); 1176 1171 ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); 1172 + ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); 1177 1173 1178 1174 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 1179 1175 BIT(NL80211_IFTYPE_AP) | ··· 1183 1177 1184 1178 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS | 1185 1179 WIPHY_FLAG_TDLS_EXTERNAL_SETUP; 1180 + 1181 + hw->wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR; 1186 1182 1187 1183 rtw_set_supported_band(hw, rtwdev->chip); 1188 1184 SET_IEEE80211_PERM_ADDR(hw, rtwdev->efuse.addr);
+11
drivers/net/wireless/realtek/rtw88/main.h
··· 431 431 PORT_SET_BSSID = BIT(1), 432 432 PORT_SET_NET_TYPE = BIT(2), 433 433 PORT_SET_AID = BIT(3), 434 + PORT_SET_BCN_CTRL = BIT(4), 434 435 }; 435 436 436 437 struct rtw_vif_port { ··· 439 438 struct rtw_hw_reg bssid; 440 439 struct rtw_hw_reg net_type; 441 440 struct rtw_hw_reg aid; 441 + struct rtw_hw_reg bcn_ctrl; 442 442 }; 443 443 444 444 struct rtw_tx_pkt_info { ··· 593 591 u8 mac_addr[ETH_ALEN]; 594 592 u8 bssid[ETH_ALEN]; 595 593 u8 port; 594 + u8 bcn_ctrl; 596 595 const struct rtw_vif_port *conf; 597 596 598 597 struct rtw_traffic_stats stats; ··· 841 838 u32 rfe_defs_size; 842 839 }; 843 840 841 + #define DACK_MSBK_BACKUP_NUM 0xf 842 + #define DACK_DCK_BACKUP_NUM 0x2 843 + 844 844 struct rtw_dm_info { 845 845 u32 cck_fa_cnt; 846 846 u32 ofdm_fa_cnt; ··· 859 853 860 854 u8 cck_gi_u_bnd; 861 855 u8 cck_gi_l_bnd; 856 + 857 + /* backup dack results for each path and I/Q */ 858 + u32 dack_adck[RTW_RF_PATH_MAX]; 859 + u16 dack_msbk[RTW_RF_PATH_MAX][2][DACK_MSBK_BACKUP_NUM]; 860 + u8 dack_dck[RTW_RF_PATH_MAX][2][DACK_DCK_BACKUP_NUM]; 862 861 }; 863 862 864 863 struct rtw_efuse {
+6 -4
drivers/net/wireless/realtek/rtw88/pci.c
··· 487 487 } 488 488 489 489 static u8 ac_to_hwq[] = { 490 - [0] = RTW_TX_QUEUE_VO, 491 - [1] = RTW_TX_QUEUE_VI, 492 - [2] = RTW_TX_QUEUE_BE, 493 - [3] = RTW_TX_QUEUE_BK, 490 + [IEEE80211_AC_VO] = RTW_TX_QUEUE_VO, 491 + [IEEE80211_AC_VI] = RTW_TX_QUEUE_VI, 492 + [IEEE80211_AC_BE] = RTW_TX_QUEUE_BE, 493 + [IEEE80211_AC_BK] = RTW_TX_QUEUE_BK, 494 494 }; 495 495 496 496 static u8 rtw_hw_queue_mapping(struct sk_buff *skb) ··· 504 504 queue = RTW_TX_QUEUE_BCN; 505 505 else if (unlikely(ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc))) 506 506 queue = RTW_TX_QUEUE_MGMT; 507 + else if (WARN_ON_ONCE(q_mapping >= ARRAY_SIZE(ac_to_hwq))) 508 + queue = ac_to_hwq[IEEE80211_AC_BE]; 507 509 else 508 510 queue = ac_to_hwq[q_mapping]; 509 511
+9 -4
drivers/net/wireless/realtek/rtw88/phy.c
··· 601 601 direct_addr = base_addr[rf_path] + (addr << 2); 602 602 mask &= RFREG_MASK; 603 603 604 - rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, DISABLE_PI); 605 - rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, DISABLE_PI); 604 + if (addr == RF_CFGCH) { 605 + rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, DISABLE_PI); 606 + rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, DISABLE_PI); 607 + } 608 + 606 609 rtw_write32_mask(rtwdev, direct_addr, mask, data); 607 610 608 611 udelay(1); 609 612 610 - rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, ENABLE_PI); 611 - rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, ENABLE_PI); 613 + if (addr == RF_CFGCH) { 614 + rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, ENABLE_PI); 615 + rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, ENABLE_PI); 616 + } 612 617 613 618 return true; 614 619 }
+412 -24
drivers/net/wireless/realtek/rtw88/rtw8822c.c
··· 203 203 *val = t; 204 204 } 205 205 206 - static u32 rtw8822c_get_path_base_addr(u8 path) 206 + static u32 rtw8822c_get_path_write_addr(u8 path) 207 207 { 208 208 u32 base_addr; 209 209 ··· 213 213 break; 214 214 case RF_PATH_B: 215 215 base_addr = 0x4100; 216 + break; 217 + default: 218 + WARN_ON(1); 219 + return -1; 220 + } 221 + 222 + return base_addr; 223 + } 224 + 225 + static u32 rtw8822c_get_path_read_addr(u8 path) 226 + { 227 + u32 base_addr; 228 + 229 + switch (path) { 230 + case RF_PATH_A: 231 + base_addr = 0x2800; 232 + break; 233 + case RF_PATH_B: 234 + base_addr = 0x4500; 216 235 break; 217 236 default: 218 237 WARN_ON(1); ··· 335 316 u32 iv[DACK_SN_8822C], qv[DACK_SN_8822C]; 336 317 u32 rf_a, rf_b; 337 318 338 - mdelay(10); 339 - 340 319 rf_a = rtw_read_rf(rtwdev, RF_PATH_A, 0x0, RFREG_MASK); 341 320 rf_b = rtw_read_rf(rtwdev, RF_PATH_B, 0x0, RFREG_MASK); 342 321 ··· 364 347 static void rtw8822c_dac_cal_adc(struct rtw_dev *rtwdev, 365 348 u8 path, u32 *adc_ic, u32 *adc_qc) 366 349 { 350 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 367 351 u32 ic = 0, qc = 0, temp = 0; 368 352 u32 base_addr; 369 353 u32 path_sel; ··· 372 354 373 355 rtw_dbg(rtwdev, RTW_DBG_RFK, "[DACK] ADCK path(%d)\n", path); 374 356 375 - base_addr = rtw8822c_get_path_base_addr(path); 357 + base_addr = rtw8822c_get_path_write_addr(path); 376 358 switch (path) { 377 359 case RF_PATH_A: 378 360 path_sel = 0xa0000; ··· 414 396 } 415 397 temp = (ic & 0x3ff) | ((qc & 0x3ff) << 10); 416 398 rtw_write32(rtwdev, base_addr + 0x68, temp); 399 + dm_info->dack_adck[path] = temp; 417 400 rtw_dbg(rtwdev, RTW_DBG_RFK, "[DACK] ADCK 0x%08x=0x08%x\n", 418 401 base_addr + 0x68, temp); 419 402 /* check ADC DC offset */ ··· 441 422 442 423 static void rtw8822c_dac_cal_step1(struct rtw_dev *rtwdev, u8 path) 443 424 { 425 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 444 426 u32 base_addr; 427 + u32 read_addr; 445 428 446 - base_addr = rtw8822c_get_path_base_addr(path); 429 + base_addr = rtw8822c_get_path_write_addr(path); 430 + read_addr = rtw8822c_get_path_read_addr(path); 447 431 432 + rtw_write32(rtwdev, base_addr + 0x68, dm_info->dack_adck[path]); 448 433 rtw_write32(rtwdev, base_addr + 0x0c, 0xdff00220); 449 434 if (path == RF_PATH_A) { 450 435 rtw_write32(rtwdev, base_addr + 0x60, 0xf0040ff0); ··· 470 447 rtw_write32(rtwdev, base_addr + 0xcc, 0x0a11fb89); 471 448 mdelay(1); 472 449 rtw_write32(rtwdev, base_addr + 0xb8, 0x62000000); 473 - mdelay(20); 474 450 rtw_write32(rtwdev, base_addr + 0xd4, 0x62000000); 475 451 mdelay(20); 452 + if (!check_hw_ready(rtwdev, read_addr + 0x08, 0x7fff80, 0xffff) || 453 + !check_hw_ready(rtwdev, read_addr + 0x34, 0x7fff80, 0xffff)) 454 + rtw_err(rtwdev, "failed to wait for dack ready\n"); 476 455 rtw_write32(rtwdev, base_addr + 0xb8, 0x02000000); 477 - mdelay(20); 456 + mdelay(1); 478 457 rtw_write32(rtwdev, base_addr + 0xbc, 0x0008ff87); 479 458 rtw_write32(rtwdev, 0x9b4, 0xdb6db600); 480 459 rtw_write32(rtwdev, base_addr + 0x10, 0x02d508c5); ··· 490 465 u32 base_addr; 491 466 u32 ic, qc, ic_in, qc_in; 492 467 493 - base_addr = rtw8822c_get_path_base_addr(path); 468 + base_addr = rtw8822c_get_path_write_addr(path); 494 469 rtw_write32_mask(rtwdev, base_addr + 0xbc, 0xf0000000, 0x0); 495 470 rtw_write32_mask(rtwdev, base_addr + 0xc0, 0xf, 0x8); 496 471 rtw_write32_mask(rtwdev, base_addr + 0xd8, 0xf0000000, 0x0); ··· 539 514 u32 *i_out, u32 *q_out) 540 515 { 541 516 u32 base_addr; 517 + u32 read_addr; 542 518 u32 ic, qc; 543 519 u32 temp; 544 520 545 - base_addr = rtw8822c_get_path_base_addr(path); 521 + base_addr = rtw8822c_get_path_write_addr(path); 522 + read_addr = rtw8822c_get_path_read_addr(path); 546 523 ic = *ic_in; 547 524 qc = *qc_in; 548 525 ··· 569 542 rtw_write32(rtwdev, base_addr + 0xcc, 0x0a11fb89); 570 543 mdelay(1); 571 544 rtw_write32(rtwdev, base_addr + 0xb8, 0x62000000); 572 - mdelay(20); 573 545 rtw_write32(rtwdev, base_addr + 0xd4, 0x62000000); 574 546 mdelay(20); 547 + if (!check_hw_ready(rtwdev, read_addr + 0x24, 0x07f80000, ic) || 548 + !check_hw_ready(rtwdev, read_addr + 0x50, 0x07f80000, qc)) 549 + rtw_err(rtwdev, "failed to write IQ vector to hardware\n"); 575 550 rtw_write32(rtwdev, base_addr + 0xb8, 0x02000000); 576 - mdelay(20); 551 + mdelay(1); 577 552 rtw_write32_mask(rtwdev, base_addr + 0xbc, 0xe, 0x3); 578 553 rtw_write32(rtwdev, 0x9b4, 0xdb6db600); 579 554 ··· 612 583 613 584 static void rtw8822c_dac_cal_step4(struct rtw_dev *rtwdev, u8 path) 614 585 { 615 - u32 base_addr = rtw8822c_get_path_base_addr(path); 586 + u32 base_addr = rtw8822c_get_path_write_addr(path); 616 587 617 588 rtw_write32(rtwdev, base_addr + 0x68, 0x0); 618 589 rtw_write32(rtwdev, base_addr + 0x10, 0x02d508c4); 619 590 rtw_write32_mask(rtwdev, base_addr + 0xbc, 0x1, 0x0); 620 591 rtw_write32_mask(rtwdev, base_addr + 0x30, BIT(30), 0x1); 592 + } 593 + 594 + static void rtw8822c_dac_cal_backup_vec(struct rtw_dev *rtwdev, 595 + u8 path, u8 vec, u32 w_addr, u32 r_addr) 596 + { 597 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 598 + u16 val; 599 + u32 i; 600 + 601 + if (WARN_ON(vec >= 2)) 602 + return; 603 + 604 + for (i = 0; i < DACK_MSBK_BACKUP_NUM; i++) { 605 + rtw_write32_mask(rtwdev, w_addr, 0xf0000000, i); 606 + val = (u16)rtw_read32_mask(rtwdev, r_addr, 0x7fc0000); 607 + dm_info->dack_msbk[path][vec][i] = val; 608 + } 609 + } 610 + 611 + static void rtw8822c_dac_cal_backup_path(struct rtw_dev *rtwdev, u8 path) 612 + { 613 + u32 w_off = 0x1c; 614 + u32 r_off = 0x2c; 615 + u32 w_addr, r_addr; 616 + 617 + if (WARN_ON(path >= 2)) 618 + return; 619 + 620 + /* backup I vector */ 621 + w_addr = rtw8822c_get_path_write_addr(path) + 0xb0; 622 + r_addr = rtw8822c_get_path_read_addr(path) + 0x10; 623 + rtw8822c_dac_cal_backup_vec(rtwdev, path, 0, w_addr, r_addr); 624 + 625 + /* backup Q vector */ 626 + w_addr = rtw8822c_get_path_write_addr(path) + 0xb0 + w_off; 627 + r_addr = rtw8822c_get_path_read_addr(path) + 0x10 + r_off; 628 + rtw8822c_dac_cal_backup_vec(rtwdev, path, 1, w_addr, r_addr); 629 + } 630 + 631 + static void rtw8822c_dac_cal_backup_dck(struct rtw_dev *rtwdev) 632 + { 633 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 634 + u8 val; 635 + 636 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKA_I_0, 0xf0000000); 637 + dm_info->dack_dck[RF_PATH_A][0][0] = val; 638 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKA_I_1, 0xf); 639 + dm_info->dack_dck[RF_PATH_A][0][1] = val; 640 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKA_Q_0, 0xf0000000); 641 + dm_info->dack_dck[RF_PATH_A][1][0] = val; 642 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKA_Q_1, 0xf); 643 + dm_info->dack_dck[RF_PATH_A][1][1] = val; 644 + 645 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKB_I_0, 0xf0000000); 646 + dm_info->dack_dck[RF_PATH_B][0][0] = val; 647 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKB_I_1, 0xf); 648 + dm_info->dack_dck[RF_PATH_B][1][0] = val; 649 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKB_Q_0, 0xf0000000); 650 + dm_info->dack_dck[RF_PATH_B][0][1] = val; 651 + val = (u8)rtw_read32_mask(rtwdev, REG_DCKB_Q_1, 0xf); 652 + dm_info->dack_dck[RF_PATH_B][1][1] = val; 653 + } 654 + 655 + static void rtw8822c_dac_cal_backup(struct rtw_dev *rtwdev) 656 + { 657 + u32 temp[3]; 658 + 659 + temp[0] = rtw_read32(rtwdev, 0x1860); 660 + temp[1] = rtw_read32(rtwdev, 0x4160); 661 + temp[2] = rtw_read32(rtwdev, 0x9b4); 662 + 663 + /* set clock */ 664 + rtw_write32(rtwdev, 0x9b4, 0xdb66db00); 665 + 666 + /* backup path-A I/Q */ 667 + rtw_write32_clr(rtwdev, 0x1830, BIT(30)); 668 + rtw_write32_mask(rtwdev, 0x1860, 0xfc000000, 0x3c); 669 + rtw8822c_dac_cal_backup_path(rtwdev, RF_PATH_A); 670 + 671 + /* backup path-B I/Q */ 672 + rtw_write32_clr(rtwdev, 0x4130, BIT(30)); 673 + rtw_write32_mask(rtwdev, 0x4160, 0xfc000000, 0x3c); 674 + rtw8822c_dac_cal_backup_path(rtwdev, RF_PATH_B); 675 + 676 + rtw8822c_dac_cal_backup_dck(rtwdev); 677 + rtw_write32_set(rtwdev, 0x1830, BIT(30)); 678 + rtw_write32_set(rtwdev, 0x4130, BIT(30)); 679 + 680 + rtw_write32(rtwdev, 0x1860, temp[0]); 681 + rtw_write32(rtwdev, 0x4160, temp[1]); 682 + rtw_write32(rtwdev, 0x9b4, temp[2]); 683 + } 684 + 685 + static void rtw8822c_dac_cal_restore_dck(struct rtw_dev *rtwdev) 686 + { 687 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 688 + u8 val; 689 + 690 + rtw_write32_set(rtwdev, REG_DCKA_I_0, BIT(19)); 691 + val = dm_info->dack_dck[RF_PATH_A][0][0]; 692 + rtw_write32_mask(rtwdev, REG_DCKA_I_0, 0xf0000000, val); 693 + val = dm_info->dack_dck[RF_PATH_A][0][1]; 694 + rtw_write32_mask(rtwdev, REG_DCKA_I_1, 0xf, val); 695 + 696 + rtw_write32_set(rtwdev, REG_DCKA_Q_0, BIT(19)); 697 + val = dm_info->dack_dck[RF_PATH_A][1][0]; 698 + rtw_write32_mask(rtwdev, REG_DCKA_Q_0, 0xf0000000, val); 699 + val = dm_info->dack_dck[RF_PATH_A][1][1]; 700 + rtw_write32_mask(rtwdev, REG_DCKA_Q_1, 0xf, val); 701 + 702 + rtw_write32_set(rtwdev, REG_DCKB_I_0, BIT(19)); 703 + val = dm_info->dack_dck[RF_PATH_B][0][0]; 704 + rtw_write32_mask(rtwdev, REG_DCKB_I_0, 0xf0000000, val); 705 + val = dm_info->dack_dck[RF_PATH_B][0][1]; 706 + rtw_write32_mask(rtwdev, REG_DCKB_I_1, 0xf, val); 707 + 708 + rtw_write32_set(rtwdev, REG_DCKB_Q_0, BIT(19)); 709 + val = dm_info->dack_dck[RF_PATH_B][1][0]; 710 + rtw_write32_mask(rtwdev, REG_DCKB_Q_0, 0xf0000000, val); 711 + val = dm_info->dack_dck[RF_PATH_B][1][1]; 712 + rtw_write32_mask(rtwdev, REG_DCKB_Q_1, 0xf, val); 713 + } 714 + 715 + static void rtw8822c_dac_cal_restore_prepare(struct rtw_dev *rtwdev) 716 + { 717 + rtw_write32(rtwdev, 0x9b4, 0xdb66db00); 718 + 719 + rtw_write32_mask(rtwdev, 0x18b0, BIT(27), 0x0); 720 + rtw_write32_mask(rtwdev, 0x18cc, BIT(27), 0x0); 721 + rtw_write32_mask(rtwdev, 0x41b0, BIT(27), 0x0); 722 + rtw_write32_mask(rtwdev, 0x41cc, BIT(27), 0x0); 723 + 724 + rtw_write32_mask(rtwdev, 0x1830, BIT(30), 0x0); 725 + rtw_write32_mask(rtwdev, 0x1860, 0xfc000000, 0x3c); 726 + rtw_write32_mask(rtwdev, 0x18b4, BIT(0), 0x1); 727 + rtw_write32_mask(rtwdev, 0x18d0, BIT(0), 0x1); 728 + 729 + rtw_write32_mask(rtwdev, 0x4130, BIT(30), 0x0); 730 + rtw_write32_mask(rtwdev, 0x4160, 0xfc000000, 0x3c); 731 + rtw_write32_mask(rtwdev, 0x41b4, BIT(0), 0x1); 732 + rtw_write32_mask(rtwdev, 0x41d0, BIT(0), 0x1); 733 + 734 + rtw_write32_mask(rtwdev, 0x18b0, 0xf00, 0x0); 735 + rtw_write32_mask(rtwdev, 0x18c0, BIT(14), 0x0); 736 + rtw_write32_mask(rtwdev, 0x18cc, 0xf00, 0x0); 737 + rtw_write32_mask(rtwdev, 0x18dc, BIT(14), 0x0); 738 + 739 + rtw_write32_mask(rtwdev, 0x18b0, BIT(0), 0x0); 740 + rtw_write32_mask(rtwdev, 0x18cc, BIT(0), 0x0); 741 + rtw_write32_mask(rtwdev, 0x18b0, BIT(0), 0x1); 742 + rtw_write32_mask(rtwdev, 0x18cc, BIT(0), 0x1); 743 + 744 + rtw8822c_dac_cal_restore_dck(rtwdev); 745 + 746 + rtw_write32_mask(rtwdev, 0x18c0, 0x38000, 0x7); 747 + rtw_write32_mask(rtwdev, 0x18dc, 0x38000, 0x7); 748 + rtw_write32_mask(rtwdev, 0x41c0, 0x38000, 0x7); 749 + rtw_write32_mask(rtwdev, 0x41dc, 0x38000, 0x7); 750 + 751 + rtw_write32_mask(rtwdev, 0x18b8, BIT(26) | BIT(25), 0x1); 752 + rtw_write32_mask(rtwdev, 0x18d4, BIT(26) | BIT(25), 0x1); 753 + 754 + rtw_write32_mask(rtwdev, 0x41b0, 0xf00, 0x0); 755 + rtw_write32_mask(rtwdev, 0x41c0, BIT(14), 0x0); 756 + rtw_write32_mask(rtwdev, 0x41cc, 0xf00, 0x0); 757 + rtw_write32_mask(rtwdev, 0x41dc, BIT(14), 0x0); 758 + 759 + rtw_write32_mask(rtwdev, 0x41b0, BIT(0), 0x0); 760 + rtw_write32_mask(rtwdev, 0x41cc, BIT(0), 0x0); 761 + rtw_write32_mask(rtwdev, 0x41b0, BIT(0), 0x1); 762 + rtw_write32_mask(rtwdev, 0x41cc, BIT(0), 0x1); 763 + 764 + rtw_write32_mask(rtwdev, 0x41b8, BIT(26) | BIT(25), 0x1); 765 + rtw_write32_mask(rtwdev, 0x41d4, BIT(26) | BIT(25), 0x1); 766 + } 767 + 768 + static bool rtw8822c_dac_cal_restore_wait(struct rtw_dev *rtwdev, 769 + u32 target_addr, u32 toggle_addr) 770 + { 771 + u32 cnt = 0; 772 + 773 + do { 774 + rtw_write32_mask(rtwdev, toggle_addr, BIT(26) | BIT(25), 0x0); 775 + rtw_write32_mask(rtwdev, toggle_addr, BIT(26) | BIT(25), 0x2); 776 + 777 + if (rtw_read32_mask(rtwdev, target_addr, 0xf) == 0x6) 778 + return true; 779 + 780 + } while (cnt++ < 100); 781 + 782 + return false; 783 + } 784 + 785 + static bool rtw8822c_dac_cal_restore_path(struct rtw_dev *rtwdev, u8 path) 786 + { 787 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 788 + u32 w_off = 0x1c; 789 + u32 r_off = 0x2c; 790 + u32 w_i, r_i, w_q, r_q; 791 + u32 value; 792 + u32 i; 793 + 794 + w_i = rtw8822c_get_path_write_addr(path) + 0xb0; 795 + r_i = rtw8822c_get_path_read_addr(path) + 0x08; 796 + w_q = rtw8822c_get_path_write_addr(path) + 0xb0 + w_off; 797 + r_q = rtw8822c_get_path_read_addr(path) + 0x08 + r_off; 798 + 799 + if (!rtw8822c_dac_cal_restore_wait(rtwdev, r_i, w_i + 0x8)) 800 + return false; 801 + 802 + for (i = 0; i < DACK_MSBK_BACKUP_NUM; i++) { 803 + rtw_write32_mask(rtwdev, w_i + 0x4, BIT(2), 0x0); 804 + value = dm_info->dack_msbk[path][0][i]; 805 + rtw_write32_mask(rtwdev, w_i + 0x4, 0xff8, value); 806 + rtw_write32_mask(rtwdev, w_i, 0xf0000000, i); 807 + rtw_write32_mask(rtwdev, w_i + 0x4, BIT(2), 0x1); 808 + } 809 + 810 + rtw_write32_mask(rtwdev, w_i + 0x4, BIT(2), 0x0); 811 + 812 + if (!rtw8822c_dac_cal_restore_wait(rtwdev, r_q, w_q + 0x8)) 813 + return false; 814 + 815 + for (i = 0; i < DACK_MSBK_BACKUP_NUM; i++) { 816 + rtw_write32_mask(rtwdev, w_q + 0x4, BIT(2), 0x0); 817 + value = dm_info->dack_msbk[path][1][i]; 818 + rtw_write32_mask(rtwdev, w_q + 0x4, 0xff8, value); 819 + rtw_write32_mask(rtwdev, w_q, 0xf0000000, i); 820 + rtw_write32_mask(rtwdev, w_q + 0x4, BIT(2), 0x1); 821 + } 822 + rtw_write32_mask(rtwdev, w_q + 0x4, BIT(2), 0x0); 823 + 824 + rtw_write32_mask(rtwdev, w_i + 0x8, BIT(26) | BIT(25), 0x0); 825 + rtw_write32_mask(rtwdev, w_q + 0x8, BIT(26) | BIT(25), 0x0); 826 + rtw_write32_mask(rtwdev, w_i + 0x4, BIT(0), 0x0); 827 + rtw_write32_mask(rtwdev, w_q + 0x4, BIT(0), 0x0); 828 + 829 + return true; 830 + } 831 + 832 + static bool __rtw8822c_dac_cal_restore(struct rtw_dev *rtwdev) 833 + { 834 + if (!rtw8822c_dac_cal_restore_path(rtwdev, RF_PATH_A)) 835 + return false; 836 + 837 + if (!rtw8822c_dac_cal_restore_path(rtwdev, RF_PATH_B)) 838 + return false; 839 + 840 + return true; 841 + } 842 + 843 + static bool rtw8822c_dac_cal_restore(struct rtw_dev *rtwdev) 844 + { 845 + struct rtw_dm_info *dm_info = &rtwdev->dm_info; 846 + u32 temp[3]; 847 + 848 + /* sample the first element for both path's IQ vector */ 849 + if (dm_info->dack_msbk[RF_PATH_A][0][0] == 0 && 850 + dm_info->dack_msbk[RF_PATH_A][1][0] == 0 && 851 + dm_info->dack_msbk[RF_PATH_B][0][0] == 0 && 852 + dm_info->dack_msbk[RF_PATH_B][1][0] == 0) 853 + return false; 854 + 855 + temp[0] = rtw_read32(rtwdev, 0x1860); 856 + temp[1] = rtw_read32(rtwdev, 0x4160); 857 + temp[2] = rtw_read32(rtwdev, 0x9b4); 858 + 859 + rtw8822c_dac_cal_restore_prepare(rtwdev); 860 + if (!check_hw_ready(rtwdev, 0x2808, 0x7fff80, 0xffff) || 861 + !check_hw_ready(rtwdev, 0x2834, 0x7fff80, 0xffff) || 862 + !check_hw_ready(rtwdev, 0x4508, 0x7fff80, 0xffff) || 863 + !check_hw_ready(rtwdev, 0x4534, 0x7fff80, 0xffff)) 864 + return false; 865 + 866 + if (!__rtw8822c_dac_cal_restore(rtwdev)) { 867 + rtw_err(rtwdev, "failed to restore dack vectors\n"); 868 + return false; 869 + } 870 + 871 + rtw_write32_mask(rtwdev, 0x1830, BIT(30), 0x1); 872 + rtw_write32_mask(rtwdev, 0x4130, BIT(30), 0x1); 873 + rtw_write32(rtwdev, 0x1860, temp[0]); 874 + rtw_write32(rtwdev, 0x4160, temp[1]); 875 + rtw_write32_mask(rtwdev, 0x18b0, BIT(27), 0x1); 876 + rtw_write32_mask(rtwdev, 0x18cc, BIT(27), 0x1); 877 + rtw_write32_mask(rtwdev, 0x41b0, BIT(27), 0x1); 878 + rtw_write32_mask(rtwdev, 0x41cc, BIT(27), 0x1); 879 + rtw_write32(rtwdev, 0x9b4, temp[2]); 880 + 881 + return true; 621 882 } 622 883 623 884 static void rtw8822c_rf_dac_cal(struct rtw_dev *rtwdev) ··· 918 599 u32 i_a = 0x0, q_a = 0x0, i_b = 0x0, q_b = 0x0; 919 600 u32 ic_a = 0x0, qc_a = 0x0, ic_b = 0x0, qc_b = 0x0; 920 601 u32 adc_ic_a = 0x0, adc_qc_a = 0x0, adc_ic_b = 0x0, adc_qc_b = 0x0; 602 + 603 + if (rtw8822c_dac_cal_restore(rtwdev)) 604 + return; 605 + 606 + /* not able to restore, do it */ 921 607 922 608 rtw8822c_dac_backup_reg(rtwdev, backup, backup_rf); 923 609 ··· 967 643 rtw_write8(rtwdev, 0x1bcc, 0x0); 968 644 969 645 rtw8822c_dac_restore_reg(rtwdev, backup, backup_rf); 646 + 647 + /* backup results to restore, saving a lot of time */ 648 + rtw8822c_dac_cal_backup(rtwdev); 970 649 971 650 rtw_dbg(rtwdev, RTW_DBG_RFK, "[DACK] path A: ic=0x%x, qc=0x%x\n", ic_a, qc_a); 972 651 rtw_dbg(rtwdev, RTW_DBG_RFK, "[DACK] path B: ic=0x%x, qc=0x%x\n", ic_b, qc_b); ··· 1342 1015 rtw_write32_clr(rtwdev, REG_CCKTXONLY, BIT_BB_CCK_CHECK_EN); 1343 1016 rtw_write32_mask(rtwdev, REG_CCAMSK, 0x3F000000, 0xF); 1344 1017 1345 - rtw_write32_mask(rtwdev, REG_RXAGCCTL0, 0x1f0, 0x0); 1346 - rtw_write32_mask(rtwdev, REG_RXAGCCTL, 0x1f0, 0x0); 1018 + switch (bw) { 1019 + case RTW_CHANNEL_WIDTH_20: 1020 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_CCK, 1021 + 0x5); 1022 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_CCK, 1023 + 0x5); 1024 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_OFDM, 1025 + 0x6); 1026 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_OFDM, 1027 + 0x6); 1028 + break; 1029 + case RTW_CHANNEL_WIDTH_40: 1030 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_CCK, 1031 + 0x4); 1032 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_CCK, 1033 + 0x4); 1034 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_OFDM, 1035 + 0x0); 1036 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_OFDM, 1037 + 0x0); 1038 + break; 1039 + } 1347 1040 if (channel == 13 || channel == 14) 1348 1041 rtw_write32_mask(rtwdev, REG_SCOTRK, 0xfff, 0x969); 1349 1042 else if (channel == 11 || channel == 12) ··· 1408 1061 rtw_write32_mask(rtwdev, REG_CCAMSK, 0x3F000000, 0x22); 1409 1062 rtw_write32_mask(rtwdev, REG_TXDFIR0, 0x70, 0x3); 1410 1063 if (channel >= 36 && channel <= 64) { 1411 - rtw_write32_mask(rtwdev, REG_RXAGCCTL0, 0x1f0, 0x1); 1412 - rtw_write32_mask(rtwdev, REG_RXAGCCTL, 0x1f0, 0x1); 1064 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_OFDM, 1065 + 0x1); 1066 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_OFDM, 1067 + 0x1); 1413 1068 } else if (channel >= 100 && channel <= 144) { 1414 - rtw_write32_mask(rtwdev, REG_RXAGCCTL0, 0x1f0, 0x2); 1415 - rtw_write32_mask(rtwdev, REG_RXAGCCTL, 0x1f0, 0x2); 1069 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_OFDM, 1070 + 0x2); 1071 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_OFDM, 1072 + 0x2); 1416 1073 } else if (channel >= 149) { 1417 - rtw_write32_mask(rtwdev, REG_RXAGCCTL0, 0x1f0, 0x3); 1418 - rtw_write32_mask(rtwdev, REG_RXAGCCTL, 0x1f0, 0x3); 1074 + rtw_write32_mask(rtwdev, REG_RXAGCCTL0, BITS_RXAGC_OFDM, 1075 + 0x3); 1076 + rtw_write32_mask(rtwdev, REG_RXAGCCTL, BITS_RXAGC_OFDM, 1077 + 0x3); 1419 1078 } 1420 1079 1421 1080 if (channel >= 36 && channel <= 51) ··· 1445 1092 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xffc0, 0x0); 1446 1093 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700, 0x7); 1447 1094 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700000, 0x6); 1095 + rtw_write32_mask(rtwdev, REG_CCK_SOURCE, BIT_NBI_EN, 0x0); 1096 + rtw_write32_mask(rtwdev, REG_SBD, BITS_SUBTUNE, 0x1); 1097 + rtw_write32_mask(rtwdev, REG_PT_CHSMO, BIT_PT_OPT, 0x0); 1448 1098 break; 1449 1099 case RTW_CHANNEL_WIDTH_40: 1450 1100 rtw_write32_mask(rtwdev, REG_CCKSB, BIT(4), ··· 1456 1100 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xc0, 0x0); 1457 1101 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xff00, 1458 1102 (primary_ch_idx | (primary_ch_idx << 4))); 1103 + rtw_write32_mask(rtwdev, REG_CCK_SOURCE, BIT_NBI_EN, 0x1); 1104 + rtw_write32_mask(rtwdev, REG_SBD, BITS_SUBTUNE, 0x1); 1105 + rtw_write32_mask(rtwdev, REG_PT_CHSMO, BIT_PT_OPT, 0x1); 1459 1106 break; 1460 1107 case RTW_CHANNEL_WIDTH_80: 1461 1108 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xf, 0xa); 1462 1109 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xc0, 0x0); 1463 1110 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xff00, 1464 1111 (primary_ch_idx | (primary_ch_idx << 4))); 1112 + rtw_write32_mask(rtwdev, REG_SBD, BITS_SUBTUNE, 0x6); 1113 + rtw_write32_mask(rtwdev, REG_PT_CHSMO, BIT_PT_OPT, 0x1); 1465 1114 break; 1466 1115 case RTW_CHANNEL_WIDTH_5: 1467 1116 rtw_write32_mask(rtwdev, REG_DFIRBW, 0x3FF0, 0x2AB); ··· 1474 1113 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xffc0, 0x1); 1475 1114 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700, 0x4); 1476 1115 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700000, 0x4); 1116 + rtw_write32_mask(rtwdev, REG_CCK_SOURCE, BIT_NBI_EN, 0x0); 1117 + rtw_write32_mask(rtwdev, REG_SBD, BITS_SUBTUNE, 0x1); 1118 + rtw_write32_mask(rtwdev, REG_PT_CHSMO, BIT_PT_OPT, 0x0); 1477 1119 break; 1478 1120 case RTW_CHANNEL_WIDTH_10: 1479 1121 rtw_write32_mask(rtwdev, REG_DFIRBW, 0x3FF0, 0x2AB); ··· 1484 1120 rtw_write32_mask(rtwdev, REG_TXBWCTL, 0xffc0, 0x2); 1485 1121 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700, 0x6); 1486 1122 rtw_write32_mask(rtwdev, REG_TXCLK, 0x700000, 0x5); 1123 + rtw_write32_mask(rtwdev, REG_CCK_SOURCE, BIT_NBI_EN, 0x0); 1124 + rtw_write32_mask(rtwdev, REG_SBD, BITS_SUBTUNE, 0x1); 1125 + rtw_write32_mask(rtwdev, REG_PT_CHSMO, BIT_PT_OPT, 0x0); 1487 1126 break; 1488 1127 } 1489 1128 } ··· 1818 1451 u32 cck_enable; 1819 1452 u32 cck_fa_cnt; 1820 1453 u32 ofdm_fa_cnt; 1821 - u32 ofdm_tx_counter; 1454 + u32 ofdm_fa_cnt1, ofdm_fa_cnt2, ofdm_fa_cnt3, ofdm_fa_cnt4, ofdm_fa_cnt5; 1455 + u16 parity_fail, rate_illegal, crc8_fail, mcs_fail, sb_search_fail, 1456 + fast_fsync, crc8_fail_vhta, mcs_fail_vht; 1822 1457 1823 1458 cck_enable = rtw_read32(rtwdev, REG_ENCCK) & BIT_CCK_BLK_EN; 1824 1459 cck_fa_cnt = rtw_read16(rtwdev, REG_CCK_FACNT); 1825 - ofdm_fa_cnt = rtw_read16(rtwdev, REG_OFDM_FACNT); 1826 - ofdm_tx_counter = rtw_read16(rtwdev, REG_OFDM_TXCNT); 1827 - ofdm_fa_cnt -= ofdm_tx_counter; 1460 + 1461 + ofdm_fa_cnt1 = rtw_read32(rtwdev, REG_OFDM_FACNT1); 1462 + ofdm_fa_cnt2 = rtw_read32(rtwdev, REG_OFDM_FACNT2); 1463 + ofdm_fa_cnt3 = rtw_read32(rtwdev, REG_OFDM_FACNT3); 1464 + ofdm_fa_cnt4 = rtw_read32(rtwdev, REG_OFDM_FACNT4); 1465 + ofdm_fa_cnt5 = rtw_read32(rtwdev, REG_OFDM_FACNT5); 1466 + 1467 + parity_fail = FIELD_GET(GENMASK(31, 16), ofdm_fa_cnt1); 1468 + rate_illegal = FIELD_GET(GENMASK(15, 0), ofdm_fa_cnt2); 1469 + crc8_fail = FIELD_GET(GENMASK(31, 16), ofdm_fa_cnt2); 1470 + crc8_fail_vhta = FIELD_GET(GENMASK(15, 0), ofdm_fa_cnt3); 1471 + mcs_fail = FIELD_GET(GENMASK(15, 0), ofdm_fa_cnt4); 1472 + mcs_fail_vht = FIELD_GET(GENMASK(31, 16), ofdm_fa_cnt4); 1473 + fast_fsync = FIELD_GET(GENMASK(15, 0), ofdm_fa_cnt5); 1474 + sb_search_fail = FIELD_GET(GENMASK(31, 16), ofdm_fa_cnt5); 1475 + 1476 + ofdm_fa_cnt = parity_fail + rate_illegal + crc8_fail + crc8_fail_vhta + 1477 + mcs_fail + mcs_fail_vht + fast_fsync + sb_search_fail; 1828 1478 1829 1479 dm_info->cck_fa_cnt = cck_fa_cnt; 1830 1480 dm_info->ofdm_fa_cnt = ofdm_fa_cnt; ··· 1852 1468 rtw_write32_mask(rtwdev, REG_CCANRX, BIT_CCK_FA_RST, 2); 1853 1469 rtw_write32_mask(rtwdev, REG_CCANRX, BIT_OFDM_FA_RST, 0); 1854 1470 rtw_write32_mask(rtwdev, REG_CCANRX, BIT_OFDM_FA_RST, 2); 1471 + 1472 + /* disable rx clk gating to reset counters */ 1473 + rtw_write32_clr(rtwdev, REG_RX_BREAK, BIT_COM_RX_GCK_EN); 1855 1474 rtw_write32_set(rtwdev, REG_CNT_CTRL, BIT_ALL_CNT_RST); 1856 1475 rtw_write32_clr(rtwdev, REG_CNT_CTRL, BIT_ALL_CNT_RST); 1476 + rtw_write32_set(rtwdev, REG_RX_BREAK, BIT_COM_RX_GCK_EN); 1857 1477 } 1858 1478 1859 1479 static void rtw8822c_do_iqk(struct rtw_dev *rtwdev)
+23
drivers/net/wireless/realtek/rtw88/rtw8822c.h
··· 133 133 #define REG_DYMPRITH 0x86c 134 134 #define REG_DYMENTH0 0x870 135 135 #define REG_DYMENTH 0x874 136 + #define REG_SBD 0x88c 137 + #define BITS_SUBTUNE GENMASK(15, 12) 136 138 #define REG_DYMTHMIN 0x8a4 137 139 #define REG_TXBWCTL 0x9b0 138 140 #define REG_TXCLK 0x9b4 ··· 142 140 #define REG_MRCM 0xc38 143 141 #define REG_AGCSWSH 0xc44 144 142 #define REG_ANTWTPD 0xc54 143 + #define REG_PT_CHSMO 0xcbc 144 + #define BIT_PT_OPT BIT(21) 145 145 #define REG_ORITXCODE 0x1800 146 146 #define REG_3WIRE 0x180c 147 147 #define BIT_3WIRE_TX_EN BIT(0) 148 148 #define BIT_3WIRE_RX_EN BIT(1) 149 149 #define BIT_3WIRE_PI_ON BIT(28) 150 150 #define REG_RXAGCCTL0 0x18ac 151 + #define BITS_RXAGC_CCK GENMASK(15, 12) 152 + #define BITS_RXAGC_OFDM GENMASK(8, 4) 153 + #define REG_DCKA_I_0 0x18bc 154 + #define REG_DCKA_I_1 0x18c0 155 + #define REG_DCKA_Q_0 0x18d8 156 + #define REG_DCKA_Q_1 0x18dc 151 157 #define REG_CCKSB 0x1a00 152 158 #define REG_RXCCKSEL 0x1a04 153 159 #define REG_BGCTRL 0x1a14 ··· 174 164 #define REG_TXF5 0x1aa0 175 165 #define REG_TXF6 0x1aac 176 166 #define REG_TXF7 0x1ab0 167 + #define REG_CCK_SOURCE 0x1abc 168 + #define BIT_NBI_EN BIT(30) 177 169 #define REG_TXANT 0x1c28 178 170 #define REG_ENCCK 0x1c3c 179 171 #define BIT_CCK_BLK_EN BIT(1) 180 172 #define BIT_CCK_OFDM_BLK_EN (BIT(0) | BIT(1)) 181 173 #define REG_CCAMSK 0x1c80 174 + #define REG_RX_BREAK 0x1d2c 175 + #define BIT_COM_RX_GCK_EN BIT(31) 182 176 #define REG_RXFNCTL 0x1d30 183 177 #define REG_RXIGI 0x1d70 184 178 #define REG_ENFN 0x1e24 ··· 192 178 #define REG_CNT_CTRL 0x1eb4 193 179 #define BIT_ALL_CNT_RST BIT(25) 194 180 #define REG_OFDM_FACNT 0x2d00 181 + #define REG_OFDM_FACNT1 0x2d04 182 + #define REG_OFDM_FACNT2 0x2d08 183 + #define REG_OFDM_FACNT3 0x2d0c 184 + #define REG_OFDM_FACNT4 0x2d10 185 + #define REG_OFDM_FACNT5 0x2d20 195 186 #define REG_OFDM_TXCNT 0x2de0 196 187 #define REG_ORITXCODE2 0x4100 197 188 #define REG_3WIRE2 0x410c 198 189 #define REG_RXAGCCTL 0x41ac 190 + #define REG_DCKB_I_0 0x41bc 191 + #define REG_DCKB_I_1 0x41c0 192 + #define REG_DCKB_Q_0 0x41d8 193 + #define REG_DCKB_Q_1 0x41dc 199 194 200 195 #endif
+1 -1
drivers/net/wireless/realtek/rtw88/tx.c
··· 362 362 pkt_info->bmc = bmc; 363 363 pkt_info->tx_pkt_size = skb->len; 364 364 pkt_info->offset = chip->tx_pkt_desc_sz; 365 - pkt_info->qsel = skb->priority; 365 + pkt_info->qsel = TX_DESC_QSEL_MGMT; 366 366 pkt_info->ls = true; 367 367 }
-6
drivers/ssb/driver_gpio.c
··· 460 460 return ssb_gpio_chipco_init(bus); 461 461 else if (ssb_extif_available(&bus->extif)) 462 462 return ssb_gpio_extif_init(bus); 463 - else 464 - WARN_ON(1); 465 - 466 463 return -1; 467 464 } 468 465 ··· 469 472 ssb_extif_available(&bus->extif)) { 470 473 gpiochip_remove(&bus->gpio); 471 474 return 0; 472 - } else { 473 - WARN_ON(1); 474 475 } 475 - 476 476 return -1; 477 477 }