Skip to content

Commit 1dde35d

Browse files
author
Kalle Valo
committed
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for 4.16. Major changes: ath10k * enable multiqueue support for all hw using mac80211 wake_tx_queue op * new Kconfig option ATH10K_SPECTRAL to save RAM * show tx stats on QCA9880 * new qcom,ath10k-calibration-variant DT entry * WMI layer support for wcn3990 ath9k * new Kconfig option ATH9K_COMMON_SPECTRAL to save RAM wcn36xx * hardware scan offload support wil6210 * run-time PM support when interface is down
2 parents 7de241f + 03a7228 commit 1dde35d

Some content is hidden

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

42 files changed

+1657
-337
lines changed

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Optional properties:
4141
- qcom,msi_addr: MSI interrupt address.
4242
- qcom,msi_base: Base value to add before writing MSI data into
4343
MSI address register.
44+
- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
45+
variant list with the same bus and device
46+
specific ids
4447
- qcom,ath10k-calibration-data : calibration data + board specific data
4548
as an array, the length can vary between
4649
hw versions.

drivers/net/wireless/ath/ath10k/Kconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,19 @@ config ATH10K_DEBUG
4747
config ATH10K_DEBUGFS
4848
bool "Atheros ath10k debugfs support"
4949
depends on ATH10K && DEBUG_FS
50-
select RELAY
5150
---help---
5251
Enabled debugfs support
5352

5453
If unsure, say Y to make it easier to debug problems.
5554

55+
config ATH10K_SPECTRAL
56+
bool "Atheros ath10k spectral scan support"
57+
depends on ATH10K_DEBUGFS
58+
select RELAY
59+
default n
60+
---help---
61+
Say Y to enable access to the FFT/spectral data via debugfs.
62+
5663
config ATH10K_TRACING
5764
bool "Atheros ath10k tracing support"
5865
depends on ATH10K

drivers/net/wireless/ath/ath10k/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ath10k_core-y += mac.o \
1515
p2p.o \
1616
swap.o
1717

18-
ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o
18+
ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o
1919
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
2020
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
2121
ath10k_core-$(CONFIG_THERMAL) += thermal.o

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

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
7575
.vht160_mcs_rx_highest = 0,
7676
.vht160_mcs_tx_highest = 0,
7777
.n_cipher_suites = 8,
78+
.num_peers = TARGET_TLV_NUM_PEERS,
79+
.ast_skid_limit = 0x10,
80+
.num_wds_entries = 0x20,
7881
},
7982
{
8083
.id = QCA9887_HW_1_0_VERSION,
@@ -99,6 +102,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
99102
.vht160_mcs_rx_highest = 0,
100103
.vht160_mcs_tx_highest = 0,
101104
.n_cipher_suites = 8,
105+
.num_peers = TARGET_TLV_NUM_PEERS,
106+
.ast_skid_limit = 0x10,
107+
.num_wds_entries = 0x20,
102108
},
103109
{
104110
.id = QCA6174_HW_2_1_VERSION,
@@ -122,6 +128,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
122128
.vht160_mcs_rx_highest = 0,
123129
.vht160_mcs_tx_highest = 0,
124130
.n_cipher_suites = 8,
131+
.num_peers = TARGET_TLV_NUM_PEERS,
132+
.ast_skid_limit = 0x10,
133+
.num_wds_entries = 0x20,
125134
},
126135
{
127136
.id = QCA6174_HW_2_1_VERSION,
@@ -145,6 +154,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
145154
.vht160_mcs_rx_highest = 0,
146155
.vht160_mcs_tx_highest = 0,
147156
.n_cipher_suites = 8,
157+
.num_peers = TARGET_TLV_NUM_PEERS,
158+
.ast_skid_limit = 0x10,
159+
.num_wds_entries = 0x20,
148160
},
149161
{
150162
.id = QCA6174_HW_3_0_VERSION,
@@ -168,6 +180,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
168180
.vht160_mcs_rx_highest = 0,
169181
.vht160_mcs_tx_highest = 0,
170182
.n_cipher_suites = 8,
183+
.num_peers = TARGET_TLV_NUM_PEERS,
184+
.ast_skid_limit = 0x10,
185+
.num_wds_entries = 0x20,
171186
},
172187
{
173188
.id = QCA6174_HW_3_2_VERSION,
@@ -194,6 +209,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
194209
.vht160_mcs_rx_highest = 0,
195210
.vht160_mcs_tx_highest = 0,
196211
.n_cipher_suites = 8,
212+
.num_peers = TARGET_TLV_NUM_PEERS,
213+
.ast_skid_limit = 0x10,
214+
.num_wds_entries = 0x20,
197215
},
198216
{
199217
.id = QCA99X0_HW_2_0_DEV_VERSION,
@@ -223,6 +241,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
223241
.vht160_mcs_rx_highest = 0,
224242
.vht160_mcs_tx_highest = 0,
225243
.n_cipher_suites = 11,
244+
.num_peers = TARGET_TLV_NUM_PEERS,
245+
.ast_skid_limit = 0x10,
246+
.num_wds_entries = 0x20,
226247
},
227248
{
228249
.id = QCA9984_HW_1_0_DEV_VERSION,
@@ -257,6 +278,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
257278
.vht160_mcs_rx_highest = 1560,
258279
.vht160_mcs_tx_highest = 1560,
259280
.n_cipher_suites = 11,
281+
.num_peers = TARGET_TLV_NUM_PEERS,
282+
.ast_skid_limit = 0x10,
283+
.num_wds_entries = 0x20,
260284
},
261285
{
262286
.id = QCA9888_HW_2_0_DEV_VERSION,
@@ -290,6 +314,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
290314
.vht160_mcs_rx_highest = 780,
291315
.vht160_mcs_tx_highest = 780,
292316
.n_cipher_suites = 11,
317+
.num_peers = TARGET_TLV_NUM_PEERS,
318+
.ast_skid_limit = 0x10,
319+
.num_wds_entries = 0x20,
293320
},
294321
{
295322
.id = QCA9377_HW_1_0_DEV_VERSION,
@@ -313,6 +340,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
313340
.vht160_mcs_rx_highest = 0,
314341
.vht160_mcs_tx_highest = 0,
315342
.n_cipher_suites = 8,
343+
.num_peers = TARGET_TLV_NUM_PEERS,
344+
.ast_skid_limit = 0x10,
345+
.num_wds_entries = 0x20,
316346
},
317347
{
318348
.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -338,6 +368,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
338368
.vht160_mcs_rx_highest = 0,
339369
.vht160_mcs_tx_highest = 0,
340370
.n_cipher_suites = 8,
371+
.num_peers = TARGET_TLV_NUM_PEERS,
372+
.ast_skid_limit = 0x10,
373+
.num_wds_entries = 0x20,
341374
},
342375
{
343376
.id = QCA4019_HW_1_0_DEV_VERSION,
@@ -368,6 +401,27 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
368401
.vht160_mcs_rx_highest = 0,
369402
.vht160_mcs_tx_highest = 0,
370403
.n_cipher_suites = 11,
404+
.num_peers = TARGET_TLV_NUM_PEERS,
405+
.ast_skid_limit = 0x10,
406+
.num_wds_entries = 0x20,
407+
},
408+
{
409+
.id = WCN3990_HW_1_0_DEV_VERSION,
410+
.dev_id = 0,
411+
.name = "wcn3990 hw1.0",
412+
.continuous_frag_desc = true,
413+
.tx_chain_mask = 0x7,
414+
.rx_chain_mask = 0x7,
415+
.max_spatial_stream = 4,
416+
.fw = {
417+
.dir = WCN3990_HW_1_0_FW_DIR,
418+
},
419+
.sw_decrypt_mcast_mgmt = true,
420+
.hw_ops = &wcn3990_ops,
421+
.decap_align_bytes = 1,
422+
.num_peers = TARGET_HL_10_TLV_NUM_PEERS,
423+
.ast_skid_limit = TARGET_HL_10_TLV_AST_SKID_LIMIT,
424+
.num_wds_entries = TARGET_HL_10_TLV_NUM_WDS_ENTRIES,
371425
},
372426
};
373427

@@ -390,6 +444,7 @@ static const char *const ath10k_core_fw_feature_str[] = {
390444
[ATH10K_FW_FEATURE_SKIP_NULL_FUNC_WAR] = "skip-null-func-war",
391445
[ATH10K_FW_FEATURE_ALLOWS_MESH_BCAST] = "allows-mesh-bcast",
392446
[ATH10K_FW_FEATURE_NO_PS] = "no-ps",
447+
[ATH10K_FW_FEATURE_MGMT_TX_BY_REF] = "mgmt-tx-by-reference",
393448
};
394449

395450
static unsigned int ath10k_core_get_fw_feature_str(char *buf,
@@ -860,6 +915,28 @@ static int ath10k_core_check_smbios(struct ath10k *ar)
860915
return 0;
861916
}
862917

918+
static int ath10k_core_check_dt(struct ath10k *ar)
919+
{
920+
struct device_node *node;
921+
const char *variant = NULL;
922+
923+
node = ar->dev->of_node;
924+
if (!node)
925+
return -ENOENT;
926+
927+
of_property_read_string(node, "qcom,ath10k-calibration-variant",
928+
&variant);
929+
if (!variant)
930+
return -ENODATA;
931+
932+
if (strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext)) < 0)
933+
ath10k_dbg(ar, ATH10K_DBG_BOOT,
934+
"bdf variant string is longer than the buffer can accommodate (variant: %s)\n",
935+
variant);
936+
937+
return 0;
938+
}
939+
863940
static int ath10k_download_and_run_otp(struct ath10k *ar)
864941
{
865942
u32 result, address = ar->hw_params.patch_load_addr;
@@ -1231,19 +1308,19 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
12311308
/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
12321309
char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
12331310

1311+
if (ar->id.bdf_ext[0] != '\0')
1312+
scnprintf(variant, sizeof(variant), ",variant=%s",
1313+
ar->id.bdf_ext);
1314+
12341315
if (ar->id.bmi_ids_valid) {
12351316
scnprintf(name, name_len,
1236-
"bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
1317+
"bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
12371318
ath10k_bus_str(ar->hif.bus),
12381319
ar->id.bmi_chip_id,
1239-
ar->id.bmi_board_id);
1320+
ar->id.bmi_board_id, variant);
12401321
goto out;
12411322
}
12421323

1243-
if (ar->id.bdf_ext[0] != '\0')
1244-
scnprintf(variant, sizeof(variant), ",variant=%s",
1245-
ar->id.bdf_ext);
1246-
12471324
scnprintf(name, name_len,
12481325
"bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
12491326
ath10k_bus_str(ar->hif.bus),
@@ -2343,7 +2420,11 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
23432420

23442421
ret = ath10k_core_check_smbios(ar);
23452422
if (ret)
2346-
ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
2423+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
2424+
2425+
ret = ath10k_core_check_dt(ar);
2426+
if (ret)
2427+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
23472428

23482429
ret = ath10k_core_fetch_board_file(ar);
23492430
if (ret) {

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767

6868
/* NAPI poll budget */
6969
#define ATH10K_NAPI_BUDGET 64
70-
#define ATH10K_NAPI_QUOTA_LIMIT 60
7170

7271
/* SMBIOS type containing Board Data File Name Extension */
7372
#define ATH10K_SMBIOS_BDF_EXT_TYPE 0xF8
@@ -364,11 +363,11 @@ struct ath10k_sta {
364363
struct rate_info txrate;
365364

366365
struct work_struct update_wk;
366+
u64 rx_duration;
367367

368368
#ifdef CONFIG_MAC80211_DEBUGFS
369369
/* protected by conf_mutex */
370370
bool aggr_mode;
371-
u64 rx_duration;
372371
#endif
373372
};
374373

@@ -463,7 +462,7 @@ struct ath10k_fw_crash_data {
463462
bool crashed_since_read;
464463

465464
guid_t guid;
466-
struct timespec timestamp;
465+
struct timespec64 timestamp;
467466
__le32 registers[REG_DUMP_COUNT_QCA988X];
468467
struct ath10k_ce_crash_data ce_crash_data[CE_COUNT_MAX];
469468
};
@@ -488,7 +487,6 @@ struct ath10k_debug {
488487
/* protected by conf_mutex */
489488
u64 fw_dbglog_mask;
490489
u32 fw_dbglog_level;
491-
u32 pktlog_filter;
492490
u32 reg_addr;
493491
u32 nf_cal_period;
494492
void *cal_data;
@@ -615,6 +613,9 @@ enum ath10k_fw_features {
615613
/* Firmware does not support power save in station mode. */
616614
ATH10K_FW_FEATURE_NO_PS = 17,
617615

616+
/* Firmware allows management tx by reference instead of by value. */
617+
ATH10K_FW_FEATURE_MGMT_TX_BY_REF = 18,
618+
618619
/* keep last */
619620
ATH10K_FW_FEATURE_COUNT,
620621
};
@@ -963,6 +964,7 @@ struct ath10k {
963964
} spectral;
964965
#endif
965966

967+
u32 pktlog_filter;
966968
struct {
967969
/* protected by conf_mutex */
968970
struct ath10k_fw_components utf_mode_fw;

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
720720

721721
crash_data->crashed_since_read = true;
722722
guid_gen(&crash_data->guid);
723-
getnstimeofday(&crash_data->timestamp);
723+
ktime_get_real_ts64(&crash_data->timestamp);
724724

725725
return crash_data;
726726
}
@@ -1950,14 +1950,14 @@ int ath10k_debug_start(struct ath10k *ar)
19501950
ret);
19511951
}
19521952

1953-
if (ar->debug.pktlog_filter) {
1953+
if (ar->pktlog_filter) {
19541954
ret = ath10k_wmi_pdev_pktlog_enable(ar,
1955-
ar->debug.pktlog_filter);
1955+
ar->pktlog_filter);
19561956
if (ret)
19571957
/* not serious */
19581958
ath10k_warn(ar,
19591959
"failed to enable pktlog filter %x: %d\n",
1960-
ar->debug.pktlog_filter, ret);
1960+
ar->pktlog_filter, ret);
19611961
} else {
19621962
ret = ath10k_wmi_pdev_pktlog_disable(ar);
19631963
if (ret)
@@ -2097,12 +2097,12 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
20972097
mutex_lock(&ar->conf_mutex);
20982098

20992099
if (ar->state != ATH10K_STATE_ON) {
2100-
ar->debug.pktlog_filter = filter;
2100+
ar->pktlog_filter = filter;
21012101
ret = count;
21022102
goto out;
21032103
}
21042104

2105-
if (filter == ar->debug.pktlog_filter) {
2105+
if (filter == ar->pktlog_filter) {
21062106
ret = count;
21072107
goto out;
21082108
}
@@ -2111,7 +2111,7 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
21112111
ret = ath10k_wmi_pdev_pktlog_enable(ar, filter);
21122112
if (ret) {
21132113
ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n",
2114-
ar->debug.pktlog_filter, ret);
2114+
ar->pktlog_filter, ret);
21152115
goto out;
21162116
}
21172117
} else {
@@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
21222122
}
21232123
}
21242124

2125-
ar->debug.pktlog_filter = filter;
2125+
ar->pktlog_filter = filter;
21262126
ret = count;
21272127

21282128
out:
@@ -2139,7 +2139,7 @@ static ssize_t ath10k_read_pktlog_filter(struct file *file, char __user *ubuf,
21392139

21402140
mutex_lock(&ar->conf_mutex);
21412141
len = scnprintf(buf, sizeof(buf) - len, "%08x\n",
2142-
ar->debug.pktlog_filter);
2142+
ar->pktlog_filter);
21432143
mutex_unlock(&ar->conf_mutex);
21442144

21452145
return simple_read_from_buffer(ubuf, count, ppos, buf, len);

0 commit comments

Comments
 (0)