Commit 07c01b86 authored by Aloka Dixit's avatar Aloka Dixit Committed by Kalle Valo

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: default avatarAloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: default avatarMuna Sinada <quic_msinada@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230725224034.14045-12-quic_alokad@quicinc.com
parent 9211df5c
...@@ -238,6 +238,7 @@ struct ath12k_vif { ...@@ -238,6 +238,7 @@ struct ath12k_vif {
u32 key_cipher; u32 key_cipher;
u8 tx_encap_type; u8 tx_encap_type;
u8 vdev_stats_id; u8 vdev_stats_id;
u32 punct_bitmap;
}; };
struct ath12k_vif_iter { struct ath12k_vif_iter {
......
...@@ -842,6 +842,7 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id, ...@@ -842,6 +842,7 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id,
arg.pref_tx_streams = ar->num_tx_chains; arg.pref_tx_streams = ar->num_tx_chains;
arg.pref_rx_streams = ar->num_rx_chains; arg.pref_rx_streams = ar->num_rx_chains;
arg.punct_bitmap = 0xFFFFFFFF;
arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);
...@@ -2139,6 +2140,7 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar, ...@@ -2139,6 +2140,7 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
const struct ieee80211_eht_mcs_nss_supp_20mhz_only *bw_20; const struct ieee80211_eht_mcs_nss_supp_20mhz_only *bw_20;
const struct ieee80211_eht_mcs_nss_supp_bw *bw; const struct ieee80211_eht_mcs_nss_supp_bw *bw;
struct ath12k_vif *arvif = (struct ath12k_vif *)vif->drv_priv;
u32 *rx_mcs, *tx_mcs; u32 *rx_mcs, *tx_mcs;
if (!sta->deflink.he_cap.has_he || !eht_cap->has_eht) if (!sta->deflink.he_cap.has_he || !eht_cap->has_eht)
...@@ -2208,6 +2210,8 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar, ...@@ -2208,6 +2210,8 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
arg->peer_eht_mcs_count++; arg->peer_eht_mcs_count++;
break; break;
} }
arg->punct_bitmap = ~arvif->punct_bitmap;
} }
static void ath12k_peer_assoc_prepare(struct ath12k *ar, static void ath12k_peer_assoc_prepare(struct ath12k *ar,
...@@ -2761,6 +2765,9 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2761,6 +2765,9 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP) changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP)
ath12k_mac_fils_discovery(arvif, info); ath12k_mac_fils_discovery(arvif, info);
if (changed & BSS_CHANGED_EHT_PUNCTURING)
arvif->punct_bitmap = info->eht_puncturing;
mutex_unlock(&ar->conf_mutex); mutex_unlock(&ar->conf_mutex);
} }
...@@ -5800,6 +5807,7 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, ...@@ -5800,6 +5807,7 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
arg.vdev_id = arvif->vdev_id; arg.vdev_id = arvif->vdev_id;
arg.dtim_period = arvif->dtim_period; arg.dtim_period = arvif->dtim_period;
arg.bcn_intval = arvif->beacon_interval; arg.bcn_intval = arvif->beacon_interval;
arg.punct_bitmap = ~arvif->punct_bitmap;
arg.freq = chandef->chan->center_freq; arg.freq = chandef->chan->center_freq;
arg.band_center_freq1 = chandef->center_freq1; arg.band_center_freq1 = chandef->center_freq1;
...@@ -5842,9 +5850,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, ...@@ -5842,9 +5850,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);
ath12k_dbg(ab, ATH12K_DBG_MAC, 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, 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); ret = ath12k_wmi_vdev_start(ar, &arg, restart);
if (ret) { if (ret) {
...@@ -6171,6 +6179,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -6171,6 +6179,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
"mac chanctx assign ptr %pK vdev_id %i\n", "mac chanctx assign ptr %pK vdev_id %i\n",
ctx, arvif->vdev_id); ctx, arvif->vdev_id);
arvif->punct_bitmap = link_conf->eht_puncturing;
/* for some targets bss peer must be created before vdev_start */ /* for some targets bss peer must be created before vdev_start */
if (ab->hw_params->vdev_start_delay && if (ab->hw_params->vdev_start_delay &&
arvif->vdev_type != WMI_VDEV_TYPE_AP && arvif->vdev_type != WMI_VDEV_TYPE_AP &&
...@@ -7298,6 +7308,8 @@ static int __ath12k_mac_register(struct ath12k *ar) ...@@ -7298,6 +7308,8 @@ static int __ath12k_mac_register(struct ath12k *ar)
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP); NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP);
} }
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_PUNCT);
ath12k_reg_init(ar); ath12k_reg_init(ar);
if (!test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags)) { if (!test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags)) {
......
...@@ -1021,6 +1021,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg, ...@@ -1021,6 +1021,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->cac_duration_ms = cpu_to_le32(arg->cac_duration_ms);
cmd->regdomain = cpu_to_le32(arg->regdomain); cmd->regdomain = cpu_to_le32(arg->regdomain);
cmd->he_ops = cpu_to_le32(arg->he_ops); cmd->he_ops = cpu_to_le32(arg->he_ops);
cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap);
if (!restart) { if (!restart) {
if (arg->ssid) { if (arg->ssid) {
...@@ -1942,6 +1943,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar, ...@@ -1942,6 +1943,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
cmd->peer_new_assoc = cpu_to_le32(arg->peer_new_assoc); cmd->peer_new_assoc = cpu_to_le32(arg->peer_new_assoc);
cmd->peer_associd = cpu_to_le32(arg->peer_associd); 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, ath12k_wmi_copy_peer_flags(cmd, arg,
test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED,
......
...@@ -2775,6 +2775,11 @@ struct wmi_vdev_start_request_cmd { ...@@ -2775,6 +2775,11 @@ struct wmi_vdev_start_request_cmd {
__le32 he_ops; __le32 he_ops;
__le32 cac_duration_ms; __le32 cac_duration_ms;
__le32 regdomain; __le32 regdomain;
__le32 min_data_rate;
__le32 mbssid_flags;
__le32 mbssid_tx_vdev_id;
__le32 eht_ops;
__le32 punct_bitmap;
} __packed; } __packed;
#define MGMT_TX_DL_FRM_LEN 64 #define MGMT_TX_DL_FRM_LEN 64
...@@ -2874,6 +2879,10 @@ struct wmi_vdev_start_req_arg { ...@@ -2874,6 +2879,10 @@ struct wmi_vdev_start_req_arg {
u32 pref_rx_streams; u32 pref_rx_streams;
u32 pref_tx_streams; u32 pref_tx_streams;
u32 num_noa_descriptors; 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 { struct ath12k_wmi_peer_create_arg {
...@@ -3604,6 +3613,7 @@ struct ath12k_wmi_peer_assoc_arg { ...@@ -3604,6 +3613,7 @@ struct ath12k_wmi_peer_assoc_arg {
u32 peer_eht_rx_mcs_set[WMI_MAX_EHTCAP_RATE_SET]; u32 peer_eht_rx_mcs_set[WMI_MAX_EHTCAP_RATE_SET];
u32 peer_eht_tx_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; struct ath12k_wmi_ppe_threshold_arg peer_eht_ppet;
u32 punct_bitmap;
}; };
struct wmi_peer_assoc_complete_cmd { struct wmi_peer_assoc_complete_cmd {
...@@ -3639,7 +3649,7 @@ struct wmi_peer_assoc_complete_cmd { ...@@ -3639,7 +3649,7 @@ struct wmi_peer_assoc_complete_cmd {
__le32 bss_max_idle_option; __le32 bss_max_idle_option;
__le32 auth_mode; __le32 auth_mode;
__le32 peer_flags_ext; __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_mac[WMI_MAX_EHTCAP_MAC_SIZE];
__le32 peer_eht_cap_phy[WMI_MAX_EHTCAP_PHY_SIZE]; __le32 peer_eht_cap_phy[WMI_MAX_EHTCAP_PHY_SIZE];
__le32 peer_eht_ops; __le32 peer_eht_ops;
......
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