mt76: mt7915: add support for 6G in-band discovery
Subsystems (2)
PATCH 1/1 mt76: mt7915: add support for 6G in-band discovery
Add offloading FILS discovery and unsolicited broadcast probe response support.
Reviewed-by Ryder Lee <[email protected]>
Signed-off-by MeiChia Chiu <[email protected]>
--- .../net/wireless/mediatek/mt76/mt7915/init.c | 2 + .../net/wireless/mediatek/mt76/mt7915/mac.c | 17 +++-- .../net/wireless/mediatek/mt76/mt7915/main.c | 8 +- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 75 ++++++++++++++++++- .../net/wireless/mediatek/mt76/mt7915/mcu.h | 15 +++- .../wireless/mediatek/mt76/mt7915/mt7915.h | 4 +- 6 files changed, 107 insertions(+), 14 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +2 -0
@@ -351,6 +351,8 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_BEACON_RATE_HT );wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_BEACON_RATE_VHT );wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_BEACON_RATE_HE ); +wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP ); +wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_FILS_DISCOVERY );if (!mdev->dev->of_node || !of_property_read_bool(mdev->dev->of_node,
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +12 -5
@@ -1177,7 +1177,7 @@ mt7915_mac_tx_rate_val(struct mt76_phy *mphy, struct ieee80211_vif *vif,void mt7915_mac_write_txwi (struct mt7915_dev *dev,__le32 *txwi,struct sk_buff *skb,struct mt76_wcid *wcid,int pid, -struct ieee80211_key_conf *key,bool beacon) +struct ieee80211_key_conf *key,u32 changed) {struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);struct ieee80211_vif *vif = info->control.vif;
@@ -1188,6 +1188,10 @@ void mt7915_mac_write_txwi(struct mt7915_dev *dev, __le32 *txwi,bool mcast = false;u16 tx_count =15 ;u32 val; +bool beacon = !!(changed & (BSS_CHANGED_BEACON | +BSS_CHANGED_BEACON_ENABLED )); +bool inband_disc = !!(changed & (BSS_CHANGED_UNSOL_BCAST_PROBE_RESP | +BSS_CHANGED_FILS_DISCOVERY ));if (vif) {struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
@@ -1200,7 +1204,10 @@ void mt7915_mac_write_txwi(struct mt7915_dev *dev, __le32 *txwi,if (ext_phy && dev->mt76.phy2) mphy = dev->mt76.phy2; -if (beacon) { +if (inband_disc) { + p_fmt =MT_TX_TYPE_FW ; + q_idx =MT_LMAC_ALTX0 ; + }else if (beacon) { p_fmt =MT_TX_TYPE_FW ; q_idx =MT_LMAC_BCN0 ; }else if (skb_get_queue_mapping (skb) >=MT_TXQ_PSD ) {
@@ -1308,8 +1315,7 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,return id; pid =mt76_tx_status_skb_add (mdev, wcid, tx_info->skb); -mt7915_mac_write_txwi (dev, txwi_ptr, tx_info->skb, wcid, pid, key, - false); +mt7915_mac_write_txwi (dev, txwi_ptr, tx_info->skb, wcid, pid, key,0 ); txp = (struct mt7915_txp *)(txwi +MT_TXD_SIZE );for (i =0 ; i < nbuf; i++) {
@@ -1919,7 +1925,8 @@ mt7915_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)case NL80211_IFTYPE_MESH_POINT :case NL80211_IFTYPE_ADHOC :case NL80211_IFTYPE_AP : -mt7915_mcu_add_beacon (hw, vif, vif->bss_conf.enable_beacon); +mt7915_mcu_add_beacon (hw, vif, vif->bss_conf.enable_beacon, +BSS_CHANGED_BEACON_ENABLED );break ;default :break ;
drivers/net/wireless/mediatek/mt76/mt7915/main.c +5 -3
@@ -622,8 +622,10 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,mt7915_update_bss_color (hw, vif, &info->he_bss_color);if (changed & (BSS_CHANGED_BEACON | -BSS_CHANGED_BEACON_ENABLED )) -mt7915_mcu_add_beacon (hw, vif, info->enable_beacon); +BSS_CHANGED_BEACON_ENABLED | +BSS_CHANGED_UNSOL_BCAST_PROBE_RESP | +BSS_CHANGED_FILS_DISCOVERY )) +mt7915_mcu_add_beacon (hw, vif, info->enable_beacon, changed);mutex_unlock (&dev->mt76.mutex); }
@@ -636,7 +638,7 @@ mt7915_channel_switch_beacon(struct ieee80211_hw *hw,struct mt7915_dev *dev =mt7915_hw_dev (hw);mutex_lock (&dev->mt76.mutex); -mt7915_mcu_add_beacon (hw, vif, true); +mt7915_mcu_add_beacon (hw, vif, true,BSS_CHANGED_BEACON );mutex_unlock (&dev->mt76.mutex); }
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +72 -3
99 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +14 -1
@@ -404,11 +404,23 @@ struct bss_info_bcn_cont {__le16 pkt_len; } __packed__aligned(4) ; +struct bss_info_inband_discovery { +__le16 tag; +__le16 len; +u8 tx_type; +u8 tx_mode; +u8 tx_interval; +u8 enable; +__le16 rsv; +__le16 prob_rsp_len; +} __packed__aligned(4) ; +enum {BSS_INFO_BCN_CSA ,BSS_INFO_BCN_BCC ,BSS_INFO_BCN_MBSSID ,BSS_INFO_BCN_CONTENT , +BSS_INFO_BCN_DISCOV ,BSS_INFO_BCN_MAX };
@@ -476,6 +488,7 @@ enum {#define MT7915_BEACON_UPDATE_SIZE (sizeof(struct sta_req_hdr) + \ sizeof(struct bss_info_bcn_cntdwn) + \ sizeof(struct bss_info_bcn_mbss) + \ - sizeof(struct bss_info_bcn_cont)) + sizeof(struct bss_info_bcn_cont) + \ + sizeof(struct bss_info_inband_discovery))#endif
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h +2 -2
@@ -464,7 +464,7 @@ int mt7915_mcu_add_rx_ba(struct mt7915_dev *dev,int mt7915_mcu_update_bss_color (struct mt7915_dev *dev,struct ieee80211_vif *vif,struct cfg80211_he_bss_color *he_bss_color);int mt7915_mcu_add_beacon (struct ieee80211_hw *hw,struct ieee80211_vif *vif, -int enable); +int enable,u32 changed);int mt7915_mcu_add_obss_spr (struct mt7915_dev *dev,struct ieee80211_vif *vif,bool enable); int mt7915_mcu_add_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -551,7 +551,7 @@ void mt7915_mac_cca_stats_reset(struct mt7915_phy *phy);void mt7915_mac_enable_nf (struct mt7915_dev *dev,bool ext_phy);void mt7915_mac_write_txwi (struct mt7915_dev *dev,__le32 *txwi,struct sk_buff *skb,struct mt76_wcid *wcid,int pid, -struct ieee80211_key_conf *key,bool beacon); +struct ieee80211_key_conf *key,u32 changed);void mt7915_mac_set_timing (struct mt7915_phy *phy);int mt7915_mac_sta_add (struct mt76_dev *mdev,struct ieee80211_vif *vif,struct ieee80211_sta *sta);
Signature · 1 line
2.18.0