Skip to content

Commit 652dfb2

Browse files
committed
Merge tag 'wireless-drivers-for-davem-2018-03-08' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo: ==================== wireless-drivers fixes for 4.16 Quote a few fixes as I have not been able to send a pull request earlier. Most of the fixes for iwlwifi but also few others, nothing really standing out though. iwlwifi * fix a bogus warning when freeing a TFD * fix severe throughput problem with 9000 series * fix for a bug that caused queue hangs in certain situations * fix for an issue with IBSS * fix an issue with rate-scaling in AP-mode * fix Channel Switch Announcement (CSA) issues with count 0 and 1 * some firmware debugging fixes * remov a wrong error message when removing keys * fix a firmware sysassert most usually triggered in IBSS * a couple of fixes on multicast queues * a fix with CCMP 256 rtlwifi * fix loss of signal for rtl8723be brcmfmac * add possibility to obtain firmware error * fix P2P_DEVICE ethernet address generation ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3d07e07 + 455f3e7 commit 652dfb2

File tree

25 files changed

+212
-88
lines changed

25 files changed

+212
-88
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ enum brcmf_netif_stop_reason {
181181
* @netif_stop_lock: spinlock for update netif_stop from multiple sources.
182182
* @pend_8021x_cnt: tracks outstanding number of 802.1x frames.
183183
* @pend_8021x_wait: used for signalling change in count.
184+
* @fwil_fwerr: flag indicating fwil layer should return firmware error codes.
184185
*/
185186
struct brcmf_if {
186187
struct brcmf_pub *drvr;
@@ -198,6 +199,7 @@ struct brcmf_if {
198199
wait_queue_head_t pend_8021x_wait;
199200
struct in6_addr ipv6_addr_tbl[NDOL_MAX_ENTRIES];
200201
u8 ipv6addr_idx;
202+
bool fwil_fwerr;
201203
};
202204

203205
int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp);

drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ static void brcmf_feat_iovar_int_get(struct brcmf_if *ifp,
104104
u32 data;
105105
int err;
106106

107+
/* we need to know firmware error */
108+
ifp->fwil_fwerr = true;
109+
107110
err = brcmf_fil_iovar_int_get(ifp, name, &data);
108111
if (err == 0) {
109112
brcmf_dbg(INFO, "enabling feature: %s\n", brcmf_feat_names[id]);
@@ -112,6 +115,8 @@ static void brcmf_feat_iovar_int_get(struct brcmf_if *ifp,
112115
brcmf_dbg(TRACE, "%s feature check failed: %d\n",
113116
brcmf_feat_names[id], err);
114117
}
118+
119+
ifp->fwil_fwerr = false;
115120
}
116121

117122
static void brcmf_feat_iovar_data_set(struct brcmf_if *ifp,
@@ -120,6 +125,9 @@ static void brcmf_feat_iovar_data_set(struct brcmf_if *ifp,
120125
{
121126
int err;
122127

128+
/* we need to know firmware error */
129+
ifp->fwil_fwerr = true;
130+
123131
err = brcmf_fil_iovar_data_set(ifp, name, data, len);
124132
if (err != -BRCMF_FW_UNSUPPORTED) {
125133
brcmf_dbg(INFO, "enabling feature: %s\n", brcmf_feat_names[id]);
@@ -128,6 +136,8 @@ static void brcmf_feat_iovar_data_set(struct brcmf_if *ifp,
128136
brcmf_dbg(TRACE, "%s feature check failed: %d\n",
129137
brcmf_feat_names[id], err);
130138
}
139+
140+
ifp->fwil_fwerr = false;
131141
}
132142

133143
#define MAX_CAPS_BUFFER_SIZE 512

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
131131
brcmf_fil_get_errstr((u32)(-fwerr)), fwerr);
132132
err = -EBADE;
133133
}
134+
if (ifp->fwil_fwerr)
135+
return fwerr;
136+
134137
return err;
135138
}
136139

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -462,25 +462,23 @@ static int brcmf_p2p_set_firmware(struct brcmf_if *ifp, u8 *p2p_mac)
462462
* @dev_addr: optional device address.
463463
*
464464
* P2P needs mac addresses for P2P device and interface. If no device
465-
* address it specified, these are derived from the primary net device, ie.
466-
* the permanent ethernet address of the device.
465+
* address it specified, these are derived from a random ethernet
466+
* address.
467467
*/
468468
static void brcmf_p2p_generate_bss_mac(struct brcmf_p2p_info *p2p, u8 *dev_addr)
469469
{
470-
struct brcmf_if *pri_ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp;
471-
bool local_admin = false;
470+
bool random_addr = false;
472471

473-
if (!dev_addr || is_zero_ether_addr(dev_addr)) {
474-
dev_addr = pri_ifp->mac_addr;
475-
local_admin = true;
476-
}
472+
if (!dev_addr || is_zero_ether_addr(dev_addr))
473+
random_addr = true;
477474

478-
/* Generate the P2P Device Address. This consists of the device's
479-
* primary MAC address with the locally administered bit set.
475+
/* Generate the P2P Device Address obtaining a random ethernet
476+
* address with the locally administered bit set.
480477
*/
481-
memcpy(p2p->dev_addr, dev_addr, ETH_ALEN);
482-
if (local_admin)
483-
p2p->dev_addr[0] |= 0x02;
478+
if (random_addr)
479+
eth_random_addr(p2p->dev_addr);
480+
else
481+
memcpy(p2p->dev_addr, dev_addr, ETH_ALEN);
484482

485483
/* Generate the P2P Interface Address. If the discovery and connection
486484
* BSSCFGs need to simultaneously co-exist, then this address must be

drivers/net/wireless/intel/iwlwifi/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ config IWLWIFI_BCAST_FILTERING
9191
config IWLWIFI_PCIE_RTPM
9292
bool "Enable runtime power management mode for PCIe devices"
9393
depends on IWLMVM && PM && EXPERT
94-
default false
9594
help
9695
Say Y here to enable runtime power management for PCIe
9796
devices. If enabled, the device will go into low power mode

drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ enum {
211211
* @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
212212
* @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
213213
* @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
214-
* @T2_V2_START_IMMEDIATELY: start time event immediately
214+
* @TE_V2_START_IMMEDIATELY: start time event immediately
215215
* @TE_V2_DEP_OTHER: depends on another time event
216216
* @TE_V2_DEP_TSF: depends on a specific time
217217
* @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
@@ -230,7 +230,7 @@ enum iwl_time_event_policy {
230230
TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
231231
TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
232232
TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
233-
T2_V2_START_IMMEDIATELY = BIT(11),
233+
TE_V2_START_IMMEDIATELY = BIT(11),
234234

235235
/* placement characteristics */
236236
TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),

drivers/net/wireless/intel/iwlwifi/fw/dbg.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11+
* Copyright(c) 2018 Intel Corporation
1112
*
1213
* This program is free software; you can redistribute it and/or modify
1314
* it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
3334
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3435
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3536
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
37+
* Copyright(c) 2018 Intel Corporation
3638
* All rights reserved.
3739
*
3840
* Redistribution and use in source and binary forms, with or without
@@ -942,7 +944,6 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt)
942944

943945
out:
944946
iwl_fw_free_dump_desc(fwrt);
945-
fwrt->dump.trig = NULL;
946947
clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status);
947948
IWL_DEBUG_INFO(fwrt, "WRT dump done\n");
948949
}
@@ -1112,6 +1113,14 @@ void iwl_fw_error_dump_wk(struct work_struct *work)
11121113
fwrt->ops->dump_start(fwrt->ops_ctx))
11131114
return;
11141115

1116+
if (fwrt->ops && fwrt->ops->fw_running &&
1117+
!fwrt->ops->fw_running(fwrt->ops_ctx)) {
1118+
IWL_ERR(fwrt, "Firmware not running - cannot dump error\n");
1119+
iwl_fw_free_dump_desc(fwrt);
1120+
clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status);
1121+
goto out;
1122+
}
1123+
11151124
if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
11161125
/* stop recording */
11171126
iwl_fw_dbg_stop_recording(fwrt);
@@ -1145,7 +1154,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work)
11451154
iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, out_ctrl);
11461155
}
11471156
}
1148-
1157+
out:
11491158
if (fwrt->ops && fwrt->ops->dump_end)
11501159
fwrt->ops->dump_end(fwrt->ops_ctx);
11511160
}

drivers/net/wireless/intel/iwlwifi/fw/dbg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11+
* Copyright(c) 2018 Intel Corporation
1112
*
1213
* This program is free software; you can redistribute it and/or modify
1314
* it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
3334
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3435
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3536
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
37+
* Copyright(c) 2018 Intel Corporation
3638
* All rights reserved.
3739
*
3840
* Redistribution and use in source and binary forms, with or without
@@ -91,6 +93,7 @@ static inline void iwl_fw_free_dump_desc(struct iwl_fw_runtime *fwrt)
9193
if (fwrt->dump.desc != &iwl_dump_desc_assert)
9294
kfree(fwrt->dump.desc);
9395
fwrt->dump.desc = NULL;
96+
fwrt->dump.trig = NULL;
9497
}
9598

9699
void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt);

drivers/net/wireless/intel/iwlwifi/fw/debugfs.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt)
7575
cancel_delayed_work_sync(&fwrt->timestamp.wk);
7676
}
7777

78+
static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt)
79+
{
80+
cancel_delayed_work_sync(&fwrt->timestamp.wk);
81+
}
82+
83+
static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt)
84+
{
85+
if (!fwrt->timestamp.delay)
86+
return;
87+
88+
schedule_delayed_work(&fwrt->timestamp.wk,
89+
round_jiffies_relative(fwrt->timestamp.delay));
90+
}
91+
7892
#else
7993
static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
8094
struct dentry *dbgfs_dir)
@@ -84,4 +98,8 @@ static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
8498

8599
static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt) {}
86100

101+
static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt) {}
102+
103+
static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {}
104+
87105
#endif /* CONFIG_IWLWIFI_DEBUGFS */

drivers/net/wireless/intel/iwlwifi/fw/init.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
7777
}
7878
IWL_EXPORT_SYMBOL(iwl_fw_runtime_init);
7979

80-
void iwl_fw_runtime_exit(struct iwl_fw_runtime *fwrt)
80+
void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt)
8181
{
82-
iwl_fw_cancel_timestamp(fwrt);
82+
iwl_fw_suspend_timestamp(fwrt);
8383
}
84-
IWL_EXPORT_SYMBOL(iwl_fw_runtime_exit);
84+
IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend);
85+
86+
void iwl_fw_runtime_resume(struct iwl_fw_runtime *fwrt)
87+
{
88+
iwl_fw_resume_timestamp(fwrt);
89+
}
90+
IWL_EXPORT_SYMBOL(iwl_fw_runtime_resume);

0 commit comments

Comments
 (0)