Skip to content

Commit 97ef122

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 5.5. Major changes: ath10k * add support for hardware rfkill on devices where firmware supports it
2 parents 4a50d45 + 2c84067 commit 97ef122

File tree

31 files changed

+719
-420
lines changed

31 files changed

+719
-420
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ Optional properties:
8181
Definition: Name of external front end module used. Some valid FEM names
8282
for example: "microsemi-lx5586", "sky85703-11"
8383
and "sky85803" etc.
84+
- qcom,snoc-host-cap-8bit-quirk:
85+
Usage: Optional
86+
Value type: <empty>
87+
Definition: Quirk specifying that the firmware expects the 8bit version
88+
of the host capability QMI request
89+
- qcom,xo-cal-data: xo cal offset to be configured in xo trim register.
8490

8591
Example (to supply PCI based wifi block details):
8692

drivers/net/wireless/ath/ar5523/ar5523.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata,
255255

256256
if (flags & AR5523_CMD_FLAG_MAGIC)
257257
hdr->magic = cpu_to_be32(1 << 24);
258-
memcpy(hdr + 1, idata, ilen);
258+
if (ilen)
259+
memcpy(hdr + 1, idata, ilen);
259260

260261
cmd->odata = odata;
261262
cmd->olen = olen;

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

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -677,13 +677,22 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
677677
complete(&ar->target_suspend);
678678
}
679679

680-
static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
680+
static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
681681
{
682+
int ret;
682683
u32 param = 0;
683684

684-
ath10k_bmi_write32(ar, hi_mbox_io_block_sz, 256);
685-
ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99);
686-
ath10k_bmi_read32(ar, hi_acs_flags, &param);
685+
ret = ath10k_bmi_write32(ar, hi_mbox_io_block_sz, 256);
686+
if (ret)
687+
return ret;
688+
689+
ret = ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99);
690+
if (ret)
691+
return ret;
692+
693+
ret = ath10k_bmi_read32(ar, hi_acs_flags, &param);
694+
if (ret)
695+
return ret;
687696

688697
/* Data transfer is not initiated, when reduced Tx completion
689698
* is used for SDIO. disable it until fixed
@@ -700,14 +709,23 @@ static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
700709
else
701710
param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
702711

703-
ath10k_bmi_write32(ar, hi_acs_flags, param);
712+
ret = ath10k_bmi_write32(ar, hi_acs_flags, param);
713+
if (ret)
714+
return ret;
704715

705716
/* Explicitly set fwlog prints to zero as target may turn it on
706717
* based on scratch registers.
707718
*/
708-
ath10k_bmi_read32(ar, hi_option_flag, &param);
719+
ret = ath10k_bmi_read32(ar, hi_option_flag, &param);
720+
if (ret)
721+
return ret;
722+
709723
param |= HI_OPTION_DISABLE_DBGLOG;
710-
ath10k_bmi_write32(ar, hi_option_flag, param);
724+
ret = ath10k_bmi_write32(ar, hi_option_flag, param);
725+
if (ret)
726+
return ret;
727+
728+
return 0;
711729
}
712730

713731
static int ath10k_init_configure_target(struct ath10k *ar)
@@ -2118,12 +2136,15 @@ static int ath10k_init_uart(struct ath10k *ar)
21182136
return ret;
21192137
}
21202138

2121-
if (!uart_print && ar->hw_params.uart_pin_workaround) {
2122-
ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
2123-
ar->hw_params.uart_pin);
2124-
if (ret) {
2125-
ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
2126-
return ret;
2139+
if (!uart_print) {
2140+
if (ar->hw_params.uart_pin_workaround) {
2141+
ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
2142+
ar->hw_params.uart_pin);
2143+
if (ret) {
2144+
ath10k_warn(ar, "failed to set UART TX pin: %d",
2145+
ret);
2146+
return ret;
2147+
}
21272148
}
21282149

21292150
return 0;
@@ -2562,8 +2583,13 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
25622583
if (status)
25632584
goto err;
25642585

2565-
if (ar->hif.bus == ATH10K_BUS_SDIO)
2566-
ath10k_init_sdio(ar, mode);
2586+
if (ar->hif.bus == ATH10K_BUS_SDIO) {
2587+
status = ath10k_init_sdio(ar, mode);
2588+
if (status) {
2589+
ath10k_err(ar, "failed to init SDIO: %d\n", status);
2590+
goto err;
2591+
}
2592+
}
25672593
}
25682594

25692595
ar->htc.htc_ops.target_send_suspend_complete =
@@ -2784,7 +2810,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
27842810

27852811
status = ath10k_hif_set_target_log_mode(ar, fw_diag_log);
27862812
if (status && status != -EOPNOTSUPP) {
2787-
ath10k_warn(ar, "set traget log mode faileds: %d\n", status);
2813+
ath10k_warn(ar, "set target log mode failed: %d\n", status);
27882814
goto err_hif_stop;
27892815
}
27902816

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ struct ath10k_wmi {
169169
struct wmi_cmd_map *cmd;
170170
struct wmi_vdev_param_map *vdev_param;
171171
struct wmi_pdev_param_map *pdev_param;
172+
struct wmi_peer_param_map *peer_param;
172173
const struct wmi_ops *ops;
173174
const struct wmi_peer_flags_map *peer_flags;
174175

@@ -963,12 +964,20 @@ struct ath10k {
963964
u32 hw_eeprom_rd;
964965
u32 ht_cap_info;
965966
u32 vht_cap_info;
967+
u32 vht_supp_mcs;
966968
u32 num_rf_chains;
967969
u32 max_spatial_stream;
968970
/* protected by conf_mutex */
971+
u32 low_2ghz_chan;
972+
u32 high_2ghz_chan;
969973
u32 low_5ghz_chan;
970974
u32 high_5ghz_chan;
971975
bool ani_enabled;
976+
u32 sys_cap_info;
977+
978+
/* protected by data_lock */
979+
bool hw_rfkill_on;
980+
972981
/* protected by conf_mutex */
973982
u8 ps_state_enable;
974983

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

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ static const struct ath10k_mem_region qca99x0_hw20_mem_regions[] = {
703703
},
704704
{
705705
.type = ATH10K_MEM_REGION_TYPE_REG,
706-
.start = 0x98000,
706+
.start = 0x980000,
707707
.len = 0x50000,
708708
.name = "IRAM",
709709
.section_table = {
@@ -786,7 +786,7 @@ static const struct ath10k_mem_region qca9984_hw10_mem_regions[] = {
786786
},
787787
{
788788
.type = ATH10K_MEM_REGION_TYPE_REG,
789-
.start = 0x98000,
789+
.start = 0x980000,
790790
.len = 0x50000,
791791
.name = "IRAM",
792792
.section_table = {
@@ -891,7 +891,7 @@ static const struct ath10k_mem_region qca4019_hw10_mem_regions[] = {
891891
},
892892
{
893893
.type = ATH10K_MEM_REGION_TYPE_REG,
894-
.start = 0x98000,
894+
.start = 0x980000,
895895
.len = 0x50000,
896896
.name = "IRAM",
897897
.section_table = {
@@ -951,6 +951,19 @@ static const struct ath10k_mem_region qca4019_hw10_mem_regions[] = {
951951
},
952952
};
953953

954+
static const struct ath10k_mem_region wcn399x_hw10_mem_regions[] = {
955+
{
956+
/* MSA region start is not fixed, hence it is assigned at runtime */
957+
.type = ATH10K_MEM_REGION_TYPE_MSA,
958+
.len = 0x100000,
959+
.name = "DRAM",
960+
.section_table = {
961+
.sections = NULL,
962+
.size = 0,
963+
},
964+
},
965+
};
966+
954967
static const struct ath10k_hw_mem_layout hw_mem_layouts[] = {
955968
{
956969
.hw_id = QCA6174_HW_1_0_VERSION,
@@ -1048,6 +1061,14 @@ static const struct ath10k_hw_mem_layout hw_mem_layouts[] = {
10481061
.size = ARRAY_SIZE(qca4019_hw10_mem_regions),
10491062
},
10501063
},
1064+
{
1065+
.hw_id = WCN3990_HW_1_0_DEV_VERSION,
1066+
.hw_rev = ATH10K_HW_WCN3990,
1067+
.region_table = {
1068+
.regions = wcn399x_hw10_mem_regions,
1069+
.size = ARRAY_SIZE(wcn399x_hw10_mem_regions),
1070+
},
1071+
},
10511072
};
10521073

10531074
static u32 ath10k_coredump_get_ramdump_size(struct ath10k *ar)
@@ -1208,9 +1229,11 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
12081229
dump_tlv = (struct ath10k_tlv_dump_data *)(buf + sofar);
12091230
dump_tlv->type = cpu_to_le32(ATH10K_FW_CRASH_DUMP_RAM_DATA);
12101231
dump_tlv->tlv_len = cpu_to_le32(crash_data->ramdump_buf_len);
1211-
memcpy(dump_tlv->tlv_data, crash_data->ramdump_buf,
1212-
crash_data->ramdump_buf_len);
1213-
sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
1232+
if (crash_data->ramdump_buf_len) {
1233+
memcpy(dump_tlv->tlv_data, crash_data->ramdump_buf,
1234+
crash_data->ramdump_buf_len);
1235+
sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
1236+
}
12141237
}
12151238

12161239
mutex_unlock(&ar->dump_mutex);
@@ -1257,6 +1280,9 @@ int ath10k_coredump_register(struct ath10k *ar)
12571280
if (test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask)) {
12581281
crash_data->ramdump_buf_len = ath10k_coredump_get_ramdump_size(ar);
12591282

1283+
if (!crash_data->ramdump_buf_len)
1284+
return 0;
1285+
12601286
crash_data->ramdump_buf = vzalloc(crash_data->ramdump_buf_len);
12611287
if (!crash_data->ramdump_buf)
12621288
return -ENOMEM;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ enum ath10k_mem_region_type {
115115
ATH10K_MEM_REGION_TYPE_IRAM2 = 5,
116116
ATH10K_MEM_REGION_TYPE_IOSRAM = 6,
117117
ATH10K_MEM_REGION_TYPE_IOREG = 7,
118+
ATH10K_MEM_REGION_TYPE_MSA = 8,
118119
};
119120

120121
/* Define a section of the region which should be copied. As not all parts

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ ath10k_dbg_sta_write_peer_debug_trigger(struct file *file,
430430
}
431431

432432
ret = ath10k_wmi_peer_set_param(ar, arsta->arvif->vdev_id, sta->addr,
433-
WMI_PEER_DEBUG, peer_debug_trigger);
433+
ar->wmi.peer_param->debug, peer_debug_trigger);
434434
if (ret) {
435435
ath10k_warn(ar, "failed to set param to trigger peer tid logs for station ret: %d\n",
436436
ret);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2726,7 +2726,7 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
27262726
spin_lock_bh(&ar->data_lock);
27272727

27282728
peer = ath10k_peer_find_by_id(ar, peer_id);
2729-
if (!peer) {
2729+
if (!peer || !peer->sta) {
27302730
spin_unlock_bh(&ar->data_lock);
27312731
rcu_read_unlock();
27322732
continue;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ const struct ath10k_hw_values qca6174_values = {
155155
.num_target_ce_config_wlan = 7,
156156
.ce_desc_meta_data_mask = 0xFFFC,
157157
.ce_desc_meta_data_lsb = 2,
158+
.rfkill_pin = 16,
159+
.rfkill_cfg = 0,
160+
.rfkill_on_level = 1,
158161
};
159162

160163
const struct ath10k_hw_values qca99x0_values = {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ struct ath10k_hw_values {
379379
u8 num_target_ce_config_wlan;
380380
u16 ce_desc_meta_data_mask;
381381
u8 ce_desc_meta_data_lsb;
382+
u32 rfkill_pin;
383+
u32 rfkill_cfg;
384+
bool rfkill_on_level;
382385
};
383386

384387
extern const struct ath10k_hw_values qca988x_values;

0 commit comments

Comments
 (0)