Commit Graph

234 Commits

Author SHA1 Message Date
jitiphil
900e0e617a qcacld-3.0: Reuse preample type, vht_sig_a_1 and vht_sig_a_1
In monitor mode, current implementation
uses the preample type, vht_sig_a_1 and vht_sig_a_1
values associated with each mpdu, instead of reusing
the values from the first mpdu, to calculate data rates.

This is causing incorrect rates to be recorded in monitor mode logs
Reuse preample type, vht_sig_a_1 and vht_sig_a_1 of first
mpdu till the last mpdu is reached.

Change-Id: Ia6e5c1b3b0cc8d8b27f16cdfbd469fdba5c4a8f2
CRs-Fixed: 2276766
2018-08-06 04:21:25 -07:00
Nirav Shah
575282cd60 qcacld-3.0: Featurize DSRC(802.11p) implementation
Featurize DSRC(802.11p) implementation

Change-Id: I64baee9d26b2300b7a7282ad2eff031c0b02b0b2
CRs-Fixed: 2287352
2018-08-06 04:21:21 -07:00
Nirav Shah
6ebfe2419d qcacld-3.0: Separate out HL and LL RX data path
Separate out HL and LL Rx Data Path in different files
to compile out features cleanly

Change-Id: Ifc0e2d7e740142f0115d1fcd53db2936f7a30979
CRs-Fixed: 2287351
2018-08-06 04:21:18 -07:00
jitiphil
335d24162d qcacld-3.0: Implement descriptor pool for fw stats
The kernel address is used as cookie to keep track
of stats request. This address can be disclosed to
target leading to a security vulnerability.

Implement a FW stats descriptor pool, and use a
descriptor ID to keep track of stats requests,
instead of the kernel address, to prevent
kernel address leak.

Change-Id: Ib49150da899c0b9314f614868a90867f4aa92d3d
CRs-Fixed: 2246110
2018-06-28 10:42:39 -07:00
Ajit Pal Singh
c31d10199c qcacld-3.0: Credit Management changes for Genoa
1) Genoa FW by default enables HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET.
When this flag is enabled, credits are reported through
HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND and not through
HTT_T2H_MSG_TYPE_TX_COMPL_IND.
However when TSF and PTP features are enabled we need to get TX
Completions from FW.
Since credits can also be updated through TX Completions
we need to disable updation of credits through TX Completion for Genoa.

2) Enable flag : cfg_ctx->tx_free_at_download to free ol tx descriptors at
   download.

Change-Id: I176dc8391ded9fc57f8be2b465effd8ae84eda49
CRs-fixed: 2268757
2018-06-28 03:10:58 -07:00
Nirav Shah
23054cfb6d qcacld-3.0: Use only 2 copy engine for RFS in Genoa
Use only 2 copy engine channels for RFS in QCN7605
(Genoa) if IPA is enabled.

Change-Id: Iabc1c21960807c707b2c9c2ad66d2e426dcb38ab
CRs-Fixed: 2265172
2018-06-25 14:12:47 -07:00
Wu Gao
d80927b104 qcacld-3.0: Return correct high bits of DMA addr
It returns NULL as high bits of DMA addr, which cause Rome platform
broken.

Change-Id: I893f86e6a269145654ae749bd01e7a890f4a1abb
CRs-Fixed: 2264775
2018-06-21 08:27:09 -07:00
Nirav Shah
87dca29f5a qcacld-3.0: Handle HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE command
Add support for HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
command from firmware to resize flow pool and call appropriate
function to handle it.

Change-Id: I7d2ca6ed459383ec5c456b15a71290264d5d2408
CRs-Fixed: 2261265
2018-06-20 04:05:44 -07:00
Sravan Kumar Kairam
b5870bb811 qcacld-3.0: Dynamic SMMU map/unmap only when IPA enabled
IPA SMMU mapping for RX buffers is needed only when IPA offload
and IPA pipes are enabled. Currently in STA only case where IPA
is not enabled SMMU map/unmap is done for RX buffers. So enable
SMMU mapping only when IPA pipes are enabled.

Change-Id: I88db2cc8606bdf4586644a7ffccd0415f85c8241
CRs-Fixed: 2213795
2018-06-20 04:05:17 -07:00
jitiphil
2de7d6ef8e qcacld-3.0: Use of %p in htt_t2h_tx_ppdu_log_print()
Introducing integer overflow checks in htt_t2h_tx_ppdu_log_print()
contained use of %p which violates security guidelines.

Change %p to %pK.

Change-Id: I9e886e9b065ea6902aeedc3d9c25aac76a07d6de
CRs-Fixed: 2252217
2018-06-11 04:45:08 -07:00
jitiphil
5202b599f8 qcacld-3.0: Incorrect message offset validations in t2h message handling
Currently in htt_t2h_msg_handler_fast, msg_len, which is in number of
bytes, is directly compared with pdev->rx_mpdu_range_offset_words,
which is in number of words. Thus their comparison becomes invalid.
In htt_t2h_msg_handler, in addition to similar issue as above, the
checks for message offset validations do not consider integer overflows
occurring.

In htt_t2h_msg_handler_fast, the check condition involving
pdev_rx_mpdu_range_offset_words were corrected to work with bytes,
and in htt_t2h_msg_handler checks for integer overflow were also
added.

Change-Id: I9ec7d30cc24d288ddcabd3bb30674a2ca21f2251
CRs-Fixed: 2248069
2018-06-08 10:11:36 -07:00
Rakshith Suresh Patkar
1273054d88 qcacld-3.0: Fix OOB access in htt_rx_ring_fill_n
Validate num and idx variables to avoid OOB access.

Change-Id: I920a3cd12744055cfc8315e3b16f8564a3cf9683
CRs-Fixed: 2225604
2018-06-08 08:30:40 -07:00
Yun Park
df3661cb1c qcacld-3.0: Handle SMMU mem map table alloc fail at unload
Change to handle SMMU mem map table alloc failure at unload.

Change-Id: If4928d7ddb1fe09608b2efd7077d6459d882ec01
CRs-Fixed: 2233582
2018-06-08 03:19:38 -07:00
Nirav Shah
bb8e47c200 qcacld-3.0: Featurize packet log
Featurize packet log.

Change-Id: Id747d142d72d02759b20bcf3091fd769261b8f67
CRs-Fixed: 2245422
2018-06-06 23:49:08 -07:00
Nirav Shah
73713f7e80 qcacld-3.0: Featurize monitor mode
Featurize monitor mode code.

Change-Id: I42d2d6a92d9097676ab3f8ec4a86958b8c0bc096
CRs-Fixed: 2245419
2018-06-06 23:49:05 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Alok Kumar
504230b163 qcacld-3.0: Fix buffer overflow in process_tx_info and process_rx_info
Currently data in "pl_tgt_hdr" is used directly from firmware without
any length check which may cause buffer over-read.

To address this issue add length check before accessing data offset

Change-Id: Ic2930fdf7168b79a8522be282b0e1cd19214742a
CRs-Fixed: 2148631
2018-03-20 14:33:54 -07:00
Yun Park
1726d60896 qcacld-3.0: Fix overflowing of mem_map_table array
In htt_rx_ring_fill_n, when debt_served is non-zero,
mem_map_table is being updated for extra buffers even
though memory to store mem_info has not been allocated
for those buffers. As a result of this overflow, memory
corruption is happening.
Fix overflowing of mem_map_table array in htt_rx_ring_fill_n.

Change-Id: I3ff96f57baf07799fd69d7ba196e44e7819f58dc
CRS-Fixed: 2103792
2018-03-19 12:18:17 -07:00
Sravan Kumar Kairam
4329c5fea8 qcacld-3.0: Map/Unmap IPA RX buffers at driver load/unload time
Map/Unmap IPA RX buffers at driver load/unload time when WLAN
SMMU is enabled.

Change-Id: Ibe2c5d234cc67a18979aed9af273d2340beb124a
CRs-Fixed: 2088439
2018-03-19 09:34:28 -07:00
Sravan Kumar Kairam
b664b6c61b qcacld-3.0: Add support for WLAN-IPA WDI 2 SMMU S1 translation
Update WLAN-IPA WDI-2 datapath buffer sharing for SMMU Stage 1
translation support. When SMMU Stage 1 translation is enabled
DMA APIs return IO virtual address(IOVA) instead of physical
address. This IOVA need to mapped to physical address by IPA
module before accessing them

Change-Id: I969ad020d5b423c785539f346286b212ea5830a1
CRS-Fixed: 2072960
2018-03-19 09:34:26 -07:00
Jingxiang Ge
0b049a8a41 qcacld-3.0: Fix regression issue for ipa init failure
When get length by HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET,
the input msg_word needs to shift 4Bytes.
Failure length check will cause ipa uc event without processing.

Regression cause Iddf2df0fd65f5b33b54f1a608cdd34e400c0e03c.

Change-Id: I41a44ae26f84d974cbd3242f4454ec6068d7b68b
CRs-Fixed: 2206296
2018-03-18 20:58:19 -07:00
Nirav Shah
eb017befbd qcacld-3.0: Add support for QCA9379 on x86 platform
Add support for QCA9379 chip on x86 platform for
USB and SDIO attach.

Change-Id: I2de81794cd16521097ffa6956a18b4b0fe981d36
CRs-Fixed: 2196757
2018-02-28 05:29:39 -08:00
Will Huang
80ac13b298 qcacld-3.0: Fix size error in htt_tx_ipa_uc_detach
Size allocate with sizeof(target_paddr_t) which is following DMA
device, but free with sizeof(qdf_nbuf_t) which is a pointer following
system. Maybe not same size on some platform.

Fix it by using same type when allocate/free.

Change-Id: Iadcb68b05ca5798f38c4341323b9fd1e32f5d693
CRs-Fixed: 2189671
2018-02-14 03:43:28 -08:00
Alok Kumar
3a7a4407d5 qcacld-3.0: Fix buffer overflow for HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
Currently variable "num_flows" and "len" is used directly, from
message, without any validation which causes buffer over-write.

To address this issue add check for the num_flows and len

Change-Id: Iddf2df0fd65f5b33b54f1a608cdd34e400c0e03c
CRs-Fixed: 2148489
2018-02-07 04:52:48 -08:00
Alok Kumar
0771953462 qcacld-3.0: Fix buffer over-read issue in htt_t2h_lp_msg_handler
Currently type conversion issues are for variables compl_msg
and pool_numap_payload. This may cause potential buffer over-read.

To address this issue add check for structure size.

Change-Id: Id4804eeaf5e80a9045f1c057fa4cb9db15c1ab7d
CRs-Fixed: 2148306
2018-02-07 00:03:52 -08:00
Alok Kumar
b46ae4adcc qcacld-3.0: Fix buffer overflow in htt_t2h_msg_handler
Currently variable "num_mpdu_ranges" is from message, which is used
directly without any validation which causes buffer over-write.

To address this issue add check for the valid num_mpdu_ranges

Change-Id: I3f340b913f3063b24c14644ea723a99690e89dcf
CRs-Fixed: 2146934
2018-02-07 00:03:47 -08:00
Wu Gao
e279444ee4 qcacld-3.0: Buffer count be power of 2 and unmap nbuf
Count of htt tx buffer pool should be power of 2 for fail case. For
Rome platform, it does not unmap nbuf when free htt tx buffer pool.

Change-Id: I85a9a1d02bf403f1be7289b1a0a89f86ef25f763
CRs-Fixed: 2179770
2018-02-03 05:32:33 -08:00
Alok Kumar
4bc43ac68a qcacld-3.0: Fix buffer overflow in htt_t2h_rx_in_order_indication_handler
Currently variable "tid" is from message, which is used directly
as array size which causes buffer over-write.

To address this issue add check for the array size.

Change-Id: I9b9d028ddb9566938f93ff8155284876c1ef9c03
CRs-Fixed: 2146949
2018-01-24 21:43:27 -08:00
Rajeev Kumar
b4b7f5c415 qcacld-3.0: Optimize driver init time log from HIF layer
Optimize driver init time log from HIF layer to avoid any console
logging related side effect.

Change-Id: If4331eb857d52330dc270cc8ebf6b559daa9413b
CRs-Fixed: 2170144
2018-01-22 21:24:21 -08:00
Yun Park
e4239809d9 qcacld-3.0: Cleanup function entry/exit logs from HDD IPA module
Move module init/deinit and function entry/exit logs to DEBUG level,
and keep only minimum logs in kernel log buffer.

Change-Id: Ia9fe82934638683079d308acfc9e7014e1d1a0e3
CRs-Fixed: 2169416
2018-01-13 00:42:40 -08:00
Rajeev Kumar
3887f9b2cc qcacld-3.0: Optimize console logging during driver load
Change some of info/warn log levels to debug log levels to
avoid excessive console logging during driver load.

Change-Id: I042a8f8f735fb2eb7c135c120cbc6644c46bcc31
CRs-Fixed: 2169378
2018-01-11 10:53:34 -08:00
Poddar, Siddarth
ee35f9250e qcacld-3.0: Enable 64-bit htt rx addr tracking based on HTT_PADDR64
Enable 64-bit htt rx addr tracking based on HTT_PADDR64
when ENABLE_DEBUG_ADDRESS_MARKING is disabled.

CRs-Fixed: 2166963
Change-Id: I47cfcb3f082bc969cd27630cfd96eb53b31cc40d
2018-01-08 14:26:06 -08:00