Commit Graph

575 Commits

Author SHA1 Message Date
Alok Kumar
b8919e14c5 qcacld-3.0: Cleanup the unreachable code in htt_t2h_lp_msg_handler
Currently, the message type HTT_T2H_MSG_TYPE_RX_ADDBA and
HTT_T2H_MSG_TYPE_RX_DELBA is not supported as firmware is
no more sending this message to host.

Clean up the unreachable code for HTT_T2H_MSG_TYPE_RX_ADDBA
and HTT_T2H_MSG_TYPE_RX_DELBA message type.

Change-Id: I7a32fb53fec00e0507ef32d29494968188c98bfd
CRs-Fixed: 2226328
2018-06-06 05:49:08 -07:00
Ryan Hsu
b5783cfcb2 qcacld-3.0: clean up to avoid NULL pointer dereference IPA
Fix a few things in one shot.

- clean up some code to avoid potential NULL pointer dereference.
- add a helper function - wlan_ipa_free_tx_desc_list() to
  avoid duplication.
- rearrage wlan_ipa_teardown_sys_pipe() to allow others' reference

Change-Id: I9d6391a7f20ae427bf59f07958bd13f349e61d83
CRs-Fixed: 2233867
2018-06-04 15:03:48 -07:00
Sravan Kumar Kairam
ff44dc3e2a qcacld-3.0: Update SMMU mem table for each rx nbuff
Currently SMMU mem map table allocation size is very high and may
lead to allocation failure if system memory is fragmented or in low
memory cases. Do not allocate SMMU mem table buffer instead update
for each rx nbuff.

Change-Id: Ib48199387abc942980cef1ef57a00e44c729e95f
CRs-Fixed: 2238629
2018-05-29 14:38:43 -07:00
Tiger Yu
baed8cd125 qcacld-3.0: Do not unmap skb_buf if the owner is ipa when vdev flush
Do not unmap the skb_buf if the owner is the ipa module when doing the
ol_txrx_vdev_flush.

For WDI 1.0 MCC TX, the IPA driver will push skb to wlan for transmission.
The skb_buffer has been mapped in the IPA driver before sending to wlan.
So no need to do unmap the skb_buf again in the wlan driver.

Change-Id: I2c1f8e916aca12f3efa73e3540e3d27c434617a1
CRs-Fixed: 2244442
2018-05-22 04:56:57 -07:00
Rakshith Suresh Patkar
ee30192439 qcacld-3.0: Fix compilation issue in ol layer
Fix compilation issue seen in ol layer functions
due to mismatch between callback pointer type and
callback function signature.

Change-Id: I46bdf88c0d3e367e15e2a54229b237e2c9416319
CRs-Fixed: 2245498
2018-05-21 10:26:23 -07:00
Padma, Santhosh Kumar
4cdbf7d8dc qcacld-3.0: Add QDF_BUG to avoid use after free
There is a chance that cumulative peer_id_ref_cnt of different
peers can exceed peer ref cnt. This can result in use after free
issue during peer unref delete in ol_txrx_peer_remove_obj_map_
entries. Add QDF_BUG to catch such case and avoid access of peer
after delete.

Change-Id: I5a3cecc6a20747fce2fbf36a5ae733c42a3bc88b
CRs-Fixed: 2206589
2018-05-21 03:52:48 -07:00
Nirav Shah
d21a2e3d6c qcacld-3.0: Featurize dp trace
Featurize dp trace to compile out cleanly.

Change-Id: I23b86459af605baa257af4ef62497f010b864215
CRs-Fixed: 2228465
2018-05-18 12:14:39 -07:00
Nirav Shah
a3cc7195ef qcacld-3.0: Flow control Resize implementation
Flow control resize implementaion as part of
Genoa enhancements to reduce total desc requirement
from 3600 to 2000.

Change-Id: Iee5d3ff08dcea13c11632cd29e6edba0dc3e979f
CRs-Fixed: 2223553
2018-05-18 12:14:33 -07:00
jitiphil
46e0a1354b qcacld-3.0: Possible Out Of Bound reads in htt_t2h_tx_ppdu_log_print()
mpdu_bytes_array_len, mpdu_msdus_array_len, and msdu_bytes_array_len
are used to calculate the record size, as well as used as
buffer offset, without any verification. This can cause to multiple
overflows and underflow leading to OOB reads.

Add checks for each arithmetic operation with these variables.

Change-Id: Ib6ec6ac6932eb8c541bc2357d45d3feaf39fdb7d
CRs-Fixed: 2226125
2018-05-17 07:59:21 -07:00
Jeff Johnson
3dca222e0b qcacld-3.0: dp: Fix misspellings
Address the following issues in the core/dp folder:
CHECK: 'accomodate' may be misspelled - perhaps 'accommodate'?
CHECK: 'acess' may be misspelled - perhaps 'access'?
CHECK: 'bahavior' may be misspelled - perhaps 'behavior'?
CHECK: 'catagory' may be misspelled - perhaps 'category'?
CHECK: 'continous' may be misspelled - perhaps 'continuous'?
CHECK: 'controler' may be misspelled - perhaps 'controller'?
CHECK: 'curently' may be misspelled - perhaps 'currently'?
CHECK: 'defintion' may be misspelled - perhaps 'definition'?
CHECK: 'Defintions' may be misspelled - perhaps 'Definitions'?
CHECK: 'desriptor' may be misspelled - perhaps 'descriptor'?
CHECK: 'extention' may be misspelled - perhaps 'extension'?
CHECK: 'informations' may be misspelled - perhaps 'information'?
CHECK: 'lenght' may be misspelled - perhaps 'length'?
CHECK: 'managment' may be misspelled - perhaps 'management'?
CHECK: 'messsage' may be misspelled - perhaps 'message'?
CHECK: 'neccessary' may be misspelled - perhaps 'necessary'?
CHECK: 'recieved' may be misspelled - perhaps 'received'?
CHECK: 'Recieve' may be misspelled - perhaps 'Receive'?

Change-Id: Ib8c1b94b5bb3bb5798e41dbb4c1461be80fd1398
CRs-Fixed: 2241941
2018-05-16 18:01:38 -07:00
Jeff Johnson
bd16f9df6b qcacld-3.0: Fix misspelling of 'request'
Fix misspelling 'reuqest' => 'request'

Change-Id: I6ad1d3d45922bba6362304bd28bb1239eeb0c5e1
CRs-Fixed: 2241934
2018-05-16 18:01:03 -07:00
Jeff Johnson
6548503053 qcacld-3.0: Fix misspelling of 'virtual'
Fix misspelling 'virtaul' => 'virtual'

Change-Id: I51517b1a879bae1adcbe90a75043198d9352c27b
CRs-Fixed: 2240064
2018-05-16 18:00:08 -07:00
Jeff Johnson
37df7c3d8f qcacld-3.0: Fix misspelling of 'want'
Fix misspelling 'wnat' => 'want'

Change-Id: I05468a6203c482b71ab0dba3e6d4177ddf66686d
CRs-Fixed: 2240067
2018-05-16 18:00:00 -07:00
Alok Kumar
f70f79a9eb qcacld-3.0: Fix inadvertent logic error in htt_tx_desc_init
Currently, "channel_freq" is declared as uint16_t. But
htt_get_channel_freq returns "int" which is assigned to
"channel_freq". So, channel_freq != -1 is always true
regardless of the values of its operands.

Declare "channel_freq" as int and add the check if
channel_freq is positive.

Change-Id: I13ae35c1bee3cdf293227e320ede8d8cd2e968fe
CRs-Fixed: 2233556
2018-05-16 13:44:34 -07:00
Sravan Kumar Kairam
adbff87a09 qcacld-3.0: Fix possible OOB access in ol_rx_reorder_detect_hole
Currently tid is extracted from HTT message and it is used without
check. This may cause possible OOB array read. To address this add
check for valid tid.

Change-Id: Idb03236e05fe43326f9ab46ae8368adc9a92d92a
CRs-Fixed: 2225497
2018-05-16 10:26:17 -07:00
Sravan Kumar Kairam
2be2792e2e qcacld-3.0: Fix possible OOB issue in ol_tx_desc_update_group_credit
Currently tx desc id is extracted from HTT message and it is used
without check. This may cause possible OOB array read. To address
this add check for valid tx desc id.

Change-Id: I121fc4d550aa587f00ec315e3a20dfb136f4d7af
CRs-Fixed: 2225461
2018-05-16 06:46:13 -07:00
Manjunathappa Prakash
7ed5ef5d16 qcacld-3.0: Get txrx_pdev context from global cds_context
__hdd_tx_timeout passes cdp_soc context dump_flow_pool_info callback
function. Lithium_dp interchangeably use cdp_soc and dp_soc as cdp_soc is
first element of dp_soc.
Same is not valid for iHelium datapath, do not expect caller to pass
the txrx_pdev context, instead get it from global cds_context.

Change-Id: I64932fefd1294275608258df49544135d3a0562c
CRs-Fixed: 2240099
2018-05-15 13:54:12 -07:00
Rakesh Pillai
33942c4344 qcacld-3.0: Fix Use-After-Free in ol_txrx_pdev_detach
The use TAILQ_FOREACH for freeing the fw_stats list during
pdev detach causes a use-after-free condition, which can lead
to unexpected behavior during the driver load or unload.

Fix the possible Use-after-free condition in pdev detach, by
using TAILQ_FOREACH_SAFE instead of TAILQ_FOREACH for freeing
the fw_stats list.

CRs-Fixed: 2214520
Change-Id: I5dfcc5e3f0d2e77a5f6226eca06bc6ab1af4e643
2018-05-15 03:21:22 -07:00
Rakshith Suresh Patkar
83871f7a7d qcacld-3.0: Define DPT_DEBUGFS_PERMS outside ifdef
DPT_DEBUGFS_PERMS macro has been defined inside
ifdef QCA_SUPPORT_TXRX_LOCAL_PEER_ID. Since this can cause problems
when the above config is not set, defining it outside.

Change-Id: Ibf02f692ddaf0b5de17d647cce27a6e093f7b7df
CRs-Fixed: 2238106
2018-05-14 11:39:08 -07:00
Jeff Johnson
9a27ffa62e qcacld-3.0: Fix typo "continous"
Replace typo "continous" with correct spelling "continuous".

Change-Id: I6159508bf43b3504d8a44f2088c3b98aef449460
CRs-Fixed: 2238297
2018-05-12 04:30:53 -07:00
Jeff Johnson
f2cf659cc2 qcacld-3.0: Fix typo "diable"
Replace typo "diable" with correct spelling "disable".

Change-Id: Ifb0d0086c1356a92fd868a22c2f1e1693f66066a
CRs-Fixed: 2238297
2018-05-12 04:30:06 -07:00
Jeff Johnson
4ceed38fbf qcacld-3.0: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I16de4aedcd0f401da8b11fa0ea4989ad1e73bf57
CRs-Fixed: 2238297
2018-05-12 04:30:02 -07:00
Jeff Johnson
6201829f3a qcacld-3.0: Fix typo "retrive"
Replace typo "retrive" with correct spelling "retrieve".

Change-Id: I09ae4ea41031a0a8108e1b60494eedb8751c5b3e
CRs-Fixed: 2238297
2018-05-12 04:29:54 -07:00
Jeff Johnson
fe8e9497e9 qcacld-3.0: Fix typo "lenght"
Replace typo "lenght" with correct spelling "length".

Change-Id: I227fe599d88c68982dd102f71c0bad30cd5d93cf
CRs-Fixed: 2238297
2018-05-12 04:29:06 -07:00
Jeff Johnson
fa7d9601ef qcacld-3.0: Fix typo "seperate"
Replace typo "seperate" with correct spelling "separate".

Change-Id: Ic2e69d5a15366c0c2fe57d2f378cac0e11228f8e
CRs-Fixed: 2238297
2018-05-12 04:28:53 -07:00
Alok Kumar
19707a8b2f qcacld-3.0: Fix null pointer dereference in htt_t2h_lp_msg_handler
Apparently netbufs_ring is initialized only when reordering is not fully
offloaded. When a message of type HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
is sent, the driver does not check if reordering is offloaded.

Add a check, if reordering is offloaded, when a message of type
HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND is sent.

Change-Id: I303b52182d97aa8185c23ccd99c37a97fb75a3d2
CRs-Fixed: 2213216
2018-05-12 01:25:35 -07:00
Jeff Johnson
118a4a05af qcacld-3.0: Fix typo "capabilites"
Replace typo "capabilites" with correct spelling "capabilities".

Change-Id: I1c84c401fd732227d63a159bea7f7f3cefacf153
CRs-Fixed: 2237725
2018-05-09 16:31:19 -07:00
Jeff Johnson
5ead5ab10f qcacld-3.0: Fix typos "sucess" and "sucessful"
Replace typos "sucess" and "sucessful" with correct spellings
"success" and "successful"

Change-Id: I30746cbab4533da9b052261fa9bb87214188138b
CRs-Fixed: 2237724
2018-05-09 16:31:15 -07:00
Yun Park
e019632b14 qcacld-3.0: Fix KASAN slab-out-of-bounds in ipa3_release_wdi_mapping
To avoid out-of-bounds access of mem_map_table from htt_rx_hash_deinit
, allocate mem_map_table size the same as maximum number of hash
entries, which is RX_NUM_HASH_BUCKETS * RX_ENTRIES_SIZE.

Change-Id: If25f97b47350196ceb2e8c60e7d5430a1484a01d
CRs-Fixed: 2214158
2018-05-05 08:22:55 -07:00
Manjunathappa Prakash
fb5f25b24a qcacld-3.0: Add GRO support to NAPI+Rx_thread processing model
GRO aggregations are hanging out of NAPI instance and We cannot use the
hif NAPI instance in Rx thread as gro_list inside NAPI is flushed out
at the start and end of NAPI poll, this will corrupt the gro_list on
which rx_thread is working. Address this concern by creating dummy
NAPI instances mapping to each hif NAPI and not scheduling them.

Change-Id: I6e1de57a669c56206a7863e86c3840bd0a9eabc1
CRs-Fixed: 2128450
2018-05-04 20:42:58 -07:00
Mohit Khanna
02281da645 qcacld-3.0: add DPTRACE Enhancements - Phase 2
Change data packets printing to one line
Add msdu-id to TX packets
Increase data packets size to include the complete IP packets
Indication/print when the throttling occurs

Change-Id: I4831c517b41f81003b8d28448a3093d911ac978c
CRs-Fixed: 2157768
2018-05-03 04:43:30 -07:00
Sravan Kumar Kairam
fbc87b7230 qcacld-3.0: Fix wlan_ipa_set_perf_level failure for UNIFIED_WDI_API
Add Unified WDI API support for ol_txrx_ipa_set_perf_level and fix
client parameter for ipa_wdi_set_perf_profile.

Change-Id: Ieaaf7cf5231f74cd6ba358c02032ae173d9618f0
CRs-Fixed: 2211504
2018-05-02 19:47:55 -07:00
Manjunathappa Prakash
7b0ad46796 qcacld-3.0: Add GRO support for STA mode
Add GRO support and make it configurable through INI(GROEnable).
GRO and LRO are mutually exclusive. Only one of them can be enabled.
And disable GRO during following conditions
1) Low TPUT scenario
2) Concurrency cases
3) For Rx packets when Peer is not connected

Change-Id: I15535827a03953231670d4138235c4876b16e045
CRs-Fixed: 2098772
2018-05-02 04:34:52 -07:00
jitiphil
10ff2ff9ed qcacld-3.0: Fix buffer overflow in htt_t2h_msg_handler_fast
Currently variable "num_mpdu_ranges" is from message, which is used
directly without any validation which causes buffer over-write.

To avoid buffer over-write add check for the valid num_mpdu_ranges

Change-Id: I54e138d4bd63cbe7a0ae4faf0fe9d8e59ca92c71
CRs-Fixed: 2213655
2018-04-26 13:12:04 -07:00
Krunal Soni
e23c41a517 qcacld-3.0: Pull head from skb in monitor mode to make a room for rtap
Some of the platforms delivers the msdu with skb head and skb data
pointing to same address, in such cases do skb pull to create a room
for radiotap hdr and let qdf_nbuf_update_radiotap() API handle creating
room for radiotap header.

Note: When skb head and skb data pointer points to same
address, it indicates that radiotap size is already considered in
headroom.

CRs-Fixed: 2230412
Change-Id: Ide49544873554ae38a49af1511fd5bafd0d25102
2018-04-24 17:17:25 -07:00
Jeff Johnson
1896fdcb30 qcacld-3.0: dp: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Id790fa94c7b6feb91db5f3d91630bf0cd5264192
CRs-Fixed: 2229655
2018-04-24 14:48:38 -07:00
Rakshith Suresh Patkar
44f6a8f1d9 qcacld-3.0: Debugfs Implementation for dp trace collection
Implement debugfs interface to dump DP trace buffer
to a debugfs file.

Change-Id: I51ac3acbfc404b87cacc8a247f85cc4ee9971b61
CRs-Fixed: 2180977
2018-04-23 07:50:50 -07:00
Manjunathappa Prakash
fa2754cce5 qcacld-3.0: Dont access msdu after it is transmitted
Tx context is holding on to reference to msdu, meanwhile Tx completion
freed the msdu, remove redundent qdf_nbuf_reset_num_frags(msdu)

Change-Id: I4c51f6e61c19147d2d4dafbd19bdfc3029a872ab
CRs-Fixed: 2222024
2018-04-19 19:25:57 -07:00
jiad
80055eb33c qcacld-3.0: Add frag_header to support pre-wdi2.0 platform
wdi2.0 feature adds extra 2 bytes to frag_header and thus hdr_len
to IPA HW also adds 2 bytes. This change breaks pre-wdi2.0 platform
with WiFi FW discarding all TX traffic since packet payload is
with an extra 2-byte offset.

Fix is to add frag_header structure with pre-wdi2.0 pattern.

Change-Id: I467a05bab4111a305ae23250c61cecc050821611
CRs-Fixed: 2047714
2018-04-18 22:03:28 -07:00
Orhan K AKYILDIZ
15e2d83d23 qcacld-3.0: Fix a race btw tx and tx-compl
While handling a multi-segment TSO packet, there is a race condition
where, if tx complete arrives fast enough, the un-sent TSO segments
may be lost forever and a previously sent segment would be attempted
to be sent over.

Fix the race condition. Dont use the segment after send to go to the
next one.

Change-Id: I4abd9d26f50c749141925894a8845cf82df4d222
CRs-Fixed: 2168778
2018-04-14 07:37:26 -07:00
Alok Kumar
ddd457e4a3 qcacld-3.0: Fix usage of PDEV pointer after free
Currently pdev pointer is freed prematurely in ol_txrx_pdev_pre_detach
but the same pointer is used when ol_txrx_pdev_detach is called. This
may lead to invalid pointer dereference issue.

To fix this issue, free pdev pointer in ol_txrx_pdev_detach after
ol_txrx_pdev_pre_detach is called.

Change-Id: I089d70842b90b568ee8a38c6ed56f5418df7303d
CRs-Fixed: 2207417
2018-04-10 08:52:35 -07:00
Dustin Brown
95ff87c60e qcacld-3.0: Flush packets in datapath error case
Several packets are sent to firmware in htt_htc_attach_all(), back to
back. However, if one of the latter packets fails to send for some
reason, the previous packets are not flushed. This leads to a number of
leaks under error conditions.

If a packet fails to send in htt_htc_attach_all(), flush the endpoint
before returning failure to the upper layers.

Change-Id: If9b33a645f7bcc77442e18566525ae57b544f1a0
CRs-Fixed: 2219137
2018-04-06 19:28:44 -07:00
Manjunathappa Prakash
7a4ecb2281 qcacld-3.0: Fix argument type for ol_txrx_stats_callback
ol_txrx_stats_callback is not implemented as it is not required, fix
the calling function argument type to match the prototype.

Change-Id: I8a976737af8f226a1774950170f445c93ebf683b
CRs-Fixed: 2216859
2018-04-04 17:47:15 -07:00
Manjunathappa Prakash
5e12b8c46e qcacld-3.0: Remove redefinition of wmi_unified_t
typedef wmi_unified_t is redefined in
qcacld-3.0/core/dp/ol/inc/ol_defines.h previous definition is here
qca-wifi-host-cmn/wmi/inc/wmi_unified_param.h, remove redefinition.

Change-Id: I2c2af59d8b24360cd09efeb12ea19c0340771bb8
CRs-Fixed: 2216859
2018-04-04 04:01:54 -07:00
Manjunathappa Prakash
92a860057d qcacld-3.0: Use dma_sync_single_for_cpu instead of dmac_inv_range
dmac_inv_range() is obsolete, use dma_sync_single_for_cpu instead.
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt.

Change-Id: I8add3c905d3cf190ef91ec023c88a7a645ae92e6
CRs-Fixed: 2216859
2018-04-04 04:01:50 -07:00
jitiphil
8ad8a6f9b2 qcacld-3.0: Fix invalid use of %p in ol_txrx_peer_release_ref
Currently %p is used in ol_txrx_peer_release_ref function in
ol_txrx.c which violates security guidelines

To address this issue change %p to %pK.

Change-Id: I06fd9eb260d1c53e4de235b710cd0ea05125b976
CRs-Fixed: 2170905
2018-04-03 01:42:50 -07:00
chenguo
861751bafa qcacld-3.0: Add target credit info in TX_QUEUE_STATS
When debug traffic stall issues, target credit number is also one
key point to trace beside status of TX queues. So add such info
in TX_QUEUE_STATS.

Change-Id: I2615545c1e041af920a4d0d6d0a8e3990768b762
CRs-Fixed: 2060945
2018-04-02 20:41:43 -07:00
Yun Park
302bdcce10 qcacld-3.0: Remove redundant typedef 'ipa_uc_op_cb_type'
Remove a redundant typedef 'ipa_uc_op_cb_type' from ol_txrx_type.h.

Change-Id: Id3cd82b846e85a0aed39a530c0510faa5572ca61
CRs-Fixed: 2213103
2018-04-02 19:39:31 -07:00
Srinivas Girigowda
e1282d4fbf qcacld-3.0: Fix clang compilation warnings
Fix clang compilation warnings.

Change-Id: I8c766c9062672608db60c583a46af2bc86bbba8c
CRs-Fixed: 2055487
2018-04-02 19:39:26 -07:00
Alok Kumar
75355aa8f3 qcacld-3.0: Add support for Tx OTA Ack stats
Add stats in vdev for Tx OTA success and failure count

Change-Id: I6849dfc1d11351f5cc63acf3a22bf72a1ef8109c
CRs-Fixed: 2211898
2018-03-28 14:44:27 -07:00