Commit graph

123 Commits

Autor SHA1 Nachricht Datum
Rakesh Pillai
94c0917f49 qcacmn: Monitor mode improvements
Move the srng history to hif context.

Process the monitor ring only for the lmac
corresponding to the configured monitor channel.

Add the timer and srng history for monitor mode.

Change-Id: I4e5e49ad5e657b55bfafbb40ef5f59496277cb40
CRs-Fixed: 2690530
2020-07-01 07:50:55 -07:00
Guisen Yang
4676e72c02 qcacmn: Change nbuf unmap API when free rx nbuf
The DMA Map/Unmap was restricted to buffer size in rx process.
But the Unmap API was not changed when free nbuf in rx desc,
apply the new unmap API.

Change-Id: Id10d746776aa9e41ef3425e166ba0207851358d6
CRs-Fixed: 2716690
2020-06-30 02:33:58 -07:00
Tallapragada Kalyan
9056ed8685 qcacmn: use proper replenish function for monitor buffer ring
use proper replenish function for monitor buffer ring
when it is called from monitor vap create

Change-Id: I2ee908f93d84eec262def264359ba4afce707976
2020-06-12 09:04:29 -07:00
Saket Jha
d30eab103c qcacmn: Create monitor mode spinlock and add null check
Due to changes in datapath init/deinit path, mon_lock spinlock was not
getting created. Create mon_lock spinlock during
dp_rx_pdev_mon_cmn_desc_pool_init.

Add null check to validate rx_tlv_header before calling
hal_rx_mpdu_start_tlv_tag_valid.

Change-Id: I41c781de29f2c8c05ec1bfa90f9c8f742f2539bf
CRs-Fixed: 2693687
2020-05-29 14:50:54 -07:00
Amir
61ea84b2cb qcacmn: Add full monitor attach/detach API
Add full monitor attach/detach API

Change-Id: I16b52d8ffe2949f43a18bb5d00c3997a1447dac4
CRs-Fixed: 2685408
2020-05-14 14:46:04 -07:00
phadiman
1f3652debc qcacmn: Datapath init-deinit changes
Do a logical split of dp_soc_attach and
dp_pdev_attach into Allocation and initialization
and dp_soc_detach and dp_pdev_detach into
de-initialization and free routines

Change-Id: I23bdca0ca86db42a4d0b2554cd60d99bb207a647
2020-05-02 21:59:42 -07:00
phadiman
b133d310ec qcacmn: Split dp_rx_pdev_attach and dp_rx_pdev_detach
Split dp_rx_pdev_attach into dp_rx_pdev_desc_pool_alloc,
dp_rx_pdev_desc_pool_init, dp_rx_pdev_buffers_alloc and
dp_rx_pdev_detach into dp_rx_pdev_desc_pool_free, dp_rx
_pdev_desc_pool_deinit, dp_rx_pdev_buffers_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: Ib543ddae90b90f4706004080b1f2b7d0e5cfbfbc
CRs-Fixed: 2663595
2020-04-27 18:02:37 -07:00
phadiman
9798b16f3f qcacmn: Split dp_mon_link_desc_pool_setup to alloc and init APIs
Split dp_mon_link_desc_pool_setup to alloc and init APIs and
dp_mon_link_desc_pool_cleanup to deinit and free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I36b2a98bd317010124916e0b2779938eba3883ea
CRs-Fixed: 2663595
2020-04-27 18:02:33 -07:00
Kai Chen
93d8e4ae42 qcacmn: enable monitor destination ring interrupt
Enable monitor destination ring interrupt to fix
packet is getting stuck in monitor mode.
Fix and add monitor mode debug count

Change-Id: I74efdcf6a4373dd73e373285c8cd3aa5757cd0b2
2020-04-19 10:03:37 -07:00
Rakesh Pillai
590d880a1e qcacmn: Change the loglevel for link desc return failure
In monitor mode, the link descriptor return failure
can occur many times, due to the timer interval.
Logging each failure on the console floods it with
too many unnecessary logs.

Ratelimit the link descriptor return failure in monitor
mode and also change its log level to info.

Change-Id: I5709a33087c6d9271d4246f04ef1acd274fba0f1
CRs-Fixed: 2650480
2020-04-07 20:19:23 -07:00
Himanshu Batra
d7e15e64e0 qcacmn: Drop FCS error frames in mon dest ring in mcopy mode
In mon dest ring, for m_copy mode, MGMT packets are received with
FCS error.Due to which multiple skbs (Head_skb with
attached frag_list) for single MPDU are sent to upper stack.
Add fix to drop FCS error frames in mcopy mode.

Change-Id: I6fbf2ea2bfdc489b56a412ece3c644ba2ce87929
2020-04-07 07:46:27 -07:00
aloksing
4b45241915 qcacmn: Add check for NULL pointer
Pointer rx_msdu_link_desc returned from call to function
dp_rx_cookie_2_mon_link_desc which may be NULL and may be
de-referenced latter

CR-Fixed: 2645199
Change-Id: I9ccba61df9571fcc99c5d5493194d5ae43a71a7f
2020-03-31 04:11:00 -07:00
Amir Patel
925a7d389c qcacmn: Add full monitor mode changes
Add following changes:
	a. Add CDP API to config full monitor mode
	b. HTT configuration changes
	c. Init/Deinit changes for full monitor mode resources

CRs-Fixed: 2632442
Change-Id: I06db5194031b3ea0f0c1e5deda20df4bc0faa0b9
2020-03-20 22:16:00 -07:00
Pavankumar Nandeshwar
9b0c1271ed qcacmn: Initialized pdev id with default value 0xFF
pdev_id is being initialized with 0. Since 0 is valid pdev_id, though
pdev is not present for that id, it is being accessed.

Initialized pdev_id to 0xFF by default. Added checks on API to
detect valid pdev_id value corresponding to lmac_id

Change-Id: I2b2a38783615494ccc08e265702815f7e562214b
2020-03-17 03:11:13 -07:00
Kai Chen
b1a940fa76 qcacmn: Fix issue on block ACK on response to BAR
Fix the issue on block ACK on response to BAR frame.
Parse BAR frame received from monitor destination ring and
generate block ack frame from BAR frame and previous block
ACK frame.

Change-Id: Ifc242b3850630aa25827b003a1e2078a9228358a
2020-03-11 01:47:02 -07:00
Amir Patel
605e44bf31 qcacmn: Move dp monitor inline APIs to header file
Move dp monitor inline APIs to header file from dp_rx_mon_dest.c
to dp_rx_mon.h to use it in component dev

CRs-Fixed: 2626054
Change-Id: I3a31dacd7d7e817f144708f9bda5536808080864
2020-03-03 18:54:37 -08:00
Amit Shukla
fc8337d5de qcacmn: Add support for noACK frames
Intercept monitor destination path for NDPA frames,
use it to generate noack frames for tx capture.

Change-Id: Ia54196bd84729a7863954b6deec7e02b52f23556
CRs-Fixed: 2605672
2020-02-28 00:20:34 -08:00
Amir Patel
b8e9bcdf4c qcacmn: Read ppdu_id from reo_entrance ring
For qcn9000, As part HW enhancements, PPDU_ID is sent
in reo_entrance_ring descriptor instead of RX_MPDU_START
tlv. Add support to read ppdu id from descriptor.
Modify existing hal API hal_rx_hw_desc_get_ppduid_get ()
arguments to pass RxDMA ring HW descriptor.

Usage:
 a. Use hal_rx_hw_desc_get_ppduid_get () -
    to get ppdu id from rx_tlv_hdr or hw descriptor based on target.
    for qcn9000, this API gets ppdu_id from HW descriptor,
    for other platforms, gets ppdu_id from rx_tv_hdr
 b. Use hal_rx_get_ppdu_id () - to get ppdu_id from rx_tlv_hdr

Change-Id: I5838227c12cde50cbb2a9da7a0d8056b8b9b7ef5
2020-02-13 05:54:15 -08:00
Shashikala Prabhu
03a9f5b19c qcacmn: Add framework to configure varying data/monitor buf size
Add a framework to configure varying buffer size for both data and monitor
buffers.
For example, with this framework, the user can configure 2K SKB for Data
buffers, monitor status rings, monitor descriptor rings, monitor
destination rings and 4K SKB for monitor buffers through compile time.

Change-Id: I212d04ff6907e71e9c80b69834aa07ecc6db4d2e
CRs-Fixed: 2604646
2020-01-29 18:08:33 -08:00
Rakesh Pillai
e3c018c0c7 qcacmn: Datapath changes for QCA6750
Add the datapath changes for supporting
the newly added IPCI bus type for QCA6750

CRs-Fixed: 2597326
Change-Id: I27e3e9f746eb383e85c7345150bda03320d041b9
2020-01-18 04:45:01 -08:00
Amit Shukla
1edfe5ae7c qcacmn: Data path changes for Dynamic Mode Change FR. Changes include-
1. Move all LMAC rings to SOC from pDEV
	2. Dynamically obtain lmac->pdev mapping while handling LMAC interrupts

Change-Id: Ib017d49243405b62fc34099c01a2b898b25341d0
2020-01-16 17:14:39 -08:00
Saket Jha
540da9a56c qcacmn: Add 6GHz Monitor Mode Support
Add monitor mode support to capture packets over 6GHz frequencies by
getting capture frequency from pdev.

Change freq type to qdf_freq_t.

Change-Id: I7b6edc43e254dc98a3c2939c369874bec9d16ddd
CRs-Fixed: 2568970
2020-01-15 11:30:21 -08:00
Aniruddha Paul
33fce952a9 qcacmn: Fix the next link descriptor read issue
Link descriptor were getting freed by the pointer
of the previous freed link descriptor. This patch
fixes by copying the address of the current in a
local descriptor info and using it to free the
current.

Change-Id: I95e137ba5b1f0ad21b0e6fb39f6671e1d5b65ba6
CRs-Fixed: 2577624
2019-12-30 05:53:14 -08:00
Jinwei Chen
3172ed4419 qcacmn: degrade log level in monitor dst processing
Degrade log level from ERROR to INFO_HIGH to prevent excessive
logging into dmesg console.

Change-Id: Ic0ef72cf2564ed2354b3db4d6e09e7ac7c832560
CRs-Fixed: 2582400
2019-12-12 18:17:36 +05:30
Surya Prakash Raajen
507b75ac5c qcacmn: Fix replenish size for monitor buffers during attach
Head_pointer == Tail_pointer is treated as ring empty and
Tail_pointer + 1 == head_pointer is treated as ring full,
hence replenish count should be num_entries-1 to avoid
buffer ring treated as empty or full.

Change-Id: I157834a86380bcd2f03679510357ad3ca5550374
CRs-Fixed: 2569491
2019-11-26 04:03:33 -08:00
Venkata Sharath Chandra Manchala
e69c9c2ac0 qcacmn: Add support for QCA6490
Add the following support for QCA6490:
1. Initialize the qca6490_hal_hw_txrx_ops
2. Initialize the hw_srng_table
3. Attach hal_qca6490_attach

Change-Id: Ic53c520ef804eb4fbe1434c704e9040c83011d3d
CRs-Fixed: 2522133
2019-10-17 15:12:14 -07:00
Venkata Sharath Chandra Manchala
84d5092701 qcacmn: Add hal_rx_hw_desc_get_ppduid_get API
Implement hal_rx_hw_desc_get_ppduid API based
on the chipset as the macro to retrieve
ppduid value is chipset dependent.

Change-Id: I7d3457d731ea486f04367f98f9f18d3f1c0fcfd7
CRs-Fixed: 2522133
2019-10-17 15:09:23 -07:00
Venkata Sharath Chandra Manchala
f05b2ae5c2 qcacmn: Add hal_rx_msdu_end_l3_hdr_padding_get API
Implement hal_rx_msdu_end_l3_hdr_padding_get API
based on the chipset as the macro to retrieve
sa_idx value is chipset dependent.

Change-Id: Ice1fc2d70e339dc1d80fa6f34f37c5a7aa074be5
CRs-Fixed: 2522133
2019-10-17 15:07:13 -07:00
Venkata Sharath Chandra Manchala
43d563277d qcacmn: Add hal_rx_desc_is_first_msdu API
Implement hal_rx_desc_is_first_msdu API
based on the chipset as the macro to
retrieve first_msdu bit value is chipset
dependent.

Change-Id: I8e8a3aceb225b591b96e6f8453ffbebf1f78e529
CRs-Fixed: 2522133
2019-10-17 15:07:09 -07:00
Chaoli Zhou
fd20986e6a qcacmn: Fix runtime unknown symbol issue
In the sdx platform, WLAN monitor mode is disabed,
in other words, CONFIG_FEATURE_MONITOR_MODE_SUPPORT
will be set to n, but dp_mon_buf_delayed_replenish
hasn't be defineded if it set to n, which can cause the
runtime unknown symbol issue. So add the definition
for it.

Change-Id: Iec50f7cc5ed6f94e2f5a40fbc6594c2830d1359f
2019-08-29 00:24:31 -07:00
Kiran Venkatappa
a33e6a8ea7 qcacmn: Use correct mac_id for delayed mon replenish
mac_id is used to get rx_desc_pool for monitor ring and mac_for_pdev is
used for srng for monitor buf. Use appropriate id to get correct
combination of hw ring and sw desc for monitor rings.

Change-Id: I7e4467e9568056e55cbabfef8f97ce94ad9c1b1c
CRs-Fixed: 2512292
2019-08-21 23:46:08 -07:00
Kai Chen
4b4e8b48cf qcacmn: change debug print and add ring stuck count
change debug print and add counter for monitor destination
ring stuck

Change-Id: I79b4d3b957303334717fd04bfddf754e303e69db
2019-08-16 08:22:57 -07:00
phadiman
797a49bc7d qcacmn: Fix incorrect access to mon buffer ring
Map mac_for_pdev appropriately for both MCL & WIN,
since MCL have multiple monitor buffer rings and
WIN just has one mon buffer ring, below API helps
identify accurate monitor buffer ring for both cases

CRs-Fixed: 2502051
Change-Id: I3929f3f7717d795850a41f4148397d87b0415118
2019-08-09 02:50:24 -07:00
Sumeet Rao
c4fa4df717 qcacmn: Add a new feature to support tagging of IPv4/v6 flows
Tags are programmed using wlanconfig commands. Rx IPv4/v6
TCP/UDP packets matching a 5-tuple are tagged using HawkeyeV2 hardware.
Tags are populated in the skb->cb in the REO/exception/monitor data
path and sent to upper stack

CRs-Fixed: 2502311
Change-Id: I7c999e75fab43b6ecb6f9d9fd4b0351f0b9cfda8
2019-08-07 11:28:21 -07:00
Mainak Sen
9550273ede qcacmn: Rx Sw Descriptor allocation should be configurable
To make Rx Software descriptor allocation configurable for each radio,
new ini variable is added.

Change-Id: Ifc5683629747a6fe8238c18448695abe91876ec5
2019-08-05 16:45:59 -07:00
Akshay Kosigi
8eda31cab3 qcacmn: Remove void ptr usage in HAL
Add code to replace usage of void pointers from
HAL layer and instead use appropriate opaque pointers

Change-Id: Id950bd9130a99014305738937aed736cf0144aca
CRs-Fixed: 2487250
2019-07-27 13:43:07 -07:00
Akshay Kosigi
a870c6181a qcacmn: Change to clean up of void pointers
Add code to cleanup usages of void pointer usages
in DP code.

Change-Id: I0736bcc0a547d858ed02f1ee59084a44e5fe4bec
CRs-Fixed: 2487249
2019-07-27 13:43:04 -07:00
Akshay Kosigi
0bca9fb200 qcacmn: Change to remove void pointer usage for HAL SRNG
Add code to remove void pointer usage for hal_srng
and use opaque pointer dp_hal_ring_t instead.

Change-Id: I6907f7376d7fe3c9180b8795bd96f49fead2ec64
CRs-Fixed: 2484404
2019-07-27 13:42:41 -07:00
Akshay Kosigi
91c56523d3 qcacmn: Remove void pointer usage for ring desc's
Make change to remove usage of void pointers for
ring descriptors and instead use a opaque pointer
dp_ring_desc_t.

Change-Id: Ia1e9a3da9eaa3cccf297b2135b52a72f2fe21431
CRs-Fixed: 2484409
2019-07-27 13:42:37 -07:00
Kiran Venkatappa
115309a008 qcacmn: Delay monitor buffers replenish to monitor VAP create
Monitor buffer are required only when monitor VAP is created. Allocate
these buffers only when montior VAP is created. This provides memory
savings when no monitor VAP is created/required.

Change-Id: I3ddaef00615f00fd13adb2789469a62f1a0af165
CRs-Fixed: 2491873
2019-07-24 21:43:36 -07:00
Shashikala Prabhu
0843438590 qcacmn: Use correct skb headroom size to update radiotap header
Size of rx_pkt_hdr tlv structure is used to check if there is enough
space in the SKB to add radiotap header.
The issue is seen due to a single SKB can hold the multiple TLVs and
the next subsequent SKB has the data. In this case, there is no headroom
available in the second SKB. Therefore crash seen while adding the
radiotap header in the second SKB.

To fix this issue, check if the SKB has enough headroom space. If not,
drop the frame.

Change-Id: Icd11f946c0aee974dde2ef21f59cfe3d8b87fa5d
CRs-Fixed: 2480719
2019-07-23 11:59:42 -07:00
Kai Chen
f76d6062ce qcacmn: work around on monitor buffer ring back pressure issue
destination ring MPDU processing is stuck because ppdu id is
not sync between monitor status ring and monitor destination ring.
Add logic to detect destination ring process stuck and jump over
destination ring stuck entry.

Change-Id: I17d9b5fba06a28239ec64d864ae7944ae04a7dae
2019-07-23 08:23:44 -07:00
Jinwei Chen
e1ffcf089e qcacmn: fix monitor packets radiotap channel incorrect issue
The channel number is always 0 from HAL RX PPDU TLV, then monitor
mode frames radiotap channel frequency is always 2407, get the
correct channel number that we saved when set monitor channel.

Change-Id: Ib927fe9aca3a4c1f98845fe37c9b1d37d1d6cf5a
CRs-Fixed: 2471161
2019-06-19 10:33:06 -07:00
Rakesh Pillai
6c1cdf307a qcacmn: Fix memory leak in dp pdev attach failure case
Currently the failure in dp_rx_pdev_mon_attach, during
dp_pdev_attach_wifi3, does not cleanup the rx buffers
and hence that memory is leaked.

Follow the proper cleanup sequence to avoid leaking
the rx buffer memory.

CRs-Fixed: 2451982
Change-Id: Idef308e11c46fe3e7ae9199a6fcf05ca83210b6b
2019-05-31 07:40:22 -07:00
nwzhao
d7196d8dd4 qcacmn: fix rx path dma-inv-range, unmap-single issues
In case of duplicated rx descriptors from hardware,
it will hit issues in __dma_inv_range(), __qdf_nbuf_unmap_single.
Detect the duplicates, skip processing them, drop the mpdu.

CRs-Fixed: 2413816
Change-Id: I7efd4b0c1bda5578578927bb22fe9d487758897d
2019-05-24 12:17:55 -07:00
Varun Reddy Yeturu
a7c21dc7f3 qcacmn: Allocate multi page memory for dp_rx_desc_pool_alloc
Allocate memory in multiple smaller chunks for dp_rx_desc_pool_alloc,
and link the pages instead of allocating one big contiguous memory to
avoid memory allocation failures.

Change-Id: Id81de10727555c4ca78963a6f01ed3b992ce9924
CRs-Fixed: 2443999
2019-05-23 20:35:07 -07:00
Karunakar Dasineni
4a6eff07b1 qcacmn: Track PPDU ID history for monitor rings
Track PPDU Id history from monitor status and destination
rings, and display as part of monitor stats.

Change-Id: I7b8985f93b1cdb6eb5210bba5a65e9bfb617a710
2019-05-06 14:58:32 -07:00
Karunakar Dasineni
142f9baf47 qcacmn: Add new feature to support protocol tags
With this feature, using appropriate commands, link layer, network layer,
transport layer and some of the application protocols can be tagged with
the user provided tag values for easier identification of protocols. The
supported protocols today are as follows.

ARP, DHCPv4, DHCPv6, DNS over TCP (v4), DNS over TCP (v6), DNS over UDP
(v4), DNS over UDP (v6), ICMPv4, ICMPv6, TCPv4, TCPv6, UDPv4,
UDPv6, IPv4, IPv6, EAP.

Receive packets are tagged by hardware. Tags are applied after the first
matching rule. Hence it is recommended that the rules are
programmed in such a way that tags are configured from application layer
to data link layer to get expected results.

Change-Id: Ibdc2bd2b78234f482074955e89fb93f05988eaca
2019-04-26 15:31:10 -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
Lin Bai
fb19a22340 qcacmn: Fix compiler issue with DISABLE_MON_CONFIG
Compiler threw error 'defined but not used [-Werror=unused-function]'
when macro DISABLE_MON_CONFIG defined.

Wrap those functions by DISABLE_MON_CONFIG, which used only
within DISABLE_MON_CONFIG.

Change-Id: Idd92b9c481d580a6ca3df39963fa98e11d9d0753
CRs-Fixed: 2418584
2019-03-19 21:17:11 -07:00