aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rsi
AgeCommit message (Collapse)AuthorFilesLines
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-06-28rsi: add in missing RSI_FSM_STATES into array fsm_stateColin Ian King1-0/+2
Two recent commits added new RSI_FSM_STATES (namely FSM_FW_NOT_LOADED and FSM_COMMON_DEV_PARAMS_SENT) and the corresponding table fsm_state was not updated to match. This can lead to an array overrun when accessing the latter two states in fsm_state. Fix this by adding in the missing states. Detected by CoverityScan, CID#1398379 ("Illegal address computation") Fixes: 9920322ccd8e ("rsi: add tx frame for common device configuration") Fixes: 015e367494c1 ("rsi: Register interrupt handler before firmware load") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-25Merge tag 'wireless-drivers-next-for-davem-2017-06-25' of ↵David S. Miller9-45/+232
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.13 New features and bug fixes to quite a few different drivers, but nothing really special standing out. What makes me happy that we have now more vendors actively contributing to upstream drivers. In this pull request we have patches from Broadcom, Intel, Qualcomm, Realtek and Redpine Signals, and I still have patches from Marvell and Quantenna pending in patchwork. Now that's something comparing to how things looked 11 years ago in Jeff Garzik's "State of the Union: Wireless" email: https://lkml.org/lkml/2006/1/5/671 Major changes: wil6210 * add low level RF sector interface via nl80211 vendor commands * add module parameter ftm_mode to load separate firmware for factory testing * support devices with different PCIe bar size * add support for PCIe D3hot in system suspend * remove ioctl interface which should not be in a wireless driver ath10k * go back to using dma_alloc_coherent() for firmware scratch memory * add per chain RSSI reporting brcmfmac * add support multi-scheduled scan * add scheduled scan support for specified BSSIDs * add support for brcm43430 revision 0 wlcore * add wil1285 compatible rsi * add RS9113 USB support iwlwifi * FW API documentation improvements (for tools and htmldoc) * continuing work for the new A000 family * bump the maximum supported FW API to 31 * improve the differentiation between 8000, 9000 and A000 families ==================== Signed-off-by: David S. Miller <[email protected]>
2017-06-21rsi: add tx frame for common device configurationPrameela Rani Garnepudi5-14/+178
After successful loading of firmware, a CARD READY indication is received by host. Common device configuration parameters are sent to the device after this. It includes information like device operating mode (Wi-Fi alone or BT coex), power save related parameters, GPIO information etc. As device supports BT coex, this frame is send in COEX queue initially. Based on the operating mode, CARD READY indication is received from each protocol module in firmware i.e. WLAN, BT. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: configure new boot parameters to devicePrameela Rani Garnepudi2-13/+22
Boot parameters are changed in new firmware. Also three new sdio sleep parameters are added for ultra low power save. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: receive path enhancement for RS9113Prameela Rani Garnepudi2-1/+9
RS9113 chipset supports Coex feature. Initial frame exchanges during device initialization happens on coex queue. This patch adds the handling for coex queue. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: Register interrupt handler before firmware loadPrameela Rani Garnepudi3-10/+13
Before firmware load, sometimes false interrupts are received. System hang is observed if interrupt handler is not registered to receive these interrupts. Hence interrupt handler registration is moved before firmware load. We will drop these false interrupts as these are not from the device. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: use enum for FSM statesAmitkumar Karwar1-7/+9
Currently macros are used for FSM states. We will replace it with enum so that new state can be added easily without worrying about macro value. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: add usb RS9113 chipset supportPrameela Rani Garnepudi1-0/+1
usb device id and vendor id for RS9113 chipset are included. So it can be used through usb interface. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-20net: manual clean code which call skb_put_[data:zero]yuan linyu1-7/+3
Signed-off-by: yuan linyu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg1-5/+3
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-01rsi: use subdirectory for firmware fileamit karwar1-1/+1
linux-firmware maintainers prefer to have a subdirectory for firmware files. Code is changed here to pick firmware file from a subdirectory. Firmware file with a new loading mechanism will be submitted inside rsi directory. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: rsi_91x_core: Use time_after time comparisonKarim Eshapa1-1/+1
Use time_after kernel macro for time comparison. Signed-off-by: Karim Eshapa <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Remove old firmware loading methodPrameela Rani Garnepudi6-323/+3
The older firmware loading method is not usable by any Redpine chipset. Hence removing that part of the code. Older firmware image with rsi_91x.fw name is deprecated Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Add new firmware loading methodPrameela Rani Garnepudi5-10/+635
The older firmware loading method has been deprecated and not in use for any chipets. New method is introduced which works based on soft boot loader. In this method, complete RAM image and FLASH image are present in the flash. Before loading the functional firmware, host issues boot loader commands to verify whether firmware to load is different from the current functional firmware. If not, firmware upgrade progresses and boot loader will switch to the new functional firmware. "rs9113_wlan_qspi.rps" is the firmware filename used 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-05-24rsi: Add new host interface operationsPrameela Rani Garnepudi5-2/+254
Host interface opearation master_reg_read, master_reg_write and load_data_master_write are added. These functions are needed for the new firmware loading method. As part of this, the function master_access_msword is moved from rsi_91x_sdio_ops.c to rsi_91x_sdio.c. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Add host interface operations as separate structure.Prameela Rani Garnepudi4-14/+40
Host interface operations are currently function pointers in rsi_hw structure. As more host interface operations are going to be introduced, separate structure is added for these for convenience. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Add usb multi-byte read operationPrameela Rani Garnepudi1-0/+40
USB multibyte read will be used in the new firmware loading method for RS9113 chipset. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Handle usb multi-byte write failure case properlyPrameela Rani Garnepudi1-4/+5
In function usb_write_register_multiple, if any intermediate block transfer is failed, further operations should be terminated. 'else' is removed, as there is no significance for it after return. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: use macros in USB specific codePrameela Rani Garnepudi1-6/+9
For USB vendor read and write operations new macros added to avoid redundant usage of long or'ed macros. Also for timeouts standard USB macros are used. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Changes in USB read and write operationsPrameela Rani Garnepudi3-8/+9
USB read and write registers maximum size is limited 2^16. More than this size is not used in the driver. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: define RSI_USB_BUF_SIZE macroamit karwar2-2/+4
RSI_USB_BUF_SIZE macro is used instead of hardcoding a buffer size to 4096. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Changes to sdio reads and writesPrameela Rani Garnepudi3-11/+11
SDIO read or write maximum size is limited to 2^16. This is done to make the host interface operations common for SDIO and USB. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-05-24rsi: Rename file rsi_91x_pkt.c to rsi_91x_hal.cPrameela Rani Garnepudi2-1/+1
The file rsi_91x_hal.c is going to contain device specific code i.e new firmware loading method for RS9113 chipset. As the file rsi_91x_pkt.c contains code to prepare device specific descriptors for transmit packet, this file is renamed to rsi_91x_hal.c which is more relevant as per it's functionality. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-03-06wireless: Set NL80211_EXT_FEATURE_CQM_RSSI_LIST in multiple driversAndrew Zaborowski1-0/+2
Set the NL80211_EXT_FEATURE_CQM_RSSI_LIST wiphy extended feature wholesale in all mac80211-based drivers that do not set the IEEE80211_VIF_BEACON_FILTER flags on their interfaces. mac80211 will be processing supplied RSSI values in ieee80211_rx_mgmt_beacon and will detect when the thresholds set by ieee80211_set_cqm_rssi_range_config are crossed. Remaining (few) drivers need code to enable the firmware to monitor the thresholds. This is mostly only compile-tested. Signed-off-by: Andrew Zaborowski <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2017-02-27scripts/spelling.txt: add "deintialize(d)" pattern and fix typo instancesMasahiro Yamada1-1/+1
Fix typos and add the following to the scripts/spelling.txt: deintializing||deinitializing deintialize||deinitialize deintialized||deinitialized Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2017-02-08mac80211: Pass new RSSI level in CQM RSSI notificationAndrzej Zaborowski1-1/+1
Extend ieee80211_cqm_rssi_notify with a rssi_level parameter so that this information can be passed to netlink clients in the next patch, if available. Most drivers will have this value at hand. wl1251 receives events from the firmware that only tell it whether latest measurement is above or below threshold so we don't pass any value at this time (parameter is 0). Signed-off-by: Andrew Zaborowski <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2016-11-25rsi: Add support for 802.11dPrameela Rani Garnepudi4-7/+53
Transmit power level in a channel is determined based on the dfs region. To support regulatory rules dfs region should be configured to device during set channel request. Also antenna gain values are taken from the mac80211 channel parameters instead of fixed values. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-25rsi: Add support for antenna selectionPrameela Rani Garnepudi4-0/+117
RSI 9113 device supports single antenna for tx and rx. Support for using external is added. This can be configured from user space using iw. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-25rsi: Add support for configuring tx powerPrameela Rani Garnepudi4-1/+76
TX power can be configured from iwconfig, iw or from mac80211 when regulatory changes are done. Hence support for configuring tx power to device is added using the RADIO_PARAMS_UPDATE command frame. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-25rsi: Add support to filter rx framesPrameela Rani Garnepudi3-1/+59
Filtering rx frames after connection in station mode avoids the overhead of processing un-necessary frames. Hence rx filter frame is added which can be configured to device at suitable times. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-17rsi: Host to device command frame vap_capabilites modified with new field ↵Prameela Rani Garnepudi3-4/+18
vap status * Command frame vap_capabilites is modified to use for vap add, vap delete and vap update in firmware, hence new filed vap status is added. * When interface is down this frame needs to be send with vap status delete. Otherwise it is considered as wrong frame for the same interface in firmware. * vap_update status is reserved for future. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-17rsi: Fix memory leak in module unloadPrameela Rani Garnepudi1-0/+11
Observed crash when module is unloaded if CONFIG_RSI_DEBUGSFS is not set. Fix: Debugfs entry removal moved inside CONFIG_RSI_DEBUGSFS flag in function rsi_mac80211_detach() Memory leak found and fixed for below structures in function rsi_mac80211_detach() * channel list for each supported band * rsi debugfs info Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-06-14rsi: eliminate superfluous NULL checkHeinrich Schuchardt1-1/+1
msg is dereferenced before checking against NULL, e.g. when assigning pad_bytes. Remove the superfluous check in function rsi_mgmt_pkt_to_core. Signed-off-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg4-56/+56
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <[email protected]>
2016-04-07rsi: Move variable initialisation into error codeMarkus Elfring1-2/+4
In rsi_send_data_pkt(), it's a little more logical to assign 'status' in the actual error handling code as opposed to at the top of the functon. Signed-off-by: Markus Elfring <[email protected]> [Deleted controversial bits, rewrote commit message] Signed-off-by: Julian Calaby <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-04-07rsi: Delete unnecessary variable initialisationMarkus Elfring1-4/+4
In rsi_send_data_pkt(), the following variables are assigned to before they're used: * tmp_hdr - Assigned on line 47, first used on line 48 * bss - Assigned on line 41, first used on line 44 * extnd_size - Assigned on line 50, first used on line 52 * seq_num - Assigned on line 48, first used on line 96 Signed-off-by: Markus Elfring <[email protected]> [Rewrote commit message] Signed-off-by: Julian Calaby <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-04-07rsi: Delete unnecessary variable initialisationMarkus Elfring1-4/+4
In rsi_send_mgmt_pkt(), the following variables are assigned to before they're used: * wh - Assigned on line 161, first used on line 180 * bss - Assigned on line 160, first used on line 196 * msg - Assigned on line 168, first used on line 175 * extnd_size - Assigned on line 139, first used on line 142 Signed-off-by: Markus Elfring <[email protected]> [Rewrote commit message] Signed-off-by: Julian Calaby <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-01-14mac80211: pass block ack session timeout to to driverSara Sharon1-12/+7
Currently mac80211 does not inform the driver of the session block ack timeout when starting a rx aggregation session. Drivers that manage the reorder buffer need to know this parameter. Seeing that there are now too many arguments for the drv_ampdu_action() function, wrap them inside a structure. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-12-30rsi: bool tests do not need comparisonNicholas Mc Guire1-1/+1
This is an API consolidation only. Bool initializations should use true and false thus bool tests don't need an explicit comparison. Signed-off-by: Nicholas Mc Guire <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2015-12-30rsi: consolidate kmalloc/memset 0 calls to kzallocNicholas Mc Guire1-2/+1
This is an API consolidation only. The use of kmalloc + memset to 0 is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2015-11-18rsi: add vendor Kconfig entryKalle Valo1-0/+15
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <[email protected]>
2015-09-22mac80211: allow to transmit A-MSDU within A-MPDUEmmanuel Grumbach1-1/+3
Advertise the capability to send A-MSDU within A-MPDU in the AddBA request sent by mac80211. Let the driver know about the peer's capabilities. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-08-25rsi: Fix possible leak when loading firmwareChristian Engelmayer2-4/+12
Commit 5d5cd85ff441 ("rsi: Fix failure to load firmware after memory leak fix and fix the leak") also added a check on the allocation of DMA-accessible memory that may directly return. In that case the already allocated firmware data is leaked. Make sure the data is always freed correctly. Detected by Coverity CID 1316519. Fixes: 5d5cd85ff441 ("rsi: Fix failure to load firmware after memory leak fix and fix the leak") Signed-off-by: Christian Engelmayer <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2015-07-31rsi: Fix failure to load firmware after memory leak fix and fix the leakMike Looijmans2-1/+11
Fixes commit eae79b4f3e82 ("rsi: fix memory leak in rsi_load_ta_instructions()") which stopped the driver from functioning. Firmware data has been allocated using vmalloc(), resulting in memory that cannot be used for DMA. Hence the firmware was first copied to a buffer allocated with kmalloc() in the original code. This patch reverts the commit and only calls "kfree()" to release the buffer after sending the data. This fixes the memory leak without breaking the driver. Add a comment to the kmemdup() calls to explain why this is done, and abort if memory allocation fails. Tested on a Topic Miami-Florida board which contains the rsi SDIO chip. Also added the same kfree() call to the USB glue driver. This was not tested on actual hardware though, as I only have the SDIO version. Fixes: eae79b4f3e82 ("rsi: fix memory leak in rsi_load_ta_instructions()") Signed-off-by: Mike Looijmans <[email protected]> Cc: [email protected] Signed-off-by: Kalle Valo <[email protected]>
2015-06-10mac80211: convert HW flags to unsigned long bitmapJohannes Berg1-4/+3
As we're running out of hardware capability flags pretty quickly, convert them to use the regular test_bit() style unsigned long bitmaps. This introduces a number of helper functions/macros to set and to test the bits, along with new debugfs code. The occurrences of an explicit __clear_bit() are intentional, the drivers were never supposed to change their supported bits on the fly. We should investigate changing this to be a per-frame flag. Signed-off-by: Johannes Berg <[email protected]>