2023-04-13 21:55:57

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH v3 00/11] wifi: ath12k: (v3) EHT support

Add driver support to bring AP up in EHT mode, configure a preamble
puncturing bitmap and associate with an EHT client.

v3: Modified patches 6 and 9 to fix some issues,
changelog included in the respective patches.
v2: This version modifies only few commit descriptions,
changelog included in the respective patches.

Following list gives the details for each patch.
1-4: Propagation of EHT capabilities from target to userspace.
Patches 1, 2 refactor the existing code to make EHT additions easier.
5: Addition of EHT phy modes.
6-9: EHT related additions in peer association.
10: Process the new WMI service ready ext2 event.
11: Preamble puncturing support.

Aloka Dixit (9):
wifi: ath12k: rename HE capabilities setup/copy functions
wifi: ath12k: move HE capabilities processing to a new function
wifi: ath12k: process EHT capabilities
wifi: ath12k: propagate EHT capabilities to userspace
wifi: ath12k: prepare EHT peer assoc parameters
wifi: ath12k: add WMI support for EHT peer
wifi: ath12k: peer assoc for 320 MHz
wifi: ath12k: parse WMI service ready ext2 event
wifi: ath12k: configure puncturing bitmap

Muna Sinada (1):
wifi: ath12k: add EHT PHY modes

Pradeep Kumar Chitrapu (1):
wifi: ath12k: add MLO header in peer association

drivers/net/wireless/ath/ath12k/core.h | 9 +
drivers/net/wireless/ath/ath12k/mac.c | 555 ++++++++++++++++++++-----
drivers/net/wireless/ath/ath12k/mac.h | 2 +-
drivers/net/wireless/ath/ath12k/wmi.c | 218 +++++++++-
drivers/net/wireless/ath/ath12k/wmi.h | 116 +++++-
5 files changed, 790 insertions(+), 110 deletions(-)


base-commit: 177555b57ca0a0519c12a2bdb64309ddbb363e11
--
2.39.0


2023-04-13 21:56:01

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH v3 08/11] wifi: ath12k: peer assoc for 320 MHz

Add required peer association definitions and processing if the
bandwidth is 320 MHz.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aloka Dixit <[email protected]>
Signed-off-by: Pradeep Kumar Chitrapu<[email protected]>
---
v3: No change from v2.
v2: No change from v1.

drivers/net/wireless/ath/ath12k/wmi.c | 2 ++
drivers/net/wireless/ath/ath12k/wmi.h | 2 ++
2 files changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index f81724260b9b..e5513e979d78 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -1808,6 +1808,8 @@ static void ath12k_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd,
cmd->peer_flags |= cpu_to_le32(WMI_PEER_80MHZ);
if (arg->bw_160)
cmd->peer_flags |= cpu_to_le32(WMI_PEER_160MHZ);
+ if (arg->bw_320)
+ cmd->peer_flags |= cpu_to_le32(WMI_PEER_EXT_320MHZ);

/* Typically if STBC is enabled for VHT it should be enabled
* for HT as well
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index c2c340af3612..f348ea9e325d 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -1169,6 +1169,7 @@ enum wmi_tlv_peer_flags {

enum wmi_tlv_peer_flags_ext {
WMI_PEER_EXT_EHT = 0x00000001,
+ WMI_PEER_EXT_320MHZ = 0x00000002,
};

/** Enum list of TLV Tags for each parameter structure type. */
@@ -3549,6 +3550,7 @@ struct ath12k_wmi_peer_assoc_arg {
bool bw_40;
bool bw_80;
bool bw_160;
+ bool bw_320;
bool stbc_flag;
bool ldpc_flag;
bool static_mimops_flag;
--
2.39.0

2023-04-13 21:56:13

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH v3 07/11] wifi: ath12k: add WMI support for EHT peer

Add new WMI tag and pass the EHT parameters for peer association
to firmware.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aloka Dixit <[email protected]>
Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
---
v3: No change from v2.
v2: No change from v1.

drivers/net/wireless/ath/ath12k/wmi.c | 40 +++++++++++++++++++++++++--
drivers/net/wireless/ath/ath12k/wmi.h | 20 ++++++++++++++
2 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 2d3094ec19c0..f81724260b9b 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -1793,6 +1793,7 @@ static void ath12k_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd,
bool hw_crypto_disabled)
{
cmd->peer_flags = 0;
+ cmd->peer_flags_ext = 0;

if (arg->is_wme_set) {
if (arg->qos_flag)
@@ -1834,6 +1835,8 @@ static void ath12k_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd,
cmd->peer_flags |= cpu_to_le32(WMI_PEER_TWT_REQ);
if (arg->twt_responder)
cmd->peer_flags |= cpu_to_le32(WMI_PEER_TWT_RESP);
+ if (arg->eht_flag)
+ cmd->peer_flags_ext |= cpu_to_le32(WMI_PEER_EXT_EHT);
}

/* Suppress authorization for all AUTH modes that need 4-way handshake
@@ -1878,6 +1881,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
struct wmi_peer_assoc_complete_cmd *cmd;
struct ath12k_wmi_vht_rate_set_params *mcs;
struct ath12k_wmi_he_rate_set_params *he_mcs;
+ struct ath12k_wmi_eht_rate_set_params *eht_mcs;
struct sk_buff *skb;
struct wmi_tlv *tlv;
void *ptr;
@@ -1894,7 +1898,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
TLV_HDR_SIZE + (peer_legacy_rates_align * sizeof(u8)) +
TLV_HDR_SIZE + (peer_ht_rates_align * sizeof(u8)) +
sizeof(*mcs) + TLV_HDR_SIZE +
- (sizeof(*he_mcs) * arg->peer_he_mcs_count);
+ (sizeof(*he_mcs) * arg->peer_he_mcs_count) +
+ TLV_HDR_SIZE + (sizeof(*eht_mcs) * arg->peer_eht_mcs_count);

skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len);
if (!skb)
@@ -1941,6 +1946,16 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
cmd->peer_ppet.ppet16_ppet8_ru3_ru0[i] =
cpu_to_le32(arg->peer_ppet.ppet16_ppet8_ru3_ru0[i]);

+ /* Update 11be capabilities */
+ memcpy_and_pad(cmd->peer_eht_cap_mac, sizeof(cmd->peer_eht_cap_mac),
+ arg->peer_eht_cap_mac, sizeof(arg->peer_eht_cap_mac),
+ 0);
+ memcpy_and_pad(cmd->peer_eht_cap_phy, sizeof(cmd->peer_eht_cap_phy),
+ arg->peer_eht_cap_phy, sizeof(arg->peer_eht_cap_phy),
+ 0);
+ memcpy_and_pad(&cmd->peer_eht_ppet, sizeof(cmd->peer_eht_ppet),
+ &arg->peer_eht_ppet, sizeof(arg->peer_eht_ppet), 0);
+
/* Update peer legacy rate information */
ptr += sizeof(*cmd);

@@ -2007,8 +2022,24 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
ptr += sizeof(*he_mcs);
}

+ /* Loop through the EHT rate set */
+ len = arg->peer_eht_mcs_count * sizeof(*eht_mcs);
+ tlv = ptr;
+ tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len);
+ ptr += TLV_HDR_SIZE;
+
+ for (i = 0; i < arg->peer_eht_mcs_count; i++) {
+ eht_mcs = ptr;
+ eht_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET,
+ sizeof(*eht_mcs));
+
+ eht_mcs->rx_mcs_set = cpu_to_le32(arg->peer_eht_rx_mcs_set[i]);
+ eht_mcs->tx_mcs_set = cpu_to_le32(arg->peer_eht_tx_mcs_set[i]);
+ ptr += sizeof(*eht_mcs);
+ }
+
ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
- "wmi peer assoc vdev id %d assoc id %d peer mac %pM peer_flags %x rate_caps %x peer_caps %x listen_intval %d ht_caps %x max_mpdu %d nss %d phymode %d peer_mpdu_density %d vht_caps %x he cap_info %x he ops %x he cap_info_ext %x he phy %x %x %x peer_bw_rxnss_override %x\n",
+ "wmi peer assoc vdev id %d assoc id %d peer mac %pM peer_flags %x rate_caps %x peer_caps %x listen_intval %d ht_caps %x max_mpdu %d nss %d phymode %d peer_mpdu_density %d vht_caps %x he cap_info %x he ops %x he cap_info_ext %x he phy %x %x %x peer_bw_rxnss_override %x peer_flags_ext %x eht mac_cap %x %x eht phy_cap %x %x %x\n",
cmd->vdev_id, cmd->peer_associd, arg->peer_mac,
cmd->peer_flags, cmd->peer_rate_caps, cmd->peer_caps,
cmd->peer_listen_intval, cmd->peer_ht_caps,
@@ -2018,7 +2049,10 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
cmd->peer_he_ops, cmd->peer_he_cap_info_ext,
cmd->peer_he_cap_phy[0], cmd->peer_he_cap_phy[1],
cmd->peer_he_cap_phy[2],
- cmd->peer_bw_rxnss_override);
+ cmd->peer_bw_rxnss_override, cmd->peer_flags_ext,
+ cmd->peer_eht_cap_mac[0], cmd->peer_eht_cap_mac[1],
+ cmd->peer_eht_cap_phy[0], cmd->peer_eht_cap_phy[1],
+ cmd->peer_eht_cap_phy[2]);

ret = ath12k_wmi_cmd_send(wmi, skb, WMI_PEER_ASSOC_CMDID);
if (ret) {
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index 12fedcf2c8b4..c2c340af3612 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -1167,6 +1167,10 @@ enum wmi_tlv_peer_flags {

};

+enum wmi_tlv_peer_flags_ext {
+ WMI_PEER_EXT_EHT = 0x00000001,
+};
+
/** Enum list of TLV Tags for each parameter structure type. */
enum wmi_tlv_tag {
WMI_TAG_LAST_RESERVED = 15,
@@ -1924,6 +1928,7 @@ enum wmi_tlv_tag {
WMI_TAG_MAC_PHY_CAPABILITIES_EXT = 0x36F,
WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9,
WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT,
+ WMI_TAG_EHT_RATE_SET = 0x3C4,
WMI_TAG_MAX
};

@@ -3609,6 +3614,15 @@ struct wmi_peer_assoc_complete_cmd {
__le32 peer_he_cap_info_internal;
__le32 min_data_rate;
__le32 peer_he_caps_6ghz;
+ __le32 sta_type;
+ __le32 bss_max_idle_option;
+ __le32 auth_mode;
+ __le32 peer_flags_ext;
+ __le32 puncture_20mhz_bitmap;
+ __le32 peer_eht_cap_mac[WMI_MAX_EHTCAP_MAC_SIZE];
+ __le32 peer_eht_cap_phy[WMI_MAX_EHTCAP_PHY_SIZE];
+ __le32 peer_eht_ops;
+ struct ath12k_wmi_ppe_threshold_params peer_eht_ppet;
} __packed;

struct wmi_stop_scan_cmd {
@@ -3836,6 +3850,12 @@ struct ath12k_wmi_he_rate_set_params {
__le32 tx_mcs_set;
} __packed;

+struct ath12k_wmi_eht_rate_set_params {
+ __le32 tlv_header;
+ __le32 rx_mcs_set;
+ __le32 tx_mcs_set;
+} __packed;
+
#define MAX_REG_RULES 10
#define REG_ALPHA2_LEN 2
#define MAX_6G_REG_RULES 5
--
2.39.0

2023-04-13 21:56:39

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH v3 10/11] wifi: ath12k: parse WMI service ready ext2 event

Parse WMI service ready ext2 event.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aloka Dixit <[email protected]>
---
v3: No change from v2.
v2: No change from v1.

drivers/net/wireless/ath/ath12k/wmi.c | 48 +++++++++++++++++++++++++++
drivers/net/wireless/ath/ath12k/wmi.h | 16 +++++++++
2 files changed, 64 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 0328ee3de019..a4e85f376a70 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -62,7 +62,23 @@ struct ath12k_wmi_svc_rdy_ext_parse {
bool dma_ring_cap_done;
};

+struct ath12k_wmi_svc_rdy_ext2_arg {
+ u32 reg_db_version;
+ u32 hw_min_max_tx_power_2ghz;
+ u32 hw_min_max_tx_power_5ghz;
+ u32 chwidth_num_peer_caps;
+ u32 preamble_puncture_bw;
+ u32 max_user_per_ppdu_ofdma;
+ u32 max_user_per_ppdu_mumimo;
+ u32 target_cap_flags;
+ u32 eht_cap_mac_info[WMI_MAX_EHTCAP_MAC_SIZE];
+ u32 max_num_linkview_peers;
+ u32 max_num_msduq_supported_per_tid;
+ u32 default_num_msduq_supported_per_tid;
+};
+
struct ath12k_wmi_svc_rdy_ext2_parse {
+ struct ath12k_wmi_svc_rdy_ext2_arg arg;
struct ath12k_wmi_dma_ring_caps_parse dma_caps_parse;
bool dma_ring_cap_done;
bool spectral_bin_scaling_done;
@@ -4085,6 +4101,26 @@ static int ath12k_service_ready_ext_event(struct ath12k_base *ab,
return ret;
}

+static int ath12k_pull_svc_ready_ext2(struct ath12k_wmi_pdev *wmi_handle,
+ const void *ptr,
+ struct ath12k_wmi_svc_rdy_ext2_arg *arg)
+{
+ const struct wmi_service_ready_ext2_event *ev = ptr;
+
+ if (!ev)
+ return -EINVAL;
+
+ arg->reg_db_version = le32_to_cpu(ev->reg_db_version);
+ arg->hw_min_max_tx_power_2ghz = le32_to_cpu(ev->hw_min_max_tx_power_2ghz);
+ arg->hw_min_max_tx_power_5ghz = le32_to_cpu(ev->hw_min_max_tx_power_5ghz);
+ arg->chwidth_num_peer_caps = le32_to_cpu(ev->chwidth_num_peer_caps);
+ arg->preamble_puncture_bw = le32_to_cpu(ev->preamble_puncture_bw);
+ arg->max_user_per_ppdu_ofdma = le32_to_cpu(ev->max_user_per_ppdu_ofdma);
+ arg->max_user_per_ppdu_mumimo = le32_to_cpu(ev->max_user_per_ppdu_mumimo);
+ arg->target_cap_flags = le32_to_cpu(ev->target_cap_flags);
+ return 0;
+}
+
static void ath12k_wmi_eht_caps_parse(struct ath12k_pdev *pdev, u32 band,
__le32 cap_mac_info[],
__le32 cap_phy_info[],
@@ -4184,10 +4220,22 @@ static int ath12k_wmi_svc_rdy_ext2_parse(struct ath12k_base *ab,
u16 tag, u16 len,
const void *ptr, void *data)
{
+ struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0];
struct ath12k_wmi_svc_rdy_ext2_parse *parse = data;
int ret;

switch (tag) {
+ case WMI_TAG_SERVICE_READY_EXT2_EVENT:
+ ret = ath12k_pull_svc_ready_ext2(wmi_handle, ptr,
+ &parse->arg);
+ if (ret) {
+ ath12k_warn(ab,
+ "failed to extract wmi service ready ext2 parameters: %d\n",
+ ret);
+ return ret;
+ }
+ break;
+
case WMI_TAG_ARRAY_STRUCT:
if (!parse->dma_ring_cap_done) {
ret = ath12k_wmi_dma_ring_caps(ab, len, ptr,
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index f348ea9e325d..d457a087dc39 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -1925,6 +1925,7 @@ enum wmi_tlv_tag {
/* TODO add all the missing cmds */
WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301,
WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO,
+ WMI_TAG_SERVICE_READY_EXT2_EVENT = 0x334,
WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344,
WMI_TAG_MAC_PHY_CAPABILITIES_EXT = 0x36F,
WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9,
@@ -2608,6 +2609,21 @@ struct ath12k_wmi_soc_hal_reg_caps_params {
#define WMI_EHT_MCS_NSS_10_11 GENMASK(11, 8)
#define WMI_EHT_MCS_NSS_12_13 GENMASK(15, 12)

+struct wmi_service_ready_ext2_event {
+ __le32 reg_db_version;
+ __le32 hw_min_max_tx_power_2ghz;
+ __le32 hw_min_max_tx_power_5ghz;
+ __le32 chwidth_num_peer_caps;
+ __le32 preamble_puncture_bw;
+ __le32 max_user_per_ppdu_ofdma;
+ __le32 max_user_per_ppdu_mumimo;
+ __le32 target_cap_flags;
+ __le32 eht_cap_mac_info[WMI_MAX_EHTCAP_MAC_SIZE];
+ __le32 max_num_linkview_peers;
+ __le32 max_num_msduq_supported_per_tid;
+ __le32 default_num_msduq_supported_per_tid;
+} __packed;
+
struct ath12k_wmi_mac_phy_caps_ext_params {
__le32 hw_mode_id;
union {
--
2.39.0

2023-04-13 21:56:50

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH v3 11/11] wifi: ath12k: configure puncturing bitmap

Enable the feature flag to indicate the driver support for
preamble puncturing. Firmware will support this feature
by default from IEEE 802.11be onwards.
Configure the bitmap as part of VDEV start/restart and
peer association commands.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aloka Dixit <[email protected]>
Signed-off-by: Muna Sinada <[email protected]>
---
v3: No change from v2.
v2: No change from v1.

drivers/net/wireless/ath/ath12k/core.h | 1 +
drivers/net/wireless/ath/ath12k/mac.c | 16 ++++++++++++++--
drivers/net/wireless/ath/ath12k/wmi.c | 2 ++
drivers/net/wireless/ath/ath12k/wmi.h | 12 +++++++++++-
4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index ed21dd78a2b9..e4287add2bcd 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -238,6 +238,7 @@ struct ath12k_vif {
u32 key_cipher;
u8 tx_encap_type;
u8 vdev_stats_id;
+ u32 punct_bitmap;
};

struct ath12k_vif_iter {
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 06abd7786eb8..865de31f2813 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -839,6 +839,7 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id,

arg.pref_tx_streams = ar->num_tx_chains;
arg.pref_rx_streams = ar->num_rx_chains;
+ arg.punct_bitmap = 0xFFFFFFFF;

arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);

@@ -2138,6 +2139,7 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
{
const struct ieee80211_sta_eht_cap *eht_cap = &sta->deflink.eht_cap;
const struct ieee80211_eht_mcs_nss_supp_bw *bw;
+ struct ath12k_vif *arvif = (struct ath12k_vif *)vif->drv_priv;
u32 *rx_mcs, *tx_mcs;

if (!sta->deflink.he_cap.has_he || !eht_cap->has_eht)
@@ -2202,6 +2204,8 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
arg->peer_eht_mcs_count++;
break;
}
+
+ arg->punct_bitmap = ~arvif->punct_bitmap;
}

static void ath12k_peer_assoc_prepare(struct ath12k *ar,
@@ -2755,6 +2759,9 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP)
ath12k_mac_fils_discovery(arvif, info);

+ if (changed & BSS_CHANGED_EHT_PUNCTURING)
+ arvif->punct_bitmap = info->eht_puncturing;
+
mutex_unlock(&ar->conf_mutex);
}

@@ -5783,6 +5790,7 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
arg.vdev_id = arvif->vdev_id;
arg.dtim_period = arvif->dtim_period;
arg.bcn_intval = arvif->beacon_interval;
+ arg.punct_bitmap = ~arvif->punct_bitmap;

arg.freq = chandef->chan->center_freq;
arg.band_center_freq1 = chandef->center_freq1;
@@ -5825,9 +5833,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);

ath12k_dbg(ab, ATH12K_DBG_MAC,
- "mac vdev %d start center_freq %d phymode %s\n",
+ "mac vdev %d start center_freq %d phymode %s punct_bitmap 0x%x\n",
arg.vdev_id, arg.freq,
- ath12k_mac_phymode_str(arg.mode));
+ ath12k_mac_phymode_str(arg.mode), arg.punct_bitmap);

ret = ath12k_wmi_vdev_start(ar, &arg, restart);
if (ret) {
@@ -6154,6 +6162,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
"mac chanctx assign ptr %pK vdev_id %i\n",
ctx, arvif->vdev_id);

+ arvif->punct_bitmap = link_conf->eht_puncturing;
+
/* for some targets bss peer must be created before vdev_start */
if (ab->hw_params->vdev_start_delay &&
arvif->vdev_type != WMI_VDEV_TYPE_AP &&
@@ -7254,6 +7264,8 @@ static int __ath12k_mac_register(struct ath12k *ar)
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP);
}

+ wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_PUNCT);
+
ath12k_reg_init(ar);

if (!test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags)) {
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index a4e85f376a70..b3fce1327573 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -1013,6 +1013,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg,
cmd->cac_duration_ms = cpu_to_le32(arg->cac_duration_ms);
cmd->regdomain = cpu_to_le32(arg->regdomain);
cmd->he_ops = cpu_to_le32(arg->he_ops);
+ cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap);

if (!restart) {
if (arg->ssid) {
@@ -1934,6 +1935,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,

cmd->peer_new_assoc = cpu_to_le32(arg->peer_new_assoc);
cmd->peer_associd = cpu_to_le32(arg->peer_associd);
+ cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap);

ath12k_wmi_copy_peer_flags(cmd, arg,
test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED,
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index d457a087dc39..f791534f1f6f 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -2771,6 +2771,11 @@ struct wmi_vdev_start_request_cmd {
__le32 he_ops;
__le32 cac_duration_ms;
__le32 regdomain;
+ __le32 min_data_rate;
+ __le32 mbssid_flags;
+ __le32 mbssid_tx_vdev_id;
+ __le32 eht_ops;
+ __le32 punct_bitmap;
} __packed;

#define MGMT_TX_DL_FRM_LEN 64
@@ -2870,6 +2875,10 @@ struct wmi_vdev_start_req_arg {
u32 pref_rx_streams;
u32 pref_tx_streams;
u32 num_noa_descriptors;
+ u32 min_data_rate;
+ u32 mbssid_flags;
+ u32 mbssid_tx_vdev_id;
+ u32 punct_bitmap;
};

struct ath12k_wmi_peer_create_arg {
@@ -3601,6 +3610,7 @@ struct ath12k_wmi_peer_assoc_arg {
u32 peer_eht_rx_mcs_set[WMI_MAX_EHTCAP_RATE_SET];
u32 peer_eht_tx_mcs_set[WMI_MAX_EHTCAP_RATE_SET];
struct ath12k_wmi_ppe_threshold_arg peer_eht_ppet;
+ u32 punct_bitmap;
};

struct wmi_peer_assoc_complete_cmd {
@@ -3636,7 +3646,7 @@ struct wmi_peer_assoc_complete_cmd {
__le32 bss_max_idle_option;
__le32 auth_mode;
__le32 peer_flags_ext;
- __le32 puncture_20mhz_bitmap;
+ __le32 punct_bitmap;
__le32 peer_eht_cap_mac[WMI_MAX_EHTCAP_MAC_SIZE];
__le32 peer_eht_cap_phy[WMI_MAX_EHTCAP_PHY_SIZE];
__le32 peer_eht_ops;
--
2.39.0

2023-04-26 06:10:49

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v3 00/11] wifi: ath12k: (v3) EHT support

Aloka Dixit <[email protected]> writes:

> Add driver support to bring AP up in EHT mode, configure a preamble
> puncturing bitmap and associate with an EHT client.
>
> v3: Modified patches 6 and 9 to fix some issues,
> changelog included in the respective patches.
> v2: This version modifies only few commit descriptions,
> changelog included in the respective patches.
>
> Following list gives the details for each patch.
> 1-4: Propagation of EHT capabilities from target to userspace.
> Patches 1, 2 refactor the existing code to make EHT additions easier.
> 5: Addition of EHT phy modes.
> 6-9: EHT related additions in peer association.
> 10: Process the new WMI service ready ext2 event.
> 11: Preamble puncturing support.
>
> Aloka Dixit (9):
> wifi: ath12k: rename HE capabilities setup/copy functions
> wifi: ath12k: move HE capabilities processing to a new function
> wifi: ath12k: process EHT capabilities
> wifi: ath12k: propagate EHT capabilities to userspace
> wifi: ath12k: prepare EHT peer assoc parameters
> wifi: ath12k: add WMI support for EHT peer
> wifi: ath12k: peer assoc for 320 MHz
> wifi: ath12k: parse WMI service ready ext2 event
> wifi: ath12k: configure puncturing bitmap
>
> Muna Sinada (1):
> wifi: ath12k: add EHT PHY modes
>
> Pradeep Kumar Chitrapu (1):
> wifi: ath12k: add MLO header in peer association

This breaks WCN7850 support:

[ 144.039164] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xda200000-0xda3fffff 64bit]
[ 144.039315] ath12k_pci 0000:06:00.0: enabling device (0000 -> 0002)
[ 144.046220] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
[ 144.118539] mhi mhi0: Requested to power ON
[ 144.118716] mhi mhi0: Power on setup success
[ 144.222303] mhi mhi0: Wait for device to enter SBL or Mission mode
[ 144.627712] ath12k_pci 0000:06:00.0: chip_id 0x2 chip_family 0x4 board_id 0x104 soc_id 0x40170200
[ 144.627945] ath12k_pci 0000:06:00.0: fw_version 0x1005bc12 fw_build_timestamp 2022-10-11 12:13 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
[ 144.959196] ath12k_pci 0000:06:00.0: failed to parse tlv -22
[ 144.959317] ath12k_pci 0000:06:00.0: failed to parse ext2 event tlv -22
[ 150.263567] ath12k_pci 0000:06:00.0: failed to receive wmi service ready event: -110
[ 150.276547] ath12k_pci 0000:06:00.0: failed to start core: -110

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2023-04-26 16:56:23

by Aloka Dixit

[permalink] [raw]
Subject: Re: [PATCH v3 00/11] wifi: ath12k: (v3) EHT support

On 4/25/2023 11:03 PM, Kalle Valo wrote:
> Aloka Dixit <[email protected]> writes:
>
>> Add driver support to bring AP up in EHT mode, configure a preamble
>> puncturing bitmap and associate with an EHT client.
>>
>> v3: Modified patches 6 and 9 to fix some issues,
>> changelog included in the respective patches.
>> v2: This version modifies only few commit descriptions,
>> changelog included in the respective patches.
>>
> This breaks WCN7850 support:
>
> [ 144.039164] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xda200000-0xda3fffff 64bit]
> [ 144.039315] ath12k_pci 0000:06:00.0: enabling device (0000 -> 0002)
> [ 144.046220] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
> [ 144.118539] mhi mhi0: Requested to power ON
> [ 144.118716] mhi mhi0: Power on setup success
> [ 144.222303] mhi mhi0: Wait for device to enter SBL or Mission mode
> [ 144.627712] ath12k_pci 0000:06:00.0: chip_id 0x2 chip_family 0x4 board_id 0x104 soc_id 0x40170200
> [ 144.627945] ath12k_pci 0000:06:00.0: fw_version 0x1005bc12 fw_build_timestamp 2022-10-11 12:13 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
> [ 144.959196] ath12k_pci 0000:06:00.0: failed to parse tlv -22
> [ 144.959317] ath12k_pci 0000:06:00.0: failed to parse ext2 event tlv -22
> [ 150.263567] ath12k_pci 0000:06:00.0: failed to receive wmi service ready event: -110
> [ 150.276547] ath12k_pci 0000:06:00.0: failed to start core: -110
>

I have started seeing ETIMEDOUT on QCN9274 as well, AP bring up fails in
vdev sync. It works if the sync timeout is increased.

2023-04-28 22:03:05

by Aloka Dixit

[permalink] [raw]
Subject: Re: [PATCH v3 00/11] wifi: ath12k: (v3) EHT support

On 4/26/2023 9:49 AM, Aloka Dixit wrote:
> On 4/25/2023 11:03 PM, Kalle Valo wrote:
>> Aloka Dixit <[email protected]> writes:
>>
>>> Add driver support to bring AP up in EHT mode, configure a preamble
>>> puncturing bitmap and associate with an EHT client.
>>>
>>> v3: Modified patches 6 and 9 to fix some issues,
>>> changelog included in the respective patches.
>>> v2: This version modifies only few commit descriptions,
>>> changelog included in the respective patches.
>>>
>> This breaks WCN7850 support:
>>
>> [  144.039164] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem
>> 0xda200000-0xda3fffff 64bit]
>> [  144.039315] ath12k_pci 0000:06:00.0: enabling device (0000 -> 0002)
>> [  144.046220] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
>> [  144.118539] mhi mhi0: Requested to power ON
>> [  144.118716] mhi mhi0: Power on setup success
>> [  144.222303] mhi mhi0: Wait for device to enter SBL or Mission mode
>> [  144.627712] ath12k_pci 0000:06:00.0: chip_id 0x2 chip_family 0x4
>> board_id 0x104 soc_id 0x40170200
>> [  144.627945] ath12k_pci 0000:06:00.0: fw_version 0x1005bc12
>> fw_build_timestamp 2022-10-11 12:13 fw_build_id
>> QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>> [  144.959196] ath12k_pci 0000:06:00.0: failed to parse tlv -22
>> [  144.959317] ath12k_pci 0000:06:00.0: failed to parse ext2 event tlv
>> -22
>> [  150.263567] ath12k_pci 0000:06:00.0: failed to receive wmi service
>> ready event: -110
>> [  150.276547] ath12k_pci 0000:06:00.0: failed to start core: -110
>>
>
> I have started seeing ETIMEDOUT on QCN9274 as well, AP bring up fails in
> vdev sync. It works if the sync timeout is increased.
>

Just an update, this is the timeout fix required for QCN9274:
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

There are also some changes required from WCN side as well.
Will update here with a link when those are available.
Thanks.

2023-05-05 03:23:47

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH v3 00/11] wifi: ath12k: (v3) EHT support

On 4/26/2023 2:03 PM, Kalle Valo wrote:
> Aloka Dixit <[email protected]> writes:
>
>
...
> This breaks WCN7850 support:
>
> [ 144.039164] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xda200000-0xda3fffff 64bit]
> [ 144.039315] ath12k_pci 0000:06:00.0: enabling device (0000 -> 0002)
> [ 144.046220] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
> [ 144.118539] mhi mhi0: Requested to power ON
> [ 144.118716] mhi mhi0: Power on setup success
> [ 144.222303] mhi mhi0: Wait for device to enter SBL or Mission mode
> [ 144.627712] ath12k_pci 0000:06:00.0: chip_id 0x2 chip_family 0x4 board_id 0x104 soc_id 0x40170200
> [ 144.627945] ath12k_pci 0000:06:00.0: fw_version 0x1005bc12 fw_build_timestamp 2022-10-11 12:13 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
> [ 144.959196] ath12k_pci 0000:06:00.0: failed to parse tlv -22
> [ 144.959317] ath12k_pci 0000:06:00.0: failed to parse ext2 event tlv -22
> [ 150.263567] ath12k_pci 0000:06:00.0: failed to receive wmi service ready event: -110
> [ 150.276547] ath12k_pci 0000:06:00.0: failed to start core: -110
WCN7850 use "single_pdev_only = true" in ath12k_hw_params, it has some
difference while handler WMI_SERVICE_READY_EXT2_EVENTID.
I have patch to handler this for WCN7850, and the patch is verified.