Skip to content

Commit 56b8718

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2016-01-05' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== brcfmac * fix IBSS which got broken over time * new USB id for bcm43242 dongle * arp offload configuration through inet notifier ath9k * add random number generator support (CONFIG_ATH9K_HWRNG) iwlwifi * Make scan parameters low latency aware * Fix in the NL80211_FEATURE_FULL_AP_CLIENT_STATE state case * Fix enable injection mode (Chaya Rachel) * Various cleanups (Dan / Julia / myself) * Allow to stay more time on popular channels (David Spinadel) * Bug fixes for D0i3 (Eliad / Luca) * Fixes for GO uAPSD (myself) * Start of TSO support (myself) * Rate control bug fixes (Eyal / Gregory) * Start the work on 9000 devices (Johannes / Sara / Oren) * Start the work on a new Tx queue allocation model (Liad) * Debug infrastructure enhancements (Golan) mwifiex * add a debugfs file for chip reset * advertise SMS4 cipher suite * increase ap and station interface limit to 3 * enable MSI support on newer pcie devices (8897 onwards) rtlwifi * fix lots of module parameter usage ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents be78a69 + 49f2a47 commit 56b8718

File tree

184 files changed

+3889
-1884
lines changed

Some content is hidden

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

184 files changed

+3889
-1884
lines changed

arch/mips/bcm47xx/setup.c

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -101,50 +101,13 @@ static void bcm47xx_machine_halt(void)
101101
}
102102

103103
#ifdef CONFIG_BCM47XX_SSB
104-
static int bcm47xx_get_invariants(struct ssb_bus *bus,
105-
struct ssb_init_invariants *iv)
106-
{
107-
char buf[20];
108-
int len, err;
109-
110-
/* Fill boardinfo structure */
111-
memset(&iv->boardinfo, 0 , sizeof(struct ssb_boardinfo));
112-
113-
len = bcm47xx_nvram_getenv("boardvendor", buf, sizeof(buf));
114-
if (len > 0) {
115-
err = kstrtou16(strim(buf), 0, &iv->boardinfo.vendor);
116-
if (err)
117-
pr_warn("Couldn't parse nvram board vendor entry with value \"%s\"\n",
118-
buf);
119-
}
120-
if (!iv->boardinfo.vendor)
121-
iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
122-
123-
len = bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf));
124-
if (len > 0) {
125-
err = kstrtou16(strim(buf), 0, &iv->boardinfo.type);
126-
if (err)
127-
pr_warn("Couldn't parse nvram board type entry with value \"%s\"\n",
128-
buf);
129-
}
130-
131-
memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
132-
bcm47xx_fill_sprom(&iv->sprom, NULL, false);
133-
134-
if (bcm47xx_nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
135-
iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);
136-
137-
return 0;
138-
}
139-
140104
static void __init bcm47xx_register_ssb(void)
141105
{
142106
int err;
143107
char buf[100];
144108
struct ssb_mipscore *mcore;
145109

146-
err = ssb_bus_ssbbus_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE,
147-
bcm47xx_get_invariants);
110+
err = ssb_bus_host_soc_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE);
148111
if (err)
149112
panic("Failed to initialize SSB bus (err %d)", err);
150113

drivers/bcma/main.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,36 @@ static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
668668
core->id.rev, core->id.class);
669669
}
670670

671-
static int __init bcma_modinit(void)
671+
static unsigned int bcma_bus_registered;
672+
673+
/*
674+
* If built-in, bus has to be registered early, before any driver calls
675+
* bcma_driver_register.
676+
* Otherwise registering driver would trigger BUG in driver_register.
677+
*/
678+
static int __init bcma_init_bus_register(void)
672679
{
673680
int err;
674681

682+
if (bcma_bus_registered)
683+
return 0;
684+
675685
err = bus_register(&bcma_bus_type);
686+
if (!err)
687+
bcma_bus_registered = 1;
688+
689+
return err;
690+
}
691+
#ifndef MODULE
692+
fs_initcall(bcma_init_bus_register);
693+
#endif
694+
695+
/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */
696+
static int __init bcma_modinit(void)
697+
{
698+
int err;
699+
700+
err = bcma_init_bus_register();
676701
if (err)
677702
return err;
678703

@@ -691,7 +716,7 @@ static int __init bcma_modinit(void)
691716

692717
return err;
693718
}
694-
fs_initcall(bcma_modinit);
719+
module_init(bcma_modinit);
695720

696721
static void __exit bcma_modexit(void)
697722
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ static ssize_t ath10k_read_htt_max_amsdu_ampdu(struct file *file,
11391139
{
11401140
struct ath10k *ar = file->private_data;
11411141
char buf[64];
1142-
u8 amsdu = 3, ampdu = 64;
1142+
u8 amsdu, ampdu;
11431143
unsigned int len;
11441144

11451145
mutex_lock(&ar->conf_mutex);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ static int ath10k_install_peer_wep_keys(struct ath10k_vif *arvif,
250250
lockdep_assert_held(&ar->conf_mutex);
251251

252252
if (WARN_ON(arvif->vif->type != NL80211_IFTYPE_AP &&
253-
arvif->vif->type != NL80211_IFTYPE_ADHOC))
253+
arvif->vif->type != NL80211_IFTYPE_ADHOC &&
254+
arvif->vif->type != NL80211_IFTYPE_MESH_POINT))
254255
return -EINVAL;
255256

256257
spin_lock_bh(&ar->data_lock);

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

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,34 +4312,58 @@ void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb)
43124312
ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n");
43134313
}
43144314

4315-
static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
4316-
u32 num_units, u32 unit_len)
4315+
static int ath10k_wmi_alloc_chunk(struct ath10k *ar, u32 req_id,
4316+
u32 num_units, u32 unit_len)
43174317
{
43184318
dma_addr_t paddr;
4319-
u32 pool_size;
4319+
u32 pool_size = 0;
43204320
int idx = ar->wmi.num_mem_chunks;
4321+
void *vaddr = NULL;
43214322

4322-
pool_size = num_units * round_up(unit_len, 4);
4323+
if (ar->wmi.num_mem_chunks == ARRAY_SIZE(ar->wmi.mem_chunks))
4324+
return -ENOMEM;
43234325

4324-
if (!pool_size)
4325-
return -EINVAL;
4326+
while (!vaddr && num_units) {
4327+
pool_size = num_units * round_up(unit_len, 4);
4328+
if (!pool_size)
4329+
return -EINVAL;
43264330

4327-
ar->wmi.mem_chunks[idx].vaddr = dma_alloc_coherent(ar->dev,
4328-
pool_size,
4329-
&paddr,
4330-
GFP_KERNEL);
4331-
if (!ar->wmi.mem_chunks[idx].vaddr) {
4332-
ath10k_warn(ar, "failed to allocate memory chunk\n");
4333-
return -ENOMEM;
4331+
vaddr = kzalloc(pool_size, GFP_KERNEL | __GFP_NOWARN);
4332+
if (!vaddr)
4333+
num_units /= 2;
43344334
}
43354335

4336-
memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
4336+
if (!num_units)
4337+
return -ENOMEM;
4338+
4339+
paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE);
4340+
if (dma_mapping_error(ar->dev, paddr)) {
4341+
kfree(vaddr);
4342+
return -ENOMEM;
4343+
}
43374344

4345+
ar->wmi.mem_chunks[idx].vaddr = vaddr;
43384346
ar->wmi.mem_chunks[idx].paddr = paddr;
43394347
ar->wmi.mem_chunks[idx].len = pool_size;
43404348
ar->wmi.mem_chunks[idx].req_id = req_id;
43414349
ar->wmi.num_mem_chunks++;
43424350

4351+
return num_units;
4352+
}
4353+
4354+
static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
4355+
u32 num_units, u32 unit_len)
4356+
{
4357+
int ret;
4358+
4359+
while (num_units) {
4360+
ret = ath10k_wmi_alloc_chunk(ar, req_id, num_units, unit_len);
4361+
if (ret < 0)
4362+
return ret;
4363+
4364+
num_units -= ret;
4365+
}
4366+
43434367
return 0;
43444368
}
43454369

@@ -7717,10 +7741,11 @@ void ath10k_wmi_free_host_mem(struct ath10k *ar)
77177741

77187742
/* free the host memory chunks requested by firmware */
77197743
for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
7720-
dma_free_coherent(ar->dev,
7721-
ar->wmi.mem_chunks[i].len,
7722-
ar->wmi.mem_chunks[i].vaddr,
7723-
ar->wmi.mem_chunks[i].paddr);
7744+
dma_unmap_single(ar->dev,
7745+
ar->wmi.mem_chunks[i].paddr,
7746+
ar->wmi.mem_chunks[i].len,
7747+
DMA_TO_DEVICE);
7748+
kfree(ar->wmi.mem_chunks[i].vaddr);
77247749
}
77257750

77267751
ar->wmi.num_mem_chunks = 0;

drivers/net/wireless/ath/ath5k/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
767767
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
768768
flags |= AR5K_TXDESC_NOACK;
769769

770-
rc_flags = info->control.rates[0].flags;
770+
rc_flags = bf->rates[0].flags;
771771

772772
hw_rate = ath5k_get_rate_hw_value(ah->hw, info, bf, 0);
773773

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,8 +3930,8 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
39303930
ath6kl_band_5ghz.ht_cap.mcs.rx_mask[0] = 0xff;
39313931
ath6kl_band_2ghz.ht_cap.mcs.rx_mask[1] = 0xff;
39323932
ath6kl_band_5ghz.ht_cap.mcs.rx_mask[1] = 0xff;
3933-
ar->hw.tx_ant = 2;
3934-
ar->hw.rx_ant = 2;
3933+
ar->hw.tx_ant = 0x3; /* mask, 2 antenna */
3934+
ar->hw.rx_ant = 0x3;
39353935
} else {
39363936
ath6kl_band_2ghz.ht_cap.mcs.rx_mask[0] = 0xff;
39373937
ath6kl_band_5ghz.ht_cap.mcs.rx_mask[0] = 0xff;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,8 +2222,9 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
22222222
}
22232223

22242224
if (status) {
2225-
ath6kl_err("failed to get pending recv messages: %d\n",
2226-
status);
2225+
if (status != -ECANCELED)
2226+
ath6kl_err("failed to get pending recv messages: %d\n",
2227+
status);
22272228

22282229
/* cleanup any packets in sync completion queue */
22292230
list_for_each_entry_safe(packets, tmp_pkt, &comp_pktq, list) {

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,10 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
954954
snprintf(filename, sizeof(filename), "%s/%s", ar->hw.fw.dir, name);
955955

956956
ret = request_firmware(&fw, filename, ar->dev);
957-
if (ret)
957+
if (ret) {
958+
ath6kl_err("Failed request firmware, rv: %d\n", ret);
958959
return ret;
960+
}
959961

960962
data = fw->data;
961963
len = fw->size;
@@ -964,11 +966,15 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
964966
magic_len = strlen(ATH6KL_FIRMWARE_MAGIC) + 1;
965967

966968
if (len < magic_len) {
969+
ath6kl_err("Magic length is invalid, len: %zd magic_len: %zd\n",
970+
len, magic_len);
967971
ret = -EINVAL;
968972
goto out;
969973
}
970974

971975
if (memcmp(data, ATH6KL_FIRMWARE_MAGIC, magic_len) != 0) {
976+
ath6kl_err("Magic is invalid, magic_len: %zd\n",
977+
magic_len);
972978
ret = -EINVAL;
973979
goto out;
974980
}
@@ -987,7 +993,12 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
987993
len -= sizeof(*hdr);
988994
data += sizeof(*hdr);
989995

996+
ath6kl_dbg(ATH6KL_DBG_BOOT, "ie-id: %d len: %zd (0x%zx)\n",
997+
ie_id, ie_len, ie_len);
998+
990999
if (len < ie_len) {
1000+
ath6kl_err("IE len is invalid, len: %zd ie_len: %zd ie-id: %d\n",
1001+
len, ie_len, ie_id);
9911002
ret = -EINVAL;
9921003
goto out;
9931004
}
@@ -1008,6 +1019,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
10081019
ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL);
10091020

10101021
if (ar->fw_otp == NULL) {
1022+
ath6kl_err("fw_otp cannot be allocated\n");
10111023
ret = -ENOMEM;
10121024
goto out;
10131025
}
@@ -1025,6 +1037,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
10251037
ar->fw = vmalloc(ie_len);
10261038

10271039
if (ar->fw == NULL) {
1040+
ath6kl_err("fw storage cannot be allocated, len: %zd\n", ie_len);
10281041
ret = -ENOMEM;
10291042
goto out;
10301043
}
@@ -1039,6 +1052,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
10391052
ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL);
10401053

10411054
if (ar->fw_patch == NULL) {
1055+
ath6kl_err("fw_patch storage cannot be allocated, len: %zd\n", ie_len);
10421056
ret = -ENOMEM;
10431057
goto out;
10441058
}

drivers/net/wireless/ath/ath9k/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,14 @@ config ATH9K_HTC_DEBUGFS
176176
depends on ATH9K_HTC && DEBUG_FS
177177
---help---
178178
Say Y, if you need access to ath9k_htc's statistics.
179+
180+
config ATH9K_HWRNG
181+
bool "Random number generator support"
182+
depends on ATH9K && (HW_RANDOM = y || HW_RANDOM = ATH9K)
183+
default y
184+
---help---
185+
This option incorporates the ADC register output as a source of
186+
randomness into Linux entropy pool (/dev/urandom and /dev/random)
187+
188+
Say Y, feeds the entropy directly from the WiFi driver to the input
189+
pool.

drivers/net/wireless/ath/ath9k/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ath9k-$(CONFIG_ATH9K_DFS_DEBUGFS) += dfs_debug.o
1515
ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += dfs.o
1616
ath9k-$(CONFIG_ATH9K_TX99) += tx99.o
1717
ath9k-$(CONFIG_ATH9K_WOW) += wow.o
18+
ath9k-$(CONFIG_ATH9K_HWRNG) += rng.o
1819

1920
ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o
2021

drivers/net/wireless/ath/ath9k/ath9k.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/leds.h>
2424
#include <linux/completion.h>
2525
#include <linux/time.h>
26+
#include <linux/hw_random.h>
2627

2728
#include "common.h"
2829
#include "debug.h"
@@ -981,6 +982,7 @@ struct ath_softc {
981982
struct ath_offchannel offchannel;
982983
struct ath_chanctx *next_chan;
983984
struct completion go_beacon;
985+
struct timespec last_event_time;
984986
#endif
985987

986988
unsigned long driver_data;
@@ -1040,6 +1042,11 @@ struct ath_softc {
10401042
u32 wow_intr_before_sleep;
10411043
bool force_wow;
10421044
#endif
1045+
1046+
#ifdef CONFIG_ATH9K_HWRNG
1047+
u32 rng_last;
1048+
struct task_struct *rng_task;
1049+
#endif
10431050
};
10441051

10451052
/********/
@@ -1062,6 +1069,22 @@ static inline int ath9k_tx99_send(struct ath_softc *sc,
10621069
}
10631070
#endif /* CONFIG_ATH9K_TX99 */
10641071

1072+
/***************************/
1073+
/* Random Number Generator */
1074+
/***************************/
1075+
#ifdef CONFIG_ATH9K_HWRNG
1076+
void ath9k_rng_start(struct ath_softc *sc);
1077+
void ath9k_rng_stop(struct ath_softc *sc);
1078+
#else
1079+
static inline void ath9k_rng_start(struct ath_softc *sc)
1080+
{
1081+
}
1082+
1083+
static inline void ath9k_rng_stop(struct ath_softc *sc)
1084+
{
1085+
}
1086+
#endif
1087+
10651088
static inline void ath_read_cachesize(struct ath_common *common, int *csz)
10661089
{
10671090
common->bus_ops->read_cachesize(common, csz);

drivers/net/wireless/ath/ath9k/beacon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
148148

149149
ath_assign_seq(common, skb);
150150

151-
if (vif->p2p)
151+
/* Always assign NOA attr when MCC enabled */
152+
if (ath9k_is_chanctx_enabled())
152153
ath9k_beacon_add_noa(sc, avp, skb);
153154

154155
bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,

0 commit comments

Comments
 (0)