summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/quantenna/qtnfmac/pearl
AgeCommit message (Collapse)Author
2017-12-20qtnfmac: modify full Tx queue error reportingSergey Matyukevich
[ Upstream commit e9931f984dd1e80adb3b5e095ef175fe383bc92d ] Under heavy load it is normal that h/w Tx queue is almost full all the time and reclaim should be done before transmitting next packet. Warning still should be reported as well as s/w Tx queues should be stopped in the case when reclaim failed. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-20qtnfmac: lock access to h/w in tx pathSergey Matyukevich
Fix tx path regression. Lock should be held when queuing packets to h/w fifos in order to properly handle configurations with multiple enabled interfaces. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31qtnfmac: implement 64-bit dma supportSergey Matyukevich
Use 64-bit dma for hosts with CONFIG_ARCH_DMA_ADDR_T_64BIT enabled. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31qtnfmac: fix free_xfer_buffer cleanupSergey Matyukevich
Check if skb tracking arrays has been already allocated. This additional check handles the case when init partially failed. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31qtnfmac: modify qtnf_map_bar not to return NULLSergey Matyukevich
NULL is not a special type of success here but a error pointer. So it makes sense to check against NULL in qtnf_map_bar and return error code. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31qtnfmac: module param sanity checkSergey Matyukevich
Linux built-in circ_buf implementation assumes that that the circular buffer length is a power of 2. Make sure that rx and tx descriptor queue lengths are power-of-2. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: modify tx reclaim lockingSergey Matyukevich
Perform additional reclaim from qtnf_pcie_data_tx. Lock tx_lock serves only reclaim synchronization purposes. Rename it accordingly and improve granularity moving this lock to qtnf_pcie_data_tx_reclaim. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: introduce counter for Rx underflow eventsSergey Matyukevich
Introduce counter for Rx underflow events. Export this counter via debugfs. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: switch to kernel circ_buf implementationSergey Matyukevich
Current code for both Rx and Tx queue management is a custom and incomplete circular buffer implementation. It makes a lot of sense to switch to kernel built-in circ_buf implementation. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: decrease default Tx queue sizeSergey Matyukevich
Avoid extra buffering in driver by default. Use max hardware Tx queue size. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: skb2rbd_attach cleanupSergey Matyukevich
Update PCIE_HDP_TX_HOST_Q_WR_PTR register in skb2rbd_attach as a part of procedure of passing new Rx buffer to hardware. Sync up all the the qtnf_rx_bd descriptor updates before passing Rx buffer to hardware. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: use __netdev_alloc_skb_ip_alignSergey Matyukevich
Replace __dev_alloc_skb and explicit NET_IP_ALIGN alignment by built-in __netdev_alloc_skb_ip_align function. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17qtnfmac: switch to napi_gro_receiveSergey Matyukevich
Use napi_gro_receive() rather than netif_receive_skb() to improve performance when GRO is enabled. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-03net: qtnfmac: constify pci_device_id.Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by <linux/pci.h> work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-03qtnfmac: Tidy up DMA mask settingRobin Murphy
As the only caller of dma_supported() outside of DMA API internals, the qtfnmac driver stands out and invites scrutiny. Thankfully, it's not being used for evil, but it is entirely redundant, since it open-codes a check that the DMA mask setting functions are going to perform anyway. In fact, the whole qtnf_pcie_init_dma_mask() function is nothing more than a rather long-winded implementation of dma_set_mask_and_coherent(), so let's just use that directly. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-06-28qtnfmac: fix uninitialized return code in retColin Ian King
The return value ret is unitialized and garbage is being returned for the three different error conditions when setting up the PCIe BARs. Fix this by initializing ret to -ENOMEM to indicate that the BARs failed to be setup correctly. Detected by CoverityScan, CID#1437563 ("Unitialized scalar variable") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-24qtnfmac: introduce new FullMAC driver for Quantenna chipsetsIgor Mitsyanko
This patch adds support for new FullMAC WiFi driver for Quantenna QSR10G chipsets. QSR10G (aka Pearl) is Quantenna's 8x8, 160M, 11ac offering. QSR10G supports 2 simultaneous WMACs - one 5G and one 2G. 5G WMAC supports 160M, 8x8 configuration. FW supports up to 8 concurrent virtual interfaces on each WMAC. Patch introduces 2 new drivers: - qtnfmac.ko for interfacing with kernel wireless core - qtnfmac_pearl_pcie.ko for interfacing with hardware over PCIe interface Signed-off-by: Dmitrii Lebed <dlebed@quantenna.com> Signed-off-by: Sergei Maksimenko <smaksimenko@quantenna.com> Signed-off-by: Sergey Matyukevich <smatyukevich@quantenna.com> Signed-off-by: Bindu Therthala <btherthala@quantenna.com> Signed-off-by: Huizhao Wang <hwang@quantenna.com> Signed-off-by: Kamlesh Rath <krath@quantenna.com> Signed-off-by: Avinash Patil <avinashp@quantenna.com> Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>