From 1377f586c6f520a6d032053a2e9c0ebc8b277e9b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 30 Jun 2023 11:01:51 +0200 Subject: [PATCH] wifi: mt7915: move capability check to start_ap Avoid using it for non-AP modes Signed-off-by: Felix Fietkau --- mt7915/main.c | 19 +++++++++++++++++++ mt7915/mcu.c | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mt7915/main.c b/mt7915/main.c index 2b47bfb2..7c05893d 100644 --- a/mt7915/main.c +++ b/mt7915/main.c @@ -658,6 +658,23 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw, mutex_unlock(&dev->mt76.mutex); } +static void +mt7915_vif_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif) +{ + struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; + struct mt7915_vif_cap *vc = &mvif->cap; + + vc->vht_ldpc = mvif->cap.vht_ldpc; + vc->vht_su_ebfer = mvif->cap.vht_su_ebfer; + vc->vht_su_ebfee = mvif->cap.vht_su_ebfee; + vc->vht_mu_ebfer = mvif->cap.vht_mu_ebfer; + vc->vht_mu_ebfee = mvif->cap.vht_mu_ebfee; + vc->he_ldpc = mvif->cap.he_ldpc; + vc->he_su_ebfer = mvif->cap.he_su_ebfer; + vc->he_su_ebfee = mvif->cap.he_su_ebfee; + vc->he_mu_ebfer = vif->bss_conf.he_mu_beamformer; +} + static int mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf) @@ -668,6 +685,8 @@ mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mutex_lock(&dev->mt76.mutex); + mt7915_vif_check_caps(phy, vif); + err = mt7915_mcu_add_bss_info(phy, vif, true); if (err) goto out; diff --git a/mt7915/mcu.c b/mt7915/mcu.c index 964ba075..b0328d4f 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -1882,23 +1882,6 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif, memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); } -static void -mt7915_mcu_vif_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif) -{ - struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; - struct mt7915_vif_cap *vc = &mvif->cap; - - vc->vht_ldpc = mvif->cap.vht_ldpc; - vc->vht_su_ebfer = mvif->cap.vht_su_ebfer; - vc->vht_su_ebfee = mvif->cap.vht_su_ebfee; - vc->vht_mu_ebfer = mvif->cap.vht_mu_ebfer; - vc->vht_mu_ebfee = mvif->cap.vht_mu_ebfee; - vc->he_ldpc = mvif->cap.he_ldpc; - vc->he_su_ebfer = mvif->cap.he_su_ebfer; - vc->he_su_ebfee = mvif->cap.he_su_ebfee; - vc->he_mu_ebfer = vif->bss_conf.he_mu_beamformer; -} - static void mt7915_mcu_beacon_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif, struct sk_buff *rskb, struct bss_info_bcn *bcn, @@ -2009,8 +1992,6 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, info = IEEE80211_SKB_CB(skb); info->hw_queue = FIELD_PREP(MT_TX_HW_QUEUE_PHY, ext_phy); - mt7915_mcu_vif_check_caps(phy, vif); - mt7915_mcu_beacon_cntdwn(vif, rskb, skb, bcn, &offs); mt7915_mcu_beacon_mbss(rskb, skb, vif, bcn, &offs); mt7915_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs);