Skip to content

Commit 5883892

Browse files
LorenzoBianconinbd168
authored andcommitted
mt76: connac: add 6GHz support to mt76_connac_mcu_sta_tlv
Introduce sta_rec_he_6g_capa tlv in order configure the mcu with 6GHz capabilities. This is a preliminary patch to enable 6GHz band for mt7921 devices. Tested-by: Deren Wu <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 9b2ea8e commit 5883892

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
770770
mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif);
771771

772772
/* starec he */
773-
if (sta->he_cap.has_he)
773+
if (sta->he_cap.has_he) {
774774
mt76_connac_mcu_sta_he_tlv(skb, sta);
775+
if (band == NL80211_BAND_6GHZ &&
776+
sta_state == MT76_STA_INFO_STATE_ASSOC) {
777+
struct sta_rec_he_6g_capa *he_6g_capa;
778+
779+
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G,
780+
sizeof(*he_6g_capa));
781+
he_6g_capa = (struct sta_rec_he_6g_capa *)tlv;
782+
he_6g_capa->capa = sta->he_6ghz_capa.capa;
783+
}
784+
}
775785

776786
tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_PHY, sizeof(*phy));
777787
phy = (struct sta_rec_phy *)tlv;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ struct sta_rec_phy {
145145
u8 rsv[2];
146146
} __packed;
147147

148+
struct sta_rec_he_6g_capa {
149+
__le16 tag;
150+
__le16 len;
151+
__le16 capa;
152+
u8 rsv[2];
153+
} __packed;
154+
148155
/* wtbl_rec */
149156

150157
struct wtbl_req_hdr {
@@ -303,6 +310,7 @@ struct wtbl_raw {
303310
sizeof(struct sta_rec_vht) + \
304311
sizeof(struct sta_rec_uapsd) + \
305312
sizeof(struct sta_rec_amsdu) + \
313+
sizeof(struct sta_rec_he_6g_capa) + \
306314
sizeof(struct tlv) + \
307315
MT76_CONNAC_WTBL_UPDATE_MAX_SIZE)
308316

@@ -329,6 +337,7 @@ enum {
329337
STA_REC_MUEDCA,
330338
STA_REC_BFEE,
331339
STA_REC_PHY = 0x15,
340+
STA_REC_HE_6G = 0x17,
332341
STA_REC_MAX_NUM
333342
};
334343

0 commit comments

Comments
 (0)