#ifndef __MT76_CONNAC_MCU_H
#define __MT76_CONNAC_MCU_H
#include "mt76_connac.h"
#define FW_FEATURE_SET_ENCRYPT …
#define FW_FEATURE_SET_KEY_IDX …
#define FW_FEATURE_ENCRY_MODE …
#define FW_FEATURE_OVERRIDE_ADDR …
#define FW_FEATURE_NON_DL …
#define DL_MODE_ENCRYPT …
#define DL_MODE_KEY_IDX …
#define DL_MODE_RESET_SEC_IV …
#define DL_MODE_WORKING_PDA_CR4 …
#define DL_MODE_VALID_RAM_ENTRY …
#define DL_CONFIG_ENCRY_MODE_SEL …
#define DL_MODE_NEED_RSP …
#define FW_START_OVERRIDE …
#define FW_START_WORKING_PDA_CR4 …
#define FW_START_WORKING_PDA_DSP …
#define PATCH_SEC_NOT_SUPPORT …
#define PATCH_SEC_TYPE_MASK …
#define PATCH_SEC_TYPE_INFO …
#define PATCH_SEC_ENC_TYPE_MASK …
#define PATCH_SEC_ENC_TYPE_PLAIN …
#define PATCH_SEC_ENC_TYPE_AES …
#define PATCH_SEC_ENC_TYPE_SCRAMBLE …
#define PATCH_SEC_ENC_SCRAMBLE_INFO_MASK …
#define PATCH_SEC_ENC_AES_KEY_MASK …
enum { … };
#define MCU_PQ_ID(p, q) …
#define MCU_PKT_ID …
struct mt76_connac2_mcu_txd { … } __packed __aligned(…);
struct mt76_connac2_mcu_uni_txd { … } __packed __aligned(…);
struct mt76_connac2_mcu_rxd { … };
struct mt76_connac2_patch_hdr { … } __packed;
struct mt76_connac2_patch_sec { … } __packed;
struct mt76_connac2_fw_trailer { … } __packed;
struct mt76_connac2_fw_region { … } __packed;
struct tlv { … } __packed;
struct bss_info_omac { … } __packed;
struct bss_info_basic { … } __packed;
struct bss_info_rf_ch { … } __packed;
struct bss_info_ext_bss { … } __packed;
enum { … };
struct sta_ntlv_hdr { … } __packed;
struct sta_req_hdr { … } __packed;
struct sta_rec_basic { … } __packed;
struct sta_rec_ht { … } __packed;
struct sta_rec_vht { … } __packed;
struct sta_rec_uapsd { … } __packed;
struct sta_rec_ba { … } __packed;
struct sta_rec_he { … } __packed;
struct sta_rec_he_v2 { … } __packed;
struct sta_rec_amsdu { … } __packed;
struct sta_rec_state { … } __packed;
#define RA_LEGACY_OFDM …
#define RA_LEGACY_CCK …
#define HT_MCS_MASK_NUM …
struct sta_rec_ra_info { … } __packed;
struct sta_rec_phy { … } __packed;
struct sta_rec_he_6g_capa { … } __packed;
struct sta_rec_pn_info { … } __packed;
struct sec_key { … } __packed;
struct sta_rec_sec { … } __packed;
struct sta_rec_bf { … } __packed;
struct sta_rec_bfee { … } __packed;
struct sta_rec_muru { … } __packed;
struct sta_rec_remove { … } __packed;
struct sta_phy { … };
struct sta_rec_ra { … } __packed;
struct sta_rec_ra_fixed { … } __packed;
struct sta_rec_tx_proc { … } __packed;
struct wtbl_req_hdr { … } __packed;
struct wtbl_generic { … } __packed;
struct wtbl_rx { … } __packed;
struct wtbl_ht { … } __packed;
struct wtbl_vht { … } __packed;
struct wtbl_tx_ps { … } __packed;
struct wtbl_hdr_trans { … } __packed;
struct wtbl_ba { … } __packed;
struct wtbl_smps { … } __packed;
struct wtbl_bf { … } __packed;
struct wtbl_pn { … } __packed;
struct wtbl_spe { … } __packed;
struct wtbl_raw { … } __packed;
#define MT76_CONNAC_WTBL_UPDATE_MAX_SIZE …
#define MT76_CONNAC_STA_UPDATE_MAX_SIZE …
enum { … };
enum { … };
#define STA_TYPE_STA …
#define STA_TYPE_AP …
#define STA_TYPE_ADHOC …
#define STA_TYPE_WDS …
#define STA_TYPE_BC …
#define NETWORK_INFRA …
#define NETWORK_P2P …
#define NETWORK_IBSS …
#define NETWORK_WDS …
#define SCAN_FUNC_RANDOM_MAC …
#define SCAN_FUNC_SPLIT_SCAN …
#define CONNECTION_INFRA_STA …
#define CONNECTION_INFRA_AP …
#define CONNECTION_P2P_GC …
#define CONNECTION_P2P_GO …
#define CONNECTION_IBSS_ADHOC …
#define CONNECTION_WDS …
#define CONNECTION_INFRA_BC …
#define CONN_STATE_DISCONNECT …
#define CONN_STATE_CONNECT …
#define CONN_STATE_PORT_SECURE …
#define STA_REC_HE_CAP_HTC …
#define STA_REC_HE_CAP_BQR …
#define STA_REC_HE_CAP_BSR …
#define STA_REC_HE_CAP_OM …
#define STA_REC_HE_CAP_AMSDU_IN_AMPDU …
#define STA_REC_HE_CAP_DUAL_BAND …
#define STA_REC_HE_CAP_LDPC …
#define STA_REC_HE_CAP_TRIG_CQI_FK …
#define STA_REC_HE_CAP_PARTIAL_BW_EXT_RANGE …
#define STA_REC_HE_CAP_LE_EQ_80M_TX_STBC …
#define STA_REC_HE_CAP_LE_EQ_80M_RX_STBC …
#define STA_REC_HE_CAP_GT_80M_TX_STBC …
#define STA_REC_HE_CAP_GT_80M_RX_STBC …
#define STA_REC_HE_CAP_SU_PPDU_1LTF_8US_GI …
#define STA_REC_HE_CAP_SU_MU_PPDU_4LTF_8US_GI …
#define STA_REC_HE_CAP_ER_SU_PPDU_1LTF_8US_GI …
#define STA_REC_HE_CAP_ER_SU_PPDU_4LTF_8US_GI …
#define STA_REC_HE_CAP_NDP_4LTF_3DOT2MS_GI …
#define STA_REC_HE_CAP_BW20_RU242_SUPPORT …
#define STA_REC_HE_CAP_TX_1024QAM_UNDER_RU242 …
#define STA_REC_HE_CAP_RX_1024QAM_UNDER_RU242 …
#define PHY_MODE_A …
#define PHY_MODE_B …
#define PHY_MODE_G …
#define PHY_MODE_GN …
#define PHY_MODE_AN …
#define PHY_MODE_AC …
#define PHY_MODE_AX_24G …
#define PHY_MODE_AX_5G …
#define PHY_MODE_AX_6G …
#define PHY_MODE_BE_24G …
#define PHY_MODE_BE_5G …
#define PHY_MODE_BE_6G …
#define MODE_CCK …
#define MODE_OFDM …
#define MODE_HT …
#define MODE_VHT …
#define MODE_HE …
#define MODE_EHT …
#define STA_CAP_WMM …
#define STA_CAP_SGI_20 …
#define STA_CAP_SGI_40 …
#define STA_CAP_TX_STBC …
#define STA_CAP_RX_STBC …
#define STA_CAP_VHT_SGI_80 …
#define STA_CAP_VHT_SGI_160 …
#define STA_CAP_VHT_TX_STBC …
#define STA_CAP_VHT_RX_STBC …
#define STA_CAP_VHT_LDPC …
#define STA_CAP_LDPC …
#define STA_CAP_HT …
#define STA_CAP_VHT …
#define STA_CAP_HE …
enum { … };
#define HR_DSSS_ERP_BASIC_RATE …
#define OFDM_BASIC_RATE …
#define PHY_TYPE_BIT_HR_DSSS …
#define PHY_TYPE_BIT_ERP …
#define PHY_TYPE_BIT_OFDM …
#define PHY_TYPE_BIT_HT …
#define PHY_TYPE_BIT_VHT …
#define PHY_TYPE_BIT_HE …
#define PHY_TYPE_BIT_BE …
#define MT_WTBL_RATE_TX_MODE …
#define MT_WTBL_RATE_MCS …
#define MT_WTBL_RATE_NSS …
#define MT_WTBL_RATE_HE_GI …
#define MT_WTBL_RATE_GI …
#define MT_WTBL_W5_CHANGE_BW_RATE …
#define MT_WTBL_W5_SHORT_GI_20 …
#define MT_WTBL_W5_SHORT_GI_40 …
#define MT_WTBL_W5_SHORT_GI_80 …
#define MT_WTBL_W5_SHORT_GI_160 …
#define MT_WTBL_W5_BW_CAP …
#define MT_WTBL_W5_MPDU_FAIL_COUNT …
#define MT_WTBL_W5_MPDU_OK_COUNT …
#define MT_WTBL_W5_RATE_IDX …
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
#define MCU_UNI_CMD_EVENT …
#define MCU_UNI_CMD_UNSOLICITED_EVENT …
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum mcu_cipher_type { … };
enum { … };
enum { … };
enum { … };
#define MCU_CMD_ACK …
#define MCU_CMD_UNI …
#define MCU_CMD_SET …
#define MCU_CMD_UNI_EXT_ACK …
#define MCU_CMD_UNI_QUERY_ACK …
#define __MCU_CMD_FIELD_ID …
#define __MCU_CMD_FIELD_EXT_ID …
#define __MCU_CMD_FIELD_QUERY …
#define __MCU_CMD_FIELD_UNI …
#define __MCU_CMD_FIELD_CE …
#define __MCU_CMD_FIELD_WA …
#define __MCU_CMD_FIELD_WM …
#define MCU_CMD(_t) …
#define MCU_EXT_CMD(_t) …
#define MCU_EXT_QUERY(_t) …
#define MCU_UNI_CMD(_t) …
#define MCU_CE_CMD(_t) …
#define MCU_CE_QUERY(_t) …
#define MCU_WA_CMD(_t) …
#define MCU_WA_EXT_CMD(_t) …
#define MCU_WA_PARAM_CMD(_t) …
#define MCU_WM_UNI_CMD(_t) …
#define MCU_WM_UNI_CMD_QUERY(_t) …
#define MCU_WA_UNI_CMD(_t) …
#define MCU_WMWA_UNI_CMD(_t) …
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum UNI_ALL_STA_INFO_TAG { … };
enum { … };
#define UNI_WOW_DETECT_TYPE_MAGIC …
#define UNI_WOW_DETECT_TYPE_ANY …
#define UNI_WOW_DETECT_TYPE_DISCONNECT …
#define UNI_WOW_DETECT_TYPE_GTK_REKEY_FAIL …
#define UNI_WOW_DETECT_TYPE_BCN_LOST …
#define UNI_WOW_DETECT_TYPE_SCH_SCAN_HIT …
#define UNI_WOW_DETECT_TYPE_BITMAP …
enum { … };
enum { … };
struct mt76_connac_bss_basic_tlv { … } __packed;
struct mt76_connac_bss_qos_tlv { … } __packed;
struct mt76_connac_beacon_loss_event { … } __packed;
struct mt76_connac_rssi_notify_event { … } __packed;
struct mt76_connac_mcu_bss_event { … } __packed;
struct mt76_connac_mcu_scan_ssid { … } __packed;
struct mt76_connac_mcu_scan_channel { … } __packed;
struct mt76_connac_mcu_scan_match { … } __packed;
struct mt76_connac_hw_scan_req { … } __packed;
#define MT76_CONNAC_SCAN_DONE_EVENT_MAX_CHANNEL_NUM …
struct mt76_connac_hw_scan_done { … } __packed;
struct mt76_connac_sched_scan_req { … } __packed;
struct mt76_connac_sched_scan_done { … } __packed;
struct bss_info_uni_bss_color { … } __packed;
struct bss_info_uni_he { … } __packed;
struct bss_info_uni_mbssid { … } __packed;
struct mt76_connac_gtk_rekey_tlv { … } __packed;
#define MT76_CONNAC_WOW_MASK_MAX_LEN …
#define MT76_CONNAC_WOW_PATTEN_MAX_LEN …
struct mt76_connac_wow_pattern_tlv { … } __packed;
struct mt76_connac_wow_ctrl_tlv { … } __packed;
struct mt76_connac_wow_gpio_param_tlv { … } __packed;
struct mt76_connac_arpns_tlv { … } __packed;
struct mt76_connac_suspend_tlv { … } __packed;
enum mt76_sta_info_state { … };
struct mt76_sta_cmd_info { … };
#define MT_SKU_POWER_LIMIT …
struct mt76_connac_sku_tlv { … } __packed;
struct mt76_connac_tx_power_limit_tlv { … } __packed;
struct mt76_connac_config { … } __packed;
struct mt76_connac_mcu_uni_event { … } __packed;
struct mt76_connac_mcu_reg_event { … } __packed;
static inline enum mcu_cipher_type
mt76_connac_mcu_get_cipher(int cipher)
{ … }
static inline u32
mt76_connac_mcu_gen_dl_mode(struct mt76_dev *dev, u8 feature_set, bool is_wa)
{ … }
#define to_wcid_lo(id) …
#define to_wcid_hi(id) …
static inline void
mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid,
u8 *wlan_idx_lo, u8 *wlan_idx_hi)
{ … }
struct sk_buff *
__mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
struct mt76_wcid *wcid, int len);
static inline struct sk_buff *
mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
struct mt76_wcid *wcid)
{ … }
struct wtbl_req_hdr *
mt76_connac_mcu_alloc_wtbl_req(struct mt76_dev *dev, struct mt76_wcid *wcid,
int cmd, void *sta_wtbl, struct sk_buff **skb);
struct tlv *mt76_connac_mcu_add_nested_tlv(struct sk_buff *skb, int tag,
int len, void *sta_ntlv,
void *sta_wtbl);
static inline struct tlv *
mt76_connac_mcu_add_tlv(struct sk_buff *skb, int tag, int len)
{ … }
int mt76_connac_mcu_set_channel_domain(struct mt76_phy *phy);
int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif);
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif,
struct ieee80211_link_sta *link_sta,
bool enable, bool newly);
void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta, void *sta_wtbl,
void *wtbl_tlv);
void mt76_connac_mcu_wtbl_hdr_trans_tlv(struct sk_buff *skb,
struct ieee80211_vif *vif,
struct mt76_wcid *wcid,
void *sta_wtbl, void *wtbl_tlv);
int mt76_connac_mcu_sta_update_hdr_trans(struct mt76_dev *dev,
struct ieee80211_vif *vif,
struct mt76_wcid *wcid, int cmd);
void mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta);
u8 mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
enum nl80211_band band,
struct ieee80211_link_sta *link_sta);
int mt76_connac_mcu_wtbl_update_hdr_trans(struct mt76_dev *dev,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta);
void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
struct ieee80211_sta *sta,
struct ieee80211_vif *vif,
u8 rcpi, u8 state);
void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
struct ieee80211_sta *sta, void *sta_wtbl,
void *wtbl_tlv, bool ht_ldpc, bool vht_ldpc);
void mt76_connac_mcu_wtbl_ba_tlv(struct mt76_dev *dev, struct sk_buff *skb,
struct ieee80211_ampdu_params *params,
bool enable, bool tx, void *sta_wtbl,
void *wtbl_tlv);
void mt76_connac_mcu_sta_ba_tlv(struct sk_buff *skb,
struct ieee80211_ampdu_params *params,
bool enable, bool tx);
int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy,
struct ieee80211_bss_conf *bss_conf,
struct mt76_wcid *wcid,
bool enable);
int mt76_connac_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif,
struct ieee80211_ampdu_params *params,
int cmd, bool enable, bool tx);
int mt76_connac_mcu_uni_set_chctx(struct mt76_phy *phy,
struct mt76_vif *vif,
struct ieee80211_chanctx_conf *ctx);
int mt76_connac_mcu_uni_add_bss(struct mt76_phy *phy,
struct ieee80211_vif *vif,
struct mt76_wcid *wcid,
bool enable,
struct ieee80211_chanctx_conf *ctx);
int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
struct mt76_sta_cmd_info *info);
void mt76_connac_mcu_beacon_loss_iter(void *priv, u8 *mac,
struct ieee80211_vif *vif);
int mt76_connac_mcu_set_rts_thresh(struct mt76_dev *dev, u32 val, u8 band);
int mt76_connac_mcu_set_mac_enable(struct mt76_dev *dev, int band, bool enable,
bool hdr_trans);
int mt76_connac_mcu_init_download(struct mt76_dev *dev, u32 addr, u32 len,
u32 mode);
int mt76_connac_mcu_start_patch(struct mt76_dev *dev);
int mt76_connac_mcu_patch_sem_ctrl(struct mt76_dev *dev, bool get);
int mt76_connac_mcu_start_firmware(struct mt76_dev *dev, u32 addr, u32 option);
int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_scan_request *scan_req);
int mt76_connac_mcu_cancel_hw_scan(struct mt76_phy *phy,
struct ieee80211_vif *vif);
int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,
struct ieee80211_vif *vif,
struct cfg80211_sched_scan_request *sreq);
int mt76_connac_mcu_sched_scan_enable(struct mt76_phy *phy,
struct ieee80211_vif *vif,
bool enable);
int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
struct mt76_vif *vif,
struct ieee80211_bss_conf *info);
int mt76_connac_mcu_set_gtk_rekey(struct mt76_dev *dev, struct ieee80211_vif *vif,
bool suspend);
int mt76_connac_mcu_set_wow_ctrl(struct mt76_phy *phy, struct ieee80211_vif *vif,
bool suspend, struct cfg80211_wowlan *wowlan);
int mt76_connac_mcu_update_gtk_rekey(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_gtk_rekey_data *key);
int mt76_connac_mcu_set_suspend_mode(struct mt76_dev *dev,
struct ieee80211_vif *vif,
bool enable, u8 mdtim,
bool wow_suspend);
int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend);
void mt76_connac_mcu_set_suspend_iter(void *priv, u8 *mac,
struct ieee80211_vif *vif);
int mt76_connac_sta_state_dp(struct mt76_dev *dev,
enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state);
int mt76_connac_mcu_chip_config(struct mt76_dev *dev);
int mt76_connac_mcu_set_deep_sleep(struct mt76_dev *dev, bool enable);
void mt76_connac_mcu_coredump_event(struct mt76_dev *dev, struct sk_buff *skb,
struct mt76_connac_coredump *coredump);
s8 mt76_connac_get_ch_power(struct mt76_phy *phy,
struct ieee80211_channel *chan,
s8 target_power);
int mt76_connac_mcu_set_rate_txpower(struct mt76_phy *phy);
int mt76_connac_mcu_set_p2p_oppps(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
u32 mt76_connac_mcu_reg_rr(struct mt76_dev *dev, u32 offset);
void mt76_connac_mcu_reg_wr(struct mt76_dev *dev, u32 offset, u32 val);
const struct ieee80211_sta_he_cap *
mt76_connac_get_he_phy_cap(struct mt76_phy *phy, struct ieee80211_vif *vif);
const struct ieee80211_sta_eht_cap *
mt76_connac_get_eht_phy_cap(struct mt76_phy *phy, struct ieee80211_vif *vif);
u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
enum nl80211_band band,
struct ieee80211_link_sta *sta);
u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
enum nl80211_band band);
int mt76_connac_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
struct mt76_connac_sta_key_conf *sta_key_conf,
struct ieee80211_key_conf *key, int mcu_cmd,
struct mt76_wcid *wcid, enum set_key_cmd cmd);
void mt76_connac_mcu_bss_ext_tlv(struct sk_buff *skb, struct mt76_vif *mvif);
void mt76_connac_mcu_bss_omac_tlv(struct sk_buff *skb,
struct ieee80211_vif *vif);
int mt76_connac_mcu_bss_basic_tlv(struct sk_buff *skb,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct mt76_phy *phy, u16 wlan_idx,
bool enable);
void mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif,
struct ieee80211_sta *sta);
void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
struct ieee80211_sta *sta,
void *sta_wtbl, void *wtbl_tlv);
int mt76_connac_mcu_set_pm(struct mt76_dev *dev, int band, int enter);
int mt76_connac_mcu_restart(struct mt76_dev *dev);
int mt76_connac_mcu_rdd_cmd(struct mt76_dev *dev, int cmd, u8 index,
u8 rx_sel, u8 val);
int mt76_connac_mcu_sta_wed_update(struct mt76_dev *dev, struct sk_buff *skb);
int mt76_connac2_load_ram(struct mt76_dev *dev, const char *fw_wm,
const char *fw_wa);
int mt76_connac2_load_patch(struct mt76_dev *dev, const char *fw_name);
int mt76_connac2_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *wait_seq);
#endif