Commit 51c47463 authored by Aloka Dixit's avatar Aloka Dixit Committed by Kalle Valo

wifi: ath12k: create a structure for WMI vdev up parameters

Host needs to send multiple BSSID configurations to firmware for
each vdev in ath12k_wmi_vdev_up() for AP mode. This function accepts
individual input parameters hence any new argument will require changes
to all callers. Most of these will use default value (0 or NULL).
Create a structure for the function arguments and include objects with
all members initialized to zero to minimize future changes.

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-5-quic_alokad@quicinc.com
parent 5fbd97f2
...@@ -867,9 +867,12 @@ static int ath12k_mac_vdev_setup_sync(struct ath12k *ar) ...@@ -867,9 +867,12 @@ static int ath12k_mac_vdev_setup_sync(struct ath12k *ar)
static int ath12k_monitor_vdev_up(struct ath12k *ar, int vdev_id) static int ath12k_monitor_vdev_up(struct ath12k *ar, int vdev_id)
{ {
struct ath12k_wmi_vdev_up_params params = {};
int ret; int ret;
ret = ath12k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); params.vdev_id = vdev_id;
params.bssid = ar->mac_addr;
ret = ath12k_wmi_vdev_up(ar, &params);
if (ret) { if (ret) {
ath12k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", ath12k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
vdev_id, ret); vdev_id, ret);
...@@ -886,6 +889,7 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id, ...@@ -886,6 +889,7 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id,
{ {
struct ieee80211_channel *channel; struct ieee80211_channel *channel;
struct wmi_vdev_start_req_arg arg = {}; struct wmi_vdev_start_req_arg arg = {};
struct ath12k_wmi_vdev_up_params params = {};
int ret; int ret;
lockdep_assert_held(&ar->conf_mutex); lockdep_assert_held(&ar->conf_mutex);
...@@ -926,7 +930,9 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id, ...@@ -926,7 +930,9 @@ static int ath12k_mac_monitor_vdev_start(struct ath12k *ar, int vdev_id,
return ret; return ret;
} }
ret = ath12k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); params.vdev_id = vdev_id;
params.bssid = ar->mac_addr;
ret = ath12k_wmi_vdev_up(ar, &params);
if (ret) { if (ret) {
ath12k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", ath12k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
vdev_id, ret); vdev_id, ret);
...@@ -1362,6 +1368,7 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_vif *arvif) ...@@ -1362,6 +1368,7 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_vif *arvif)
static void ath12k_control_beaconing(struct ath12k_vif *arvif, static void ath12k_control_beaconing(struct ath12k_vif *arvif,
struct ieee80211_bss_conf *info) struct ieee80211_bss_conf *info)
{ {
struct ath12k_wmi_vdev_up_params params = {};
struct ath12k *ar = arvif->ar; struct ath12k *ar = arvif->ar;
int ret; int ret;
...@@ -1389,8 +1396,10 @@ static void ath12k_control_beaconing(struct ath12k_vif *arvif, ...@@ -1389,8 +1396,10 @@ static void ath12k_control_beaconing(struct ath12k_vif *arvif,
ether_addr_copy(arvif->bssid, info->bssid); ether_addr_copy(arvif->bssid, info->bssid);
ret = ath12k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, params.vdev_id = arvif->vdev_id;
arvif->bssid); params.aid = arvif->aid;
params.bssid = arvif->bssid;
ret = ath12k_wmi_vdev_up(arvif->ar, &params);
if (ret) { if (ret) {
ath12k_warn(ar->ab, "failed to bring up vdev %d: %i\n", ath12k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
arvif->vdev_id, ret); arvif->vdev_id, ret);
...@@ -2605,6 +2614,7 @@ static void ath12k_bss_assoc(struct ath12k *ar, ...@@ -2605,6 +2614,7 @@ static void ath12k_bss_assoc(struct ath12k *ar,
struct ieee80211_bss_conf *bss_conf) struct ieee80211_bss_conf *bss_conf)
{ {
struct ieee80211_vif *vif = arvif->vif; struct ieee80211_vif *vif = arvif->vif;
struct ath12k_wmi_vdev_up_params params = {};
struct ath12k_wmi_peer_assoc_arg peer_arg; struct ath12k_wmi_peer_assoc_arg peer_arg;
struct ieee80211_sta *ap_sta; struct ieee80211_sta *ap_sta;
struct ath12k_peer *peer; struct ath12k_peer *peer;
...@@ -2657,7 +2667,10 @@ static void ath12k_bss_assoc(struct ath12k *ar, ...@@ -2657,7 +2667,10 @@ static void ath12k_bss_assoc(struct ath12k *ar,
arvif->aid = vif->cfg.aid; arvif->aid = vif->cfg.aid;
ether_addr_copy(arvif->bssid, bss_conf->bssid); ether_addr_copy(arvif->bssid, bss_conf->bssid);
ret = ath12k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid); params.vdev_id = arvif->vdev_id;
params.aid = arvif->aid;
params.bssid = arvif->bssid;
ret = ath12k_wmi_vdev_up(ar, &params);
if (ret) { if (ret) {
ath12k_warn(ar->ab, "failed to set vdev %d up: %d\n", ath12k_warn(ar->ab, "failed to set vdev %d up: %d\n",
arvif->vdev_id, ret); arvif->vdev_id, ret);
...@@ -7184,6 +7197,7 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, ...@@ -7184,6 +7197,7 @@ ath12k_mac_update_vif_chan(struct ath12k *ar,
struct ieee80211_vif_chanctx_switch *vifs, struct ieee80211_vif_chanctx_switch *vifs,
int n_vifs) int n_vifs)
{ {
struct ath12k_wmi_vdev_up_params params = {};
struct ath12k_base *ab = ar->ab; struct ath12k_base *ab = ar->ab;
struct ath12k_vif *arvif; struct ath12k_vif *arvif;
int ret; int ret;
...@@ -7264,8 +7278,10 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, ...@@ -7264,8 +7278,10 @@ ath12k_mac_update_vif_chan(struct ath12k *ar,
ath12k_warn(ab, "failed to update bcn tmpl during csa: %d\n", ath12k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
ret); ret);
ret = ath12k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, params.vdev_id = arvif->vdev_id;
arvif->bssid); params.aid = arvif->aid;
params.bssid = arvif->bssid;
ret = ath12k_wmi_vdev_up(arvif->ar, &params);
if (ret) { if (ret) {
ath12k_warn(ab, "failed to bring vdev up %d: %d\n", ath12k_warn(ab, "failed to bring vdev up %d: %d\n",
arvif->vdev_id, ret); arvif->vdev_id, ret);
......
...@@ -1103,7 +1103,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg, ...@@ -1103,7 +1103,7 @@ int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg,
return ret; return ret;
} }
int ath12k_wmi_vdev_up(struct ath12k *ar, u32 vdev_id, u32 aid, const u8 *bssid) int ath12k_wmi_vdev_up(struct ath12k *ar, struct ath12k_wmi_vdev_up_params *params)
{ {
struct ath12k_wmi_pdev *wmi = ar->wmi; struct ath12k_wmi_pdev *wmi = ar->wmi;
struct wmi_vdev_up_cmd *cmd; struct wmi_vdev_up_cmd *cmd;
...@@ -1118,14 +1118,14 @@ int ath12k_wmi_vdev_up(struct ath12k *ar, u32 vdev_id, u32 aid, const u8 *bssid) ...@@ -1118,14 +1118,14 @@ int ath12k_wmi_vdev_up(struct ath12k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_UP_CMD, cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_UP_CMD,
sizeof(*cmd)); sizeof(*cmd));
cmd->vdev_id = cpu_to_le32(vdev_id); cmd->vdev_id = cpu_to_le32(params->vdev_id);
cmd->vdev_assoc_id = cpu_to_le32(aid); cmd->vdev_assoc_id = cpu_to_le32(params->aid);
ether_addr_copy(cmd->vdev_bssid.addr, bssid); ether_addr_copy(cmd->vdev_bssid.addr, params->bssid);
ath12k_dbg(ar->ab, ATH12K_DBG_WMI, ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
"WMI mgmt vdev up id 0x%x assoc id %d bssid %pM\n", "WMI mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
vdev_id, aid, bssid); params->vdev_id, params->aid, params->bssid);
ret = ath12k_wmi_cmd_send(wmi, skb, WMI_VDEV_UP_CMDID); ret = ath12k_wmi_cmd_send(wmi, skb, WMI_VDEV_UP_CMDID);
if (ret) { if (ret) {
......
...@@ -2763,6 +2763,12 @@ struct wmi_vdev_delete_cmd { ...@@ -2763,6 +2763,12 @@ struct wmi_vdev_delete_cmd {
__le32 vdev_id; __le32 vdev_id;
} __packed; } __packed;
struct ath12k_wmi_vdev_up_params {
u32 vdev_id;
u32 aid;
const u8 *bssid;
};
struct wmi_vdev_up_cmd { struct wmi_vdev_up_cmd {
__le32 tlv_header; __le32 tlv_header;
__le32 vdev_id; __le32 vdev_id;
...@@ -4893,8 +4899,7 @@ int ath12k_wmi_bcn_tmpl(struct ath12k *ar, u32 vdev_id, ...@@ -4893,8 +4899,7 @@ int ath12k_wmi_bcn_tmpl(struct ath12k *ar, u32 vdev_id,
struct ieee80211_mutable_offsets *offs, struct ieee80211_mutable_offsets *offs,
struct sk_buff *bcn); struct sk_buff *bcn);
int ath12k_wmi_vdev_down(struct ath12k *ar, u8 vdev_id); int ath12k_wmi_vdev_down(struct ath12k *ar, u8 vdev_id);
int ath12k_wmi_vdev_up(struct ath12k *ar, u32 vdev_id, u32 aid, int ath12k_wmi_vdev_up(struct ath12k *ar, struct ath12k_wmi_vdev_up_params *params);
const u8 *bssid);
int ath12k_wmi_vdev_stop(struct ath12k *ar, u8 vdev_id); int ath12k_wmi_vdev_stop(struct ath12k *ar, u8 vdev_id);
int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg, int ath12k_wmi_vdev_start(struct ath12k *ar, struct wmi_vdev_start_req_arg *arg,
bool restart); bool restart);
......
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