wifi: mt76: mt7925: add NAN MCU helpers

Add the mt7925 NAN MCU ABI and helpers for enable, disable, configuration
updates, availability updates and peer schedule commands.

Upper-layer integration is added by later patches.

Co-developed-by: Stella Liu <[email protected]>
Signed-off-by: Stella Liu <[email protected]>
Co-developed-by: Jeremy Yu <[email protected]>
Signed-off-by: Jeremy Yu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Sean Wang
2026-08-25 11:23:14 +02:00
committed by Felix Fietkau
parent e81b53328c
commit 471fb15e87
6 changed files with 1418 additions and 1 deletions
+38
View File
@@ -122,6 +122,18 @@ struct mt792x_link_sta {
struct ieee80211_link_sta *pri_link;
};
struct mt792x_sta_nan_sched {
u16 committed_dw;
u32 sch_idx;
bool idx_assigned;
unsigned long ndp_ctx_bitmap;
u8 ndp_ctx_id; /* assigned NDP context ID (for NDI sta) */
struct {
u8 map_id;
struct cfg80211_chan_def chans[CFG80211_NAN_SCHED_NUM_TIME_SLOTS];
} maps[CFG80211_NAN_MAX_PEER_MAPS];
};
struct mt792x_sta {
struct mt792x_link_sta deflink; /* must be first */
struct mt792x_link_sta __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
@@ -130,6 +142,9 @@ struct mt792x_sta {
u16 valid_links;
u8 deflink_id;
/* NAN peer schedule */
struct mt792x_sta_nan_sched nan_sched;
};
DECLARE_EWMA(rssi, 10, 8);
@@ -146,6 +161,25 @@ struct mt792x_bss_conf {
unsigned int link_id;
};
struct mt792x_nan_conf {
u8 master_pref;
u8 bands;
u8 cluster_id[ETH_ALEN];
u32 discovery_beacon_interval;
bool enable_dw_notification;
};
struct mt792x_nan {
struct mt792x_nan_conf conf;
/* Scheduler */
struct cfg80211_chan_def local_sched[CFG80211_NAN_SCHED_NUM_TIME_SLOTS];
u32 seq_id;
/* Connection index bitmap, up to NAN_MAX_CONN_CFG peers */
unsigned long conn_bitmap;
};
struct mt792x_vif {
struct mt792x_bss_conf bss_conf; /* must be first */
struct mt792x_bss_conf __rcu *link_conf[IEEE80211_MLD_MAX_NUM_LINKS];
@@ -160,6 +194,8 @@ struct mt792x_vif {
struct work_struct csa_work;
struct timer_list csa_timer;
struct mt792x_nan nan;
};
struct mt792x_phy {
@@ -299,6 +335,8 @@ struct mt792x_dev {
u32 backup_l2;
struct ieee80211_chanctx_conf *new_ctx;
struct ieee80211_vif *nan_vif;
};
static inline struct mt792x_bss_conf *