Skip to content

Commit dda423d

Browse files
ryderlee1110nbd168
authored andcommitted
wifi: mt76: mt7996: remove mt7996_mcu_beacon_check_caps()
Those capabilities have been added into ieee80211_bss_conf. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 885f7af commit dda423d

File tree

3 files changed

+8
-124
lines changed

3 files changed

+8
-124
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
220220
vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR;
221221

222222
mt7996_init_bitrate_mask(vif);
223-
memset(&mvif->cap, -1, sizeof(mvif->cap));
224223

225224
mt7996_mcu_add_bss_info(phy, vif, true);
226225
mt7996_mcu_add_sta(dev, vif, NULL, true);

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

Lines changed: 8 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,6 @@ static inline bool
10531053
mt7996_is_ebf_supported(struct mt7996_phy *phy, struct ieee80211_vif *vif,
10541054
struct ieee80211_sta *sta, bool bfee)
10551055
{
1056-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
10571056
int sts = hweight16(phy->mt76->chainmask);
10581057

10591058
if (vif->type != NL80211_IFTYPE_STATION &&
@@ -1068,32 +1067,32 @@ mt7996_is_ebf_supported(struct mt7996_phy *phy, struct ieee80211_vif *vif,
10681067
struct ieee80211_eht_cap_elem_fixed *pe = &pc->eht_cap_elem;
10691068

10701069
if (bfee)
1071-
return mvif->cap.eht_su_ebfee &&
1070+
return vif->bss_conf.eht_su_beamformee &&
10721071
EHT_PHY(CAP0_SU_BEAMFORMEE, pe->phy_cap_info[0]);
10731072
else
1074-
return mvif->cap.eht_su_ebfer &&
1073+
return vif->bss_conf.eht_su_beamformer &&
10751074
EHT_PHY(CAP0_SU_BEAMFORMER, pe->phy_cap_info[0]);
10761075
}
10771076

10781077
if (sta->deflink.he_cap.has_he) {
10791078
struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
10801079

10811080
if (bfee)
1082-
return mvif->cap.he_su_ebfee &&
1081+
return vif->bss_conf.he_su_beamformee &&
10831082
HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]);
10841083
else
1085-
return mvif->cap.he_su_ebfer &&
1084+
return vif->bss_conf.he_su_beamformer &&
10861085
HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
10871086
}
10881087

10891088
if (sta->deflink.vht_cap.vht_supported) {
10901089
u32 cap = sta->deflink.vht_cap.cap;
10911090

10921091
if (bfee)
1093-
return mvif->cap.vht_su_ebfee &&
1092+
return vif->bss_conf.vht_su_beamformee &&
10941093
(cap & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE);
10951094
else
1096-
return mvif->cap.vht_su_ebfer &&
1095+
return vif->bss_conf.vht_su_beamformer &&
10971096
(cap & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE);
10981097
}
10991098

@@ -1572,7 +1571,7 @@ mt7996_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7996_dev *dev,
15721571
cap |= STA_CAP_TX_STBC;
15731572
if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
15741573
cap |= STA_CAP_RX_STBC;
1575-
if (mvif->cap.ht_ldpc &&
1574+
if (vif->bss_conf.ht_ldpc &&
15761575
(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
15771576
cap |= STA_CAP_LDPC;
15781577

@@ -1598,7 +1597,7 @@ mt7996_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7996_dev *dev,
15981597
cap |= STA_CAP_VHT_TX_STBC;
15991598
if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
16001599
cap |= STA_CAP_VHT_RX_STBC;
1601-
if (mvif->cap.vht_ldpc &&
1600+
if (vif->bss_conf.vht_ldpc &&
16021601
(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
16031602
cap |= STA_CAP_VHT_LDPC;
16041603

@@ -1911,102 +1910,6 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif,
19111910
memcpy(buf + MT_TXD_SIZE, skb->data, skb->len);
19121911
}
19131912

1914-
static void
1915-
mt7996_mcu_beacon_check_caps(struct mt7996_phy *phy, struct ieee80211_vif *vif,
1916-
struct sk_buff *skb)
1917-
{
1918-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
1919-
struct mt7996_vif_cap *vc = &mvif->cap;
1920-
const struct ieee80211_eht_cap_elem_fixed *eht;
1921-
const struct ieee80211_he_cap_elem *he;
1922-
const struct ieee80211_vht_cap *vht;
1923-
const struct ieee80211_ht_cap *ht;
1924-
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
1925-
const u8 *ie;
1926-
u32 len, bc;
1927-
1928-
/* Check missing configuration options to allow AP mode in mac80211
1929-
* to remain in sync with hostapd settings, and get a subset of
1930-
* beacon and hardware capabilities.
1931-
*/
1932-
if (WARN_ON_ONCE(skb->len <= (mgmt->u.beacon.variable - skb->data)))
1933-
return;
1934-
1935-
memset(vc, 0, sizeof(*vc));
1936-
1937-
len = skb->len - (mgmt->u.beacon.variable - skb->data);
1938-
1939-
ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, mgmt->u.beacon.variable,
1940-
len);
1941-
if (ie && ie[1] >= sizeof(*ht)) {
1942-
ht = (void *)(ie + 2);
1943-
vc->ht_ldpc |= !!(le16_to_cpu(ht->cap_info) &
1944-
IEEE80211_HT_CAP_LDPC_CODING);
1945-
}
1946-
1947-
ie = cfg80211_find_ie(WLAN_EID_VHT_CAPABILITY, mgmt->u.beacon.variable,
1948-
len);
1949-
if (ie && ie[1] >= sizeof(*vht)) {
1950-
u32 pc = phy->mt76->sband_5g.sband.vht_cap.cap;
1951-
1952-
vht = (void *)(ie + 2);
1953-
bc = le32_to_cpu(vht->vht_cap_info);
1954-
1955-
vc->vht_ldpc |= !!(bc & IEEE80211_VHT_CAP_RXLDPC);
1956-
vc->vht_su_ebfer =
1957-
(bc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE) &&
1958-
(pc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE);
1959-
vc->vht_su_ebfee =
1960-
(bc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE) &&
1961-
(pc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE);
1962-
vc->vht_mu_ebfer =
1963-
(bc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE) &&
1964-
(pc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE);
1965-
vc->vht_mu_ebfee =
1966-
(bc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) &&
1967-
(pc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
1968-
}
1969-
1970-
ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY,
1971-
mgmt->u.beacon.variable, len);
1972-
if (ie && ie[1] >= sizeof(*he) + 1) {
1973-
const struct ieee80211_sta_he_cap *pc =
1974-
mt76_connac_get_he_phy_cap(phy->mt76, vif);
1975-
const struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
1976-
1977-
he = (void *)(ie + 3);
1978-
1979-
vc->he_ldpc =
1980-
HE_PHY(CAP1_LDPC_CODING_IN_PAYLOAD, pe->phy_cap_info[1]);
1981-
vc->he_su_ebfer =
1982-
HE_PHY(CAP3_SU_BEAMFORMER, he->phy_cap_info[3]) &&
1983-
HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]);
1984-
vc->he_su_ebfee =
1985-
HE_PHY(CAP4_SU_BEAMFORMEE, he->phy_cap_info[4]) &&
1986-
HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
1987-
vc->he_mu_ebfer =
1988-
HE_PHY(CAP4_MU_BEAMFORMER, he->phy_cap_info[4]) &&
1989-
HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4]);
1990-
}
1991-
1992-
ie = cfg80211_find_ext_ie(WLAN_EID_EXT_EHT_CAPABILITY,
1993-
mgmt->u.beacon.variable, len);
1994-
if (ie && ie[1] >= sizeof(*eht) + 1) {
1995-
const struct ieee80211_sta_eht_cap *pc =
1996-
mt76_connac_get_eht_phy_cap(phy->mt76, vif);
1997-
const struct ieee80211_eht_cap_elem_fixed *pe = &pc->eht_cap_elem;
1998-
1999-
eht = (void *)(ie + 3);
2000-
2001-
vc->eht_su_ebfer =
2002-
EHT_PHY(CAP0_SU_BEAMFORMER, eht->phy_cap_info[0]) &&
2003-
EHT_PHY(CAP0_SU_BEAMFORMER, pe->phy_cap_info[0]);
2004-
vc->eht_su_ebfee =
2005-
EHT_PHY(CAP0_SU_BEAMFORMEE, eht->phy_cap_info[0]) &&
2006-
EHT_PHY(CAP0_SU_BEAMFORMEE, pe->phy_cap_info[0]);
2007-
}
2008-
}
2009-
20101913
int mt7996_mcu_add_beacon(struct ieee80211_hw *hw,
20111914
struct ieee80211_vif *vif, int en)
20121915
{
@@ -2045,8 +1948,6 @@ int mt7996_mcu_add_beacon(struct ieee80211_hw *hw,
20451948
info = IEEE80211_SKB_CB(skb);
20461949
info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->mt76->band_idx);
20471950

2048-
mt7996_mcu_beacon_check_caps(phy, vif, skb);
2049-
20501951
mt7996_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs);
20511952
/* TODO: subtag - 11v MBSSID */
20521953
mt7996_mcu_beacon_cntdwn(vif, rskb, skb, &offs);

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,9 @@ struct mt7996_sta {
112112
} twt;
113113
};
114114

115-
struct mt7996_vif_cap {
116-
bool ht_ldpc:1;
117-
bool vht_ldpc:1;
118-
bool he_ldpc:1;
119-
bool vht_su_ebfer:1;
120-
bool vht_su_ebfee:1;
121-
bool vht_mu_ebfer:1;
122-
bool vht_mu_ebfee:1;
123-
bool he_su_ebfer:1;
124-
bool he_su_ebfee:1;
125-
bool he_mu_ebfer:1;
126-
bool eht_su_ebfer:1;
127-
bool eht_su_ebfee:1;
128-
};
129-
130115
struct mt7996_vif {
131116
struct mt76_vif mt76; /* must be first */
132117

133-
struct mt7996_vif_cap cap;
134118
struct mt7996_sta sta;
135119
struct mt7996_phy *phy;
136120

0 commit comments

Comments
 (0)