1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
10 #include <net/mac80211.h>
11 #include <net/cfg80211.h>
16 struct ath12k_generic_iter {
21 /* number of failed packets (20 packets with 16 sw reties each) */
22 #define ATH12K_KICKOUT_THRESHOLD (20 * 16)
24 /* Use insanely high numbers to make sure that the firmware implementation
25 * won't start, we have the same functionality already in hostapd. Unit
28 #define ATH12K_KEEPALIVE_MIN_IDLE 3747
29 #define ATH12K_KEEPALIVE_MAX_IDLE 3895
30 #define ATH12K_KEEPALIVE_MAX_UNRESPONSIVE 3900
32 /* FIXME: should these be in ieee80211.h? */
33 #define IEEE80211_VHT_MCS_SUPPORT_0_11_MASK GENMASK(23, 16)
34 #define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11 BIT(24)
36 #define ATH12K_CHAN_WIDTH_NUM 8
38 #define ATH12K_TX_POWER_MAX_VAL 70
39 #define ATH12K_TX_POWER_MIN_VAL 0
41 enum ath12k_supported_bw {
48 extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default;
50 void ath12k_mac_destroy(struct ath12k_base *ab);
51 void ath12k_mac_unregister(struct ath12k_base *ab);
52 int ath12k_mac_register(struct ath12k_base *ab);
53 int ath12k_mac_allocate(struct ath12k_base *ab);
54 int ath12k_mac_hw_ratecode_to_legacy_rate(u8 hw_rc, u8 preamble, u8 *rateidx,
56 u8 ath12k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
58 u8 ath12k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
59 u8 hw_rate, bool cck);
61 void __ath12k_mac_scan_finish(struct ath12k *ar);
62 void ath12k_mac_scan_finish(struct ath12k *ar);
64 struct ath12k_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id);
65 struct ath12k_vif *ath12k_mac_get_arvif_by_vdev_id(struct ath12k_base *ab,
67 struct ath12k *ath12k_mac_get_ar_by_vdev_id(struct ath12k_base *ab, u32 vdev_id);
68 struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id);
70 void ath12k_mac_drain_tx(struct ath12k *ar);
71 void ath12k_mac_peer_cleanup_all(struct ath12k *ar);
72 int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
73 enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);
74 enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);
75 enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);