aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2017-07-28mwifiex: reset interrupt status across device resetBrian Norris1-0/+1
When resetting the device, we might have queued up interrupts that didn't get a chance to finish processing. We really don't need to handle them at this point; we just want to make sure they don't cause us to try to process old commands from before the device was reset. Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28mwifiex: reunite copy-and-pasted remove/reset codeBrian Norris1-76/+28
When PCIe FLR code was added, it explicitly copy-and-pasted much of mwifiex_remove_card() into mwifiex_shutdown_sw(). This is unnecessary, as almost all of the code should be reused. Let's reunite what we can for now. The only functional changes for now: * call netif_device_detach() in the remove() code path -- this wasn't done before, but it really should be a no-op, when the device is getting totally unregistered soon anyway * call the ->down_dev() driver callback only after we've finished all SW teardown -- this should have no significant effect, since the only user (pcie.c) does very minimal work there, and it doesn't matter that we reorder this Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: fix static checker warningAmitkumar Karwar1-1/+8
u32 pointer is changed to u16 and filled the value. Problem is solved by using local temporary variable. Below static checker warning was reported. drivers/net/wireless/rsi/rsi_91x_usb.c:400 rsi_usb_master_reg_read() warn: passing casted pointer 'value' to 'rsi_usb_reg_read()' 32 vs 16. Fixes: b97e9b94ad75c ("rsi: Add new host interface operations") Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: check length before USB read/write registerAmitkumar Karwar1-0/+6
These checks are required. Otherwise we may end up getting memory corruption if invalid length is passed. Fixes: b97e9b94ad75c ("rsi: Add new host interface operations") Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: use macro for allocating USB bufferAmitkumar Karwar2-2/+3
4 bytes is fixed size for reading or writing USB register. We will use a macro instead of hardcoding this. Fixes: b97e9b94ad75c ("rsi: Add new host interface operations") Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: regulatory enhancementsPrameela Rani Garnepudi2-12/+45
Below regulatory changes are included this patch * Country code is saved as it will be used in bgscan. * Region codes are mapped according to RSI region codes. * Radar flag settings are moved under the check if 5GHZ band is enabled. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Send rx filter frame to device when interface is downPrameela Rani Garnepudi1-0/+4
When interface is down it is better to stop all RX packets to host. 0xffff will block all packets to host. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Remove internal header from Tx status skbPrameela Rani Garnepudi1-1/+9
Device specific descriptor for each TX packet is prepared on top of skb data address. This descriptor should be pulled out before indicating the TX status to mac80211. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: update tx command frame block/unblock dataPrameela Rani Garnepudi2-7/+22
TX command frame block/unblock data is modified to use common descriptor structure. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: block/unblock data queues as per connection statusPrameela Rani Garnepudi1-0/+5
Data queues should be unblocked after station add notify frame is sent and should be blocked after station delete notify is sent. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: update autorate request command framePrameela Rani Garnepudi1-0/+3
When Short Gaurd Interval is enabled bit 9 is set in rate. Otherwise it should not be set. Added missing 'else' case in this patch. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: set_key enhancementsPrameela Rani Garnepudi1-13/+15
Broadcast bit to be set for broadcast and multicast packets. For remove_key, tx and rx mic need not be filled. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: update set_key command framePrameela Rani Garnepudi2-14/+28
TX command frame set_key is modified to use common descriptor structure. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: update vap capabilities command framePrameela Rani Garnepudi3-29/+49
VAP capablities frame configured to device is modified to use common descriptor structure. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: update set_channel command framePrameela Rani Garnepudi2-25/+35
TX command frame set_channel is modified to use common descriptor structure. Also DFS channel indication to firmware is added in the descriptor for dfs channels configuration. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Update baseband RF programming framePrameela Rani Garnepudi2-11/+25
Baseband RF programming frame configured to device is modified to use common descriptor structure. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Update aggregation parameters command framePrameela Rani Garnepudi2-24/+31
AMPDU aggregation parameters frame configured to device is modified to use common descriptor structure. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Update peer notify command framePrameela Rani Garnepudi2-10/+13
TX command frame peer notify is updated to use common descriptor structure. MPDU density value added to the frame. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: remove unnecessary check for 802.11 management packetPrameela Rani Garnepudi1-30/+24
The function rsi_mgmt_pkt_to_core() is for passing the 802.11 management frames to mac80211. So, it is unnecessary to check again for the frame type 802.11 management in this function. It can be checked before passing to this function. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Update in tx command frame radio capabilitiesPrameela Rani Garnepudi3-28/+48
Radio capabilities frame is updated to use common descriptor structure. Also, few changes to this frame is done like hardware queues are increase to 12 from 8, default channel number is included. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: immediate wakeup bit and priority for TX command packetsPrameela Rani Garnepudi2-0/+4
For all TX command packets immediate wakeup bit needs to be set in descriptor. This will make sure device will wakeup if it is in any sleep state. Priority of the packet is also set. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: add common structures needed for command packetsPrameela Rani Garnepudi1-0/+38
All internal management packets (command packets) use some common fields and some packet specific fields for packet descriptors. This patch adds some common structures which are needed for all command packets. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Rename mutex tx_rxlock to the tx_lock.Karun Eagalapati3-8/+8
We have now added separate lock for Rx. This lock is used to protect tx path only Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: use separate mutex lock for receive threadKarun Eagalapati4-8/+11
Deadlock issue is observed during our stress tests. The root cause for the issue is same lock is used between tx and rx threads. This patch adds a separate mutex lock for rx thread to resolve the problem. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: SDIO Rx packet processing enhancementKarun Eagalapati3-8/+28
Newer firmware sends information about number of blocks through interrupt only. We don't need to read extra register for this. This patch adds needed driver changes for this enhancment. The change here is backward compatible Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: Optimise sdio claim and release hostKarun Eagalapati1-10/+21
SDIO host is already claimed in our interrupt handler. Some lower level APIs claims host while performing SDIO read or write operations. Let's use sdio_irq_task variable to check if we are in interrupt context and claim/release the host accordingly. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: rename variable in_sdio_litefi_irqKarun Eagalapati1-1/+1
The variable in_sdio_litefi_irq is renamed to sdio_irq_task, as it is more relevant here. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: separate function for data packet descriptorPavani Muthyala1-23/+28
Data packet descriptor preparation code is moved a separate function. Signed-off-by: Pavani Muthyala <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: data packet descriptor enhancementsPavani Muthyala3-15/+55
This patch covers some enhancements in data packet descriptor preparation especially for EAPOL, multicast/broadcast packets. Signed-off-by: Pavani Muthyala <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: data packet descriptor code cleanupPavani Muthyala3-21/+36
Currently this descriptor is prepared with the help of __le16 pointer. This patch makes use of a structure to prepare the descriptor in a cleaner way. Signed-off-by: Pavani Muthyala <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: separate function for management packet descriptorPrameela Rani Garnepudi4-52/+98
Management descriptor preparation is move to a separate function as it will be called from a different context in upcoming patches. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: management frame descriptor preparation cleanupPavani Muthyala2-19/+35
Currently this descriptor is prepared with the help of __le16 pointer. This patch makes use of a structure to prepare the descriptor in a cleaner way. Signed-off-by: Pavani Muthyala <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: set immediate wakeup bitKarun Eagalapati1-0/+1
immediate wakeup bit is set while sending internal management frame to the firmware. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: choose correct endpoint based on queue.Karun Eagalapati1-1/+2
Till now only management packets were handled. Let's enhance the logic for choosing endpoint to accommodate other packets. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: rename USB endpoint macrosKarun Eagalapati2-3/+3
These endpoints are for WLAN and BT protocols. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: correct the logic of deriving queue numberAmitkumar Karwar1-1/+1
Maximum valid queue number is 0x5. So anding with 0x7 should be ok here. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: USB tx headroom cleanupKarun Eagalapati1-20/+21
USB headroom is added while submitting the data to URB as per firmware's requirement. This logic is moved to rsi_usb_card_write() so that caller need not worry about it. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: card reset for USB interfaceKarun Eagalapati2-0/+73
We need to reset the chip in teardown path so that it can work next time when driver is loaded. This patch adds support for this reset configuration for USB. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: correct SDIO disconnect path handlingKarun Eagalapati1-5/+14
Sometimes it's observed that we get interrupt/Rx frame when device is already detached from mac80211. In this case couple of error messages are displayed in dmesg log. This patch corrects the order so that disconnection will happen cleanly Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: chip reset for SDIO interfaceKarun Eagalapati3-1/+113
We need to reset the chip in teardown path so that it can work next time when driver is loaded. This patch adds support for this reset configuration for SDIO. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: fix sdio card reset problemKarun Eagalapati1-17/+9
card reset is not working with recent kernels. Using host->card->ocr instead of host->ocr_avail solved the problem. Signed-off-by: Karun Eagalapati <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: changes in eeprom read framePrameela Rani Garnepudi4-30/+96
EEPROM read frame is sent during device initialization to read mac address. The format of the frame is modified in firmware to include eeprom length and offset. This frame does not return firmware version now. Also same frame is sent again to read rf type and band information. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28rsi: use BUILD_BUG_ON check for fsm_stateAmitkumar Karwar2-1/+5
Whenever new fsm_state enum element is added, fsm_state array also needs to be updated. If this change is missed, we may end up doing invalid access in array. BUILD_BUG_ON check will help to avoid this problem. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-28Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo11-177/+394
ath.git patches for 4.14. Major changes: ath10k * preparation for wcn3990 support
2017-07-27brcmfmac: fix memleak due to calling brcmf_sdiod_sgtable_alloc() twiceArend Van Spriel1-5/+0
Due to a bugfix in wireless tree and the commit mentioned below a merge was needed which went haywire. So the submitted change resulted in the function brcmf_sdiod_sgtable_alloc() being called twice during the probe thus leaking the memory of the first call. Cc: [email protected] # 4.6.x Fixes: 4d7928959832 ("brcmfmac: switch to new platform data") Reported-by: Stefan Wahren <[email protected]> Tested-by: Stefan Wahren <[email protected]> Reviewed-by: Hante Meuleman <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-27brcmfmac: Don't grow SKB by negative sizeDaniel Stone1-1/+1
The commit to rework the headroom check in start_xmit() now calls pxskb_expand_head() unconditionally if the header is CoW. Unfortunately, it does so with the delta between the extant headroom and the header length, which may be negative if there is already sufficient headroom. pskb_expand_head() does allow for size being 0, in which case it just copies, so clamp the header delta to zero. Opening Chrome (and all my tabs) on a PCIE device was enough to reliably hit this. Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()") Signed-off-by: Daniel Stone <[email protected]> Cc: Arend Van Spriel <[email protected]> Cc: James Hughes <[email protected]> Cc: Hante Meuleman <[email protected]> Cc: Pieter-Paul Giesberts <[email protected]> Cc: Franky Lin <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-27wl1251: add a missing spin_lock_init()Cong Wang1-0/+1
This fixes the following kernel warning: [ 5668.771453] BUG: spinlock bad magic on CPU#0, kworker/u2:3/9745 [ 5668.771850] lock: 0xce63ef20, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [ 5668.772277] CPU: 0 PID: 9745 Comm: kworker/u2:3 Tainted: G W 4.12.0-03002-gec979a4-dirty #40 [ 5668.772796] Hardware name: Nokia RX-51 board [ 5668.773071] Workqueue: phy1 wl1251_irq_work [ 5668.773345] [<c010c9e4>] (unwind_backtrace) from [<c010a274>] (show_stack+0x10/0x14) [ 5668.773803] [<c010a274>] (show_stack) from [<c01545a4>] (do_raw_spin_lock+0x6c/0xa0) [ 5668.774230] [<c01545a4>] (do_raw_spin_lock) from [<c06ca578>] (_raw_spin_lock_irqsave+0x10/0x18) [ 5668.774658] [<c06ca578>] (_raw_spin_lock_irqsave) from [<c048c010>] (wl1251_op_tx+0x38/0x5c) [ 5668.775115] [<c048c010>] (wl1251_op_tx) from [<c06a12e8>] (ieee80211_tx_frags+0x188/0x1c0) [ 5668.775543] [<c06a12e8>] (ieee80211_tx_frags) from [<c06a138c>] (__ieee80211_tx+0x6c/0x130) [ 5668.775970] [<c06a138c>] (__ieee80211_tx) from [<c06a3dbc>] (ieee80211_tx+0xdc/0x104) [ 5668.776367] [<c06a3dbc>] (ieee80211_tx) from [<c06a4af0>] (__ieee80211_subif_start_xmit+0x454/0x8c8) [ 5668.776824] [<c06a4af0>] (__ieee80211_subif_start_xmit) from [<c06a4f94>] (ieee80211_subif_start_xmit+0x30/0x2fc) [ 5668.777343] [<c06a4f94>] (ieee80211_subif_start_xmit) from [<c0578848>] (dev_hard_start_xmit+0x80/0x118) ... by adding the missing spin_lock_init(). Reported-by: Pavel Machek <[email protected]> Cc: Kalle Valo <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-27rtlwifi: kfree entry until after entry->bssid has been accessedColin Ian King1-1/+1
The current code kfree's entry and then dereferences it by accessing entry->bssid. Avoid the dereference-after-free by moving the kfree after the access to entry->bssid. Detected by CoverityScan, CID#1448600 ("Read from pointer after free") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-27mwifiex: correct channel stat buffer overflowsBrian Norris2-1/+7
mwifiex records information about various channels as it receives scan information. It does this by appending to a buffer that was sized to the max number of supported channels on any band, but there are numerous problems: (a) scans can return info from more than one band (e.g., both 2.4 and 5 GHz), so the determined "max" is not large enough (b) some firmware appears to return multiple results for a given channel, so the max *really* isn't large enough (c) there is no bounds checking when stashing these stats, so problems (a) and (b) can easily lead to buffer overflows Let's patch this by setting a slightly-more-correct max (that accounts for a combination of both 2.4G and 5G bands) and adding a bounds check when writing to our statistics buffer. Due to problem (b), we still might not properly report all known survey information (e.g., with "iw <dev> survey dump"), since duplicate results (or otherwise "larger than expected" results) will cause some truncation. But that's a problem for a future bugfix. (And because of this known deficiency, only log the excess at the WARN level, since that isn't visible by default in this driver and would otherwise be a bit too noisy.) Fixes: bf35443314ac ("mwifiex: channel statistics support for mwifiex") Cc: <[email protected]> Cc: Avinash Patil <[email protected]> Cc: Xinming Hu <[email protected]> Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Dmitry Torokhov <[email protected]> Reviewed-by: Ganapathi Bhat <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-07-25drivers/net: Fix ptr_ret.cocci warnings.Tonghao Zhang1-4/+1
we can use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR 1. drivers/net/appletalk/ipddp.c 2. drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Tonghao Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>