summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210/netdev.c
AgeCommit message (Collapse)Author
2016-08-31wil6210: extract firmware version from file headerLior David
Currently the FW version is taken from the sw_version field of the FW ready event. This version is based on internal version control revision and it is difficult to map to actual FW version. Fix this by using the actual FW version stored in the FW file header record. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-08-19wil6210: fix wiphy registration sequenceLior David
Currently wiphy structure is initialized and registered in wil_if_alloc, before some information is available such as MAC address and capabilities. As a result there is a small chance user space will get incorrect information from calls such as NL80211_CMD_GET_WIPHY. Fix this by seperating the registration and moving it to wil_if_add which is executed later, after all relevant information is known. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-03-07wil6210: clean ioctl debug messageLior David
Fix a debug message related to IOCTL that was incorrectly logged with the MISC category, and move it inside wil_ioctl so it will always be logged even if we call wil_ioctl from other places. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-03-07wil6210: P2P_DEVICE virtual interface supportLior David
Added support for the P2P_DEVICE virtual interface. This interface is intended for P2P management operations such as discovery and GO negotiation. Normally it is implemented by drivers to allow a separate interface for P2P management with its own MAC address, but for 11ad drivers it is needed to support P2P search, since it cannot otherwise be separated from normal scan. Since we only support a single interface/MAC address, we can't easily separate between primary and P2P_DEVICE interfaces. For example when a management packet arrives we can't tell for which interface it is intended. To work around this, we store a pointer to the interface where the last "radio operation" was triggered such as scan or remain on channel, and we forward management packets and scan results to this interface. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-01-26wil6210: handle tx completions only if vring tx data is enabledMaya Erez
wil_vring_fini_tx is called in disconnect in order to free the allocated vrings. wil_vring_fini_tx is disabling the vring_tx_data before napi_synchronize is called in order to avoid the tx handling of this vring, while wil_vring_free is called only after napi finished the current handling of the tx completed packets. Due to that, in case of disconnect, wil6210_netdev_poll_tx can be called when vring->va is not NULL but vring_tx_data[i]->enabled is already disabled. This patch checks vring_tx_data[i]->enabled in wil6210_netdev_poll_tx to prevent handling of disabled vrings. Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-11-18net: add netif_tx_napi_add()Eric Dumazet
netif_tx_napi_add() is a variant of netif_napi_add() It should be used by drivers that use a napi structure to exclusively poll TX. We do not want to add this kind of napi in napi_hash[] in following patches, adding generic busy polling to all NAPI drivers. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-06wil6210: allow to handle Rx on 2 coresVladimir Shulman
Allow network stack part of Rx processing to run on separate core, relaxing CPU utilization on the core used for Rx NAPI. If RXHASH feature is enabled, the driver sets rxhash of each skb to 1 to enable RPS. The core for processing the rx skb is determined by RPS mechanism according to rx_cpus bit mask which is configured at user level. For processing skbs on different core from the core which processes the interrupts, it is recommended not to enable core 0 in rx_cpus bit mask. 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@qca.qualcomm.com>
2015-08-06wil6210: TSO implementationVladimir Kondratiev
Driver report supported TSO (v4 & v6) and IP checksum offload in addition to previously supported features. In data path skbs are checked for non-zero gso_size, and when detected sent to additional function for processing TSO SKBs. Since HW does not fully support TSO, additional effort is required from the driver. Driver partitions the data into mss sized descriptors which are then DMAed to the HW. 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@qca.qualcomm.com>
2015-06-09wil6210: reorder init sequenceVladimir Kondratiev
Need to reorder init sequence to run wil_platform_init before pci_enable_device. Assumption is platform init may be required before device may be enabled. Another issue, platform uninit should be called after pci_disable_device because platform uninit may render pci device non-accessible. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-04-28wil6210: fw debug modeVladimir Kondratiev
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>
2015-03-13wil6210: NAPI completion refactorVladimir Kondratiev
It is expected that driver completes NAPI when less than full budget is consumed. Fulfill this requirement. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-29wil6210: Add Tx queue len configurationVladimir Shulman
Tx queue was hard-coded to 1000 in ether_setup. Add wil_dev_setup function which configures tx queue len to chosen default value after calling ether_setup. 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>
2015-01-29wil6210: fix timing of netif_carrier_on indicationDedy Lansky
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>
2014-10-30wil6210: Add support for large packetsVladimir Kondratiev
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>
2014-10-02wil6210: atomic I/O for the card memoryVladimir Kondratiev
Introduce netdev IOCTLs, to be used by the debug tools. Allows to read/write single dword value or memory block, aligned to dword Different address modes supported: - BAR offset - Firmware "linker" address - target's AHB bus Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-26wil6210: ethtool opsVladimir Kondratiev
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>
2014-09-11wil6210: enlarge TX/RX buffer lengthVladimir Kondratiev
HW supports upto 2304 packet size on the air. HW is responsible for adding (Tx) or removing (Rx) the following headers: 802.11 hdr: 26B SNAP: 8B CRC: 4B Security (optional): 24B HW adds max 62B to the payload passed from driver. It means driver can use max packet size of 2304-62 = 2242B 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>
2014-09-11wil6210: add more debug printoutsVladimir Kondratiev
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>
2014-08-25wil6210: fix free'd memory access in wil_if_free()Vladimir Kondratiev
In the wil_priv_deinit(), wdev->netdev is accessed, so free_netdev() should not be called before mentioned call. Set wdev->netdev to NULL Make sure no more attempts to use it. It is used for debug printk if not NULL. This fix kernel panic on module unload and in case error on probe; if memory allocation debugging enabled. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-25wil6210: update copyright year 2014Vladimir Kondratiev
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>
2014-07-15net: set name_assign_type in alloc_netdev()Tom Gundersen
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert all users to pass NET_NAME_UNKNOWN. Coccinelle patch: @@ expression sizeof_priv, name, setup, txqs, rxqs, count; @@ ( -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs) | -alloc_netdev_mq(sizeof_priv, name, setup, count) +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count) | -alloc_netdev(sizeof_priv, name, setup) +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup) ) v9: move comments here from the wrong commit Signed-off-by: Tom Gundersen <teg@jklm.no> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-29wil6210: limit MTUVladimir Kondratiev
Obey 802.11 spec that defines max. data size 7920 bytes Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17wil6210: use GROVladimir Kondratiev
GRO is easy to enable when already using NAPI framework, and it improves CPU utilisation. Enable it by default. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17wil6210: add scatter-gather supportVladimir Kondratiev
When setting fragmented skb for Tx, assign skb to the last descriptor and set number of fragments in the 1-st one On Tx complete, HW sets "DU" bit in Tx descriptor only for the last descriptor; so search for it using number of fragments field. Middle descriptors may have "DU" bit not set by the hardware. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22wil6210: Enable TCP/UDP checksum HW offloadKirshenbaum Erez
Add support for TCP and UDP HW checksum offloading. RX chain is allways configured for offload mode. In case of checksum error in RX path the DMA L4 error bit(5) will be set to 1 and driver will drop the packet. TX checksum offloading is configrable (ethtool -K). TX descriptors are configured for checksum offload according to the SKB protocol type (TCP/UDP, IPV4/6), Upon mismatch drop the TX packet (checksum required but not TCP/UDP IPV4/6 type). Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22wil6210: use NAPIVladimir Kondratiev
Introduce NAPI for Rx and Tx completion. This fixes packet reordering that happens when Rx handled right in the IRQ: netif_rx puts packet in 'percpu' queue, then network stack fetches packets from 'percpu' queues for processing, with different pattern of queue switching. As result, network stack see packets in different order. This causes hard to understand TCP throughput degradation in about 30min Complete polling if only one packet was processed - this eliminates empty polls that would be otherwise done at the end of each burst Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-13wil6210: headers clean-upVladimir Kondratiev
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30wil6210: checkpatch warningsVladimir Kondratiev
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30wil6210: Fix: Tx stallVladimir Kondratiev
Due to multi-tx-queue design, wil_start_xmit() used to be executed concurrently for different queues. Then, these transmits delivered to the same queue, creating race. As result, Tx descriptor may be skipped, causing stall in hardware. Convert to single Tx queue fixes it. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-04wireless: add new wil6210 802.11ad 60GHz driverVladimir Kondratiev
This adds support for the 60 GHz 802.11ad Wilocity card through a new driver, wil6210. Wilocity implemented the firmware, QCA maintains the device driver. Currently supported: - STA: with security - AP: limited to 1 connected STA, security disabled - Monitor: due to a hardware/firmware limitation either control or non-control frames are monitored Using a STA and AP with this drive, one can assemble a fully functional BSS. Throughput of 1.2Gbps is achieved with iperf. The wil6210 cards have on-board flash memory for the firmware, the cards comes pre-flashed and no firmware download is required. For more details see: http://wireless.kernel.org/en/users/Drivers/wil6210 Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>