ath11k: add HE support
Subsystems (2)
v7 cover ath11k: add HE support
This series adds initial support for HE mode to the ath11k driver.
Changes in V2:
* generate sband_iftype data from FW provided capabilities
* properly handle rx_status for HE frames
* fix regression in basic VHT phymode
* various minor cleanups
Changes in V3
* make the he_cap generating code future-proof
* move phymode lookup to an array
Changes in V4
* remove dependency in local patch
Changes in V5
* populate he_oper field when preparing peer assoc
* populate ppet field when preparing peer assoc
* fix 80p80 phymode when preparing peer assoc
* address review comments
Changes in V6
* use bss_conf for storing the he_oper field
* add rate reporting
Changes in V7
* fix Beamforming and Sounding Dimension fields in PHY CAP
* use fixed size for phymode array
* add ppet cap generation code
John Crispin (8):
mac80211: propagate HE operation info into bss_conf
ath11k: fix some whitespace errors
ath11k: move phymode selection from function to array lookup
ath11k: add HE handling to the debug code
ath11k: extend reading of FW capabilities
ath11k: add defines for max MCS rates per phymode
ath11k: handle rx status for HE frames
ath11k: add HE support
drivers/net/wireless/ath/ath11k/core.h | 11 +- drivers/net/wireless/ath/ath11k/debugfs_sta.c | 24 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 18 +- drivers/net/wireless/ath/ath11k/mac.c | 370 ++++++++++++++---- drivers/net/wireless/ath/ath11k/mac.h | 2 + drivers/net/wireless/ath/ath11k/reg.c | 1 + drivers/net/wireless/ath/ath11k/wmi.c | 13 +- drivers/net/wireless/ath/ath11k/wmi.h | 44 ++- include/net/mac80211.h | 2 + net/mac80211/he.c | 14 + net/mac80211/ieee80211_i.h | 4 + net/mac80211/mlme.c | 1 + 12 files changed, 402 insertions(+), 102 deletions(-)
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 1/8 mac80211: propagate HE operation info into bss_conf
Upon a successful assoc a station shall store the content of the HE operation element inside bss_conf so that the driver can setup the hardware accordingly.
--- include/net/mac80211.h | 2 ++ net/mac80211/he.c | 14 ++++++++++++++ net/mac80211/ieee80211_i.h | 4 ++++ net/mac80211/mlme.c | 1 + 4 files changed, 21 insertions(+)
include/net/mac80211.h +2 -0
@@ -599,6 +599,7 @@ struct ieee80211_ftm_responder_params {* nontransmitted BSSIDs * @profile_periodicity: the least number of beacon frames need to be received * in order to discover all the nontransmitted BSSIDs in the set. +* @he_operation: HE operation information of the AP we are connected to */ struct ieee80211_bss_conf {const u8 *bssid;
@@ -659,6 +660,7 @@ struct ieee80211_bss_conf {u8 bssid_indicator;bool ema_ap;u8 profile_periodicity; +struct ieee80211_he_operation he_operation; };/**
net/mac80211/he.c +14 -0
@@ -53,3 +53,17 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, he_cap->has_he = true; } + +void +ieee80211_he_op_ie_to_bss_conf (struct ieee80211_vif *vif, +const struct ieee80211_he_operation *he_op_ie_elem) +{ +struct ieee80211_he_operation *he_operation = + &vif->bss_conf.he_operation; + +if (!he_op_ie_elem) { +memset (he_operation,0 ,sizeof (*he_operation)); +return ; + } +memcpy (he_operation, he_op_ie_elem,sizeof (*he_operation)); +}
net/mac80211/ieee80211_i.h +4 -0
@@ -1870,6 +1870,10 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, const u8 *he_cap_ie, u8 he_cap_len, struct sta_info *sta); +void +ieee80211_he_op_ie_to_bss_conf (struct ieee80211_vif *vif, +const struct ieee80211_he_operation *he_op_ie_elem); +/* Spectrum management */ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt,
net/mac80211/mlme.c +1 -0
@@ -3364,6 +3364,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,if (elems.uora_element) bss_conf->uora_ocw_range = elems.uora_element[0 ]; +ieee80211_he_op_ie_to_bss_conf (&sdata->vif, elems.he_operation);/* TODO: OPEN: what happens if BSS color disable is set? */ }
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 2/8 ath11k: fix some whitespace errors
In reply to John CrispinMinor space vs tabs formatting error.
--- drivers/net/wireless/ath/ath11k/wmi.h | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.h +19 -19
@@ -4190,28 +4190,28 @@ struct wmi_unit_test_cmd {#define MAX_SUPPORTED_RATES 128 -#define WMI_PEER_AUTH 0x00000001 -#define WMI_PEER_QOS 0x00000002 -#define WMI_PEER_NEED_PTK_4_WAY 0x00000004 -#define WMI_PEER_NEED_GTK_2_WAY 0x00000010 -#define WMI_PEER_HE 0x00000400 -#define WMI_PEER_APSD 0x00000800 -#define WMI_PEER_HT 0x00001000 -#define WMI_PEER_40MHZ 0x00002000 -#define WMI_PEER_STBC 0x00008000 -#define WMI_PEER_LDPC 0x00010000 -#define WMI_PEER_DYN_MIMOPS 0x00020000 -#define WMI_PEER_STATIC_MIMOPS 0x00040000 -#define WMI_PEER_SPATIAL_MUX 0x00200000 -#define WMI_PEER_VHT 0x02000000 -#define WMI_PEER_80MHZ 0x04000000 -#define WMI_PEER_PMF 0x08000000 +#define WMI_PEER_AUTH 0x00000001 +#define WMI_PEER_QOS 0x00000002 +#define WMI_PEER_NEED_PTK_4_WAY 0x00000004 +#define WMI_PEER_NEED_GTK_2_WAY 0x00000010 +#define WMI_PEER_HE 0x00000400 +#define WMI_PEER_APSD 0x00000800 +#define WMI_PEER_HT 0x00001000 +#define WMI_PEER_40MHZ 0x00002000 +#define WMI_PEER_STBC 0x00008000 +#define WMI_PEER_LDPC 0x00010000 +#define WMI_PEER_DYN_MIMOPS 0x00020000 +#define WMI_PEER_STATIC_MIMOPS 0x00040000 +#define WMI_PEER_SPATIAL_MUX 0x00200000 +#define WMI_PEER_VHT 0x02000000 +#define WMI_PEER_80MHZ 0x04000000 +#define WMI_PEER_PMF 0x08000000/* TODO: Place holder for WLAN_PEER_F_PS_PRESEND_REQUIRED = 0x10000000. * Need to be cleaned up */ -#define WMI_PEER_IS_P2P_CAPABLE 0x20000000 -#define WMI_PEER_160MHZ 0x40000000 -#define WMI_PEER_SAFEMODE_EN 0x80000000 +#define WMI_PEER_IS_P2P_CAPABLE 0x20000000 +#define WMI_PEER_160MHZ 0x40000000 +#define WMI_PEER_SAFEMODE_EN 0x80000000struct beacon_tmpl_params {u8 vdev_id;
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 3/8 ath11k: move phymode selection from function to array lookup
In reply to John CrispinWith HE support getting added, the approach of using functions will quickly get convoluted. Change the code to use an array lookup function instead.
--- drivers/net/wireless/ath/ath11k/mac.c | 116 ++++++++++++-------------- drivers/net/wireless/ath/ath11k/mac.h | 2 + 2 files changed, 54 insertions(+), 64 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +52 -64
@@ -105,6 +105,52 @@ static struct ieee80211_rate ath11k_legacy_rates[] = { { .bitrate = 540, .hw_value = ATH11K_HW_RATE_OFDM_54M }, }; +static const int +ath11k_phymodes[NUM_NL80211_BANDS ][2 ][ATH11K_CHAN_WIDTH_NUM ] = { + [NL80211_BAND_2GHZ ] = { + { + [NL80211_CHAN_WIDTH_5 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_10 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_20_NOHT ] =MODE_11G , + [NL80211_CHAN_WIDTH_20 ] =MODE_11NG_HT20 , + [NL80211_CHAN_WIDTH_40 ] =MODE_11NG_HT40 , + [NL80211_CHAN_WIDTH_80 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_80P80 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_160 ] =MODE_UNKNOWN , + }, { + [NL80211_CHAN_WIDTH_5 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_10 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_20_NOHT ] =MODE_11G , + [NL80211_CHAN_WIDTH_20 ] =MODE_11AX_HE20_2G , + [NL80211_CHAN_WIDTH_40 ] =MODE_11AX_HE40_2G , + [NL80211_CHAN_WIDTH_80 ] =MODE_11AX_HE80_2G , + [NL80211_CHAN_WIDTH_80P80 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_160 ] =MODE_UNKNOWN , + }, + }, + [NL80211_BAND_5GHZ ] = { + { + [NL80211_CHAN_WIDTH_5 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_10 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_20_NOHT ] =MODE_11A , + [NL80211_CHAN_WIDTH_20 ] =MODE_11AC_VHT20 , + [NL80211_CHAN_WIDTH_40 ] =MODE_11AC_VHT40 , + [NL80211_CHAN_WIDTH_80 ] =MODE_11AC_VHT80 , + [NL80211_CHAN_WIDTH_160 ] =MODE_11AC_VHT160 , + [NL80211_CHAN_WIDTH_80P80 ] =MODE_11AC_VHT80_80 , + }, { + [NL80211_CHAN_WIDTH_5 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_10 ] =MODE_UNKNOWN , + [NL80211_CHAN_WIDTH_20_NOHT ] =MODE_11A , + [NL80211_CHAN_WIDTH_20 ] =MODE_11AX_HE20 , + [NL80211_CHAN_WIDTH_40 ] =MODE_11AX_HE40 , + [NL80211_CHAN_WIDTH_80 ] =MODE_11AX_HE80 , + [NL80211_CHAN_WIDTH_160 ] =MODE_11AX_HE160 , + [NL80211_CHAN_WIDTH_80P80 ] =MODE_11AX_HE80_80 , + }, + }, +}; +#define ATH11K_MAC_FIRST_OFDM_RATE_IDX 4#define ath11k_g_rates ath11k_legacy_rates#define ath11k_g_rates_size (ARRAY_SIZE(ath11k_legacy_rates))
@@ -151,69 +197,6 @@ static int get_num_chains(u32 mask)return num_chains; } -static inline enum wmi_phy_mode -chan_to_phymode (const struct cfg80211_chan_def *chandef) -{ -enum wmi_phy_mode phymode =MODE_UNKNOWN ; - -switch (chandef->chan->band) { -case NL80211_BAND_2GHZ : -switch (chandef->width) { -case NL80211_CHAN_WIDTH_20_NOHT : -if (chandef->chan->flags &IEEE80211_CHAN_NO_OFDM ) - phymode =MODE_11B ; -else - phymode =MODE_11G ; -break ; -case NL80211_CHAN_WIDTH_20 : - phymode =MODE_11NG_HT20 ; -break ; -case NL80211_CHAN_WIDTH_40 : - phymode =MODE_11NG_HT40 ; -break ; -case NL80211_CHAN_WIDTH_5 : -case NL80211_CHAN_WIDTH_10 : -case NL80211_CHAN_WIDTH_80 : -case NL80211_CHAN_WIDTH_80P80 : -case NL80211_CHAN_WIDTH_160 : - phymode =MODE_UNKNOWN ; -break ; - } -break ; -case NL80211_BAND_5GHZ : -switch (chandef->width) { -case NL80211_CHAN_WIDTH_20_NOHT : - phymode =MODE_11A ; -break ; -case NL80211_CHAN_WIDTH_20 : - phymode =MODE_11AC_VHT20 ; -break ; -case NL80211_CHAN_WIDTH_40 : - phymode =MODE_11AC_VHT40 ; -break ; -case NL80211_CHAN_WIDTH_80 : - phymode =MODE_11AC_VHT80 ; -break ; -case NL80211_CHAN_WIDTH_160 : - phymode =MODE_11AC_VHT160 ; -break ; -case NL80211_CHAN_WIDTH_80P80 : - phymode =MODE_11AC_VHT80_80 ; -break ; -case NL80211_CHAN_WIDTH_5 : -case NL80211_CHAN_WIDTH_10 : - phymode =MODE_UNKNOWN ; -break ; - } -break ; -default : -break ; - } - -WARN_ON (phymode ==MODE_UNKNOWN ); -return phymode; -} -u8 ath11k_mac_bitrate_to_idx (const struct ieee80211_supported_band *sband,u32 bitrate) {
@@ -4062,7 +4045,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, arg.channel.freq = chandef->chan->center_freq; arg.channel.band_center_freq1 = chandef->center_freq1; arg.channel.band_center_freq2 = chandef->center_freq2; - arg.channel.mode =chan_to_phymode (chandef); + arg.channel.mode = + ath11k_phymodes[chandef->chan->band][he_support][chandef->width]; +if (arg.channel.mode ==MODE_11G && + chandef->chan->flags &IEEE80211_CHAN_NO_OFDM ) + arg.channel.mode =MODE_11B ; +WARN_ON (arg.channel.mode ==MODE_UNKNOWN ); arg.channel.min_power =0 ; arg.channel.max_power = chandef->chan->max_power *2 ;
drivers/net/wireless/ath/ath11k/mac.h +2 -0
@@ -162,6 +162,8 @@ struct ath11k_generic_iter {#define WMI_MAX_SPATIAL_STREAM 3 +#define ATH11K_CHAN_WIDTH_NUM 8 +int ath11k_mac_create (struct ath11k_base *ab);void ath11k_mac_destroy (struct ath11k_base *ab);void ath11k_mac_unregister (struct ath11k_base *ab);
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V7 3/8] ath11k: move phymode selection from function to array lookup
Quoted 6 lines · On Monday, 3 June 2019 21:01:52 CEST John Crispin wrote:
With HE support getting added, the approach of using functions will quickly get convoluted. Change the code to use an array lookup function instead.
Signed-off-by Shashidhar Lakkavalli <[email protected]>Signed-off-by John Crispin <[email protected]>---
[...]
Quoted 4 lines
u8 ath11k_mac_bitrate_to_idx(const struct
ieee80211_supported_band*sband,drivers/net/wireless/ath/ath11k/mac.c +0
-0u32 bitrate) {
drivers/net/wireless/ath/ath11k/mac.c ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, · line 4053
Quoted 10 lines
drivers/net/wireless/ath/ath11k/mac.c +6
-1@@ -4062,7 +4045,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, arg.channel.freq = chandef->chan->center_freq; arg.channel.band_center_freq1 = chandef->center_freq1; arg.channel.band_center_freq2 = chandef->center_freq2; - arg.channel.mode =chan_to_phymode (chandef); + arg.channel.mode = + ath11k_phymodes[chandef->chan->band][he_support][chandef->width]; +if (arg.channel.mode ==MODE_11G && + chandef->chan->flags &IEEE80211_CHAN_NO_OFDM ) + arg.channel.mode =MODE_11B ; +WARN_ON (arg.channel.mode ==MODE_UNKNOWN );
What is the reason for splitting it up between HE and non-HE PHY modes? It is not like there is a split between VHT and HT PHY mode.
Kind regards,
Sven
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 4/8 ath11k: add HE handling to the debug code
In reply to John CrispinThis patch allows the driver to also show the HE counters and stats. Also extend the appropriate debug prints with HE info.
--- drivers/net/wireless/ath/ath11k/core.h | 2 ++ drivers/net/wireless/ath/ath11k/debugfs_sta.c | 24 +++++++++++++++++-- drivers/net/wireless/ath/ath11k/dp_rx.c | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +2 -0
@@ -256,6 +256,7 @@ struct ath11k_peer {struct dp_rx_tid rx_tid[IEEE80211_NUM_TIDS +1 ]; }; +#define ATH11K_HE_MCS_NUM 12#define ATH11K_VHT_MCS_NUM 10#define ATH11K_BW_NUM 4#define ATH11K_NSS_NUM 4
@@ -309,6 +310,7 @@ struct ath11k_htt_data_stats {u64 legacy[ATH11K_COUNTER_TYPE_MAX ][ATH11K_LEGACY_NUM ];u64 ht[ATH11K_COUNTER_TYPE_MAX ][ATH11K_HT_MCS_NUM ];u64 vht[ATH11K_COUNTER_TYPE_MAX ][ATH11K_VHT_MCS_NUM ]; +u64 he[ATH11K_COUNTER_TYPE_MAX ][ATH11K_HE_MCS_NUM ];u64 bw[ATH11K_COUNTER_TYPE_MAX ][ATH11K_BW_NUM ];u64 nss[ATH11K_COUNTER_TYPE_MAX ][ATH11K_NSS_NUM ];u64 gi[ATH11K_COUNTER_TYPE_MAX ][ATH11K_GI_NUM ];
drivers/net/wireless/ath/ath11k/debugfs_sta.c +22 -2
@@ -45,7 +45,14 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,#define STATS_OP_FMT (name) tx_stats->stats[ATH11K_STATS_TYPE_##name] -if (txrate->flags &RATE_INFO_FLAGS_VHT_MCS ) { +if (txrate->flags &RATE_INFO_FLAGS_HE_MCS ) { +STATS_OP_FMT (SUCC ).he[0 ][mcs] += peer_stats->succ_bytes; +STATS_OP_FMT (SUCC ).he[1 ][mcs] += peer_stats->succ_pkts; +STATS_OP_FMT (FAIL ).he[0 ][mcs] += peer_stats->failed_bytes; +STATS_OP_FMT (FAIL ).he[1 ][mcs] += peer_stats->failed_pkts; +STATS_OP_FMT (RETRY ).he[0 ][mcs] += peer_stats->retry_bytes; +STATS_OP_FMT (RETRY ).he[1 ][mcs] += peer_stats->retry_pkts; + }else if (txrate->flags &RATE_INFO_FLAGS_VHT_MCS ) {STATS_OP_FMT (SUCC ).vht[0 ][mcs] += peer_stats->succ_bytes;STATS_OP_FMT (SUCC ).vht[1 ][mcs] += peer_stats->succ_pkts;STATS_OP_FMT (FAIL ).vht[0 ][mcs] += peer_stats->failed_bytes;
@@ -73,7 +80,12 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,if (peer_stats->is_ampdu) { tx_stats->ba_fails += peer_stats->ba_fails; -if (txrate->flags &RATE_INFO_FLAGS_MCS ) { +if (txrate->flags &RATE_INFO_FLAGS_HE_MCS ) { +STATS_OP_FMT (AMPDU ).he[0 ][mcs] += + peer_stats->succ_bytes + peer_stats->retry_bytes; +STATS_OP_FMT (AMPDU ).he[1 ][mcs] += + peer_stats->succ_pkts + peer_stats->retry_pkts; + }else if (txrate->flags &RATE_INFO_FLAGS_MCS ) {STATS_OP_FMT (AMPDU ).ht[0 ][mcs] += peer_stats->succ_bytes + peer_stats->retry_bytes; STATS_OP_FMT(AMPDU).ht[1][mcs] +=
@@ -229,6 +241,14 @@ static ssize_t ath11k_dbg_sta_dump_tx_stats(struct file *file, len +=scnprintf (buf + len, size - len,"%s_%s\n" , str_name[k], str[j]); + len +=scnprintf (buf + len, size - len, +" HE MCS %s\n" , + str[j]); +for (i =0 ; i <ATH11K_HE_MCS_NUM ; i++) + len +=scnprintf (buf + len, size - len, +" %llu " , + stats->he[j][i]); + len +=scnprintf (buf + len, size - len,"\n" ); len +=scnprintf (buf + len, size - len," VHT MCS %s\n" , str[j]);
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -1
@@ -1817,7 +1817,7 @@ static void ath11k_dp_rx_deliver_msdu(struct ath11k *ar, struct napi_struct *nap status =IEEE80211_SKB_RXCB (msdu); ath11k_dbg(ar->ab, ATH11K_DBG_DATA, - "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", + "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", msdu, msdu->len, ieee80211_get_SA(hdr),
@@ -1828,6 +1828,7 @@ static void ath11k_dp_rx_deliver_msdu(struct ath11k *ar, struct napi_struct *nap (status->encoding ==RX_ENC_LEGACY ) ?"legacy" :"" , (status->encoding ==RX_ENC_HT ) ?"ht" :"" , (status->encoding ==RX_ENC_VHT ) ?"vht" :"" , + (status->encoding ==RX_ENC_HE ) ?"he" :"" , (status->bw ==RATE_INFO_BW_40 ) ?"40" :"" , (status->bw ==RATE_INFO_BW_80 ) ?"80" :"" , (status->bw == RATE_INFO_BW_160) ? "160" : "",
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 5/8 ath11k: extend reading of FW capabilities
In reply to John CrispinRead the additional mcs and extended mac capabilities field from the service ready callback and store them inside the ath11k_pdev_cap structure. This allows us to generate the sband_iftype_data dynamically.
--- drivers/net/wireless/ath/ath11k/core.h | 3 ++- drivers/net/wireless/ath/ath11k/wmi.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +2 -1
@@ -527,7 +527,7 @@ struct ath11k {struct ath11k_band_cap {u32 max_bw_supported;u32 ht_cap_info; -u32 he_cap_info; +u32 he_cap_info[2 ];u32 he_mcs;u32 he_cap_phy_info[PSOC_HOST_MAX_PHY_SIZE ];struct ath11k_ppe_threshold he_ppet;
@@ -538,6 +538,7 @@ struct ath11k_pdev_cap {u32 ampdu_density;u32 vht_cap;u32 vht_mcs; +u32 he_mcs;u32 tx_chain_mask;u32 rx_chain_mask;u32 tx_chain_mask_shift;
drivers/net/wireless/ath/ath11k/wmi.c +5 -2
@@ -327,6 +327,7 @@ static int ath11k_pull_mac_phy_cap_service_ready_ext( }else if (mac_phy_caps->supported_bands &WMI_HOST_WLAN_5G_CAP ) { pdev_cap->vht_cap = mac_phy_caps->vht_cap_info_5g; pdev_cap->vht_mcs = mac_phy_caps->vht_supp_mcs_5g; + pdev_cap->he_mcs = mac_phy_caps->he_supp_mcs_5g; pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_5g; pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_5g; }else {
@@ -349,7 +350,8 @@ static int ath11k_pull_mac_phy_cap_service_ready_ext( cap_band = &pdev_cap->band[NL80211_BAND_2GHZ ]; cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_2g; cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_2g; - cap_band->he_cap_info = mac_phy_caps->he_cap_info_2g; + cap_band->he_cap_info[0 ] = mac_phy_caps->he_cap_info_2g; + cap_band->he_cap_info[1 ] = mac_phy_caps->he_cap_info_2g_ext; cap_band->he_mcs = mac_phy_caps->he_supp_mcs_2g;memcpy (cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_2g,sizeof (u32) *PSOC_HOST_MAX_PHY_SIZE );
@@ -359,7 +361,8 @@ static int ath11k_pull_mac_phy_cap_service_ready_ext( cap_band = &pdev_cap->band[NL80211_BAND_5GHZ ]; cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; - cap_band->he_cap_info = mac_phy_caps->he_cap_info_5g; + cap_band->he_cap_info[0 ] = mac_phy_caps->he_cap_info_5g; + cap_band->he_cap_info[1 ] = mac_phy_caps->he_cap_info_5g_ext; cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g;memcpy (cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g,sizeof (u32) *PSOC_HOST_MAX_PHY_SIZE );
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 6/8 ath11k: add defines for max MCS rates per phymode
In reply to John CrispinUse defines rather than magic numbers.
--- drivers/net/wireless/ath/ath11k/core.h | 4 ++++ drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +4 -0
@@ -49,6 +49,10 @@ enum wme_ac {WME_NUM_AC }; +#define ATH11K_HT_MCS_MAX 7 +#define ATH11K_VHT_MCS_MAX 9 +#define ATH11K_HE_MCS_MAX 11 +static inline enum wme_ac ath11k_tid_to_ac (u32 tid) { return (((tid == 0) || (tid == 3)) ? WME_AC_BE :
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -2
@@ -1705,7 +1705,7 @@ static void ath11k_dp_rx_h_rate(struct ath11k *ar, void *rx_desc,break ;case RX_MSDU_START_PKT_TYPE_11N : rx_status->encoding =RX_ENC_HT ; -if (rate_mcs >7 ) { +if (rate_mcs >ATH11K_HT_MCS_MAX ) {ath11k_warn (ar->ab,"Received with invalid mcs in HT mode %d\n" , rate_mcs);break ; }
@@ -1717,7 +1717,7 @@ static void ath11k_dp_rx_h_rate(struct ath11k *ar, void *rx_desc,case RX_MSDU_START_PKT_TYPE_11AC : rx_status->encoding =RX_ENC_VHT ; rx_status->rate_idx = rate_mcs; -if (rate_mcs >9 ) { +if (rate_mcs >ATH11K_VHT_MCS_MAX ) {ath11k_warn (ar->ab,"Received with invalid mcs in VHT mode %d\n" , rate_mcs);break ; }
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 7/8 ath11k: handle rx status for HE frames
In reply to John CrispinThe case clause handling HE frames was not handled yet in the code reading the RX status. The new case is identical to VHT with the difference of the higher maximum MCS rate.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +10 -1
@@ -1727,7 +1727,16 @@ static void ath11k_dp_rx_h_rate(struct ath11k *ar, void *rx_desc, rx_status->bw =ath11k_bw_to_mac80211_bw (bw);break ;case RX_MSDU_START_PKT_TYPE_11AX : -ath11k_warn (ar->ab,"pkt_type %d not yet supported\n" , pkt_type); + rx_status->rate_idx = rate_mcs; +if (rate_mcs >ATH11K_HE_MCS_MAX ) { +ath11k_warn (ar->ab, +"Received with invalid mcs in HE mode %d\n" , + rate_mcs); +break ; + } + rx_status->encoding =RX_ENC_HE ; + rx_status->nss = nss; + rx_status->bw =ath11k_bw_to_mac80211_bw (bw);break ; } }
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v7 8/8 ath11k: add HE support
In reply to John CrispinAdd basic HE support to the driver. The sband_iftype data is generated from the capabilities read from the FW.
--- drivers/net/wireless/ath/ath11k/core.h | 2 + drivers/net/wireless/ath/ath11k/mac.c | 254 ++++++++++++++++++++++++- drivers/net/wireless/ath/ath11k/reg.c | 1 + drivers/net/wireless/ath/ath11k/wmi.c | 6 +- drivers/net/wireless/ath/ath11k/wmi.h | 6 +- 5 files changed, 259 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +2 -0
@@ -446,6 +446,8 @@ struct ath11k {struct {struct ieee80211_supported_band sbands[NUM_NL80211_BANDS ]; +struct ieee80211_sband_iftype_data + iftype[NUM_NL80211_BANDS ][NUM_NL80211_IFTYPES ]; } mac;unsigned long dev_flags;unsigned int filter_flags;
drivers/net/wireless/ath/ath11k/mac.c +246 -8
305 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/reg.c +1 -0
@@ -141,6 +141,7 @@ int ath11k_reg_update_chan_list(struct ath11k *ar)/* TODO: Set to true/false based on some condition? */ ch->allow_ht = true; ch->allow_vht = true; + ch->allow_he = true; ch->dfs_set = !!(channel->flags &IEEE80211_CHAN_RADAR );
drivers/net/wireless/ath/ath11k/wmi.c +5 -1
@@ -743,6 +743,8 @@ static void ath11k_wmi_put_wmi_channel(struct wmi_channel *chan, chan->info |=WMI_CHAN_INFO_ALLOW_HT ;if (arg->channel.allow_vht) chan->info |=WMI_CHAN_INFO_ALLOW_VHT ; +if (arg->channel.allow_he) + chan->info |=WMI_CHAN_INFO_ALLOW_HE ;if (arg->channel.ht40plus) chan->info |=WMI_CHAN_INFO_HT40_PLUS ;if (arg->channel.chan_radar)
@@ -2195,7 +2197,9 @@ int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar,if (tchan_info->is_chan_passive) chan_info->info |=WMI_CHAN_INFO_PASSIVE ; -if (tchan_info->allow_vht) +if (tchan_info->allow_he) + chan_info->info |=WMI_CHAN_INFO_ALLOW_HE ; +else if (tchan_info->allow_vht) chan_info->info |=WMI_CHAN_INFO_ALLOW_VHT ;else if (tchan_info->allow_ht) chan_info->info |=WMI_CHAN_INFO_ALLOW_HT ;
drivers/net/wireless/ath/ath11k/wmi.h +5 -1
@@ -2997,6 +2997,7 @@ struct channel_param { is_chan_passive:1, allow_ht:1, allow_vht:1, + allow_he:1, set_agile:1;u32 phy_mode;u32 cfreq1;
@@ -3892,7 +3893,10 @@ struct wmi_vdev_install_key_arg {#define WMI_MAX_SUPPORTED_RATES 128#define WMI_HOST_MAX_HECAP_PHY_SIZE 3 -#define WMI_HOST_MAX_HE_RATE_SET 1 +#define WMI_HOST_MAX_HE_RATE_SET 3 +#define WMI_HECAP_TXRX_MCS_NSS_IDX_80 0 +#define WMI_HECAP_TXRX_MCS_NSS_IDX_160 1 +#define WMI_HECAP_TXRX_MCS_NSS_IDX_80_80 2struct wmi_rate_set_arg {u32 num_rates;
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 5 lines · John Crispin
Add basic HE support to the driver. The
sband_iftypedata is generated from the capabilities read from the FW.Signed-off-by Shashidhar Lakkavalli <[email protected]>Signed-off-by John Crispin <[email protected]>
Due to reason unknown to me this had a conflict in mac.c, and annoyingly 3-way merge didn't work either. Here's the rejected hunk:
diff a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c (rejected hunks)
@@ -1470,7 +1565,14 @@ static void ath11k_peer_assoc_h_phymode(struct ath11k *ar,
switch (band) {
case NL80211_BAND_2GHZ:
- if (sta->vht_cap.vht_supported &&
+ if (sta->he_cap.has_he) {
+ if (sta->bandwidth == IEEE80211_STA_RX_BW_80)
+ phymode = MODE_11AX_HE80_2G;
+ else if (sta->bandwidth == IEEE80211_STA_RX_BW_40)
+ phymode = MODE_11AX_HE40_2G;
+ else
+ phymode = MODE_11AX_HE20_2G;
+ } else if (sta->vht_cap.vht_supported &&
!ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) {
if (sta->bandwidth == IEEE80211_STA_RX_BW_40)
phymode = MODE_11AC_VHT40_2G;
I fixed it manually in the pending branch. Please check and let me know if it's ok:
Signature · 6 lines
Kalle Valo _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Kalle Valo
AppliedQuoted 30 lines · John Crispin
This series adds initial support for HE mode to the ath11k driver.
Changes in V2:
* generatesband_iftypedata from FW provided capabilities
* properly handlerx_statusfor HE frames
* fix regression in basic VHT phymode
* various minor cleanupsChanges in V3
* make thehe_capgenerating code future-proof
* move phymode lookup to an arrayChanges in V4
* remove dependency in local patchChanges in V5
* populatehe_operfield when preparing peer assoc
* populate ppet field when preparing peer assoc
* fix 80p80 phymode when preparing peer assoc
* address review commentsChanges in V6
* usebss_conffor storing thehe_operfield
* add rate reportingChanges in V7
* fix Beamforming and Sounding Dimension fields in PHY CAP
* use fixed size for phymode array
* add ppet cap generation code
Quoted 9 lines
John Crispin (8):
mac80211: propagate HE operation info intobss_conf
ath11k: fix some whitespace errors
ath11k: move phymode selection from function to array lookup
ath11k: add HE handling to the debug code
ath11k: extend reading of FW capabilities
ath11k: add defines for max MCS rates per phymode
ath11k: handle rx status for HE frames
ath11k: add HE support
Thanks, applied manually:
1848c5fd914f NOTUPSTREAM: mac80211: propagate HE operation info into bss_conf 9e73898c16e8 ath11k: fix some whitespace errorsd13a73716991 ath11k: move phymode selection from function to array lookup b8a9b5b1c88d ath11k: add HE handling to the debug code de0fe6e2e4da ath11k: extend reading of FW capabilities 748b3fb13a55 ath11k: add defines for max MCS rates per phymode 31396b6bdbb8 ath11k: handle rx status for HE frames17aca2d9a969 ath11k: add HE support
This introduced new sparse warnings, please fix those in a followup patch:
drivers/net/wireless/ath/ath11k/mac.c:1334:83: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1334:83: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1334:83: got restricted __le16 const [usertype] rx_mcs_80p80drivers/net/wireless/ath/ath11k/mac.c:1336:83: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1336:83: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1336:83: got restricted __le16 const [usertype] tx_mcs_80p80drivers/net/wireless/ath/ath11k/mac.c:1340:73: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1340:73: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1340:73: got restricted __le16 const [usertype] rx_mcs_160drivers/net/wireless/ath/ath11k/mac.c:1342:73: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1342:73: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1342:73: got restricted __le16 const [usertype] tx_mcs_160drivers/net/wireless/ath/ath11k/mac.c:1348:72: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1348:72: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1348:72: got restricted __le16 const [usertype] rx_mcs_80drivers/net/wireless/ath/ath11k/mac.c:1350:72: warning: incorrect type in assignment (different base types)drivers/net/wireless/ath/ath11k/mac.c:1350:72: expected unsigned intdrivers/net/wireless/ath/ath11k/mac.c:1350:72: got restricted __le16 const [usertype] tx_mcs_80
Signature · 6 lines
Kalle Valo _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k