.. | .. |
---|
| 1 | +// SPDX-License-Identifier: ISC |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2005-2011 Atheros Communications Inc. |
---|
3 | 4 | * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. |
---|
4 | 5 | * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. |
---|
5 | | - * |
---|
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 |
---|
13 | | - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
---|
14 | | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
---|
15 | | - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
---|
16 | | - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | #include <linux/skbuff.h> |
---|
.. | .. |
---|
539 | 528 | WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, |
---|
540 | 529 | .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED, |
---|
541 | 530 | .radar_found_cmdid = WMI_CMD_UNSUPPORTED, |
---|
| 531 | + .set_bb_timing_cmdid = WMI_10_2_PDEV_SET_BB_TIMING_CONFIG_CMDID, |
---|
542 | 532 | }; |
---|
543 | 533 | |
---|
544 | 534 | /* 10.4 WMI cmd track */ |
---|
.. | .. |
---|
750 | 740 | .tdls_peer_update_cmdid = WMI_10_4_TDLS_PEER_UPDATE_CMDID, |
---|
751 | 741 | .tdls_set_offchan_mode_cmdid = WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID, |
---|
752 | 742 | .radar_found_cmdid = WMI_10_4_RADAR_FOUND_CMDID, |
---|
| 743 | + .per_peer_per_tid_config_cmdid = WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID, |
---|
| 744 | +}; |
---|
| 745 | + |
---|
| 746 | +static struct wmi_peer_param_map wmi_peer_param_map = { |
---|
| 747 | + .smps_state = WMI_PEER_SMPS_STATE, |
---|
| 748 | + .ampdu = WMI_PEER_AMPDU, |
---|
| 749 | + .authorize = WMI_PEER_AUTHORIZE, |
---|
| 750 | + .chan_width = WMI_PEER_CHAN_WIDTH, |
---|
| 751 | + .nss = WMI_PEER_NSS, |
---|
| 752 | + .use_4addr = WMI_PEER_USE_4ADDR, |
---|
| 753 | + .use_fixed_power = WMI_PEER_USE_FIXED_PWR, |
---|
| 754 | + .debug = WMI_PEER_DEBUG, |
---|
| 755 | + .phymode = WMI_PEER_PHYMODE, |
---|
| 756 | + .dummy_var = WMI_PEER_DUMMY_VAR, |
---|
753 | 757 | }; |
---|
754 | 758 | |
---|
755 | 759 | /* MAIN WMI VDEV param map */ |
---|
.. | .. |
---|
825 | 829 | .meru_vc = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
826 | 830 | .rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
827 | 831 | .bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 832 | + .disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 833 | + .rtt_responder_role = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
828 | 834 | }; |
---|
829 | 835 | |
---|
830 | 836 | /* 10.X WMI VDEV param map */ |
---|
.. | .. |
---|
900 | 906 | .meru_vc = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
901 | 907 | .rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
902 | 908 | .bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 909 | + .disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 910 | + .rtt_responder_role = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
903 | 911 | }; |
---|
904 | 912 | |
---|
905 | 913 | static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map = { |
---|
.. | .. |
---|
974 | 982 | .meru_vc = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
975 | 983 | .rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
976 | 984 | .bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 985 | + .disable_4addr_src_lrn = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
| 986 | + .rtt_responder_role = WMI_VDEV_PARAM_UNSUPPORTED, |
---|
977 | 987 | }; |
---|
978 | 988 | |
---|
979 | 989 | static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = { |
---|
.. | .. |
---|
1051 | 1061 | .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, |
---|
1052 | 1062 | .inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, |
---|
1053 | 1063 | .dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT, |
---|
| 1064 | + .disable_4addr_src_lrn = WMI_10_4_VDEV_PARAM_DISABLE_4_ADDR_SRC_LRN, |
---|
| 1065 | + .rtt_responder_role = WMI_10_4_VDEV_PARAM_ENABLE_DISABLE_RTT_RESPONDER_ROLE, |
---|
1054 | 1066 | }; |
---|
1055 | 1067 | |
---|
1056 | 1068 | static struct wmi_pdev_param_map wmi_pdev_param_map = { |
---|
.. | .. |
---|
1307 | 1319 | .set_mcast2ucast_mode = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
1308 | 1320 | .set_mcast2ucast_buffer = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
1309 | 1321 | .remove_mcast2ucast_buffer = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
1310 | | - .peer_sta_ps_statechg_enable = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
| 1322 | + .peer_sta_ps_statechg_enable = |
---|
| 1323 | + WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE, |
---|
1311 | 1324 | .igmpmld_ac_override = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
1312 | 1325 | .block_interbss = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
1313 | 1326 | .set_disable_reset_cmdid = WMI_PDEV_PARAM_UNSUPPORTED, |
---|
.. | .. |
---|
1600 | 1613 | .enable_btcoex = WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX, |
---|
1601 | 1614 | }; |
---|
1602 | 1615 | |
---|
| 1616 | +static const u8 wmi_key_cipher_suites[] = { |
---|
| 1617 | + [WMI_CIPHER_NONE] = WMI_CIPHER_NONE, |
---|
| 1618 | + [WMI_CIPHER_WEP] = WMI_CIPHER_WEP, |
---|
| 1619 | + [WMI_CIPHER_TKIP] = WMI_CIPHER_TKIP, |
---|
| 1620 | + [WMI_CIPHER_AES_OCB] = WMI_CIPHER_AES_OCB, |
---|
| 1621 | + [WMI_CIPHER_AES_CCM] = WMI_CIPHER_AES_CCM, |
---|
| 1622 | + [WMI_CIPHER_WAPI] = WMI_CIPHER_WAPI, |
---|
| 1623 | + [WMI_CIPHER_CKIP] = WMI_CIPHER_CKIP, |
---|
| 1624 | + [WMI_CIPHER_AES_CMAC] = WMI_CIPHER_AES_CMAC, |
---|
| 1625 | + [WMI_CIPHER_AES_GCM] = WMI_CIPHER_AES_GCM, |
---|
| 1626 | +}; |
---|
| 1627 | + |
---|
| 1628 | +static const u8 wmi_tlv_key_cipher_suites[] = { |
---|
| 1629 | + [WMI_CIPHER_NONE] = WMI_TLV_CIPHER_NONE, |
---|
| 1630 | + [WMI_CIPHER_WEP] = WMI_TLV_CIPHER_WEP, |
---|
| 1631 | + [WMI_CIPHER_TKIP] = WMI_TLV_CIPHER_TKIP, |
---|
| 1632 | + [WMI_CIPHER_AES_OCB] = WMI_TLV_CIPHER_AES_OCB, |
---|
| 1633 | + [WMI_CIPHER_AES_CCM] = WMI_TLV_CIPHER_AES_CCM, |
---|
| 1634 | + [WMI_CIPHER_WAPI] = WMI_TLV_CIPHER_WAPI, |
---|
| 1635 | + [WMI_CIPHER_CKIP] = WMI_TLV_CIPHER_CKIP, |
---|
| 1636 | + [WMI_CIPHER_AES_CMAC] = WMI_TLV_CIPHER_AES_CMAC, |
---|
| 1637 | + [WMI_CIPHER_AES_GCM] = WMI_TLV_CIPHER_AES_GCM, |
---|
| 1638 | +}; |
---|
| 1639 | + |
---|
1603 | 1640 | static const struct wmi_peer_flags_map wmi_peer_flags_map = { |
---|
1604 | 1641 | .auth = WMI_PEER_AUTH, |
---|
1605 | 1642 | .qos = WMI_PEER_QOS, |
---|
.. | .. |
---|
1658 | 1695 | .bw160 = WMI_10_2_PEER_160MHZ, |
---|
1659 | 1696 | }; |
---|
1660 | 1697 | |
---|
1661 | | -void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, |
---|
| 1698 | +void ath10k_wmi_put_wmi_channel(struct ath10k *ar, struct wmi_channel *ch, |
---|
1662 | 1699 | const struct wmi_channel_arg *arg) |
---|
1663 | 1700 | { |
---|
1664 | 1701 | u32 flags = 0; |
---|
| 1702 | + struct ieee80211_channel *chan = NULL; |
---|
1665 | 1703 | |
---|
1666 | 1704 | memset(ch, 0, sizeof(*ch)); |
---|
1667 | 1705 | |
---|
.. | .. |
---|
1678 | 1716 | if (arg->chan_radar) |
---|
1679 | 1717 | flags |= WMI_CHAN_FLAG_DFS; |
---|
1680 | 1718 | |
---|
| 1719 | + ch->band_center_freq2 = 0; |
---|
1681 | 1720 | ch->mhz = __cpu_to_le32(arg->freq); |
---|
1682 | 1721 | ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1); |
---|
1683 | | - if (arg->mode == MODE_11AC_VHT80_80) |
---|
| 1722 | + if (arg->mode == MODE_11AC_VHT80_80) { |
---|
1684 | 1723 | ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq2); |
---|
1685 | | - else |
---|
1686 | | - ch->band_center_freq2 = 0; |
---|
| 1724 | + chan = ieee80211_get_channel(ar->hw->wiphy, |
---|
| 1725 | + arg->band_center_freq2 - 10); |
---|
| 1726 | + } |
---|
| 1727 | + |
---|
| 1728 | + if (arg->mode == MODE_11AC_VHT160) { |
---|
| 1729 | + u32 band_center_freq1; |
---|
| 1730 | + u32 band_center_freq2; |
---|
| 1731 | + |
---|
| 1732 | + if (arg->freq > arg->band_center_freq1) { |
---|
| 1733 | + band_center_freq1 = arg->band_center_freq1 + 40; |
---|
| 1734 | + band_center_freq2 = arg->band_center_freq1 - 40; |
---|
| 1735 | + } else { |
---|
| 1736 | + band_center_freq1 = arg->band_center_freq1 - 40; |
---|
| 1737 | + band_center_freq2 = arg->band_center_freq1 + 40; |
---|
| 1738 | + } |
---|
| 1739 | + |
---|
| 1740 | + ch->band_center_freq1 = |
---|
| 1741 | + __cpu_to_le32(band_center_freq1); |
---|
| 1742 | + /* Minus 10 to get a defined 5G channel frequency*/ |
---|
| 1743 | + chan = ieee80211_get_channel(ar->hw->wiphy, |
---|
| 1744 | + band_center_freq2 - 10); |
---|
| 1745 | + /* The center frequency of the entire VHT160 */ |
---|
| 1746 | + ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq1); |
---|
| 1747 | + } |
---|
| 1748 | + |
---|
| 1749 | + if (chan && chan->flags & IEEE80211_CHAN_RADAR) |
---|
| 1750 | + flags |= WMI_CHAN_FLAG_DFS_CFREQ2; |
---|
| 1751 | + |
---|
1687 | 1752 | ch->min_power = arg->min_power; |
---|
1688 | 1753 | ch->max_power = arg->max_power; |
---|
1689 | 1754 | ch->reg_power = arg->max_reg_power; |
---|
.. | .. |
---|
1890 | 1955 | u32 vdev_id; |
---|
1891 | 1956 | u32 buf_len = msdu->len; |
---|
1892 | 1957 | u16 fc; |
---|
| 1958 | + const u8 *peer_addr; |
---|
1893 | 1959 | |
---|
1894 | 1960 | hdr = (struct ieee80211_hdr *)msdu->data; |
---|
1895 | 1961 | fc = le16_to_cpu(hdr->frame_control); |
---|
.. | .. |
---|
1910 | 1976 | ieee80211_is_deauth(hdr->frame_control) || |
---|
1911 | 1977 | ieee80211_is_disassoc(hdr->frame_control)) && |
---|
1912 | 1978 | ieee80211_has_protected(hdr->frame_control)) { |
---|
1913 | | - len += IEEE80211_CCMP_MIC_LEN; |
---|
1914 | | - buf_len += IEEE80211_CCMP_MIC_LEN; |
---|
| 1979 | + peer_addr = hdr->addr1; |
---|
| 1980 | + if (is_multicast_ether_addr(peer_addr)) { |
---|
| 1981 | + len += sizeof(struct ieee80211_mmie_16); |
---|
| 1982 | + buf_len += sizeof(struct ieee80211_mmie_16); |
---|
| 1983 | + } else { |
---|
| 1984 | + if (cb->ucast_cipher == WLAN_CIPHER_SUITE_GCMP || |
---|
| 1985 | + cb->ucast_cipher == WLAN_CIPHER_SUITE_GCMP_256) { |
---|
| 1986 | + len += IEEE80211_GCMP_MIC_LEN; |
---|
| 1987 | + buf_len += IEEE80211_GCMP_MIC_LEN; |
---|
| 1988 | + } else { |
---|
| 1989 | + len += IEEE80211_CCMP_MIC_LEN; |
---|
| 1990 | + buf_len += IEEE80211_CCMP_MIC_LEN; |
---|
| 1991 | + } |
---|
| 1992 | + } |
---|
1915 | 1993 | } |
---|
1916 | 1994 | |
---|
1917 | 1995 | len = round_up(len, 4); |
---|
.. | .. |
---|
2319 | 2397 | return true; |
---|
2320 | 2398 | } |
---|
2321 | 2399 | |
---|
2322 | | -static int wmi_process_mgmt_tx_comp(struct ath10k *ar, u32 desc_id, |
---|
2323 | | - u32 status) |
---|
| 2400 | +static int |
---|
| 2401 | +wmi_process_mgmt_tx_comp(struct ath10k *ar, struct mgmt_tx_compl_params *param) |
---|
2324 | 2402 | { |
---|
2325 | 2403 | struct ath10k_mgmt_tx_pkt_addr *pkt_addr; |
---|
2326 | 2404 | struct ath10k_wmi *wmi = &ar->wmi; |
---|
.. | .. |
---|
2330 | 2408 | |
---|
2331 | 2409 | spin_lock_bh(&ar->data_lock); |
---|
2332 | 2410 | |
---|
2333 | | - pkt_addr = idr_find(&wmi->mgmt_pending_tx, desc_id); |
---|
| 2411 | + pkt_addr = idr_find(&wmi->mgmt_pending_tx, param->desc_id); |
---|
2334 | 2412 | if (!pkt_addr) { |
---|
2335 | 2413 | ath10k_warn(ar, "received mgmt tx completion for invalid msdu_id: %d\n", |
---|
2336 | | - desc_id); |
---|
| 2414 | + param->desc_id); |
---|
2337 | 2415 | ret = -ENOENT; |
---|
2338 | 2416 | goto out; |
---|
2339 | 2417 | } |
---|
.. | .. |
---|
2343 | 2421 | msdu->len, DMA_TO_DEVICE); |
---|
2344 | 2422 | info = IEEE80211_SKB_CB(msdu); |
---|
2345 | 2423 | |
---|
2346 | | - if (status) |
---|
| 2424 | + if (param->status) { |
---|
2347 | 2425 | info->flags &= ~IEEE80211_TX_STAT_ACK; |
---|
2348 | | - else |
---|
| 2426 | + } else { |
---|
2349 | 2427 | info->flags |= IEEE80211_TX_STAT_ACK; |
---|
| 2428 | + info->status.ack_signal = ATH10K_DEFAULT_NOISE_FLOOR + |
---|
| 2429 | + param->ack_rssi; |
---|
| 2430 | + info->status.is_valid_ack_signal = true; |
---|
| 2431 | + } |
---|
2350 | 2432 | |
---|
2351 | 2433 | ieee80211_tx_status_irqsafe(ar->hw, msdu); |
---|
2352 | 2434 | |
---|
2353 | 2435 | ret = 0; |
---|
2354 | 2436 | |
---|
2355 | 2437 | out: |
---|
2356 | | - idr_remove(&wmi->mgmt_pending_tx, desc_id); |
---|
| 2438 | + idr_remove(&wmi->mgmt_pending_tx, param->desc_id); |
---|
2357 | 2439 | spin_unlock_bh(&ar->data_lock); |
---|
2358 | 2440 | return ret; |
---|
2359 | 2441 | } |
---|
.. | .. |
---|
2361 | 2443 | int ath10k_wmi_event_mgmt_tx_compl(struct ath10k *ar, struct sk_buff *skb) |
---|
2362 | 2444 | { |
---|
2363 | 2445 | struct wmi_tlv_mgmt_tx_compl_ev_arg arg; |
---|
| 2446 | + struct mgmt_tx_compl_params param; |
---|
2364 | 2447 | int ret; |
---|
2365 | 2448 | |
---|
2366 | 2449 | ret = ath10k_wmi_pull_mgmt_tx_compl(ar, skb, &arg); |
---|
.. | .. |
---|
2369 | 2452 | return ret; |
---|
2370 | 2453 | } |
---|
2371 | 2454 | |
---|
2372 | | - wmi_process_mgmt_tx_comp(ar, __le32_to_cpu(arg.desc_id), |
---|
2373 | | - __le32_to_cpu(arg.status)); |
---|
| 2455 | + memset(¶m, 0, sizeof(struct mgmt_tx_compl_params)); |
---|
| 2456 | + param.desc_id = __le32_to_cpu(arg.desc_id); |
---|
| 2457 | + param.status = __le32_to_cpu(arg.status); |
---|
| 2458 | + |
---|
| 2459 | + if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map)) |
---|
| 2460 | + param.ack_rssi = __le32_to_cpu(arg.ack_rssi); |
---|
| 2461 | + |
---|
| 2462 | + wmi_process_mgmt_tx_comp(ar, ¶m); |
---|
2374 | 2463 | |
---|
2375 | 2464 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv evnt mgmt tx completion\n"); |
---|
| 2465 | + |
---|
| 2466 | + return 0; |
---|
| 2467 | +} |
---|
| 2468 | + |
---|
| 2469 | +int ath10k_wmi_event_mgmt_tx_bundle_compl(struct ath10k *ar, struct sk_buff *skb) |
---|
| 2470 | +{ |
---|
| 2471 | + struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg arg; |
---|
| 2472 | + struct mgmt_tx_compl_params param; |
---|
| 2473 | + u32 num_reports; |
---|
| 2474 | + int i, ret; |
---|
| 2475 | + |
---|
| 2476 | + ret = ath10k_wmi_pull_mgmt_tx_bundle_compl(ar, skb, &arg); |
---|
| 2477 | + if (ret) { |
---|
| 2478 | + ath10k_warn(ar, "failed to parse bundle mgmt compl event: %d\n", ret); |
---|
| 2479 | + return ret; |
---|
| 2480 | + } |
---|
| 2481 | + |
---|
| 2482 | + num_reports = __le32_to_cpu(arg.num_reports); |
---|
| 2483 | + |
---|
| 2484 | + for (i = 0; i < num_reports; i++) { |
---|
| 2485 | + memset(¶m, 0, sizeof(struct mgmt_tx_compl_params)); |
---|
| 2486 | + param.desc_id = __le32_to_cpu(arg.desc_ids[i]); |
---|
| 2487 | + param.status = __le32_to_cpu(arg.desc_ids[i]); |
---|
| 2488 | + |
---|
| 2489 | + if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map)) |
---|
| 2490 | + param.ack_rssi = __le32_to_cpu(arg.ack_rssi[i]); |
---|
| 2491 | + wmi_process_mgmt_tx_comp(ar, ¶m); |
---|
| 2492 | + } |
---|
| 2493 | + |
---|
| 2494 | + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv event bundle mgmt tx completion\n"); |
---|
2376 | 2495 | |
---|
2377 | 2496 | return 0; |
---|
2378 | 2497 | } |
---|
.. | .. |
---|
2386 | 2505 | u32 rx_status; |
---|
2387 | 2506 | u32 channel; |
---|
2388 | 2507 | u32 phy_mode; |
---|
2389 | | - u32 snr; |
---|
| 2508 | + u32 snr, rssi; |
---|
2390 | 2509 | u32 rate; |
---|
2391 | 2510 | u16 fc; |
---|
2392 | | - int ret; |
---|
| 2511 | + int ret, i; |
---|
2393 | 2512 | |
---|
2394 | 2513 | ret = ath10k_wmi_pull_mgmt_rx(ar, skb, &arg); |
---|
2395 | 2514 | if (ret) { |
---|
.. | .. |
---|
2448 | 2567 | |
---|
2449 | 2568 | status->freq = ieee80211_channel_to_frequency(channel, status->band); |
---|
2450 | 2569 | status->signal = snr + ATH10K_DEFAULT_NOISE_FLOOR; |
---|
| 2570 | + |
---|
| 2571 | + BUILD_BUG_ON(ARRAY_SIZE(status->chain_signal) != ARRAY_SIZE(arg.rssi)); |
---|
| 2572 | + |
---|
| 2573 | + for (i = 0; i < ARRAY_SIZE(status->chain_signal); i++) { |
---|
| 2574 | + status->chains &= ~BIT(i); |
---|
| 2575 | + rssi = __le32_to_cpu(arg.rssi[i]); |
---|
| 2576 | + ath10k_dbg(ar, ATH10K_DBG_MGMT, "mgmt rssi[%d]:%d\n", i, arg.rssi[i]); |
---|
| 2577 | + |
---|
| 2578 | + if (rssi != ATH10K_INVALID_RSSI && rssi != 0) { |
---|
| 2579 | + status->chain_signal[i] = ATH10K_DEFAULT_NOISE_FLOOR + rssi; |
---|
| 2580 | + status->chains |= BIT(i); |
---|
| 2581 | + } |
---|
| 2582 | + } |
---|
| 2583 | + |
---|
2451 | 2584 | status->rate_idx = ath10k_mac_bitrate_to_idx(sband, rate / 100); |
---|
2452 | 2585 | |
---|
2453 | 2586 | hdr = (struct ieee80211_hdr *)skb->data; |
---|
.. | .. |
---|
2476 | 2609 | |
---|
2477 | 2610 | if (ieee80211_is_beacon(hdr->frame_control)) |
---|
2478 | 2611 | ath10k_mac_handle_beacon(ar, skb); |
---|
| 2612 | + |
---|
| 2613 | + if (ieee80211_is_beacon(hdr->frame_control) || |
---|
| 2614 | + ieee80211_is_probe_resp(hdr->frame_control)) |
---|
| 2615 | + status->boottime_ns = ktime_get_boottime_ns(); |
---|
2479 | 2616 | |
---|
2480 | 2617 | ath10k_dbg(ar, ATH10K_DBG_MGMT, |
---|
2481 | 2618 | "event mgmt rx skb %pK len %d ftype %02x stype %02x\n", |
---|
.. | .. |
---|
2553 | 2690 | return 0; |
---|
2554 | 2691 | } |
---|
2555 | 2692 | |
---|
| 2693 | +/* |
---|
| 2694 | + * Handle the channel info event for firmware which only sends one |
---|
| 2695 | + * chan_info event per scanned channel. |
---|
| 2696 | + */ |
---|
| 2697 | +static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar, |
---|
| 2698 | + struct chan_info_params *params) |
---|
| 2699 | +{ |
---|
| 2700 | + struct survey_info *survey; |
---|
| 2701 | + int idx; |
---|
| 2702 | + |
---|
| 2703 | + if (params->cmd_flags & WMI_CHAN_INFO_FLAG_COMPLETE) { |
---|
| 2704 | + ath10k_dbg(ar, ATH10K_DBG_WMI, "chan info report completed\n"); |
---|
| 2705 | + return; |
---|
| 2706 | + } |
---|
| 2707 | + |
---|
| 2708 | + idx = freq_to_idx(ar, params->freq); |
---|
| 2709 | + if (idx >= ARRAY_SIZE(ar->survey)) { |
---|
| 2710 | + ath10k_warn(ar, "chan info: invalid frequency %d (idx %d out of bounds)\n", |
---|
| 2711 | + params->freq, idx); |
---|
| 2712 | + return; |
---|
| 2713 | + } |
---|
| 2714 | + |
---|
| 2715 | + survey = &ar->survey[idx]; |
---|
| 2716 | + |
---|
| 2717 | + if (!params->mac_clk_mhz) |
---|
| 2718 | + return; |
---|
| 2719 | + |
---|
| 2720 | + memset(survey, 0, sizeof(*survey)); |
---|
| 2721 | + |
---|
| 2722 | + survey->noise = params->noise_floor; |
---|
| 2723 | + survey->time = (params->cycle_count / params->mac_clk_mhz) / 1000; |
---|
| 2724 | + survey->time_busy = (params->rx_clear_count / params->mac_clk_mhz) / 1000; |
---|
| 2725 | + survey->filled |= SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME | |
---|
| 2726 | + SURVEY_INFO_TIME_BUSY; |
---|
| 2727 | +} |
---|
| 2728 | + |
---|
| 2729 | +/* |
---|
| 2730 | + * Handle the channel info event for firmware which sends chan_info |
---|
| 2731 | + * event in pairs(start and stop events) for every scanned channel. |
---|
| 2732 | + */ |
---|
| 2733 | +static void ath10k_wmi_event_chan_info_paired(struct ath10k *ar, |
---|
| 2734 | + struct chan_info_params *params) |
---|
| 2735 | +{ |
---|
| 2736 | + struct survey_info *survey; |
---|
| 2737 | + int idx; |
---|
| 2738 | + |
---|
| 2739 | + idx = freq_to_idx(ar, params->freq); |
---|
| 2740 | + if (idx >= ARRAY_SIZE(ar->survey)) { |
---|
| 2741 | + ath10k_warn(ar, "chan info: invalid frequency %d (idx %d out of bounds)\n", |
---|
| 2742 | + params->freq, idx); |
---|
| 2743 | + return; |
---|
| 2744 | + } |
---|
| 2745 | + |
---|
| 2746 | + if (params->cmd_flags & WMI_CHAN_INFO_FLAG_COMPLETE) { |
---|
| 2747 | + if (ar->ch_info_can_report_survey) { |
---|
| 2748 | + survey = &ar->survey[idx]; |
---|
| 2749 | + survey->noise = params->noise_floor; |
---|
| 2750 | + survey->filled = SURVEY_INFO_NOISE_DBM; |
---|
| 2751 | + |
---|
| 2752 | + ath10k_hw_fill_survey_time(ar, |
---|
| 2753 | + survey, |
---|
| 2754 | + params->cycle_count, |
---|
| 2755 | + params->rx_clear_count, |
---|
| 2756 | + ar->survey_last_cycle_count, |
---|
| 2757 | + ar->survey_last_rx_clear_count); |
---|
| 2758 | + } |
---|
| 2759 | + |
---|
| 2760 | + ar->ch_info_can_report_survey = false; |
---|
| 2761 | + } else { |
---|
| 2762 | + ar->ch_info_can_report_survey = true; |
---|
| 2763 | + } |
---|
| 2764 | + |
---|
| 2765 | + if (!(params->cmd_flags & WMI_CHAN_INFO_FLAG_PRE_COMPLETE)) { |
---|
| 2766 | + ar->survey_last_rx_clear_count = params->rx_clear_count; |
---|
| 2767 | + ar->survey_last_cycle_count = params->cycle_count; |
---|
| 2768 | + } |
---|
| 2769 | +} |
---|
| 2770 | + |
---|
2556 | 2771 | void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb) |
---|
2557 | 2772 | { |
---|
| 2773 | + struct chan_info_params ch_info_param; |
---|
2558 | 2774 | struct wmi_ch_info_ev_arg arg = {}; |
---|
2559 | | - struct survey_info *survey; |
---|
2560 | | - u32 err_code, freq, cmd_flags, noise_floor, rx_clear_count, cycle_count; |
---|
2561 | | - int idx, ret; |
---|
| 2775 | + int ret; |
---|
2562 | 2776 | |
---|
2563 | 2777 | ret = ath10k_wmi_pull_ch_info(ar, skb, &arg); |
---|
2564 | 2778 | if (ret) { |
---|
.. | .. |
---|
2566 | 2780 | return; |
---|
2567 | 2781 | } |
---|
2568 | 2782 | |
---|
2569 | | - err_code = __le32_to_cpu(arg.err_code); |
---|
2570 | | - freq = __le32_to_cpu(arg.freq); |
---|
2571 | | - cmd_flags = __le32_to_cpu(arg.cmd_flags); |
---|
2572 | | - noise_floor = __le32_to_cpu(arg.noise_floor); |
---|
2573 | | - rx_clear_count = __le32_to_cpu(arg.rx_clear_count); |
---|
2574 | | - cycle_count = __le32_to_cpu(arg.cycle_count); |
---|
| 2783 | + ch_info_param.err_code = __le32_to_cpu(arg.err_code); |
---|
| 2784 | + ch_info_param.freq = __le32_to_cpu(arg.freq); |
---|
| 2785 | + ch_info_param.cmd_flags = __le32_to_cpu(arg.cmd_flags); |
---|
| 2786 | + ch_info_param.noise_floor = __le32_to_cpu(arg.noise_floor); |
---|
| 2787 | + ch_info_param.rx_clear_count = __le32_to_cpu(arg.rx_clear_count); |
---|
| 2788 | + ch_info_param.cycle_count = __le32_to_cpu(arg.cycle_count); |
---|
| 2789 | + ch_info_param.mac_clk_mhz = __le32_to_cpu(arg.mac_clk_mhz); |
---|
2575 | 2790 | |
---|
2576 | 2791 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
2577 | 2792 | "chan info err_code %d freq %d cmd_flags %d noise_floor %d rx_clear_count %d cycle_count %d\n", |
---|
2578 | | - err_code, freq, cmd_flags, noise_floor, rx_clear_count, |
---|
2579 | | - cycle_count); |
---|
| 2793 | + ch_info_param.err_code, ch_info_param.freq, ch_info_param.cmd_flags, |
---|
| 2794 | + ch_info_param.noise_floor, ch_info_param.rx_clear_count, |
---|
| 2795 | + ch_info_param.cycle_count); |
---|
2580 | 2796 | |
---|
2581 | 2797 | spin_lock_bh(&ar->data_lock); |
---|
2582 | 2798 | |
---|
.. | .. |
---|
2590 | 2806 | break; |
---|
2591 | 2807 | } |
---|
2592 | 2808 | |
---|
2593 | | - idx = freq_to_idx(ar, freq); |
---|
2594 | | - if (idx >= ARRAY_SIZE(ar->survey)) { |
---|
2595 | | - ath10k_warn(ar, "chan info: invalid frequency %d (idx %d out of bounds)\n", |
---|
2596 | | - freq, idx); |
---|
2597 | | - goto exit; |
---|
2598 | | - } |
---|
2599 | | - |
---|
2600 | | - if (cmd_flags & WMI_CHAN_INFO_FLAG_COMPLETE) { |
---|
2601 | | - if (ar->ch_info_can_report_survey) { |
---|
2602 | | - survey = &ar->survey[idx]; |
---|
2603 | | - survey->noise = noise_floor; |
---|
2604 | | - survey->filled = SURVEY_INFO_NOISE_DBM; |
---|
2605 | | - |
---|
2606 | | - ath10k_hw_fill_survey_time(ar, |
---|
2607 | | - survey, |
---|
2608 | | - cycle_count, |
---|
2609 | | - rx_clear_count, |
---|
2610 | | - ar->survey_last_cycle_count, |
---|
2611 | | - ar->survey_last_rx_clear_count); |
---|
2612 | | - } |
---|
2613 | | - |
---|
2614 | | - ar->ch_info_can_report_survey = false; |
---|
2615 | | - } else { |
---|
2616 | | - ar->ch_info_can_report_survey = true; |
---|
2617 | | - } |
---|
2618 | | - |
---|
2619 | | - if (!(cmd_flags & WMI_CHAN_INFO_FLAG_PRE_COMPLETE)) { |
---|
2620 | | - ar->survey_last_rx_clear_count = rx_clear_count; |
---|
2621 | | - ar->survey_last_cycle_count = cycle_count; |
---|
2622 | | - } |
---|
| 2809 | + if (test_bit(ATH10K_FW_FEATURE_SINGLE_CHAN_INFO_PER_CHANNEL, |
---|
| 2810 | + ar->running_fw->fw_file.fw_features)) |
---|
| 2811 | + ath10k_wmi_event_chan_info_unpaired(ar, &ch_info_param); |
---|
| 2812 | + else |
---|
| 2813 | + ath10k_wmi_event_chan_info_paired(ar, &ch_info_param); |
---|
2623 | 2814 | |
---|
2624 | 2815 | exit: |
---|
2625 | 2816 | spin_unlock_bh(&ar->data_lock); |
---|
.. | .. |
---|
3692 | 3883 | * actual channel switch is done |
---|
3693 | 3884 | */ |
---|
3694 | 3885 | if (arvif->vif->csa_active && |
---|
3695 | | - ieee80211_csa_is_complete(arvif->vif)) { |
---|
| 3886 | + ieee80211_beacon_cntdwn_is_complete(arvif->vif)) { |
---|
3696 | 3887 | ieee80211_csa_finish(arvif->vif); |
---|
3697 | 3888 | continue; |
---|
3698 | 3889 | } |
---|
.. | .. |
---|
5061 | 5252 | } |
---|
5062 | 5253 | } |
---|
5063 | 5254 | |
---|
| 5255 | +static void |
---|
| 5256 | +ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb) |
---|
| 5257 | +{ |
---|
| 5258 | + struct wmi_peer_sta_ps_state_chg_event *ev; |
---|
| 5259 | + struct ieee80211_sta *sta; |
---|
| 5260 | + struct ath10k_sta *arsta; |
---|
| 5261 | + u8 peer_addr[ETH_ALEN]; |
---|
| 5262 | + |
---|
| 5263 | + lockdep_assert_held(&ar->data_lock); |
---|
| 5264 | + |
---|
| 5265 | + ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data; |
---|
| 5266 | + ether_addr_copy(peer_addr, ev->peer_macaddr.addr); |
---|
| 5267 | + |
---|
| 5268 | + rcu_read_lock(); |
---|
| 5269 | + |
---|
| 5270 | + sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer_addr, NULL); |
---|
| 5271 | + |
---|
| 5272 | + if (!sta) { |
---|
| 5273 | + ath10k_warn(ar, "failed to find station entry %pM\n", |
---|
| 5274 | + peer_addr); |
---|
| 5275 | + goto exit; |
---|
| 5276 | + } |
---|
| 5277 | + |
---|
| 5278 | + arsta = (struct ath10k_sta *)sta->drv_priv; |
---|
| 5279 | + arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state); |
---|
| 5280 | + |
---|
| 5281 | +exit: |
---|
| 5282 | + rcu_read_unlock(); |
---|
| 5283 | +} |
---|
| 5284 | + |
---|
5064 | 5285 | void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb) |
---|
5065 | 5286 | { |
---|
5066 | 5287 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n"); |
---|
.. | .. |
---|
5116 | 5337 | void *vaddr; |
---|
5117 | 5338 | |
---|
5118 | 5339 | pool_size = num_units * round_up(unit_len, 4); |
---|
5119 | | - vaddr = dma_zalloc_coherent(ar->dev, pool_size, &paddr, GFP_KERNEL); |
---|
| 5340 | + vaddr = dma_alloc_coherent(ar->dev, pool_size, &paddr, GFP_KERNEL); |
---|
5120 | 5341 | |
---|
5121 | 5342 | if (!vaddr) |
---|
5122 | 5343 | return -ENOMEM; |
---|
.. | .. |
---|
5209 | 5430 | arg->max_tx_power = ev->hw_max_tx_power; |
---|
5210 | 5431 | arg->ht_cap = ev->ht_cap_info; |
---|
5211 | 5432 | arg->vht_cap = ev->vht_cap_info; |
---|
| 5433 | + arg->vht_supp_mcs = ev->vht_supp_mcs; |
---|
5212 | 5434 | arg->sw_ver0 = ev->sw_version; |
---|
5213 | 5435 | arg->sw_ver1 = ev->sw_version_1; |
---|
5214 | 5436 | arg->phy_capab = ev->phy_capability; |
---|
5215 | 5437 | arg->num_rf_chains = ev->num_rf_chains; |
---|
5216 | 5438 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; |
---|
| 5439 | + arg->low_2ghz_chan = ev->hal_reg_capabilities.low_2ghz_chan; |
---|
| 5440 | + arg->high_2ghz_chan = ev->hal_reg_capabilities.high_2ghz_chan; |
---|
5217 | 5441 | arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan; |
---|
5218 | 5442 | arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan; |
---|
5219 | 5443 | arg->num_mem_reqs = ev->num_mem_reqs; |
---|
.. | .. |
---|
5248 | 5472 | arg->max_tx_power = ev->hw_max_tx_power; |
---|
5249 | 5473 | arg->ht_cap = ev->ht_cap_info; |
---|
5250 | 5474 | arg->vht_cap = ev->vht_cap_info; |
---|
| 5475 | + arg->vht_supp_mcs = ev->vht_supp_mcs; |
---|
5251 | 5476 | arg->sw_ver0 = ev->sw_version; |
---|
5252 | 5477 | arg->phy_capab = ev->phy_capability; |
---|
5253 | 5478 | arg->num_rf_chains = ev->num_rf_chains; |
---|
5254 | 5479 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; |
---|
| 5480 | + arg->low_2ghz_chan = ev->hal_reg_capabilities.low_2ghz_chan; |
---|
| 5481 | + arg->high_2ghz_chan = ev->hal_reg_capabilities.high_2ghz_chan; |
---|
5255 | 5482 | arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan; |
---|
5256 | 5483 | arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan; |
---|
5257 | 5484 | arg->num_mem_reqs = ev->num_mem_reqs; |
---|
5258 | 5485 | arg->service_map = ev->wmi_service_bitmap; |
---|
5259 | 5486 | arg->service_map_len = sizeof(ev->wmi_service_bitmap); |
---|
| 5487 | + |
---|
| 5488 | + /* Deliberately skipping ev->sys_cap_info as WMI and WMI-TLV have |
---|
| 5489 | + * different values. We would need a translation to handle that, |
---|
| 5490 | + * but as we don't currently need anything from sys_cap_info from |
---|
| 5491 | + * WMI interface (only from WMI-TLV) safest it to skip it. |
---|
| 5492 | + */ |
---|
5260 | 5493 | |
---|
5261 | 5494 | n = min_t(size_t, __le32_to_cpu(arg->num_mem_reqs), |
---|
5262 | 5495 | ARRAY_SIZE(arg->mem_reqs)); |
---|
.. | .. |
---|
5297 | 5530 | ar->hw_max_tx_power = __le32_to_cpu(arg.max_tx_power); |
---|
5298 | 5531 | ar->ht_cap_info = __le32_to_cpu(arg.ht_cap); |
---|
5299 | 5532 | ar->vht_cap_info = __le32_to_cpu(arg.vht_cap); |
---|
| 5533 | + ar->vht_supp_mcs = __le32_to_cpu(arg.vht_supp_mcs); |
---|
5300 | 5534 | ar->fw_version_major = |
---|
5301 | 5535 | (__le32_to_cpu(arg.sw_ver0) & 0xff000000) >> 24; |
---|
5302 | 5536 | ar->fw_version_minor = (__le32_to_cpu(arg.sw_ver0) & 0x00ffffff); |
---|
.. | .. |
---|
5306 | 5540 | ar->phy_capability = __le32_to_cpu(arg.phy_capab); |
---|
5307 | 5541 | ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains); |
---|
5308 | 5542 | ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd); |
---|
| 5543 | + ar->low_2ghz_chan = __le32_to_cpu(arg.low_2ghz_chan); |
---|
| 5544 | + ar->high_2ghz_chan = __le32_to_cpu(arg.high_2ghz_chan); |
---|
5309 | 5545 | ar->low_5ghz_chan = __le32_to_cpu(arg.low_5ghz_chan); |
---|
5310 | 5546 | ar->high_5ghz_chan = __le32_to_cpu(arg.high_5ghz_chan); |
---|
| 5547 | + ar->sys_cap_info = __le32_to_cpu(arg.sys_cap_info); |
---|
5311 | 5548 | |
---|
5312 | 5549 | ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ", |
---|
5313 | 5550 | arg.service_map, arg.service_map_len); |
---|
| 5551 | + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi sys_cap_info 0x%x\n", |
---|
| 5552 | + ar->sys_cap_info); |
---|
5314 | 5553 | |
---|
5315 | 5554 | if (ar->num_rf_chains > ar->max_spatial_stream) { |
---|
5316 | 5555 | ath10k_warn(ar, "hardware advertises support for more spatial streams than it should (%d > %d)\n", |
---|
.. | .. |
---|
5409 | 5648 | |
---|
5410 | 5649 | skip_mem_alloc: |
---|
5411 | 5650 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
5412 | | - "wmi event service ready min_tx_power 0x%08x max_tx_power 0x%08x ht_cap 0x%08x vht_cap 0x%08x sw_ver0 0x%08x sw_ver1 0x%08x fw_build 0x%08x phy_capab 0x%08x num_rf_chains 0x%08x eeprom_rd 0x%08x num_mem_reqs 0x%08x\n", |
---|
| 5651 | + "wmi event service ready min_tx_power 0x%08x max_tx_power 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_mcs 0x%08x sw_ver0 0x%08x sw_ver1 0x%08x fw_build 0x%08x phy_capab 0x%08x num_rf_chains 0x%08x eeprom_rd 0x%08x low_2ghz_chan %d high_2ghz_chan %d low_5ghz_chan %d high_5ghz_chan %d num_mem_reqs 0x%08x\n", |
---|
5413 | 5652 | __le32_to_cpu(arg.min_tx_power), |
---|
5414 | 5653 | __le32_to_cpu(arg.max_tx_power), |
---|
5415 | 5654 | __le32_to_cpu(arg.ht_cap), |
---|
5416 | 5655 | __le32_to_cpu(arg.vht_cap), |
---|
| 5656 | + __le32_to_cpu(arg.vht_supp_mcs), |
---|
5417 | 5657 | __le32_to_cpu(arg.sw_ver0), |
---|
5418 | 5658 | __le32_to_cpu(arg.sw_ver1), |
---|
5419 | 5659 | __le32_to_cpu(arg.fw_build), |
---|
5420 | 5660 | __le32_to_cpu(arg.phy_capab), |
---|
5421 | 5661 | __le32_to_cpu(arg.num_rf_chains), |
---|
5422 | 5662 | __le32_to_cpu(arg.eeprom_rd), |
---|
| 5663 | + __le32_to_cpu(arg.low_2ghz_chan), |
---|
| 5664 | + __le32_to_cpu(arg.high_2ghz_chan), |
---|
| 5665 | + __le32_to_cpu(arg.low_5ghz_chan), |
---|
| 5666 | + __le32_to_cpu(arg.high_5ghz_chan), |
---|
5423 | 5667 | __le32_to_cpu(arg.num_mem_reqs)); |
---|
5424 | 5668 | |
---|
5425 | 5669 | dev_kfree_skb(skb); |
---|
.. | .. |
---|
5488 | 5732 | } |
---|
5489 | 5733 | |
---|
5490 | 5734 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
5491 | | - "wmi event ready sw_version %u abi_version %u mac_addr %pM status %d\n", |
---|
| 5735 | + "wmi event ready sw_version 0x%08x abi_version %u mac_addr %pM status %d\n", |
---|
5492 | 5736 | __le32_to_cpu(arg.sw_version), |
---|
5493 | 5737 | __le32_to_cpu(arg.abi_version), |
---|
5494 | 5738 | arg.mac_addr, |
---|
5495 | 5739 | __le32_to_cpu(arg.status)); |
---|
5496 | 5740 | |
---|
5497 | | - ether_addr_copy(ar->mac_addr, arg.mac_addr); |
---|
| 5741 | + if (is_zero_ether_addr(ar->mac_addr)) |
---|
| 5742 | + ether_addr_copy(ar->mac_addr, arg.mac_addr); |
---|
5498 | 5743 | complete(&ar->wmi.unified_ready); |
---|
5499 | 5744 | return 0; |
---|
5500 | 5745 | } |
---|
.. | .. |
---|
5995 | 6240 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
5996 | 6241 | "received event id %d not implemented\n", id); |
---|
5997 | 6242 | break; |
---|
| 6243 | + case WMI_10_2_PEER_STA_PS_STATECHG_EVENTID: |
---|
| 6244 | + ath10k_wmi_event_peer_sta_ps_state_chg(ar, skb); |
---|
| 6245 | + break; |
---|
5998 | 6246 | default: |
---|
5999 | 6247 | ath10k_warn(ar, "Unknown eventid: %d\n", id); |
---|
6000 | 6248 | break; |
---|
.. | .. |
---|
6112 | 6360 | case WMI_10_4_DFS_STATUS_CHECK_EVENTID: |
---|
6113 | 6361 | ath10k_wmi_event_dfs_status_check(ar, skb); |
---|
6114 | 6362 | break; |
---|
| 6363 | + case WMI_10_4_PEER_STA_PS_STATECHG_EVENTID: |
---|
| 6364 | + ath10k_wmi_event_peer_sta_ps_state_chg(ar, skb); |
---|
| 6365 | + break; |
---|
6115 | 6366 | default: |
---|
6116 | 6367 | ath10k_warn(ar, "Unknown eventid: %d\n", id); |
---|
6117 | 6368 | break; |
---|
.. | .. |
---|
6158 | 6409 | |
---|
6159 | 6410 | ar->wmi.eid = conn_resp.eid; |
---|
6160 | 6411 | return 0; |
---|
| 6412 | +} |
---|
| 6413 | + |
---|
| 6414 | +static struct sk_buff * |
---|
| 6415 | +ath10k_wmi_op_gen_pdev_set_base_macaddr(struct ath10k *ar, |
---|
| 6416 | + const u8 macaddr[ETH_ALEN]) |
---|
| 6417 | +{ |
---|
| 6418 | + struct wmi_pdev_set_base_macaddr_cmd *cmd; |
---|
| 6419 | + struct sk_buff *skb; |
---|
| 6420 | + |
---|
| 6421 | + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
---|
| 6422 | + if (!skb) |
---|
| 6423 | + return ERR_PTR(-ENOMEM); |
---|
| 6424 | + |
---|
| 6425 | + cmd = (struct wmi_pdev_set_base_macaddr_cmd *)skb->data; |
---|
| 6426 | + ether_addr_copy(cmd->mac_addr.addr, macaddr); |
---|
| 6427 | + |
---|
| 6428 | + ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
| 6429 | + "wmi pdev basemac %pM\n", macaddr); |
---|
| 6430 | + return skb; |
---|
6161 | 6431 | } |
---|
6162 | 6432 | |
---|
6163 | 6433 | static struct sk_buff * |
---|
.. | .. |
---|
6291 | 6561 | struct wmi_init_cmd *cmd; |
---|
6292 | 6562 | struct sk_buff *buf; |
---|
6293 | 6563 | struct wmi_resource_config config = {}; |
---|
6294 | | - u32 len, val; |
---|
| 6564 | + u32 val; |
---|
6295 | 6565 | |
---|
6296 | 6566 | config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS); |
---|
6297 | 6567 | config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS); |
---|
.. | .. |
---|
6343 | 6613 | config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC); |
---|
6344 | 6614 | config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES); |
---|
6345 | 6615 | |
---|
6346 | | - len = sizeof(*cmd) + |
---|
6347 | | - (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
---|
6348 | | - |
---|
6349 | | - buf = ath10k_wmi_alloc_skb(ar, len); |
---|
| 6616 | + buf = ath10k_wmi_alloc_skb(ar, struct_size(cmd, mem_chunks.items, |
---|
| 6617 | + ar->wmi.num_mem_chunks)); |
---|
6350 | 6618 | if (!buf) |
---|
6351 | 6619 | return ERR_PTR(-ENOMEM); |
---|
6352 | 6620 | |
---|
.. | .. |
---|
6364 | 6632 | struct wmi_init_cmd_10x *cmd; |
---|
6365 | 6633 | struct sk_buff *buf; |
---|
6366 | 6634 | struct wmi_resource_config_10x config = {}; |
---|
6367 | | - u32 len, val; |
---|
| 6635 | + u32 val; |
---|
6368 | 6636 | |
---|
6369 | 6637 | config.num_vdevs = __cpu_to_le32(TARGET_10X_NUM_VDEVS); |
---|
6370 | 6638 | config.num_peers = __cpu_to_le32(TARGET_10X_NUM_PEERS); |
---|
.. | .. |
---|
6408 | 6676 | config.num_msdu_desc = __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC); |
---|
6409 | 6677 | config.max_frag_entries = __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES); |
---|
6410 | 6678 | |
---|
6411 | | - len = sizeof(*cmd) + |
---|
6412 | | - (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
---|
6413 | | - |
---|
6414 | | - buf = ath10k_wmi_alloc_skb(ar, len); |
---|
| 6679 | + buf = ath10k_wmi_alloc_skb(ar, struct_size(cmd, mem_chunks.items, |
---|
| 6680 | + ar->wmi.num_mem_chunks)); |
---|
6415 | 6681 | if (!buf) |
---|
6416 | 6682 | return ERR_PTR(-ENOMEM); |
---|
6417 | 6683 | |
---|
.. | .. |
---|
6429 | 6695 | struct wmi_init_cmd_10_2 *cmd; |
---|
6430 | 6696 | struct sk_buff *buf; |
---|
6431 | 6697 | struct wmi_resource_config_10x config = {}; |
---|
6432 | | - u32 len, val, features; |
---|
| 6698 | + u32 val, features; |
---|
6433 | 6699 | |
---|
6434 | 6700 | config.num_vdevs = __cpu_to_le32(TARGET_10X_NUM_VDEVS); |
---|
6435 | 6701 | config.num_peer_keys = __cpu_to_le32(TARGET_10X_NUM_PEER_KEYS); |
---|
.. | .. |
---|
6481 | 6747 | config.num_msdu_desc = __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC); |
---|
6482 | 6748 | config.max_frag_entries = __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES); |
---|
6483 | 6749 | |
---|
6484 | | - len = sizeof(*cmd) + |
---|
6485 | | - (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
---|
6486 | | - |
---|
6487 | | - buf = ath10k_wmi_alloc_skb(ar, len); |
---|
| 6750 | + buf = ath10k_wmi_alloc_skb(ar, struct_size(cmd, mem_chunks.items, |
---|
| 6751 | + ar->wmi.num_mem_chunks)); |
---|
6488 | 6752 | if (!buf) |
---|
6489 | 6753 | return ERR_PTR(-ENOMEM); |
---|
6490 | 6754 | |
---|
.. | .. |
---|
6516 | 6780 | struct wmi_init_cmd_10_4 *cmd; |
---|
6517 | 6781 | struct sk_buff *buf; |
---|
6518 | 6782 | struct wmi_resource_config_10_4 config = {}; |
---|
6519 | | - u32 len; |
---|
6520 | 6783 | |
---|
6521 | 6784 | config.num_vdevs = __cpu_to_le32(ar->max_num_vdevs); |
---|
6522 | 6785 | config.num_peers = __cpu_to_le32(ar->max_num_peers); |
---|
.. | .. |
---|
6578 | 6841 | config.iphdr_pad_config = __cpu_to_le32(TARGET_10_4_IPHDR_PAD_CONFIG); |
---|
6579 | 6842 | config.qwrap_config = __cpu_to_le32(TARGET_10_4_QWRAP_CONFIG); |
---|
6580 | 6843 | |
---|
6581 | | - len = sizeof(*cmd) + |
---|
6582 | | - (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
---|
6583 | | - |
---|
6584 | | - buf = ath10k_wmi_alloc_skb(ar, len); |
---|
| 6844 | + buf = ath10k_wmi_alloc_skb(ar, struct_size(cmd, mem_chunks.items, |
---|
| 6845 | + ar->wmi.num_mem_chunks)); |
---|
6585 | 6846 | if (!buf) |
---|
6586 | 6847 | return ERR_PTR(-ENOMEM); |
---|
6587 | 6848 | |
---|
.. | .. |
---|
6933 | 7194 | memcpy(cmd->ssid.ssid, arg->ssid, arg->ssid_len); |
---|
6934 | 7195 | } |
---|
6935 | 7196 | |
---|
6936 | | - ath10k_wmi_put_wmi_channel(&cmd->chan, &arg->channel); |
---|
| 7197 | + ath10k_wmi_put_wmi_channel(ar, &cmd->chan, &arg->channel); |
---|
6937 | 7198 | |
---|
6938 | 7199 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
6939 | 7200 | "wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, ch_flags: 0x%0X, max_power: %d\n", |
---|
.. | .. |
---|
7289 | 7550 | struct sk_buff *skb; |
---|
7290 | 7551 | struct wmi_channel_arg *ch; |
---|
7291 | 7552 | struct wmi_channel *ci; |
---|
7292 | | - int len; |
---|
7293 | 7553 | int i; |
---|
7294 | 7554 | |
---|
7295 | | - len = sizeof(*cmd) + arg->n_channels * sizeof(struct wmi_channel); |
---|
7296 | | - |
---|
7297 | | - skb = ath10k_wmi_alloc_skb(ar, len); |
---|
| 7555 | + skb = ath10k_wmi_alloc_skb(ar, struct_size(cmd, chan_info, arg->n_channels)); |
---|
7298 | 7556 | if (!skb) |
---|
7299 | 7557 | return ERR_PTR(-EINVAL); |
---|
7300 | 7558 | |
---|
.. | .. |
---|
7305 | 7563 | ch = &arg->channels[i]; |
---|
7306 | 7564 | ci = &cmd->chan_info[i]; |
---|
7307 | 7565 | |
---|
7308 | | - ath10k_wmi_put_wmi_channel(ci, ch); |
---|
| 7566 | + ath10k_wmi_put_wmi_channel(ar, ci, ch); |
---|
7309 | 7567 | } |
---|
7310 | 7568 | |
---|
7311 | 7569 | return skb; |
---|
.. | .. |
---|
7396 | 7654 | struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf; |
---|
7397 | 7655 | |
---|
7398 | 7656 | ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg); |
---|
7399 | | - if (arg->peer_bw_rxnss_override) |
---|
7400 | | - cmd->peer_bw_rxnss_override = |
---|
7401 | | - __cpu_to_le32((arg->peer_bw_rxnss_override - 1) | |
---|
7402 | | - BIT(PEER_BW_RXNSS_OVERRIDE_OFFSET)); |
---|
7403 | | - else |
---|
7404 | | - cmd->peer_bw_rxnss_override = 0; |
---|
| 7657 | + cmd->peer_bw_rxnss_override = |
---|
| 7658 | + __cpu_to_le32(arg->peer_bw_rxnss_override); |
---|
7405 | 7659 | } |
---|
7406 | 7660 | |
---|
7407 | 7661 | static int |
---|
.. | .. |
---|
8080 | 8334 | len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", |
---|
8081 | 8335 | "MPDUs delivered to stack", pdev->loc_mpdus); |
---|
8082 | 8336 | len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", |
---|
8083 | | - "Oversized AMSUs", pdev->oversize_amsdu); |
---|
| 8337 | + "Oversized AMSDUs", pdev->oversize_amsdu); |
---|
8084 | 8338 | len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", |
---|
8085 | 8339 | "PHY errors", pdev->phy_errs); |
---|
8086 | 8340 | len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", |
---|
.. | .. |
---|
8153 | 8407 | |
---|
8154 | 8408 | static void |
---|
8155 | 8409 | ath10k_wmi_fw_peer_stats_fill(const struct ath10k_fw_stats_peer *peer, |
---|
8156 | | - char *buf, u32 *length) |
---|
| 8410 | + char *buf, u32 *length, bool extended_peer) |
---|
8157 | 8411 | { |
---|
8158 | 8412 | u32 len = *length; |
---|
8159 | 8413 | u32 buf_len = ATH10K_FW_STATS_BUF_SIZE; |
---|
.. | .. |
---|
8166 | 8420 | "Peer TX rate", peer->peer_tx_rate); |
---|
8167 | 8421 | len += scnprintf(buf + len, buf_len - len, "%30s %u\n", |
---|
8168 | 8422 | "Peer RX rate", peer->peer_rx_rate); |
---|
8169 | | - len += scnprintf(buf + len, buf_len - len, "%30s %u\n", |
---|
8170 | | - "Peer RX duration", peer->rx_duration); |
---|
| 8423 | + if (!extended_peer) |
---|
| 8424 | + len += scnprintf(buf + len, buf_len - len, "%30s %llu\n", |
---|
| 8425 | + "Peer RX duration", peer->rx_duration); |
---|
8171 | 8426 | |
---|
8172 | 8427 | len += scnprintf(buf + len, buf_len - len, "\n"); |
---|
8173 | 8428 | *length = len; |
---|
| 8429 | +} |
---|
| 8430 | + |
---|
| 8431 | +static void |
---|
| 8432 | +ath10k_wmi_fw_extd_peer_stats_fill(const struct ath10k_fw_extd_stats_peer *peer, |
---|
| 8433 | + char *buf, u32 *length) |
---|
| 8434 | +{ |
---|
| 8435 | + u32 len = *length; |
---|
| 8436 | + u32 buf_len = ATH10K_FW_STATS_BUF_SIZE; |
---|
| 8437 | + |
---|
| 8438 | + len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", |
---|
| 8439 | + "Peer MAC address", peer->peer_macaddr); |
---|
| 8440 | + len += scnprintf(buf + len, buf_len - len, "%30s %llu\n", |
---|
| 8441 | + "Peer RX duration", peer->rx_duration); |
---|
8174 | 8442 | } |
---|
8175 | 8443 | |
---|
8176 | 8444 | void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar, |
---|
.. | .. |
---|
8218 | 8486 | "================="); |
---|
8219 | 8487 | |
---|
8220 | 8488 | list_for_each_entry(peer, &fw_stats->peers, list) { |
---|
8221 | | - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); |
---|
| 8489 | + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, |
---|
| 8490 | + fw_stats->extended); |
---|
8222 | 8491 | } |
---|
8223 | 8492 | |
---|
8224 | 8493 | unlock: |
---|
.. | .. |
---|
8276 | 8545 | "================="); |
---|
8277 | 8546 | |
---|
8278 | 8547 | list_for_each_entry(peer, &fw_stats->peers, list) { |
---|
8279 | | - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); |
---|
| 8548 | + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, |
---|
| 8549 | + fw_stats->extended); |
---|
8280 | 8550 | } |
---|
8281 | 8551 | |
---|
8282 | 8552 | unlock: |
---|
.. | .. |
---|
8385 | 8655 | const struct ath10k_fw_stats_pdev *pdev; |
---|
8386 | 8656 | const struct ath10k_fw_stats_vdev_extd *vdev; |
---|
8387 | 8657 | const struct ath10k_fw_stats_peer *peer; |
---|
| 8658 | + const struct ath10k_fw_extd_stats_peer *extd_peer; |
---|
8388 | 8659 | size_t num_peers; |
---|
8389 | 8660 | size_t num_vdevs; |
---|
8390 | 8661 | |
---|
.. | .. |
---|
8447 | 8718 | "================="); |
---|
8448 | 8719 | |
---|
8449 | 8720 | list_for_each_entry(peer, &fw_stats->peers, list) { |
---|
8450 | | - ath10k_wmi_fw_peer_stats_fill(peer, buf, &len); |
---|
| 8721 | + ath10k_wmi_fw_peer_stats_fill(peer, buf, &len, |
---|
| 8722 | + fw_stats->extended); |
---|
| 8723 | + } |
---|
| 8724 | + |
---|
| 8725 | + if (fw_stats->extended) { |
---|
| 8726 | + list_for_each_entry(extd_peer, &fw_stats->peers_extd, list) { |
---|
| 8727 | + ath10k_wmi_fw_extd_peer_stats_fill(extd_peer, buf, |
---|
| 8728 | + &len); |
---|
| 8729 | + } |
---|
8451 | 8730 | } |
---|
8452 | 8731 | |
---|
8453 | 8732 | unlock: |
---|
.. | .. |
---|
8543 | 8822 | cmd = (struct wmi_ext_resource_config_10_4_cmd *)skb->data; |
---|
8544 | 8823 | cmd->host_platform_config = __cpu_to_le32(type); |
---|
8545 | 8824 | cmd->fw_feature_bitmap = __cpu_to_le32(fw_feature_bitmap); |
---|
8546 | | - cmd->wlan_gpio_priority = __cpu_to_le32(-1); |
---|
| 8825 | + cmd->wlan_gpio_priority = __cpu_to_le32(ar->coex_gpio_pin); |
---|
8547 | 8826 | cmd->coex_version = __cpu_to_le32(WMI_NO_COEX_VERSION_SUPPORT); |
---|
8548 | 8827 | cmd->coex_gpio_pin1 = __cpu_to_le32(-1); |
---|
8549 | 8828 | cmd->coex_gpio_pin2 = __cpu_to_le32(-1); |
---|
.. | .. |
---|
8688 | 8967 | |
---|
8689 | 8968 | for (i = 0; i < cap->peer_chan_len; i++) { |
---|
8690 | 8969 | chan = (struct wmi_channel *)&peer_cap->peer_chan_list[i]; |
---|
8691 | | - ath10k_wmi_put_wmi_channel(chan, &chan_arg[i]); |
---|
| 8970 | + ath10k_wmi_put_wmi_channel(ar, chan, &chan_arg[i]); |
---|
8692 | 8971 | } |
---|
8693 | 8972 | |
---|
8694 | 8973 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
.. | .. |
---|
8720 | 8999 | "wmi radar found pri_min %d pri_max %d width_min %d width_max %d sidx_min %d sidx_max %d\n", |
---|
8721 | 9000 | arg->pri_min, arg->pri_max, arg->width_min, |
---|
8722 | 9001 | arg->width_max, arg->sidx_min, arg->sidx_max); |
---|
| 9002 | + return skb; |
---|
| 9003 | +} |
---|
| 9004 | + |
---|
| 9005 | +static struct sk_buff * |
---|
| 9006 | +ath10k_wmi_10_4_gen_per_peer_per_tid_cfg(struct ath10k *ar, |
---|
| 9007 | + const struct wmi_per_peer_per_tid_cfg_arg *arg) |
---|
| 9008 | +{ |
---|
| 9009 | + struct wmi_peer_per_tid_cfg_cmd *cmd; |
---|
| 9010 | + struct sk_buff *skb; |
---|
| 9011 | + |
---|
| 9012 | + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
---|
| 9013 | + if (!skb) |
---|
| 9014 | + return ERR_PTR(-ENOMEM); |
---|
| 9015 | + |
---|
| 9016 | + memset(skb->data, 0, sizeof(*cmd)); |
---|
| 9017 | + |
---|
| 9018 | + cmd = (struct wmi_peer_per_tid_cfg_cmd *)skb->data; |
---|
| 9019 | + cmd->vdev_id = cpu_to_le32(arg->vdev_id); |
---|
| 9020 | + ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_macaddr.addr); |
---|
| 9021 | + cmd->tid = cpu_to_le32(arg->tid); |
---|
| 9022 | + cmd->ack_policy = cpu_to_le32(arg->ack_policy); |
---|
| 9023 | + cmd->aggr_control = cpu_to_le32(arg->aggr_control); |
---|
| 9024 | + cmd->rate_control = cpu_to_le32(arg->rate_ctrl); |
---|
| 9025 | + cmd->retry_count = cpu_to_le32(arg->retry_count); |
---|
| 9026 | + cmd->rcode_flags = cpu_to_le32(arg->rcode_flags); |
---|
| 9027 | + cmd->ext_tid_cfg_bitmap = cpu_to_le32(arg->ext_tid_cfg_bitmap); |
---|
| 9028 | + cmd->rtscts_ctrl = cpu_to_le32(arg->rtscts_ctrl); |
---|
| 9029 | + |
---|
| 9030 | + ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
| 9031 | + "wmi noack tid %d vdev id %d ack_policy %d aggr %u rate_ctrl %u rcflag %u retry_count %d rtscts %d ext_tid_cfg_bitmap %d mac_addr %pM\n", |
---|
| 9032 | + arg->tid, arg->vdev_id, arg->ack_policy, arg->aggr_control, |
---|
| 9033 | + arg->rate_ctrl, arg->rcode_flags, arg->retry_count, |
---|
| 9034 | + arg->rtscts_ctrl, arg->ext_tid_cfg_bitmap, arg->peer_macaddr.addr); |
---|
8723 | 9035 | return skb; |
---|
8724 | 9036 | } |
---|
8725 | 9037 | |
---|
.. | .. |
---|
8763 | 9075 | return -ETIMEDOUT; |
---|
8764 | 9076 | |
---|
8765 | 9077 | return 0; |
---|
| 9078 | +} |
---|
| 9079 | + |
---|
| 9080 | +static struct sk_buff * |
---|
| 9081 | +ath10k_wmi_10_2_4_op_gen_bb_timing(struct ath10k *ar, |
---|
| 9082 | + const struct wmi_bb_timing_cfg_arg *arg) |
---|
| 9083 | +{ |
---|
| 9084 | + struct wmi_pdev_bb_timing_cfg_cmd *cmd; |
---|
| 9085 | + struct sk_buff *skb; |
---|
| 9086 | + |
---|
| 9087 | + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
---|
| 9088 | + if (!skb) |
---|
| 9089 | + return ERR_PTR(-ENOMEM); |
---|
| 9090 | + |
---|
| 9091 | + cmd = (struct wmi_pdev_bb_timing_cfg_cmd *)skb->data; |
---|
| 9092 | + cmd->bb_tx_timing = __cpu_to_le32(arg->bb_tx_timing); |
---|
| 9093 | + cmd->bb_xpa_timing = __cpu_to_le32(arg->bb_xpa_timing); |
---|
| 9094 | + |
---|
| 9095 | + ath10k_dbg(ar, ATH10K_DBG_WMI, |
---|
| 9096 | + "wmi pdev bb_tx_timing 0x%x bb_xpa_timing 0x%x\n", |
---|
| 9097 | + arg->bb_tx_timing, arg->bb_xpa_timing); |
---|
| 9098 | + return skb; |
---|
8766 | 9099 | } |
---|
8767 | 9100 | |
---|
8768 | 9101 | static const struct wmi_ops wmi_ops = { |
---|
.. | .. |
---|
8948 | 9281 | .gen_peer_create = ath10k_wmi_op_gen_peer_create, |
---|
8949 | 9282 | .gen_peer_delete = ath10k_wmi_op_gen_peer_delete, |
---|
8950 | 9283 | .gen_peer_flush = ath10k_wmi_op_gen_peer_flush, |
---|
| 9284 | + .gen_pdev_set_base_macaddr = ath10k_wmi_op_gen_pdev_set_base_macaddr, |
---|
8951 | 9285 | .gen_peer_set_param = ath10k_wmi_op_gen_peer_set_param, |
---|
8952 | 9286 | .gen_set_psmode = ath10k_wmi_op_gen_set_psmode, |
---|
8953 | 9287 | .gen_set_sta_ps = ath10k_wmi_op_gen_set_sta_ps, |
---|
.. | .. |
---|
9038 | 9372 | .gen_pdev_enable_adaptive_cca = |
---|
9039 | 9373 | ath10k_wmi_op_gen_pdev_enable_adaptive_cca, |
---|
9040 | 9374 | .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, |
---|
| 9375 | + .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, |
---|
9041 | 9376 | /* .gen_bcn_tmpl not implemented */ |
---|
9042 | 9377 | /* .gen_prb_tmpl not implemented */ |
---|
9043 | 9378 | /* .gen_p2p_go_bcn_ie not implemented */ |
---|
.. | .. |
---|
9065 | 9400 | |
---|
9066 | 9401 | .gen_pdev_suspend = ath10k_wmi_op_gen_pdev_suspend, |
---|
9067 | 9402 | .gen_pdev_resume = ath10k_wmi_op_gen_pdev_resume, |
---|
| 9403 | + .gen_pdev_set_base_macaddr = ath10k_wmi_op_gen_pdev_set_base_macaddr, |
---|
9068 | 9404 | .gen_pdev_set_rd = ath10k_wmi_10x_op_gen_pdev_set_rd, |
---|
9069 | 9405 | .gen_pdev_set_param = ath10k_wmi_op_gen_pdev_set_param, |
---|
9070 | 9406 | .gen_init = ath10k_wmi_10_4_op_gen_init, |
---|
.. | .. |
---|
9108 | 9444 | .gen_pdev_get_tpc_table_cmdid = |
---|
9109 | 9445 | ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid, |
---|
9110 | 9446 | .gen_radar_found = ath10k_wmi_10_4_gen_radar_found, |
---|
| 9447 | + .gen_per_peer_per_tid_cfg = ath10k_wmi_10_4_gen_per_peer_per_tid_cfg, |
---|
9111 | 9448 | |
---|
9112 | 9449 | /* shared with 10.2 */ |
---|
9113 | 9450 | .pull_echo_ev = ath10k_wmi_op_pull_echo_ev, |
---|
.. | .. |
---|
9127 | 9464 | ar->wmi.cmd = &wmi_10_4_cmd_map; |
---|
9128 | 9465 | ar->wmi.vdev_param = &wmi_10_4_vdev_param_map; |
---|
9129 | 9466 | ar->wmi.pdev_param = &wmi_10_4_pdev_param_map; |
---|
| 9467 | + ar->wmi.peer_param = &wmi_peer_param_map; |
---|
9130 | 9468 | ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; |
---|
| 9469 | + ar->wmi_key_cipher = wmi_key_cipher_suites; |
---|
9131 | 9470 | break; |
---|
9132 | 9471 | case ATH10K_FW_WMI_OP_VERSION_10_2_4: |
---|
9133 | 9472 | ar->wmi.cmd = &wmi_10_2_4_cmd_map; |
---|
9134 | 9473 | ar->wmi.ops = &wmi_10_2_4_ops; |
---|
9135 | 9474 | ar->wmi.vdev_param = &wmi_10_2_4_vdev_param_map; |
---|
9136 | 9475 | ar->wmi.pdev_param = &wmi_10_2_4_pdev_param_map; |
---|
| 9476 | + ar->wmi.peer_param = &wmi_peer_param_map; |
---|
9137 | 9477 | ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; |
---|
| 9478 | + ar->wmi_key_cipher = wmi_key_cipher_suites; |
---|
9138 | 9479 | break; |
---|
9139 | 9480 | case ATH10K_FW_WMI_OP_VERSION_10_2: |
---|
9140 | 9481 | ar->wmi.cmd = &wmi_10_2_cmd_map; |
---|
9141 | 9482 | ar->wmi.ops = &wmi_10_2_ops; |
---|
9142 | 9483 | ar->wmi.vdev_param = &wmi_10x_vdev_param_map; |
---|
9143 | 9484 | ar->wmi.pdev_param = &wmi_10x_pdev_param_map; |
---|
| 9485 | + ar->wmi.peer_param = &wmi_peer_param_map; |
---|
9144 | 9486 | ar->wmi.peer_flags = &wmi_10_2_peer_flags_map; |
---|
| 9487 | + ar->wmi_key_cipher = wmi_key_cipher_suites; |
---|
9145 | 9488 | break; |
---|
9146 | 9489 | case ATH10K_FW_WMI_OP_VERSION_10_1: |
---|
9147 | 9490 | ar->wmi.cmd = &wmi_10x_cmd_map; |
---|
9148 | 9491 | ar->wmi.ops = &wmi_10_1_ops; |
---|
9149 | 9492 | ar->wmi.vdev_param = &wmi_10x_vdev_param_map; |
---|
9150 | 9493 | ar->wmi.pdev_param = &wmi_10x_pdev_param_map; |
---|
| 9494 | + ar->wmi.peer_param = &wmi_peer_param_map; |
---|
9151 | 9495 | ar->wmi.peer_flags = &wmi_10x_peer_flags_map; |
---|
| 9496 | + ar->wmi_key_cipher = wmi_key_cipher_suites; |
---|
9152 | 9497 | break; |
---|
9153 | 9498 | case ATH10K_FW_WMI_OP_VERSION_MAIN: |
---|
9154 | 9499 | ar->wmi.cmd = &wmi_cmd_map; |
---|
9155 | 9500 | ar->wmi.ops = &wmi_ops; |
---|
9156 | 9501 | ar->wmi.vdev_param = &wmi_vdev_param_map; |
---|
9157 | 9502 | ar->wmi.pdev_param = &wmi_pdev_param_map; |
---|
| 9503 | + ar->wmi.peer_param = &wmi_peer_param_map; |
---|
9158 | 9504 | ar->wmi.peer_flags = &wmi_peer_flags_map; |
---|
| 9505 | + ar->wmi_key_cipher = wmi_key_cipher_suites; |
---|
9159 | 9506 | break; |
---|
9160 | 9507 | case ATH10K_FW_WMI_OP_VERSION_TLV: |
---|
9161 | 9508 | ath10k_wmi_tlv_attach(ar); |
---|
| 9509 | + ar->wmi_key_cipher = wmi_tlv_key_cipher_suites; |
---|
9162 | 9510 | break; |
---|
9163 | 9511 | case ATH10K_FW_WMI_OP_VERSION_UNSET: |
---|
9164 | 9512 | case ATH10K_FW_WMI_OP_VERSION_MAX: |
---|
.. | .. |
---|
9229 | 9577 | } |
---|
9230 | 9578 | |
---|
9231 | 9579 | cancel_work_sync(&ar->svc_rdy_work); |
---|
9232 | | - |
---|
9233 | | - if (ar->svc_rdy_skb) |
---|
9234 | | - dev_kfree_skb(ar->svc_rdy_skb); |
---|
| 9580 | + dev_kfree_skb(ar->svc_rdy_skb); |
---|
9235 | 9581 | } |
---|