Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d98c3ed

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2015-05-21' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== ath10k: * enable channel 144 on 5 GHz * enable Adaptive Noise Immunity (ANI) by default * add Wake on Wireless LAN (WOW) patterns support * add basic Tunneled Direct Link Setup (TDLS) support * add multi-channel support for QCA6174 * enable IBSS RSN support * enable Bluetooth Coexistance whenever firmware supports it * add more versatile way to set bitrates used by the firmware ath9k: * spectral scan: add support for multiple FFT frames per report iwlwifi: * major rework of the scan code (Luca) * some work on the thermal code (Chaya Rachel) * some work on the firwmare debugging infrastructure brcmfmac: * SDIO suspend and resume fixes * wiphy band info and changes in regulatory settings * add support for BCM4324 SDIO and BCM4358 PCIe * enable support of PCIe devices on router platforms (Hante) ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 4029685 + 6e65104 commit d98c3ed

Some content is hidden

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

75 files changed

+6724
-2385
lines changed

drivers/bcma/driver_gpio.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
226226
chip->of_node = cc->core->dev.of_node;
227227
#endif
228228
switch (bus->chipinfo.id) {
229+
case BCMA_CHIP_ID_BCM4707:
229230
case BCMA_CHIP_ID_BCM5357:
230231
case BCMA_CHIP_ID_BCM53572:
231232
chip->ngpio = 32;
@@ -235,16 +236,17 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
235236
}
236237

237238
/*
238-
* On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
239-
* pin numbers. We don't have Device Tree there and we can't really use
240-
* relative (per chip) numbers.
241-
* So let's use predictable base for BCM47XX and "random" for all other.
239+
* Register SoC GPIO devices with absolute GPIO pin base.
240+
* On MIPS, we don't have Device Tree and we can't use relative (per chip)
241+
* GPIO numbers.
242+
* On some ARM devices, user space may want to access some system GPIO
243+
* pins directly, which is easier to do with a predictable GPIO base.
242244
*/
243-
#if IS_BUILTIN(CONFIG_BCM47XX)
244-
chip->base = bus->num * BCMA_GPIO_MAX_PINS;
245-
#else
246-
chip->base = -1;
247-
#endif
245+
if (IS_BUILTIN(CONFIG_BCM47XX) ||
246+
cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
247+
chip->base = bus->num * BCMA_GPIO_MAX_PINS;
248+
else
249+
chip->base = -1;
248250

249251
err = bcma_gpio_irq_domain_init(cc);
250252
if (err)

drivers/net/wireless/ath/ath.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ void ath_printk(const char *level, const struct ath_common *common,
251251
* @ATH_DBG_DFS: radar datection
252252
* @ATH_DBG_WOW: Wake on Wireless
253253
* @ATH_DBG_DYNACK: dynack handling
254+
* @ATH_DBG_SPECTRAL_SCAN: FFT spectral scan
254255
* @ATH_DBG_ANY: enable all debugging
255256
*
256257
* The debug level is used to control the amount and type of debugging output
@@ -280,6 +281,7 @@ enum ATH_DEBUG {
280281
ATH_DBG_WOW = 0x00020000,
281282
ATH_DBG_CHAN_CTX = 0x00040000,
282283
ATH_DBG_DYNACK = 0x00080000,
284+
ATH_DBG_SPECTRAL_SCAN = 0x00100000,
283285
ATH_DBG_ANY = 0xffffffff
284286
};
285287

drivers/net/wireless/ath/ath10k/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ ath10k_core-y += mac.o \
1010
wmi.o \
1111
wmi-tlv.o \
1212
bmi.o \
13-
hw.o
13+
hw.o \
14+
p2p.o
1415

1516
ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o
1617
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
1718
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
1819
ath10k_core-$(CONFIG_THERMAL) += thermal.o
1920
ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
21+
ath10k_core-$(CONFIG_PM) += wow.o
2022

2123
obj-$(CONFIG_ATH10K_PCI) += ath10k_pci.o
2224
ath10k_pci-y += pci.o \

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

Lines changed: 121 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -482,31 +482,79 @@ static int ath10k_fetch_cal_file(struct ath10k *ar)
482482
return 0;
483483
}
484484

485-
static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar)
485+
static int ath10k_core_fetch_spec_board_file(struct ath10k *ar)
486486
{
487-
int ret = 0;
487+
char filename[100];
488488

489-
if (ar->hw_params.fw.fw == NULL) {
490-
ath10k_err(ar, "firmware file not defined\n");
491-
return -EINVAL;
492-
}
489+
scnprintf(filename, sizeof(filename), "board-%s-%s.bin",
490+
ath10k_bus_str(ar->hif.bus), ar->spec_board_id);
491+
492+
ar->board = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, filename);
493+
if (IS_ERR(ar->board))
494+
return PTR_ERR(ar->board);
495+
496+
ar->board_data = ar->board->data;
497+
ar->board_len = ar->board->size;
498+
ar->spec_board_loaded = true;
493499

494-
if (ar->hw_params.fw.board == NULL) {
495-
ath10k_err(ar, "board data file not defined");
500+
return 0;
501+
}
502+
503+
static int ath10k_core_fetch_generic_board_file(struct ath10k *ar)
504+
{
505+
if (!ar->hw_params.fw.board) {
506+
ath10k_err(ar, "failed to find board file fw entry\n");
496507
return -EINVAL;
497508
}
498509

499510
ar->board = ath10k_fetch_fw_file(ar,
500511
ar->hw_params.fw.dir,
501512
ar->hw_params.fw.board);
502-
if (IS_ERR(ar->board)) {
503-
ret = PTR_ERR(ar->board);
504-
ath10k_err(ar, "could not fetch board data (%d)\n", ret);
505-
goto err;
506-
}
513+
if (IS_ERR(ar->board))
514+
return PTR_ERR(ar->board);
507515

508516
ar->board_data = ar->board->data;
509517
ar->board_len = ar->board->size;
518+
ar->spec_board_loaded = false;
519+
520+
return 0;
521+
}
522+
523+
static int ath10k_core_fetch_board_file(struct ath10k *ar)
524+
{
525+
int ret;
526+
527+
if (strlen(ar->spec_board_id) > 0) {
528+
ret = ath10k_core_fetch_spec_board_file(ar);
529+
if (ret) {
530+
ath10k_info(ar, "failed to load spec board file, falling back to generic: %d\n",
531+
ret);
532+
goto generic;
533+
}
534+
535+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "found specific board file for %s\n",
536+
ar->spec_board_id);
537+
return 0;
538+
}
539+
540+
generic:
541+
ret = ath10k_core_fetch_generic_board_file(ar);
542+
if (ret) {
543+
ath10k_err(ar, "failed to fetch generic board data: %d\n", ret);
544+
return ret;
545+
}
546+
547+
return 0;
548+
}
549+
550+
static int ath10k_core_fetch_firmware_api_1(struct ath10k *ar)
551+
{
552+
int ret = 0;
553+
554+
if (ar->hw_params.fw.fw == NULL) {
555+
ath10k_err(ar, "firmware file not defined\n");
556+
return -EINVAL;
557+
}
510558

511559
ar->firmware = ath10k_fetch_fw_file(ar,
512560
ar->hw_params.fw.dir,
@@ -675,6 +723,17 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
675723
ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie wmi op version %d\n",
676724
ar->wmi.op_version);
677725
break;
726+
case ATH10K_FW_IE_HTT_OP_VERSION:
727+
if (ie_len != sizeof(u32))
728+
break;
729+
730+
version = (__le32 *)data;
731+
732+
ar->htt.op_version = le32_to_cpup(version);
733+
734+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie htt op version %d\n",
735+
ar->htt.op_version);
736+
break;
678737
default:
679738
ath10k_warn(ar, "Unknown FW IE: %u\n",
680739
le32_to_cpu(hdr->id));
@@ -695,27 +754,6 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
695754
goto err;
696755
}
697756

698-
/* now fetch the board file */
699-
if (ar->hw_params.fw.board == NULL) {
700-
ath10k_err(ar, "board data file not defined");
701-
ret = -EINVAL;
702-
goto err;
703-
}
704-
705-
ar->board = ath10k_fetch_fw_file(ar,
706-
ar->hw_params.fw.dir,
707-
ar->hw_params.fw.board);
708-
if (IS_ERR(ar->board)) {
709-
ret = PTR_ERR(ar->board);
710-
ath10k_err(ar, "could not fetch board data '%s/%s' (%d)\n",
711-
ar->hw_params.fw.dir, ar->hw_params.fw.board,
712-
ret);
713-
goto err;
714-
}
715-
716-
ar->board_data = ar->board->data;
717-
ar->board_len = ar->board->size;
718-
719757
return 0;
720758

721759
err:
@@ -730,6 +768,19 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
730768
/* calibration file is optional, don't check for any errors */
731769
ath10k_fetch_cal_file(ar);
732770

771+
ret = ath10k_core_fetch_board_file(ar);
772+
if (ret) {
773+
ath10k_err(ar, "failed to fetch board file: %d\n", ret);
774+
return ret;
775+
}
776+
777+
ar->fw_api = 5;
778+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
779+
780+
ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API5_FILE);
781+
if (ret == 0)
782+
goto success;
783+
733784
ar->fw_api = 4;
734785
ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
735786

@@ -958,6 +1009,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
9581009
ar->max_num_stations = TARGET_NUM_STATIONS;
9591010
ar->max_num_vdevs = TARGET_NUM_VDEVS;
9601011
ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
1012+
ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
1013+
WMI_STAT_PEER;
9611014
break;
9621015
case ATH10K_FW_WMI_OP_VERSION_10_1:
9631016
case ATH10K_FW_WMI_OP_VERSION_10_2:
@@ -966,19 +1019,47 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
9661019
ar->max_num_stations = TARGET_10X_NUM_STATIONS;
9671020
ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
9681021
ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
1022+
ar->fw_stats_req_mask = WMI_STAT_PEER;
9691023
break;
9701024
case ATH10K_FW_WMI_OP_VERSION_TLV:
9711025
ar->max_num_peers = TARGET_TLV_NUM_PEERS;
9721026
ar->max_num_stations = TARGET_TLV_NUM_STATIONS;
9731027
ar->max_num_vdevs = TARGET_TLV_NUM_VDEVS;
1028+
ar->max_num_tdls_vdevs = TARGET_TLV_NUM_TDLS_VDEVS;
9741029
ar->htt.max_num_pending_tx = TARGET_TLV_NUM_MSDU_DESC;
1030+
ar->wow.max_num_patterns = TARGET_TLV_NUM_WOW_PATTERNS;
1031+
ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
1032+
WMI_STAT_PEER;
9751033
break;
9761034
case ATH10K_FW_WMI_OP_VERSION_UNSET:
9771035
case ATH10K_FW_WMI_OP_VERSION_MAX:
9781036
WARN_ON(1);
9791037
return -EINVAL;
9801038
}
9811039

1040+
/* Backwards compatibility for firmwares without
1041+
* ATH10K_FW_IE_HTT_OP_VERSION.
1042+
*/
1043+
if (ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_UNSET) {
1044+
switch (ar->wmi.op_version) {
1045+
case ATH10K_FW_WMI_OP_VERSION_MAIN:
1046+
ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_MAIN;
1047+
break;
1048+
case ATH10K_FW_WMI_OP_VERSION_10_1:
1049+
case ATH10K_FW_WMI_OP_VERSION_10_2:
1050+
case ATH10K_FW_WMI_OP_VERSION_10_2_4:
1051+
ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_1;
1052+
break;
1053+
case ATH10K_FW_WMI_OP_VERSION_TLV:
1054+
ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
1055+
break;
1056+
case ATH10K_FW_WMI_OP_VERSION_UNSET:
1057+
case ATH10K_FW_WMI_OP_VERSION_MAX:
1058+
WARN_ON(1);
1059+
return -EINVAL;
1060+
}
1061+
}
1062+
9821063
return 0;
9831064
}
9841065

@@ -1080,9 +1161,8 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
10801161

10811162
if (mode == ATH10K_FIRMWARE_MODE_NORMAL) {
10821163
status = ath10k_wmi_wait_for_service_ready(ar);
1083-
if (status <= 0) {
1164+
if (status) {
10841165
ath10k_warn(ar, "wmi service ready event not received");
1085-
status = -ETIMEDOUT;
10861166
goto err_hif_stop;
10871167
}
10881168
}
@@ -1098,9 +1178,8 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
10981178
}
10991179

11001180
status = ath10k_wmi_wait_for_unified_ready(ar);
1101-
if (status <= 0) {
1181+
if (status) {
11021182
ath10k_err(ar, "wmi unified ready event not received\n");
1103-
status = -ETIMEDOUT;
11041183
goto err_hif_stop;
11051184
}
11061185

@@ -1151,6 +1230,7 @@ EXPORT_SYMBOL(ath10k_core_start);
11511230
int ath10k_wait_for_suspend(struct ath10k *ar, u32 suspend_opt)
11521231
{
11531232
int ret;
1233+
unsigned long time_left;
11541234

11551235
reinit_completion(&ar->target_suspend);
11561236

@@ -1160,9 +1240,9 @@ int ath10k_wait_for_suspend(struct ath10k *ar, u32 suspend_opt)
11601240
return ret;
11611241
}
11621242

1163-
ret = wait_for_completion_timeout(&ar->target_suspend, 1 * HZ);
1243+
time_left = wait_for_completion_timeout(&ar->target_suspend, 1 * HZ);
11641244

1165-
if (ret == 0) {
1245+
if (!time_left) {
11661246
ath10k_warn(ar, "suspend timed out - target pause event never came\n");
11671247
return -ETIMEDOUT;
11681248
}
@@ -1386,6 +1466,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
13861466
init_completion(&ar->scan.completed);
13871467
init_completion(&ar->scan.on_channel);
13881468
init_completion(&ar->target_suspend);
1469+
init_completion(&ar->wow.wakeup_completed);
13891470

13901471
init_completion(&ar->install_key_done);
13911472
init_completion(&ar->vdev_setup_done);

0 commit comments

Comments
 (0)