diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-08-25 06:09:38 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-08-26 12:04:48 -0400 |
commit | 7aa7a72a23679abf1cea9b3b65a8921244e769a7 (patch) | |
tree | 1fae909aa0300aff481db6fe53e5bd09c696d57b | |
parent | 61e9aab7a1930ae031d1b9d948837b5ffd8e3f5e (diff) |
ath10k: improve logging to include dev id
This makes it a lot easier to log and debug
messages if there's more than 1 ath10k device on a
system.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath10k/bmi.c | 52 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/ce.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.c | 181 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.c | 67 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htc.c | 99 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htc.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt_rx.c | 116 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt_tx.c | 46 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 427 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/pci.c | 203 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/spectral.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/txrx.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 355 |
15 files changed, 833 insertions, 781 deletions
diff --git a/drivers/net/wireless/ath/ath10k/bmi.c b/drivers/net/wireless/ath/ath10k/bmi.c index 17d221abd58c..3d29b0875b3e 100644 --- a/drivers/net/wireless/ath/ath10k/bmi.c +++ b/drivers/net/wireless/ath/ath10k/bmi.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | void ath10k_bmi_start(struct ath10k *ar) | 23 | void ath10k_bmi_start(struct ath10k *ar) |
24 | { | 24 | { |
25 | ath10k_dbg(ATH10K_DBG_BMI, "bmi start\n"); | 25 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi start\n"); |
26 | 26 | ||
27 | ar->bmi.done_sent = false; | 27 | ar->bmi.done_sent = false; |
28 | } | 28 | } |
@@ -33,10 +33,10 @@ int ath10k_bmi_done(struct ath10k *ar) | |||
33 | u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.done); | 33 | u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.done); |
34 | int ret; | 34 | int ret; |
35 | 35 | ||
36 | ath10k_dbg(ATH10K_DBG_BMI, "bmi done\n"); | 36 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi done\n"); |
37 | 37 | ||
38 | if (ar->bmi.done_sent) { | 38 | if (ar->bmi.done_sent) { |
39 | ath10k_dbg(ATH10K_DBG_BMI, "bmi skipped\n"); | 39 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi skipped\n"); |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | 42 | ||
@@ -45,7 +45,7 @@ int ath10k_bmi_done(struct ath10k *ar) | |||
45 | 45 | ||
46 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); | 46 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); |
47 | if (ret) { | 47 | if (ret) { |
48 | ath10k_warn("unable to write to the device: %d\n", ret); | 48 | ath10k_warn(ar, "unable to write to the device: %d\n", ret); |
49 | return ret; | 49 | return ret; |
50 | } | 50 | } |
51 | 51 | ||
@@ -61,10 +61,10 @@ int ath10k_bmi_get_target_info(struct ath10k *ar, | |||
61 | u32 resplen = sizeof(resp.get_target_info); | 61 | u32 resplen = sizeof(resp.get_target_info); |
62 | int ret; | 62 | int ret; |
63 | 63 | ||
64 | ath10k_dbg(ATH10K_DBG_BMI, "bmi get target info\n"); | 64 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi get target info\n"); |
65 | 65 | ||
66 | if (ar->bmi.done_sent) { | 66 | if (ar->bmi.done_sent) { |
67 | ath10k_warn("BMI Get Target Info Command disallowed\n"); | 67 | ath10k_warn(ar, "BMI Get Target Info Command disallowed\n"); |
68 | return -EBUSY; | 68 | return -EBUSY; |
69 | } | 69 | } |
70 | 70 | ||
@@ -72,12 +72,12 @@ int ath10k_bmi_get_target_info(struct ath10k *ar, | |||
72 | 72 | ||
73 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); | 73 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); |
74 | if (ret) { | 74 | if (ret) { |
75 | ath10k_warn("unable to get target info from device\n"); | 75 | ath10k_warn(ar, "unable to get target info from device\n"); |
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | if (resplen < sizeof(resp.get_target_info)) { | 79 | if (resplen < sizeof(resp.get_target_info)) { |
80 | ath10k_warn("invalid get_target_info response length (%d)\n", | 80 | ath10k_warn(ar, "invalid get_target_info response length (%d)\n", |
81 | resplen); | 81 | resplen); |
82 | return -EIO; | 82 | return -EIO; |
83 | } | 83 | } |
@@ -97,11 +97,11 @@ int ath10k_bmi_read_memory(struct ath10k *ar, | |||
97 | u32 rxlen; | 97 | u32 rxlen; |
98 | int ret; | 98 | int ret; |
99 | 99 | ||
100 | ath10k_dbg(ATH10K_DBG_BMI, "bmi read address 0x%x length %d\n", | 100 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi read address 0x%x length %d\n", |
101 | address, length); | 101 | address, length); |
102 | 102 | ||
103 | if (ar->bmi.done_sent) { | 103 | if (ar->bmi.done_sent) { |
104 | ath10k_warn("command disallowed\n"); | 104 | ath10k_warn(ar, "command disallowed\n"); |
105 | return -EBUSY; | 105 | return -EBUSY; |
106 | } | 106 | } |
107 | 107 | ||
@@ -115,7 +115,7 @@ int ath10k_bmi_read_memory(struct ath10k *ar, | |||
115 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, | 115 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, |
116 | &resp, &rxlen); | 116 | &resp, &rxlen); |
117 | if (ret) { | 117 | if (ret) { |
118 | ath10k_warn("unable to read from the device (%d)\n", | 118 | ath10k_warn(ar, "unable to read from the device (%d)\n", |
119 | ret); | 119 | ret); |
120 | return ret; | 120 | return ret; |
121 | } | 121 | } |
@@ -137,11 +137,11 @@ int ath10k_bmi_write_memory(struct ath10k *ar, | |||
137 | u32 txlen; | 137 | u32 txlen; |
138 | int ret; | 138 | int ret; |
139 | 139 | ||
140 | ath10k_dbg(ATH10K_DBG_BMI, "bmi write address 0x%x length %d\n", | 140 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi write address 0x%x length %d\n", |
141 | address, length); | 141 | address, length); |
142 | 142 | ||
143 | if (ar->bmi.done_sent) { | 143 | if (ar->bmi.done_sent) { |
144 | ath10k_warn("command disallowed\n"); | 144 | ath10k_warn(ar, "command disallowed\n"); |
145 | return -EBUSY; | 145 | return -EBUSY; |
146 | } | 146 | } |
147 | 147 | ||
@@ -159,7 +159,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar, | |||
159 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, | 159 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, |
160 | NULL, NULL); | 160 | NULL, NULL); |
161 | if (ret) { | 161 | if (ret) { |
162 | ath10k_warn("unable to write to the device (%d)\n", | 162 | ath10k_warn(ar, "unable to write to the device (%d)\n", |
163 | ret); | 163 | ret); |
164 | return ret; | 164 | return ret; |
165 | } | 165 | } |
@@ -183,11 +183,11 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result) | |||
183 | u32 resplen = sizeof(resp.execute); | 183 | u32 resplen = sizeof(resp.execute); |
184 | int ret; | 184 | int ret; |
185 | 185 | ||
186 | ath10k_dbg(ATH10K_DBG_BMI, "bmi execute address 0x%x param 0x%x\n", | 186 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute address 0x%x param 0x%x\n", |
187 | address, param); | 187 | address, param); |
188 | 188 | ||
189 | if (ar->bmi.done_sent) { | 189 | if (ar->bmi.done_sent) { |
190 | ath10k_warn("command disallowed\n"); | 190 | ath10k_warn(ar, "command disallowed\n"); |
191 | return -EBUSY; | 191 | return -EBUSY; |
192 | } | 192 | } |
193 | 193 | ||
@@ -197,19 +197,19 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result) | |||
197 | 197 | ||
198 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); | 198 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); |
199 | if (ret) { | 199 | if (ret) { |
200 | ath10k_warn("unable to read from the device\n"); | 200 | ath10k_warn(ar, "unable to read from the device\n"); |
201 | return ret; | 201 | return ret; |
202 | } | 202 | } |
203 | 203 | ||
204 | if (resplen < sizeof(resp.execute)) { | 204 | if (resplen < sizeof(resp.execute)) { |
205 | ath10k_warn("invalid execute response length (%d)\n", | 205 | ath10k_warn(ar, "invalid execute response length (%d)\n", |
206 | resplen); | 206 | resplen); |
207 | return -EIO; | 207 | return -EIO; |
208 | } | 208 | } |
209 | 209 | ||
210 | *result = __le32_to_cpu(resp.execute.result); | 210 | *result = __le32_to_cpu(resp.execute.result); |
211 | 211 | ||
212 | ath10k_dbg(ATH10K_DBG_BMI, "bmi execute result 0x%x\n", *result); | 212 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute result 0x%x\n", *result); |
213 | 213 | ||
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
@@ -221,11 +221,11 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length) | |||
221 | u32 txlen; | 221 | u32 txlen; |
222 | int ret; | 222 | int ret; |
223 | 223 | ||
224 | ath10k_dbg(ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n", | 224 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n", |
225 | buffer, length); | 225 | buffer, length); |
226 | 226 | ||
227 | if (ar->bmi.done_sent) { | 227 | if (ar->bmi.done_sent) { |
228 | ath10k_warn("command disallowed\n"); | 228 | ath10k_warn(ar, "command disallowed\n"); |
229 | return -EBUSY; | 229 | return -EBUSY; |
230 | } | 230 | } |
231 | 231 | ||
@@ -241,7 +241,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length) | |||
241 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, | 241 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, |
242 | NULL, NULL); | 242 | NULL, NULL); |
243 | if (ret) { | 243 | if (ret) { |
244 | ath10k_warn("unable to write to the device\n"); | 244 | ath10k_warn(ar, "unable to write to the device\n"); |
245 | return ret; | 245 | return ret; |
246 | } | 246 | } |
247 | 247 | ||
@@ -258,11 +258,11 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address) | |||
258 | u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.lz_start); | 258 | u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.lz_start); |
259 | int ret; | 259 | int ret; |
260 | 260 | ||
261 | ath10k_dbg(ATH10K_DBG_BMI, "bmi lz stream start address 0x%x\n", | 261 | ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz stream start address 0x%x\n", |
262 | address); | 262 | address); |
263 | 263 | ||
264 | if (ar->bmi.done_sent) { | 264 | if (ar->bmi.done_sent) { |
265 | ath10k_warn("command disallowed\n"); | 265 | ath10k_warn(ar, "command disallowed\n"); |
266 | return -EBUSY; | 266 | return -EBUSY; |
267 | } | 267 | } |
268 | 268 | ||
@@ -271,7 +271,7 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address) | |||
271 | 271 | ||
272 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); | 272 | ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); |
273 | if (ret) { | 273 | if (ret) { |
274 | ath10k_warn("unable to Start LZ Stream to the device\n"); | 274 | ath10k_warn(ar, "unable to Start LZ Stream to the device\n"); |
275 | return ret; | 275 | return ret; |
276 | } | 276 | } |
277 | 277 | ||
@@ -286,7 +286,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar, | |||
286 | u32 trailer_len = length - head_len; | 286 | u32 trailer_len = length - head_len; |
287 | int ret; | 287 | int ret; |
288 | 288 | ||
289 | ath10k_dbg(ATH10K_DBG_BMI, | 289 | ath10k_dbg(ar, ATH10K_DBG_BMI, |
290 | "bmi fast download address 0x%x buffer 0x%p length %d\n", | 290 | "bmi fast download address 0x%x buffer 0x%p length %d\n", |
291 | address, buffer, length); | 291 | address, buffer, length); |
292 | 292 | ||
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index f6668162a0a8..71eef233bd01 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c | |||
@@ -284,7 +284,7 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, | |||
284 | int ret = 0; | 284 | int ret = 0; |
285 | 285 | ||
286 | if (nbytes > ce_state->src_sz_max) | 286 | if (nbytes > ce_state->src_sz_max) |
287 | ath10k_warn("%s: send more we can (nbytes: %d, max: %d)\n", | 287 | ath10k_warn(ar, "%s: send more we can (nbytes: %d, max: %d)\n", |
288 | __func__, nbytes, ce_state->src_sz_max); | 288 | __func__, nbytes, ce_state->src_sz_max); |
289 | 289 | ||
290 | if (unlikely(CE_RING_DELTA(nentries_mask, | 290 | if (unlikely(CE_RING_DELTA(nentries_mask, |
@@ -853,7 +853,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, | |||
853 | ath10k_ce_src_ring_lowmark_set(ar, ctrl_addr, 0); | 853 | ath10k_ce_src_ring_lowmark_set(ar, ctrl_addr, 0); |
854 | ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries); | 854 | ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries); |
855 | 855 | ||
856 | ath10k_dbg(ATH10K_DBG_BOOT, | 856 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
857 | "boot init ce src ring id %d entries %d base_addr %p\n", | 857 | "boot init ce src ring id %d entries %d base_addr %p\n", |
858 | ce_id, nentries, src_ring->base_addr_owner_space); | 858 | ce_id, nentries, src_ring->base_addr_owner_space); |
859 | 859 | ||
@@ -887,7 +887,7 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar, | |||
887 | ath10k_ce_dest_ring_lowmark_set(ar, ctrl_addr, 0); | 887 | ath10k_ce_dest_ring_lowmark_set(ar, ctrl_addr, 0); |
888 | ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries); | 888 | ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries); |
889 | 889 | ||
890 | ath10k_dbg(ATH10K_DBG_BOOT, | 890 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
891 | "boot ce dest ring id %d entries %d base_addr %p\n", | 891 | "boot ce dest ring id %d entries %d base_addr %p\n", |
892 | ce_id, nentries, dest_ring->base_addr_owner_space); | 892 | ce_id, nentries, dest_ring->base_addr_owner_space); |
893 | 893 | ||
@@ -1056,7 +1056,7 @@ int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, | |||
1056 | if (attr->src_nentries) { | 1056 | if (attr->src_nentries) { |
1057 | ret = ath10k_ce_init_src_ring(ar, ce_id, attr); | 1057 | ret = ath10k_ce_init_src_ring(ar, ce_id, attr); |
1058 | if (ret) { | 1058 | if (ret) { |
1059 | ath10k_err("Failed to initialize CE src ring for ID: %d (%d)\n", | 1059 | ath10k_err(ar, "Failed to initialize CE src ring for ID: %d (%d)\n", |
1060 | ce_id, ret); | 1060 | ce_id, ret); |
1061 | return ret; | 1061 | return ret; |
1062 | } | 1062 | } |
@@ -1065,7 +1065,7 @@ int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, | |||
1065 | if (attr->dest_nentries) { | 1065 | if (attr->dest_nentries) { |
1066 | ret = ath10k_ce_init_dest_ring(ar, ce_id, attr); | 1066 | ret = ath10k_ce_init_dest_ring(ar, ce_id, attr); |
1067 | if (ret) { | 1067 | if (ret) { |
1068 | ath10k_err("Failed to initialize CE dest ring for ID: %d (%d)\n", | 1068 | ath10k_err(ar, "Failed to initialize CE dest ring for ID: %d (%d)\n", |
1069 | ce_id, ret); | 1069 | ce_id, ret); |
1070 | return ret; | 1070 | return ret; |
1071 | } | 1071 | } |
@@ -1110,7 +1110,7 @@ int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id, | |||
1110 | ce_state->src_ring = ath10k_ce_alloc_src_ring(ar, ce_id, attr); | 1110 | ce_state->src_ring = ath10k_ce_alloc_src_ring(ar, ce_id, attr); |
1111 | if (IS_ERR(ce_state->src_ring)) { | 1111 | if (IS_ERR(ce_state->src_ring)) { |
1112 | ret = PTR_ERR(ce_state->src_ring); | 1112 | ret = PTR_ERR(ce_state->src_ring); |
1113 | ath10k_err("failed to allocate copy engine source ring %d: %d\n", | 1113 | ath10k_err(ar, "failed to allocate copy engine source ring %d: %d\n", |
1114 | ce_id, ret); | 1114 | ce_id, ret); |
1115 | ce_state->src_ring = NULL; | 1115 | ce_state->src_ring = NULL; |
1116 | return ret; | 1116 | return ret; |
@@ -1122,7 +1122,7 @@ int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id, | |||
1122 | attr); | 1122 | attr); |
1123 | if (IS_ERR(ce_state->dest_ring)) { | 1123 | if (IS_ERR(ce_state->dest_ring)) { |
1124 | ret = PTR_ERR(ce_state->dest_ring); | 1124 | ret = PTR_ERR(ce_state->dest_ring); |
1125 | ath10k_err("failed to allocate copy engine destination ring %d: %d\n", | 1125 | ath10k_err(ar, "failed to allocate copy engine destination ring %d: %d\n", |
1126 | ce_id, ret); | 1126 | ce_id, ret); |
1127 | ce_state->dest_ring = NULL; | 1127 | ce_state->dest_ring = NULL; |
1128 | return ret; | 1128 | return ret; |
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 157dcf906f29..651a6da8adf5 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c | |||
@@ -53,7 +53,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { | |||
53 | 53 | ||
54 | static void ath10k_send_suspend_complete(struct ath10k *ar) | 54 | static void ath10k_send_suspend_complete(struct ath10k *ar) |
55 | { | 55 | { |
56 | ath10k_dbg(ATH10K_DBG_BOOT, "boot suspend complete\n"); | 56 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot suspend complete\n"); |
57 | 57 | ||
58 | complete(&ar->target_suspend); | 58 | complete(&ar->target_suspend); |
59 | } | 59 | } |
@@ -67,14 +67,14 @@ static int ath10k_init_configure_target(struct ath10k *ar) | |||
67 | ret = ath10k_bmi_write32(ar, hi_app_host_interest, | 67 | ret = ath10k_bmi_write32(ar, hi_app_host_interest, |
68 | HTC_PROTOCOL_VERSION); | 68 | HTC_PROTOCOL_VERSION); |
69 | if (ret) { | 69 | if (ret) { |
70 | ath10k_err("settings HTC version failed\n"); | 70 | ath10k_err(ar, "settings HTC version failed\n"); |
71 | return ret; | 71 | return ret; |
72 | } | 72 | } |
73 | 73 | ||
74 | /* set the firmware mode to STA/IBSS/AP */ | 74 | /* set the firmware mode to STA/IBSS/AP */ |
75 | ret = ath10k_bmi_read32(ar, hi_option_flag, ¶m_host); | 75 | ret = ath10k_bmi_read32(ar, hi_option_flag, ¶m_host); |
76 | if (ret) { | 76 | if (ret) { |
77 | ath10k_err("setting firmware mode (1/2) failed\n"); | 77 | ath10k_err(ar, "setting firmware mode (1/2) failed\n"); |
78 | return ret; | 78 | return ret; |
79 | } | 79 | } |
80 | 80 | ||
@@ -93,14 +93,14 @@ static int ath10k_init_configure_target(struct ath10k *ar) | |||
93 | 93 | ||
94 | ret = ath10k_bmi_write32(ar, hi_option_flag, param_host); | 94 | ret = ath10k_bmi_write32(ar, hi_option_flag, param_host); |
95 | if (ret) { | 95 | if (ret) { |
96 | ath10k_err("setting firmware mode (2/2) failed\n"); | 96 | ath10k_err(ar, "setting firmware mode (2/2) failed\n"); |
97 | return ret; | 97 | return ret; |
98 | } | 98 | } |
99 | 99 | ||
100 | /* We do all byte-swapping on the host */ | 100 | /* We do all byte-swapping on the host */ |
101 | ret = ath10k_bmi_write32(ar, hi_be, 0); | 101 | ret = ath10k_bmi_write32(ar, hi_be, 0); |
102 | if (ret) { | 102 | if (ret) { |
103 | ath10k_err("setting host CPU BE mode failed\n"); | 103 | ath10k_err(ar, "setting host CPU BE mode failed\n"); |
104 | return ret; | 104 | return ret; |
105 | } | 105 | } |
106 | 106 | ||
@@ -108,7 +108,7 @@ static int ath10k_init_configure_target(struct ath10k *ar) | |||
108 | ret = ath10k_bmi_write32(ar, hi_fw_swap, 0); | 108 | ret = ath10k_bmi_write32(ar, hi_fw_swap, 0); |
109 | 109 | ||
110 | if (ret) { | 110 | if (ret) { |
111 | ath10k_err("setting FW data/desc swap flags failed\n"); | 111 | ath10k_err(ar, "setting FW data/desc swap flags failed\n"); |
112 | return ret; | 112 | return ret; |
113 | } | 113 | } |
114 | 114 | ||
@@ -146,11 +146,12 @@ static int ath10k_push_board_ext_data(struct ath10k *ar) | |||
146 | 146 | ||
147 | ret = ath10k_bmi_read32(ar, hi_board_ext_data, &board_ext_data_addr); | 147 | ret = ath10k_bmi_read32(ar, hi_board_ext_data, &board_ext_data_addr); |
148 | if (ret) { | 148 | if (ret) { |
149 | ath10k_err("could not read board ext data addr (%d)\n", ret); | 149 | ath10k_err(ar, "could not read board ext data addr (%d)\n", |
150 | ret); | ||
150 | return ret; | 151 | return ret; |
151 | } | 152 | } |
152 | 153 | ||
153 | ath10k_dbg(ATH10K_DBG_BOOT, | 154 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
154 | "boot push board extended data addr 0x%x\n", | 155 | "boot push board extended data addr 0x%x\n", |
155 | board_ext_data_addr); | 156 | board_ext_data_addr); |
156 | 157 | ||
@@ -158,7 +159,7 @@ static int ath10k_push_board_ext_data(struct ath10k *ar) | |||
158 | return 0; | 159 | return 0; |
159 | 160 | ||
160 | if (ar->board_len != (board_data_size + board_ext_data_size)) { | 161 | if (ar->board_len != (board_data_size + board_ext_data_size)) { |
161 | ath10k_err("invalid board (ext) data sizes %zu != %d+%d\n", | 162 | ath10k_err(ar, "invalid board (ext) data sizes %zu != %d+%d\n", |
162 | ar->board_len, board_data_size, board_ext_data_size); | 163 | ar->board_len, board_data_size, board_ext_data_size); |
163 | return -EINVAL; | 164 | return -EINVAL; |
164 | } | 165 | } |
@@ -167,14 +168,15 @@ static int ath10k_push_board_ext_data(struct ath10k *ar) | |||
167 | ar->board_data + board_data_size, | 168 | ar->board_data + board_data_size, |
168 | board_ext_data_size); | 169 | board_ext_data_size); |
169 | if (ret) { | 170 | if (ret) { |
170 | ath10k_err("could not write board ext data (%d)\n", ret); | 171 | ath10k_err(ar, "could not write board ext data (%d)\n", ret); |
171 | return ret; | 172 | return ret; |
172 | } | 173 | } |
173 | 174 | ||
174 | ret = ath10k_bmi_write32(ar, hi_board_ext_data_config, | 175 | ret = ath10k_bmi_write32(ar, hi_board_ext_data_config, |
175 | (board_ext_data_size << 16) | 1); | 176 | (board_ext_data_size << 16) | 1); |
176 | if (ret) { | 177 | if (ret) { |
177 | ath10k_err("could not write board ext data bit (%d)\n", ret); | 178 | ath10k_err(ar, "could not write board ext data bit (%d)\n", |
179 | ret); | ||
178 | return ret; | 180 | return ret; |
179 | } | 181 | } |
180 | 182 | ||
@@ -189,13 +191,13 @@ static int ath10k_download_board_data(struct ath10k *ar) | |||
189 | 191 | ||
190 | ret = ath10k_push_board_ext_data(ar); | 192 | ret = ath10k_push_board_ext_data(ar); |
191 | if (ret) { | 193 | if (ret) { |
192 | ath10k_err("could not push board ext data (%d)\n", ret); | 194 | ath10k_err(ar, "could not push board ext data (%d)\n", ret); |
193 | goto exit; | 195 | goto exit; |
194 | } | 196 | } |
195 | 197 | ||
196 | ret = ath10k_bmi_read32(ar, hi_board_data, &address); | 198 | ret = ath10k_bmi_read32(ar, hi_board_data, &address); |
197 | if (ret) { | 199 | if (ret) { |
198 | ath10k_err("could not read board data addr (%d)\n", ret); | 200 | ath10k_err(ar, "could not read board data addr (%d)\n", ret); |
199 | goto exit; | 201 | goto exit; |
200 | } | 202 | } |
201 | 203 | ||
@@ -203,13 +205,13 @@ static int ath10k_download_board_data(struct ath10k *ar) | |||
203 | min_t(u32, board_data_size, | 205 | min_t(u32, board_data_size, |
204 | ar->board_len)); | 206 | ar->board_len)); |
205 | if (ret) { | 207 | if (ret) { |
206 | ath10k_err("could not write board data (%d)\n", ret); | 208 | ath10k_err(ar, "could not write board data (%d)\n", ret); |
207 | goto exit; | 209 | goto exit; |
208 | } | 210 | } |
209 | 211 | ||
210 | ret = ath10k_bmi_write32(ar, hi_board_data_initialized, 1); | 212 | ret = ath10k_bmi_write32(ar, hi_board_data_initialized, 1); |
211 | if (ret) { | 213 | if (ret) { |
212 | ath10k_err("could not write board data bit (%d)\n", ret); | 214 | ath10k_err(ar, "could not write board data bit (%d)\n", ret); |
213 | goto exit; | 215 | goto exit; |
214 | } | 216 | } |
215 | 217 | ||
@@ -225,30 +227,30 @@ static int ath10k_download_and_run_otp(struct ath10k *ar) | |||
225 | /* OTP is optional */ | 227 | /* OTP is optional */ |
226 | 228 | ||
227 | if (!ar->otp_data || !ar->otp_len) { | 229 | if (!ar->otp_data || !ar->otp_len) { |
228 | ath10k_warn("Not running otp, calibration will be incorrect (otp-data %p otp_len %zd)!\n", | 230 | ath10k_warn(ar, "Not running otp, calibration will be incorrect (otp-data %p otp_len %zd)!\n", |
229 | ar->otp_data, ar->otp_len); | 231 | ar->otp_data, ar->otp_len); |
230 | return 0; | 232 | return 0; |
231 | } | 233 | } |
232 | 234 | ||
233 | ath10k_dbg(ATH10K_DBG_BOOT, "boot upload otp to 0x%x len %zd\n", | 235 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot upload otp to 0x%x len %zd\n", |
234 | address, ar->otp_len); | 236 | address, ar->otp_len); |
235 | 237 | ||
236 | ret = ath10k_bmi_fast_download(ar, address, ar->otp_data, ar->otp_len); | 238 | ret = ath10k_bmi_fast_download(ar, address, ar->otp_data, ar->otp_len); |
237 | if (ret) { | 239 | if (ret) { |
238 | ath10k_err("could not write otp (%d)\n", ret); | 240 | ath10k_err(ar, "could not write otp (%d)\n", ret); |
239 | return ret; | 241 | return ret; |
240 | } | 242 | } |
241 | 243 | ||
242 | ret = ath10k_bmi_execute(ar, address, 0, &result); | 244 | ret = ath10k_bmi_execute(ar, address, 0, &result); |
243 | if (ret) { | 245 | if (ret) { |
244 | ath10k_err("could not execute otp (%d)\n", ret); | 246 | ath10k_err(ar, "could not execute otp (%d)\n", ret); |
245 | return ret; | 247 | return ret; |
246 | } | 248 | } |
247 | 249 | ||
248 | ath10k_dbg(ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); | 250 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); |
249 | 251 | ||
250 | if (result != 0) { | 252 | if (result != 0) { |
251 | ath10k_err("otp calibration failed: %d", result); | 253 | ath10k_err(ar, "otp calibration failed: %d", result); |
252 | return -EINVAL; | 254 | return -EINVAL; |
253 | } | 255 | } |
254 | 256 | ||
@@ -265,7 +267,7 @@ static int ath10k_download_fw(struct ath10k *ar) | |||
265 | ret = ath10k_bmi_fast_download(ar, address, ar->firmware_data, | 267 | ret = ath10k_bmi_fast_download(ar, address, ar->firmware_data, |
266 | ar->firmware_len); | 268 | ar->firmware_len); |
267 | if (ret) { | 269 | if (ret) { |
268 | ath10k_err("could not write fw (%d)\n", ret); | 270 | ath10k_err(ar, "could not write fw (%d)\n", ret); |
269 | goto exit; | 271 | goto exit; |
270 | } | 272 | } |
271 | 273 | ||
@@ -302,12 +304,12 @@ static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar) | |||
302 | int ret = 0; | 304 | int ret = 0; |
303 | 305 | ||
304 | if (ar->hw_params.fw.fw == NULL) { | 306 | if (ar->hw_params.fw.fw == NULL) { |
305 | ath10k_err("firmware file not defined\n"); | 307 | ath10k_err(ar, "firmware file not defined\n"); |
306 | return -EINVAL; | 308 | return -EINVAL; |
307 | } | 309 | } |
308 | 310 | ||
309 | if (ar->hw_params.fw.board == NULL) { | 311 | if (ar->hw_params.fw.board == NULL) { |
310 | ath10k_err("board data file not defined"); | 312 | ath10k_err(ar, "board data file not defined"); |
311 | return -EINVAL; | 313 | return -EINVAL; |
312 | } | 314 | } |
313 | 315 | ||
@@ -316,7 +318,7 @@ static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar) | |||
316 | ar->hw_params.fw.board); | 318 | ar->hw_params.fw.board); |
317 | if (IS_ERR(ar->board)) { | 319 | if (IS_ERR(ar->board)) { |
318 | ret = PTR_ERR(ar->board); | 320 | ret = PTR_ERR(ar->board); |
319 | ath10k_err("could not fetch board data (%d)\n", ret); | 321 | ath10k_err(ar, "could not fetch board data (%d)\n", ret); |
320 | goto err; | 322 | goto err; |
321 | } | 323 | } |
322 | 324 | ||
@@ -328,7 +330,7 @@ static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar) | |||
328 | ar->hw_params.fw.fw); | 330 | ar->hw_params.fw.fw); |
329 | if (IS_ERR(ar->firmware)) { | 331 | if (IS_ERR(ar->firmware)) { |
330 | ret = PTR_ERR(ar->firmware); | 332 | ret = PTR_ERR(ar->firmware); |
331 | ath10k_err("could not fetch firmware (%d)\n", ret); | 333 | ath10k_err(ar, "could not fetch firmware (%d)\n", ret); |
332 | goto err; | 334 | goto err; |
333 | } | 335 | } |
334 | 336 | ||
@@ -344,7 +346,7 @@ static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar) | |||
344 | ar->hw_params.fw.otp); | 346 | ar->hw_params.fw.otp); |
345 | if (IS_ERR(ar->otp)) { | 347 | if (IS_ERR(ar->otp)) { |
346 | ret = PTR_ERR(ar->otp); | 348 | ret = PTR_ERR(ar->otp); |
347 | ath10k_err("could not fetch otp (%d)\n", ret); | 349 | ath10k_err(ar, "could not fetch otp (%d)\n", ret); |
348 | goto err; | 350 | goto err; |
349 | } | 351 | } |
350 | 352 | ||
@@ -369,7 +371,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
369 | /* first fetch the firmware file (firmware-*.bin) */ | 371 | /* first fetch the firmware file (firmware-*.bin) */ |
370 | ar->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, name); | 372 | ar->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, name); |
371 | if (IS_ERR(ar->firmware)) { | 373 | if (IS_ERR(ar->firmware)) { |
372 | ath10k_err("could not fetch firmware file '%s/%s': %ld\n", | 374 | ath10k_err(ar, "could not fetch firmware file '%s/%s': %ld\n", |
373 | ar->hw_params.fw.dir, name, PTR_ERR(ar->firmware)); | 375 | ar->hw_params.fw.dir, name, PTR_ERR(ar->firmware)); |
374 | return PTR_ERR(ar->firmware); | 376 | return PTR_ERR(ar->firmware); |
375 | } | 377 | } |
@@ -381,14 +383,14 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
381 | magic_len = strlen(ATH10K_FIRMWARE_MAGIC) + 1; | 383 | magic_len = strlen(ATH10K_FIRMWARE_MAGIC) + 1; |
382 | 384 | ||
383 | if (len < magic_len) { | 385 | if (len < magic_len) { |
384 | ath10k_err("firmware file '%s/%s' too small to contain magic: %zu\n", | 386 | ath10k_err(ar, "firmware file '%s/%s' too small to contain magic: %zu\n", |
385 | ar->hw_params.fw.dir, name, len); | 387 | ar->hw_params.fw.dir, name, len); |
386 | ret = -EINVAL; | 388 | ret = -EINVAL; |
387 | goto err; | 389 | goto err; |
388 | } | 390 | } |
389 | 391 | ||
390 | if (memcmp(data, ATH10K_FIRMWARE_MAGIC, magic_len) != 0) { | 392 | if (memcmp(data, ATH10K_FIRMWARE_MAGIC, magic_len) != 0) { |
391 | ath10k_err("invalid firmware magic\n"); | 393 | ath10k_err(ar, "invalid firmware magic\n"); |
392 | ret = -EINVAL; | 394 | ret = -EINVAL; |
393 | goto err; | 395 | goto err; |
394 | } | 396 | } |
@@ -410,7 +412,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
410 | data += sizeof(*hdr); | 412 | data += sizeof(*hdr); |
411 | 413 | ||
412 | if (len < ie_len) { | 414 | if (len < ie_len) { |
413 | ath10k_err("invalid length for FW IE %d (%zu < %zu)\n", | 415 | ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n", |
414 | ie_id, len, ie_len); | 416 | ie_id, len, ie_len); |
415 | ret = -EINVAL; | 417 | ret = -EINVAL; |
416 | goto err; | 418 | goto err; |
@@ -424,7 +426,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
424 | memcpy(ar->hw->wiphy->fw_version, data, ie_len); | 426 | memcpy(ar->hw->wiphy->fw_version, data, ie_len); |
425 | ar->hw->wiphy->fw_version[ie_len] = '\0'; | 427 | ar->hw->wiphy->fw_version[ie_len] = '\0'; |
426 | 428 | ||
427 | ath10k_dbg(ATH10K_DBG_BOOT, | 429 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
428 | "found fw version %s\n", | 430 | "found fw version %s\n", |
429 | ar->hw->wiphy->fw_version); | 431 | ar->hw->wiphy->fw_version); |
430 | break; | 432 | break; |
@@ -434,11 +436,11 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
434 | 436 | ||
435 | timestamp = (__le32 *)data; | 437 | timestamp = (__le32 *)data; |
436 | 438 | ||
437 | ath10k_dbg(ATH10K_DBG_BOOT, "found fw timestamp %d\n", | 439 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw timestamp %d\n", |
438 | le32_to_cpup(timestamp)); | 440 | le32_to_cpup(timestamp)); |
439 | break; | 441 | break; |
440 | case ATH10K_FW_IE_FEATURES: | 442 | case ATH10K_FW_IE_FEATURES: |
441 | ath10k_dbg(ATH10K_DBG_BOOT, | 443 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
442 | "found firmware features ie (%zd B)\n", | 444 | "found firmware features ie (%zd B)\n", |
443 | ie_len); | 445 | ie_len); |
444 | 446 | ||
@@ -450,19 +452,19 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
450 | break; | 452 | break; |
451 | 453 | ||
452 | if (data[index] & (1 << bit)) { | 454 | if (data[index] & (1 << bit)) { |
453 | ath10k_dbg(ATH10K_DBG_BOOT, | 455 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
454 | "Enabling feature bit: %i\n", | 456 | "Enabling feature bit: %i\n", |
455 | i); | 457 | i); |
456 | __set_bit(i, ar->fw_features); | 458 | __set_bit(i, ar->fw_features); |
457 | } | 459 | } |
458 | } | 460 | } |
459 | 461 | ||
460 | ath10k_dbg_dump(ATH10K_DBG_BOOT, "features", "", | 462 | ath10k_dbg_dump(ar, ATH10K_DBG_BOOT, "features", "", |
461 | ar->fw_features, | 463 | ar->fw_features, |
462 | sizeof(ar->fw_features)); | 464 | sizeof(ar->fw_features)); |
463 | break; | 465 | break; |
464 | case ATH10K_FW_IE_FW_IMAGE: | 466 | case ATH10K_FW_IE_FW_IMAGE: |
465 | ath10k_dbg(ATH10K_DBG_BOOT, | 467 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
466 | "found fw image ie (%zd B)\n", | 468 | "found fw image ie (%zd B)\n", |
467 | ie_len); | 469 | ie_len); |
468 | 470 | ||
@@ -471,7 +473,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
471 | 473 | ||
472 | break; | 474 | break; |
473 | case ATH10K_FW_IE_OTP_IMAGE: | 475 | case ATH10K_FW_IE_OTP_IMAGE: |
474 | ath10k_dbg(ATH10K_DBG_BOOT, | 476 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
475 | "found otp image ie (%zd B)\n", | 477 | "found otp image ie (%zd B)\n", |
476 | ie_len); | 478 | ie_len); |
477 | 479 | ||
@@ -480,7 +482,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
480 | 482 | ||
481 | break; | 483 | break; |
482 | default: | 484 | default: |
483 | ath10k_warn("Unknown FW IE: %u\n", | 485 | ath10k_warn(ar, "Unknown FW IE: %u\n", |
484 | le32_to_cpu(hdr->id)); | 486 | le32_to_cpu(hdr->id)); |
485 | break; | 487 | break; |
486 | } | 488 | } |
@@ -493,7 +495,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
493 | } | 495 | } |
494 | 496 | ||
495 | if (!ar->firmware_data || !ar->firmware_len) { | 497 | if (!ar->firmware_data || !ar->firmware_len) { |
496 | ath10k_warn("No ATH10K_FW_IE_FW_IMAGE found from '%s/%s', skipping\n", | 498 | ath10k_warn(ar, "No ATH10K_FW_IE_FW_IMAGE found from '%s/%s', skipping\n", |
497 | ar->hw_params.fw.dir, name); | 499 | ar->hw_params.fw.dir, name); |
498 | ret = -ENOMEDIUM; | 500 | ret = -ENOMEDIUM; |
499 | goto err; | 501 | goto err; |
@@ -501,14 +503,14 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
501 | 503 | ||
502 | if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features) && | 504 | if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features) && |
503 | !test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) { | 505 | !test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) { |
504 | ath10k_err("feature bits corrupted: 10.2 feature requires 10.x feature to be set as well"); | 506 | ath10k_err(ar, "feature bits corrupted: 10.2 feature requires 10.x feature to be set as well"); |
505 | ret = -EINVAL; | 507 | ret = -EINVAL; |
506 | goto err; | 508 | goto err; |
507 | } | 509 | } |
508 | 510 | ||
509 | /* now fetch the board file */ | 511 | /* now fetch the board file */ |
510 | if (ar->hw_params.fw.board == NULL) { | 512 | if (ar->hw_params.fw.board == NULL) { |
511 | ath10k_err("board data file not defined"); | 513 | ath10k_err(ar, "board data file not defined"); |
512 | ret = -EINVAL; | 514 | ret = -EINVAL; |
513 | goto err; | 515 | goto err; |
514 | } | 516 | } |
@@ -518,7 +520,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name) | |||
518 | ar->hw_params.fw.board); | 520 | ar->hw_params.fw.board); |
519 | if (IS_ERR(ar->board)) { | 521 | if (IS_ERR(ar->board)) { |
520 | ret = PTR_ERR(ar->board); | 522 | ret = PTR_ERR(ar->board); |
521 | ath10k_err("could not fetch board data '%s/%s' (%d)\n", | 523 | ath10k_err(ar, "could not fetch board data '%s/%s' (%d)\n", |
522 | ar->hw_params.fw.dir, ar->hw_params.fw.board, | 524 | ar->hw_params.fw.dir, ar->hw_params.fw.board, |
523 | ret); | 525 | ret); |
524 | goto err; | 526 | goto err; |
@@ -539,28 +541,28 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar) | |||
539 | int ret; | 541 | int ret; |
540 | 542 | ||
541 | ar->fw_api = 3; | 543 | ar->fw_api = 3; |
542 | ath10k_dbg(ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); | 544 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); |
543 | 545 | ||
544 | ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API3_FILE); | 546 | ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API3_FILE); |
545 | if (ret == 0) | 547 | if (ret == 0) |
546 | goto success; | 548 | goto success; |
547 | 549 | ||
548 | ar->fw_api = 2; | 550 | ar->fw_api = 2; |
549 | ath10k_dbg(ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); | 551 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); |
550 | 552 | ||
551 | ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE); | 553 | ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE); |
552 | if (ret == 0) | 554 | if (ret == 0) |
553 | goto success; | 555 | goto success; |
554 | 556 | ||
555 | ar->fw_api = 1; | 557 | ar->fw_api = 1; |
556 | ath10k_dbg(ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); | 558 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); |
557 | 559 | ||
558 | ret = ath10k_core_fetch_firmware_api_1(ar); | 560 | ret = ath10k_core_fetch_firmware_api_1(ar); |
559 | if (ret) | 561 | if (ret) |
560 | return ret; | 562 | return ret; |
561 | 563 | ||
562 | success: | 564 | success: |
563 | ath10k_dbg(ATH10K_DBG_BOOT, "using fw api %d\n", ar->fw_api); | 565 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "using fw api %d\n", ar->fw_api); |
564 | 566 | ||
565 | return 0; | 567 | return 0; |
566 | } | 568 | } |
@@ -571,19 +573,19 @@ static int ath10k_init_download_firmware(struct ath10k *ar) | |||
571 | 573 | ||
572 | ret = ath10k_download_board_data(ar); | 574 | ret = ath10k_download_board_data(ar); |
573 | if (ret) { | 575 | if (ret) { |
574 | ath10k_err("failed to download board data: %d\n", ret); | 576 | ath10k_err(ar, "failed to download board data: %d\n", ret); |
575 | return ret; | 577 | return ret; |
576 | } | 578 | } |
577 | 579 | ||
578 | ret = ath10k_download_and_run_otp(ar); | 580 | ret = ath10k_download_and_run_otp(ar); |
579 | if (ret) { | 581 | if (ret) { |
580 | ath10k_err("failed to run otp: %d\n", ret); | 582 | ath10k_err(ar, "failed to run otp: %d\n", ret); |
581 | return ret; | 583 | return ret; |
582 | } | 584 | } |
583 | 585 | ||
584 | ret = ath10k_download_fw(ar); | 586 | ret = ath10k_download_fw(ar); |
585 | if (ret) { | 587 | if (ret) { |
586 | ath10k_err("failed to download firmware: %d\n", ret); | 588 | ath10k_err(ar, "failed to download firmware: %d\n", ret); |
587 | return ret; | 589 | return ret; |
588 | } | 590 | } |
589 | 591 | ||
@@ -600,7 +602,7 @@ static int ath10k_init_uart(struct ath10k *ar) | |||
600 | */ | 602 | */ |
601 | ret = ath10k_bmi_write32(ar, hi_serial_enable, 0); | 603 | ret = ath10k_bmi_write32(ar, hi_serial_enable, 0); |
602 | if (ret) { | 604 | if (ret) { |
603 | ath10k_warn("could not disable UART prints (%d)\n", ret); | 605 | ath10k_warn(ar, "could not disable UART prints (%d)\n", ret); |
604 | return ret; | 606 | return ret; |
605 | } | 607 | } |
606 | 608 | ||
@@ -609,24 +611,24 @@ static int ath10k_init_uart(struct ath10k *ar) | |||
609 | 611 | ||
610 | ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, 7); | 612 | ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, 7); |
611 | if (ret) { | 613 | if (ret) { |
612 | ath10k_warn("could not enable UART prints (%d)\n", ret); | 614 | ath10k_warn(ar, "could not enable UART prints (%d)\n", ret); |
613 | return ret; | 615 | return ret; |
614 | } | 616 | } |
615 | 617 | ||
616 | ret = ath10k_bmi_write32(ar, hi_serial_enable, 1); | 618 | ret = ath10k_bmi_write32(ar, hi_serial_enable, 1); |
617 | if (ret) { | 619 | if (ret) { |
618 | ath10k_warn("could not enable UART prints (%d)\n", ret); | 620 | ath10k_warn(ar, "could not enable UART prints (%d)\n", ret); |
619 | return ret; | 621 | return ret; |
620 | } | 622 | } |
621 | 623 | ||
622 | /* Set the UART baud rate to 19200. */ | 624 | /* Set the UART baud rate to 19200. */ |
623 | ret = ath10k_bmi_write32(ar, hi_desired_baud_rate, 19200); | 625 | ret = ath10k_bmi_write32(ar, hi_desired_baud_rate, 19200); |
624 | if (ret) { | 626 | if (ret) { |
625 | ath10k_warn("could not set the baud rate (%d)\n", ret); | 627 | ath10k_warn(ar, "could not set the baud rate (%d)\n", ret); |
626 | return ret; | 628 | return ret; |
627 | } | 629 | } |
628 | 630 | ||
629 | ath10k_info("UART prints enabled\n"); | 631 | ath10k_info(ar, "UART prints enabled\n"); |
630 | return 0; | 632 | return 0; |
631 | } | 633 | } |
632 | 634 | ||
@@ -643,14 +645,14 @@ static int ath10k_init_hw_params(struct ath10k *ar) | |||
643 | } | 645 | } |
644 | 646 | ||
645 | if (i == ARRAY_SIZE(ath10k_hw_params_list)) { | 647 | if (i == ARRAY_SIZE(ath10k_hw_params_list)) { |
646 | ath10k_err("Unsupported hardware version: 0x%x\n", | 648 | ath10k_err(ar, "Unsupported hardware version: 0x%x\n", |
647 | ar->target_version); | 649 | ar->target_version); |
648 | return -EINVAL; | 650 | return -EINVAL; |
649 | } | 651 | } |
650 | 652 | ||
651 | ar->hw_params = *hw_params; | 653 | ar->hw_params = *hw_params; |
652 | 654 | ||
653 | ath10k_dbg(ATH10K_DBG_BOOT, "Hardware name %s version 0x%x\n", | 655 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "Hardware name %s version 0x%x\n", |
654 | ar->hw_params.name, ar->target_version); | 656 | ar->hw_params.name, ar->target_version); |
655 | 657 | ||
656 | return 0; | 658 | return 0; |
@@ -672,7 +674,7 @@ static void ath10k_core_restart(struct work_struct *work) | |||
672 | case ATH10K_STATE_OFF: | 674 | case ATH10K_STATE_OFF: |
673 | /* this can happen if driver is being unloaded | 675 | /* this can happen if driver is being unloaded |
674 | * or if the crash happens during FW probing */ | 676 | * or if the crash happens during FW probing */ |
675 | ath10k_warn("cannot restart a device that hasn't been started\n"); | 677 | ath10k_warn(ar, "cannot restart a device that hasn't been started\n"); |
676 | break; | 678 | break; |
677 | case ATH10K_STATE_RESTARTING: | 679 | case ATH10K_STATE_RESTARTING: |
678 | /* hw restart might be requested from multiple places */ | 680 | /* hw restart might be requested from multiple places */ |
@@ -681,7 +683,7 @@ static void ath10k_core_restart(struct work_struct *work) | |||
681 | ar->state = ATH10K_STATE_WEDGED; | 683 | ar->state = ATH10K_STATE_WEDGED; |
682 | /* fall through */ | 684 | /* fall through */ |
683 | case ATH10K_STATE_WEDGED: | 685 | case ATH10K_STATE_WEDGED: |
684 | ath10k_warn("device is wedged, will not restart\n"); | 686 | ath10k_warn(ar, "device is wedged, will not restart\n"); |
685 | break; | 687 | break; |
686 | } | 688 | } |
687 | 689 | ||
@@ -714,7 +716,7 @@ int ath10k_core_start(struct ath10k *ar) | |||
714 | 716 | ||
715 | status = ath10k_htc_init(ar); | 717 | status = ath10k_htc_init(ar); |
716 | if (status) { | 718 | if (status) { |
717 | ath10k_err("could not init HTC (%d)\n", status); | 719 | ath10k_err(ar, "could not init HTC (%d)\n", status); |
718 | goto err; | 720 | goto err; |
719 | } | 721 | } |
720 | 722 | ||
@@ -724,84 +726,85 @@ int ath10k_core_start(struct ath10k *ar) | |||
724 | 726 | ||
725 | status = ath10k_wmi_attach(ar); | 727 | status = ath10k_wmi_attach(ar); |
726 | if (status) { | 728 | if (status) { |
727 | ath10k_err("WMI attach failed: %d\n", status); | 729 | ath10k_err(ar, "WMI attach failed: %d\n", status); |
728 | goto err; | 730 | goto err; |
729 | } | 731 | } |
730 | 732 | ||
731 | status = ath10k_htt_init(ar); | 733 | status = ath10k_htt_init(ar); |
732 | if (status) { | 734 | if (status) { |
733 | ath10k_err("failed to init htt: %d\n", status); | 735 | ath10k_err(ar, "failed to init htt: %d\n", status); |
734 | goto err_wmi_detach; | 736 | goto err_wmi_detach; |
735 | } | 737 | } |
736 | 738 | ||
737 | status = ath10k_htt_tx_alloc(&ar->htt); | 739 | status = ath10k_htt_tx_alloc(&ar->htt); |
738 | if (status) { | 740 | if (status) { |
739 | ath10k_err("failed to alloc htt tx: %d\n", status); | 741 | ath10k_err(ar, "failed to alloc htt tx: %d\n", status); |
740 | goto err_wmi_detach; | 742 | goto err_wmi_detach; |
741 | } | 743 | } |
742 | 744 | ||
743 | status = ath10k_htt_rx_alloc(&ar->htt); | 745 | status = ath10k_htt_rx_alloc(&ar->htt); |
744 | if (status) { | 746 | if (status) { |
745 | ath10k_err("failed to alloc htt rx: %d\n", status); | 747 | ath10k_err(ar, "failed to alloc htt rx: %d\n", status); |
746 | goto err_htt_tx_detach; | 748 | goto err_htt_tx_detach; |
747 | } | 749 | } |
748 | 750 | ||
749 | status = ath10k_hif_start(ar); | 751 | status = ath10k_hif_start(ar); |
750 | if (status) { | 752 | if (status) { |
751 | ath10k_err("could not start HIF: %d\n", status); | 753 | ath10k_err(ar, "could not start HIF: %d\n", status); |
752 | goto err_htt_rx_detach; | 754 | goto err_htt_rx_detach; |
753 | } | 755 | } |
754 | 756 | ||
755 | status = ath10k_htc_wait_target(&ar->htc); | 757 | status = ath10k_htc_wait_target(&ar->htc); |
756 | if (status) { | 758 | if (status) { |
757 | ath10k_err("failed to connect to HTC: %d\n", status); | 759 | ath10k_err(ar, "failed to connect to HTC: %d\n", status); |
758 | goto err_hif_stop; | 760 | goto err_hif_stop; |
759 | } | 761 | } |
760 | 762 | ||
761 | status = ath10k_htt_connect(&ar->htt); | 763 | status = ath10k_htt_connect(&ar->htt); |
762 | if (status) { | 764 | if (status) { |
763 | ath10k_err("failed to connect htt (%d)\n", status); | 765 | ath10k_err(ar, "failed to connect htt (%d)\n", status); |
764 | goto err_hif_stop; | 766 | goto err_hif_stop; |
765 | } | 767 | } |
766 | 768 | ||
767 | status = ath10k_wmi_connect(ar); | 769 | status = ath10k_wmi_connect(ar); |
768 | if (status) { | 770 | if (status) { |
769 | ath10k_err("could not connect wmi: %d\n", status); | 771 | ath10k_err(ar, "could not connect wmi: %d\n", status); |
770 | goto err_hif_stop; | 772 | goto err_hif_stop; |
771 | } | 773 | } |
772 | 774 | ||
773 | status = ath10k_htc_start(&ar->htc); | 775 | status = ath10k_htc_start(&ar->htc); |
774 | if (status) { | 776 | if (status) { |
775 | ath10k_err("failed to start htc: %d\n", status); | 777 | ath10k_err(ar, "failed to start htc: %d\n", status); |
776 | goto err_hif_stop; | 778 | goto err_hif_stop; |
777 | } | 779 | } |
778 | 780 | ||
779 | status = ath10k_wmi_wait_for_service_ready(ar); | 781 | status = ath10k_wmi_wait_for_service_ready(ar); |
780 | if (status <= 0) { | 782 | if (status <= 0) { |
781 | ath10k_warn("wmi service ready event not received"); | 783 | ath10k_warn(ar, "wmi service ready event not received"); |
782 | status = -ETIMEDOUT; | 784 | status = -ETIMEDOUT; |
783 | goto err_hif_stop; | 785 | goto err_hif_stop; |
784 | } | 786 | } |
785 | 787 | ||
786 | ath10k_dbg(ATH10K_DBG_BOOT, "firmware %s booted\n", | 788 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "firmware %s booted\n", |
787 | ar->hw->wiphy->fw_version); | 789 | ar->hw->wiphy->fw_version); |
788 | 790 | ||
789 | status = ath10k_wmi_cmd_init(ar); | 791 | status = ath10k_wmi_cmd_init(ar); |
790 | if (status) { | 792 | if (status) { |
791 | ath10k_err("could not send WMI init command (%d)\n", status); | 793 | ath10k_err(ar, "could not send WMI init command (%d)\n", |
794 | status); | ||
792 | goto err_hif_stop; | 795 | goto err_hif_stop; |
793 | } | 796 | } |
794 | 797 | ||
795 | status = ath10k_wmi_wait_for_unified_ready(ar); | 798 | status = ath10k_wmi_wait_for_unified_ready(ar); |
796 | if (status <= 0) { | 799 | if (status <= 0) { |
797 | ath10k_err("wmi unified ready event not received\n"); | 800 | ath10k_err(ar, "wmi unified ready event not received\n"); |
798 | status = -ETIMEDOUT; | 801 | status = -ETIMEDOUT; |
799 | goto err_hif_stop; | 802 | goto err_hif_stop; |
800 | } | 803 | } |
801 | 804 | ||
802 | status = ath10k_htt_setup(&ar->htt); | 805 | status = ath10k_htt_setup(&ar->htt); |
803 | if (status) { | 806 | if (status) { |
804 | ath10k_err("failed to setup htt: %d\n", status); | 807 | ath10k_err(ar, "failed to setup htt: %d\n", status); |
805 | goto err_hif_stop; | 808 | goto err_hif_stop; |
806 | } | 809 | } |
807 | 810 | ||
@@ -839,14 +842,14 @@ int ath10k_wait_for_suspend(struct ath10k *ar, u32 suspend_opt) | |||
839 | 842 | ||
840 | ret = ath10k_wmi_pdev_suspend_target(ar, suspend_opt); | 843 | ret = ath10k_wmi_pdev_suspend_target(ar, suspend_opt); |
841 | if (ret) { | 844 | if (ret) { |
842 | ath10k_warn("could not suspend target (%d)\n", ret); | 845 | ath10k_warn(ar, "could not suspend target (%d)\n", ret); |
843 | return ret; | 846 | return ret; |
844 | } | 847 | } |
845 | 848 | ||
846 | ret = wait_for_completion_timeout(&ar->target_suspend, 1 * HZ); | 849 | ret = wait_for_completion_timeout(&ar->target_suspend, 1 * HZ); |
847 | 850 | ||
848 | if (ret == 0) { | 851 | if (ret == 0) { |
849 | ath10k_warn("suspend timed out - target pause event never came\n"); | 852 | ath10k_warn(ar, "suspend timed out - target pause event never came\n"); |
850 | return -ETIMEDOUT; | 853 | return -ETIMEDOUT; |
851 | } | 854 | } |
852 | 855 | ||
@@ -880,14 +883,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar) | |||
880 | 883 | ||
881 | ret = ath10k_hif_power_up(ar); | 884 | ret = ath10k_hif_power_up(ar); |
882 | if (ret) { | 885 | if (ret) { |
883 | ath10k_err("could not start pci hif (%d)\n", ret); | 886 | ath10k_err(ar, "could not start pci hif (%d)\n", ret); |
884 | return ret; | 887 | return ret; |
885 | } | 888 | } |
886 | 889 | ||
887 | memset(&target_info, 0, sizeof(target_info)); | 890 | memset(&target_info, 0, sizeof(target_info)); |
888 | ret = ath10k_bmi_get_target_info(ar, &target_info); | 891 | ret = ath10k_bmi_get_target_info(ar, &target_info); |
889 | if (ret) { | 892 | if (ret) { |
890 | ath10k_err("could not get target info (%d)\n", ret); | 893 | ath10k_err(ar, "could not get target info (%d)\n", ret); |
891 | ath10k_hif_power_down(ar); | 894 | ath10k_hif_power_down(ar); |
892 | return ret; | 895 | return ret; |
893 | } | 896 | } |
@@ -897,14 +900,14 @@ static int ath10k_core_probe_fw(struct ath10k *ar) | |||
897 | 900 | ||
898 | ret = ath10k_init_hw_params(ar); | 901 | ret = ath10k_init_hw_params(ar); |
899 | if (ret) { | 902 | if (ret) { |
900 | ath10k_err("could not get hw params (%d)\n", ret); | 903 | ath10k_err(ar, "could not get hw params (%d)\n", ret); |
901 | ath10k_hif_power_down(ar); | 904 | ath10k_hif_power_down(ar); |
902 | return ret; | 905 | return ret; |
903 | } | 906 | } |
904 | 907 | ||
905 | ret = ath10k_core_fetch_firmware_files(ar); | 908 | ret = ath10k_core_fetch_firmware_files(ar); |
906 | if (ret) { | 909 | if (ret) { |
907 | ath10k_err("could not fetch firmware files (%d)\n", ret); | 910 | ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); |
908 | ath10k_hif_power_down(ar); | 911 | ath10k_hif_power_down(ar); |
909 | return ret; | 912 | return ret; |
910 | } | 913 | } |
@@ -913,7 +916,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) | |||
913 | 916 | ||
914 | ret = ath10k_core_start(ar); | 917 | ret = ath10k_core_start(ar); |
915 | if (ret) { | 918 | if (ret) { |
916 | ath10k_err("could not init core (%d)\n", ret); | 919 | ath10k_err(ar, "could not init core (%d)\n", ret); |
917 | ath10k_core_free_firmware_files(ar); | 920 | ath10k_core_free_firmware_files(ar); |
918 | ath10k_hif_power_down(ar); | 921 | ath10k_hif_power_down(ar); |
919 | mutex_unlock(&ar->conf_mutex); | 922 | mutex_unlock(&ar->conf_mutex); |
@@ -933,7 +936,7 @@ static int ath10k_core_check_chip_id(struct ath10k *ar) | |||
933 | { | 936 | { |
934 | u32 hw_revision = MS(ar->chip_id, SOC_CHIP_ID_REV); | 937 | u32 hw_revision = MS(ar->chip_id, SOC_CHIP_ID_REV); |
935 | 938 | ||
936 | ath10k_dbg(ATH10K_DBG_BOOT, "boot chip_id 0x%08x hw_revision 0x%x\n", | 939 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot chip_id 0x%08x hw_revision 0x%x\n", |
937 | ar->chip_id, hw_revision); | 940 | ar->chip_id, hw_revision); |
938 | 941 | ||
939 | /* Check that we are not using hw1.0 (some of them have same pci id | 942 | /* Check that we are not using hw1.0 (some of them have same pci id |
@@ -941,7 +944,7 @@ static int ath10k_core_check_chip_id(struct ath10k *ar) | |||
941 | * due to missing hw1.0 workarounds. */ | 944 | * due to missing hw1.0 workarounds. */ |
942 | switch (hw_revision) { | 945 | switch (hw_revision) { |
943 | case QCA988X_HW_1_0_CHIP_ID_REV: | 946 | case QCA988X_HW_1_0_CHIP_ID_REV: |
944 | ath10k_err("ERROR: qca988x hw1.0 is not supported\n"); | 947 | ath10k_err(ar, "ERROR: qca988x hw1.0 is not supported\n"); |
945 | return -EOPNOTSUPP; | 948 | return -EOPNOTSUPP; |
946 | 949 | ||
947 | case QCA988X_HW_2_0_CHIP_ID_REV: | 950 | case QCA988X_HW_2_0_CHIP_ID_REV: |
@@ -949,7 +952,7 @@ static int ath10k_core_check_chip_id(struct ath10k *ar) | |||
949 | return 0; | 952 | return 0; |
950 | 953 | ||
951 | default: | 954 | default: |
952 | ath10k_warn("Warning: hardware revision unknown (0x%x), expect problems\n", | 955 | ath10k_warn(ar, "Warning: hardware revision unknown (0x%x), expect problems\n", |
953 | ar->chip_id); | 956 | ar->chip_id); |
954 | return 0; | 957 | return 0; |
955 | } | 958 | } |
@@ -964,25 +967,25 @@ static void ath10k_core_register_work(struct work_struct *work) | |||
964 | 967 | ||
965 | status = ath10k_core_probe_fw(ar); | 968 | status = ath10k_core_probe_fw(ar); |
966 | if (status) { | 969 | if (status) { |
967 | ath10k_err("could not probe fw (%d)\n", status); | 970 | ath10k_err(ar, "could not probe fw (%d)\n", status); |
968 | goto err; | 971 | goto err; |
969 | } | 972 | } |
970 | 973 | ||
971 | status = ath10k_mac_register(ar); | 974 | status = ath10k_mac_register(ar); |
972 | if (status) { | 975 | if (status) { |
973 | ath10k_err("could not register to mac80211 (%d)\n", status); | 976 | ath10k_err(ar, "could not register to mac80211 (%d)\n", status); |
974 | goto err_release_fw; | 977 | goto err_release_fw; |
975 | } | 978 | } |
976 | 979 | ||
977 | status = ath10k_debug_create(ar); | 980 | status = ath10k_debug_create(ar); |
978 | if (status) { | 981 | if (status) { |
979 | ath10k_err("unable to initialize debugfs\n"); | 982 | ath10k_err(ar, "unable to initialize debugfs\n"); |
980 | goto err_unregister_mac; | 983 | goto err_unregister_mac; |
981 | } | 984 | } |
982 | 985 | ||
983 | status = ath10k_spectral_create(ar); | 986 | status = ath10k_spectral_create(ar); |
984 | if (status) { | 987 | if (status) { |
985 | ath10k_err("failed to initialize spectral\n"); | 988 | ath10k_err(ar, "failed to initialize spectral\n"); |
986 | goto err_debug_destroy; | 989 | goto err_debug_destroy; |
987 | } | 990 | } |
988 | 991 | ||
@@ -1010,7 +1013,7 @@ int ath10k_core_register(struct ath10k *ar, u32 chip_id) | |||
1010 | 1013 | ||
1011 | status = ath10k_core_check_chip_id(ar); | 1014 | status = ath10k_core_check_chip_id(ar); |
1012 | if (status) { | 1015 | if (status) { |
1013 | ath10k_err("Unsupported chip id 0x%08x\n", ar->chip_id); | 1016 | ath10k_err(ar, "Unsupported chip id 0x%08x\n", ar->chip_id); |
1014 | return status; | 1017 | return status; |
1015 | } | 1018 | } |
1016 | 1019 | ||
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 442fe93d18be..f3f0a80f8bab 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c | |||
@@ -106,25 +106,7 @@ struct ath10k_dump_file_data { | |||
106 | u8 data[0]; | 106 | u8 data[0]; |
107 | } __packed; | 107 | } __packed; |
108 | 108 | ||
109 | static int ath10k_printk(const char *level, const char *fmt, ...) | 109 | int ath10k_info(struct ath10k *ar, const char *fmt, ...) |
110 | { | ||
111 | struct va_format vaf; | ||
112 | va_list args; | ||
113 | int rtn; | ||
114 | |||
115 | va_start(args, fmt); | ||
116 | |||
117 | vaf.fmt = fmt; | ||
118 | vaf.va = &args; | ||
119 | |||
120 | rtn = printk("%sath10k: %pV", level, &vaf); | ||
121 | |||
122 | va_end(args); | ||
123 | |||
124 | return rtn; | ||
125 | } | ||
126 | |||
127 | int ath10k_info(const char *fmt, ...) | ||
128 | { | 110 | { |
129 | struct va_format vaf = { | 111 | struct va_format vaf = { |
130 | .fmt = fmt, | 112 | .fmt = fmt, |
@@ -134,7 +116,7 @@ int ath10k_info(const char *fmt, ...) | |||
134 | 116 | ||
135 | va_start(args, fmt); | 117 | va_start(args, fmt); |
136 | vaf.va = &args; | 118 | vaf.va = &args; |
137 | ret = ath10k_printk(KERN_INFO, "%pV", &vaf); | 119 | ret = dev_info(ar->dev, "%pV", &vaf); |
138 | trace_ath10k_log_info(&vaf); | 120 | trace_ath10k_log_info(&vaf); |
139 | va_end(args); | 121 | va_end(args); |
140 | 122 | ||
@@ -144,7 +126,7 @@ EXPORT_SYMBOL(ath10k_info); | |||
144 | 126 | ||
145 | void ath10k_print_driver_info(struct ath10k *ar) | 127 | void ath10k_print_driver_info(struct ath10k *ar) |
146 | { | 128 | { |
147 | ath10k_info("%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d\n", | 129 | ath10k_info(ar, "%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d\n", |
148 | ar->hw_params.name, | 130 | ar->hw_params.name, |
149 | ar->target_version, | 131 | ar->target_version, |
150 | ar->chip_id, | 132 | ar->chip_id, |
@@ -152,7 +134,7 @@ void ath10k_print_driver_info(struct ath10k *ar) | |||
152 | ar->fw_api, | 134 | ar->fw_api, |
153 | ar->htt.target_version_major, | 135 | ar->htt.target_version_major, |
154 | ar->htt.target_version_minor); | 136 | ar->htt.target_version_minor); |
155 | ath10k_info("debug %d debugfs %d tracing %d dfs %d\n", | 137 | ath10k_info(ar, "debug %d debugfs %d tracing %d dfs %d\n", |
156 | config_enabled(CONFIG_ATH10K_DEBUG), | 138 | config_enabled(CONFIG_ATH10K_DEBUG), |
157 | config_enabled(CONFIG_ATH10K_DEBUGFS), | 139 | config_enabled(CONFIG_ATH10K_DEBUGFS), |
158 | config_enabled(CONFIG_ATH10K_TRACING), | 140 | config_enabled(CONFIG_ATH10K_TRACING), |
@@ -160,7 +142,7 @@ void ath10k_print_driver_info(struct ath10k *ar) | |||
160 | } | 142 | } |
161 | EXPORT_SYMBOL(ath10k_print_driver_info); | 143 | EXPORT_SYMBOL(ath10k_print_driver_info); |
162 | 144 | ||
163 | int ath10k_err(const char *fmt, ...) | 145 | int ath10k_err(struct ath10k *ar, const char *fmt, ...) |
164 | { | 146 | { |
165 | struct va_format vaf = { | 147 | struct va_format vaf = { |
166 | .fmt = fmt, | 148 | .fmt = fmt, |
@@ -170,7 +152,7 @@ int ath10k_err(const char *fmt, ...) | |||
170 | 152 | ||
171 | va_start(args, fmt); | 153 | va_start(args, fmt); |
172 | vaf.va = &args; | 154 | vaf.va = &args; |
173 | ret = ath10k_printk(KERN_ERR, "%pV", &vaf); | 155 | ret = dev_err(ar->dev, "%pV", &vaf); |
174 | trace_ath10k_log_err(&vaf); | 156 | trace_ath10k_log_err(&vaf); |
175 | va_end(args); | 157 | va_end(args); |
176 | 158 | ||
@@ -178,25 +160,21 @@ int ath10k_err(const char *fmt, ...) | |||
178 | } | 160 | } |
179 | EXPORT_SYMBOL(ath10k_err); | 161 | EXPORT_SYMBOL(ath10k_err); |
180 | 162 | ||
181 | int ath10k_warn(const char *fmt, ...) | 163 | int ath10k_warn(struct ath10k *ar, const char *fmt, ...) |
182 | { | 164 | { |
183 | struct va_format vaf = { | 165 | struct va_format vaf = { |
184 | .fmt = fmt, | 166 | .fmt = fmt, |
185 | }; | 167 | }; |
186 | va_list args; | 168 | va_list args; |
187 | int ret = 0; | ||
188 | 169 | ||
189 | va_start(args, fmt); | 170 | va_start(args, fmt); |
190 | vaf.va = &args; | 171 | vaf.va = &args; |
191 | 172 | dev_warn_ratelimited(ar->dev, "%pV", &vaf); | |
192 | if (net_ratelimit()) | ||
193 | ret = ath10k_printk(KERN_WARNING, "%pV", &vaf); | ||
194 | |||
195 | trace_ath10k_log_warn(&vaf); | 173 | trace_ath10k_log_warn(&vaf); |
196 | 174 | ||
197 | va_end(args); | 175 | va_end(args); |
198 | 176 | ||
199 | return ret; | 177 | return 0; |
200 | } | 178 | } |
201 | EXPORT_SYMBOL(ath10k_warn); | 179 | EXPORT_SYMBOL(ath10k_warn); |
202 | 180 | ||
@@ -417,7 +395,7 @@ static ssize_t ath10k_read_fw_stats(struct file *file, char __user *user_buf, | |||
417 | 395 | ||
418 | ret = ath10k_wmi_request_stats(ar, WMI_REQUEST_PEER_STAT); | 396 | ret = ath10k_wmi_request_stats(ar, WMI_REQUEST_PEER_STAT); |
419 | if (ret) { | 397 | if (ret) { |
420 | ath10k_warn("could not request stats (%d)\n", ret); | 398 | ath10k_warn(ar, "could not request stats (%d)\n", ret); |
421 | goto exit; | 399 | goto exit; |
422 | } | 400 | } |
423 | 401 | ||
@@ -635,10 +613,10 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file, | |||
635 | } | 613 | } |
636 | 614 | ||
637 | if (!strcmp(buf, "soft")) { | 615 | if (!strcmp(buf, "soft")) { |
638 | ath10k_info("simulating soft firmware crash\n"); | 616 | ath10k_info(ar, "simulating soft firmware crash\n"); |
639 | ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0); | 617 | ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0); |
640 | } else if (!strcmp(buf, "hard")) { | 618 | } else if (!strcmp(buf, "hard")) { |
641 | ath10k_info("simulating hard firmware crash\n"); | 619 | ath10k_info(ar, "simulating hard firmware crash\n"); |
642 | /* 0x7fff is vdev id, and it is always out of range for all | 620 | /* 0x7fff is vdev id, and it is always out of range for all |
643 | * firmware variants in order to force a firmware crash. | 621 | * firmware variants in order to force a firmware crash. |
644 | */ | 622 | */ |
@@ -650,7 +628,7 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file, | |||
650 | } | 628 | } |
651 | 629 | ||
652 | if (ret) { | 630 | if (ret) { |
653 | ath10k_warn("failed to simulate firmware crash: %d\n", ret); | 631 | ath10k_warn(ar, "failed to simulate firmware crash: %d\n", ret); |
654 | goto exit; | 632 | goto exit; |
655 | } | 633 | } |
656 | 634 | ||
@@ -839,7 +817,7 @@ static int ath10k_debug_htt_stats_req(struct ath10k *ar) | |||
839 | ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask, | 817 | ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask, |
840 | cookie); | 818 | cookie); |
841 | if (ret) { | 819 | if (ret) { |
842 | ath10k_warn("failed to send htt stats request: %d\n", ret); | 820 | ath10k_warn(ar, "failed to send htt stats request: %d\n", ret); |
843 | return ret; | 821 | return ret; |
844 | } | 822 | } |
845 | 823 | ||
@@ -1013,7 +991,7 @@ static ssize_t ath10k_write_fw_dbglog(struct file *file, | |||
1013 | if (ar->state == ATH10K_STATE_ON) { | 991 | if (ar->state == ATH10K_STATE_ON) { |
1014 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); | 992 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); |
1015 | if (ret) { | 993 | if (ret) { |
1016 | ath10k_warn("dbglog cfg failed from debugfs: %d\n", | 994 | ath10k_warn(ar, "dbglog cfg failed from debugfs: %d\n", |
1017 | ret); | 995 | ret); |
1018 | goto exit; | 996 | goto exit; |
1019 | } | 997 | } |
@@ -1044,13 +1022,14 @@ int ath10k_debug_start(struct ath10k *ar) | |||
1044 | ret = ath10k_debug_htt_stats_req(ar); | 1022 | ret = ath10k_debug_htt_stats_req(ar); |
1045 | if (ret) | 1023 | if (ret) |
1046 | /* continue normally anyway, this isn't serious */ | 1024 | /* continue normally anyway, this isn't serious */ |
1047 | ath10k_warn("failed to start htt stats workqueue: %d\n", ret); | 1025 | ath10k_warn(ar, "failed to start htt stats workqueue: %d\n", |
1026 | ret); | ||
1048 | 1027 | ||
1049 | if (ar->debug.fw_dbglog_mask) { | 1028 | if (ar->debug.fw_dbglog_mask) { |
1050 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); | 1029 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); |
1051 | if (ret) | 1030 | if (ret) |
1052 | /* not serious */ | 1031 | /* not serious */ |
1053 | ath10k_warn("failed to enable dbglog during start: %d", | 1032 | ath10k_warn(ar, "failed to enable dbglog during start: %d", |
1054 | ret); | 1033 | ret); |
1055 | } | 1034 | } |
1056 | 1035 | ||
@@ -1230,7 +1209,8 @@ void ath10k_debug_destroy(struct ath10k *ar) | |||
1230 | #endif /* CONFIG_ATH10K_DEBUGFS */ | 1209 | #endif /* CONFIG_ATH10K_DEBUGFS */ |
1231 | 1210 | ||
1232 | #ifdef CONFIG_ATH10K_DEBUG | 1211 | #ifdef CONFIG_ATH10K_DEBUG |
1233 | void ath10k_dbg(enum ath10k_debug_mask mask, const char *fmt, ...) | 1212 | void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask, |
1213 | const char *fmt, ...) | ||
1234 | { | 1214 | { |
1235 | struct va_format vaf; | 1215 | struct va_format vaf; |
1236 | va_list args; | 1216 | va_list args; |
@@ -1241,7 +1221,7 @@ void ath10k_dbg(enum ath10k_debug_mask mask, const char *fmt, ...) | |||
1241 | vaf.va = &args; | 1221 | vaf.va = &args; |
1242 | 1222 | ||
1243 | if (ath10k_debug_mask & mask) | 1223 | if (ath10k_debug_mask & mask) |
1244 | ath10k_printk(KERN_DEBUG, "%pV", &vaf); | 1224 | dev_printk(KERN_DEBUG, ar->dev, "%pV", &vaf); |
1245 | 1225 | ||
1246 | trace_ath10k_log_dbg(mask, &vaf); | 1226 | trace_ath10k_log_dbg(mask, &vaf); |
1247 | 1227 | ||
@@ -1249,13 +1229,14 @@ void ath10k_dbg(enum ath10k_debug_mask mask, const char *fmt, ...) | |||
1249 | } | 1229 | } |
1250 | EXPORT_SYMBOL(ath10k_dbg); | 1230 | EXPORT_SYMBOL(ath10k_dbg); |
1251 | 1231 | ||
1252 | void ath10k_dbg_dump(enum ath10k_debug_mask mask, | 1232 | void ath10k_dbg_dump(struct ath10k *ar, |
1233 | enum ath10k_debug_mask mask, | ||
1253 | const char *msg, const char *prefix, | 1234 | const char *msg, const char *prefix, |
1254 | const void *buf, size_t len) | 1235 | const void *buf, size_t len) |
1255 | { | 1236 | { |
1256 | if (ath10k_debug_mask & mask) { | 1237 | if (ath10k_debug_mask & mask) { |
1257 | if (msg) | 1238 | if (msg) |
1258 | ath10k_dbg(mask, "%s\n", msg); | 1239 | ath10k_dbg(ar, mask, "%s\n", msg); |
1259 | 1240 | ||
1260 | print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len); | 1241 | print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len); |
1261 | } | 1242 | } |
diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h index 47ee4a623af6..56746539bea2 100644 --- a/drivers/net/wireless/ath/ath10k/debug.h +++ b/drivers/net/wireless/ath/ath10k/debug.h | |||
@@ -39,9 +39,9 @@ enum ath10k_debug_mask { | |||
39 | 39 | ||
40 | extern unsigned int ath10k_debug_mask; | 40 | extern unsigned int ath10k_debug_mask; |
41 | 41 | ||
42 | __printf(1, 2) int ath10k_info(const char *fmt, ...); | 42 | __printf(2, 3) int ath10k_info(struct ath10k *ar, const char *fmt, ...); |
43 | __printf(1, 2) int ath10k_err(const char *fmt, ...); | 43 | __printf(2, 3) int ath10k_err(struct ath10k *ar, const char *fmt, ...); |
44 | __printf(1, 2) int ath10k_warn(const char *fmt, ...); | 44 | __printf(2, 3) int ath10k_warn(struct ath10k *ar, const char *fmt, ...); |
45 | void ath10k_print_driver_info(struct ath10k *ar); | 45 | void ath10k_print_driver_info(struct ath10k *ar); |
46 | 46 | ||
47 | #ifdef CONFIG_ATH10K_DEBUGFS | 47 | #ifdef CONFIG_ATH10K_DEBUGFS |
@@ -107,20 +107,24 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar) | |||
107 | #endif /* CONFIG_ATH10K_DEBUGFS */ | 107 | #endif /* CONFIG_ATH10K_DEBUGFS */ |
108 | 108 | ||
109 | #ifdef CONFIG_ATH10K_DEBUG | 109 | #ifdef CONFIG_ATH10K_DEBUG |
110 | __printf(2, 3) void ath10k_dbg(enum ath10k_debug_mask mask, | 110 | __printf(3, 4) void ath10k_dbg(struct ath10k *ar, |
111 | enum ath10k_debug_mask mask, | ||
111 | const char *fmt, ...); | 112 | const char *fmt, ...); |
112 | void ath10k_dbg_dump(enum ath10k_debug_mask mask, | 113 | void ath10k_dbg_dump(struct ath10k *ar, |
114 | enum ath10k_debug_mask mask, | ||
113 | const char *msg, const char *prefix, | 115 | const char *msg, const char *prefix, |
114 | const void *buf, size_t len); | 116 | const void *buf, size_t len); |
115 | #else /* CONFIG_ATH10K_DEBUG */ | 117 | #else /* CONFIG_ATH10K_DEBUG */ |
116 | 118 | ||
117 | static inline int ath10k_dbg(enum ath10k_debug_mask dbg_mask, | 119 | static inline int ath10k_dbg(struct ath10k *ar, |
120 | enum ath10k_debug_mask dbg_mask, | ||
118 | const char *fmt, ...) | 121 | const char *fmt, ...) |
119 | { | 122 | { |
120 | return 0; | 123 | return 0; |
121 | } | 124 | } |
122 | 125 | ||
123 | static inline void ath10k_dbg_dump(enum ath10k_debug_mask mask, | 126 | static inline void ath10k_dbg_dump(struct ath10k *ar, |
127 | enum ath10k_debug_mask mask, | ||
124 | const char *msg, const char *prefix, | 128 | const char *msg, const char *prefix, |
125 | const void *buf, size_t len) | 129 | const void *buf, size_t len) |
126 | { | 130 | { |
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 7e08bb328847..fd9a251f0659 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c | |||
@@ -46,7 +46,7 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void *ar) | |||
46 | 46 | ||
47 | skb = dev_alloc_skb(ATH10K_HTC_CONTROL_BUFFER_SIZE); | 47 | skb = dev_alloc_skb(ATH10K_HTC_CONTROL_BUFFER_SIZE); |
48 | if (!skb) { | 48 | if (!skb) { |
49 | ath10k_warn("Unable to allocate ctrl skb\n"); | 49 | ath10k_warn(ar, "Unable to allocate ctrl skb\n"); |
50 | return NULL; | 50 | return NULL; |
51 | } | 51 | } |
52 | 52 | ||
@@ -56,7 +56,7 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void *ar) | |||
56 | skb_cb = ATH10K_SKB_CB(skb); | 56 | skb_cb = ATH10K_SKB_CB(skb); |
57 | memset(skb_cb, 0, sizeof(*skb_cb)); | 57 | memset(skb_cb, 0, sizeof(*skb_cb)); |
58 | 58 | ||
59 | ath10k_dbg(ATH10K_DBG_HTC, "%s: skb %p\n", __func__, skb); | 59 | ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %p\n", __func__, skb); |
60 | return skb; | 60 | return skb; |
61 | } | 61 | } |
62 | 62 | ||
@@ -72,13 +72,15 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, | |||
72 | static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, | 72 | static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, |
73 | struct sk_buff *skb) | 73 | struct sk_buff *skb) |
74 | { | 74 | { |
75 | ath10k_dbg(ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__, | 75 | struct ath10k *ar = ep->htc->ar; |
76 | |||
77 | ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__, | ||
76 | ep->eid, skb); | 78 | ep->eid, skb); |
77 | 79 | ||
78 | ath10k_htc_restore_tx_skb(ep->htc, skb); | 80 | ath10k_htc_restore_tx_skb(ep->htc, skb); |
79 | 81 | ||
80 | if (!ep->ep_ops.ep_tx_complete) { | 82 | if (!ep->ep_ops.ep_tx_complete) { |
81 | ath10k_warn("no tx handler for eid %d\n", ep->eid); | 83 | ath10k_warn(ar, "no tx handler for eid %d\n", ep->eid); |
82 | dev_kfree_skb_any(skb); | 84 | dev_kfree_skb_any(skb); |
83 | return; | 85 | return; |
84 | } | 86 | } |
@@ -89,12 +91,14 @@ static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, | |||
89 | /* assumes tx_lock is held */ | 91 | /* assumes tx_lock is held */ |
90 | static bool ath10k_htc_ep_need_credit_update(struct ath10k_htc_ep *ep) | 92 | static bool ath10k_htc_ep_need_credit_update(struct ath10k_htc_ep *ep) |
91 | { | 93 | { |
94 | struct ath10k *ar = ep->htc->ar; | ||
95 | |||
92 | if (!ep->tx_credit_flow_enabled) | 96 | if (!ep->tx_credit_flow_enabled) |
93 | return false; | 97 | return false; |
94 | if (ep->tx_credits >= ep->tx_credits_per_max_message) | 98 | if (ep->tx_credits >= ep->tx_credits_per_max_message) |
95 | return false; | 99 | return false; |
96 | 100 | ||
97 | ath10k_dbg(ATH10K_DBG_HTC, "HTC: endpoint %d needs credit update\n", | 101 | ath10k_dbg(ar, ATH10K_DBG_HTC, "HTC: endpoint %d needs credit update\n", |
98 | ep->eid); | 102 | ep->eid); |
99 | return true; | 103 | return true; |
100 | } | 104 | } |
@@ -123,6 +127,7 @@ int ath10k_htc_send(struct ath10k_htc *htc, | |||
123 | enum ath10k_htc_ep_id eid, | 127 | enum ath10k_htc_ep_id eid, |
124 | struct sk_buff *skb) | 128 | struct sk_buff *skb) |
125 | { | 129 | { |
130 | struct ath10k *ar = htc->ar; | ||
126 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; | 131 | struct ath10k_htc_ep *ep = &htc->endpoint[eid]; |
127 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); | 132 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); |
128 | struct ath10k_hif_sg_item sg_item; | 133 | struct ath10k_hif_sg_item sg_item; |
@@ -134,7 +139,7 @@ int ath10k_htc_send(struct ath10k_htc *htc, | |||
134 | return -ECOMM; | 139 | return -ECOMM; |
135 | 140 | ||
136 | if (eid >= ATH10K_HTC_EP_COUNT) { | 141 | if (eid >= ATH10K_HTC_EP_COUNT) { |
137 | ath10k_warn("Invalid endpoint id: %d\n", eid); | 142 | ath10k_warn(ar, "Invalid endpoint id: %d\n", eid); |
138 | return -ENOENT; | 143 | return -ENOENT; |
139 | } | 144 | } |
140 | 145 | ||
@@ -149,7 +154,7 @@ int ath10k_htc_send(struct ath10k_htc *htc, | |||
149 | goto err_pull; | 154 | goto err_pull; |
150 | } | 155 | } |
151 | ep->tx_credits -= credits; | 156 | ep->tx_credits -= credits; |
152 | ath10k_dbg(ATH10K_DBG_HTC, | 157 | ath10k_dbg(ar, ATH10K_DBG_HTC, |
153 | "htc ep %d consumed %d credits (total %d)\n", | 158 | "htc ep %d consumed %d credits (total %d)\n", |
154 | eid, credits, ep->tx_credits); | 159 | eid, credits, ep->tx_credits); |
155 | spin_unlock_bh(&htc->tx_lock); | 160 | spin_unlock_bh(&htc->tx_lock); |
@@ -180,7 +185,7 @@ err_credits: | |||
180 | if (ep->tx_credit_flow_enabled) { | 185 | if (ep->tx_credit_flow_enabled) { |
181 | spin_lock_bh(&htc->tx_lock); | 186 | spin_lock_bh(&htc->tx_lock); |
182 | ep->tx_credits += credits; | 187 | ep->tx_credits += credits; |
183 | ath10k_dbg(ATH10K_DBG_HTC, | 188 | ath10k_dbg(ar, ATH10K_DBG_HTC, |
184 | "htc ep %d reverted %d credits back (total %d)\n", | 189 | "htc ep %d reverted %d credits back (total %d)\n", |
185 | eid, credits, ep->tx_credits); | 190 | eid, credits, ep->tx_credits); |
186 | spin_unlock_bh(&htc->tx_lock); | 191 | spin_unlock_bh(&htc->tx_lock); |
@@ -219,11 +224,12 @@ ath10k_htc_process_credit_report(struct ath10k_htc *htc, | |||
219 | int len, | 224 | int len, |
220 | enum ath10k_htc_ep_id eid) | 225 | enum ath10k_htc_ep_id eid) |
221 | { | 226 | { |
227 | struct ath10k *ar = htc->ar; | ||
222 | struct ath10k_htc_ep *ep; | 228 | struct ath10k_htc_ep *ep; |
223 | int i, n_reports; | 229 | int i, n_reports; |
224 | 230 | ||
225 | if (len % sizeof(*report)) | 231 | if (len % sizeof(*report)) |
226 | ath10k_warn("Uneven credit report len %d", len); | 232 | ath10k_warn(ar, "Uneven credit report len %d", len); |
227 | 233 | ||
228 | n_reports = len / sizeof(*report); | 234 | n_reports = len / sizeof(*report); |
229 | 235 | ||
@@ -235,7 +241,7 @@ ath10k_htc_process_credit_report(struct ath10k_htc *htc, | |||
235 | ep = &htc->endpoint[report->eid]; | 241 | ep = &htc->endpoint[report->eid]; |
236 | ep->tx_credits += report->credits; | 242 | ep->tx_credits += report->credits; |
237 | 243 | ||
238 | ath10k_dbg(ATH10K_DBG_HTC, "htc ep %d got %d credits (total %d)\n", | 244 | ath10k_dbg(ar, ATH10K_DBG_HTC, "htc ep %d got %d credits (total %d)\n", |
239 | report->eid, report->credits, ep->tx_credits); | 245 | report->eid, report->credits, ep->tx_credits); |
240 | 246 | ||
241 | if (ep->ep_ops.ep_tx_credits) { | 247 | if (ep->ep_ops.ep_tx_credits) { |
@@ -252,6 +258,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, | |||
252 | int length, | 258 | int length, |
253 | enum ath10k_htc_ep_id src_eid) | 259 | enum ath10k_htc_ep_id src_eid) |
254 | { | 260 | { |
261 | struct ath10k *ar = htc->ar; | ||
255 | int status = 0; | 262 | int status = 0; |
256 | struct ath10k_htc_record *record; | 263 | struct ath10k_htc_record *record; |
257 | u8 *orig_buffer; | 264 | u8 *orig_buffer; |
@@ -271,7 +278,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, | |||
271 | 278 | ||
272 | if (record->hdr.len > length) { | 279 | if (record->hdr.len > length) { |
273 | /* no room left in buffer for record */ | 280 | /* no room left in buffer for record */ |
274 | ath10k_warn("Invalid record length: %d\n", | 281 | ath10k_warn(ar, "Invalid record length: %d\n", |
275 | record->hdr.len); | 282 | record->hdr.len); |
276 | status = -EINVAL; | 283 | status = -EINVAL; |
277 | break; | 284 | break; |
@@ -281,7 +288,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, | |||
281 | case ATH10K_HTC_RECORD_CREDITS: | 288 | case ATH10K_HTC_RECORD_CREDITS: |
282 | len = sizeof(struct ath10k_htc_credit_report); | 289 | len = sizeof(struct ath10k_htc_credit_report); |
283 | if (record->hdr.len < len) { | 290 | if (record->hdr.len < len) { |
284 | ath10k_warn("Credit report too long\n"); | 291 | ath10k_warn(ar, "Credit report too long\n"); |
285 | status = -EINVAL; | 292 | status = -EINVAL; |
286 | break; | 293 | break; |
287 | } | 294 | } |
@@ -291,7 +298,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, | |||
291 | src_eid); | 298 | src_eid); |
292 | break; | 299 | break; |
293 | default: | 300 | default: |
294 | ath10k_warn("Unhandled record: id:%d length:%d\n", | 301 | ath10k_warn(ar, "Unhandled record: id:%d length:%d\n", |
295 | record->hdr.id, record->hdr.len); | 302 | record->hdr.id, record->hdr.len); |
296 | break; | 303 | break; |
297 | } | 304 | } |
@@ -305,7 +312,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, | |||
305 | } | 312 | } |
306 | 313 | ||
307 | if (status) | 314 | if (status) |
308 | ath10k_dbg_dump(ATH10K_DBG_HTC, "htc rx bad trailer", "", | 315 | ath10k_dbg_dump(ar, ATH10K_DBG_HTC, "htc rx bad trailer", "", |
309 | orig_buffer, orig_length); | 316 | orig_buffer, orig_length); |
310 | 317 | ||
311 | return status; | 318 | return status; |
@@ -331,8 +338,8 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, | |||
331 | eid = hdr->eid; | 338 | eid = hdr->eid; |
332 | 339 | ||
333 | if (eid >= ATH10K_HTC_EP_COUNT) { | 340 | if (eid >= ATH10K_HTC_EP_COUNT) { |
334 | ath10k_warn("HTC Rx: invalid eid %d\n", eid); | 341 | ath10k_warn(ar, "HTC Rx: invalid eid %d\n", eid); |
335 | ath10k_dbg_dump(ATH10K_DBG_HTC, "htc bad header", "", | 342 | ath10k_dbg_dump(ar, ATH10K_DBG_HTC, "htc bad header", "", |
336 | hdr, sizeof(*hdr)); | 343 | hdr, sizeof(*hdr)); |
337 | status = -EINVAL; | 344 | status = -EINVAL; |
338 | goto out; | 345 | goto out; |
@@ -352,19 +359,19 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, | |||
352 | payload_len = __le16_to_cpu(hdr->len); | 359 | payload_len = __le16_to_cpu(hdr->len); |
353 | 360 | ||
354 | if (payload_len + sizeof(*hdr) > ATH10K_HTC_MAX_LEN) { | 361 | if (payload_len + sizeof(*hdr) > ATH10K_HTC_MAX_LEN) { |
355 | ath10k_warn("HTC rx frame too long, len: %zu\n", | 362 | ath10k_warn(ar, "HTC rx frame too long, len: %zu\n", |
356 | payload_len + sizeof(*hdr)); | 363 | payload_len + sizeof(*hdr)); |
357 | ath10k_dbg_dump(ATH10K_DBG_HTC, "htc bad rx pkt len", "", | 364 | ath10k_dbg_dump(ar, ATH10K_DBG_HTC, "htc bad rx pkt len", "", |
358 | hdr, sizeof(*hdr)); | 365 | hdr, sizeof(*hdr)); |
359 | status = -EINVAL; | 366 | status = -EINVAL; |
360 | goto out; | 367 | goto out; |
361 | } | 368 | } |
362 | 369 | ||
363 | if (skb->len < payload_len) { | 370 | if (skb->len < payload_len) { |
364 | ath10k_dbg(ATH10K_DBG_HTC, | 371 | ath10k_dbg(ar, ATH10K_DBG_HTC, |
365 | "HTC Rx: insufficient length, got %d, expected %d\n", | 372 | "HTC Rx: insufficient length, got %d, expected %d\n", |
366 | skb->len, payload_len); | 373 | skb->len, payload_len); |
367 | ath10k_dbg_dump(ATH10K_DBG_HTC, "htc bad rx pkt len", | 374 | ath10k_dbg_dump(ar, ATH10K_DBG_HTC, "htc bad rx pkt len", |
368 | "", hdr, sizeof(*hdr)); | 375 | "", hdr, sizeof(*hdr)); |
369 | status = -EINVAL; | 376 | status = -EINVAL; |
370 | goto out; | 377 | goto out; |
@@ -380,7 +387,7 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, | |||
380 | 387 | ||
381 | if ((trailer_len < min_len) || | 388 | if ((trailer_len < min_len) || |
382 | (trailer_len > payload_len)) { | 389 | (trailer_len > payload_len)) { |
383 | ath10k_warn("Invalid trailer length: %d\n", | 390 | ath10k_warn(ar, "Invalid trailer length: %d\n", |
384 | trailer_len); | 391 | trailer_len); |
385 | status = -EPROTO; | 392 | status = -EPROTO; |
386 | goto out; | 393 | goto out; |
@@ -413,7 +420,7 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, | |||
413 | * this is a fatal error, target should not be | 420 | * this is a fatal error, target should not be |
414 | * sending unsolicited messages on the ep 0 | 421 | * sending unsolicited messages on the ep 0 |
415 | */ | 422 | */ |
416 | ath10k_warn("HTC rx ctrl still processing\n"); | 423 | ath10k_warn(ar, "HTC rx ctrl still processing\n"); |
417 | status = -EINVAL; | 424 | status = -EINVAL; |
418 | complete(&htc->ctl_resp); | 425 | complete(&htc->ctl_resp); |
419 | goto out; | 426 | goto out; |
@@ -434,7 +441,7 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, | |||
434 | goto out; | 441 | goto out; |
435 | } | 442 | } |
436 | 443 | ||
437 | ath10k_dbg(ATH10K_DBG_HTC, "htc rx completion ep %d skb %p\n", | 444 | ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %p\n", |
438 | eid, skb); | 445 | eid, skb); |
439 | ep->ep_ops.ep_rx_complete(ar, skb); | 446 | ep->ep_ops.ep_rx_complete(ar, skb); |
440 | 447 | ||
@@ -451,7 +458,7 @@ static void ath10k_htc_control_rx_complete(struct ath10k *ar, | |||
451 | { | 458 | { |
452 | /* This is unexpected. FW is not supposed to send regular rx on this | 459 | /* This is unexpected. FW is not supposed to send regular rx on this |
453 | * endpoint. */ | 460 | * endpoint. */ |
454 | ath10k_warn("unexpected htc rx\n"); | 461 | ath10k_warn(ar, "unexpected htc rx\n"); |
455 | kfree_skb(skb); | 462 | kfree_skb(skb); |
456 | } | 463 | } |
457 | 464 | ||
@@ -538,6 +545,7 @@ static u8 ath10k_htc_get_credit_allocation(struct ath10k_htc *htc, | |||
538 | 545 | ||
539 | int ath10k_htc_wait_target(struct ath10k_htc *htc) | 546 | int ath10k_htc_wait_target(struct ath10k_htc *htc) |
540 | { | 547 | { |
548 | struct ath10k *ar = htc->ar; | ||
541 | int i, status = 0; | 549 | int i, status = 0; |
542 | struct ath10k_htc_svc_conn_req conn_req; | 550 | struct ath10k_htc_svc_conn_req conn_req; |
543 | struct ath10k_htc_svc_conn_resp conn_resp; | 551 | struct ath10k_htc_svc_conn_resp conn_resp; |
@@ -555,7 +563,7 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) | |||
555 | * iomap writes unmasking PCI CE irqs aren't propagated | 563 | * iomap writes unmasking PCI CE irqs aren't propagated |
556 | * properly in KVM PCI-passthrough sometimes. | 564 | * properly in KVM PCI-passthrough sometimes. |
557 | */ | 565 | */ |
558 | ath10k_warn("failed to receive control response completion, polling..\n"); | 566 | ath10k_warn(ar, "failed to receive control response completion, polling..\n"); |
559 | 567 | ||
560 | for (i = 0; i < CE_COUNT; i++) | 568 | for (i = 0; i < CE_COUNT; i++) |
561 | ath10k_hif_send_complete_check(htc->ar, i, 1); | 569 | ath10k_hif_send_complete_check(htc->ar, i, 1); |
@@ -568,12 +576,12 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) | |||
568 | } | 576 | } |
569 | 577 | ||
570 | if (status < 0) { | 578 | if (status < 0) { |
571 | ath10k_err("ctl_resp never came in (%d)\n", status); | 579 | ath10k_err(ar, "ctl_resp never came in (%d)\n", status); |
572 | return status; | 580 | return status; |
573 | } | 581 | } |
574 | 582 | ||
575 | if (htc->control_resp_len < sizeof(msg->hdr) + sizeof(msg->ready)) { | 583 | if (htc->control_resp_len < sizeof(msg->hdr) + sizeof(msg->ready)) { |
576 | ath10k_err("Invalid HTC ready msg len:%d\n", | 584 | ath10k_err(ar, "Invalid HTC ready msg len:%d\n", |
577 | htc->control_resp_len); | 585 | htc->control_resp_len); |
578 | return -ECOMM; | 586 | return -ECOMM; |
579 | } | 587 | } |
@@ -584,21 +592,21 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) | |||
584 | credit_size = __le16_to_cpu(msg->ready.credit_size); | 592 | credit_size = __le16_to_cpu(msg->ready.credit_size); |
585 | 593 | ||
586 | if (message_id != ATH10K_HTC_MSG_READY_ID) { | 594 | if (message_id != ATH10K_HTC_MSG_READY_ID) { |
587 | ath10k_err("Invalid HTC ready msg: 0x%x\n", message_id); | 595 | ath10k_err(ar, "Invalid HTC ready msg: 0x%x\n", message_id); |
588 | return -ECOMM; | 596 | return -ECOMM; |
589 | } | 597 | } |
590 | 598 | ||
591 | htc->total_transmit_credits = credit_count; | 599 | htc->total_transmit_credits = credit_count; |
592 | htc->target_credit_size = credit_size; | 600 | htc->target_credit_size = credit_size; |
593 | 601 | ||
594 | ath10k_dbg(ATH10K_DBG_HTC, | 602 | ath10k_dbg(ar, ATH10K_DBG_HTC, |
595 | "Target ready! transmit resources: %d size:%d\n", | 603 | "Target ready! transmit resources: %d size:%d\n", |
596 | htc->total_transmit_credits, | 604 | htc->total_transmit_credits, |
597 | htc->target_credit_size); | 605 | htc->target_credit_size); |
598 | 606 | ||
599 | if ((htc->total_transmit_credits == 0) || | 607 | if ((htc->total_transmit_credits == 0) || |
600 | (htc->target_credit_size == 0)) { | 608 | (htc->target_credit_size == 0)) { |
601 | ath10k_err("Invalid credit size received\n"); | 609 | ath10k_err(ar, "Invalid credit size received\n"); |
602 | return -ECOMM; | 610 | return -ECOMM; |
603 | } | 611 | } |
604 | 612 | ||
@@ -615,7 +623,8 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) | |||
615 | /* connect fake service */ | 623 | /* connect fake service */ |
616 | status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); | 624 | status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); |
617 | if (status) { | 625 | if (status) { |
618 | ath10k_err("could not connect to htc service (%d)\n", status); | 626 | ath10k_err(ar, "could not connect to htc service (%d)\n", |
627 | status); | ||
619 | return status; | 628 | return status; |
620 | } | 629 | } |
621 | 630 | ||
@@ -626,6 +635,7 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
626 | struct ath10k_htc_svc_conn_req *conn_req, | 635 | struct ath10k_htc_svc_conn_req *conn_req, |
627 | struct ath10k_htc_svc_conn_resp *conn_resp) | 636 | struct ath10k_htc_svc_conn_resp *conn_resp) |
628 | { | 637 | { |
638 | struct ath10k *ar = htc->ar; | ||
629 | struct ath10k_htc_msg *msg; | 639 | struct ath10k_htc_msg *msg; |
630 | struct ath10k_htc_conn_svc *req_msg; | 640 | struct ath10k_htc_conn_svc *req_msg; |
631 | struct ath10k_htc_conn_svc_response resp_msg_dummy; | 641 | struct ath10k_htc_conn_svc_response resp_msg_dummy; |
@@ -651,13 +661,13 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
651 | tx_alloc = ath10k_htc_get_credit_allocation(htc, | 661 | tx_alloc = ath10k_htc_get_credit_allocation(htc, |
652 | conn_req->service_id); | 662 | conn_req->service_id); |
653 | if (!tx_alloc) | 663 | if (!tx_alloc) |
654 | ath10k_dbg(ATH10K_DBG_BOOT, | 664 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
655 | "boot htc service %s does not allocate target credits\n", | 665 | "boot htc service %s does not allocate target credits\n", |
656 | htc_service_name(conn_req->service_id)); | 666 | htc_service_name(conn_req->service_id)); |
657 | 667 | ||
658 | skb = ath10k_htc_build_tx_ctrl_skb(htc->ar); | 668 | skb = ath10k_htc_build_tx_ctrl_skb(htc->ar); |
659 | if (!skb) { | 669 | if (!skb) { |
660 | ath10k_err("Failed to allocate HTC packet\n"); | 670 | ath10k_err(ar, "Failed to allocate HTC packet\n"); |
661 | return -ENOMEM; | 671 | return -ENOMEM; |
662 | } | 672 | } |
663 | 673 | ||
@@ -695,7 +705,7 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
695 | if (status <= 0) { | 705 | if (status <= 0) { |
696 | if (status == 0) | 706 | if (status == 0) |
697 | status = -ETIMEDOUT; | 707 | status = -ETIMEDOUT; |
698 | ath10k_err("Service connect timeout: %d\n", status); | 708 | ath10k_err(ar, "Service connect timeout: %d\n", status); |
699 | return status; | 709 | return status; |
700 | } | 710 | } |
701 | 711 | ||
@@ -708,11 +718,11 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
708 | if ((message_id != ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID) || | 718 | if ((message_id != ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID) || |
709 | (htc->control_resp_len < sizeof(msg->hdr) + | 719 | (htc->control_resp_len < sizeof(msg->hdr) + |
710 | sizeof(msg->connect_service_response))) { | 720 | sizeof(msg->connect_service_response))) { |
711 | ath10k_err("Invalid resp message ID 0x%x", message_id); | 721 | ath10k_err(ar, "Invalid resp message ID 0x%x", message_id); |
712 | return -EPROTO; | 722 | return -EPROTO; |
713 | } | 723 | } |
714 | 724 | ||
715 | ath10k_dbg(ATH10K_DBG_HTC, | 725 | ath10k_dbg(ar, ATH10K_DBG_HTC, |
716 | "HTC Service %s connect response: status: 0x%x, assigned ep: 0x%x\n", | 726 | "HTC Service %s connect response: status: 0x%x, assigned ep: 0x%x\n", |
717 | htc_service_name(service_id), | 727 | htc_service_name(service_id), |
718 | resp_msg->status, resp_msg->eid); | 728 | resp_msg->status, resp_msg->eid); |
@@ -721,7 +731,7 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
721 | 731 | ||
722 | /* check response status */ | 732 | /* check response status */ |
723 | if (resp_msg->status != ATH10K_HTC_CONN_SVC_STATUS_SUCCESS) { | 733 | if (resp_msg->status != ATH10K_HTC_CONN_SVC_STATUS_SUCCESS) { |
724 | ath10k_err("HTC Service %s connect request failed: 0x%x)\n", | 734 | ath10k_err(ar, "HTC Service %s connect request failed: 0x%x)\n", |
725 | htc_service_name(service_id), | 735 | htc_service_name(service_id), |
726 | resp_msg->status); | 736 | resp_msg->status); |
727 | return -EPROTO; | 737 | return -EPROTO; |
@@ -772,18 +782,18 @@ setup: | |||
772 | if (status) | 782 | if (status) |
773 | return status; | 783 | return status; |
774 | 784 | ||
775 | ath10k_dbg(ATH10K_DBG_BOOT, | 785 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
776 | "boot htc service '%s' ul pipe %d dl pipe %d eid %d ready\n", | 786 | "boot htc service '%s' ul pipe %d dl pipe %d eid %d ready\n", |
777 | htc_service_name(ep->service_id), ep->ul_pipe_id, | 787 | htc_service_name(ep->service_id), ep->ul_pipe_id, |
778 | ep->dl_pipe_id, ep->eid); | 788 | ep->dl_pipe_id, ep->eid); |
779 | 789 | ||
780 | ath10k_dbg(ATH10K_DBG_BOOT, | 790 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
781 | "boot htc ep %d ul polled %d dl polled %d\n", | 791 | "boot htc ep %d ul polled %d dl polled %d\n", |
782 | ep->eid, ep->ul_is_polled, ep->dl_is_polled); | 792 | ep->eid, ep->ul_is_polled, ep->dl_is_polled); |
783 | 793 | ||
784 | if (disable_credit_flow_ctrl && ep->tx_credit_flow_enabled) { | 794 | if (disable_credit_flow_ctrl && ep->tx_credit_flow_enabled) { |
785 | ep->tx_credit_flow_enabled = false; | 795 | ep->tx_credit_flow_enabled = false; |
786 | ath10k_dbg(ATH10K_DBG_BOOT, | 796 | ath10k_dbg(ar, ATH10K_DBG_BOOT, |
787 | "boot htc service '%s' eid %d TX flow control disabled\n", | 797 | "boot htc service '%s' eid %d TX flow control disabled\n", |
788 | htc_service_name(ep->service_id), assigned_eid); | 798 | htc_service_name(ep->service_id), assigned_eid); |
789 | } | 799 | } |
@@ -791,13 +801,13 @@ setup: | |||
791 | return status; | 801 | return status; |
792 | } | 802 | } |
793 | 803 | ||
794 | struct sk_buff *ath10k_htc_alloc_skb(int size) | 804 | struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size) |
795 | { | 805 | { |
796 | struct sk_buff *skb; | 806 | struct sk_buff *skb; |
797 | 807 | ||
798 | skb = dev_alloc_skb(size + sizeof(struct ath10k_htc_hdr)); | 808 | skb = dev_alloc_skb(size + sizeof(struct ath10k_htc_hdr)); |
799 | if (!skb) { | 809 | if (!skb) { |
800 | ath10k_warn("could not allocate HTC tx skb\n"); | 810 | ath10k_warn(ar, "could not allocate HTC tx skb\n"); |
801 | return NULL; | 811 | return NULL; |
802 | } | 812 | } |
803 | 813 | ||
@@ -805,13 +815,14 @@ struct sk_buff *ath10k_htc_alloc_skb(int size) | |||
805 | 815 | ||
806 | /* FW/HTC requires 4-byte aligned streams */ | 816 | /* FW/HTC requires 4-byte aligned streams */ |
807 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) | 817 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) |
808 | ath10k_warn("Unaligned HTC tx skb\n"); | 818 | ath10k_warn(ar, "Unaligned HTC tx skb\n"); |
809 | 819 | ||
810 | return skb; | 820 | return skb; |
811 | } | 821 | } |
812 | 822 | ||
813 | int ath10k_htc_start(struct ath10k_htc *htc) | 823 | int ath10k_htc_start(struct ath10k_htc *htc) |
814 | { | 824 | { |
825 | struct ath10k *ar = htc->ar; | ||
815 | struct sk_buff *skb; | 826 | struct sk_buff *skb; |
816 | int status = 0; | 827 | int status = 0; |
817 | struct ath10k_htc_msg *msg; | 828 | struct ath10k_htc_msg *msg; |
@@ -827,7 +838,7 @@ int ath10k_htc_start(struct ath10k_htc *htc) | |||
827 | msg->hdr.message_id = | 838 | msg->hdr.message_id = |
828 | __cpu_to_le16(ATH10K_HTC_MSG_SETUP_COMPLETE_EX_ID); | 839 | __cpu_to_le16(ATH10K_HTC_MSG_SETUP_COMPLETE_EX_ID); |
829 | 840 | ||
830 | ath10k_dbg(ATH10K_DBG_HTC, "HTC is using TX credit flow control\n"); | 841 | ath10k_dbg(ar, ATH10K_DBG_HTC, "HTC is using TX credit flow control\n"); |
831 | 842 | ||
832 | status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb); | 843 | status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb); |
833 | if (status) { | 844 | if (status) { |
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h index b5a9daacc2c2..bf532f671189 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h | |||
@@ -355,6 +355,6 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, | |||
355 | struct ath10k_htc_svc_conn_resp *conn_resp); | 355 | struct ath10k_htc_svc_conn_resp *conn_resp); |
356 | int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid, | 356 | int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid, |
357 | struct sk_buff *packet); | 357 | struct sk_buff *packet); |
358 | struct sk_buff *ath10k_htc_alloc_skb(int size); | 358 | struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size); |
359 | 359 | ||
360 | #endif | 360 | #endif |
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c index 19c12cc8d663..87daae11f116 100644 --- a/drivers/net/wireless/ath/ath10k/htt.c +++ b/drivers/net/wireless/ath/ath10k/htt.c | |||
@@ -74,12 +74,14 @@ int ath10k_htt_init(struct ath10k *ar) | |||
74 | 74 | ||
75 | static int ath10k_htt_verify_version(struct ath10k_htt *htt) | 75 | static int ath10k_htt_verify_version(struct ath10k_htt *htt) |
76 | { | 76 | { |
77 | ath10k_dbg(ATH10K_DBG_BOOT, "htt target version %d.%d\n", | 77 | struct ath10k *ar = htt->ar; |
78 | |||
79 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt target version %d.%d\n", | ||
78 | htt->target_version_major, htt->target_version_minor); | 80 | htt->target_version_major, htt->target_version_minor); |
79 | 81 | ||
80 | if (htt->target_version_major != 2 && | 82 | if (htt->target_version_major != 2 && |
81 | htt->target_version_major != 3) { | 83 | htt->target_version_major != 3) { |
82 | ath10k_err("unsupported htt major version %d. supported versions are 2 and 3\n", | 84 | ath10k_err(ar, "unsupported htt major version %d. supported versions are 2 and 3\n", |
83 | htt->target_version_major); | 85 | htt->target_version_major); |
84 | return -ENOTSUPP; | 86 | return -ENOTSUPP; |
85 | } | 87 | } |
@@ -89,6 +91,7 @@ static int ath10k_htt_verify_version(struct ath10k_htt *htt) | |||
89 | 91 | ||
90 | int ath10k_htt_setup(struct ath10k_htt *htt) | 92 | int ath10k_htt_setup(struct ath10k_htt *htt) |
91 | { | 93 | { |
94 | struct ath10k *ar = htt->ar; | ||
92 | int status; | 95 | int status; |
93 | 96 | ||
94 | init_completion(&htt->target_version_received); | 97 | init_completion(&htt->target_version_received); |
@@ -100,7 +103,7 @@ int ath10k_htt_setup(struct ath10k_htt *htt) | |||
100 | status = wait_for_completion_timeout(&htt->target_version_received, | 103 | status = wait_for_completion_timeout(&htt->target_version_received, |
101 | HTT_TARGET_VERSION_TIMEOUT_HZ); | 104 | HTT_TARGET_VERSION_TIMEOUT_HZ); |
102 | if (status <= 0) { | 105 | if (status <= 0) { |
103 | ath10k_warn("htt version request timed out\n"); | 106 | ath10k_warn(ar, "htt version request timed out\n"); |
104 | return -ETIMEDOUT; | 107 | return -ETIMEDOUT; |
105 | } | 108 | } |
106 | 109 | ||
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 763d6a228a13..30927b1d7109 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c | |||
@@ -271,13 +271,14 @@ void ath10k_htt_rx_free(struct ath10k_htt *htt) | |||
271 | 271 | ||
272 | static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt) | 272 | static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt) |
273 | { | 273 | { |
274 | struct ath10k *ar = htt->ar; | ||
274 | int idx; | 275 | int idx; |
275 | struct sk_buff *msdu; | 276 | struct sk_buff *msdu; |
276 | 277 | ||
277 | lockdep_assert_held(&htt->rx_ring.lock); | 278 | lockdep_assert_held(&htt->rx_ring.lock); |
278 | 279 | ||
279 | if (htt->rx_ring.fill_cnt == 0) { | 280 | if (htt->rx_ring.fill_cnt == 0) { |
280 | ath10k_warn("tried to pop sk_buff from an empty rx ring\n"); | 281 | ath10k_warn(ar, "tried to pop sk_buff from an empty rx ring\n"); |
281 | return NULL; | 282 | return NULL; |
282 | } | 283 | } |
283 | 284 | ||
@@ -311,6 +312,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
311 | struct sk_buff **tail_msdu, | 312 | struct sk_buff **tail_msdu, |
312 | u32 *attention) | 313 | u32 *attention) |
313 | { | 314 | { |
315 | struct ath10k *ar = htt->ar; | ||
314 | int msdu_len, msdu_chaining = 0; | 316 | int msdu_len, msdu_chaining = 0; |
315 | struct sk_buff *msdu; | 317 | struct sk_buff *msdu; |
316 | struct htt_rx_desc *rx_desc; | 318 | struct htt_rx_desc *rx_desc; |
@@ -318,7 +320,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
318 | lockdep_assert_held(&htt->rx_ring.lock); | 320 | lockdep_assert_held(&htt->rx_ring.lock); |
319 | 321 | ||
320 | if (htt->rx_confused) { | 322 | if (htt->rx_confused) { |
321 | ath10k_warn("htt is confused. refusing rx\n"); | 323 | ath10k_warn(ar, "htt is confused. refusing rx\n"); |
322 | return -1; | 324 | return -1; |
323 | } | 325 | } |
324 | 326 | ||
@@ -331,7 +333,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
331 | msdu->len + skb_tailroom(msdu), | 333 | msdu->len + skb_tailroom(msdu), |
332 | DMA_FROM_DEVICE); | 334 | DMA_FROM_DEVICE); |
333 | 335 | ||
334 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt rx pop: ", | 336 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt rx pop: ", |
335 | msdu->data, msdu->len + skb_tailroom(msdu)); | 337 | msdu->data, msdu->len + skb_tailroom(msdu)); |
336 | 338 | ||
337 | rx_desc = (struct htt_rx_desc *)msdu->data; | 339 | rx_desc = (struct htt_rx_desc *)msdu->data; |
@@ -354,7 +356,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
354 | ath10k_htt_rx_free_msdu_chain(*head_msdu); | 356 | ath10k_htt_rx_free_msdu_chain(*head_msdu); |
355 | *head_msdu = NULL; | 357 | *head_msdu = NULL; |
356 | msdu = NULL; | 358 | msdu = NULL; |
357 | ath10k_err("htt rx stopped. cannot recover\n"); | 359 | ath10k_err(ar, "htt rx stopped. cannot recover\n"); |
358 | htt->rx_confused = true; | 360 | htt->rx_confused = true; |
359 | break; | 361 | break; |
360 | } | 362 | } |
@@ -429,7 +431,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
429 | next->len + skb_tailroom(next), | 431 | next->len + skb_tailroom(next), |
430 | DMA_FROM_DEVICE); | 432 | DMA_FROM_DEVICE); |
431 | 433 | ||
432 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, | 434 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, |
433 | "htt rx chained: ", next->data, | 435 | "htt rx chained: ", next->data, |
434 | next->len + skb_tailroom(next)); | 436 | next->len + skb_tailroom(next)); |
435 | 437 | ||
@@ -483,13 +485,14 @@ static void ath10k_htt_rx_replenish_task(unsigned long ptr) | |||
483 | 485 | ||
484 | int ath10k_htt_rx_alloc(struct ath10k_htt *htt) | 486 | int ath10k_htt_rx_alloc(struct ath10k_htt *htt) |
485 | { | 487 | { |
488 | struct ath10k *ar = htt->ar; | ||
486 | dma_addr_t paddr; | 489 | dma_addr_t paddr; |
487 | void *vaddr; | 490 | void *vaddr; |
488 | struct timer_list *timer = &htt->rx_ring.refill_retry_timer; | 491 | struct timer_list *timer = &htt->rx_ring.refill_retry_timer; |
489 | 492 | ||
490 | htt->rx_ring.size = ath10k_htt_rx_ring_size(htt); | 493 | htt->rx_ring.size = ath10k_htt_rx_ring_size(htt); |
491 | if (!is_power_of_2(htt->rx_ring.size)) { | 494 | if (!is_power_of_2(htt->rx_ring.size)) { |
492 | ath10k_warn("htt rx ring size is not power of 2\n"); | 495 | ath10k_warn(ar, "htt rx ring size is not power of 2\n"); |
493 | return -EINVAL; | 496 | return -EINVAL; |
494 | } | 497 | } |
495 | 498 | ||
@@ -550,7 +553,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) | |||
550 | tasklet_init(&htt->txrx_compl_task, ath10k_htt_txrx_compl_task, | 553 | tasklet_init(&htt->txrx_compl_task, ath10k_htt_txrx_compl_task, |
551 | (unsigned long)htt); | 554 | (unsigned long)htt); |
552 | 555 | ||
553 | ath10k_dbg(ATH10K_DBG_BOOT, "htt rx ring size %d fill_level %d\n", | 556 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt rx ring size %d fill_level %d\n", |
554 | htt->rx_ring.size, htt->rx_ring.fill_level); | 557 | htt->rx_ring.size, htt->rx_ring.fill_level); |
555 | return 0; | 558 | return 0; |
556 | 559 | ||
@@ -572,7 +575,8 @@ err_netbuf: | |||
572 | return -ENOMEM; | 575 | return -ENOMEM; |
573 | } | 576 | } |
574 | 577 | ||
575 | static int ath10k_htt_rx_crypto_param_len(enum htt_rx_mpdu_encrypt_type type) | 578 | static int ath10k_htt_rx_crypto_param_len(struct ath10k *ar, |
579 | enum htt_rx_mpdu_encrypt_type type) | ||
576 | { | 580 | { |
577 | switch (type) { | 581 | switch (type) { |
578 | case HTT_RX_MPDU_ENCRYPT_WEP40: | 582 | case HTT_RX_MPDU_ENCRYPT_WEP40: |
@@ -588,11 +592,12 @@ static int ath10k_htt_rx_crypto_param_len(enum htt_rx_mpdu_encrypt_type type) | |||
588 | return 0; | 592 | return 0; |
589 | } | 593 | } |
590 | 594 | ||
591 | ath10k_warn("unknown encryption type %d\n", type); | 595 | ath10k_warn(ar, "unknown encryption type %d\n", type); |
592 | return 0; | 596 | return 0; |
593 | } | 597 | } |
594 | 598 | ||
595 | static int ath10k_htt_rx_crypto_tail_len(enum htt_rx_mpdu_encrypt_type type) | 599 | static int ath10k_htt_rx_crypto_tail_len(struct ath10k *ar, |
600 | enum htt_rx_mpdu_encrypt_type type) | ||
596 | { | 601 | { |
597 | switch (type) { | 602 | switch (type) { |
598 | case HTT_RX_MPDU_ENCRYPT_NONE: | 603 | case HTT_RX_MPDU_ENCRYPT_NONE: |
@@ -608,7 +613,7 @@ static int ath10k_htt_rx_crypto_tail_len(enum htt_rx_mpdu_encrypt_type type) | |||
608 | return 8; | 613 | return 8; |
609 | } | 614 | } |
610 | 615 | ||
611 | ath10k_warn("unknown encryption type %d\n", type); | 616 | ath10k_warn(ar, "unknown encryption type %d\n", type); |
612 | return 0; | 617 | return 0; |
613 | } | 618 | } |
614 | 619 | ||
@@ -859,7 +864,7 @@ static void ath10k_process_rx(struct ath10k *ar, | |||
859 | status = IEEE80211_SKB_RXCB(skb); | 864 | status = IEEE80211_SKB_RXCB(skb); |
860 | *status = *rx_status; | 865 | *status = *rx_status; |
861 | 866 | ||
862 | ath10k_dbg(ATH10K_DBG_DATA, | 867 | ath10k_dbg(ar, ATH10K_DBG_DATA, |
863 | "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", | 868 | "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", |
864 | skb, | 869 | skb, |
865 | skb->len, | 870 | skb->len, |
@@ -881,7 +886,7 @@ static void ath10k_process_rx(struct ath10k *ar, | |||
881 | !!(status->flag & RX_FLAG_FAILED_FCS_CRC), | 886 | !!(status->flag & RX_FLAG_FAILED_FCS_CRC), |
882 | !!(status->flag & RX_FLAG_MMIC_ERROR), | 887 | !!(status->flag & RX_FLAG_MMIC_ERROR), |
883 | !!(status->flag & RX_FLAG_AMSDU_MORE)); | 888 | !!(status->flag & RX_FLAG_AMSDU_MORE)); |
884 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "rx skb: ", | 889 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "rx skb: ", |
885 | skb->data, skb->len); | 890 | skb->data, skb->len); |
886 | 891 | ||
887 | ieee80211_rx(ar->hw, skb); | 892 | ieee80211_rx(ar->hw, skb); |
@@ -897,6 +902,7 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt, | |||
897 | struct ieee80211_rx_status *rx_status, | 902 | struct ieee80211_rx_status *rx_status, |
898 | struct sk_buff *skb_in) | 903 | struct sk_buff *skb_in) |
899 | { | 904 | { |
905 | struct ath10k *ar = htt->ar; | ||
900 | struct htt_rx_desc *rxd; | 906 | struct htt_rx_desc *rxd; |
901 | struct sk_buff *skb = skb_in; | 907 | struct sk_buff *skb = skb_in; |
902 | struct sk_buff *first; | 908 | struct sk_buff *first; |
@@ -930,8 +936,8 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt, | |||
930 | /* First frame in an A-MSDU chain has more decapped data. */ | 936 | /* First frame in an A-MSDU chain has more decapped data. */ |
931 | if (skb == first) { | 937 | if (skb == first) { |
932 | len = round_up(ieee80211_hdrlen(hdr->frame_control), 4); | 938 | len = round_up(ieee80211_hdrlen(hdr->frame_control), 4); |
933 | len += round_up(ath10k_htt_rx_crypto_param_len(enctype), | 939 | len += round_up(ath10k_htt_rx_crypto_param_len(ar, |
934 | 4); | 940 | enctype), 4); |
935 | decap_hdr += len; | 941 | decap_hdr += len; |
936 | } | 942 | } |
937 | 943 | ||
@@ -1006,6 +1012,7 @@ static void ath10k_htt_rx_msdu(struct ath10k_htt *htt, | |||
1006 | struct ieee80211_rx_status *rx_status, | 1012 | struct ieee80211_rx_status *rx_status, |
1007 | struct sk_buff *skb) | 1013 | struct sk_buff *skb) |
1008 | { | 1014 | { |
1015 | struct ath10k *ar = htt->ar; | ||
1009 | struct htt_rx_desc *rxd; | 1016 | struct htt_rx_desc *rxd; |
1010 | struct ieee80211_hdr *hdr; | 1017 | struct ieee80211_hdr *hdr; |
1011 | enum rx_msdu_decap_format fmt; | 1018 | enum rx_msdu_decap_format fmt; |
@@ -1015,7 +1022,7 @@ static void ath10k_htt_rx_msdu(struct ath10k_htt *htt, | |||
1015 | 1022 | ||
1016 | /* This shouldn't happen. If it does than it may be a FW bug. */ | 1023 | /* This shouldn't happen. If it does than it may be a FW bug. */ |
1017 | if (skb->next) { | 1024 | if (skb->next) { |
1018 | ath10k_warn("htt rx received chained non A-MSDU frame\n"); | 1025 | ath10k_warn(ar, "htt rx received chained non A-MSDU frame\n"); |
1019 | ath10k_htt_rx_free_msdu_chain(skb->next); | 1026 | ath10k_htt_rx_free_msdu_chain(skb->next); |
1020 | skb->next = NULL; | 1027 | skb->next = NULL; |
1021 | } | 1028 | } |
@@ -1052,7 +1059,8 @@ static void ath10k_htt_rx_msdu(struct ath10k_htt *htt, | |||
1052 | 1059 | ||
1053 | rfc1042 = hdr; | 1060 | rfc1042 = hdr; |
1054 | rfc1042 += roundup(hdr_len, 4); | 1061 | rfc1042 += roundup(hdr_len, 4); |
1055 | rfc1042 += roundup(ath10k_htt_rx_crypto_param_len(enctype), 4); | 1062 | rfc1042 += roundup(ath10k_htt_rx_crypto_param_len(ar, |
1063 | enctype), 4); | ||
1056 | 1064 | ||
1057 | skb_pull(skb, sizeof(struct ethhdr)); | 1065 | skb_pull(skb, sizeof(struct ethhdr)); |
1058 | memcpy(skb_push(skb, sizeof(struct rfc1042_hdr)), | 1066 | memcpy(skb_push(skb, sizeof(struct rfc1042_hdr)), |
@@ -1161,27 +1169,29 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k_htt *htt, | |||
1161 | bool channel_set, | 1169 | bool channel_set, |
1162 | u32 attention) | 1170 | u32 attention) |
1163 | { | 1171 | { |
1172 | struct ath10k *ar = htt->ar; | ||
1173 | |||
1164 | if (head->len == 0) { | 1174 | if (head->len == 0) { |
1165 | ath10k_dbg(ATH10K_DBG_HTT, | 1175 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1166 | "htt rx dropping due to zero-len\n"); | 1176 | "htt rx dropping due to zero-len\n"); |
1167 | return false; | 1177 | return false; |
1168 | } | 1178 | } |
1169 | 1179 | ||
1170 | if (attention & RX_ATTENTION_FLAGS_DECRYPT_ERR) { | 1180 | if (attention & RX_ATTENTION_FLAGS_DECRYPT_ERR) { |
1171 | ath10k_dbg(ATH10K_DBG_HTT, | 1181 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1172 | "htt rx dropping due to decrypt-err\n"); | 1182 | "htt rx dropping due to decrypt-err\n"); |
1173 | return false; | 1183 | return false; |
1174 | } | 1184 | } |
1175 | 1185 | ||
1176 | if (!channel_set) { | 1186 | if (!channel_set) { |
1177 | ath10k_warn("no channel configured; ignoring frame!\n"); | 1187 | ath10k_warn(ar, "no channel configured; ignoring frame!\n"); |
1178 | return false; | 1188 | return false; |
1179 | } | 1189 | } |
1180 | 1190 | ||
1181 | /* Skip mgmt frames while we handle this in WMI */ | 1191 | /* Skip mgmt frames while we handle this in WMI */ |
1182 | if (status == HTT_RX_IND_MPDU_STATUS_MGMT_CTRL || | 1192 | if (status == HTT_RX_IND_MPDU_STATUS_MGMT_CTRL || |
1183 | attention & RX_ATTENTION_FLAGS_MGMT_TYPE) { | 1193 | attention & RX_ATTENTION_FLAGS_MGMT_TYPE) { |
1184 | ath10k_dbg(ATH10K_DBG_HTT, "htt rx mgmt ctrl\n"); | 1194 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx mgmt ctrl\n"); |
1185 | return false; | 1195 | return false; |
1186 | } | 1196 | } |
1187 | 1197 | ||
@@ -1189,14 +1199,14 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k_htt *htt, | |||
1189 | status != HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR && | 1199 | status != HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR && |
1190 | status != HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER && | 1200 | status != HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER && |
1191 | !htt->ar->monitor_started) { | 1201 | !htt->ar->monitor_started) { |
1192 | ath10k_dbg(ATH10K_DBG_HTT, | 1202 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1193 | "htt rx ignoring frame w/ status %d\n", | 1203 | "htt rx ignoring frame w/ status %d\n", |
1194 | status); | 1204 | status); |
1195 | return false; | 1205 | return false; |
1196 | } | 1206 | } |
1197 | 1207 | ||
1198 | if (test_bit(ATH10K_CAC_RUNNING, &htt->ar->dev_flags)) { | 1208 | if (test_bit(ATH10K_CAC_RUNNING, &htt->ar->dev_flags)) { |
1199 | ath10k_dbg(ATH10K_DBG_HTT, | 1209 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1200 | "htt rx CAC running\n"); | 1210 | "htt rx CAC running\n"); |
1201 | return false; | 1211 | return false; |
1202 | } | 1212 | } |
@@ -1207,6 +1217,7 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k_htt *htt, | |||
1207 | static void ath10k_htt_rx_handler(struct ath10k_htt *htt, | 1217 | static void ath10k_htt_rx_handler(struct ath10k_htt *htt, |
1208 | struct htt_rx_indication *rx) | 1218 | struct htt_rx_indication *rx) |
1209 | { | 1219 | { |
1220 | struct ath10k *ar = htt->ar; | ||
1210 | struct ieee80211_rx_status *rx_status = &htt->rx_status; | 1221 | struct ieee80211_rx_status *rx_status = &htt->rx_status; |
1211 | struct htt_rx_indication_mpdu_range *mpdu_ranges; | 1222 | struct htt_rx_indication_mpdu_range *mpdu_ranges; |
1212 | struct htt_rx_desc *rxd; | 1223 | struct htt_rx_desc *rxd; |
@@ -1252,7 +1263,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, | |||
1252 | rx_status); | 1263 | rx_status); |
1253 | } | 1264 | } |
1254 | 1265 | ||
1255 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt rx ind: ", | 1266 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt rx ind: ", |
1256 | rx, sizeof(*rx) + | 1267 | rx, sizeof(*rx) + |
1257 | (sizeof(struct htt_rx_indication_mpdu_range) * | 1268 | (sizeof(struct htt_rx_indication_mpdu_range) * |
1258 | num_mpdu_ranges)); | 1269 | num_mpdu_ranges)); |
@@ -1274,7 +1285,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, | |||
1274 | &attention); | 1285 | &attention); |
1275 | 1286 | ||
1276 | if (ret < 0) { | 1287 | if (ret < 0) { |
1277 | ath10k_warn("failed to pop amsdu from htt rx ring %d\n", | 1288 | ath10k_warn(ar, "failed to pop amsdu from htt rx ring %d\n", |
1278 | ret); | 1289 | ret); |
1279 | ath10k_htt_rx_free_msdu_chain(msdu_head); | 1290 | ath10k_htt_rx_free_msdu_chain(msdu_head); |
1280 | continue; | 1291 | continue; |
@@ -1323,6 +1334,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, | |||
1323 | static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | 1334 | static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, |
1324 | struct htt_rx_fragment_indication *frag) | 1335 | struct htt_rx_fragment_indication *frag) |
1325 | { | 1336 | { |
1337 | struct ath10k *ar = htt->ar; | ||
1326 | struct sk_buff *msdu_head, *msdu_tail; | 1338 | struct sk_buff *msdu_head, *msdu_tail; |
1327 | enum htt_rx_mpdu_encrypt_type enctype; | 1339 | enum htt_rx_mpdu_encrypt_type enctype; |
1328 | struct htt_rx_desc *rxd; | 1340 | struct htt_rx_desc *rxd; |
@@ -1349,10 +1361,10 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | |||
1349 | &attention); | 1361 | &attention); |
1350 | spin_unlock_bh(&htt->rx_ring.lock); | 1362 | spin_unlock_bh(&htt->rx_ring.lock); |
1351 | 1363 | ||
1352 | ath10k_dbg(ATH10K_DBG_HTT_DUMP, "htt rx frag ahead\n"); | 1364 | ath10k_dbg(ar, ATH10K_DBG_HTT_DUMP, "htt rx frag ahead\n"); |
1353 | 1365 | ||
1354 | if (ret) { | 1366 | if (ret) { |
1355 | ath10k_warn("failed to pop amsdu from httr rx ring for fragmented rx %d\n", | 1367 | ath10k_warn(ar, "failed to pop amsdu from httr rx ring for fragmented rx %d\n", |
1356 | ret); | 1368 | ret); |
1357 | ath10k_htt_rx_free_msdu_chain(msdu_head); | 1369 | ath10k_htt_rx_free_msdu_chain(msdu_head); |
1358 | return; | 1370 | return; |
@@ -1369,7 +1381,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | |||
1369 | RX_MSDU_START_INFO1_DECAP_FORMAT); | 1381 | RX_MSDU_START_INFO1_DECAP_FORMAT); |
1370 | 1382 | ||
1371 | if (fmt != RX_MSDU_DECAP_RAW) { | 1383 | if (fmt != RX_MSDU_DECAP_RAW) { |
1372 | ath10k_warn("we dont support non-raw fragmented rx yet\n"); | 1384 | ath10k_warn(ar, "we dont support non-raw fragmented rx yet\n"); |
1373 | dev_kfree_skb_any(msdu_head); | 1385 | dev_kfree_skb_any(msdu_head); |
1374 | goto end; | 1386 | goto end; |
1375 | } | 1387 | } |
@@ -1381,17 +1393,17 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | |||
1381 | msdu_head->ip_summed = ath10k_htt_rx_get_csum_state(msdu_head); | 1393 | msdu_head->ip_summed = ath10k_htt_rx_get_csum_state(msdu_head); |
1382 | 1394 | ||
1383 | if (tkip_mic_err) | 1395 | if (tkip_mic_err) |
1384 | ath10k_warn("tkip mic error\n"); | 1396 | ath10k_warn(ar, "tkip mic error\n"); |
1385 | 1397 | ||
1386 | if (decrypt_err) { | 1398 | if (decrypt_err) { |
1387 | ath10k_warn("decryption err in fragmented rx\n"); | 1399 | ath10k_warn(ar, "decryption err in fragmented rx\n"); |
1388 | dev_kfree_skb_any(msdu_head); | 1400 | dev_kfree_skb_any(msdu_head); |
1389 | goto end; | 1401 | goto end; |
1390 | } | 1402 | } |
1391 | 1403 | ||
1392 | if (enctype != HTT_RX_MPDU_ENCRYPT_NONE) { | 1404 | if (enctype != HTT_RX_MPDU_ENCRYPT_NONE) { |
1393 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 1405 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
1394 | paramlen = ath10k_htt_rx_crypto_param_len(enctype); | 1406 | paramlen = ath10k_htt_rx_crypto_param_len(ar, enctype); |
1395 | 1407 | ||
1396 | /* It is more efficient to move the header than the payload */ | 1408 | /* It is more efficient to move the header than the payload */ |
1397 | memmove((void *)msdu_head->data + paramlen, | 1409 | memmove((void *)msdu_head->data + paramlen, |
@@ -1405,7 +1417,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | |||
1405 | trim = 4; | 1417 | trim = 4; |
1406 | 1418 | ||
1407 | /* remove crypto trailer */ | 1419 | /* remove crypto trailer */ |
1408 | trim += ath10k_htt_rx_crypto_tail_len(enctype); | 1420 | trim += ath10k_htt_rx_crypto_tail_len(ar, enctype); |
1409 | 1421 | ||
1410 | /* last fragment of TKIP frags has MIC */ | 1422 | /* last fragment of TKIP frags has MIC */ |
1411 | if (!ieee80211_has_morefrags(hdr->frame_control) && | 1423 | if (!ieee80211_has_morefrags(hdr->frame_control) && |
@@ -1413,20 +1425,20 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, | |||
1413 | trim += 8; | 1425 | trim += 8; |
1414 | 1426 | ||
1415 | if (trim > msdu_head->len) { | 1427 | if (trim > msdu_head->len) { |
1416 | ath10k_warn("htt rx fragment: trailer longer than the frame itself? drop\n"); | 1428 | ath10k_warn(ar, "htt rx fragment: trailer longer than the frame itself? drop\n"); |
1417 | dev_kfree_skb_any(msdu_head); | 1429 | dev_kfree_skb_any(msdu_head); |
1418 | goto end; | 1430 | goto end; |
1419 | } | 1431 | } |
1420 | 1432 | ||
1421 | skb_trim(msdu_head, msdu_head->len - trim); | 1433 | skb_trim(msdu_head, msdu_head->len - trim); |
1422 | 1434 | ||
1423 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt rx frag mpdu: ", | 1435 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt rx frag mpdu: ", |
1424 | msdu_head->data, msdu_head->len); | 1436 | msdu_head->data, msdu_head->len); |
1425 | ath10k_process_rx(htt->ar, rx_status, msdu_head); | 1437 | ath10k_process_rx(htt->ar, rx_status, msdu_head); |
1426 | 1438 | ||
1427 | end: | 1439 | end: |
1428 | if (fw_desc_len > 0) { | 1440 | if (fw_desc_len > 0) { |
1429 | ath10k_dbg(ATH10K_DBG_HTT, | 1441 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1430 | "expecting more fragmented rx in one indication %d\n", | 1442 | "expecting more fragmented rx in one indication %d\n", |
1431 | fw_desc_len); | 1443 | fw_desc_len); |
1432 | } | 1444 | } |
@@ -1456,12 +1468,12 @@ static void ath10k_htt_rx_frm_tx_compl(struct ath10k *ar, | |||
1456 | tx_done.discard = true; | 1468 | tx_done.discard = true; |
1457 | break; | 1469 | break; |
1458 | default: | 1470 | default: |
1459 | ath10k_warn("unhandled tx completion status %d\n", status); | 1471 | ath10k_warn(ar, "unhandled tx completion status %d\n", status); |
1460 | tx_done.discard = true; | 1472 | tx_done.discard = true; |
1461 | break; | 1473 | break; |
1462 | } | 1474 | } |
1463 | 1475 | ||
1464 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion num_msdus %d\n", | 1476 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx completion num_msdus %d\n", |
1465 | resp->data_tx_completion.num_msdus); | 1477 | resp->data_tx_completion.num_msdus); |
1466 | 1478 | ||
1467 | for (i = 0; i < resp->data_tx_completion.num_msdus; i++) { | 1479 | for (i = 0; i < resp->data_tx_completion.num_msdus; i++) { |
@@ -1482,14 +1494,14 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, struct htt_resp *resp) | |||
1482 | tid = MS(info0, HTT_RX_BA_INFO0_TID); | 1494 | tid = MS(info0, HTT_RX_BA_INFO0_TID); |
1483 | peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID); | 1495 | peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID); |
1484 | 1496 | ||
1485 | ath10k_dbg(ATH10K_DBG_HTT, | 1497 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1486 | "htt rx addba tid %hu peer_id %hu size %hhu\n", | 1498 | "htt rx addba tid %hu peer_id %hu size %hhu\n", |
1487 | tid, peer_id, ev->window_size); | 1499 | tid, peer_id, ev->window_size); |
1488 | 1500 | ||
1489 | spin_lock_bh(&ar->data_lock); | 1501 | spin_lock_bh(&ar->data_lock); |
1490 | peer = ath10k_peer_find_by_id(ar, peer_id); | 1502 | peer = ath10k_peer_find_by_id(ar, peer_id); |
1491 | if (!peer) { | 1503 | if (!peer) { |
1492 | ath10k_warn("received addba event for invalid peer_id: %hu\n", | 1504 | ath10k_warn(ar, "received addba event for invalid peer_id: %hu\n", |
1493 | peer_id); | 1505 | peer_id); |
1494 | spin_unlock_bh(&ar->data_lock); | 1506 | spin_unlock_bh(&ar->data_lock); |
1495 | return; | 1507 | return; |
@@ -1497,13 +1509,13 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, struct htt_resp *resp) | |||
1497 | 1509 | ||
1498 | arvif = ath10k_get_arvif(ar, peer->vdev_id); | 1510 | arvif = ath10k_get_arvif(ar, peer->vdev_id); |
1499 | if (!arvif) { | 1511 | if (!arvif) { |
1500 | ath10k_warn("received addba event for invalid vdev_id: %u\n", | 1512 | ath10k_warn(ar, "received addba event for invalid vdev_id: %u\n", |
1501 | peer->vdev_id); | 1513 | peer->vdev_id); |
1502 | spin_unlock_bh(&ar->data_lock); | 1514 | spin_unlock_bh(&ar->data_lock); |
1503 | return; | 1515 | return; |
1504 | } | 1516 | } |
1505 | 1517 | ||
1506 | ath10k_dbg(ATH10K_DBG_HTT, | 1518 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1507 | "htt rx start rx ba session sta %pM tid %hu size %hhu\n", | 1519 | "htt rx start rx ba session sta %pM tid %hu size %hhu\n", |
1508 | peer->addr, tid, ev->window_size); | 1520 | peer->addr, tid, ev->window_size); |
1509 | 1521 | ||
@@ -1522,14 +1534,14 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp) | |||
1522 | tid = MS(info0, HTT_RX_BA_INFO0_TID); | 1534 | tid = MS(info0, HTT_RX_BA_INFO0_TID); |
1523 | peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID); | 1535 | peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID); |
1524 | 1536 | ||
1525 | ath10k_dbg(ATH10K_DBG_HTT, | 1537 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1526 | "htt rx delba tid %hu peer_id %hu\n", | 1538 | "htt rx delba tid %hu peer_id %hu\n", |
1527 | tid, peer_id); | 1539 | tid, peer_id); |
1528 | 1540 | ||
1529 | spin_lock_bh(&ar->data_lock); | 1541 | spin_lock_bh(&ar->data_lock); |
1530 | peer = ath10k_peer_find_by_id(ar, peer_id); | 1542 | peer = ath10k_peer_find_by_id(ar, peer_id); |
1531 | if (!peer) { | 1543 | if (!peer) { |
1532 | ath10k_warn("received addba event for invalid peer_id: %hu\n", | 1544 | ath10k_warn(ar, "received addba event for invalid peer_id: %hu\n", |
1533 | peer_id); | 1545 | peer_id); |
1534 | spin_unlock_bh(&ar->data_lock); | 1546 | spin_unlock_bh(&ar->data_lock); |
1535 | return; | 1547 | return; |
@@ -1537,13 +1549,13 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp) | |||
1537 | 1549 | ||
1538 | arvif = ath10k_get_arvif(ar, peer->vdev_id); | 1550 | arvif = ath10k_get_arvif(ar, peer->vdev_id); |
1539 | if (!arvif) { | 1551 | if (!arvif) { |
1540 | ath10k_warn("received addba event for invalid vdev_id: %u\n", | 1552 | ath10k_warn(ar, "received addba event for invalid vdev_id: %u\n", |
1541 | peer->vdev_id); | 1553 | peer->vdev_id); |
1542 | spin_unlock_bh(&ar->data_lock); | 1554 | spin_unlock_bh(&ar->data_lock); |
1543 | return; | 1555 | return; |
1544 | } | 1556 | } |
1545 | 1557 | ||
1546 | ath10k_dbg(ATH10K_DBG_HTT, | 1558 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1547 | "htt rx stop rx ba session sta %pM tid %hu\n", | 1559 | "htt rx stop rx ba session sta %pM tid %hu\n", |
1548 | peer->addr, tid); | 1560 | peer->addr, tid); |
1549 | 1561 | ||
@@ -1558,9 +1570,9 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) | |||
1558 | 1570 | ||
1559 | /* confirm alignment */ | 1571 | /* confirm alignment */ |
1560 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) | 1572 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) |
1561 | ath10k_warn("unaligned htt message, expect trouble\n"); | 1573 | ath10k_warn(ar, "unaligned htt message, expect trouble\n"); |
1562 | 1574 | ||
1563 | ath10k_dbg(ATH10K_DBG_HTT, "htt rx, msg_type: 0x%0X\n", | 1575 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx, msg_type: 0x%0X\n", |
1564 | resp->hdr.msg_type); | 1576 | resp->hdr.msg_type); |
1565 | switch (resp->hdr.msg_type) { | 1577 | switch (resp->hdr.msg_type) { |
1566 | case HTT_T2H_MSG_TYPE_VERSION_CONF: { | 1578 | case HTT_T2H_MSG_TYPE_VERSION_CONF: { |
@@ -1624,7 +1636,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) | |||
1624 | struct ath10k *ar = htt->ar; | 1636 | struct ath10k *ar = htt->ar; |
1625 | struct htt_security_indication *ev = &resp->security_indication; | 1637 | struct htt_security_indication *ev = &resp->security_indication; |
1626 | 1638 | ||
1627 | ath10k_dbg(ATH10K_DBG_HTT, | 1639 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
1628 | "sec ind peer_id %d unicast %d type %d\n", | 1640 | "sec ind peer_id %d unicast %d type %d\n", |
1629 | __le16_to_cpu(ev->peer_id), | 1641 | __le16_to_cpu(ev->peer_id), |
1630 | !!(ev->flags & HTT_SECURITY_IS_UNICAST), | 1642 | !!(ev->flags & HTT_SECURITY_IS_UNICAST), |
@@ -1633,7 +1645,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) | |||
1633 | break; | 1645 | break; |
1634 | } | 1646 | } |
1635 | case HTT_T2H_MSG_TYPE_RX_FRAG_IND: { | 1647 | case HTT_T2H_MSG_TYPE_RX_FRAG_IND: { |
1636 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt event: ", | 1648 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt event: ", |
1637 | skb->data, skb->len); | 1649 | skb->data, skb->len); |
1638 | ath10k_htt_rx_frag_handler(htt, &resp->rx_frag_ind); | 1650 | ath10k_htt_rx_frag_handler(htt, &resp->rx_frag_ind); |
1639 | break; | 1651 | break; |
@@ -1650,7 +1662,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) | |||
1650 | * sends all tx frames as already inspected so this shouldn't | 1662 | * sends all tx frames as already inspected so this shouldn't |
1651 | * happen unless fw has a bug. | 1663 | * happen unless fw has a bug. |
1652 | */ | 1664 | */ |
1653 | ath10k_warn("received an unexpected htt tx inspect event\n"); | 1665 | ath10k_warn(ar, "received an unexpected htt tx inspect event\n"); |
1654 | break; | 1666 | break; |
1655 | case HTT_T2H_MSG_TYPE_RX_ADDBA: | 1667 | case HTT_T2H_MSG_TYPE_RX_ADDBA: |
1656 | ath10k_htt_rx_addba(ar, resp); | 1668 | ath10k_htt_rx_addba(ar, resp); |
@@ -1665,9 +1677,9 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) | |||
1665 | break; | 1677 | break; |
1666 | } | 1678 | } |
1667 | default: | 1679 | default: |
1668 | ath10k_dbg(ATH10K_DBG_HTT, "htt event (%d) not handled\n", | 1680 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt event (%d) not handled\n", |
1669 | resp->hdr.msg_type); | 1681 | resp->hdr.msg_type); |
1670 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt event: ", | 1682 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt event: ", |
1671 | skb->data, skb->len); | 1683 | skb->data, skb->len); |
1672 | break; | 1684 | break; |
1673 | }; | 1685 | }; |
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 8b27bfcc1de3..eaa73aa99c20 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c | |||
@@ -58,6 +58,7 @@ exit: | |||
58 | 58 | ||
59 | int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt) | 59 | int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt) |
60 | { | 60 | { |
61 | struct ath10k *ar = htt->ar; | ||
61 | int msdu_id; | 62 | int msdu_id; |
62 | 63 | ||
63 | lockdep_assert_held(&htt->tx_lock); | 64 | lockdep_assert_held(&htt->tx_lock); |
@@ -67,24 +68,29 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt) | |||
67 | if (msdu_id == htt->max_num_pending_tx) | 68 | if (msdu_id == htt->max_num_pending_tx) |
68 | return -ENOBUFS; | 69 | return -ENOBUFS; |
69 | 70 | ||
70 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx alloc msdu_id %d\n", msdu_id); | 71 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx alloc msdu_id %d\n", msdu_id); |
71 | __set_bit(msdu_id, htt->used_msdu_ids); | 72 | __set_bit(msdu_id, htt->used_msdu_ids); |
72 | return msdu_id; | 73 | return msdu_id; |
73 | } | 74 | } |
74 | 75 | ||
75 | void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id) | 76 | void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id) |
76 | { | 77 | { |
78 | struct ath10k *ar = htt->ar; | ||
79 | |||
77 | lockdep_assert_held(&htt->tx_lock); | 80 | lockdep_assert_held(&htt->tx_lock); |
78 | 81 | ||
79 | if (!test_bit(msdu_id, htt->used_msdu_ids)) | 82 | if (!test_bit(msdu_id, htt->used_msdu_ids)) |
80 | ath10k_warn("trying to free unallocated msdu_id %d\n", msdu_id); | 83 | ath10k_warn(ar, "trying to free unallocated msdu_id %d\n", |
84 | msdu_id); | ||
81 | 85 | ||
82 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx free msdu_id %hu\n", msdu_id); | 86 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx free msdu_id %hu\n", msdu_id); |
83 | __clear_bit(msdu_id, htt->used_msdu_ids); | 87 | __clear_bit(msdu_id, htt->used_msdu_ids); |
84 | } | 88 | } |
85 | 89 | ||
86 | int ath10k_htt_tx_alloc(struct ath10k_htt *htt) | 90 | int ath10k_htt_tx_alloc(struct ath10k_htt *htt) |
87 | { | 91 | { |
92 | struct ath10k *ar = htt->ar; | ||
93 | |||
88 | spin_lock_init(&htt->tx_lock); | 94 | spin_lock_init(&htt->tx_lock); |
89 | init_waitqueue_head(&htt->empty_tx_wq); | 95 | init_waitqueue_head(&htt->empty_tx_wq); |
90 | 96 | ||
@@ -93,7 +99,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt) | |||
93 | else | 99 | else |
94 | htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC; | 100 | htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC; |
95 | 101 | ||
96 | ath10k_dbg(ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n", | 102 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n", |
97 | htt->max_num_pending_tx); | 103 | htt->max_num_pending_tx); |
98 | 104 | ||
99 | htt->pending_tx = kzalloc(sizeof(*htt->pending_tx) * | 105 | htt->pending_tx = kzalloc(sizeof(*htt->pending_tx) * |
@@ -122,6 +128,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt) | |||
122 | 128 | ||
123 | static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt) | 129 | static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt) |
124 | { | 130 | { |
131 | struct ath10k *ar = htt->ar; | ||
125 | struct htt_tx_done tx_done = {0}; | 132 | struct htt_tx_done tx_done = {0}; |
126 | int msdu_id; | 133 | int msdu_id; |
127 | 134 | ||
@@ -130,7 +137,7 @@ static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt) | |||
130 | if (!test_bit(msdu_id, htt->used_msdu_ids)) | 137 | if (!test_bit(msdu_id, htt->used_msdu_ids)) |
131 | continue; | 138 | continue; |
132 | 139 | ||
133 | ath10k_dbg(ATH10K_DBG_HTT, "force cleanup msdu_id %hu\n", | 140 | ath10k_dbg(ar, ATH10K_DBG_HTT, "force cleanup msdu_id %hu\n", |
134 | msdu_id); | 141 | msdu_id); |
135 | 142 | ||
136 | tx_done.discard = 1; | 143 | tx_done.discard = 1; |
@@ -157,6 +164,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb) | |||
157 | 164 | ||
158 | int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) | 165 | int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) |
159 | { | 166 | { |
167 | struct ath10k *ar = htt->ar; | ||
160 | struct sk_buff *skb; | 168 | struct sk_buff *skb; |
161 | struct htt_cmd *cmd; | 169 | struct htt_cmd *cmd; |
162 | int len = 0; | 170 | int len = 0; |
@@ -165,7 +173,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) | |||
165 | len += sizeof(cmd->hdr); | 173 | len += sizeof(cmd->hdr); |
166 | len += sizeof(cmd->ver_req); | 174 | len += sizeof(cmd->ver_req); |
167 | 175 | ||
168 | skb = ath10k_htc_alloc_skb(len); | 176 | skb = ath10k_htc_alloc_skb(ar, len); |
169 | if (!skb) | 177 | if (!skb) |
170 | return -ENOMEM; | 178 | return -ENOMEM; |
171 | 179 | ||
@@ -184,6 +192,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) | |||
184 | 192 | ||
185 | int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) | 193 | int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) |
186 | { | 194 | { |
195 | struct ath10k *ar = htt->ar; | ||
187 | struct htt_stats_req *req; | 196 | struct htt_stats_req *req; |
188 | struct sk_buff *skb; | 197 | struct sk_buff *skb; |
189 | struct htt_cmd *cmd; | 198 | struct htt_cmd *cmd; |
@@ -192,7 +201,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) | |||
192 | len += sizeof(cmd->hdr); | 201 | len += sizeof(cmd->hdr); |
193 | len += sizeof(cmd->stats_req); | 202 | len += sizeof(cmd->stats_req); |
194 | 203 | ||
195 | skb = ath10k_htc_alloc_skb(len); | 204 | skb = ath10k_htc_alloc_skb(ar, len); |
196 | if (!skb) | 205 | if (!skb) |
197 | return -ENOMEM; | 206 | return -ENOMEM; |
198 | 207 | ||
@@ -214,7 +223,8 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) | |||
214 | 223 | ||
215 | ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb); | 224 | ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb); |
216 | if (ret) { | 225 | if (ret) { |
217 | ath10k_warn("failed to send htt type stats request: %d", ret); | 226 | ath10k_warn(ar, "failed to send htt type stats request: %d", |
227 | ret); | ||
218 | dev_kfree_skb_any(skb); | 228 | dev_kfree_skb_any(skb); |
219 | return ret; | 229 | return ret; |
220 | } | 230 | } |
@@ -224,6 +234,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) | |||
224 | 234 | ||
225 | int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) | 235 | int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) |
226 | { | 236 | { |
237 | struct ath10k *ar = htt->ar; | ||
227 | struct sk_buff *skb; | 238 | struct sk_buff *skb; |
228 | struct htt_cmd *cmd; | 239 | struct htt_cmd *cmd; |
229 | struct htt_rx_ring_setup_ring *ring; | 240 | struct htt_rx_ring_setup_ring *ring; |
@@ -242,7 +253,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) | |||
242 | 253 | ||
243 | len = sizeof(cmd->hdr) + sizeof(cmd->rx_setup.hdr) | 254 | len = sizeof(cmd->hdr) + sizeof(cmd->rx_setup.hdr) |
244 | + (sizeof(*ring) * num_rx_ring); | 255 | + (sizeof(*ring) * num_rx_ring); |
245 | skb = ath10k_htc_alloc_skb(len); | 256 | skb = ath10k_htc_alloc_skb(ar, len); |
246 | if (!skb) | 257 | if (!skb) |
247 | return -ENOMEM; | 258 | return -ENOMEM; |
248 | 259 | ||
@@ -311,6 +322,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, | |||
311 | u8 max_subfrms_ampdu, | 322 | u8 max_subfrms_ampdu, |
312 | u8 max_subfrms_amsdu) | 323 | u8 max_subfrms_amsdu) |
313 | { | 324 | { |
325 | struct ath10k *ar = htt->ar; | ||
314 | struct htt_aggr_conf *aggr_conf; | 326 | struct htt_aggr_conf *aggr_conf; |
315 | struct sk_buff *skb; | 327 | struct sk_buff *skb; |
316 | struct htt_cmd *cmd; | 328 | struct htt_cmd *cmd; |
@@ -328,7 +340,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, | |||
328 | len = sizeof(cmd->hdr); | 340 | len = sizeof(cmd->hdr); |
329 | len += sizeof(cmd->aggr_conf); | 341 | len += sizeof(cmd->aggr_conf); |
330 | 342 | ||
331 | skb = ath10k_htc_alloc_skb(len); | 343 | skb = ath10k_htc_alloc_skb(ar, len); |
332 | if (!skb) | 344 | if (!skb) |
333 | return -ENOMEM; | 345 | return -ENOMEM; |
334 | 346 | ||
@@ -340,7 +352,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, | |||
340 | aggr_conf->max_num_ampdu_subframes = max_subfrms_ampdu; | 352 | aggr_conf->max_num_ampdu_subframes = max_subfrms_ampdu; |
341 | aggr_conf->max_num_amsdu_subframes = max_subfrms_amsdu; | 353 | aggr_conf->max_num_amsdu_subframes = max_subfrms_amsdu; |
342 | 354 | ||
343 | ath10k_dbg(ATH10K_DBG_HTT, "htt h2t aggr cfg msg amsdu %d ampdu %d", | 355 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt h2t aggr cfg msg amsdu %d ampdu %d", |
344 | aggr_conf->max_num_amsdu_subframes, | 356 | aggr_conf->max_num_amsdu_subframes, |
345 | aggr_conf->max_num_ampdu_subframes); | 357 | aggr_conf->max_num_ampdu_subframes); |
346 | 358 | ||
@@ -355,7 +367,8 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, | |||
355 | 367 | ||
356 | int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) | 368 | int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) |
357 | { | 369 | { |
358 | struct device *dev = htt->ar->dev; | 370 | struct ath10k *ar = htt->ar; |
371 | struct device *dev = ar->dev; | ||
359 | struct sk_buff *txdesc = NULL; | 372 | struct sk_buff *txdesc = NULL; |
360 | struct htt_cmd *cmd; | 373 | struct htt_cmd *cmd; |
361 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); | 374 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); |
@@ -382,7 +395,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) | |||
382 | htt->pending_tx[msdu_id] = msdu; | 395 | htt->pending_tx[msdu_id] = msdu; |
383 | spin_unlock_bh(&htt->tx_lock); | 396 | spin_unlock_bh(&htt->tx_lock); |
384 | 397 | ||
385 | txdesc = ath10k_htc_alloc_skb(len); | 398 | txdesc = ath10k_htc_alloc_skb(ar, len); |
386 | if (!txdesc) { | 399 | if (!txdesc) { |
387 | res = -ENOMEM; | 400 | res = -ENOMEM; |
388 | goto err_free_msdu_id; | 401 | goto err_free_msdu_id; |
@@ -429,7 +442,8 @@ err: | |||
429 | 442 | ||
430 | int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) | 443 | int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) |
431 | { | 444 | { |
432 | struct device *dev = htt->ar->dev; | 445 | struct ath10k *ar = htt->ar; |
446 | struct device *dev = ar->dev; | ||
433 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)msdu->data; | 447 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)msdu->data; |
434 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); | 448 | struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); |
435 | struct ath10k_hif_sg_item sg_items[2]; | 449 | struct ath10k_hif_sg_item sg_items[2]; |
@@ -545,11 +559,11 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) | |||
545 | skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr); | 559 | skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr); |
546 | skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le32(HTT_INVALID_PEERID); | 560 | skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le32(HTT_INVALID_PEERID); |
547 | 561 | ||
548 | ath10k_dbg(ATH10K_DBG_HTT, | 562 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
549 | "htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid %hhu\n", | 563 | "htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid %hhu\n", |
550 | flags0, flags1, msdu->len, msdu_id, frags_paddr, | 564 | flags0, flags1, msdu->len, msdu_id, frags_paddr, |
551 | (u32)skb_cb->paddr, vdev_id, tid); | 565 | (u32)skb_cb->paddr, vdev_id, tid); |
552 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "htt tx msdu: ", | 566 | ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt tx msdu: ", |
553 | msdu->data, msdu->len); | 567 | msdu->data, msdu->len); |
554 | 568 | ||
555 | sg_items[0].transfer_id = 0; | 569 | sg_items[0].transfer_id = 0; |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index e568882a17de..b858c8288196 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -36,6 +36,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif, | |||
36 | enum set_key_cmd cmd, | 36 | enum set_key_cmd cmd, |
37 | const u8 *macaddr) | 37 | const u8 *macaddr) |
38 | { | 38 | { |
39 | struct ath10k *ar = arvif->ar; | ||
39 | struct wmi_vdev_install_key_arg arg = { | 40 | struct wmi_vdev_install_key_arg arg = { |
40 | .vdev_id = arvif->vdev_id, | 41 | .vdev_id = arvif->vdev_id, |
41 | .key_idx = key->keyidx, | 42 | .key_idx = key->keyidx, |
@@ -73,7 +74,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif, | |||
73 | arg.key_flags = WMI_KEY_PAIRWISE; | 74 | arg.key_flags = WMI_KEY_PAIRWISE; |
74 | break; | 75 | break; |
75 | default: | 76 | default: |
76 | ath10k_warn("cipher %d is not supported\n", key->cipher); | 77 | ath10k_warn(ar, "cipher %d is not supported\n", key->cipher); |
77 | return -EOPNOTSUPP; | 78 | return -EOPNOTSUPP; |
78 | } | 79 | } |
79 | 80 | ||
@@ -168,7 +169,7 @@ static int ath10k_clear_peer_keys(struct ath10k_vif *arvif, | |||
168 | first_errno = ret; | 169 | first_errno = ret; |
169 | 170 | ||
170 | if (ret) | 171 | if (ret) |
171 | ath10k_warn("failed to remove peer wep key %d: %d\n", | 172 | ath10k_warn(ar, "failed to remove peer wep key %d: %d\n", |
172 | i, ret); | 173 | i, ret); |
173 | 174 | ||
174 | peer->keys[i] = NULL; | 175 | peer->keys[i] = NULL; |
@@ -216,7 +217,7 @@ static int ath10k_clear_vdev_key(struct ath10k_vif *arvif, | |||
216 | first_errno = ret; | 217 | first_errno = ret; |
217 | 218 | ||
218 | if (ret) | 219 | if (ret) |
219 | ath10k_warn("failed to remove key for %pM: %d\n", | 220 | ath10k_warn(ar, "failed to remove key for %pM: %d\n", |
220 | addr, ret); | 221 | addr, ret); |
221 | } | 222 | } |
222 | 223 | ||
@@ -327,14 +328,14 @@ static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr) | |||
327 | 328 | ||
328 | ret = ath10k_wmi_peer_create(ar, vdev_id, addr); | 329 | ret = ath10k_wmi_peer_create(ar, vdev_id, addr); |
329 | if (ret) { | 330 | if (ret) { |
330 | ath10k_warn("failed to create wmi peer %pM on vdev %i: %i\n", | 331 | ath10k_warn(ar, "failed to create wmi peer %pM on vdev %i: %i\n", |
331 | addr, vdev_id, ret); | 332 | addr, vdev_id, ret); |
332 | return ret; | 333 | return ret; |
333 | } | 334 | } |
334 | 335 | ||
335 | ret = ath10k_wait_for_peer_created(ar, vdev_id, addr); | 336 | ret = ath10k_wait_for_peer_created(ar, vdev_id, addr); |
336 | if (ret) { | 337 | if (ret) { |
337 | ath10k_warn("failed to wait for created wmi peer %pM on vdev %i: %i\n", | 338 | ath10k_warn(ar, "failed to wait for created wmi peer %pM on vdev %i: %i\n", |
338 | addr, vdev_id, ret); | 339 | addr, vdev_id, ret); |
339 | return ret; | 340 | return ret; |
340 | } | 341 | } |
@@ -355,7 +356,7 @@ static int ath10k_mac_set_kickout(struct ath10k_vif *arvif) | |||
355 | ret = ath10k_wmi_pdev_set_param(ar, param, | 356 | ret = ath10k_wmi_pdev_set_param(ar, param, |
356 | ATH10K_KICKOUT_THRESHOLD); | 357 | ATH10K_KICKOUT_THRESHOLD); |
357 | if (ret) { | 358 | if (ret) { |
358 | ath10k_warn("failed to set kickout threshold on vdev %i: %d\n", | 359 | ath10k_warn(ar, "failed to set kickout threshold on vdev %i: %d\n", |
359 | arvif->vdev_id, ret); | 360 | arvif->vdev_id, ret); |
360 | return ret; | 361 | return ret; |
361 | } | 362 | } |
@@ -364,7 +365,7 @@ static int ath10k_mac_set_kickout(struct ath10k_vif *arvif) | |||
364 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, | 365 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, |
365 | ATH10K_KEEPALIVE_MIN_IDLE); | 366 | ATH10K_KEEPALIVE_MIN_IDLE); |
366 | if (ret) { | 367 | if (ret) { |
367 | ath10k_warn("failed to set keepalive minimum idle time on vdev %i: %d\n", | 368 | ath10k_warn(ar, "failed to set keepalive minimum idle time on vdev %i: %d\n", |
368 | arvif->vdev_id, ret); | 369 | arvif->vdev_id, ret); |
369 | return ret; | 370 | return ret; |
370 | } | 371 | } |
@@ -373,7 +374,7 @@ static int ath10k_mac_set_kickout(struct ath10k_vif *arvif) | |||
373 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, | 374 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, |
374 | ATH10K_KEEPALIVE_MAX_IDLE); | 375 | ATH10K_KEEPALIVE_MAX_IDLE); |
375 | if (ret) { | 376 | if (ret) { |
376 | ath10k_warn("failed to set keepalive maximum idle time on vdev %i: %d\n", | 377 | ath10k_warn(ar, "failed to set keepalive maximum idle time on vdev %i: %d\n", |
377 | arvif->vdev_id, ret); | 378 | arvif->vdev_id, ret); |
378 | return ret; | 379 | return ret; |
379 | } | 380 | } |
@@ -382,7 +383,7 @@ static int ath10k_mac_set_kickout(struct ath10k_vif *arvif) | |||
382 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, | 383 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, |
383 | ATH10K_KEEPALIVE_MAX_UNRESPONSIVE); | 384 | ATH10K_KEEPALIVE_MAX_UNRESPONSIVE); |
384 | if (ret) { | 385 | if (ret) { |
385 | ath10k_warn("failed to set keepalive maximum unresponsive time on vdev %i: %d\n", | 386 | ath10k_warn(ar, "failed to set keepalive maximum unresponsive time on vdev %i: %d\n", |
386 | arvif->vdev_id, ret); | 387 | arvif->vdev_id, ret); |
387 | return ret; | 388 | return ret; |
388 | } | 389 | } |
@@ -449,7 +450,7 @@ static void ath10k_peer_cleanup(struct ath10k *ar, u32 vdev_id) | |||
449 | if (peer->vdev_id != vdev_id) | 450 | if (peer->vdev_id != vdev_id) |
450 | continue; | 451 | continue; |
451 | 452 | ||
452 | ath10k_warn("removing stale peer %pM from vdev_id %d\n", | 453 | ath10k_warn(ar, "removing stale peer %pM from vdev_id %d\n", |
453 | peer->addr, vdev_id); | 454 | peer->addr, vdev_id); |
454 | 455 | ||
455 | list_del(&peer->list); | 456 | list_del(&peer->list); |
@@ -496,7 +497,7 @@ static bool ath10k_monitor_is_enabled(struct ath10k *ar) | |||
496 | { | 497 | { |
497 | lockdep_assert_held(&ar->conf_mutex); | 498 | lockdep_assert_held(&ar->conf_mutex); |
498 | 499 | ||
499 | ath10k_dbg(ATH10K_DBG_MAC, | 500 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
500 | "mac monitor refs: promisc %d monitor %d cac %d\n", | 501 | "mac monitor refs: promisc %d monitor %d cac %d\n", |
501 | ar->promisc, ar->monitor, | 502 | ar->promisc, ar->monitor, |
502 | test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)); | 503 | test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)); |
@@ -531,35 +532,35 @@ static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) | |||
531 | 532 | ||
532 | ret = ath10k_wmi_vdev_start(ar, &arg); | 533 | ret = ath10k_wmi_vdev_start(ar, &arg); |
533 | if (ret) { | 534 | if (ret) { |
534 | ath10k_warn("failed to request monitor vdev %i start: %d\n", | 535 | ath10k_warn(ar, "failed to request monitor vdev %i start: %d\n", |
535 | vdev_id, ret); | 536 | vdev_id, ret); |
536 | return ret; | 537 | return ret; |
537 | } | 538 | } |
538 | 539 | ||
539 | ret = ath10k_vdev_setup_sync(ar); | 540 | ret = ath10k_vdev_setup_sync(ar); |
540 | if (ret) { | 541 | if (ret) { |
541 | ath10k_warn("failed to synchronize setup for monitor vdev %i: %d\n", | 542 | ath10k_warn(ar, "failed to synchronize setup for monitor vdev %i: %d\n", |
542 | vdev_id, ret); | 543 | vdev_id, ret); |
543 | return ret; | 544 | return ret; |
544 | } | 545 | } |
545 | 546 | ||
546 | ret = ath10k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); | 547 | ret = ath10k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); |
547 | if (ret) { | 548 | if (ret) { |
548 | ath10k_warn("failed to put up monitor vdev %i: %d\n", | 549 | ath10k_warn(ar, "failed to put up monitor vdev %i: %d\n", |
549 | vdev_id, ret); | 550 | vdev_id, ret); |
550 | goto vdev_stop; | 551 | goto vdev_stop; |
551 | } | 552 | } |
552 | 553 | ||
553 | ar->monitor_vdev_id = vdev_id; | 554 | ar->monitor_vdev_id = vdev_id; |
554 | 555 | ||
555 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor vdev %i started\n", | 556 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor vdev %i started\n", |
556 | ar->monitor_vdev_id); | 557 | ar->monitor_vdev_id); |
557 | return 0; | 558 | return 0; |
558 | 559 | ||
559 | vdev_stop: | 560 | vdev_stop: |
560 | ret = ath10k_wmi_vdev_stop(ar, ar->monitor_vdev_id); | 561 | ret = ath10k_wmi_vdev_stop(ar, ar->monitor_vdev_id); |
561 | if (ret) | 562 | if (ret) |
562 | ath10k_warn("failed to stop monitor vdev %i after start failure: %d\n", | 563 | ath10k_warn(ar, "failed to stop monitor vdev %i after start failure: %d\n", |
563 | ar->monitor_vdev_id, ret); | 564 | ar->monitor_vdev_id, ret); |
564 | 565 | ||
565 | return ret; | 566 | return ret; |
@@ -573,20 +574,20 @@ static int ath10k_monitor_vdev_stop(struct ath10k *ar) | |||
573 | 574 | ||
574 | ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id); | 575 | ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id); |
575 | if (ret) | 576 | if (ret) |
576 | ath10k_warn("failed to put down monitor vdev %i: %d\n", | 577 | ath10k_warn(ar, "failed to put down monitor vdev %i: %d\n", |
577 | ar->monitor_vdev_id, ret); | 578 | ar->monitor_vdev_id, ret); |
578 | 579 | ||
579 | ret = ath10k_wmi_vdev_stop(ar, ar->monitor_vdev_id); | 580 | ret = ath10k_wmi_vdev_stop(ar, ar->monitor_vdev_id); |
580 | if (ret) | 581 | if (ret) |
581 | ath10k_warn("failed to to request monitor vdev %i stop: %d\n", | 582 | ath10k_warn(ar, "failed to to request monitor vdev %i stop: %d\n", |
582 | ar->monitor_vdev_id, ret); | 583 | ar->monitor_vdev_id, ret); |
583 | 584 | ||
584 | ret = ath10k_vdev_setup_sync(ar); | 585 | ret = ath10k_vdev_setup_sync(ar); |
585 | if (ret) | 586 | if (ret) |
586 | ath10k_warn("failed to synchronise monitor vdev %i: %d\n", | 587 | ath10k_warn(ar, "failed to synchronise monitor vdev %i: %d\n", |
587 | ar->monitor_vdev_id, ret); | 588 | ar->monitor_vdev_id, ret); |
588 | 589 | ||
589 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor vdev %i stopped\n", | 590 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor vdev %i stopped\n", |
590 | ar->monitor_vdev_id); | 591 | ar->monitor_vdev_id); |
591 | return ret; | 592 | return ret; |
592 | } | 593 | } |
@@ -598,7 +599,7 @@ static int ath10k_monitor_vdev_create(struct ath10k *ar) | |||
598 | lockdep_assert_held(&ar->conf_mutex); | 599 | lockdep_assert_held(&ar->conf_mutex); |
599 | 600 | ||
600 | if (ar->free_vdev_map == 0) { | 601 | if (ar->free_vdev_map == 0) { |
601 | ath10k_warn("failed to find free vdev id for monitor vdev\n"); | 602 | ath10k_warn(ar, "failed to find free vdev id for monitor vdev\n"); |
602 | return -ENOMEM; | 603 | return -ENOMEM; |
603 | } | 604 | } |
604 | 605 | ||
@@ -610,13 +611,13 @@ static int ath10k_monitor_vdev_create(struct ath10k *ar) | |||
610 | WMI_VDEV_TYPE_MONITOR, | 611 | WMI_VDEV_TYPE_MONITOR, |
611 | 0, ar->mac_addr); | 612 | 0, ar->mac_addr); |
612 | if (ret) { | 613 | if (ret) { |
613 | ath10k_warn("failed to request monitor vdev %i creation: %d\n", | 614 | ath10k_warn(ar, "failed to request monitor vdev %i creation: %d\n", |
614 | ar->monitor_vdev_id, ret); | 615 | ar->monitor_vdev_id, ret); |
615 | return ret; | 616 | return ret; |
616 | } | 617 | } |
617 | 618 | ||
618 | ar->free_vdev_map &= ~(1 << ar->monitor_vdev_id); | 619 | ar->free_vdev_map &= ~(1 << ar->monitor_vdev_id); |
619 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor vdev %d created\n", | 620 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor vdev %d created\n", |
620 | ar->monitor_vdev_id); | 621 | ar->monitor_vdev_id); |
621 | 622 | ||
622 | return 0; | 623 | return 0; |
@@ -630,14 +631,14 @@ static int ath10k_monitor_vdev_delete(struct ath10k *ar) | |||
630 | 631 | ||
631 | ret = ath10k_wmi_vdev_delete(ar, ar->monitor_vdev_id); | 632 | ret = ath10k_wmi_vdev_delete(ar, ar->monitor_vdev_id); |
632 | if (ret) { | 633 | if (ret) { |
633 | ath10k_warn("failed to request wmi monitor vdev %i removal: %d\n", | 634 | ath10k_warn(ar, "failed to request wmi monitor vdev %i removal: %d\n", |
634 | ar->monitor_vdev_id, ret); | 635 | ar->monitor_vdev_id, ret); |
635 | return ret; | 636 | return ret; |
636 | } | 637 | } |
637 | 638 | ||
638 | ar->free_vdev_map |= 1 << ar->monitor_vdev_id; | 639 | ar->free_vdev_map |= 1 << ar->monitor_vdev_id; |
639 | 640 | ||
640 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor vdev %d deleted\n", | 641 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor vdev %d deleted\n", |
641 | ar->monitor_vdev_id); | 642 | ar->monitor_vdev_id); |
642 | return ret; | 643 | return ret; |
643 | } | 644 | } |
@@ -649,30 +650,30 @@ static int ath10k_monitor_start(struct ath10k *ar) | |||
649 | lockdep_assert_held(&ar->conf_mutex); | 650 | lockdep_assert_held(&ar->conf_mutex); |
650 | 651 | ||
651 | if (!ath10k_monitor_is_enabled(ar)) { | 652 | if (!ath10k_monitor_is_enabled(ar)) { |
652 | ath10k_warn("trying to start monitor with no references\n"); | 653 | ath10k_warn(ar, "trying to start monitor with no references\n"); |
653 | return 0; | 654 | return 0; |
654 | } | 655 | } |
655 | 656 | ||
656 | if (ar->monitor_started) { | 657 | if (ar->monitor_started) { |
657 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor already started\n"); | 658 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor already started\n"); |
658 | return 0; | 659 | return 0; |
659 | } | 660 | } |
660 | 661 | ||
661 | ret = ath10k_monitor_vdev_create(ar); | 662 | ret = ath10k_monitor_vdev_create(ar); |
662 | if (ret) { | 663 | if (ret) { |
663 | ath10k_warn("failed to create monitor vdev: %d\n", ret); | 664 | ath10k_warn(ar, "failed to create monitor vdev: %d\n", ret); |
664 | return ret; | 665 | return ret; |
665 | } | 666 | } |
666 | 667 | ||
667 | ret = ath10k_monitor_vdev_start(ar, ar->monitor_vdev_id); | 668 | ret = ath10k_monitor_vdev_start(ar, ar->monitor_vdev_id); |
668 | if (ret) { | 669 | if (ret) { |
669 | ath10k_warn("failed to start monitor vdev: %d\n", ret); | 670 | ath10k_warn(ar, "failed to start monitor vdev: %d\n", ret); |
670 | ath10k_monitor_vdev_delete(ar); | 671 | ath10k_monitor_vdev_delete(ar); |
671 | return ret; | 672 | return ret; |
672 | } | 673 | } |
673 | 674 | ||
674 | ar->monitor_started = true; | 675 | ar->monitor_started = true; |
675 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor started\n"); | 676 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor started\n"); |
676 | 677 | ||
677 | return 0; | 678 | return 0; |
678 | } | 679 | } |
@@ -684,27 +685,27 @@ static void ath10k_monitor_stop(struct ath10k *ar) | |||
684 | lockdep_assert_held(&ar->conf_mutex); | 685 | lockdep_assert_held(&ar->conf_mutex); |
685 | 686 | ||
686 | if (ath10k_monitor_is_enabled(ar)) { | 687 | if (ath10k_monitor_is_enabled(ar)) { |
687 | ath10k_dbg(ATH10K_DBG_MAC, | 688 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
688 | "mac monitor will be stopped later\n"); | 689 | "mac monitor will be stopped later\n"); |
689 | return; | 690 | return; |
690 | } | 691 | } |
691 | 692 | ||
692 | if (!ar->monitor_started) { | 693 | if (!ar->monitor_started) { |
693 | ath10k_dbg(ATH10K_DBG_MAC, | 694 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
694 | "mac monitor probably failed to start earlier\n"); | 695 | "mac monitor probably failed to start earlier\n"); |
695 | return; | 696 | return; |
696 | } | 697 | } |
697 | 698 | ||
698 | ret = ath10k_monitor_vdev_stop(ar); | 699 | ret = ath10k_monitor_vdev_stop(ar); |
699 | if (ret) | 700 | if (ret) |
700 | ath10k_warn("failed to stop monitor vdev: %d\n", ret); | 701 | ath10k_warn(ar, "failed to stop monitor vdev: %d\n", ret); |
701 | 702 | ||
702 | ret = ath10k_monitor_vdev_delete(ar); | 703 | ret = ath10k_monitor_vdev_delete(ar); |
703 | if (ret) | 704 | if (ret) |
704 | ath10k_warn("failed to delete monitor vdev: %d\n", ret); | 705 | ath10k_warn(ar, "failed to delete monitor vdev: %d\n", ret); |
705 | 706 | ||
706 | ar->monitor_started = false; | 707 | ar->monitor_started = false; |
707 | ath10k_dbg(ATH10K_DBG_MAC, "mac monitor stopped\n"); | 708 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac monitor stopped\n"); |
708 | } | 709 | } |
709 | 710 | ||
710 | static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif) | 711 | static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif) |
@@ -737,12 +738,12 @@ static int ath10k_start_cac(struct ath10k *ar) | |||
737 | 738 | ||
738 | ret = ath10k_monitor_start(ar); | 739 | ret = ath10k_monitor_start(ar); |
739 | if (ret) { | 740 | if (ret) { |
740 | ath10k_warn("failed to start monitor (cac): %d\n", ret); | 741 | ath10k_warn(ar, "failed to start monitor (cac): %d\n", ret); |
741 | clear_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); | 742 | clear_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); |
742 | return ret; | 743 | return ret; |
743 | } | 744 | } |
744 | 745 | ||
745 | ath10k_dbg(ATH10K_DBG_MAC, "mac cac start monitor vdev %d\n", | 746 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac cac start monitor vdev %d\n", |
746 | ar->monitor_vdev_id); | 747 | ar->monitor_vdev_id); |
747 | 748 | ||
748 | return 0; | 749 | return 0; |
@@ -759,7 +760,7 @@ static int ath10k_stop_cac(struct ath10k *ar) | |||
759 | clear_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); | 760 | clear_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); |
760 | ath10k_monitor_stop(ar); | 761 | ath10k_monitor_stop(ar); |
761 | 762 | ||
762 | ath10k_dbg(ATH10K_DBG_MAC, "mac cac finished\n"); | 763 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac cac finished\n"); |
763 | 764 | ||
764 | return 0; | 765 | return 0; |
765 | } | 766 | } |
@@ -785,7 +786,7 @@ static void ath10k_recalc_radar_detection(struct ath10k *ar) | |||
785 | * radiation is not allowed, make this channel DFS_UNAVAILABLE | 786 | * radiation is not allowed, make this channel DFS_UNAVAILABLE |
786 | * by indicating that radar was detected. | 787 | * by indicating that radar was detected. |
787 | */ | 788 | */ |
788 | ath10k_warn("failed to start CAC: %d\n", ret); | 789 | ath10k_warn(ar, "failed to start CAC: %d\n", ret); |
789 | ieee80211_radar_detected(ar->hw); | 790 | ieee80211_radar_detected(ar->hw); |
790 | } | 791 | } |
791 | } | 792 | } |
@@ -827,7 +828,7 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart) | |||
827 | arg.ssid_len = arvif->vif->bss_conf.ssid_len; | 828 | arg.ssid_len = arvif->vif->bss_conf.ssid_len; |
828 | } | 829 | } |
829 | 830 | ||
830 | ath10k_dbg(ATH10K_DBG_MAC, | 831 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
831 | "mac vdev %d start center_freq %d phymode %s\n", | 832 | "mac vdev %d start center_freq %d phymode %s\n", |
832 | arg.vdev_id, arg.channel.freq, | 833 | arg.vdev_id, arg.channel.freq, |
833 | ath10k_wmi_phymode_str(arg.channel.mode)); | 834 | ath10k_wmi_phymode_str(arg.channel.mode)); |
@@ -838,14 +839,14 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart) | |||
838 | ret = ath10k_wmi_vdev_start(ar, &arg); | 839 | ret = ath10k_wmi_vdev_start(ar, &arg); |
839 | 840 | ||
840 | if (ret) { | 841 | if (ret) { |
841 | ath10k_warn("failed to start WMI vdev %i: %d\n", | 842 | ath10k_warn(ar, "failed to start WMI vdev %i: %d\n", |
842 | arg.vdev_id, ret); | 843 | arg.vdev_id, ret); |
843 | return ret; | 844 | return ret; |
844 | } | 845 | } |
845 | 846 | ||
846 | ret = ath10k_vdev_setup_sync(ar); | 847 | ret = ath10k_vdev_setup_sync(ar); |
847 | if (ret) { | 848 | if (ret) { |
848 | ath10k_warn("failed to synchronise setup for vdev %i: %d\n", | 849 | ath10k_warn(ar, "failed to synchronise setup for vdev %i: %d\n", |
849 | arg.vdev_id, ret); | 850 | arg.vdev_id, ret); |
850 | return ret; | 851 | return ret; |
851 | } | 852 | } |
@@ -877,14 +878,14 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif) | |||
877 | 878 | ||
878 | ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id); | 879 | ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id); |
879 | if (ret) { | 880 | if (ret) { |
880 | ath10k_warn("failed to stop WMI vdev %i: %d\n", | 881 | ath10k_warn(ar, "failed to stop WMI vdev %i: %d\n", |
881 | arvif->vdev_id, ret); | 882 | arvif->vdev_id, ret); |
882 | return ret; | 883 | return ret; |
883 | } | 884 | } |
884 | 885 | ||
885 | ret = ath10k_vdev_setup_sync(ar); | 886 | ret = ath10k_vdev_setup_sync(ar); |
886 | if (ret) { | 887 | if (ret) { |
887 | ath10k_warn("failed to syncronise setup for vdev %i: %d\n", | 888 | ath10k_warn(ar, "failed to syncronise setup for vdev %i: %d\n", |
888 | arvif->vdev_id, ret); | 889 | arvif->vdev_id, ret); |
889 | return ret; | 890 | return ret; |
890 | } | 891 | } |
@@ -902,6 +903,7 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif) | |||
902 | static void ath10k_control_beaconing(struct ath10k_vif *arvif, | 903 | static void ath10k_control_beaconing(struct ath10k_vif *arvif, |
903 | struct ieee80211_bss_conf *info) | 904 | struct ieee80211_bss_conf *info) |
904 | { | 905 | { |
906 | struct ath10k *ar = arvif->ar; | ||
905 | int ret = 0; | 907 | int ret = 0; |
906 | 908 | ||
907 | lockdep_assert_held(&arvif->ar->conf_mutex); | 909 | lockdep_assert_held(&arvif->ar->conf_mutex); |
@@ -939,7 +941,7 @@ static void ath10k_control_beaconing(struct ath10k_vif *arvif, | |||
939 | ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, | 941 | ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, |
940 | arvif->bssid); | 942 | arvif->bssid); |
941 | if (ret) { | 943 | if (ret) { |
942 | ath10k_warn("failed to bring up vdev %d: %i\n", | 944 | ath10k_warn(ar, "failed to bring up vdev %d: %i\n", |
943 | arvif->vdev_id, ret); | 945 | arvif->vdev_id, ret); |
944 | ath10k_vdev_stop(arvif); | 946 | ath10k_vdev_stop(arvif); |
945 | return; | 947 | return; |
@@ -948,13 +950,14 @@ static void ath10k_control_beaconing(struct ath10k_vif *arvif, | |||
948 | arvif->is_started = true; | 950 | arvif->is_started = true; |
949 | arvif->is_up = true; | 951 | arvif->is_up = true; |
950 | 952 | ||
951 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); | 953 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); |
952 | } | 954 | } |
953 | 955 | ||
954 | static void ath10k_control_ibss(struct ath10k_vif *arvif, | 956 | static void ath10k_control_ibss(struct ath10k_vif *arvif, |
955 | struct ieee80211_bss_conf *info, | 957 | struct ieee80211_bss_conf *info, |
956 | const u8 self_peer[ETH_ALEN]) | 958 | const u8 self_peer[ETH_ALEN]) |
957 | { | 959 | { |
960 | struct ath10k *ar = arvif->ar; | ||
958 | u32 vdev_param; | 961 | u32 vdev_param; |
959 | int ret = 0; | 962 | int ret = 0; |
960 | 963 | ||
@@ -963,7 +966,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, | |||
963 | if (!info->ibss_joined) { | 966 | if (!info->ibss_joined) { |
964 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, self_peer); | 967 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, self_peer); |
965 | if (ret) | 968 | if (ret) |
966 | ath10k_warn("failed to delete IBSS self peer %pM for vdev %d: %d\n", | 969 | ath10k_warn(ar, "failed to delete IBSS self peer %pM for vdev %d: %d\n", |
967 | self_peer, arvif->vdev_id, ret); | 970 | self_peer, arvif->vdev_id, ret); |
968 | 971 | ||
969 | if (is_zero_ether_addr(arvif->bssid)) | 972 | if (is_zero_ether_addr(arvif->bssid)) |
@@ -972,7 +975,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, | |||
972 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, | 975 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, |
973 | arvif->bssid); | 976 | arvif->bssid); |
974 | if (ret) { | 977 | if (ret) { |
975 | ath10k_warn("failed to delete IBSS BSSID peer %pM for vdev %d: %d\n", | 978 | ath10k_warn(ar, "failed to delete IBSS BSSID peer %pM for vdev %d: %d\n", |
976 | arvif->bssid, arvif->vdev_id, ret); | 979 | arvif->bssid, arvif->vdev_id, ret); |
977 | return; | 980 | return; |
978 | } | 981 | } |
@@ -984,7 +987,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, | |||
984 | 987 | ||
985 | ret = ath10k_peer_create(arvif->ar, arvif->vdev_id, self_peer); | 988 | ret = ath10k_peer_create(arvif->ar, arvif->vdev_id, self_peer); |
986 | if (ret) { | 989 | if (ret) { |
987 | ath10k_warn("failed to create IBSS self peer %pM for vdev %d: %d\n", | 990 | ath10k_warn(ar, "failed to create IBSS self peer %pM for vdev %d: %d\n", |
988 | self_peer, arvif->vdev_id, ret); | 991 | self_peer, arvif->vdev_id, ret); |
989 | return; | 992 | return; |
990 | } | 993 | } |
@@ -993,7 +996,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, | |||
993 | ret = ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id, vdev_param, | 996 | ret = ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id, vdev_param, |
994 | ATH10K_DEFAULT_ATIM); | 997 | ATH10K_DEFAULT_ATIM); |
995 | if (ret) | 998 | if (ret) |
996 | ath10k_warn("failed to set IBSS ATIM for vdev %d: %d\n", | 999 | ath10k_warn(ar, "failed to set IBSS ATIM for vdev %d: %d\n", |
997 | arvif->vdev_id, ret); | 1000 | arvif->vdev_id, ret); |
998 | } | 1001 | } |
999 | 1002 | ||
@@ -1020,7 +1023,7 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) | |||
1020 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, | 1023 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, |
1021 | conf->dynamic_ps_timeout); | 1024 | conf->dynamic_ps_timeout); |
1022 | if (ret) { | 1025 | if (ret) { |
1023 | ath10k_warn("failed to set inactivity time for vdev %d: %i\n", | 1026 | ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n", |
1024 | arvif->vdev_id, ret); | 1027 | arvif->vdev_id, ret); |
1025 | return ret; | 1028 | return ret; |
1026 | } | 1029 | } |
@@ -1028,12 +1031,12 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) | |||
1028 | psmode = WMI_STA_PS_MODE_DISABLED; | 1031 | psmode = WMI_STA_PS_MODE_DISABLED; |
1029 | } | 1032 | } |
1030 | 1033 | ||
1031 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d psmode %s\n", | 1034 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d psmode %s\n", |
1032 | arvif->vdev_id, psmode ? "enable" : "disable"); | 1035 | arvif->vdev_id, psmode ? "enable" : "disable"); |
1033 | 1036 | ||
1034 | ret = ath10k_wmi_set_psmode(ar, arvif->vdev_id, psmode); | 1037 | ret = ath10k_wmi_set_psmode(ar, arvif->vdev_id, psmode); |
1035 | if (ret) { | 1038 | if (ret) { |
1036 | ath10k_warn("failed to set PS Mode %d for vdev %d: %d\n", | 1039 | ath10k_warn(ar, "failed to set PS Mode %d for vdev %d: %d\n", |
1037 | psmode, arvif->vdev_id, ret); | 1040 | psmode, arvif->vdev_id, ret); |
1038 | return ret; | 1041 | return ret; |
1039 | } | 1042 | } |
@@ -1117,12 +1120,12 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar, | |||
1117 | 1120 | ||
1118 | /* FIXME: base on RSN IE/WPA IE is a correct idea? */ | 1121 | /* FIXME: base on RSN IE/WPA IE is a correct idea? */ |
1119 | if (rsnie || wpaie) { | 1122 | if (rsnie || wpaie) { |
1120 | ath10k_dbg(ATH10K_DBG_WMI, "%s: rsn ie found\n", __func__); | 1123 | ath10k_dbg(ar, ATH10K_DBG_WMI, "%s: rsn ie found\n", __func__); |
1121 | arg->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; | 1124 | arg->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; |
1122 | } | 1125 | } |
1123 | 1126 | ||
1124 | if (wpaie) { | 1127 | if (wpaie) { |
1125 | ath10k_dbg(ATH10K_DBG_WMI, "%s: wpa ie found\n", __func__); | 1128 | ath10k_dbg(ar, ATH10K_DBG_WMI, "%s: wpa ie found\n", __func__); |
1126 | arg->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; | 1129 | arg->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; |
1127 | } | 1130 | } |
1128 | } | 1131 | } |
@@ -1231,7 +1234,7 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar, | |||
1231 | arg->peer_num_spatial_streams = sta->rx_nss; | 1234 | arg->peer_num_spatial_streams = sta->rx_nss; |
1232 | } | 1235 | } |
1233 | 1236 | ||
1234 | ath10k_dbg(ATH10K_DBG_MAC, "mac ht peer %pM mcs cnt %d nss %d\n", | 1237 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac ht peer %pM mcs cnt %d nss %d\n", |
1235 | arg->addr, | 1238 | arg->addr, |
1236 | arg->peer_ht_rates.num_rates, | 1239 | arg->peer_ht_rates.num_rates, |
1237 | arg->peer_num_spatial_streams); | 1240 | arg->peer_num_spatial_streams); |
@@ -1248,7 +1251,7 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar, | |||
1248 | lockdep_assert_held(&ar->conf_mutex); | 1251 | lockdep_assert_held(&ar->conf_mutex); |
1249 | 1252 | ||
1250 | if (sta->wme && sta->uapsd_queues) { | 1253 | if (sta->wme && sta->uapsd_queues) { |
1251 | ath10k_dbg(ATH10K_DBG_MAC, "mac uapsd_queues 0x%x max_sp %d\n", | 1254 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac uapsd_queues 0x%x max_sp %d\n", |
1252 | sta->uapsd_queues, sta->max_sp); | 1255 | sta->uapsd_queues, sta->max_sp); |
1253 | 1256 | ||
1254 | if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) | 1257 | if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) |
@@ -1273,7 +1276,7 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar, | |||
1273 | WMI_AP_PS_PEER_PARAM_UAPSD, | 1276 | WMI_AP_PS_PEER_PARAM_UAPSD, |
1274 | uapsd); | 1277 | uapsd); |
1275 | if (ret) { | 1278 | if (ret) { |
1276 | ath10k_warn("failed to set ap ps peer param uapsd for vdev %i: %d\n", | 1279 | ath10k_warn(ar, "failed to set ap ps peer param uapsd for vdev %i: %d\n", |
1277 | arvif->vdev_id, ret); | 1280 | arvif->vdev_id, ret); |
1278 | return ret; | 1281 | return ret; |
1279 | } | 1282 | } |
@@ -1283,7 +1286,7 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar, | |||
1283 | WMI_AP_PS_PEER_PARAM_MAX_SP, | 1286 | WMI_AP_PS_PEER_PARAM_MAX_SP, |
1284 | max_sp); | 1287 | max_sp); |
1285 | if (ret) { | 1288 | if (ret) { |
1286 | ath10k_warn("failed to set ap ps peer param max sp for vdev %i: %d\n", | 1289 | ath10k_warn(ar, "failed to set ap ps peer param max sp for vdev %i: %d\n", |
1287 | arvif->vdev_id, ret); | 1290 | arvif->vdev_id, ret); |
1288 | return ret; | 1291 | return ret; |
1289 | } | 1292 | } |
@@ -1295,7 +1298,7 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar, | |||
1295 | ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, sta->addr, | 1298 | ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, sta->addr, |
1296 | WMI_AP_PS_PEER_PARAM_AGEOUT_TIME, 10); | 1299 | WMI_AP_PS_PEER_PARAM_AGEOUT_TIME, 10); |
1297 | if (ret) { | 1300 | if (ret) { |
1298 | ath10k_warn("failed to set ap ps peer param ageout time for vdev %i: %d\n", | 1301 | ath10k_warn(ar, "failed to set ap ps peer param ageout time for vdev %i: %d\n", |
1299 | arvif->vdev_id, ret); | 1302 | arvif->vdev_id, ret); |
1300 | return ret; | 1303 | return ret; |
1301 | } | 1304 | } |
@@ -1342,7 +1345,7 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar, | |||
1342 | arg->peer_vht_rates.tx_mcs_set = | 1345 | arg->peer_vht_rates.tx_mcs_set = |
1343 | __le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map); | 1346 | __le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map); |
1344 | 1347 | ||
1345 | ath10k_dbg(ATH10K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n", | 1348 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n", |
1346 | sta->addr, arg->peer_max_mpdu, arg->peer_flags); | 1349 | sta->addr, arg->peer_max_mpdu, arg->peer_flags); |
1347 | } | 1350 | } |
1348 | 1351 | ||
@@ -1415,7 +1418,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar, | |||
1415 | break; | 1418 | break; |
1416 | } | 1419 | } |
1417 | 1420 | ||
1418 | ath10k_dbg(ATH10K_DBG_MAC, "mac peer %pM phymode %s\n", | 1421 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac peer %pM phymode %s\n", |
1419 | sta->addr, ath10k_wmi_phymode_str(phymode)); | 1422 | sta->addr, ath10k_wmi_phymode_str(phymode)); |
1420 | 1423 | ||
1421 | arg->peer_phymode = phymode; | 1424 | arg->peer_phymode = phymode; |
@@ -1488,7 +1491,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, | |||
1488 | 1491 | ||
1489 | ap_sta = ieee80211_find_sta(vif, bss_conf->bssid); | 1492 | ap_sta = ieee80211_find_sta(vif, bss_conf->bssid); |
1490 | if (!ap_sta) { | 1493 | if (!ap_sta) { |
1491 | ath10k_warn("failed to find station entry for bss %pM vdev %i\n", | 1494 | ath10k_warn(ar, "failed to find station entry for bss %pM vdev %i\n", |
1492 | bss_conf->bssid, arvif->vdev_id); | 1495 | bss_conf->bssid, arvif->vdev_id); |
1493 | rcu_read_unlock(); | 1496 | rcu_read_unlock(); |
1494 | return; | 1497 | return; |
@@ -1501,7 +1504,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, | |||
1501 | ret = ath10k_peer_assoc_prepare(ar, arvif, ap_sta, | 1504 | ret = ath10k_peer_assoc_prepare(ar, arvif, ap_sta, |
1502 | bss_conf, &peer_arg); | 1505 | bss_conf, &peer_arg); |
1503 | if (ret) { | 1506 | if (ret) { |
1504 | ath10k_warn("failed to prepare peer assoc for %pM vdev %i: %d\n", | 1507 | ath10k_warn(ar, "failed to prepare peer assoc for %pM vdev %i: %d\n", |
1505 | bss_conf->bssid, arvif->vdev_id, ret); | 1508 | bss_conf->bssid, arvif->vdev_id, ret); |
1506 | rcu_read_unlock(); | 1509 | rcu_read_unlock(); |
1507 | return; | 1510 | return; |
@@ -1511,19 +1514,19 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, | |||
1511 | 1514 | ||
1512 | ret = ath10k_wmi_peer_assoc(ar, &peer_arg); | 1515 | ret = ath10k_wmi_peer_assoc(ar, &peer_arg); |
1513 | if (ret) { | 1516 | if (ret) { |
1514 | ath10k_warn("failed to run peer assoc for %pM vdev %i: %d\n", | 1517 | ath10k_warn(ar, "failed to run peer assoc for %pM vdev %i: %d\n", |
1515 | bss_conf->bssid, arvif->vdev_id, ret); | 1518 | bss_conf->bssid, arvif->vdev_id, ret); |
1516 | return; | 1519 | return; |
1517 | } | 1520 | } |
1518 | 1521 | ||
1519 | ret = ath10k_setup_peer_smps(ar, arvif, bss_conf->bssid, &ht_cap); | 1522 | ret = ath10k_setup_peer_smps(ar, arvif, bss_conf->bssid, &ht_cap); |
1520 | if (ret) { | 1523 | if (ret) { |
1521 | ath10k_warn("failed to setup peer SMPS for vdev %i: %d\n", | 1524 | ath10k_warn(ar, "failed to setup peer SMPS for vdev %i: %d\n", |
1522 | arvif->vdev_id, ret); | 1525 | arvif->vdev_id, ret); |
1523 | return; | 1526 | return; |
1524 | } | 1527 | } |
1525 | 1528 | ||
1526 | ath10k_dbg(ATH10K_DBG_MAC, | 1529 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
1527 | "mac vdev %d up (associated) bssid %pM aid %d\n", | 1530 | "mac vdev %d up (associated) bssid %pM aid %d\n", |
1528 | arvif->vdev_id, bss_conf->bssid, bss_conf->aid); | 1531 | arvif->vdev_id, bss_conf->bssid, bss_conf->aid); |
1529 | 1532 | ||
@@ -1532,7 +1535,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, | |||
1532 | 1535 | ||
1533 | ret = ath10k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid); | 1536 | ret = ath10k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid); |
1534 | if (ret) { | 1537 | if (ret) { |
1535 | ath10k_warn("failed to set vdev %d up: %d\n", | 1538 | ath10k_warn(ar, "failed to set vdev %d up: %d\n", |
1536 | arvif->vdev_id, ret); | 1539 | arvif->vdev_id, ret); |
1537 | return; | 1540 | return; |
1538 | } | 1541 | } |
@@ -1558,7 +1561,7 @@ static void ath10k_bss_disassoc(struct ieee80211_hw *hw, | |||
1558 | * No idea why this happens, even though VDEV-DOWN is supposed | 1561 | * No idea why this happens, even though VDEV-DOWN is supposed |
1559 | * to be analogous to link down, so just stop the VDEV. | 1562 | * to be analogous to link down, so just stop the VDEV. |
1560 | */ | 1563 | */ |
1561 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d stop (disassociated\n", | 1564 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d stop (disassociated\n", |
1562 | arvif->vdev_id); | 1565 | arvif->vdev_id); |
1563 | 1566 | ||
1564 | /* FIXME: check return value */ | 1567 | /* FIXME: check return value */ |
@@ -1571,7 +1574,7 @@ static void ath10k_bss_disassoc(struct ieee80211_hw *hw, | |||
1571 | * interfaces as it expects there is no rx when no interface is | 1574 | * interfaces as it expects there is no rx when no interface is |
1572 | * running. | 1575 | * running. |
1573 | */ | 1576 | */ |
1574 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d down\n", arvif->vdev_id); | 1577 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d down\n", arvif->vdev_id); |
1575 | 1578 | ||
1576 | /* FIXME: why don't we print error if wmi call fails? */ | 1579 | /* FIXME: why don't we print error if wmi call fails? */ |
1577 | ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); | 1580 | ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); |
@@ -1592,7 +1595,7 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1592 | 1595 | ||
1593 | ret = ath10k_peer_assoc_prepare(ar, arvif, sta, NULL, &peer_arg); | 1596 | ret = ath10k_peer_assoc_prepare(ar, arvif, sta, NULL, &peer_arg); |
1594 | if (ret) { | 1597 | if (ret) { |
1595 | ath10k_warn("failed to prepare WMI peer assoc for %pM vdev %i: %i\n", | 1598 | ath10k_warn(ar, "failed to prepare WMI peer assoc for %pM vdev %i: %i\n", |
1596 | sta->addr, arvif->vdev_id, ret); | 1599 | sta->addr, arvif->vdev_id, ret); |
1597 | return ret; | 1600 | return ret; |
1598 | } | 1601 | } |
@@ -1600,14 +1603,14 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1600 | peer_arg.peer_reassoc = reassoc; | 1603 | peer_arg.peer_reassoc = reassoc; |
1601 | ret = ath10k_wmi_peer_assoc(ar, &peer_arg); | 1604 | ret = ath10k_wmi_peer_assoc(ar, &peer_arg); |
1602 | if (ret) { | 1605 | if (ret) { |
1603 | ath10k_warn("failed to run peer assoc for STA %pM vdev %i: %d\n", | 1606 | ath10k_warn(ar, "failed to run peer assoc for STA %pM vdev %i: %d\n", |
1604 | sta->addr, arvif->vdev_id, ret); | 1607 | sta->addr, arvif->vdev_id, ret); |
1605 | return ret; | 1608 | return ret; |
1606 | } | 1609 | } |
1607 | 1610 | ||
1608 | ret = ath10k_setup_peer_smps(ar, arvif, sta->addr, &sta->ht_cap); | 1611 | ret = ath10k_setup_peer_smps(ar, arvif, sta->addr, &sta->ht_cap); |
1609 | if (ret) { | 1612 | if (ret) { |
1610 | ath10k_warn("failed to setup peer SMPS for vdev %d: %d\n", | 1613 | ath10k_warn(ar, "failed to setup peer SMPS for vdev %d: %d\n", |
1611 | arvif->vdev_id, ret); | 1614 | arvif->vdev_id, ret); |
1612 | return ret; | 1615 | return ret; |
1613 | } | 1616 | } |
@@ -1616,7 +1619,7 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1616 | arvif->num_legacy_stations++; | 1619 | arvif->num_legacy_stations++; |
1617 | ret = ath10k_recalc_rtscts_prot(arvif); | 1620 | ret = ath10k_recalc_rtscts_prot(arvif); |
1618 | if (ret) { | 1621 | if (ret) { |
1619 | ath10k_warn("failed to recalculate rts/cts prot for vdev %d: %d\n", | 1622 | ath10k_warn(ar, "failed to recalculate rts/cts prot for vdev %d: %d\n", |
1620 | arvif->vdev_id, ret); | 1623 | arvif->vdev_id, ret); |
1621 | return ret; | 1624 | return ret; |
1622 | } | 1625 | } |
@@ -1624,14 +1627,14 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1624 | 1627 | ||
1625 | ret = ath10k_install_peer_wep_keys(arvif, sta->addr); | 1628 | ret = ath10k_install_peer_wep_keys(arvif, sta->addr); |
1626 | if (ret) { | 1629 | if (ret) { |
1627 | ath10k_warn("failed to install peer wep keys for vdev %i: %d\n", | 1630 | ath10k_warn(ar, "failed to install peer wep keys for vdev %i: %d\n", |
1628 | arvif->vdev_id, ret); | 1631 | arvif->vdev_id, ret); |
1629 | return ret; | 1632 | return ret; |
1630 | } | 1633 | } |
1631 | 1634 | ||
1632 | ret = ath10k_peer_assoc_qos_ap(ar, arvif, sta); | 1635 | ret = ath10k_peer_assoc_qos_ap(ar, arvif, sta); |
1633 | if (ret) { | 1636 | if (ret) { |
1634 | ath10k_warn("failed to set qos params for STA %pM for vdev %i: %d\n", | 1637 | ath10k_warn(ar, "failed to set qos params for STA %pM for vdev %i: %d\n", |
1635 | sta->addr, arvif->vdev_id, ret); | 1638 | sta->addr, arvif->vdev_id, ret); |
1636 | return ret; | 1639 | return ret; |
1637 | } | 1640 | } |
@@ -1650,7 +1653,7 @@ static int ath10k_station_disassoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1650 | arvif->num_legacy_stations--; | 1653 | arvif->num_legacy_stations--; |
1651 | ret = ath10k_recalc_rtscts_prot(arvif); | 1654 | ret = ath10k_recalc_rtscts_prot(arvif); |
1652 | if (ret) { | 1655 | if (ret) { |
1653 | ath10k_warn("failed to recalculate rts/cts prot for vdev %d: %d\n", | 1656 | ath10k_warn(ar, "failed to recalculate rts/cts prot for vdev %d: %d\n", |
1654 | arvif->vdev_id, ret); | 1657 | arvif->vdev_id, ret); |
1655 | return ret; | 1658 | return ret; |
1656 | } | 1659 | } |
@@ -1658,7 +1661,7 @@ static int ath10k_station_disassoc(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1658 | 1661 | ||
1659 | ret = ath10k_clear_peer_keys(arvif, sta->addr); | 1662 | ret = ath10k_clear_peer_keys(arvif, sta->addr); |
1660 | if (ret) { | 1663 | if (ret) { |
1661 | ath10k_warn("failed to clear all peer wep keys for vdev %i: %d\n", | 1664 | ath10k_warn(ar, "failed to clear all peer wep keys for vdev %i: %d\n", |
1662 | arvif->vdev_id, ret); | 1665 | arvif->vdev_id, ret); |
1663 | return ret; | 1666 | return ret; |
1664 | } | 1667 | } |
@@ -1750,7 +1753,7 @@ static int ath10k_update_channel_list(struct ath10k *ar) | |||
1750 | if (WARN_ON_ONCE(ch->mode == MODE_UNKNOWN)) | 1753 | if (WARN_ON_ONCE(ch->mode == MODE_UNKNOWN)) |
1751 | continue; | 1754 | continue; |
1752 | 1755 | ||
1753 | ath10k_dbg(ATH10K_DBG_WMI, | 1756 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
1754 | "mac channel [%zd/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n", | 1757 | "mac channel [%zd/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n", |
1755 | ch - arg.channels, arg.n_channels, | 1758 | ch - arg.channels, arg.n_channels, |
1756 | ch->freq, ch->max_power, ch->max_reg_power, | 1759 | ch->freq, ch->max_power, ch->max_reg_power, |
@@ -1793,7 +1796,7 @@ static void ath10k_regd_update(struct ath10k *ar) | |||
1793 | 1796 | ||
1794 | ret = ath10k_update_channel_list(ar); | 1797 | ret = ath10k_update_channel_list(ar); |
1795 | if (ret) | 1798 | if (ret) |
1796 | ath10k_warn("failed to update channel list: %d\n", ret); | 1799 | ath10k_warn(ar, "failed to update channel list: %d\n", ret); |
1797 | 1800 | ||
1798 | regpair = ar->ath_common.regulatory.regpair; | 1801 | regpair = ar->ath_common.regulatory.regpair; |
1799 | 1802 | ||
@@ -1814,7 +1817,7 @@ static void ath10k_regd_update(struct ath10k *ar) | |||
1814 | regpair->reg_5ghz_ctl, | 1817 | regpair->reg_5ghz_ctl, |
1815 | wmi_dfs_reg); | 1818 | wmi_dfs_reg); |
1816 | if (ret) | 1819 | if (ret) |
1817 | ath10k_warn("failed to set pdev regdomain: %d\n", ret); | 1820 | ath10k_warn(ar, "failed to set pdev regdomain: %d\n", ret); |
1818 | } | 1821 | } |
1819 | 1822 | ||
1820 | static void ath10k_reg_notifier(struct wiphy *wiphy, | 1823 | static void ath10k_reg_notifier(struct wiphy *wiphy, |
@@ -1827,12 +1830,12 @@ static void ath10k_reg_notifier(struct wiphy *wiphy, | |||
1827 | ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory); | 1830 | ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory); |
1828 | 1831 | ||
1829 | if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { | 1832 | if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { |
1830 | ath10k_dbg(ATH10K_DBG_REGULATORY, "dfs region 0x%x\n", | 1833 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs region 0x%x\n", |
1831 | request->dfs_region); | 1834 | request->dfs_region); |
1832 | result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector, | 1835 | result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector, |
1833 | request->dfs_region); | 1836 | request->dfs_region); |
1834 | if (!result) | 1837 | if (!result) |
1835 | ath10k_warn("DFS region 0x%X not supported, will trigger radar for every pulse\n", | 1838 | ath10k_warn(ar, "DFS region 0x%X not supported, will trigger radar for every pulse\n", |
1836 | request->dfs_region); | 1839 | request->dfs_region); |
1837 | } | 1840 | } |
1838 | 1841 | ||
@@ -1869,7 +1872,7 @@ static u8 ath10k_tx_h_get_vdev_id(struct ath10k *ar, | |||
1869 | if (ar->monitor_started) | 1872 | if (ar->monitor_started) |
1870 | return ar->monitor_vdev_id; | 1873 | return ar->monitor_vdev_id; |
1871 | 1874 | ||
1872 | ath10k_warn("failed to resolve vdev id\n"); | 1875 | ath10k_warn(ar, "failed to resolve vdev id\n"); |
1873 | return 0; | 1876 | return 0; |
1874 | } | 1877 | } |
1875 | 1878 | ||
@@ -1905,6 +1908,7 @@ static void ath10k_tx_wep_key_work(struct work_struct *work) | |||
1905 | { | 1908 | { |
1906 | struct ath10k_vif *arvif = container_of(work, struct ath10k_vif, | 1909 | struct ath10k_vif *arvif = container_of(work, struct ath10k_vif, |
1907 | wep_key_work); | 1910 | wep_key_work); |
1911 | struct ath10k *ar = arvif->ar; | ||
1908 | int ret, keyidx = arvif->def_wep_key_newidx; | 1912 | int ret, keyidx = arvif->def_wep_key_newidx; |
1909 | 1913 | ||
1910 | mutex_lock(&arvif->ar->conf_mutex); | 1914 | mutex_lock(&arvif->ar->conf_mutex); |
@@ -1915,7 +1919,7 @@ static void ath10k_tx_wep_key_work(struct work_struct *work) | |||
1915 | if (arvif->def_wep_key_idx == keyidx) | 1919 | if (arvif->def_wep_key_idx == keyidx) |
1916 | goto unlock; | 1920 | goto unlock; |
1917 | 1921 | ||
1918 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d set keyidx %d\n", | 1922 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d set keyidx %d\n", |
1919 | arvif->vdev_id, keyidx); | 1923 | arvif->vdev_id, keyidx); |
1920 | 1924 | ||
1921 | ret = ath10k_wmi_vdev_set_param(arvif->ar, | 1925 | ret = ath10k_wmi_vdev_set_param(arvif->ar, |
@@ -1923,7 +1927,7 @@ static void ath10k_tx_wep_key_work(struct work_struct *work) | |||
1923 | arvif->ar->wmi.vdev_param->def_keyid, | 1927 | arvif->ar->wmi.vdev_param->def_keyid, |
1924 | keyidx); | 1928 | keyidx); |
1925 | if (ret) { | 1929 | if (ret) { |
1926 | ath10k_warn("failed to update wep key index for vdev %d: %d\n", | 1930 | ath10k_warn(ar, "failed to update wep key index for vdev %d: %d\n", |
1927 | arvif->vdev_id, | 1931 | arvif->vdev_id, |
1928 | ret); | 1932 | ret); |
1929 | goto unlock; | 1933 | goto unlock; |
@@ -2003,7 +2007,7 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb) | |||
2003 | ar->fw_features)) { | 2007 | ar->fw_features)) { |
2004 | if (skb_queue_len(&ar->wmi_mgmt_tx_queue) >= | 2008 | if (skb_queue_len(&ar->wmi_mgmt_tx_queue) >= |
2005 | ATH10K_MAX_NUM_MGMT_PENDING) { | 2009 | ATH10K_MAX_NUM_MGMT_PENDING) { |
2006 | ath10k_warn("reached WMI management transmit queue limit\n"); | 2010 | ath10k_warn(ar, "reached WMI management transmit queue limit\n"); |
2007 | ret = -EBUSY; | 2011 | ret = -EBUSY; |
2008 | goto exit; | 2012 | goto exit; |
2009 | } | 2013 | } |
@@ -2027,7 +2031,8 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb) | |||
2027 | 2031 | ||
2028 | exit: | 2032 | exit: |
2029 | if (ret) { | 2033 | if (ret) { |
2030 | ath10k_warn("failed to transmit packet, dropping: %d\n", ret); | 2034 | ath10k_warn(ar, "failed to transmit packet, dropping: %d\n", |
2035 | ret); | ||
2031 | ieee80211_free_txskb(ar->hw, skb); | 2036 | ieee80211_free_txskb(ar->hw, skb); |
2032 | } | 2037 | } |
2033 | } | 2038 | } |
@@ -2069,7 +2074,7 @@ void ath10k_offchan_tx_work(struct work_struct *work) | |||
2069 | 2074 | ||
2070 | mutex_lock(&ar->conf_mutex); | 2075 | mutex_lock(&ar->conf_mutex); |
2071 | 2076 | ||
2072 | ath10k_dbg(ATH10K_DBG_MAC, "mac offchannel skb %p\n", | 2077 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %p\n", |
2073 | skb); | 2078 | skb); |
2074 | 2079 | ||
2075 | hdr = (struct ieee80211_hdr *)skb->data; | 2080 | hdr = (struct ieee80211_hdr *)skb->data; |
@@ -2082,13 +2087,13 @@ void ath10k_offchan_tx_work(struct work_struct *work) | |||
2082 | 2087 | ||
2083 | if (peer) | 2088 | if (peer) |
2084 | /* FIXME: should this use ath10k_warn()? */ | 2089 | /* FIXME: should this use ath10k_warn()? */ |
2085 | ath10k_dbg(ATH10K_DBG_MAC, "peer %pM on vdev %d already present\n", | 2090 | ath10k_dbg(ar, ATH10K_DBG_MAC, "peer %pM on vdev %d already present\n", |
2086 | peer_addr, vdev_id); | 2091 | peer_addr, vdev_id); |
2087 | 2092 | ||
2088 | if (!peer) { | 2093 | if (!peer) { |
2089 | ret = ath10k_peer_create(ar, vdev_id, peer_addr); | 2094 | ret = ath10k_peer_create(ar, vdev_id, peer_addr); |
2090 | if (ret) | 2095 | if (ret) |
2091 | ath10k_warn("failed to create peer %pM on vdev %d: %d\n", | 2096 | ath10k_warn(ar, "failed to create peer %pM on vdev %d: %d\n", |
2092 | peer_addr, vdev_id, ret); | 2097 | peer_addr, vdev_id, ret); |
2093 | } | 2098 | } |
2094 | 2099 | ||
@@ -2102,13 +2107,13 @@ void ath10k_offchan_tx_work(struct work_struct *work) | |||
2102 | ret = wait_for_completion_timeout(&ar->offchan_tx_completed, | 2107 | ret = wait_for_completion_timeout(&ar->offchan_tx_completed, |
2103 | 3 * HZ); | 2108 | 3 * HZ); |
2104 | if (ret <= 0) | 2109 | if (ret <= 0) |
2105 | ath10k_warn("timed out waiting for offchannel skb %p\n", | 2110 | ath10k_warn(ar, "timed out waiting for offchannel skb %p\n", |
2106 | skb); | 2111 | skb); |
2107 | 2112 | ||
2108 | if (!peer) { | 2113 | if (!peer) { |
2109 | ret = ath10k_peer_delete(ar, vdev_id, peer_addr); | 2114 | ret = ath10k_peer_delete(ar, vdev_id, peer_addr); |
2110 | if (ret) | 2115 | if (ret) |
2111 | ath10k_warn("failed to delete peer %pM on vdev %d: %d\n", | 2116 | ath10k_warn(ar, "failed to delete peer %pM on vdev %d: %d\n", |
2112 | peer_addr, vdev_id, ret); | 2117 | peer_addr, vdev_id, ret); |
2113 | } | 2118 | } |
2114 | 2119 | ||
@@ -2142,7 +2147,7 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work) | |||
2142 | 2147 | ||
2143 | ret = ath10k_wmi_mgmt_tx(ar, skb); | 2148 | ret = ath10k_wmi_mgmt_tx(ar, skb); |
2144 | if (ret) { | 2149 | if (ret) { |
2145 | ath10k_warn("failed to transmit management frame via WMI: %d\n", | 2150 | ath10k_warn(ar, "failed to transmit management frame via WMI: %d\n", |
2146 | ret); | 2151 | ret); |
2147 | ieee80211_free_txskb(ar->hw, skb); | 2152 | ieee80211_free_txskb(ar->hw, skb); |
2148 | } | 2153 | } |
@@ -2199,13 +2204,13 @@ static int ath10k_scan_stop(struct ath10k *ar) | |||
2199 | 2204 | ||
2200 | ret = ath10k_wmi_stop_scan(ar, &arg); | 2205 | ret = ath10k_wmi_stop_scan(ar, &arg); |
2201 | if (ret) { | 2206 | if (ret) { |
2202 | ath10k_warn("failed to stop wmi scan: %d\n", ret); | 2207 | ath10k_warn(ar, "failed to stop wmi scan: %d\n", ret); |
2203 | goto out; | 2208 | goto out; |
2204 | } | 2209 | } |
2205 | 2210 | ||
2206 | ret = wait_for_completion_timeout(&ar->scan.completed, 3*HZ); | 2211 | ret = wait_for_completion_timeout(&ar->scan.completed, 3*HZ); |
2207 | if (ret == 0) { | 2212 | if (ret == 0) { |
2208 | ath10k_warn("failed to receive scan abortion completion: timed out\n"); | 2213 | ath10k_warn(ar, "failed to receive scan abortion completion: timed out\n"); |
2209 | ret = -ETIMEDOUT; | 2214 | ret = -ETIMEDOUT; |
2210 | } else if (ret > 0) { | 2215 | } else if (ret > 0) { |
2211 | ret = 0; | 2216 | ret = 0; |
@@ -2243,7 +2248,7 @@ static void ath10k_scan_abort(struct ath10k *ar) | |||
2243 | break; | 2248 | break; |
2244 | case ATH10K_SCAN_STARTING: | 2249 | case ATH10K_SCAN_STARTING: |
2245 | case ATH10K_SCAN_ABORTING: | 2250 | case ATH10K_SCAN_ABORTING: |
2246 | ath10k_warn("refusing scan abortion due to invalid scan state: %s (%d)\n", | 2251 | ath10k_warn(ar, "refusing scan abortion due to invalid scan state: %s (%d)\n", |
2247 | ath10k_scan_state_str(ar->scan.state), | 2252 | ath10k_scan_state_str(ar->scan.state), |
2248 | ar->scan.state); | 2253 | ar->scan.state); |
2249 | break; | 2254 | break; |
@@ -2253,7 +2258,7 @@ static void ath10k_scan_abort(struct ath10k *ar) | |||
2253 | 2258 | ||
2254 | ret = ath10k_scan_stop(ar); | 2259 | ret = ath10k_scan_stop(ar); |
2255 | if (ret) | 2260 | if (ret) |
2256 | ath10k_warn("failed to abort scan: %d\n", ret); | 2261 | ath10k_warn(ar, "failed to abort scan: %d\n", ret); |
2257 | 2262 | ||
2258 | spin_lock_bh(&ar->data_lock); | 2263 | spin_lock_bh(&ar->data_lock); |
2259 | break; | 2264 | break; |
@@ -2287,7 +2292,7 @@ static int ath10k_start_scan(struct ath10k *ar, | |||
2287 | if (ret == 0) { | 2292 | if (ret == 0) { |
2288 | ret = ath10k_scan_stop(ar); | 2293 | ret = ath10k_scan_stop(ar); |
2289 | if (ret) | 2294 | if (ret) |
2290 | ath10k_warn("failed to stop scan: %d\n", ret); | 2295 | ath10k_warn(ar, "failed to stop scan: %d\n", ret); |
2291 | 2296 | ||
2292 | return -ETIMEDOUT; | 2297 | return -ETIMEDOUT; |
2293 | } | 2298 | } |
@@ -2314,7 +2319,7 @@ static void ath10k_tx(struct ieee80211_hw *hw, | |||
2314 | 2319 | ||
2315 | /* We should disable CCK RATE due to P2P */ | 2320 | /* We should disable CCK RATE due to P2P */ |
2316 | if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE) | 2321 | if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE) |
2317 | ath10k_dbg(ATH10K_DBG_MAC, "IEEE80211_TX_CTL_NO_CCK_RATE\n"); | 2322 | ath10k_dbg(ar, ATH10K_DBG_MAC, "IEEE80211_TX_CTL_NO_CCK_RATE\n"); |
2318 | 2323 | ||
2319 | ATH10K_SKB_CB(skb)->htt.is_offchan = false; | 2324 | ATH10K_SKB_CB(skb)->htt.is_offchan = false; |
2320 | ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr); | 2325 | ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr); |
@@ -2334,7 +2339,8 @@ static void ath10k_tx(struct ieee80211_hw *hw, | |||
2334 | ATH10K_SKB_CB(skb)->vdev_id = ar->scan.vdev_id; | 2339 | ATH10K_SKB_CB(skb)->vdev_id = ar->scan.vdev_id; |
2335 | spin_unlock_bh(&ar->data_lock); | 2340 | spin_unlock_bh(&ar->data_lock); |
2336 | 2341 | ||
2337 | ath10k_dbg(ATH10K_DBG_MAC, "queued offchannel skb %p\n", skb); | 2342 | ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb %p\n", |
2343 | skb); | ||
2338 | 2344 | ||
2339 | skb_queue_tail(&ar->offchan_tx_queue, skb); | 2345 | skb_queue_tail(&ar->offchan_tx_queue, skb); |
2340 | ieee80211_queue_work(hw, &ar->offchan_tx_work); | 2346 | ieee80211_queue_work(hw, &ar->offchan_tx_work); |
@@ -2424,7 +2430,7 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant) | |||
2424 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->tx_chain_mask, | 2430 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->tx_chain_mask, |
2425 | tx_ant); | 2431 | tx_ant); |
2426 | if (ret) { | 2432 | if (ret) { |
2427 | ath10k_warn("failed to set tx-chainmask: %d, req 0x%x\n", | 2433 | ath10k_warn(ar, "failed to set tx-chainmask: %d, req 0x%x\n", |
2428 | ret, tx_ant); | 2434 | ret, tx_ant); |
2429 | return ret; | 2435 | return ret; |
2430 | } | 2436 | } |
@@ -2432,7 +2438,7 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant) | |||
2432 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->rx_chain_mask, | 2438 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->rx_chain_mask, |
2433 | rx_ant); | 2439 | rx_ant); |
2434 | if (ret) { | 2440 | if (ret) { |
2435 | ath10k_warn("failed to set rx-chainmask: %d, req 0x%x\n", | 2441 | ath10k_warn(ar, "failed to set rx-chainmask: %d, req 0x%x\n", |
2436 | ret, rx_ant); | 2442 | ret, rx_ant); |
2437 | return ret; | 2443 | return ret; |
2438 | } | 2444 | } |
@@ -2483,25 +2489,25 @@ static int ath10k_start(struct ieee80211_hw *hw) | |||
2483 | 2489 | ||
2484 | ret = ath10k_hif_power_up(ar); | 2490 | ret = ath10k_hif_power_up(ar); |
2485 | if (ret) { | 2491 | if (ret) { |
2486 | ath10k_err("Could not init hif: %d\n", ret); | 2492 | ath10k_err(ar, "Could not init hif: %d\n", ret); |
2487 | goto err_off; | 2493 | goto err_off; |
2488 | } | 2494 | } |
2489 | 2495 | ||
2490 | ret = ath10k_core_start(ar); | 2496 | ret = ath10k_core_start(ar); |
2491 | if (ret) { | 2497 | if (ret) { |
2492 | ath10k_err("Could not init core: %d\n", ret); | 2498 | ath10k_err(ar, "Could not init core: %d\n", ret); |
2493 | goto err_power_down; | 2499 | goto err_power_down; |
2494 | } | 2500 | } |
2495 | 2501 | ||
2496 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pmf_qos, 1); | 2502 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pmf_qos, 1); |
2497 | if (ret) { | 2503 | if (ret) { |
2498 | ath10k_warn("failed to enable PMF QOS: %d\n", ret); | 2504 | ath10k_warn(ar, "failed to enable PMF QOS: %d\n", ret); |
2499 | goto err_core_stop; | 2505 | goto err_core_stop; |
2500 | } | 2506 | } |
2501 | 2507 | ||
2502 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->dynamic_bw, 1); | 2508 | ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->dynamic_bw, 1); |
2503 | if (ret) { | 2509 | if (ret) { |
2504 | ath10k_warn("failed to enable dynamic BW: %d\n", ret); | 2510 | ath10k_warn(ar, "failed to enable dynamic BW: %d\n", ret); |
2505 | goto err_core_stop; | 2511 | goto err_core_stop; |
2506 | } | 2512 | } |
2507 | 2513 | ||
@@ -2521,7 +2527,7 @@ static int ath10k_start(struct ieee80211_hw *hw) | |||
2521 | ret = ath10k_wmi_pdev_set_param(ar, | 2527 | ret = ath10k_wmi_pdev_set_param(ar, |
2522 | ar->wmi.pdev_param->arp_ac_override, 0); | 2528 | ar->wmi.pdev_param->arp_ac_override, 0); |
2523 | if (ret) { | 2529 | if (ret) { |
2524 | ath10k_warn("failed to set arp ac override parameter: %d\n", | 2530 | ath10k_warn(ar, "failed to set arp ac override parameter: %d\n", |
2525 | ret); | 2531 | ret); |
2526 | goto err_core_stop; | 2532 | goto err_core_stop; |
2527 | } | 2533 | } |
@@ -2575,7 +2581,7 @@ static int ath10k_config_ps(struct ath10k *ar) | |||
2575 | list_for_each_entry(arvif, &ar->arvifs, list) { | 2581 | list_for_each_entry(arvif, &ar->arvifs, list) { |
2576 | ret = ath10k_mac_vif_setup_ps(arvif); | 2582 | ret = ath10k_mac_vif_setup_ps(arvif); |
2577 | if (ret) { | 2583 | if (ret) { |
2578 | ath10k_warn("failed to setup powersave: %d\n", ret); | 2584 | ath10k_warn(ar, "failed to setup powersave: %d\n", ret); |
2579 | break; | 2585 | break; |
2580 | } | 2586 | } |
2581 | } | 2587 | } |
@@ -2613,7 +2619,7 @@ static void ath10k_config_chan(struct ath10k *ar) | |||
2613 | 2619 | ||
2614 | lockdep_assert_held(&ar->conf_mutex); | 2620 | lockdep_assert_held(&ar->conf_mutex); |
2615 | 2621 | ||
2616 | ath10k_dbg(ATH10K_DBG_MAC, | 2622 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
2617 | "mac config channel to %dMHz (cf1 %dMHz cf2 %dMHz width %s)\n", | 2623 | "mac config channel to %dMHz (cf1 %dMHz cf2 %dMHz width %s)\n", |
2618 | ar->chandef.chan->center_freq, | 2624 | ar->chandef.chan->center_freq, |
2619 | ar->chandef.center_freq1, | 2625 | ar->chandef.center_freq1, |
@@ -2637,7 +2643,7 @@ static void ath10k_config_chan(struct ath10k *ar) | |||
2637 | 2643 | ||
2638 | ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); | 2644 | ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); |
2639 | if (ret) { | 2645 | if (ret) { |
2640 | ath10k_warn("failed to down vdev %d: %d\n", | 2646 | ath10k_warn(ar, "failed to down vdev %d: %d\n", |
2641 | arvif->vdev_id, ret); | 2647 | arvif->vdev_id, ret); |
2642 | continue; | 2648 | continue; |
2643 | } | 2649 | } |
@@ -2654,7 +2660,7 @@ static void ath10k_config_chan(struct ath10k *ar) | |||
2654 | 2660 | ||
2655 | ret = ath10k_vdev_restart(arvif); | 2661 | ret = ath10k_vdev_restart(arvif); |
2656 | if (ret) { | 2662 | if (ret) { |
2657 | ath10k_warn("failed to restart vdev %d: %d\n", | 2663 | ath10k_warn(ar, "failed to restart vdev %d: %d\n", |
2658 | arvif->vdev_id, ret); | 2664 | arvif->vdev_id, ret); |
2659 | continue; | 2665 | continue; |
2660 | } | 2666 | } |
@@ -2665,7 +2671,7 @@ static void ath10k_config_chan(struct ath10k *ar) | |||
2665 | ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, | 2671 | ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, |
2666 | arvif->bssid); | 2672 | arvif->bssid); |
2667 | if (ret) { | 2673 | if (ret) { |
2668 | ath10k_warn("failed to bring vdev up %d: %d\n", | 2674 | ath10k_warn(ar, "failed to bring vdev up %d: %d\n", |
2669 | arvif->vdev_id, ret); | 2675 | arvif->vdev_id, ret); |
2670 | continue; | 2676 | continue; |
2671 | } | 2677 | } |
@@ -2685,7 +2691,7 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed) | |||
2685 | mutex_lock(&ar->conf_mutex); | 2691 | mutex_lock(&ar->conf_mutex); |
2686 | 2692 | ||
2687 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | 2693 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { |
2688 | ath10k_dbg(ATH10K_DBG_MAC, | 2694 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
2689 | "mac config channel %dMHz flags 0x%x radar %d\n", | 2695 | "mac config channel %dMHz flags 0x%x radar %d\n", |
2690 | conf->chandef.chan->center_freq, | 2696 | conf->chandef.chan->center_freq, |
2691 | conf->chandef.chan->flags, | 2697 | conf->chandef.chan->flags, |
@@ -2705,21 +2711,21 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed) | |||
2705 | } | 2711 | } |
2706 | 2712 | ||
2707 | if (changed & IEEE80211_CONF_CHANGE_POWER) { | 2713 | if (changed & IEEE80211_CONF_CHANGE_POWER) { |
2708 | ath10k_dbg(ATH10K_DBG_MAC, "mac config power %d\n", | 2714 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac config power %d\n", |
2709 | hw->conf.power_level); | 2715 | hw->conf.power_level); |
2710 | 2716 | ||
2711 | param = ar->wmi.pdev_param->txpower_limit2g; | 2717 | param = ar->wmi.pdev_param->txpower_limit2g; |
2712 | ret = ath10k_wmi_pdev_set_param(ar, param, | 2718 | ret = ath10k_wmi_pdev_set_param(ar, param, |
2713 | hw->conf.power_level * 2); | 2719 | hw->conf.power_level * 2); |
2714 | if (ret) | 2720 | if (ret) |
2715 | ath10k_warn("failed to set 2g txpower %d: %d\n", | 2721 | ath10k_warn(ar, "failed to set 2g txpower %d: %d\n", |
2716 | hw->conf.power_level, ret); | 2722 | hw->conf.power_level, ret); |
2717 | 2723 | ||
2718 | param = ar->wmi.pdev_param->txpower_limit5g; | 2724 | param = ar->wmi.pdev_param->txpower_limit5g; |
2719 | ret = ath10k_wmi_pdev_set_param(ar, param, | 2725 | ret = ath10k_wmi_pdev_set_param(ar, param, |
2720 | hw->conf.power_level * 2); | 2726 | hw->conf.power_level * 2); |
2721 | if (ret) | 2727 | if (ret) |
2722 | ath10k_warn("failed to set 5g txpower %d: %d\n", | 2728 | ath10k_warn(ar, "failed to set 5g txpower %d: %d\n", |
2723 | hw->conf.power_level, ret); | 2729 | hw->conf.power_level, ret); |
2724 | } | 2730 | } |
2725 | 2731 | ||
@@ -2731,7 +2737,7 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed) | |||
2731 | ar->monitor = true; | 2737 | ar->monitor = true; |
2732 | ret = ath10k_monitor_start(ar); | 2738 | ret = ath10k_monitor_start(ar); |
2733 | if (ret) { | 2739 | if (ret) { |
2734 | ath10k_warn("failed to start monitor (config): %d\n", | 2740 | ath10k_warn(ar, "failed to start monitor (config): %d\n", |
2735 | ret); | 2741 | ret); |
2736 | ar->monitor = false; | 2742 | ar->monitor = false; |
2737 | } | 2743 | } |
@@ -2775,7 +2781,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2775 | INIT_LIST_HEAD(&arvif->list); | 2781 | INIT_LIST_HEAD(&arvif->list); |
2776 | 2782 | ||
2777 | if (ar->free_vdev_map == 0) { | 2783 | if (ar->free_vdev_map == 0) { |
2778 | ath10k_warn("Free vdev map is empty, no more interfaces allowed.\n"); | 2784 | ath10k_warn(ar, "Free vdev map is empty, no more interfaces allowed.\n"); |
2779 | ret = -EBUSY; | 2785 | ret = -EBUSY; |
2780 | goto err; | 2786 | goto err; |
2781 | } | 2787 | } |
@@ -2811,13 +2817,13 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2811 | break; | 2817 | break; |
2812 | } | 2818 | } |
2813 | 2819 | ||
2814 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev create %d (add interface) type %d subtype %d\n", | 2820 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev create %d (add interface) type %d subtype %d\n", |
2815 | arvif->vdev_id, arvif->vdev_type, arvif->vdev_subtype); | 2821 | arvif->vdev_id, arvif->vdev_type, arvif->vdev_subtype); |
2816 | 2822 | ||
2817 | ret = ath10k_wmi_vdev_create(ar, arvif->vdev_id, arvif->vdev_type, | 2823 | ret = ath10k_wmi_vdev_create(ar, arvif->vdev_id, arvif->vdev_type, |
2818 | arvif->vdev_subtype, vif->addr); | 2824 | arvif->vdev_subtype, vif->addr); |
2819 | if (ret) { | 2825 | if (ret) { |
2820 | ath10k_warn("failed to create WMI vdev %i: %d\n", | 2826 | ath10k_warn(ar, "failed to create WMI vdev %i: %d\n", |
2821 | arvif->vdev_id, ret); | 2827 | arvif->vdev_id, ret); |
2822 | goto err; | 2828 | goto err; |
2823 | } | 2829 | } |
@@ -2829,7 +2835,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2829 | ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param, | 2835 | ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param, |
2830 | arvif->def_wep_key_idx); | 2836 | arvif->def_wep_key_idx); |
2831 | if (ret) { | 2837 | if (ret) { |
2832 | ath10k_warn("failed to set vdev %i default key id: %d\n", | 2838 | ath10k_warn(ar, "failed to set vdev %i default key id: %d\n", |
2833 | arvif->vdev_id, ret); | 2839 | arvif->vdev_id, ret); |
2834 | goto err_vdev_delete; | 2840 | goto err_vdev_delete; |
2835 | } | 2841 | } |
@@ -2839,7 +2845,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2839 | ATH10K_HW_TXRX_NATIVE_WIFI); | 2845 | ATH10K_HW_TXRX_NATIVE_WIFI); |
2840 | /* 10.X firmware does not support this VDEV parameter. Do not warn */ | 2846 | /* 10.X firmware does not support this VDEV parameter. Do not warn */ |
2841 | if (ret && ret != -EOPNOTSUPP) { | 2847 | if (ret && ret != -EOPNOTSUPP) { |
2842 | ath10k_warn("failed to set vdev %i TX encapsulation: %d\n", | 2848 | ath10k_warn(ar, "failed to set vdev %i TX encapsulation: %d\n", |
2843 | arvif->vdev_id, ret); | 2849 | arvif->vdev_id, ret); |
2844 | goto err_vdev_delete; | 2850 | goto err_vdev_delete; |
2845 | } | 2851 | } |
@@ -2847,14 +2853,14 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2847 | if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { | 2853 | if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { |
2848 | ret = ath10k_peer_create(ar, arvif->vdev_id, vif->addr); | 2854 | ret = ath10k_peer_create(ar, arvif->vdev_id, vif->addr); |
2849 | if (ret) { | 2855 | if (ret) { |
2850 | ath10k_warn("failed to create vdev %i peer for AP: %d\n", | 2856 | ath10k_warn(ar, "failed to create vdev %i peer for AP: %d\n", |
2851 | arvif->vdev_id, ret); | 2857 | arvif->vdev_id, ret); |
2852 | goto err_vdev_delete; | 2858 | goto err_vdev_delete; |
2853 | } | 2859 | } |
2854 | 2860 | ||
2855 | ret = ath10k_mac_set_kickout(arvif); | 2861 | ret = ath10k_mac_set_kickout(arvif); |
2856 | if (ret) { | 2862 | if (ret) { |
2857 | ath10k_warn("failed to set vdev %i kickout parameters: %d\n", | 2863 | ath10k_warn(ar, "failed to set vdev %i kickout parameters: %d\n", |
2858 | arvif->vdev_id, ret); | 2864 | arvif->vdev_id, ret); |
2859 | goto err_peer_delete; | 2865 | goto err_peer_delete; |
2860 | } | 2866 | } |
@@ -2866,7 +2872,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2866 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, | 2872 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, |
2867 | param, value); | 2873 | param, value); |
2868 | if (ret) { | 2874 | if (ret) { |
2869 | ath10k_warn("failed to set vdev %i RX wake policy: %d\n", | 2875 | ath10k_warn(ar, "failed to set vdev %i RX wake policy: %d\n", |
2870 | arvif->vdev_id, ret); | 2876 | arvif->vdev_id, ret); |
2871 | goto err_peer_delete; | 2877 | goto err_peer_delete; |
2872 | } | 2878 | } |
@@ -2876,7 +2882,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2876 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, | 2882 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, |
2877 | param, value); | 2883 | param, value); |
2878 | if (ret) { | 2884 | if (ret) { |
2879 | ath10k_warn("failed to set vdev %i TX wake thresh: %d\n", | 2885 | ath10k_warn(ar, "failed to set vdev %i TX wake thresh: %d\n", |
2880 | arvif->vdev_id, ret); | 2886 | arvif->vdev_id, ret); |
2881 | goto err_peer_delete; | 2887 | goto err_peer_delete; |
2882 | } | 2888 | } |
@@ -2886,7 +2892,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2886 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, | 2892 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, |
2887 | param, value); | 2893 | param, value); |
2888 | if (ret) { | 2894 | if (ret) { |
2889 | ath10k_warn("failed to set vdev %i PSPOLL count: %d\n", | 2895 | ath10k_warn(ar, "failed to set vdev %i PSPOLL count: %d\n", |
2890 | arvif->vdev_id, ret); | 2896 | arvif->vdev_id, ret); |
2891 | goto err_peer_delete; | 2897 | goto err_peer_delete; |
2892 | } | 2898 | } |
@@ -2894,14 +2900,14 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
2894 | 2900 | ||
2895 | ret = ath10k_mac_set_rts(arvif, ar->hw->wiphy->rts_threshold); | 2901 | ret = ath10k_mac_set_rts(arvif, ar->hw->wiphy->rts_threshold); |
2896 | if (ret) { | 2902 | if (ret) { |
2897 | ath10k_warn("failed to set rts threshold for vdev %d: %d\n", | 2903 | ath10k_warn(ar, "failed to set rts threshold for vdev %d: %d\n", |
2898 | arvif->vdev_id, ret); | 2904 | arvif->vdev_id, ret); |
2899 | goto err_peer_delete; | 2905 | goto err_peer_delete; |
2900 | } | 2906 | } |
2901 | 2907 | ||
2902 | ret = ath10k_mac_set_frag(arvif, ar->hw->wiphy->frag_threshold); | 2908 | ret = ath10k_mac_set_frag(arvif, ar->hw->wiphy->frag_threshold); |
2903 | if (ret) { | 2909 | if (ret) { |
2904 | ath10k_warn("failed to set frag threshold for vdev %d: %d\n", | 2910 | ath10k_warn(ar, "failed to set frag threshold for vdev %d: %d\n", |
2905 | arvif->vdev_id, ret); | 2911 | arvif->vdev_id, ret); |
2906 | goto err_peer_delete; | 2912 | goto err_peer_delete; |
2907 | } | 2913 | } |
@@ -2948,7 +2954,7 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, | |||
2948 | 2954 | ||
2949 | ret = ath10k_spectral_vif_stop(arvif); | 2955 | ret = ath10k_spectral_vif_stop(arvif); |
2950 | if (ret) | 2956 | if (ret) |
2951 | ath10k_warn("failed to stop spectral for vdev %i: %d\n", | 2957 | ath10k_warn(ar, "failed to stop spectral for vdev %i: %d\n", |
2952 | arvif->vdev_id, ret); | 2958 | arvif->vdev_id, ret); |
2953 | 2959 | ||
2954 | ar->free_vdev_map |= 1 << arvif->vdev_id; | 2960 | ar->free_vdev_map |= 1 << arvif->vdev_id; |
@@ -2957,18 +2963,18 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, | |||
2957 | if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { | 2963 | if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { |
2958 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, vif->addr); | 2964 | ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, vif->addr); |
2959 | if (ret) | 2965 | if (ret) |
2960 | ath10k_warn("failed to remove peer for AP vdev %i: %d\n", | 2966 | ath10k_warn(ar, "failed to remove peer for AP vdev %i: %d\n", |
2961 | arvif->vdev_id, ret); | 2967 | arvif->vdev_id, ret); |
2962 | 2968 | ||
2963 | kfree(arvif->u.ap.noa_data); | 2969 | kfree(arvif->u.ap.noa_data); |
2964 | } | 2970 | } |
2965 | 2971 | ||
2966 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %i delete (remove interface)\n", | 2972 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %i delete (remove interface)\n", |
2967 | arvif->vdev_id); | 2973 | arvif->vdev_id); |
2968 | 2974 | ||
2969 | ret = ath10k_wmi_vdev_delete(ar, arvif->vdev_id); | 2975 | ret = ath10k_wmi_vdev_delete(ar, arvif->vdev_id); |
2970 | if (ret) | 2976 | if (ret) |
2971 | ath10k_warn("failed to delete WMI vdev %i: %d\n", | 2977 | ath10k_warn(ar, "failed to delete WMI vdev %i: %d\n", |
2972 | arvif->vdev_id, ret); | 2978 | arvif->vdev_id, ret); |
2973 | 2979 | ||
2974 | ath10k_peer_cleanup(ar, arvif->vdev_id); | 2980 | ath10k_peer_cleanup(ar, arvif->vdev_id); |
@@ -3007,7 +3013,7 @@ static void ath10k_configure_filter(struct ieee80211_hw *hw, | |||
3007 | ar->promisc = true; | 3013 | ar->promisc = true; |
3008 | ret = ath10k_monitor_start(ar); | 3014 | ret = ath10k_monitor_start(ar); |
3009 | if (ret) { | 3015 | if (ret) { |
3010 | ath10k_warn("failed to start monitor (promisc): %d\n", | 3016 | ath10k_warn(ar, "failed to start monitor (promisc): %d\n", |
3011 | ret); | 3017 | ret); |
3012 | ar->promisc = false; | 3018 | ar->promisc = false; |
3013 | } | 3019 | } |
@@ -3039,17 +3045,17 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3039 | vdev_param = ar->wmi.vdev_param->beacon_interval; | 3045 | vdev_param = ar->wmi.vdev_param->beacon_interval; |
3040 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, | 3046 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, |
3041 | arvif->beacon_interval); | 3047 | arvif->beacon_interval); |
3042 | ath10k_dbg(ATH10K_DBG_MAC, | 3048 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3043 | "mac vdev %d beacon_interval %d\n", | 3049 | "mac vdev %d beacon_interval %d\n", |
3044 | arvif->vdev_id, arvif->beacon_interval); | 3050 | arvif->vdev_id, arvif->beacon_interval); |
3045 | 3051 | ||
3046 | if (ret) | 3052 | if (ret) |
3047 | ath10k_warn("failed to set beacon interval for vdev %d: %i\n", | 3053 | ath10k_warn(ar, "failed to set beacon interval for vdev %d: %i\n", |
3048 | arvif->vdev_id, ret); | 3054 | arvif->vdev_id, ret); |
3049 | } | 3055 | } |
3050 | 3056 | ||
3051 | if (changed & BSS_CHANGED_BEACON) { | 3057 | if (changed & BSS_CHANGED_BEACON) { |
3052 | ath10k_dbg(ATH10K_DBG_MAC, | 3058 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3053 | "vdev %d set beacon tx mode to staggered\n", | 3059 | "vdev %d set beacon tx mode to staggered\n", |
3054 | arvif->vdev_id); | 3060 | arvif->vdev_id); |
3055 | 3061 | ||
@@ -3057,14 +3063,14 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3057 | ret = ath10k_wmi_pdev_set_param(ar, pdev_param, | 3063 | ret = ath10k_wmi_pdev_set_param(ar, pdev_param, |
3058 | WMI_BEACON_STAGGERED_MODE); | 3064 | WMI_BEACON_STAGGERED_MODE); |
3059 | if (ret) | 3065 | if (ret) |
3060 | ath10k_warn("failed to set beacon mode for vdev %d: %i\n", | 3066 | ath10k_warn(ar, "failed to set beacon mode for vdev %d: %i\n", |
3061 | arvif->vdev_id, ret); | 3067 | arvif->vdev_id, ret); |
3062 | } | 3068 | } |
3063 | 3069 | ||
3064 | if (changed & BSS_CHANGED_BEACON_INFO) { | 3070 | if (changed & BSS_CHANGED_BEACON_INFO) { |
3065 | arvif->dtim_period = info->dtim_period; | 3071 | arvif->dtim_period = info->dtim_period; |
3066 | 3072 | ||
3067 | ath10k_dbg(ATH10K_DBG_MAC, | 3073 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3068 | "mac vdev %d dtim_period %d\n", | 3074 | "mac vdev %d dtim_period %d\n", |
3069 | arvif->vdev_id, arvif->dtim_period); | 3075 | arvif->vdev_id, arvif->dtim_period); |
3070 | 3076 | ||
@@ -3072,7 +3078,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3072 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, | 3078 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, |
3073 | arvif->dtim_period); | 3079 | arvif->dtim_period); |
3074 | if (ret) | 3080 | if (ret) |
3075 | ath10k_warn("failed to set dtim period for vdev %d: %i\n", | 3081 | ath10k_warn(ar, "failed to set dtim period for vdev %d: %i\n", |
3076 | arvif->vdev_id, ret); | 3082 | arvif->vdev_id, ret); |
3077 | } | 3083 | } |
3078 | 3084 | ||
@@ -3091,14 +3097,14 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3091 | if (changed & BSS_CHANGED_BSSID && | 3097 | if (changed & BSS_CHANGED_BSSID && |
3092 | vif->type != NL80211_IFTYPE_AP) { | 3098 | vif->type != NL80211_IFTYPE_AP) { |
3093 | if (!is_zero_ether_addr(info->bssid)) { | 3099 | if (!is_zero_ether_addr(info->bssid)) { |
3094 | ath10k_dbg(ATH10K_DBG_MAC, | 3100 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3095 | "mac vdev %d create peer %pM\n", | 3101 | "mac vdev %d create peer %pM\n", |
3096 | arvif->vdev_id, info->bssid); | 3102 | arvif->vdev_id, info->bssid); |
3097 | 3103 | ||
3098 | ret = ath10k_peer_create(ar, arvif->vdev_id, | 3104 | ret = ath10k_peer_create(ar, arvif->vdev_id, |
3099 | info->bssid); | 3105 | info->bssid); |
3100 | if (ret) | 3106 | if (ret) |
3101 | ath10k_warn("failed to add peer %pM for vdev %d when changing bssid: %i\n", | 3107 | ath10k_warn(ar, "failed to add peer %pM for vdev %d when changing bssid: %i\n", |
3102 | info->bssid, arvif->vdev_id, ret); | 3108 | info->bssid, arvif->vdev_id, ret); |
3103 | 3109 | ||
3104 | if (vif->type == NL80211_IFTYPE_STATION) { | 3110 | if (vif->type == NL80211_IFTYPE_STATION) { |
@@ -3108,13 +3114,13 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3108 | */ | 3114 | */ |
3109 | memcpy(arvif->bssid, info->bssid, ETH_ALEN); | 3115 | memcpy(arvif->bssid, info->bssid, ETH_ALEN); |
3110 | 3116 | ||
3111 | ath10k_dbg(ATH10K_DBG_MAC, | 3117 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3112 | "mac vdev %d start %pM\n", | 3118 | "mac vdev %d start %pM\n", |
3113 | arvif->vdev_id, info->bssid); | 3119 | arvif->vdev_id, info->bssid); |
3114 | 3120 | ||
3115 | ret = ath10k_vdev_start(arvif); | 3121 | ret = ath10k_vdev_start(arvif); |
3116 | if (ret) { | 3122 | if (ret) { |
3117 | ath10k_warn("failed to start vdev %i: %d\n", | 3123 | ath10k_warn(ar, "failed to start vdev %i: %d\n", |
3118 | arvif->vdev_id, ret); | 3124 | arvif->vdev_id, ret); |
3119 | goto exit; | 3125 | goto exit; |
3120 | } | 3126 | } |
@@ -3138,12 +3144,12 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3138 | 3144 | ||
3139 | if (changed & BSS_CHANGED_ERP_CTS_PROT) { | 3145 | if (changed & BSS_CHANGED_ERP_CTS_PROT) { |
3140 | arvif->use_cts_prot = info->use_cts_prot; | 3146 | arvif->use_cts_prot = info->use_cts_prot; |
3141 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d cts_prot %d\n", | 3147 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d cts_prot %d\n", |
3142 | arvif->vdev_id, info->use_cts_prot); | 3148 | arvif->vdev_id, info->use_cts_prot); |
3143 | 3149 | ||
3144 | ret = ath10k_recalc_rtscts_prot(arvif); | 3150 | ret = ath10k_recalc_rtscts_prot(arvif); |
3145 | if (ret) | 3151 | if (ret) |
3146 | ath10k_warn("failed to recalculate rts/cts prot for vdev %d: %d\n", | 3152 | ath10k_warn(ar, "failed to recalculate rts/cts prot for vdev %d: %d\n", |
3147 | arvif->vdev_id, ret); | 3153 | arvif->vdev_id, ret); |
3148 | } | 3154 | } |
3149 | 3155 | ||
@@ -3155,14 +3161,14 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3155 | else | 3161 | else |
3156 | slottime = WMI_VDEV_SLOT_TIME_LONG; /* 20us */ | 3162 | slottime = WMI_VDEV_SLOT_TIME_LONG; /* 20us */ |
3157 | 3163 | ||
3158 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d slot_time %d\n", | 3164 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d slot_time %d\n", |
3159 | arvif->vdev_id, slottime); | 3165 | arvif->vdev_id, slottime); |
3160 | 3166 | ||
3161 | vdev_param = ar->wmi.vdev_param->slot_time; | 3167 | vdev_param = ar->wmi.vdev_param->slot_time; |
3162 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, | 3168 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, |
3163 | slottime); | 3169 | slottime); |
3164 | if (ret) | 3170 | if (ret) |
3165 | ath10k_warn("failed to set erp slot for vdev %d: %i\n", | 3171 | ath10k_warn(ar, "failed to set erp slot for vdev %d: %i\n", |
3166 | arvif->vdev_id, ret); | 3172 | arvif->vdev_id, ret); |
3167 | } | 3173 | } |
3168 | 3174 | ||
@@ -3173,7 +3179,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3173 | else | 3179 | else |
3174 | preamble = WMI_VDEV_PREAMBLE_LONG; | 3180 | preamble = WMI_VDEV_PREAMBLE_LONG; |
3175 | 3181 | ||
3176 | ath10k_dbg(ATH10K_DBG_MAC, | 3182 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3177 | "mac vdev %d preamble %dn", | 3183 | "mac vdev %d preamble %dn", |
3178 | arvif->vdev_id, preamble); | 3184 | arvif->vdev_id, preamble); |
3179 | 3185 | ||
@@ -3181,7 +3187,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
3181 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, | 3187 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, |
3182 | preamble); | 3188 | preamble); |
3183 | if (ret) | 3189 | if (ret) |
3184 | ath10k_warn("failed to set preamble for vdev %d: %i\n", | 3190 | ath10k_warn(ar, "failed to set preamble for vdev %d: %i\n", |
3185 | arvif->vdev_id, ret); | 3191 | arvif->vdev_id, ret); |
3186 | } | 3192 | } |
3187 | 3193 | ||
@@ -3259,7 +3265,7 @@ static int ath10k_hw_scan(struct ieee80211_hw *hw, | |||
3259 | 3265 | ||
3260 | ret = ath10k_start_scan(ar, &arg); | 3266 | ret = ath10k_start_scan(ar, &arg); |
3261 | if (ret) { | 3267 | if (ret) { |
3262 | ath10k_warn("failed to start hw scan: %d\n", ret); | 3268 | ath10k_warn(ar, "failed to start hw scan: %d\n", ret); |
3263 | spin_lock_bh(&ar->data_lock); | 3269 | spin_lock_bh(&ar->data_lock); |
3264 | ar->scan.state = ATH10K_SCAN_IDLE; | 3270 | ar->scan.state = ATH10K_SCAN_IDLE; |
3265 | spin_unlock_bh(&ar->data_lock); | 3271 | spin_unlock_bh(&ar->data_lock); |
@@ -3315,7 +3321,7 @@ static void ath10k_set_key_h_def_keyidx(struct ath10k *ar, | |||
3315 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, | 3321 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, |
3316 | key->keyidx); | 3322 | key->keyidx); |
3317 | if (ret) | 3323 | if (ret) |
3318 | ath10k_warn("failed to set vdev %i group key as default key: %d\n", | 3324 | ath10k_warn(ar, "failed to set vdev %i group key as default key: %d\n", |
3319 | arvif->vdev_id, ret); | 3325 | arvif->vdev_id, ret); |
3320 | } | 3326 | } |
3321 | 3327 | ||
@@ -3353,7 +3359,7 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3353 | 3359 | ||
3354 | if (!peer) { | 3360 | if (!peer) { |
3355 | if (cmd == SET_KEY) { | 3361 | if (cmd == SET_KEY) { |
3356 | ath10k_warn("failed to install key for non-existent peer %pM\n", | 3362 | ath10k_warn(ar, "failed to install key for non-existent peer %pM\n", |
3357 | peer_addr); | 3363 | peer_addr); |
3358 | ret = -EOPNOTSUPP; | 3364 | ret = -EOPNOTSUPP; |
3359 | goto exit; | 3365 | goto exit; |
@@ -3376,7 +3382,7 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3376 | 3382 | ||
3377 | ret = ath10k_install_key(arvif, key, cmd, peer_addr); | 3383 | ret = ath10k_install_key(arvif, key, cmd, peer_addr); |
3378 | if (ret) { | 3384 | if (ret) { |
3379 | ath10k_warn("failed to install key for vdev %i peer %pM: %d\n", | 3385 | ath10k_warn(ar, "failed to install key for vdev %i peer %pM: %d\n", |
3380 | arvif->vdev_id, peer_addr, ret); | 3386 | arvif->vdev_id, peer_addr, ret); |
3381 | goto exit; | 3387 | goto exit; |
3382 | } | 3388 | } |
@@ -3391,7 +3397,7 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3391 | peer->keys[key->keyidx] = NULL; | 3397 | peer->keys[key->keyidx] = NULL; |
3392 | else if (peer == NULL) | 3398 | else if (peer == NULL) |
3393 | /* impossible unless FW goes crazy */ | 3399 | /* impossible unless FW goes crazy */ |
3394 | ath10k_warn("Peer %pM disappeared!\n", peer_addr); | 3400 | ath10k_warn(ar, "Peer %pM disappeared!\n", peer_addr); |
3395 | spin_unlock_bh(&ar->data_lock); | 3401 | spin_unlock_bh(&ar->data_lock); |
3396 | 3402 | ||
3397 | exit: | 3403 | exit: |
@@ -3427,45 +3433,45 @@ static void ath10k_sta_rc_update_wk(struct work_struct *wk) | |||
3427 | mutex_lock(&ar->conf_mutex); | 3433 | mutex_lock(&ar->conf_mutex); |
3428 | 3434 | ||
3429 | if (changed & IEEE80211_RC_BW_CHANGED) { | 3435 | if (changed & IEEE80211_RC_BW_CHANGED) { |
3430 | ath10k_dbg(ATH10K_DBG_MAC, "mac update sta %pM peer bw %d\n", | 3436 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac update sta %pM peer bw %d\n", |
3431 | sta->addr, bw); | 3437 | sta->addr, bw); |
3432 | 3438 | ||
3433 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, | 3439 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, |
3434 | WMI_PEER_CHAN_WIDTH, bw); | 3440 | WMI_PEER_CHAN_WIDTH, bw); |
3435 | if (err) | 3441 | if (err) |
3436 | ath10k_warn("failed to update STA %pM peer bw %d: %d\n", | 3442 | ath10k_warn(ar, "failed to update STA %pM peer bw %d: %d\n", |
3437 | sta->addr, bw, err); | 3443 | sta->addr, bw, err); |
3438 | } | 3444 | } |
3439 | 3445 | ||
3440 | if (changed & IEEE80211_RC_NSS_CHANGED) { | 3446 | if (changed & IEEE80211_RC_NSS_CHANGED) { |
3441 | ath10k_dbg(ATH10K_DBG_MAC, "mac update sta %pM nss %d\n", | 3447 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac update sta %pM nss %d\n", |
3442 | sta->addr, nss); | 3448 | sta->addr, nss); |
3443 | 3449 | ||
3444 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, | 3450 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, |
3445 | WMI_PEER_NSS, nss); | 3451 | WMI_PEER_NSS, nss); |
3446 | if (err) | 3452 | if (err) |
3447 | ath10k_warn("failed to update STA %pM nss %d: %d\n", | 3453 | ath10k_warn(ar, "failed to update STA %pM nss %d: %d\n", |
3448 | sta->addr, nss, err); | 3454 | sta->addr, nss, err); |
3449 | } | 3455 | } |
3450 | 3456 | ||
3451 | if (changed & IEEE80211_RC_SMPS_CHANGED) { | 3457 | if (changed & IEEE80211_RC_SMPS_CHANGED) { |
3452 | ath10k_dbg(ATH10K_DBG_MAC, "mac update sta %pM smps %d\n", | 3458 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac update sta %pM smps %d\n", |
3453 | sta->addr, smps); | 3459 | sta->addr, smps); |
3454 | 3460 | ||
3455 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, | 3461 | err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, |
3456 | WMI_PEER_SMPS_STATE, smps); | 3462 | WMI_PEER_SMPS_STATE, smps); |
3457 | if (err) | 3463 | if (err) |
3458 | ath10k_warn("failed to update STA %pM smps %d: %d\n", | 3464 | ath10k_warn(ar, "failed to update STA %pM smps %d: %d\n", |
3459 | sta->addr, smps, err); | 3465 | sta->addr, smps, err); |
3460 | } | 3466 | } |
3461 | 3467 | ||
3462 | if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { | 3468 | if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { |
3463 | ath10k_dbg(ATH10K_DBG_MAC, "mac update sta %pM supp rates\n", | 3469 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac update sta %pM supp rates\n", |
3464 | sta->addr); | 3470 | sta->addr); |
3465 | 3471 | ||
3466 | err = ath10k_station_assoc(ar, arvif, sta, true); | 3472 | err = ath10k_station_assoc(ar, arvif, sta, true); |
3467 | if (err) | 3473 | if (err) |
3468 | ath10k_warn("failed to reassociate station: %pM\n", | 3474 | ath10k_warn(ar, "failed to reassociate station: %pM\n", |
3469 | sta->addr); | 3475 | sta->addr); |
3470 | } | 3476 | } |
3471 | 3477 | ||
@@ -3510,31 +3516,31 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, | |||
3510 | max_num_peers = TARGET_NUM_PEERS; | 3516 | max_num_peers = TARGET_NUM_PEERS; |
3511 | 3517 | ||
3512 | if (ar->num_peers >= max_num_peers) { | 3518 | if (ar->num_peers >= max_num_peers) { |
3513 | ath10k_warn("number of peers exceeded: peers number %d (max peers %d)\n", | 3519 | ath10k_warn(ar, "number of peers exceeded: peers number %d (max peers %d)\n", |
3514 | ar->num_peers, max_num_peers); | 3520 | ar->num_peers, max_num_peers); |
3515 | ret = -ENOBUFS; | 3521 | ret = -ENOBUFS; |
3516 | goto exit; | 3522 | goto exit; |
3517 | } | 3523 | } |
3518 | 3524 | ||
3519 | ath10k_dbg(ATH10K_DBG_MAC, | 3525 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3520 | "mac vdev %d peer create %pM (new sta) num_peers %d\n", | 3526 | "mac vdev %d peer create %pM (new sta) num_peers %d\n", |
3521 | arvif->vdev_id, sta->addr, ar->num_peers); | 3527 | arvif->vdev_id, sta->addr, ar->num_peers); |
3522 | 3528 | ||
3523 | ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr); | 3529 | ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr); |
3524 | if (ret) | 3530 | if (ret) |
3525 | ath10k_warn("failed to add peer %pM for vdev %d when adding a new sta: %i\n", | 3531 | ath10k_warn(ar, "failed to add peer %pM for vdev %d when adding a new sta: %i\n", |
3526 | sta->addr, arvif->vdev_id, ret); | 3532 | sta->addr, arvif->vdev_id, ret); |
3527 | } else if ((old_state == IEEE80211_STA_NONE && | 3533 | } else if ((old_state == IEEE80211_STA_NONE && |
3528 | new_state == IEEE80211_STA_NOTEXIST)) { | 3534 | new_state == IEEE80211_STA_NOTEXIST)) { |
3529 | /* | 3535 | /* |
3530 | * Existing station deletion. | 3536 | * Existing station deletion. |
3531 | */ | 3537 | */ |
3532 | ath10k_dbg(ATH10K_DBG_MAC, | 3538 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
3533 | "mac vdev %d peer delete %pM (sta gone)\n", | 3539 | "mac vdev %d peer delete %pM (sta gone)\n", |
3534 | arvif->vdev_id, sta->addr); | 3540 | arvif->vdev_id, sta->addr); |
3535 | ret = ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); | 3541 | ret = ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); |
3536 | if (ret) | 3542 | if (ret) |
3537 | ath10k_warn("failed to delete peer %pM for vdev %d: %i\n", | 3543 | ath10k_warn(ar, "failed to delete peer %pM for vdev %d: %i\n", |
3538 | sta->addr, arvif->vdev_id, ret); | 3544 | sta->addr, arvif->vdev_id, ret); |
3539 | 3545 | ||
3540 | if (vif->type == NL80211_IFTYPE_STATION) | 3546 | if (vif->type == NL80211_IFTYPE_STATION) |
@@ -3546,12 +3552,12 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, | |||
3546 | /* | 3552 | /* |
3547 | * New association. | 3553 | * New association. |
3548 | */ | 3554 | */ |
3549 | ath10k_dbg(ATH10K_DBG_MAC, "mac sta %pM associated\n", | 3555 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac sta %pM associated\n", |
3550 | sta->addr); | 3556 | sta->addr); |
3551 | 3557 | ||
3552 | ret = ath10k_station_assoc(ar, arvif, sta, false); | 3558 | ret = ath10k_station_assoc(ar, arvif, sta, false); |
3553 | if (ret) | 3559 | if (ret) |
3554 | ath10k_warn("failed to associate station %pM for vdev %i: %i\n", | 3560 | ath10k_warn(ar, "failed to associate station %pM for vdev %i: %i\n", |
3555 | sta->addr, arvif->vdev_id, ret); | 3561 | sta->addr, arvif->vdev_id, ret); |
3556 | } else if (old_state == IEEE80211_STA_ASSOC && | 3562 | } else if (old_state == IEEE80211_STA_ASSOC && |
3557 | new_state == IEEE80211_STA_AUTH && | 3563 | new_state == IEEE80211_STA_AUTH && |
@@ -3560,12 +3566,12 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, | |||
3560 | /* | 3566 | /* |
3561 | * Disassociation. | 3567 | * Disassociation. |
3562 | */ | 3568 | */ |
3563 | ath10k_dbg(ATH10K_DBG_MAC, "mac sta %pM disassociated\n", | 3569 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac sta %pM disassociated\n", |
3564 | sta->addr); | 3570 | sta->addr); |
3565 | 3571 | ||
3566 | ret = ath10k_station_disassoc(ar, arvif, sta); | 3572 | ret = ath10k_station_disassoc(ar, arvif, sta); |
3567 | if (ret) | 3573 | if (ret) |
3568 | ath10k_warn("failed to disassociate station: %pM vdev %i: %i\n", | 3574 | ath10k_warn(ar, "failed to disassociate station: %pM vdev %i: %i\n", |
3569 | sta->addr, arvif->vdev_id, ret); | 3575 | sta->addr, arvif->vdev_id, ret); |
3570 | } | 3576 | } |
3571 | exit: | 3577 | exit: |
@@ -3613,7 +3619,7 @@ static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif, | |||
3613 | WMI_STA_PS_PARAM_UAPSD, | 3619 | WMI_STA_PS_PARAM_UAPSD, |
3614 | arvif->u.sta.uapsd); | 3620 | arvif->u.sta.uapsd); |
3615 | if (ret) { | 3621 | if (ret) { |
3616 | ath10k_warn("failed to set uapsd params: %d\n", ret); | 3622 | ath10k_warn(ar, "failed to set uapsd params: %d\n", ret); |
3617 | goto exit; | 3623 | goto exit; |
3618 | } | 3624 | } |
3619 | 3625 | ||
@@ -3626,7 +3632,7 @@ static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif, | |||
3626 | WMI_STA_PS_PARAM_RX_WAKE_POLICY, | 3632 | WMI_STA_PS_PARAM_RX_WAKE_POLICY, |
3627 | value); | 3633 | value); |
3628 | if (ret) | 3634 | if (ret) |
3629 | ath10k_warn("failed to set rx wake param: %d\n", ret); | 3635 | ath10k_warn(ar, "failed to set rx wake param: %d\n", ret); |
3630 | 3636 | ||
3631 | exit: | 3637 | exit: |
3632 | return ret; | 3638 | return ret; |
@@ -3676,13 +3682,13 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, | |||
3676 | /* FIXME: FW accepts wmm params per hw, not per vif */ | 3682 | /* FIXME: FW accepts wmm params per hw, not per vif */ |
3677 | ret = ath10k_wmi_pdev_set_wmm_params(ar, &ar->wmm_params); | 3683 | ret = ath10k_wmi_pdev_set_wmm_params(ar, &ar->wmm_params); |
3678 | if (ret) { | 3684 | if (ret) { |
3679 | ath10k_warn("failed to set wmm params: %d\n", ret); | 3685 | ath10k_warn(ar, "failed to set wmm params: %d\n", ret); |
3680 | goto exit; | 3686 | goto exit; |
3681 | } | 3687 | } |
3682 | 3688 | ||
3683 | ret = ath10k_conf_tx_uapsd(ar, vif, ac, params->uapsd); | 3689 | ret = ath10k_conf_tx_uapsd(ar, vif, ac, params->uapsd); |
3684 | if (ret) | 3690 | if (ret) |
3685 | ath10k_warn("failed to set sta uapsd: %d\n", ret); | 3691 | ath10k_warn(ar, "failed to set sta uapsd: %d\n", ret); |
3686 | 3692 | ||
3687 | exit: | 3693 | exit: |
3688 | mutex_unlock(&ar->conf_mutex); | 3694 | mutex_unlock(&ar->conf_mutex); |
@@ -3741,7 +3747,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, | |||
3741 | 3747 | ||
3742 | ret = ath10k_start_scan(ar, &arg); | 3748 | ret = ath10k_start_scan(ar, &arg); |
3743 | if (ret) { | 3749 | if (ret) { |
3744 | ath10k_warn("failed to start roc scan: %d\n", ret); | 3750 | ath10k_warn(ar, "failed to start roc scan: %d\n", ret); |
3745 | spin_lock_bh(&ar->data_lock); | 3751 | spin_lock_bh(&ar->data_lock); |
3746 | ar->scan.state = ATH10K_SCAN_IDLE; | 3752 | ar->scan.state = ATH10K_SCAN_IDLE; |
3747 | spin_unlock_bh(&ar->data_lock); | 3753 | spin_unlock_bh(&ar->data_lock); |
@@ -3750,11 +3756,11 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, | |||
3750 | 3756 | ||
3751 | ret = wait_for_completion_timeout(&ar->scan.on_channel, 3*HZ); | 3757 | ret = wait_for_completion_timeout(&ar->scan.on_channel, 3*HZ); |
3752 | if (ret == 0) { | 3758 | if (ret == 0) { |
3753 | ath10k_warn("failed to switch to channel for roc scan\n"); | 3759 | ath10k_warn(ar, "failed to switch to channel for roc scan\n"); |
3754 | 3760 | ||
3755 | ret = ath10k_scan_stop(ar); | 3761 | ret = ath10k_scan_stop(ar); |
3756 | if (ret) | 3762 | if (ret) |
3757 | ath10k_warn("failed to stop scan: %d\n", ret); | 3763 | ath10k_warn(ar, "failed to stop scan: %d\n", ret); |
3758 | 3764 | ||
3759 | ret = -ETIMEDOUT; | 3765 | ret = -ETIMEDOUT; |
3760 | goto exit; | 3766 | goto exit; |
@@ -3791,12 +3797,12 @@ static int ath10k_set_rts_threshold(struct ieee80211_hw *hw, u32 value) | |||
3791 | 3797 | ||
3792 | mutex_lock(&ar->conf_mutex); | 3798 | mutex_lock(&ar->conf_mutex); |
3793 | list_for_each_entry(arvif, &ar->arvifs, list) { | 3799 | list_for_each_entry(arvif, &ar->arvifs, list) { |
3794 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d rts threshold %d\n", | 3800 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d rts threshold %d\n", |
3795 | arvif->vdev_id, value); | 3801 | arvif->vdev_id, value); |
3796 | 3802 | ||
3797 | ret = ath10k_mac_set_rts(arvif, value); | 3803 | ret = ath10k_mac_set_rts(arvif, value); |
3798 | if (ret) { | 3804 | if (ret) { |
3799 | ath10k_warn("failed to set rts threshold for vdev %d: %d\n", | 3805 | ath10k_warn(ar, "failed to set rts threshold for vdev %d: %d\n", |
3800 | arvif->vdev_id, ret); | 3806 | arvif->vdev_id, ret); |
3801 | break; | 3807 | break; |
3802 | } | 3808 | } |
@@ -3814,12 +3820,12 @@ static int ath10k_set_frag_threshold(struct ieee80211_hw *hw, u32 value) | |||
3814 | 3820 | ||
3815 | mutex_lock(&ar->conf_mutex); | 3821 | mutex_lock(&ar->conf_mutex); |
3816 | list_for_each_entry(arvif, &ar->arvifs, list) { | 3822 | list_for_each_entry(arvif, &ar->arvifs, list) { |
3817 | ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d fragmentation threshold %d\n", | 3823 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d fragmentation threshold %d\n", |
3818 | arvif->vdev_id, value); | 3824 | arvif->vdev_id, value); |
3819 | 3825 | ||
3820 | ret = ath10k_mac_set_rts(arvif, value); | 3826 | ret = ath10k_mac_set_rts(arvif, value); |
3821 | if (ret) { | 3827 | if (ret) { |
3822 | ath10k_warn("failed to set fragmentation threshold for vdev %d: %d\n", | 3828 | ath10k_warn(ar, "failed to set fragmentation threshold for vdev %d: %d\n", |
3823 | arvif->vdev_id, ret); | 3829 | arvif->vdev_id, ret); |
3824 | break; | 3830 | break; |
3825 | } | 3831 | } |
@@ -3859,7 +3865,7 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
3859 | }), ATH10K_FLUSH_TIMEOUT_HZ); | 3865 | }), ATH10K_FLUSH_TIMEOUT_HZ); |
3860 | 3866 | ||
3861 | if (ret <= 0 || skip) | 3867 | if (ret <= 0 || skip) |
3862 | ath10k_warn("failed to flush transmit queue (skip %i ar-state %i): %i\n", | 3868 | ath10k_warn(ar, "failed to flush transmit queue (skip %i ar-state %i): %i\n", |
3863 | skip, ar->state, ret); | 3869 | skip, ar->state, ret); |
3864 | 3870 | ||
3865 | skip: | 3871 | skip: |
@@ -3894,7 +3900,7 @@ static int ath10k_suspend(struct ieee80211_hw *hw, | |||
3894 | 3900 | ||
3895 | ret = ath10k_hif_suspend(ar); | 3901 | ret = ath10k_hif_suspend(ar); |
3896 | if (ret) { | 3902 | if (ret) { |
3897 | ath10k_warn("failed to suspend hif: %d\n", ret); | 3903 | ath10k_warn(ar, "failed to suspend hif: %d\n", ret); |
3898 | goto resume; | 3904 | goto resume; |
3899 | } | 3905 | } |
3900 | 3906 | ||
@@ -3903,7 +3909,7 @@ static int ath10k_suspend(struct ieee80211_hw *hw, | |||
3903 | resume: | 3909 | resume: |
3904 | ret = ath10k_wmi_pdev_resume_target(ar); | 3910 | ret = ath10k_wmi_pdev_resume_target(ar); |
3905 | if (ret) | 3911 | if (ret) |
3906 | ath10k_warn("failed to resume target: %d\n", ret); | 3912 | ath10k_warn(ar, "failed to resume target: %d\n", ret); |
3907 | 3913 | ||
3908 | ret = 1; | 3914 | ret = 1; |
3909 | exit: | 3915 | exit: |
@@ -3920,14 +3926,14 @@ static int ath10k_resume(struct ieee80211_hw *hw) | |||
3920 | 3926 | ||
3921 | ret = ath10k_hif_resume(ar); | 3927 | ret = ath10k_hif_resume(ar); |
3922 | if (ret) { | 3928 | if (ret) { |
3923 | ath10k_warn("failed to resume hif: %d\n", ret); | 3929 | ath10k_warn(ar, "failed to resume hif: %d\n", ret); |
3924 | ret = 1; | 3930 | ret = 1; |
3925 | goto exit; | 3931 | goto exit; |
3926 | } | 3932 | } |
3927 | 3933 | ||
3928 | ret = ath10k_wmi_pdev_resume_target(ar); | 3934 | ret = ath10k_wmi_pdev_resume_target(ar); |
3929 | if (ret) { | 3935 | if (ret) { |
3930 | ath10k_warn("failed to resume target: %d\n", ret); | 3936 | ath10k_warn(ar, "failed to resume target: %d\n", ret); |
3931 | ret = 1; | 3937 | ret = 1; |
3932 | goto exit; | 3938 | goto exit; |
3933 | } | 3939 | } |
@@ -3948,7 +3954,7 @@ static void ath10k_restart_complete(struct ieee80211_hw *hw) | |||
3948 | /* If device failed to restart it will be in a different state, e.g. | 3954 | /* If device failed to restart it will be in a different state, e.g. |
3949 | * ATH10K_STATE_WEDGED */ | 3955 | * ATH10K_STATE_WEDGED */ |
3950 | if (ar->state == ATH10K_STATE_RESTARTED) { | 3956 | if (ar->state == ATH10K_STATE_RESTARTED) { |
3951 | ath10k_info("device successfully recovered\n"); | 3957 | ath10k_info(ar, "device successfully recovered\n"); |
3952 | ar->state = ATH10K_STATE_ON; | 3958 | ar->state = ATH10K_STATE_ON; |
3953 | } | 3959 | } |
3954 | 3960 | ||
@@ -4145,7 +4151,8 @@ ath10k_bitrate_mask_correct(const struct cfg80211_bitrate_mask *mask, | |||
4145 | } | 4151 | } |
4146 | 4152 | ||
4147 | static bool | 4153 | static bool |
4148 | ath10k_bitrate_mask_rate(const struct cfg80211_bitrate_mask *mask, | 4154 | ath10k_bitrate_mask_rate(struct ath10k *ar, |
4155 | const struct cfg80211_bitrate_mask *mask, | ||
4149 | enum ieee80211_band band, | 4156 | enum ieee80211_band band, |
4150 | u8 *fixed_rate, | 4157 | u8 *fixed_rate, |
4151 | u8 *fixed_nss) | 4158 | u8 *fixed_nss) |
@@ -4203,7 +4210,7 @@ ath10k_bitrate_mask_rate(const struct cfg80211_bitrate_mask *mask, | |||
4203 | nss <<= 4; | 4210 | nss <<= 4; |
4204 | pream <<= 6; | 4211 | pream <<= 6; |
4205 | 4212 | ||
4206 | ath10k_dbg(ATH10K_DBG_MAC, "mac fixed rate pream 0x%02x nss 0x%02x rate 0x%02x\n", | 4213 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac fixed rate pream 0x%02x nss 0x%02x rate 0x%02x\n", |
4207 | pream, nss, rate); | 4214 | pream, nss, rate); |
4208 | 4215 | ||
4209 | *fixed_rate = pream | nss | rate; | 4216 | *fixed_rate = pream | nss | rate; |
@@ -4211,7 +4218,8 @@ ath10k_bitrate_mask_rate(const struct cfg80211_bitrate_mask *mask, | |||
4211 | return true; | 4218 | return true; |
4212 | } | 4219 | } |
4213 | 4220 | ||
4214 | static bool ath10k_get_fixed_rate_nss(const struct cfg80211_bitrate_mask *mask, | 4221 | static bool ath10k_get_fixed_rate_nss(struct ath10k *ar, |
4222 | const struct cfg80211_bitrate_mask *mask, | ||
4215 | enum ieee80211_band band, | 4223 | enum ieee80211_band band, |
4216 | u8 *fixed_rate, | 4224 | u8 *fixed_rate, |
4217 | u8 *fixed_nss) | 4225 | u8 *fixed_nss) |
@@ -4221,7 +4229,7 @@ static bool ath10k_get_fixed_rate_nss(const struct cfg80211_bitrate_mask *mask, | |||
4221 | return true; | 4229 | return true; |
4222 | 4230 | ||
4223 | /* Next Check single rate is set */ | 4231 | /* Next Check single rate is set */ |
4224 | return ath10k_bitrate_mask_rate(mask, band, fixed_rate, fixed_nss); | 4232 | return ath10k_bitrate_mask_rate(ar, mask, band, fixed_rate, fixed_nss); |
4225 | } | 4233 | } |
4226 | 4234 | ||
4227 | static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif, | 4235 | static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif, |
@@ -4241,16 +4249,16 @@ static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif, | |||
4241 | goto exit; | 4249 | goto exit; |
4242 | 4250 | ||
4243 | if (fixed_rate == WMI_FIXED_RATE_NONE) | 4251 | if (fixed_rate == WMI_FIXED_RATE_NONE) |
4244 | ath10k_dbg(ATH10K_DBG_MAC, "mac disable fixed bitrate mask\n"); | 4252 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac disable fixed bitrate mask\n"); |
4245 | 4253 | ||
4246 | if (force_sgi) | 4254 | if (force_sgi) |
4247 | ath10k_dbg(ATH10K_DBG_MAC, "mac force sgi\n"); | 4255 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac force sgi\n"); |
4248 | 4256 | ||
4249 | vdev_param = ar->wmi.vdev_param->fixed_rate; | 4257 | vdev_param = ar->wmi.vdev_param->fixed_rate; |
4250 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, | 4258 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, |
4251 | vdev_param, fixed_rate); | 4259 | vdev_param, fixed_rate); |
4252 | if (ret) { | 4260 | if (ret) { |
4253 | ath10k_warn("failed to set fixed rate param 0x%02x: %d\n", | 4261 | ath10k_warn(ar, "failed to set fixed rate param 0x%02x: %d\n", |
4254 | fixed_rate, ret); | 4262 | fixed_rate, ret); |
4255 | ret = -EINVAL; | 4263 | ret = -EINVAL; |
4256 | goto exit; | 4264 | goto exit; |
@@ -4263,7 +4271,7 @@ static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif, | |||
4263 | vdev_param, fixed_nss); | 4271 | vdev_param, fixed_nss); |
4264 | 4272 | ||
4265 | if (ret) { | 4273 | if (ret) { |
4266 | ath10k_warn("failed to set fixed nss param %d: %d\n", | 4274 | ath10k_warn(ar, "failed to set fixed nss param %d: %d\n", |
4267 | fixed_nss, ret); | 4275 | fixed_nss, ret); |
4268 | ret = -EINVAL; | 4276 | ret = -EINVAL; |
4269 | goto exit; | 4277 | goto exit; |
@@ -4276,7 +4284,7 @@ static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif, | |||
4276 | force_sgi); | 4284 | force_sgi); |
4277 | 4285 | ||
4278 | if (ret) { | 4286 | if (ret) { |
4279 | ath10k_warn("failed to set sgi param %d: %d\n", | 4287 | ath10k_warn(ar, "failed to set sgi param %d: %d\n", |
4280 | force_sgi, ret); | 4288 | force_sgi, ret); |
4281 | ret = -EINVAL; | 4289 | ret = -EINVAL; |
4282 | goto exit; | 4290 | goto exit; |
@@ -4305,14 +4313,14 @@ static int ath10k_set_bitrate_mask(struct ieee80211_hw *hw, | |||
4305 | return -EINVAL; | 4313 | return -EINVAL; |
4306 | 4314 | ||
4307 | if (!ath10k_default_bitrate_mask(ar, band, mask)) { | 4315 | if (!ath10k_default_bitrate_mask(ar, band, mask)) { |
4308 | if (!ath10k_get_fixed_rate_nss(mask, band, | 4316 | if (!ath10k_get_fixed_rate_nss(ar, mask, band, |
4309 | &fixed_rate, | 4317 | &fixed_rate, |
4310 | &fixed_nss)) | 4318 | &fixed_nss)) |
4311 | return -EINVAL; | 4319 | return -EINVAL; |
4312 | } | 4320 | } |
4313 | 4321 | ||
4314 | if (fixed_rate == WMI_FIXED_RATE_NONE && force_sgi) { | 4322 | if (fixed_rate == WMI_FIXED_RATE_NONE && force_sgi) { |
4315 | ath10k_warn("failed to force SGI usage for default rate settings\n"); | 4323 | ath10k_warn(ar, "failed to force SGI usage for default rate settings\n"); |
4316 | return -EINVAL; | 4324 | return -EINVAL; |
4317 | } | 4325 | } |
4318 | 4326 | ||
@@ -4331,7 +4339,7 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw, | |||
4331 | 4339 | ||
4332 | spin_lock_bh(&ar->data_lock); | 4340 | spin_lock_bh(&ar->data_lock); |
4333 | 4341 | ||
4334 | ath10k_dbg(ATH10K_DBG_MAC, | 4342 | ath10k_dbg(ar, ATH10K_DBG_MAC, |
4335 | "mac sta rc update for %pM changed %08x bw %d nss %d smps %d\n", | 4343 | "mac sta rc update for %pM changed %08x bw %d nss %d smps %d\n", |
4336 | sta->addr, changed, sta->bandwidth, sta->rx_nss, | 4344 | sta->addr, changed, sta->bandwidth, sta->rx_nss, |
4337 | sta->smps_mode); | 4345 | sta->smps_mode); |
@@ -4350,7 +4358,7 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw, | |||
4350 | bw = WMI_PEER_CHWIDTH_80MHZ; | 4358 | bw = WMI_PEER_CHWIDTH_80MHZ; |
4351 | break; | 4359 | break; |
4352 | case IEEE80211_STA_RX_BW_160: | 4360 | case IEEE80211_STA_RX_BW_160: |
4353 | ath10k_warn("Invalid bandwith %d in rc update for %pM\n", | 4361 | ath10k_warn(ar, "Invalid bandwith %d in rc update for %pM\n", |
4354 | sta->bandwidth, sta->addr); | 4362 | sta->bandwidth, sta->addr); |
4355 | bw = WMI_PEER_CHWIDTH_20MHZ; | 4363 | bw = WMI_PEER_CHWIDTH_20MHZ; |
4356 | break; | 4364 | break; |
@@ -4377,7 +4385,7 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw, | |||
4377 | smps = WMI_PEER_SMPS_DYNAMIC; | 4385 | smps = WMI_PEER_SMPS_DYNAMIC; |
4378 | break; | 4386 | break; |
4379 | case IEEE80211_SMPS_NUM_MODES: | 4387 | case IEEE80211_SMPS_NUM_MODES: |
4380 | ath10k_warn("Invalid smps %d in sta rc update for %pM\n", | 4388 | ath10k_warn(ar, "Invalid smps %d in sta rc update for %pM\n", |
4381 | sta->smps_mode, sta->addr); | 4389 | sta->smps_mode, sta->addr); |
4382 | smps = WMI_PEER_SMPS_PS_NONE; | 4390 | smps = WMI_PEER_SMPS_PS_NONE; |
4383 | break; | 4391 | break; |
@@ -4409,9 +4417,10 @@ static int ath10k_ampdu_action(struct ieee80211_hw *hw, | |||
4409 | struct ieee80211_sta *sta, u16 tid, u16 *ssn, | 4417 | struct ieee80211_sta *sta, u16 tid, u16 *ssn, |
4410 | u8 buf_size) | 4418 | u8 buf_size) |
4411 | { | 4419 | { |
4420 | struct ath10k *ar = hw->priv; | ||
4412 | struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); | 4421 | struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); |
4413 | 4422 | ||
4414 | ath10k_dbg(ATH10K_DBG_MAC, "mac ampdu vdev_id %i sta %pM tid %hu action %d\n", | 4423 | ath10k_dbg(ar, ATH10K_DBG_MAC, "mac ampdu vdev_id %i sta %pM tid %hu action %d\n", |
4415 | arvif->vdev_id, sta->addr, tid, action); | 4424 | arvif->vdev_id, sta->addr, tid, action); |
4416 | 4425 | ||
4417 | switch (action) { | 4426 | switch (action) { |
@@ -4739,7 +4748,7 @@ struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id) | |||
4739 | ath10k_get_arvif_iter, | 4748 | ath10k_get_arvif_iter, |
4740 | &arvif_iter); | 4749 | &arvif_iter); |
4741 | if (!arvif_iter.arvif) { | 4750 | if (!arvif_iter.arvif) { |
4742 | ath10k_warn("No VIF found for vdev %d\n", vdev_id); | 4751 | ath10k_warn(ar, "No VIF found for vdev %d\n", vdev_id); |
4743 | return NULL; | 4752 | return NULL; |
4744 | } | 4753 | } |
4745 | 4754 | ||
@@ -4885,19 +4894,19 @@ int ath10k_mac_register(struct ath10k *ar) | |||
4885 | NL80211_DFS_UNSET); | 4894 | NL80211_DFS_UNSET); |
4886 | 4895 | ||
4887 | if (!ar->dfs_detector) | 4896 | if (!ar->dfs_detector) |
4888 | ath10k_warn("failed to initialise DFS pattern detector\n"); | 4897 | ath10k_warn(ar, "failed to initialise DFS pattern detector\n"); |
4889 | } | 4898 | } |
4890 | 4899 | ||
4891 | ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy, | 4900 | ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy, |
4892 | ath10k_reg_notifier); | 4901 | ath10k_reg_notifier); |
4893 | if (ret) { | 4902 | if (ret) { |
4894 | ath10k_err("failed to initialise regulatory: %i\n", ret); | 4903 | ath10k_err(ar, "failed to initialise regulatory: %i\n", ret); |
4895 | goto err_free; | 4904 | goto err_free; |
4896 | } | 4905 | } |
4897 | 4906 | ||
4898 | ret = ieee80211_register_hw(ar->hw); | 4907 | ret = ieee80211_register_hw(ar->hw); |
4899 | if (ret) { | 4908 | if (ret) { |
4900 | ath10k_err("failed to register ieee80211: %d\n", ret); | 4909 | ath10k_err(ar, "failed to register ieee80211: %d\n", ret); |
4901 | goto err_free; | 4910 | goto err_free; |
4902 | } | 4911 | } |
4903 | 4912 | ||
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 3af462ab27f6..83ef6ef622fa 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c | |||
@@ -296,7 +296,7 @@ static int __ath10k_pci_rx_post_buf(struct ath10k_pci_pipe *pipe) | |||
296 | skb->len + skb_tailroom(skb), | 296 | skb->len + skb_tailroom(skb), |
297 | DMA_FROM_DEVICE); | 297 | DMA_FROM_DEVICE); |
298 | if (unlikely(dma_mapping_error(ar->dev, paddr))) { | 298 | if (unlikely(dma_mapping_error(ar->dev, paddr))) { |
299 | ath10k_warn("failed to dma map pci rx buf\n"); | 299 | ath10k_warn(ar, "failed to dma map pci rx buf\n"); |
300 | dev_kfree_skb_any(skb); | 300 | dev_kfree_skb_any(skb); |
301 | return -EIO; | 301 | return -EIO; |
302 | } | 302 | } |
@@ -305,7 +305,7 @@ static int __ath10k_pci_rx_post_buf(struct ath10k_pci_pipe *pipe) | |||
305 | 305 | ||
306 | ret = __ath10k_ce_rx_post_buf(ce_pipe, skb, paddr); | 306 | ret = __ath10k_ce_rx_post_buf(ce_pipe, skb, paddr); |
307 | if (ret) { | 307 | if (ret) { |
308 | ath10k_warn("failed to post pci rx buf: %d\n", ret); | 308 | ath10k_warn(ar, "failed to post pci rx buf: %d\n", ret); |
309 | dma_unmap_single(ar->dev, paddr, skb->len + skb_tailroom(skb), | 309 | dma_unmap_single(ar->dev, paddr, skb->len + skb_tailroom(skb), |
310 | DMA_FROM_DEVICE); | 310 | DMA_FROM_DEVICE); |
311 | dev_kfree_skb_any(skb); | 311 | dev_kfree_skb_any(skb); |
@@ -334,7 +334,7 @@ static void __ath10k_pci_rx_post_pipe(struct ath10k_pci_pipe *pipe) | |||
334 | while (num--) { | 334 | while (num--) { |
335 | ret = __ath10k_pci_rx_post_buf(pipe); | 335 | ret = __ath10k_pci_rx_post_buf(pipe); |
336 | if (ret) { | 336 | if (ret) { |
337 | ath10k_warn("failed to post pci rx buf: %d\n", ret); | 337 | ath10k_warn(ar, "failed to post pci rx buf: %d\n", ret); |
338 | mod_timer(&ar_pci->rx_post_retry, jiffies + | 338 | mod_timer(&ar_pci->rx_post_retry, jiffies + |
339 | ATH10K_PCI_RX_POST_RETRY_MS); | 339 | ATH10K_PCI_RX_POST_RETRY_MS); |
340 | break; | 340 | break; |
@@ -514,7 +514,7 @@ done: | |||
514 | __le32_to_cpu(((__le32 *)data_buf)[i]); | 514 | __le32_to_cpu(((__le32 *)data_buf)[i]); |
515 | } | 515 | } |
516 | } else | 516 | } else |
517 | ath10k_warn("failed to read diag value at 0x%x: %d\n", | 517 | ath10k_warn(ar, "failed to read diag value at 0x%x: %d\n", |
518 | address, ret); | 518 | address, ret); |
519 | 519 | ||
520 | if (data_buf) | 520 | if (data_buf) |
@@ -539,14 +539,14 @@ static int __ath10k_pci_diag_read_hi(struct ath10k *ar, void *dest, | |||
539 | 539 | ||
540 | ret = ath10k_pci_diag_read32(ar, host_addr, &addr); | 540 | ret = ath10k_pci_diag_read32(ar, host_addr, &addr); |
541 | if (ret != 0) { | 541 | if (ret != 0) { |
542 | ath10k_warn("failed to get memcpy hi address for firmware address %d: %d\n", | 542 | ath10k_warn(ar, "failed to get memcpy hi address for firmware address %d: %d\n", |
543 | src, ret); | 543 | src, ret); |
544 | return ret; | 544 | return ret; |
545 | } | 545 | } |
546 | 546 | ||
547 | ret = ath10k_pci_diag_read_mem(ar, addr, dest, len); | 547 | ret = ath10k_pci_diag_read_mem(ar, addr, dest, len); |
548 | if (ret != 0) { | 548 | if (ret != 0) { |
549 | ath10k_warn("failed to memcpy firmware memory from %d (%d B): %d\n", | 549 | ath10k_warn(ar, "failed to memcpy firmware memory from %d (%d B): %d\n", |
550 | addr, len, ret); | 550 | addr, len, ret); |
551 | return ret; | 551 | return ret; |
552 | } | 552 | } |
@@ -695,7 +695,7 @@ done: | |||
695 | } | 695 | } |
696 | 696 | ||
697 | if (ret != 0) | 697 | if (ret != 0) |
698 | ath10k_warn("failed to write diag value at 0x%x: %d\n", | 698 | ath10k_warn(ar, "failed to write diag value at 0x%x: %d\n", |
699 | address, ret); | 699 | address, ret); |
700 | 700 | ||
701 | return ret; | 701 | return ret; |
@@ -798,7 +798,7 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state) | |||
798 | max_nbytes, DMA_FROM_DEVICE); | 798 | max_nbytes, DMA_FROM_DEVICE); |
799 | 799 | ||
800 | if (unlikely(max_nbytes < nbytes)) { | 800 | if (unlikely(max_nbytes < nbytes)) { |
801 | ath10k_warn("rxed more than expected (nbytes %d, max %d)", | 801 | ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)", |
802 | nbytes, max_nbytes); | 802 | nbytes, max_nbytes); |
803 | dev_kfree_skb_any(skb); | 803 | dev_kfree_skb_any(skb); |
804 | continue; | 804 | continue; |
@@ -836,10 +836,10 @@ static int ath10k_pci_hif_tx_sg(struct ath10k *ar, u8 pipe_id, | |||
836 | } | 836 | } |
837 | 837 | ||
838 | for (i = 0; i < n_items - 1; i++) { | 838 | for (i = 0; i < n_items - 1; i++) { |
839 | ath10k_dbg(ATH10K_DBG_PCI, | 839 | ath10k_dbg(ar, ATH10K_DBG_PCI, |
840 | "pci tx item %d paddr 0x%08x len %d n_items %d\n", | 840 | "pci tx item %d paddr 0x%08x len %d n_items %d\n", |
841 | i, items[i].paddr, items[i].len, n_items); | 841 | i, items[i].paddr, items[i].len, n_items); |
842 | ath10k_dbg_dump(ATH10K_DBG_PCI_DUMP, NULL, "item data: ", | 842 | ath10k_dbg_dump(ar, ATH10K_DBG_PCI_DUMP, NULL, "pci tx data: ", |
843 | items[i].vaddr, items[i].len); | 843 | items[i].vaddr, items[i].len); |
844 | 844 | ||
845 | err = ath10k_ce_send_nolock(ce_pipe, | 845 | err = ath10k_ce_send_nolock(ce_pipe, |
@@ -854,10 +854,10 @@ static int ath10k_pci_hif_tx_sg(struct ath10k *ar, u8 pipe_id, | |||
854 | 854 | ||
855 | /* `i` is equal to `n_items -1` after for() */ | 855 | /* `i` is equal to `n_items -1` after for() */ |
856 | 856 | ||
857 | ath10k_dbg(ATH10K_DBG_PCI, | 857 | ath10k_dbg(ar, ATH10K_DBG_PCI, |
858 | "pci tx item %d paddr 0x%08x len %d n_items %d\n", | 858 | "pci tx item %d paddr 0x%08x len %d n_items %d\n", |
859 | i, items[i].paddr, items[i].len, n_items); | 859 | i, items[i].paddr, items[i].len, n_items); |
860 | ath10k_dbg_dump(ATH10K_DBG_PCI_DUMP, NULL, "item data: ", | 860 | ath10k_dbg_dump(ar, ATH10K_DBG_PCI_DUMP, NULL, "pci tx data: ", |
861 | items[i].vaddr, items[i].len); | 861 | items[i].vaddr, items[i].len); |
862 | 862 | ||
863 | err = ath10k_ce_send_nolock(ce_pipe, | 863 | err = ath10k_ce_send_nolock(ce_pipe, |
@@ -884,7 +884,7 @@ static u16 ath10k_pci_hif_get_free_queue_number(struct ath10k *ar, u8 pipe) | |||
884 | { | 884 | { |
885 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); | 885 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); |
886 | 886 | ||
887 | ath10k_dbg(ATH10K_DBG_PCI, "pci hif get free queue number\n"); | 887 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif get free queue number\n"); |
888 | 888 | ||
889 | return ath10k_ce_num_free_src_entries(ar_pci->pipe_info[pipe].ce_hdl); | 889 | return ath10k_ce_num_free_src_entries(ar_pci->pipe_info[pipe].ce_hdl); |
890 | } | 890 | } |
@@ -901,15 +901,15 @@ static void ath10k_pci_dump_registers(struct ath10k *ar, | |||
901 | hi_failure_state, | 901 | hi_failure_state, |
902 | REG_DUMP_COUNT_QCA988X * sizeof(u32)); | 902 | REG_DUMP_COUNT_QCA988X * sizeof(u32)); |
903 | if (ret) { | 903 | if (ret) { |
904 | ath10k_err("failed to read firmware dump area: %d\n", ret); | 904 | ath10k_err(ar, "failed to read firmware dump area: %d\n", ret); |
905 | return; | 905 | return; |
906 | } | 906 | } |
907 | 907 | ||
908 | BUILD_BUG_ON(REG_DUMP_COUNT_QCA988X % 4); | 908 | BUILD_BUG_ON(REG_DUMP_COUNT_QCA988X % 4); |
909 | 909 | ||
910 | ath10k_err("firmware register dump:\n"); | 910 | ath10k_err(ar, "firmware register dump:\n"); |
911 | for (i = 0; i < REG_DUMP_COUNT_QCA988X; i += 4) | 911 | for (i = 0; i < REG_DUMP_COUNT_QCA988X; i += 4) |
912 | ath10k_err("[%02d]: 0x%08X 0x%08X 0x%08X 0x%08X\n", | 912 | ath10k_err(ar, "[%02d]: 0x%08X 0x%08X 0x%08X 0x%08X\n", |
913 | i, | 913 | i, |
914 | reg_dump_values[i], | 914 | reg_dump_values[i], |
915 | reg_dump_values[i + 1], | 915 | reg_dump_values[i + 1], |
@@ -935,7 +935,7 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | |||
935 | else | 935 | else |
936 | scnprintf(uuid, sizeof(uuid), "n/a"); | 936 | scnprintf(uuid, sizeof(uuid), "n/a"); |
937 | 937 | ||
938 | ath10k_err("firmware crashed! (uuid %s)\n", uuid); | 938 | ath10k_err(ar, "firmware crashed! (uuid %s)\n", uuid); |
939 | ath10k_print_driver_info(ar); | 939 | ath10k_print_driver_info(ar); |
940 | 940 | ||
941 | if (!crash_data) | 941 | if (!crash_data) |
@@ -952,7 +952,7 @@ exit: | |||
952 | static void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, | 952 | static void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, |
953 | int force) | 953 | int force) |
954 | { | 954 | { |
955 | ath10k_dbg(ATH10K_DBG_PCI, "pci hif send complete check\n"); | 955 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif send complete check\n"); |
956 | 956 | ||
957 | if (!force) { | 957 | if (!force) { |
958 | int resources; | 958 | int resources; |
@@ -980,7 +980,7 @@ static void ath10k_pci_hif_set_callbacks(struct ath10k *ar, | |||
980 | { | 980 | { |
981 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); | 981 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); |
982 | 982 | ||
983 | ath10k_dbg(ATH10K_DBG_PCI, "pci hif set callbacks\n"); | 983 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif set callbacks\n"); |
984 | 984 | ||
985 | memcpy(&ar_pci->msg_callbacks_current, callbacks, | 985 | memcpy(&ar_pci->msg_callbacks_current, callbacks, |
986 | sizeof(ar_pci->msg_callbacks_current)); | 986 | sizeof(ar_pci->msg_callbacks_current)); |
@@ -1008,7 +1008,7 @@ static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar, | |||
1008 | { | 1008 | { |
1009 | int ret = 0; | 1009 | int ret = 0; |
1010 | 1010 | ||
1011 | ath10k_dbg(ATH10K_DBG_PCI, "pci hif map service\n"); | 1011 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif map service\n"); |
1012 | 1012 | ||
1013 | /* polling for received messages not supported */ | 1013 | /* polling for received messages not supported */ |
1014 | *dl_is_polled = 0; | 1014 | *dl_is_polled = 0; |
@@ -1069,7 +1069,7 @@ static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar, | |||
1069 | { | 1069 | { |
1070 | int ul_is_polled, dl_is_polled; | 1070 | int ul_is_polled, dl_is_polled; |
1071 | 1071 | ||
1072 | ath10k_dbg(ATH10K_DBG_PCI, "pci hif get default pipe\n"); | 1072 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif get default pipe\n"); |
1073 | 1073 | ||
1074 | (void)ath10k_pci_hif_map_service_to_pipe(ar, | 1074 | (void)ath10k_pci_hif_map_service_to_pipe(ar, |
1075 | ATH10K_HTC_SVC_ID_RSVD_CTRL, | 1075 | ATH10K_HTC_SVC_ID_RSVD_CTRL, |
@@ -1115,7 +1115,7 @@ static void ath10k_pci_irq_enable(struct ath10k *ar) | |||
1115 | 1115 | ||
1116 | static int ath10k_pci_hif_start(struct ath10k *ar) | 1116 | static int ath10k_pci_hif_start(struct ath10k *ar) |
1117 | { | 1117 | { |
1118 | ath10k_dbg(ATH10K_DBG_BOOT, "boot hif start\n"); | 1118 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n"); |
1119 | 1119 | ||
1120 | ath10k_pci_irq_enable(ar); | 1120 | ath10k_pci_irq_enable(ar); |
1121 | ath10k_pci_rx_post(ar); | 1121 | ath10k_pci_rx_post(ar); |
@@ -1222,7 +1222,7 @@ static void ath10k_pci_flush(struct ath10k *ar) | |||
1222 | 1222 | ||
1223 | static void ath10k_pci_hif_stop(struct ath10k *ar) | 1223 | static void ath10k_pci_hif_stop(struct ath10k *ar) |
1224 | { | 1224 | { |
1225 | ath10k_dbg(ATH10K_DBG_BOOT, "boot hif stop\n"); | 1225 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n"); |
1226 | 1226 | ||
1227 | ath10k_pci_irq_disable(ar); | 1227 | ath10k_pci_irq_disable(ar); |
1228 | ath10k_pci_flush(ar); | 1228 | ath10k_pci_flush(ar); |
@@ -1340,6 +1340,7 @@ static void ath10k_pci_bmi_send_done(struct ath10k_ce_pipe *ce_state) | |||
1340 | 1340 | ||
1341 | static void ath10k_pci_bmi_recv_data(struct ath10k_ce_pipe *ce_state) | 1341 | static void ath10k_pci_bmi_recv_data(struct ath10k_ce_pipe *ce_state) |
1342 | { | 1342 | { |
1343 | struct ath10k *ar = ce_state->ar; | ||
1343 | struct bmi_xfer *xfer; | 1344 | struct bmi_xfer *xfer; |
1344 | u32 ce_data; | 1345 | u32 ce_data; |
1345 | unsigned int nbytes; | 1346 | unsigned int nbytes; |
@@ -1351,7 +1352,7 @@ static void ath10k_pci_bmi_recv_data(struct ath10k_ce_pipe *ce_state) | |||
1351 | return; | 1352 | return; |
1352 | 1353 | ||
1353 | if (!xfer->wait_for_resp) { | 1354 | if (!xfer->wait_for_resp) { |
1354 | ath10k_warn("unexpected: BMI data received; ignoring\n"); | 1355 | ath10k_warn(ar, "unexpected: BMI data received; ignoring\n"); |
1355 | return; | 1356 | return; |
1356 | } | 1357 | } |
1357 | 1358 | ||
@@ -1487,7 +1488,7 @@ static int ath10k_pci_wake_target_cpu(struct ath10k *ar) | |||
1487 | CORE_CTRL_ADDRESS, | 1488 | CORE_CTRL_ADDRESS, |
1488 | &core_ctrl); | 1489 | &core_ctrl); |
1489 | if (ret) { | 1490 | if (ret) { |
1490 | ath10k_warn("failed to read core_ctrl: %d\n", ret); | 1491 | ath10k_warn(ar, "failed to read core_ctrl: %d\n", ret); |
1491 | return ret; | 1492 | return ret; |
1492 | } | 1493 | } |
1493 | 1494 | ||
@@ -1498,7 +1499,7 @@ static int ath10k_pci_wake_target_cpu(struct ath10k *ar) | |||
1498 | CORE_CTRL_ADDRESS, | 1499 | CORE_CTRL_ADDRESS, |
1499 | core_ctrl); | 1500 | core_ctrl); |
1500 | if (ret) { | 1501 | if (ret) { |
1501 | ath10k_warn("failed to set target CPU interrupt mask: %d\n", | 1502 | ath10k_warn(ar, "failed to set target CPU interrupt mask: %d\n", |
1502 | ret); | 1503 | ret); |
1503 | return ret; | 1504 | return ret; |
1504 | } | 1505 | } |
@@ -1527,13 +1528,13 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1527 | ret = ath10k_pci_diag_read_access(ar, interconnect_targ_addr, | 1528 | ret = ath10k_pci_diag_read_access(ar, interconnect_targ_addr, |
1528 | &pcie_state_targ_addr); | 1529 | &pcie_state_targ_addr); |
1529 | if (ret != 0) { | 1530 | if (ret != 0) { |
1530 | ath10k_err("Failed to get pcie state addr: %d\n", ret); | 1531 | ath10k_err(ar, "Failed to get pcie state addr: %d\n", ret); |
1531 | return ret; | 1532 | return ret; |
1532 | } | 1533 | } |
1533 | 1534 | ||
1534 | if (pcie_state_targ_addr == 0) { | 1535 | if (pcie_state_targ_addr == 0) { |
1535 | ret = -EIO; | 1536 | ret = -EIO; |
1536 | ath10k_err("Invalid pcie state addr\n"); | 1537 | ath10k_err(ar, "Invalid pcie state addr\n"); |
1537 | return ret; | 1538 | return ret; |
1538 | } | 1539 | } |
1539 | 1540 | ||
@@ -1542,13 +1543,13 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1542 | pipe_cfg_addr), | 1543 | pipe_cfg_addr), |
1543 | &pipe_cfg_targ_addr); | 1544 | &pipe_cfg_targ_addr); |
1544 | if (ret != 0) { | 1545 | if (ret != 0) { |
1545 | ath10k_err("Failed to get pipe cfg addr: %d\n", ret); | 1546 | ath10k_err(ar, "Failed to get pipe cfg addr: %d\n", ret); |
1546 | return ret; | 1547 | return ret; |
1547 | } | 1548 | } |
1548 | 1549 | ||
1549 | if (pipe_cfg_targ_addr == 0) { | 1550 | if (pipe_cfg_targ_addr == 0) { |
1550 | ret = -EIO; | 1551 | ret = -EIO; |
1551 | ath10k_err("Invalid pipe cfg addr\n"); | 1552 | ath10k_err(ar, "Invalid pipe cfg addr\n"); |
1552 | return ret; | 1553 | return ret; |
1553 | } | 1554 | } |
1554 | 1555 | ||
@@ -1557,7 +1558,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1557 | sizeof(target_ce_config_wlan)); | 1558 | sizeof(target_ce_config_wlan)); |
1558 | 1559 | ||
1559 | if (ret != 0) { | 1560 | if (ret != 0) { |
1560 | ath10k_err("Failed to write pipe cfg: %d\n", ret); | 1561 | ath10k_err(ar, "Failed to write pipe cfg: %d\n", ret); |
1561 | return ret; | 1562 | return ret; |
1562 | } | 1563 | } |
1563 | 1564 | ||
@@ -1566,13 +1567,13 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1566 | svc_to_pipe_map), | 1567 | svc_to_pipe_map), |
1567 | &svc_to_pipe_map); | 1568 | &svc_to_pipe_map); |
1568 | if (ret != 0) { | 1569 | if (ret != 0) { |
1569 | ath10k_err("Failed to get svc/pipe map: %d\n", ret); | 1570 | ath10k_err(ar, "Failed to get svc/pipe map: %d\n", ret); |
1570 | return ret; | 1571 | return ret; |
1571 | } | 1572 | } |
1572 | 1573 | ||
1573 | if (svc_to_pipe_map == 0) { | 1574 | if (svc_to_pipe_map == 0) { |
1574 | ret = -EIO; | 1575 | ret = -EIO; |
1575 | ath10k_err("Invalid svc_to_pipe map\n"); | 1576 | ath10k_err(ar, "Invalid svc_to_pipe map\n"); |
1576 | return ret; | 1577 | return ret; |
1577 | } | 1578 | } |
1578 | 1579 | ||
@@ -1580,7 +1581,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1580 | target_service_to_ce_map_wlan, | 1581 | target_service_to_ce_map_wlan, |
1581 | sizeof(target_service_to_ce_map_wlan)); | 1582 | sizeof(target_service_to_ce_map_wlan)); |
1582 | if (ret != 0) { | 1583 | if (ret != 0) { |
1583 | ath10k_err("Failed to write svc/pipe map: %d\n", ret); | 1584 | ath10k_err(ar, "Failed to write svc/pipe map: %d\n", ret); |
1584 | return ret; | 1585 | return ret; |
1585 | } | 1586 | } |
1586 | 1587 | ||
@@ -1589,7 +1590,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1589 | config_flags), | 1590 | config_flags), |
1590 | &pcie_config_flags); | 1591 | &pcie_config_flags); |
1591 | if (ret != 0) { | 1592 | if (ret != 0) { |
1592 | ath10k_err("Failed to get pcie config_flags: %d\n", ret); | 1593 | ath10k_err(ar, "Failed to get pcie config_flags: %d\n", ret); |
1593 | return ret; | 1594 | return ret; |
1594 | } | 1595 | } |
1595 | 1596 | ||
@@ -1600,7 +1601,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1600 | &pcie_config_flags, | 1601 | &pcie_config_flags, |
1601 | sizeof(pcie_config_flags)); | 1602 | sizeof(pcie_config_flags)); |
1602 | if (ret != 0) { | 1603 | if (ret != 0) { |
1603 | ath10k_err("Failed to write pcie config_flags: %d\n", ret); | 1604 | ath10k_err(ar, "Failed to write pcie config_flags: %d\n", ret); |
1604 | return ret; | 1605 | return ret; |
1605 | } | 1606 | } |
1606 | 1607 | ||
@@ -1609,7 +1610,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1609 | 1610 | ||
1610 | ret = ath10k_pci_diag_read_access(ar, ealloc_targ_addr, &ealloc_value); | 1611 | ret = ath10k_pci_diag_read_access(ar, ealloc_targ_addr, &ealloc_value); |
1611 | if (ret != 0) { | 1612 | if (ret != 0) { |
1612 | ath10k_err("Faile to get early alloc val: %d\n", ret); | 1613 | ath10k_err(ar, "Faile to get early alloc val: %d\n", ret); |
1613 | return ret; | 1614 | return ret; |
1614 | } | 1615 | } |
1615 | 1616 | ||
@@ -1621,7 +1622,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1621 | 1622 | ||
1622 | ret = ath10k_pci_diag_write_access(ar, ealloc_targ_addr, ealloc_value); | 1623 | ret = ath10k_pci_diag_write_access(ar, ealloc_targ_addr, ealloc_value); |
1623 | if (ret != 0) { | 1624 | if (ret != 0) { |
1624 | ath10k_err("Failed to set early alloc val: %d\n", ret); | 1625 | ath10k_err(ar, "Failed to set early alloc val: %d\n", ret); |
1625 | return ret; | 1626 | return ret; |
1626 | } | 1627 | } |
1627 | 1628 | ||
@@ -1630,7 +1631,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1630 | 1631 | ||
1631 | ret = ath10k_pci_diag_read_access(ar, flag2_targ_addr, &flag2_value); | 1632 | ret = ath10k_pci_diag_read_access(ar, flag2_targ_addr, &flag2_value); |
1632 | if (ret != 0) { | 1633 | if (ret != 0) { |
1633 | ath10k_err("Failed to get option val: %d\n", ret); | 1634 | ath10k_err(ar, "Failed to get option val: %d\n", ret); |
1634 | return ret; | 1635 | return ret; |
1635 | } | 1636 | } |
1636 | 1637 | ||
@@ -1638,7 +1639,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) | |||
1638 | 1639 | ||
1639 | ret = ath10k_pci_diag_write_access(ar, flag2_targ_addr, flag2_value); | 1640 | ret = ath10k_pci_diag_write_access(ar, flag2_targ_addr, flag2_value); |
1640 | if (ret != 0) { | 1641 | if (ret != 0) { |
1641 | ath10k_err("Failed to set option val: %d\n", ret); | 1642 | ath10k_err(ar, "Failed to set option val: %d\n", ret); |
1642 | return ret; | 1643 | return ret; |
1643 | } | 1644 | } |
1644 | 1645 | ||
@@ -1652,7 +1653,7 @@ static int ath10k_pci_alloc_ce(struct ath10k *ar) | |||
1652 | for (i = 0; i < CE_COUNT; i++) { | 1653 | for (i = 0; i < CE_COUNT; i++) { |
1653 | ret = ath10k_ce_alloc_pipe(ar, i, &host_ce_config_wlan[i]); | 1654 | ret = ath10k_ce_alloc_pipe(ar, i, &host_ce_config_wlan[i]); |
1654 | if (ret) { | 1655 | if (ret) { |
1655 | ath10k_err("failed to allocate copy engine pipe %d: %d\n", | 1656 | ath10k_err(ar, "failed to allocate copy engine pipe %d: %d\n", |
1656 | i, ret); | 1657 | i, ret); |
1657 | return ret; | 1658 | return ret; |
1658 | } | 1659 | } |
@@ -1687,7 +1688,7 @@ static int ath10k_pci_ce_init(struct ath10k *ar) | |||
1687 | ath10k_pci_ce_send_done, | 1688 | ath10k_pci_ce_send_done, |
1688 | ath10k_pci_ce_recv_data); | 1689 | ath10k_pci_ce_recv_data); |
1689 | if (ret) { | 1690 | if (ret) { |
1690 | ath10k_err("failed to initialize copy engine pipe %d: %d\n", | 1691 | ath10k_err(ar, "failed to initialize copy engine pipe %d: %d\n", |
1691 | pipe_num, ret); | 1692 | pipe_num, ret); |
1692 | return ret; | 1693 | return ret; |
1693 | } | 1694 | } |
@@ -1746,16 +1747,17 @@ static int ath10k_pci_warm_reset(struct ath10k *ar) | |||
1746 | { | 1747 | { |
1747 | u32 val; | 1748 | u32 val; |
1748 | 1749 | ||
1749 | ath10k_dbg(ATH10K_DBG_BOOT, "boot warm reset\n"); | 1750 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot warm reset\n"); |
1750 | 1751 | ||
1751 | /* debug */ | 1752 | /* debug */ |
1752 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + | 1753 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + |
1753 | PCIE_INTR_CAUSE_ADDRESS); | 1754 | PCIE_INTR_CAUSE_ADDRESS); |
1754 | ath10k_dbg(ATH10K_DBG_BOOT, "boot host cpu intr cause: 0x%08x\n", val); | 1755 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot host cpu intr cause: 0x%08x\n", |
1756 | val); | ||
1755 | 1757 | ||
1756 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + | 1758 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + |
1757 | CPU_INTR_ADDRESS); | 1759 | CPU_INTR_ADDRESS); |
1758 | ath10k_dbg(ATH10K_DBG_BOOT, "boot target cpu intr cause: 0x%08x\n", | 1760 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot target cpu intr cause: 0x%08x\n", |
1759 | val); | 1761 | val); |
1760 | 1762 | ||
1761 | /* disable pending irqs */ | 1763 | /* disable pending irqs */ |
@@ -1798,11 +1800,12 @@ static int ath10k_pci_warm_reset(struct ath10k *ar) | |||
1798 | /* debug */ | 1800 | /* debug */ |
1799 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + | 1801 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + |
1800 | PCIE_INTR_CAUSE_ADDRESS); | 1802 | PCIE_INTR_CAUSE_ADDRESS); |
1801 | ath10k_dbg(ATH10K_DBG_BOOT, "boot host cpu intr cause: 0x%08x\n", val); | 1803 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot host cpu intr cause: 0x%08x\n", |
1804 | val); | ||
1802 | 1805 | ||
1803 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + | 1806 | val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + |
1804 | CPU_INTR_ADDRESS); | 1807 | CPU_INTR_ADDRESS); |
1805 | ath10k_dbg(ATH10K_DBG_BOOT, "boot target cpu intr cause: 0x%08x\n", | 1808 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot target cpu intr cause: 0x%08x\n", |
1806 | val); | 1809 | val); |
1807 | 1810 | ||
1808 | /* CPU warm reset */ | 1811 | /* CPU warm reset */ |
@@ -1813,11 +1816,12 @@ static int ath10k_pci_warm_reset(struct ath10k *ar) | |||
1813 | 1816 | ||
1814 | val = ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + | 1817 | val = ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + |
1815 | SOC_RESET_CONTROL_ADDRESS); | 1818 | SOC_RESET_CONTROL_ADDRESS); |
1816 | ath10k_dbg(ATH10K_DBG_BOOT, "boot target reset state: 0x%08x\n", val); | 1819 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot target reset state: 0x%08x\n", |
1820 | val); | ||
1817 | 1821 | ||
1818 | msleep(100); | 1822 | msleep(100); |
1819 | 1823 | ||
1820 | ath10k_dbg(ATH10K_DBG_BOOT, "boot warm reset complete\n"); | 1824 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot warm reset complete\n"); |
1821 | 1825 | ||
1822 | return 0; | 1826 | return 0; |
1823 | } | 1827 | } |
@@ -1842,31 +1846,31 @@ static int __ath10k_pci_hif_power_up(struct ath10k *ar, bool cold_reset) | |||
1842 | ret = ath10k_pci_warm_reset(ar); | 1846 | ret = ath10k_pci_warm_reset(ar); |
1843 | 1847 | ||
1844 | if (ret) { | 1848 | if (ret) { |
1845 | ath10k_err("failed to reset target: %d\n", ret); | 1849 | ath10k_err(ar, "failed to reset target: %d\n", ret); |
1846 | goto err; | 1850 | goto err; |
1847 | } | 1851 | } |
1848 | 1852 | ||
1849 | ret = ath10k_pci_ce_init(ar); | 1853 | ret = ath10k_pci_ce_init(ar); |
1850 | if (ret) { | 1854 | if (ret) { |
1851 | ath10k_err("failed to initialize CE: %d\n", ret); | 1855 | ath10k_err(ar, "failed to initialize CE: %d\n", ret); |
1852 | goto err; | 1856 | goto err; |
1853 | } | 1857 | } |
1854 | 1858 | ||
1855 | ret = ath10k_pci_wait_for_target_init(ar); | 1859 | ret = ath10k_pci_wait_for_target_init(ar); |
1856 | if (ret) { | 1860 | if (ret) { |
1857 | ath10k_err("failed to wait for target to init: %d\n", ret); | 1861 | ath10k_err(ar, "failed to wait for target to init: %d\n", ret); |
1858 | goto err_ce; | 1862 | goto err_ce; |
1859 | } | 1863 | } |
1860 | 1864 | ||
1861 | ret = ath10k_pci_init_config(ar); | 1865 | ret = ath10k_pci_init_config(ar); |
1862 | if (ret) { | 1866 | if (ret) { |
1863 | ath10k_err("failed to setup init config: %d\n", ret); | 1867 | ath10k_err(ar, "failed to setup init config: %d\n", ret); |
1864 | goto err_ce; | 1868 | goto err_ce; |
1865 | } | 1869 | } |
1866 | 1870 | ||
1867 | ret = ath10k_pci_wake_target_cpu(ar); | 1871 | ret = ath10k_pci_wake_target_cpu(ar); |
1868 | if (ret) { | 1872 | if (ret) { |
1869 | ath10k_err("could not wake up target CPU: %d\n", ret); | 1873 | ath10k_err(ar, "could not wake up target CPU: %d\n", ret); |
1870 | goto err_ce; | 1874 | goto err_ce; |
1871 | } | 1875 | } |
1872 | 1876 | ||
@@ -1894,7 +1898,7 @@ static int ath10k_pci_hif_power_up_warm(struct ath10k *ar) | |||
1894 | if (ret == 0) | 1898 | if (ret == 0) |
1895 | break; | 1899 | break; |
1896 | 1900 | ||
1897 | ath10k_warn("failed to warm reset (attempt %d out of %d): %d\n", | 1901 | ath10k_warn(ar, "failed to warm reset (attempt %d out of %d): %d\n", |
1898 | i + 1, ATH10K_PCI_NUM_WARM_RESET_ATTEMPTS, ret); | 1902 | i + 1, ATH10K_PCI_NUM_WARM_RESET_ATTEMPTS, ret); |
1899 | } | 1903 | } |
1900 | 1904 | ||
@@ -1905,7 +1909,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar) | |||
1905 | { | 1909 | { |
1906 | int ret; | 1910 | int ret; |
1907 | 1911 | ||
1908 | ath10k_dbg(ATH10K_DBG_BOOT, "boot hif power up\n"); | 1912 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power up\n"); |
1909 | 1913 | ||
1910 | /* | 1914 | /* |
1911 | * Hardware CUS232 version 2 has some issues with cold reset and the | 1915 | * Hardware CUS232 version 2 has some issues with cold reset and the |
@@ -1917,17 +1921,17 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar) | |||
1917 | */ | 1921 | */ |
1918 | ret = ath10k_pci_hif_power_up_warm(ar); | 1922 | ret = ath10k_pci_hif_power_up_warm(ar); |
1919 | if (ret) { | 1923 | if (ret) { |
1920 | ath10k_warn("failed to power up target using warm reset: %d\n", | 1924 | ath10k_warn(ar, "failed to power up target using warm reset: %d\n", |
1921 | ret); | 1925 | ret); |
1922 | 1926 | ||
1923 | if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY) | 1927 | if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY) |
1924 | return ret; | 1928 | return ret; |
1925 | 1929 | ||
1926 | ath10k_warn("trying cold reset\n"); | 1930 | ath10k_warn(ar, "trying cold reset\n"); |
1927 | 1931 | ||
1928 | ret = __ath10k_pci_hif_power_up(ar, true); | 1932 | ret = __ath10k_pci_hif_power_up(ar, true); |
1929 | if (ret) { | 1933 | if (ret) { |
1930 | ath10k_err("failed to power up target using cold reset too (%d)\n", | 1934 | ath10k_err(ar, "failed to power up target using cold reset too (%d)\n", |
1931 | ret); | 1935 | ret); |
1932 | return ret; | 1936 | return ret; |
1933 | } | 1937 | } |
@@ -1938,7 +1942,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar) | |||
1938 | 1942 | ||
1939 | static void ath10k_pci_hif_power_down(struct ath10k *ar) | 1943 | static void ath10k_pci_hif_power_down(struct ath10k *ar) |
1940 | { | 1944 | { |
1941 | ath10k_dbg(ATH10K_DBG_BOOT, "boot hif power down\n"); | 1945 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n"); |
1942 | 1946 | ||
1943 | ath10k_pci_warm_reset(ar); | 1947 | ath10k_pci_warm_reset(ar); |
1944 | } | 1948 | } |
@@ -2023,7 +2027,7 @@ static void ath10k_msi_err_tasklet(unsigned long data) | |||
2023 | struct ath10k *ar = (struct ath10k *)data; | 2027 | struct ath10k *ar = (struct ath10k *)data; |
2024 | 2028 | ||
2025 | if (!ath10k_pci_has_fw_crashed(ar)) { | 2029 | if (!ath10k_pci_has_fw_crashed(ar)) { |
2026 | ath10k_warn("received unsolicited fw crash interrupt\n"); | 2030 | ath10k_warn(ar, "received unsolicited fw crash interrupt\n"); |
2027 | return; | 2031 | return; |
2028 | } | 2032 | } |
2029 | 2033 | ||
@@ -2042,7 +2046,8 @@ static irqreturn_t ath10k_pci_per_engine_handler(int irq, void *arg) | |||
2042 | int ce_id = irq - ar_pci->pdev->irq - MSI_ASSIGN_CE_INITIAL; | 2046 | int ce_id = irq - ar_pci->pdev->irq - MSI_ASSIGN_CE_INITIAL; |
2043 | 2047 | ||
2044 | if (ce_id < 0 || ce_id >= ARRAY_SIZE(ar_pci->pipe_info)) { | 2048 | if (ce_id < 0 || ce_id >= ARRAY_SIZE(ar_pci->pipe_info)) { |
2045 | ath10k_warn("unexpected/invalid irq %d ce_id %d\n", irq, ce_id); | 2049 | ath10k_warn(ar, "unexpected/invalid irq %d ce_id %d\n", irq, |
2050 | ce_id); | ||
2046 | return IRQ_HANDLED; | 2051 | return IRQ_HANDLED; |
2047 | } | 2052 | } |
2048 | 2053 | ||
@@ -2116,7 +2121,7 @@ static int ath10k_pci_request_irq_msix(struct ath10k *ar) | |||
2116 | ath10k_pci_msi_fw_handler, | 2121 | ath10k_pci_msi_fw_handler, |
2117 | IRQF_SHARED, "ath10k_pci", ar); | 2122 | IRQF_SHARED, "ath10k_pci", ar); |
2118 | if (ret) { | 2123 | if (ret) { |
2119 | ath10k_warn("failed to request MSI-X fw irq %d: %d\n", | 2124 | ath10k_warn(ar, "failed to request MSI-X fw irq %d: %d\n", |
2120 | ar_pci->pdev->irq + MSI_ASSIGN_FW, ret); | 2125 | ar_pci->pdev->irq + MSI_ASSIGN_FW, ret); |
2121 | return ret; | 2126 | return ret; |
2122 | } | 2127 | } |
@@ -2126,7 +2131,7 @@ static int ath10k_pci_request_irq_msix(struct ath10k *ar) | |||
2126 | ath10k_pci_per_engine_handler, | 2131 | ath10k_pci_per_engine_handler, |
2127 | IRQF_SHARED, "ath10k_pci", ar); | 2132 | IRQF_SHARED, "ath10k_pci", ar); |
2128 | if (ret) { | 2133 | if (ret) { |
2129 | ath10k_warn("failed to request MSI-X ce irq %d: %d\n", | 2134 | ath10k_warn(ar, "failed to request MSI-X ce irq %d: %d\n", |
2130 | ar_pci->pdev->irq + i, ret); | 2135 | ar_pci->pdev->irq + i, ret); |
2131 | 2136 | ||
2132 | for (i--; i >= MSI_ASSIGN_CE_INITIAL; i--) | 2137 | for (i--; i >= MSI_ASSIGN_CE_INITIAL; i--) |
@@ -2149,7 +2154,7 @@ static int ath10k_pci_request_irq_msi(struct ath10k *ar) | |||
2149 | ath10k_pci_interrupt_handler, | 2154 | ath10k_pci_interrupt_handler, |
2150 | IRQF_SHARED, "ath10k_pci", ar); | 2155 | IRQF_SHARED, "ath10k_pci", ar); |
2151 | if (ret) { | 2156 | if (ret) { |
2152 | ath10k_warn("failed to request MSI irq %d: %d\n", | 2157 | ath10k_warn(ar, "failed to request MSI irq %d: %d\n", |
2153 | ar_pci->pdev->irq, ret); | 2158 | ar_pci->pdev->irq, ret); |
2154 | return ret; | 2159 | return ret; |
2155 | } | 2160 | } |
@@ -2166,7 +2171,7 @@ static int ath10k_pci_request_irq_legacy(struct ath10k *ar) | |||
2166 | ath10k_pci_interrupt_handler, | 2171 | ath10k_pci_interrupt_handler, |
2167 | IRQF_SHARED, "ath10k_pci", ar); | 2172 | IRQF_SHARED, "ath10k_pci", ar); |
2168 | if (ret) { | 2173 | if (ret) { |
2169 | ath10k_warn("failed to request legacy irq %d: %d\n", | 2174 | ath10k_warn(ar, "failed to request legacy irq %d: %d\n", |
2170 | ar_pci->pdev->irq, ret); | 2175 | ar_pci->pdev->irq, ret); |
2171 | return ret; | 2176 | return ret; |
2172 | } | 2177 | } |
@@ -2187,7 +2192,7 @@ static int ath10k_pci_request_irq(struct ath10k *ar) | |||
2187 | return ath10k_pci_request_irq_msix(ar); | 2192 | return ath10k_pci_request_irq_msix(ar); |
2188 | } | 2193 | } |
2189 | 2194 | ||
2190 | ath10k_warn("unknown irq configuration upon request\n"); | 2195 | ath10k_warn(ar, "unknown irq configuration upon request\n"); |
2191 | return -EINVAL; | 2196 | return -EINVAL; |
2192 | } | 2197 | } |
2193 | 2198 | ||
@@ -2226,7 +2231,8 @@ static int ath10k_pci_init_irq(struct ath10k *ar) | |||
2226 | ath10k_pci_init_irq_tasklets(ar); | 2231 | ath10k_pci_init_irq_tasklets(ar); |
2227 | 2232 | ||
2228 | if (ath10k_pci_irq_mode != ATH10K_PCI_IRQ_AUTO) | 2233 | if (ath10k_pci_irq_mode != ATH10K_PCI_IRQ_AUTO) |
2229 | ath10k_info("limiting irq mode to: %d\n", ath10k_pci_irq_mode); | 2234 | ath10k_info(ar, "limiting irq mode to: %d\n", |
2235 | ath10k_pci_irq_mode); | ||
2230 | 2236 | ||
2231 | /* Try MSI-X */ | 2237 | /* Try MSI-X */ |
2232 | if (ath10k_pci_irq_mode == ATH10K_PCI_IRQ_AUTO) { | 2238 | if (ath10k_pci_irq_mode == ATH10K_PCI_IRQ_AUTO) { |
@@ -2288,7 +2294,7 @@ static int ath10k_pci_deinit_irq(struct ath10k *ar) | |||
2288 | pci_disable_msi(ar_pci->pdev); | 2294 | pci_disable_msi(ar_pci->pdev); |
2289 | } | 2295 | } |
2290 | 2296 | ||
2291 | ath10k_warn("unknown irq configuration upon deinit\n"); | 2297 | ath10k_warn(ar, "unknown irq configuration upon deinit\n"); |
2292 | return -EINVAL; | 2298 | return -EINVAL; |
2293 | } | 2299 | } |
2294 | 2300 | ||
@@ -2298,14 +2304,15 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar) | |||
2298 | unsigned long timeout; | 2304 | unsigned long timeout; |
2299 | u32 val; | 2305 | u32 val; |
2300 | 2306 | ||
2301 | ath10k_dbg(ATH10K_DBG_BOOT, "boot waiting target to initialise\n"); | 2307 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot waiting target to initialise\n"); |
2302 | 2308 | ||
2303 | timeout = jiffies + msecs_to_jiffies(ATH10K_PCI_TARGET_WAIT); | 2309 | timeout = jiffies + msecs_to_jiffies(ATH10K_PCI_TARGET_WAIT); |
2304 | 2310 | ||
2305 | do { | 2311 | do { |
2306 | val = ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS); | 2312 | val = ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS); |
2307 | 2313 | ||
2308 | ath10k_dbg(ATH10K_DBG_BOOT, "boot target indicator %x\n", val); | 2314 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot target indicator %x\n", |
2315 | val); | ||
2309 | 2316 | ||
2310 | /* target should never return this */ | 2317 | /* target should never return this */ |
2311 | if (val == 0xffffffff) | 2318 | if (val == 0xffffffff) |
@@ -2329,24 +2336,24 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar) | |||
2329 | } while (time_before(jiffies, timeout)); | 2336 | } while (time_before(jiffies, timeout)); |
2330 | 2337 | ||
2331 | if (val == 0xffffffff) { | 2338 | if (val == 0xffffffff) { |
2332 | ath10k_err("failed to read device register, device is gone\n"); | 2339 | ath10k_err(ar, "failed to read device register, device is gone\n"); |
2333 | return -EIO; | 2340 | return -EIO; |
2334 | } | 2341 | } |
2335 | 2342 | ||
2336 | if (val & FW_IND_EVENT_PENDING) { | 2343 | if (val & FW_IND_EVENT_PENDING) { |
2337 | ath10k_warn("device has crashed during init\n"); | 2344 | ath10k_warn(ar, "device has crashed during init\n"); |
2338 | ath10k_pci_fw_crashed_clear(ar); | 2345 | ath10k_pci_fw_crashed_clear(ar); |
2339 | ath10k_pci_fw_crashed_dump(ar); | 2346 | ath10k_pci_fw_crashed_dump(ar); |
2340 | return -ECOMM; | 2347 | return -ECOMM; |
2341 | } | 2348 | } |
2342 | 2349 | ||
2343 | if (!(val & FW_IND_INITIALIZED)) { | 2350 | if (!(val & FW_IND_INITIALIZED)) { |
2344 | ath10k_err("failed to receive initialized event from target: %08x\n", | 2351 | ath10k_err(ar, "failed to receive initialized event from target: %08x\n", |
2345 | val); | 2352 | val); |
2346 | return -ETIMEDOUT; | 2353 | return -ETIMEDOUT; |
2347 | } | 2354 | } |
2348 | 2355 | ||
2349 | ath10k_dbg(ATH10K_DBG_BOOT, "boot target initialised\n"); | 2356 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot target initialised\n"); |
2350 | return 0; | 2357 | return 0; |
2351 | } | 2358 | } |
2352 | 2359 | ||
@@ -2355,7 +2362,7 @@ static int ath10k_pci_cold_reset(struct ath10k *ar) | |||
2355 | int i; | 2362 | int i; |
2356 | u32 val; | 2363 | u32 val; |
2357 | 2364 | ||
2358 | ath10k_dbg(ATH10K_DBG_BOOT, "boot cold reset\n"); | 2365 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset\n"); |
2359 | 2366 | ||
2360 | /* Put Target, including PCIe, into RESET. */ | 2367 | /* Put Target, including PCIe, into RESET. */ |
2361 | val = ath10k_pci_reg_read32(ar, SOC_GLOBAL_RESET_ADDRESS); | 2368 | val = ath10k_pci_reg_read32(ar, SOC_GLOBAL_RESET_ADDRESS); |
@@ -2380,7 +2387,7 @@ static int ath10k_pci_cold_reset(struct ath10k *ar) | |||
2380 | msleep(1); | 2387 | msleep(1); |
2381 | } | 2388 | } |
2382 | 2389 | ||
2383 | ath10k_dbg(ATH10K_DBG_BOOT, "boot cold reset complete\n"); | 2390 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset complete\n"); |
2384 | 2391 | ||
2385 | return 0; | 2392 | return 0; |
2386 | } | 2393 | } |
@@ -2396,13 +2403,13 @@ static int ath10k_pci_claim(struct ath10k *ar) | |||
2396 | 2403 | ||
2397 | ret = pci_enable_device(pdev); | 2404 | ret = pci_enable_device(pdev); |
2398 | if (ret) { | 2405 | if (ret) { |
2399 | ath10k_err("failed to enable pci device: %d\n", ret); | 2406 | ath10k_err(ar, "failed to enable pci device: %d\n", ret); |
2400 | return ret; | 2407 | return ret; |
2401 | } | 2408 | } |
2402 | 2409 | ||
2403 | ret = pci_request_region(pdev, BAR_NUM, "ath"); | 2410 | ret = pci_request_region(pdev, BAR_NUM, "ath"); |
2404 | if (ret) { | 2411 | if (ret) { |
2405 | ath10k_err("failed to request region BAR%d: %d\n", BAR_NUM, | 2412 | ath10k_err(ar, "failed to request region BAR%d: %d\n", BAR_NUM, |
2406 | ret); | 2413 | ret); |
2407 | goto err_device; | 2414 | goto err_device; |
2408 | } | 2415 | } |
@@ -2410,13 +2417,13 @@ static int ath10k_pci_claim(struct ath10k *ar) | |||
2410 | /* Target expects 32 bit DMA. Enforce it. */ | 2417 | /* Target expects 32 bit DMA. Enforce it. */ |
2411 | ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | 2418 | ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |
2412 | if (ret) { | 2419 | if (ret) { |
2413 | ath10k_err("failed to set dma mask to 32-bit: %d\n", ret); | 2420 | ath10k_err(ar, "failed to set dma mask to 32-bit: %d\n", ret); |
2414 | goto err_region; | 2421 | goto err_region; |
2415 | } | 2422 | } |
2416 | 2423 | ||
2417 | ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); | 2424 | ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); |
2418 | if (ret) { | 2425 | if (ret) { |
2419 | ath10k_err("failed to set consistent dma mask to 32-bit: %d\n", | 2426 | ath10k_err(ar, "failed to set consistent dma mask to 32-bit: %d\n", |
2420 | ret); | 2427 | ret); |
2421 | goto err_region; | 2428 | goto err_region; |
2422 | } | 2429 | } |
@@ -2430,12 +2437,12 @@ static int ath10k_pci_claim(struct ath10k *ar) | |||
2430 | /* Arrange for access to Target SoC registers. */ | 2437 | /* Arrange for access to Target SoC registers. */ |
2431 | ar_pci->mem = pci_iomap(pdev, BAR_NUM, 0); | 2438 | ar_pci->mem = pci_iomap(pdev, BAR_NUM, 0); |
2432 | if (!ar_pci->mem) { | 2439 | if (!ar_pci->mem) { |
2433 | ath10k_err("failed to iomap BAR%d\n", BAR_NUM); | 2440 | ath10k_err(ar, "failed to iomap BAR%d\n", BAR_NUM); |
2434 | ret = -EIO; | 2441 | ret = -EIO; |
2435 | goto err_master; | 2442 | goto err_master; |
2436 | } | 2443 | } |
2437 | 2444 | ||
2438 | ath10k_dbg(ATH10K_DBG_BOOT, "boot pci_mem 0x%p\n", ar_pci->mem); | 2445 | ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%p\n", ar_pci->mem); |
2439 | return 0; | 2446 | return 0; |
2440 | 2447 | ||
2441 | err_master: | 2448 | err_master: |
@@ -2469,15 +2476,15 @@ static int ath10k_pci_probe(struct pci_dev *pdev, | |||
2469 | struct ath10k_pci *ar_pci; | 2476 | struct ath10k_pci *ar_pci; |
2470 | u32 chip_id; | 2477 | u32 chip_id; |
2471 | 2478 | ||
2472 | ath10k_dbg(ATH10K_DBG_PCI, "pci probe\n"); | ||
2473 | |||
2474 | ar = ath10k_core_create(sizeof(*ar_pci), &pdev->dev, | 2479 | ar = ath10k_core_create(sizeof(*ar_pci), &pdev->dev, |
2475 | &ath10k_pci_hif_ops); | 2480 | &ath10k_pci_hif_ops); |
2476 | if (!ar) { | 2481 | if (!ar) { |
2477 | ath10k_err("failed to allocate core\n"); | 2482 | dev_err(&pdev->dev, "failed to allocate core\n"); |
2478 | return -ENOMEM; | 2483 | return -ENOMEM; |
2479 | } | 2484 | } |
2480 | 2485 | ||
2486 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci probe\n"); | ||
2487 | |||
2481 | ar_pci = ath10k_pci_priv(ar); | 2488 | ar_pci = ath10k_pci_priv(ar); |
2482 | ar_pci->pdev = pdev; | 2489 | ar_pci->pdev = pdev; |
2483 | ar_pci->dev = &pdev->dev; | 2490 | ar_pci->dev = &pdev->dev; |
@@ -2489,25 +2496,26 @@ static int ath10k_pci_probe(struct pci_dev *pdev, | |||
2489 | 2496 | ||
2490 | ret = ath10k_pci_claim(ar); | 2497 | ret = ath10k_pci_claim(ar); |
2491 | if (ret) { | 2498 | if (ret) { |
2492 | ath10k_err("failed to claim device: %d\n", ret); | 2499 | ath10k_err(ar, "failed to claim device: %d\n", ret); |
2493 | goto err_core_destroy; | 2500 | goto err_core_destroy; |
2494 | } | 2501 | } |
2495 | 2502 | ||
2496 | ret = ath10k_pci_wake(ar); | 2503 | ret = ath10k_pci_wake(ar); |
2497 | if (ret) { | 2504 | if (ret) { |
2498 | ath10k_err("failed to wake up: %d\n", ret); | 2505 | ath10k_err(ar, "failed to wake up: %d\n", ret); |
2499 | goto err_release; | 2506 | goto err_release; |
2500 | } | 2507 | } |
2501 | 2508 | ||
2502 | chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); | 2509 | chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); |
2503 | if (chip_id == 0xffffffff) { | 2510 | if (chip_id == 0xffffffff) { |
2504 | ath10k_err("failed to get chip id\n"); | 2511 | ath10k_err(ar, "failed to get chip id\n"); |
2505 | goto err_sleep; | 2512 | goto err_sleep; |
2506 | } | 2513 | } |
2507 | 2514 | ||
2508 | ret = ath10k_pci_alloc_ce(ar); | 2515 | ret = ath10k_pci_alloc_ce(ar); |
2509 | if (ret) { | 2516 | if (ret) { |
2510 | ath10k_err("failed to allocate copy engine pipes: %d\n", ret); | 2517 | ath10k_err(ar, "failed to allocate copy engine pipes: %d\n", |
2518 | ret); | ||
2511 | goto err_sleep; | 2519 | goto err_sleep; |
2512 | } | 2520 | } |
2513 | 2521 | ||
@@ -2515,7 +2523,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, | |||
2515 | 2523 | ||
2516 | ret = ath10k_ce_disable_interrupts(ar); | 2524 | ret = ath10k_ce_disable_interrupts(ar); |
2517 | if (ret) { | 2525 | if (ret) { |
2518 | ath10k_err("failed to disable copy engine interrupts: %d\n", | 2526 | ath10k_err(ar, "failed to disable copy engine interrupts: %d\n", |
2519 | ret); | 2527 | ret); |
2520 | goto err_free_ce; | 2528 | goto err_free_ce; |
2521 | } | 2529 | } |
@@ -2529,17 +2537,17 @@ static int ath10k_pci_probe(struct pci_dev *pdev, | |||
2529 | 2537 | ||
2530 | ret = ath10k_pci_init_irq(ar); | 2538 | ret = ath10k_pci_init_irq(ar); |
2531 | if (ret) { | 2539 | if (ret) { |
2532 | ath10k_err("failed to init irqs: %d\n", ret); | 2540 | ath10k_err(ar, "failed to init irqs: %d\n", ret); |
2533 | goto err_free_ce; | 2541 | goto err_free_ce; |
2534 | } | 2542 | } |
2535 | 2543 | ||
2536 | ath10k_info("pci irq %s interrupts %d irq_mode %d reset_mode %d\n", | 2544 | ath10k_info(ar, "pci irq %s interrupts %d irq_mode %d reset_mode %d\n", |
2537 | ath10k_pci_get_irq_method(ar), ar_pci->num_msi_intrs, | 2545 | ath10k_pci_get_irq_method(ar), ar_pci->num_msi_intrs, |
2538 | ath10k_pci_irq_mode, ath10k_pci_reset_mode); | 2546 | ath10k_pci_irq_mode, ath10k_pci_reset_mode); |
2539 | 2547 | ||
2540 | ret = ath10k_pci_request_irq(ar); | 2548 | ret = ath10k_pci_request_irq(ar); |
2541 | if (ret) { | 2549 | if (ret) { |
2542 | ath10k_warn("failed to request irqs: %d\n", ret); | 2550 | ath10k_warn(ar, "failed to request irqs: %d\n", ret); |
2543 | goto err_deinit_irq; | 2551 | goto err_deinit_irq; |
2544 | } | 2552 | } |
2545 | 2553 | ||
@@ -2548,7 +2556,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, | |||
2548 | 2556 | ||
2549 | ret = ath10k_core_register(ar, chip_id); | 2557 | ret = ath10k_core_register(ar, chip_id); |
2550 | if (ret) { | 2558 | if (ret) { |
2551 | ath10k_err("failed to register driver core: %d\n", ret); | 2559 | ath10k_err(ar, "failed to register driver core: %d\n", ret); |
2552 | goto err_free_irq; | 2560 | goto err_free_irq; |
2553 | } | 2561 | } |
2554 | 2562 | ||
@@ -2580,7 +2588,7 @@ static void ath10k_pci_remove(struct pci_dev *pdev) | |||
2580 | struct ath10k *ar = pci_get_drvdata(pdev); | 2588 | struct ath10k *ar = pci_get_drvdata(pdev); |
2581 | struct ath10k_pci *ar_pci; | 2589 | struct ath10k_pci *ar_pci; |
2582 | 2590 | ||
2583 | ath10k_dbg(ATH10K_DBG_PCI, "pci remove\n"); | 2591 | ath10k_dbg(ar, ATH10K_DBG_PCI, "pci remove\n"); |
2584 | 2592 | ||
2585 | if (!ar) | 2593 | if (!ar) |
2586 | return; | 2594 | return; |
@@ -2615,7 +2623,8 @@ static int __init ath10k_pci_init(void) | |||
2615 | 2623 | ||
2616 | ret = pci_register_driver(&ath10k_pci_driver); | 2624 | ret = pci_register_driver(&ath10k_pci_driver); |
2617 | if (ret) | 2625 | if (ret) |
2618 | ath10k_err("failed to register PCI driver: %d\n", ret); | 2626 | printk(KERN_ERR "failed to register ath10k pci driver: %d\n", |
2627 | ret); | ||
2619 | 2628 | ||
2620 | return ret; | 2629 | return ret; |
2621 | } | 2630 | } |
diff --git a/drivers/net/wireless/ath/ath10k/spectral.c b/drivers/net/wireless/ath/ath10k/spectral.c index a53afc23864f..3e1454b74e00 100644 --- a/drivers/net/wireless/ath/ath10k/spectral.c +++ b/drivers/net/wireless/ath/ath10k/spectral.c | |||
@@ -237,7 +237,7 @@ static int ath10k_spectral_scan_config(struct ath10k *ar, | |||
237 | WMI_SPECTRAL_TRIGGER_CMD_CLEAR, | 237 | WMI_SPECTRAL_TRIGGER_CMD_CLEAR, |
238 | WMI_SPECTRAL_ENABLE_CMD_DISABLE); | 238 | WMI_SPECTRAL_ENABLE_CMD_DISABLE); |
239 | if (res < 0) { | 239 | if (res < 0) { |
240 | ath10k_warn("failed to enable spectral scan: %d\n", res); | 240 | ath10k_warn(ar, "failed to enable spectral scan: %d\n", res); |
241 | return res; | 241 | return res; |
242 | } | 242 | } |
243 | 243 | ||
@@ -271,7 +271,7 @@ static int ath10k_spectral_scan_config(struct ath10k *ar, | |||
271 | 271 | ||
272 | res = ath10k_wmi_vdev_spectral_conf(ar, &arg); | 272 | res = ath10k_wmi_vdev_spectral_conf(ar, &arg); |
273 | if (res < 0) { | 273 | if (res < 0) { |
274 | ath10k_warn("failed to configure spectral scan: %d\n", res); | 274 | ath10k_warn(ar, "failed to configure spectral scan: %d\n", res); |
275 | return res; | 275 | return res; |
276 | } | 276 | } |
277 | 277 | ||
@@ -332,12 +332,12 @@ static ssize_t write_file_spec_scan_ctl(struct file *file, | |||
332 | res = ath10k_spectral_scan_config(ar, | 332 | res = ath10k_spectral_scan_config(ar, |
333 | ar->spectral.mode); | 333 | ar->spectral.mode); |
334 | if (res < 0) { | 334 | if (res < 0) { |
335 | ath10k_warn("failed to reconfigure spectral scan: %d\n", | 335 | ath10k_warn(ar, "failed to reconfigure spectral scan: %d\n", |
336 | res); | 336 | res); |
337 | } | 337 | } |
338 | res = ath10k_spectral_scan_trigger(ar); | 338 | res = ath10k_spectral_scan_trigger(ar); |
339 | if (res < 0) { | 339 | if (res < 0) { |
340 | ath10k_warn("failed to trigger spectral scan: %d\n", | 340 | ath10k_warn(ar, "failed to trigger spectral scan: %d\n", |
341 | res); | 341 | res); |
342 | } | 342 | } |
343 | } else { | 343 | } else { |
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index f4fa22d1d591..2eeec8a63d5c 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c | |||
@@ -32,14 +32,14 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb) | |||
32 | * offchan_tx_skb. */ | 32 | * offchan_tx_skb. */ |
33 | spin_lock_bh(&ar->data_lock); | 33 | spin_lock_bh(&ar->data_lock); |
34 | if (ar->offchan_tx_skb != skb) { | 34 | if (ar->offchan_tx_skb != skb) { |
35 | ath10k_warn("completed old offchannel frame\n"); | 35 | ath10k_warn(ar, "completed old offchannel frame\n"); |
36 | goto out; | 36 | goto out; |
37 | } | 37 | } |
38 | 38 | ||
39 | complete(&ar->offchan_tx_completed); | 39 | complete(&ar->offchan_tx_completed); |
40 | ar->offchan_tx_skb = NULL; /* just for sanity */ | 40 | ar->offchan_tx_skb = NULL; /* just for sanity */ |
41 | 41 | ||
42 | ath10k_dbg(ATH10K_DBG_HTT, "completed offchannel skb %p\n", skb); | 42 | ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb %p\n", skb); |
43 | out: | 43 | out: |
44 | spin_unlock_bh(&ar->data_lock); | 44 | spin_unlock_bh(&ar->data_lock); |
45 | } | 45 | } |
@@ -47,18 +47,19 @@ out: | |||
47 | void ath10k_txrx_tx_unref(struct ath10k_htt *htt, | 47 | void ath10k_txrx_tx_unref(struct ath10k_htt *htt, |
48 | const struct htt_tx_done *tx_done) | 48 | const struct htt_tx_done *tx_done) |
49 | { | 49 | { |
50 | struct device *dev = htt->ar->dev; | 50 | struct ath10k *ar = htt->ar; |
51 | struct device *dev = ar->dev; | ||
51 | struct ieee80211_tx_info *info; | 52 | struct ieee80211_tx_info *info; |
52 | struct ath10k_skb_cb *skb_cb; | 53 | struct ath10k_skb_cb *skb_cb; |
53 | struct sk_buff *msdu; | 54 | struct sk_buff *msdu; |
54 | 55 | ||
55 | lockdep_assert_held(&htt->tx_lock); | 56 | lockdep_assert_held(&htt->tx_lock); |
56 | 57 | ||
57 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n", | 58 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n", |
58 | tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack); | 59 | tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack); |
59 | 60 | ||
60 | if (tx_done->msdu_id >= htt->max_num_pending_tx) { | 61 | if (tx_done->msdu_id >= htt->max_num_pending_tx) { |
61 | ath10k_warn("warning: msdu_id %d too big, ignoring\n", | 62 | ath10k_warn(ar, "warning: msdu_id %d too big, ignoring\n", |
62 | tx_done->msdu_id); | 63 | tx_done->msdu_id); |
63 | return; | 64 | return; |
64 | } | 65 | } |
@@ -182,7 +183,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt, | |||
182 | wake_up(&ar->peer_mapping_wq); | 183 | wake_up(&ar->peer_mapping_wq); |
183 | } | 184 | } |
184 | 185 | ||
185 | ath10k_dbg(ATH10K_DBG_HTT, "htt peer map vdev %d peer %pM id %d\n", | 186 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer map vdev %d peer %pM id %d\n", |
186 | ev->vdev_id, ev->addr, ev->peer_id); | 187 | ev->vdev_id, ev->addr, ev->peer_id); |
187 | 188 | ||
188 | set_bit(ev->peer_id, peer->peer_ids); | 189 | set_bit(ev->peer_id, peer->peer_ids); |
@@ -199,12 +200,12 @@ void ath10k_peer_unmap_event(struct ath10k_htt *htt, | |||
199 | spin_lock_bh(&ar->data_lock); | 200 | spin_lock_bh(&ar->data_lock); |
200 | peer = ath10k_peer_find_by_id(ar, ev->peer_id); | 201 | peer = ath10k_peer_find_by_id(ar, ev->peer_id); |
201 | if (!peer) { | 202 | if (!peer) { |
202 | ath10k_warn("peer-unmap-event: unknown peer id %d\n", | 203 | ath10k_warn(ar, "peer-unmap-event: unknown peer id %d\n", |
203 | ev->peer_id); | 204 | ev->peer_id); |
204 | goto exit; | 205 | goto exit; |
205 | } | 206 | } |
206 | 207 | ||
207 | ath10k_dbg(ATH10K_DBG_HTT, "htt peer unmap vdev %d peer %pM id %d\n", | 208 | ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer unmap vdev %d peer %pM id %d\n", |
208 | peer->vdev_id, peer->addr, ev->peer_id); | 209 | peer->vdev_id, peer->addr, ev->peer_id); |
209 | 210 | ||
210 | clear_bit(ev->peer_id, peer->peer_ids); | 211 | clear_bit(ev->peer_id, peer->peer_ids); |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index ec3bf4e00b4d..e500a3cc905e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -624,18 +624,18 @@ int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar) | |||
624 | return ret; | 624 | return ret; |
625 | } | 625 | } |
626 | 626 | ||
627 | static struct sk_buff *ath10k_wmi_alloc_skb(u32 len) | 627 | static struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len) |
628 | { | 628 | { |
629 | struct sk_buff *skb; | 629 | struct sk_buff *skb; |
630 | u32 round_len = roundup(len, 4); | 630 | u32 round_len = roundup(len, 4); |
631 | 631 | ||
632 | skb = ath10k_htc_alloc_skb(WMI_SKB_HEADROOM + round_len); | 632 | skb = ath10k_htc_alloc_skb(ar, WMI_SKB_HEADROOM + round_len); |
633 | if (!skb) | 633 | if (!skb) |
634 | return NULL; | 634 | return NULL; |
635 | 635 | ||
636 | skb_reserve(skb, WMI_SKB_HEADROOM); | 636 | skb_reserve(skb, WMI_SKB_HEADROOM); |
637 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) | 637 | if (!IS_ALIGNED((unsigned long)skb->data, 4)) |
638 | ath10k_warn("Unaligned WMI skb\n"); | 638 | ath10k_warn(ar, "Unaligned WMI skb\n"); |
639 | 639 | ||
640 | skb_put(skb, round_len); | 640 | skb_put(skb, round_len); |
641 | memset(skb->data, 0, round_len); | 641 | memset(skb->data, 0, round_len); |
@@ -733,7 +733,7 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, | |||
733 | might_sleep(); | 733 | might_sleep(); |
734 | 734 | ||
735 | if (cmd_id == WMI_CMD_UNSUPPORTED) { | 735 | if (cmd_id == WMI_CMD_UNSUPPORTED) { |
736 | ath10k_warn("wmi command %d is not supported by firmware\n", | 736 | ath10k_warn(ar, "wmi command %d is not supported by firmware\n", |
737 | cmd_id); | 737 | cmd_id); |
738 | return ret; | 738 | return ret; |
739 | } | 739 | } |
@@ -781,7 +781,7 @@ int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb) | |||
781 | 781 | ||
782 | len = round_up(len, 4); | 782 | len = round_up(len, 4); |
783 | 783 | ||
784 | wmi_skb = ath10k_wmi_alloc_skb(len); | 784 | wmi_skb = ath10k_wmi_alloc_skb(ar, len); |
785 | if (!wmi_skb) | 785 | if (!wmi_skb) |
786 | return -ENOMEM; | 786 | return -ENOMEM; |
787 | 787 | ||
@@ -795,7 +795,7 @@ int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb) | |||
795 | memcpy(cmd->hdr.peer_macaddr.addr, ieee80211_get_DA(hdr), ETH_ALEN); | 795 | memcpy(cmd->hdr.peer_macaddr.addr, ieee80211_get_DA(hdr), ETH_ALEN); |
796 | memcpy(cmd->buf, skb->data, skb->len); | 796 | memcpy(cmd->buf, skb->data, skb->len); |
797 | 797 | ||
798 | ath10k_dbg(ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d ftype %02x stype %02x\n", | 798 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d ftype %02x stype %02x\n", |
799 | wmi_skb, wmi_skb->len, fc & IEEE80211_FCTL_FTYPE, | 799 | wmi_skb, wmi_skb->len, fc & IEEE80211_FCTL_FTYPE, |
800 | fc & IEEE80211_FCTL_STYPE); | 800 | fc & IEEE80211_FCTL_STYPE); |
801 | 801 | ||
@@ -819,7 +819,7 @@ static void ath10k_wmi_event_scan_started(struct ath10k *ar) | |||
819 | case ATH10K_SCAN_IDLE: | 819 | case ATH10K_SCAN_IDLE: |
820 | case ATH10K_SCAN_RUNNING: | 820 | case ATH10K_SCAN_RUNNING: |
821 | case ATH10K_SCAN_ABORTING: | 821 | case ATH10K_SCAN_ABORTING: |
822 | ath10k_warn("received scan started event in an invalid scan state: %s (%d)\n", | 822 | ath10k_warn(ar, "received scan started event in an invalid scan state: %s (%d)\n", |
823 | ath10k_scan_state_str(ar->scan.state), | 823 | ath10k_scan_state_str(ar->scan.state), |
824 | ar->scan.state); | 824 | ar->scan.state); |
825 | break; | 825 | break; |
@@ -849,7 +849,7 @@ static void ath10k_wmi_event_scan_completed(struct ath10k *ar) | |||
849 | * is) ignored by the host as it may be just firmware's scan | 849 | * is) ignored by the host as it may be just firmware's scan |
850 | * state machine recovering. | 850 | * state machine recovering. |
851 | */ | 851 | */ |
852 | ath10k_warn("received scan completed event in an invalid scan state: %s (%d)\n", | 852 | ath10k_warn(ar, "received scan completed event in an invalid scan state: %s (%d)\n", |
853 | ath10k_scan_state_str(ar->scan.state), | 853 | ath10k_scan_state_str(ar->scan.state), |
854 | ar->scan.state); | 854 | ar->scan.state); |
855 | break; | 855 | break; |
@@ -867,7 +867,7 @@ static void ath10k_wmi_event_scan_bss_chan(struct ath10k *ar) | |||
867 | switch (ar->scan.state) { | 867 | switch (ar->scan.state) { |
868 | case ATH10K_SCAN_IDLE: | 868 | case ATH10K_SCAN_IDLE: |
869 | case ATH10K_SCAN_STARTING: | 869 | case ATH10K_SCAN_STARTING: |
870 | ath10k_warn("received scan bss chan event in an invalid scan state: %s (%d)\n", | 870 | ath10k_warn(ar, "received scan bss chan event in an invalid scan state: %s (%d)\n", |
871 | ath10k_scan_state_str(ar->scan.state), | 871 | ath10k_scan_state_str(ar->scan.state), |
872 | ar->scan.state); | 872 | ar->scan.state); |
873 | break; | 873 | break; |
@@ -885,7 +885,7 @@ static void ath10k_wmi_event_scan_foreign_chan(struct ath10k *ar, u32 freq) | |||
885 | switch (ar->scan.state) { | 885 | switch (ar->scan.state) { |
886 | case ATH10K_SCAN_IDLE: | 886 | case ATH10K_SCAN_IDLE: |
887 | case ATH10K_SCAN_STARTING: | 887 | case ATH10K_SCAN_STARTING: |
888 | ath10k_warn("received scan foreign chan event in an invalid scan state: %s (%d)\n", | 888 | ath10k_warn(ar, "received scan foreign chan event in an invalid scan state: %s (%d)\n", |
889 | ath10k_scan_state_str(ar->scan.state), | 889 | ath10k_scan_state_str(ar->scan.state), |
890 | ar->scan.state); | 890 | ar->scan.state); |
891 | break; | 891 | break; |
@@ -954,7 +954,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb) | |||
954 | 954 | ||
955 | spin_lock_bh(&ar->data_lock); | 955 | spin_lock_bh(&ar->data_lock); |
956 | 956 | ||
957 | ath10k_dbg(ATH10K_DBG_WMI, | 957 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
958 | "scan event %s type %d reason %d freq %d req_id %d scan_id %d vdev_id %d state %s (%d)\n", | 958 | "scan event %s type %d reason %d freq %d req_id %d scan_id %d vdev_id %d state %s (%d)\n", |
959 | ath10k_wmi_event_scan_type_str(event_type, reason), | 959 | ath10k_wmi_event_scan_type_str(event_type, reason), |
960 | event_type, reason, freq, req_id, scan_id, vdev_id, | 960 | event_type, reason, freq, req_id, scan_id, vdev_id, |
@@ -974,7 +974,7 @@ static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb) | |||
974 | ath10k_wmi_event_scan_foreign_chan(ar, freq); | 974 | ath10k_wmi_event_scan_foreign_chan(ar, freq); |
975 | break; | 975 | break; |
976 | case WMI_SCAN_EVENT_START_FAILED: | 976 | case WMI_SCAN_EVENT_START_FAILED: |
977 | ath10k_warn("received scan start failure event\n"); | 977 | ath10k_warn(ar, "received scan start failure event\n"); |
978 | break; | 978 | break; |
979 | case WMI_SCAN_EVENT_DEQUEUED: | 979 | case WMI_SCAN_EVENT_DEQUEUED: |
980 | case WMI_SCAN_EVENT_PREEMPTED: | 980 | case WMI_SCAN_EVENT_PREEMPTED: |
@@ -1107,7 +1107,7 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) | |||
1107 | 1107 | ||
1108 | memset(status, 0, sizeof(*status)); | 1108 | memset(status, 0, sizeof(*status)); |
1109 | 1109 | ||
1110 | ath10k_dbg(ATH10K_DBG_MGMT, | 1110 | ath10k_dbg(ar, ATH10K_DBG_MGMT, |
1111 | "event mgmt rx status %08x\n", rx_status); | 1111 | "event mgmt rx status %08x\n", rx_status); |
1112 | 1112 | ||
1113 | if (test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) { | 1113 | if (test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) { |
@@ -1143,9 +1143,9 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) | |||
1143 | 1143 | ||
1144 | if (phy_mode == MODE_11B && | 1144 | if (phy_mode == MODE_11B && |
1145 | status->band == IEEE80211_BAND_5GHZ) | 1145 | status->band == IEEE80211_BAND_5GHZ) |
1146 | ath10k_dbg(ATH10K_DBG_MGMT, "wmi mgmt rx 11b (CCK) on 5GHz\n"); | 1146 | ath10k_dbg(ar, ATH10K_DBG_MGMT, "wmi mgmt rx 11b (CCK) on 5GHz\n"); |
1147 | } else { | 1147 | } else { |
1148 | ath10k_warn("using (unreliable) phy_mode to extract band for mgmt rx\n"); | 1148 | ath10k_warn(ar, "using (unreliable) phy_mode to extract band for mgmt rx\n"); |
1149 | status->band = phy_mode_to_band(phy_mode); | 1149 | status->band = phy_mode_to_band(phy_mode); |
1150 | } | 1150 | } |
1151 | 1151 | ||
@@ -1175,12 +1175,12 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) | |||
1175 | } | 1175 | } |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | ath10k_dbg(ATH10K_DBG_MGMT, | 1178 | ath10k_dbg(ar, ATH10K_DBG_MGMT, |
1179 | "event mgmt rx skb %p len %d ftype %02x stype %02x\n", | 1179 | "event mgmt rx skb %p len %d ftype %02x stype %02x\n", |
1180 | skb, skb->len, | 1180 | skb, skb->len, |
1181 | fc & IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE); | 1181 | fc & IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE); |
1182 | 1182 | ||
1183 | ath10k_dbg(ATH10K_DBG_MGMT, | 1183 | ath10k_dbg(ar, ATH10K_DBG_MGMT, |
1184 | "event mgmt rx freq %d band %d snr %d, rate_idx %d\n", | 1184 | "event mgmt rx freq %d band %d snr %d, rate_idx %d\n", |
1185 | status->freq, status->band, status->signal, | 1185 | status->freq, status->band, status->signal, |
1186 | status->rate_idx); | 1186 | status->rate_idx); |
@@ -1230,7 +1230,7 @@ static void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb) | |||
1230 | rx_clear_count = __le32_to_cpu(ev->rx_clear_count); | 1230 | rx_clear_count = __le32_to_cpu(ev->rx_clear_count); |
1231 | cycle_count = __le32_to_cpu(ev->cycle_count); | 1231 | cycle_count = __le32_to_cpu(ev->cycle_count); |
1232 | 1232 | ||
1233 | ath10k_dbg(ATH10K_DBG_WMI, | 1233 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
1234 | "chan info err_code %d freq %d cmd_flags %d noise_floor %d rx_clear_count %d cycle_count %d\n", | 1234 | "chan info err_code %d freq %d cmd_flags %d noise_floor %d rx_clear_count %d cycle_count %d\n", |
1235 | err_code, freq, cmd_flags, noise_floor, rx_clear_count, | 1235 | err_code, freq, cmd_flags, noise_floor, rx_clear_count, |
1236 | cycle_count); | 1236 | cycle_count); |
@@ -1240,7 +1240,7 @@ static void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb) | |||
1240 | switch (ar->scan.state) { | 1240 | switch (ar->scan.state) { |
1241 | case ATH10K_SCAN_IDLE: | 1241 | case ATH10K_SCAN_IDLE: |
1242 | case ATH10K_SCAN_STARTING: | 1242 | case ATH10K_SCAN_STARTING: |
1243 | ath10k_warn("received chan info event without a scan request, ignoring\n"); | 1243 | ath10k_warn(ar, "received chan info event without a scan request, ignoring\n"); |
1244 | goto exit; | 1244 | goto exit; |
1245 | case ATH10K_SCAN_RUNNING: | 1245 | case ATH10K_SCAN_RUNNING: |
1246 | case ATH10K_SCAN_ABORTING: | 1246 | case ATH10K_SCAN_ABORTING: |
@@ -1249,7 +1249,7 @@ static void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb) | |||
1249 | 1249 | ||
1250 | idx = freq_to_idx(ar, freq); | 1250 | idx = freq_to_idx(ar, freq); |
1251 | if (idx >= ARRAY_SIZE(ar->survey)) { | 1251 | if (idx >= ARRAY_SIZE(ar->survey)) { |
1252 | ath10k_warn("chan info: invalid frequency %d (idx %d out of bounds)\n", | 1252 | ath10k_warn(ar, "chan info: invalid frequency %d (idx %d out of bounds)\n", |
1253 | freq, idx); | 1253 | freq, idx); |
1254 | goto exit; | 1254 | goto exit; |
1255 | } | 1255 | } |
@@ -1280,12 +1280,12 @@ exit: | |||
1280 | 1280 | ||
1281 | static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb) | 1281 | static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb) |
1282 | { | 1282 | { |
1283 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_ECHO_EVENTID\n"); | 1283 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_ECHO_EVENTID\n"); |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb) | 1286 | static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb) |
1287 | { | 1287 | { |
1288 | ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug mesg len %d\n", | 1288 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event debug mesg len %d\n", |
1289 | skb->len); | 1289 | skb->len); |
1290 | 1290 | ||
1291 | trace_ath10k_wmi_dbglog(skb->data, skb->len); | 1291 | trace_ath10k_wmi_dbglog(skb->data, skb->len); |
@@ -1298,7 +1298,7 @@ static void ath10k_wmi_event_update_stats(struct ath10k *ar, | |||
1298 | { | 1298 | { |
1299 | struct wmi_stats_event *ev = (struct wmi_stats_event *)skb->data; | 1299 | struct wmi_stats_event *ev = (struct wmi_stats_event *)skb->data; |
1300 | 1300 | ||
1301 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_UPDATE_STATS_EVENTID\n"); | 1301 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_UPDATE_STATS_EVENTID\n"); |
1302 | 1302 | ||
1303 | ath10k_debug_read_target_stats(ar, ev); | 1303 | ath10k_debug_read_target_stats(ar, ev); |
1304 | } | 1304 | } |
@@ -1308,7 +1308,7 @@ static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, | |||
1308 | { | 1308 | { |
1309 | struct wmi_vdev_start_response_event *ev; | 1309 | struct wmi_vdev_start_response_event *ev; |
1310 | 1310 | ||
1311 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_START_RESP_EVENTID\n"); | 1311 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_START_RESP_EVENTID\n"); |
1312 | 1312 | ||
1313 | ev = (struct wmi_vdev_start_response_event *)skb->data; | 1313 | ev = (struct wmi_vdev_start_response_event *)skb->data; |
1314 | 1314 | ||
@@ -1321,7 +1321,7 @@ static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, | |||
1321 | static void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, | 1321 | static void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, |
1322 | struct sk_buff *skb) | 1322 | struct sk_buff *skb) |
1323 | { | 1323 | { |
1324 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_STOPPED_EVENTID\n"); | 1324 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_STOPPED_EVENTID\n"); |
1325 | complete(&ar->vdev_setup_done); | 1325 | complete(&ar->vdev_setup_done); |
1326 | } | 1326 | } |
1327 | 1327 | ||
@@ -1333,14 +1333,14 @@ static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, | |||
1333 | 1333 | ||
1334 | ev = (struct wmi_peer_sta_kickout_event *)skb->data; | 1334 | ev = (struct wmi_peer_sta_kickout_event *)skb->data; |
1335 | 1335 | ||
1336 | ath10k_dbg(ATH10K_DBG_WMI, "wmi event peer sta kickout %pM\n", | 1336 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event peer sta kickout %pM\n", |
1337 | ev->peer_macaddr.addr); | 1337 | ev->peer_macaddr.addr); |
1338 | 1338 | ||
1339 | rcu_read_lock(); | 1339 | rcu_read_lock(); |
1340 | 1340 | ||
1341 | sta = ieee80211_find_sta_by_ifaddr(ar->hw, ev->peer_macaddr.addr, NULL); | 1341 | sta = ieee80211_find_sta_by_ifaddr(ar->hw, ev->peer_macaddr.addr, NULL); |
1342 | if (!sta) { | 1342 | if (!sta) { |
1343 | ath10k_warn("Spurious quick kickout for STA %pM\n", | 1343 | ath10k_warn(ar, "Spurious quick kickout for STA %pM\n", |
1344 | ev->peer_macaddr.addr); | 1344 | ev->peer_macaddr.addr); |
1345 | goto exit; | 1345 | goto exit; |
1346 | } | 1346 | } |
@@ -1417,7 +1417,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, | |||
1417 | (u8 *)skb_tail_pointer(bcn) - ies); | 1417 | (u8 *)skb_tail_pointer(bcn) - ies); |
1418 | if (!ie) { | 1418 | if (!ie) { |
1419 | if (arvif->vdev_type != WMI_VDEV_TYPE_IBSS) | 1419 | if (arvif->vdev_type != WMI_VDEV_TYPE_IBSS) |
1420 | ath10k_warn("no tim ie found;\n"); | 1420 | ath10k_warn(ar, "no tim ie found;\n"); |
1421 | return; | 1421 | return; |
1422 | } | 1422 | } |
1423 | 1423 | ||
@@ -1437,12 +1437,12 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, | |||
1437 | ie_len += expand_size; | 1437 | ie_len += expand_size; |
1438 | pvm_len += expand_size; | 1438 | pvm_len += expand_size; |
1439 | } else { | 1439 | } else { |
1440 | ath10k_warn("tim expansion failed\n"); | 1440 | ath10k_warn(ar, "tim expansion failed\n"); |
1441 | } | 1441 | } |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | if (pvm_len > sizeof(arvif->u.ap.tim_bitmap)) { | 1444 | if (pvm_len > sizeof(arvif->u.ap.tim_bitmap)) { |
1445 | ath10k_warn("tim pvm length is too great (%d)\n", pvm_len); | 1445 | ath10k_warn(ar, "tim pvm length is too great (%d)\n", pvm_len); |
1446 | return; | 1446 | return; |
1447 | } | 1447 | } |
1448 | 1448 | ||
@@ -1456,7 +1456,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, | |||
1456 | ATH10K_SKB_CB(bcn)->bcn.deliver_cab = true; | 1456 | ATH10K_SKB_CB(bcn)->bcn.deliver_cab = true; |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | ath10k_dbg(ATH10K_DBG_MGMT, "dtim %d/%d mcast %d pvmlen %d\n", | 1459 | ath10k_dbg(ar, ATH10K_DBG_MGMT, "dtim %d/%d mcast %d pvmlen %d\n", |
1460 | tim->dtim_count, tim->dtim_period, | 1460 | tim->dtim_count, tim->dtim_period, |
1461 | tim->bitmap_ctrl, pvm_len); | 1461 | tim->bitmap_ctrl, pvm_len); |
1462 | } | 1462 | } |
@@ -1534,7 +1534,7 @@ static void ath10k_wmi_update_noa(struct ath10k *ar, struct ath10k_vif *arvif, | |||
1534 | if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO) | 1534 | if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO) |
1535 | return; | 1535 | return; |
1536 | 1536 | ||
1537 | ath10k_dbg(ATH10K_DBG_MGMT, "noa changed: %d\n", noa->changed); | 1537 | ath10k_dbg(ar, ATH10K_DBG_MGMT, "noa changed: %d\n", noa->changed); |
1538 | if (noa->changed & WMI_P2P_NOA_CHANGED_BIT) { | 1538 | if (noa->changed & WMI_P2P_NOA_CHANGED_BIT) { |
1539 | new_len = ath10k_p2p_calc_noa_ie_len(noa); | 1539 | new_len = ath10k_p2p_calc_noa_ie_len(noa); |
1540 | if (!new_len) | 1540 | if (!new_len) |
@@ -1582,7 +1582,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1582 | ev = (struct wmi_host_swba_event *)skb->data; | 1582 | ev = (struct wmi_host_swba_event *)skb->data; |
1583 | map = __le32_to_cpu(ev->vdev_map); | 1583 | map = __le32_to_cpu(ev->vdev_map); |
1584 | 1584 | ||
1585 | ath10k_dbg(ATH10K_DBG_MGMT, "mgmt swba vdev_map 0x%x\n", | 1585 | ath10k_dbg(ar, ATH10K_DBG_MGMT, "mgmt swba vdev_map 0x%x\n", |
1586 | ev->vdev_map); | 1586 | ev->vdev_map); |
1587 | 1587 | ||
1588 | for (; map; map >>= 1, vdev_id++) { | 1588 | for (; map; map >>= 1, vdev_id++) { |
@@ -1592,13 +1592,13 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1592 | i++; | 1592 | i++; |
1593 | 1593 | ||
1594 | if (i >= WMI_MAX_AP_VDEV) { | 1594 | if (i >= WMI_MAX_AP_VDEV) { |
1595 | ath10k_warn("swba has corrupted vdev map\n"); | 1595 | ath10k_warn(ar, "swba has corrupted vdev map\n"); |
1596 | break; | 1596 | break; |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | bcn_info = &ev->bcn_info[i]; | 1599 | bcn_info = &ev->bcn_info[i]; |
1600 | 1600 | ||
1601 | ath10k_dbg(ATH10K_DBG_MGMT, | 1601 | ath10k_dbg(ar, ATH10K_DBG_MGMT, |
1602 | "mgmt event bcn_info %d tim_len %d mcast %d changed %d num_ps_pending %d bitmap 0x%08x%08x%08x%08x\n", | 1602 | "mgmt event bcn_info %d tim_len %d mcast %d changed %d num_ps_pending %d bitmap 0x%08x%08x%08x%08x\n", |
1603 | i, | 1603 | i, |
1604 | __le32_to_cpu(bcn_info->tim_info.tim_len), | 1604 | __le32_to_cpu(bcn_info->tim_info.tim_len), |
@@ -1612,7 +1612,8 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1612 | 1612 | ||
1613 | arvif = ath10k_get_arvif(ar, vdev_id); | 1613 | arvif = ath10k_get_arvif(ar, vdev_id); |
1614 | if (arvif == NULL) { | 1614 | if (arvif == NULL) { |
1615 | ath10k_warn("no vif for vdev_id %d found\n", vdev_id); | 1615 | ath10k_warn(ar, "no vif for vdev_id %d found\n", |
1616 | vdev_id); | ||
1616 | continue; | 1617 | continue; |
1617 | } | 1618 | } |
1618 | 1619 | ||
@@ -1629,7 +1630,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1629 | 1630 | ||
1630 | bcn = ieee80211_beacon_get(ar->hw, arvif->vif); | 1631 | bcn = ieee80211_beacon_get(ar->hw, arvif->vif); |
1631 | if (!bcn) { | 1632 | if (!bcn) { |
1632 | ath10k_warn("could not get mac80211 beacon\n"); | 1633 | ath10k_warn(ar, "could not get mac80211 beacon\n"); |
1633 | continue; | 1634 | continue; |
1634 | } | 1635 | } |
1635 | 1636 | ||
@@ -1641,7 +1642,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1641 | 1642 | ||
1642 | if (arvif->beacon) { | 1643 | if (arvif->beacon) { |
1643 | if (!arvif->beacon_sent) | 1644 | if (!arvif->beacon_sent) |
1644 | ath10k_warn("SWBA overrun on vdev %d\n", | 1645 | ath10k_warn(ar, "SWBA overrun on vdev %d\n", |
1645 | arvif->vdev_id); | 1646 | arvif->vdev_id); |
1646 | 1647 | ||
1647 | dma_unmap_single(arvif->ar->dev, | 1648 | dma_unmap_single(arvif->ar->dev, |
@@ -1657,7 +1658,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1657 | ret = dma_mapping_error(arvif->ar->dev, | 1658 | ret = dma_mapping_error(arvif->ar->dev, |
1658 | ATH10K_SKB_CB(bcn)->paddr); | 1659 | ATH10K_SKB_CB(bcn)->paddr); |
1659 | if (ret) { | 1660 | if (ret) { |
1660 | ath10k_warn("failed to map beacon: %d\n", ret); | 1661 | ath10k_warn(ar, "failed to map beacon: %d\n", ret); |
1661 | dev_kfree_skb_any(bcn); | 1662 | dev_kfree_skb_any(bcn); |
1662 | goto skip; | 1663 | goto skip; |
1663 | } | 1664 | } |
@@ -1674,7 +1675,7 @@ skip: | |||
1674 | static void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, | 1675 | static void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, |
1675 | struct sk_buff *skb) | 1676 | struct sk_buff *skb) |
1676 | { | 1677 | { |
1677 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_TBTTOFFSET_UPDATE_EVENTID\n"); | 1678 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TBTTOFFSET_UPDATE_EVENTID\n"); |
1678 | } | 1679 | } |
1679 | 1680 | ||
1680 | static void ath10k_dfs_radar_report(struct ath10k *ar, | 1681 | static void ath10k_dfs_radar_report(struct ath10k *ar, |
@@ -1690,20 +1691,20 @@ static void ath10k_dfs_radar_report(struct ath10k *ar, | |||
1690 | reg0 = __le32_to_cpu(rr->reg0); | 1691 | reg0 = __le32_to_cpu(rr->reg0); |
1691 | reg1 = __le32_to_cpu(rr->reg1); | 1692 | reg1 = __le32_to_cpu(rr->reg1); |
1692 | 1693 | ||
1693 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1694 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1694 | "wmi phyerr radar report chirp %d max_width %d agc_total_gain %d pulse_delta_diff %d\n", | 1695 | "wmi phyerr radar report chirp %d max_width %d agc_total_gain %d pulse_delta_diff %d\n", |
1695 | MS(reg0, RADAR_REPORT_REG0_PULSE_IS_CHIRP), | 1696 | MS(reg0, RADAR_REPORT_REG0_PULSE_IS_CHIRP), |
1696 | MS(reg0, RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH), | 1697 | MS(reg0, RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH), |
1697 | MS(reg0, RADAR_REPORT_REG0_AGC_TOTAL_GAIN), | 1698 | MS(reg0, RADAR_REPORT_REG0_AGC_TOTAL_GAIN), |
1698 | MS(reg0, RADAR_REPORT_REG0_PULSE_DELTA_DIFF)); | 1699 | MS(reg0, RADAR_REPORT_REG0_PULSE_DELTA_DIFF)); |
1699 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1700 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1700 | "wmi phyerr radar report pulse_delta_pean %d pulse_sidx %d fft_valid %d agc_mb_gain %d subchan_mask %d\n", | 1701 | "wmi phyerr radar report pulse_delta_pean %d pulse_sidx %d fft_valid %d agc_mb_gain %d subchan_mask %d\n", |
1701 | MS(reg0, RADAR_REPORT_REG0_PULSE_DELTA_PEAK), | 1702 | MS(reg0, RADAR_REPORT_REG0_PULSE_DELTA_PEAK), |
1702 | MS(reg0, RADAR_REPORT_REG0_PULSE_SIDX), | 1703 | MS(reg0, RADAR_REPORT_REG0_PULSE_SIDX), |
1703 | MS(reg1, RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID), | 1704 | MS(reg1, RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID), |
1704 | MS(reg1, RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN), | 1705 | MS(reg1, RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN), |
1705 | MS(reg1, RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK)); | 1706 | MS(reg1, RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK)); |
1706 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1707 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1707 | "wmi phyerr radar report pulse_tsf_offset 0x%X pulse_dur: %d\n", | 1708 | "wmi phyerr radar report pulse_tsf_offset 0x%X pulse_dur: %d\n", |
1708 | MS(reg1, RADAR_REPORT_REG1_PULSE_TSF_OFFSET), | 1709 | MS(reg1, RADAR_REPORT_REG1_PULSE_TSF_OFFSET), |
1709 | MS(reg1, RADAR_REPORT_REG1_PULSE_DUR)); | 1710 | MS(reg1, RADAR_REPORT_REG1_PULSE_DUR)); |
@@ -1730,25 +1731,25 @@ static void ath10k_dfs_radar_report(struct ath10k *ar, | |||
1730 | pe.width = width; | 1731 | pe.width = width; |
1731 | pe.rssi = rssi; | 1732 | pe.rssi = rssi; |
1732 | 1733 | ||
1733 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1734 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1734 | "dfs add pulse freq: %d, width: %d, rssi %d, tsf: %llX\n", | 1735 | "dfs add pulse freq: %d, width: %d, rssi %d, tsf: %llX\n", |
1735 | pe.freq, pe.width, pe.rssi, pe.ts); | 1736 | pe.freq, pe.width, pe.rssi, pe.ts); |
1736 | 1737 | ||
1737 | ATH10K_DFS_STAT_INC(ar, pulses_detected); | 1738 | ATH10K_DFS_STAT_INC(ar, pulses_detected); |
1738 | 1739 | ||
1739 | if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) { | 1740 | if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) { |
1740 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1741 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1741 | "dfs no pulse pattern detected, yet\n"); | 1742 | "dfs no pulse pattern detected, yet\n"); |
1742 | return; | 1743 | return; |
1743 | } | 1744 | } |
1744 | 1745 | ||
1745 | ath10k_dbg(ATH10K_DBG_REGULATORY, "dfs radar detected\n"); | 1746 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs radar detected\n"); |
1746 | ATH10K_DFS_STAT_INC(ar, radar_detected); | 1747 | ATH10K_DFS_STAT_INC(ar, radar_detected); |
1747 | 1748 | ||
1748 | /* Control radar events reporting in debugfs file | 1749 | /* Control radar events reporting in debugfs file |
1749 | dfs_block_radar_events */ | 1750 | dfs_block_radar_events */ |
1750 | if (ar->dfs_block_radar_events) { | 1751 | if (ar->dfs_block_radar_events) { |
1751 | ath10k_info("DFS Radar detected, but ignored as requested\n"); | 1752 | ath10k_info(ar, "DFS Radar detected, but ignored as requested\n"); |
1752 | return; | 1753 | return; |
1753 | } | 1754 | } |
1754 | 1755 | ||
@@ -1767,13 +1768,13 @@ static int ath10k_dfs_fft_report(struct ath10k *ar, | |||
1767 | reg1 = __le32_to_cpu(fftr->reg1); | 1768 | reg1 = __le32_to_cpu(fftr->reg1); |
1768 | rssi = event->hdr.rssi_combined; | 1769 | rssi = event->hdr.rssi_combined; |
1769 | 1770 | ||
1770 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1771 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1771 | "wmi phyerr fft report total_gain_db %d base_pwr_db %d fft_chn_idx %d peak_sidx %d\n", | 1772 | "wmi phyerr fft report total_gain_db %d base_pwr_db %d fft_chn_idx %d peak_sidx %d\n", |
1772 | MS(reg0, SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB), | 1773 | MS(reg0, SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB), |
1773 | MS(reg0, SEARCH_FFT_REPORT_REG0_BASE_PWR_DB), | 1774 | MS(reg0, SEARCH_FFT_REPORT_REG0_BASE_PWR_DB), |
1774 | MS(reg0, SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX), | 1775 | MS(reg0, SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX), |
1775 | MS(reg0, SEARCH_FFT_REPORT_REG0_PEAK_SIDX)); | 1776 | MS(reg0, SEARCH_FFT_REPORT_REG0_PEAK_SIDX)); |
1776 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1777 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1777 | "wmi phyerr fft report rel_pwr_db %d avgpwr_db %d peak_mag %d num_store_bin %d\n", | 1778 | "wmi phyerr fft report rel_pwr_db %d avgpwr_db %d peak_mag %d num_store_bin %d\n", |
1778 | MS(reg1, SEARCH_FFT_REPORT_REG1_RELPWR_DB), | 1779 | MS(reg1, SEARCH_FFT_REPORT_REG1_RELPWR_DB), |
1779 | MS(reg1, SEARCH_FFT_REPORT_REG1_AVGPWR_DB), | 1780 | MS(reg1, SEARCH_FFT_REPORT_REG1_AVGPWR_DB), |
@@ -1785,7 +1786,7 @@ static int ath10k_dfs_fft_report(struct ath10k *ar, | |||
1785 | /* false event detection */ | 1786 | /* false event detection */ |
1786 | if (rssi == DFS_RSSI_POSSIBLY_FALSE && | 1787 | if (rssi == DFS_RSSI_POSSIBLY_FALSE && |
1787 | peak_mag < 2 * DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE) { | 1788 | peak_mag < 2 * DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE) { |
1788 | ath10k_dbg(ATH10K_DBG_REGULATORY, "dfs false pulse detected\n"); | 1789 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs false pulse detected\n"); |
1789 | ATH10K_DFS_STAT_INC(ar, pulses_discarded); | 1790 | ATH10K_DFS_STAT_INC(ar, pulses_discarded); |
1790 | return -EINVAL; | 1791 | return -EINVAL; |
1791 | } | 1792 | } |
@@ -1804,7 +1805,7 @@ static void ath10k_wmi_event_dfs(struct ath10k *ar, | |||
1804 | u8 *tlv_buf; | 1805 | u8 *tlv_buf; |
1805 | 1806 | ||
1806 | buf_len = __le32_to_cpu(event->hdr.buf_len); | 1807 | buf_len = __le32_to_cpu(event->hdr.buf_len); |
1807 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1808 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1808 | "wmi event dfs err_code %d rssi %d tsfl 0x%X tsf64 0x%llX len %d\n", | 1809 | "wmi event dfs err_code %d rssi %d tsfl 0x%X tsf64 0x%llX len %d\n", |
1809 | event->hdr.phy_err_code, event->hdr.rssi_combined, | 1810 | event->hdr.phy_err_code, event->hdr.rssi_combined, |
1810 | __le32_to_cpu(event->hdr.tsf_timestamp), tsf, buf_len); | 1811 | __le32_to_cpu(event->hdr.tsf_timestamp), tsf, buf_len); |
@@ -1817,21 +1818,22 @@ static void ath10k_wmi_event_dfs(struct ath10k *ar, | |||
1817 | 1818 | ||
1818 | while (i < buf_len) { | 1819 | while (i < buf_len) { |
1819 | if (i + sizeof(*tlv) > buf_len) { | 1820 | if (i + sizeof(*tlv) > buf_len) { |
1820 | ath10k_warn("too short buf for tlv header (%d)\n", i); | 1821 | ath10k_warn(ar, "too short buf for tlv header (%d)\n", |
1822 | i); | ||
1821 | return; | 1823 | return; |
1822 | } | 1824 | } |
1823 | 1825 | ||
1824 | tlv = (struct phyerr_tlv *)&event->bufp[i]; | 1826 | tlv = (struct phyerr_tlv *)&event->bufp[i]; |
1825 | tlv_len = __le16_to_cpu(tlv->len); | 1827 | tlv_len = __le16_to_cpu(tlv->len); |
1826 | tlv_buf = &event->bufp[i + sizeof(*tlv)]; | 1828 | tlv_buf = &event->bufp[i + sizeof(*tlv)]; |
1827 | ath10k_dbg(ATH10K_DBG_REGULATORY, | 1829 | ath10k_dbg(ar, ATH10K_DBG_REGULATORY, |
1828 | "wmi event dfs tlv_len %d tlv_tag 0x%02X tlv_sig 0x%02X\n", | 1830 | "wmi event dfs tlv_len %d tlv_tag 0x%02X tlv_sig 0x%02X\n", |
1829 | tlv_len, tlv->tag, tlv->sig); | 1831 | tlv_len, tlv->tag, tlv->sig); |
1830 | 1832 | ||
1831 | switch (tlv->tag) { | 1833 | switch (tlv->tag) { |
1832 | case PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY: | 1834 | case PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY: |
1833 | if (i + sizeof(*tlv) + sizeof(*rr) > buf_len) { | 1835 | if (i + sizeof(*tlv) + sizeof(*rr) > buf_len) { |
1834 | ath10k_warn("too short radar pulse summary (%d)\n", | 1836 | ath10k_warn(ar, "too short radar pulse summary (%d)\n", |
1835 | i); | 1837 | i); |
1836 | return; | 1838 | return; |
1837 | } | 1839 | } |
@@ -1841,7 +1843,8 @@ static void ath10k_wmi_event_dfs(struct ath10k *ar, | |||
1841 | break; | 1843 | break; |
1842 | case PHYERR_TLV_TAG_SEARCH_FFT_REPORT: | 1844 | case PHYERR_TLV_TAG_SEARCH_FFT_REPORT: |
1843 | if (i + sizeof(*tlv) + sizeof(*fftr) > buf_len) { | 1845 | if (i + sizeof(*tlv) + sizeof(*fftr) > buf_len) { |
1844 | ath10k_warn("too short fft report (%d)\n", i); | 1846 | ath10k_warn(ar, "too short fft report (%d)\n", |
1847 | i); | ||
1845 | return; | 1848 | return; |
1846 | } | 1849 | } |
1847 | 1850 | ||
@@ -1870,7 +1873,7 @@ static void ath10k_wmi_event_spectral_scan(struct ath10k *ar, | |||
1870 | 1873 | ||
1871 | while (i < buf_len) { | 1874 | while (i < buf_len) { |
1872 | if (i + sizeof(*tlv) > buf_len) { | 1875 | if (i + sizeof(*tlv) > buf_len) { |
1873 | ath10k_warn("failed to parse phyerr tlv header at byte %d\n", | 1876 | ath10k_warn(ar, "failed to parse phyerr tlv header at byte %d\n", |
1874 | i); | 1877 | i); |
1875 | return; | 1878 | return; |
1876 | } | 1879 | } |
@@ -1880,7 +1883,7 @@ static void ath10k_wmi_event_spectral_scan(struct ath10k *ar, | |||
1880 | tlv_buf = &event->bufp[i + sizeof(*tlv)]; | 1883 | tlv_buf = &event->bufp[i + sizeof(*tlv)]; |
1881 | 1884 | ||
1882 | if (i + sizeof(*tlv) + tlv_len > buf_len) { | 1885 | if (i + sizeof(*tlv) + tlv_len > buf_len) { |
1883 | ath10k_warn("failed to parse phyerr tlv payload at byte %d\n", | 1886 | ath10k_warn(ar, "failed to parse phyerr tlv payload at byte %d\n", |
1884 | i); | 1887 | i); |
1885 | return; | 1888 | return; |
1886 | } | 1889 | } |
@@ -1888,7 +1891,7 @@ static void ath10k_wmi_event_spectral_scan(struct ath10k *ar, | |||
1888 | switch (tlv->tag) { | 1891 | switch (tlv->tag) { |
1889 | case PHYERR_TLV_TAG_SEARCH_FFT_REPORT: | 1892 | case PHYERR_TLV_TAG_SEARCH_FFT_REPORT: |
1890 | if (sizeof(*fftr) > tlv_len) { | 1893 | if (sizeof(*fftr) > tlv_len) { |
1891 | ath10k_warn("failed to parse fft report at byte %d\n", | 1894 | ath10k_warn(ar, "failed to parse fft report at byte %d\n", |
1892 | i); | 1895 | i); |
1893 | return; | 1896 | return; |
1894 | } | 1897 | } |
@@ -1899,7 +1902,7 @@ static void ath10k_wmi_event_spectral_scan(struct ath10k *ar, | |||
1899 | fftr, fftr_len, | 1902 | fftr, fftr_len, |
1900 | tsf); | 1903 | tsf); |
1901 | if (res < 0) { | 1904 | if (res < 0) { |
1902 | ath10k_warn("failed to process fft report: %d\n", | 1905 | ath10k_warn(ar, "failed to process fft report: %d\n", |
1903 | res); | 1906 | res); |
1904 | return; | 1907 | return; |
1905 | } | 1908 | } |
@@ -1922,7 +1925,7 @@ static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb) | |||
1922 | 1925 | ||
1923 | /* Check if combined event available */ | 1926 | /* Check if combined event available */ |
1924 | if (left_len < sizeof(*comb_event)) { | 1927 | if (left_len < sizeof(*comb_event)) { |
1925 | ath10k_warn("wmi phyerr combined event wrong len\n"); | 1928 | ath10k_warn(ar, "wmi phyerr combined event wrong len\n"); |
1926 | return; | 1929 | return; |
1927 | } | 1930 | } |
1928 | 1931 | ||
@@ -1936,7 +1939,7 @@ static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb) | |||
1936 | tsf <<= 32; | 1939 | tsf <<= 32; |
1937 | tsf |= __le32_to_cpu(comb_event->hdr.tsf_l32); | 1940 | tsf |= __le32_to_cpu(comb_event->hdr.tsf_l32); |
1938 | 1941 | ||
1939 | ath10k_dbg(ATH10K_DBG_WMI, | 1942 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
1940 | "wmi event phyerr count %d tsf64 0x%llX\n", | 1943 | "wmi event phyerr count %d tsf64 0x%llX\n", |
1941 | count, tsf); | 1944 | count, tsf); |
1942 | 1945 | ||
@@ -1944,7 +1947,8 @@ static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb) | |||
1944 | for (i = 0; i < count; i++) { | 1947 | for (i = 0; i < count; i++) { |
1945 | /* Check if we can read event header */ | 1948 | /* Check if we can read event header */ |
1946 | if (left_len < sizeof(*event)) { | 1949 | if (left_len < sizeof(*event)) { |
1947 | ath10k_warn("single event (%d) wrong head len\n", i); | 1950 | ath10k_warn(ar, "single event (%d) wrong head len\n", |
1951 | i); | ||
1948 | return; | 1952 | return; |
1949 | } | 1953 | } |
1950 | 1954 | ||
@@ -1954,7 +1958,7 @@ static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb) | |||
1954 | phy_err_code = event->hdr.phy_err_code; | 1958 | phy_err_code = event->hdr.phy_err_code; |
1955 | 1959 | ||
1956 | if (left_len < buf_len) { | 1960 | if (left_len < buf_len) { |
1957 | ath10k_warn("single event (%d) wrong buf len\n", i); | 1961 | ath10k_warn(ar, "single event (%d) wrong buf len\n", i); |
1958 | return; | 1962 | return; |
1959 | } | 1963 | } |
1960 | 1964 | ||
@@ -1981,13 +1985,13 @@ static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb) | |||
1981 | 1985 | ||
1982 | static void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb) | 1986 | static void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb) |
1983 | { | 1987 | { |
1984 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_ROAM_EVENTID\n"); | 1988 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_ROAM_EVENTID\n"); |
1985 | } | 1989 | } |
1986 | 1990 | ||
1987 | static void ath10k_wmi_event_profile_match(struct ath10k *ar, | 1991 | static void ath10k_wmi_event_profile_match(struct ath10k *ar, |
1988 | struct sk_buff *skb) | 1992 | struct sk_buff *skb) |
1989 | { | 1993 | { |
1990 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_PROFILE_MATCH\n"); | 1994 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PROFILE_MATCH\n"); |
1991 | } | 1995 | } |
1992 | 1996 | ||
1993 | static void ath10k_wmi_event_debug_print(struct ath10k *ar, | 1997 | static void ath10k_wmi_event_debug_print(struct ath10k *ar, |
@@ -2012,7 +2016,7 @@ static void ath10k_wmi_event_debug_print(struct ath10k *ar, | |||
2012 | } | 2016 | } |
2013 | 2017 | ||
2014 | if (i == sizeof(buf) - 1) | 2018 | if (i == sizeof(buf) - 1) |
2015 | ath10k_warn("wmi debug print truncated: %d\n", skb->len); | 2019 | ath10k_warn(ar, "wmi debug print truncated: %d\n", skb->len); |
2016 | 2020 | ||
2017 | /* for some reason the debug prints end with \n, remove that */ | 2021 | /* for some reason the debug prints end with \n, remove that */ |
2018 | if (skb->data[i - 1] == '\n') | 2022 | if (skb->data[i - 1] == '\n') |
@@ -2021,108 +2025,108 @@ static void ath10k_wmi_event_debug_print(struct ath10k *ar, | |||
2021 | /* the last byte is always reserved for the null character */ | 2025 | /* the last byte is always reserved for the null character */ |
2022 | buf[i] = '\0'; | 2026 | buf[i] = '\0'; |
2023 | 2027 | ||
2024 | ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug print '%s'\n", buf); | 2028 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event debug print '%s'\n", buf); |
2025 | } | 2029 | } |
2026 | 2030 | ||
2027 | static void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb) | 2031 | static void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb) |
2028 | { | 2032 | { |
2029 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_PDEV_QVIT_EVENTID\n"); | 2033 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_QVIT_EVENTID\n"); |
2030 | } | 2034 | } |
2031 | 2035 | ||
2032 | static void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, | 2036 | static void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, |
2033 | struct sk_buff *skb) | 2037 | struct sk_buff *skb) |
2034 | { | 2038 | { |
2035 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_WLAN_PROFILE_DATA_EVENTID\n"); | 2039 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_WLAN_PROFILE_DATA_EVENTID\n"); |
2036 | } | 2040 | } |
2037 | 2041 | ||
2038 | static void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar, | 2042 | static void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar, |
2039 | struct sk_buff *skb) | 2043 | struct sk_buff *skb) |
2040 | { | 2044 | { |
2041 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_RTT_MEASUREMENT_REPORT_EVENTID\n"); | 2045 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_RTT_MEASUREMENT_REPORT_EVENTID\n"); |
2042 | } | 2046 | } |
2043 | 2047 | ||
2044 | static void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar, | 2048 | static void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar, |
2045 | struct sk_buff *skb) | 2049 | struct sk_buff *skb) |
2046 | { | 2050 | { |
2047 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_TSF_MEASUREMENT_REPORT_EVENTID\n"); | 2051 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TSF_MEASUREMENT_REPORT_EVENTID\n"); |
2048 | } | 2052 | } |
2049 | 2053 | ||
2050 | static void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, | 2054 | static void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, |
2051 | struct sk_buff *skb) | 2055 | struct sk_buff *skb) |
2052 | { | 2056 | { |
2053 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_RTT_ERROR_REPORT_EVENTID\n"); | 2057 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_RTT_ERROR_REPORT_EVENTID\n"); |
2054 | } | 2058 | } |
2055 | 2059 | ||
2056 | static void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, | 2060 | static void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, |
2057 | struct sk_buff *skb) | 2061 | struct sk_buff *skb) |
2058 | { | 2062 | { |
2059 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_WOW_WAKEUP_HOST_EVENTID\n"); | 2063 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_WOW_WAKEUP_HOST_EVENTID\n"); |
2060 | } | 2064 | } |
2061 | 2065 | ||
2062 | static void ath10k_wmi_event_dcs_interference(struct ath10k *ar, | 2066 | static void ath10k_wmi_event_dcs_interference(struct ath10k *ar, |
2063 | struct sk_buff *skb) | 2067 | struct sk_buff *skb) |
2064 | { | 2068 | { |
2065 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_DCS_INTERFERENCE_EVENTID\n"); | 2069 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_DCS_INTERFERENCE_EVENTID\n"); |
2066 | } | 2070 | } |
2067 | 2071 | ||
2068 | static void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, | 2072 | static void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, |
2069 | struct sk_buff *skb) | 2073 | struct sk_buff *skb) |
2070 | { | 2074 | { |
2071 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_PDEV_TPC_CONFIG_EVENTID\n"); | 2075 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_TPC_CONFIG_EVENTID\n"); |
2072 | } | 2076 | } |
2073 | 2077 | ||
2074 | static void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, | 2078 | static void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, |
2075 | struct sk_buff *skb) | 2079 | struct sk_buff *skb) |
2076 | { | 2080 | { |
2077 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n"); | 2081 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n"); |
2078 | } | 2082 | } |
2079 | 2083 | ||
2080 | static void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar, | 2084 | static void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar, |
2081 | struct sk_buff *skb) | 2085 | struct sk_buff *skb) |
2082 | { | 2086 | { |
2083 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_GTK_OFFLOAD_STATUS_EVENTID\n"); | 2087 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_GTK_OFFLOAD_STATUS_EVENTID\n"); |
2084 | } | 2088 | } |
2085 | 2089 | ||
2086 | static void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, | 2090 | static void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, |
2087 | struct sk_buff *skb) | 2091 | struct sk_buff *skb) |
2088 | { | 2092 | { |
2089 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_GTK_REKEY_FAIL_EVENTID\n"); | 2093 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_GTK_REKEY_FAIL_EVENTID\n"); |
2090 | } | 2094 | } |
2091 | 2095 | ||
2092 | static void ath10k_wmi_event_delba_complete(struct ath10k *ar, | 2096 | static void ath10k_wmi_event_delba_complete(struct ath10k *ar, |
2093 | struct sk_buff *skb) | 2097 | struct sk_buff *skb) |
2094 | { | 2098 | { |
2095 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_TX_DELBA_COMPLETE_EVENTID\n"); | 2099 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TX_DELBA_COMPLETE_EVENTID\n"); |
2096 | } | 2100 | } |
2097 | 2101 | ||
2098 | static void ath10k_wmi_event_addba_complete(struct ath10k *ar, | 2102 | static void ath10k_wmi_event_addba_complete(struct ath10k *ar, |
2099 | struct sk_buff *skb) | 2103 | struct sk_buff *skb) |
2100 | { | 2104 | { |
2101 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_TX_ADDBA_COMPLETE_EVENTID\n"); | 2105 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TX_ADDBA_COMPLETE_EVENTID\n"); |
2102 | } | 2106 | } |
2103 | 2107 | ||
2104 | static void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar, | 2108 | static void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar, |
2105 | struct sk_buff *skb) | 2109 | struct sk_buff *skb) |
2106 | { | 2110 | { |
2107 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID\n"); | 2111 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID\n"); |
2108 | } | 2112 | } |
2109 | 2113 | ||
2110 | static void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, | 2114 | static void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, |
2111 | struct sk_buff *skb) | 2115 | struct sk_buff *skb) |
2112 | { | 2116 | { |
2113 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_INST_RSSI_STATS_EVENTID\n"); | 2117 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_INST_RSSI_STATS_EVENTID\n"); |
2114 | } | 2118 | } |
2115 | 2119 | ||
2116 | static void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, | 2120 | static void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, |
2117 | struct sk_buff *skb) | 2121 | struct sk_buff *skb) |
2118 | { | 2122 | { |
2119 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_STANDBY_REQ_EVENTID\n"); | 2123 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_STANDBY_REQ_EVENTID\n"); |
2120 | } | 2124 | } |
2121 | 2125 | ||
2122 | static void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, | 2126 | static void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, |
2123 | struct sk_buff *skb) | 2127 | struct sk_buff *skb) |
2124 | { | 2128 | { |
2125 | ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n"); | 2129 | ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n"); |
2126 | } | 2130 | } |
2127 | 2131 | ||
2128 | static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id, | 2132 | static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id, |
@@ -2142,7 +2146,7 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id, | |||
2142 | &paddr, | 2146 | &paddr, |
2143 | GFP_ATOMIC); | 2147 | GFP_ATOMIC); |
2144 | if (!ar->wmi.mem_chunks[idx].vaddr) { | 2148 | if (!ar->wmi.mem_chunks[idx].vaddr) { |
2145 | ath10k_warn("failed to allocate memory chunk\n"); | 2149 | ath10k_warn(ar, "failed to allocate memory chunk\n"); |
2146 | return -ENOMEM; | 2150 | return -ENOMEM; |
2147 | } | 2151 | } |
2148 | 2152 | ||
@@ -2163,7 +2167,7 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
2163 | DECLARE_BITMAP(svc_bmap, WMI_SERVICE_BM_SIZE) = {}; | 2167 | DECLARE_BITMAP(svc_bmap, WMI_SERVICE_BM_SIZE) = {}; |
2164 | 2168 | ||
2165 | if (skb->len < sizeof(*ev)) { | 2169 | if (skb->len < sizeof(*ev)) { |
2166 | ath10k_warn("Service ready event was %d B but expected %zu B. Wrong firmware version?\n", | 2170 | ath10k_warn(ar, "Service ready event was %d B but expected %zu B. Wrong firmware version?\n", |
2167 | skb->len, sizeof(*ev)); | 2171 | skb->len, sizeof(*ev)); |
2168 | return; | 2172 | return; |
2169 | } | 2173 | } |
@@ -2186,7 +2190,7 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
2186 | set_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX, ar->fw_features); | 2190 | set_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX, ar->fw_features); |
2187 | 2191 | ||
2188 | if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) { | 2192 | if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) { |
2189 | ath10k_warn("hardware advertises support for more spatial streams than it should (%d > %d)\n", | 2193 | ath10k_warn(ar, "hardware advertises support for more spatial streams than it should (%d > %d)\n", |
2190 | ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM); | 2194 | ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM); |
2191 | ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM; | 2195 | ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM; |
2192 | } | 2196 | } |
@@ -2196,7 +2200,7 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
2196 | 2200 | ||
2197 | wmi_main_svc_map(ev->wmi_service_bitmap, svc_bmap); | 2201 | wmi_main_svc_map(ev->wmi_service_bitmap, svc_bmap); |
2198 | ath10k_debug_read_service_map(ar, svc_bmap, sizeof(svc_bmap)); | 2202 | ath10k_debug_read_service_map(ar, svc_bmap, sizeof(svc_bmap)); |
2199 | ath10k_dbg_dump(ATH10K_DBG_WMI, NULL, "ath10k: wmi svc: ", | 2203 | ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ", |
2200 | ev->wmi_service_bitmap, sizeof(ev->wmi_service_bitmap)); | 2204 | ev->wmi_service_bitmap, sizeof(ev->wmi_service_bitmap)); |
2201 | 2205 | ||
2202 | if (strlen(ar->hw->wiphy->fw_version) == 0) { | 2206 | if (strlen(ar->hw->wiphy->fw_version) == 0) { |
@@ -2211,11 +2215,11 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
2211 | 2215 | ||
2212 | /* FIXME: it probably should be better to support this */ | 2216 | /* FIXME: it probably should be better to support this */ |
2213 | if (__le32_to_cpu(ev->num_mem_reqs) > 0) { | 2217 | if (__le32_to_cpu(ev->num_mem_reqs) > 0) { |
2214 | ath10k_warn("target requested %d memory chunks; ignoring\n", | 2218 | ath10k_warn(ar, "target requested %d memory chunks; ignoring\n", |
2215 | __le32_to_cpu(ev->num_mem_reqs)); | 2219 | __le32_to_cpu(ev->num_mem_reqs)); |
2216 | } | 2220 | } |
2217 | 2221 | ||
2218 | ath10k_dbg(ATH10K_DBG_WMI, | 2222 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2219 | "wmi event service ready sw_ver 0x%08x sw_ver1 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n", | 2223 | "wmi event service ready sw_ver 0x%08x sw_ver1 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n", |
2220 | __le32_to_cpu(ev->sw_version), | 2224 | __le32_to_cpu(ev->sw_version), |
2221 | __le32_to_cpu(ev->sw_version_1), | 2225 | __le32_to_cpu(ev->sw_version_1), |
@@ -2240,7 +2244,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2240 | DECLARE_BITMAP(svc_bmap, WMI_SERVICE_BM_SIZE) = {}; | 2244 | DECLARE_BITMAP(svc_bmap, WMI_SERVICE_BM_SIZE) = {}; |
2241 | 2245 | ||
2242 | if (skb->len < sizeof(*ev)) { | 2246 | if (skb->len < sizeof(*ev)) { |
2243 | ath10k_warn("Service ready event was %d B but expected %zu B. Wrong firmware version?\n", | 2247 | ath10k_warn(ar, "Service ready event was %d B but expected %zu B. Wrong firmware version?\n", |
2244 | skb->len, sizeof(*ev)); | 2248 | skb->len, sizeof(*ev)); |
2245 | return; | 2249 | return; |
2246 | } | 2250 | } |
@@ -2256,7 +2260,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2256 | ar->num_rf_chains = __le32_to_cpu(ev->num_rf_chains); | 2260 | ar->num_rf_chains = __le32_to_cpu(ev->num_rf_chains); |
2257 | 2261 | ||
2258 | if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) { | 2262 | if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) { |
2259 | ath10k_warn("hardware advertises support for more spatial streams than it should (%d > %d)\n", | 2263 | ath10k_warn(ar, "hardware advertises support for more spatial streams than it should (%d > %d)\n", |
2260 | ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM); | 2264 | ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM); |
2261 | ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM; | 2265 | ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM; |
2262 | } | 2266 | } |
@@ -2266,7 +2270,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2266 | 2270 | ||
2267 | wmi_10x_svc_map(ev->wmi_service_bitmap, svc_bmap); | 2271 | wmi_10x_svc_map(ev->wmi_service_bitmap, svc_bmap); |
2268 | ath10k_debug_read_service_map(ar, svc_bmap, sizeof(svc_bmap)); | 2272 | ath10k_debug_read_service_map(ar, svc_bmap, sizeof(svc_bmap)); |
2269 | ath10k_dbg_dump(ATH10K_DBG_WMI, NULL, "ath10k: wmi svc: ", | 2273 | ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ", |
2270 | ev->wmi_service_bitmap, sizeof(ev->wmi_service_bitmap)); | 2274 | ev->wmi_service_bitmap, sizeof(ev->wmi_service_bitmap)); |
2271 | 2275 | ||
2272 | if (strlen(ar->hw->wiphy->fw_version) == 0) { | 2276 | if (strlen(ar->hw->wiphy->fw_version) == 0) { |
@@ -2280,7 +2284,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2280 | num_mem_reqs = __le32_to_cpu(ev->num_mem_reqs); | 2284 | num_mem_reqs = __le32_to_cpu(ev->num_mem_reqs); |
2281 | 2285 | ||
2282 | if (num_mem_reqs > ATH10K_MAX_MEM_REQS) { | 2286 | if (num_mem_reqs > ATH10K_MAX_MEM_REQS) { |
2283 | ath10k_warn("requested memory chunks number (%d) exceeds the limit\n", | 2287 | ath10k_warn(ar, "requested memory chunks number (%d) exceeds the limit\n", |
2284 | num_mem_reqs); | 2288 | num_mem_reqs); |
2285 | return; | 2289 | return; |
2286 | } | 2290 | } |
@@ -2288,7 +2292,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2288 | if (!num_mem_reqs) | 2292 | if (!num_mem_reqs) |
2289 | goto exit; | 2293 | goto exit; |
2290 | 2294 | ||
2291 | ath10k_dbg(ATH10K_DBG_WMI, "firmware has requested %d memory chunks\n", | 2295 | ath10k_dbg(ar, ATH10K_DBG_WMI, "firmware has requested %d memory chunks\n", |
2292 | num_mem_reqs); | 2296 | num_mem_reqs); |
2293 | 2297 | ||
2294 | for (i = 0; i < num_mem_reqs; ++i) { | 2298 | for (i = 0; i < num_mem_reqs; ++i) { |
@@ -2306,7 +2310,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2306 | else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS) | 2310 | else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS) |
2307 | num_units = TARGET_10X_NUM_VDEVS + 1; | 2311 | num_units = TARGET_10X_NUM_VDEVS + 1; |
2308 | 2312 | ||
2309 | ath10k_dbg(ATH10K_DBG_WMI, | 2313 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2310 | "wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n", | 2314 | "wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n", |
2311 | req_id, | 2315 | req_id, |
2312 | __le32_to_cpu(ev->mem_reqs[i].num_units), | 2316 | __le32_to_cpu(ev->mem_reqs[i].num_units), |
@@ -2321,7 +2325,7 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar, | |||
2321 | } | 2325 | } |
2322 | 2326 | ||
2323 | exit: | 2327 | exit: |
2324 | ath10k_dbg(ATH10K_DBG_WMI, | 2328 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2325 | "wmi event service ready sw_ver 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n", | 2329 | "wmi event service ready sw_ver 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n", |
2326 | __le32_to_cpu(ev->sw_version), | 2330 | __le32_to_cpu(ev->sw_version), |
2327 | __le32_to_cpu(ev->abi_version), | 2331 | __le32_to_cpu(ev->abi_version), |
@@ -2345,7 +2349,7 @@ static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb) | |||
2345 | 2349 | ||
2346 | memcpy(ar->mac_addr, ev->mac_addr.addr, ETH_ALEN); | 2350 | memcpy(ar->mac_addr, ev->mac_addr.addr, ETH_ALEN); |
2347 | 2351 | ||
2348 | ath10k_dbg(ATH10K_DBG_WMI, | 2352 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2349 | "wmi event ready sw_version %u abi_version %u mac_addr %pM status %d skb->len %i ev-sz %zu\n", | 2353 | "wmi event ready sw_version %u abi_version %u mac_addr %pM status %d skb->len %i ev-sz %zu\n", |
2350 | __le32_to_cpu(ev->sw_version), | 2354 | __le32_to_cpu(ev->sw_version), |
2351 | __le32_to_cpu(ev->abi_version), | 2355 | __le32_to_cpu(ev->abi_version), |
@@ -2465,7 +2469,7 @@ static void ath10k_wmi_main_process_rx(struct ath10k *ar, struct sk_buff *skb) | |||
2465 | ath10k_wmi_ready_event_rx(ar, skb); | 2469 | ath10k_wmi_ready_event_rx(ar, skb); |
2466 | break; | 2470 | break; |
2467 | default: | 2471 | default: |
2468 | ath10k_warn("Unknown eventid: %d\n", id); | 2472 | ath10k_warn(ar, "Unknown eventid: %d\n", id); |
2469 | break; | 2473 | break; |
2470 | } | 2474 | } |
2471 | 2475 | ||
@@ -2572,7 +2576,7 @@ static void ath10k_wmi_10x_process_rx(struct ath10k *ar, struct sk_buff *skb) | |||
2572 | ath10k_wmi_ready_event_rx(ar, skb); | 2576 | ath10k_wmi_ready_event_rx(ar, skb); |
2573 | break; | 2577 | break; |
2574 | default: | 2578 | default: |
2575 | ath10k_warn("Unknown eventid: %d\n", id); | 2579 | ath10k_warn(ar, "Unknown eventid: %d\n", id); |
2576 | break; | 2580 | break; |
2577 | } | 2581 | } |
2578 | 2582 | ||
@@ -2685,11 +2689,11 @@ static void ath10k_wmi_10_2_process_rx(struct ath10k *ar, struct sk_buff *skb) | |||
2685 | case WMI_10_2_MCAST_BUF_RELEASE_EVENTID: | 2689 | case WMI_10_2_MCAST_BUF_RELEASE_EVENTID: |
2686 | case WMI_10_2_MCAST_LIST_AGEOUT_EVENTID: | 2690 | case WMI_10_2_MCAST_LIST_AGEOUT_EVENTID: |
2687 | case WMI_10_2_WDS_PEER_EVENTID: | 2691 | case WMI_10_2_WDS_PEER_EVENTID: |
2688 | ath10k_dbg(ATH10K_DBG_WMI, | 2692 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2689 | "received event id %d not implemented\n", id); | 2693 | "received event id %d not implemented\n", id); |
2690 | break; | 2694 | break; |
2691 | default: | 2695 | default: |
2692 | ath10k_warn("Unknown eventid: %d\n", id); | 2696 | ath10k_warn(ar, "Unknown eventid: %d\n", id); |
2693 | break; | 2697 | break; |
2694 | } | 2698 | } |
2695 | 2699 | ||
@@ -2766,7 +2770,7 @@ int ath10k_wmi_connect(struct ath10k *ar) | |||
2766 | 2770 | ||
2767 | status = ath10k_htc_connect_service(&ar->htc, &conn_req, &conn_resp); | 2771 | status = ath10k_htc_connect_service(&ar->htc, &conn_req, &conn_resp); |
2768 | if (status) { | 2772 | if (status) { |
2769 | ath10k_warn("failed to connect to WMI CONTROL service status: %d\n", | 2773 | ath10k_warn(ar, "failed to connect to WMI CONTROL service status: %d\n", |
2770 | status); | 2774 | status); |
2771 | return status; | 2775 | return status; |
2772 | } | 2776 | } |
@@ -2782,7 +2786,7 @@ static int ath10k_wmi_main_pdev_set_regdomain(struct ath10k *ar, u16 rd, | |||
2782 | struct wmi_pdev_set_regdomain_cmd *cmd; | 2786 | struct wmi_pdev_set_regdomain_cmd *cmd; |
2783 | struct sk_buff *skb; | 2787 | struct sk_buff *skb; |
2784 | 2788 | ||
2785 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 2789 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
2786 | if (!skb) | 2790 | if (!skb) |
2787 | return -ENOMEM; | 2791 | return -ENOMEM; |
2788 | 2792 | ||
@@ -2793,7 +2797,7 @@ static int ath10k_wmi_main_pdev_set_regdomain(struct ath10k *ar, u16 rd, | |||
2793 | cmd->conformance_test_limit_2G = __cpu_to_le32(ctl2g); | 2797 | cmd->conformance_test_limit_2G = __cpu_to_le32(ctl2g); |
2794 | cmd->conformance_test_limit_5G = __cpu_to_le32(ctl5g); | 2798 | cmd->conformance_test_limit_5G = __cpu_to_le32(ctl5g); |
2795 | 2799 | ||
2796 | ath10k_dbg(ATH10K_DBG_WMI, | 2800 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2797 | "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n", | 2801 | "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n", |
2798 | rd, rd2g, rd5g, ctl2g, ctl5g); | 2802 | rd, rd2g, rd5g, ctl2g, ctl5g); |
2799 | 2803 | ||
@@ -2809,7 +2813,7 @@ static int ath10k_wmi_10x_pdev_set_regdomain(struct ath10k *ar, u16 rd, | |||
2809 | struct wmi_pdev_set_regdomain_cmd_10x *cmd; | 2813 | struct wmi_pdev_set_regdomain_cmd_10x *cmd; |
2810 | struct sk_buff *skb; | 2814 | struct sk_buff *skb; |
2811 | 2815 | ||
2812 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 2816 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
2813 | if (!skb) | 2817 | if (!skb) |
2814 | return -ENOMEM; | 2818 | return -ENOMEM; |
2815 | 2819 | ||
@@ -2821,7 +2825,7 @@ static int ath10k_wmi_10x_pdev_set_regdomain(struct ath10k *ar, u16 rd, | |||
2821 | cmd->conformance_test_limit_5G = __cpu_to_le32(ctl5g); | 2825 | cmd->conformance_test_limit_5G = __cpu_to_le32(ctl5g); |
2822 | cmd->dfs_domain = __cpu_to_le32(dfs_reg); | 2826 | cmd->dfs_domain = __cpu_to_le32(dfs_reg); |
2823 | 2827 | ||
2824 | ath10k_dbg(ATH10K_DBG_WMI, | 2828 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2825 | "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x dfs_region %x\n", | 2829 | "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x dfs_region %x\n", |
2826 | rd, rd2g, rd5g, ctl2g, ctl5g, dfs_reg); | 2830 | rd, rd2g, rd5g, ctl2g, ctl5g, dfs_reg); |
2827 | 2831 | ||
@@ -2851,7 +2855,7 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar, | |||
2851 | if (arg->passive) | 2855 | if (arg->passive) |
2852 | return -EINVAL; | 2856 | return -EINVAL; |
2853 | 2857 | ||
2854 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 2858 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
2855 | if (!skb) | 2859 | if (!skb) |
2856 | return -ENOMEM; | 2860 | return -ENOMEM; |
2857 | 2861 | ||
@@ -2869,7 +2873,7 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar, | |||
2869 | cmd->chan.reg_classid = arg->reg_class_id; | 2873 | cmd->chan.reg_classid = arg->reg_class_id; |
2870 | cmd->chan.antenna_max = arg->max_antenna_gain; | 2874 | cmd->chan.antenna_max = arg->max_antenna_gain; |
2871 | 2875 | ||
2872 | ath10k_dbg(ATH10K_DBG_WMI, | 2876 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
2873 | "wmi set channel mode %d freq %d\n", | 2877 | "wmi set channel mode %d freq %d\n", |
2874 | arg->mode, arg->freq); | 2878 | arg->mode, arg->freq); |
2875 | 2879 | ||
@@ -2882,7 +2886,7 @@ int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt) | |||
2882 | struct wmi_pdev_suspend_cmd *cmd; | 2886 | struct wmi_pdev_suspend_cmd *cmd; |
2883 | struct sk_buff *skb; | 2887 | struct sk_buff *skb; |
2884 | 2888 | ||
2885 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 2889 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
2886 | if (!skb) | 2890 | if (!skb) |
2887 | return -ENOMEM; | 2891 | return -ENOMEM; |
2888 | 2892 | ||
@@ -2896,7 +2900,7 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar) | |||
2896 | { | 2900 | { |
2897 | struct sk_buff *skb; | 2901 | struct sk_buff *skb; |
2898 | 2902 | ||
2899 | skb = ath10k_wmi_alloc_skb(0); | 2903 | skb = ath10k_wmi_alloc_skb(ar, 0); |
2900 | if (skb == NULL) | 2904 | if (skb == NULL) |
2901 | return -ENOMEM; | 2905 | return -ENOMEM; |
2902 | 2906 | ||
@@ -2909,11 +2913,12 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value) | |||
2909 | struct sk_buff *skb; | 2913 | struct sk_buff *skb; |
2910 | 2914 | ||
2911 | if (id == WMI_PDEV_PARAM_UNSUPPORTED) { | 2915 | if (id == WMI_PDEV_PARAM_UNSUPPORTED) { |
2912 | ath10k_warn("pdev param %d not supported by firmware\n", id); | 2916 | ath10k_warn(ar, "pdev param %d not supported by firmware\n", |
2917 | id); | ||
2913 | return -EOPNOTSUPP; | 2918 | return -EOPNOTSUPP; |
2914 | } | 2919 | } |
2915 | 2920 | ||
2916 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 2921 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
2917 | if (!skb) | 2922 | if (!skb) |
2918 | return -ENOMEM; | 2923 | return -ENOMEM; |
2919 | 2924 | ||
@@ -2921,7 +2926,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value) | |||
2921 | cmd->param_id = __cpu_to_le32(id); | 2926 | cmd->param_id = __cpu_to_le32(id); |
2922 | cmd->param_value = __cpu_to_le32(value); | 2927 | cmd->param_value = __cpu_to_le32(value); |
2923 | 2928 | ||
2924 | ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set param %d value %d\n", | 2929 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set param %d value %d\n", |
2925 | id, value); | 2930 | id, value); |
2926 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid); | 2931 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid); |
2927 | } | 2932 | } |
@@ -2988,7 +2993,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar) | |||
2988 | len = sizeof(*cmd) + | 2993 | len = sizeof(*cmd) + |
2989 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); | 2994 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
2990 | 2995 | ||
2991 | buf = ath10k_wmi_alloc_skb(len); | 2996 | buf = ath10k_wmi_alloc_skb(ar, len); |
2992 | if (!buf) | 2997 | if (!buf) |
2993 | return -ENOMEM; | 2998 | return -ENOMEM; |
2994 | 2999 | ||
@@ -2999,7 +3004,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar) | |||
2999 | goto out; | 3004 | goto out; |
3000 | } | 3005 | } |
3001 | 3006 | ||
3002 | ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", | 3007 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", |
3003 | ar->wmi.num_mem_chunks); | 3008 | ar->wmi.num_mem_chunks); |
3004 | 3009 | ||
3005 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); | 3010 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); |
@@ -3012,7 +3017,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar) | |||
3012 | cmd->host_mem_chunks[i].req_id = | 3017 | cmd->host_mem_chunks[i].req_id = |
3013 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); | 3018 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); |
3014 | 3019 | ||
3015 | ath10k_dbg(ATH10K_DBG_WMI, | 3020 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3016 | "wmi chunk %d len %d requested, addr 0x%llx\n", | 3021 | "wmi chunk %d len %d requested, addr 0x%llx\n", |
3017 | i, | 3022 | i, |
3018 | ar->wmi.mem_chunks[i].len, | 3023 | ar->wmi.mem_chunks[i].len, |
@@ -3021,7 +3026,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar) | |||
3021 | out: | 3026 | out: |
3022 | memcpy(&cmd->resource_config, &config, sizeof(config)); | 3027 | memcpy(&cmd->resource_config, &config, sizeof(config)); |
3023 | 3028 | ||
3024 | ath10k_dbg(ATH10K_DBG_WMI, "wmi init\n"); | 3029 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi init\n"); |
3025 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); | 3030 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); |
3026 | } | 3031 | } |
3027 | 3032 | ||
@@ -3079,7 +3084,7 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) | |||
3079 | len = sizeof(*cmd) + | 3084 | len = sizeof(*cmd) + |
3080 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); | 3085 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
3081 | 3086 | ||
3082 | buf = ath10k_wmi_alloc_skb(len); | 3087 | buf = ath10k_wmi_alloc_skb(ar, len); |
3083 | if (!buf) | 3088 | if (!buf) |
3084 | return -ENOMEM; | 3089 | return -ENOMEM; |
3085 | 3090 | ||
@@ -3090,7 +3095,7 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) | |||
3090 | goto out; | 3095 | goto out; |
3091 | } | 3096 | } |
3092 | 3097 | ||
3093 | ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", | 3098 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", |
3094 | ar->wmi.num_mem_chunks); | 3099 | ar->wmi.num_mem_chunks); |
3095 | 3100 | ||
3096 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); | 3101 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); |
@@ -3103,7 +3108,7 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) | |||
3103 | cmd->host_mem_chunks[i].req_id = | 3108 | cmd->host_mem_chunks[i].req_id = |
3104 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); | 3109 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); |
3105 | 3110 | ||
3106 | ath10k_dbg(ATH10K_DBG_WMI, | 3111 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3107 | "wmi chunk %d len %d requested, addr 0x%llx\n", | 3112 | "wmi chunk %d len %d requested, addr 0x%llx\n", |
3108 | i, | 3113 | i, |
3109 | ar->wmi.mem_chunks[i].len, | 3114 | ar->wmi.mem_chunks[i].len, |
@@ -3112,7 +3117,7 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) | |||
3112 | out: | 3117 | out: |
3113 | memcpy(&cmd->resource_config, &config, sizeof(config)); | 3118 | memcpy(&cmd->resource_config, &config, sizeof(config)); |
3114 | 3119 | ||
3115 | ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10x\n"); | 3120 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi init 10x\n"); |
3116 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); | 3121 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); |
3117 | } | 3122 | } |
3118 | 3123 | ||
@@ -3170,7 +3175,7 @@ static int ath10k_wmi_10_2_cmd_init(struct ath10k *ar) | |||
3170 | len = sizeof(*cmd) + | 3175 | len = sizeof(*cmd) + |
3171 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); | 3176 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); |
3172 | 3177 | ||
3173 | buf = ath10k_wmi_alloc_skb(len); | 3178 | buf = ath10k_wmi_alloc_skb(ar, len); |
3174 | if (!buf) | 3179 | if (!buf) |
3175 | return -ENOMEM; | 3180 | return -ENOMEM; |
3176 | 3181 | ||
@@ -3181,7 +3186,7 @@ static int ath10k_wmi_10_2_cmd_init(struct ath10k *ar) | |||
3181 | goto out; | 3186 | goto out; |
3182 | } | 3187 | } |
3183 | 3188 | ||
3184 | ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", | 3189 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", |
3185 | ar->wmi.num_mem_chunks); | 3190 | ar->wmi.num_mem_chunks); |
3186 | 3191 | ||
3187 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); | 3192 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); |
@@ -3194,7 +3199,7 @@ static int ath10k_wmi_10_2_cmd_init(struct ath10k *ar) | |||
3194 | cmd->host_mem_chunks[i].req_id = | 3199 | cmd->host_mem_chunks[i].req_id = |
3195 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); | 3200 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); |
3196 | 3201 | ||
3197 | ath10k_dbg(ATH10K_DBG_WMI, | 3202 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3198 | "wmi chunk %d len %d requested, addr 0x%llx\n", | 3203 | "wmi chunk %d len %d requested, addr 0x%llx\n", |
3199 | i, | 3204 | i, |
3200 | ar->wmi.mem_chunks[i].len, | 3205 | ar->wmi.mem_chunks[i].len, |
@@ -3203,7 +3208,7 @@ static int ath10k_wmi_10_2_cmd_init(struct ath10k *ar) | |||
3203 | out: | 3208 | out: |
3204 | memcpy(&cmd->resource_config.common, &config, sizeof(config)); | 3209 | memcpy(&cmd->resource_config.common, &config, sizeof(config)); |
3205 | 3210 | ||
3206 | ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10.2\n"); | 3211 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi init 10.2\n"); |
3207 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); | 3212 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); |
3208 | } | 3213 | } |
3209 | 3214 | ||
@@ -3295,7 +3300,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar, | |||
3295 | if (len < 0) | 3300 | if (len < 0) |
3296 | return len; /* len contains error code here */ | 3301 | return len; /* len contains error code here */ |
3297 | 3302 | ||
3298 | skb = ath10k_wmi_alloc_skb(len); | 3303 | skb = ath10k_wmi_alloc_skb(ar, len); |
3299 | if (!skb) | 3304 | if (!skb) |
3300 | return -ENOMEM; | 3305 | return -ENOMEM; |
3301 | 3306 | ||
@@ -3391,7 +3396,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar, | |||
3391 | return -EINVAL; | 3396 | return -EINVAL; |
3392 | } | 3397 | } |
3393 | 3398 | ||
3394 | ath10k_dbg(ATH10K_DBG_WMI, "wmi start scan\n"); | 3399 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi start scan\n"); |
3395 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid); | 3400 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid); |
3396 | } | 3401 | } |
3397 | 3402 | ||
@@ -3433,7 +3438,7 @@ int ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg) | |||
3433 | if (arg->req_type == WMI_SCAN_STOP_ONE && arg->u.scan_id > 0xFFF) | 3438 | if (arg->req_type == WMI_SCAN_STOP_ONE && arg->u.scan_id > 0xFFF) |
3434 | return -EINVAL; | 3439 | return -EINVAL; |
3435 | 3440 | ||
3436 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3441 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3437 | if (!skb) | 3442 | if (!skb) |
3438 | return -ENOMEM; | 3443 | return -ENOMEM; |
3439 | 3444 | ||
@@ -3449,7 +3454,7 @@ int ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg) | |||
3449 | cmd->scan_id = __cpu_to_le32(scan_id); | 3454 | cmd->scan_id = __cpu_to_le32(scan_id); |
3450 | cmd->scan_req_id = __cpu_to_le32(req_id); | 3455 | cmd->scan_req_id = __cpu_to_le32(req_id); |
3451 | 3456 | ||
3452 | ath10k_dbg(ATH10K_DBG_WMI, | 3457 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3453 | "wmi stop scan reqid %d req_type %d vdev/scan_id %d\n", | 3458 | "wmi stop scan reqid %d req_type %d vdev/scan_id %d\n", |
3454 | arg->req_id, arg->req_type, arg->u.scan_id); | 3459 | arg->req_id, arg->req_type, arg->u.scan_id); |
3455 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid); | 3460 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid); |
@@ -3463,7 +3468,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id, | |||
3463 | struct wmi_vdev_create_cmd *cmd; | 3468 | struct wmi_vdev_create_cmd *cmd; |
3464 | struct sk_buff *skb; | 3469 | struct sk_buff *skb; |
3465 | 3470 | ||
3466 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3471 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3467 | if (!skb) | 3472 | if (!skb) |
3468 | return -ENOMEM; | 3473 | return -ENOMEM; |
3469 | 3474 | ||
@@ -3473,7 +3478,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id, | |||
3473 | cmd->vdev_subtype = __cpu_to_le32(subtype); | 3478 | cmd->vdev_subtype = __cpu_to_le32(subtype); |
3474 | memcpy(cmd->vdev_macaddr.addr, macaddr, ETH_ALEN); | 3479 | memcpy(cmd->vdev_macaddr.addr, macaddr, ETH_ALEN); |
3475 | 3480 | ||
3476 | ath10k_dbg(ATH10K_DBG_WMI, | 3481 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3477 | "WMI vdev create: id %d type %d subtype %d macaddr %pM\n", | 3482 | "WMI vdev create: id %d type %d subtype %d macaddr %pM\n", |
3478 | vdev_id, type, subtype, macaddr); | 3483 | vdev_id, type, subtype, macaddr); |
3479 | 3484 | ||
@@ -3485,14 +3490,14 @@ int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id) | |||
3485 | struct wmi_vdev_delete_cmd *cmd; | 3490 | struct wmi_vdev_delete_cmd *cmd; |
3486 | struct sk_buff *skb; | 3491 | struct sk_buff *skb; |
3487 | 3492 | ||
3488 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3493 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3489 | if (!skb) | 3494 | if (!skb) |
3490 | return -ENOMEM; | 3495 | return -ENOMEM; |
3491 | 3496 | ||
3492 | cmd = (struct wmi_vdev_delete_cmd *)skb->data; | 3497 | cmd = (struct wmi_vdev_delete_cmd *)skb->data; |
3493 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3498 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3494 | 3499 | ||
3495 | ath10k_dbg(ATH10K_DBG_WMI, | 3500 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3496 | "WMI vdev delete id %d\n", vdev_id); | 3501 | "WMI vdev delete id %d\n", vdev_id); |
3497 | 3502 | ||
3498 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid); | 3503 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid); |
@@ -3525,7 +3530,7 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar, | |||
3525 | else | 3530 | else |
3526 | return -EINVAL; /* should not happen, we already check cmd_id */ | 3531 | return -EINVAL; /* should not happen, we already check cmd_id */ |
3527 | 3532 | ||
3528 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3533 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3529 | if (!skb) | 3534 | if (!skb) |
3530 | return -ENOMEM; | 3535 | return -ENOMEM; |
3531 | 3536 | ||
@@ -3563,7 +3568,7 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar, | |||
3563 | cmd->chan.reg_classid = arg->channel.reg_class_id; | 3568 | cmd->chan.reg_classid = arg->channel.reg_class_id; |
3564 | cmd->chan.antenna_max = arg->channel.max_antenna_gain; | 3569 | cmd->chan.antenna_max = arg->channel.max_antenna_gain; |
3565 | 3570 | ||
3566 | ath10k_dbg(ATH10K_DBG_WMI, | 3571 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3567 | "wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, " | 3572 | "wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, " |
3568 | "ch_flags: 0x%0X, max_power: %d\n", cmdname, arg->vdev_id, | 3573 | "ch_flags: 0x%0X, max_power: %d\n", cmdname, arg->vdev_id, |
3569 | flags, arg->channel.freq, arg->channel.mode, | 3574 | flags, arg->channel.freq, arg->channel.mode, |
@@ -3593,14 +3598,14 @@ int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id) | |||
3593 | struct wmi_vdev_stop_cmd *cmd; | 3598 | struct wmi_vdev_stop_cmd *cmd; |
3594 | struct sk_buff *skb; | 3599 | struct sk_buff *skb; |
3595 | 3600 | ||
3596 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3601 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3597 | if (!skb) | 3602 | if (!skb) |
3598 | return -ENOMEM; | 3603 | return -ENOMEM; |
3599 | 3604 | ||
3600 | cmd = (struct wmi_vdev_stop_cmd *)skb->data; | 3605 | cmd = (struct wmi_vdev_stop_cmd *)skb->data; |
3601 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3606 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3602 | 3607 | ||
3603 | ath10k_dbg(ATH10K_DBG_WMI, "wmi vdev stop id 0x%x\n", vdev_id); | 3608 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi vdev stop id 0x%x\n", vdev_id); |
3604 | 3609 | ||
3605 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid); | 3610 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid); |
3606 | } | 3611 | } |
@@ -3610,7 +3615,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid) | |||
3610 | struct wmi_vdev_up_cmd *cmd; | 3615 | struct wmi_vdev_up_cmd *cmd; |
3611 | struct sk_buff *skb; | 3616 | struct sk_buff *skb; |
3612 | 3617 | ||
3613 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3618 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3614 | if (!skb) | 3619 | if (!skb) |
3615 | return -ENOMEM; | 3620 | return -ENOMEM; |
3616 | 3621 | ||
@@ -3619,7 +3624,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid) | |||
3619 | cmd->vdev_assoc_id = __cpu_to_le32(aid); | 3624 | cmd->vdev_assoc_id = __cpu_to_le32(aid); |
3620 | memcpy(&cmd->vdev_bssid.addr, bssid, ETH_ALEN); | 3625 | memcpy(&cmd->vdev_bssid.addr, bssid, ETH_ALEN); |
3621 | 3626 | ||
3622 | ath10k_dbg(ATH10K_DBG_WMI, | 3627 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3623 | "wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n", | 3628 | "wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n", |
3624 | vdev_id, aid, bssid); | 3629 | vdev_id, aid, bssid); |
3625 | 3630 | ||
@@ -3631,14 +3636,14 @@ int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id) | |||
3631 | struct wmi_vdev_down_cmd *cmd; | 3636 | struct wmi_vdev_down_cmd *cmd; |
3632 | struct sk_buff *skb; | 3637 | struct sk_buff *skb; |
3633 | 3638 | ||
3634 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3639 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3635 | if (!skb) | 3640 | if (!skb) |
3636 | return -ENOMEM; | 3641 | return -ENOMEM; |
3637 | 3642 | ||
3638 | cmd = (struct wmi_vdev_down_cmd *)skb->data; | 3643 | cmd = (struct wmi_vdev_down_cmd *)skb->data; |
3639 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3644 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3640 | 3645 | ||
3641 | ath10k_dbg(ATH10K_DBG_WMI, | 3646 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3642 | "wmi mgmt vdev down id 0x%x\n", vdev_id); | 3647 | "wmi mgmt vdev down id 0x%x\n", vdev_id); |
3643 | 3648 | ||
3644 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid); | 3649 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid); |
@@ -3651,13 +3656,13 @@ int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, | |||
3651 | struct sk_buff *skb; | 3656 | struct sk_buff *skb; |
3652 | 3657 | ||
3653 | if (param_id == WMI_VDEV_PARAM_UNSUPPORTED) { | 3658 | if (param_id == WMI_VDEV_PARAM_UNSUPPORTED) { |
3654 | ath10k_dbg(ATH10K_DBG_WMI, | 3659 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3655 | "vdev param %d not supported by firmware\n", | 3660 | "vdev param %d not supported by firmware\n", |
3656 | param_id); | 3661 | param_id); |
3657 | return -EOPNOTSUPP; | 3662 | return -EOPNOTSUPP; |
3658 | } | 3663 | } |
3659 | 3664 | ||
3660 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3665 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3661 | if (!skb) | 3666 | if (!skb) |
3662 | return -ENOMEM; | 3667 | return -ENOMEM; |
3663 | 3668 | ||
@@ -3666,7 +3671,7 @@ int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, | |||
3666 | cmd->param_id = __cpu_to_le32(param_id); | 3671 | cmd->param_id = __cpu_to_le32(param_id); |
3667 | cmd->param_value = __cpu_to_le32(param_value); | 3672 | cmd->param_value = __cpu_to_le32(param_value); |
3668 | 3673 | ||
3669 | ath10k_dbg(ATH10K_DBG_WMI, | 3674 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3670 | "wmi vdev id 0x%x set param %d value %d\n", | 3675 | "wmi vdev id 0x%x set param %d value %d\n", |
3671 | vdev_id, param_id, param_value); | 3676 | vdev_id, param_id, param_value); |
3672 | 3677 | ||
@@ -3684,7 +3689,7 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar, | |||
3684 | if (arg->key_cipher != WMI_CIPHER_NONE && arg->key_data == NULL) | 3689 | if (arg->key_cipher != WMI_CIPHER_NONE && arg->key_data == NULL) |
3685 | return -EINVAL; | 3690 | return -EINVAL; |
3686 | 3691 | ||
3687 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd) + arg->key_len); | 3692 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd) + arg->key_len); |
3688 | if (!skb) | 3693 | if (!skb) |
3689 | return -ENOMEM; | 3694 | return -ENOMEM; |
3690 | 3695 | ||
@@ -3702,7 +3707,7 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar, | |||
3702 | if (arg->key_data) | 3707 | if (arg->key_data) |
3703 | memcpy(cmd->key_data, arg->key_data, arg->key_len); | 3708 | memcpy(cmd->key_data, arg->key_data, arg->key_len); |
3704 | 3709 | ||
3705 | ath10k_dbg(ATH10K_DBG_WMI, | 3710 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3706 | "wmi vdev install key idx %d cipher %d len %d\n", | 3711 | "wmi vdev install key idx %d cipher %d len %d\n", |
3707 | arg->key_idx, arg->key_cipher, arg->key_len); | 3712 | arg->key_idx, arg->key_cipher, arg->key_len); |
3708 | return ath10k_wmi_cmd_send(ar, skb, | 3713 | return ath10k_wmi_cmd_send(ar, skb, |
@@ -3716,7 +3721,7 @@ int ath10k_wmi_vdev_spectral_conf(struct ath10k *ar, | |||
3716 | struct sk_buff *skb; | 3721 | struct sk_buff *skb; |
3717 | u32 cmdid; | 3722 | u32 cmdid; |
3718 | 3723 | ||
3719 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3724 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3720 | if (!skb) | 3725 | if (!skb) |
3721 | return -ENOMEM; | 3726 | return -ENOMEM; |
3722 | 3727 | ||
@@ -3752,7 +3757,7 @@ int ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger, | |||
3752 | struct sk_buff *skb; | 3757 | struct sk_buff *skb; |
3753 | u32 cmdid; | 3758 | u32 cmdid; |
3754 | 3759 | ||
3755 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3760 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3756 | if (!skb) | 3761 | if (!skb) |
3757 | return -ENOMEM; | 3762 | return -ENOMEM; |
3758 | 3763 | ||
@@ -3771,7 +3776,7 @@ int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, | |||
3771 | struct wmi_peer_create_cmd *cmd; | 3776 | struct wmi_peer_create_cmd *cmd; |
3772 | struct sk_buff *skb; | 3777 | struct sk_buff *skb; |
3773 | 3778 | ||
3774 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3779 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3775 | if (!skb) | 3780 | if (!skb) |
3776 | return -ENOMEM; | 3781 | return -ENOMEM; |
3777 | 3782 | ||
@@ -3779,7 +3784,7 @@ int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, | |||
3779 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3784 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3780 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); | 3785 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); |
3781 | 3786 | ||
3782 | ath10k_dbg(ATH10K_DBG_WMI, | 3787 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3783 | "wmi peer create vdev_id %d peer_addr %pM\n", | 3788 | "wmi peer create vdev_id %d peer_addr %pM\n", |
3784 | vdev_id, peer_addr); | 3789 | vdev_id, peer_addr); |
3785 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid); | 3790 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid); |
@@ -3791,7 +3796,7 @@ int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id, | |||
3791 | struct wmi_peer_delete_cmd *cmd; | 3796 | struct wmi_peer_delete_cmd *cmd; |
3792 | struct sk_buff *skb; | 3797 | struct sk_buff *skb; |
3793 | 3798 | ||
3794 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3799 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3795 | if (!skb) | 3800 | if (!skb) |
3796 | return -ENOMEM; | 3801 | return -ENOMEM; |
3797 | 3802 | ||
@@ -3799,7 +3804,7 @@ int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id, | |||
3799 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3804 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3800 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); | 3805 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); |
3801 | 3806 | ||
3802 | ath10k_dbg(ATH10K_DBG_WMI, | 3807 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3803 | "wmi peer delete vdev_id %d peer_addr %pM\n", | 3808 | "wmi peer delete vdev_id %d peer_addr %pM\n", |
3804 | vdev_id, peer_addr); | 3809 | vdev_id, peer_addr); |
3805 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid); | 3810 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid); |
@@ -3811,7 +3816,7 @@ int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id, | |||
3811 | struct wmi_peer_flush_tids_cmd *cmd; | 3816 | struct wmi_peer_flush_tids_cmd *cmd; |
3812 | struct sk_buff *skb; | 3817 | struct sk_buff *skb; |
3813 | 3818 | ||
3814 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3819 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3815 | if (!skb) | 3820 | if (!skb) |
3816 | return -ENOMEM; | 3821 | return -ENOMEM; |
3817 | 3822 | ||
@@ -3820,7 +3825,7 @@ int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id, | |||
3820 | cmd->peer_tid_bitmap = __cpu_to_le32(tid_bitmap); | 3825 | cmd->peer_tid_bitmap = __cpu_to_le32(tid_bitmap); |
3821 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); | 3826 | memcpy(cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); |
3822 | 3827 | ||
3823 | ath10k_dbg(ATH10K_DBG_WMI, | 3828 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3824 | "wmi peer flush vdev_id %d peer_addr %pM tids %08x\n", | 3829 | "wmi peer flush vdev_id %d peer_addr %pM tids %08x\n", |
3825 | vdev_id, peer_addr, tid_bitmap); | 3830 | vdev_id, peer_addr, tid_bitmap); |
3826 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid); | 3831 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid); |
@@ -3833,7 +3838,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, | |||
3833 | struct wmi_peer_set_param_cmd *cmd; | 3838 | struct wmi_peer_set_param_cmd *cmd; |
3834 | struct sk_buff *skb; | 3839 | struct sk_buff *skb; |
3835 | 3840 | ||
3836 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3841 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3837 | if (!skb) | 3842 | if (!skb) |
3838 | return -ENOMEM; | 3843 | return -ENOMEM; |
3839 | 3844 | ||
@@ -3843,7 +3848,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, | |||
3843 | cmd->param_value = __cpu_to_le32(param_value); | 3848 | cmd->param_value = __cpu_to_le32(param_value); |
3844 | memcpy(&cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); | 3849 | memcpy(&cmd->peer_macaddr.addr, peer_addr, ETH_ALEN); |
3845 | 3850 | ||
3846 | ath10k_dbg(ATH10K_DBG_WMI, | 3851 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3847 | "wmi vdev %d peer 0x%pM set param %d value %d\n", | 3852 | "wmi vdev %d peer 0x%pM set param %d value %d\n", |
3848 | vdev_id, peer_addr, param_id, param_value); | 3853 | vdev_id, peer_addr, param_id, param_value); |
3849 | 3854 | ||
@@ -3856,7 +3861,7 @@ int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id, | |||
3856 | struct wmi_sta_powersave_mode_cmd *cmd; | 3861 | struct wmi_sta_powersave_mode_cmd *cmd; |
3857 | struct sk_buff *skb; | 3862 | struct sk_buff *skb; |
3858 | 3863 | ||
3859 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3864 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3860 | if (!skb) | 3865 | if (!skb) |
3861 | return -ENOMEM; | 3866 | return -ENOMEM; |
3862 | 3867 | ||
@@ -3864,7 +3869,7 @@ int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id, | |||
3864 | cmd->vdev_id = __cpu_to_le32(vdev_id); | 3869 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
3865 | cmd->sta_ps_mode = __cpu_to_le32(psmode); | 3870 | cmd->sta_ps_mode = __cpu_to_le32(psmode); |
3866 | 3871 | ||
3867 | ath10k_dbg(ATH10K_DBG_WMI, | 3872 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3868 | "wmi set powersave id 0x%x mode %d\n", | 3873 | "wmi set powersave id 0x%x mode %d\n", |
3869 | vdev_id, psmode); | 3874 | vdev_id, psmode); |
3870 | 3875 | ||
@@ -3879,7 +3884,7 @@ int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id, | |||
3879 | struct wmi_sta_powersave_param_cmd *cmd; | 3884 | struct wmi_sta_powersave_param_cmd *cmd; |
3880 | struct sk_buff *skb; | 3885 | struct sk_buff *skb; |
3881 | 3886 | ||
3882 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3887 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3883 | if (!skb) | 3888 | if (!skb) |
3884 | return -ENOMEM; | 3889 | return -ENOMEM; |
3885 | 3890 | ||
@@ -3888,7 +3893,7 @@ int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id, | |||
3888 | cmd->param_id = __cpu_to_le32(param_id); | 3893 | cmd->param_id = __cpu_to_le32(param_id); |
3889 | cmd->param_value = __cpu_to_le32(value); | 3894 | cmd->param_value = __cpu_to_le32(value); |
3890 | 3895 | ||
3891 | ath10k_dbg(ATH10K_DBG_WMI, | 3896 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3892 | "wmi sta ps param vdev_id 0x%x param %d value %d\n", | 3897 | "wmi sta ps param vdev_id 0x%x param %d value %d\n", |
3893 | vdev_id, param_id, value); | 3898 | vdev_id, param_id, value); |
3894 | return ath10k_wmi_cmd_send(ar, skb, | 3899 | return ath10k_wmi_cmd_send(ar, skb, |
@@ -3904,7 +3909,7 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac, | |||
3904 | if (!mac) | 3909 | if (!mac) |
3905 | return -EINVAL; | 3910 | return -EINVAL; |
3906 | 3911 | ||
3907 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 3912 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
3908 | if (!skb) | 3913 | if (!skb) |
3909 | return -ENOMEM; | 3914 | return -ENOMEM; |
3910 | 3915 | ||
@@ -3914,7 +3919,7 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac, | |||
3914 | cmd->param_value = __cpu_to_le32(value); | 3919 | cmd->param_value = __cpu_to_le32(value); |
3915 | memcpy(&cmd->peer_macaddr, mac, ETH_ALEN); | 3920 | memcpy(&cmd->peer_macaddr, mac, ETH_ALEN); |
3916 | 3921 | ||
3917 | ath10k_dbg(ATH10K_DBG_WMI, | 3922 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
3918 | "wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n", | 3923 | "wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n", |
3919 | vdev_id, param_id, value, mac); | 3924 | vdev_id, param_id, value, mac); |
3920 | 3925 | ||
@@ -3934,7 +3939,7 @@ int ath10k_wmi_scan_chan_list(struct ath10k *ar, | |||
3934 | 3939 | ||
3935 | len = sizeof(*cmd) + arg->n_channels * sizeof(struct wmi_channel); | 3940 | len = sizeof(*cmd) + arg->n_channels * sizeof(struct wmi_channel); |
3936 | 3941 | ||
3937 | skb = ath10k_wmi_alloc_skb(len); | 3942 | skb = ath10k_wmi_alloc_skb(ar, len); |
3938 | if (!skb) | 3943 | if (!skb) |
3939 | return -EINVAL; | 3944 | return -EINVAL; |
3940 | 3945 | ||
@@ -4076,7 +4081,7 @@ int ath10k_wmi_peer_assoc(struct ath10k *ar, | |||
4076 | len = sizeof(struct wmi_main_peer_assoc_complete_cmd); | 4081 | len = sizeof(struct wmi_main_peer_assoc_complete_cmd); |
4077 | } | 4082 | } |
4078 | 4083 | ||
4079 | skb = ath10k_wmi_alloc_skb(len); | 4084 | skb = ath10k_wmi_alloc_skb(ar, len); |
4080 | if (!skb) | 4085 | if (!skb) |
4081 | return -ENOMEM; | 4086 | return -ENOMEM; |
4082 | 4087 | ||
@@ -4089,7 +4094,7 @@ int ath10k_wmi_peer_assoc(struct ath10k *ar, | |||
4089 | ath10k_wmi_peer_assoc_fill_main(ar, skb->data, arg); | 4094 | ath10k_wmi_peer_assoc_fill_main(ar, skb->data, arg); |
4090 | } | 4095 | } |
4091 | 4096 | ||
4092 | ath10k_dbg(ATH10K_DBG_WMI, | 4097 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
4093 | "wmi peer assoc vdev %d addr %pM (%s)\n", | 4098 | "wmi peer assoc vdev %d addr %pM (%s)\n", |
4094 | arg->vdev_id, arg->addr, | 4099 | arg->vdev_id, arg->addr, |
4095 | arg->peer_reassoc ? "reassociate" : "new"); | 4100 | arg->peer_reassoc ? "reassociate" : "new"); |
@@ -4107,7 +4112,7 @@ int ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif) | |||
4107 | int ret; | 4112 | int ret; |
4108 | u16 fc; | 4113 | u16 fc; |
4109 | 4114 | ||
4110 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 4115 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
4111 | if (!skb) | 4116 | if (!skb) |
4112 | return -ENOMEM; | 4117 | return -ENOMEM; |
4113 | 4118 | ||
@@ -4155,7 +4160,7 @@ int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, | |||
4155 | struct wmi_pdev_set_wmm_params *cmd; | 4160 | struct wmi_pdev_set_wmm_params *cmd; |
4156 | struct sk_buff *skb; | 4161 | struct sk_buff *skb; |
4157 | 4162 | ||
4158 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 4163 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
4159 | if (!skb) | 4164 | if (!skb) |
4160 | return -ENOMEM; | 4165 | return -ENOMEM; |
4161 | 4166 | ||
@@ -4165,7 +4170,7 @@ int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, | |||
4165 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); | 4170 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); |
4166 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); | 4171 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); |
4167 | 4172 | ||
4168 | ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); | 4173 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); |
4169 | return ath10k_wmi_cmd_send(ar, skb, | 4174 | return ath10k_wmi_cmd_send(ar, skb, |
4170 | ar->wmi.cmd->pdev_set_wmm_params_cmdid); | 4175 | ar->wmi.cmd->pdev_set_wmm_params_cmdid); |
4171 | } | 4176 | } |
@@ -4175,14 +4180,14 @@ int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id) | |||
4175 | struct wmi_request_stats_cmd *cmd; | 4180 | struct wmi_request_stats_cmd *cmd; |
4176 | struct sk_buff *skb; | 4181 | struct sk_buff *skb; |
4177 | 4182 | ||
4178 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 4183 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
4179 | if (!skb) | 4184 | if (!skb) |
4180 | return -ENOMEM; | 4185 | return -ENOMEM; |
4181 | 4186 | ||
4182 | cmd = (struct wmi_request_stats_cmd *)skb->data; | 4187 | cmd = (struct wmi_request_stats_cmd *)skb->data; |
4183 | cmd->stats_id = __cpu_to_le32(stats_id); | 4188 | cmd->stats_id = __cpu_to_le32(stats_id); |
4184 | 4189 | ||
4185 | ath10k_dbg(ATH10K_DBG_WMI, "wmi request stats %d\n", (int)stats_id); | 4190 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi request stats %d\n", (int)stats_id); |
4186 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid); | 4191 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid); |
4187 | } | 4192 | } |
4188 | 4193 | ||
@@ -4192,7 +4197,7 @@ int ath10k_wmi_force_fw_hang(struct ath10k *ar, | |||
4192 | struct wmi_force_fw_hang_cmd *cmd; | 4197 | struct wmi_force_fw_hang_cmd *cmd; |
4193 | struct sk_buff *skb; | 4198 | struct sk_buff *skb; |
4194 | 4199 | ||
4195 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 4200 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
4196 | if (!skb) | 4201 | if (!skb) |
4197 | return -ENOMEM; | 4202 | return -ENOMEM; |
4198 | 4203 | ||
@@ -4200,7 +4205,7 @@ int ath10k_wmi_force_fw_hang(struct ath10k *ar, | |||
4200 | cmd->type = __cpu_to_le32(type); | 4205 | cmd->type = __cpu_to_le32(type); |
4201 | cmd->delay_ms = __cpu_to_le32(delay_ms); | 4206 | cmd->delay_ms = __cpu_to_le32(delay_ms); |
4202 | 4207 | ||
4203 | ath10k_dbg(ATH10K_DBG_WMI, "wmi force fw hang %d delay %d\n", | 4208 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi force fw hang %d delay %d\n", |
4204 | type, delay_ms); | 4209 | type, delay_ms); |
4205 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); | 4210 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); |
4206 | } | 4211 | } |
@@ -4211,7 +4216,7 @@ int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable) | |||
4211 | struct sk_buff *skb; | 4216 | struct sk_buff *skb; |
4212 | u32 cfg; | 4217 | u32 cfg; |
4213 | 4218 | ||
4214 | skb = ath10k_wmi_alloc_skb(sizeof(*cmd)); | 4219 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); |
4215 | if (!skb) | 4220 | if (!skb) |
4216 | return -ENOMEM; | 4221 | return -ENOMEM; |
4217 | 4222 | ||
@@ -4232,7 +4237,7 @@ int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable) | |||
4232 | cmd->config_enable = __cpu_to_le32(cfg); | 4237 | cmd->config_enable = __cpu_to_le32(cfg); |
4233 | cmd->config_valid = __cpu_to_le32(ATH10K_DBGLOG_CFG_LOG_LVL_MASK); | 4238 | cmd->config_valid = __cpu_to_le32(ATH10K_DBGLOG_CFG_LOG_LVL_MASK); |
4234 | 4239 | ||
4235 | ath10k_dbg(ATH10K_DBG_WMI, | 4240 | ath10k_dbg(ar, ATH10K_DBG_WMI, |
4236 | "wmi dbglog cfg modules %08x %08x config %08x %08x\n", | 4241 | "wmi dbglog cfg modules %08x %08x config %08x %08x\n", |
4237 | __le32_to_cpu(cmd->module_enable), | 4242 | __le32_to_cpu(cmd->module_enable), |
4238 | __le32_to_cpu(cmd->module_valid), | 4243 | __le32_to_cpu(cmd->module_valid), |