Commit Graph

562 Commits

Author SHA1 Message Date
Wu Gao
20380e9491 qcacmn: Set max rings of DIR_BUF_RX_DMA_SRC to 2
In HSP platform, ring index 0 is for spectral scan, and ring idex 1 is
for CFR capture. Extend max rings to 2 and support CFR capture.

Change-Id: I02b39dd626b67172123bc5e77173d50a132fc735
CRs-Fixed: 2634636
2020-03-23 02:25:14 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -07:00
Mohit Khanna
c58bf56dae qcacmn: Use QDF_MODULE_ID_HAL for HAL tracing APIs
Currently hal_info, hal_err etc are using QDF_MODULE_ID_TXRX to print.
Since HAL is a separte module, use QDF_MODULE_ID_HAL.

Change-Id: I2345e1b333ef1f7a4808f5417657ac58da071475
CRs-Fixed: 2636911
2020-03-16 17:23:59 -07:00
Amir
252b67e048 qcacmn: Add HAL layer changes for full monitor mode
Add HAL layer changes for full monitor mode.

Define HAL API and Data structures to read sw_monitor_ring
descriptor.

CRs-Fixed: 2630982
Change-Id: I015fa106d9da74222bef092d50e96fc70a117a4a
2020-03-15 23:45:58 -07:00
Guisen Yang
b1d228b9aa qcacmn: Change print format for pointer and timer
Build failure happen when use the incorrect print format for
pointer. The timer type should not be used for time difference.
Use %pK for pointer format, and change the variable type to
uint64_t for delta_us.

Change-Id: I7da553ee2a770e4498a23f16d5187dec74357635
CRs-Fixed: 2639868
2020-03-13 23:50:54 -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
Mohit Khanna
b4429e8278 qcacmn: Add delayed register write support in HAL
In case the bus is in low power mode, the register writes (followed by a
memory barrier) may take a long time (~4ms). This can cause the caller
to block till the PCIe write is completed. Thus, even though PCI
writes are posted, it can still block the caller.

Hence, in case the bus is in low power mode (not in M0), or not in high
throughput scenarios, queue the register write in a workqueue. The
register write will happen in the delayed work context. In other cases,
i.e ,when the bus is not in low power mode or in high thoughput
scenarios, do the register writes in caller context.

Change-Id: Idf218e4581545bc6ac67b91d0f70d495387ca90e
CRs-Fixed: 2602029
2020-03-09 20:58:23 -07:00
Amir Patel
d5a7a4ca89 qcacmn: Revert "qcacmn: Replenish last entry in monitor status ring"
This reverts commit I7da6cd6006243cbca2151da22a31a6f5ed0015f3

Change-Id: I04ceeeeabb5f94bfcd81e10280dcd017da537c81
2020-03-09 14:52:57 -07:00
Alok Kumar
32de2fe166 qcacmn: Fix compilation and update SHADOW REG OFFSET for qca6750
For qca6750, update the SHADOW REGISTER OFFSET value and
fix the compilation issue.

Change-Id: Ic4b44c1c40e62ddcc50c0a66d37c0663a70b5c54
CRs-Fixed: 2633044
2020-03-04 07:30:44 -08:00
Debasis Das
eb601eca1e qcacmn: Fix DSCP to tid mapping for Tx packets
Write TID-no correctly for DSCP-value if
2 consecutive registers are needed to configure
the mapping.

Change-Id: I857f95e2d1bda0214a32b2802f1dcc460be87085
2020-03-03 23:54:10 -08:00
Amir Patel
31bfe1fb2c qcacmn: Replenish last entry in monitor status ring
In current monitor status ring implementation,
on pdev_attach, (srng->num_entires – 1) entries
(to keep one entry slot between hp and tp)
are replenished and last entry is not replenished to HW.

With qcn9000 monitor mode HW enhancements, status and destination ring
can be made lock-stepped.
for qcn9000 lock step is achieved by making monitor status ring
follow the monitor destination reap for a PPDU

However in existing flow during attach monitor status replenish logic
do not fill last entry but is filled up during first subsequent reap.
for first ppdu, i.e. after reaping destination ring,
when status ring is reaped, as first entry (hp = srng->num_entires – 1)
in status ring is NULL, so lock-stepping is not achieved.

To address this issue for qcn9000 as well as HK:
	a. Replenish last entry in monitor status ring during attach
	b. Modify src srng peek API to peek it from hp+1 entry
	c. Introduce new HAL API get cur desc and move next

CRs-Fixed: 2626049
Change-Id: I7da6cd6006243cbca2151da22a31a6f5ed0015f3
2020-03-03 12:37:37 -08:00
Ankit Kumar
2bf9b7a18a qcacmn: Initialize command/credit ring for qca8074 & qcn9000
Initialize command/credit ring for qca8074 & qcn9000.

Change-Id: I28087dd4d8f4afddd954c764c2e85da43eaf78f1
CRs-fixed: 2562649
2020-03-01 05:25:24 -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
Sumedh Baikady
d188789876 qcacmn: Enhancement in Minidump feature
Handle minidump logging using dynamic
configurablity options. Data structures
to be logged in minidump can be configured
using internal INI file.

Change-Id: I99f12b3f98c4a9c0e15c3e5d611019e6b8d0909a
2020-02-26 08:35:46 -08:00
Rakesh Pillai
8e01014b7d qcacmn: Add history for register write failure
Maintain a history of the register writes which
have failed. The failure of register write is
determined by reading back the register after
writing a value to that register. If the read
value does not match the value which was written
then it is termed as a failed register write.

Change-Id: Ic3423c2cbd74bf498c0d3dd8ee7ce4231054541a
CRs-Fixed: 2624475
2020-02-25 03:01:36 -08:00
Rakesh Pillai
ff26d1c783 qcacmn: Add stats for register write failure
Sometimes the register write in windowed region
are not going through, thereby retaining the
previous value, which can be incorrect for a
certain mode of operation for the driver.

This kind of incorrect register values, due to
a register write not succeeding, can lead to
unwanted issues. Also the simple logging of
any such occcurence can be over-written in the
logs, thereby going unnoticed.

Add a HAL level statistics to maintain the
count of such failed register writes.

Change-Id: Ib5e98705c23f0c916cb85f518576663710eb30e0
CRs-Fixed: 2611839
2020-02-20 04:52:12 -08:00
aloksing
f89f2b3e50 qcacmn: Fix wifi load issue on CYP
wifi load failed due to unknown symbol in qca_ol
Add export symbol inside compile time macro

Change-Id: If1bb24084a6f95678b51bb85aaa0b8a87df3d50b
CRs-Fixed: 2621904
2020-02-16 00:39:08 -08:00
Alok Kumar
7271755f47 qcacmn: Add static window support for UMAC and CE access in 6750
Use static window for accessing UMAC and CE register in qca6750. For
UMAC and CE register access, separate static window is mapped. Host
accesses these registers using relative offset to window address.

Change-Id: I7940336579553f05a11f1379f635689d08508c56
CRs-Fixed: 2617684
2020-02-15 17:42:01 -08:00
Linux Build Service Account
67ef957780 Merge "qcacmn: Rename cmd ring to cmd_credit ring" 2020-02-15 11:08:15 -08:00
Ankit Kumar
f63aaef3d3 qcacmn: Rename cmd ring to cmd_credit ring
Command ring is now renamed to credit ring on QCN9000
and used for credit based flow.
Renaming the ring to give meaningful name.

Change-Id: I726aed19477fcfb256e4e0cca8ddb9389035b58c
CRs-Fixed: 2562640
2020-02-15 00:32:25 -08:00
Alok Kumar
281aa22857 qcacmn: Update CE registers and CE IRQ for qca6750
Update CE registers offset during hal srng configuration
and configure CE IRQ for qcac6750.

Change-Id: I4fd3d37783361f0029c7ef80e32425f8790d1250
CRs-Fixed: 2617699
2020-02-14 20:20:07 -08:00
Linux Build Service Account
f707a73551 Merge "qcacmn: Read ppdu_id from reo_entrance ring" 2020-02-13 13:07:19 -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
Linux Build Service Account
71dccc8bc2 Merge "qcacmn: Set DBS scan if ndp peers are active" 2020-02-13 04:38:15 -08:00
Venkata Sharath Chandra Manchala
d2ceaf472c qcacmn: Add hal macros for fisa assist
Add 6490 chip specific HAL macros to extract FISA assist from TLV header.

Change-Id: I269431b2708f07b10e7e02715d8940fea27a66f6
CRs-Fixed: 2599917
2020-02-12 11:58:49 -08:00
Manjunathappa Prakash
f3b2944efe qcacmn: Move flow learning and operation HAL macros out of header file
Move flow learning and operation HAL macros from header file hal_rx_flow.h
to hal_rx_flow.c.
1) hal_rx_flow.c conditionally compiled in based on the feature
2) Function implementations are too big to be defined in hal_rx_flow.h

Replicate hal_rx_flow_setup_fse specific to FISA Flow programming.
Implement function to dump the FT entries.

Change-Id: I7db943495eecfc064c4b696939da83d1d8ed9280
CRs-Fixed: 2599917
2020-02-12 11:58:30 -08:00
Basamma Yakkanahalli
f9529fbba8 qcacmn: Adding hal support for ipq5018
Added new qca5018 hal folder to add ipq5018 specific changes.
This includes interface files to access ipq5018 hal registers.

Change-Id: I7e19dc7c8719fa175695b268dc904fb4521a3330
2020-02-10 21:56:37 -08:00
Karunakar Dasineni
f2d6649390 qcacmn: Add HAL SW frame group Id for RTS
Add HAL SW frame group Id definition for RTS

Change-Id: Ic750d3e3f7123c17c6939b69200966e45bf3164a
2020-02-07 21:25:07 -08:00
Manjunathappa Prakash
9195497a5f qcacmn: Implement chip specific hal_rx_msdu_packet_metadata_get_9000
8074 and QCN9000 coexist, so make hal_rx_msdu_packet_metadata_get()
as chip specific

Change-Id: I5b0b5e7f8915d12d4b267d5f07b03b47bb49a83f
CRs-Fixed: 2595314
2020-02-06 11:21:48 -08:00
Manjunathappa Prakash
5fb8965b74 qcacmn: Fix HAL_RX_MSDU_END_DA_IDX_GET macro compilation failure
Move HAL_RX_MSDU_END_DA_IDX_GET macros to chip specific header file.
Fixing compilation failure for 6490 and 6750.
hal_rx_msdu_packet_metadata_get_generic need not be chip specific,
macros defining the function are already chip specific.

Change-Id: I940a289662bdeddfbf99fae2a80d7796334832e7
CRs-Fixed: 2595314
2020-02-05 15:32:48 -08:00
syed touqeer pasha
6997a37a1e qcacmn: Extract msdu end TLV information at once during Rx fast path
Rather than extracting msdu end pkt tlv information per field basis
during fast data path, extract msdu end pkt tlv information at once
and store in local structure.

Change-Id: I0877ba4f824d480cc0851c72090f010852d0d203
2020-02-05 02:28:41 -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
Kai Chen
085ce4026b qcacmn: fix the issue for block ack/ack for tx capture mode
fix the issue for block ack/ack for tx capture mode.
1. Hanndle BAR frame.
2. set rate for ACK frame.
3. Check block ack session and use block ack if block
ack session is established.
4. no ACK for broadcast probe request.
5. not ack if the ack policy is set to no ack in qos control.

Change-Id: I4f22c1c976334978fb971b42319fb3a6e43a00c2
2020-01-27 11:52:36 -08:00
Alok Kumar
9bb30c19ed qcacmn: Add callback to get WBM internal error in qca6750
Add target specific callback to read the WBM internal error
for qca6750.

Change-Id: I79960a972d024ead33903415b4094561a22ad99b
CRs-Fixed: 2607116
2020-01-25 14:08:15 -08:00
Nandha Kishore Easwaran
4842f87b82 qcacmn: Define shadow register as 0 in else case
Define shadow register value as 0 in else case where none
of the chips supporting SHADOW configuration are enabled. This
is needed for low memory configuration profiles where
QCN9000 and QCA6290 are undefined.

Change-Id: I6281568e830b506707aeb96d3ea03811cc1de8a7
2020-01-21 16:59:20 -08:00
Rakesh Pillai
984343c2ea qcacmn: HAL layer changes for Moselle
Add the HAL layer APIs for supporting Moselle

CRs-Fixed: 2597328
Change-Id: Idc59af4ee093e702da95aa704fd3abd76ae5834f
2020-01-18 04:45:14 -08:00
Nisha Menon
4d77312b6d qcacmn: Check if FW or host in recovery before invoking assert
Force wake request is sent before register write. If this req
fails check if FW is down or host is in recovery before
asserting.

Change-Id: I6d31b1f95b68ae4e462f59ed32ed933de55cacae
CRs-Fixed: 2601364
2020-01-17 07:28:13 -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
Tallapragada Kalyan
fa6f80fcad qcacmn: use proper HAL abtraction APIs to get WBM internal error
the current HAL API is to read the WBM internal error
bit from the wbm release ring descriptor is always taking
HKv1 HW structure. But the wbm_internal_error bit
placement has changed from HKv2, for this reason we have
to use target specific HAL API.

Change-Id: I44789180754ca21ae59650b6d8620321a1f12569
2020-01-15 01:30:23 -08:00
Balamurugan Mahalingam
4120f06921 qcacmn: define SHADOW_REGISTER macro for QCN9000
Define shadow registers for QCN9000.

Change-Id: I47fc7057838bf6491dc292660a69b47a655fe0e9
2020-01-12 00:12:33 -08:00
Padma Raghunathan
5cd2e56349 qcacmn: CFR: Process PPDU status TLVs and extract CFR information
Channel Frequency Response(CFR) feature requires PPDU information
for correlation with CFR data. Host subscribes for the relevant PPDU
status TLVs via the Host RX monitor status ring. During monitor status
ring reap, all information needed for CFR correlation is accumulated
in a HAL PPDU structure and delivered to WDI event subscribers.

Change-Id: I3662b60375cb8886447a2fba3efead6a1ef3a98d
CRs-Fixed: 2593408
2020-01-09 10:34:35 +05:30
Prathyusha Guduri
d32c59edb5 qcacmn: Enable HAL_IS_DECAP_FORMAT_RAW for all profiles
HAL_IS_DECAP_FORMAT_RAW was only defined for low memory profiles. Enable
it on all profiles

Change-Id: I064109e6756b25252bedf96065f59ad6ed360bcc
2020-01-02 06:44:38 -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
Kai Chen
011b6c668b qcacmn: add block ack and ack frame for tx capture feature
Block ack and ack frame is composed and sent to up
layer after a unicast packet to AP is received for
tx capture feature.

Change-Id: I4b6bb35fa093432539d15d09a93f85a8ec700b34
2019-12-23 05:50:44 -08:00
Rakesh Pillai
30294e2c79 qcacmn: Skip setting BA window size to 2 for NON BA case
As per the REO logic, if a packet is received with
SN <= current SN, then it will be treated as a 2K jump
error or OOR and the packet in consideration will be
dropped by REO. For NON-BA case this case will be
treated as 2k-jump error.

For the NON-BA case, the packets with SN <= current SN
should not be dropped.
The current REO configuration, sets the BA window size
to 2 for NON-BA case, which in turn enables 2k-jump
detection.

For configuring the REO to not drop packets with previous
SN, we need not set the BA window size to 2, thereby
disabling the 2k-jump check for NON-BA case.

A. SN = 1, 2, 3, 4, 2096, … 
   (good case, as long as the SN is within 2K range)
B. SN = 3, 5, 2
   (3, 5 are good packet, 2 is bad packet and will
   be dropped to ‘2K error’ with error code = 2K error.)
   (note that this is for non-BA session, for BA session,
    we detect SN as either
   2K error or OOR error based on SN and window size).
After this change, we will treat this as a good packet.

C. SN = 1, 1, 1, 1, with duplicate detect enabled – these are duplicate
                    packets and will be dropped to ‘DD queue’ with
                    error code = DD
(No change)

D. SN = 1, 1, 1, 1, with duplicate detect disabled – packets will be
                    dropped to ‘2K error’ with error code = 2K error.
After this change, we will treat this as a good packet.

Skip the setting of BA window size to 2 for aggregated
packets in NON BA case.

CRs-Fixed: 2580605
Change-Id: I19d5eced7c8730a9c3820fd6fc69923d2a98263a
2019-12-12 06:33:55 -08:00
Ruben Columbus
fadeef890b qcacmn: populate qos_null in rx state
sw_frame_group_id decides process for frame. USER_STATS tlv case uses
sw_frame_group_id to add qos_null frame control to rx_status.

Change-Id: Ia3da8dbe4fc4c2d0f21fa8864e6b4e87170ba8f6
2019-12-11 00:19:50 -08:00
Kai Chen
a8cf59455e qcacmn: Add stats on OFDMA and MU-MIMO packet
Add MCS, NSS, MPDU FCS OK, MPDU FCS ERR stats
classified by SU, OFDMA and MU-MIMO.

Change-Id: I3ade03acc06bd924fdeb8dfcaf6b18fb01f01d68
2019-12-01 19:16:58 -08:00
Jinwei Chen
a718c757b3 qcacmn: check register writing result for IPA case
When SAP do connection with first Ref-STA or dis-connection with
last Ref_STA, wlan host need to re-configure REO Dst ring control
register. one of the register offset is 0xA38004, host need to write
remap window register (offset 0x310C) with value 0x14 first, but
sometimes this remap window writing not work, so just use the remap
window value 0x3F left by last writing, final Dst register offset will
be 0x1FB8004 which is out of valid range.
  Find that if we read back the remap window after writing is done,
remap window writing failure issue is gone. as a WAR, check register
writing result for this specific register REO_R0_DST_RING_CTRL_IX_0
always before root caused.

Change-Id: I8d385a0f974ff37bdd867d2ec946f2f46f6eff32
CRs-Fixed: 2570728
2019-12-01 13:11:45 -08:00
syed touqeer pasha
15f8f4c23f qcacmn: Qcn9000 packet tlv field access
Qcn9000 functions to access fields in per packet tlv.

Change-Id: I4751514c6f6d288354e3f220017cc27b6a4f393e
CRs-fixed: 2552619
2019-11-26 02:15:35 -08:00
Nandha Kishore Easwaran
bcf953583a qcacmn: Use multi window write and read for pine
Write into hal register using three floating windows instead of one.
This change is done to avoid frequent window changes for writing into
DP and CE registers. Instead 3 windows are used. One window is statically
mapped to CE block and another window is mapped statically to DP block.
Due to this design there is no need to change the window register to
write into these blocks and write can be done on corresponding window
with single iowrite32. Similar loginc is used for ioread32.

Also modified the hp_addr and tp_addr in initialisation stage so that
hal_write will not have multiple if checks.

Change-Id: Ibb99ec4da7f63323082e46a28afbe90e1f555545
CRs-fixed: 2507441
2019-11-26 02:15:26 -08:00