mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
206 lines
7.1 KiB
Diff
206 lines
7.1 KiB
Diff
From cfc8bc024ad4f2e468cdf2b9ce400b75b5440b92 Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Thu, 20 Jan 2022 18:04:51 -0800
|
|
Subject: [PATCH 06/14] ath11k: create a structure for WMI vdev up parameters
|
|
|
|
Include an instance of the structure instead of individual parameters
|
|
as input to ath11k_wmi_vdev_up().
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
|
|
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/mac.c | 31 +++++++++++++++++++++------
|
|
drivers/net/wireless/ath/ath11k/wmi.c | 15 +++++++------
|
|
drivers/net/wireless/ath/ath11k/wmi.h | 16 ++++++++++----
|
|
3 files changed, 45 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
|
|
index 05c7b24d8b28..b5d5df6eef3c 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
|
@@ -993,6 +993,7 @@ static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id,
|
|
struct ieee80211_channel *channel;
|
|
struct wmi_vdev_start_req_arg arg = {};
|
|
int ret;
|
|
+ struct vdev_up_params params = { 0 };
|
|
|
|
lockdep_assert_held(&ar->conf_mutex);
|
|
|
|
@@ -1033,7 +1034,9 @@ static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id,
|
|
return ret;
|
|
}
|
|
|
|
- ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr);
|
|
+ params.vdev_id = vdev_id,
|
|
+ params.bssid = ar->mac_addr,
|
|
+ ret = ath11k_wmi_vdev_up(ar, ¶ms);
|
|
if (ret) {
|
|
ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
|
|
vdev_id, ret);
|
|
@@ -1501,6 +1504,7 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
|
|
{
|
|
struct ath11k *ar = arvif->ar;
|
|
int ret = 0;
|
|
+ struct vdev_up_params params = { 0 };
|
|
|
|
lockdep_assert_held(&arvif->ar->conf_mutex);
|
|
|
|
@@ -1533,8 +1537,10 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
|
|
|
|
ether_addr_copy(arvif->bssid, info->bssid);
|
|
|
|
- ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
|
- arvif->bssid);
|
|
+ params.vdev_id = arvif->vdev_id;
|
|
+ params.aid = arvif->aid;
|
|
+ params.bssid = arvif->bssid;
|
|
+ ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms);
|
|
if (ret) {
|
|
ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
|
|
arvif->vdev_id, ret);
|
|
@@ -2956,6 +2962,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,
|
|
struct ieee80211_sta_he_cap he_cap;
|
|
int ret;
|
|
bool debug;
|
|
+ struct vdev_up_params params = { 0 };
|
|
|
|
lockdep_assert_held(&ar->conf_mutex);
|
|
|
|
@@ -3012,7 +3019,10 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,
|
|
arvif->aid = bss_conf->aid;
|
|
ether_addr_copy(arvif->bssid, bss_conf->bssid);
|
|
|
|
- ret = ath11k_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 = ath11k_wmi_vdev_up(ar, ¶ms);
|
|
if (ret) {
|
|
ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n",
|
|
arvif->vdev_id, ret);
|
|
@@ -8319,6 +8329,8 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
|
|
ath11k_mac_update_rx_channel(ar, NULL, vifs, n_vifs);
|
|
|
|
for (i = 0; i < n_vifs; i++) {
|
|
+ struct vdev_up_params params = { 0 };
|
|
+
|
|
arvif = (void *)vifs[i].vif->drv_priv;
|
|
|
|
if (WARN_ON(!arvif->is_started))
|
|
@@ -8342,8 +8354,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
|
|
ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
|
|
ret);
|
|
|
|
- ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
|
|
- arvif->bssid);
|
|
+ params.vdev_id = arvif->vdev_id;
|
|
+ params.aid = arvif->aid;
|
|
+ params.bssid = arvif->bssid;
|
|
+ ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
|
|
arvif->vdev_id, ret);
|
|
@@ -8475,6 +8489,7 @@ static int ath11k_start_vdev_delay(struct ieee80211_hw *hw,
|
|
struct ath11k_base *ab = ar->ab;
|
|
struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
|
int ret;
|
|
+ struct vdev_up_params params = { 0 };
|
|
|
|
if (WARN_ON(arvif->is_started))
|
|
return -EBUSY;
|
|
@@ -8489,7 +8504,9 @@ static int ath11k_start_vdev_delay(struct ieee80211_hw *hw,
|
|
}
|
|
|
|
if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
|
|
- ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr);
|
|
+ params.vdev_id = arvif->vdev_id,
|
|
+ params.bssid = ar->mac_addr,
|
|
+ ret = ath11k_wmi_vdev_up(ar, ¶ms);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed put monitor up: %d\n", ret);
|
|
return ret;
|
|
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
|
|
index 66cbd245a6f6..bc6e46b64337 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
|
@@ -1088,7 +1088,7 @@ int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
|
|
return ret;
|
|
}
|
|
|
|
-int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
|
|
+int ath11k_wmi_vdev_up(struct ath11k *ar, struct vdev_up_params *params)
|
|
{
|
|
struct ath11k_pdev_wmi *wmi = ar->wmi;
|
|
struct wmi_vdev_up_cmd *cmd;
|
|
@@ -1103,10 +1103,13 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
|
|
|
|
cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_UP_CMD) |
|
|
FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
|
|
- cmd->vdev_id = vdev_id;
|
|
- cmd->vdev_assoc_id = aid;
|
|
-
|
|
- ether_addr_copy(cmd->vdev_bssid.addr, bssid);
|
|
+ cmd->vdev_id = params->vdev_id;
|
|
+ cmd->vdev_assoc_id = params->aid;
|
|
+ ether_addr_copy(cmd->vdev_bssid.addr, params->bssid);
|
|
+ cmd->profile_idx = params->profile_idx;
|
|
+ cmd->profile_count = params->profile_count;
|
|
+ if (params->tx_bssid)
|
|
+ ether_addr_copy(cmd->tx_vdev_bssid.addr, params->tx_bssid);
|
|
|
|
ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_UP_CMDID);
|
|
if (ret) {
|
|
@@ -1116,7 +1119,7 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
|
|
|
|
ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
|
|
"WMI mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
|
|
- vdev_id, aid, bssid);
|
|
+ params->vdev_id, params->aid, params->bssid);
|
|
|
|
return ret;
|
|
}
|
|
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
|
|
index cca3bc73bc66..563e4993c4db 100644
|
|
--- a/drivers/net/wireless/ath/ath11k/wmi.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
|
|
@@ -2733,14 +2733,23 @@ struct wmi_vdev_delete_cmd {
|
|
u32 vdev_id;
|
|
} __packed;
|
|
|
|
+struct vdev_up_params {
|
|
+ u32 vdev_id;
|
|
+ u16 aid;
|
|
+ const u8 *bssid;
|
|
+ u32 profile_idx;
|
|
+ u32 profile_count;
|
|
+ u8 *tx_bssid;
|
|
+};
|
|
+
|
|
struct wmi_vdev_up_cmd {
|
|
u32 tlv_header;
|
|
u32 vdev_id;
|
|
u32 vdev_assoc_id;
|
|
struct wmi_mac_addr vdev_bssid;
|
|
- struct wmi_mac_addr trans_bssid;
|
|
+ struct wmi_mac_addr tx_vdev_bssid;
|
|
u32 profile_idx;
|
|
- u32 profile_num;
|
|
+ u32 profile_count;
|
|
} __packed;
|
|
|
|
struct wmi_vdev_stop_cmd {
|
|
@@ -6914,8 +6923,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,
|
|
struct ieee80211_mutable_offsets *offs,
|
|
struct sk_buff *bcn);
|
|
int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id);
|
|
-int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid,
|
|
- const u8 *bssid);
|
|
+int ath11k_wmi_vdev_up(struct ath11k *ar, struct vdev_up_params *params);
|
|
int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id);
|
|
int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
|
|
bool restart);
|
|
--
|
|
2.31.1
|
|
|