aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-12Merge tag 'wireless-drivers-next-for-davem-2015-10-09' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller21-141/+504
Kalle Valo says: ==================== Major changes: iwlwifi * some debugfs improvements * fix signedness in beacon statistics * deinline some functions to reduce size when device tracing is enabled * filter beacons out in AP mode when no stations are associated * deprecate firmwares version -12 * fix a runtime PM vs. legacy suspend race * one-liner fix for a ToF bug * clean-ups in the rx code * small debugging improvement * fix WoWLAN with new firmware versions * more clean-ups towards multiple RX queues; * some rate scaling fixes and improvements; * some time-of-flight fixes; * other generic improvements and clean-ups; brcmfmac * rework code dealing with multiple interfaces * allow logging firmware console using debug level * support for BCM4350, BCM4365, and BCM4366 PCIE devices * fixed for legacy P2P and P2P device handling * correct set and get tx-power ath9k * add support for Outside Context of a BSS (OCB) mode mwifiex * add USB multichannel feature ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-05mwifiex: avoid gettimeofday in ba_threshold settingArnd Bergmann1-11/+4
mwifiex_get_random_ba_threshold() uses a complex homegrown implementation to generate a pseudo-random number from the current time as returned from do_gettimeofday(). This currently requires two 32-bit divisions plus a couple of other computations that are eventually discarded as only eight bits of the microsecond portion are used at all. We could replace this with a call to get_random_bytes(), but that might drain the entropy pool too fast if this is called for each packet. Instead, this patch converts it to use ktime_get_ns(), which is a bit faster than do_gettimeofday(), and then uses a similar algorithm as before, but in a way that takes both the nanosecond and second portion into account for slightly-more-but-still-not-very-random pseudorandom number. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Amitkumar Karwar <akarwar@marvell.com> Cc: Nishant Sarmukadam <nishants@marvell.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: linux-wireless@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-05mwifiex: use ktime_get_real for timestampingArnd Bergmann1-3/+1
The mwifiex_11n_aggregate_pkt() function creates a ktime_t from a timeval returned by do_gettimeofday, which is slow and causes an overflow in 2038 on 32-bit architectures. This solves both problems by using the appropriate ktime_get_real() function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Amitkumar Karwar <akarwar@marvell.com> Cc: Nishant Sarmukadam <nishants@marvell.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: linux-wireless@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-29mwifiex: fix mwifiex_rdeeprom_read()Dan Carpenter1-7/+7
There were several bugs here. 1) The done label was in the wrong place so we didn't copy any information out when there was no command given. 2) We were using PAGE_SIZE as the size of the buffer instead of "PAGE_SIZE - pos". 3) snprintf() returns the number of characters that would have been printed if there were enough space. If there was not enough space (and we had fixed the memory corruption bug #2) then it would result in an information leak when we do simple_read_from_buffer(). I've changed it to use scnprintf() instead. I also removed the initialization at the start of the function, because I thought it made the code a little more clear. Fixes: 5e6e3a92b9a4 ('wireless: mwifiex: initial commit for Marvell mwifiex driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: complete usb tx data with multi endpointsZhaoyang Liu8-16/+90
This patch do the work to TX data with specific USB endpoint. At the same time, update data_sent flag according to multi port status. And is_port_ready API is added for BSS interface to check if current used usb data endpoint is available or not. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: add usb multi endpoints resync supportZhaoyang Liu6-4/+127
This patch add support for usb multi endpoints resync. Once multi channel event is received from firmware, update usb_mc_setp flag to block TX data until setup is over. And available data endpoint will be attached to BSS interface. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: add usb tx data multi endpoints supportZhaoyang Liu3-46/+97
This patch add support for USB interface to TX data with different endpoint. And previous TX information are saved in new designed structure. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: add usb multi channel event process supportZhaoyang Liu5-10/+82
This patch add multi channel event process for USB multi tx data endpoints. Driver receives firmware multi channel event only in case that new connection is setup or interface is disconnect. Different BSS interface need update used usb endpoint. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: move usb specific data_sent update to usb.cZhaoyang Liu5-29/+6
This patch move data_sent flag update to usb.c file. >From now all data_sent update cases only happened in specific file: sdio.c, usb.c, pcie.c. Outside ot these files, it is only allowed to check the value of data_ent. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: fix tx data_sent issue for usb interfaceZhaoyang Liu4-9/+13
This patch fix missing tx data_sent flag update for usb interface. Except USB interface, data_sent flag has been updated in specific file such as sdio.c and pcie.c. So only USB interface type need check when TX data completed. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: Suppress -ENOSR error for data traffic on USBAmitkumar Karwar1-1/+1
We have preallocated buffer pool for Tx data. During high data traffic, all buffers are submitted to USB and driver needs to wait until one of the buffers get available for next Tx packet. "data: -ENOSR is returned" errors is expected in this case. Let's lower the priority of this message. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: correct paused tx data packet counterZhaoyang Liu2-5/+14
This patch fixes observed issues while updating counter for number of paused data packets in wmm queue when trying to delete packet or delete station entry. Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: avoid memsetting PCIe event bufferAmitkumar Karwar1-1/+0
Preallocated PCIe buffer is being reused for all PCIe interface events. Physical address of the buffer is shared with firmware so that it can perform DMA on it. As event length is specified in the header, there should not be a problem if the buffer gets overwritten. We will save some cycles by avoiding memset everytime while submitting the buffer to firmware. Fixes: 2728cecdc7d6bf3d21(mwifiex: corrections in PCIe event skb) Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: fix NULL pointer dereference during hidden SSID scanAniket Nagarnaik1-1/+1
This NULL pointer dereference is observed during suspend resume stress test. All pending commands are cancelled when system goes into suspend state. There a corner case in which host may receive response for last scan command after this and try to trigger extra active scan for hidden SSIDs. The issue is fixed by adding a NULL check to skip that extra scan. Fixes: 2375fa2b36feaf34 (mwifiex: fix unable to connect hidden SSID..) Cc: <stable@vger.kernel.org> [v4.2+] Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: don't always include ht/vht info in tdls confirm frameAniket Nagarnaik1-0/+12
Current TDLS implementation always includes ht/vht information in tdls setup confirm frame which causes teardown by legacy peer station after TDLS handshake. We will inclue ht/vht capabilities in tdls setup confirm frame only if peer station supports it to fix this problem. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: NULL check for cfg80211_inform_bss()Xinming Hu2-10/+16
cfg80211_inform_bss would return null in some cases, such as memory allocation failure. This patch adds sanity check for this case, to avoid possible issues when above corner case is hit. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: fix driver init failure under memory pressureXinming Hu3-7/+20
64k Tx and Rx buffers are allocated during driver initialization for SDIO level data aggregations. When host is under memory pressure situation, kzalloc() request for 64k may fail. We will try allocating 32k buffers and disable our rx single port aggreagation feature in this situation. If the allocation still fails, we will disable our sdio multport aggregation feature as well. In this way, we will transmit and receive packets one by one, thus reduce the demand for big memory. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: minor corrections in multiport aggregation codeXinming Hu1-2/+5
This patch includes below changes 1) Check if multiport aggregation feature flag while doing rx length validation check. 2) Reset buffer size variables when buffers are freed. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29mwifiex: update amsdu tx packet time stampZhaoyang Liu1-0/+1
This patch fixes the issue of delay time in A-MSDU tx packet. In generated new A-MSDU packet, the time stamp is initialized to zero. Choose the time of first MSDU packet as aggregated packet's time. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-09-29mwifiex: fix typo in del_virtual_intf() functionXinming Hu1-3/+3
Interface counters should be incremented in add_virtual_intf() and decremented in del_virtual_intf() function. This patch corrects 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>
2015-09-29mwifiex: Make mwifiex_dbg a function, reduce object sizeJoe Perches2-9/+28
The mwifiex_dbg macro has two tests that could be consolidated into a function reducing overall object size ~10KB (~4%). So convert the macro into a function. $ size drivers/net/wireless/mwifiex/built-in.o* (x86-64 defconfig) text data bss dec hex filename 233102 8628 4809 246539 3c30b drivers/net/wireless/mwifiex/built-in.o.new 243949 8628 4809 257386 3ed6a drivers/net/wireless/mwifiex/built-in.o.old Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-22mwifiex: fix comparison expressionAndrzej Hajda1-2/+2
To avoid underflows signed variables should be used in expression. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-13mwifiex: claim sdio bus while downloading the firmwareAniket Nagarnaik1-0/+4
Our 8887 A2 chip can have separate firmware images for bluetooth and WLAN. We observed an issue during parallel downloading of these images by btmrvl and mwifiex drivers. This patch claims sdio bus before starting of the firmware download in mwifiex and releases it after completion to fix the problem. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-13mwifiex: fix unable to connect hidden SSID AP on DFS channelchunfan chen4-12/+136
We will check if any hidden SSID found in passive scan channels and do specific SSID active scan for those channels. Signed-off-by: chunfan chen <jeffc@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-13mwifiex: add firmware dump support for SD8997Zhaoyang Liu2-10/+148
This patch adds firmware dump feature for SD8997 chipset. The difference here is only one memory type is needed to save all firmware information. Device dump information will be uploaded to usersapace file. Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-08-13mwifiex: add support for 8997 chipsetZhaoyang Liu7-9/+147
This patch adds support for 8997 chipset to mwifiex with SDIO/PCIe/USB interface. The corresponding firmware image files are located in: "mrvl/sd8997_uapsta.bin" "mrvl/pcie8997_uapsta.bin" "mrvl/usb8997_uapsta.bin" Signed-off-by: Zhaoyang Liu <liuzy@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>
2015-08-13mwifiex: usb: return an error if kmalloc failsDan Carpenter1-1/+3
The current code returns success if kmalloc fails. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-10mwifiex: correct TDLS link delete failure message priorityAmitkumar Karwar1-1/+1
Commit d8d2f19feb16 ("mwifiex: silence TDLS link delete failure for nonexistent link") lowers the priority of error message when TDLS link is already deleted. But it had got increased by commit acebe8c10a6e ("mwifiex: change dbg print func to mwifiex_dbg") Reported-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: add missing skb_push() in mwifiex_check_uap_capabiltiesAmitkumar Karwar1-0/+2
For PCIe/USB chipsets, preallocated skb buffers are reused for event handling. mwifiex_check_uap_capabilties() performs skb_pull(). This patch adds missing skb_push() to restore skb's data pointer/length. This bug was introduced by commit debfc6008169 ("mwifiex: update AP WMM settings from BSS_START event") Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: corrections in PCIe event skb handlingAmitkumar Karwar1-0/+2
Preallocated event SKBs are getting reused for PCIe chipset. Their physical addresses are shared with firmware so that firmware can write data into them. This patch makes sure that SKB is cleared and length is set to default while submitting it to firmware. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: fix system crash observed during initialisationZhaoyang Liu1-1/+3
System crash was observed if one of the driver initialisation commands is timed out. The reason is our timeout handler triggers firmware dump, meanwhile driver initialisation error paths have already freed the adapter structure. Firmware hasn't yet completely initialized. So collecting firmware dump is not needed in this case. Command timeout handler is modified in this patch to fix the crash issue. Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: fix command timeout for PCIe chipsetsZhaoyang Liu2-5/+4
When WLAN interface is up and running, driver unload and load was causing command timeout error. We enable Rx data by updating RX ring read pointer in init_fw_port(). It should be done when FW is completely intialialised. Command timeout is fixed in this patch by moving init_fw_port() call to mwifiex_init_fw_complete(). Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: using right aid value for tdls action frameXinming Hu1-1/+1
Variable pos is u8 here, so memcpy is needed to store u16 aid. At the same time, aid should be platform independent, upper layer utility(wpa_supplicant,etc.,) parse it as le16, so keep it le16 here. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: simplify mwifiex_complete_cmdAndreas Fenkart3-11/+6
600f5d909a54("mwifiex: cleanup ioctl wait queue and abstraction layer") introduced the wakeup_interruptible suppression in mwifiex_complete_cmd b1a47aa5e1e1("mwifiex: fix system hang issue in cmd timeout error case") then added wakup_interruptible to mwifiex_cmd_timeout_func the single place setting a status of ETIMEDOUT. Instead of doing extra work, using the standard call-chain will have the same effect: mwifiex_cancel_pending_ioctl -> mwifiex_recycle_cmd_node -> mwifiex_insert_cmd_to_free_q -> mwifiex_complete_cmd -> wake_up_interruptible The difference is that previously the condition was not set to true, but that's probably just an oversight in b1a47aa5e1e1 and shouldn't have any consequence Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: remove CMD_F_CANCELED flagAndreas Fenkart2-14/+10
CMD_F_CANCELED was used to abort mwifiex_process_cmdresp in case it already started or starts processing the cmd. But this was probably not working the way intended: - it is racy: mwifiex_process_cmdresp might already have passed that test and is continuing to use the cmd node being recycled - mwifiex_process_cmdresp repeatedly uses adapter->curr_cmd which we just set to NULL - mwifiex_recycle_cmd_node will clear the flag The reason why it probably works is that mwifiex_cancel_pending_ioctl is only called from mwifiex_cmd_timeout_func, where the there is little chance of a command response still arriving Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: remove redundant reset of cmd_wait_q statusAndreas Fenkart1-1/+0
mwifiex_cancel_pending_ioctl is called only from mwifiex_cmd_timeout_func. There the wait_q status is set to -ETIMEDWAIT before calling this function. Whether we reset the status to -1 or leave it at -ETIMEDWAIT at end doesn't matter since both are != 0 hence mean failure Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: remove explicit mwifiex_complete_cmd callsAndreas Fenkart1-8/+2
standard call chain when releasing a cmd node: mwifiex_recycle_cmd_node -> mwifiex_insert_cmd_to_free_q -> mwifiex_complete_cmd, if wait_q_enabled calling mwifiex_complete_cmd explicitly and setting wait_q_enabled = false is redundant Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-06mwifiex: sdio: reset adapter using mmc_hw_resetAndreas Fenkart2-15/+39
Since 1fb654fd97ff("mmc: sdio: add reset callback to bus operations"), sdio cards can be power cycled using mmc_hw_reset. The use mmc_remove_host/mmc_add_host is discouraged, because these are internal functions to the mmc core and should only be used by mmc hosts Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: correct p2p and station interface countersAniket Nagarnaik1-1/+3
While changing interface type from p2p client or p2p go to station, we should update counters for p2p interface and station interface. Also calling mwifiex_cfg80211_deinit_p2p method instead of mwifiex_cfg80211_init_p2p_client method to deinit p2p interface. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: use maximum ssid length as 0xfe for p2pAniket Nagarnaik1-0/+4
0xfe is basically a magic number used to ask firmware match provided string in a SSID. In this case, firmware will return scan results containing"DIRECT-" string. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: add bss mode TLV to extended scan commandAniket Nagarnaik2-0/+16
We are setting BSS mode as ANY so that firmware will provide all types of scan entries. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: fix for p2p broken linkAniket Nagarnaik3-4/+29
This patch fixes following issues in p2p code paths. 1) bss role, bss type and connection type was not set correctly for p2p GO and p2p client at couple of places. 2) Driver appends a proprietary header to management frames which will be parsed by our firmware. Later while informing TX status to cfg80211, modified frame buffer was passed to cfg80211_mgmt_tx_status() instead of original one. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: usb: Fix double add error when submitting rx urbReyad Attiyat1-2/+4
There is an error that can occur where the driver adds the same URB to USB submission list twice. This happens since mwifiex_usb_submit_rem_rx can submit packets at same time as an rx urb complete callback. This causes list corruption and is fixed by not setting the skb to NULL when submitting an rx packet. [ 84.461242] WARNING: CPU: 1 PID: 748 at lib/list_debug.c:36 __list_add+0xcb/0xd0() [ 84.461245] list_add double add: new=ffff8800c92b0c50, prev=ffff8800c92b0c50, next=ffff8800ced6c430. [ 84.461247] Modules linked in: rfcomm fuse cmac nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack bnep iptable_mangle iptable_security iptable_raw btusb btintel bluetooth mwifiex_usb mwifiex x86_pkg_temp_thermal cfg80211 coretemp r8712u(C) kvm_intel kvm hid_sensor_als hid_sensor_incl_3d hid_sensor_rotation hid_sensor_magn_3d hid_sensor_accel_3d hid_sensor_gyro_3d hid_sensor_trigger hid_sensor_iio_common industrialio_triggered_buffer kfifo_buf rfkill iTCO_wdt industrialio iTCO_vendor_support [ 84.461316] crc32_pclmul crc32c_intel ghash_clmulni_intel microcode snd_hda_codec_realtek vfat snd_hda_codec_generic fat snd_hda_codec_hdmi snd_hda_intel snd_hda_controller uvcvideo snd_hda_codec videobuf2_vmalloc videobuf2_memops snd_hwdep videobuf2_core snd_hda_core joydev v4l2_common videodev hid_sensor_hub snd_seq hid_multitouch media snd_seq_device snd_pcm snd_timer mei_me snd i2c_i801 lpc_ich mei soundcore tpm_infineon tpm_tis tpm i2c_hid i2c_designware_platform i2c_designware_core nfsd auth_rpcgss nfs_acl lockd grace sunrpc sch_fq_codel i915 i2c_algo_bit drm_kms_helper drm xhci_pci xhci_hcd ehci_pci sd_mod ehci_hcd video [ 84.461383] CPU: 1 PID: 748 Comm: kworker/u9:0 Tainted: G C 4.1.0-rc5+ #163 [ 84.461386] Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 2, BIOS 2.05.0250 04/10/2015 [ 84.461396] Workqueue: MWIFIEX_RX_WORK_QUEUE mwifiex_rx_work_queue [mwifiex] [ 84.461399] ffffffff81a8150e ffff8801174cf8e8 ffffffff817df830 0000000000000000 [ 84.461405] ffff8801174cf938 ffff8801174cf928 ffffffff810a54ba ffff8800c86bd750 [ 84.461410] ffff8800c92b0c50 ffff8800c92b0c50 ffff8800ced6c430 ffff88010c057178 [ 84.461416] Call Trace: [ 84.461421] [<ffffffff817df830>] dump_stack+0x4f/0x7b [ 84.461428] [<ffffffff810a54ba>] warn_slowpath_common+0x8a/0xc0 [ 84.461432] [<ffffffff810a5536>] warn_slowpath_fmt+0x46/0x50 [ 84.461436] [<ffffffff814109fb>] __list_add+0xcb/0xd0 [ 84.461442] [<ffffffff815c551a>] ? usb_hcd_link_urb_to_ep+0x2a/0xa0 [ 84.461446] [<ffffffff815c5570>] usb_hcd_link_urb_to_ep+0x80/0xa0 [ 84.461459] [<ffffffffa004318a>] prepare_transfer+0xaa/0x130 [xhci_hcd] [ 84.461470] [<ffffffffa0044cf7>] xhci_queue_bulk_tx+0xb7/0x7a0 [xhci_hcd] [ 84.461480] [<ffffffffa003b67f>] ? xhci_urb_enqueue+0x50f/0x660 [xhci_hcd] [ 84.461489] [<ffffffffa003b67f>] ? xhci_urb_enqueue+0x50f/0x660 [xhci_hcd] [ 84.461498] [<ffffffffa003b735>] xhci_urb_enqueue+0x5c5/0x660 [xhci_hcd] [ 84.461503] [<ffffffff815c7ad3>] usb_hcd_submit_urb+0x93/0xa70 [ 84.461507] [<ffffffff8168dde8>] ? __alloc_skb+0x78/0x1f0 [ 84.461511] [<ffffffff8168d301>] ? __kmalloc_reserve.isra.26+0x31/0x90 [ 84.461515] [<ffffffff8168ddbc>] ? __alloc_skb+0x4c/0x1f0 [ 84.461519] [<ffffffff8168ddfc>] ? __alloc_skb+0x8c/0x1f0 [ 84.461523] [<ffffffff8168badd>] ? skb_dequeue+0x5d/0x80 [ 84.461527] [<ffffffff815c987e>] usb_submit_urb+0x42e/0x5f0 [ 84.461531] [<ffffffff816931d9>] ? __alloc_rx_skb+0x39/0x100 [ 84.461536] [<ffffffffa05aa372>] mwifiex_usb_submit_rx_urb+0xb2/0x170 [mwifiex_usb] [ 84.461542] [<ffffffffa05aa5f5>] mwifiex_usb_submit_rem_rx_urbs+0x45/0x50 [mwifiex_usb] [ 84.461550] [<ffffffffa07094be>] mwifiex_rx_work_queue+0x10e/0x140 [mwifiex] [ 84.461556] [<ffffffff810c4429>] process_one_work+0x229/0x890 [ 84.461559] [<ffffffff810c438c>] ? process_one_work+0x18c/0x890 [ 84.461565] [<ffffffff810c4ae3>] worker_thread+0x53/0x470 [ 84.461569] [<ffffffff810c4a90>] ? process_one_work+0x890/0x890 [ 84.461572] [<ffffffff810cb162>] kthread+0xf2/0x110 [ 84.461577] [<ffffffff811031ad>] ? trace_hardirqs_on+0xd/0x10 [ 84.461581] [<ffffffff810cb070>] ? kthread_create_on_node+0x230/0x230 [ 84.461586] [<ffffffff817e9662>] ret_from_fork+0x42/0x70 [ 84.461590] [<ffffffff810cb070>] ? kthread_create_on_node+0x230/0x230 [ 84.461593] ---[ end trace 65103af5e6fb3444 ]--- Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: fix leak of gen_ie storage on exit from mwifiex_del_mgmt_iesJohn Linville1-0/+1
Storage pointed to by gen_ie is allocated with kmalloc, but was never freed. Coverity CID #1271251 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: do not short circuit exit from mwifiex_set_mgmt_iesJohn Linville1-0/+2
Without this change, the code simply exits after calling mwifiex_uap_set_head_tail_ies, leving the call to mwifiex_set_mgmt_beacon_data_ies as dead code. Coverity CID #1271292 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: avoid freeing improper pointer in mwifiex_set_wowlan_mef_entryJohn Linville1-2/+6
mwifiex_set_wowlan_mef_entry attempts to free a passed-in pointer in case of an error. The only caller (mwifiex_set_mef_filter) passes that pointer as an offset into allocated memory, so any attempt to free that will not be the actual allocated pointer. Address this by changing mwifiex_set_wowlan_mef_entry to not do any free, and to cause mwifiex_set_mef_filter to do the appropriate free if the call to mwifiex_set_wowlan_mef_entry fails. Coverity CID #1295879 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: handle multichannel eventAvinash Patil4-0/+46
This patch adds support to handle multichannel event from FW. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: separate interface combination for multichannel and DFSAvinash Patil1-3/+22
Multichannel and DFS cannot be supported at same time. So when multichannel operation is enabled by module parameter, we enable number of channel as 2 while registering wiphy. For all other cases we advertise DFS support to cfg80211. Patch also adds support for radar detect widths parameter. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: advertise multichannel support to cfg80211Avinash Patil3-5/+23
This patch adds support to advetise mwifiex multichannel support to cfg80211. If module parameter drcs is enabled and FW supports multichannel operation we advertise this support to cfg80211. As of now 2 simultaneous channels are supported. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-21mwifiex: support to set multichannel policy to FWAvinash Patil3-0/+40
This patch adds support for setting multichannel policy as module parameter to FW. Value of 1 indicates Multichannel support is enabled and value of 0 disables it. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>