Commit 15ced2a6 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

wifi: mt76: mt7925: extend mt7925_get_phy_mode_ext for per-link STA

Extend mt7925_get_phy_mode_ext with the per-link STA configuration.

The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20240613030241.5771-35-sean.wang@kernel.orgSigned-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent e7a9853e
......@@ -2035,16 +2035,17 @@ int mt7925_mcu_set_chctx(struct mt76_phy *phy, struct mt76_vif *mvif,
static u8
mt7925_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
enum nl80211_band band, struct ieee80211_sta *sta)
enum nl80211_band band,
struct ieee80211_link_sta *link_sta)
{
struct ieee80211_he_6ghz_capa *he_6ghz_capa;
const struct ieee80211_sta_eht_cap *eht_cap;
__le16 capa = 0;
u8 mode = 0;
if (sta) {
he_6ghz_capa = &sta->deflink.he_6ghz_capa;
eht_cap = &sta->deflink.eht_cap;
if (link_sta) {
he_6ghz_capa = &link_sta->he_6ghz_capa;
eht_cap = &link_sta->eht_cap;
} else {
struct ieee80211_supported_band *sband;
......@@ -2090,6 +2091,7 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
struct mt792x_sta *msta = sta ? (struct mt792x_sta *)sta->drv_priv :
&mconf->vif->sta;
struct ieee80211_link_sta *link_sta = sta ? &sta->deflink : NULL;
struct cfg80211_chan_def *chandef = ctx ? &ctx->def : &phy->chandef;
enum nl80211_band band = chandef->chan->band;
struct mt76_connac_bss_basic_tlv *basic_req;
......@@ -2104,7 +2106,8 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
mconf->mt76.omac_idx;
basic_req->hw_bss_idx = idx;
basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band, sta);
basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band,
link_sta);
if (band == NL80211_BAND_2GHZ)
basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_ERP_INDEX);
......
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