summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell/mwifiex/pcie.h
Commit message (Collapse)AuthorAgeFilesLines
* mwifiex: pcie: extract wifi part from combo firmware during function level resetXinming Hu2017-04-201-1/+2
| | | | | | | | | | | | | | | | | A separate wifi-only firmware was download during pcie function level reset. It is in fact the tail part of wifi/bt combo firmware. Per Brian's and Dmitry's suggestion, this patch extract the wifi part from combo firmware. After that, the mrvl/pcie8997_wlan_v4.bin image in linux-firmware repo is redundant (though I guess we keep it around to support older kernels). Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: pcie: correct scratch register nameXinming Hu2017-04-201-6/+7
| | | | | | | | This patch correct pcie scratch register name, to keep the same with chipset side definition. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: mwifiex_unmap_pci_memory() handling for sleep confirmAmitkumar Karwar2017-01-281-0/+1
| | | | | | | | | | | | | | Sleep confirm is a special command for which "adapter->cur_cmd" pointer is not set. When it's response is received, host writes SLEEP confirm done to a register. Firmware will perform DMA for writing sleep cookie signature on same buffer after this. Let's not immediately call mwifiex_unmap_pci_memory() for this special command. Unmapping will be done when firmware completes writing sleep cookie signature. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: move pcie_work and related variables inside cardGanapathi Bhat2017-01-121-0/+2
| | | | | | | | | | | Currently pcie_work and related variables are global. It may create problem while supporting multiple devices simultaneously. Let's move it inside card structure so that separate instance will be created/ cancelled in init/teardown threads of each connected devices. Signed-off-by: Ganapathi Bhat <gbhat@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: resolve races between async FW init (failure) and device removalBrian Norris2016-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | It's possible for the FW init sequence to fail, which will trigger a device cleanup sequence in mwifiex_fw_dpc(). This sequence can race with device suspend() or remove() (e.g., reboot or unbind), and can trigger use-after-free issues. Currently, this driver attempts (poorly) to synchronize remove() using a semaphore, but it doesn't protect some of the critical sections properly. Particularly, we grab a pointer to the adapter struct (card->adapter) without checking if it's being freed or not. We later do a NULL check on the adapter, but that doesn't work if the adapter was freed. Also note that the PCIe interface driver doesn't ever set card->adapter to NULL, so even if we get the synchronization right, we still might try to redo the cleanup in ->remove(), even if the FW init failure sequence already did it. This patch replaces the static semaphore with a per-device completion struct, and uses that completion to synchronize the remove() thread with the mwifiex_fw_dpc(). A future patch will utilize this completion to synchronize the suspend() thread as well. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: PCIe8997 chip specific handlingAmitkumar Karwar2016-09-091-8/+6
| | | | | | | | | | | | The patch corrects the revision id register and uses it along with magic value and chip version registers to download appropriate firmware image. PCIe8997 Z chipset variant code has been removed, as it won't be used in production. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: add PCIe function level reset supportAmitkumar Karwar2016-09-091-0/+1
| | | | | | | | | | | | | | | | This patch implements pre and post FLR handlers to support PCIe FLR functionality. Software cleanup is performed in pre-FLR whereas firmware is downloaded and software is re-initialised in post-FLR handler. Following command triggers FLR. echo "1" > /sys/bus/pci/devices/$NUMBER/reset This feature can be used as a recovery mechanism when firmware gets hang. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: Change default firmware for PCIe8997 chipsetAmitkumar Karwar2016-07-081-2/+2
| | | | | | | | | PCIe-USB8997 variant is being used in the product. Let's change default firmware from PCIe-UART to PCIe-USB. So by default PCIe-USB firmware would be downloaded if version register doesn't give any information. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: disable MSIx interrupt for 8997 chipsetShengzhen Li2016-07-051-1/+1
| | | | | | | | | | | Sometimes MSIx interrupts are received out of order on multi-core system. This creates a problem when there is a race between data packet and SLEEP event from firmware. We will disable MSIx interrupt mode to solve the problem and go with MSI mode. Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: Drop unnecessary include pcieport_if.hLukas Wunner2016-05-111-1/+0
| | | | | | | | | | | This header file is only needed for drivers binding to a PCI bridge device allocated by drivers/pci/pcie/portdrv_core.c. The mwifiex driver doesn't do that nor use any symbols defined in pcieport_if.h. Cc: Amitkumar Karwar <akarwar@marvell.com> Cc: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: change sleep cookie poll countShengzhen Li2016-05-101-1/+1
| | | | | | | | | Sometimes current polling count is not sufficient. This patch increases it to 100. Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: add default setting for pcie firmware downloadShengzhen Li2016-04-141-0/+2
| | | | | | | | | This patch adds default setting for pcie firmware download name in case that there are newer chipset version. Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: add pcie usb/uart firmware download supportShengzhen Li2016-04-141-2/+5
| | | | | | | | | This patch adds support for downloading usb/uart firmware for 8997 chipset by reading the chip version. Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: dump pcie scratch registersXinming Hu2016-04-071-0/+2
| | | | | | | | | This patch prints pcie scratch registers during firmware dump. They will be useful for analysing firmware status. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: check revision id while choosing PCIe firmwareShengzhen Li2016-04-071-6/+10
| | | | | | | | | Some of the chipsets have two revisions. This patch selects appropriate firmware by checking revision id. Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: firmware dump support for w8997 chipsetXinming Hu2016-02-071-1/+12
| | | | | | | | | | | | | | | | Current firmware dump solution support w8897 chipset, this patch extend the exist framework with support for w8997 chipset. Trigger firmware dump using, cat /sys/kernel/debug/mwifiex/mlan0/device_dump, data can be obtain by cat /sys/class/devcoredump/devcd*/data > data.txt after that. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: use an extensible framework for firmware dump solutionXinming Hu2016-02-071-0/+19
| | | | | | | | | | This patch apply an extensible firmware dump framework, so that other chipset can be easily added as needed. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: keep original structure in decl header fileXinming Hu2016-02-071-0/+1
| | | | | | | | | | | | memory_type_mapping strucuture did not refer to other mwifiex specific strture. A better software design method would keep it in decl header file, which does not include other mwifiex header file. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: enable pcie MSIx interrupt mode supportXinming Hu2016-01-291-0/+17
| | | | | | | | | Newer pcie chipsets (8997 onwards) support MSIx. This patch enables it. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: enable MSI interrupt support in pcieAvinash Patil2015-12-301-0/+1
| | | | | | | | | Newer pcie devices (8897 onwards) support MSI. This patch enables it. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: add missing check for PCIe8997 chipsetAmitkumar Karwar2015-12-301-0/+1
| | | | | | | | | This patch ensures mwifiex_pcie_txbd_empty() does take care of 8997 chipset. Fixes: 6d85ef00d9dfe ("mwifiex: add support for 8997 chipset") Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix PCIe register information for 8997 chipsetAmitkumar Karwar2015-12-301-4/+4
| | | | | | | | | | This patch corrects some information in mwifiex_pcie_card_reg() structure for 8997 chipset Fixes: 6d85ef00d9dfe ("mwifiex: add support for 8997 chipset") Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: move under marvell vendor directoryKalle Valo2015-11-181-0/+382
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
OpenPOWER on IntegriCloud