Commit Graph

6873 Commits

Author SHA1 Message Date
Paul Zhang
f9afcce798 qcacmn: Add subcmd QCA_NL80211_VENDOR_SUBCMD_INTEROP_ISSUES_AP
In practice, some APs have interop issues with the DUT. This sub command
is used to transfer the AP info between the driver and user space. This
works both as a command and event. As a command, it configures the
stored list of APs from user space to firmware; as an event, it
indicates the AP info detected by the firmware to user space for
persistent storage. The attributes defined in enum
qca_vendor_attr_interop_issues_ap are used to deliver the parameters.

Change-Id: I18c8f5b9555573cf3d732ad14e83840f56a74d48
CRs-Fixed: 2441046
2019-05-20 11:22:25 -07:00
Ankit Kumar
0ae4abc97b qcacmn: Replace QDF_DMA_BIDIRECTIONAL to QDF_DMA_FROM_DEVICE in rx
In Rx path, We really don't need to flush data and invalidate.
Hence replacing map/unmap flag to QDF_DMA_FROM_DEVICE.

Change-Id: I3de0c73e11a08a875114167a55fe9fe4432f1dd4
CRs-fixed: 2449712
2019-05-20 11:22:21 -07:00
Pranita Solanke
05862964ab qcacmn: Identify WIN/MCC specific features
Identify the WIN/MCC specific features. Move the features under feature
specific flags. Get rid of WIN/MCC specific code.

Change-Id: Iaf4e5befd7d574a20bea5c078201adbeac3b762c
2019-05-20 09:58:47 -07:00
Abhishek Ambure
409a3b2c53 qcacmn: Cleanup VDEV_SM legacy code
Legacy code for VDEV_SM is no more used, hence this clean up is done.

Change-Id: Ie5afeab68bafce6ed1bdaaa8cb778a94f3a2bbf8
CRs-Fixed: 2454113
2019-05-20 09:58:44 -07:00
Vivek
2ec3781464 qcacmn: Define qdf timer multiplier as a macro
The current QDF timer multiplier factor is of type
uint32 which takes whole number, so we cannot have multiplier
factors like 0.5 or 1.5

To provide such timer multiplier,
we define timer multiplier, as a macro, provided though
build options and support values like 0.5 or 1.5 through
1/2 and 3/2 respectively and this is used to configure the
timeout value.

Change-Id: I3f5441e33cca71f4a399cbbf9c6f61e2f21ee828
CRs-Fixed: 2450710
2019-05-20 07:54:01 -07:00
Ankit Kumar
f2526d44ee qcacmn: Place check under qdf_likely unlikely flag
Place if check inside qdf_likely and qdf_unlikely check
to optimize code through compiler.

Change-Id: I46796247fd09860aa0f62170eb7f7e5ef8e8f896
CRs-fixed: 2455579
2019-05-20 10:46:49 +05:30
Akshay Kosigi
2a2a8afda4 qcacmn: Add change to restart target if timer
Add code to restart timer for a new vdev command being sent to FW,
while we are awaiting for a response from FW for a previous command.

Change-Id: I1847968831cca6b0ee1e49d32b83196061341702
CRs-Fixed: 2450682
2019-05-16 14:46:39 -07:00
Abhishek Singh
77f9ba1cc0 qcacmn: Move legacy serialization flush cmds to common api
Move legacy serialization flush cmds to common api

Change-Id: I7a1a46a615c90e112c91efc4aec1461023b6ad5c
CRs-Fixed: 2452518
2019-05-16 14:46:34 -07:00
Pragaspathi Thilagaraj
a7c83f7401 qcacmn: Fix possible OOB in target_if_direct_buf_rx_rsp_event_handler
The function target_if_direct_buf_rx_rsp_event_handler() handles
the WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID event from target.
This function calls extract_dbr_buf_release_fixed_tlv() to copy
the module id, pdev id number of buffer release entry and number
of meta data release entries. The value of module id is used to
index the array dbr_mod_param to get the value of mod_param.
So if the module id value greater than dbr_pdev_obj->num_modules
could result in possible OOB.

Validate mod_id received in the fixed param of the event
WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID against
dbr_pdev_obj->num_modules.

Change-Id: I1c2c0a2a9c98d8b787496aba7a7c4f8fd781de16
CRs-Fixed: 2428798
2019-05-16 12:43:19 -07:00
Chaitanya Kiran Godavarthi
70aeda1cdd qcacmn: Handle BSS peer in STA mode
1. Set BSS peer for AP during peer-create and for STA in peer-map handler
2. Set Self peer in STA mode
3. Avoid tid cleanup in STA mode
4. Remove redundant selfmac checks in Rx
5. In MEC event handler add a check to ignore MEC events
    when STA is not connected.

Change-Id: I2a34b4742d9dedaa0709c1f4c87f3a06b794f36b
2019-05-16 07:45:55 -07:00
Kiran Venkatappa
110d691272 qcacmn: Increase CE1 buffers to 512 for qca8074
CE1 is used for HTT RX after initial HTC control exchange. Hence
increase it back to 512. This reverts  the change
I2b3a58c1d7a914194d842824945d12ae7c9ebb05

Change-Id: Idd7fdcb45f2f8d4188d4e36431b92b6ee443a982
CRs-Fixed: 2450563
2019-05-16 05:57:37 -07:00
Jianmin Zhu
787c7cdb43 qcacmn: Free serial cmd before its timer when rmmod
Rmmod process:
wlan_hdd_pld_remove --> hdd_stop_adapter --> hdd_vdev_destroy
--> WLAN_SER_CMD_DEL_STA_SESSION (25) cmd queued --> PLD_FW_DOWN
(will complete wait event as part of qdf_complete_wait_events)
--> hdd_wlan_stop_modules --> cds_disable -->
dispatcher_psoc_disable --> wlan_serialization_psoc_disable -->
wlan_serialization_timer_destroy --> umac_stop --> csr_stop -->
wlan_ser_cancel_non_scan_cmd -> check if timer is present but th
 timer are already destroyed, so assert.

Move wlan_serialization_purge_cmd_list into converged API file to
be shared by MCC and WIN.

Change-Id: Iad557e4a05d682c257be0c39049c52950e5eb530
CRs-Fixed: 2451058
2019-05-16 05:57:33 -07:00
Karunakar Dasineni
1cd51ddb7c qcacmn: Optimize SRNG memory allocation
To avoid higher order allocations, allocate extra
bytes for base address alignment only if unaligned
address is returned.

Change-Id: I185e58150952cd7e1ae0039e4382973465de5f68
2019-05-15 21:34:36 -07:00
Surya Prakash Raajen
b9780dd207 qcacmn: Update Tx rate only when tid is valid data tid
Update the tx rate only when tid is between 0-7 data tid
or 15 a valid one

Change-Id: I5cc23f6b4fc170d6306d3420c27b879704a0dbf4
CRs-Fixed: 2436934
2019-05-15 21:34:33 -07:00
nwzhao
ea2ffbb331 qcacmn: skip processing duplicate descriptor in dp_rx_err_mpdu_pop
If there's a HW duplicate rx descriptor from hardware,
it'll cause a NULL pointer issue in
__dma_inv_range in dp_rxdma_err_process.
In this case, skip procssing it as a workaround.

CRs-Fixed: 2398327
Change-Id: I5639e5fc9a3a06e6762448ec7cb2ea58d9ae8160
2019-05-15 21:34:29 -07:00
Naga
f1313ba77e qcacmn: Add change to avoid sending wmi cmd
Add change to avoid send wmi command in case
of vdev start, multi vdev restart, stop and delete
when vdev_mlme object is NULL.

Change-Id: Iaa3d3f56fb9caf37b933f029c57311edef0281b4
CRs-Fixed: 2443599
2019-05-15 05:47:17 -07:00
Pranita Solanke
71371bc4ad qcacmn: Removal of CONFIG WIN macro
Move WIN specific structures out of common datapath, WDI_ENUM
into common datapath and remove WIN specific header files inclusion

Change-Id: I8a0d9db4970f3ea9d966337caf178ebce55c28c5
2019-05-15 05:47:13 -07:00
Nirav Shah
0811d82877 qcacmn: Fix multiple unmap of same netbuf
Clear HTC_TX_PACKET_FLAG_FIXUP_NETBUF flag in
hif_send_head failure scenario to avoid
multiple unamap of same netbuf.

Change-Id: Id7f6aeba1eff0d23b76927fcbb03643409fc7859
CRs-Fixed: 2437034
2019-05-14 23:57:59 -07:00
Akshay Kosigi
4a994eff88 qcacmn: Add change to send target if response to HOST
Add code to enable sending target_if vdev response to host,
if FW fails to send response within expiry time.
Move timer free functionality to vdev destroy path so as
to make the system not to go into deadlock

Change-Id: I72bdecf2502a755ffc09414f8b72d230bf9c559f
Crs-Fixed: 2449238
2019-05-14 23:57:56 -07:00
Mohit Khanna
e5a6e94464 qcacmn: Restrict RX softirq poll times
The following changes are made

-Yield dp_rx_process if poll time exceeds
-Yield dp_tx_comp_handler if poll time exceeds
-Interrupt statistics to track various interrupt contexts and
 corresponding interrupt masks
-Add poll times histogram buckets to NAPI stats

Change-Id: I8c7a6bbbb97c7b3dd1dde6ac3a97113c433086a2
CRs-Fixed: 2423879
2019-05-14 18:39:59 -07:00
Venkata Sharath Chandra Manchala
bedc0cd113 qcacmn: Move statistics to dp_stats file
Move dump_stats API to dp_stats.c file.

Change-Id: I7cc3f438c58bb8e2521b7042472dd8436f513e58
CRs-Fixed: 2451204
2019-05-14 18:39:54 -07:00
Karunakar Dasineni
8075637d77 qcacmn: Add DP structures to minidump
Add calls to log some data-path structures to minidump.

Change-Id: Ib94e22e9e44ad314eaaff3d6ab57f2c60082e8ec
CRs-Fixed: 2444081
2019-05-14 16:23:09 -07:00
Karunakar Dasineni
23d22c6d8a qcacmn: Add minidump support in QDF
Add QDF wrappers for minidump logging, which logs
memory locations to be collected as part of minidump.

Change-Id: I2c6b648d3fbb3aed9aaf7eb4872df5befcae971f
CRs-Fixed: 2444081
2019-05-14 16:23:05 -07:00
Arun Kumar Khandavalli
52ac4710fa qcacmn: Move osif priv deallocation to vdev destroy
osif priv is allocated as part of the vdev object and freed as part of
the logical vdev deletion. There is a race condition where in a
component
holding the reference to the vdev is trying to do an operation using
the osif priv. But in the other thread osif priv can be freed.
This can lead to null pointer exception.

Hence, move the osif priv deletion to the vdev physical destroy.
Change-Id: Iea3fd87cb272a51c5691ee2e39a590861c1b1637
CRs-Fixed: 2449996
2019-05-14 13:03:20 -07:00
Arif Hussain
2fcbb3f715 qcacmn: Add SSR protection to os_if_wifi_pos_callback()
Protect SSR protection for wifi pos callback function to prevent
possible race condition between user request and driver unload.

Change-Id: I68d3636429f8891f0a4d6c78642aeecf7d67e105
CRs-Fixed: 2349354
2019-05-14 11:15:56 -07:00
Rajeev Kumar Sirasanagandla
f3ed004380 qcacmn: Fix possible NULL dereference in apf read
While processing WMI_BPF_GET_VDEV_WORK_MEMORY_RESP_EVENTID,
in wma_apf_read_work_memory_event_handler() apf read callback is
invoked after wmi_extract_apf_read_memory_resp_event_tlv().

During extraction of apf attributes there is no NULL check of data
tlv when data length is non-zero. If the firmware message is wrongly
crafted with non-zero length in fixed param and NULL data then NULL
pointer dereference is seen in apf read callback.

To address this, avoid copy when data is NULL and data length is
non-zero.

Change-Id: Ie054c487ead5c929e5a293651a65383d6f87dc71
CRs-Fixed: 2446019
2019-05-14 11:15:52 -07:00
Ankit Kumar
f90c944dad qcacmn: Access msdu_len from struct cb to avoid cache miss
We are accessing nbuf_len field for every nbuf
and which causes cache hit as we are accessing
it not from 1st cache line. This field is present
in struct cb. Lets access it from here to avoid
cache miss.

Change-Id: I21a81d844a4cc755a0ca0c156bd3f4d5702fd913
CRs-fixed: 2449717
2019-05-14 05:46:31 -07:00
Shashikala Prabhu
3f2ceb8b9f qcacmn: Fix deadlock due to peer_ref_mutex and scn_lock
Deadlock happens when control path takes scn_lock and calls
dp_peer_unref_delete() which in tern tries to acquire peer_ref_mutex.
At the same time, if other core starts handling peer_unmap by acquiring
peer_ref_mutex and calls dp_reset_and_release_peer_mem() which in turn
calls ol_ath_node_free() and tries to acquire scn_lock leading to a
deadlock.

Fix this by unlocking peer_ref_mutex before calling
dp_reset_and_release_peer_mem().

Change-Id: I343a8ef8f0914f9245a06b2818c9cbbe1db5218f
CRs-Fixed: 2449878
2019-05-14 03:52:01 -07:00
bings
47c737dba8 qcacmn: Add ini to honour NL80211 scan policy flags
Currently dwell time is determined by scan policy flags from kernel.
Sometimes when we suspect the scan result is not full enough, we need
to set dwell time by force through ini.

Add ini to decide whether to honour NL80211 scan policy flags, so that
we can disable dwell time changed by scan policy flag from kernel.

Change-Id: Ia0b9f957a7de901513479522e008e4bcbd6b2c0e
CRs-Fixed: 2428630
2019-05-13 14:41:41 -07:00
sheenam monga
af7c3c95d9 qcacmn: Add new attribute for roam reason
Currently, there is no attribute to get information for roam reason.

Atrribute QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REASON is added in
QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH command to inform
the roam reason. An enum qca_roam_reason is defined for the valid
values of the QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_ROAM_REASON.

Change-Id: I7f51e1c0905840235098600530bb027f6badb76e
CRs-Fixed: 2425898
2019-05-13 14:41:37 -07:00
phadiman
b68fa39efd qcacmn: Add DFS Radar Event Notifications
Add event notifications to userspace
    1. Radar Detect
    2. CAC Start
    3. CAC Complete
    4. NOL Start
    5. NOL Complete

CRs-Fixed: 2448199
Change-Id: I5deaa53c922fe4e149e7198b287e31d3876d49d4
2019-05-13 13:11:38 -07:00
Venkata Sharath Chandra Manchala
ec01bbcfbe qcacmn: Copy HTC Packet data
Make a local copy of HTC buffer before giving it
to Firmware through CE

Change-Id: Ib11ee7f0d7cd7b055768c0fe10627b81383257f3
CRs-Fixed: 2434881
2019-05-13 13:11:33 -07:00
Ankit Kumar
b374429155 qcacmn: Use ENABLE_DP_HIST_STATS to enable histogram functions
At present, DP_STATS_XXX and DP_HIST_XXX can be disabled
or enabled at the same time using macro DISABLE_DP_STATS.
Make DP_STATS_XXX and DP_HIST_XXX under different macro
so that both can be enabled/disabled separately.

HIST_STATS are by default disabled and can be enabled by
enabling ENABLE_DP_HIST_STATS macro.

Change-Id: I4e7b817afef040407a496e268f2fd680791fc47b
CRs-fixed: 2449710
2019-05-13 03:31:52 -07:00
Surya Prakash
4e517d7795 qcacmn: Use arrays for param conversion from host to target type
Convert host param id to target param id using arrays
instead of switch case. This enables removal of CONFIG_MCL
compile time macro and use specific macro
ENABLE_HOST_TO_TARGET_CONVERSION for conversions

Change-Id: I223141d47e92521e6600fc0e160ab2deef43d7d2
CRs-Fixed: 2418030
2019-05-13 03:31:48 -07:00
Santosh Anbu
261451a46c qcacmn: Add API to fetch logically deleted peer list of a vdev
Add API to fetch the logically deleted peer list for a given vdev
and also add change to move peer delete request and response
related stats from pdev to vdev layer

Change-Id: Ibaac286a1e6ca86988b223055c15a6b9ba6cf4b9
CRs-Fixed: 2448111
2019-05-13 03:31:44 -07:00
sheenam monga
57effefdba qcacmn: Fix reachable Assert in convert_target_pdev_id_to_host_pdev_id
Currently, If invalid pdev_id is passed to
convert_target_pdev_id_to_host_pdev_id it results into Assert.

Fix is to remove QDF_ASSERT(0) in convert_target_pdev_id_to_host_pdev_id.
Return WMI_HOST_PDEV_ID_INVALID if convert_target_pdev_id_to_host_pdev_id
receives invalid pdev id.

Change-Id: Icb6a75c3f3664596fbba4532f5b29ed626ba28f2
CRs-Fixed: 2428787
2019-05-13 03:31:40 -07:00
Abhinav Kumar
88e3fc5032 qcacmn: Add QCA vendor command to support beacon reporting feature
Add a QCA vendor sub command QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING
to implement beacon reporting feature. Different operations required to
implement this feature can be specified in
QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_OP_TYPE.

Userspace requests the driver/firmware to periodically report received
Beacon frames whose BSSID matches the current connected BSS's MAC
address. If userspace requests the driver/firmware to send beacon
reports actively, the driver encapsulates the details of the beacon in
an event and sends it to userspace asynchronously. Otherwise, the driver
will only update the beacon in cfg80211 scan cache but will not send any
event to userspace.

If this command is not issued, the current behavior of the
driver/firmware is to update the cfg80211 scan cache only when there is
a scan issued by the host in progress or whenever there is a change in
IEs of the Beacon frames from the current connected BSS.

The userspace requests the driver/firmware to stop reporting beacons
when reporting is not required anymore. If the driver/firmware is not
able to receive Beacon frames because of other Wi-Fi operations such as
off-channel activities, etc., the driver/firmware sends a pause event to
userspace and stops reporting Beacon frames. The driver/firmware
indicates whether the beacon reporting automatically resumes later by
using the QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES flag. If
userspace doesn't want the beacon reporting to be resumed automatically,
userspace can send QCA_WLAN_VENDOR_BEACON_REPORTING_OP_STOP command to
the driver to stop beacon reporting.

Change-Id: Iaefecc744ba07bb573a98fd5e6e4705b16f8d2c8
CRs-Fixed: 2446114
2019-05-10 19:07:17 -07:00
Srinivas Pitla
011b676abe qcacmn: On CSA complete, MLME can choose to disconnect peers
CSA on DFS channels requires CAC period after RESTART response, stations
can leave during CAC period, but AP would not receive, as it moves to new
channel. Here, MLME can choose to disconnect peers.

This change moves VDEV SM to SUSPEND_RESTART substate from CSA_RESTART
if MLME chooses to disconnect peers.

Change-Id: If4a57545007bbfd0dbc8e5cc498e2741283bcfcc
CRs-Fixed: 2446744
2019-05-10 16:28:48 -07:00
Gurumoorthi Gnanasambandhan
d9ee8fd96b qcacmn: Add option to set high priority scan
For enhanced  repeater independent mode scan request
from wpa_supplicant needs to be set in high priority scan.

Change-Id: I4f95d0e7b2f1d9eb68ed14efd4ee3932ced5af61
CRs-Fixed: 2432916
2019-05-10 16:28:44 -07:00
nobelj
debe2b3b9c qcacmn: support enhance TX capture
support TX capture mode to deliver msdu along with meta data.

Change-Id: Ic84416cc4892e37bfb831dada136a4ff6b615a61
2019-05-10 12:39:30 -07:00
gaurank kathpalia
c2dac1c92b qcacmn: Add filter logic according to timestamp in scan
Currently the driver does not have any mechanism to filter
out the scan results according to the age.

Add a logic in the scan filter API, to filter out the scan
result according to the age threshold, so that APs which
are older than a particular value are filtered out.

Change-Id: If3f4b372b28a0f75b1d70915df4e3e1a7e518931
CRs-Fixed: 2447988
2019-05-09 04:59:10 -07:00
Vivek
16ad475315 qcacmn: Return on failure of releasing reference of object
The release ref APIs for an object first checks,
if the caller is holding a ref, and if yes, it decrements
the count.

If not, there is an error print and an assert, and if the assert is
disabled, the total ref count is decremented in the code, which could
lead to the object getting destoyed, even when it is being used or
some other component holding its ref.

So, if release ref API for an object is called by a component, which
is not holding the ref, we should return, so its handled correctly
even when assert is disabled.

Change-Id: I90de5c1b2e485e80c4b3138fc0fd99f5509d06a2
CRs-Fixed: 2417616
2019-05-08 04:47:19 -07:00
Tallapragada Kalyan
7147b3ccbf qcacmn: RX optimization changes to reduce cache misses
certain fields are now retrieved from reo_destination
ring to nbuf cb. This avoids accessing the RX_TLVs
which are spread across two cache lines. This is
helping improve small pkt (64 byte) performance.

Change-Id: Iee95813356c3dd90ab2e8a2756913def89710fb1
CRs-Fixed: 2426703
2019-05-08 04:47:16 -07:00
Naga
35fa197776 qcacmn: Add change to remove setting txbf
Add change to remove setting txbf irrespective
of opmode before sending vdev up cmd

Change-Id: Ic5b604fb34456203f1afda759ab81595ef1ccd04
CRs-Fixed: 2446756
2019-05-08 04:47:12 -07:00
Bala Venkatesh
c88eb85707 qcacmn: Stop ROC timer synchronously
Mc timer is used to initialize the p2p roc timer.
And the actual timer runs in the soft irq thread and
when the timer exipres it posts the message to mc thread.
Currently, qdf_mc_timer_stop is called to stop the timer.
It calls the del_timer internally to delete the timer.
del_timer() ensures that the given timer is not queued
to run anywhere in the system. But the callback may
be running on another CPU core can create race conditions.

So use del_timer_sync to delete the roc timer.

Change-Id: I2c0fd6e335fc342a3acf06ede534c84d40e19346
CRs-Fixed: 2447236
2019-05-08 02:51:46 -07:00
Visudha Sathurappan
fbd467f5a6 qcacmn: Fix compilation errors when ATH_SUPPORT_DFS is disabled
Fix compilation errors when disabling ATH_SUPPORT_DFS

Change-Id: I229ae5086070badec899b5b95be3ce389a3247ba
2019-05-08 02:51:43 -07:00
Yeshwanth Sriram Guntuka
bc70137f9e qcacmn: Set hidden ssid flag in vdev restart for SAP CSA scenario
SAP configured in hidden ssid mode sends probe response to
BC probe requests after force SCC. In send_vdev_start_cmd_tlv,
triggered as part of set_channel on SAP interface, host does not
set the hidden_ssid flag in vdev_restart scenario which results
in the aforementioned behavior.

Fix is to set the hidden ssid flag in vdev_restart scenario
as well for channel switch on SAP interface.

Change-Id: I6c8126f6df05b8794a89690a6fe320be1f02c356
CRs-Fixed: 2442872
2019-05-07 21:15:11 -07:00
Karunakar Dasineni
4a6eff07b1 qcacmn: Track PPDU ID history for monitor rings
Track PPDU Id history from monitor status and destination
rings, and display as part of monitor stats.

Change-Id: I7b8985f93b1cdb6eb5210bba5a65e9bfb617a710
2019-05-06 14:58:32 -07:00
Varsha Mishra
5827fd091d qcacmn: Set invalid tid in multicast enhancement before enqueueing
Set tid invalid before enqueuing frame to transmit classifier.
When not set to invalid, tid is not classified by HW.

Change-Id: I4fb96a010fed1e0178d7d70a83503e1dcf5f755a
2019-05-06 14:58:28 -07:00
Venkata Sharath Chandra Manchala
3dfc614c3e qcacmn: Reduce trace level for stats
1. Reduce trace level of stats from fatal to info_high
2. Move stats APIs to dp_stats.c

Change-Id: I0b27a254075610fbbafcc8b09b72403ccb83473a
CRs-Fixed: 2446189
2019-05-06 10:44:11 -07:00