Commit Graph

230 Commits

Author SHA1 Message Date
Manikanta Pubbisetty
2db8a92735 qcacmn: add FSE CMEM HTT response
CMEM FSE details like offset into CMEM where flow search table(FST)
is allocated and the size of the FST will be sent by the firmware
in response to FSE setup message. Adding the logic to parse the
response message and update the CMEM parameters in the SW FST.

Change-Id: Id1dd4b59be02c175da3fc6fcb5ed56e6f491133a
CRs-Fixed: 2771187
2020-09-17 10:18:19 -07:00
Yeshwanth Sriram Guntuka
fcdcc1005f qcacmn: Do not set pkt len to HTT_MAX_MSG_SIZE in PPDU ind handling
Skbs allocated for CE1 ring are of size 2048 bytes. On
receiving PPDU stats HTT message, skb is pulled for 8
bytes corresponding to the HTC header length. As part of
dp_ppdu_stats_ind_handler, skb len is set to HTT_MAX_MSG_SIZE.
In the case where skb allocation is exactly of 2048 bytes,
including HTC header length, the aforementioned set_len
causes the skb to be expanded due to lack of tailroom.
This causes the skb data pointer to be changed which results
in invalid memory access.

Fix is to remove the qdf_nbuf_set_pktlen as skb len is
appropriately set by HTC layer.

Change-Id: Ied68c30456dc0e263ccfd03102962233a0e43d9f
CRs-Fixed: 2777516
2020-09-17 00:21:57 -07:00
Srinivas Girigowda
a104d7b453 qcacmn: dp: Remove redundant __func__ from the logs
The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.

Change-Id: I26bfac840ac6732ac83fb008db8e1702996eb21e
CRs-Fixed: 2774457
2020-09-15 02:45:47 -07:00
nobelj
a5219e6980 qcacmn: modify ppdu desc print log level
modify ppdu desc print that flooding the console

Change-Id: I30342dfade7967ac3bc7cb9740697fc09e4ade03
2020-09-09 14:03:55 -07:00
Yeshwanth Sriram Guntuka
aefb2ac3d4 qcacmn: Free nbuf from htt misc list only when magic pattern is set
In the scenario where htt packets fail to be transmitted to
FW, they are added in both endpoint tx queue and misc list.
On receiving FW down indication before these packets are sent
to FW, endpoint tx queue is flushed and nbufs are freed. Post
this, the aforementioned nbufs would be unmapped/freed again in
htt_htc_misc_pkt_pool_free causing panic.

Fix is to free the nbuf via misc pool free only when the magic
pattern is set.

Change-Id: Ie523a7ca0054eb4104a107b3bddd50cb9b585275
CRs-Fixed: 2762829
2020-08-31 17:21:26 -07:00
Shivani Soni
466f147d05 qcacmn: Debugfs support for HTT stats
Debugfs support for HTT stats under compile
time flag "HTT_STATS_DEBUGFS_SUPPORT".

Change-Id: I44c4f11265fdb3b9d53a9ac545e2945854bb9a57
CRs-Fixed: 2760947
2020-08-31 17:21:22 -07:00
Rhythm Patwa
3a1d8d64f7 qcacmn: Add support for Punctured Preamble PPDU count in tx stats
Add support to update the count of number of Punctured Preamble
PPDU's transmitted by the AP.

Change-Id: Id85a490e9e80566e639f48190a96d3107c6e5c61
CRs-fixed: 2755288
2020-08-27 18:37:12 -07:00
Chaithanya Garrepalli
ddc9e59e8f qcacmn: Add VDEV refcount debug support
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id

Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
2020-08-20 10:07:32 -07:00
Chaithanya Garrepalli
a718007f03 qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API

New lock soc->vdev_map_lock is introduced to protect
vdev id to object array

Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
2020-08-20 10:07:28 -07:00
Ruben Columbus
f1973b22d7 qcacmn: Add fix to support frame control for MU ctrl frame
frame control for second and subsequent user are zero which overide the
master frame control. Added fix to update master frame control from user
position zero.

Change-Id: Ic0331dd5d486fbffa44d29c74b4f1f15414d0a65
2020-08-18 14:43:39 -07:00
Chaithanya Garrepalli
3ecfd5005c qcacmn: used id based search instead of mac search
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
2020-08-15 01:26:29 -07:00
Chaithanya Garrepalli
fdc6a808ae qcacmn: add module id for peer reference
Add support to get the peer reference with module id

To help debug the peer reference related issues

Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
2020-08-15 01:26:14 -07:00
Chaithanya Garrepalli
113841906c qcacmn: increment refcount for peer find by id
Use unified version of dp_peer_find_by_id API
which will take peer reference

Also use unified peer ref release API dp_peer_unref_delete

Change-Id: Ibb516a933020a42a5584dbbbba59f8d9b72dcaa4
2020-08-15 01:26:10 -07:00
phadiman
3df84438dd qcacmn: Add CDP API to get peer wlanstats ctx
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
2020-08-14 14:44:25 -07:00
Jia Ding
c07761e4cc qcacmn: Fix static code analysis issues in DP
In dp_srng_init, max_buffer_length and prefetch_timer are used
while uninitialized.

In dp_bucket_index, overrunning array cdp_sw_enq_delay leads to
out-of-bounds access.

In dp_rx_defrag_fraglist_insert, cur is first NULL checked but
cur is again set to qdf_nbuf_next and is accessed without
NULL check. Thus do a NULL check again before dereferencing
cur to avoid potential NULL pointer dereference.

In htt_t2h_stats_handler, soc could be NULL while cmn_init_done
is dereferenced. Thus fix it by NULL check soc first and then
dereference cmn_init_done.

Change-Id: Ie6a33347d34862f30ba04a10096d3892af7571d3
CRs-Fixed: 2751573
2020-08-12 13:56:42 -07:00
Subrat Mishra
9b715c34c5 qcacmn: Retrieve per PPDU phy tx duration
Add support to retrieve per PPDU phy tx duration without response time.
Add support to retrieve per User phy tx duration for MU-MIMO and OFDMA.

These metrics are useful for ATF stats feature. Stats processing done
only if atf stats flag is set.

CRs-Fixed: 2709102
Change-Id: I90db41aa45843808e07343a80750c154abbde9cd
2020-08-12 06:42:17 -07:00
Ruben Columbus
e762bb831e qcacmn: prevent double free on buffer
wdi event has to be called before dp_txrx_ppdu_stats_handler.
this will handle all pktlog htt messages including cases for mgmt frame

Change-Id: Iefba15b61278fe77cbb6d6df9190e66b46ed573c
2020-08-05 20:59:16 -07:00
Lin Bai
73f1205497 qcacmn: Print HTT version info in INFO_LOW level
Since HTT minor verison isback compitable, print it in INFO_LOW.

Change-Id: I4327d7b32f5ef9a876b5ad274e260406c8bb3169
CRs-Fixed: 2747669
2020-08-05 11:19:00 -07:00
nobelj
4dd08941dd qcacmn: add fix to send ppdu in sequential order
logic of holding ppdu info list is modified to store it
in sequential order.

Change-Id: I179e76f4bb1663e141e48df5f274ac5fd1b81bbc
2020-08-03 13:28:35 -07:00
nobelj
4e788e664c qcacmn: fix tx capture MU data and bar frame ctrl
copying mu data info is done inside schedule command status tlv
and handling based on completion status is added.

Change-Id: I2792d754a4fa3e2992d68f569c9ce40be8ff02e2
2020-07-31 20:16:09 -07:00
Manikanta Pubbisetty
f3a83d1757 qcacmn: support new htt interface changes for FISA
HTT interface to enable FISA has been modified to accomadate only
FISA enable and aggregation limit fields, rest of the fields will
be initialized by the firmware; this change is in accordance with
it.

Change-Id: Ia5950541b8d852029650c02e81c097bf049e54c5
CRs-Fixed: 2731543
2020-07-31 16:26:35 -07:00
Manoj Ekbote
3d34d90697 qcacmn: Set up user completion struct based on max users
Currently, per-user information in Tx PPDU completion is allocated for
37 users though FW may send information for fewer number of users. In
new scheme, FW provides number of users in USERS_INFO TLV and host can
allocate the per-user struct based on this number. This can save memory
while processing each completion message.

CRs-Fixed: 2730923
Change-Id: If04fd664a1ef6e77e8eb44c5d2bd1fa89fcaba72
2020-07-26 20:24:22 -07:00
Amir
990bafdd4d qcacmn: Set 'en' bit to true in full monitor mode register
As per MAC team's suggestion, While disbaling full monitor mode,
Set 'en' bit to true in full monitor mode register.

CRs-Fixed: 2722950
Change-Id: Idc891efde5f1fa625d59b7a193deeb38dca33e23
2020-07-17 01:51:39 -07:00
nobelj
f7dbc44dd9 qcacmn: Fix rate of mu bar populated as zero
fix mu bar rate that populated as zero sometimes.

Change-Id: I382c351e923419b43ef9b5b497b1a10e401ee5d8
2020-06-21 04:03:57 -07:00
Christopher Chopp
5cf3d57f4e qcacmn: Move ppdu_user_desc peer check in tx cap tlvs
Move the ppdu_user_desc assignments in all tx capture
before peer checks. FW sends the peer_id which is not
valid in host, so this check is needed to not
miss the sequence number in this scenario.

Change-Id: I24305ae8f8f1964157ca61b8687fe72e76cde5ca
CRs-Fixed: 2626247
2020-05-08 16:10:50 -07:00
Ruben Columbus
1bda6dc94f qcacmn: setting phy_mode to preambles value
if peer delayed ba is true then value of preamble will be eventually
overwritten by previous frame (HE) and would give wrong values when
shown in pcap for radiotap fields. phy_mode is set to preamble value to
hold it and later on set it to mpdu_info preamble.

Change-Id: I054d27064b9ad151130fcbc1684594308352cef4
2020-05-05 05:00:07 -07:00
phadiman
1f3652debc qcacmn: Datapath init-deinit changes
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
2020-05-02 21:59:42 -07:00
Yue Ma
d77dcda3bc qcacmn: Tag HTT messages which do not have FW responses
For HTT messages (no matter they are test commands or not) which do not
have FW responses, tag them for runtime PM feature so that corresponding
usage count will be decrement right after sending them through HTC to
avoid usage count mismatch. Tag the missing ones in this change.

Change-Id: I3f78d21a5a490db6dff0dd2786d87c3ced66180c
CRs-fixed: 2672301
2020-04-29 16:03:34 -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
Srinivas Pitla
34b51d3dcc qcacmn: Free nbuf on bpr disabled case only
If tx capture, sniffer are not enabled, mgmt nbuf is freed.
It is causing use-after-free in bpr enabled case
Added change to free only when bpr is disabled

Change-Id: Ia56254ca371cd9fbc21f5d58fac7ea96792d0bee
CRs-Fixed: 2663098
2020-04-14 03:04:55 -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
Srinivas Pitla
ebf2f5aa58 qcacmn: update ba_size only when ba_size is 0
For ACK completion, update ba_size, ba_bitmap, ba_seqno
only if these are not updated earlier.

This fix updates ba_size, ba_bitmap, ba_seqno for QOS TID frames
in ACK completion handler, if these are not updated earlier.

CRs-Fixed: 2650482
Change-Id: I1d5f4bdb29a3d5194cd4a1544b39d6aa42903b1b
2020-03-30 17:11:16 -07:00
Saket Jha
07622e4108 qcacmn: Fix double unmap issue in HTC misc list
Add mutex protection while freeing pkts in HTC misc list to prevent
double unmap of netbuf.

Change-Id: I5c52324e382f8047037ca1d1a50367bc6052b737
CRs-Fixed: 2646771
2020-03-28 12:16:24 -07:00
Amir Patel
925a7d389c qcacmn: Add full monitor mode changes
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
2020-03-20 22:16:00 -07:00
Srinivas Pitla
cd32eed2af qcacmn: Drop mgmt nbuf in tx_capture disabled case
If tx_capture is disabled, the frames notified to tx_capture
module needs to be freed.

This change frees mgmt frames in tx capture module, if the feature
is disabled

Change-Id: I5f9ced69246c2b712d76f2f3cc61b5c386b703ec
CRs-Fixed: 2644025
2020-03-20 20:36:47 -07:00
Amit Shukla
a700ecf10e qcacmn: Fix rate and PHY type for disassoc retry packets
In tx capture feature, the last retry packet has wrong rate.
This is because the peer is invalid at the time rate TLV is processed
for retries.

Change-Id: I0eb9a8c80f8ea0dde60fe819c7e667293630a379
CRs-Fixed: 2633669
2020-03-19 01:36:55 -07:00
Pavankumar Nandeshwar
9b0c1271ed qcacmn: Initialized pdev id with default value 0xFF
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
2020-03-17 03:11:13 -07:00
Ankit Kumar
673a66042b qcacmn: Retrieve peer from mac based search
Use mac based search to avoid use after free Peer.

Change-Id: Ie6c3e82f3bb95cdf4c6504e95704e821bbd19e24
2020-03-09 08:24:21 -07:00
Srinivas Pitla
4f48adea18 qcacmn: Fix EAPOL frames issue in Tx capture
This change fixes issue with EAPOL frames in Tx capture
EAPOL frames completions are received with ACK completion.
For ACK completion, ba_size, ba_bitmap, ba_seqno are not updated earlier.
it was leading to dropping the frames in driver.

This fix updates ba_size, ba_bitmap, ba_seqno for QOS TID frames in ACK
completion handler

Change-Id: I58308a13c1b6addb95f424aa7ad45fe64e93b532
CRs-Fixed: 2620890
2020-03-04 22:59:15 -08:00
Amir Patel
605e44bf31 qcacmn: Move dp monitor inline APIs to header file
Move dp monitor inline APIs to header file from dp_rx_mon_dest.c
to dp_rx_mon.h to use it in component dev

CRs-Fixed: 2626054
Change-Id: I3a31dacd7d7e817f144708f9bda5536808080864
2020-03-03 18:54:37 -08:00
nobelj
d3a6d13d9f qcacmn: Fix to support ack ba status tlv comes twice
Sometimes ack ba status tlv comes twice which cause ppdu desc to be hold
as waiting for some more tlv as mpdu ack ba tlv is not matching with
completion common tlv mpdu count.

Change-Id: Id946ecd53018ee7abe93aa6c5f62e69d41b750e8
2020-02-25 21:59:08 -08:00
Ruben Columbus
e792f8bab3 qcacmn: adding doppler/SR for he information
Add doppler and spatial reuse in ppdu descriptor to be able to use it on
HE information for tx capture

Change-Id: Id87a692a89d00c64929624c22c2efc27bc873e43
2020-02-25 12:39:44 -08:00
Aditya Sathish
041409f98f qcacmn: Add 6GHz support for chan/freq/band usage in mesh mode
Currently mesh mode uses channel numbering which is derived
from APIs that don't support 6GHz channels numbering due to the
overloading of 6GHz channels with 2.4GHz and 5GHz.

Add support to obtain the correct channel number (and auxiliary
information like band and frequency) through the new APIs that
support 6GHz.

Change-Id: Ib0b39ebae2a22bd6b2b5d17b9058c3c2100e0d59
CRs-Fixed: 2605229
2020-02-20 08:32:09 -08:00
nobelj
b621cabe85 qcacmn: Fix ppdu stats for disassoc frame
For Disassoc frame, fw send ppdu stats to host with peer_id
of the previous associated client. peer id is valid and peer
structure is NULL making framectrl as zero for disassoc frame.
with the fix frame ctrl are populated before checking for invalid peer.

Change-Id: I5960685a4c90f00a850f4f1fa2b3d883117fb443
2020-02-19 20:46:01 -08:00
nobelj
eaf0a8e1aa qcacmn: update tx rate stats only for transmitted packet
Fix issue, update tx rate stats only for transmitted packet

Change-Id: Ice13c99bf82380d56759eb180e774ffab21b66b0
2020-02-17 07:41:08 -08:00
Radha Krishna Simha Jiguru
b4c0f1fe75 qcacmn: Add HTT message for sending 3 tuple configuration
Add HTT message for 3 tuple hash reporting in packet TLVs.
Change-Id: Iacdeee178838b490b3ad7e79c8bf27ca06b371a6
2020-02-15 21:49:27 -08:00
Yeshwanth Sriram Guntuka
52a511822b qcacmn: Put the htc pkt in freelist on htc_send_pkt failure
In case of nbuf map failure as part of htc_send_pkt for
tx credit flow disabled endpoints, htc pkt is not put
back in the freelist as return status is not checked
resulting in memory leak.

Fix is to put the htc pkt back in the freelist based on
status returned by htc_send_pkt.

Change-Id: I9173fa3684bc887a360b92d48b689c53a5ad5dbe
CRs-Fixed: 2596297
2020-02-15 19:10:29 -08:00
Manjunathappa Prakash
3227df4b10 qcacmn: Tag FSE/FISA HTT setup commands as HTC_TX_PACKET_TAG_RUNTIME_PUT
FSE setup, FSE cache flush and FISA config commands do not have
response, tag them as HTC_TX_PACKET_TAG_RUNTIME_PUT so that get on
runtime_pm is released. Without this target fails to go to runtime_pm
suspend.

Change-Id: Ibb14484dd50c62bb4680b41acf93ce3da1bec796
CRs-Fixed: 2606884
2020-02-12 11:59:29 -08:00
Manjunathappa Prakash
5d73e075e8 qcacmn: Add support to deliver the packets to FISA
Hook FISA specific callback to deliver the Rx packets to
FISA frame work.

Change-Id: Ia16c857764c0c3bf99c3855eac01659eb03c7608
CRs-Fixed: 2599917
2020-02-12 11:58:59 -08:00