1
0
Fork 0
Commit Graph

124 Commits (d58ff35122847a83ba55394e2ae3a1527b6febf5)

Author SHA1 Message Date
Vladimir Kondratiev 3a3def8dbe wil6210: allow to configure ADDBA request
For manual ADDBA configuration, allow to set desired window size or
disable automatic mechanism.

Introduce module parameter (int) agg_wsize. It can be changed on run time,
will be taken into account on the next connect. Interpretation:
- <0 - disable automatic ADDBA; intended for manual testing through debugfs
- 0 - use automatically calculated window size
- >0 - use this for window size. Clipped by maximum supported by the hardware
with current environment.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:06 +02:00
Vladimir Kondratiev 3a124ed645 wil6210: simple ADDBA on originator (Tx) side
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>
2015-01-15 14:30:55 +02:00
Vladimir Kondratiev 3277213feb wil6210: ADDBA/DELBA flows
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>
2015-01-15 14:30:45 +02:00
Vladimir Kondratiev fbf61095bc wil6210: remove TODO wrt buffer alignment
Hardware doesn't place any restrictions on the buffer alignment,
consider this TODO resolved.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-12-01 15:57:23 -05:00
Vladimir Kondratiev 70801e1b1e wil6210: Rate limit "ring full" error message
In the wil_tx_ring, error message printed when tx attempted
while vring has no space to accommodate all fragments of frame.
Normally, such situation handled by stopping tx queue.
But, if tx queue is by-passed (like pktgen does), this error
will be triggered at high rate and dmesg will be flooded with
this message. Whole system may become unstable and hang with
no possible recover except power cycle.

Rate-limit it to prevent dmesg flooding.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-12-01 15:57:23 -05:00
Vladimir Kondratiev d3762b4060 wil6210: configurable vring sizes
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>
2014-12-01 15:57:23 -05:00
Vladimir Kondratiev 9a06bec9ae wil6210: Add support for large packets
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-30 15:26:52 -04:00
Vladimir Kondratiev e0106adade wil6210: enlarge TX/RX buffer length
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-11 15:27:38 -04:00
Vladimir Kondratiev 9cf10d623e wil6210: add more debug printouts
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-09-11 15:27:37 -04:00
Vladimir Kondratiev 8fe596274d wil6210: coding style fixes
- 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>
2014-09-11 15:27:36 -04:00
Vladimir Kondratiev ef77285fc3 wil6210: debug prints for vring de-allocation
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-11 15:27:36 -04:00
Vladimir Kondratiev 36345ac33c wil6210: fix beamforming data reporting
When reading 'bf' file on debugfs, query beam forming status from firmware.
Ignore CID's that return error or return all zeros.

Remove obsolete code that used to maintain statistics on per-device basis,
as now it is reported be per-CID and current.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-25 16:17:35 -04:00
Vladimir Kondratiev 02525a7925 wil6210: update copyright year 2014
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-08-25 16:17:31 -04:00
Vladimir Kondratiev 76dfa4b771 wil6210: fix double definition of 'ctx'
Variable 'ctx' declarad again in the inner loop. Should use
one from outer loop instead.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-18 13:45:23 -04:00
Vladimir Kondratiev 55f8f68017 wil6210: track Tx queue state
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>
2014-06-19 15:49:27 -04:00
Vladimir Kondratiev 5aed13932a wil6210: avoid dmesg pollution by Tx errors
On Tx path, when vring for the destination not found,
it was considered as error and message was printed unconditionally.
However, this situation is normal after disconnect. If disconnect was while
heavy traffic load, lots of Tx packets will be dropped and this would
cause significant amount of prints in dmesg.
Demote messages priority from 'error' to 'debug'.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:25 -04:00
Vladimir Kondratiev 194b482b50 wil6210: Debug print GRO Rx result
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:25 -04:00
Vladimir Kondratiev 7c0acf868d wil6210: Tx performance monitoring
For performance monitoring, trace time intervals when Tx vring
is idle/not idle. Use CPU cycle counter for this, because jiffies is
too rough, and other precise time measurement methods involve
overhead while get_cycles() should be fast.
This used to provide some estimation for percentage when Tx vring
was idle, i.e. when hardware is under-utilized.
Estimation is not precise because of many reasons - CPU frequency scaling,
grt_cycles() may be per core etc. But still, it is good estimation

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:24 -04:00
Vladimir Kondratiev 67c3e1b41e wil6210: more debug info for vring
print used/available counters on debugfs;
print to dmesg when Tx vring becomes empty

This aids with performance investigation

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:24 -04:00
Vladimir Kondratiev 39c52ee8cb wil6210: improve pointers printing
use proper format %pad for the dma_addr_t arguments;
prefix %p with 0x, as %p don't print is by itself

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-29 13:10:31 -04:00
Vladimir Kondratiev 5bb6423e8f wil6210: inline functions for vring hi/lo watermarks
Provide clear definition of the watermarks for the vring descriptor space.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-29 13:10:30 -04:00
Vladimir Kondratiev 097638a08a wil6210: fix race between disconnect and Tx NAPI
When disconnecting some CID, corresponded Tx vring get released. During vring
release, all descriptors get freed. It is possible that Tx NAPI working on the same
vring simultaneously. If it happens, descriptor may be double freed.

To protect from the race above, make sure NAPI won't process the same vring.
Introduce 'enabled' flag in the struct vring_tx_data. Proceed with Tx NAPI only if
'enabled' flag set. Prior to Tx vring release, clear this flag and make sure NAPI
get synchronized.

NAPI enablement status protected by wil->mutex, add protection where it was
missing and check for it.

During reset, disconnect all peers first, then proceed with the Rx vring. It allows for
the disconnect flow to observe proper 'wil->status' and correctly notify cfg80211 about
connection status change

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:19 -04:00
Vladimir Kondratiev b5998e6a3d wil6210: use GRO
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-17 13:44:18 -04:00
Vladimir Kondratiev 8bf6adb988 wil6210: fix memory leak in the AP flow
When switching between STA and AP modes, memory allocated for Rx vring leaks
This is because start_ap() allocates Rx vring but stop_ap() do not free it.
Logically, Rx vring is not valid (HW can't use it anymore), so free it in reset()
Also, check double init for Rx vring and bail out with -EINVAL

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:18 -04:00
Vladimir Kondratiev aa27deaabf wil6210: reduce dmesg pollution after FW crash
When FW crashes, dmesg get polluted with the "FW not ready"
error message. Print it only once per FW lifecycle

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:17 -04:00
Vladimir Kondratiev 2232abd59a wil6210: generalize tx desc mapping
Introduce enum to describe mapping type; allow 'none' in addition to
'single' and 'page'; this is preparation for GSO

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:16 -04:00
Vladimir Kondratiev c236658f14 wil6210: add scatter-gather support
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>
2014-03-17 13:44:16 -04:00
Vladimir Kondratiev e58c9f7043 wil6210: Block data till "data port open" reported
When connection established, as reported by WMI_CONNECT_EVENTID,
4-way handshaking required for the secure connection is not done
yet. It is indicated by another WMI event. Wait for it and only then
allow data traffic. In case of non-secure connection, FW reports
"data port open" immediately after connection.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:16 -04:00
Vladimir Kondratiev a70abea5f5 wil6210: Helpers to deal with 'cidxtid' fields
Encode/decode helpers

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17 13:44:16 -04:00
Vladimir Kondratiev 0bbc4adebd wil6210: do not reorder groupcast Rx
Groupcast frames are not subject for BACK reordering because they are not
ACK'ed and one can't request re-transmitt

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:38 -05:00
Vladimir Kondratiev 93ae6d49e2 wil6210: Fill vring2cid_tid table early
Need to fill translation table before calling WMI with WMI_VRING_CFG_CMDID
since firmware may generate events during this call; and events need translation
table filled to be properly dispatched

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:35 -05:00
Vladimir Kondratiev c8b78b5f0f wil6210: per-connection statistics
Calculate statistics per connection, report with "iw station dump"

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:34 -05:00
Vladimir Kondratiev fb3cac5726 wil6210: broadcast Tx
Hardware do not support "real" broadcast on the air.
Use method similar to the Directed Multicast Service (DMS) as
described in the 10.23.15.2 "DMS procedures"

This service copies frame and delivers unicast for each associated peer

Do the following: send original frame to 1-st Tx vring, and send copies
to all other active vrings.

As currently hardware/firmware don't support A-MSDU, convert broadcast
frame to unicast instead of wrapping it in A-MSDU

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:31 -05:00
Vladimir Kondratiev b4490f423c wil6210: Block ACK
When running multiple connections, hardware can't do BACK reordering
and it should be done on the host.

Model after mac80211's implementation. Drop RCU for now;
to be re-added when BACK will be stabilized

BACK handshaking is not implemented yet in the hardware,
pretend it was done to support the way FW operating

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:30 -05:00
Vladimir Kondratiev 3df2cd3618 wil6210: multiple connect - initial support
Enable multiple (up to 8 - HW/FW limitation) simultaneous connections.
Each connection has its own CID (connection ID) that describes chip's
beam-forming entity. Tx Vring should refer to correct CID for frame to reach
its destination.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28 14:33:29 -05:00
Vladimir Kondratiev 0786dc4edd wil6210: correct #include for prefetch()
This fixes bug found by the kbuild test robot:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   1e2f9295f4
commit: 1cbbcb08c7 [135/140] wil6210: prefetch head of packet
config: make ARCH=microblaze allyesconfig

All error/warnings:

   drivers/net/wireless/ath/wil6210/txrx.c: In function 'wil_vring_reap_rx':
>> drivers/net/wireless/ath/wil6210/txrx.c:381:2: error: implicit declaration of function 'prefetch' [-Werror=implicit-function-declaration]
     prefetch(skb->data);
     ^
   cc1: some warnings being treated as errors

vim +/prefetch +381 drivers/net/wireless/ath/wil6210/txrx.c

   375                  wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
   376                  kfree_skb(skb);
   377                  return NULL;
   378          }
   379          skb_trim(skb, dmalen);
   380
 > 381          prefetch(skb->data);
   382
   383          wil_hex_dump_txrx("Rx ", DUMP_PREFIX_OFFSET, 16, 1,
   384                            skb->data, skb_headlen(skb), false);

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-16 14:55:43 -05:00
Vladimir Kondratiev 1cbbcb08c7 wil6210: prefetch head of packet
As soon as skb is ready to be reaped, prefetch 1-st cache line.
This accelerates data access that is performed later, during the
packet classification by the driver and IP stack.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-09 10:56:39 -05:00
Vladimir Kondratiev df2d08eed2 wil6210: Fix IP version indication for Tx csum offload
Bit DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS should be set for IPv4
only. Don't set it for IPv6

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-09 10:56:39 -05:00
Vladimir Kondratiev 4a68ab100f wil6210: let IP stack re-check HW TCP/UDP csum errors
Fix for TCP iperf from Windows to Linux stall after about 1sec

Hardware reports false errors in some situations:

Microsoft IP stack, in violation of RFC 1624, set TCP checksum that should be 0x0
as 0xffff. hardware report Rx csum error. If HW csum absolutely trusted,
this frame can be never received, as re-transmitted one will have same csum problem.
In addition, it mess up block ack reorder buffer, as if packet dropped, it is not score boarded
there.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-15 16:07:59 -04:00
Kirshenbaum Erez 504937d493 wil6210: Enable TCP/UDP checksum HW offload
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-07-22 16:54:44 -04:00
Vladimir Kondratiev c2a146f610 wil6210: fix error path in wil_tx_vring
Release fragments in the order of allocation; including one for skb head

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22 16:54:44 -04:00
Vladimir Kondratiev 6cdadd4dc7 wil6210: fix subtle race in wil_tx_vring
Finish all SW context modifications prior to notifying hardware

It used to be race condition: if HW finish Tx and issue Tx completion IRQ very fast,
prior to SW context update in wil_tx_vring, Tx completion will mis-handle descriptor, as
SW part will have no skb pointer stored.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22 16:54:38 -04:00
Vladimir Kondratiev f88f113a54 wil6210: Introduce struct for sw context
Enable adding more data to the SW context.
For now, add flag "mapped_as_page", to separate decisions on free-ing skb
and type of DMA mapping.
This allows linking skb itself to any descriptor of fragmented skb.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22 16:54:38 -04:00
Vladimir Kondratiev 03269c658b wil6210: Optimize Tx completion
No need to modify HW descriptor, as it will be re-initialized on Tx.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22 16:54:38 -04:00
Vladimir Kondratiev 4d1ac0721a wil6210: fix wrong index in wil_vring_free
When destroying Rx vring, branch for Rx used wrong Tx descriptor:
while SW context was taken for "head", HW descriptor was, by mistake,
taken from "tail"

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22 16:54:37 -04:00
Kirshenbaum Erez 668b2bbd7f wil6210: add HW write-back option in TX descriptor
Map BIT 9 in TX DMA DWARD 0 as HW write back option.
We must turn on this option in the last TX descriptor,
this is required for old HW compatability.
This option indicate to HW that WB is required for this descriptor.

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-06-24 14:44:26 -04:00
Kirshenbaum Erez 99b55bd22a wil6210: set vring index for all descriptors
The vring index (MAC queue id) must be set in all TX descriptors
otherwise HW will fail to release descriptors for a specific vring
(disconnect or vring switch flows).
This is normally occurs when fragmentation required, if vring index
will not be the same for all SKB descriptors HW will fail to flush
this MAC queue.

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-06-24 14:44:26 -04:00
Vladimir Kondratiev d58db4e49f wil6210: Send EAPOL frames using normal Tx queue
No more need for special processing of EAPOL, FW can now send EAPOL frames
using normal Tx queue for TID 0

This fixes "schedule while atomic" bug - start_xmit called in softirq context;
while WMI mechanism that was used may sleep.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-12 15:06:51 -04:00
Wei Yongjun 110dea0008 wil6210: use kfree_skb() instead of kfree()
Use kfree_skb() instead of kfree() to free sk_buff.

Introduced by commit e270045b56
(wil6210: Sanity check for reported DMA length)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-24 13:18:22 -04:00
Vladimir Kondratiev 224c9c2366 wil6210: do not stop Tx queue on packet drop
Packet drop may be caused by various flows, like disconnect
while Tx packets was queued; this should not lead to stopping
of the Tx queue, or all Tx get stalled.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:08:39 -04:00
Vladimir Kondratiev 68ada71e33 wil6210: fix remaining use of non-cached copy of tx/rx descriptors
- Introduce common code for Tx/Rx descriptor physical address set/parse
- Fix endianness for address fields
- consistent descriptor naming: '_d' for non-cached memory, 'd' for cached copy
- wil_tx_desc_map now modify cached copy, no need for 'volatile'

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:08:37 -04:00
Vladimir Kondratiev e0287c4ab8 wil6210: use NAPI
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-05-22 15:08:35 -04:00
Vladimir Kondratiev 9865809562 wil6210: trace support
Trace the following:
- WMI cmd/event
- log events
- interrupts
- Tx/Rx

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:08:27 -04:00
Vladimir Kondratiev c0d3771360 wil6210: debug dump packet content right after DMA
Move packet dump to the earliest location where it is known to have
valid data.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:05:35 -04:00
Vladimir Kondratiev e270045b56 wil6210: Sanity check for reported DMA length
If Rx descriptor contains garbage, it is possible to access memory beyond
allocated buffer.

Check this condition and drop Rx if reported length is
unreasonable large

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:05:35 -04:00
Vladimir Kondratiev 7e59444444 wil6210: 'length' in Tx/Rx descriptors is little endian
Hardware uses little endian for the Tx/Rx descriptors field 'length',
do appropriate conversions

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22 15:05:34 -04:00
John W. Linville 6ed0e321a0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2013-04-24 10:54:20 -04:00
Vladimir Kondratiev 4de41bef3e wil6210: Use cached copy of Tx descriptor
Original Tx descriptor stored is in non-cached area for DMA;
copy it to the cached memory to speed-up access

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:25 -04:00
Vladimir Kondratiev b5d98e9d02 wil6210: Tx init optimization
vring size is known from the beginning, fill it immediately
in the struct initializer
This is minor optimization that reduces code size.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:24 -04:00
Vladimir Kondratiev 33e611690e wil6210: Use cached copy of Rx descriptor
Rx descriptors stored in non-cacheable memory area for DMA.
Non-cacheable memory causes long access time from CPU.

Copy rx descriptor to the skb->cb, and use this copy.
It provides faster memory access, and will be usefull to keep
Rx information for later processing (BACK reorder)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:24 -04:00
John W. Linville 5470b462c3 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2013-03-20 15:24:57 -04:00
Joe Perches d0320f7500 drivers:net: Remove dma_alloc_coherent OOM messages
I believe these error messages are already logged
on allocation failure by warn_alloc_failed and so
get a dump_stack on OOM.

Remove the unnecessary additional error logging.

Around these deletions:

o Alignment neatening.
o Remove unnecessary casts of dma_alloc_coherent.
o Hoist assigns from ifs.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-15 08:56:58 -04:00
Vladimir Kondratiev b80231773a wil6210: sync with new firmware
Adjust driver for changes in the FW API.
Noticeable changes in the FW are:
- temperature sensing
- infrastructure for multiple connections
- infrastructure for P2P
- signal strength indication

This commit introduces only changes that are required to support same functionality
as previous firmware, no new features.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-13 14:26:21 -04:00
Vladimir Kondratiev c7996ef852 wil6210: headers clean-up
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-13 14:26:21 -04:00
Joe Perches 14f8dc4953 drivers: net: Remove remaining alloc/OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/memcpy to kmemdup.
Removed now unused stack variables.
Removed unnecessary parentheses.
Neatened alignment.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-08 17:44:39 -05:00
Vladimir Kondratiev c331997b6c wil6210: fix wil_vring_init_tx status
In case vring setup with the firmware failed,
success status was returned. fix it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:19 -05:00
Vladimir Kondratiev 2acb4220b2 wil6210: Never delete Rx chain with firmware
Firmware crash on attempt to delete Rx chain.
Driver part of Rx chain removed only in preparation for the target reset;
as reset is the only flow that removes Rx chain in the firmware.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:19 -05:00
Vladimir Kondratiev afda8bb50b wil6210: checkpatch warnings
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:18 -05:00
Vladimir Kondratiev 7743882d6f wil6210: fix checkpatch CamelCase warnings
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:17 -05:00
Vladimir Kondratiev 241804cb7b wil6210: Call skb_orphan() right before Rx indication
Other parts of Rx path (BACK logic) will need to access associated data

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:14 -05:00
Vladimir Kondratiev 795ce73438 wil6210: Count Tx statistics on Tx completion
This allows to account for Tx errors

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:13 -05:00
Vladimir Kondratiev 47e19af9a7 wil6210: Refactor rx init/fini
Move WMI related operations to wmi.c as helper functions

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:12 -05:00
Vladimir Kondratiev 2057ebb2bd wil6210: remove raw wil_dbg() calls
Introduce debug category "MISC", convert all raw wil_dbg() to this category.
This improves dynamic debug manageability

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30 15:07:12 -05:00
Vladimir Kondratiev 2be7d22f06 wireless: add new wil6210 802.11ad 60GHz driver
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>
2013-01-04 16:10:53 -05:00