summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-03-13rsi: use dynamic RX control blocks instead of MAX_RX_URBPrameela Rani Garnepudi2-16/+23
Currently 2 RX control blocks are allocated by default. If wifi alone mode is used rx control block 2 is unusable. So, changes are done accordingly in all places to use RX control blocks dynamically based on coex mode check. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: improve RX handling in SDIO interfacePrameela Rani Garnepudi4-24/+94
Currently, RX packets are handled in interrupt context in SDIO interface. To improve the efficiency of processing RX packets, RX thread and RX skb queues are introduced. When the packet is read from device, driver prepares skb, add to RX queue and trigger RX thread event. RX thread processes the packets from RX queue. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: sdio changes to support BTPrameela Rani Garnepudi2-1/+3
Queue number is correctly updated for BT traffic. Also, kzalloc instead of kmalloc is used for Rx packet allocation. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: add module parameter operating modePrameela Rani Garnepudi5-7/+74
Operating mode determines the support for other protocols. This is made as module parameter for better usage. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: handle BT traffic in driverSiva Rebbagondla8-9/+118
BT frames are passed through coex and hal modules to BUS. After firmware is loaded, based on the operating mode CARD READY frame comes for each protocol. When BT card ready is received, BT attach is called. Protocol operations are exchanged between the modules at initialization time. Build flag CONFIG_RSI_COEX is introduced to enable coex support if CONFIG_BT_RSIHCI is enabled. Coex operations are valid if coex mode is greater than 1 only. Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13Bluetooth: btrsi: add new rsi bluetooth driverPrameela Rani Garnepudi4-1/+205
Redpine bluetooth driver is a thin driver which depends on 'rsi_91x' driver for transmitting and receiving packets to/from device. It creates hci interface when attach() is called from 'rsi_91x' module. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: add coex supportPrameela Rani Garnepudi12-10/+303
With BT support, driver has to handle two streams of data (i.e. wlan and BT). Actual coex implementation is in firmware. Coex module just schedule the packets to firmware by taking them from the corresponding paths. Structures for module and protocol operations are introduced for this purpose. Protocol operations structure is global structure which can be shared among different modules. Move initialization of coex and operating mode values to rsi_91x_init(). Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: add header file rsi_91xPrameela Rani Garnepudi2-10/+36
The common parameters used by wlan and bt modules are add to a new header file "rsi_91x.h" defined in 'include/net' Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: add bluetooth rx endpointSiva Rebbagondla2-18/+25
USB endpoint 1 is used for WLAN which is presently in use. USB endpoint 2 is introduced for BT Rx traffic. Enumeration of Rx BT endpoint and submitting Rx BT URB are added. >From /sys/kernel/debug/usb/devices, Ad=81(I) is for WLAN EP IN and Ad=01(O) is for Wlan EP OUT. Ad=82(I) is for BT EP IN and Ad=02(O) is for BT EP OUT. T: Bus=01 Lev=01 Prnt=01 Port=09 Cnt=03 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1618 ProdID=9113 Rev= 0.02 S: Manufacturer=Redpine Signals, Inc. S: Product=Wireless USB Network Module S: SerialNumber=000000000001 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA I:* If#= 0 Alt= 0 #EPs= 6 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none) E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13rsi: add rx control block to handle rx packets in USBPrameela Rani Garnepudi7-34/+96
Rx bluetooth endpoint shall be added in further patches. Rx control block is introduced here to handle Rx packets properly. Separate function is written to initialize the RX control blocks. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt7601u: let mac80211 validate rx CCMP PNLorenzo Bianconi2-1/+10
Apparently the hardware does not perform CCMP PN validation so let mac80211 take care of possible replay attacks in sw. Moreover indicate ICV and MIC had been stripped setting corresponding bits in ieee80211_rx_status. The fix has been validated using 4.2.1 and 4.1.3 tests from the WiFi Alliance vulnerability detection tool. Fixes: c869f77d6abb ("add mt7601u driver") Acked-by: Jakub Kicinski <kubakici@wp.pl> Tested-by: David Park <david.park@hitemengineering.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt7601u: simplify mt7601u_mcu_msg_alloc signatureLorenzo Bianconi1-4/+3
Remove mt7601u_dev parameter from mt7601u_mcu_msg_alloc signature since dev pointer is never used in routine body Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt76x2: remove unnecessary len variable in mt76x2_eeprom_load()Lorenzo Bianconi1-6/+6
Substitute unnecessary len variable in mt76x2_eeprom_load() with MT7662_EEPROM_SIZE macro since len is used just to store eeprom default size. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt7601u: remove a warning in mt7601u_efuse_physical_size_check()Lorenzo Bianconi1-1/+1
Fix the following sparse warning in mt7601u_efuse_physical_size_check: - drivers/net/wireless/mediatek/mt7601u/eeprom.c:77:27: warning: Variable length array is used Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt76x2: add mac80211 {set,get}_antenna callbacksLorenzo Bianconi6-16/+88
Add capability to select tx/rx antennas. Possible values are: - 1: to use only the first antenna - 2: to use only the second antenna - 3: to use both of them Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt76: add mt76_init_stream_cap routineLorenzo Bianconi1-17/+39
Add mt76_init_stream_cap utility routine to set ht/vht sta capabilities related to number of streams currently used by the device (it will be used by mac80211 set_antenna callback) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-13mt76: initialize available_antennas_{tx,rx} infoLorenzo Bianconi3-0/+8
Initialize available_antennas related info in wiphy data structure according to antenna_mask field; antenna_mask info is initialized in device specific code and will be used in mac80211 {set,get}_antenna callbacks Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28mt7601u: make write with mask access atomicLorenzo Bianconi2-16/+39
Introduce __mt7601u_rr and __mt7601u_vendor_single_wr routines in order to make mt7601u_rmw and mt7601u_rmc atomic. This patch does not fix a reported issue but makes the usb access more robust to concurrent operations on the same register since it is theoretically possible that read and write accesses of mt7601u_rmw/mt7601u_rmc can be interleaved with a different write operation on the same register. Moreover using __mt7601u_rr and __mt7601u_vendor_single_wr in mt7601u_rmw/mt7601u_rmc allows to grab vendor_req_mutex mutex once instead of twice Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28rtl8187: Fix NULL pointer dereference in priv->conf_mutexSudhir Sreedharan1-1/+1
This can be reproduced by bind/unbind the driver multiple times in AM3517 board. Analysis revealed that rtl8187_start() was invoked before probe finishes(ie. before the mutex is initialized). INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 821 Comm: wpa_supplicant Not tainted 4.9.80-dirty #250 Hardware name: Generic AM3517 (Flattened Device Tree) [<c010e0d8>] (unwind_backtrace) from [<c010beac>] (show_stack+0x10/0x14) [<c010beac>] (show_stack) from [<c017401c>] (register_lock_class+0x4f4/0x55c) [<c017401c>] (register_lock_class) from [<c0176fe0>] (__lock_acquire+0x74/0x1938) [<c0176fe0>] (__lock_acquire) from [<c0178cfc>] (lock_acquire+0xfc/0x23c) [<c0178cfc>] (lock_acquire) from [<c08aa2f8>] (mutex_lock_nested+0x50/0x3b0) [<c08aa2f8>] (mutex_lock_nested) from [<c05f5bf8>] (rtl8187_start+0x2c/0xd54) [<c05f5bf8>] (rtl8187_start) from [<c082dea0>] (drv_start+0xa8/0x320) [<c082dea0>] (drv_start) from [<c084d1d4>] (ieee80211_do_open+0x2bc/0x8e4) [<c084d1d4>] (ieee80211_do_open) from [<c069be94>] (__dev_open+0xb8/0x120) [<c069be94>] (__dev_open) from [<c069c11c>] (__dev_change_flags+0x88/0x14c) [<c069c11c>] (__dev_change_flags) from [<c069c1f8>] (dev_change_flags+0x18/0x48) [<c069c1f8>] (dev_change_flags) from [<c0710b08>] (devinet_ioctl+0x738/0x840) [<c0710b08>] (devinet_ioctl) from [<c067925c>] (sock_ioctl+0x164/0x2f4) [<c067925c>] (sock_ioctl) from [<c02883f8>] (do_vfs_ioctl+0x8c/0x9d0) [<c02883f8>] (do_vfs_ioctl) from [<c0288da8>] (SyS_ioctl+0x6c/0x7c) [<c0288da8>] (SyS_ioctl) from [<c0107760>] (ret_fast_syscall+0x0/0x1c) Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = cd1ec000 [00000000] *pgd=8d1de831, *pte=00000000, *ppte=00000000 Internal error: Oops: 817 [#1] PREEMPT ARM Modules linked in: CPU: 0 PID: 821 Comm: wpa_supplicant Not tainted 4.9.80-dirty #250 Hardware name: Generic AM3517 (Flattened Device Tree) task: ce73eec0 task.stack: cd1ea000 PC is at mutex_lock_nested+0xe8/0x3b0 LR is at mutex_lock_nested+0xd0/0x3b0 Cc: stable@vger.kernel.org Signed-off-by: Sudhir Sreedharan <ssreedharan@mvista.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28mt7601u: set device mac address in mt7601u_add_interface()Lorenzo Bianconi1-0/+3
If mac80211 adds a vif with a different mac address respect to the eeprom one, the device will not be able to connect to the ap since the hw address has not been updated. Fix the issue updating hw mac address in mt7601u_add_interface routine BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1516935 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28mt7601u: move mt7601u_set_macaddr in mac related codeLorenzo Bianconi3-22/+19
Remove static qualifier from mt7601u_set_macaddr routine and move it in mac related code in order to be used to properly support vif with different mac address respect to the default one Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28mt76x2: remove warnings in mt76x2_mac_write_txwi()Lorenzo Bianconi1-2/+2
Fix following sparse warnings in mt76x2_mac_write_txwi: - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:201:26: warning: incorrect type in assignment (different base types) - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:201:26: expected restricted __le32 [usertype] iv - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:201:26: got unsigned int [unsigned] [usertype] <noident> - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:202:27: warning: incorrect type in assignment (different base types) - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:202:27: expected restricted __le32 [usertype] eiv - drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:202:27: got unsigned int [unsigned] [usertype] <noident> Fixes: 23405236460b ("mt76: fix transmission of encrypted management frames") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28ssb: Prevent build of PCI host features in moduleMatt Redfearn1-1/+1
Attempting to build ssb.ko with CONFIG_SSB_DRIVER_PCICORE=y results in a build error due to use of symbols not exported from vmlinux: ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined! ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined! make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1 To prevent this, don't allow the host mode feature to be built if CONFIG_SSB=m Signed-off-by: Matt Redfearn <matt.redfearn@mips.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-28bcma: add HP Stream NotebookDenis 'GNUtoo' Carikli1-0/+1
In this laptop we have the following PCI device: 02:00.0 Network controller [0280]: Broadcom Limited BCM43142 802.11b/g/n [14e4:4365] (rev 01) Subsystem: Hewlett-Packard Company BCM43142 802.11b/g/n [103c:804a] [...] Region 0: Memory at 91000000 (64-bit, non-prefetchable) [size=32K] [...] With this patch, we can now see its WiFi chip: bcma: bus0: Found chip with id 43142, rev 0x01 and package 0x08 bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x28, class 0x0) bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x21, class 0x0) bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x16, class 0x0) bcma: bus0: Core 3 found: UNKNOWN (manuf 0x43B, id 0x368, rev 0x00, class 0x0) bcma: bus0: Found rev 15 PMU (capabilities 0x518C5E0F) bcma: bus0: SPROM offset 0x840 bcma: bus0: Found SPROM revision 10 bcma: bus0: Workarounds unknown or not needed for device 0xA886 bcma: bus0: Bus registered But it not yet supported by brcmsmac so it won't work for now: brcmsmac bcma0:1: brcms_b_attach wl0: vendor 0x14e4 device 0x4365 brcmsmac: unknown device id 4365 Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: btcoex: fix argument typo of if-statement found by CoccinellePing-Ke Shih1-1/+1
This was detected with static analysis using Coccinelle: ./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c:1107:5-18: duplicated argument to && or || Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmsmac: remove duplicated bit-wise or of IEEE80211_CHAN_NO_IRColin Ian King1-1/+0
Bit pattern IEEE80211_CHAN_NO_IR is being bit-wise or'd twice; remove the redundant 2nd IEEE80211_CHAN_NO_IR Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: reject too long PSKJohannes Berg1-0/+3
nl80211 already allows specifying 48 bytes, but brcmfmac only supports 32. Reject keys that are too long. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: remove duplicate pointer variable from brcmf_sdio_firmware_callback()Arend Van Spriel1-19/+18
In brcmf_sdio_firmware_callback() two pointer variables were used pointing to the same construct. Get rid of sdiodev variable. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: change log level for some low-level sdio functionsArend Van Spriel1-5/+5
Reducing the number of trace level messages in sdio code giving them sdio log level instead. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: remove brcmf_bus_started() from bus apiArend Van Spriel5-57/+16
No longer needed to call this in bus layer so make it static and call it in the last phase of brcmf_attach() instead. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: move brcmf_attach() function in core.cArend Van Spriel1-49/+49
Moving the function in preparation of subsequent patch. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: usb: call brcmf_usb_up() during brcmf_bus_preinit()Arend Van Spriel1-5/+2
By calling brcmf_usb_up() during brcmf_bus_preinit() it does not need to be called in brcmf_usb_bus_setup(). Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()Arend Van Spriel2-17/+23
Now we can move brcmf_attach() until after the firmware has been downloaded to the device. Make the call just before brcmf_bus_started(). Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: move allocation of control rx buffer to brcmf_sdio_bus_preinit()Arend Van Spriel1-14/+12
Allocate the control rx buffer needed for firmware control interface during brcmf_sdio_bus_preinit(). This relies on common layer setting struct brcmf_bus::maxctl during brcmf_attach(). By moving the allocation we can move brcmf_attach() in subsequent change. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27brcmfmac: move brcmf_bus_preinit() call just after changing bus stateArend Van Spriel2-3/+5
Moving the brcmf_bus_preinit() call allows the bus code to do some required initialization before handling firmware control messages. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27mwifiex: set different mac address for interfaces with same bss typeXinming Hu2-5/+32
Multiple interfaces with same bss type could affect each other if they are sharing the same mac address. In this patch, different mac address is assigned to new interface which have same bss type with exist interfaces. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27qtnfmac: implement asynchronous firmware loadingSergey Matyukevich2-198/+180
In pci probe() function start firmware loading, protocol handshake and driver core initialization, and not wait for completion. Signed-off-by: Sergei Maksimenko <smaksimenko@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27qtnfmac: enable reloading of qtnfmac kernel modulesSergei Maksimenko3-1/+16
This patch enables rmmod/insmod for qtnfmac kernel modules: - do not 'pin' pci device in order to disable it on module unload - implement card reset procedure - restore PCI bar addresses for restarted wireless card Signed-off-by: Sergei Maksimenko <smaksimenko@quantenna.com> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27qtnfmac: fix releasing Tx/Rx data buffersSergey Matyukevich1-12/+18
Add missing PCI unmap for Tx buffers and release all buffers explicitly. Managed release using devm_add_action is not suitable for qtnfmac Tx/Rx data buffers. The reason is in ordering and dependencies: buffers should be released after transmission is stopped but before PCI device resources and DMA allocations are released. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: rtl8192cu: remove pointless memcpyArnd Bergmann1-1/+0
gcc-8 points out that source and destination of the memcpy() are always the same pointer, so the effect of memcpy() is undefined here (its arguments must not overlap): drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c: In function '_rtl_rx_process': drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:430:2: error: 'memcpy' source argument is the same as destination [-Werror=restrict] Most likely this is harmless, but it's easy to just remove the line and get rid of the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: rtl8192cu: Remove variable self-assignment in rf.cMatthias Kaehlcke1-3/+0
In _rtl92c_get_txpower_writeval_by_regulatory() the variable writeVal is assigned to itself in an if ... else statement, apparently only to document that the branch condition is handled and that a previously read value should be returned unmodified. The self-assignment causes clang to raise the following warning: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c:304:13: error: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Werror,-Wself-assign] writeVal = writeVal; Delete the branch with the self-assignment. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27wireless: zd1211rw: remove redundant assignment of pointer 'q'Colin Ian King1-1/+0
Pointer q is initialized and then almost immediately afterwards being re-assigned the same value. Remove the second redundant assignment. Cleans up clang warning: drivers/net/wireless/zydas/zd1211rw/zd_mac.c:503:23: warning: Value stored to 'q' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: btcoex: Add 8822be btcoex supported files for wifi onlyPing-Ke Shih2-0/+80
The wifi only btcoex is used to solo card (without BT), and it is also useful to exclude the interference with BT to make debug easier. There are only four ops for wifi only btcoex to initialze antenna and switch the settings while band is changed. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: btcoex: add routine to set default port idPing-Ke Shih3-0/+29
Tell wifi and BT firmware the default port ID to set multiports' state properly, but only 8822be needs this function currently. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: add efuse ops for other componentsPing-Ke Shih4-1/+22
The new component phydm need to access efuse content, so we prepare ops for reference. Signed-off-by: Tsang-Shian Lin <thlin@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: add definition radio_mask for RF and maximum bandwidthPing-Ke Shih1-0/+8
Add rf mask definition (BIT 0, BIT 1, BIT 2, ...) that is different from rf path definition (0, 1, 2, ...), and then combinations of rf path are possible. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: Fix VHT NSS in RCPing-Ke Shih1-9/+46
NSS is a argument of highest rate in RC, and it occupies bit 4-7 so use ieee80211_rate_set_vht() to fill the values. Since it got correct rate index, we don't need to check chips to assign NSS in set function anymore. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: Add rate section and its related definition and commentPing-Ke Shih2-3/+7
Add comments to make it to be easier to understand, and add compile time assertions. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: Extend tx_power_by_rate_offset size for newer ICPing-Ke Shih2-1/+4
In older design, the TX power is grouped into rate section (smaller array size), but new design groups them into rate (larger array size). Thus, we extend the size for both cases, and add compile time assertion. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-02-27rtlwifi: Use 6 bits as sequence number of TX reportPing-Ke Shih2-4/+26
In new design, SW_DEFINE[1:0] of tx desc are used by firmware, and the TX report only contains SW_DEFINE[7:0]. To satisfy with all cases, driver uses SW_DEFINE[7:2] as sequence number. Besides, the format of tx report have been changed, so a new flag RTL_SPEC_EXT_C2H is used to access report. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>