d93e27dd42bb95ab68ba0ab33239d2979664f076
[openwrt/staging/xback.git] /
1 From c82dc33f252fd8883be66f2d0230af0fd734c683 Mon Sep 17 00:00:00 2001
2 From: Aloka Dixit <quic_alokad@quicinc.com>
3 Date: Fri, 5 May 2023 16:11:27 +0300
4 Subject: [PATCH 74/77] wifi: ath11k: MBSSID parameter configuration in AP mode
5
6 Include MBSSID parameters in WMI vdev up operation.
7
8 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
9
10 Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
11 Co-developed-by: John Crispin <john@phrozen.org>
12 Signed-off-by: John Crispin <john@phrozen.org>
13 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
14 Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com
15 ---
16 drivers/net/wireless/ath/ath11k/mac.c | 29 +++++++++++++++++++++------
17 drivers/net/wireless/ath/ath11k/wmi.c | 8 +++++++-
18 drivers/net/wireless/ath/ath11k/wmi.h | 3 ++-
19 3 files changed, 32 insertions(+), 8 deletions(-)
20
21 --- a/drivers/net/wireless/ath/ath11k/mac.c
22 +++ b/drivers/net/wireless/ath/ath11k/mac.c
23 @@ -964,7 +964,7 @@ static int ath11k_mac_monitor_vdev_start
24 return ret;
25 }
26
27 - ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr);
28 + ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr, NULL, 0, 0);
29 if (ret) {
30 ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
31 vdev_id, ret);
32 @@ -1423,6 +1423,7 @@ static void ath11k_control_beaconing(str
33 struct ieee80211_bss_conf *info)
34 {
35 struct ath11k *ar = arvif->ar;
36 + struct ath11k_vif *tx_arvif = NULL;
37 int ret = 0;
38
39 lockdep_assert_held(&arvif->ar->conf_mutex);
40 @@ -1451,8 +1452,14 @@ static void ath11k_control_beaconing(str
41
42 ether_addr_copy(arvif->bssid, info->bssid);
43
44 + if (arvif->vif->mbssid_tx_vif)
45 + tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
46 +
47 ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
48 - arvif->bssid);
49 + arvif->bssid,
50 + tx_arvif ? tx_arvif->bssid : NULL,
51 + info->bssid_index,
52 + 1 << info->bssid_indicator);
53 if (ret) {
54 ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
55 arvif->vdev_id, ret);
56 @@ -2879,7 +2886,8 @@ static void ath11k_bss_assoc(struct ieee
57 arvif->aid = vif->cfg.aid;
58 ether_addr_copy(arvif->bssid, bss_conf->bssid);
59
60 - ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid);
61 + ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid,
62 + NULL, 0, 0);
63 if (ret) {
64 ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n",
65 arvif->vdev_id, ret);
66 @@ -7133,7 +7141,8 @@ ath11k_mac_update_vif_chan(struct ath11k
67 int n_vifs)
68 {
69 struct ath11k_base *ab = ar->ab;
70 - struct ath11k_vif *arvif;
71 + struct ath11k_vif *arvif, *tx_arvif = NULL;
72 + struct ieee80211_vif *mbssid_tx_vif;
73 int ret;
74 int i;
75 bool monitor_vif = false;
76 @@ -7187,8 +7196,15 @@ ath11k_mac_update_vif_chan(struct ath11k
77 ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
78 ret);
79
80 + mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
81 + if (mbssid_tx_vif)
82 + tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
83 +
84 ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
85 - arvif->bssid);
86 + arvif->bssid,
87 + tx_arvif ? tx_arvif->bssid : NULL,
88 + arvif->vif->bss_conf.bssid_index,
89 + 1 << arvif->vif->bss_conf.bssid_indicator);
90 if (ret) {
91 ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
92 arvif->vdev_id, ret);
93 @@ -7306,7 +7322,8 @@ static int ath11k_start_vdev_delay(struc
94 }
95
96 if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
97 - ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr);
98 + ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr,
99 + NULL, 0, 0);
100 if (ret) {
101 ath11k_warn(ab, "failed put monitor up: %d\n", ret);
102 return ret;
103 --- a/drivers/net/wireless/ath/ath11k/wmi.c
104 +++ b/drivers/net/wireless/ath/ath11k/wmi.c
105 @@ -1001,7 +1001,8 @@ int ath11k_wmi_vdev_start(struct ath11k
106 return ret;
107 }
108
109 -int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
110 +int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid,
111 + u8 *tx_bssid, u32 nontx_profile_idx, u32 nontx_profile_cnt)
112 {
113 struct ath11k_pdev_wmi *wmi = ar->wmi;
114 struct wmi_vdev_up_cmd *cmd;
115 @@ -1025,6 +1026,11 @@ int ath11k_wmi_vdev_up(struct ath11k *ar
116
117 ether_addr_copy(cmd->vdev_bssid.addr, bssid);
118
119 + cmd->nontx_profile_idx = nontx_profile_idx;
120 + cmd->nontx_profile_cnt = nontx_profile_cnt;
121 + if (tx_bssid)
122 + ether_addr_copy(cmd->tx_vdev_bssid.addr, tx_bssid);
123 +
124 if (arvif && arvif->vif->type == NL80211_IFTYPE_STATION) {
125 bss_conf = &arvif->vif->bss_conf;
126
127 --- a/drivers/net/wireless/ath/ath11k/wmi.h
128 +++ b/drivers/net/wireless/ath/ath11k/wmi.h
129 @@ -6301,7 +6301,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *a
130 struct sk_buff *bcn);
131 int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id);
132 int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid,
133 - const u8 *bssid);
134 + const u8 *bssid, u8 *tx_bssid, u32 nontx_profile_idx,
135 + u32 nontx_profile_cnt);
136 int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id);
137 int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
138 bool restart);