Commit Graph

1577 Commits

Author SHA1 Message Date
Nandha Kishore Easwaran
3232a8d88b qcacmn: Process lmac rings in polled mode
Add code to process lmac rings in polling.
Lmac rings can be switched between polling and interrupts
by using lmac_polled_mode flag in dp_soc.

Change-Id: I231e906930c9b42100a2df3e52acac97deba1c34
2020-01-13 15:18:46 -08:00
Nandha Kishore Easwaran
bd98e6205e qcacmn: Create new interrupt mask for msi
Created a new interrupt mask for msi chipsets so that both ahb
and pci chipsets can work together.

Change-Id: I78d1b9641e58f07d1582152c691c5ae29e6ddb03
2020-01-13 15:18:31 -08:00
Nandha Kishore Easwaran
1d9464d4fa qcacmn: Setting interrupt mode in soc_init
Setting interrupt mode in dp_soc_init as setting it in
dp_soc_attach is resulting in interrupt mode not set on
subsequent wifi down/up. soc_attach is called only in case
of wifi unload/load and not in case of wifi down/up.
Adding interrupt mode setting in soc_init helps in setting
correct interrupt mode in case of wifi down/up.

Change-Id: I9e6ad94e42b7bc2bf84f832ece8dc8779e335905
2020-01-13 15:18:17 -08:00
Linux Build Service Account
2105b28e4c Merge "qcacmn: Reduce excessive console logging" 2020-01-12 19:35:57 -08:00
Sravan Goud
c064fc3b4a qcacmn: Reduce excessive console logging
There is excessive console logging in case of peer or vdev
null in mic error handling and wbm err processing in softirq
context which is delaying the interrupt to get enable and as a
result host is slow in reaping the wbm2sw3 ring. This leads to
wbm2sw3 ring full back pressure at FW and finally FW asserts.
As part of this change reduce reduce the error logging level from
err to info and for MSM info goes to the wifi logger logs and not
to the console.

Change-Id: I9b8be1feee5e807cecbe307b24a323e2b0ae631a
CRs-Fixed: 2596656
2020-01-12 17:01:25 -08:00
Jinwei Chen
5d2b019ea4 qcacmn: WAR for monitor mode HTT msg sending failure
If two back to back HTT msg sending happened in short time,
the second HTT msg source SRNG HP writing has chance to fail,
this has been confirmed by HST HW.
  For monitor mode, HTT msg for monitor status ring configuration
is the last msg for sending, if the 2nd HTT msg for monitor status ring
sending failed, HW won't provide anything into 2nd monitor status ring.
  as a WAR, add some delay before 2nd HTT msg start sending, > 2us is
required per HST HW, delay 100 us for safe.

Change-Id: Id2a5a8798fde79267f9d6f9ba23d8ed54a400aa7
CRs-Fixed: 2597248
2020-01-12 13:21:06 -08:00
Sravan Goud
d207ff2e28 qcacmn: Provide vendor extended stats from host
Currently in lithium FW is not always in datapath. As a result
can not provide all the wlan vendor extended stats. So as part
of this host provides some of the extended stats.

Change-Id: I876b6e905f7e25b7088f80f07e55e26a7a409241
CRs-Fixed: 2594797
2020-01-12 06:24:30 -08:00
Chaithanya Garrepalli
79b64ac4ba qcacmn: fix potential memory leak in dp_rx_process
There is a chance of leak of RX buffers if peer disconnects
while we are in middle for processing the list of MSDUs in a
AMSDU

Change-Id: I0081ec96da95ea570903dbd5d91c866c8c141667
2020-01-11 22:28:04 -08:00
Linux Build Service Account
131bc0cd37 Merge "qcacmn: CFR: Process PPDU status TLVs and extract CFR information" 2020-01-11 20:06:29 -08:00
Venkata Sharath Chandra Manchala
09d116aee9 qcacmn: Avoid invalid invalid_peer_head_msdu list
Add a check to validate invalid_peer_head_msdu before accessing
to avoid NULL dereference.

Change-Id: I9218bdd1100b48a32240546f380b1437ae72c406
CRs-Fixed: 2585651
2020-01-10 20:12:26 -08:00
Padma Raghunathan
fe453dfd10 qcacmn: CFR: Monitor/Data ring filter settings
Channel Frequency Response(CFR) captures FFT bins corresponding to a PPDU
received and this is relayed to user space application. Since FFT bins
alone will not be meaningful, additional information about the PPDU such
as Peer addr, BW, NSS, etc are extracted from multiple PPDU status TLVs
and passed on to userspace along with CFR data.

Host RX monitor status ring is configured during CFR enable and the host
subscribes to relevant PPDU TLVs that provides all necessary information
for CFR data correlation.

Change-Id: Ia8080fe96c330db42d371634ba4363eb36c05402
CRs-Fixed: 2593416
2020-01-09 10:34:29 +05:30
Amruta Kulkarni
0f0a36c8d4 qcacmn: Change info/err prints to debug in roaming path
The printk buffer is protected by a global raw spinlock for readers
and writers. This restricts the contexts that are allowed to
access the buffer. So large latencies exists when printing to
kmsg done with QDF trace levels WARN, INFO, ERROR. This results
in roaming KPI for maximum transition time exceeding the expected
100ms.
So change info/err prints to debug prints in roaming path
to reduce delays in roaming time.

Change-Id: I9cdf043da6e88d735ab39812e74ed24784ceede3
CRs-Fixed: 2594867
2020-01-08 20:11:15 -08:00
Jinwei Chen
0181445b71 qcacmn: fix dp_tx_desc invalid accessing due to race condition
crash scenario:
  a. dp_tx_vdev_detach will reset the vdev of TX desc to NULL
by dp_tx_desc_flush.
  b. in the meantime, if TX completion is coming and when all TX desc
is recycled, the pool will be freed if pool status is invalid before.
  c. invalid TX desc accessing will happen in (a).

add TX desc pool lock protection in dp_tx_desc_flush.

Change-Id: I65c570aa6a3044a478dbe51bbf396cf24612f675
CRs-Fixed: 2595755
2020-01-04 22:12:21 -08:00
Adil Saeed Musthafa
e76b6f2458 qcacmn: command to modify OMN timer, primary IF in dynamic mode switch
* Add command to modify OMN (Operating Mode Notification) timer value for
hw-mode switch. These commands can enable/disable the sending of Opmode
IEs in the beacons after HW mode switch and also configure the time for
which the IE will be sent after the switch.

* Add command to change primary interface when switching dynamically to
DBS mode.

Change-Id: Iceb8e29a46fa4873d3cbd7e41ec0da3782a5dd22
CRs-Fixed: 2560684
2020-01-03 20:04:15 -08:00
Rakesh Pillai
ae0f601eac qcacmn: Ratelimit error log for REO CMD send failure
REO CMD send failure floods the console with error logs.

Ratelimit the error log for REO CMD send failure
and increment stats to keep track of the number of
failures.

CRs-Fixed: 2593996
Change-Id: Id415a17b1ba1f4c044bf34eb31e81e2cea825f80
2020-01-03 07:48:31 -08:00
Jinwei Chen
1d2e65a76c qcacmn: fix STA + SAP IPA de-frag issue
Currently wlan host will re-inject defrag data with RBM 6 to
REO, this data buffer will go to REO-->REO2SW4-->IPA-->FW2RXDMA,
fix below issue introduced by this RX buffer path.
a. FW assert due to FW2RXDMA DMA address not 4 bytes aligned.
b. host skb double allocation due to qdf_nbuf_linearize() for frag skb.
c. Invalid RBM 6 for fragment RX due to RX buffer resue.

Change-Id: I36d831fc14b6b9aa0cea32682823de348f7eecd3
CRs-Fixed: 2591453
2020-01-03 04:43:01 -08:00
Chaithanya Garrepalli
3583cfb2c9 qcacmn: always match vdev_id to search from peer from hash
In vdev to vdev roaming on HKv2 we can have dp peer on
different LMACs with same mac address. To get the right
peer on PDEV use id match while searching from hash table

Change-Id: I60b4d7018120c9bd6a56913822ce42f24598184a
2019-12-31 02:44:30 -08:00
Chaithanya Garrepalli
52511a17d1 qcacmn: check for vdev_id mismatch to deliver NBUFs to stack
Check for vdev_id mismatch to deliver NBUFs to stack to avoid
hold peer reference while giving nbuf list to stack

Change-Id: Ic475e00d5b1793ada7b26b7af3322ca2fa51836f
2019-12-31 01:24:43 -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
Vevek Venkatesan
27e7bb4d79 qcacmn: cdp: Converge cdp_cmn_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- txrx_peer_unmap_sync_cb_set
- txrx_fw_stats_get
- txrx_get_ctrl_pdev_from_vdev
- txrx_get_mon_vdev_from_pdev

Change-Id: I4472dc0905edb7700acb4401b117c8876ba455f3
CRs-Fixed: 2541460
2019-12-27 03:25:49 -08:00
Pavankumar Nandeshwar
a234716d1d qcacmn: cmn_ops changes in datapath for umac-dp decoupling
Change cmn_ops APIs to replace pdev, vdev and peer
dp handles with pdev_id, vdev_id and peer mac address
along with dp soc handle

Change-Id: I5716a87cad56b1dfe8dd56f193bbb6ff923a6af1
2019-12-27 03:24:59 -08:00
Surya Prakash Raajen
bf5195f2e6 qcacmn: Memory optmization of Node/peer structure variables
Remove unused variables and reduce the memory by
the structure padding.

Change-Id: I8feca8b6e3c340601a2097ccf6ce18d5840f29b9
CRs-Fixed: 2587049
2019-12-27 01:40:32 -08:00
Tiger Yu
dc29b1f9d7 qcacmn: Limit logging when handling tx comp status if vdev is NULL
Use dp_info_rl instead of QDF_TRACE when handling tx completion status to
avoid excessive logging when vdev is destroyed in the another thread.

Change-Id: I1044c6d747ba1c7036664fe0265ec4855b7b4c47
CRs-Fixed: 2591486
2019-12-25 01:51:21 -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
Ruben Columbus
1bec34c1e4 qcacmn: add ppdu_desc to cdp_tx_indication_info
ppdu_desc contains more information that is relevant to radiotap.

Change-Id: Ie2d0d53027958edf0a1032b270b7a8339b849924
2019-12-23 01:20:33 -08:00
nobelj
0e00776f45 qcacmn: support flush tlv in tx capture
update ppdu desc member based on flush tlv field
to support tx capture feature.

Change-Id: I9c5bc3a1ccce935d6be63556c025997d01fb6d4b
2019-12-22 23:51:34 -08:00
nobelj
182938a5b0 qcacmn: Modify timestamp to support 64 bits
modify Tx timestamp to support 64 bits value

Change-Id: I1c032b2e07a5bae94ec3a58d33dd9340f95a622e
2019-12-22 23:51:19 -08:00
nobelj
cf57a9af2a qcacmn: support 64 bits timestamp in wmi mgmt completion
added support for 64 bits timestamp that come for each tx
wmi mgmt completion

Change-Id: I70d66bcbe04aebad507a872faa97df8ab9752657
2019-12-22 23:51:04 -08:00
Saket Jha
6ef034094f qcacmn: Initialize qdf_nbuf_t before use
Initialize qdf_nbuf_t variables before use.

Change-Id: I4922de4c9f31c98dc745802dbb23a0757795769d
CRs-Fixed: 2587451
2019-12-20 20:06:36 -08:00
nobelj
219e7e57e2 qcacmn: Fix NULL data Tx frame capture
Handle ppdu descriptor for NULL data frame as payload come
mgmt payload tlv.

Change-Id: I0d9322c8132dc520d0274b9cf1abcf3018469bf7
2019-12-19 10:25:51 -08:00
nobelj
4771edbadc qcacmn: support for tx capture stats
added support to print debug stats for tx capture

Change-Id: Id5533e076f9b5d3f15a392f61b4af5fdffa9efb0
2019-12-19 10:25:35 -08:00
Jinwei Chen
5bd952ce05 qcacmn: fix srng lock hold long time due to logging
when lot of fragment frame with invalid peer_id indicated to
host through reo exception ring, excessive logging cause srng
lock hold long time.
  degrade log level as a WAR to avoid excessive logging.

Change-Id: Iffb18ad723d1ac5955868cc8ec99bb0198785ee5
CRs-Fixed: 2584610
2019-12-19 03:05:15 -08:00
nobelj
68930ca688 qcacmn: tx capture update bar frames
as we are overriding bar ppdu information, we need bar start/end
timestamp and duration.
added resp_type, mprot_type, rts_success and rts_failure in
cdp completion user.

Change-Id: I53c215e948fad8d079e1d4c40ec07d34aff1fefe
2019-12-18 18:57:41 -08:00
Sumedh Baikady
48fdc2ddfb qcacmn: Add out of band advertisement in 6Ghz
Add WMI and objmgr support for maintaining RNR
buffer cache and receive tbtt events for all
vdevs using existing tbtt offset WMI.

Change-Id: Idfed63e104e629fbe455d1cf6202cd9b332f5cf9
2019-12-18 11:13:36 -08:00
nobelj
c5cb3bf9c5 qcacmn: multiple update of tid for same ppdu stats
remove multiple update of tid for same ppdu stats.
tid is populated from user rate, completion common and
ack ba status tlv. As tid from ack ba status tlv comes wrong
for non-qos tid. we remove the tid populate in ack ba status tlv.

Change-Id: Ia8b0004fc329bf0fecc1a622e199635034c213a7
2019-12-17 01:38:27 -08:00
Yue Ma
9c43a47af0 qcacmn: Clean up channel number usage for CDP API
For cdp_hl_fc_set_td_limit() API, use channel frequency instead of
channel number.

Change-Id: I852f1fc192374a4b603e615664d7fb27ea984f5f
CRs-fixed: 2565737
2019-12-16 19:46:13 -08:00
Mohit Khanna
82382b32e9 qcacmn: Handle BAR OOR/2K_JUMP REO errors
Currently in dp_rx_wbm_err_process, we donot handle
HAL_REO_ERR_BAR_FRAME_2K_JUMP and HAL_REO_ERR_BAR_FRAME_OOR REO errors.
Add support for the same.

Change-Id: I22147fcd2d531c1e08214626796994593ffeb3a6
CRs-Fixed: 2580876
2019-12-16 14:20:15 -08:00
Ruben Columbus
282f3a5ce1 qcacmn: RSSI averaging function accuracy
improvement on function for avergaging rssi accuracy

Change-Id: I4fb231aacb2ed76a2e5e1b5843a8b095e9901406
2019-12-13 12:15:02 -08:00
nobelj
ab929fe416 qcacmn: update tlv bitmap check and fix retries counter
expected tlv bitmap can't be guaranteed as different ppdu frame has
different expected tlv bitmap. Check last tlv before sending stats
as tlv are coming from firmware in sequential order.

retry counter is not populate correctly, only successful
completion ppdu status get update

Change-Id: Ia4b71371bbf38996df9dbb67746078d5fbd628a1
2019-12-12 18:32:25 -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
phadiman
a73cc69157 qcacmn: Fix pool alloc issue in detach path
Memory is freed and allocated only during
wifi load and unload in case of WIN and not
during wifi up/down

Calling dp_tx_soc_detach unconditionally
was leading to memory free in wifi down
path and when wifi up was issued the
memory which was freed was never allocated

Call dp_tx_soc_detach conditonaly only for
MCL in dp_soc_cmn_cleanup and for WIN in
dp_soc_detach using dp_soc_reinit flag which 
is set for WIN during wifi unload

Change-Id: I9da34f7945d65a34e719c7db58da13e85ae3d228
2019-12-12 18:15:18 +05:30
Pavankumar Nandeshwar
e54c584723 qcacmn: Decoupling changes for stats, wds, raw and pflow ops
Change cdp_host_stats_ops, cdp_wds_ops, cdp_raw_ops
and cdp_pflow_ops APIs to replace pdev, vdev and peer
dp handles with pdev_id, vdev_id and peer mac address
along with dp soc handle.

Change-Id: Ia956882535cc04e57a006905d46ccfe9d95bb731
2019-12-10 19:40:36 -08:00
Jeffin Mammen
084f936b71 qcacmn: Correct message in backpressure event
Correct the debug message to print the appropriate
ring id when backpressure events are reported

Change-Id: I4cb2af9c802469ecd0c38bdd3789439048de876f
CRs-Fixed: 2556208
2019-12-10 04:21:43 -08:00
Tiger Yu
1e974a9312 qcacmn: Reset ba_status to inactive irrespective of tid update status
Reset ba_status to inactive irrespective of tid update status to make
sure the ba_status reset successfully.

And also use pe_err_rl instead of pe_err to avoid excessive logging.

Change-Id: Ifc6adc166b5093742b34dd7d74924f9d54146ea4
CRs-Fixed: 2577663
2019-12-09 20:38:41 -08:00
Alok Kumar
3d15ae8780 qcacmn: Define CDP Ops for packet capture mode
Define CDP Ops for packet capture mode

Change-Id: If08191f47060210f4340940d01be8eb2cf8cc426
CRs-Fixed: 2528432
2019-12-09 17:29:15 -08:00
Jinwei Chen
9012d61d31 qcacmn: fix invalid accessing to rx_desc_status pool
crash scenario:
a. pktlog is enabled, the timer mon_reap_timer is active,
   reap mon_status_ring hal desc periodically.
b. rx_desc status pool is freed in dp_rx_pdev_mon_detach() when do
   dp_pdev_deinit() while the mon_reap_timer is still active until
   dp_rxdma_ring_cleanup() free it.
c. during the timeslot between dp_rx_pdev_mon_detach() and
   dp_rxdma_ring_cleanup(), if some hal desc is pending to be
   processed on mon_status_ring, invalid accessing to rx_desc_status
   pool happened.

solution:
  if pktlog is enabled, stop mon_reap_timer ahead of
dp_rx_pdev_mon_detach() in dp_pktlogmod_exit().

Change-Id: I91b16a88a5e4390587925d6eb2840b3ec1ec2187
CRs-Fixed: 2579817
2019-12-09 01:31:20 -08:00
Mohit Khanna
918456b6c3 qcacmn: Use HAL_RX_BUF_RBM_SW3_RBM for defrag pkts
Currently defragmented packets use HAL_RX_BUF_RBM_SW1_RBM as the RBM
value for the defragmented packets which are re-injected into REO.
Thus, if REO encounters any error while handling these packets, they
would end up in WBM2SW1 ring (via WBM), which is managed by the FW. The
FW will eventually recycle these buffers back to RXDMA via its refill
process. As a part of defragmentation, host does a 802.11 -> 802.3
header conversion. This is resulting in an address which is not 4
byte aligned. Hence, when RXDMA tries to use these addresses (after FW
recycles them), it may lead to issues.

Change the RBM value of the defragmented buffers which are
re-injected. Now, if REO ends up throwing an error for these
packets, they wll end up in WBM2SW3, which is managed by the host.
The host can then drop these packets and replenish RXDMA with 4 byte
aligned buffers (via FW).

Change-Id: I9d9c25385978d5be855699feb28d292c6f3fffdd
CRs-Fixed: 2572483
2019-12-07 04:22:09 -08:00
Jinwei Chen
fbd48efe1c qcacmn: fix dp vdev use after free for monitor mode
Crash scenario:
a. monitor mode dp_vdev is freed in dp_vdev_detach_wifi3 without
   checking whether any dp_peer is associated.
b. monitor mode self dp_peer do peer clean up when HTT peer
   unmap MSG received, invalid accessing to dp_vdev as it has been
   freed in step (a).

Check if there is dp_peer associated for monitor mode dp_vdev,
skip dp_vdev free, when all dp_peer is freed, dp_delete_pending_vdev
will free dp_vdev.

Change-Id: Iea4b0efc6e7bbd4109d9cd0b109dfddf727a9fff
CRs-Fixed: 2576604
2019-12-06 01:52:39 -08:00
Yeshwanth Sriram Guntuka
65d547730f qcacmn: Cleanup local peer id from DP APIs
Local peer_id is being cleaned up across DP, HDD and PS/WMA.
So, any references to local peer_id/sta_id will be replaced
by peer mac address and all interactions between the layers
will be based on peer mac address.

Cleanup local peer id usage from DP APIs.

Change-Id: I930e1c6a09092a373c093239632d6f310fee18e2
CRs-Fixed: 2529041
2019-12-06 01:52:16 -08:00
Yeshwanth Sriram Guntuka
92aa901f84 qcacmn: Cleanup unused DP APIs [PEER_ID_PHASE2]
Local peer_id is being cleaned up across DP, HDD and PS/WMA.
So, any references to local peer_id/sta_id will be replaced
by peer mac address and all interactions between the layers
will be based on peer mac address.

Cleanup unusued DP APIs which are based on local peer_id.

Change-Id: Idd95bc640ca7e36a427be7202935034d4ed58979
CRs-Fixed: 2529026
2019-12-06 01:52:01 -08:00