Commit ea68f1bb authored by Aloka Dixit's avatar Aloka Dixit Committed by Kalle Valo

wifi: ath12k: configure MBSSID params in vdev create/start

Configure multiple BSSID flags and vdev_id of the transmited profile
in vdev create/start commands depending on the service bit
WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT.

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>
Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240508202912.11902-3-quic_alokad@quicinc.com
parent 519a545c
...@@ -5984,17 +5984,59 @@ ath12k_mac_get_vdev_stats_id(struct ath12k_vif *arvif) ...@@ -5984,17 +5984,59 @@ ath12k_mac_get_vdev_stats_id(struct ath12k_vif *arvif)
return vdev_stats_id; return vdev_stats_id;
} }
static void ath12k_mac_setup_vdev_create_arg(struct ath12k_vif *arvif, static int ath12k_mac_setup_vdev_params_mbssid(struct ath12k_vif *arvif,
struct ath12k_wmi_vdev_create_arg *arg) u32 *flags, u32 *tx_vdev_id)
{
struct ieee80211_vif *tx_vif = arvif->vif->mbssid_tx_vif;
struct ath12k *ar = arvif->ar;
struct ath12k_vif *tx_arvif;
if (!tx_vif)
return 0;
tx_arvif = ath12k_vif_to_arvif(tx_vif);
if (arvif->vif->bss_conf.nontransmitted) {
if (ar->ah->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy)
return -EINVAL;
*flags = WMI_VDEV_MBSSID_FLAGS_NON_TRANSMIT_AP;
*tx_vdev_id = tx_arvif->vdev_id;
} else if (tx_arvif == arvif) {
*flags = WMI_VDEV_MBSSID_FLAGS_TRANSMIT_AP;
} else {
return -EINVAL;
}
if (arvif->vif->bss_conf.ema_ap)
*flags |= WMI_VDEV_MBSSID_FLAGS_EMA_MODE;
return 0;
}
static int ath12k_mac_setup_vdev_create_arg(struct ath12k_vif *arvif,
struct ath12k_wmi_vdev_create_arg *arg)
{ {
struct ath12k *ar = arvif->ar; struct ath12k *ar = arvif->ar;
struct ath12k_pdev *pdev = ar->pdev; struct ath12k_pdev *pdev = ar->pdev;
int ret;
arg->if_id = arvif->vdev_id; arg->if_id = arvif->vdev_id;
arg->type = arvif->vdev_type; arg->type = arvif->vdev_type;
arg->subtype = arvif->vdev_subtype; arg->subtype = arvif->vdev_subtype;
arg->pdev_id = pdev->pdev_id; arg->pdev_id = pdev->pdev_id;
arg->mbssid_flags = WMI_VDEV_MBSSID_FLAGS_NON_MBSSID_AP;
arg->mbssid_tx_vdev_id = 0;
if (!test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT,
ar->ab->wmi_ab.svc_map)) {
ret = ath12k_mac_setup_vdev_params_mbssid(arvif,
&arg->mbssid_flags,
&arg->mbssid_tx_vdev_id);
if (ret)
return ret;
}
if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) {
arg->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; arg->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains;
arg->chains[NL80211_BAND_2GHZ].rx = ar->num_rx_chains; arg->chains[NL80211_BAND_2GHZ].rx = ar->num_rx_chains;
...@@ -6010,6 +6052,7 @@ static void ath12k_mac_setup_vdev_create_arg(struct ath12k_vif *arvif, ...@@ -6010,6 +6052,7 @@ static void ath12k_mac_setup_vdev_create_arg(struct ath12k_vif *arvif,
} }
arg->if_stats_id = ath12k_mac_get_vdev_stats_id(arvif); arg->if_stats_id = ath12k_mac_get_vdev_stats_id(arvif);
return 0;
} }
static u32 static u32
...@@ -6191,7 +6234,12 @@ static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) ...@@ -6191,7 +6234,12 @@ static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++)
vif->hw_queue[i] = i % (ATH12K_HW_MAX_QUEUES - 1); vif->hw_queue[i] = i % (ATH12K_HW_MAX_QUEUES - 1);
ath12k_mac_setup_vdev_create_arg(arvif, &vdev_arg); ret = ath12k_mac_setup_vdev_create_arg(arvif, &vdev_arg);
if (ret) {
ath12k_warn(ab, "failed to create vdev parameters %d: %d\n",
arvif->vdev_id, ret);
goto err;
}
ret = ath12k_wmi_vdev_create(ar, vif->addr, &vdev_arg); ret = ath12k_wmi_vdev_create(ar, vif->addr, &vdev_arg);
if (ret) { if (ret) {
...@@ -6933,10 +6981,16 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, ...@@ -6933,10 +6981,16 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
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;
/* Fill the MBSSID flags to indicate AP is non MBSSID by default
* Corresponding flags would be updated with MBSSID support.
*/
arg.mbssid_flags = WMI_VDEV_MBSSID_FLAGS_NON_MBSSID_AP; arg.mbssid_flags = WMI_VDEV_MBSSID_FLAGS_NON_MBSSID_AP;
arg.mbssid_tx_vdev_id = 0;
if (test_bit(WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT,
ar->ab->wmi_ab.svc_map)) {
ret = ath12k_mac_setup_vdev_params_mbssid(arvif,
&arg.mbssid_flags,
&arg.mbssid_tx_vdev_id);
if (ret)
return ret;
}
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
arg.ssid = arvif->u.ap.ssid; arg.ssid = arvif->u.ap.ssid;
......
...@@ -844,6 +844,8 @@ int ath12k_wmi_vdev_create(struct ath12k *ar, u8 *macaddr, ...@@ -844,6 +844,8 @@ int ath12k_wmi_vdev_create(struct ath12k *ar, u8 *macaddr,
cmd->vdev_subtype = cpu_to_le32(args->subtype); cmd->vdev_subtype = cpu_to_le32(args->subtype);
cmd->num_cfg_txrx_streams = cpu_to_le32(WMI_NUM_SUPPORTED_BAND_MAX); cmd->num_cfg_txrx_streams = cpu_to_le32(WMI_NUM_SUPPORTED_BAND_MAX);
cmd->pdev_id = cpu_to_le32(args->pdev_id); cmd->pdev_id = cpu_to_le32(args->pdev_id);
cmd->mbssid_flags = cpu_to_le32(args->mbssid_flags);
cmd->mbssid_tx_vdev_id = cpu_to_le32(args->mbssid_tx_vdev_id);
cmd->vdev_stats_id = cpu_to_le32(args->if_stats_id); cmd->vdev_stats_id = cpu_to_le32(args->if_stats_id);
ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); ether_addr_copy(cmd->vdev_macaddr.addr, macaddr);
...@@ -1049,6 +1051,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg, ...@@ -1049,6 +1051,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg,
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); cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap);
cmd->mbssid_flags = cpu_to_le32(arg->mbssid_flags); cmd->mbssid_flags = cpu_to_le32(arg->mbssid_flags);
cmd->mbssid_tx_vdev_id = cpu_to_le32(arg->mbssid_tx_vdev_id);
if (!restart) { if (!restart) {
if (arg->ssid) { if (arg->ssid) {
......
...@@ -2154,6 +2154,7 @@ enum wmi_tlv_service { ...@@ -2154,6 +2154,7 @@ enum wmi_tlv_service {
WMI_TLV_SERVICE_PER_PEER_HTT_STATS_RESET = 213, WMI_TLV_SERVICE_PER_PEER_HTT_STATS_RESET = 213,
WMI_TLV_SERVICE_FREQINFO_IN_METADATA = 219, WMI_TLV_SERVICE_FREQINFO_IN_METADATA = 219,
WMI_TLV_SERVICE_EXT2_MSG = 220, WMI_TLV_SERVICE_EXT2_MSG = 220,
WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT = 253,
WMI_MAX_EXT_SERVICE = 256, WMI_MAX_EXT_SERVICE = 256,
...@@ -2729,6 +2730,8 @@ struct ath12k_wmi_vdev_create_arg { ...@@ -2729,6 +2730,8 @@ struct ath12k_wmi_vdev_create_arg {
} chains[NUM_NL80211_BANDS]; } chains[NUM_NL80211_BANDS];
u32 pdev_id; u32 pdev_id;
u8 if_stats_id; u8 if_stats_id;
u32 mbssid_flags;
u32 mbssid_tx_vdev_id;
}; };
#define ATH12K_MAX_VDEV_STATS_ID 0x30 #define ATH12K_MAX_VDEV_STATS_ID 0x30
...@@ -2795,6 +2798,10 @@ struct ath12k_wmi_ssid_params { ...@@ -2795,6 +2798,10 @@ struct ath12k_wmi_ssid_params {
enum wmi_vdev_mbssid_flags { enum wmi_vdev_mbssid_flags {
WMI_VDEV_MBSSID_FLAGS_NON_MBSSID_AP = BIT(0), WMI_VDEV_MBSSID_FLAGS_NON_MBSSID_AP = BIT(0),
WMI_VDEV_MBSSID_FLAGS_TRANSMIT_AP = BIT(1),
WMI_VDEV_MBSSID_FLAGS_NON_TRANSMIT_AP = BIT(2),
WMI_VDEV_MBSSID_FLAGS_EMA_MODE = BIT(3),
WMI_VDEV_MBSSID_FLAGS_SCAN_MODE_VAP = BIT(4),
}; };
struct wmi_vdev_start_request_cmd { struct wmi_vdev_start_request_cmd {
......
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