Commit e9eac4eb authored by Deren Wu's avatar Deren Wu Committed by Felix Fietkau

wifi: mt76: connac: add eht support for phy mode config

Add eht configuration support in existing function
mt76_connac_get_phy_mode_v2() and export it for mt7925.

This is a preliminary patch to support mt7925 driver.
Co-developed-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent d3d7f57e
...@@ -780,19 +780,21 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) ...@@ -780,19 +780,21 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
} }
EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_he_tlv_v2); EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_he_tlv_v2);
static u8 u8
mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
enum nl80211_band band, struct ieee80211_sta *sta) enum nl80211_band band, struct ieee80211_sta *sta)
{ {
struct ieee80211_sta_ht_cap *ht_cap; struct ieee80211_sta_ht_cap *ht_cap;
struct ieee80211_sta_vht_cap *vht_cap; struct ieee80211_sta_vht_cap *vht_cap;
const struct ieee80211_sta_he_cap *he_cap; const struct ieee80211_sta_he_cap *he_cap;
const struct ieee80211_sta_eht_cap *eht_cap;
u8 mode = 0; u8 mode = 0;
if (sta) { if (sta) {
ht_cap = &sta->deflink.ht_cap; ht_cap = &sta->deflink.ht_cap;
vht_cap = &sta->deflink.vht_cap; vht_cap = &sta->deflink.vht_cap;
he_cap = &sta->deflink.he_cap; he_cap = &sta->deflink.he_cap;
eht_cap = &sta->deflink.eht_cap;
} else { } else {
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
...@@ -800,6 +802,7 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, ...@@ -800,6 +802,7 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
ht_cap = &sband->ht_cap; ht_cap = &sband->ht_cap;
vht_cap = &sband->vht_cap; vht_cap = &sband->vht_cap;
he_cap = ieee80211_get_he_iftype_cap(sband, vif->type); 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) { if (band == NL80211_BAND_2GHZ) {
...@@ -810,6 +813,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, ...@@ -810,6 +813,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
if (he_cap && he_cap->has_he) if (he_cap && he_cap->has_he)
mode |= PHY_TYPE_BIT_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) { } else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) {
mode |= PHY_TYPE_BIT_OFDM; mode |= PHY_TYPE_BIT_OFDM;
...@@ -821,10 +827,14 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, ...@@ -821,10 +827,14 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
if (he_cap && he_cap->has_he) if (he_cap && he_cap->has_he)
mode |= PHY_TYPE_BIT_HE; mode |= PHY_TYPE_BIT_HE;
if (eht_cap && eht_cap->has_eht)
mode |= PHY_TYPE_BIT_BE;
} }
return mode; return mode;
} }
EXPORT_SYMBOL_GPL(mt76_connac_get_phy_mode_v2);
void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
......
...@@ -919,6 +919,7 @@ enum { ...@@ -919,6 +919,7 @@ enum {
PHY_TYPE_HT_INDEX, PHY_TYPE_HT_INDEX,
PHY_TYPE_VHT_INDEX, PHY_TYPE_VHT_INDEX,
PHY_TYPE_HE_INDEX, PHY_TYPE_HE_INDEX,
PHY_TYPE_BE_INDEX,
PHY_TYPE_INDEX_NUM PHY_TYPE_INDEX_NUM
}; };
...@@ -928,6 +929,7 @@ enum { ...@@ -928,6 +929,7 @@ enum {
#define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) #define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX)
#define PHY_TYPE_BIT_VHT BIT(PHY_TYPE_VHT_INDEX) #define PHY_TYPE_BIT_VHT BIT(PHY_TYPE_VHT_INDEX)
#define PHY_TYPE_BIT_HE BIT(PHY_TYPE_HE_INDEX) #define PHY_TYPE_BIT_HE BIT(PHY_TYPE_HE_INDEX)
#define PHY_TYPE_BIT_BE BIT(PHY_TYPE_BE_INDEX)
#define MT_WTBL_RATE_TX_MODE GENMASK(9, 6) #define MT_WTBL_RATE_TX_MODE GENMASK(9, 6)
#define MT_WTBL_RATE_MCS GENMASK(5, 0) #define MT_WTBL_RATE_MCS GENMASK(5, 0)
...@@ -1808,6 +1810,8 @@ int mt76_connac_mcu_sta_update_hdr_trans(struct mt76_dev *dev, ...@@ -1808,6 +1810,8 @@ int mt76_connac_mcu_sta_update_hdr_trans(struct mt76_dev *dev,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct mt76_wcid *wcid, int cmd); struct mt76_wcid *wcid, int cmd);
void mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta); void mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta);
u8 mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
enum nl80211_band band, struct ieee80211_sta *sta);
int mt76_connac_mcu_wtbl_update_hdr_trans(struct mt76_dev *dev, int mt76_connac_mcu_wtbl_update_hdr_trans(struct mt76_dev *dev,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta); struct ieee80211_sta *sta);
......
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