Commit f5596850 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7615: add sta pointer to mt7615_mcu_add_bss_info signature

Introduce sta pointer to mt7615_mcu_add_bss_info signature in order to
avoid sta lookup in mt7615_mcu_bss_basic_tlv routine
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 5ac2e2a3
...@@ -501,7 +501,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw, ...@@ -501,7 +501,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
} }
if (changed & BSS_CHANGED_BEACON_ENABLED) { if (changed & BSS_CHANGED_BEACON_ENABLED) {
mt7615_mcu_add_bss_info(phy, vif, info->enable_beacon); mt7615_mcu_add_bss_info(phy, vif, NULL, info->enable_beacon);
mt7615_mcu_sta_add(dev, vif, NULL, info->enable_beacon); mt7615_mcu_sta_add(dev, vif, NULL, info->enable_beacon);
} }
...@@ -546,7 +546,7 @@ int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -546,7 +546,7 @@ int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt7615_phy *phy; struct mt7615_phy *phy;
phy = mvif->band_idx ? mt7615_ext_phy(dev) : &dev->phy; phy = mvif->band_idx ? mt7615_ext_phy(dev) : &dev->phy;
mt7615_mcu_add_bss_info(phy, vif, true); mt7615_mcu_add_bss_info(phy, vif, sta, true);
} }
mt7615_mac_wtbl_update(dev, idx, mt7615_mac_wtbl_update(dev, idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR); MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
...@@ -570,7 +570,7 @@ void mt7615_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -570,7 +570,7 @@ void mt7615_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt7615_phy *phy; struct mt7615_phy *phy;
phy = mvif->band_idx ? mt7615_ext_phy(dev) : &dev->phy; phy = mvif->band_idx ? mt7615_ext_phy(dev) : &dev->phy;
mt7615_mcu_add_bss_info(phy, vif, false); mt7615_mcu_add_bss_info(phy, vif, sta, false);
} }
spin_lock_bh(&dev->sta_poll_lock); spin_lock_bh(&dev->sta_poll_lock);
......
...@@ -645,7 +645,7 @@ mt7615_mcu_add_tlv(struct sk_buff *skb, int tag, int len) ...@@ -645,7 +645,7 @@ mt7615_mcu_add_tlv(struct sk_buff *skb, int tag, int len)
static int static int
mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
bool enable) struct ieee80211_sta *sta, bool enable)
{ {
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct bss_info_basic *bss; struct bss_info_basic *bss;
...@@ -661,20 +661,11 @@ mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, ...@@ -661,20 +661,11 @@ mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
break; break;
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
/* TODO: enable BSS_INFO_UAPSD & BSS_INFO_PM */ /* TODO: enable BSS_INFO_UAPSD & BSS_INFO_PM */
if (enable) { if (enable && sta) {
struct ieee80211_sta *sta;
struct mt7615_sta *msta; struct mt7615_sta *msta;
rcu_read_lock();
sta = ieee80211_find_sta(vif, vif->bss_conf.bssid);
if (!sta) {
rcu_read_unlock();
return -EINVAL;
}
msta = (struct mt7615_sta *)sta->drv_priv; msta = (struct mt7615_sta *)sta->drv_priv;
wlan_idx = msta->wcid.idx; wlan_idx = msta->wcid.idx;
rcu_read_unlock();
} }
break; break;
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
...@@ -994,7 +985,7 @@ mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, ...@@ -994,7 +985,7 @@ mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
static int static int
mt7615_mcu_add_bss(struct mt7615_phy *phy, struct ieee80211_vif *vif, mt7615_mcu_add_bss(struct mt7615_phy *phy, struct ieee80211_vif *vif,
bool enable) struct ieee80211_sta *sta, bool enable)
{ {
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = phy->dev; struct mt7615_dev *dev = phy->dev;
...@@ -1007,7 +998,7 @@ mt7615_mcu_add_bss(struct mt7615_phy *phy, struct ieee80211_vif *vif, ...@@ -1007,7 +998,7 @@ mt7615_mcu_add_bss(struct mt7615_phy *phy, struct ieee80211_vif *vif,
if (enable) if (enable)
mt7615_mcu_bss_omac_tlv(skb, vif); mt7615_mcu_bss_omac_tlv(skb, vif);
mt7615_mcu_bss_basic_tlv(skb, vif, enable); mt7615_mcu_bss_basic_tlv(skb, vif, sta, enable);
if (enable && mvif->omac_idx > EXT_BSSID_START) if (enable && mvif->omac_idx > EXT_BSSID_START)
mt7615_mcu_bss_ext_tlv(skb, mvif); mt7615_mcu_bss_ext_tlv(skb, mvif);
...@@ -1272,8 +1263,8 @@ mt7615_mcu_uni_ctrl_pm_state(struct mt7615_dev *dev, int band, int state) ...@@ -1272,8 +1263,8 @@ mt7615_mcu_uni_ctrl_pm_state(struct mt7615_dev *dev, int band, int state)
} }
static int static int
mt7615_mcu_uni_add_bss(struct mt7615_phy *phy, mt7615_mcu_uni_add_bss(struct mt7615_phy *phy, struct ieee80211_vif *vif,
struct ieee80211_vif *vif, bool enable) struct ieee80211_sta *sta, bool enable)
{ {
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct cfg80211_chan_def *chandef = &phy->mt76->chandef; struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
......
...@@ -222,7 +222,7 @@ struct mt7615_mcu_ops { ...@@ -222,7 +222,7 @@ struct mt7615_mcu_ops {
int (*add_dev_info)(struct mt7615_dev *dev, int (*add_dev_info)(struct mt7615_dev *dev,
struct ieee80211_vif *vif, bool enable); struct ieee80211_vif *vif, bool enable);
int (*add_bss_info)(struct mt7615_phy *phy, struct ieee80211_vif *vif, int (*add_bss_info)(struct mt7615_phy *phy, struct ieee80211_vif *vif,
bool enable); struct ieee80211_sta *sta, bool enable);
int (*add_beacon_offload)(struct mt7615_dev *dev, int (*add_beacon_offload)(struct mt7615_dev *dev,
struct ieee80211_hw *hw, struct ieee80211_hw *hw,
struct ieee80211_vif *vif, bool enable); struct ieee80211_vif *vif, bool enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment