1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
9 #include <linux/types.h>
10 #include <linux/interrupt.h>
11 #include <linux/irq.h>
12 #include <linux/bitfield.h>
27 #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
29 #define ATH11K_TX_MGMT_NUM_PENDING_MAX 512
31 #define ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI 64
33 /* Pending management packets threshold for dropping probe responses */
34 #define ATH11K_PRB_RSP_DROP_THRESHOLD ((ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI * 3) / 4)
36 #define ATH11K_INVALID_HW_MAC_ID 0xFF
38 enum ath11k_supported_bw {
53 #define ATH11K_HT_MCS_MAX 7
54 #define ATH11K_VHT_MCS_MAX 9
55 #define ATH11K_HE_MCS_MAX 11
57 static inline enum wme_ac ath11k_tid_to_ac(u32 tid)
59 return (((tid == 0) || (tid == 3)) ? WME_AC_BE :
60 ((tid == 1) || (tid == 2)) ? WME_AC_BK :
61 ((tid == 4) || (tid == 5)) ? WME_AC_VI :
65 enum ath11k_skb_flags {
66 ATH11K_SKB_HW_80211_ENCAP = BIT(0),
69 struct ath11k_skb_cb {
74 struct ieee80211_vif *vif;
77 struct ath11k_skb_rxcb {
82 struct hal_rx_desc *rx_desc;
93 ATH11K_HW_QCA6390_HW20,
94 ATH11K_HW_IPQ6018_HW10,
97 enum ath11k_firmware_mode {
98 /* the default mode, standard 802.11 functionality */
99 ATH11K_FIRMWARE_MODE_NORMAL,
101 /* factory tests etc */
102 ATH11K_FIRMWARE_MODE_FTM,
105 #define ATH11K_IRQ_NUM_MAX 52
106 #define ATH11K_EXT_IRQ_NUM_MAX 16
108 struct ath11k_ext_irq_grp {
109 struct ath11k_base *ab;
110 u32 irqs[ATH11K_EXT_IRQ_NUM_MAX];
114 struct napi_struct napi;
115 struct net_device napi_ndev;
118 #define HEHANDLE_CAP_PHYINFO_SIZE 3
119 #define HECAP_PHYINFO_SIZE 9
120 #define HECAP_MACINFO_SIZE 5
121 #define HECAP_TXRX_MCS_NSS_SIZE 2
122 #define HECAP_PPET16_PPET8_MAX_SIZE 25
124 #define HE_PPET16_PPET8_SIZE 8
126 /* 802.11ax PPE (PPDU packet Extension) threshold */
127 struct he_ppe_threshold {
130 u32 ppet16_ppet8_ru3_ru0[HE_PPET16_PPET8_SIZE];
134 u8 hecap_macinfo[HECAP_MACINFO_SIZE];
135 u32 hecap_rxmcsnssmap;
136 u32 hecap_txmcsnssmap;
137 u32 hecap_phyinfo[HEHANDLE_CAP_PHYINFO_SIZE];
138 struct he_ppe_threshold hecap_ppet;
145 WMI_HOST_TP_SCALE_MAX = 0,
146 WMI_HOST_TP_SCALE_50 = 1,
147 WMI_HOST_TP_SCALE_25 = 2,
148 WMI_HOST_TP_SCALE_12 = 3,
149 WMI_HOST_TP_SCALE_MIN = 4,
150 WMI_HOST_TP_SCALE_SIZE = 5,
153 enum ath11k_scan_state {
155 ATH11K_SCAN_STARTING,
157 ATH11K_SCAN_ABORTING,
160 enum ath11k_dev_flags {
162 ATH11K_FLAG_CORE_REGISTERED,
163 ATH11K_FLAG_CRASH_FLUSH,
164 ATH11K_FLAG_RAW_MODE,
165 ATH11K_FLAG_HW_CRYPTO_DISABLED,
167 ATH11K_FLAG_RECOVERY,
168 ATH11K_FLAG_UNREGISTERING,
169 ATH11K_FLAG_REGISTERED,
172 enum ath11k_monitor_flags {
173 ATH11K_FLAG_MONITOR_ENABLED,
178 enum wmi_vdev_type vdev_type;
179 enum wmi_vdev_subtype vdev_subtype;
184 u8 hal_addr_search_flags;
188 struct ieee80211_vif *vif;
191 struct wmi_wmm_params_all_arg wmm_params;
192 struct list_head list;
198 /* 127 stations; wmi limit */
202 u8 ssid[IEEE80211_MAX_SSID_LEN];
204 /* P2P_IE with NoA attribute for P2P_GO case */
212 bool spectral_enabled;
215 struct cfg80211_bitrate_mask bitrate_mask;
216 int num_legacy_stations;
217 int rtscts_prot_mode;
221 struct ieee80211_chanctx_conf chanctx;
224 struct ath11k_vif_iter {
226 struct ath11k_vif *arvif;
229 struct ath11k_rx_peer_stats {
232 u64 num_mpdu_fcs_err;
235 u64 other_msdu_count;
236 u64 ampdu_msdu_count;
237 u64 non_ampdu_msdu_count;
239 u64 beamformed_count;
240 u64 mcs_count[HAL_RX_MAX_MCS + 1];
241 u64 nss_count[HAL_RX_MAX_NSS];
242 u64 bw_count[HAL_RX_BW_MAX];
243 u64 gi_count[HAL_RX_GI_MAX];
244 u64 coding_count[HAL_RX_SU_MU_CODING_MAX];
245 u64 tid_count[IEEE80211_NUM_TIDS + 1];
246 u64 pream_cnt[HAL_RX_PREAMBLE_MAX];
247 u64 reception_type[HAL_RX_RECEPTION_TYPE_MAX];
250 u64 ru_alloc_cnt[HAL_RX_RU_ALLOC_TYPE_MAX];
253 #define ATH11K_HE_MCS_NUM 12
254 #define ATH11K_VHT_MCS_NUM 10
255 #define ATH11K_BW_NUM 4
256 #define ATH11K_NSS_NUM 4
257 #define ATH11K_LEGACY_NUM 12
258 #define ATH11K_GI_NUM 4
259 #define ATH11K_HT_MCS_NUM 32
261 enum ath11k_pkt_rx_err {
262 ATH11K_PKT_RX_ERR_FCS,
263 ATH11K_PKT_RX_ERR_TKIP,
264 ATH11K_PKT_RX_ERR_CRYPT,
265 ATH11K_PKT_RX_ERR_PEER_IDX_INVAL,
266 ATH11K_PKT_RX_ERR_MAX,
269 enum ath11k_ampdu_subfrm_num {
270 ATH11K_AMPDU_SUBFRM_NUM_10,
271 ATH11K_AMPDU_SUBFRM_NUM_20,
272 ATH11K_AMPDU_SUBFRM_NUM_30,
273 ATH11K_AMPDU_SUBFRM_NUM_40,
274 ATH11K_AMPDU_SUBFRM_NUM_50,
275 ATH11K_AMPDU_SUBFRM_NUM_60,
276 ATH11K_AMPDU_SUBFRM_NUM_MORE,
277 ATH11K_AMPDU_SUBFRM_NUM_MAX,
280 enum ath11k_amsdu_subfrm_num {
281 ATH11K_AMSDU_SUBFRM_NUM_1,
282 ATH11K_AMSDU_SUBFRM_NUM_2,
283 ATH11K_AMSDU_SUBFRM_NUM_3,
284 ATH11K_AMSDU_SUBFRM_NUM_4,
285 ATH11K_AMSDU_SUBFRM_NUM_MORE,
286 ATH11K_AMSDU_SUBFRM_NUM_MAX,
289 enum ath11k_counter_type {
290 ATH11K_COUNTER_TYPE_BYTES,
291 ATH11K_COUNTER_TYPE_PKTS,
292 ATH11K_COUNTER_TYPE_MAX,
295 enum ath11k_stats_type {
296 ATH11K_STATS_TYPE_SUCC,
297 ATH11K_STATS_TYPE_FAIL,
298 ATH11K_STATS_TYPE_RETRY,
299 ATH11K_STATS_TYPE_AMPDU,
300 ATH11K_STATS_TYPE_MAX,
303 struct ath11k_htt_data_stats {
304 u64 legacy[ATH11K_COUNTER_TYPE_MAX][ATH11K_LEGACY_NUM];
305 u64 ht[ATH11K_COUNTER_TYPE_MAX][ATH11K_HT_MCS_NUM];
306 u64 vht[ATH11K_COUNTER_TYPE_MAX][ATH11K_VHT_MCS_NUM];
307 u64 he[ATH11K_COUNTER_TYPE_MAX][ATH11K_HE_MCS_NUM];
308 u64 bw[ATH11K_COUNTER_TYPE_MAX][ATH11K_BW_NUM];
309 u64 nss[ATH11K_COUNTER_TYPE_MAX][ATH11K_NSS_NUM];
310 u64 gi[ATH11K_COUNTER_TYPE_MAX][ATH11K_GI_NUM];
313 struct ath11k_htt_tx_stats {
314 struct ath11k_htt_data_stats stats[ATH11K_STATS_TYPE_MAX];
320 struct ath11k_per_ppdu_tx_stats {
330 struct ath11k_vif *arvif;
332 /* the following are protected by ar->data_lock */
333 u32 changed; /* IEEE80211_RC_* */
337 enum hal_pn_type pn_type;
339 struct work_struct update_wk;
340 struct rate_info txrate;
341 struct rate_info last_txrate;
345 struct ath11k_htt_tx_stats *tx_stats;
346 struct ath11k_rx_peer_stats *rx_stats;
348 #ifdef CONFIG_MAC80211_DEBUGFS
349 /* protected by conf_mutex */
354 #define ATH11K_MIN_5G_FREQ 4150
355 #define ATH11K_MIN_6G_FREQ 5945
356 #define ATH11K_MAX_6G_FREQ 7115
357 #define ATH11K_NUM_CHANS 100
358 #define ATH11K_MAX_5G_CHAN 173
363 ATH11K_STATE_RESTARTING,
364 ATH11K_STATE_RESTARTED,
366 /* Add other states as required */
369 /* Antenna noise floor */
370 #define ATH11K_DEFAULT_NOISE_FLOOR -95
372 struct ath11k_fw_stats {
373 struct dentry *debugfs_fwstats;
376 struct list_head pdevs;
377 struct list_head vdevs;
378 struct list_head bcn;
381 struct ath11k_dbg_htt_stats {
384 struct debug_htt_stats_req *stats_req;
385 /* protects shared stats req buffer */
389 struct ath11k_debug {
390 struct dentry *debugfs_pdev;
391 struct ath11k_dbg_htt_stats htt_stats;
393 struct ath11k_fw_stats fw_stats;
394 struct completion fw_stats_complete;
399 u32 pktlog_peer_valid;
400 u8 pktlog_peer_addr[ETH_ALEN];
404 struct ath11k_per_peer_tx_stats {
416 #define ATH11K_FLUSH_TIMEOUT (5 * HZ)
418 struct ath11k_vdev_stop_status {
419 bool stop_in_progress;
424 struct ath11k_base *ab;
425 struct ath11k_pdev *pdev;
426 struct ieee80211_hw *hw;
427 struct ieee80211_ops *ops;
428 struct ath11k_pdev_wmi *wmi;
429 struct ath11k_pdev_dp dp;
430 u8 mac_addr[ETH_ALEN];
433 struct ath11k_he ar_he;
434 enum ath11k_state state;
437 struct completion started;
438 struct completion completed;
439 struct completion on_channel;
440 struct delayed_work timeout;
441 enum ath11k_scan_state state;
449 struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
450 struct ieee80211_sband_iftype_data
451 iftype[NUM_NL80211_BANDS][NUM_NL80211_IFTYPES];
453 unsigned long dev_flags;
454 unsigned int filter_flags;
455 unsigned long monitor_flags;
458 u32 txpower_limit_2g;
459 u32 txpower_limit_5g;
464 u32 max_num_stations;
465 bool monitor_present;
466 /* To synchronize concurrent synchronous mac80211 callback operations,
467 * concurrent debugfs configuration and concurrent FW statistics events.
469 struct mutex conf_mutex;
470 /* protects the radio specific data like debug stats, ppdu_stats_info stats,
471 * vdev_stop_status info, scan data, ath11k_sta info, ath11k_vif info,
472 * channel context data, survey info, test mode data.
474 spinlock_t data_lock;
476 struct list_head arvifs;
477 /* should never be NULL; needed for regular htt rx */
478 struct ieee80211_channel *rx_channel;
480 /* valid during scan; needed for mgmt rx during scan */
481 struct ieee80211_channel *scan_channel;
487 /* pdev_idx starts from 0 whereas pdev->pdev_id starts with 1 */
491 struct completion peer_assoc_done;
493 int install_key_status;
494 struct completion install_key_done;
496 int last_wmi_vdev_start_status;
497 struct ath11k_vdev_stop_status vdev_stop_status;
498 struct completion vdev_setup_done;
502 u32 num_started_vdevs;
503 u32 num_created_vdevs;
504 unsigned long long allocated_vdev_map;
506 struct idr txmgmt_idr;
507 /* protects txmgmt_idr data */
508 spinlock_t txmgmt_idr_lock;
509 atomic_t num_pending_mgmt_tx;
511 /* cycle count is reported twice for each visited channel during scan.
512 * access protected by data_lock
514 u32 survey_last_rx_clear_count;
515 u32 survey_last_cycle_count;
517 /* Channel info events are expected to come in pairs without and with
518 * COMPLETE flag set respectively for each channel visit during scan.
520 * However there are deviations from this rule. This flag is used to
521 * avoid reporting garbage data.
523 bool ch_info_can_report_survey;
524 struct survey_info survey[ATH11K_NUM_CHANS];
525 struct completion bss_survey_done;
527 struct work_struct regd_update_work;
529 struct work_struct wmi_mgmt_tx_work;
530 struct sk_buff_head wmi_mgmt_tx_queue;
532 struct ath11k_per_peer_tx_stats peer_tx_stats;
533 struct list_head ppdu_stats_info;
534 u32 ppdu_stat_list_depth;
536 struct ath11k_per_peer_tx_stats cached_stats;
539 #ifdef CONFIG_ATH11K_DEBUGFS
540 struct ath11k_debug debug;
542 #ifdef CONFIG_ATH11K_SPECTRAL
543 struct ath11k_spectral spectral;
545 bool dfs_block_radar_events;
546 struct ath11k_thermal thermal;
549 struct ath11k_band_cap {
551 u32 max_bw_supported;
555 u32 he_cap_phy_info[PSOC_HOST_MAX_PHY_SIZE];
556 struct ath11k_ppe_threshold he_ppet;
560 struct ath11k_pdev_cap {
568 u32 tx_chain_mask_shift;
569 u32 rx_chain_mask_shift;
570 struct ath11k_band_cap band[NUM_NL80211_BANDS];
576 struct ath11k_pdev_cap cap;
577 u8 mac_addr[ETH_ALEN];
580 struct ath11k_board_data {
581 const struct firmware *fw;
586 struct ath11k_bus_params {
590 bool fixed_mem_region;
593 /* IPQ8074 HW channel counters frequency value in hertz */
594 #define IPQ8074_CC_FREQ_HERTZ 320000
596 struct ath11k_bp_stats {
597 /* Head Pointer reported by the last HTT Backpressure event for the ring */
600 /* Tail Pointer reported by the last HTT Backpressure event for the ring */
603 /* Number of Backpressure events received for the ring */
606 /* Last recorded event timestamp */
607 unsigned long jiffies;
610 struct ath11k_dp_ring_bp_stats {
611 struct ath11k_bp_stats umac_ring_bp_stats[HTT_SW_UMAC_RING_IDX_MAX];
612 struct ath11k_bp_stats lmac_ring_bp_stats[HTT_SW_LMAC_RING_IDX_MAX][MAX_RADIOS];
615 struct ath11k_soc_dp_tx_err_stats {
616 /* TCL Ring Descriptor unavailable */
617 u32 desc_na[DP_TCL_NUM_RING_MAX];
618 /* Other failures during dp_tx due to mem allocation failure
619 * idr unavailable etc.
624 struct ath11k_soc_dp_stats {
627 u32 rxdma_error[HAL_REO_ENTR_RING_RXDMA_ECODE_MAX];
628 u32 reo_error[HAL_REO_DEST_RING_ERROR_CODE_MAX];
629 u32 hal_reo_error[DP_REO_DST_RING_MAX];
630 struct ath11k_soc_dp_tx_err_stats tx_err;
631 struct ath11k_dp_ring_bp_stats bp_stats;
634 /* Master structure to hold the hw data which may be used in core module */
636 enum ath11k_hw_rev hw_rev;
637 struct platform_device *pdev;
639 struct ath11k_qmi qmi;
640 struct ath11k_wmi_base wmi_ab;
641 struct completion fw_ready;
642 struct rproc *tgt_rproc;
644 /* HW channel counters frequency value in hertz common to all MACs */
647 struct ath11k_htc htc;
652 unsigned long mem_len;
656 const struct ath11k_hif_ops *ops;
660 struct timer_list rx_replenish_retry;
661 struct ath11k_hal hal;
662 /* To synchronize core_start/core_stop */
663 struct mutex core_lock;
664 /* Protects data like peers */
665 spinlock_t base_lock;
666 struct ath11k_pdev pdevs[MAX_RADIOS];
667 struct ath11k_pdev __rcu *pdevs_active[MAX_RADIOS];
668 struct ath11k_hal_reg_capabilities_ext hal_reg_cap[MAX_RADIOS];
669 unsigned long long free_vdev_map;
670 struct list_head peers;
671 wait_queue_head_t peer_mapping_wq;
672 u8 mac_addr[ETH_ALEN];
674 u32 wlan_init_status;
675 int irq_num[ATH11K_IRQ_NUM_MAX];
676 struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX];
677 struct napi_struct *napi;
678 struct ath11k_targ_cap target_caps;
679 u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE];
680 bool pdevs_macaddr_valid;
683 struct ath11k_hw_params hw_params;
684 struct ath11k_bus_params bus_params;
686 const struct firmware *cal_file;
688 /* Below regd's are protected by ab->data_lock */
689 /* This is the regd set for every radio
690 * by the firmware during initializatin
692 struct ieee80211_regdomain *default_regd[MAX_RADIOS];
693 /* This regd is set during dynamic country setting
694 * This may or may not be used during the runtime
696 struct ieee80211_regdomain *new_regd[MAX_RADIOS];
698 /* Current DFS Regulatory */
699 enum ath11k_dfs_region dfs_region;
700 #ifdef CONFIG_ATH11K_DEBUGFS
701 struct dentry *debugfs_soc;
702 struct dentry *debugfs_ath11k;
704 struct ath11k_soc_dp_stats soc_stats;
706 unsigned long dev_flags;
707 struct completion driver_recovery;
708 struct workqueue_struct *workqueue;
709 struct work_struct restart_work;
711 /* protected by data_lock */
712 u32 fw_crash_counter;
714 u32 pktlog_defs_checksum;
716 /* Round robbin based TCL ring selector */
717 atomic_t tcl_ring_selector;
719 struct ath11k_dbring_cap *db_caps;
723 u8 drv_priv[0] __aligned(sizeof(void *));
726 struct ath11k_fw_stats_pdev {
727 struct list_head list;
731 /* Cycles spent transmitting frames */
733 /* Cycles spent receiving frames */
735 /* Total channel busy time, evidently */
737 /* Total on-channel time */
749 /* Num HTT cookies queued to dispatch list */
751 /* Num HTT cookies dispatched */
753 /* Num MSDU queued to WAL */
755 /* Num MPDU queue to WAL */
757 /* Num MSDUs dropped by WMM limit */
759 /* Num Local frames queued */
761 /* Num Local frames done */
763 /* Num queued to HW */
765 /* Num PPDU reaped from HW */
769 /* Num PPDUs cleaned up in TX abort */
771 /* Num MPDUs requed by SW */
773 /* excessive retries */
775 /* data hw rate code */
777 /* Scheduler self triggers */
779 /* frames dropped due to excessive sw retries */
780 u32 sw_retry_failure;
781 /* illegal rate phy errors */
782 u32 illgl_rate_phy_err;
783 /* wal pdev continuous xretry */
784 u32 pdev_cont_xretry;
785 /* wal pdev tx timeouts */
787 /* wal pdev resets */
789 /* frames dropped due to non-availability of stateless TIDs */
790 u32 stateless_tid_alloc_failure;
791 /* PhY/BB underrun */
793 /* MPDU is more than txop limit */
797 /* Cnts any change in ring routing mid-ppdu */
798 s32 mid_ppdu_route_change;
799 /* Total number of statuses processed */
801 /* Extra frags on rings 0-3 */
806 /* MSDUs / MPDUs delivered to HTT */
809 /* MSDUs / MPDUs delivered to local stack */
812 /* AMSDUs that have more MSDUs than the status ring size */
814 /* Number of PHY errors */
816 /* Number of PHY errors drops */
818 /* Number of mpdu errors - FCS, MIC, ENC etc. */
822 struct ath11k_fw_stats_vdev {
823 struct list_head list;
828 u32 num_tx_frames[WLAN_MAX_AC];
830 u32 num_tx_frames_retries[WLAN_MAX_AC];
831 u32 num_tx_frames_failures[WLAN_MAX_AC];
836 u32 num_tx_not_acked;
837 u32 tx_rate_history[MAX_TX_RATE_VALUES];
838 u32 beacon_rssi_history[MAX_TX_RATE_VALUES];
841 struct ath11k_fw_stats_bcn {
842 struct list_head list;
846 u32 tx_bcn_outage_cnt;
849 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[];
850 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[];
851 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[];
853 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
854 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
856 void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
857 void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id,
858 u8 *mac_addr, u16 ast_hash);
859 struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id,
861 struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,
863 struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
864 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
865 int ath11k_core_pre_init(struct ath11k_base *ab);
866 int ath11k_core_init(struct ath11k_base *ath11k);
867 void ath11k_core_deinit(struct ath11k_base *ath11k);
868 struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
870 const struct ath11k_bus_params *bus_params);
871 void ath11k_core_free(struct ath11k_base *ath11k);
872 int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
873 struct ath11k_board_data *bd);
874 void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd);
876 void ath11k_core_halt(struct ath11k *ar);
878 const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
879 const char *filename);
881 static inline const char *ath11k_scan_state_str(enum ath11k_scan_state state)
884 case ATH11K_SCAN_IDLE:
886 case ATH11K_SCAN_STARTING:
888 case ATH11K_SCAN_RUNNING:
890 case ATH11K_SCAN_ABORTING:
897 static inline struct ath11k_skb_cb *ATH11K_SKB_CB(struct sk_buff *skb)
899 return (struct ath11k_skb_cb *)&IEEE80211_SKB_CB(skb)->driver_data;
902 static inline struct ath11k_skb_rxcb *ATH11K_SKB_RXCB(struct sk_buff *skb)
904 BUILD_BUG_ON(sizeof(struct ath11k_skb_rxcb) > sizeof(skb->cb));
905 return (struct ath11k_skb_rxcb *)skb->cb;
908 static inline struct ath11k_vif *ath11k_vif_to_arvif(struct ieee80211_vif *vif)
910 return (struct ath11k_vif *)vif->drv_priv;
913 static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab,
916 return ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar;
919 static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab,
920 const char *filename,
921 void *buf, size_t buf_len)
923 snprintf(buf, buf_len, "%s/%s/%s", ATH11K_FW_DIR,
924 ab->hw_params.fw.dir, filename);
927 static inline const char *ath11k_bus_str(enum ath11k_bus bus)
939 #endif /* _CORE_H_ */