Nbufs are reused on non-monitoring status ring, so stale
values will still be present in the status ring nbufs post
channel change. A possible scenario where after mon channel
is changed to 5G from 2G, MAC-0 status ring is processed and
buffer_done tlv tag could be read from the stale nbuf even
though HW does not set this for the latest packet. This could
result in un-map and free of the status_nbuf even before HW
updates the buffer_done tlv tag.
Fix is to replenish buffers instead of re-using the buffers
when reaping non-monitoring status ring.
Change-Id: I239ddae04a57ee1078a6b7399d659ae1295276b5
CRs-Fixed: 2806422
In dp_mon_status_srng_drop_for_mac, the rx_desc pool
used for status ring is dest ring desc pool which is
not the appropriate one.
Fix is to use the appropriate desc pool for mon status
ring.
Change-Id: I6f178354789212b375a7a541366bef590a925568
CRs-Fixed: 2800658
Add log limit to error "DMA not done" when reaping Monitor status ring
to avoid flooding other useful driver log.
Change-Id: I251ef8082d49bfdbcc6a234224cbefdba608b5f5
CRs-Fixed: 2798732
In monitor mode, if channel is initially configured from 5G
band and then moved to channel from 2G band, packets are still
received on MAC-0 RXDMA2SW ring since IMPS is disabled for both
MACs. Since driver reaps only MAC-1 RXDMA2SW ring, ring full
condition is hit for the MAC-0 ring causing ring backpressure.
Fix is to drop packets received on the non-monitoring MAC
ring.
Change-Id: I49cb276827f4a06791183ee3fe8c88ba84df085d
CRs-Fixed: 2791341
While processing monitor status srng when DMA is not done
for current peeked HP+1 and DMA is done for HP+2 then nbuf
at HP+1 is freed without processing. But nbuf should be unmapped
before freeing. So unmap nbuf then proceed for freeing.
Change-Id: I9e808a7c9b6452d6b6e1fddc49fb08871c8c90f9
CRs-Fixed: 2785364
Reserve 128 bytes headroom for monitor status buffer
to accomadate feature specific radiotap header or any other info
in the headroom.
CRs-Fixed: 2775118
Change-Id: I2b1aba26e565b58c48a2e24ad17965aacd6b4526
STATUS_BUFFER_DONE tlv written in first word for a status
buffer indicates that DMA is done for that status ring entry.
In existing implementation, for a status ring entry if
STATUS_BUFFER_DONE tlv is not written by HW, we poll on to status ring
entry until DMA is done by HW.
During lmac reset it may happnen that HW will not write STATUS_BUFFER_DONE
tlv in status buffer, in that case we end up polling infinitely leading
to backpressure on monitor status ring.
As per MAC team's suggestion, when HP + 1 entry is peeked and if DMA
is not done and if HP + 2 entry's DMA done is set,
replenish HP + 1 entry and start processing in next interrupt.
If HP + 2 entry's DMA done is not set,
poll onto HP + 1 entry DMA done to be set.
CRs-Fixed: 2740988
Change-Id: Ieef667f0bb4a47e74fc320c93243c637409f47f0
As index based search is protected with refcnt now
reverting the changes which are added as a WAR to protect
peer memory
Change-Id: Iac837d45d0d4b2509bbf7d60401d9497c0d998b0
Remove the peer backpointer in ast entry and store
peer_id instead
Assign peer_id in AST entry in AST MAP event,
also add the ast entry to peers ast list
In AST map & AST unmap APIs use ast find by vdev_id
Change-Id: I74d9828dc309149d98f6f577b5c8304cb087fd76
Add support to get the peer reference with module id
To help debug the peer reference related issues
Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
Peer wlanstats context was accessed directly from
PPDU cookie, with this approach the cookie pointer
may become stale if peer goes for deletion
Hence access the wlanstats context using CDP API
with stats context protection
CRs-Fixed: 2740261
Change-Id: I54c785325f8852ad422f05527b98ebca6e4d6cf0
Memory optimization of monitor status ring by allocating buffers during
replenish using alloc_skb (linux API).
It creates buffer of required size rather than 4k size(dev_alloc_skb)
Change-Id: I3ae5e403de28c4570f8ac3b50d3ca878a9e4b2f9
CRs-Fixed: 2733931
Rx desc pool have a flag to identify whether frag or nbuf
operation needs to be performed for alloc, map, prep and
free buffer for monitor dest buffer.
This flag will be set only for mon destination desc pool,
if RX_MON_MEM_FRAG feature is enabled.
In all other case, It will be set to Zero and default nbuf
operation will be taken.
This flag get initialized at the time of pdev rx_desc_pool
initialization and gets reset while pdev deinit.
Mon destination buffer will have support for frag if
RX_MON_MEM_FRAG flag is set.
Change-Id: I67c6c823ee4f114035b884c024a1a9054a40665b
CRs-Fixed: 2741757
When matching ppdu_id is detected during HAL processing, then print the
error message instead of going for assert.
Change-Id: I8f58359a66fbeaf2ebc98477f65bab446c0a784b
CRs-Fixed: 2747953
In monitor mode, radiotap header contains VHT/HE information in management
and control frames after association of STA to AP.For this,reset of
ppdu_info is required before processing of ppdu in order to avoid reuse
of ppdu_info.
Change-Id: Ia36ec2664f79d645ff76db016f986dfb92ec8bbd
CRs-Fixed: 2734804
wdi event handler take host pdev id. Convert lmac/target pdev id to host
pdev id for wdi event handler.
Change-Id: Iaf1f3e77055be0178d810d960924ca618b334fd2
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
In DP while handling ppdu stats, we call qdf_nbuf_put_tail
and proceed with updating the nbuf data whithout a check on
the return status of qdf_nbuf_put_tail.
If the qdf_nbuf_put_tail API failed, would free the nbuf
and subsequent updates to the nbuf would result in use
after free, which is resulting in memory corruption.
Add check to verify the return status of qdf_nbuf_put_tail
and proceed accordingly.
Also while updating the ppdu stats, ensure the num of users
of ppdu is checked against the max number of users defined.
CRs-Fixed: 2678258
Change-Id: I00b661fdb342d31563506f93abd63673af8ede55
In lithium a peer will have only single peer_id hence remove
peer_ids array from dp_peer structure
Change-Id: Ib98270b7fd98f1199b862e4608f990687914b7cc
Currently computation of Rx rate depends on SU MCS
and SU NSS for SU PPDU. For SU PPDU, incorrect SU NSS leads to
incorrect computation of Rx rate.
To fix this, use respective PPDU information(MCS and NSS) and
calculate Rx rate based on proper SU NSS.
Change-Id: I754a7ecd57ec02d33f211937b7ffd025278d1e05
CRs-Fixed: 2668760
The status nbuf replenish can fail in low memory
scenario, and the error logging can flood the console.
Ratelimit the status nbuf allocation failure logging.
Change-Id: I8e26b1060fdca62d36236f2d57fbbf7be165e3c6
CRs-Fixed: 2678202
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
Currently, mcopy mode delivers first msdu(fcs_passed 128 bytes) per-ppdu
to upper layer, add support for Extended mcopy mode to deliver first
msdu(128 bytes) per-MPDU(fcs_passed).
Change-Id: Ib345fc14a8d468788b9de78516d27e8dff24caa4
CRs-Fixed: 2644175
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
For qcn9000 in case of monitor mode, reap monitor destination
ring first and status ring later to avoid backpressure
on monitor destination ring
Change-Id: I4e1931afe0453221f1326ca7bdb7f0273cc7363d
CRs-Fixed: 2670656
Restrict DMA Map/UnMap upto buffer size for packets in rx process.
This gives 2-3% cpu gain in peak throughput.
Change-Id: Iaf5e9f6f734d80b6d2c234bd8e679cf2a81c7e2c
CRs-Fixed: 2660698
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
d. Remove WAR to skip status ring entries if DMA is not done
Change-Id: I60b8e7c075253d37e6b849a9b24f473c5afce82c
CRs-Fixed: 2626049
Retrieve peer from mac address to avoid accessing peer
even if peer is deleted.
Change-Id: I1c9740fc5d3090ef296c4dc4a5afe7022e83dca5
CRs-Fixed: 2663836
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
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
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
Move RCC specific debug statistics to Data path
to avoid allocating nbuf for the PPDUs for which
MAC has not sent a Freeze TLV. Instead just update the
debug statistics at an earlier point irrespective of
MAC sending Freeze to PHY, to gather below information:
Status of number of PPDUs being captured by PHY
Status of MAC sending freeze TLV for the PPDUs
Update freeze reason for the number of PPDUs received
Add support to clear debug statistics at user's will.
Change-Id: I8def3ce1f3ecc0b169030704db3fb1fb1c0a20ee
CRs-Fixed: 2609604
Currently computation of Rx rate depends on Multi-user MCS
and NSS even for SU PPDU. For Single User PPDU, this becomes
invalid since computation of Rx rate should be based on SU MCS
and NSS.
To fix this, use respective PPDU information(MCS and NSS) and
calculate Rx rate based on ppdu_type.
Change-Id: Ic18cbabe192e2cafce5cdceb5644368ff6b7c9fb
CRs-fixed: 2617063
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
Peer id field is set to HTT_INVALID_PEER when failed to
populate cdp rx indication structure.Set num_user to 0 in
such cases.This avoids out of bound access during rx stats
update.
Change-Id: I112713deee1ec3cb9c37ba3571aff05fb816c76d
CRs-Fixed: 2596779
1. Move all LMAC rings to SOC from pDEV
2. Dynamically obtain lmac->pdev mapping while handling LMAC interrupts
Change-Id: Ib017d49243405b62fc34099c01a2b898b25341d0
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
CFR has specific modes where status TLVs from non-associated
clients will be used for correlation with CFR data. In the
common API used by STATS and CFR, add an exception for CFR to
collect the necessary PPDU information. STATS on the other hand,
does not collect information from non-associated clients.
Change-Id: I2987010ae84ff02a25bfce5cc77bbc3e5383560b
CRs-Fixed: 2598547
CFR information extracted from PPDU status TLVs is already stored in
HAL ppdu structure. Extract the same and copy it to CDP ppdu structure.
This is delivered to subscribers through a WDI event, similar to PPDU
stats.
Change-Id: I4315626c7f79f85b75b8d1b9e1e5caf8d65abed9
CRs-Fixed: 2593416
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
add 1 to nss value received from software response reference pointer.
ofdma_info_valid bit need to set zero.
populate ru_size from software response reference pointer.
Change-Id: Iea2019211902a468d8fd180423b3dedb4c04ce41
Currently for averaging rssi we do not add per_bw_offset to SNR,
add per_bw_offset value to SNR to compute avg_rssi
Change-Id: I451f90e5794235c7466f3c4f1850df246e719d0a