#include <linux/fs.h>
#include "mt7915.h"
#include "mcu.h"
#include "mac.h"
#include "eeprom.h"
#define fw_name(_dev, name, ...) …
#define fw_name_var(_dev, name) …
#define MCU_PATCH_ADDRESS …
#define HE_PHY(p, c) …
#define HE_MAC(m, c) …
static bool sr_scene_detect = …;
module_param(sr_scene_detect, bool, 0644);
MODULE_PARM_DESC(…) …;
static u8
mt7915_mcu_get_sta_nss(u16 mcs_map)
{ … }
static void
mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
u16 mcs_map)
{ … }
static void
mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
const u16 *mask)
{ … }
static void
mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs,
const u8 *mask)
{ … }
static int
mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
struct sk_buff *skb, int seq)
{ … }
static int
mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *wait_seq)
{ … }
int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
{ … }
static void
mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
{ … }
static void
mt7915_mcu_rx_csa_notify(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_rx_thermal_notify(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
{ … }
static void
mt7915_mcu_rx_bcc_notify(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static void
mt7915_mcu_rx_unsolicited_event(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb)
{ … }
static struct tlv *
mt7915_mcu_add_nested_subtlv(struct sk_buff *skb, int sub_tag, int sub_len,
__le16 *sub_ntlv, __le16 *len)
{ … }
struct mt7915_he_obss_narrow_bw_ru_data { … };
static void mt7915_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy,
struct cfg80211_bss *bss,
void *_data)
{ … }
static bool mt7915_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{ … }
static void
mt7915_mcu_bss_rfch_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{ … }
static void
mt7915_mcu_bss_ra_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{ … }
static void
mt7915_mcu_bss_he_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{ … }
static void
mt7915_mcu_bss_hw_amsdu_tlv(struct sk_buff *skb)
{ … }
static void
mt7915_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt7915_phy *phy)
{ … }
static int
mt7915_mcu_muar_config(struct mt7915_phy *phy, struct ieee80211_vif *vif,
bool bssid, bool enable)
{ … }
int mt7915_mcu_add_bss_info(struct mt7915_phy *phy,
struct ieee80211_vif *vif, int enable)
{ … }
int mt7915_mcu_add_tx_ba(struct mt7915_dev *dev,
struct ieee80211_ampdu_params *params,
bool enable)
{ … }
int mt7915_mcu_add_rx_ba(struct mt7915_dev *dev,
struct ieee80211_ampdu_params *params,
bool enable)
{ … }
static void
mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
struct ieee80211_vif *vif)
{ … }
static void
mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
struct ieee80211_sta *sta, struct ieee80211_vif *vif)
{ … }
static void
mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
{ … }
static void
mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
{ … }
static void
mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{ … }
static int
mt7915_mcu_sta_wtbl_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{ … }
static inline bool
mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, bool bfee)
{ … }
static void
mt7915_mcu_sta_sounding_rate(struct sta_rec_bf *bf)
{ … }
static void
mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
struct sta_rec_bf *bf)
{ … }
static void
mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
struct sta_rec_bf *bf, bool explicit)
{ … }
static void
mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
struct mt7915_phy *phy, struct sta_rec_bf *bf)
{ … }
static void
mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{ … }
static void
mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{ … }
static enum mcu_mmps_mode
mt7915_mcu_get_mmps_mode(enum ieee80211_smps_mode smps)
{ … }
int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
void *data, u32 field)
{ … }
int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{ … }
static int
mt7915_mcu_set_spe_idx(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{ … }
static int
mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{ … }
static void
mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{ … }
int mt7915_mcu_add_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, bool changed)
{ … }
static int
mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{ … }
int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, bool enable)
{ … }
int mt7915_mcu_wed_enable_rx_stats(struct mt7915_dev *dev)
{ … }
int mt7915_mcu_add_dev_info(struct mt7915_phy *phy,
struct ieee80211_vif *vif, bool enable)
{ … }
static void
mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
struct sk_buff *skb, struct bss_info_bcn *bcn,
struct ieee80211_mutable_offsets *offs)
{ … }
static void
mt7915_mcu_beacon_mbss(struct sk_buff *rskb, struct sk_buff *skb,
struct ieee80211_vif *vif, struct bss_info_bcn *bcn,
struct ieee80211_mutable_offsets *offs)
{ … }
static void
mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct sk_buff *rskb, struct sk_buff *skb,
struct bss_info_bcn *bcn,
struct ieee80211_mutable_offsets *offs)
{ … }
int
mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif,
u32 changed)
{ … }
int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int en, u32 changed)
{ … }
static int mt7915_driver_own(struct mt7915_dev *dev, u8 band)
{ … }
static int
mt7915_firmware_state(struct mt7915_dev *dev, bool wa)
{ … }
static int mt7915_load_firmware(struct mt7915_dev *dev)
{ … }
int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl)
{ … }
int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level)
{ … }
int mt7915_mcu_muru_debug_set(struct mt7915_dev *dev, bool enabled)
{ … }
int mt7915_mcu_muru_debug_get(struct mt7915_phy *phy)
{ … }
static int mt7915_mcu_set_mwds(struct mt7915_dev *dev, bool enabled)
{ … }
int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u32 val)
{ … }
static int
mt7915_mcu_init_rx_airtime(struct mt7915_dev *dev)
{ … }
static int mt7915_red_set_watermark(struct mt7915_dev *dev)
{ … }
static int mt7915_mcu_set_red(struct mt7915_dev *dev, bool enabled)
{ … }
int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
{ … }
int mt7915_mcu_init(struct mt7915_dev *dev)
{ … }
void mt7915_mcu_exit(struct mt7915_dev *dev)
{ … }
static int
mt7915_mcu_set_rx_hdr_trans_blacklist(struct mt7915_dev *dev, int band)
{ … }
int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band,
bool enable, bool hdr_trans)
{ … }
int mt7915_mcu_update_edca(struct mt7915_dev *dev, void *param)
{ … }
int mt7915_mcu_set_tx(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{ … }
int mt7915_mcu_set_fcc5_lpn(struct mt7915_dev *dev, int val)
{ … }
int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
const struct mt7915_dfs_pulse *pulse)
{ … }
int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
const struct mt7915_dfs_pattern *pattern)
{ … }
static int
mt7915_mcu_background_chain_ctrl(struct mt7915_phy *phy,
struct cfg80211_chan_def *chandef,
int cmd)
{ … }
int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
struct cfg80211_chan_def *chandef)
{ … }
int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
{ … }
static int mt7915_mcu_set_eeprom_flash(struct mt7915_dev *dev)
{ … }
int mt7915_mcu_set_eeprom(struct mt7915_dev *dev)
{ … }
int mt7915_mcu_get_eeprom(struct mt7915_dev *dev, u32 offset)
{ … }
int mt7915_mcu_get_eeprom_free_block(struct mt7915_dev *dev, u8 *block_num)
{ … }
static int mt7915_mcu_set_pre_cal(struct mt7915_dev *dev, u8 idx,
u8 *data, u32 len, int cmd)
{ … }
int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev)
{ … }
static int mt7915_find_freq_idx(const u16 *freqs, int n_freqs, u16 cur)
{ … }
static int mt7915_dpd_freq_idx(struct mt7915_dev *dev, u16 freq, u8 bw)
{ … }
int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
{ … }
int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)
{ … }
int mt7915_mcu_get_temperature(struct mt7915_phy *phy)
{ … }
int mt7915_mcu_set_thermal_throttling(struct mt7915_phy *phy, u8 state)
{ … }
int mt7915_mcu_set_thermal_protect(struct mt7915_phy *phy)
{ … }
int mt7915_mcu_set_txpower_frame_min(struct mt7915_phy *phy, s8 txpower)
{ … }
int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta, s8 txpower)
{ … }
int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy)
{ … }
int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len)
{ … }
int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode,
u8 en)
{ … }
int mt7915_mcu_set_sku_en(struct mt7915_phy *phy, bool enable)
{ … }
int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
{ … }
int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action)
{ … }
static int
mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val)
{ … }
static int
mt7915_mcu_set_obss_spr_pd(struct mt7915_phy *phy,
struct ieee80211_he_obss_pd *he_obss_pd)
{ … }
static int
mt7915_mcu_set_obss_spr_siga(struct mt7915_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_he_obss_pd *he_obss_pd)
{ … }
static int
mt7915_mcu_set_obss_spr_bitmap(struct mt7915_phy *phy,
struct ieee80211_he_obss_pd *he_obss_pd)
{ … }
int mt7915_mcu_add_obss_spr(struct mt7915_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_he_obss_pd *he_obss_pd)
{ … }
int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct rate_info *rate)
{ … }
int mt7915_mcu_update_bss_color(struct mt7915_dev *dev, struct ieee80211_vif *vif,
struct cfg80211_he_bss_color *he_bss_color)
{ … }
#define TWT_AGRT_TRIGGER …
#define TWT_AGRT_ANNOUNCE …
#define TWT_AGRT_PROTECT …
int mt7915_mcu_twt_agrt_update(struct mt7915_dev *dev,
struct mt7915_vif *mvif,
struct mt7915_twt_flow *flow,
int cmd)
{ … }
int mt7915_mcu_wed_wa_tx_stats(struct mt7915_dev *dev, u16 wlan_idx)
{ … }
int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
{ … }