summaryrefslogtreecommitdiffstats
path: root/drivers/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ath6kl: Fix race in heart beat pollingVasanthakumar Thiagarajan2013-08-071-0/+3
| | | | | | | | | | Make sure to cancel heart beat timer before freeing wmi to avoid potential NULL pointer dereference. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: add SoC power save option to PCI features mapBartosz Markowski2013-08-072-12/+21
| | | | | | | | | | | | | | Unify the PCI options location. By default the SoC PS option is disabled to boost the performance and due to poor stability on early HW revisions. In future we can remove the module parameter and turn on/off the PS for given hardware. This change also makes the pci module parameter for SoC PS static. Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix device teardownMichal Kazior2013-08-051-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | This fixes interrupt-related issue when no interfaces were running thus the device was considered powered down. The power_down() function isn't really powering down the device. It simply assumed it won't interrupt. This wasn't true in some cases and could lead to paging failures upon FW indication interrupt (i.e. FW crash) because some structures aren't allocated in that device state. One reason for that was that ar_pci->started wasn't reset. The other is interrupts should've been masked when teardown starts. The patch reorganized interrupt setup and makes sure ar_pci->started is reset accordingly. Reported-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix failpath in MSI-X setupMichal Kazior2013-08-021-1/+6
| | | | | | | | | | | | pci_disable_msi() must be called if the initial request_irq() fails. Also add a warning message so it's possible to distinguish request_irq() failure and pci_enable_msi() failure. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: zero arvif memory on add_interface()Michal Kazior2013-08-021-0/+2
| | | | | | | | | | | | | | | | The private memory area in vif provided by mac80211 isn't guaranteed to be zeroed. This patch should fix issues when switching between STA and AP interface types. The tim_bitmap could become polluted by STA bssid field (since it's a union), wep_keys array could also become polluted with invalid pointers and probably much more. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: advertise more conservative intf combinationsMichal Kazior2013-08-021-3/+9
| | | | | | | | | | Apparently the available firmware has a limit of handling 7 APs, 3 GOs or 8 STAs. This is based on empirical tests and it is still possible some combinations may crash the firmware. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: make sure to use passive scan when n_ssids is 0Michal Kazior2013-08-021-0/+2
| | | | | | | | | | | | | Normally user specifies broadcast ssid for scanning. If the user wants to do a passive scan it does not pass any ssids. The patch makes sure we ath10k tells firmware to not send anything at all in case it decides no ssids equals broadcast ssid. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: prevent using invalid ringbuffer indexesMichal Kazior2013-08-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | If the device is removed and hotplug fails ioread32() will return 0xFFFFFFFF. In that case reading ringbuffer during device bringup led to out-of-bounds addressing of a ringbuffer array that in turn led to a paging failure. This could be reproduced by the following: * boot without acpi/prevent hotplug from working * insert and manually detect (pci rescan) the device * remove the device physically * load ath10k driver * kernel crashed Ringbuffer index reading is now protected by using an appropriate mask to prevent addressing an invalid array index. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement get_survey()Michal Kazior2013-08-024-1/+122
| | | | | | | | | | | This implements a limited subset of what can be reported in the survey dump. This can be used for assessing approximate channel load, e.g. for automatic channel selection. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement tx checksum offloadingMichal Kazior2013-08-022-0/+4
| | | | | | | | | | HW supports L3/L4 tx checksum offloading. This should reduce CPU load and improve performance on slow host machines. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement rx checksum offloadingMichal Kazior2013-08-021-0/+40
| | | | | | | | | | HW supports L3/L4 rx checksum offloading. This should reduce CPU load and improve performance on slow host machines. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: detect the number of spatial streams supported by hwMichal Kazior2013-07-313-12/+20
| | | | | | | | | | | | Until now ath10k assumed 3 spatial streams. However some devices support only 2 spatial streams. This patch improves performance on devices that don't support 3 spatial streams. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: improve tx throughput on slow machinesMichal Kazior2013-07-311-3/+3
| | | | | | | | | | | | | It is more efficient to move just the 802.11 header instead of the whole payload in most cases. This has no measurable effect on modern hardware. It should improve performance by a few percent on hardware such as an Access Point that have a slow CPU compared to a typical desktop CPU. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix rts/fragmentation threshold setupMichal Kazior2013-07-301-26/+28
| | | | | | | | | | | | If RTS and fragmentation threshold values are 0xFFFFFFFF they should be considered disabled and no min/max limits must be applied. This fixes some issues with throughput issues, especially with VHT. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix memleak in mac setupMichal Kazior2013-07-301-11/+15
| | | | | | | | | | In some cases channel arrays were never freed. The patch also unifies error handling in the mac setup function. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: don't reset HTC endpoints unnecessarilyMichal Kazior2013-07-301-1/+0
| | | | | | | | | | Endpoints are re-initialized upon HTC start anyway so there's no need to do that twice in case of restarting HTC (i.e. in case of hardware recovery). Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: prevent HTC from being used after stoppingMichal Kazior2013-07-302-16/+15
| | | | | | | | | It was possible to submit new HTC commands after/while HTC stopped. This led to memory corruption in some rare cases. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: create debugfs interface to trigger fw crashMichal Kazior2013-07-301-0/+57
| | | | | | | | | | | This can be useful for testing. To perform a forced firmware crash write 'crash' to 'simulate_fw_crash' debugfs file. E.g. echo crash > /sys/kernel/debug/ieee80211/phy1/ath10k/simulate_fw_crash Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix NULL dereference for injected packetsMichal Kazior2013-07-301-4/+8
| | | | | | | | | | | | Tx processing functions dereference vif and caused NULL to be dereferenced for injected frames. Don't call these functions at all for injected frames. It doesn't make much sense to do so anyway. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement fw crash simulation commandMichal Kazior2013-07-302-0/+38
| | | | | | | This can be useful to test FW crash handling. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement device recoveryMichal Kazior2013-07-307-19/+144
| | | | | | | | | | | | | | | | Restart the hardware if FW crashes. If FW crashes during recovery we leave the hardware in a "wedged" state to avoid recursive recoveries. When in "wedged" state userspace may bring interfaces down (to issue stop()) and then bring one interface (to issue start()) to reload hardware manually. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: skip fw stats debugfs interface if device is downMichal Kazior2013-07-301-14/+16
| | | | | | | | | | | If the device is not running then there may be no FW at all to send the query to. If the FW is already there it might still trigger a crash if the command is sent before the device is fully initialized. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: store firmware files in memoryMichal Kazior2013-07-302-52/+109
| | | | | | | | | | | | Different FW versions may provide different functions thus mean different hw capabilities advertised to mac80211. It is safe to swap firmware files on disk during driver/device runtime without worries. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: defer hw setup to start/stop mac80211 hooksMichal Kazior2013-07-303-32/+81
| | | | | | | | | | | | | | | | | | This fixes suspend-to-disk. The hardware is now re-initialized upon freeze/thaw properly. This also makes suspend/resume re-initialize the hardware as WoWLAN support is not done yet. With some little work it should be possible to support hw reconfiguration for hw/fw recovery. HW must be initialized once before registering to mac80211 because FW determinates what hw capabilities can be advertised. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: make sure all resources are freed upon ath10k_stop()Michal Kazior2013-07-301-0/+25
| | | | | | | | This is necessary for proper hw reconfiguration and to avoid memory leaks. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: move free_vdev_map initializationMichal Kazior2013-07-301-2/+2
| | | | | | | | | | | | This is necessary for hw reconfiguration to work. Since mac80211 is not calling remove_interface() is such case we must reset free_vdev_map. Also use a define instead of a hardcoded value for vdev map initialization. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: decouple suspend codeMichal Kazior2013-07-305-154/+138
| | | | | | | | | | | | | | | | | Split up fw-related and hw-related suspension code. Although we don't advertise WoW support to mac80211 yet it's useful to keep the code in suspend/resume hooks. At this point there's no need to keep pci pm ops. In case of WoW mac80211 calls ath10k_suspend() which should take care of entering low-power mode. In case WoW is not available mac80211 will go through regular interface teradown and use start/stop. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: reset BMI state upon initMichal Kazior2013-07-303-0/+9
| | | | | | | | This is necessary if we want to be able to restart hw on-the-fly. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: allow deferred regd updateMichal Kazior2013-07-302-7/+26
| | | | | | | | | Regulatory domain notification hook can be called regardless of the hw state (i.e. before start mac80211 callback). Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: decouple core start/stop logicMichal Kazior2013-07-302-12/+34
| | | | | | | | | Enables code reuse for proper hw reconfiguration that is in turn required for proper suspend/hibernation/wowlan support. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: decouple pci start/stop logicMichal Kazior2013-07-302-39/+91
| | | | | | | | | | | Split logic that prepares the device for BMI phase/cleans up related resources. This is necessary for ath10k to be able to restart hw on the fly without reloading the module. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: add missing debug printsMichal Kazior2013-07-301-0/+6
| | | | | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: abort scan properly if wmi_scan_stop failsMichal Kazior2013-07-301-0/+4
| | | | | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: improve lockingMichal Kazior2013-07-301-2/+55
| | | | | | | | Add more lockdep asserts and a few conf_mutex locks. It's better to be on the safe side. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: embed HTT struct inside ath10kMichal Kazior2013-07-307-34/+34
| | | | | | | | This reduces number of allocations and simplifies memory managemnt. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: embed HTC struct inside ath10kMichal Kazior2013-07-307-46/+27
| | | | | | | | This reduces number of allocations and simplifies memory managemnt. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: rename hif callbackMichal Kazior2013-07-303-9/+9
| | | | | | | | | The `set_callbacks` is a more appopriate name for the function. Let's leave `init` for something else. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: change function to take struct ath10k as argMichal Kazior2013-07-301-3/+3
| | | | | | | | This aligns it to the argument list of other similar functions. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: provide errno if bmi read/write failsMichal Kazior2013-07-301-2/+4
| | | | | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: lower print level for a messageMichal Kazior2013-07-301-2/+3
| | | | | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: silent warning in IBSS modeMichal Kazior2013-07-301-2/+2
| | | | | | | | There is no TIM IE generated in IBSS beacons by mac80211. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix typo in define nameMichal Kazior2013-07-303-6/+6
| | | | | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: remove ath10k_busMichal Kazior2013-07-303-10/+1
| | | | | | | It serves no purpose. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: do not setup rts/frag thresholds for suspended interfacesMichal Kazior2013-07-301-2/+2
| | | | | | | | | | | | | | | mac80211 calls for rts/frag threshold hooks before any interface is brought back up again when resuming. We would set vdev parameters before given vdev is created lading to a FW crash. rts/frag thresholds will be re-set accordingly in add_interface() hook anyway. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: setup rts/frag thresholds upon vdev creationMichal Kazior2013-07-301-1/+19
| | | | | | | | | | | | mac80211 configures rts/frag thresholds per-hw not per-vif. ath10k FW expects those values to be set per-vdev (i.e. per-vif). ath10k should now respect rts/frag thresholds set before a given interface was brought up. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix possible deadlockMichal Kazior2013-07-301-4/+6
| | | | | | | | | It was possible to have a deadlock due to inverted locking of local->iflist_mtx and ath10k->conf_mutex. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix teardown orderingMichal Kazior2013-07-301-1/+1
| | | | | | | | This should fix memory corruption if HIF is tried to be restarted. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* mwifiex: code rearrangement in sdio.cAmitkumar Karwar2013-07-261-107/+104
| | | | | | | | | Some function definitions are moved to appropriate place to avoid forward declarations. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: handle driver initialization error pathsAmitkumar Karwar2013-07-262-28/+56
| | | | | | | | | | | | | | | mwifiex_fw_dpc() asynchronously takes care of firmware download and initialization. Currently the error paths in mwifiex_fw_dpc() are not handled. So if wrong firmware is downloaded, required cleanup work is not performed. memory is leaked and workqueue remains unterminated in this case. mwifiex_terminate_workqueue() is moved to avoid forward declaration. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2013-07-2532-146/+279
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless