Commit Graph

623 Commits

Author SHA1 Message Date
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
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