Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: BSD-3-Clause-Clear */
 2/*
 3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
 4 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 5 */
 6
 7#ifndef ATH12K_MAC_H
 8#define ATH12K_MAC_H
 9
10#include <net/mac80211.h>
11#include <net/cfg80211.h>
 
12
13struct ath12k;
14struct ath12k_base;
 
 
15
16struct ath12k_generic_iter {
17	struct ath12k *ar;
18	int ret;
19};
20
21/* number of failed packets (20 packets with 16 sw reties each) */
22#define ATH12K_KICKOUT_THRESHOLD		(20 * 16)
23
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
26 * is seconds.
27 */
28#define ATH12K_KEEPALIVE_MIN_IDLE		3747
29#define ATH12K_KEEPALIVE_MAX_IDLE		3895
30#define ATH12K_KEEPALIVE_MAX_UNRESPONSIVE	3900
31
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)
35
36#define ATH12K_CHAN_WIDTH_NUM			14
37
38#define ATH12K_TX_POWER_MAX_VAL	70
39#define ATH12K_TX_POWER_MIN_VAL	0
40
 
 
 
41enum ath12k_supported_bw {
42	ATH12K_BW_20    = 0,
43	ATH12K_BW_40    = 1,
44	ATH12K_BW_80    = 2,
45	ATH12K_BW_160   = 3,
46	ATH12K_BW_320   = 4,
47};
48
49extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default;
50
51void ath12k_mac_destroy(struct ath12k_base *ab);
52void ath12k_mac_unregister(struct ath12k_base *ab);
53int ath12k_mac_register(struct ath12k_base *ab);
54int ath12k_mac_allocate(struct ath12k_base *ab);
55int ath12k_mac_hw_ratecode_to_legacy_rate(u8 hw_rc, u8 preamble, u8 *rateidx,
56					  u16 *rate);
57u8 ath12k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
58			     u32 bitrate);
59u8 ath12k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
60			     u8 hw_rate, bool cck);
61
62void __ath12k_mac_scan_finish(struct ath12k *ar);
63void ath12k_mac_scan_finish(struct ath12k *ar);
64
65struct ath12k_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id);
66struct ath12k_vif *ath12k_mac_get_arvif_by_vdev_id(struct ath12k_base *ab,
67						   u32 vdev_id);
68struct ath12k *ath12k_mac_get_ar_by_vdev_id(struct ath12k_base *ab, u32 vdev_id);
69struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id);
70
71void ath12k_mac_drain_tx(struct ath12k *ar);
72void ath12k_mac_peer_cleanup_all(struct ath12k *ar);
73int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
74enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);
75enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);
76enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);
77int ath12k_mac_rfkill_enable_radio(struct ath12k *ar, bool enable);
78int ath12k_mac_rfkill_config(struct ath12k *ar);
 
 
 
 
 
 
 
 
79#endif
v6.13.7
 1/* SPDX-License-Identifier: BSD-3-Clause-Clear */
 2/*
 3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
 4 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
 5 */
 6
 7#ifndef ATH12K_MAC_H
 8#define ATH12K_MAC_H
 9
10#include <net/mac80211.h>
11#include <net/cfg80211.h>
12#include "wmi.h"
13
14struct ath12k;
15struct ath12k_base;
16struct ath12k_hw;
17struct ath12k_pdev_map;
18
19struct ath12k_generic_iter {
20	struct ath12k *ar;
21	int ret;
22};
23
24/* number of failed packets (20 packets with 16 sw reties each) */
25#define ATH12K_KICKOUT_THRESHOLD		(20 * 16)
26
27/* Use insanely high numbers to make sure that the firmware implementation
28 * won't start, we have the same functionality already in hostapd. Unit
29 * is seconds.
30 */
31#define ATH12K_KEEPALIVE_MIN_IDLE		3747
32#define ATH12K_KEEPALIVE_MAX_IDLE		3895
33#define ATH12K_KEEPALIVE_MAX_UNRESPONSIVE	3900
34
35/* FIXME: should these be in ieee80211.h? */
36#define IEEE80211_VHT_MCS_SUPPORT_0_11_MASK	GENMASK(23, 16)
37#define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11	BIT(24)
38
39#define ATH12K_CHAN_WIDTH_NUM			14
40
41#define ATH12K_TX_POWER_MAX_VAL	70
42#define ATH12K_TX_POWER_MIN_VAL	0
43
44#define ATH12K_DEFAULT_LINK_ID	0
45#define ATH12K_INVALID_LINK_ID	255
46
47enum ath12k_supported_bw {
48	ATH12K_BW_20    = 0,
49	ATH12K_BW_40    = 1,
50	ATH12K_BW_80    = 2,
51	ATH12K_BW_160   = 3,
52	ATH12K_BW_320   = 4,
53};
54
55extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default;
56
57void ath12k_mac_destroy(struct ath12k_base *ab);
58void ath12k_mac_unregister(struct ath12k_base *ab);
59int ath12k_mac_register(struct ath12k_base *ab);
60int ath12k_mac_allocate(struct ath12k_base *ab);
61int ath12k_mac_hw_ratecode_to_legacy_rate(u8 hw_rc, u8 preamble, u8 *rateidx,
62					  u16 *rate);
63u8 ath12k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
64			     u32 bitrate);
65u8 ath12k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
66			     u8 hw_rate, bool cck);
67
68void __ath12k_mac_scan_finish(struct ath12k *ar);
69void ath12k_mac_scan_finish(struct ath12k *ar);
70
71struct ath12k_link_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id);
72struct ath12k_link_vif *ath12k_mac_get_arvif_by_vdev_id(struct ath12k_base *ab,
73							u32 vdev_id);
74struct ath12k *ath12k_mac_get_ar_by_vdev_id(struct ath12k_base *ab, u32 vdev_id);
75struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id);
76
77void ath12k_mac_drain_tx(struct ath12k *ar);
78void ath12k_mac_peer_cleanup_all(struct ath12k *ar);
79int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
80enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);
81enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);
82enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);
83int ath12k_mac_rfkill_enable_radio(struct ath12k *ar, bool enable);
84int ath12k_mac_rfkill_config(struct ath12k *ar);
85int ath12k_mac_wait_tx_complete(struct ath12k *ar);
86void ath12k_mac_handle_beacon(struct ath12k *ar, struct sk_buff *skb);
87void ath12k_mac_handle_beacon_miss(struct ath12k *ar, u32 vdev_id);
88int ath12k_mac_vif_set_keepalive(struct ath12k_link_vif *arvif,
89				 enum wmi_sta_keepalive_method method,
90				 u32 interval);
91u8 ath12k_mac_get_target_pdev_id(struct ath12k *ar);
92
93#endif