summaryrefslogtreecommitdiffstats
path: root/drivers/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: move eeprom into privJohannes Berg2012-04-1213-172/+155
| | | | | | | | | | | | | | | | | | | | | | The whole code around eeprom is distributed across whole bunch of different files, most of which belong to the to-be-DVM code. As a result, it is currently very hard to split out the EEPROM code to be generic. However, it is also quite unlikely that the current EEPROM code will be needed by the MVM code as that has different mechanisms to query the EEPROM (it does so through the uCode.) So, at least temporarily, move everything into priv. If it becomes necessary to use the code from MVM, we will have to split it out, but then it's also easier since we'll know what pieces we need. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: split force_reset debugfs fileJohannes Berg2012-04-128-115/+62
| | | | | | | | | | | | | | | | | | Split the force_reset debugfs file into two different files: * "rf_reset" triggers a reset of the RF when written to and exposes statistics on RF resets when read * fw_restart triggers a firmware restart when written to and lives in the transport This cleans up all sources of firmware restart to originate within the transport layer and allows us to simplify some code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: remove ack_check module parameterJohannes Berg2012-04-123-74/+0
| | | | | | | | | This defaults to false, and we don't recommend to use it anywhere, so just remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move hw_params into privJohannes Berg2012-04-1217-169/+168
| | | | | | | | | | | | | The hw_params are mostly values that are derived from the actual hardware config. As such, while it is possible that MVM will require similar ones, it makes more sense -- at least for now -- to put them into the DVM struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move queue watchdog into transportJohannes Berg2012-04-1211-141/+91
| | | | | | | | | | | | | | | | | | | | | | | This removes one of the two sources of device restarts in the upper layer -- those are a bit inconvenient because normal restarts originate in the transport. By moving the watchdog down it can be treated the same. Also rewrite the watchdog logic. Timers are much more efficient when they never fire, so instead firing a timer every 500ms set up a timer for each TX queue and fire it only when the queue is really stuck. This avoids the CPU waking up when everything is working well. While at it, remove the wd_disable config item and replace it by simply setting wd_timeout to IWL_WATCHHDOG_DISABLED (0). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: remove unneeded struct declarationsJohannes Berg2012-04-121-2/+0
| | | | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: remove watchdog debugfs fileJohannes Berg2012-04-121-25/+0
| | | | | | | | | | | | This file isn't really all that useful as when the watchdog triggered it's already too late, and the setting doesn't persist unlike e.g. a module parameter that could be added to the right config file. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move rx_page_order into transportJohannes Berg2012-04-127-25/+29
| | | | | | | | | | | | | | That way it isn't needed in hw_params, which is shared data. It also isn't really what we should configure in the transport, that is better just 4k/8k, so configure a bool and derive the page order in the transport. This also means the transport doesn't need access to the module parameter any more. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ipw2100: remove a redundant NULL check before calling release_firmware()Jesper Juhl2012-04-121-2/+1
| | | | | | | | The release_firmware() function does its own NULL test so a test before calling it is rather redundant. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, orinoco: release_firmware() tests for NULL, remove explicit tests ↵Jesper Juhl2012-04-121-5/+2
| | | | | | | | | | before calls It is redundant to test for NULL pointers before calling release_firmware() since the function does its own NULL test. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, mwifiex: drop redundant NULL test before call to release_firmware()Jesper Juhl2012-04-121-2/+1
| | | | | | | | | Since release_firmware() does its own test for NULL it is redundant to do so before calling it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, libertas: remove redundant NULL tests before calling ↵Jesper Juhl2012-04-124-20/+10
| | | | | | | | | | release_firmware() release_firmware() tests for, and deals gracefully with, NULL pointers. Remove redundant explicit tests before calling the function. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ipw2200: remove a redundant NULL check before calling release_firmware()Jesper Juhl2012-04-121-2/+1
| | | | | | | | The release_firmware() function does its own NULL test, so testing before calling it is rather redundant. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, atmel: remove pointless test for NULL before release_firmware() callJesper Juhl2012-04-121-2/+1
| | | | | | | | release_firmware() does its own test. Explicitly checking before the call is redundant. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, at76c50x:: Don't needlessly test for NULL before calling ↵Jesper Juhl2012-04-121-4/+2
| | | | | | | | | | release_firmware() The release_firmware() function deals gracefully with being passed a NULL pointer, so explicit tests before the call are rather pointless. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8192de: Recognize 92D E-CUT version.Forest Bond2012-04-121-1/+5
| | | | | | | | | | | | | The chip version constant (0xCC33) was taken from version 0001.0105.2011 of the GPL vendor driver. Note that this driver version also ships a firmware update, but I am unsure if it is required for E-CUT chips to function properly. A nearby spelling error was also corrected. Signed-off-by: Forest Bond <forest.bond@rapidrollout.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8192de: Clean up and fix 92D cut version constants and macros.Forest Bond2012-04-121-9/+7
| | | | | | | | | | | | | | The previous definitions included both {B,C,D,E}_CUT_VERSION and CHIP_92D_{C,D}_CUT with conflicting values for the C and D cut versions, and literal hex values were used in the IS_92D_{C,D,E}_CUT macros. So we clean all this up and in doing so enable cut-specific code paths for cuts C and D, which would not have been executed because the CHIP_92D_{C,D}_CUT constants were wrong and the cut version was thus recorded incorrectly. Signed-off-by: Forest Bond <forest.bond@rapidrollout.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtlwifi: support for Belkin Surf N300 XRLorenzo Bianconi2012-04-121-0/+1
| | | | | | | | Added support for Belkin Surf N300 XR wireless usb adapter to rtlwifi driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'for-linville' of git://github.com/kvalo/ath6klJohn W. Linville2012-04-1220-165/+3370
|\
| * ath6kl: Fix 4-way handshake failure in AP and P2P GO modeVasanthakumar Thiagarajan2012-04-094-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RSN capability field of RSN IE which is generated (which is what really advertised in beacon/probe response) differs from the one generated in wpa_supplicant. This inconsistency in rsn IE results in 4-way handshake failure. To fix this, configure rsn capability used in wpa_supplicant in firmware using a new wmi command, WMI_SET_IE_CMDID. There is a bit (ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE) in fw_capabilities to advertise this support to driver. Signed-off-by: Subramania Sharma <sharmat@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Configure htcap in fw based on the channel type in AP modeVasanthakumar Thiagarajan2012-04-095-21/+116
| | | | | | | | | | | | | | | | | | | | This patch disables HT in start_ap if the type of the channel on which the AP mode is going to be operating is non-HT. HT is enabled with default ht cap setting if the operating channel is going to be 11n. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Don't advertise HT40 support in 2.4 GhzVasanthakumar Thiagarajan2012-04-091-2/+3
| | | | | | | | | | | | | | HT40 is not supported in 2.4Ghz. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Fix target assert in p2p bringup with multi vifVasanthakumar Thiagarajan2012-04-092-9/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | Using interface 0 for p2p causes target assert. This is because interface 0 is always initialized to non-p2p operations. Fix this issue by initializing all the interfaces for p2p when fw is capable of dynamic interface switching. When fw is not capable of dynamic switching, make sure p2p is not brought up on interface which is not initialized for this purpose. Reported-by: Naveen Singh navesing@qca.qualcomm.com Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Support net_stats.multicastVasanthakumar Thiagarajan2012-04-041-1/+2
| | | | | | | | | | | | | | | | | | net_stats.multicast is updated with the count of received multicast packets. kvalo: indentation changes Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Fix scan related issue on suspend-resumeVivek Natarajan2012-04-031-0/+4
| | | | | | | | | | | | | | | | | | | | When a scan request is pending while going to suspend, any new scan request after resume will fail. So, cancel all scan requests in all the vifs before moving to suspend state. Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Use vmalloc instead of kmalloc for fwVivek Natarajan2012-04-032-2/+5
| | | | | | | | | | | | | | | | | | | | Sometimes it has been observed that allocating a contiguous memory of more than 100K fails with kmalloc. This has been modified to use vmalloc instead. Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Set background scan period.Bala Shanmugam2012-03-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After connect command, send scan params WMI command to set background scan period. If period value is zero send 0xffff as bg scan period to disable bg scan. Set default bg scan period to be 60 seconds if not specified. This patch depends on below patch cfg80211: Add background scan period attribute. kvalo: fix open parenthesis alignment Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Store scan request info in-advance before sending SCAN requestRaja Mani2012-03-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In current code, Scan request info is recorded in vif->scan_req after sending SCAN request to the firmware in ath6kl_cfg80211_scan(). In some corner cases, firmware sends SCAN_COMPLETE event immediately when it receives SCAN request, which internally executes scan complete event handler ath6kl_cfg80211_scan_complete_event() first. So, Scan completion handler will a get a chance to executed even before storing scan request info in ath6kl_cfg80211_scan(). Scan completion handler never report SCAN_COMPLETE event to cfg80211 if scan request info(vif->scan_req) is NULL. This leads to scan failure issue ("Device or resource busy error") during next SCAN request from the user space. This patch ensures that scan request info is stored before sending SCAN request. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: add full USB supportKalle Valo2012-03-262-4/+782
| | | | | | | | | | | | | | | | Now, with HTC pipe, it's possible to fully support USB version of AR6004. Based on code by Kevin Fang. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Add HTC pipe implementationKalle Valo2012-03-267-0/+1808
| | | | | | | | | | | | | | | | This is needed for USB. Based on code by Kevin Fang. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: add htc opsKalle Valo2012-03-2610-55/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for adding HTC pipe implementation add htc-ops.h to make it possible dynamically choose which HTC type is used. Needed for full USB support. Based on the code by Ray Chen <raychen@qca.qualcomm.com>. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Ray Chen <raychen@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: remove void pointer from ath6kl_credit_setup()Kalle Valo2012-03-262-3/+3
| | | | | | | | | | | | Void pointers are bad. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: add rx data padding supportKalle Valo2012-03-262-0/+10
| | | | | | | | | | | | Needed when using USB. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: add pointer to the skb in htc_packetKalle Valo2012-03-262-0/+13
| | | | | | | | | | | | Needed by the USB code. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: add tx_comp_multi() to struct htc_ep_callbacksKalle Valo2012-03-262-0/+2
| | | | | | | | | | | | It's also needed by the USB code. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Add tx_complete() to struct htc_ep_callbacksKalle Valo2012-03-264-4/+7
| | | | | | | | | | | | | | This is needed by the USB code. Also while at it replace one void pointer with a properly typed pointer. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: set ram reserved size only for ar6003Kalle Valo2012-03-261-10/+12
| | | | | | | | | | | | Ram reserved size is not needed with ar6004. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: Configure inactivity timeout in fwVasanthakumar Thiagarajan2012-03-264-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Configure the inactivity timeout passed in start_ap() to firmware. This capability is advertised only when fw supports it, there is a new bit (ATH6KL_FW_CAPABILITY_INACTIVITY_TIMEOUT) in firmware capability ie for driver to learn fw's capability. After the fw finds out the station is inactive, it will probe the station with null func frames. By default, the timeout is 10 secs. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * Merge remote branch 'wireless-next/master' into ath6kl-nextKalle Valo2012-03-26156-6416/+6427
| |\
| * | ath6kl: Optimize target power in deep sleep suspendRaja Mani2012-03-261-17/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding below steps helps to get good power numbers in deep sleep suspend path, * Disable WOW mode. * Flush data packets and wait for all control packets. to be cleared in TX path before deep sleep suspend. * Set host sleep mode to SLEEP. Below steps are added to perform the recovery action while the system resume from deep sleep, * Set host sleep mode to AWAKE. * Reset scan parameters to default value. In addition, Debug prints are added to track deep sleep suspend/resume state. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: Isolate host sleep mode config part from ath6kl_wow_suspendRaja Mani2012-03-261-31/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The piece of code used in ath6kk_wow_suspend function to configure the host sleep mode is needed in deep sleep case also. Moving that portion to a separate function called ath6kl_update_host_mode() would be helpful to avoid the duplication of the same code in deep sleep path. There is no functional change. kvalo: move inline functions to cfg80211.c and fix a long line Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: Dump htc header when invalid Rx frame length is detectedVasanthakumar Thiagarajan2012-03-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dump htc header along with the warning message when the request to Rx with invalid frame length is detected. kvalo: fix open parenthesis alignment Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: abort normal scan when scheduled scan is startedKalle Valo2012-03-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the device disconnects from an AP when it is in suspending state. You will get the following message from wpa_supplicant after waking the device up and sending scan request: "Scan trigger failed: ret=-16 (Device or resource busy)" Fix the issue by sending a scan complete event before starting scheduled scan. kvalo: cosmetic changes to commit log Signed-off-by: Isaac.li <shonmou@gmail.com> Tested-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: Add __printf verification to ath6kl_printkJoe Perches2012-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | Make sure printf formats and arguments match. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: Add ARP offload related statistic info in tgt_statsRaja Mani2012-03-202-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firmware reports the below ARP offload related information while sending the target statistic event to the host. * Number of ARP packets received. * Number of packets matched with the device IP addr. * Number of ARP response packet sent to the remote. This patch adds the additional debug prints in debugfs entry tgt_stats. It will be useful to know the ARP offload execution status. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: add debug log for AP MLME operationsAarthi Thiruvengadam2012-03-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This is useful during debugging to check if disconnect commands were issued by the host. Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | ath6kl: handle probe response from P2P device in P2P GO modeAarthi Thiruvengadam2012-03-202-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the device is in P2P GO mode and in listen state, the correct behavior is to see two different probe response frames - one from P2P device and the other from GO. wpa_supplicant uses the same mechanism to send the frame in both cases (ath6kl_mgmt_tx). For GO probe response, ath6kl needs to call ath6kl_send_go_probe_resp (this will add only WSC/P2P IEs and the rest of the IEs are filled in by the firmware). That was done based on the nw_type == AP_NETWORK which would work if P2P Device role were in a separate netdev. When P2P Device and GO use the same netdev, ath6kl needs to use the special GO probe response case only if SSID is longer than P2P wildcard SSID. Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com> Reviewed-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | | Merge branch 'master' of ↵John W. Linville2012-04-12193-1242/+1627
|\ \ \ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * | | rtlwifi: Add missing DMA buffer unmapping for PCI driversLarry Finger2012-04-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://bugzilla.kernel.org/show_bug.cgi?id=42976, a system with driver rtl8192se used as an AP suffers from "Out of SW-IOMMU space" errors. These are caused by the DMA buffers used for beacons never being unmapped. This bug was also reported at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/961618 Reported-and-Tested-by: Da Xue <da@lessconfused.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | | rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routineLarry Finger2012-04-112-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version of rtlwifi for USB operations uses kmalloc to acquire a 32-bit buffer for each read of the device. When _usb_read_sync() is called with the rcu_lock held, the result is a "sleeping function called from invalid context" BUG. This is reported for two cases in https://bugzilla.kernel.org/show_bug.cgi?id=42775. The first case has the lock originating from within rtlwifi and could be fixed by rearranging the locking; however, the second originates from within mac80211. The kmalloc() call is removed from _usb_read_sync() by creating a ring buffer pointer in the private area and allocating the buffer data in the probe routine. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> [This version good for 3.3+ - different patch for 3.2 - 2.6.39] Signed-off-by: John W. Linville <linville@tuxdriver.com>