Commit Graph

1207 Commits

Author SHA1 Message Date
Sandeep Puligilla
8e89d57e0e qcacld-3.0: Add spectral scan feature flag
Add spectral scan feature flag which can be
used to control the feature through build options.

Change-Id: Ide13e958cffff610626c891041307b40ac94c47d
CRs-Fixed: 2232167
2018-06-06 23:49:01 -07:00
Jeff Johnson
8abc59300e qcacld-3.0: Tighten the wma_tgt_cfg_cb API
Currently the function typedef wma_tgt_cfg_cb is defined with two void
pointer parameters. However the types of the two parameters are known
to both the sender and the receiver, so fully specify the types of
those parameters.

Change-Id: I7cf7178015084599061b123da7b5f1f453ec5353
CRs-Fixed: 2254954
2018-06-06 20:28:19 -07:00
Jeff Johnson
528c2cfc31 qcacld-3.0: Rename cds_context field pMACContext
Per the Linux coding style "mixed-case names are frowned upon" so
rename field pMACContext in struct cds_context.

Change-Id: I50007d80d12276b682237d728435203e455a18c9
CRs-Fixed: 2250670
2018-06-06 20:27:27 -07:00
Manjunathappa Prakash
a0cbc92c6b qcacld-3.0: Add HDD flow pool map/unmap for policy manger
Add HDD flow pool map and unmap functions. These are registered
with the policy manager (via CDS) so that lithium_dp vdev flow pools are
created/deleted when vdev become active/not-active under the control of
the policy manager

Change-Id: I1ff6b3bafa78df68fbf9a221ac0d001bd5a06d8d
CRs-Fixed: 2240815
2018-06-06 05:49:20 -07:00
Jeff Johnson
2b6982c4a5 qcacld-3.0: Replace references to cds context typedefs
To align with the Linux Kernel coding style replace typedefs
cds_context_type and p_cds_contextType with a reference to the
underlying struct.

Change-Id: Ifc85a9bbecd29614835ed9e61ab143d0387e82b0
CRs-Fixed: 2250667
2018-06-04 13:58:45 -07:00
Krunal Soni
ee5d1ad681 qcacld-3.0: Add debug log to capture vdev attach and detach events
There are certain stability issues reported and from the logs, it
has been concluded that vdev detach is missing which causes memory
leaks.

Add debug logs around vdev attach and detach paths to recognize any
memory leaks.

CRs-Fixed: 2244033
Change-Id: I9ee751fff8f51c7ad2ca2d7ec1e894cbbf60d201
2018-06-01 21:02:43 -07:00
Dundi Raviteja
3bcf3a89e3 qcacld-3.0: Use request manager to get NUD stats
Use request manager for handling get NUD stats

Change-Id: Ie1a15de440803d007d16568138d4a8e7692a30d4
CRs-Fixed: 2246435
2018-06-01 12:02:35 -07:00
Zhu Jianmin
f9e2e2d18f qcacld-3.0: Fix psoc ref count leak in wma_open
In wma_open, first get ref of psoc, then attach wmi, if attach
failed, should release ref of psoc before return

Change-Id: If2e21bbf8b54de865c2b54582685974474ea3c7c
CRs-Fixed: 2250872
2018-06-01 06:34:04 -07:00
wadesong
78cb3c231f qcacld-3.0: Fix a memory leak during driver init
When WMI attaching fails in wma_open, the memory allocated
during invokation of target_if_open should be freed to
avoid a memory leak.

Change-Id: I64e5bbc9714199a1598df55e00586786a30aad35
CRs-fixed: 2237068
2018-05-29 06:50:59 -07:00
Pragaspathi Thilagaraj
961a8b8077 qcacld-3.0: Fix potential NULL dereference in hdd_hostapd_sap_event_cb
In the function hdd_hostapd_sap_event_cb, stainfo is obtained
from hdd_get_stainfo(). This stainfo is dereferenced later to
retrive dhcp_phase later. If the stainfo returned from the
function hdd_get_stainfo is NULL, then a possible NULL pointer
dereference could occur.

Add check to validate stainfo is not NULL.

Change-Id: Ia428142b6ae2545528c5998dcde63845ca592b56
CRs-Fixed:  2233870
2018-05-25 08:21:32 -07:00
Sandeep Puligilla
63c07ee307 Revert "qcacld-3.0: Don't fill any WMA request if target is not ready"
This reverts commit I358841566f858e115b3b04f12f4d8b70b75d1dfc.

Change-Id: I1701fcf0910d47a0bac91bf20d6271c6f6144590
CRs-Fixed: 2246741
2018-05-23 20:45:29 -07:00
Dundi Raviteja
3aa01be35a qcacld-3.0: Remove ini and iwpriv support for changing SIFS burst mode
Remove support for enabling/disabling SIFS burst mode,
SAP DFS channel SIFS burst and SIFS burst duration through
ini parameter as well as through IOCTL

Change-Id: I3d43afa3c0c85eef470a29b9e7ad812079666278
CRs-Fixed: 2238175
2018-05-22 00:45:28 -07:00
Ryan Hsu
c69185569b qcacld-3.0: populate board version information from wmi event
These board information are stored in the board file while the
calibration process. WMI service ready event will now carry them for host.
Append these board version information to the firmware version string.

Change-Id: Ieb5bc480bd0c2e387fcf6990dd192741f0b7cd6b
CRs-fixed: 2218963
2018-05-21 21:47:54 -07:00
Wen Gong
7952fbd708 qcacld-3.0: Add extscan feature flag
Add config flag to enable / disable extscan feature

Change-Id: Icb5087619964b729041e18127baba1b2796ed911
CRs-Fixed: 2226549
2018-05-20 21:55:45 -07:00
Naveen Rawat
fa2a100bac qcacld-3.0: Add implementation of get_station_stats
Add changes to support get station stats from within cp_stats
component.

Change-Id: Id685e9d94f185ee562f21d12d118e94a737a6a7e
CRs-Fixed: 2210338
2018-05-19 10:56:45 -07:00
Naveen Rawat
ea1564b784 qcacld-3.0: Fix tTxrateinfoflags as per linux coding guidelines
Fix tTxrateinfoflags as per linux coding guidelines, this will later
help move the struct to qcacmn.

Change-Id: I1911d25594aaecc7c166cf36b79111b61e6de457
CRs-Fixed: 2244834
2018-05-18 16:46:40 -07:00
Jeff Johnson
c97816c244 qcacld-3.0: wma: Fix misspellings
Address the following issues in the core/wma folder:
CHECK: 'accomodate' may be misspelled - perhaps 'accommodate'?
CHECK: 'acess' may be misspelled - perhaps 'access'?
CHECK: 'catagory' may be misspelled - perhaps 'category'?
CHECK: 'chnage' may be misspelled - perhaps 'change'?
CHECK: 'defintions' may be misspelled - perhaps 'definitions'?
CHECK: 'Intialize' may be misspelled - perhaps 'Initialize'?
CHECK: 'Intial' may be misspelled - perhaps 'Initial'?
CHECK: 'proces' may be misspelled - perhaps 'process'?
CHECK: 'progess' may be misspelled - perhaps 'progress'?
CHECK: 'refrence' may be misspelled - perhaps 'reference'?
CHECK: 'Relevent' may be misspelled - perhaps 'Relevant'?
CHECK: 'reponse' may be misspelled - perhaps 'response'?

Change-Id: Idc314b5a3a6945211581e2135cfaf9d0d5f69457
CRs-Fixed: 2241946
2018-05-18 02:17:05 -07:00
Lin Bai
c135114bad qcacld-3.0: Fix potential risk of AMSDU config
Change "qcacld-3.0: Add support to send A-MSDU aggregation type
to firmware" combines the AMSDU/AMPDU configuration path in WMA
layer, which is causing some ampdu parameters be overwritten by
value of amsdu.

Avoid GEN_VDEV_PARAM_AMSDU handler to touch ampdu parameters.

CRs-Fixed: 2243571
Change-Id: I52119f2bbcb306f5fad704e912c4cbb179c6a369
2018-05-17 21:39:00 -07:00
Wen Gong
9976890a5d qcacld-3.0: Featurize dbglog_host
Featurize parsing support for WLAN firmware logs in WLAN host driver

Change-Id: Ib4f04bd23698e981bc4ab1f8e0d880798d521020
CRs-Fixed: 2228367
2018-05-17 14:26:19 -07:00
gaurank kathpalia
a4a012ca2e qcacld-3.0: Add length check in wma_process_rmf_frame
The driver verifies the replay_attack in protected
management frames in the API wma_is_ccmp_pn_replay_attack
The API expects a CCMP header pointer, but it may happen that
the size of the total frame is less than the size of ieee frame
+ the CCMP header length. In that case the CCMP pointer will
point to some memory location  not allocated to the frame, which
will result to out of bound access.

Fix is to add a length check to memory allocated to wbuf in
wma_process_rmf_frame

Change-Id: I351fa671cb8728843c8843c27dd91bcb201abb42
CRs-Fixed: 2230976
2018-05-17 06:03:33 -07:00
Srinivas Girigowda
e1be8779ca qcacld-3.0: Revive the WoW wakeup logs to appear in kmsg
In the earlier generation of product or qcacld-3.0 code,
the wow related logs which helps debug which is the packet
waking up the APPS used to appear in kmsg and hence part of
the bugreport.

Now in the recent code base, this log is moved to LOGD
which appears in cnss_diag, with this change the ask is
to revive the same logs to appear in kmsg instead of
cnss_diag logs.

Hence move these from Debug to Info. INFO logs appear in kmsg.

Change-Id: Iefcd362209f3f2276d0c2ac53359e0f325122f95
CRs-Fixed: 2225547
2018-05-16 23:19:39 -07:00
Jeff Johnson
3370f3a742 qcacld-3.0: Fix misspellings of 'success'
Fix misspellings
- success => success
- succesful => successful
- succesfull => successful
- succesfully => successfully

Change-Id: Ie74c59650c4784ac6df4599f38487eee90489b23
CRs-Fixed: 2241936
2018-05-16 18:01:12 -07:00
Jeff Johnson
bbca3d503c qcacld-3.0: Fix misspellings of 'unknown'
Fix misspellings 'unknow' => 'unknown'

Change-Id: I7593ddf74df9c7917bd94819953ef0603c15a933
CRs-Fixed: 2240061
2018-05-16 18:00:20 -07:00
Yeshwanth Sriram Guntuka
011904f038 qcacld-3.0: Possible buffer overflow in wma_nan_rsp_event_handler
Check for nan rsp data len does not take TLV header
size into account which could lead to buffer overflow
when copying data where TLV header size is taken into
account.

Fix is to subtract TLV header size and wmi_nan_event_hdr
size from max allowed size when validating nan rsp data
length.

Change-Id: I341779a33ed218fdda5d008e949ced0c8cf05590
CRs-Fixed: 2227248
2018-05-16 10:26:06 -07:00
Min Liu
31c601d2d6 qcacld-3.0: Reset FW peer count when HO failed
For LFR 3.0, when HO failed, peer deletion is handled by FW,
No WMI_PEER_DELETE_CMDID will be sent to FW.
Reset the peer counter when HO failure is reported.

Change-Id: I07cecf3166f40d2bd103a286e4556f95d7465bba
CRs-Fixed: 2240059
2018-05-16 06:46:25 -07:00
Visweswara Tanuku
02e40d282a qcacld-3.0: Do proper cleanup when management frame send failed
qcacld-2.0 to qcacld-3.0 propagation

When Management frame Tx fails, tx_frm_ota_comp_cb is not set NULL
during cleanup, because of which assert is observed since session
is not available

Set tx_frm_ota_comp_cb NULL when Management frame tx fails

Change-Id: I318a6d04cce06955f6751f6f3df746fec50b9434
CRs-Fixed: 2127855
2018-05-16 03:57:10 -07:00
Vignesh Viswanathan
f0ef774994 qcacld-3.0: Remove unused scan_info struct in wma_txrx_node
Remove the unused member scan_info in wma_txrx_node structure.

Change-Id: Ice2c3209620ac7fd9874680b2d976ca363d22695
CRs-Fixed: 2239807
2018-05-16 02:07:38 -07:00
Abhishek Singh
0ac37445d5 qcacld-3.0: Call vdev resp and hold req queue cleanup from MC thread
Vdev resp and hold req queue cleanup is called in kernel thread context
and this may lead to race condition where it may free the wma's iface
structure while MC thread is using the iface.

In case FW down is received during interface delete, driver complete wait
events and thus the interface delete remove the adapter before del sta
self resp is received and thus del sta self resp uses adapter after its
freed.

To avoid this call the vdev resp and hold req queue cleanup from MC
thread. Also call del sta self resp only when driver unload is in
progress. For FW down case the resp is not required.

Change-Id: I711f83c54df29251de365a3137077b3b8d82b448
CRs-Fixed: 2234547
2018-05-15 20:56:20 -07:00
Arif Hussain
0e24680997 qcacld-3.0: Add support to send A-MSDU aggregation type to firmware
Add support to send A-MSDU aggregation type to firmware.

Change-Id: Id97efa6b7ff658b11462f9d6b6c8e79107e5f128
CRs-Fixed: 2234350
2018-05-15 13:54:08 -07:00
Wen Gong
3f00338bf7 qcacld-3.0: Change WLAN_FEATURE_HDD_MEMDUMP_ENABLE
Change WLAN_FEATURE_HDD_MEMDUMP_ENABLE to WLAN_FEATURE_MEMDUMP_ENABLE

Change-Id: Id4ef8de4dc7b566f3b29b9e045c1530c873a426c
CRs-Fixed: 2241236
2018-05-15 10:05:40 -07:00
Yeshwanth Sriram Guntuka
f71b48e505 qcacld-3.0: Possible buffer overflow in wma_stats_ext_event_handler
Check for stats ext info data len does not take TLV header
size into account which could lead to buffer overflow
when copying data where TLV header size is taken into
account.

Fix is to subtract TLV header size and stats_ext_info
size from max allowed size when validating stats ext
info data length.

Change-Id: I34e35a0aab396af3d93a0f61e0ab6a2da09f22ab
CRs-Fixed: 2227263
2018-05-15 03:21:26 -07:00
gaurank kathpalia
d84b0052d3 qcacld-3.0: Allocate extra 100 bytes to add missing IE info
In the API sir_validate_and_rectify_ies, the driver rectifies
the RSN IE, if the AP hasnt filled the RSN capabilities in the
beacon/probe response, but has filled the length of IE as extra
2 bytes meant for the RSN capabilities.The driver tries to repair
these kind of frames and fills the last 2 bytes of RSN IE with
default RSN capabilities, to prevent the failure of unpacking
the IEs in unpack-core. But, the driver may write these default
RSN capabilities into some other allocated memory, because the
allocated memory is only the frame length, which would result
in OOB write.

Fix is to allocate some reserve bytes in the frame
for these type of issues.

Change-Id: I46c7301f3e40f84d2c68ec9ba38702baa6926306
CRs-Fixed: 2232542
2018-05-14 23:15:34 -07:00
Tushnim Bhattacharyya
eb622b0f2f qcacld-3.0: Ignore the csa event when roaming is in progress
Ignore the csa event for the station if roaming is in progress on
the same.

Change-Id: Ibb698589484a6a9df021a00986b89bebcc003b27
CRs-Fixed: 2237556
2018-05-14 21:54:34 -07:00
Vignesh Viswanathan
ea432dda8a qcacld-3.0: Add sanity check for min buf_len in wma_form_rx_packet
In function wma_form_rx_packet, mpdu_data_len is calculated as
(buf_len - mpdu_hdr_len). If the value of buf_len is less than
mpdu_hdr_len, then a integer underflow would occur while calculating
mpdu_data_len.

Add sanity check to return invalid if buf_len is less than mpdu_hdr_len.

Change-Id: I4522eadb65f6cd8b210ba071a91e53008eec042c
CRs-Fixed: 2230318
2018-05-14 19:07:58 -07:00
Dustin Brown
b1032c2cc2 qcacld-3.0: Add management frame wake stats
Track and print WLAN wake stats for management frames received.

Change-Id: I803a4cebbeb4434e25e00dc3826b186dbb17f413
CRs-Fixed: 2234398
2018-05-14 17:59:44 -07:00
hqu
a8d079d93d qcacld-3.0: Always set WMI_ROAM_SCAN_MODE_NONE with RSO_STOP cmd for LFR2.0
For LFR2.0 roaming policy, firmware will indicate roam event with
WMI_ROAM_REASON_SUITABLE_AP reason even ROAM_SCAN_OFFLOAD_STOP cmd
set with WMI_ROAM_SCAN_MODE_ROAMOFFLOAD, it doesn't obey LFR2.0
roaming policy design. Root cause is firmware only disable roam
scan with ROAM_SCAN_OFFLOAD_STOP cmd which must set scan mode with
WMI_ROAM_SCAN_MODE_NONE.

Fix is to always set scan mode with WMI_ROAM_SCAN_MODE_NONE for
LFR2.0 when host send ROAM_SCAN_OFFLOAD_STOP cmd.

Change-Id: Id5e8325f2767023daacd3dbd4104ce768de3857d
CRs-Fixed: 2228315
2018-05-14 13:58:37 -07:00
gaurank kathpalia
c63859d9f0 qcacld-3.0: Send RSN caps in RSO command
Association request initiated by the host contains
the RSN capabilities which contains both the flags
of PMF, i.e PMF required and PMF capable. The DUT
may connect to a non PMF AP or only a PMF capable AP,
if the DUT is PMK capable and not PMF required,
but connection to a non PMF AP isnt allowed
if the DUT is configured as PMF required.
In the Association request, the DUT advertises its
RSN capabilities, and accrding to them, the connection
(PMF/non PMF) happens. But these capabilities arent
sent to the firmware, so while roaming, the DUT may
connect to a non-PMF AP, as in the re-assoc request
the DUT would still advertise PMF-REQUIRED as false,
which would be violation of protocol.

Fix is to send these RSN capabilities to the
firmware as part of roam scan offload params,
to have firmware save the configuration, and
send the RE-assoc request with PMF required as
true, if the DUT supports PMF required.

Change-Id: Iff58f7ba3b2fee7a834bd625225bbb3d62f33557
CRs-Fixed: 2234977
2018-05-14 10:26:21 -07:00
Yeshwanth Sriram Guntuka
0e6f44655a qcacld-3.0: Decrement vdev ref count in wma_state_info_dump
Vdev ref count is incremented in wma_state_info_dump
and not decremented before return. This results in
vdev not deleted physically as part of wlan0 hdd_stop.
On hdd_open, a new vdev is created for wlan0 with same
mac addr as the previous wlan0 vdev. In scan, API to
get vdev by mac addr will return NULL since the first
wlan0 vdev is not physically deleted and not removed from
vdev list.

Fix is to decrement vdev ref count in wma_state_info_dump.

Change-Id: I67c90a721643f5bb7c6e212846f6d398055a6672
CRs-Fixed: 2233997
2018-05-14 10:26:15 -07:00
Srinivas Girigowda
eb6ecf3f96 qcacld-3.0: Consistently use policy_mgr_dual_mac_config
Remove duplicate structs wmi_dual_mac_config and sir_dual_mac_config
and use policy_mgr_dual_mac_config.

Change-Id: I6da6539f519ec46ee274ba3f3ae042e5fd9c25d2
CRs-Fixed: 2190993
2018-05-12 04:31:13 -07:00
Jeff Johnson
11d7c9db98 qcacld-3.0: Fix typo "occured"
Replace typo "occured" with correct spelling "occurred".

Change-Id: I4d64bee7c9c929b4e7fce0c17d98136cff737fc4
CRs-Fixed: 2238297
2018-05-12 04:29:09 -07:00
Sourav Mohapatra
cf632579b1 qcacld-3.0: Use new API for fetching wmi_handle
Use get_wmi_unified_hdl_from_psoc instead of GET_WMI_HDL_FROM_PSOC due
to incompatible return types.

Solve renaming dependencies with common side changes.

Change-Id: Ie84641327d64876877c7d26b63d632c79770a88c
CRs-Fixed: 2203055
2018-05-11 22:40:02 -07:00
Himanshu Agarwal
1230ee0ddd qcacld-3.0: Enable fw_crash_timeout
Presently, fw_crash_timeout is disabled as a result of which if
timeout happens for any VDEV related WMI command and device goes
in bad state, no assert or recovery is getting triggered. Due to
this, device crashes at some later point of time at some random
location making debugging difficult.

Enable fw_crash_timeout and trigger recovery if recovery is enabled
otherwise assert.

Change-Id: I9e9e51cba8086bd181be28884c490f0bd77663a8
CRs-Fixed: 2229101
2018-05-09 20:22:51 -07:00
Jeff Johnson
5ead5ab10f qcacld-3.0: Fix typos "sucess" and "sucessful"
Replace typos "sucess" and "sucessful" with correct spellings
"success" and "successful"

Change-Id: I30746cbab4533da9b052261fa9bb87214188138b
CRs-Fixed: 2237724
2018-05-09 16:31:15 -07:00
Vignesh Viswanathan
ad47f0a2a8 qcacld-3.0: Modify callers of ObjMgr APIs to include pdev_id
wlan_objmgr_get_vdev_by_macaddr_from_psoc and wlan_objmgr_get_peer
API's definitions have been changed to include pdev_id as an
argument.

Modify the callers of these APIs to include pdev_id as argument.

Change-Id: I3d0de6a0bc1dfefbe1b3cad51ec23f703baaf3ad
CRs-Fixed: 2210728
2018-05-09 01:44:33 -07:00
Will Huang
67ce1e332b qcacld-3.0: Refine PMO wow to support legacy chip
wma_is_service_enabled can't get valid service bitmap if call in
hdd_update_pmo_config, use psoc_ctx->caps.unified_wow instead to check
pattern id per vdev and legacy d0 wow capability.

Change-Id: If7bf316f482c49253fc4b95b94e172727b27ffd1
CRs-Fixed: 2225847
2018-05-06 23:12:33 -07:00
Wen Gong
aa6d55d9e7 qcacld-3.0: Add hdd memory dump feature flag
Add config flag to enable / disable hdd memory dump feature

Change-Id: Id2994f72b595096459e65ef4da5381d6eb3b476b
CRs-Fixed: 2231695
2018-05-06 23:12:29 -07:00
gaurank kathpalia
d2967a742c qcacld-3.0: Fix OOB write in vdev_mac_map
In the API wma_process_pdev_hw_mode_trans_ind
the host doesnt check the upper limit of
num_vdev_mac_entries received from the firmware,
and fills the same to the host structure
hw_mode_trans_ind, which may cause OOB write.
Fix is to check for the max vdev supported in the
same API and return if the condition is false.

Change-Id: I54a9e12f777b87b49057d6c97c06ab71b9ad1d77
CRs-Fixed: 2221965
2018-05-05 09:21:29 -07:00
Tushnim Bhattacharyya
89710e3e80 qcacld-3.0: Use WMI_HOST_WLAN_PHY_MODE instead of WLAN_PHY_MODE
Use the enumaration defined in common instead of the legacy one in
cld.

Change-Id: I0ad7659b8d03ae5a14b15ca464395ea3e2571286
CRs-Fixed: 2216803
2018-05-04 21:46:42 -07:00
Pragaspathi Thilagaraj
2628343597 qcacld-3.0: Fix possible buffer overread in wma_set_epno_network_list
In the function wma_set_epno_network_list,
req->networks[i].ssid.ssId is copied into the destination
params->networks[i].ssid.mac_ssid. But the ssid length is not
considered while copying and WMI_MAC_MAX_SSID_LENGTH is used as
the length for copying. This might result in possible buffer
overread if the ssid length is not WMI_MAC_MAX_SSID_LENGTH.
Similar issue is seen in wma_pno_start also.

Use pno->aNetworks[i].ssId.length as the size to mem copy the
ssid to the destination ssid buffer.

Change-Id: Id3f579da97e398663b7d583f5f46d4671eabeae3
CRs-Fixed: 2233682
2018-05-04 20:43:00 -07:00
Zhang Qian
610a1a7a34 qcacld-3.0: Add pointer check in wma_is_ccmp_pn_replay_attack
cdp_get_pn_info() would output wild pointers and cause NULL
pointer reference in wma_is_ccmp_pn_replay_attack().
Add pointer check in wma_is_ccmp_pn_replay_attack().

CRs-Fixed: 2232554
Change-Id: Ic2e5487468aaced91d6567005bbe66a7c065f088
2018-05-03 10:42:38 -07:00