Commit Graph

237 Commits

Author SHA1 Message Date
Chaithanya Garrepalli
82eb94c989 qcacmn: remove bss and self peer back pointers from dp_vdev
Remove self and BSS peer back pointers and added APIs to
get self and BSS peer from VDEV

These new APIs will iterate through peer list and return
the appropriate peer by taking a reference

Caller has to take care of releasing the reference

Change-Id: I550ff83d665f3ad0a185bea1a1e6270c5474ff07
2020-08-06 14:37:19 -07:00
Jeevan Kukkalli
94c430da4a qcacmn: Notify HMWDS ast add status to upper layers
Notification is sent in following two scenarios.
 - After call to dp_peer_add_ast() if we are not expecting any
   peer map event.
 - When HTT peer map event is received.

Change-Id: Id926d1cec1ee64520b0368fcc5000988c24e0513
CRs-Fixed: 2745542
2020-08-03 11:23:43 -07:00
Chaithanya Garrepalli
59fc94ae9f qcacmn: Add API to check if peer exist on a PDEV
In add AST API check if peer with mac address exist
on a PDEV

Change-Id: Ied67e461faf769c444d29d1bce79405f51012ea2
2020-07-31 03:44:57 -07:00
Jeevan Kukkalli
30f2d61e6d qcacmn: Handle invalid HW ast index case inside dp_peer_map_ast()
Handle invalid HW ast index case inside function dp_peer_map_ast().
This change aids upcoming feature where status of HMWDS ast add is
reported to upper layer. This change eliminates extra peer ast list
traversal required for the new feature.

Change-Id: Ic6f45fedb53204c52719686aee9a90ae12695d09
CRs-Fixed: 2728611
2020-07-24 07:10:24 -07:00
Jeevan Kukkalli
659ecbabda qcacmn: Return appropriate QDF error codes
Modify functions dp_peer_add_ast(),dp_peer_map_ast() and
dp_rx_peer_map_handler() to return appropriate QDF error codes.

Change-Id: I582a5e68219fe25df5f46ae6044afa3bed880d2c
CRs-Fixed: 2728559
2020-07-22 11:55:41 -07:00
Aniruddha Paul
b07ed991ec qcacmn: Alloc/Dealloc the peer extended stats
Allocate/Deallocated the peer extended object in the
peer_create() and peer_del() paths respectively.

Change-Id: I3e93e1ec85aefb22d3fb40d1b01bbd07d660aff5
2020-07-15 03:52:18 -07:00
Chaithanya Garrepalli
eb6c7aa478 qcacmn: decrement num ast entries in hash clean up
In wifi down path decrement the ast count while force
freeing AST hash table

Change-Id: If98785eada2866c860ad4769fa744ca29d93dfbe
2020-06-29 02:38:40 -07:00
Chaithanya Garrepalli
1d144f88bd qcacmn: store peer_id instead of peer_ids array in dp_peer
In lithium a peer will have only single peer_id hence remove
peer_ids array from dp_peer structure

Change-Id: Ib98270b7fd98f1199b862e4608f990687914b7cc
2020-05-29 13:13:37 -07:00
Alok Kumar
e341157506 qcacmn: Avoid NULL pointer dereference of pdev
Suspicious dereference of pointer 'pdev' by passing argument
to function 'dp_find_peer_by_addr' in dp_register_peer.

Add NULL check before dereference of pointer 'pdev'.

Change-Id: Ibe2db784287ff1557aec983829781378578016c0
CRs-Fixed: 2668253
2020-05-07 03:44:50 -07:00
nobelj
01dcfedca1 qcacmn: Support MU in tx capture mode
Support fix for MU related data frame in tx capture mode.

Change-Id: I8b63eaf320463a3a068beb589089582cafe05001
CRs-Fixed: 2656346
2020-04-27 23:26:50 -07:00
Pavankumar Nandeshwar
d111e1ef43 qcacmn: Validate number of wds entries deleted during unmap
Validate number of wds entries deleted during peer unmap
handling with the number which firmware has sent in
peer unmap message, which indicates the number of
wds ast entries deleted by firmware after peer delete.

Change-Id: I09e1c41bab19cd023e7a83baf1e90d51aab4229e
CRs-fixed: 2667445
2020-04-22 06:23:30 -07:00
Pavankumar Nandeshwar
2d9f587695 qcacmn: Host-FW handshake improvements for WDS AST deletions
- For directly connected peers, during peer de-auth,
  a Single Peer delete request to the FW from host
  should delete all AST entries attached to the peer.
- This optimization is aimed at optimizing host-fw
  handshake messages

Change-Id: Iaebe2022f90ef9a10a6a0f37b21c409cf9e9ea39
CRs-fixed: 2647242
2020-04-20 05:54:48 -07:00
Rakesh Pillai
d1f8fbb225 qcacmn: Clear the peer when it is deleted
The peer rx packets should be flushed when
deleting the peer and its state should be reset
to DISCONNECT, when deleting the peer.

If the state of peer is not set to DISCONNECT,
then the flushing of rx packets for the peer
which is being deleted will call the rx callback
and submit these packet to the stack, which can
cause unwanted behaviour.

This way the UMAC does not need to specifically
call clear peer before deleting the peer.

Change-Id: I3b5a737126350a361d968f6349aef6291b2e3f56
CRs-Fixed: 2659629
2020-04-14 19:03:58 -07:00
Yu Tian
8abdbcc616 qcacmn: Implement send DELBA per HTT event
Is some cases, FW wants to adjust BA session parameters
FW sends a HTT event and HOST helps to send out DELBA
and modify BA win size in the next round of ADDBA req/resp
exchange to reduce following RX AMPDU aggr-size

Change-Id: I97777ff59a18346f2cd4e2e562c8ae6acdcd69d7
CRs-Fixed: 2644641
2020-04-02 00:12:42 -07:00
Yu Tian
22eed0e6af qcacmn: Limit the REO cmd number in batch operate
MCL path add the desc back to freelist when FLUSH
failed. It may cause the CMD pending in free list
is even larger than REO_CMD_RING max size and lead CMD
flood then cause REO HW in an unexpected condition.
So it's needed to limit the number REO cmds in a batch
operation.

Change-Id: Ib6b97f0693feb7bb5829bda4683248b495b6c7b3
CRs-Fixed: 2642516
2020-04-01 07:36:33 -07:00
Pavankumar Nandeshwar
d1aac5b3c3 qcacmn: Send peer_id in peer_add_wds_entry API
Send peer_id in peer_add_wds_entry API of ol_if_ops,
so that the dp peer doesn't need to be explicitly
retrieved in corresponding offload API.

Change-Id: Ia32d31946de43e9faa1970f4e74f2810f4125995
CRs-fixed: 2629475
2020-03-05 08:28:02 -08:00
Yu Tian
42e17e09b4 qcacmn: refine dp_set_key_sec_type_wifi3
Peer key security type is set in cdp_set_pn_check,
this API is called in key install step, but only
update Ucast field even if in Mcast key install.
This may be set wrongly if Ucast and Mcast security
modes are different. Add a new API to set
security modes of differ key types separately.
This change should be reviewd in associate with
review #3036742

Change-Id: Ib9723416fbedbe3dce61224928d51ef203cf7068
CRs-Fixed: 2623114
2020-03-02 19:13:17 -08:00
Ananya Gupta
9b146aa11a qcacmn: Iterate over all vdev ids to check if peer exists
Currently when checking for duplicate peer, only the vdev
id on which peer is going to be created is checked and not
on other vdev ids. So correct it by iterating over all
vdev ids.

Change-Id: Ie05ecc125d3285a522021b630fc7244501b6a797
CRs-Fixed: 2629146
2020-02-27 13:16:57 -08:00
Yu Tian
0108c7d032 qcacmn: update REO SSN when TX compl of ADDBA resp
There is possibility that DUT receives non-aggr frames
with non-aggr SN during BA setup during BA session
setup. SSN updates when ADDBA req is processed, should
also update REO SSN one more time when ADDBA resp sends
This will let REO to be able to receive frames in BA
session with new SN.

Change-Id: I4791bcd6f1ede90615c883d31426fcdecd50a631
CRs-Fixed: 2623505
2020-02-24 22:01:46 -08:00
Sravan Goud
b2c1b4a49b qcacmn: Ignore rx hw stats reo command status callback
Host queries for reo hw stats by sending reo queue status command
on all the rx tids. After sending host waits to receive for all the
rx tids reo hw stats. If the hw stats reo status is not received for
all the rx tids with in the specified timeout value corresponding
peers's reference is released. In parallel if disconnect happens
from userspace, there is always a chance to access the freed rxtid
reference in rx hw stats callback. So in case of rx hw stats event
timeout ignore processing the reo command status rx stats callback.

Change-Id: I0aba346a25564a3c29751f1f5a1d4e9204b93d33
CRs-Fixed: 2619720
2020-02-17 11:46:43 +08:00
Linux Build Service Account
67ef957780 Merge "qcacmn: Rename cmd ring to cmd_credit ring" 2020-02-15 11:08:15 -08:00
Yu Tian
0c6d94dd3e qcacmn: cdp: Implement API cdp_set_key_sec_type
Peer key security type is set in cdp_set_pn_check,
this API is called in key install step, but only
update Ucast field even if in Mcast key install.
This may be set wrongly if Ucast and Mcast security
modes are different. Add a new API to set security
modes of differ key types separately.

Change-Id: Icaa63139d117de75633ca1f81eb618c6b9294b53
CRs-Fixed: 2617461
2020-02-14 07:40:04 -08:00
Venkata Sharath Chandra Manchala
0094761c88 qcacmn: Take peer reference before requesting for rx queue status
Increase the peer ref count before requesting for reo
queue stats and release the ref count after receiving
the queue stats on the reo status srng.

Change-Id: Ife3b87951e767414efa1bfb45486cd364578d2a7
CRs-Fixed: 2604862
2020-02-13 13:05:54 -08:00
Radha Krishna Simha Jiguru
89a6c08c9b qcacmn: Avoid entry free only based on WDS feature flag
Allow AST entry deletion from del_ast call for HTT V1 cases

Change-Id: If7cd1dfe59680b29c8664a460a236e608c00b158
2020-02-11 12:41:15 -08:00
Linux Build Service Account
9cf6099bec Merge "qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0" 2020-01-31 05:37:08 -08:00
Nandha Kishore Easwaran
b7c18849ae qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0
Replace QCA_WIFI_QCA8074_VP with CONFIG_WIFI_EMULATION_WIFI_3_0
since VP platform is not being used anymore.
Most of the parameters present inside QCA_WIFI_QCA8074_VP are related
to emulation timeouts. Hence replacing it with a more meaningful flag.

Change-Id: I22a0e5803e765333947f1613b376dcc6bd25b5af
2020-01-31 02:34:19 -08:00
Radha Krishna Simha Jiguru
64b4848aa0 qcacmn: Do cleanup related to peer_map_unmap_v2
AST entry delete logic has some conditional checks making code with respect
to HTT V1 and V2 messages making it tough to follow.

Change-Id: I229324446134b32021a956fb689e4726256fcc28
2020-01-29 23:02:57 -08:00
Mainak Sen
d13ed3e9e1 qcacmn: API support for AST flow override
Lithium HW can parse each MSDU when packets are enqueued to transmit
classifier and each MSDU can get enqueued to different MSDU-Queue.
By default, there are 2 queues per TID – UDP and NON-UDP. Based on
the flow parsing, packets will be queued to either of them.
Enterprise customers uses RAW mode frames which transmit classifier
would not be able to identify L4 protocol for  UDP or NON-UDP queue
for encrypted frames.
Customer can also have different application based packets which needs
to be enqueued to differently prioritized queues. They can choose to
tag each MSDU based on application DPI and derive the flow priority
as below –
•	UDP
•	NON-UDP
•	HI-PRIO
•	LOW-PRIO
Customer needs API support from host which will provide an ast-index
based on a particular flow id given peer mac address. Based on the mac
address, host will find the associated peer and return the ast_index &
cache set number corresponding to the flow id from peer flow based ast
entry table. Customer will then program this ast-index and ast override
in transmit classifier CMD ring to enqueue MSDU to a specific
flow-queuein TQM.
Host API:
Input parameter – uint8_t *peer mac address, uint8_t flow id
Output – uint16_t ast_index
Change-Id: I79557c31532514ad5ec0c1848827a3e5cd91cdf2
2020-01-27 17:37:43 -08:00
Shivani Soni
a5707a4ded qcacmn: Update MAC address format dp
Updating MAC Address format in dp

Change-Id: I9e855d4081a5c5eadd69945d94596a699e2c2cd1
CRs-Fixed: 2599241
2020-01-23 06:27:28 -08:00
Subhranil Choudhury
22434e5ebd qcacmn: Add ast-type in wds_add
Add ast-type as argument in wds peer create command.
This helps to identify the ast entry from the time when ast add is done.

Change-Id: Ia0c073cf8f2573608e6a84410dffee6edf9b064b
2020-01-22 19:23:51 -08:00
Vevek Venkatesan
af776988bf qcacmn: cdp: Converge cdp_peer_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.

Also remove the ops which are used to store
and retrieve such handles, that no more needed.

- register_peer
- clear_peer
- change_peer_state
- peer_get_ref_by_addr
- peer_release_ref
- peer_state_update
- get_vdev_by_sta_id
- register_ocb_peer
- get_peer_state
- get_vdev_for_peer
- update_ibss_add_peer_num_of_vdev
- remove_peers_for_vdev
- remove_peers_for_vdev_no_lock
- copy_mac_addr_raw
- add_last_real_peer
- is_vdev_restore_last_peer
- update_last_real_peer
- peer_detach_force_delete

Change-Id: I4a41211464a30e018e8b73b8e9b91c7a509327b4
CRs-Fixed: 2541711
2020-01-22 02:46:27 -08:00
Pavankumar Nandeshwar
0ce3870654 qcacmn: Modify set 2 of ctrl_ops in dp to for umac-dp decoupling
Change set 2 of ctrl_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: I3f180c9c360d564f0b229b447074ad23b7c0a737
2020-01-20 17:52:06 -08:00
Pavankumar Nandeshwar
6c83405439 qcacmn: Modify set 1 of ctrl_ops to acheive umac-dp decoupling
Change set 1 of the ctrl_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: Iedf6dea2215d3d04b2212c71c8ec8c7328c559e8
2020-01-20 17:51:36 -08:00
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
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
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
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
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
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
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
Nisha Menon
98c4dd401b qcacmn: Fix for SMMU fault on reo cmd desc address
Memory leak fixed in dp_rx_tid_delete_wifi3 in the case
where update cmd send fails. Add the desc to the front of
free desc list and set a flag to ensure that the update
cmd is resent from delete rx_tid callback. In the same
callback ensure that the update cmd desc is sent out first
and then proceed to free other descs by sending out the
flush cache cmd for each of those descs.

If the flush cache cmd is not sent successfully to REO,
add the REO descriptor back to the free desc list and
defer the deletion to the callback function. This update
is made under MCL feature flag REO_DESC_DEFER_FREE.

Add a soc level stat to indicate the reo send cmd failures.

Change-Id: I4e4cf47223d5325a53f2df22571895489d033ba3
CRs-Fixed: 2551028
2019-11-10 23:58:50 -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
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
sumedh baikady
c0bd0bee0e qcacmn: Reset svld on getting delba or teardown
Currently we do not update svld with 0 on receiving
delba or during a teardown. This change sets update_svld
and resets svld flag to 0.

Change-Id: Ic5eb5732946c47d7c20230f225fbb1bf54621506
CRs-Fixed: 2514183
2019-10-30 16:51:31 -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
Rathees kumar Chinannan
e03a81b08a qcacmn: Fix to add AST entry during WDS to static roaming
Fix to add AST entry during WDS to static roaming

Change-Id: I761eef2d1ea384832e152a64252f08d2c71652cc
CRs-fixed: 2539088
2019-10-21 03:46:45 -07:00
Saket Jha
ce8c3108d5 qcacmn: Clear defrag waitlist in all cases
Rx defrag waitlist was not getting cleared during dp_peer_rx_cleanup in
the case of STA mode even though the tid was getting deleted. This
created a scenario where the next time dp_rx_defrag_waitlist_remove was
called, it was trying to access now invalid memory. If a vdev was
disconnected in the middle of receiving traffic, then the tid would be
deleted but the rx frag waitlist would not. Upon reconnecting, the
reception of the next frag would cause a crash due to the now invalid
memory in the waitlist.

Change-Id: I5bb1a31f38fa45128d0f35fafaddaf729c99489d
CRs-Fixed: 2538879
2019-10-15 22:58:32 -07:00