Commit Graph

1289 Commits

Author SHA1 Message Date
Amar Singhal
0cb9a5c808 qcacld-3.0: Refine ready event processing
1) Use correct typecast in function wma_process_fw_event_mc_thread_ctx
2) Change log level to debug and refine logs in
 wma_process_fw_event_handler

CRs-Fixed: 2281191
Change-Id: I4e67143d028867b193e42ec51f6f7562287eba82
2018-07-20 09:31:05 -07:00
Abhinav Kumar
68834229f5 qcacld-3.0: fix the beacon corruption in WMA beacon update msg
When beacon is updated the host pass the gSchBeaconFrameBegin
param to WMA to copy the beacon to WMI and pass the value to
firmware. gSchBeaconFrameBegin is global so if we receive new
beacon update in LIM before the WMA process the old beacon
update the values in the global gSchBeaconFrameBegin are
updated as per new beacon. So if there is change in beacon
length the first WMA msg copy the wrong beacon data and send
this corrupt date to firmware.

To fix this instead of passing the global gSchBeaconFrameBegin
fill the beacon date in the beacon update req itself.

Change-Id: I6d196784470d9a2aeeaba76e12577f9f65012bac
CRs-Fixed: 2272448
2018-07-20 09:31:02 -07:00
Sourav Mohapatra
5daec820b0 qcacld-3.0: Remove wma_is_service_enable API
The API wma_is_service_enable is a wrapper on the converged
wmi_service_enabled API for services and extended services. The checks
used in the API are not updated for the converged service enum.

Replace wma_is_service_enable with wmi_service_enabled as there is no
need to have a wrapper

Change-Id: I4fe3601f7e1a031290e139f9ef55f845965b7b2e
CRs-Fixed: 2276471
2018-07-20 00:48:04 -07:00
Dustin Brown
19048bd940 qcacld-3.0: Use an event for WMI ready in WMA
The WMI ready event from firmware currently uses an event queue, but is
being moved to a simple event instead. Update WMA to account for this
change.

See: I08b4f088874b7c63e20b129f14dbac01851496e5

Change-Id: I5242cc0e839b59db990fb918e8029b8f68385de6
CRs-Fixed: 2275468
2018-07-19 23:10:52 -07:00
Jeff Johnson
f7e36d6e4e qcacld-3.0: Refine the P2P LO callback API
The P2P LO Callback currently specifies a void pointer for the event
payload. In the case of this API the event payload is always a struct
sir_p2p_lo_event so update the API to explicitly use this type. In
addition, currently the callback is not using the registered
user-supplied context, so update the callback to correctly use the
user-supplied context.

Change-Id: I566facea3c92b377823c1b3e38f99c84bc65e9d4
CRs-Fixed: 2278587
2018-07-19 00:56:36 -07:00
Chaoli Zhou
5d6bad19a9 qcacld-3.0: Extract spectral phyerr for qca6574
Qca6574 doesn't use phy_err_mask0 to indicate a spectral
scan phyerr, so spectral_phyerr_event_handler will never
be called. So add some logical to extract the correct phyerr
code to obtain the spectral scan results.

Change-Id: Ib1ec1aa98f25827dfe6ab549ff96a5d4139ad106
CRs-Fixed: 2252379
2018-07-18 21:52:51 -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
Min Liu
ffb250d8af qcacld-3.0: Use field-by-field assignment for FW stats
In wma_unified_link_iface_stats_event_handler, FW stats is cast into
some host data structure via memory copy. It could be dangerous since
there could be some mismatch between host and FW data structures.
Update it with field-by-field assignment.

Change-Id: If90c6062551c8769d948b3267dfa323fba310a78
CRs-Fixed: 2274034
2018-07-16 22:03:35 -07:00
Kabilan Kannan
ebe01e7a16 qcacld-3.0: Validate SAR2 response event handle
Validate SAR2 response event handle and pass the valid
pointer for result extraction

Change-Id: I91982c411c77494662f6d00de6078622a3d548ae
CRs-Fixed: 2259373
2018-07-13 12:12:42 -07:00
Liangwei Dong
0f9c75d562 qcacld-3.0: Use HW MODE ID to find HW mode info
Firmware reports HW mode ID during HW mode change,
use Policy mgr API to get HW mode Info.

Change-Id: I01c7e346a5c2292490705690bc8261b41d0a8127
CRs-Fixed: 2256189
2018-07-13 08:27:13 -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
Jeff Johnson
17b1239949 qcacld-3.0: Refine the EXT Scan Callback API
Currently the EXT Scan Callback API specifies a void pointer for the
context parameter.  It is fine for an API to use a void pointer for a
data structure that is opaque or a binary blob, but in this case an
HDD handle is always passed, so explicitly reference that type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: I50c16e1259149147537984242f9bd03b3af15d0b
CRs-Fixed: 2277275
2018-07-12 22:26:45 -07:00
Jeff Johnson
959f369ed4 qcacld-3.0: Refine the link layer stats callback API
It is fine for an API to use a void pointer for a data structure that
is opaque or a binary blob, but it is not ok to do so when the type of
the data must be known and agreed upon by both the caller and the
callee. In the case of the link layer stats callback the API
definition uses a void pointer for both the context parameter and the
response parameter, but an HDD handle is always passed as the context
and a tSirLLStatsResults struct is always passed as the response, so
explicitly reference those types. This will allow the compiler to
verify that the correct types of parameters are being passed.

Change-Id: Iba181bbc97331f8fdde1cdf5c81a80efef014839
CRs-Fixed: 2276494
2018-07-12 22:26:38 -07:00
Sravan Kumar Kairam
b8bdf522fc qcacld-3.0: Register target if ops for DP control ops
As part of DP-CP interaction convergence register common
converged target if ops for DP control ops.

Change-Id: Ifbe5d20e32262782016c3b0c20a7d2e149a071c3
CRs-fixed: 2273037
2018-07-12 18:02:02 -07:00
Liangwei Dong
0da1426e7b qcacld-3.0: Enable Host STA OBSS Scan
Enable supplicant STA OBSS Scan
and disable OBSS SCAN WMI command sending
if Firmware doesn't support OBSS scan offload.

Change-Id: Id8fde7301d307c355b9f6cf82b85854a6d84ca79
CRs-Fixed: 2275065
2018-07-11 23:36:18 -07:00
Dustin Brown
ef8448da63 qcacld-3.0: Add modern WMA logging macros
In order to help facilitate the move to per-level logging, add new
logging macros to WMA.

Change-Id: Ie5fa0074f6ace527a84dcc82b332607473615d7c
CRs-Fixed: 2275464
2018-07-11 18:45:30 -07:00
Bala Venkatesh
110b03e0f7 qcacld-3.0: Create object mgr self peer for STA mode
For self STA object manager peer is not created.
To transmit some frames before association object manager
peer is required in wlan_mgmt_txrx_mgmt_frame_tx.
So, create self STA obj manager peer as part of vdev attach.

CRs-Fixed: 2276106
Change-Id: If34e039e1bbadcafabd1f86579c7d639256c9267
2018-07-11 14:28:52 -07:00
Krunal Soni
d90ed4ea85 qcacld-3.0: Fix peer ref-count while deleting peer as part of LFR3
There are two instances where peer ref counting leak has been observed
1) When DUT-STA is connected to AP1 and if it tries to roam to AP2 or
   to same AP1 then as part of roam sync indication, it needs to delete
   the old peer and create the new peer. Deletion of old peer is
   happening through force delete operation which is No-OP for some of
   the platforms. In such cases, do normal peer delete operation, so
   that peer ref count can be deleted properly.

CRs-Fixed: 2270761
Change-Id: Ibcad72943258e531e29498961d3d7e692fd05b36
2018-07-10 18:41:42 -07:00
Lin Bai
772fbaf169 qcacld-3.0: NULL pointer dereferenced when starting 11ax SAP
BSS Desc pointer will be NULL when starting SAP, in function
csr_roam_issue_start_bss(). And it is causing NULL pointer
dereference when get bss channel number from BSS Desc.

Get channel number from csr_roamstart_bssparams instead.

CRs-Fixed: 2272749
Change-Id: Idf4eeb21f1298db03a030af72bf9f0a530ba3e68
2018-07-10 18:41:39 -07:00
Kabilan Kannan
8de9238d10 qcacld-3.0: Do not call wma_remove_peer(), when peer is invalid
Do not call wma_remove_peer() function, when TDLS peer
is invalid.

Change-Id: I8dba5b9db0b55b8dd21a876dea9f7861e67434eb
CRs-Fixed: 2271733
2018-07-09 15:55:27 -07:00
Wu Gao
b422f77258 qcacld-3.0: Check txrx vdev pointer before tx mgmt frame
It get NULL pointer to txrx vdev when Rome platform tx mgmt frame in
cdp_mgmt_send_ext, and then DUT broken since access NULL pointer.
So, add protection before call cdp_mgmt_send_ext.

Change-Id: Ia51a8183bf89115a4f0f3520b80186daa379602d
CRs-Fixed: 2265687
2018-07-09 09:57:20 -07:00
jsreekum
ac44b92ac6 qcacld-3.0: Add default target configs for Genoa
Add Genoa specific default target configurations for
offload configs, max tx pattern config and max sta
vdev config

Change-Id: Id682b1103d87021e207de335721805515db6a932
CRs-Fixed: 2258999
2018-07-09 08:31:10 -07:00
Kiran Kumar Lokere
1a43bcf236 qcacld-3.0: Add support for SRD channels in ETSI domain
Add support for SRD channels in ETSI regulatory domain

1) Add SRD channels only if DSRC feature is disabled.
2) Add user configuration to enable/disable these channels
in master mode PCL/ACS. Default is disabled.
3) Allow these channels in ACS/PCL only if the INI is set.

Change-Id: Ibd79dc95e9911ce3a0fd101f4716d9bbb8b75466
CRs-Fixed: 2264786
2018-07-05 20:49:25 -07:00
Jeff Johnson
75873e9608 qcacld-3.0: Replace wmi_unified_nat_keepalive_enable()
There are multiple issues with wmi_unified_nat_keepalive_enable():
1) WMA global functions should have a wma_ prefix.
2) The function prototype indicates it should return int status, and
   the one caller, wma_add_sta_req_sta_mode(), is expecting that, but
   it actually returns QDF_STATUS.
3) The function is a very thin wrapper that calls the unified WMI API
   wmi_unified_nat_keepalive_en_cmd() and hence adds no real value.

Rather than address these issues, just remove the function and update
wma_add_sta_req_sta_mode() to directly call the unified WMI API
wmi_unified_nat_keepalive_en_cmd().

Change-Id: I13a4140ba6343240bde51704af2921c001f66a21
CRs-Fixed: 2271552
2018-07-05 10:00:59 -07:00
Jeff Johnson
6aaaa997e4 qcacld-3.0: Rename hHdd to hdd_handle
Rename hHdd to hdd_handle to avoid camelCase.

Change-Id: I338b39e128dbd3c1560695fcbb49c5a4bc470169
CRs-Fixed: 2271551
2018-07-03 16:36:35 -07:00
Dundi Raviteja
3566823ebe qcacld-3.0: OOB read while processing extscan change results
In function wma_extscan_change_results_event_handler(), numResults
in dest_chglist is assigning as total_entries in the event, but the
memory allocated to dest_chglist is based on the numap variable,
which may cause out of buffer read in extscan indication callback
function wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind().

Also tSirWifiSignificantChange array parsing in both the functions
is not efficient which may lead to accessing unallocated memory.

To address out of buffer read, assign numap to numResults in
dest_chglist and to address accessing of unallocated memory,
parse tSirWifiSignificantChange array with efficient logic.

Change-Id: Ia0c287147e80e17de84fe6b1cb83c8e3c29a1fa0
CRs-Fixed: 2253396
2018-07-03 13:42:14 -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
Jinwei Chen
ef742dc73c qcacld-3.0: Fix sme_update_tgt_he_cap param and indent
Fix checkpatch issue introduced by change "qcacld-3.0:
separate HE caps per band", use new mac_handle_t instead
of tHalHandle in sme_update_tgt_he_cap param and fix
indent issue.

Change-Id: I91e11fd38ac72266b4afcf42d71340975127f559
CRs-Fixed: 2268400
2018-07-02 08:45:32 -07:00
Amar Singhal
4228c39d30 qcacld-3.0: Check for wmi_ready before processing wmi messages
If wmi_ready is not set, we can infer that WMI_READY_EVENTID has not
been fully processed yet. Completion of WMI_READY_EVENTID is necessary
for any follow-on messages to be processed properly, since it builds
infrastructure on host. Therefore, serialize the follow-on message with
WMI_READY_EVENT if wmi_ready is not set yet.

CRs-Fixed: 2267180
Change-Id: I2e5df318f8e40a9487502a49539252c9fde9892b
2018-06-30 00:17:50 -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
Kabilan Kannan
caa8550b4c qcacld-3.0: Add SAR V2 support
Add changes to support SAR V2 power limits.

Change-Id: I35f8a194ac9c53c8fd564bd301398b78fa995bed
CRs-Fixed: 2217067
2018-06-29 13:31:37 -07:00
Arif Hussain
baf28b8ec0 qcacld-3.0: Send dfs offload enable command based on ready event
Send dfs offload enable command to firmware after receiving
ready event.

Change-Id: I8bec60543f4514ddb30a2cdcb1ccab9260130ca8
CRs-Fixed: 2269832
2018-06-28 17:49:53 -07:00
Vignesh Viswanathan
e92b6cec9d qcacld-3.0: Send roam_scan_mode as 0 for RSO Stop during disconnect
Currently if disconnet is triggered from the supplicant, RSO Stop
is sent with reason REASON_ROAM_STOP_ALL and this sends roam_scan_mode
as 0 to the FW.
However, if disconnect is triggered from the LIM/FW, the RSO Stop
is sent with reason REASON_DISCONNECTED and leads to roam_scan_mode
being sent as 4 which does not disable RSO in the FW.
In STA+STA scenario where vdev0 receives a disconnect from LIM,
RSO is not stopped for vdev0, however driver goes ahead to enable
RSO for vdev1, which leads to FW assert.

Send roam_scan_mode as 0 for RSO Stop command with REASON_DISCONNECTED
also.

Change-Id: Id2147653ecbd91e033f42382aa00a717d280f6e6
CRs-Fixed: 2266778
2018-06-28 16:38:23 -07:00
Anurag Chouhan
47cb171622 qcacld-3.0: Fix compilation error for LE targets
Fix compilation errors for the LE target.

Change-Id: Id6e6d88fba3c70ee0f680a19dfa0c1ab29e34a02
2018-06-28 03:10:51 -07:00
Vignesh Viswanathan
ba40f4b509 qcacld-3.0: Reset fw_peer_count for HO failure during del BSS
Currently fw_peer_count for HO failure is done in wma_roam_ho_fail_handler
which can lead to improper reset of the fw_peer_count if a HDD triggered
disassoc is in progress for the same peer leading to fw_peer_count going
to -1.

Reset the fw_peer_count for HO failure case in wma_delete_bss_ho_fail
API as this is called from the CSR/LIM for handling HO failure as
part of CSR disconnect.

Change-Id: I1526757b085086ca51eef9b9cca0ea757ed20b61
CRs-Fixed: 2266337
2018-06-26 18:53:21 -07:00
Hanumanth Reddy Pothula
834f943961 qcacld-3.0: Report valid MCS index to upper layer
While processing get_station cfg operation, HDD is using Nss
value, which gets updated during association, to calculate data
rate. So, there is a possibility of driver to report invalid
MCS index to upper layer if association happens with Nss 2 and
when data transmission is happening at Nss 1 rate.

On receiving GET STATS response, calculate Nss value based upon
the current data rate received from firmware, and pass it to HDD,
so that HDD can use the same Nss value to report valid MCS index
to the upper layer.

Change-Id: I62f029d53149a4747f619027ce69ce65fb280b8d
CRs-Fixed: 2250993
2018-06-22 21:07:13 -07:00
Abhishek Singh
38da980436 qcacld-3.0: Fix peer use after free in wma_is_ccmp_pn_replay_attack
In wma_is_ccmp_pn_replay_attack peer is used without taking the ref
count and thus this can lead to peer used after free.

Fix this by taking ref of peer before using the peer in
wma_is_ccmp_pn_replay_attack and release ref once access is done.

Change-Id: Iaa5936a1c7f6f8667a68fcb646eaec4cb3aa5469
CRs-Fixed: 2264434
2018-06-22 17:29:02 -07:00
Naveen Rawat
e9d642342d qcacld-3.0: Fix NDI self-peer creation sequence
Make sure to follow AP for NDI self peer creation so that self peer
creation and deletion can be symmetric.

Change-Id: Ie7f9c7b5500540c824a75758337967f8d4f6e692
CRs-Fixed: 2261713
2018-06-22 10:32:34 -07:00
Arif Hussain
db6e4e96b4 qcacld-3.0: Send dfs offload enable command based on service bit
Send dfs offload enable command to firmware if phyerror offload
service bit is enabled.

Change-Id: If84164ae6dec8585e5895ee526750df5b15c201f
CRs-Fixed: 2264638
2018-06-21 22:42:11 -07:00
Varun Reddy Yeturu
4f849e5032 qcacld-3.0: Send Peer TWT caps in PEER ASSOC
Parse the association response frame to read the
peer TWT extended capabilities and fill them in
the WMI PEER ASSOC command and send it to the
firmware.

Change-Id: I07f21010abbdaa20e212abae127009dd11e6ab7d
CRs-Fixed: 2264690
2018-06-21 19:57:54 -07:00
Dustin Brown
576eea4d4f qcacld-3.0: Demote hardware capability logs
Hardware capability logs in WMA are currently logged at info level. To
avoid spamming the console logs, reduce these logs to debug level.

Change-Id: I57c9a3712bde728695ef79aab495a429b8ef79e4
CRs-Fixed: 2265455
2018-06-21 19:57:47 -07:00
gaurank kathpalia
89d3c32488 qcacld-3.0: Move objmgr create/delete from HDD->WMA
Currently the driver creates and deletes the objmgr peer
in HDD layer. According to the latest requirement, the CDP
peer create/delete needs the pointer of objmgr peer, which
thus has to created before CDP peer create, and deleted
after CDP peer delete, which is done in WMA layer.

Remove the objmgr peer create/delete from HDD, and move it
to the WMA layer.

Change-Id: I5bd62a83864e09a3728109e2deec2adf4bb899b5
CRs-Fixed: 2264892
2018-06-21 13:52:08 -07:00
Nachiket Kukade
01becb9bf0 qcacld-3.0: Cleanup dtim configuration during suspend and resume
Currently while going to suspend, dtim parameters are not
correctly getting configured. Some other parameters to config
like the inactivity timeout are completely skipped as well.

Cleanly port the setting of dtim and other parameters during
suspend and resume.

Change-Id: Ic41a8ace3f5650e53f2dcaa416bfe241b87aa88d
CRs-Fixed: 2248160
2018-06-21 12:35:44 -07:00
Nachiket Kukade
4b7c8e03c7 qcacld-3.0: Port modulated dtim and override listen interval
Port modulated dtim and override listen interval to PMO from
WMA.

Change-Id: Id965dd8ee0fbddfa563335fd2fe225dcd20cd162
CRs-Fixed: 2252788
2018-06-21 12:35:40 -07:00
Jinwei Chen
998a1a0e95 qcacld-3.0: separate HE caps per band
currently some HE capability is shared same value from
MIN value of 2G and 5G capability, separate them per band.

Change-Id: I37831b4044d4ca2deaf5015fb44227c824996136
CRs-Fixed: 2239070
2018-06-21 01:58:50 -07:00
Qiwei Cai
3719efe9e3 qcacld-3.0: Featurize WLAN_FEATURE_LINK_LAYER_STATS
Featurize WLAN_FEATURE_LINK_LAYER_STATS to compile out
in mission mode.

Change-Id: If0f27efa3661f4b3083180690160109084c5da67
CRs-Fixed: 2255035
2018-06-21 00:24:23 -07:00
Nachiket Kukade
177b5b06c4 qcacld-3.0: Add support for Android Packet Filter v3
Android Packet Filter 3.0 requires the framework to be able
to read and write into the APF work memory in the Firmware.
It also requires to be able to enable or disable the
interpreter.

Add support for the new read/write/enable/disable operations.

Change-Id: Ic72243b918f4a8385a92b803a1ca3c5305423b52
CRs-Fixed: 2184969
2018-06-20 11:32:39 -07:00
Pragaspathi Thilagaraj
f65cffe88c qcacld-3.0: Fix mem leak during reset passpoint list wma command
The function sme_reset_passpoint_list, posts the wma message
WMA_RESET_PASSPOINT_LIST_REQ. This message is freed at the
sme_reset_passpoint_list in case of failure. But for the success
case, the req_msg is not freed at wma_mc_process_msg. This
results in mem_leak in case of success case.

Free the req_msg at wma_mc_process_msg after returning from the
call wma_reset_passpoint_network_list.

Change-Id: Ib4b427a8acc2d531ac9d6e8f92a30205163ec0ba
CRs-Fixed: 2259237
2018-06-20 04:05:28 -07:00
Varun Reddy Yeturu
d33033f7d0 qcacld-3.0: Kbuild changes for TWT
Add the compilation flags for TWT feature to Kbuild.
Based on the compilation flag, include the source
files for compilation and also include the header
files path.

Change-Id: I45991b3c9e49e2aa0ff51a2650fde69ea447bf15
CRs-Fixed: 2238302
2018-06-20 00:42:47 -07:00
Varun Reddy Yeturu
3c9f89cfbf qcacld-3.0: Process TWT enable complete event
Process the TWT enable complete event sent by the
firmware after enabling TWT.
Set the appropriate state for TWT so that it can
be used later to check if TWT is enabled or not
in the target.

Change-Id: I924387d6afc2bf80efec0fce36ea907c6932dcda
CRs-Fixed: 2238302
2018-06-20 00:42:44 -07:00