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 extern unsigned int ath11k_frame_mode;
40 enum ath11k_supported_bw {
55 #define ATH11K_HT_MCS_MAX 7
56 #define ATH11K_VHT_MCS_MAX 9
57 #define ATH11K_HE_MCS_MAX 11
59 enum ath11k_crypt_mode {
60 /* Only use hardware crypto engine */
62 /* Only use software crypto */
66 static inline enum wme_ac ath11k_tid_to_ac(u32 tid)
68 return (((tid == 0) || (tid == 3)) ? WME_AC_BE :
69 ((tid == 1) || (tid == 2)) ? WME_AC_BK :
70 ((tid == 4) || (tid == 5)) ? WME_AC_VI :
74 enum ath11k_skb_flags {
75 ATH11K_SKB_HW_80211_ENCAP = BIT(0),
78 struct ath11k_skb_cb {
83 struct ieee80211_vif *vif;
86 struct ath11k_skb_rxcb {
91 struct hal_rx_desc *rx_desc;
102 ATH11K_HW_QCA6390_HW20,
103 ATH11K_HW_IPQ6018_HW10,
106 enum ath11k_firmware_mode {
107 /* the default mode, standard 802.11 functionality */
108 ATH11K_FIRMWARE_MODE_NORMAL,
110 /* factory tests etc */
111 ATH11K_FIRMWARE_MODE_FTM,
114 #define ATH11K_IRQ_NUM_MAX 52
115 #define ATH11K_EXT_IRQ_NUM_MAX 16
117 struct ath11k_ext_irq_grp {
118 struct ath11k_base *ab;
119 u32 irqs[ATH11K_EXT_IRQ_NUM_MAX];
123 struct napi_struct napi;
124 struct net_device napi_ndev;
127 #define HEHANDLE_CAP_PHYINFO_SIZE 3
128 #define HECAP_PHYINFO_SIZE 9
129 #define HECAP_MACINFO_SIZE 5
130 #define HECAP_TXRX_MCS_NSS_SIZE 2
131 #define HECAP_PPET16_PPET8_MAX_SIZE 25
133 #define HE_PPET16_PPET8_SIZE 8
135 /* 802.11ax PPE (PPDU packet Extension) threshold */
136 struct he_ppe_threshold {
139 u32 ppet16_ppet8_ru3_ru0[HE_PPET16_PPET8_SIZE];
143 u8 hecap_macinfo[HECAP_MACINFO_SIZE];
144 u32 hecap_rxmcsnssmap;
145 u32 hecap_txmcsnssmap;
146 u32 hecap_phyinfo[HEHANDLE_CAP_PHYINFO_SIZE];
147 struct he_ppe_threshold hecap_ppet;
154 WMI_HOST_TP_SCALE_MAX = 0,
155 WMI_HOST_TP_SCALE_50 = 1,
156 WMI_HOST_TP_SCALE_25 = 2,
157 WMI_HOST_TP_SCALE_12 = 3,
158 WMI_HOST_TP_SCALE_MIN = 4,
159 WMI_HOST_TP_SCALE_SIZE = 5,
162 enum ath11k_scan_state {
164 ATH11K_SCAN_STARTING,
166 ATH11K_SCAN_ABORTING,
169 enum ath11k_dev_flags {
171 ATH11K_FLAG_CORE_REGISTERED,
172 ATH11K_FLAG_CRASH_FLUSH,
173 ATH11K_FLAG_RAW_MODE,
174 ATH11K_FLAG_HW_CRYPTO_DISABLED,
176 ATH11K_FLAG_RECOVERY,
177 ATH11K_FLAG_UNREGISTERING,
178 ATH11K_FLAG_REGISTERED,
181 enum ath11k_monitor_flags {
182 ATH11K_FLAG_MONITOR_ENABLED,
187 enum wmi_vdev_type vdev_type;
188 enum wmi_vdev_subtype vdev_subtype;
193 u8 hal_addr_search_flags;
197 struct ieee80211_vif *vif;
200 struct wmi_wmm_params_all_arg wmm_params;
201 struct list_head list;
207 /* 127 stations; wmi limit */
211 u8 ssid[IEEE80211_MAX_SSID_LEN];
213 /* P2P_IE with NoA attribute for P2P_GO case */
221 bool spectral_enabled;
224 struct cfg80211_bitrate_mask bitrate_mask;
225 int num_legacy_stations;
226 int rtscts_prot_mode;
230 struct ieee80211_chanctx_conf chanctx;
233 struct ath11k_vif_iter {
235 struct ath11k_vif *arvif;
238 struct ath11k_rx_peer_stats {
241 u64 num_mpdu_fcs_err;
244 u64 other_msdu_count;
245 u64 ampdu_msdu_count;
246 u64 non_ampdu_msdu_count;
248 u64 beamformed_count;
249 u64 mcs_count[HAL_RX_MAX_MCS + 1];
250 u64 nss_count[HAL_RX_MAX_NSS];
251 u64 bw_count[HAL_RX_BW_MAX];
252 u64 gi_count[HAL_RX_GI_MAX];
253 u64 coding_count[HAL_RX_SU_MU_CODING_MAX];
254 u64 tid_count[IEEE80211_NUM_TIDS + 1];
255 u64 pream_cnt[HAL_RX_PREAMBLE_MAX];
256 u64 reception_type[HAL_RX_RECEPTION_TYPE_MAX];
259 u64 ru_alloc_cnt[HAL_RX_RU_ALLOC_TYPE_MAX];
262 #define ATH11K_HE_MCS_NUM 12
263 #define ATH11K_VHT_MCS_NUM 10
264 #define ATH11K_BW_NUM 4
265 #define ATH11K_NSS_NUM 4
266 #define ATH11K_LEGACY_NUM 12
267 #define ATH11K_GI_NUM 4
268 #define ATH11K_HT_MCS_NUM 32
270 enum ath11k_pkt_rx_err {
271 ATH11K_PKT_RX_ERR_FCS,
272 ATH11K_PKT_RX_ERR_TKIP,
273 ATH11K_PKT_RX_ERR_CRYPT,
274 ATH11K_PKT_RX_ERR_PEER_IDX_INVAL,
275 ATH11K_PKT_RX_ERR_MAX,
278 enum ath11k_ampdu_subfrm_num {
279 ATH11K_AMPDU_SUBFRM_NUM_10,
280 ATH11K_AMPDU_SUBFRM_NUM_20,
281 ATH11K_AMPDU_SUBFRM_NUM_30,
282 ATH11K_AMPDU_SUBFRM_NUM_40,
283 ATH11K_AMPDU_SUBFRM_NUM_50,
284 ATH11K_AMPDU_SUBFRM_NUM_60,
285 ATH11K_AMPDU_SUBFRM_NUM_MORE,
286 ATH11K_AMPDU_SUBFRM_NUM_MAX,
289 enum ath11k_amsdu_subfrm_num {
290 ATH11K_AMSDU_SUBFRM_NUM_1,
291 ATH11K_AMSDU_SUBFRM_NUM_2,
292 ATH11K_AMSDU_SUBFRM_NUM_3,
293 ATH11K_AMSDU_SUBFRM_NUM_4,
294 ATH11K_AMSDU_SUBFRM_NUM_MORE,
295 ATH11K_AMSDU_SUBFRM_NUM_MAX,
298 enum ath11k_counter_type {
299 ATH11K_COUNTER_TYPE_BYTES,
300 ATH11K_COUNTER_TYPE_PKTS,
301 ATH11K_COUNTER_TYPE_MAX,
304 enum ath11k_stats_type {
305 ATH11K_STATS_TYPE_SUCC,
306 ATH11K_STATS_TYPE_FAIL,
307 ATH11K_STATS_TYPE_RETRY,
308 ATH11K_STATS_TYPE_AMPDU,
309 ATH11K_STATS_TYPE_MAX,
312 struct ath11k_htt_data_stats {
313 u64 legacy[ATH11K_COUNTER_TYPE_MAX][ATH11K_LEGACY_NUM];
314 u64 ht[ATH11K_COUNTER_TYPE_MAX][ATH11K_HT_MCS_NUM];
315 u64 vht[ATH11K_COUNTER_TYPE_MAX][ATH11K_VHT_MCS_NUM];
316 u64 he[ATH11K_COUNTER_TYPE_MAX][ATH11K_HE_MCS_NUM];
317 u64 bw[ATH11K_COUNTER_TYPE_MAX][ATH11K_BW_NUM];
318 u64 nss[ATH11K_COUNTER_TYPE_MAX][ATH11K_NSS_NUM];
319 u64 gi[ATH11K_COUNTER_TYPE_MAX][ATH11K_GI_NUM];
322 struct ath11k_htt_tx_stats {
323 struct ath11k_htt_data_stats stats[ATH11K_STATS_TYPE_MAX];
329 struct ath11k_per_ppdu_tx_stats {
339 struct ath11k_vif *arvif;
341 /* the following are protected by ar->data_lock */
342 u32 changed; /* IEEE80211_RC_* */
346 enum hal_pn_type pn_type;
348 struct work_struct update_wk;
349 struct rate_info txrate;
350 struct rate_info last_txrate;
354 struct ath11k_htt_tx_stats *tx_stats;
355 struct ath11k_rx_peer_stats *rx_stats;
357 #ifdef CONFIG_MAC80211_DEBUGFS
358 /* protected by conf_mutex */
363 #define ATH11K_MIN_5G_FREQ 4150
364 #define ATH11K_MIN_6G_FREQ 5945
365 #define ATH11K_MAX_6G_FREQ 7115
366 #define ATH11K_NUM_CHANS 100
367 #define ATH11K_MAX_5G_CHAN 173
372 ATH11K_STATE_RESTARTING,
373 ATH11K_STATE_RESTARTED,
375 /* Add other states as required */
378 /* Antenna noise floor */
379 #define ATH11K_DEFAULT_NOISE_FLOOR -95
381 struct ath11k_fw_stats {
382 struct dentry *debugfs_fwstats;
385 struct list_head pdevs;
386 struct list_head vdevs;
387 struct list_head bcn;
390 struct ath11k_dbg_htt_stats {
393 struct debug_htt_stats_req *stats_req;
394 /* protects shared stats req buffer */
398 struct ath11k_debug {
399 struct dentry *debugfs_pdev;
400 struct ath11k_dbg_htt_stats htt_stats;
402 struct ath11k_fw_stats fw_stats;
403 struct completion fw_stats_complete;
408 u32 pktlog_peer_valid;
409 u8 pktlog_peer_addr[ETH_ALEN];
413 struct ath11k_per_peer_tx_stats {
425 #define ATH11K_FLUSH_TIMEOUT (5 * HZ)
427 struct ath11k_vdev_stop_status {
428 bool stop_in_progress;
433 struct ath11k_base *ab;
434 struct ath11k_pdev *pdev;
435 struct ieee80211_hw *hw;
436 struct ieee80211_ops *ops;
437 struct ath11k_pdev_wmi *wmi;
438 struct ath11k_pdev_dp dp;
439 u8 mac_addr[ETH_ALEN];
442 struct ath11k_he ar_he;
443 enum ath11k_state state;
446 struct completion started;
447 struct completion completed;
448 struct completion on_channel;
449 struct delayed_work timeout;
450 enum ath11k_scan_state state;
458 struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
459 struct ieee80211_sband_iftype_data
460 iftype[NUM_NL80211_BANDS][NUM_NL80211_IFTYPES];
462 unsigned long dev_flags;
463 unsigned int filter_flags;
464 unsigned long monitor_flags;
467 u32 txpower_limit_2g;
468 u32 txpower_limit_5g;
473 u32 max_num_stations;
474 bool monitor_present;
475 /* To synchronize concurrent synchronous mac80211 callback operations,
476 * concurrent debugfs configuration and concurrent FW statistics events.
478 struct mutex conf_mutex;
479 /* protects the radio specific data like debug stats, ppdu_stats_info stats,
480 * vdev_stop_status info, scan data, ath11k_sta info, ath11k_vif info,
481 * channel context data, survey info, test mode data.
483 spinlock_t data_lock;
485 struct list_head arvifs;
486 /* should never be NULL; needed for regular htt rx */
487 struct ieee80211_channel *rx_channel;
489 /* valid during scan; needed for mgmt rx during scan */
490 struct ieee80211_channel *scan_channel;
496 /* pdev_idx starts from 0 whereas pdev->pdev_id starts with 1 */
500 struct completion peer_assoc_done;
502 int install_key_status;
503 struct completion install_key_done;
505 int last_wmi_vdev_start_status;
506 struct ath11k_vdev_stop_status vdev_stop_status;
507 struct completion vdev_setup_done;
511 u32 num_started_vdevs;
512 u32 num_created_vdevs;
513 unsigned long long allocated_vdev_map;
515 struct idr txmgmt_idr;
516 /* protects txmgmt_idr data */
517 spinlock_t txmgmt_idr_lock;
518 atomic_t num_pending_mgmt_tx;
520 /* cycle count is reported twice for each visited channel during scan.
521 * access protected by data_lock
523 u32 survey_last_rx_clear_count;
524 u32 survey_last_cycle_count;
526 /* Channel info events are expected to come in pairs without and with
527 * COMPLETE flag set respectively for each channel visit during scan.
529 * However there are deviations from this rule. This flag is used to
530 * avoid reporting garbage data.
532 bool ch_info_can_report_survey;
533 struct survey_info survey[ATH11K_NUM_CHANS];
534 struct completion bss_survey_done;
536 struct work_struct regd_update_work;
538 struct work_struct wmi_mgmt_tx_work;
539 struct sk_buff_head wmi_mgmt_tx_queue;
541 struct ath11k_per_peer_tx_stats peer_tx_stats;
542 struct list_head ppdu_stats_info;
543 u32 ppdu_stat_list_depth;
545 struct ath11k_per_peer_tx_stats cached_stats;
548 #ifdef CONFIG_ATH11K_DEBUGFS
549 struct ath11k_debug debug;
551 #ifdef CONFIG_ATH11K_SPECTRAL
552 struct ath11k_spectral spectral;
554 bool dfs_block_radar_events;
555 struct ath11k_thermal thermal;
558 struct ath11k_band_cap {
560 u32 max_bw_supported;
564 u32 he_cap_phy_info[PSOC_HOST_MAX_PHY_SIZE];
565 struct ath11k_ppe_threshold he_ppet;
569 struct ath11k_pdev_cap {
577 u32 tx_chain_mask_shift;
578 u32 rx_chain_mask_shift;
579 struct ath11k_band_cap band[NUM_NL80211_BANDS];
585 struct ath11k_pdev_cap cap;
586 u8 mac_addr[ETH_ALEN];
589 struct ath11k_board_data {
590 const struct firmware *fw;
595 struct ath11k_bus_params {
599 bool fixed_mem_region;
602 /* IPQ8074 HW channel counters frequency value in hertz */
603 #define IPQ8074_CC_FREQ_HERTZ 320000
605 struct ath11k_bp_stats {
606 /* Head Pointer reported by the last HTT Backpressure event for the ring */
609 /* Tail Pointer reported by the last HTT Backpressure event for the ring */
612 /* Number of Backpressure events received for the ring */
615 /* Last recorded event timestamp */
616 unsigned long jiffies;
619 struct ath11k_dp_ring_bp_stats {
620 struct ath11k_bp_stats umac_ring_bp_stats[HTT_SW_UMAC_RING_IDX_MAX];
621 struct ath11k_bp_stats lmac_ring_bp_stats[HTT_SW_LMAC_RING_IDX_MAX][MAX_RADIOS];
624 struct ath11k_soc_dp_tx_err_stats {
625 /* TCL Ring Descriptor unavailable */
626 u32 desc_na[DP_TCL_NUM_RING_MAX];
627 /* Other failures during dp_tx due to mem allocation failure
628 * idr unavailable etc.
633 struct ath11k_soc_dp_stats {
636 u32 rxdma_error[HAL_REO_ENTR_RING_RXDMA_ECODE_MAX];
637 u32 reo_error[HAL_REO_DEST_RING_ERROR_CODE_MAX];
638 u32 hal_reo_error[DP_REO_DST_RING_MAX];
639 struct ath11k_soc_dp_tx_err_stats tx_err;
640 struct ath11k_dp_ring_bp_stats bp_stats;
643 /* Master structure to hold the hw data which may be used in core module */
645 enum ath11k_hw_rev hw_rev;
646 struct platform_device *pdev;
648 struct ath11k_qmi qmi;
649 struct ath11k_wmi_base wmi_ab;
650 struct completion fw_ready;
651 struct rproc *tgt_rproc;
653 /* HW channel counters frequency value in hertz common to all MACs */
656 struct ath11k_htc htc;
661 unsigned long mem_len;
665 const struct ath11k_hif_ops *ops;
669 struct timer_list rx_replenish_retry;
670 struct ath11k_hal hal;
671 /* To synchronize core_start/core_stop */
672 struct mutex core_lock;
673 /* Protects data like peers */
674 spinlock_t base_lock;
675 struct ath11k_pdev pdevs[MAX_RADIOS];
676 struct ath11k_pdev __rcu *pdevs_active[MAX_RADIOS];
677 struct ath11k_hal_reg_capabilities_ext hal_reg_cap[MAX_RADIOS];
678 unsigned long long free_vdev_map;
679 struct list_head peers;
680 wait_queue_head_t peer_mapping_wq;
681 u8 mac_addr[ETH_ALEN];
683 u32 wlan_init_status;
684 int irq_num[ATH11K_IRQ_NUM_MAX];
685 struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX];
686 struct napi_struct *napi;
687 struct ath11k_targ_cap target_caps;
688 u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE];
689 bool pdevs_macaddr_valid;
692 struct ath11k_hw_params hw_params;
693 struct ath11k_bus_params bus_params;
695 const struct firmware *cal_file;
697 /* Below regd's are protected by ab->data_lock */
698 /* This is the regd set for every radio
699 * by the firmware during initializatin
701 struct ieee80211_regdomain *default_regd[MAX_RADIOS];
702 /* This regd is set during dynamic country setting
703 * This may or may not be used during the runtime
705 struct ieee80211_regdomain *new_regd[MAX_RADIOS];
707 /* Current DFS Regulatory */
708 enum ath11k_dfs_region dfs_region;
709 #ifdef CONFIG_ATH11K_DEBUGFS
710 struct dentry *debugfs_soc;
711 struct dentry *debugfs_ath11k;
713 struct ath11k_soc_dp_stats soc_stats;
715 unsigned long dev_flags;
716 struct completion driver_recovery;
717 struct workqueue_struct *workqueue;
718 struct work_struct restart_work;
720 /* protected by data_lock */
721 u32 fw_crash_counter;
723 u32 pktlog_defs_checksum;
725 /* Round robbin based TCL ring selector */
726 atomic_t tcl_ring_selector;
728 struct ath11k_dbring_cap *db_caps;
732 u8 drv_priv[0] __aligned(sizeof(void *));
735 struct ath11k_fw_stats_pdev {
736 struct list_head list;
740 /* Cycles spent transmitting frames */
742 /* Cycles spent receiving frames */
744 /* Total channel busy time, evidently */
746 /* Total on-channel time */
758 /* Num HTT cookies queued to dispatch list */
760 /* Num HTT cookies dispatched */
762 /* Num MSDU queued to WAL */
764 /* Num MPDU queue to WAL */
766 /* Num MSDUs dropped by WMM limit */
768 /* Num Local frames queued */
770 /* Num Local frames done */
772 /* Num queued to HW */
774 /* Num PPDU reaped from HW */
778 /* Num PPDUs cleaned up in TX abort */
780 /* Num MPDUs requed by SW */
782 /* excessive retries */
784 /* data hw rate code */
786 /* Scheduler self triggers */
788 /* frames dropped due to excessive sw retries */
789 u32 sw_retry_failure;
790 /* illegal rate phy errors */
791 u32 illgl_rate_phy_err;
792 /* wal pdev continuous xretry */
793 u32 pdev_cont_xretry;
794 /* wal pdev tx timeouts */
796 /* wal pdev resets */
798 /* frames dropped due to non-availability of stateless TIDs */
799 u32 stateless_tid_alloc_failure;
800 /* PhY/BB underrun */
802 /* MPDU is more than txop limit */
806 /* Cnts any change in ring routing mid-ppdu */
807 s32 mid_ppdu_route_change;
808 /* Total number of statuses processed */
810 /* Extra frags on rings 0-3 */
815 /* MSDUs / MPDUs delivered to HTT */
818 /* MSDUs / MPDUs delivered to local stack */
821 /* AMSDUs that have more MSDUs than the status ring size */
823 /* Number of PHY errors */
825 /* Number of PHY errors drops */
827 /* Number of mpdu errors - FCS, MIC, ENC etc. */
831 struct ath11k_fw_stats_vdev {
832 struct list_head list;
837 u32 num_tx_frames[WLAN_MAX_AC];
839 u32 num_tx_frames_retries[WLAN_MAX_AC];
840 u32 num_tx_frames_failures[WLAN_MAX_AC];
845 u32 num_tx_not_acked;
846 u32 tx_rate_history[MAX_TX_RATE_VALUES];
847 u32 beacon_rssi_history[MAX_TX_RATE_VALUES];
850 struct ath11k_fw_stats_bcn {
851 struct list_head list;
855 u32 tx_bcn_outage_cnt;
858 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[];
859 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[];
860 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[];
862 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
863 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
865 void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
866 void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id,
867 u8 *mac_addr, u16 ast_hash);
868 struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id,
870 struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,
872 struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
873 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
874 int ath11k_core_pre_init(struct ath11k_base *ab);
875 int ath11k_core_init(struct ath11k_base *ath11k);
876 void ath11k_core_deinit(struct ath11k_base *ath11k);
877 struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
879 const struct ath11k_bus_params *bus_params);
880 void ath11k_core_free(struct ath11k_base *ath11k);
881 int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
882 struct ath11k_board_data *bd);
883 void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd);
885 void ath11k_core_halt(struct ath11k *ar);
887 const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
888 const char *filename);
890 static inline const char *ath11k_scan_state_str(enum ath11k_scan_state state)
893 case ATH11K_SCAN_IDLE:
895 case ATH11K_SCAN_STARTING:
897 case ATH11K_SCAN_RUNNING:
899 case ATH11K_SCAN_ABORTING:
906 static inline struct ath11k_skb_cb *ATH11K_SKB_CB(struct sk_buff *skb)
908 return (struct ath11k_skb_cb *)&IEEE80211_SKB_CB(skb)->driver_data;
911 static inline struct ath11k_skb_rxcb *ATH11K_SKB_RXCB(struct sk_buff *skb)
913 BUILD_BUG_ON(sizeof(struct ath11k_skb_rxcb) > sizeof(skb->cb));
914 return (struct ath11k_skb_rxcb *)skb->cb;
917 static inline struct ath11k_vif *ath11k_vif_to_arvif(struct ieee80211_vif *vif)
919 return (struct ath11k_vif *)vif->drv_priv;
922 static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab,
925 return ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar;
928 static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab,
929 const char *filename,
930 void *buf, size_t buf_len)
932 snprintf(buf, buf_len, "%s/%s/%s", ATH11K_FW_DIR,
933 ab->hw_params.fw.dir, filename);
936 static inline const char *ath11k_bus_str(enum ath11k_bus bus)
948 #endif /* _CORE_H_ */