Commit Graph

320 Commits

Author SHA1 Message Date
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
Venkata Sharath Chandra Manchala
2b0d3f38d5 qcacmn: Support force wake request
1. Add hif_force_wake_request API to wake the
mhi and umac before reading/writing the memory region
greater than BAR+4K.
2. Add hif_force_wake_release API to release the
PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG so the
umac can power collapse again at a later point of time.
3. Add pci stats to dump the force wake status.

Change-Id: Ic6d5463ea0cdb28d9144be61da55e43033b53298
CRs-Fixed: 2478052
2019-11-26 02:15:13 -08:00
Venkata Sharath Chandra Manchala
74a2f413df qcacmn: Increase the force wake timeout
Increase the force wake timeout to 100ms for
debug builds as mhi requires 100ms to
wake up.

Change-Id: Ida0b1287a86a5a97fd2d9c80fee4e677eea86cbe
CRs-Fixed: 2552815
2019-11-18 10:33:26 -08:00
Jinwei Chen
99ae1c1f3d qcacmn: Support register writing result check for IPA case
a. Add new macro HAL_REG_WRITE_CONFIRM to check register writing result,
enable register writing result check when do REO DST ring remap for
IPA.
b. only enable register writing result check when macro
HAL_REGISTER_WRITE_DEBUG is configured.

Change-Id: Ib52e6b0d689ccf714876b3978fa8e356f652d25e
CRs-Fixed: 2557252
2019-11-11 13:41:55 -08:00
Venkata Sharath Chandra Manchala
ea6518b89e qcacmn: Record reo command srng events
Add debugging infrastructure to record every event posted to reo
command ring. The infrastructure maintains the record of the last
64 events posted to the ring.

Change-Id: Id56fc352050eb664a64b0abb767f3b4a6b4c3aa3
CRs-Fixed: 2552822
2019-11-07 19:50:09 -08:00
Venkata Sharath Chandra Manchala
05c1f9c8c3 qcacmn: Remove unneccessary logging
Remove unneccessary logging to avoid
printing on the console.

Change-Id: Icdd5ea5703ab41561af7092def2b3b4352c637f2
CRs-Fixed: 2552006
2019-11-05 22:18:03 -08:00
Nandha Kishore Easwaran
fb73acb147 qcacmn: CE flag changes for QCN9000
Added change to modify ce flags for Pine.
Also made changes in window enable bit

Change-Id: Id080be53d14450cb6d9376fc810177bce26a2869
CRs-fixed: 2507441
2019-11-05 16:18:38 -08:00
Venkata Sharath Chandra Manchala
c9e344de3d qcacmn: Set the reo destination ring ctrl register
The reo destination ctrl registers
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR and
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR are used for mapping
msdu packets to different reo rings.
For QCA6390,
reo remap values varied from 0 - 7 so every 3 bits in
the register were used to map to a particular reo ring.
For QCA6490,
reo remap values vary from 0 - 9 as two extra reo rings are
added so we are using 4 bits in the register to map to a
particular reo ring.
Use the macros directly provided in the header files
to map reo rings.

Change-Id: I6d64266d3b388b3453b7df959048e3d693cf0a40
CRs-Fixed: 2544102
2019-10-30 05:58:57 -07:00
Jinwei Chen
7d419468a9 qcacmn: Use CNSS register window lock for register accessing
If CNSS platform driver and wlan host driver try to write
window register at the same time, conflict happened which then
register write failed.
Use the window register lock shared from CNSS driver to avoid
the conflict.

Change-Id: Iccc4e60e4f5eed995ec6aa53b024f3f96a2619a0
CRs-Fixed: 2534408
2019-10-28 20:58:46 -07:00
Mohit Khanna
80002653b1 qcacmn: Check for ring approaching full during RX
Check if REO ring is near full at the end of dp_rx_process. In case the
ring is near full, reap the packets in the ring (and replenish, send to
upper layer) until the quota allows. Ignore the HIF yield time
limit in such cases.

This change is needed to prevent back pressure from the REO ring(in case
it gets full). Backpressure from REO ring (to LMAC) may lead to a
watchdog and eventually a FW crash. Hence, avoid such a scenario by
reaping as many packets as the 'quota' allows when the REO ring is in
aforementioned condition.

A sid-effect of this change would be that at times the RX softirq may run
longer (till the quota limit) than the configured HIF yield time.
However, this logic is not expected to kick-in in perf builds. The issue
is reported for a defconfig build where lots debug options are enabled
in the kernel which can slow the processing down.

Change-Id: I2eb6544c159ec5957d10386b1750fd96473fe13a
CRs-Fixed: 2540964
2019-10-23 12:04:39 -07:00
Pavankumar Nandeshwar
b86ddaf205 qcacmn: Handle wbm_internal_error in tx completions
Handle wbm_internal_error in tx completions by releasing
associated descriptors and buffers.

Change-Id: I94d334c90c0514674323430fe53da72fb5424576
2019-10-23 10:32:33 -07:00
Sravan Goud
7d2afb4d62 qcacmn: Do panic if pci wake request fails
During hal write register first device force wakeup
request is done. If force wakeup request fails register
write is not done and the execution continues. This leads
to NOC erros in REO ramap register cases. As in later point
of time packets will be coming on wrong reo2sw ring and at
the destination side channels are not enabled. When NOC error
happens the current system is of no help to root cause as the
write fail happened way before. So do panic if pci wake request
fails which help to root cause the reason for failure.

Change-Id: I30d3f0a7858f3d4af96a80f69ba59764c9a7c8e9
CRs-Fixed: 2541061
2019-10-19 10:58:54 -07:00
Venkata Sharath Chandra Manchala
b9cafe22c0 qcacmn: Avoid invalid access to umac register when runtime suspend
When txrx_stats 28 is issued we post messages to reo command ring
to receive reo queue stats on the reo status ring.
This leads to acces accessing reo_cmd_ring head pointer shadow
register when runtime pm is suspended. Perform
a hif_pm_runtime_get to resume the apps before accessing
the shadow register.

Change-Id: Ie6df817fc114bd4c8ba7783df1fe3bd770deec40
CRs-Fixed: 2544174
2019-10-19 06:49:18 -07:00
Manjunathappa Prakash
6a3150dc23 qcacmn: HAL changes to support 6490-R50 and 8074v2 HW header changes
HAL changes to support 6490-R50 and 8074v2 HW header changes

Change-Id: Idb557363b9fce29d10a781c017a1727d110584c5
CRs-Fixed: 2522133
2019-10-17 15:13:09 -07:00
Venkata Sharath Chandra Manchala
36fd40ab6e qcacmn: Add hal_rx_get_rx_sequence API
Add hal_rx_get_rx_sequence API to retrieve
rx sequence value based on the chipset.

Change-Id: I8377b96dfe04e9695a183482d9fcc4a804f845e0
CRs-Fixed: 2522133
2019-10-17 15:12:59 -07:00
Venkata Sharath Chandra Manchala
7dab661c10 qcacmn: Add hal_6490_tx.h file
Add hal tx macros to access
hardware structures.

Change-Id: Ia3b9f09539500f90d9458ff84c0510758234f917
CRs-Fixed: 2522133
2019-10-17 15:12:26 -07: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
5c5d409000 qcacmn: Add hal_rx_tlv_get_tcp_chksum API
Implement hal_rx_tlv_get_tcp_chksum API
to retrieve tcp_udp_checksum value
based on the chipset.

Change-Id: Ifab970f10af06f8c0cdbd14d57cb66b49bae1648
CRs-Fixed: 2522133
2019-10-17 15:12:02 -07:00
Venkata Sharath Chandra Manchala
1059fae62c qcacmn: Add hal_rx_msdu_get_flow_params chip specific
Implement hal_rx_msdu_get_flow_params API
per chipset as the macro
to retrieve the flow parameters is
chipset dependent.

Change-Id: I6ef83232ebdf7497871a7fc588e082d14cdc9e75
CRs-Fixed: 2522133
2019-10-17 15:11:50 -07:00
Venkata Sharath Chandra Manchala
8fc894afc8 qcacmn: Add hal_rx_msdu_cce_metadata_get API
Implement hal_rx_msdu_cce_metadata API per
chipset as the macro to retrieve the cce_metadata
value is chipset dependent.

Change-Id: Icd87d4ac32be78d69b24da106381a7669c86ada6
CRs-Fixed: 2522133
2019-10-17 15:11:41 -07:00
Venkata Sharath Chandra Manchala
905312efaa qcacmn: Add hal_rx_msdu_fse_metadata_get API
Implement hal_rx_msdu_fse_metadata API per
chipset as the macro to retrieve the fse_metadata
value is chipset dependent.

Change-Id: Iae7f532460b5203af2f95c504a6941c0b18b665e
CRs-Fixed: 2522133
2019-10-17 15:11:29 -07:00
Venkata Sharath Chandra Manchala
b5ec9d28ee qcacmn: Add hal_rx_msdu_flow_idx_timeout API
Implement hal_rx_msdu_flow_idx_timeout API
per chipset as the macro
to retrieve the flow_idx_timeout value is
chipset dependent.

Change-Id: I03030e3763b3c4a9099699a2d24b8110961610cf
CRs-Fixed: 2522133
2019-10-17 15:11:16 -07:00
Venkata Sharath Chandra Manchala
b9a8536661 qcacmn: Add hal_rx_msdu_flow_idx_invalid API
Implement hal_rx_msdu_flow_idx_invalid API
per chipset as the macro
to retrieve the flow_idx_invalid value is
chipset dependent.

Change-Id: I5b8622eb896456b7388016a16657048d0da4e970
CRs-Fixed: 2522133
2019-10-17 15:11:03 -07:00
Venkata Sharath Chandra Manchala
c9a4e14344 qcacmn: Add hal_rx_msdu_flow_idx_get API
Implement hal_rx_msdu_flow_idx_get API
per chipset as the macro
to retrieve the flow_idx value is
chipset dependent.

Change-Id: I75131d7c048f5b67489ed25fbd52bfcf01bab782
CRs-Fixed: 2522133
2019-10-17 15:10:51 -07:00
Venkata Sharath Chandra Manchala
222b2539cb qcacmn: Add more HAL APIs in hal_api_mon.h
Add the following macros:
1. HAL_REO_CONFIG
2. HAL_RX_MSDU_DESC_INFO_GET
3. HAL_RX_LINK_DESC_MSDU0_PTR

Add the relevant function pointers to
retrieve the descriptor info from the
above mentioned macros based on a
given chipset.

Change-Id: If44ae3d91397f1b1b0c36a49ce56a2c5e719434e
CRs-Fixed: 2522133
2019-10-17 15:10:39 -07:00
Venkata Sharath Chandra Manchala
b7d2df16b5 qcacmn: Add HAL APIs in hal_generic_api.h
Add the following macros:
1. HAL_RX_GET_FC_VALID
2. HAL_RX_GET_TO_DS_FLAG
3. HAL_RX_GET_MAC_ADDR2_VALID
4. HAL_RX_GET_FILTER_CATEGORY
5. HAL_RX_GET_PPDU_ID

Also add function pointers to
retrieve the flags from the above
macros.
Change-Id: I334b198588ceba77cd30bdde7ebc500cdbe18358
CRs-Fixed: 2522133
2019-10-17 15:10:27 -07:00
Venkata Sharath Chandra Manchala
8227240793 qcacmn: Add HAL macros in dp_rx_defrag.c
Add the following HAL macros:
1. HAL_RX_MSDU0_BUFFER_ADDR_LSB
2. HAL_RX_MSDU_DESC_INFO_PTR_GET
3. HAL_ENT_MPDU_DESC_INFO
4. HAL_DST_MPDU_DESC_INFO

Add relevant function pointers to retrieve
descriptor info from the macros based
on chipsets.

Change-Id: I99ce7566a668180c7849eedea915b6f23a8dbf35
CRs-Fixed: 2522133
2019-10-17 15:10:16 -07:00
Venkata Sharath Chandra Manchala
38e84d2722 qcacmn: Add hal_tx_desc_set_mesh_en API
Implement hal_tx_desc_set_mesh_en API
based on the chipset as
the macro to set mesh_en value is
chipset dependent.

Change-Id: I43c85e4ed6fd4f9992de5b71857cdb8becd1dd36
CRs-Fixed: 2522133
2019-10-17 15:10:04 -07:00
Venkata Sharath Chandra Manchala
685045eb9c qcacmn: Add hal_rx_msdu_end_sa_sw_peer_id_get API
Implement hal_rx_msdu_end_sa_sw_peer_id API
based on the chipset as
the macro to retrieve sa_sw_peer_id value is
chipset dependent.

Change-Id: I2efd1f851539bbffc8f75c7662045c1f4a3c4469
CRs-Fixed: 2522133
2019-10-17 15:09:53 -07:00
Venkata Sharath Chandra Manchala
56022cb6e1 qcacmn: Add hal_rx_mpdu_start_mpdu_qos_control_valid_get API
Implement hal_rx_mpdu_start_mpdu_qos_control_valid
API based on the chipset as
the macro to retrieve mpdu_qos_control value is
chipset dependent.

Change-Id: I61449ff5afc958f1a1f93013b0c5ab56d38cc833
CRs-Fixed: 2522133
2019-10-17 15:09:41 -07:00
Venkata Sharath Chandra Manchala
25d7dbc589 qcacmn: Add hal_reo_status_get_header_generic API
Implement hal_reo_status_get_header_generic
based on the chipset as the macro to retrieve
reo_status value is chipset dependent.

Change-Id: I43bd624bec37fb051f33b4828fcf7cd3e4b2a61e
CRs-Fixed: 2522133
2019-10-17 15:09:32 -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
8513048ac9 qcacmn: Add hal_rx_tid_get API
Implement hal_rx_tid_get API based on
the chipset as the macro to retrieve
tid value is chipset dependent.

Change-Id: I37eab3f3c1c2bbba6094b9ddb24d72712b819f73
CRs-Fixed: 2522133
2019-10-17 15:09:13 -07:00
Venkata Sharath Chandra Manchala
5ddc518b2e qcacmn: Add hal_rx_is_unicast API
Implement hal_rx_is_unicase API based
on the chipset as the macro to retrieve
is_unicast bit value is chipset dependent.

Change-Id: I38807f478c295309adf2a07ce9010b1bc04c734e
CRs-Fixed: 2522133
2019-10-17 15:09:04 -07:00
Venkata Sharath Chandra Manchala
68d6f0d585 qcacmn: Add hal_rx_get_mpdu_sequence_control_valid API
Implement hal_rx_get_mpdu_sequence_control_valid
API based on the chipset as
the macro to retrieve sequence control valid
value is chipset dependent.

Change-Id: I01a006094d0330060e9ff1a91200c48c2426f38d
CRs-Fixed: 2522133
2019-10-17 15:08:54 -07:00
Venkata Sharath Chandra Manchala
aa7628361e qcacmn: Add hal_rx_mpdu_get_addr4 API
Implement hal_rx_mpdu_get_addr4 API based
on the chipset as the macro to retrieve
addr4 value is chipset dependent.

Change-Id: Ie35d01de1619a8ab540bb1b2019a15b436efb7d4
CRs-Fixed: 2522133
2019-10-17 15:08:45 -07:00
Venkata Sharath Chandra Manchala
7c868259ff qcacmn: Add hal_rx_mpdu_get_addr3 API
Implement hal_rx_mpdu_get_addr3 API
based on the chipset as
the macro to retrieve addr3 value is
chipset dependent.

Change-Id: I3983599b656e82170de5905c08daee3ec164e7a0
CRs-Fixed: 2522133
2019-10-17 15:08:38 -07:00
Venkata Sharath Chandra Manchala
a81a2fed42 qcacmn: Add hal_rx_mpdu_get_addr2 API
Implement hal_rx_mpdu_get_addr2 API
based on the chipset as
the macro to retrieve addr2 value is
chipset dependent.

Change-Id: I4026db892d4f2f41db72c50f780ba898b8a17fa7
CRs-Fixed: 2522133
2019-10-17 15:08:31 -07:00
Venkata Sharath Chandra Manchala
e3ae3193f9 qcacmn: Add hal_rx_mpdu_get_addr1 API
Implement hal_rx_mpdu_get_addr1 API
based on the chipset as the macro to
retrieve addr1 value is
chipset dependent.

Change-Id: I7ed88f2243d397c9d605a08d3b93e17f0004c63d
CRs-Fixed: 2522133
2019-10-17 15:08:22 -07:00
Venkata Sharath Chandra Manchala
25ba7b8c4f qcacmn: Add hal_rx_get_mpdu_frame_control_valid API
Implement hal_rx_get_mpdu_frame_control_valid API
based on the chipset as the macro to retrieve
frame control valid value is chipset dependent.

Change-Id: I49d16ae44b2e9567ff746d2088058f0c1025ea40
CRs-Fixed: 2522133
2019-10-17 15:08:12 -07:00
Venkata Sharath Chandra Manchala
1e3a479fdf qcacmn: Add hal_rx_mpdu_get_fr_ds API
Implement hal_rx_mpdu_get_fr_ds API
based on the chipset as the macro to
retrieve for_ds value is chipset
dependent.

Change-Id: I6d41d02ac50cae752567d98645f0447cc122a84f
CRs-Fixed: 2522133
2019-10-17 15:08:06 -07:00
Venkata Sharath Chandra Manchala
e7924fd2da qcacmn: Add hal_rx_mpdu_get_to_ds API
Implement hal_rx_mpdu_get_to_ds API based
on the chipset as the macro to retrieve
to_ds bit value is chipset dependent.

Change-Id: I36d9d14e226bcc604b91d8aecbe52836c5a12272
CRs-Fixed: 2522133
2019-10-17 15:07:57 -07:00
Venkata Sharath Chandra Manchala
96ed623043 qcacmn: Add hal_rx_mpdu_start_sw_peer_id_get API
Implement hal_rx_mpdu_start_sw_peer_id API
based on the chipset as the macro to retrieve
sw_peer_id value is chipset dependent.

Change-Id: Ifebaf2430731f5e0593dde4789d721e9fe7ce7c1
CRs-Fixed: 2522133
2019-10-17 15:07:50 -07:00