Path: blob/main/sys/contrib/dev/athk/ath12k/mac.h
105663 views
/* SPDX-License-Identifier: BSD-3-Clause-Clear */1/*2* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.3* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.4*/56#ifndef ATH12K_MAC_H7#define ATH12K_MAC_H89#include <net/mac80211.h>10#include <net/cfg80211.h>1112struct ath12k;13struct ath12k_base;1415struct ath12k_generic_iter {16struct ath12k *ar;17int ret;18};1920/* number of failed packets (20 packets with 16 sw reties each) */21#define ATH12K_KICKOUT_THRESHOLD (20 * 16)2223/* Use insanely high numbers to make sure that the firmware implementation24* won't start, we have the same functionality already in hostapd. Unit25* is seconds.26*/27#define ATH12K_KEEPALIVE_MIN_IDLE 374728#define ATH12K_KEEPALIVE_MAX_IDLE 389529#define ATH12K_KEEPALIVE_MAX_UNRESPONSIVE 39003031/* FIXME: should these be in ieee80211.h? */32#define IEEE80211_VHT_MCS_SUPPORT_0_11_MASK GENMASK(23, 16)33#define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11 BIT(24)3435#define ATH12K_CHAN_WIDTH_NUM 143637#define ATH12K_TX_POWER_MAX_VAL 7038#define ATH12K_TX_POWER_MIN_VAL 03940enum ath12k_supported_bw {41ATH12K_BW_20 = 0,42ATH12K_BW_40 = 1,43ATH12K_BW_80 = 2,44ATH12K_BW_160 = 3,45};4647extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default;4849void ath12k_mac_destroy(struct ath12k_base *ab);50void ath12k_mac_unregister(struct ath12k_base *ab);51int ath12k_mac_register(struct ath12k_base *ab);52int ath12k_mac_allocate(struct ath12k_base *ab);53int ath12k_mac_hw_ratecode_to_legacy_rate(u8 hw_rc, u8 preamble, u8 *rateidx,54u16 *rate);55u8 ath12k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,56u32 bitrate);57u8 ath12k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,58u8 hw_rate, bool cck);5960void __ath12k_mac_scan_finish(struct ath12k *ar);61void ath12k_mac_scan_finish(struct ath12k *ar);6263struct ath12k_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id);64struct ath12k_vif *ath12k_mac_get_arvif_by_vdev_id(struct ath12k_base *ab,65u32 vdev_id);66struct ath12k *ath12k_mac_get_ar_by_vdev_id(struct ath12k_base *ab, u32 vdev_id);67struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id);6869void ath12k_mac_drain_tx(struct ath12k *ar);70void ath12k_mac_peer_cleanup_all(struct ath12k *ar);71int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);72enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);73enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);74enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);75#endif767778