linux/drivers/net/wireless/ath/ath11k/core.h

/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#ifndef ATH11K_CORE_H
#define ATH11K_CORE_H

#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/bitfield.h>
#include <linux/dmi.h>
#include <linux/ctype.h>
#include <linux/rhashtable.h>
#include <linux/average.h>
#include <linux/firmware.h>

#include "qmi.h"
#include "htc.h"
#include "wmi.h"
#include "hal.h"
#include "dp.h"
#include "ce.h"
#include "mac.h"
#include "hw.h"
#include "hal_rx.h"
#include "reg.h"
#include "thermal.h"
#include "dbring.h"
#include "spectral.h"
#include "wow.h"
#include "fw.h"

#define SM(_v, _f)

#define ATH11K_TX_MGMT_NUM_PENDING_MAX

#define ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI

/* Pending management packets threshold for dropping probe responses */
#define ATH11K_PRB_RSP_DROP_THRESHOLD

#define ATH11K_INVALID_HW_MAC_ID
#define ATH11K_CONNECTION_LOSS_HZ

/* SMBIOS type containing Board Data File Name Extension */
#define ATH11K_SMBIOS_BDF_EXT_TYPE

/* SMBIOS type structure length (excluding strings-set) */
#define ATH11K_SMBIOS_BDF_EXT_LENGTH

/* The magic used by QCA spec */
#define ATH11K_SMBIOS_BDF_EXT_MAGIC

extern unsigned int ath11k_frame_mode;
extern bool ath11k_ftm_mode;

#define ATH11K_SCAN_TIMEOUT_HZ

#define ATH11K_MON_TIMER_INTERVAL
#define ATH11K_RESET_TIMEOUT_HZ
#define ATH11K_RESET_MAX_FAIL_COUNT_FIRST
#define ATH11K_RESET_MAX_FAIL_COUNT_FINAL
#define ATH11K_RESET_FAIL_TIMEOUT_HZ
#define ATH11K_RECONFIGURE_TIMEOUT_HZ
#define ATH11K_RECOVER_START_TIMEOUT_HZ

enum ath11k_supported_bw {};

enum ath11k_bdf_search {};

enum wme_ac {};

#define ATH11K_HT_MCS_MAX
#define ATH11K_VHT_MCS_MAX
#define ATH11K_HE_MCS_MAX

enum ath11k_crypt_mode {};

static inline enum wme_ac ath11k_tid_to_ac(u32 tid)
{}

enum ath11k_skb_flags {};

struct ath11k_skb_cb {} __packed;

struct ath11k_skb_rxcb {};

enum ath11k_hw_rev {};

enum ath11k_firmware_mode {};

extern bool ath11k_cold_boot_cal;

#define ATH11K_IRQ_NUM_MAX
#define ATH11K_EXT_IRQ_NUM_MAX

struct ath11k_ext_irq_grp {};

enum ath11k_smbios_cc_type {};

struct ath11k_smbios_bdf {} __packed;

#define HEHANDLE_CAP_PHYINFO_SIZE
#define HECAP_PHYINFO_SIZE
#define HECAP_MACINFO_SIZE
#define HECAP_TXRX_MCS_NSS_SIZE
#define HECAP_PPET16_PPET8_MAX_SIZE

#define HE_PPET16_PPET8_SIZE

/* 802.11ax PPE (PPDU packet Extension) threshold */
struct he_ppe_threshold {};

struct ath11k_he {};

#define MAX_RADIOS

/* ipq5018 hw param macros */
#define MAX_RADIOS_5018
#define CE_CNT_5018
#define TARGET_CE_CNT_5018
#define SVC_CE_MAP_LEN_5018
#define RXDMA_PER_PDEV_5018

enum {};

enum ath11k_scan_state {};

enum ath11k_11d_state {};

enum ath11k_dev_flags {};

enum ath11k_monitor_flags {};

#define ATH11K_IPV6_UC_TYPE
#define ATH11K_IPV6_AC_TYPE

#define ATH11K_IPV6_MAX_COUNT
#define ATH11K_IPV4_MAX_COUNT

struct ath11k_arp_ns_offload {};

struct ath11k_rekey_data {};

/**
 * struct ath11k_chan_power_info - TPE containing power info per channel chunk
 * @chan_cfreq: channel center freq (MHz)
 * e.g.
 * channel 37/20 MHz,  it is 6135
 * channel 37/40 MHz,  it is 6125
 * channel 37/80 MHz,  it is 6145
 * channel 37/160 MHz, it is 6185
 * @tx_power: transmit power (dBm)
 */
struct ath11k_chan_power_info {};

/* ath11k only deals with 160 MHz, so 8 subchannels */
#define ATH11K_NUM_PWR_LEVELS

/**
 * struct ath11k_reg_tpc_power_info - regulatory TPC power info
 * @is_psd_power: is PSD power or not
 * @eirp_power: Maximum EIRP power (dBm), valid only if power is PSD
 * @ap_power_type: type of power (SP/LPI/VLP)
 * @num_pwr_levels: number of power levels
 * @reg_max: Array of maximum TX power (dBm) per PSD value
 * @ap_constraint_power: AP constraint power (dBm)
 * @tpe: TPE values processed from TPE IE
 * @chan_power_info: power info to send to firmware
 */
struct ath11k_reg_tpc_power_info {};

struct ath11k_vif {};

struct ath11k_vif_iter {};

struct ath11k_rx_peer_stats {};

#define ATH11K_HE_MCS_NUM
#define ATH11K_VHT_MCS_NUM
#define ATH11K_BW_NUM
#define ATH11K_NSS_NUM
#define ATH11K_LEGACY_NUM
#define ATH11K_GI_NUM
#define ATH11K_HT_MCS_NUM

enum ath11k_pkt_rx_err {};

enum ath11k_ampdu_subfrm_num {};

enum ath11k_amsdu_subfrm_num {};

enum ath11k_counter_type {};

enum ath11k_stats_type {};

struct ath11k_htt_data_stats {};

struct ath11k_htt_tx_stats {};

struct ath11k_per_ppdu_tx_stats {};

DECLARE_EWMA(avg_rssi, 10, 8)

struct ath11k_sta {};

#define ATH11K_MIN_5G_FREQ
#define ATH11K_MIN_6G_FREQ
#define ATH11K_MAX_6G_FREQ
#define ATH11K_NUM_CHANS
#define ATH11K_MAX_5G_CHAN

enum ath11k_state {};

/* Antenna noise floor */
#define ATH11K_DEFAULT_NOISE_FLOOR

#define ATH11K_INVALID_RSSI_FULL

#define ATH11K_INVALID_RSSI_EMPTY

struct ath11k_fw_stats {};

struct ath11k_dbg_htt_stats {};

#define MAX_MODULE_ID_BITMAP_WORDS

struct ath11k_debug {};

struct ath11k_per_peer_tx_stats {};

#define ATH11K_FLUSH_TIMEOUT
#define ATH11K_VDEV_DELETE_TIMEOUT_HZ

struct ath11k {};

struct ath11k_band_cap {};

struct ath11k_pdev_cap {};

struct ath11k_pdev {};

struct ath11k_board_data {};

struct ath11k_pci_ops {};

/* IPQ8074 HW channel counters frequency value in hertz */
#define IPQ8074_CC_FREQ_HERTZ

struct ath11k_bp_stats {};

struct ath11k_dp_ring_bp_stats {};

struct ath11k_soc_dp_tx_err_stats {};

struct ath11k_soc_dp_stats {};

struct ath11k_msi_user {};

struct ath11k_msi_config {};

/* Master structure to hold the hw data which may be used in core module */
struct ath11k_base {};

struct ath11k_fw_stats_pdev {};

struct ath11k_fw_stats_vdev {};

struct ath11k_fw_stats_bcn {};

void ath11k_fw_stats_init(struct ath11k *ar);
void ath11k_fw_stats_pdevs_free(struct list_head *head);
void ath11k_fw_stats_vdevs_free(struct list_head *head);
void ath11k_fw_stats_bcn_free(struct list_head *head);
void ath11k_fw_stats_free(struct ath11k_fw_stats *stats);

extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018[];

extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];

extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[];

extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
int ath11k_core_pre_init(struct ath11k_base *ab);
int ath11k_core_init(struct ath11k_base *ath11k);
void ath11k_core_deinit(struct ath11k_base *ath11k);
struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
				      enum ath11k_bus bus);
void ath11k_core_free(struct ath11k_base *ath11k);
int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
			  struct ath11k_board_data *bd);
int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd);
int ath11k_core_fetch_board_data_api_1(struct ath11k_base *ab,
				       struct ath11k_board_data *bd,
				       const char *name);
void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd);
int ath11k_core_check_dt(struct ath11k_base *ath11k);
int ath11k_core_check_smbios(struct ath11k_base *ab);
void ath11k_core_halt(struct ath11k *ar);
int ath11k_core_resume_early(struct ath11k_base *ab);
int ath11k_core_resume(struct ath11k_base *ab);
int ath11k_core_suspend(struct ath11k_base *ab);
int ath11k_core_suspend_late(struct ath11k_base *ab);
void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab);

const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
						    const char *filename);

static inline const char *ath11k_scan_state_str(enum ath11k_scan_state state)
{}

static inline struct ath11k_skb_cb *ATH11K_SKB_CB(struct sk_buff *skb)
{}

static inline struct ath11k_skb_rxcb *ATH11K_SKB_RXCB(struct sk_buff *skb)
{}

static inline struct ath11k_vif *ath11k_vif_to_arvif(struct ieee80211_vif *vif)
{}

static inline struct ath11k_sta *ath11k_sta_to_arsta(struct ieee80211_sta *sta)
{}

static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab,
					     int mac_id)
{}

static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab,
						    const char *filename,
						    void *buf, size_t buf_len)
{}

static inline const char *ath11k_bus_str(enum ath11k_bus bus)
{}

#endif /* _CORE_H_ */