Commit Graph

634 Commits

Author SHA1 Message Date
Mohit Khanna
7032200a77 qcacld-3.0: Support for DP RX Threads
Add support for DP RX Threads as a part of the FR. Multiple RX threads
can be enabled from the ini. The code is added in a new DP module
outside of the cmn project.

Change-Id: Ief6ee955f13c5e527986307371b8e45677cb9700
CRs-Fixed: 2256446
2018-08-24 18:35:32 -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
Alok Kumar
3a6327d4e7 qcacld-3.0: Remove the logs during RX thread buffer post
APPS watchdog bark timeout happens due to continuous excessive
logging of "Not able to allocate context" in ol_txrx_offld_flush
and in ol_rx_data_process. Remove these extra logs.

Change-Id: Idf96ca584d77c68ad771a150604d1b9ca65ba3eb
CRs-Fixed: 2289492
2018-08-08 14:50:34 -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
Sravan Kumar Kairam
a886120770 qcacld-3.0: Do rx inorder replenish for fragmented packets
Currently for fragment packets received legacy rx buffer replenish
is done which does not take in to account number of msdu count but
depends on fill count. Variable fill count is not protected and the
value becomes incorrect if AP sends both the fragmented and normal
packets at the same time. This leads to rx buffer replenish failure
and eventually data stall. To fix this do rx inorder replenish for
fragmented packets similar to normal ones if rx full reorder offload
is enabled.

Change-Id: I144c10be7b45268300b040e07ecb909a1ca113cc
CRs-Fixed: 2289797
2018-08-07 08:41:21 -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
Nirav Shah
52d85aacf5 qcacld-3.0: Separate out HL and LL TX data path
Separate out HL and LL Tx Data Path in different files
to compile out features cleanly.

Change-Id: I9033a5bc83bbc95ff00be3f46dc6eda65eab9e71
CRs-Fixed: 2287346
2018-08-06 04:21:13 -07:00
Ajit Pal Singh
8184e939b6 qcacld-3.0: Init tx_mutex in pdev_attach
Initialise spinlock: tx_mutex in pdev_attach instead of
pdev_post_attach as it may be accessed
in ol_tx_flow_ct_unpause_os_q() just after FW download.

Change-Id: I9de2eacd573420d23bc3a71a52dfb27bc1cfdab5
CRs-Fixed: 2285503
2018-07-27 12:34:57 -07:00
Nirav Shah
790d943594 qcacld-3.0: Add per module logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: Id808fef623b82cec38fc31071ef384f3ff0c92da
CRs-Fixed: 2278874
2018-07-27 09:09:42 -07:00
Alok Kumar
cc943caa7e qcacld-3.0: Add support to set/get timestamp for management frames
Add setter and getter function of timestamp for management frames
for the peer based on peer's mac address.

Change-Id: Iab0862eda2392bd516c8ba0b913441b8e0d4c493
CRs-Fixed: 2264667
2018-07-18 00:17:59 -07:00
Sravan Kumar Kairam
c273afd8e8 qcacld-3.0: Update UMAC peer objmgr handle to DP peer
At DP peer creation update UMAC peer objmgr handle to the
DP peer structure. Also update the DP peer handle to the UMAC
peer objmgr handle.

Change-Id: I9983fe9626eae9d2ad6e3b2a6fde9183f5bf6356
CRs-Fixed: 2259804
2018-07-13 00:54:03 -07:00
Sravan Kumar Kairam
43f191ba25 qcacld-3.0: Update UMAC vdev objmgr handle to DP vdev
At DP vdev registration update UMAC vdev objmgr handle to the
DP vdev structure.

Change-Id: I438cac1cc952ee8e1a4a372320e686d610b6c071
CRs-Fixed: 2236430
2018-07-11 14:29:02 -07:00
Sravan Kumar Kairam
1cbfb00f1c qcacld-3.0: Fix compilation issue for legacy DP
As part of DP CP interaction UMAC pdev objmgr handle is
passed at dp pdev attach. But in legacy DP config handle
is passed which leads to compilation issue. In this change
handle compilation issue by type casing handles.

Change-Id: I40986c8fd07d007aced91621f338f31332be6782
CRs-Fixed: 2260753
2018-07-09 02:02:15 -07:00
Tiger Yu
415a97e476 qcacld-3.0: Fix the double free for the txrx stats req
The txrx stats req has been freed in the ol_txrx_pdev_detach by checking
req_list of pdev.
Remove the txrx stats req free in the ol_txrx_fw_stats_desc_pool_deinit
to avoid the double free.

Change-Id: Idb2d5517e90ee873e7fd62d58c48a4f793266bac
CRs-Fixed: 2272696
2018-07-05 18:01:26 -07:00
psimha
8696f772fe qcacld-3.0: Add CDP API to set key in data path
Add CDP API to set RX MIC key in datapath.
Required to perform RX demic of fragmented packets.

Change-Id: I3c05da62ff20f8551cdc5780ce2f7b8d23c73a37
CRs-Fixed: 2217884
2018-07-02 16:08:48 -07:00
Abhinav Kumar
50d4dc7645 qcacld-3.0: Fix high latency during BTM roaming
While processing the WMA_ROAM_OFFLOAD_SYNCH_IND event, The
driver takes nearly 150 to 200 msec time to just write fatal,
error and info messages to the kmsg log buffer. Also to get
tx power supplicant runs another thread while roaming. These
cause more latency(300ms) to send WMA_ROAM_OFFLOAD_SYNCH_CNF
message to fw. To decrease roam latency, the driver should
write the only necessary error message to kmsg buffer.

The fix is to change irrelevant fatal, error and info message
type to debug add a check in __wlan_hdd_cfg80211_get_txpower
to reject the request to get Tx power while roaming in progress
otherwise driver will process this and will increase the roaming
latency.

Change-Id: I6c31637f21991b5b29c1e2dd2c2935ae7d4fc3d0
CRs-Fixed: 2251824
2018-06-29 19:37:17 -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
2650d4eb6e qcacld-3.0: Return supported max tx groups for all HIFs
Return max tx groups supported in driver for all HIF types.
Earlier max tx group was being returned for SDIO only.

Change-Id: Id0431b03b89945386dd0f5aa0fe01b6d66fadde2
CRs-fixed: 2268757
2018-06-28 03:11:01 -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
13ecbedb75 qcacld-3.0: Fix compilation issue for legacy flow control
Fix compilation issue for legacy flow control
(CONFIG_WLAN_TX_FLOW_CONTROL_LEGACY flag).

Change-Id: I2462d5b689ad6ea027411ff56c7550ab6036c0f4
CRs-Fixed: 2267924
2018-06-27 02:11:34 -07:00
Nirav Shah
99923a8330 qcacld-3.0: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: Icfcc28fb592ee99704d8fb23bc3cb45b6e4c9f53
CRs-Fixed: 2266718
2018-06-26 18:53:18 -07:00
Ajit Pal Singh
a9d5382e9a qcacld-3.0: Check per vdev limits for selecting discard frames
When HL Flow Control is enabled, check for per vdev limits for making
a decision on whether frames should be discarded.

Change-Id: Ifde5f763d253eb644f97afeab9e4e1365c23e672
CRs-fixed: 2236321
2018-06-26 01:35:54 -07:00
Ajit Pal Singh
d6c08f2f0e qcacld-3.0: Add function to set vdev tx_desc limit
1) Add ol txrx function to set TX descriptor limits for a
vdev.
2) Set the TX descriptor limits for STA and AP mode.

Change-Id: Ie9b1e52c3aff05db99ba3748a94792cc8116cdca
CRs-fixed: 2236321
2018-06-26 01:35:51 -07:00
Ajit Pal Singh
aa4a47fedb qcacld-3.0: Restart netdev queues when tx_desc get free
1) Restart high priority netdev queue when tx descriptors get freed
   and the vdev->tx_desc_count < vdev->tx_desc_limit.
2) Restart normal priority netdev queues when tx descriptors get freed
   and the vdev->tx_desc_count < vdev->queue_start_th.

Change-Id: I99cc159289bc31558294e02cd9213a18472563f6
CRs-fixed: 2236321
2018-06-26 01:35:47 -07:00
Ajit Pal Singh
851a777ffc qcacld-3.0: Update OS queue status in TXRX module
Add function: ol_txrx_set_vdev_os_queue_status() to update
OS queue stop/start status in TXRX module.
Also call cdp_hl_fc_set_os_queue_status() from 'flow control
resume timer' to update OS queue status in TXRX module.

Change-Id: I03260985a48084bc523a3814c93c0e6b213e1970
CRs-fixed: 2236321
2018-06-26 01:35:42 -07:00
Ajit Pal Singh
5bcf68a52a qcacld-3.0: Stop netdev queues when limits reach
1) Stop non priority netdev queues when tx-q stop threshold reaches.
2) Stop priority queue when tx_desc_limit reached.

Change-Id: Idcacc19b6d47dd665bb54f210d6da292cbe5af8d
CRs-fixed: 2236321
2018-06-26 01:35:38 -07:00
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