Skip to content

Commit 28131d8

Browse files
committed
Merge tag 'wireless-drivers-next-2021-10-29' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers-next patches for v5.16 Fourth set of patches for v5.16. Mostly fixes this time, wcn36xx and iwlwifi have some new features but nothing really out of ordinary. We have one conflict with kspp tree. Major changes: ath11k * fix QCA6390 A-MSDU handling (CVE-2020-24588) wcn36xx * enable hardware scan offload for 5Ghz band * add missing 5GHz channels 136 and 144 iwlwifi * support a new ACPI table revision * improvements in the device selection code * new hardware support * support for WiFi 6E enablement via BIOS * support firmware API version 67 * support for 160MHz in ranging measurements ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 7444d70 + 2619f90 commit 28131d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3609
-1398
lines changed

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,9 +2690,16 @@ static int ath10k_core_copy_target_iram(struct ath10k *ar)
26902690
int i, ret;
26912691
u32 len, remaining_len;
26922692

2693-
hw_mem = ath10k_coredump_get_mem_layout(ar);
2693+
/* copy target iram feature must work also when
2694+
* ATH10K_FW_CRASH_DUMP_RAM_DATA is disabled, so
2695+
* _ath10k_coredump_get_mem_layout() to accomplist that
2696+
*/
2697+
hw_mem = _ath10k_coredump_get_mem_layout(ar);
26942698
if (!hw_mem)
2695-
return -ENOMEM;
2699+
/* if CONFIG_DEV_COREDUMP is disabled we get NULL, then
2700+
* just silently disable the feature by doing nothing
2701+
*/
2702+
return 0;
26962703

26972704
for (i = 0; i < hw_mem->region_table.size; i++) {
26982705
tmp = &hw_mem->region_table.regions[i];

drivers/net/wireless/ath/ath10k/coredump.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,11 +1447,17 @@ static u32 ath10k_coredump_get_ramdump_size(struct ath10k *ar)
14471447

14481448
const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar)
14491449
{
1450-
int i;
1451-
14521450
if (!test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask))
14531451
return NULL;
14541452

1453+
return _ath10k_coredump_get_mem_layout(ar);
1454+
}
1455+
EXPORT_SYMBOL(ath10k_coredump_get_mem_layout);
1456+
1457+
const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar)
1458+
{
1459+
int i;
1460+
14551461
if (WARN_ON(ar->target_version == 0))
14561462
return NULL;
14571463

@@ -1464,7 +1470,6 @@ const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k
14641470

14651471
return NULL;
14661472
}
1467-
EXPORT_SYMBOL(ath10k_coredump_get_mem_layout);
14681473

14691474
struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar)
14701475
{

drivers/net/wireless/ath/ath10k/coredump.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ int ath10k_coredump_register(struct ath10k *ar);
176176
void ath10k_coredump_unregister(struct ath10k *ar);
177177
void ath10k_coredump_destroy(struct ath10k *ar);
178178

179+
const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar);
179180
const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar);
180181

181182
#else /* CONFIG_DEV_COREDUMP */
@@ -214,6 +215,12 @@ ath10k_coredump_get_mem_layout(struct ath10k *ar)
214215
return NULL;
215216
}
216217

218+
static inline const struct ath10k_hw_mem_layout *
219+
_ath10k_coredump_get_mem_layout(struct ath10k *ar)
220+
{
221+
return NULL;
222+
}
223+
217224
#endif /* CONFIG_DEV_COREDUMP */
218225

219226
#endif /* _COREDUMP_H_ */

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5583,7 +5583,15 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
55835583
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) {
55845584
arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN,
55855585
GFP_KERNEL);
5586-
arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf;
5586+
5587+
/* Using a kernel pointer in place of a dma_addr_t
5588+
* token can lead to undefined behavior if that
5589+
* makes it into cache management functions. Use a
5590+
* known-invalid address token instead, which
5591+
* avoids the warning and makes it easier to catch
5592+
* bugs if it does end up getting used.
5593+
*/
5594+
arvif->beacon_paddr = DMA_MAPPING_ERROR;
55875595
} else {
55885596
arvif->beacon_buf =
55895597
dma_alloc_coherent(ar->dev,

drivers/net/wireless/ath/ath10k/usb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static int ath10k_usb_submit_ctrl_in(struct ath10k *ar,
525525
req,
526526
USB_DIR_IN | USB_TYPE_VENDOR |
527527
USB_RECIP_DEVICE, value, index, buf,
528-
size, 2 * HZ);
528+
size, 2000);
529529

530530
if (ret < 0) {
531531
ath10k_warn(ar, "Failed to read usb control message: %d\n",
@@ -853,6 +853,11 @@ static int ath10k_usb_setup_pipe_resources(struct ath10k *ar,
853853
le16_to_cpu(endpoint->wMaxPacketSize),
854854
endpoint->bInterval);
855855
}
856+
857+
/* Ignore broken descriptors. */
858+
if (usb_endpoint_maxp(endpoint) == 0)
859+
continue;
860+
856861
urbcount = 0;
857862

858863
pipe_num =

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
8181
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
8282
.fix_l1ss = true,
8383
.max_tx_ring = DP_TCL_NUM_RING_MAX,
84+
.hal_params = &ath11k_hw_hal_params_ipq8074,
8485
},
8586
{
8687
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -129,6 +130,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
129130
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
130131
.fix_l1ss = true,
131132
.max_tx_ring = DP_TCL_NUM_RING_MAX,
133+
.hal_params = &ath11k_hw_hal_params_ipq8074,
132134
},
133135
{
134136
.name = "qca6390 hw2.0",
@@ -176,6 +178,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
176178
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
177179
.fix_l1ss = true,
178180
.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
181+
.hal_params = &ath11k_hw_hal_params_qca6390,
179182
},
180183
{
181184
.name = "qcn9074 hw1.0",
@@ -223,6 +226,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
223226
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
224227
.fix_l1ss = true,
225228
.max_tx_ring = DP_TCL_NUM_RING_MAX,
229+
.hal_params = &ath11k_hw_hal_params_ipq8074,
226230
},
227231
{
228232
.name = "wcn6855 hw2.0",
@@ -270,6 +274,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
270274
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
271275
.fix_l1ss = false,
272276
.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
277+
.hal_params = &ath11k_hw_hal_params_qca6390,
273278
},
274279
};
275280

drivers/net/wireless/ath/ath11k/dp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ int ath11k_dp_service_srng(struct ath11k_base *ab,
739739
int budget)
740740
{
741741
struct napi_struct *napi = &irq_grp->napi;
742+
const struct ath11k_hw_hal_params *hal_params;
742743
int grp_id = irq_grp->grp_id;
743744
int work_done = 0;
744745
int i = 0, j;
@@ -821,8 +822,9 @@ int ath11k_dp_service_srng(struct ath11k_base *ab,
821822
struct ath11k_pdev_dp *dp = &ar->dp;
822823
struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring;
823824

825+
hal_params = ab->hw_params.hal_params;
824826
ath11k_dp_rxbufs_replenish(ab, id, rx_ring, 0,
825-
HAL_RX_BUF_RBM_SW3_BM);
827+
hal_params->rx_buf_rbm);
826828
}
827829
}
828830
}

drivers/net/wireless/ath/ath11k/dp_rx.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int ath11k_dp_rxdma_ring_buf_setup(struct ath11k *ar,
499499

500500
rx_ring->bufs_max = num_entries;
501501
ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries,
502-
HAL_RX_BUF_RBM_SW3_BM);
502+
ar->ab->hw_params.hal_params->rx_buf_rbm);
503503
return 0;
504504
}
505505

@@ -2756,7 +2756,7 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id,
27562756
rx_ring = &ar->dp.rx_refill_buf_ring;
27572757

27582758
ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i],
2759-
HAL_RX_BUF_RBM_SW3_BM);
2759+
ab->hw_params.hal_params->rx_buf_rbm);
27602760
}
27612761

27622762
ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list,
@@ -2949,6 +2949,7 @@ static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id,
29492949
int *budget, struct sk_buff_head *skb_list)
29502950
{
29512951
struct ath11k *ar;
2952+
const struct ath11k_hw_hal_params *hal_params;
29522953
struct ath11k_pdev_dp *dp;
29532954
struct dp_rxdma_ring *rx_ring;
29542955
struct hal_srng *srng;
@@ -3019,8 +3020,9 @@ static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id,
30193020
&buf_id);
30203021

30213022
if (!skb) {
3023+
hal_params = ab->hw_params.hal_params;
30223024
ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, 0, 0,
3023-
HAL_RX_BUF_RBM_SW3_BM);
3025+
hal_params->rx_buf_rbm);
30243026
num_buffs_reaped++;
30253027
break;
30263028
}
@@ -3030,7 +3032,8 @@ static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id,
30303032
FIELD_PREP(DP_RXDMA_BUF_COOKIE_BUF_ID, buf_id);
30313033

30323034
ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, rxcb->paddr,
3033-
cookie, HAL_RX_BUF_RBM_SW3_BM);
3035+
cookie,
3036+
ab->hw_params.hal_params->rx_buf_rbm);
30343037
ath11k_hal_srng_src_get_next_entry(ab, srng);
30353038
num_buffs_reaped++;
30363039
}
@@ -3419,7 +3422,8 @@ static int ath11k_dp_rx_h_defrag_reo_reinject(struct ath11k *ar, struct dp_rx_ti
34193422
cookie = FIELD_PREP(DP_RXDMA_BUF_COOKIE_PDEV_ID, dp->mac_id) |
34203423
FIELD_PREP(DP_RXDMA_BUF_COOKIE_BUF_ID, buf_id);
34213424

3422-
ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie, HAL_RX_BUF_RBM_SW3_BM);
3425+
ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie,
3426+
ab->hw_params.hal_params->rx_buf_rbm);
34233427

34243428
/* Fill mpdu details into reo entrace ring */
34253429
srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id];
@@ -3796,7 +3800,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
37963800
ath11k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
37973801
&rbm);
37983802
if (rbm != HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST &&
3799-
rbm != HAL_RX_BUF_RBM_SW3_BM) {
3803+
rbm != ab->hw_params.hal_params->rx_buf_rbm) {
38003804
ab->soc_stats.invalid_rbm++;
38013805
ath11k_warn(ab, "invalid return buffer manager %d\n", rbm);
38023806
ath11k_dp_rx_link_desc_return(ab, desc,
@@ -3852,7 +3856,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
38523856
rx_ring = &ar->dp.rx_refill_buf_ring;
38533857

38543858
ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i],
3855-
HAL_RX_BUF_RBM_SW3_BM);
3859+
ab->hw_params.hal_params->rx_buf_rbm);
38563860
}
38573861

38583862
return tot_n_bufs_reaped;
@@ -4148,7 +4152,7 @@ int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab,
41484152
rx_ring = &ar->dp.rx_refill_buf_ring;
41494153

41504154
ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i],
4151-
HAL_RX_BUF_RBM_SW3_BM);
4155+
ab->hw_params.hal_params->rx_buf_rbm);
41524156
}
41534157

41544158
rcu_read_lock();
@@ -4257,7 +4261,7 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget)
42574261

42584262
if (num_buf_freed)
42594263
ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed,
4260-
HAL_RX_BUF_RBM_SW3_BM);
4264+
ab->hw_params.hal_params->rx_buf_rbm);
42614265

42624266
return budget - quota;
42634267
}
@@ -4976,6 +4980,7 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
49764980
{
49774981
struct ath11k_pdev_dp *dp = &ar->dp;
49784982
struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data;
4983+
const struct ath11k_hw_hal_params *hal_params;
49794984
void *ring_entry;
49804985
void *mon_dst_srng;
49814986
u32 ppdu_id;
@@ -5039,16 +5044,18 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
50395044

50405045
if (rx_bufs_used) {
50415046
rx_mon_stats->dest_ppdu_done++;
5047+
hal_params = ar->ab->hw_params.hal_params;
5048+
50425049
if (ar->ab->hw_params.rxdma1_enable)
50435050
ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id,
50445051
&dp->rxdma_mon_buf_ring,
50455052
rx_bufs_used,
5046-
HAL_RX_BUF_RBM_SW3_BM);
5053+
hal_params->rx_buf_rbm);
50475054
else
50485055
ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id,
50495056
&dp->rx_refill_buf_ring,
50505057
rx_bufs_used,
5051-
HAL_RX_BUF_RBM_SW3_BM);
5058+
hal_params->rx_buf_rbm);
50525059
}
50535060
}
50545061

drivers/net/wireless/ath/ath11k/hal_rx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ int ath11k_hal_wbm_desc_parse_err(struct ath11k_base *ab, void *desc,
356356
struct hal_wbm_release_ring *wbm_desc = desc;
357357
enum hal_wbm_rel_desc_type type;
358358
enum hal_wbm_rel_src_module rel_src;
359+
enum hal_rx_buf_return_buf_manager ret_buf_mgr;
359360

360361
type = FIELD_GET(HAL_WBM_RELEASE_INFO0_DESC_TYPE,
361362
wbm_desc->info0);
@@ -371,8 +372,9 @@ int ath11k_hal_wbm_desc_parse_err(struct ath11k_base *ab, void *desc,
371372
rel_src != HAL_WBM_REL_SRC_MODULE_REO)
372373
return -EINVAL;
373374

374-
if (FIELD_GET(BUFFER_ADDR_INFO1_RET_BUF_MGR,
375-
wbm_desc->buf_addr_info.info1) != HAL_RX_BUF_RBM_SW3_BM) {
375+
ret_buf_mgr = FIELD_GET(BUFFER_ADDR_INFO1_RET_BUF_MGR,
376+
wbm_desc->buf_addr_info.info1);
377+
if (ret_buf_mgr != ab->hw_params.hal_params->rx_buf_rbm) {
376378
ab->soc_stats.invalid_rbm++;
377379
return -EINVAL;
378380
}

drivers/net/wireless/ath/ath11k/hw.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#include <linux/bitops.h>
88
#include <linux/bitfield.h>
99

10-
#include "hw.h"
1110
#include "core.h"
1211
#include "ce.h"
1312
#include "hif.h"
13+
#include "hal.h"
14+
#include "hw.h"
1415

1516
/* Map from pdev index to hw mac index */
1617
static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx)
@@ -2124,3 +2125,11 @@ const struct ath11k_hw_regs wcn6855_regs = {
21242125
.pcie_qserdes_sysclk_en_sel = 0x01e0c0ac,
21252126
.pcie_pcs_osc_dtct_config_base = 0x01e0c628,
21262127
};
2128+
2129+
const struct ath11k_hw_hal_params ath11k_hw_hal_params_ipq8074 = {
2130+
.rx_buf_rbm = HAL_RX_BUF_RBM_SW3_BM,
2131+
};
2132+
2133+
const struct ath11k_hw_hal_params ath11k_hw_hal_params_qca6390 = {
2134+
.rx_buf_rbm = HAL_RX_BUF_RBM_SW1_BM,
2135+
};

drivers/net/wireless/ath/ath11k/hw.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef ATH11K_HW_H
77
#define ATH11K_HW_H
88

9+
#include "hal.h"
910
#include "wmi.h"
1011

1112
/* Target configuration defines */
@@ -119,6 +120,10 @@ struct ath11k_hw_ring_mask {
119120
u8 host2rxdma[ATH11K_EXT_IRQ_GRP_NUM_MAX];
120121
};
121122

123+
struct ath11k_hw_hal_params {
124+
enum hal_rx_buf_return_buf_manager rx_buf_rbm;
125+
};
126+
122127
struct ath11k_hw_params {
123128
const char *name;
124129
u16 hw_rev;
@@ -170,6 +175,7 @@ struct ath11k_hw_params {
170175
u32 hal_desc_sz;
171176
bool fix_l1ss;
172177
u8 max_tx_ring;
178+
const struct ath11k_hw_hal_params *hal_params;
173179
};
174180

175181
struct ath11k_hw_ops {
@@ -223,6 +229,9 @@ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
223229
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
224230
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074;
225231

232+
extern const struct ath11k_hw_hal_params ath11k_hw_hal_params_ipq8074;
233+
extern const struct ath11k_hw_hal_params ath11k_hw_hal_params_qca6390;
234+
226235
static inline
227236
int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw,
228237
int pdev_idx)

drivers/net/wireless/ath/ath6kl/usb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ static int ath6kl_usb_setup_pipe_resources(struct ath6kl_usb *ar_usb)
340340
le16_to_cpu(endpoint->wMaxPacketSize),
341341
endpoint->bInterval);
342342
}
343+
344+
/* Ignore broken descriptors. */
345+
if (usb_endpoint_maxp(endpoint) == 0)
346+
continue;
347+
343348
urbcount = 0;
344349

345350
pipe_num =
@@ -907,7 +912,7 @@ static int ath6kl_usb_submit_ctrl_in(struct ath6kl_usb *ar_usb,
907912
req,
908913
USB_DIR_IN | USB_TYPE_VENDOR |
909914
USB_RECIP_DEVICE, value, index, buf,
910-
size, 2 * HZ);
915+
size, 2000);
911916

912917
if (ret < 0) {
913918
ath6kl_warn("Failed to read usb control message: %d\n", ret);

0 commit comments

Comments
 (0)