Commit Graph

258 Commits

Author SHA1 Message Date
Alok Kumar
b94a2e7f29 qcacld-3.0: Update Arp Stats for both Tx and Rx Arp Packets
Currently rx_arp_resp_count stats is not updated for ARP packet
during rx in htt_rx_amsdu_rx_in_order_pop_ll as packet type is
not marked as QDF_NBUF_CB_PACKET_TYPE_ARP.
Also, track_arp_ip member of adapter is updated during NUD SET
but track_arp_ip of hdd_ctx is used inside hdd_hard_start_xmit
and hdd_rx_packet_cbk to compare arp src ip.

Update the packet type to QDF_NBUF_CB_PACKET_TYPE_ARP for ipv4 ARP
packet during htt_rx_amsdu_rx_in_order_pop_ll.
Use track_arp_ip member of adapter to compare arp src ip.

Change-Id: I58a678caa8ce4b54b583f76cfcbbb4f46443f448
CRs-Fixed: 2405335
2019-03-14 13:01:20 -07:00
Srinivas Girigowda
69e60dbbde qcacld-3.0: Remove obsolete macros/enums from the code
Remove obsolete macros/enums from the code.

Change-Id: I398f4d65bcfc996bbaf12076b55b7e6cf9e182be
CRs-Fixed: 2414803
2019-03-13 19:41:17 -07:00
Rakshith Suresh Patkar
dd7f36c0dd qcacld-3.0: Move htt_rx specific macros from hif to htt
Add htt_rx specific macros in htt.

Change-Id: I34aca35574a3366e65000f40529e65593a37932e
CRs-Fixed: 2412216
2019-03-12 10:01:22 -07:00
Srinivas Girigowda
98234535e0 qcacld-3.0: Converge *_MIN/MAX() to QDF_MIN/MAX()
Converge multiple MIN/MAX() macros across the stack
to QDF_MIN/MAX().

Change-Id: Ibf622b1e365431fa579005ba8bffdd33b7808da8
CRs-Fixed: 2413868
2019-03-12 02:58:39 -07:00
Jeff Johnson
cdcc910871 qcacld-3.0: Remove extern from htt prototypes
To align with the Linux coding standard as enforced by the checkpatch
script, remove the extern keyword from htt prototypes.

Change-Id: I8a935de8d3cb5ea65ee81d5ba770f6e51608cba9
CRs-Fixed: 2411810
2019-03-08 04:36:53 -08:00
Srinivas Girigowda
a83abf3bbe qcacld-3.0: Modify IEEE80211_FC0_*_QOS to QDF_IEEE80211_FC0_SUBTYPE_QOS
Modify IEEE80211_FC0_SUBTYPE_QOS to QDF_IEEE80211_FC0_SUBTYPE_QOS.

Change-Id: Ide7ce0b8ff66af1706c2781dbe2aecb316613366
CRs-Fixed: 2408230
2019-03-05 11:27:49 -08:00
Srinivas Girigowda
2834495863 qcacld-3.0: Remove cds_ieee80211_defines.h
Remove cds_ieee80211_defines.h file.

Change-Id: I3b7a3f61f82ea15b7975fb5d143257c80382f20d
CRs-Fixed: 2395980
2019-02-26 21:18:05 -08:00
Nirav Shah
da761ede23 qcacld-3.0: Fix datapath statistics print format
Fix datapath statistics print format.

Change-Id: Id1c95fc93f1d7335eb199afa59b2077a36641dc3
CRS-Fixed: 2401250
2019-02-20 02:55:51 -08:00
hangtian
127c953c7f qcacld-3.0: Use qdf_mem_zero for zero initialization
Use qdf_mem_zero for zero initialization.

Change-Id: Ic2b8d907623cf67a4569aaf01398c1b3a2bff707
CRs-Fixed: 2376644
2019-01-14 08:38:03 -08:00
Jeff Johnson
40d289ec79 qcacld-3.0: Remove macro HTT_TX_DESC_PADDR()
Macro HTT_TX_DESC_PADDR() is unused. Furthermore, it references
tx_descs fields which do not exist. Since it couldn't possibly be
used in its current form, remove the macro.

Change-Id: I62b2d7bc3291ba6c2dc486196076827cfc22d8ec
CRs-Fixed: 2375421
2019-01-07 08:47:15 -08:00
Rakshith Suresh Patkar
c107967468 qcacld-3.0: Use new accessor macro for map_index in qdf_nbuf_cb
The existing accessor macro NBUF_MAP_ID is obsoleted due to
restructuring of qdf_nbuf_cb.

Use new macro QDF_NBUF_CB_RX_MAP_IDX to access map_index.

Change-Id: I23650781cdd770f25b72a0a5fe55acc12d71cb64
CRs-Fixed: 2370724
2018-12-23 21:58:36 -08:00
Alok Kumar
6f20e30949 qcacld-3.0: Avoid rx_ring.refill_debt count to become negative
Here rx_ring.refill_debt can become negative if filled count
returned from htt_rx_ring_fill_n() exceeds the rx_ring.refill_debt.

This is possible because inside htt_rx_ring_fill_n() we always refill
num = qdf_atomic_read(&pdev->rx_ring.refill_debt). Here we do not take
care of already served debt.

Taken care of above by subtracting debt_served from refill debt.

Change-Id: I0c154c978b711da2d8497c50f730619767787188
CRs-Fixed: 2365566
2018-12-21 02:40:32 -08:00
Jeff Johnson
c44540a879 qcacld-3.0: Remove unused htt_fw_stats macro ROUND_UP_TO_4
Macro ROUND_UP_TO_4 in htt_fw_stats.c is unused, so remove it.

Change-Id: I2aea830bee4d9e40546a02ee8715995e662cbeb2
CRs-Fixed: 2366962
2018-12-17 13:12:01 -08:00
Rakshith Suresh Patkar
0f6375c2b7 qcacld-3.0: Enable use of new htt header format
If FW supports new htt format include only payload length in
the header length.

Change-Id: Ia668d73dcae3eb4adc1a4cfb0498b34d8c38f522
CRs-Fixed: 2361564
2018-12-10 05:36:45 -08:00
Lin Bai
6abb0f08e5 qcacld-3.0: Typecast DMA address properly when printing
Change Icdcfcdd10400aa2fad64441aa863087cc1c3766e use %llx to print
qdf_dma_addr_t. While qdf_dma_addr_t defined as 'unsigned long',
if without definition from kernel header.
Typecast DMA address to 'unsigned long long', before using %llx to
print DMA address directly.

Change-Id: Ic9527b494ac1aa2d47567a7dab5f0786913f4921
CRs-Fixed: 2355624
2018-11-28 01:36:43 -08:00
Lin Bai
e8ce5c5744 qcacld-3.0: Fix format error when printing DMA address
Compiler threw error as -Werror=int-to-pointer-cast when casting
DMA address to void pointer.
Use %llx to print DMA address directly.

Change-Id: Icdcfcdd10400aa2fad64441aa863087cc1c3766e
CRs-Fixed: 2350605
2018-11-21 13:47:22 -08:00
Nirav Shah
7c8c171e05 qcacld-3.0: Remove unnecessary prints from data path
1. Remove error prints for qdf_mem_malloc APIs.
2. Remove unnecessary __func__ from data path prints.

Change-Id: I6c4b110f626d84da055821c5f210a3d000b6ff15
CRs-Fixed: 2317315
2018-11-16 05:08:30 -08:00
Will Huang
a47dca3872 qcacld-3.0: Map as QDF_DMA_BIDIRECTIONAL for PMF tx frame
Some target which support sending mgmt frame based on htt would DMA
write this PMF tx frame buffer, it may cause smmu check permission
fault, set a flag to do special DMA map.

Change-Id: I3686be211374d2c316726fa3248dedce87c3faed
CRs-Fixed: 2332329
2018-10-30 01:46:01 -07:00
Amar Singhal
ddd2cf98d2 qcacld-3.0: Unlock the rx_ring spin-lock appropriately
Unlock the rx_ring.rx_hash_lock spin-lock when returning due to
failure to do smmu map_unmap.

Change-Id: I1b905c0ad529c80f78807c030920121ee0909825
CRs-Fixed: 2299785
2018-09-06 10:05:27 -07:00
Alok Kumar
a13db78b09 qcacld-3.0: Add pre-allocated pool of SKBs for Rx ring
In low memory condition, RX ring may become empty when all
SKB buffers attached to the ring get consumed and kernel is
unable to allocate SKB buffer during replenish.

Create a pre-allocated pool of skbs during driver load time
and request the buffer from this pool in low memory case.

Change-Id: If8c6a4fe04f3c931dc60dcffe28e45166eab9835
CRs-Fixed: 2306861
2018-09-06 01:41:52 -07:00
Manjunathappa Prakash
1bc742d65e qcacld-3.0: Do not log DP info logs on the console
Reduce the log level so that logs appear on cnss-diag log instead on
console.

Change-Id: I66ba3a941b9c6be9ec4fb04af39f9362822787d2
CRs-Fixed: 2296841
2018-08-17 16:13:06 -07:00
Dustin Brown
83044c26d3 qcacld-3.0: Remove redundant recovery-enabled checks
cds_trigger_recovery() already checks for various conditions before
actually triggering recovery. One of these checks ensures that recovery
is enabled, but some callers are checking to see if recovery is enabled
before calling cds_trigger_recovery() as well. Because of this, some
important checks are skipped, and crashes can occur when they should
not. Remove the redundant checks at the call sites for
cds_trigger_recovery() so that all of the recovery conditions are
properly handled, and the wlan driver avoids crashing when it should
not.

Change-Id: I8c26a002b66496a1eb06263f3f8b91ead739e3ac
CRs-Fixed: 2296008
2018-08-15 01:17:42 -07:00
Nirav Shah
e6194ac8ad qcacld-3.0: Update data path statistics log level
Do not required to print function and line number
for data path statistics function which is invoked
by ioctl.
Change data path statistics to info print so
that it can be printed in dmesg as well.

Change-Id: I4b5ea4202255ace71dbb6f9a4bbff6f93e496425
CRs-Fixed: 2278885
2018-08-14 02:15:39 -07:00
Venkata Sharath Chandra Manchala
9ac1620c82 qcacld-3.0: Add conditional QCA6390_HEADERS_DEF flag
Add a conditional compilation QCA6390_HEADERS_DEF flag to compile
htt_rx_restitch_mpdu_from_msdus.

Change-Id: I6b526f2dd5d56338e520ec138512b7cf2d849d0c
CRs-Fixed: 2275699
2018-08-08 12:53:42 -07:00
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