Commit Graph

604 Commits

Author SHA1 Message Date
Ajit Pal Singh
5d269618d5 qcacld-3.0: Populate legacy flow control ops for HL
1) Populate legacy flow control ops 'cdp_lflowctl_ops'
for HL netdev flow control.
2) Also call cdp_hl_fc_register() to register HL flow control
callback.
3) Increase number of netdev queues to 5

Change-Id: I6bdb015b3325e54386f2aad093c89f6f782c24ed
CRs-fixed: 2236321
2018-06-26 01:35:35 -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
Sravan Kumar Kairam
5eeeb7aa2a qcacld-3.0: Fix compilation error
Fix undeclared variable error compilation issue.

Change-Id: I088336967eb701708c5cbd864f00a7fbb8cc705b
CRs-Fixed: 2265088
2018-06-21 22:42:15 -07:00
Alok Kumar
4696fb0272 qcacld-3.0: Add Tx comp cbk for DHCP ACK SKB CB
During hard_start_xmit, set a flag in SKB CB to indicate DHCP ACK
packet, and a callback gets called on TX completion.

Change-Id: I4e11b2c35b4747c7af35a387b404e3ccb1e8e8e4
CRs-Fixed: 2253557
2018-06-21 13:52:12 -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
jitiphil
ecbee58c44 qcacld-3.0: Implement API to set dpt params debugfs
Implement API to set dp trace params debugfs which
sets  proto bitmap, num of records and verbosity
in the same order. API expects exactly 3 params to be
passed in the same order.

CRs-Fixed: 2184740
Change-Id: Ia802243bbd2e9d985a58ccf913d9cfbe3d71c8a8
2018-06-21 08:27:05 -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
Alok Kumar
8e17824200 qcacld-3.0: Fix invalid dereferencing of peer_id_to_obj_map for peer_ref
Currently, in ol_txrx_is_peer_eligible_for_deletion(), invalid
dereferencing of peer_id_to_obj_map[0xFFFF] to get peer_ref while
processing VDEV stop response handler may occur.

Revert the changes introduced by
Change-Id: Icf252612081a41f94db6df4684348f2962b2da9d and
Change-Id: I743e2e2c83c3e07e5d5ec4fde7fc3b098766ca96

Change-Id: I7aa104f69a5665f0e08314fb0a273e077f562939
CRs-Fixed: 2261088
2018-06-18 16:33:33 -07:00
Yun Park
4dcc193aa8 qcacld-3.0: Fix out-of-bounds access in ol_rx_indication_handler
Fix overrunning callee's array of size 19 by evaluating argument tid
not to pass the maximum number.

Change-Id: I993339f4b9aea51e9566d213c9828825c5f2bf66
CRs-Fixed: 2232744
2018-06-15 20:10:40 -07:00
Ajit Pal Singh
b06e052345 qcacld-3.0: Borrow credits from other txq group
In case the current selected txq group, does not have enough credits,
try to borrow credits from the other txq group.

Change-Id: I86fbe990853d90598f6e09b13f7061e4ba1a78ae
CRs-fixed: 2246206
2018-06-15 20:10:35 -07:00
Ajit Pal Singh
db16f01709 qcacld-3.0: Distribute credits amongst groups
1) When a group is created i.e. the first vdev is added to it,
assign all the credits to it.
2) When the second group is created, transfer some minimum credits
to it.
3) When a group is deleted, transfer its credits to the other group.

Change-Id: I0c5532033718b250ab0633b4da4e219c0315cac9
CRs-fixed: 2246206
2018-06-15 20:10:32 -07:00
Ajit Pal Singh
43ad30d0ec qcacld-3.0: Maintain frame count per txq-group
1) Add function: ol_tx_update_grp_frm_count() to maintain count of frames
per group.
2) Call ol_tx_update_grp_frm_count() from ol_tx_enqueue(),
ol_tx_dequeue() and ol_tx_queue_free().

Change-Id: If1b07ea5bbdcbc6ad6d0c91e6b2060c4264b9472
CRs-fixed: 2246206
2018-06-15 20:10:30 -07:00
Zhu Jianmin
9952304979 qcacld-3.0: Fix peer use after free in ol_txrx_clear_peer
When DUT P2P Go/SAP deauth ref STA, in race condition, scheduler
thread may try to clear peer data and drop pending rx packets
after peer freed in peer unmap handler in soft irq context,
use after free issue will happen.

Error log:
BUG: spinlock bad magic on CPU#1, scheduler_threa/28550
Unable to handle kernel paging request at virtual address
6b6b6b6b6b715b

Stackframe:
do_raw_spin_lock+0x34/0x154
_raw_spin_lock_bh+0x24/0x30
ol_txrx_clear_peer_internal+0x68/0xb0 [wlan]
ol_txrx_clear_peer+0x78/0xa0 [wlan]
hdd_softap_deregister_sta+0xd0/0x200 [wlan]
hdd_hostapd_sap_event_cb+0xca8/0x20b8 [wlan]

Change-Id: Ib8d133528f5ff22125218861206d241f96eaf0da
CRs-Fixed: 2247334
2018-06-14 11:46:54 -07:00
Nirav Shah
46fc6301ea qcacld-3.0: Featurize Tx throttle feature
Featurize Tx throttle feature.

Change-Id: Ie97749367b8c4e7af7fe0bee68b15be5946fdd67
CRs-Fixed: 2257918
2018-06-14 02:56:34 -07:00
Nirav Shah
c4aa1abac2 qcacld-3.0: Separate out different flow control implementation
Separate out QCA_LL_LEGACY_TX_FLOW_CONTROL
and QCA_LL_TX_FLOW_CONTROL_V2 flow control implementation
in different files to compile out features cleanly.

Change-Id: I5d6ddf9ea61b409b25d242852ed1f0102e94ad88
CRs-Fixed: 2228902
2018-06-14 02:56:32 -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
Alok Kumar
d27a9ed4f7 qcacld-3.0: Fix race vdev down and tx_desc->vdev access
ol_tx_update_connectivity_stats() in tx completion
path updates connectivity stats referenced from tx_desc.
In cases when vdev has gone down and tx completion are received
leads to NULL vdev access. So, add check before accessing vdev.

Change-Id: I402d740ab3ecd923aa1b632bd0c59447599c17df
CRs-Fixed: 2225053
2018-06-08 20:14:06 -07:00
Manjunathappa Prakash
7c985c7995 qcacld-3.0: Fix race vdev down and tx_desc->vdev access
ol_tx_update_arp_stats() in tx completion path updates the per vdev
arp statistics. vdev is referenced from tx_desc.
In cases when vdev has gone down and tx completion are received leads
to NULL vdev access. So clear reference to vdev inside tx_descs when
vdev goes down.

Change-Id: Ic8c854b42ece41489f71e1374e5e72580308e9fe
CRs-Fixed: 2215312
2018-06-08 20:14:03 -07:00
Nirav Shah
997e083b0f qcacld-3.0: Configure log buffer size from Kbuild
Configure log buffer size from Kbuild.

Change-Id: If84653ea8f5ef2a94cc006b1c62ac468de2e408a
CRs-Fixed: 2255920
2018-06-08 19:00:00 -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
Alok Kumar
4d87ff204f qcacld-3.0: Fix NULL pointer dereferencing of vdev during peer deletion
During peer deletion, ol_txrx_is_peer_eligible_for_deletion() is
called to check if peer is eligible for deletion. Inside function,
vdev is dereferenced to extract pdev but due to race conditon peer
may get freed from the list and this may lead to NULL pointer
derefencing of vdev.

Avoid dereferencing of vdev and pass pdev itself as an argument to
ol_txrx_is_peer_eligible_for_deletion()

Change-Id: I743e2e2c83c3e07e5d5ec4fde7fc3b098766ca96
CRs-Fixed: 2252243
2018-06-08 00:36:59 -07:00
Alok Kumar
bda73bb1f2 qcacld-3.0: Fix NULL pointer dereferencing of peer due to race condition
Peer get deleted during ol_txrx_peer_detach_force_delete when
WMA_ROAM_OFFLOAD_SYNCH_IND is received. As peer deletion is
happening in different context and ol_rx_send_pktlog_event is
accessing the peer in different context, a possible race condition
has occurred which leads to NULL pointer dereferencing of peer.

Ignore the peer deletion during ol_txrx_peer_detach_force_delete and
delete it during ol_rx_peer_unmap_handler.

Change-Id: Icf252612081a41f94db6df4684348f2962b2da9d
CRs-Fixed: 2238214
2018-06-08 00:36:55 -07:00
Nirav Shah
5ff1fd05d6 qcacld-3.0: Featurize fastpath feature
Featurize fastpath feature cleanly and
also disable unused code when Fastpath
is enabled.

Change-Id: I3922af873ef32544fdca37be0b110ebbc2abc45a
CRs-Fixed: 2226918
2018-06-07 15:47:45 -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
Amar Singhal
82b6a74853 qcacld-3.0: Remove incorrect check for station count
Remove incorrect check for WLAN_MAX_STA_COUNT. The callee
ol_txrx_get_vdev_by_local_id would do the correct check for
OL_TXRX_NUM_LOCAL_PEER_IDS.

Change-Id: I74f9996316cead165f40454c75145515e9c86a04
CRs-Fixed: 2247595
2018-06-06 18:56:18 -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
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