Commit Graph

605 Commits

Author SHA1 Message Date
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
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
Pavankumar Nandeshwar
4c7b81b540 qcacmn: removal of cp handles and changes for ol_if_ops
Remove pdev and vdev control path handles from data path.
Instead send pdev_id and vdev_id along with opaque soc
handle in ol_if_ops.

Change-Id: I6ee083f07e464f283da0d70ada70a4e10e18e1b2
2019-12-04 07:45:10 -08:00
Pavankumar Nandeshwar
715fdc32ec qcacmn: remove ctrl_peer handle from dp peer
Remove ctrl_peer handle from dp peer and instead
use peer's mac address

Change-Id: I9e24fa94248749f9b4859bce4a1d79d70f32507e
2019-12-04 07:44:21 -08:00
Venkata Sharath Chandra Manchala
fb323024ac qcacmn: Avoid freeing the lock
Avoid freeing flow_pool_array_lock when it is
not created. So free flow_pool_array_lock in 2
ways:
1. When dp_soc_cmn_setup fails free the flow_pool_array
   lock only if it is created and then close the dp
   soc handle.
2. As flow_pool_array_lock is created in dp_soc_cmn_setup
   as part of dp_pdev_attach_wifi3 init sequence free the
   lock only in the dp_soc_cmn_cleanup as part of the
   dp_pdev_detach_wifi3 deinit sequence.

Change-Id: Ie3e11da0bc0854fa550c5d417ca3c0bc9e2593b1
CRs-Fixed: 2565603
2019-12-04 03:37:28 -08:00
Chaithanya Garrepalli
b7796edd5b Revert "qcacmn: corrected the print statement"
This reverts commit I37a7c98eef6a8ad0b27541584927505ffc447cb2.

Reverting because below change address the compilation error
I4bb7bb14a2e521645be6e2677a44a78fa79fcb0b

Change-Id: Ib38276ab9974cf22486631f10ec345a629637b82
2019-11-27 07:05:15 -08:00
Alok Kumar
4c23054e43 qcacmn: Add support for DataStall Events
Register and de-register DataStall callback which posts
DataStall Events.

Change-Id: I078e34b0d476c350f175b797fd54a79789ca56f5
CRs-Fixed: 2561193
2019-11-26 02:16:17 -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
Jinwei Chen
490e7fd6b4 qcacmn: fix dp_vdev use after free caused by racing condition
crash scenario:
a. dp_peer_unref_delete remove peer from vdev->peer_list.
b. dp_vdev_detach_wifi3 skip setting vdev->delete.pending as
   vdev->peer_list is empty, dp_vdev is freed.
c. dp_peer_unref_delete still try to access dp_vdev after first
   peer_ref_mutex released, invalid accessing happened.

solution:
a. Get vdev member like vdev->delete.pending flag within
   first peer_ref_mutex in dp_peer_unref_delete to avoid vdev freed.
b. Separate dp_reset_and_release_peer_mem function into two function
   dp_vdev_reset_peer/dp_peer_release_mem, dp__vdev_reset_peer
   will be invoked within first peer_ref_mutex. after first
   peer_ref_mutex is released, invoke dp_peer_release_mem since dp_soc
   ->cdp_soc.ol_ops->peer_unref_delete should be outside of
   peer_ref_mutex in case deadlock issue reported from WIN.

Change-Id: I90f3b139030c5ce399d85723ae4f67ce0faf4b28
CRs-Fixed: 2568256
2019-11-22 00:27:54 -08:00
Amir Patel
fea17f4d75 qcacmn: Free status buffer queue at proper place
Currently after disabling mcopy mode, remaining status
buffers are not freed, free status buffers at proper place

Change-Id: I4a04a7ab58771ce1dd21f3ee08b42589f312eb76
2019-11-21 07:49:03 -08:00
Rakesh Pillai
1d4d12e0e9 qcacmn: cdp: Convergence of cdp_bus_ops
Currently the cdp apis 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/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.

Converged bus_ops
- bus_suspend
- bus_resume

CRs-Fixed: 2539826
Change-Id: Id4d6ba16beae89f4052e72024ef8ce891ea33715
2019-11-21 06:12:58 -08:00
Rakesh Pillai
d295d1e81d qcacmn: cdp: Convergence of cdp_misc_ops
Currently the cdp apis 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/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.

Converged misc_ops
- tx_non_std
- get_opmode
- get_tx_ack_stats
- set_ibss_vdev_heart_beat_timer
- hl_tdls_flag_reset
- set_wisa_mode
- txrx_post_data_stall_event
- update_mac_id
- pkt_log_init
- pkt_log_con_service
- get_num_rx_contexts
- set_wmm_param
- flush_rx_frames
- bad_peer_txctl_set_setting
- bad_peer_txctl_update_threshold
- txrx_data_stall_cb_register
- txrx_data_stall_cb_deregister
- vdev_set_driver_del_ack_enable
- get_intra_bss_fwd_pkts_count
- mark_first_wakeup_packet
- register_pktdump_cb
- unregister_pktdump_cb
- pdev_reset_driver_del_ack
- runtime_suspend
- runtime_resume

CRs-Fixed: 2539811
Change-Id: I3080df033d6411d7078a322224b914bda2fddc0e
2019-11-21 06:12:31 -08:00
Chaithanya Garrepalli
60a154f99e qcacmn: corrected the print statement
Corrected print statement to dump AST entries

Change-Id: I37a7c98eef6a8ad0b27541584927505ffc447cb2
2019-11-20 05:51:46 -08:00
Rakesh Pillai
3f13c071b9 qcacmn: Fix compilation errors in DP_PRINT
Fix compilation error in DP_PRINT which is
seen when compiled for lithium datapath.

CRs-Fixed: 2567068
Change-Id: I4bb7bb14a2e521645be6e2677a44a78fa79fcb0b
2019-11-18 10:33:17 -08:00
Rakesh Pillai
2b88f071f9 qcacmn: cdp: Convergence of cdp_mob_stats_ops
Currently the cdp apis 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/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.

Converged mob_stats_ops
- clear_stats

CRs-Fixed: 2539824
Change-Id: Id424b939c8ef77bd9fae55eaa4c08023efc32093
2019-11-11 23:08:42 -08:00
Rakesh Pillai
e5430cb03e qcacmn: Handle vdev_id as parameter for txrx stats handler
The datapath vdev handle is not to be used outside
datapath layer. So the cdp api for getting txrx stats
will pass vdev_id instead of the vdev handle.

Pass vdev id instead of vdev handle for the cdp api
used to get txrx stats. Use the vdev_id to retrieve
the corresponding vdev handle in the txrx stats handler.

CRs-Fixed: 2560364
Change-Id: I57b6c6b232d122583e85929fa972d68bc54e84e0
2019-11-08 01:45:26 -08:00
Chaithanya Garrepalli
6bc8263586 qcacmn: do not store vdev_id in ast_entry
Remove the vdev_id feild from ast_entry structure

Change-Id: I0f79d13399212397c4c88aa5c39d422719a17137
2019-11-05 05:39:45 -08:00
Rakesh Pillai
534a143d8f qcacmn: Add support to flush rx packets for a vdev
When a particular vdev is deleted, the corresponding rx
packets which have been queued to the rx thread are not
flushed. Hence when such packets are submitted to the
network stack, the dev for this skb will be invalid,
since we have already freed the adapter.

Flush out the packets in the rx thread queues, before
deleting the vdev.

CRs-Fixed: 2543392
Change-Id: I2490d0f5ce965f62152613a17a59232521ca058f
2019-11-01 00:18:13 -07: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
Venkata Sharath Chandra Manchala
8a4812f7fc qcacmn: Enable TSO Stats for Lithium based products
Add support to account for TSO jumbo packets on the
Tx path and print the statistics using dumpStats 3.

Change-Id: I6cc446df5c84e3ac436d922935fcd559e0704ec5
CRs-Fixed: 2356244
2019-10-28 07:11:53 -07:00
Pavankumar Nandeshwar
5d3171d70e qcacmn: Add vdev_id to vdev_handle map in dp
Add a vdev_id to vdev_handle map in dp for faster
retrieval of vdev using vdev_id.

Change-Id: Ie19e09dd2e2b3d99317146d1b4cecdb5147a3cdd
2019-10-24 21:42:11 -07:00
Chaithanya Garrepalli
8b58459630 qcacmn: remove unused rx_opt_proc from dp_peer
Cleanup unused rx_opt_proc from dp_peer

Change-Id: I83401689f408f04c6f084dd83eb40dfacb295919
2019-10-22 12:46:13 -07:00
Jinwei Chen
13219389f1 qcacmn: fix compilation issue in dp_vdev_flush_peers
Fix compilation issue in dp_vdev_flush_peers.

Change-Id: I170398134d0a5eb30fecba78641fadfa2cfb236f
CRs-Fixed: 2545597
2019-10-19 19:25:47 -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
Jinwei Chen
a3e587120b qcacmn: flush pending vdevs and peers when do pdev deinit
Flush all the pending vdevs and peers when do pdev deinit

Change-Id: Id99ca5394bc96a07b75a44847dbc1c7681355265
CRs-Fixed: 2532199
2019-10-14 05:47:56 -07:00
Rakesh Pillai
ec9faaa73e qcacmn: Set interrupt mode during soc attach
Currently the interrupt mode is set as a part of
interrupt attach. The interrupt mode is needed for
pdev attach and hence it is decoupled from the interrupt
attach, setting the interrupt mode during soc attach.

Set the correct interrupt mode during soc attach.

CRs-Fixed: 2500015
Change-Id: I68496bed68cac5a2a2bd19adf2377bae7eb8783c
2019-10-14 05:47:50 -07:00
Sravan Kumar Kairam
78b01a1e1b qcacmn: Flush srng tp and hp only for flush event
Currently after runtime resume all SW2TCL data and reo cmd
srng rings hp and tp value are flushed. In case of IPA
offload case SW2TCL3 righ hp value will be updated by IPA
and not by host. In case of runtime pm enable host is
setting the value to zero as part of runtime resume which
results in incorrect hp value of SW2TCL3. As part of this
change set flush event for rings which are accessed by host
during link down state and after runtime resume flush the
rings for which flush event is set.

Change-Id: I5c9afa708277cf3a6e6d5ef99447bc21f88cfdcf
CRs-Fixed: 2514621
2019-10-12 22:16:04 -07:00
Rakesh Pillai
01b9b680fc qcacmn: Avoid REO destination change when IPA enabled in P2P mode
In cases where one of the interfaces is a P2P-GO and
IPA has been enabled, the P2P connection establishment
fails.

When IPA is enabled, the REO destination is changed to REO4
which can be reaped only by IPA module. But in case of P2P-GO
interface in operation, this change in configuration causes
all the RX packets to be stalled due to incorrect REO configuration.

Hence, to avoid this case, do not change the REO dest config
when the interface subtype is P2P.

CRs-Fixed: 2498315
Change-Id: Ie9f01c3b353c7c0503e1541d6c79c2f47c9782f3
2019-10-10 13:43:37 -07:00
Jinwei Chen
1c76e897e3 qcacmn: refine dp_vdev_flush_peers logic
Refine dp_vdev_flush_peers,
a. wrap ast entry flushing into dp_peer_flush_ast_entry()
b. if unmap_only is true, logic keep same.
c. if unmap_only is false, also use __dp_peer_find_by_id
instead of dp_peer_find_by_id to get peer object.
only if peer flag valid is true, then call dp_peer_delete_wifi3
to avoid peer member invalid accessing.

Change-Id: I7a6d53e124ff369305b91050731901ff0a43d6af
CRs-Fixed: 2534274
2019-10-10 03:17:47 -07:00
Nirav Shah
c806725022 qcacmn: Do not print periodic flow control stats
Do not print periodic flow control stats for lithium
data path.

Change-Id: Idc05417c23b4c5a3916a2a9fc433960e48d469fe
CRs-Fixed: 2535644
2019-10-09 19:10:53 -07:00
Karunakar Dasineni
13abde98f1 qcacmn: CDP interface to deliver Tx mgmt frames
Add CDP interface to pass on host generated mgmt
frames to DP, to be included in Tx capture.

Change-Id: Ic1a63c137ca546b0ad2b94d92fd5d489e9512a6f
2019-10-07 16:38:23 -07:00
Shashikala Prabhu
5d579844ba qcacmn: Change log level for Special vap channel change
During special vap channel change, we see "monitor vap already created"
print on the console. This is the expected print, because
pdev->monitor_configured is set during wifi up. Therefore, change the
debug level of this print from ERROR to DEBUG.

Change-Id: Ia290b74d9be20691eac3ebc50f6cc3fff3e94953
CRs-Fixed: 2529580
2019-09-28 08:11:15 -07:00
Kai Chen
99efa0dce4 qcacmn: Enable peer filtering for enhanced RX capture
Enable peer filtering for enhanced RX capture.

Change-Id: Ic8d27b575721f6fe3bae06ed7d23b1ff300306c9
2019-09-23 20:35:31 -07:00
Saket Jha
52e54333f4 qcacmn: Delete all peers during SSR
During SSR in dp_vdev_flush_peers function, the else condition finds peers
to delete by calling dp_peer_find_by_id. If the delete_in_progress_ flag
has already been set to TRUE, then dp_peer_find_by_id will return NULL
and not delete the vdev object. Calling __dp_peer_find_by_id will always
return peer id so all peers are sure to be deleted.

Change-Id: I86bf2bdda7ebc5a9c2f4bbc877392ebff9cbaf59
CRs-Fixed: 2513104
2019-09-16 17:23:27 -07:00
Chaithanya Garrepalli
11b7ea2bc5 qcacmn: pass client mac address also to nac rssi API
Add client MAC address while calling upper layers to
configure NAC RSSI

Change-Id: Ib7b0140ee4d194fe86c37d862fc6024b61481011
2019-09-12 01:46:32 -07:00
Shashikala Prabhu
8fe9679be0 qcacmn: Use qdf aligned mem alloc APIs in DP component
Replace dp_srng_mem_alloc() by qdf_aligned_mem_alloc_consistent() and
qdf_aligned_malloc() in dp_srng_setup().

Change-Id: Iae236a3cc19ec7a9f94b04382d37fc95e6ed622f
CRs-Fixed: 2462455
2019-08-28 02:39:37 -07:00
Sumeet Rao
2b730bbc76 qcacmn: Reorganize protocol and flow tagging changes to wifi-host component
Reorganize protocol and flow tagging changes to wifi-host component.

CRs-Fixed: 2501573
Change-Id: Ic6bc9548fd8bb66c2f8bae4740a4dcad4002f720
2019-08-22 12:35:28 -07:00
Sumeet Rao
3953e0ad69 qcacmn: Check nss enabled config before programming flow search table
In cases where NSS offload is enabled, we currently do not support
flow-based search (flow tagging). Check for NSS offload enabled flag
prior to configuring the flow search table in target/hardware.

CRs-Fixed: 2502311
Change-Id: I291c610fe568ac36bacb3c21fd14feb544332b20
2019-08-16 12:44:37 -07:00
phadiman
baaa7b98ce qcacmn: Replace %p with %pK format specifier
Replace %p with %pK specifier in dp_main
module

Change-Id: I637f5a4ddc827011aa48295ea50544632d1a9a76
2019-08-16 08:22:53 -07:00
Amir Patel
44bd807fa7 qcacmn: Fix memleak in m_copy mode
1. Assign correct first msdu payload
2. Reset mpdu fcs ok bitmap upon reception of next ppdu
3. Free rx_ppdu_buf_q in error cases

Change-Id: I4f2e687d51d1e10693adc9cfcdee49190ba6815c
CRs-Fixed: 2502889
2019-08-16 02:58:08 -07:00
Jinwei Chen
0f015f2b53 qcacmn: support changing driver mode to monitor
support monitor mode enablement by changing driver mode.

Change-Id: I5436b21f4f554101e74590757ed2ac05d2d84fa0
CRs-Fixed: 2491560
2019-08-16 02:58:05 -07:00
Rakshith Suresh Patkar
fb42ec3909 qcacmn: Cleanup dp_get_vdev_by_sta_id [PEER_ID_PHASE1]
Cleanup dp_get_vdev_by_sta_id to be peer mac address based
from local peer id based.

Also, modify the API cdp_peer_get_vdev_by_sta_id with additional
argument for peer mac address.
Rename cdp_peer_get_vdev_by_sta_id to cdp_peer_get_vdev_by_peer_addr.

Change-Id: I889538b5ea7ebac8973dcaaa5ebdad1ac495e791
CRs-Fixed: 2504569
2019-08-15 20:38:29 -07:00
Ankit Kumar
cd66fff1ce qcacmn: Process smart antenna fields from tlv
Process smart antenna fields from tlv
HTT_PPDU_STATS_USR_COMPLTN_COMMON_TLV in tx
completion path and export it to tx_completion.

Change-Id: If14e711b0aee8e583fd329f3c3915904649ffe47
CRs-Fixed: 2491429
2019-08-15 01:28:21 -07:00
Sumeet Rao
511db296dd qcacmn: Add CDP api to set rx_pkt_enable,tx_pkt_enable for a peer
Since tx_monitor mode and rx_monitor mode consume signficant MIPS
when enabled on a per-peer basis, new requirement is to enable such
functionality on a per-peer basis. New CDP APIs are added to set these
per-peer parameters.

CRs-Fixed: 2494471
Change-Id: Ib44845ec98481cc4df36c30f47335522e5274568
2019-08-14 14:30:23 -07:00
Mohit Khanna
698987c896 qcacmn: Send GRO flush indication at end of dp_rx_process
In case of TCP packets being processed by dp_rx_process, send out GRO
flush indication to the thread.

CRs-Fixed: 2500152
Change-Id: I4f464456d423e4680955992c0acf0ed5f4e618b8
2019-08-13 16:23:36 -07:00
Ruben Columbus
4319493562 qcacmn: ring backpressure handler
rxhost ring backpressure:
identifying rings causing rx backpressure after being notified
by FW message. Adding logs to be able to see at what state
the ap was after a backpressure event was triggered.
Adding radio stats (261) as well as napi stats for better
state description.
Change-Id: I395450be6faaf959f91729516a7b229c5b3396ce
2019-08-12 16:18:24 -07:00
Nandha Kishore Easwaran
5d3475b985 qcacmn: Initial changes for pine
Add device ID change and target type checks for pine.
Also remove memory war added for Hk emulation.

Change-Id: Idf531a48a03202d4fb241a92a1d671ee2b94cfbd
CRs-fixed: 2453899
2019-08-11 02:11:41 -07:00
Sravan Kumar Kairam
1e8591a2a0 qcacmn: Dont destroy rx_tid lock for peer reuse
In case of peer reuse case rx_tid locks are destroyed as
part of peer cleanup and are not initialized again. So while
deleting this peer as part of unref delete peer cleanup is done
which again tries to destroy the rx_tid locks which were already
destroyed. This leads to assert complaining destroying lock with
out initialization. So dont destroy the rx tid locks in case of
peer reference reuse.

Change-Id: I860de558950009cae6f62385dd665badfe9964e0
CRs-Fixed: 2504973
2019-08-11 00:47:32 -07:00