Commit Graph

3777 Commits

Author SHA1 Message Date
Varun Reddy Yeturu
b1e6cd3a66 qcacld-3.0: Fix using uninitialized values in hdd_send_twt_enable_cmd
Fix using uninitialized values for req_val, bcast_val and resp_val
in the function hdd_send_twt_enable_cmd.

Change-Id: Ie671660b62f0624fbf86707f15fe122b81552a53
CRs-Fixed: 2277826
2018-07-20 16:23:50 -07:00
Dustin Brown
0127a73a2d qcacld-3.0: Enable/Disable MC filter when connected
Multicast address filtering only makes sense if the interface is
connected and capable of receiving traffic. Avoid enabling/disabling
the multicast address filter list on an interface that is disconnected.

Change-Id: Id8aff136e920bb726b8c7dd539d477ff44f080d4
CRs-Fixed: 2282003
2018-07-20 10:46:49 -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
Dustin Brown
6619bc276c qcacld-3.0: Ensure conn_state session_id in bounds
Attempting to flush the powersave timer on an adapter with an invalid
session_id leads to an out-of-bounds access when checking the station
context's connection state. Only flush powersave timers for adapters
with valid session_ids. Additionally, add debug asserts for invalid
session_id's in the other connection state checking functions too.

Change-Id: Iacd2f97b01d7f6901d402908304a43c2c20d2380
CRs-Fixed: 2281219
2018-07-19 00:56:33 -07:00
Jeff Johnson
0e96308f39 qcacld-3.0: Refine the Thermal Level callback API
The Thermal Level callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: Ifa6f9fb5d3e27470b3f5292552b871d072150988
CRs-Fixed: 2278586
2018-07-19 00:56:30 -07:00
Kiran Kumar Lokere
f54b85555f qcacld-3.0: Add support to configure HE trigger frame MAC padding
Add support to configure HE trigger frame MAC padding and disable
the MU EDCA param update when user configures the padding.

Change-Id: Ief928c5421366b03ee6e1d6253963b10fd3b87b6
CRs-Fixed: 2265331
2018-07-18 23:18:12 -07:00
Alok Kumar
cee3cf297a qcacld-3.0: Fix OOB access of sta_info for invalid sta_id
Currently, sta_id is used without validation in hdd_inspect_dhcp_packet
which may lead to OOB access for sta_info.

Call hdd_inspect_dhcp_packet only if sta_id is valid.

Change-Id: I09ebdaeeb86f8abe95fe09d23974c4bf331e29fe
CRs-Fixed: 2276615
2018-07-18 08:38:50 -07:00
Dundi Raviteja
53de6c3371 qcacld-3.0: Use request manager framework for ready to extwow event
We are transitioning the usage of ready to extwow event
to request manager framework.

Change-Id: I648b6db4ab5367c8e04e77f4adc2fb9d42039054
CRs-Fixed: 2274944
2018-07-18 05:58:59 -07:00
Dundi Raviteja
6bb9e328aa qcacld-3.0: Use request manager framework for set antenna mode event
We are transitioning the usage of set antenna mode event
to request manager framework.

Change-Id: I4df39c9b71ccd5680f85d1662bec06bc90f70977
CRs-Fixed: 2274929
2018-07-18 00:18:03 -07:00
gaurank kathpalia
82a1b2b802 qcacld-3.0: Fix GTK offload req params
Currently the host sends the fixed gtk offload params
and the FILS TLV params, even when the FILS feature is disabled
in the host, which force firmware to pick the KEK from the
FILS TLV structure rather than from the fixed param structure,
which further leads to GTK re-keying feature fail.

Fix is to send only the fixed params in case when host doesnt
supports FILS.

Change-Id: I5b3b3fd503c7cb9c4d7933074fd483086b113204
CRs-Fixed: 2244725
2018-07-17 14:48:23 -07:00
Visweswara Tanuku
6bc52de881 qcacld-3.0: Use hdd netdev notifier call for softAP interface
qcacld-2.0 to qcacld-3.0 propagation

In softAP scenario, if any pending scan request is not serviced
before NETDEV_GOING_DOWN is called, it results in call trace
Handle this by using hdd netdev notifier call for softAP, where
scan_block_work is flushed.

Change-Id: I5de07103e0b0008f21c0a13add0eed36ea1b31d0
CRs-fixed: 2076542
2018-07-17 05:28:37 -07:00
Sandeep Puligilla
c5609d5bdc qcacld-3.0: Add legacy mlme component
Add legacy mlme component main APIs and init/deinit from HDD.

Change-Id: I3d3de3bca9a4fd0896a9d6a076b5e60bb1a5ca83
CRs-Fixed: 2272959
2018-07-17 05:28:30 -07:00
Vignesh Viswanathan
597d901893 qcacld-3.0: Send Peer Authorized for SAP peers after Set Key Complete
The hostapd sends the add_key command followed by the change_station
command to set the peer to authorized state and open the data ports.
Since the add_key is serialized through LIM/WMA layers and might not
have been sent to the FW by the time the change_station is received,
the FW would assert due to peer moved to authorized state before keys
are set.

Send the Peer authorized command to FW and to the hostapd only after
the set_key is complete for the peer.

Change-Id: Ibd1737a41ea96770987da4070b72e756538e7508
CRs-Fixed: 2267291
2018-07-17 03:48:33 -07:00
Chaoli Zhou
75b062f194 qcacld-3.0: Allow Setting Channel&Bandwidth in STA mode
Add one new ini configuration item to disable/enable
setMonChan in STA mode with disconnected state for
spectral scan test at CV2X platform.

Change-Id: Ie9ffc701d93ed1c050375dd56151b7a0da69cdce
CRs-Fixed: 2279013
2018-07-17 03:48:30 -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
Abhinav Kumar
eab259362d qcacld-3.0: Add error handling support while sending roam invoke cmd to fw
Fix is to allow driver to send roam invoke command to firmware only when
roaming is allowed by both driver as well as supplicant for current vdev.

Change-Id: I76331c7c73672dd4c73b2cfaaba1e5c01652b982
CRs-Fixed: 2277523
2018-07-16 18:32:28 -07:00
Jeff Johnson
dc198eccdb qcacld-3.0: Refine the Lost Link Info callback API
The Lost Link Info callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: I1ef9151d1a0c444a9bbb64aee6ae26030dd0bdbf
CRs-Fixed: 2278585
2018-07-14 21:20:05 -07:00
Jeff Johnson
4397514c87 qcacld-3.0: Refine the Roam Scan Offload callback API
The Roam Scan Offload (RSO) callback currently specifies a void
pointer for the context. In the case of this API the context is
actually known to be an HDD handle, so update the API to explicitly
use this type. This will allow the compiler to verify that the correct
type of parameter is being passed.

Change-Id: I9f3098a9f4bc840ef2f6210717849db5d4dd2c2a
CRs-fixed: 2278584
2018-07-14 03:34:07 -07:00
Jeff Johnson
d0b6c7e4ed qcacld-3.0: Refine the BT Activity callback API
The BT Activity callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: I1bb29fcbd339d48b19352d61a18c0ae3ee3b10da
CRs-Fixed: 2278583
2018-07-14 03:34:04 -07:00
Jeff Johnson
c45168b885 qcacld-3.0: Refine the NAN Event callback API
The NAN Event callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: I998119cb02d2b6412b63c36f740016745a6fbe4f
CRs-Fixed: 2278582
2018-07-14 03:34:00 -07:00
Dustin Brown
2da29eb8a5 qcacld-3.0: Destroy vdev if close session fails
Currently, hdd_vdev_destroy has some error handling logic which avoids
actually destroying the vdev in some cases. This always constitutes a
leak of resources. Regardless of the result of the call to
sme_close_session(), always destroy the vdev in hdd_vdev_destroy().

Change-Id: I86f3e55866a8506dd4a1a2bcbf8bf5d5264d49e3
CRs-Fixed: 2278043
2018-07-13 19:29:32 -07:00
Qiwei Cai
1083f5b0ac qcacld-3.0: Featurize WLAN_NS_OFFLOAD
Fix compilation errors when disable WLAN_NS_OFFLOAD

Change-Id: Ifba894a4880a226cedf4c88b1121d02c63aceb4b
CRs-Fixed: 2271272
2018-07-13 10:36:11 -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
Qiwei Cai
ad9b01ce3d qcacld-3.0: Reduce roam debug buffer size
Change WLAN_ROAM_DEBUG_MAX_REC from 256 to 64 to save memory

Change-Id: Ib70ab70bc6841251eb76db8ab6173eb0b58ad39e
CRs-Fixed: 2271408
2018-07-13 08:27:10 -07:00
Rajeev Kumar
eeeb6f2893 qcacld-3.0: Optimize string log size in hdd_set_ibss_power_save_params
Optimize string log size in hdd API hdd_set_ibss_power_save_params such
that wlan.ko size is optimized.

Change-Id: I9021c505ce987217eddc1f96f419a08787e21e97
CRs-Fixed: 2277782
2018-07-13 02:58:28 -07:00
Jeff Johnson
4584365853 qcacld-3.0: Refine the EXT Stats callback APIs
The EXT and EXT2 stats callbacks currently specify a void pointer for
the context. In the case of these APIs the context is actually known
to be an HDD handle, so update the APIs to explicitly use this
type. This will allow the compiler to verify that the correct type of
parameter is being passed.

Change-Id: I31f6e688a4940cba88b628e76ecd2f295386bb19
CRs-Fixed: 2277297
2018-07-12 22:26:56 -07:00
Jeff Johnson
da2afa4202 qcacld-3.0: Refine the TX Queue callback API
The TX Queue callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: I125b80eb250a5cfcb78f4a19d7a803838a4d147b
CRs-Fixed: 2277286
2018-07-12 22:26:52 -07:00
Jeff Johnson
3201e62b65 qcacld-3.0: Refine the RSSI Threshold Breach callback API
The RSSI Threshold Breach callback currently specifies a void pointer
for the context. In the case of this API the context is actually known
to be an HDD handle, so update the API to explicitly use this
type. This will allow the compiler to verify that the correct type of
parameter is being passed.

Change-Id: Ifbedc0a0b38f4f9251524842595af296034153f9
CRs-Fixed: 2277278
2018-07-12 22:26:49 -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
3a08ff978a qcacld-3.0: Refine the TWT callback APIs
Currently the TWT enable complete and disable complete APIs specify 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 these cases 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: Ibbe3f6809e892833473d234bf19a9245d7e7c1f1
CRs-Fixed: 2276989
2018-07-12 22:26:42 -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
cb5fd01a0c qcacld-3.0: Update UMAC ctrl pdev to dp pdev
Update UMAC ctrl pdev handle to dp pdev handle and also
update dp pdev handle to UMAC pddev handle.

Change-Id: I7e6fd9c80d3e982ce9398b2c9229622826f0f33f
CRs-Fixed: 2254324
2018-07-12 12:34:40 -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
Sourav Mohapatra
a30c457cc9 qcacld-3.0: Add check for validity of COUNTRY driver cmd
When the driver command COUNTRY is issued from the userspace, the
command and the parameter is copied from the user in hdd_driver_command()
where it is then processed by hdd_drv_cmd_process() and then passed on
to the handler, in this case, drv_cmd_country(). The command parameter
passed is then parsed for the country code appended after the string
"COUNTRY". In the case the command is passed without any country code,
there may occur an out of bounds index access in the function
drv_cmd_country(). The parsed parameters in this function are accessed
without any validity check.

Add a validity check to verify that the command is passed with country
code parameters to prevent access of out of bound index.

Change-Id: I03c372796ed7cd62e54a0acdf237069be076ee2c
CRs-Fixed: 2242617
2018-07-11 18:45:47 -07:00
Jeff Johnson
f6182e4561 qcacld-3.0: Refine the congestion_cb API
Currently the congestion_cb 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: I3bfa07300fad8cd75b7b98c9b7ccdad4936bf32f
CRs-Fixed: 2276476
2018-07-11 18:45:44 -07:00
Jeff Johnson
b7fa256b6c qcacld-3.0: Refine the chip_power_save_fail_cb API
Currently the chip_power_save_fail_cb 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: Ia9cbf1a229423d3dffd4d137c726d34b7a70fbb3
CRs-Fixed: 2276467
2018-07-11 18:45:41 -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
Min Liu
e4b38a08e2 qcacld-3.0: Fix mem leak in hdd_objmgr_create_and_store_vdev
In the error path of hdd_objmgr_create_and_store_vdev,
osif_priv->osif_tdls is not freed.
Call wlan_cfg80211_tdls_priv_deinit to free the buffer
in error path.

Change-Id: I4f1fdca1a6a4f2e8c061dc227632850d5baab320
CRs-Fixed: 2275008
2018-07-11 14:28:55 -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
Mohit Khanna
f7562c330e qcacld-3.0: Fix DPTRACE live mode timing logic
DPTRACE timing logic uses the bandwidth request timer (~100ms) to make
calculations. Fix the current code to invoke qdf_throttle_live_mode
every 100ms, instead of when the throughput changes.

Change-Id: Ic64c28ef30ac7d7f764216a615ff1d9903436105
CRs-Fixed: 2273874
2018-07-11 14:28:48 -07:00
Will Huang
ba035ec953 qcacld-3.0: Fix deadlock of rmmod and wlan start module
On cnss2 platform, the cnss callbacks in wlan driver are called with
serialization, and in wlan driver stop module and start module has
mutex of iface_change_lock, it might hit deadlock if race condition
happen of rmmod and start module, because start module might call
pld_power_on for this case.

Fix by setting unload flag earlier in __hdd_module_exit which in
different context of cnss serialized work queue, it prevents new
interface open at this point and wait for external thread complete
after it, it close race window before call wlan_hdd_pld_remove.

Change-Id: I8eb3740701070428c59f1fe3e8d2f439d9173413
CRs-Fixed: 2265691
2018-07-11 14:28:35 -07:00
Dustin Brown
0ea8d3b85f qcacld-3.0: Add "unit_test" IOCTL
Add a unit test IOCTL for components to hook their unit tests into.

Change-Id: I676394771a35263454bc0f6d13174fbb7d957e67
CRs-Fixed: 2274538
2018-07-10 18:41:55 -07:00
Lin Bai
5dc5495d9a qcacld-3.0: Allocate/Free skb in same function
The skb used for HW-mode-change vendor event will be freed twice
in failure scenario.
To avoid this, just keep the free in same function as allocation.

CRs-Fixed: 2274784
Change-Id: Ibd37bc9787470da6de93c87a16c4c3bed7d1f78e
2018-07-10 18:41:52 -07:00
Jeff Johnson
7b3c98f329 qcacld-3.0: Clean up the wlan_hdd_power API
Clean up issues identified in wlan_hdd_power.h:
- Make sure all APIs have documentation
- Make sure all APIs adhere to the coding standard

Change-Id: I955b2eaec5f583d8d558df1dac7708b7b455e089
CRs-Fixed: 2275266
2018-07-10 18:41:49 -07:00
bings
6fb9bf69d3 qcacld-3.0: Check txrx_vdev before calling cdp_fc_vdev_flush
When txrx_vdev is NULL, zero address access happens if cdp_fc_vdev_flush
is called.

Before calling cdp_fc_vdev_flush, make sure txrx_vdev is not NULL.

Change-Id: I13b52bd3f2fb5e7db6150c8bf645c5bec703bc2b
CRs-Fixed: 2272005
2018-07-10 18:41:45 -07:00
Jeff Johnson
fb0857d3b5 qcacld-3.0: Clean up the wlan_hdd_softap_tx_rx API
Clean up issues identified in wlan_hdd_softap_tx_rx.h:
- Make sure all APIs have documentation
- Make sure only public APIs are present
- Make sure API identifiers do not use camelCase
- Remove obsolete API hdd_softap_rx_mul_packet_cbk()

Change-Id: Icacd2c7b1358cd6f71d86dc5d8a966973ff7a110
CRs-Fixed: 2275265
2018-07-10 14:06:37 -07:00
Jeff Johnson
b9feee40b6 qcacld-3.0: Fix indent in hdd_pld_request_bus_bandwidth()
Checkpatch flagged the following issue, so fix it:

ERROR:CODE_INDENT: code indent should use tabs where possible
+^I^I          next_rx_level, avg_rx);$

Change-Id: Ib6133df181ec7517bf0b212bd8d677666d99ccb9
CRs-Fixed: 2275264
2018-07-10 14:06:34 -07:00
Jeff Johnson
dd6fd48b3d qcacld-3.0: Remove obsolete 11d scan callback mechanism
SME exposes an 802.11d scan callback mechansim that was used by a
prior generation of the driver. The current generation no longer uses
this callback, so remove it.

Change-Id: I11b7916fd8244f3ba03ec73779a8c7e61c2a06ab
CRs-Fixed: 2273914
2018-07-10 14:06:30 -07:00
Tiger Yu
8c3877001d qcacld-3.0: Deregister tx flow control when reset all adapters
Deregister tx flow control when reset all adapters to miss unregister
the tx_flow_control_timer.

Change-Id: Idfa29dfc319532b7203008c2ee83a4e10aa8a8bc
CRs-Fixed: 2273178
2018-07-09 05:32:47 -07:00
gaurank kathpalia
ea6b5e603c qcacld-3.0: Fix KW issue in hdd_sme_roam_callback
The driver may dereference pRoamInfo by calling APIs
in hdd_sme_roam_callback which have arguements of
structure tagCsrRoamInfo.

Fix is to have a check for pRoamInfo, and then only
pass its struct members as arguments to other API.

Change-Id: I28acee0ff42a50221f6dbef7af4b9c04dd6e8d1e
CRs-Fixed: 2259290
2018-07-07 17:03:40 -07:00