Commit Graph

130 Commits

Author SHA1 Message Date
Srinivas Girigowda
2751b6d2b3 qcacmn: Consolidate multiple MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
Consolidate multiple (redundant) MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
CDP_MAC_ADDR_LEN
OL_TXRX_MAC_ADDR_LEN
DP_MAC_ADDR_LEN
HTT_MAC_ADDR_LEN
IEEE80211_ADDR_LEN
DEFRAG_IEEE80211_ADDR_LEN
ETHER_ADDR_LEN
HAL_MAC_ADDR_LEN
WLAN_MACADDR_LEN

CRs-Fixed: 2406591
Change-Id: I4a87f8ff556920c7b341bdbba99ec43c97b873f4
2019-03-28 16:50:32 -07:00
Jeff Johnson
a8edf330f0 qcacmn: dp: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within dp replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I61f3adab1208682d36235421f44a048e35df346d
CRs-Fixed: 2418258
2019-03-27 06:10:00 -07:00
phadiman
7dd261d614 qcacmn: Free Rx Desc during WiFi unload
Rx desc pools are reused across wifi up
and wifi down, only nbufs part of these
pools are free during down

Free Rx desc pools during WiFi Unload

CRs-Fixed: 2418941
Change-Id: I5cc3a82d99efd84f51f9eb048cf06da5a4495e55
2019-03-26 04:13:12 -07:00
Varsha Mishra
a331e6e55f qcacmn: Implement delay VOW stats for hawkeye
Delay counters per TID have been implemented for following types:
1. Linux stack to hw enqueue delay
2. HW enqueue delay to tx completion delay
3. TX interframe delay
4. RX interframe delay
5. RX frame delay from ring reap to networking stack

Change-Id: I836596cbd878a43955c18b4981cb5b7b43d4df5e
2019-03-12 06:10:05 -07:00
Shashikala Prabhu
e11412df5c qcacmn: Add compile time macro to disable rx_pkt_hdr_tlv
Do not process  RX packet header TLV for low memory config profile.
Also, drop decapped frames in invalid peer processing function.

Change-Id: Ifc7721bb25d85c7e277bebf4b962d2f1bfea150c
CRs-Fixed: 2395508
2019-03-08 23:38:04 -08:00
phadiman
449a268392 qcacmn: Reuse Rx Descriptor Pool Array
wifi up/down will cause soc stop and soc
start which will allocate rx desc pool
array memory for each wifi up

This creates memory fragmentation issue
hence reuse Rx descriptor pool array
across wifi up/down and free only nbufs

CRs-Fixed: 2394666
Change-Id: Ic897c733dfba3d8829e2f2f51099cd615b8a7ea2
2019-03-08 20:19:16 -08:00
phadiman
2c146ea33a qcacmn: Memory Leak in Rx Frag Path
qdf_nbuf_cat API used to call skb_free
on src address but was later modified
so that the caller of qdf_nbuf_cat is
responsible for freeing the src memory

Due to this change in  the API, the
freeing of src memory on caller side
was not taken care and will lead to
mem leak

Hence add qdf_nbuf_free after calling
qdf_nbuf_cat if it returns success.

If qdf_nbuf_cat returns failure, then
freeing is taken care as part of error
handling in parent function.

CRs-Fixed: 2411320
Change-Id: If50eb9279d0cf26a0cf57444cb69e56f11995720
2019-03-08 17:24:08 -08:00
Tallapragada Kalyan
f07025a708 qcacmn: Do not drop multicast pkts in DBDC QWRAP mode
We are not suppose to drop multicast loop backedpkts
received on a different radio. instead they should be
sent to dp link aggregator for setting certain flags.

Change-Id: Idae19c1b6a2caf2a1b2b58fac531c43e9c24db51
CRs-Fixed: 2351300
2019-02-12 08:45:09 -08:00
Tallapragada Kalyan
eff377a1d3 qcacmn: do not process duplicate descriptor frame in RX
once in a while the HW is sending a descriptor which
is already processed by host. This can be a potential HW
issue, as a WAR we are not processing such duplicate descriptors
instead increment a counter and continue with next descriptor.

Change-Id: I6c9bc6a9fb4705b42284171a32855411aa5dd73f
CRs-Fixed: 2338543
2019-01-17 10:49:24 -08:00
Chaithanya Garrepalli
9cc562c53b qcacmn: Modify CDP AST APIs to synchronize add and delete cmds to FW
Change the CDP abstraction APIs for ast entry find, add and delete
to avoid external references for ast entry in upper layers

Process the HTT v2 peer map messages which will be enabled for
nexthop ast entries and use these messages instead of WMI event
for HKv1 WAR where we have to wait for delete confirmation from
target event which is processed in control path

Change-Id: Ifa91a259c0762344deb8ab89e868fc5554d75543
CRs-fixed: 2354951
2019-01-17 02:22:24 -08:00
Aniruddha Paul
a2e7c93db7 qcacmn: Change the 2k handling API to non-static
Make the 2k jump handler from static to non-static
to change the scope of the API.

Change-Id: I55e2b69c8d470cdf958da76f4f0c8d0effc7ed2e
2019-01-12 07:28:54 -08:00
Subhranil Choudhury
5079d52ebf qcacmn: Split the wds src port learn function
Splitting the wds srcport learn function to add:
1. A wrapper function where host extracts the required fields from
   nbuf cb and rx_tlv header.
2. A common function which can be called from both host path
   as well as offload path.

Change-Id: I2f2c0580c049f48395a3e0a265e3fb5d8aed6774
2019-01-07 00:12:49 -08:00
Mohit Khanna
705149946b qcacmn: Fix large RX desc pool memory allocation
During dp_rx_pdev_attach and dp_rx_pdev_mon_buf_attach we are allocating
three times as many rx descriptors as there are entries in the ring for
AP usecase. This is not needed for MCL and may need to kmalloc
failures for allocating that much contiguous memory

Allocate only as many RX descriptors as there are ring entries for MCL
usecase.

Change-Id: I8b559a85c3899bcbdc520e71ba5da409314db160
CRs-Fixed: 2342957
2018-12-15 10:07:15 -08:00
sumedh baikady
da15920d5b qcacmn: Support for smart monitor on HKv2
Add support for smart monitor feature on HKv2.
For HKv2, NAC filtering is done by HW and NAC is
programmed directly in the AST table. The NAC entries
in AST table have monitor direct bit set and this
is obtained by host via monitor status ring.
host subscribes for packet header in MD packets.

To these filtered packets radiotap header is added
and delivered to the stack.

Change-Id: I123f986531943e376ac5c492540e01f0b03348c4
2018-12-13 16:46:07 -08:00
Chaithanya Garrepalli
0a5f71bca1 qcacmn: remove the QDF_BUG in src port learn when peer found
Remove the QDF_BUG in sa valid case when AST entry is not found
and peer is found as this can be a valid case in DBDC repeater

In DBDC repeater case we may receive the L2UF frame sent on 5G
radio on 2G interface

In this case SA will be valid and peer will be found for 5G VAP
mac address, but ast entry will not be found in ast_table as we
dont receive peer map events for STA vaps

Change-Id: I22e8582605f59a8691d8fcbb43627655d1a6500c
2018-11-20 12:19:12 -08:00
Karunakar Dasineni
700ad73754 qcacmn: WAR for duplicate buffers in monitor mode
WAR to discard duplicate indications (buffers and link descriptors)
from monitor DMA seen sometimes on RXDMA2SW ring.

Change-Id: I687b782f54fbbf85ae932ee833ac9263b5879ca6
2018-11-17 10:48:13 -08:00
Om Prakash Tripathi
f8ccc18f6a qcacmn: Check delete in progress before adding wds entry
In Repeater configuration when a STA first associates to Root AP
on some radio and then roams quickly to repeater AP on other radio,
some times target assert is observed due to below race condition.
1. Root AP sends peer delete command to FW on radio X and clears
   its AST entry. This peer delete command not processed by FW yet.
2. STA roames to repeater AP and starts ping traffic to Root AP.
3. Root AP receives the ping frame and tries to add wds entry on
   radio Y as AST entry was not found.
4. FW receives add wds entry on radio Y while on radio X an
   direct peer ast entry for same mac was present.
5. FW asserts.

Change-Id: I02ac409f2b4f6b2ea307d99c5f1fdab7776ca938
CRs-Fixed: 2347818
2018-11-16 05:10:27 -08:00
Chaithanya Garrepalli
e10f87bd41 qcacmn: add a flag in AST entry to indicate AST map
Add a flag for AST entry to indicate if AST entry is
mapped to AST table and use this flag while dereferncing
ast table with ast_index in ast_entry

Change-Id: I8c90f3c40116e24303aac8a7bd53e8f5b67e22bf
2018-10-18 16:58:40 -07:00
phadiman
6ba855ca40 qcacmn: Delete existing AST on different radio
In STA roaming scenarios it is possible that an
AST entry for a given MAC address already exist
on the other radio

Delete the existing WDS AST entry on other radio
if present before adding the new wds entry on the
current radio as part of WDS source port learning

Change-Id: I15ef79be0441f3b27fd55e728f5bb27b073c6469
CRs-Fixed: 2334625
2018-10-18 00:21:21 -07:00
Chaithanya Garrepalli
139f6f495b qcacmn: add AST entry when SA is valid and AST not found in host table
SA might be valid for the mac address after AST entry is deleted from
host AST table as GSE caches the AST entry on other radio even after
it is deleted.

In this case send add AST with updated peer and vdev

Change-Id: I6178785f158a0323bb5dc86179db29785c3a392e
2018-10-18 00:21:18 -07:00
Tallapragada Kalyan
5e3a39c8d3 qcacmn: add support for Secondary HMWDS ast entry
add support for Secondary HMWDS ast entry

Change-Id: Ibf77659cbc2d7e2b536736d89e747549e269e68c
CRs-Fixed: 2312270
2018-10-06 08:16:22 -07:00
Sravan Kumar Kairam
26d471ec56 qcacmn: Take peer ref count and dec it after using
Currently peer reference is used with out taking any ref count.
In parallel context execution on different core peer reference may
be cleaned up in peer unmap event. So take ref count while using
the peer reference and decrement after done with it.

Change-Id: I02ca172cbdc4309fabd3bbbad00940826662bbd3
CRs-Fixed: 2301963
2018-09-27 20:24:36 -07:00
Radha krishna Simha Jiguru
273407908f qcacmn: Add AST type to distinquish bss on STA
When a BSS peer gets associated with vap configured in sta mode,
the ast type associated with that entry should be different from
that of regular static entries, The reason being bridge on root AP
can pick up the mac address of AP VAP.

Change-Id: Ie322a015d883e2712f41623f71ccbc255b99baf3
2018-09-18 06:17:18 -07:00
Chaithanya Garrepalli
2467ed1445 qcacmn: avoid wds source port learning for STA in HKV2
Changes to avoid WDS source port learning in STA mode
if ast override feature is supported by HW

Change-Id: I248c8815429e7417dcf3f451912ee5f037af9c25
2018-09-15 21:21:23 -07:00
Mohit Khanna
7ac554bda5 qcacmn: Support for DP RX Threads
Add support for DP RX Threads as a part of the FR. Multiple RX
threads can be enabled from the ini. The code is added in a new DP
module outside of the cmn project.

Change-Id: Id966c46c2799d23c2a4fa1c884610955afed3565
CRs-Fixed: 2256470
2018-08-24 18:35:45 -07:00
Pamidipati, Vijay
13f5ec2749 qcacmn: Enable DBDC WAR in Root AP mode
In current code, DBDC WAR for AST applies only for repeater mode.
Add support to enable this even in AP modex, for use in SON usecases

Change-Id: I82791fbae0cc86ac6d951c4d85b709c755334273
2018-08-17 10:30:45 -07:00
Aditya Sathish
ded018e406 qcacmn: Clean up dp component prints
Clean up datapath component prints by correcting trace levels for
regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msh appends them by default.

Change-Id: Ie8fe319fcb737720f7400a165e134b6a18bd15b5
CRs-Fixed: 2243843
2018-08-10 18:11:21 -07:00
Pamidipati, Vijay
3756b7603e qcacmn: DBDC repeater mode changes in AST
Add new ast_get_type API for DBDC repeater feature.
Add other changes required in WDS and MEC handling
required for DBDC repeater feature to function properly.

Apply sta kickout logic to handle roaming cases
only within same radio. For roaming across radios, DP should
rely on control path.

Change-Id: If9b35720082dd87de40827843a14238e818bc454
2018-08-06 13:43:58 -07:00
Balamurugan Mahalingam
96d2d41c87 qcacmn: Fix compilation issues and a minor issue
Removed qdf exports on functions defined in target specific
header files and defined those functions as static. Revert
changes on hal_rx_msdu_end_sa_idx_get and make
hal_rx_msdu_end_da_idx_get target specific

Change-Id: I2858b1d77118f0a26b54bf983bd342c7a4fe757d
2018-07-21 00:03:36 -07:00
Balamurugan Mahalingam
97ad1061a3 qcacmn: introduce few target specific hal functions
make hal_rx_msdu_end_sa_idx_get and hal_rx_dump_msdu_end_tlv
routines target specific as qca6390 implementation differs
a bit. add target specific functions for qca6290 and qca8074

Change-Id: Ie05b91d965bae3642e3264620c6d8427ad368044
2018-07-21 00:03:32 -07:00
Jeff Johnson
ff2dfb217b qcacmn: dp: Fix misspellings
Address the following issues in the dp folder:
CHECK: 'availble' may be misspelled - perhaps 'available'?
CHECK: 'catagory' may be misspelled - perhaps 'category'?
CHECK: 'endianess' may be misspelled - perhaps 'endianness'?
CHECK: 'exceded' may be misspelled - perhaps 'exceeded'?
CHECK: 'explicitely' may be misspelled - perhaps 'explicitly'?
CHECK: 'Inteface' may be misspelled - perhaps 'Interface'?
CHECK: 'lengh' may be misspelled - perhaps 'length'?
CHECK: 'messsages' may be misspelled - perhaps 'messages'?
CHECK: 'miscelleneous' may be misspelled - perhaps 'miscellaneous'?
CHECK: 'Ouput' may be misspelled - perhaps 'Output'?
CHECK: 'poiter' may be misspelled - perhaps 'pointer'?
CHECK: 'Poiter' may be misspelled - perhaps 'Pointer'?
CHECK: 'psuedo' may be misspelled - perhaps 'pseudo'?
CHECK: 'registerd' may be misspelled - perhaps 'registered'?
CHECK: 'requred' may be misspelled - perhaps 'required'?
CHECK: 'retreive' may be misspelled - perhaps 'retrieve'?
CHECK: 'succesfully' may be misspelled - perhaps 'successfully'?
CHECK: 'vaild' may be misspelled - perhaps 'valid'?
CHECK: 'virtaul' may be misspelled - perhaps 'virtual'?

Change-Id: I66b9cdc6115dd133b385e60c9d02cefd1bd0bac3
CRs-Fixed: 2241574
2018-05-19 19:41:02 -07:00
psimha
4d9c3f9806 qcacmn: Add sanity checks before retrieving rx_desc
Add sanity checks for pool id & index extracted
from the SW cookie field within buf_addr_info.

Change-Id: Icf21b94fa05f6f8887b8c7a17896348f25436dda
CRs-Fixed: 2220030
2018-05-16 19:48:38 -07:00
Tallapragada Kalyan
ee40c5657f qcacmn: handle mcast pkts in DBDC QWRAP mode
drop mcast pkts in DBDC QWRAP mode if its looped
back on a different pdev

Change-Id: Ia8a23d56e409c85f9c3be523da2041ab622dcb42
2018-05-15 04:33:58 -07:00
Prathyusha Guduri
02ed94801a qcacmn: Add support in DP for enabling multiqueue support
Enable multiqueue on VAP with 4 Tx and Rx queues in lithium.

In Rx path set the rx queue of skb based on the reo ring id on which it
is received.

In Tx path use the queue_mapping of skb to map to the hardware Tx ring
on which it has to be transmitted.

Change-Id: I103a21e91d1ed5c0e1d8441863d4fcd273b7bed9
2018-05-14 03:00:07 -07:00
Chaithanya Garrepalli
72dc9132a6 qcacmn: Raw mode re-factoring and cleanup in rx
Cleaned raw mode specific code and moved the rx
processing to single API dp_rx_sg_create

Change-Id: I7696786d9a0f10983d3299956b46b2ec76b388a5
CRs-fixed: 2204824
2018-05-11 21:12:39 -07:00
Pamidipati, Vijay
d578db10c0 qcacmn: Handle STA roaming to another AP/Repeater
Add support in DP WDS source port learning handler to kickout a STA,
when direct associated peer(SA) roams to another AP/Repeater and
reachable via TA peer

Change-Id: I84d0b92c9b4e39c05f4d7c25b3f5afb1d535ca02
CRs-Fixed: 2219924
2018-04-17 05:09:05 -07:00
Venkata Sharath Chandra Manchala
16fcceb7de qcacmn: Change the buffer manager
Change the buffer manager from HAL_RX_BUF_RBM_SW3_BM to
HAL_RX_BUF_RBM_SW1_BM to handle regular and error packets.

Change-Id: I696d41f6cf0be1d5045ab27841ccc3ee2afea7de
CRs-Fixed: 2189452
2018-04-06 13:25:31 -07:00
Manjunathappa Prakash
86f4ba70f3 qcacmn: Allocate HW link desc pools for each mac
MCL operates on both macs with single pdev. So allocate HW link
descriptor pools for each macs.

Change-Id: I5a373bfbd1d15557e1fc66b8af17c2a130cdf5f9
CRs-Fixed: 2176848
2018-03-20 15:55:02 -07:00
jinweic chen
c3546321b6 qcacmn: add nbuf map result check when replenish
add the nbuf map result checking when replenish rx
nbuf to monitor status ring, this could avoid the
case nbuf map failed and invalid dma address
posted to HW or do unmap for unmapped nbuf.

Change-Id: I45cfc015f71a2d7295f7fcb4803bd6e68e2752d4
CRs-Fixed: 2182546
2018-03-13 06:00:59 -07:00
Mohit Khanna
e1d7e0ecc9 qcacmn: fix double unmap issue in monitor mode
Currently while reaping the rxda destination ring in dp_rx_mon_mpdu_pop,
we end up un-mapping the nbuf twice when -
1. msdu_ppdu_id > ppdu_id
2. msdu_ppdu_id = ppdu_id

For case 1, we exit from the dp_rx_mon_mpdu_pop without reaping the
descriptor completely, but we unmap the nbuf corresponding to it.
Next, when case 2 happens, we end up un-mapping the nbuf again to reap
the same descriptor.

Introduce a flag in the rx_desc to keep track of un-mapping the nbuf. If
the nbuf is already unmapped, donot unmap it.

Change-Id: Icb64fbc00312d6d0e6d41f7b475eb1285530c3d0
CRs-Fixed: 2185301
2018-02-16 22:58:09 -08:00
Tallapragada Kalyan
57b6bb3e1d qcacmn: Add support for DBDC repeater
Added CDP callback APIs so the DBDC repeater module
outside of cmn_dev can add, delete and update the AST
entries. Also with this change the sending of wds cmds
to fw is tied to adding AST, deleteing AST and updating
the AST entries.

Change-Id: I48d31962236860f50e16b771abaf3b8825b798df
2018-02-13 02:00:41 -08:00
Aniruddha Paul
80f52e70ca qcacmn: Add API to return the msdu link descriptor for NSS offload
Add API to return the msdu link descriptor from obtained from NSS back to
host link descriptor pool.

CRs-Fixed: 2178692

Change-Id: Ib4f967ea887e013d6461ba760a45dbda6fd92baa
2018-01-30 23:55:22 -08:00
chenguo
91c9010216 qcacmn: Fix memory leak for invalid peer error
In dp_rx_null_q_desc_handle, if peer is invaild and no need to
deliver to the upper layer, the nbuf must be freed before recycle
the rx descriptor.

CRs-Fixed: 2153932
Change-Id: I1b373d1b5b50da42b896f0b2fd7bbd13b0e2466d
2018-01-01 23:25:10 -08:00
Nandha Kishore Easwaran
47e7416b12 qcacmn: Add check to drop mcast loopback packet
Added a check in RX path to detect multicast loopback packets in
qwrap mode. In qwrap mode, there are multiple station vaps and
multicast loopback packet from one station vap should not come into
the other station vap. Added a check for this by iterating through
the vap list and checking if any of the vdev mac address matches
with the source address of the packet.

Also added a new vdev parameter to check if qwrap isolation mode is
enabled. In qwrap isolation mode, loopback packets should not be
dropped.

Change-Id: I7d35bf657a87337871156e4caec9038432e23a87
CRs-fixed: 2149190
2017-12-28 01:26:17 -08:00
Chandru Neginahal
ccf1cbd063 qcacmn: Expose dp_rx_mic_error_process() to other modules
dp_rx_mic_error_process() api is needed for nss wifi offload mode also

Change-Id: I3666bf3133ea59d5d286931c205bd09b8f6d6c72
CRs-fixed: 2155250
2017-12-21 21:25:56 -08:00
Kris Muthusamy
7e36889461 qcacmn: Adding vdev id for WDS add/del/update API's
- Update the WDS add/del/update dp api's with vdev context

Change-Id: I68bf5670232aaa4bb4cce6a6fe0f7b3b2e921143
CRs-fixed: 2133484
2017-12-20 11:45:07 -08:00
psimha
223883fb88 qcacmn: Handle RX defrag in exception path
- Perform SW chaining of fragments.
- Reinject only the head fragment to REO.

Change-Id: I198db3ba4319b8a2e800eb7495cf190c5e86d4cd
CRs-Fixed: 2144197
2017-12-18 15:55:14 -08:00
chenguo
85d964f48b qcacmn: Add AST type for DP path
There is a hard-coded AST type number used for DP path, which will
cause poor readability. Fix this problem by using a pre-defined
constant type value.

CRs-Fixed: 2142975
Change-Id: I3520970bf59ea7152a0851cfdc3b8e7943ddbc19
2017-12-13 23:38:12 -08:00
Tallapragada Kalyan
2a5fc625d2 qcacmn: Add WDS Vendor Extension ECM Framework
Add WDS tx/rx policy checks in Tx and Rx datapaths.
In Rx path, check packets against rx policy configured
In Tx Reinject path, checks are to process or drop 4-addr/3-addr packets
to peers decisively

Change-Id: I0a6c01b7555fa5d369ab2c9baf454d49808857fc
2017-12-13 12:15:54 -08:00
Vivek
de90e59667 qcacmn: Reorganize the tx & rx member of skb->cb structure
The current tx & rx member of skb->cb structure has lot of common members
duplicated across win & mcl sub structures.
The common members are now moved out
and new members are added as per the requirement.
Also the members are organized to avoid additional padding
and fit within the 48 byte boundary for both 32bit & 64 bit platforms.

Change-Id: I27abc95d51127513cf2e7e9657a4ee84324b2cc9
CRs-Fixed: 2120295
2017-12-02 01:40:58 -08:00