summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/main.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge tag 'wireless-drivers-next-for-davem-2015-06-03' of ↵David S. Miller2015-06-031-5/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== new driver mt7601u for MediaTek Wi-Fi devices MT7601U ath10k: * qca6174 power consumption improvements, enable ASPM etc (Michal) wil6210: * support Wi-Fi Simple Configuration in STA mode iwlwifi: * a few fixes (re-enablement of interrupts for certain new platforms that have special power states) * Rework completely the RBD allocation model towards new multi RX hardware. * cleanups * scan reworks continuation (Luca) mwifiex: * improve firmware debug functionality rtlwifi: * update regulatory database brcmfmac: * cleanup and new feature support in PCIe code * alternative nvram loading for router support ==================== Conflicts: drivers/net/wireless/iwlwifi/Kconfig Trivial conflict in iwlwifi Kconfig, two commits adding the same two chip numbers to the help text, but order transposed. Signed-off-by: David S. Miller <davem@davemloft.net>
| * | wil6210: broadcast for secure linkVladimir Kondratiev2015-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce 2 types of GTK, Tx (for this STA) and Rx (for each peer). Now, AP has only Tx GTK, STA - only Rx one. PBSS not supported yet; for it, continue using pseudo-DMS. Handle per-vring .1x state, update it from WMI_VRING_EN_EVENTID event. This allows unification for unicast and broadcast vrings. This mechanism replaces former per-CID "data_port_open" Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | wil6210: fix boot loader "ready" indicationVladimir Kondratiev2015-05-041-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Boot loader "ready" indication has changed from "bit0 set" to "only bit0 set". This is to address hardware glitches. Due to glitches, sometimes right after reset register reads 0xffffffff, or (rarely) other garbage. Reflect this in the driver Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * | wil6210: fw debug modeVladimir Kondratiev2015-04-281-0/+15
| |/ | | | | | | | | | | | | | | refactor module parameter debug_fw to act as "fw debug mode", where driver do nothing but allow card memory access. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* / cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnectJohannes Berg2015-05-261-1/+1
|/ | | | | | | | | | | | | | | | | | | | When we disconnect from the AP, drivers call cfg80211_disconnect(). This doesn't know whether the disconnection was initiated locally or by the AP though, which can cause problems with the supplicant, for example with WPS. This issue obviously doesn't show up with any mac80211 based driver since mac80211 doesn't call this function. Fix this by requiring drivers to indicate whether the disconnect is locally generated or not. I've tried to update the drivers, but may not have gotten the values correct, and some drivers may currently not be able to report correct values. In case of doubt I left it at false, which is the current behaviour. For libertas, make adjustments as indicated by Dan Williams. Reported-by: Matthieu Mauger <matthieux.mauger@intel.com> Tested-by: Matthieu Mauger <matthieux.mauger@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wil6210: implement broadcast/multicast dataVladimir Kondratiev2015-03-201-0/+33
| | | | | | | | | | Use dedicated vring for multicast frames; this vring allocated for AP and PBSS (both P2P GO and client) configurations For short frames, use MCS0; for long - MCS1 Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: fix check for FW responsivenessVladimir Kondratiev2015-03-201-0/+2
| | | | | | | | | | "echo" used to be called when no firmware loaded to the NIC, this causes error output. Probe firmware with "echo" only after it returned "ready" event. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: support AP isolationVladimir Kondratiev2015-03-131-0/+1
| | | | | | | | | | | | For the AP, configuration may say not to bridge traffic between wireless clients. This is conveyed from user space (ex: hostapd has ap_isolate parameter) with NL80211_CMD_SET_BSS, to the driver's cfg80211 ops method change_bss Add support for this setting. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: enable fix for HW bug in 802.11->803.3 transformVladimir Kondratiev2015-02-271-0/+4
| | | | | | | | | | In the old hardware, bug existed that caused DA and SA for every Rx packet to be swapped in the AP mode. New hardware has fix for this bug. Enable this fix in the hardware. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: remove support for old hardwareVladimir Kondratiev2015-02-271-38/+20
| | | | | | | | | | | Hardware older than Sparrow B0 obsolete. There is no WiFi product that uses this hardware. Recent firmware does not support it either. Remove driver support. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: boot loaderVladimir Kondratiev2015-02-271-36/+68
| | | | | | | | | | | | | | | | | | | Introduce boot loader. Instead of the operational firmware, very small boot loader is burned to the on-board flash. Boot loader initializes hardware upon reset, and prepares for low power mode. Boot loader reports MAC address and detects radio chip connected. Driver loads firmware only when bringing up interface. All information required to set up network interface, most important is MAC address, reported by the boot loader The firmware composed of 2 files: - wil6210.fw - firmware itself (compiled code + data) - wil6210.board - board file (various board and radio dependent calibrations and parameters) Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: implement cfg80211 probe_client() opVladimir Kondratiev2015-01-291-0/+5
| | | | | | | | | | Access point require this API to check peer alive status. Assume peer is alive when it is connected, because firmware implements keep alive checks and will disconnect peer if it is not alive. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: remove unnecessary interrupt moderation module parametersVladimir Shulman2015-01-291-33/+5
| | | | | | | | | | Interrupt moderation parameters will never be passed as module parameters. For product, they will be hard-coded after lab testing, and for debugging, they can be altered via debugfs. Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: fix timing of netif_carrier_on indicationDedy Lansky2015-01-291-24/+6
| | | | | | | | | | | | | | netif_carrier_on indication was too late. In case Rx packet received before netif_carrier_on indication, upper layers could not send Tx packet back. The fix is to indicate netif_carrier_on earlier: for STA, indicate netif_carrier_on when association starts. for AP/PCP, indicate netif_carrier_on upon starting AP/PCP. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: relax spinlocks in rx reorderVladimir Kondratiev2015-01-151-3/+4
| | | | | | | | | | | | | | In the Rx reorder mechanism, nothing is done in the interrupt context, so there is no need to use 'irq' flavors of spinlock. Rx done in NAPI context (tasklet), other manipulations - in the thread context. Having interrupts enabled makes it better for the OS in general. Besides, if enslaved under bonding, bridge or team driver, Rx won't work with interrupts disabled. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: RX high threshold interrupt configurationVladimir Kondratiev2015-01-151-0/+9
| | | | | | | | | | Rx high threshold interrupt is reported by the hardware in case when number of not utilized by the HW descriptors in the Rx ring becomes low. Introduce module parameter for RX high threshold. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: add advanced interrupt moderationVladimir Kondratiev2015-01-151-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | Add advanced interrupt moderation support available since "Sparrow B0". Legacy interrupt moderation used only one counter to moderate tx, rx, and misc interrupts. Advanced interrupt moderation bypasses misc, and handles separately tx and rx interrupts. In addition it has two timers for each interrupt type. Max burst duration timer which defines how long to postpone interrupt after first event (receive event for rx and tx complete event for tx), and interframe timeout which defines how to determine the end of the burst and issue interrupt even if the first timer still pending. Capabilities flags in wil_priv is set on initialization according to HW. The rest of the code checks for advanced interrupt capability bit in capabilities flags field. Debugfs is split accordingly: "legacy" interrupt moderation remains unchanged, new debugs files added for advanced interrupt moderation support. Module params are aligned to support advanced interrupt moderation (tx & rx). When not available (for legacy interrupt moderation) will use only rx configuration; Tx configuration will be ignored in this case. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: use HW capabilities mask in resetVladimir Kondratiev2015-01-151-19/+14
| | | | | | | | | | Use the proper reset follow based on HW capabilities detection instead of chip ID. Remove old hw ID mechanism which was used only for reset flow. Remove support for Marlon A0. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: use bitmap API for "status"Vladimir Kondratiev2015-01-151-13/+14
| | | | | | | wil->status used as bitmap; use DECLARE_BITMAP for it. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: consider SNAP header in MTU calculationsVladimir Kondratiev2015-01-151-1/+1
| | | | | | | | | | When encapsulating 802.3 frames into the 802.11 ones, 8-byte SNAP header added to save ethtype. SNAP is part of the frame body, thus should be counted in MSDU. So, MTU = MSDU - SNAP Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: fix max. MPDU sizeVladimir Kondratiev2015-01-151-1/+1
| | | | | | | | | When configuring Tx/Rx VRING's, driver need to specify max. MPDU size It should take into account all overhead introduced by 802.3->208.11 transformation. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: fix disconnect 1 STA in APVladimir Kondratiev2015-01-151-9/+20
| | | | | | | | | When disconnecting single STA in AP, it might be that STA in question is already disconnected. In this case, need to do nothing. Previously, it was mis-interpreted as "disconnect all" Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: simple ADDBA on originator (Tx) sideVladimir Kondratiev2015-01-151-0/+5
| | | | | | | | | | | | | | | | | Upon Tx vring creation, initiate BACK establishment with maximum possible window size. When establishing secure connection, there is EAPOL data exchange between connection itself and "data port open", where security is done and non-EAPOL data may be transferred. It is better to send EAPOL frames using normal ACK because of firmware considerations. send ADDBA only is 2 conditions met: - data port open for the corresponded STA - vring created Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: ADDBA/DELBA flowsVladimir Kondratiev2015-01-151-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce BACK establishment procedures; decision logic is not implemented yet; debugfs entry 'addba' used to manually trigger addba/delba for ringid 0. debugfs usage: to establish BACK with agg_wsize 16: echo 16 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba to delete BACK: echo 0 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba to change agg_wsize, one need to delete BACK and establish it anew ADDBA flow for: - originator Tx side (initiator) sends WMI_VRING_BA_EN_CMDID providing agg_wsize and timeout parameters. Eventually, it gets event confirming BACK agreement - WMI_BA_STATUS_EVENTID with negotiated parameters. On this event, update Tx vring data (struct vring_tx_data) and display BACK parameters on debugfs - recipient Rx side (recipient) firmware informs driver about ADDBA with WMI_RCP_ADDBA_REQ_EVENTID, driver process it in service work queue wq_service. It adjusts parameters and sends response with WMI_RCP_ADDBA_RESP_CMDID, and final confirmation provided by firmware with WMI_ADDBA_RESP_SENT_EVENTID. In case of success, driver updates Rx BACK reorder buffer. policy for BACK parameters: - aggregation size (agg_wsize * MPDUsize)) to not exceed 64Kbytes DELBA flow for: - originator driver decides to terminate BACK, it sends WMI_VRING_BA_DIS_CMDID and updates struct vring_tx_data associated with vring; ignore WMI_DELBA_EVENTID. - recipient firmware informs driver with WMI_DELBA_EVENTID, driver deletes correspondent reorder buffer ADDBA request processing requires sending WMI command, therefore it is processed in work queue context. Same work queue used as for connect, it get renamed to wq_service Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wil6210: reset flow updateVladimir Kondratiev2014-12-011-0/+3
| | | | | | | | | | | | | | If card reset with firmware download executed, followed by reset with use of firmware from build in flash, firmware download indication remains in the hardware register. When running firmware download flow, the SW download indication is written by the driver to bit 0 in usage_6: wil_fw_load(), "S(RGF_USER_USAGE_6, 1);" This register, like all USER RGF, wasn't reset in SW reset flow. Therefore the driver must clear it on SW reset flow. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: configurable vring sizesVladimir Kondratiev2014-12-011-2/+32
| | | | | | | | | | Allow to configure VRING size for both Rx and Tx via module parameters: rx_ring_order and tx_ring_order. Parameters are ring size orders, i.e. ring size calculated as 1 << order. Defaults for both Tx and Rx are order 9, i.e. size 512 Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: fix recovery after scan timeoutVladimir Kondratiev2014-12-011-0/+1
| | | | | | | | | | | | | Scan timeout treated as indication for firmware error; and should be handled in the same way. Recovery state machine does not perform as designed because its state is not updated in case of scan timeout. Fix is to set recovery state machine into the proper state. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: propagate disconnect reasonVladimir Kondratiev2014-12-011-13/+12
| | | | | | | | | Propagate reason for the disconnect through the relevant call chains: - report to cfg80211 reason as reported by the firmware - provide to the firmware reason as requested by cfg80211 Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: Add support for large packetsVladimir Kondratiev2014-10-301-0/+29
| | | | | | | | | | It is possible to configure driver using mtu_max module parameter by setting it to value in range of 68..7920 inclusive. This is sub-optimal performance-wise in case packet is larger than 1 page. mtu_max default value is 2228. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: improve dmesg for fw error handlingVladimir Kondratiev2014-10-301-0/+3
| | | | | | | | In case of FW error, make it clear (in dmesg) what branch is taken in the error recovery code. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: prevent double disconnect command issuingVladimir Kondratiev2014-10-301-10/+25
| | | | | | | | | | | | | | | | | | | | Disconnect flow may be invoked either from upper layer request, or from event reported by the firmware. In case of firmware event, driver need to release resources for the station but not send another disconnect WMI command. In case of upper layer request, WMI_DISCONNECT_STA_CMDID command need to be issued for the firmware to perform disconnect on the MAC layer. Eventually, event is expected to confirm MAC disconnect, but it is better to not wait for firmware event and release station resources immediately. FW may fail to report disconnect for various reasons, so one could not rely on event always reported. Introduce parameter to distinguish 2 cases above to prevent double WMI command issuing. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: reset flow updatesVladimir Kondratiev2014-10-301-5/+18
| | | | | | | As communicated with the firmware & hardware teams Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: do not attempt FW recovery if interface is downVladimir Kondratiev2014-10-301-0/+5
| | | | | | | | | | | | When interface is down, recovery flow should not be attempted. Next ndo_open() will trigger target reset, that is FW recovery. Doing recovery while interface is down cause internal "up", leaving internal driver state in conflict with network stack. Then, when network stack will call ndo_open(), kernel oops will be triggered. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: manual FW error recovery modeVladimir Kondratiev2014-10-021-8/+38
| | | | | | | | | | | | | | | | | | | | Introduce manual FW recovery mode. It is activated if module parameter @no_fw_recovery set to true. May be changed at runtime. Recovery information provided by new "recovery" debugfs file. It prints: mode = [auto|manual] state = [idle|pending|running] In manual mode, after FW error, recovery won't start automatically. Instead, after notification to user space, recovery waits in "pending" state, as indicated by the "recovery" debugfs file. User space tools may perform data collection and allow to continue recovery by writing "run" to the "recovery" debugfs file. Alternatively, recovery pending may be canceled by stopping network interface i.e. 'ifconfig wlan0 down' Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: ethtool opsVladimir Kondratiev2014-09-261-0/+26
| | | | | | | | | | Provide ethtool support; with support for interrupt coalescing through get_coalesce/set_coalesce. Placeholders for begin/complete will be used by runtime PM to make sure target is powered up while performing ethtool operations Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: fix for oops while stopping interfaceVladimir Kondratiev2014-09-111-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When interface stopped while running intensive Rx traffic, the following oops observed: [89846.734683] Call trace: [89846.737117] [<ffffffc00083aa64>] dev_gro_receive+0xac/0x358 [89846.742674] [<ffffffc00083ae94>] napi_gro_receive+0x24/0xa4 [89846.748251] [<ffffffbffc1c2f88>] $x+0xec/0x1f8 [wil6210] wil_netif_rx_any [89846.753547] [<ffffffbffc1c4830>] $x+0x34/0x54 [wil6210] wil_release_reorder_frame [89846.758755] [<ffffffbffc1c48ac>] wil_release_reorder_frames+0x5c/0x78 [wil6210] [89846.766044] [<ffffffbffc1c4bf8>] wil_tid_ampdu_rx_free+0x20/0x48 [wil6210] [89846.772901] [<ffffffbffc1bedc8>] $x+0x190/0x1e8 [wil6210] [89846.778285] [<ffffffbffc1c0ed4>] wmi_event_worker+0x230/0x2f8 [wil6210] [89846.784865] [<ffffffc0000b0bc8>] process_one_work+0x278/0x3fc [89846.790591] [<ffffffc0000b1218>] worker_thread+0x200/0x330 [89846.796060] [<ffffffc0000b6664>] kthread+0xac/0xb8 [89846.800836] Code: b940c661 f9406a62 8b010041 f9400026 (f8636882) [89846.807008] ---[ end trace d6fdc17cd27d18f6 ]--- Reason is the following: when removing Rx vring (wil_netdev_ops.ndo_stop -> wil_stop -> wil_down -> __wil_down -> wil_rx_fini), Rx interrupt occurs. It trigger Rx NAPI, calling wil_rx_handle() that reaps (already cleaned) buffer, causing skb referring to garbage memory being set into reorder buffer. Then, network stack trying to access this buffer and fails. Prevent Rx NAPI from being scheduled if device going to stop. Bit wil_status_napi_en reflects NAPI enablement state, check it when triggering Rx NAPI. Testing shows that check for wil_status_napi_en sometimes gets negative, and new error message get printed - in this case kernel oops would be observed. Original oops is no more reproducible. This change requires also changes in the AP flows. Properly enable/disable NAPI for the AP. Make sure Rx VRING is disabled when resetting target. For this, promote __wil_up() and __wil_down() to the module scope, and use it in the relevant flows. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: rename [en|dis]able irq to [un]maskVladimir Kondratiev2014-09-111-2/+2
| | | | | | | | | To better reflect real action performed, rename: s/wil6210_disable_irq/wil_mask_irq/ s/wil6210_enable_irq/wil_unmask_irq/ Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: introduce separate completion for WMIDedy Lansky2014-09-111-0/+2
| | | | | | | | | | | re-use of wmi_ready for both FW ready event and for wmi_call was causing false "FW not ready" indication in case wmi_call() was invoked while reset took place. add wmi_call completion variable instead of re-using wmi_ready. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: fix race condition between BACK event and Rx dataDedy Lansky2014-09-111-1/+12
| | | | | | | | | | | | While handling Rx packet, BACK event arrives and frees tid_ampdu_rx array. This causes kernel panic while accessing already freed spinlock The fix is to remove tid_ampdu_rx[]'s spinlock and instead use single sta's spinlock to guard the whole tid_ampdu_rx array. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: fix for memory corruption upon rmmodDedy Lansky2014-09-111-1/+25
| | | | | | | | | | | | Driver disabled PCI master before making sure HW is idle. This caused memory corruption in case HW access system memory after PCI master got disabled. The fix is to change uninit sequence. Make sure FW/HW is idle before disabling PCI Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: add more debug printoutsVladimir Kondratiev2014-09-111-0/+10
| | | | | | | | added misc printouts in some init/uninit functions for better traceability Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: platform specific moduleVladimir Kondratiev2014-09-111-0/+7
| | | | | | | | New module (wil_platform) for handling platform specific tasks Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: coding style fixesVladimir Kondratiev2014-09-111-3/+4
| | | | | | | | | - parentheses, indentation, typos - seq_puts() instead of seq_printf() with single argument - sizeof(var) vs. sizeof(type) Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: firmware downloadVladimir Kondratiev2014-09-111-32/+61
| | | | | | | | | | | Firmware download implemented but is still experimental feature; flag controlling it added, no_fw_load. It is true by default, use no_fw_load=N to activate feature. Reset flows also got some adjustment for the fw download to work Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: wait longer for hardware reset completionVladimir Kondratiev2014-08-251-4/+7
| | | | | | | | | Typical time for hardware reset, as measured, is about 200..250 msec. Adjust sleeping to use more relaxed msleep, increase sleep interval and increase total sleep time to be about 1sec Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: check error in wil_target_reset()Vladimir Kondratiev2014-08-251-5/+7
| | | | | | | | | | | | When resetting target in wil_target_reset(), error may occur. Indicate error via error code. In case of error, don't attempt to further interact with card, specifically don't attempt firmware download or interrupts enabling. Move wil_rx_fini() to be always executed to prevent memory leak. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: update copyright year 2014Vladimir Kondratiev2014-08-251-1/+1
| | | | | | | Fix Copyright headers in all files changed in 2014, to mention 2014 Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: fix race in resetVladimir Kondratiev2014-08-251-1/+4
| | | | | | | | It is important to halt USER CPU first, then MAC CPU Otherwise, race happens in the firmware Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: support for "sparrow" hardwareVladimir Kondratiev2014-07-181-8/+34
| | | | | | | | | | New hardware release appears; it require some changes to properly support it. Introduce struct wil_board and "board" attribute in wil6210_priv; keep hardware variant information in this structure. fill it on probe(). Used in the reset flow. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wil6210: track Tx queue stateVladimir Kondratiev2014-06-191-0/+2
| | | | | | | | Provide both event (netif_tx_[stop|wake]) tracking via printk; and state via debugfs 'info' Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>