summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell
Commit message (Collapse)AuthorAgeFilesLines
* mwifiex: fix AP start problem for newly added interfaceAmitkumar Karwar2016-06-291-0/+8
| | | | | | | | | | | | | It's been observed that if interface type is changed from managed to __ap, AP can be successfully started. But there is a problem if new ap interface is added. The problem got resolved after sending appropriate commands to firmware in add_interface handler. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix AP unable to start in VHT40 problemAmitkumar Karwar2016-06-292-2/+30
| | | | | | | | | This patch populates secondary channel offset and downloads it to firmware to fix the problem. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix system hang problem after resumeAmitkumar Karwar2016-06-291-1/+1
| | | | | | | | | | On some platforms, driver is unable to wakeup firmware after system resume due to a problem at MMC subsystem. Triggering card reset in this case has a race with card removal from MMC which causes system hang. This patch resolves the problem by not triggering card reset. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: cancel pending scan during disconnectXinming Hu2016-06-291-0/+3
| | | | | | | | | | It is obeserved that sometimes scan operation will block the disconnect during system suspend. It's ok to cancel ongoing scan in this case. It reduces unnecessary system suspend delay. 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: factor out mwifiex_cancel_scanXinming Hu2016-06-293-38/+29
| | | | | | | | | This patch creates common function mwifiex_cancel_scan to remove duplication of code. 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: Fix an issue spotted by KASANGanapathi Bhat2016-06-292-0/+16
| | | | | | | | | | When an association command is sent to firmware but the process is killed before the command response arrives, driver will try to access bss_desc which is already freed. This issue is fixed by checking return value of bss_start. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas: Add spinlock to avoid race conditionPavel Andrianov2016-06-291-0/+4
| | | | | | | | | | | | | | | | lbs_mac_event_disconnected may free priv->currenttxskb while lbs_hard_start_xmit accesses to it. The patch adds a spinlock for mutual exclusion. Tested on OLPC XO-1 (usb8388) and XO-1.5 (sd8686) with v4.7-rc3. Confirmed that lbs_mac_event_disconnected is being called on the station when hostapd on access point is given SIGHUP. Signed-off-by: Pavel <andrianov@ispras.ru> Tested-by: James Cameron <quozl@laptop.org> Acked-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas_tf: Remove create_workqueueBhaktipriya Shridhar2016-06-291-1/+1
| | | | | | | | | | | | | | | alloc_workqueue replaces deprecated create_workqueue(). A dedicated workqueue has been used since the workitem (viz &priv->cmd_work per priv, which maps to lbtf_cmd_work) is involved in actual command processing and may be used on a memory reclaim path. The workitems require forward progress under memory pressure and hence, WQ_MEM_RECLAIM has been set. Since there are only a fixed number of work items, explicit concurrency limit is unnecessary here. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix link error against sdioArnd Bergmann2016-06-183-6/+15
| | | | | | | | | | | | | | | | | | | | Calling sdio_claim_host() from the interface independent part of the mwifiex driver is not only a layering violation, but also causes a link error if MMC support is disabled, or if CONFIG_MMC=m and CONFIG_MWIFIEX=y: drivers/net/built-in.o: In function `mwifiex_fw_dpc': :(.text+0xff138): undefined reference to `sdio_claim_host' :(.text+0xff158): undefined reference to `sdio_release_host' The right way to do this is to have the sdio specific code in the sdio driver front-end, and we already have a callback pointer that we can use for this after exporting the generic fw download function from the core driver. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 65c71efe1c59 ("mwifiex: fix racing condition when downloading firmware") Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas: Remove create_workqueueBhaktipriya Shridhar2016-06-162-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc_workqueue replaces deprecated create_workqueue(). In if_sdio.c, the workqueue card->workqueue has workitem &card->packet_worker, which is mapped to if_sdio_host_to_card_worker. The workitem is involved in sending packets to firmware. Forward progress under memory pressure is a requirement here. In if_spi.c, the workqueue card->workqueue has workitem &card->packet_worker, which is mapped to if_spi_host_to_card_worker. The workitem is involved in sending command packets from the host. Forward progress under memory pressure is a requirement here. Dedicated workqueues have been used in both cases since the workitems on the workqueues are involved in normal device operation with WQ_MEM_RECLAIM set to gurantee forward progress under memory pressure. Since there are only a fixed number of work items, explicit concurrency limit is unnecessary. flush_workqueue is unnecessary since destroy_workqueue() itself calls drain_workqueue() which flushes repeatedly till the workqueue becomes empty. Hence the calls to flush_workqueue() before destroy_workqueue() have been dropped. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas_tf: Drop unused variable and defineGuenter Roeck2016-06-161-7/+0
| | | | | | | | | | | | | gcc-6 reports: drivers/net/wireless/marvell/libertas_tf/main.c:30:19: error: 'lbtf_driver_version' defined but not used with -Werror=unused-const-variable=. Reported-by: Fengguang Wu <fengguang.wu@intel.com> [0-day test robot] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: use better message and error code when OF node doesn't matchJavier Martinez Canillas2016-06-161-2/+2
| | | | | | | | | | | | | | | The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT binding document lists the possible compatible strings that a SDIO child node can have, so the driver checks if the defined in the node matches. But the error message when that's not the case is misleading, so change for one that makes clear what the error really is. Also, returning a -1 as errno code is not correct since that's -EPERM. A -EINVAL seems to be a more appropriate one. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: don't print an error if an optional DT property is missingJavier Martinez Canillas2016-06-161-1/+1
| | | | | | | | | | The Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt DT binding document say that the "interrupts" property in the child node is optional. So the property being missed shouldn't be treated as an error. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: check if mwifiex_sdio_probe_of() fails and return errorJavier Martinez Canillas2016-06-161-2/+7
| | | | | | | | | The function can fail so the returned value should be checked and the error propagated to the caller in case of a failure. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: use dev_err() instead of pr_err() in mwifiex_sdio_probe()Javier Martinez Canillas2016-06-161-2/+2
| | | | | | | | It's better to have the device name prefixed in the error message. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: consolidate mwifiex_sdio_probe() error pathsJavier Martinez Canillas2016-06-161-6/+11
| | | | | | | | | | | | | | Instead of duplicating part of the cleanups needed in case of an error in .probe callback, have a single error path and use goto labels as is common practice in the kernel. This also has the nice side effect that the cleanup operations are made in the inverse order of their counterparts, which was not the case for the mwifiex_add_card() error path. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: propagate mwifiex_add_card() errno code in mwifiex_sdio_probe()Javier Martinez Canillas2016-06-161-4/+4
| | | | | | | | | | | | | | | There's only a check if mwifiex_add_card() returned a nonzero value, but the actual error code is neither stored nor propagated to the caller. So instead of always returning -1 (which is -EPERM and not a suitable errno code in this case), propagate the value returned by mwifiex_add_card(). Patch also removes the assignment of sdio_disable_func() returned value since it was overwritten anyways and what matters is to know the error value returned by the first function that failed. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: propagate sdio_enable_func() errno code in mwifiex_sdio_probe()Javier Martinez Canillas2016-06-161-1/+1
| | | | | | | | | | | | | If the sdio_enable_func() function fails on .probe, the -EIO errno code is always returned but that could make more difficult to debug and find the cause of why the function actually failed. Since the driver/device core prints the value returned by .probe in its error message propagate what was returned by sdio_enable_func() at fail. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: only call mwifiex_sdio_probe_of() if dev has an OF nodeJavier Martinez Canillas2016-06-161-3/+3
| | | | | | | | | | | | | | | | | | | | | SDIO is an auto enumerable bus so the SDIO devices are matched using the sdio_device_id table and not using compatible strings from a OF id table. However, commit ce4f6f0c353b ("mwifiex: add platform specific wakeup interrupt support") allowed to match nodes defined as child of the SDIO host controller in the probe function using a compatible string to setup platform specific parameters in the DT. The problem is that the OF parse function is always called regardless if the SDIO dev has an OF node associated or not, and prints an error if it is not found. So, on a platform that doesn't have a node for a SDIO dev, the following misleading error message will be printed: [ 12.480042] mwifiex_sdio mmc2:0001:1: sdio platform data not available Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: inform disconnection initiator correctly.Amitkumar Karwar2016-06-144-10/+12
| | | | | | | | This patch ensures that 'locally_generated' parameter is correctly passed to cfg80211_disconnected() API. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: remove misleading GFP_DMA flag in buffer allocationsMathias Krause2016-06-143-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | The GFP_DMA flag is obviously misunderstood in the mwifiex driver. It's meant for legacy ISA DMA memory mappings only -- the lower 16MB on x86. That doesn't apply to PCIe or SDIO devices, I guess. Remove the GFP_DMA flag to reduce the need to place the socket buffer allocation into the low mem DMA area, which might already be in use by other drivers. This misuse was flagged by the PaX USERCOPY feature by chance, as it detected the user copy operation from a DMA buffer in the recvfrom() syscall path. Signed-off-by: Mathias Krause <minipli@googlemail.com> Tested-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: Amitkumar Karwar <akarwar@marvell.com> Cc: Nishant Sarmukadam <nishants@marvell.com> Cc: Xinming Hu <huxm@marvell.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: Brad Spengler <spender@grsecurity.net> Cc: PaX Team <pageexec@freemail.hu> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix racing condition when downloading firmwareWei-Ning Huang2016-06-141-2/+10
| | | | | | | | | | | | | | | | | | The action 'check for winner' and 'download firmware' should be an atomic action. This is true for btmrvl driver but not mwmfiex, which cause firmware download to fail when the following senerio happens: 1) mwifiex check winner status: true 2) btmrvl check winner status: true, and start downloading firmware 3) mwfieix tries to download firmware, but failed because btmrvl is already downloading. This won't happen if 1) and 3) is an atomic action. This patch adds sdio_claim/release_host call around those two actions to make sure it's atomic. Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwiflex: avoid possible null pointer dereferenceHeinrich Schuchardt2016-06-141-1/+2
| | | | | | | Do not dereference card before checking against NULL value. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: illegal assignmentHeinrich Schuchardt2016-06-141-1/+1
| | | | | | | | | Variable adapter is incorrectly initialized. Fixes: bf00dc22bc7a ("mwifiex: AMSDU Rx frame handling in AP mode") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix typoJulia Lawall2016-06-041-1/+1
| | | | | | | firmare -> firmware Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* Merge tag 'wireless-drivers-next-for-davem-2016-05-13' of ↵David S. Miller2016-05-202-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers patches for 4.7 Major changes: iwlwifi * remove IWLWIFI_DEBUG_EXPERIMENTAL_UCODE kconfig option * work for RX multiqueue continues * dynamic queue allocation work continues * add Luca as maintainer * a bunch of fixes and improvements all over brcmfmac * add 4356 sdio support ath6kl * add ability to set debug uart baud rate with a module parameter wil6210 * add debugfs file to configure firmware led functionality ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * mwifiex: fixup error messagesWei-Ning Huang2016-05-111-2/+3
| | | | | | | | | | | | | | Use dev_err instead of pr_err and add newline character at the end. Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> 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>
* | treewide: replace dev->trans_start update with helperFlorian Westphal2016-05-041-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all trans_start updates with netif_trans_update helper. change was done via spatch: struct net_device *d; @@ - d->trans_start = jiffies + netif_trans_update(d) Compile tested only. Cc: user-mode-linux-devel@lists.sourceforge.net Cc: linux-xtensa@linux-xtensa.org Cc: linux1394-devel@lists.sourceforge.net Cc: linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org Cc: MPT-FusionLinux.pdl@broadcom.com Cc: linux-scsi@vger.kernel.org Cc: linux-can@vger.kernel.org Cc: linux-parisc@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-hams@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: devel@driverdev.osuosl.org Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
* mwifiex: increase dwell time for active scanAmitkumar Karwar2016-04-271-2/+2
| | | | | | | | | | | It's been observed that sometimes AP's probe response is received after scan duration gets completed for the channel. This happens especially when wildcard scan is performed along with specific SSID scan. We will increase the time from 30 msecs to 40 msecs. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: disable channel filtering feature in firmwareAmitkumar Karwar2016-04-271-5/+6
| | | | | | | | | | | | | | As 2.4Ghz channels are overlapping, sometimes AP responds to probe request even if it's operating on neighbouring channel. Currently firmware drops those scan entries, as current channel doesn't match with APs channel. This patch enables MWIFIEX_DISABLE_CHAN_FILT flag in scan command to disable the feature so that better scan results will be received in 2.4Ghz band. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: avoid querying wakeup reason when wowlan is disabledAmitkumar Karwar2016-04-271-0/+4
| | | | | | | | | | In cfg80211 resume handler, we query wakeup reason from firmware and report to cfg80211. if wowlan is disabled, connection is already terminated during suspend. We don't need to query wakeup reason in this case. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: report wowlan wakeup reasons correctlyAmitkumar Karwar2016-04-271-6/+3
| | | | | | | | | It's been observed that wakeup on GTK rekey failure wasn't reported to cfg80211. This patch corrects the check so that all valid wakeup reasons are reported. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix coding styleAmitkumar Karwar2016-04-271-1/+1
| | | | | | | Redundant space in case statement is removed. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: transmit packet stats incorrect.Marty Faltesek2016-04-271-6/+7
| | | | | | | | | tx_packets counter is incremented for aggregated packets, when it had already been incremented for the aggregated packet's constituent parts. Removing the extra count. Signed-off-by: Marty Faltesek <mfaltesek@google.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fw download does not release sdio bus during failureMarty Faltesek2016-04-271-2/+1
| | | | | | Signed-off-by: Marty Faltesek <mfaltesek@google.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: bridged packets cause wmm_tx_pending counter to go negativeMarty Faltesek2016-04-271-0/+4
| | | | | | | | When a packet is queued from the bridge, wmm_tx_pending is not incremented, but when the packet is dequeued the counter is decremented. Signed-off-by: Marty Faltesek <mfaltesek@google.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix loop timeout in mwifiex_prog_fw_w_helper()Dan Carpenter2016-04-261-3/+4
| | | | | | | | | | | | | USB8XXX_FW_MAX_RETRY is 3. We were using a post-op loop "while (retries--) {" but then the lines after that assume the loop exits with retries set to zero. I've fixed this by changing to a pre-op loop. I started with retries set to 4 instead of 3 so that we still go through the loop the same number of times. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: missing error code on allocation failureDan Carpenter2016-04-261-1/+3
| | | | | | | We accidentally return success instead of -ENOMEM. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: stop background scan when net device closedXinming Hu2016-04-261-7/+7
| | | | | | | | | Transmit data path should not touch background scan. We will stop background scan when net device is closed. 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: add platform specific wakeup interrupt supportXinming Hu2016-04-264-3/+106
| | | | | | | | | | | | | On some arm-based platforms, we need to configure platform specific parameters by device tree node and also define our node as a child node of parent SDIO host controller. This patch parses these parameters from device tree. It includes calibration data dowoload to firmware, wakeup pin configured to firmware, and soc specific wake up gpio, which will be set as wakeup interrupt pin. 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: make mwifiex_insert_cmd_to_free_q local staticAndreas Fenkart2016-04-152-43/+41
| | | | | | | | | | after factoring out mwifiex_cancel_pending_scan_cmd the function is not called outside of cmdevt file moved function to head of file to avoid forward declaration, also moved mwifiex_recycle_cmd_node since they are very similar Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: factor out mwifiex_cancel_pending_scan_cmdAndreas Fenkart2016-04-154-53/+27
| | | | | | | | | | | | | | | | | | | Releasing the scan_pending lock in mwifiex_check_next_scan_command introduces a short window where pending scan commands can be removed or added before removing them all in mwifiex_cancel_pending_scan_cmd. I think this is safe, since the worst thing to happen is that a pending scan cmd is removed by the command handler. Adding new scan commands is not possible while one is pending, see scan_processing flag. Since all commands are removed from the queue anyway, we don't care if some commands are removed by a different code path earlier, the final state remains the same. I assume, that the critical section needed for the check has been extended over clearing the pending scan queue out of convenience. The lock was already held and releasing it and grab it again was just more work. It doesn't seem to be necessary because of concurrency. Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: scan: replace pointer arithmetic with array accessAndreas Fenkart2016-04-151-10/+7
| | | | | | | | improves readability Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: scan: factor out dbg_security_flagsAndreas Fenkart2016-04-151-49/+25
| | | | | | | merge copy/paste code Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: scan: simplify ternary operators using gnu extensionAndreas Fenkart2016-04-151-5/+2
| | | | | | | | | "x ? x : y" can be simplified as "x ? : y" https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html#Conditionals Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: scan: factor out has_ieee_hdr/has_vendor_hdrAndreas Fenkart2016-04-151-29/+23
| | | | | Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: scan: simplify dereference of bss_desc fieldsAndreas Fenkart2016-04-151-52/+46
| | | | | | | | | | | | | | | | given this structure: struct foo { struct bar { int baz; } } these accesses are equivalent: (*(foo->bar)).baz foo->bar->baz Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mwifiex: fix the incorrect WARN_ON during suspendVishal Thanki2016-04-141-1/+1
| | | | | | | | | During system suspend, there is a kernel WARNING issued if there is a pending command present. By marking the wait queue disabled after calling the command completion routine fixes it. Signed-off-by: Vishal Thanki <vishalthanki@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
OpenPOWER on IntegriCloud