wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band

Driver should configure basic rate and phy mode for SAP mode.

Fixes: c948b5da6b ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: rong.yan <rong.yan@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
rong.yan
2023-12-29 11:09:29 +08:00
committed by Felix Fietkau
parent 479146078a
commit 243cecc857
3 changed files with 15 additions and 4 deletions

View File

@@ -935,6 +935,9 @@ enum {
PHY_TYPE_INDEX_NUM
};
#define HR_DSSS_ERP_BASIC_RATE GENMASK(3, 0)
#define OFDM_BASIC_RATE (BIT(6) | BIT(8) | BIT(10))
#define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX)
#define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX)
#define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX)

View File

@@ -2047,9 +2047,9 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
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;
u8 idx, basic_phy;
struct tlv *tlv;
int conn_type;
u8 idx;
tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_BASIC, sizeof(*basic_req));
basic_req = (struct mt76_connac_bss_basic_tlv *)tlv;
@@ -2060,8 +2060,10 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band, sta);
basic_phy = mt76_connac_get_phy_mode_v2(phy, vif, band, sta);
basic_req->nonht_basic_phy = cpu_to_le16(basic_phy);
if (band == NL80211_BAND_2GHZ)
basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_ERP_INDEX);
else
basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_OFDM_INDEX);
memcpy(basic_req->bssid, vif->bss_conf.bssid, ETH_ALEN);
basic_req->phymode = mt76_connac_get_phy_mode(phy, vif, band, sta);
@@ -2165,6 +2167,11 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy,
bmc = (struct bss_rate_tlv *)tlv;
if (band == NL80211_BAND_2GHZ)
bmc->basic_rate = cpu_to_le16(HR_DSSS_ERP_BASIC_RATE);
else
bmc->basic_rate = cpu_to_le16(OFDM_BASIC_RATE);
bmc->short_preamble = (band == NL80211_BAND_2GHZ);
bmc->bc_fixed_rate = idx;
bmc->mc_fixed_rate = idx;

View File

@@ -334,7 +334,8 @@ struct bss_req_hdr {
struct bss_rate_tlv {
__le16 tag;
__le16 len;
u8 __rsv1[4];
u8 __rsv1[2];
__le16 basic_rate;
__le16 bc_trans;
__le16 mc_trans;
u8 short_preamble;