mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-23 04:12:31 +00:00
1428 lines
51 KiB
Diff
1428 lines
51 KiB
Diff
From 1d5c74a1bf5717880ae08ba8232756a86bd28b5e Mon Sep 17 00:00:00 2001
|
|
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
|
|
Date: Wed, 5 Apr 2023 08:29:19 +0800
|
|
Subject: [PATCH] mt76: revert for backports-5.15 wireless stack
|
|
|
|
wifi: mt76: mt7915: add support for he ldpc control from hostapd
|
|
---
|
|
dma.c | 2 +-
|
|
mac80211.c | 15 +--
|
|
mt7615/dma.c | 4 +-
|
|
mt7615/main.c | 6 +-
|
|
mt7615/mcu.c | 8 +-
|
|
mt76_connac_mac.c | 2 +-
|
|
mt76_connac_mcu.c | 119 ++++++++++------------
|
|
mt76x02_mac.c | 6 +-
|
|
mt7915/debugfs.c | 4 +-
|
|
mt7915/dma.c | 4 +-
|
|
mt7915/init.c | 3 +-
|
|
mt7915/main.c | 36 ++-----
|
|
mt7915/mcu.c | 246 ++++++++++++++++++++++++++++++----------------
|
|
mt7915/testmode.c | 8 +-
|
|
tx.c | 22 ++---
|
|
wed.c | 1 +
|
|
16 files changed, 260 insertions(+), 226 deletions(-)
|
|
|
|
diff --git a/dma.c b/dma.c
|
|
index 782463f..39fafce 100644
|
|
--- a/dma.c
|
|
+++ b/dma.c
|
|
@@ -1052,7 +1052,7 @@ mt76_dma_init(struct mt76_dev *dev,
|
|
init_completion(&dev->mmio.wed_reset_complete);
|
|
|
|
mt76_for_each_q_rx(dev, i) {
|
|
- netif_napi_add(&dev->napi_dev, &dev->napi[i], poll);
|
|
+ netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64);
|
|
mt76_dma_rx_fill(dev, &dev->q_rx[i]);
|
|
napi_enable(&dev->napi[i]);
|
|
}
|
|
diff --git a/mac80211.c b/mac80211.c
|
|
index 0360172..2d0e9a8 100644
|
|
--- a/mac80211.c
|
|
+++ b/mac80211.c
|
|
@@ -1061,14 +1061,9 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
|
|
status->enc_flags = mstat.enc_flags;
|
|
status->encoding = mstat.encoding;
|
|
status->bw = mstat.bw;
|
|
- if (status->encoding == RX_ENC_EHT) {
|
|
- status->eht.ru = mstat.eht.ru;
|
|
- status->eht.gi = mstat.eht.gi;
|
|
- } else {
|
|
- status->he_ru = mstat.he_ru;
|
|
- status->he_gi = mstat.he_gi;
|
|
- status->he_dcm = mstat.he_dcm;
|
|
- }
|
|
+ status->he_ru = mstat.he_ru;
|
|
+ status->he_gi = mstat.he_gi;
|
|
+ status->he_dcm = mstat.he_dcm;
|
|
status->rate_idx = mstat.rate_idx;
|
|
status->nss = mstat.nss;
|
|
status->band = mstat.band;
|
|
@@ -1591,7 +1586,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
|
|
static void
|
|
__mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|
{
|
|
- if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
|
|
+ if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
|
|
ieee80211_csa_finish(vif);
|
|
}
|
|
|
|
@@ -1613,7 +1608,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|
{
|
|
struct mt76_dev *dev = priv;
|
|
|
|
- if (!vif->bss_conf.csa_active)
|
|
+ if (!vif->csa_active)
|
|
return;
|
|
|
|
dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif);
|
|
diff --git a/mt7615/dma.c b/mt7615/dma.c
|
|
index e7135b2..6767c39 100644
|
|
--- a/mt7615/dma.c
|
|
+++ b/mt7615/dma.c
|
|
@@ -282,8 +282,8 @@ int mt7615_dma_init(struct mt7615_dev *dev)
|
|
if (ret < 0)
|
|
return ret;
|
|
|
|
- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
|
|
- mt7615_poll_tx);
|
|
+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
|
|
+ mt7615_poll_tx, NAPI_POLL_WEIGHT);
|
|
napi_enable(&dev->mt76.tx_napi);
|
|
|
|
mt76_poll(dev, MT_WPDMA_GLO_CFG,
|
|
diff --git a/mt7615/main.c b/mt7615/main.c
|
|
index dab16b5..d32a752 100644
|
|
--- a/mt7615/main.c
|
|
+++ b/mt7615/main.c
|
|
@@ -473,7 +473,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
|
|
|
|
static int
|
|
mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
- unsigned int link_id, u16 queue,
|
|
+ u16 queue,
|
|
const struct ieee80211_tx_queue_params *params)
|
|
{
|
|
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
|
|
@@ -581,7 +581,7 @@ mt7615_update_mu_group(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
|
|
struct ieee80211_vif *vif,
|
|
struct ieee80211_bss_conf *info,
|
|
- u64 changed)
|
|
+ u32 changed)
|
|
{
|
|
struct mt7615_dev *dev = mt7615_hw_dev(hw);
|
|
struct mt7615_phy *phy = mt7615_hw_phy(hw);
|
|
@@ -624,7 +624,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
|
|
}
|
|
|
|
if (changed & BSS_CHANGED_ASSOC)
|
|
- mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc);
|
|
+ mt7615_mac_set_beacon_filter(phy, vif, info->assoc);
|
|
|
|
if (changed & BSS_CHANGED_MU_GROUPS)
|
|
mt7615_update_mu_group(hw, vif, info);
|
|
diff --git a/mt7615/mcu.c b/mt7615/mcu.c
|
|
index c9444c6..466f38e 100644
|
|
--- a/mt7615/mcu.c
|
|
+++ b/mt7615/mcu.c
|
|
@@ -353,7 +353,7 @@ out:
|
|
static void
|
|
mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|
{
|
|
- if (vif->bss_conf.csa_active)
|
|
+ if (vif->csa_active)
|
|
ieee80211_csa_finish(vif);
|
|
}
|
|
|
|
@@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
|
|
if (!enable)
|
|
goto out;
|
|
|
|
- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
|
|
+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
|
|
if (!skb)
|
|
return -EINVAL;
|
|
|
|
@@ -1075,7 +1075,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
|
|
if (!enable)
|
|
goto out;
|
|
|
|
- skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0);
|
|
+ skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs);
|
|
if (!skb)
|
|
return -EINVAL;
|
|
|
|
@@ -2526,7 +2526,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
|
u8 pad;
|
|
} req = {
|
|
.bss_idx = mvif->mt76.idx,
|
|
- .aid = cpu_to_le16(vif->cfg.aid),
|
|
+ .aid = cpu_to_le16(vif->bss_conf.aid),
|
|
.dtim_period = vif->bss_conf.dtim_period,
|
|
.bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
|
|
};
|
|
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
|
|
index 0510296..edeb618 100644
|
|
--- a/mt76_connac_mac.c
|
|
+++ b/mt76_connac_mac.c
|
|
@@ -1124,7 +1124,7 @@ void mt76_connac2_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
|
|
u32 val;
|
|
|
|
if (!sta ||
|
|
- !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
|
|
+ !(sta->ht_cap.ht_supported || sta->he_cap.has_he))
|
|
return;
|
|
|
|
tid = le32_get_bits(txwi[1], MT_TXD1_TID);
|
|
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
|
|
index 15e61c9..dd23643 100644
|
|
--- a/mt76_connac_mcu.c
|
|
+++ b/mt76_connac_mcu.c
|
|
@@ -199,7 +199,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif)
|
|
*/
|
|
} req = {
|
|
.bss_idx = mvif->idx,
|
|
- .ps_state = vif->cfg.ps ? 2 : 0,
|
|
+ .ps_state = vif->bss_conf.ps ? 2 : 0,
|
|
};
|
|
|
|
if (vif->type != NL80211_IFTYPE_STATION)
|
|
@@ -397,7 +397,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
|
if (vif->type == NL80211_IFTYPE_STATION &&
|
|
!is_zero_ether_addr(vif->bss_conf.bssid)) {
|
|
memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
|
|
- basic->aid = cpu_to_le16(vif->cfg.aid);
|
|
+ basic->aid = cpu_to_le16(vif->bss_conf.aid);
|
|
} else {
|
|
eth_broadcast_addr(basic->peer_addr);
|
|
}
|
|
@@ -421,7 +421,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
|
else
|
|
conn_type = CONNECTION_INFRA_AP;
|
|
basic->conn_type = cpu_to_le32(conn_type);
|
|
- basic->aid = cpu_to_le16(vif->cfg.aid);
|
|
+ basic->aid = cpu_to_le16(vif->bss_conf.aid);
|
|
break;
|
|
case NL80211_IFTYPE_ADHOC:
|
|
basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
|
|
@@ -565,7 +565,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
|
|
|
|
if (sta) {
|
|
if (vif->type == NL80211_IFTYPE_STATION)
|
|
- generic->partial_aid = cpu_to_le16(vif->cfg.aid);
|
|
+ generic->partial_aid = cpu_to_le16(vif->bss_conf.aid);
|
|
else
|
|
generic->partial_aid = cpu_to_le16(sta->aid);
|
|
memcpy(generic->peer_addr, sta->addr, ETH_ALEN);
|
|
@@ -614,14 +614,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
|
|
vif->type != NL80211_IFTYPE_STATION)
|
|
return;
|
|
|
|
- if (!sta->deflink.agg.max_amsdu_len)
|
|
+ if (!sta->max_amsdu_len)
|
|
return;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
|
|
amsdu = (struct sta_rec_amsdu *)tlv;
|
|
amsdu->max_amsdu_num = 8;
|
|
amsdu->amsdu_en = true;
|
|
- amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >=
|
|
+ amsdu->max_mpdu_size = sta->max_amsdu_len >=
|
|
IEEE80211_MAX_MPDU_LEN_VHT_7991;
|
|
|
|
wcid->amsdu = true;
|
|
@@ -632,7 +632,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
|
|
static void
|
|
mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
{
|
|
- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
|
|
+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
|
|
struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
|
|
struct sta_rec_he *he;
|
|
struct tlv *tlv;
|
|
@@ -720,7 +720,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
|
|
he->he_cap = cpu_to_le32(cap);
|
|
|
|
- switch (sta->deflink.bandwidth) {
|
|
+ switch (sta->bandwidth) {
|
|
case IEEE80211_STA_RX_BW_160:
|
|
if (elem->phy_cap_info[0] &
|
|
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
|
@@ -765,7 +765,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
void
|
|
mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
{
|
|
- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
|
|
+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
|
|
struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
|
|
struct sta_rec_he_v2 *he;
|
|
struct tlv *tlv;
|
|
@@ -776,7 +776,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap));
|
|
memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap));
|
|
|
|
- switch (sta->deflink.bandwidth) {
|
|
+ switch (sta->bandwidth) {
|
|
case IEEE80211_STA_RX_BW_160:
|
|
if (elem->phy_cap_info[0] &
|
|
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
|
@@ -792,7 +792,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
break;
|
|
}
|
|
|
|
- he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US;
|
|
+ he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_he_tlv_v2);
|
|
|
|
@@ -803,14 +803,12 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
|
|
struct ieee80211_sta_ht_cap *ht_cap;
|
|
struct ieee80211_sta_vht_cap *vht_cap;
|
|
const struct ieee80211_sta_he_cap *he_cap;
|
|
- const struct ieee80211_sta_eht_cap *eht_cap;
|
|
u8 mode = 0;
|
|
|
|
if (sta) {
|
|
- ht_cap = &sta->deflink.ht_cap;
|
|
- vht_cap = &sta->deflink.vht_cap;
|
|
- he_cap = &sta->deflink.he_cap;
|
|
- eht_cap = &sta->deflink.eht_cap;
|
|
+ ht_cap = &sta->ht_cap;
|
|
+ vht_cap = &sta->vht_cap;
|
|
+ he_cap = &sta->he_cap;
|
|
} else {
|
|
struct ieee80211_supported_band *sband;
|
|
|
|
@@ -818,7 +816,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
|
|
ht_cap = &sband->ht_cap;
|
|
vht_cap = &sband->vht_cap;
|
|
he_cap = ieee80211_get_he_iftype_cap(sband, vif->type);
|
|
- eht_cap = ieee80211_get_eht_iftype_cap(sband, vif->type);
|
|
}
|
|
|
|
if (band == NL80211_BAND_2GHZ) {
|
|
@@ -829,9 +826,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
|
|
|
|
if (he_cap && he_cap->has_he)
|
|
mode |= PHY_TYPE_BIT_HE;
|
|
-
|
|
- if (eht_cap && eht_cap->has_eht)
|
|
- mode |= PHY_TYPE_BIT_BE;
|
|
} else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) {
|
|
mode |= PHY_TYPE_BIT_OFDM;
|
|
|
|
@@ -843,9 +837,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
|
|
|
|
if (he_cap && he_cap->has_he)
|
|
mode |= PHY_TYPE_BIT_HE;
|
|
-
|
|
- if (eht_cap && eht_cap->has_eht)
|
|
- mode |= PHY_TYPE_BIT_BE;
|
|
}
|
|
|
|
return mode;
|
|
@@ -869,25 +860,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
|
|
u16 supp_rates;
|
|
|
|
/* starec ht */
|
|
- if (sta->deflink.ht_cap.ht_supported) {
|
|
+ if (sta->ht_cap.ht_supported) {
|
|
struct sta_rec_ht *ht;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
|
|
ht = (struct sta_rec_ht *)tlv;
|
|
- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
|
|
+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
|
|
}
|
|
|
|
/* starec vht */
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
struct sta_rec_vht *vht;
|
|
int len;
|
|
|
|
len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4;
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len);
|
|
vht = (struct sta_rec_vht *)tlv;
|
|
- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
|
|
- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
|
|
- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
|
|
+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
|
|
+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
|
|
+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
|
|
}
|
|
|
|
/* starec uapsd */
|
|
@@ -896,11 +887,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
|
|
if (!is_mt7921(dev))
|
|
return;
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)
|
|
+ if (sta->ht_cap.ht_supported || sta->he_cap.has_he)
|
|
mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif);
|
|
|
|
/* starec he */
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
+ if (sta->he_cap.has_he) {
|
|
mt76_connac_mcu_sta_he_tlv(skb, sta);
|
|
mt76_connac_mcu_sta_he_tlv_v2(skb, sta);
|
|
if (band == NL80211_BAND_6GHZ &&
|
|
@@ -910,7 +901,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G,
|
|
sizeof(*he_6g_capa));
|
|
he_6g_capa = (struct sta_rec_he_6g_capa *)tlv;
|
|
- he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa;
|
|
+ he_6g_capa->capa = sta->he_6ghz_capa.capa;
|
|
}
|
|
}
|
|
|
|
@@ -920,14 +911,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
|
|
phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates);
|
|
phy->rcpi = rcpi;
|
|
phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR,
|
|
- sta->deflink.ht_cap.ampdu_factor) |
|
|
+ sta->ht_cap.ampdu_factor) |
|
|
FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY,
|
|
- sta->deflink.ht_cap.ampdu_density);
|
|
+ sta->ht_cap.ampdu_density);
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info));
|
|
ra_info = (struct sta_rec_ra_info *)tlv;
|
|
|
|
- supp_rates = sta->deflink.supp_rates[band];
|
|
+ supp_rates = sta->supp_rates[band];
|
|
if (band == NL80211_BAND_2GHZ)
|
|
supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) |
|
|
FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf);
|
|
@@ -936,18 +927,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
|
|
|
|
ra_info->legacy = cpu_to_le16(supp_rates);
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported)
|
|
+ if (sta->ht_cap.ht_supported)
|
|
memcpy(ra_info->rx_mcs_bitmask,
|
|
- sta->deflink.ht_cap.mcs.rx_mask,
|
|
+ sta->ht_cap.mcs.rx_mask,
|
|
HT_MCS_MASK_NUM);
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state));
|
|
state = (struct sta_rec_state *)tlv;
|
|
state->state = sta_state;
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
- state->vht_opmode = sta->deflink.bandwidth;
|
|
- state->vht_opmode |= (sta->deflink.rx_nss - 1) <<
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
+ state->vht_opmode = sta->bandwidth;
|
|
+ state->vht_opmode |= (sta->rx_nss - 1) <<
|
|
IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
|
|
}
|
|
}
|
|
@@ -963,7 +954,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
|
|
tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps),
|
|
wtbl_tlv, sta_wtbl);
|
|
smps = (struct wtbl_smps *)tlv;
|
|
- smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC);
|
|
+ smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv);
|
|
|
|
@@ -975,27 +966,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
|
struct tlv *tlv;
|
|
u32 flags = 0;
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) {
|
|
+ if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
|
|
tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
|
|
wtbl_tlv, sta_wtbl);
|
|
ht = (struct wtbl_ht *)tlv;
|
|
ht->ldpc = ht_ldpc &&
|
|
- !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
|
|
+ !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported) {
|
|
- ht->af = sta->deflink.ht_cap.ampdu_factor;
|
|
- ht->mm = sta->deflink.ht_cap.ampdu_density;
|
|
+ if (sta->ht_cap.ht_supported) {
|
|
+ ht->af = sta->ht_cap.ampdu_factor;
|
|
+ ht->mm = sta->ht_cap.ampdu_density;
|
|
} else {
|
|
- ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
|
|
+ ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
|
|
IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
|
|
- ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
|
|
+ ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
|
|
IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
|
|
}
|
|
|
|
ht->ht = true;
|
|
}
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) {
|
|
+ if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
|
|
struct wtbl_vht *vht;
|
|
u8 af;
|
|
|
|
@@ -1004,18 +995,18 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
|
sta_wtbl);
|
|
vht = (struct wtbl_vht *)tlv;
|
|
vht->ldpc = vht_ldpc &&
|
|
- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
|
|
+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
|
|
vht->vht = true;
|
|
|
|
af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
|
|
- sta->deflink.vht_cap.cap);
|
|
+ sta->vht_cap.cap);
|
|
if (ht)
|
|
ht->af = max(ht->af, af);
|
|
}
|
|
|
|
mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv);
|
|
|
|
- if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) {
|
|
+ if (is_connac_v1(dev) && sta->ht_cap.ht_supported) {
|
|
/* sgi */
|
|
u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 |
|
|
MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160;
|
|
@@ -1025,15 +1016,15 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
|
sizeof(*raw), wtbl_tlv,
|
|
sta_wtbl);
|
|
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
|
|
flags |= MT_WTBL_W5_SHORT_GI_20;
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
|
|
flags |= MT_WTBL_W5_SHORT_GI_40;
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
|
|
flags |= MT_WTBL_W5_SHORT_GI_80;
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
|
|
flags |= MT_WTBL_W5_SHORT_GI_160;
|
|
}
|
|
raw = (struct wtbl_raw *)tlv;
|
|
@@ -1322,9 +1313,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
|
|
return 0x38;
|
|
|
|
if (sta) {
|
|
- ht_cap = &sta->deflink.ht_cap;
|
|
- vht_cap = &sta->deflink.vht_cap;
|
|
- he_cap = &sta->deflink.he_cap;
|
|
+ ht_cap = &sta->ht_cap;
|
|
+ vht_cap = &sta->vht_cap;
|
|
+ he_cap = &sta->he_cap;
|
|
} else {
|
|
struct ieee80211_supported_band *sband;
|
|
|
|
@@ -1647,7 +1638,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
|
|
for (i = 0; i < sreq->n_ssids; i++) {
|
|
if (!sreq->ssids[i].ssid_len)
|
|
continue;
|
|
-
|
|
req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len);
|
|
memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
|
|
sreq->ssids[i].ssid_len);
|
|
@@ -1787,7 +1777,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,
|
|
memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len);
|
|
req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len);
|
|
}
|
|
-
|
|
req->match_num = sreq->n_match_sets;
|
|
for (i = 0; i < req->match_num; i++) {
|
|
match = &sreq->match_sets[i];
|
|
@@ -2163,10 +2152,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
|
|
struct mt76_vif *vif,
|
|
struct ieee80211_bss_conf *info)
|
|
{
|
|
- struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif,
|
|
- bss_conf);
|
|
struct sk_buff *skb;
|
|
- int i, len = min_t(int, mvif->cfg.arp_addr_cnt,
|
|
+ int i, len = min_t(int, info->arp_addr_cnt,
|
|
IEEE80211_BSS_ARP_ADDR_LIST_LEN);
|
|
struct {
|
|
struct {
|
|
@@ -2194,7 +2181,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
|
|
|
|
skb_put_data(skb, &req_hdr, sizeof(req_hdr));
|
|
for (i = 0; i < len; i++)
|
|
- skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32));
|
|
+ skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32));
|
|
|
|
return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
|
|
}
|
|
diff --git a/mt76x02_mac.c b/mt76x02_mac.c
|
|
index d5db6ff..fec3d10 100644
|
|
--- a/mt76x02_mac.c
|
|
+++ b/mt76x02_mac.c
|
|
@@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
|
|
txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC);
|
|
if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1)
|
|
txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC);
|
|
- if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC)
|
|
+ if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
|
|
txwi_flags |= MT_TXWI_FLAGS_MMPS;
|
|
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
|
|
txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ;
|
|
@@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
|
|
txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ;
|
|
if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) {
|
|
u8 ba_size = IEEE80211_MIN_AMPDU_BUF;
|
|
- u8 ampdu_density = sta->deflink.ht_cap.ampdu_density;
|
|
+ u8 ampdu_density = sta->ht_cap.ampdu_density;
|
|
|
|
- ba_size <<= sta->deflink.ht_cap.ampdu_factor;
|
|
+ ba_size <<= sta->ht_cap.ampdu_factor;
|
|
ba_size = min_t(int, 63, ba_size - 1);
|
|
if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
|
|
ba_size = 0;
|
|
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
|
|
index 76d1951..e22e777 100644
|
|
--- a/mt7915/debugfs.c
|
|
+++ b/mt7915/debugfs.c
|
|
@@ -2052,8 +2052,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file,
|
|
|
|
phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0);
|
|
for (i = 0; i <= phy.bw; i++) {
|
|
- phy.sgi |= gi << (i << sta->deflink.he_cap.has_he);
|
|
- phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he);
|
|
+ phy.sgi |= gi << (i << sta->he_cap.has_he);
|
|
+ phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he);
|
|
}
|
|
field = RATE_PARAM_FIXED;
|
|
|
|
diff --git a/mt7915/dma.c b/mt7915/dma.c
|
|
index 4f9f5a3..fde6a38 100644
|
|
--- a/mt7915/dma.c
|
|
+++ b/mt7915/dma.c
|
|
@@ -596,8 +596,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
|
|
if (ret < 0)
|
|
return ret;
|
|
|
|
- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
|
|
- mt7915_poll_tx);
|
|
+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
|
|
+ mt7915_poll_tx, NAPI_POLL_WEIGHT);
|
|
napi_enable(&dev->mt76.tx_napi);
|
|
|
|
mt7915_dma_enable(dev, false);
|
|
diff --git a/mt7915/init.c b/mt7915/init.c
|
|
index e5327be..93f706f 100644
|
|
--- a/mt7915/init.c
|
|
+++ b/mt7915/init.c
|
|
@@ -1154,8 +1154,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
|
|
mt76_connac_gen_ppe_thresh(he_cap->ppe_thres, nss);
|
|
} else {
|
|
he_cap_elem->phy_cap_info[9] |=
|
|
- u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US,
|
|
- IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK);
|
|
+ IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
|
|
}
|
|
|
|
if (band == NL80211_BAND_6GHZ) {
|
|
diff --git a/mt7915/main.c b/mt7915/main.c
|
|
index 17a380b..cc4fb49 100644
|
|
--- a/mt7915/main.c
|
|
+++ b/mt7915/main.c
|
|
@@ -547,7 +547,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
|
|
|
|
static int
|
|
mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
- unsigned int link_id, u16 queue,
|
|
+ u16 queue,
|
|
const struct ieee80211_tx_queue_params *params)
|
|
{
|
|
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
|
@@ -648,7 +648,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
|
|
static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
|
|
struct ieee80211_vif *vif,
|
|
struct ieee80211_bss_conf *info,
|
|
- u64 changed)
|
|
+ u32 changed)
|
|
{
|
|
struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
|
struct mt7915_dev *dev = mt7915_hw_dev(hw);
|
|
@@ -664,7 +664,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
|
|
vif->type == NL80211_IFTYPE_STATION)
|
|
set_bss_info = set_sta = !is_zero_ether_addr(info->bssid);
|
|
if (changed & BSS_CHANGED_ASSOC)
|
|
- set_bss_info = vif->cfg.assoc;
|
|
+ set_bss_info = info->assoc;
|
|
if (changed & BSS_CHANGED_BEACON_ENABLED &&
|
|
vif->type != NL80211_IFTYPE_AP)
|
|
set_bss_info = set_sta = info->enable_beacon;
|
|
@@ -712,27 +712,8 @@ 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->ht_ldpc = vif->bss_conf.ht_ldpc;
|
|
- vc->vht_ldpc = vif->bss_conf.vht_ldpc;
|
|
- vc->vht_su_ebfer = vif->bss_conf.vht_su_beamformer;
|
|
- vc->vht_su_ebfee = vif->bss_conf.vht_su_beamformee;
|
|
- vc->vht_mu_ebfer = vif->bss_conf.vht_mu_beamformer;
|
|
- vc->vht_mu_ebfee = vif->bss_conf.vht_mu_beamformee;
|
|
- vc->he_ldpc = vif->bss_conf.he_ldpc;
|
|
- vc->he_su_ebfer = vif->bss_conf.he_su_beamformer;
|
|
- vc->he_su_ebfee = vif->bss_conf.he_su_beamformee;
|
|
- 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)
|
|
+mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|
{
|
|
struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
|
struct mt7915_dev *dev = mt7915_hw_dev(hw);
|
|
@@ -740,8 +721,6 @@ 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;
|
|
@@ -753,8 +732,7 @@ out:
|
|
}
|
|
|
|
static void
|
|
-mt7915_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
- struct ieee80211_bss_conf *link_conf)
|
|
+mt7915_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|
{
|
|
struct mt7915_dev *dev = mt7915_hw_dev(hw);
|
|
|
|
@@ -1374,10 +1352,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
|
|
{
|
|
struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
|
struct mt7915_dev *dev = mt7915_hw_dev(hw);
|
|
- s16 txpower = sta->deflink.txpwr.power;
|
|
+ s16 txpower = sta->txpwr.power;
|
|
int ret;
|
|
|
|
- if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC)
|
|
+ if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC)
|
|
txpower = 0;
|
|
|
|
mutex_lock(&dev->mt76.mutex);
|
|
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
|
|
index f0273fe..5c14114 100644
|
|
--- a/mt7915/mcu.c
|
|
+++ b/mt7915/mcu.c
|
|
@@ -67,7 +67,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
|
|
struct mt7915_dev *dev = msta->vif->phy->dev;
|
|
enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band;
|
|
const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs;
|
|
- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
|
|
+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
|
|
|
|
for (nss = 0; nss < max_nss; nss++) {
|
|
int mcs;
|
|
@@ -107,7 +107,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
|
|
|
|
/* only support 2ss on 160MHz for mt7915 */
|
|
if (is_mt7915(&dev->mt76) && nss > 1 &&
|
|
- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
|
|
+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
|
|
break;
|
|
}
|
|
|
|
@@ -120,8 +120,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
|
|
{
|
|
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
|
struct mt7915_dev *dev = msta->vif->phy->dev;
|
|
- u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map);
|
|
- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
|
|
+ u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
|
|
+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
|
|
u16 mcs;
|
|
|
|
for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) {
|
|
@@ -143,7 +143,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
|
|
|
|
/* only support 2ss on 160MHz for mt7915 */
|
|
if (is_mt7915(&dev->mt76) && nss > 1 &&
|
|
- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
|
|
+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
|
|
break;
|
|
}
|
|
}
|
|
@@ -152,10 +152,10 @@ static void
|
|
mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs,
|
|
const u8 *mask)
|
|
{
|
|
- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
|
|
+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
|
|
|
|
for (nss = 0; nss < max_nss; nss++)
|
|
- ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss];
|
|
+ ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss];
|
|
}
|
|
|
|
static int
|
|
@@ -243,7 +243,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
|
|
static void
|
|
mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|
{
|
|
- if (!vif->bss_conf.csa_active || vif->type == NL80211_IFTYPE_STATION)
|
|
+ if (!vif->csa_active || vif->type == NL80211_IFTYPE_STATION)
|
|
return;
|
|
|
|
ieee80211_csa_finish(vif);
|
|
@@ -349,7 +349,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
|
|
static void
|
|
mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|
{
|
|
- if (!vif->bss_conf.color_change_active || vif->type == NL80211_IFTYPE_STATION)
|
|
+ if (!vif->color_change_active || vif->type == NL80211_IFTYPE_STATION)
|
|
return;
|
|
|
|
ieee80211_color_change_finish(vif);
|
|
@@ -945,13 +945,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
|
|
struct ieee80211_vif *vif)
|
|
{
|
|
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
|
- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
|
|
+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
|
|
struct ieee80211_he_mcs_nss_supp mcs_map;
|
|
struct sta_rec_he *he;
|
|
struct tlv *tlv;
|
|
u32 cap = 0;
|
|
|
|
- if (!sta->deflink.he_cap.has_he)
|
|
+ if (!sta->he_cap.has_he)
|
|
return;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he));
|
|
@@ -1037,8 +1037,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
|
|
|
|
he->he_cap = cpu_to_le32(cap);
|
|
|
|
- mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
|
|
- switch (sta->deflink.bandwidth) {
|
|
+ mcs_map = sta->he_cap.he_mcs_nss_supp;
|
|
+ switch (sta->bandwidth) {
|
|
case IEEE80211_STA_RX_BW_160:
|
|
if (elem->phy_cap_info[0] &
|
|
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
|
@@ -1088,7 +1088,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
struct ieee80211_sta *sta, struct ieee80211_vif *vif)
|
|
{
|
|
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
|
- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
|
|
+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
|
|
struct mt7915_phy *phy = mvif->phy;
|
|
struct sta_rec_muru *muru;
|
|
struct tlv *tlv;
|
|
@@ -1113,11 +1113,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
muru->cfg.ofdma_dl_en = !!(phy->muru_onoff & OFDMA_DL);
|
|
muru->cfg.ofdma_ul_en = !!(phy->muru_onoff & OFDMA_UL);
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported)
|
|
+ if (sta->vht_cap.vht_supported)
|
|
muru->mimo_dl.vht_mu_bfee =
|
|
- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
|
|
+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
|
|
|
|
- if (!sta->deflink.he_cap.has_he)
|
|
+ if (!sta->he_cap.has_he)
|
|
return;
|
|
|
|
muru->mimo_dl.partial_bw_dl_mimo =
|
|
@@ -1153,13 +1153,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
struct sta_rec_ht *ht;
|
|
struct tlv *tlv;
|
|
|
|
- if (!sta->deflink.ht_cap.ht_supported)
|
|
+ if (!sta->ht_cap.ht_supported)
|
|
return;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
|
|
|
|
ht = (struct sta_rec_ht *)tlv;
|
|
- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
|
|
+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
|
|
}
|
|
|
|
static void
|
|
@@ -1168,15 +1168,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
|
|
struct sta_rec_vht *vht;
|
|
struct tlv *tlv;
|
|
|
|
- if (!sta->deflink.vht_cap.vht_supported)
|
|
+ if (!sta->vht_cap.vht_supported)
|
|
return;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht));
|
|
|
|
vht = (struct sta_rec_vht *)tlv;
|
|
- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
|
|
- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
|
|
- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
|
|
+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
|
|
+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
|
|
+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
|
|
}
|
|
|
|
static void
|
|
@@ -1191,7 +1191,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
vif->type != NL80211_IFTYPE_AP)
|
|
return;
|
|
|
|
- if (!sta->deflink.agg.max_amsdu_len)
|
|
+ if (!sta->max_amsdu_len)
|
|
return;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
|
|
@@ -1200,7 +1200,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
amsdu->amsdu_en = true;
|
|
msta->wcid.amsdu = true;
|
|
|
|
- switch (sta->deflink.agg.max_amsdu_len) {
|
|
+ switch (sta->max_amsdu_len) {
|
|
case IEEE80211_MAX_MPDU_LEN_VHT_11454:
|
|
if (!is_mt7915(&dev->mt76)) {
|
|
amsdu->max_mpdu_size =
|
|
@@ -1263,8 +1263,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
|
|
if (!bfee && sts < 2)
|
|
return false;
|
|
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
|
|
+ if (sta->he_cap.has_he) {
|
|
+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
|
|
|
|
if (bfee)
|
|
return mvif->cap.he_su_ebfee &&
|
|
@@ -1274,8 +1274,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
|
|
HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
|
|
}
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
- u32 cap = sta->deflink.vht_cap.cap;
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
+ u32 cap = sta->vht_cap.cap;
|
|
|
|
if (bfee)
|
|
return mvif->cap.vht_su_ebfee &&
|
|
@@ -1301,7 +1301,7 @@ static void
|
|
mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
|
|
struct sta_rec_bf *bf)
|
|
{
|
|
- struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs;
|
|
+ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
|
|
u8 n = 0;
|
|
|
|
bf->tx_mode = MT_PHY_TYPE_HT;
|
|
@@ -1326,7 +1326,7 @@ static void
|
|
mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
|
|
struct sta_rec_bf *bf, bool explicit)
|
|
{
|
|
- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
|
|
+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
|
|
struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap;
|
|
u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map);
|
|
u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map);
|
|
@@ -1347,14 +1347,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
|
|
bf->ncol = min_t(u8, nss_mcs, bf->nrow);
|
|
bf->ibf_ncol = bf->ncol;
|
|
|
|
- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
|
|
+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
|
|
bf->nrow = 1;
|
|
} else {
|
|
bf->nrow = tx_ant;
|
|
bf->ncol = min_t(u8, nss_mcs, bf->nrow);
|
|
bf->ibf_ncol = nss_mcs;
|
|
|
|
- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
|
|
+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
|
|
bf->ibf_nrow = 1;
|
|
}
|
|
}
|
|
@@ -1363,7 +1363,7 @@ static void
|
|
mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
|
|
struct mt7915_phy *phy, struct sta_rec_bf *bf)
|
|
{
|
|
- struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap;
|
|
+ struct ieee80211_sta_he_cap *pc = &sta->he_cap;
|
|
struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
|
|
const struct ieee80211_sta_he_cap *vc =
|
|
mt76_connac_get_he_phy_cap(phy->mt76, vif);
|
|
@@ -1388,7 +1388,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
|
|
bf->ncol = min_t(u8, nss_mcs, bf->nrow);
|
|
bf->ibf_ncol = bf->ncol;
|
|
|
|
- if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160)
|
|
+ if (sta->bandwidth != IEEE80211_STA_RX_BW_160)
|
|
return;
|
|
|
|
/* go over for 160MHz and 80p80 */
|
|
@@ -1436,7 +1436,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
};
|
|
bool ebf;
|
|
|
|
- if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
|
|
+ if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he))
|
|
return;
|
|
|
|
ebf = mt7915_is_ebf_supported(phy, vif, sta, false);
|
|
@@ -1450,21 +1450,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
* vht: support eBF and iBF
|
|
* ht: iBF only, since mac80211 lacks of eBF support
|
|
*/
|
|
- if (sta->deflink.he_cap.has_he && ebf)
|
|
+ if (sta->he_cap.has_he && ebf)
|
|
mt7915_mcu_sta_bfer_he(sta, vif, phy, bf);
|
|
- else if (sta->deflink.vht_cap.vht_supported)
|
|
+ else if (sta->vht_cap.vht_supported)
|
|
mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf);
|
|
- else if (sta->deflink.ht_cap.ht_supported)
|
|
+ else if (sta->ht_cap.ht_supported)
|
|
mt7915_mcu_sta_bfer_ht(sta, phy, bf);
|
|
else
|
|
return;
|
|
|
|
bf->bf_cap = ebf ? ebf : dev->ibf << 1;
|
|
- bf->bw = sta->deflink.bandwidth;
|
|
- bf->ibf_dbw = sta->deflink.bandwidth;
|
|
+ bf->bw = sta->bandwidth;
|
|
+ bf->ibf_dbw = sta->bandwidth;
|
|
bf->ibf_nrow = tx_ant;
|
|
|
|
- if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
|
|
+ if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
|
|
bf->ibf_timeout = 0x48;
|
|
else
|
|
bf->ibf_timeout = 0x18;
|
|
@@ -1474,7 +1474,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
else
|
|
bf->mem_20m = matrix[bf->nrow][bf->ncol];
|
|
|
|
- switch (sta->deflink.bandwidth) {
|
|
+ switch (sta->bandwidth) {
|
|
case IEEE80211_STA_RX_BW_160:
|
|
case IEEE80211_STA_RX_BW_80:
|
|
bf->mem_total = bf->mem_20m * 2;
|
|
@@ -1499,7 +1499,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
struct tlv *tlv;
|
|
u8 nrow = 0;
|
|
|
|
- if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he))
|
|
+ if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he))
|
|
return;
|
|
|
|
if (!mt7915_is_ebf_supported(phy, vif, sta, true))
|
|
@@ -1508,13 +1508,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee));
|
|
bfee = (struct sta_rec_bfee *)tlv;
|
|
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
|
|
+ if (sta->he_cap.has_he) {
|
|
+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
|
|
|
|
nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
|
|
pe->phy_cap_info[5]);
|
|
- } else if (sta->deflink.vht_cap.vht_supported) {
|
|
- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
|
|
+ } else if (sta->vht_cap.vht_supported) {
|
|
+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
|
|
|
|
nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK,
|
|
pc->cap);
|
|
@@ -1570,7 +1570,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
|
|
ra->phy = *phy;
|
|
break;
|
|
case RATE_PARAM_MMPS_UPDATE:
|
|
- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
|
|
+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
|
|
break;
|
|
case RATE_PARAM_SPE_UPDATE:
|
|
ra->spe_idx = *(u8 *)data;
|
|
@@ -1646,7 +1646,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
|
|
do { \
|
|
u8 i, gi = mask->control[band]._gi; \
|
|
gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \
|
|
- for (i = 0; i <= sta->deflink.bandwidth; i++) { \
|
|
+ for (i = 0; i <= sta->bandwidth; i++) { \
|
|
phy.sgi |= gi << (i << (_he)); \
|
|
phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\
|
|
} \
|
|
@@ -1660,11 +1660,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
|
|
} \
|
|
} while (0)
|
|
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
+ if (sta->he_cap.has_he) {
|
|
__sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1);
|
|
- } else if (sta->deflink.vht_cap.vht_supported) {
|
|
+ } else if (sta->vht_cap.vht_supported) {
|
|
__sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0);
|
|
- } else if (sta->deflink.ht_cap.ht_supported) {
|
|
+ } else if (sta->ht_cap.ht_supported) {
|
|
__sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0);
|
|
} else {
|
|
nrates = hweight32(mask->control[band].legacy);
|
|
@@ -1698,7 +1698,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
|
|
* actual txrate hardware sends out.
|
|
*/
|
|
addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7);
|
|
- if (sta->deflink.he_cap.has_he)
|
|
+ if (sta->he_cap.has_he)
|
|
mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi);
|
|
else
|
|
mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi);
|
|
@@ -1731,7 +1731,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
|
|
enum nl80211_band band = chandef->chan->band;
|
|
struct sta_rec_ra *ra;
|
|
struct tlv *tlv;
|
|
- u32 supp_rate = sta->deflink.supp_rates[band];
|
|
+ u32 supp_rate = sta->supp_rates[band];
|
|
u32 cap = sta->wme ? STA_CAP_WMM : 0;
|
|
|
|
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra));
|
|
@@ -1741,9 +1741,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
|
|
ra->auto_rate = true;
|
|
ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta);
|
|
ra->channel = chandef->chan->hw_value;
|
|
- ra->bw = sta->deflink.bandwidth;
|
|
- ra->phy.bw = sta->deflink.bandwidth;
|
|
- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
|
|
+ ra->bw = sta->bandwidth;
|
|
+ ra->phy.bw = sta->bandwidth;
|
|
+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
|
|
|
|
if (supp_rate) {
|
|
supp_rate &= mask->control[band].legacy;
|
|
@@ -1763,22 +1763,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
|
|
}
|
|
}
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported) {
|
|
+ if (sta->ht_cap.ht_supported) {
|
|
ra->supp_mode |= MODE_HT;
|
|
- ra->af = sta->deflink.ht_cap.ampdu_factor;
|
|
- ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
|
|
+ ra->af = sta->ht_cap.ampdu_factor;
|
|
+ ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
|
|
|
|
cap |= STA_CAP_HT;
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
|
|
cap |= STA_CAP_SGI_20;
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
|
|
cap |= STA_CAP_SGI_40;
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
|
|
cap |= STA_CAP_TX_STBC;
|
|
- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
|
|
+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
|
|
cap |= STA_CAP_RX_STBC;
|
|
if (mvif->cap.ht_ldpc &&
|
|
- (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
|
|
+ (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
|
|
cap |= STA_CAP_LDPC;
|
|
|
|
mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs,
|
|
@@ -1786,37 +1786,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
|
|
ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs;
|
|
}
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
u8 af;
|
|
|
|
ra->supp_mode |= MODE_VHT;
|
|
af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
|
|
- sta->deflink.vht_cap.cap);
|
|
+ sta->vht_cap.cap);
|
|
ra->af = max_t(u8, ra->af, af);
|
|
|
|
cap |= STA_CAP_VHT;
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
|
|
cap |= STA_CAP_VHT_SGI_80;
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
|
|
cap |= STA_CAP_VHT_SGI_160;
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
|
|
cap |= STA_CAP_VHT_TX_STBC;
|
|
- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
|
|
+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
|
|
cap |= STA_CAP_VHT_RX_STBC;
|
|
if (mvif->cap.vht_ldpc &&
|
|
- (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
|
|
+ (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
|
|
cap |= STA_CAP_VHT_LDPC;
|
|
|
|
mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs,
|
|
mask->control[band].vht_mcs);
|
|
}
|
|
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
+ if (sta->he_cap.has_he) {
|
|
ra->supp_mode |= MODE_HE;
|
|
cap |= STA_CAP_HE;
|
|
|
|
- if (sta->deflink.he_6ghz_capa.capa)
|
|
- ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
|
|
+ if (sta->he_6ghz_capa.capa)
|
|
+ ra->af = le16_get_bits(sta->he_6ghz_capa.capa,
|
|
IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
|
|
}
|
|
|
|
@@ -2025,7 +2025,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
|
|
if (!offs->cntdwn_counter_offs[0])
|
|
return;
|
|
|
|
- sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
|
|
+ sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
|
|
tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info),
|
|
&bcn->sub_ntlv, &bcn->len);
|
|
info = (struct bss_info_bcn_cntdwn *)tlv;
|
|
@@ -2110,9 +2110,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
|
if (offs->cntdwn_counter_offs[0]) {
|
|
u16 offset = offs->cntdwn_counter_offs[0];
|
|
|
|
- if (vif->bss_conf.csa_active)
|
|
+ if (vif->csa_active)
|
|
cont->csa_ofs = cpu_to_le16(offset - 4);
|
|
- if (vif->bss_conf.color_change_active)
|
|
+ if (vif->color_change_active)
|
|
cont->bcc_ofs = cpu_to_le16(offset - 3);
|
|
}
|
|
|
|
@@ -2122,6 +2122,85 @@ 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_beacon_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif,
|
|
+ struct sk_buff *skb)
|
|
+{
|
|
+ struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
|
+ struct mt7915_vif_cap *vc = &mvif->cap;
|
|
+ const struct ieee80211_he_cap_elem *he;
|
|
+ const struct ieee80211_vht_cap *vht;
|
|
+ const struct ieee80211_ht_cap *ht;
|
|
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
|
|
+ const u8 *ie;
|
|
+ u32 len, bc;
|
|
+
|
|
+ /* Check missing configuration options to allow AP mode in mac80211
|
|
+ * to remain in sync with hostapd settings, and get a subset of
|
|
+ * beacon and hardware capabilities.
|
|
+ */
|
|
+ if (WARN_ON_ONCE(skb->len <= (mgmt->u.beacon.variable - skb->data)))
|
|
+ return;
|
|
+
|
|
+ memset(vc, 0, sizeof(*vc));
|
|
+
|
|
+ len = skb->len - (mgmt->u.beacon.variable - skb->data);
|
|
+
|
|
+ ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, mgmt->u.beacon.variable,
|
|
+ len);
|
|
+ if (ie && ie[1] >= sizeof(*ht)) {
|
|
+ ht = (void *)(ie + 2);
|
|
+ vc->ht_ldpc = !!(le16_to_cpu(ht->cap_info) &
|
|
+ IEEE80211_HT_CAP_LDPC_CODING);
|
|
+ }
|
|
+
|
|
+ ie = cfg80211_find_ie(WLAN_EID_VHT_CAPABILITY, mgmt->u.beacon.variable,
|
|
+ len);
|
|
+ if (ie && ie[1] >= sizeof(*vht)) {
|
|
+ u32 pc = phy->mt76->sband_5g.sband.vht_cap.cap;
|
|
+
|
|
+ vht = (void *)(ie + 2);
|
|
+ bc = le32_to_cpu(vht->vht_cap_info);
|
|
+
|
|
+ vc->vht_ldpc = !!(bc & IEEE80211_VHT_CAP_RXLDPC);
|
|
+ vc->vht_su_ebfer =
|
|
+ (bc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE) &&
|
|
+ (pc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE);
|
|
+ vc->vht_su_ebfee =
|
|
+ (bc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE) &&
|
|
+ (pc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE);
|
|
+ vc->vht_mu_ebfer =
|
|
+ (bc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE) &&
|
|
+ (pc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE);
|
|
+ vc->vht_mu_ebfee =
|
|
+ (bc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) &&
|
|
+ (pc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
|
|
+ }
|
|
+
|
|
+ ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY,
|
|
+ mgmt->u.beacon.variable, len);
|
|
+ if (ie && ie[1] >= sizeof(*he) + 1) {
|
|
+ const struct ieee80211_sta_he_cap *pc =
|
|
+ mt76_connac_get_he_phy_cap(phy->mt76, vif);
|
|
+ const struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
|
|
+
|
|
+ he = (void *)(ie + 3);
|
|
+
|
|
+ vc->he_ldpc =
|
|
+ HE_PHY(CAP1_LDPC_CODING_IN_PAYLOAD, he->phy_cap_info[1]) &&
|
|
+ HE_PHY(CAP1_LDPC_CODING_IN_PAYLOAD, pe->phy_cap_info[1]);
|
|
+ vc->he_su_ebfer =
|
|
+ HE_PHY(CAP3_SU_BEAMFORMER, he->phy_cap_info[3]) &&
|
|
+ HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]);
|
|
+ vc->he_su_ebfee =
|
|
+ HE_PHY(CAP4_SU_BEAMFORMEE, he->phy_cap_info[4]) &&
|
|
+ HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
|
|
+ vc->he_mu_ebfer =
|
|
+ HE_PHY(CAP4_MU_BEAMFORMER, he->phy_cap_info[4]) &&
|
|
+ HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4]);
|
|
+ }
|
|
+}
|
|
+
|
|
int
|
|
mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
|
u32 changed)
|
|
@@ -2234,7 +2313,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, in
|
|
if (!en)
|
|
goto out;
|
|
|
|
- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
|
|
+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
|
|
if (!skb) {
|
|
dev_kfree_skb(rskb);
|
|
return -EINVAL;
|
|
@@ -2250,6 +2329,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, in
|
|
info = IEEE80211_SKB_CB(skb);
|
|
info->hw_queue = FIELD_PREP(MT_TX_HW_QUEUE_PHY, ext_phy);
|
|
|
|
+ mt7915_mcu_beacon_check_caps(phy, vif, skb);
|
|
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);
|
|
@@ -3547,17 +3627,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
|
|
if (txpower) {
|
|
u32 offs, len, i;
|
|
|
|
- if (sta->deflink.ht_cap.ht_supported) {
|
|
+ if (sta->ht_cap.ht_supported) {
|
|
const u8 *sku_len = mt7915_sku_group_len;
|
|
|
|
offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM];
|
|
len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40];
|
|
|
|
- if (sta->deflink.vht_cap.vht_supported) {
|
|
+ if (sta->vht_cap.vht_supported) {
|
|
offs += len;
|
|
len = sku_len[SKU_VHT_BW20] * 4;
|
|
|
|
- if (sta->deflink.he_cap.has_he) {
|
|
+ if (sta->he_cap.has_he) {
|
|
offs += len + sku_len[SKU_HE_RU26] * 3;
|
|
len = sku_len[SKU_HE_RU242] * 4;
|
|
}
|
|
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
|
|
index ecd6271..b2c442b 100644
|
|
--- a/mt7915/testmode.c
|
|
+++ b/mt7915/testmode.c
|
|
@@ -418,12 +418,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid)
|
|
memcpy(sta->addr, td->addr[0], ETH_ALEN);
|
|
|
|
if (td->tx_rate_mode >= MT76_TM_TX_MODE_HT)
|
|
- memcpy(&sta->deflink.ht_cap, &sband->ht_cap, sizeof(sta->deflink.ht_cap));
|
|
+ memcpy(&sta->ht_cap, &sband->ht_cap, sizeof(sta->ht_cap));
|
|
if (td->tx_rate_mode >= MT76_TM_TX_MODE_VHT)
|
|
- memcpy(&sta->deflink.vht_cap, &sband->vht_cap, sizeof(sta->deflink.vht_cap));
|
|
+ memcpy(&sta->vht_cap, &sband->vht_cap, sizeof(sta->vht_cap));
|
|
if (td->tx_rate_mode >= MT76_TM_TX_MODE_HE_SU)
|
|
- memcpy(&sta->deflink.he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
|
|
- sizeof(sta->deflink.he_cap));
|
|
+ memcpy(&sta->he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
|
|
+ sizeof(sta->he_cap));
|
|
sta->aid = aid;
|
|
sta->wme = 1;
|
|
|
|
diff --git a/tx.c b/tx.c
|
|
index e4eb74b..a3654a9 100644
|
|
--- a/tx.c
|
|
+++ b/tx.c
|
|
@@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
|
|
.skb = skb,
|
|
.info = IEEE80211_SKB_CB(skb),
|
|
};
|
|
- struct ieee80211_rate_status rs = {};
|
|
struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
|
|
struct mt76_wcid *wcid;
|
|
|
|
wcid = rcu_dereference(dev->wcid[cb->wcid]);
|
|
if (wcid) {
|
|
status.sta = wcid_to_sta(wcid);
|
|
- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
|
|
- rs.rate_idx = wcid->rate;
|
|
- status.rates = &rs;
|
|
- status.n_rates = 1;
|
|
- } else {
|
|
- status.n_rates = 0;
|
|
- }
|
|
+
|
|
+ if (status.sta)
|
|
+ status.rate = &wcid->rate;
|
|
}
|
|
|
|
hw = mt76_tx_status_get_hw(dev, skb);
|
|
@@ -239,6 +234,7 @@ mt76_tx_check_non_aql(struct mt76_dev *dev, struct mt76_wcid *wcid,
|
|
void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *skb,
|
|
struct list_head *free_list)
|
|
{
|
|
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
|
struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
|
|
struct ieee80211_tx_status status = {
|
|
.skb = skb,
|
|
@@ -269,15 +265,13 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
|
|
#endif
|
|
|
|
if (cb->pktid < MT_PACKET_ID_FIRST) {
|
|
- struct ieee80211_rate_status rs = {};
|
|
-
|
|
hw = mt76_tx_status_get_hw(dev, skb);
|
|
status.sta = wcid_to_sta(wcid);
|
|
- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
|
|
- rs.rate_idx = wcid->rate;
|
|
- status.rates = &rs;
|
|
- status.n_rates = 1;
|
|
+ if (status.sta) {
|
|
+ info->status.rates[0].idx = -1;
|
|
+ status.rate = &wcid->rate;
|
|
}
|
|
+
|
|
spin_lock_bh(&dev->rx_lock);
|
|
ieee80211_tx_status_ext(hw, &status);
|
|
spin_unlock_bh(&dev->rx_lock);
|
|
diff --git a/wed.c b/wed.c
|
|
index 652f59e..1c2ad30 100644
|
|
--- a/wed.c
|
|
+++ b/wed.c
|
|
@@ -80,6 +80,7 @@ u32 mt76_wed_init_rx_buf(struct mtk_wed_device *wed, int size)
|
|
phy_addr = dma_map_single(dev->dma_dev, ptr,
|
|
wed->wlan.rx_size,
|
|
DMA_TO_DEVICE);
|
|
+
|
|
if (unlikely(dma_mapping_error(dev->dev, phy_addr))) {
|
|
skb_free_frag(ptr);
|
|
mt76_put_rxwi(dev, r);
|
|
--
|
|
2.18.0
|
|
|