Commit Graph

2511 Commits

Author SHA1 Message Date
Jeff Johnson
174c47a211 qcacld-3.0: Populate pdev and vdev legacy_osif_priv pointers
Currently the legacy_osif_priv pointers in the Object Manager's pdev
and vdev objects are not populated. As a result it is not possible to
get the HDD object given an Object Manager object. Populate these
pointers to allow these lookups.

Change-Id: If5ee0c785d0496ee4f06f7d230fbcf6ba957b610
CRs-Fixed: 2119155
2017-09-29 17:41:01 -07:00
Dustin Brown
a713916eae qcacld-3.0: Throw error if nla_parse is used directly
In order to support multiple nla_parse function signatures across
different kernel versions, a new hdd_nla_parse wrapper was introduced.
However, it is easy for propagations or new code to reintroduce
nla_parse. Redefine nla_parse to throw an error, to prevent the
function from being reintroduced into the code base.

Change-Id: I6e9b9cd60cee94dd9f94a067e7b9d964d60ae295
CRs-Fixed: 2116044
2017-09-29 17:40:59 -07:00
Jeff Johnson
60dc2b18f1 qcacld-3.0: Fix CDS layering violation in hdd_wlan_start_modules()
Currently hdd_wlan_start_modules() gets a pointer to the CDS Global
Context, and then in the failure path it dereferences this pointer to
call hdd_hif_close().  This is a layering violation -- HDD should not
be aware of the contents of the CDS Global Context and should not be
dereferencing the pointer.

Modify the code to use the exported cds_get_context() API to retrieve
this information.

Change-Id: I640bea70b50d5533afa1ee1b2e0cd6b9619a4ac2
CRs-Fixed: 2118692
2017-09-29 15:40:00 -07:00
Jeff Johnson
156b9d27ce qcacld-3.0: Use correct SAP context in hdd_print_acl()
In hdd_print_acl() the calls to SAP APIs are using a poorly named,
poorly typed variable. Recently all of the SAP APIs were reworked to
expose a clean interface, so update hdd_print_acl() to align with that
interface.

Change-Id: Ib10f5fc017589d13fe1ccfb758d9333daa0e3ac7
CRs-Fixed: 2118653
2017-09-28 22:48:50 -07:00
Dustin Brown
27cd994d11 qcacld-3.0: Stop adapters on connection mode change
__con_mode_handler does not currently stop existing adapters before
stopping the driver module. In order to support runtime leak detection,
existing adapters should be stopped to avoid any false positives. Stop
any existing adapters before stopping the driver modules when changing
the connection mode.

Change-Id: I1ee369a75c74f889e06ee8a07a34f1b34120317e
CRs-Fixed: 2117892
2017-09-28 21:59:39 -07:00
Jeff Johnson
18611aff04 qcacld-3.0: Remove obsolete prototype hdd_rx_mul_packet_cbk()
There is a prototype for hdd_rx_mul_packet_cbk() but no
implementation, so remove this obviously obsolete prototype.

Change-Id: I9119bcb8baf9b9a04f5c99d39eb5a7abfa18607f
CRs-Fixed: 2118652
2017-09-28 21:59:35 -07:00
Houston Hoffman
e5cd52cc41 qcacld-3.0: Call hif apis to block traffic during suspend
Before performing wow handshake, block unwanted traffic between the host
and firmware.

Change-Id: I977603b06639fe30816179defec337a2067fc210
CRs-Fixed: 2004308
2017-09-28 21:59:30 -07:00
SaidiReddy Yenuga
8cbd921ba2 qcacld-3.0: Add NULL Check in iwpriv ioctl iw_setint_getnone
qcacld-2.0 to qcacld-3.0 propagation

iw_setint_getnone can cause crash in monitor mode as hal
context is not initialized.

Modify the code to handle dereferencing hHal in Driver Monitor
mode.

CRs-Fixed: 1040579
Change-Id: If26cfab5374ac34c55e03b887c320c0736a9df23
2017-09-28 18:04:20 -07:00
Venkata Sharath Chandra Manchala
9bf41ff5ff qcacld-3.0: Reduce log level
For the hdd receive datapath reduce the log level
from INFO to DEBUG to avoid excessive logging.

Change-Id: I5d5881aeadcb5129e3c67c34402e29e732bae1a4
CRs-Fixed: 2105286
2017-09-28 16:11:29 -07:00
Naveen Rawat
1b91657a1d qcacld-3.0: Reject scan request on NDI vdev
NDI does not need scan from userspace to establish connection
and it does not support scan request either. Hence reject scan
request on NDI vdev.

Change-Id: I58b0c899b6f1196f32a70e3f2c95d6ff839d4555
CRs-Fixed: 2115215
2017-09-28 16:11:26 -07:00
Jeff Johnson
02d23c3bcd qcacld-3.0: Remove obsolete HDD WPS macros and enums
HDD defines a large set of WPS macros and enumerations which were
inherited from a prior version of the driver which implemented SAP WPS
in the driver itself. Now that SAP WPS is entirely handled by
userspace, these macros and enumerations are obsolete, so remove them.

Change-Id: Id8c9622c1e6429fcb64c3d292bc273bf49da79e4
CRs-Fixed: 2118451
2017-09-28 13:26:35 -07:00
Frank Liu
5c63dc8f82 qcacld-3.0: TDLS: remove remaining legacy code
Clear up tdls legacy init/deini, helper functions and structures.
Also remove legacy code in vendor nl80211 and iwpriv commands.

Change-Id: I983851d8cc0d3605c3d6bd0d8975c72844f71740
CRs-Fixed: 2105075
2017-09-28 09:39:48 -07:00
Frank Liu
1b8212057d qcacld-3.0: TDLS: remove legacy event process
Clear up the tdls legacy tdls firmware events and
implicit tdls discovery request process.

Change-Id: I2e2380b1789cce7841ff0be4120184d1bce0b7e7
CRs-Fixed: 2105075
2017-09-28 09:39:45 -07:00
Frank Liu
d1a2846324 qcacld-3.0: TDLS: remove legacy core functions
Clear up the tdls legacy functions which handle add/delete
tdls peer, tdls mgmt frame process and tdls_oper callback.

Change-Id: I8ba344ce5593df44bd15527e2ff68e872b6d23b8
CRs-Fixed: 2105075
2017-09-28 09:39:43 -07:00
Frank Liu
2ef4ab2f99 qcacld-3.0: TDLS: remove legacy interfaces
Clear up the legacy tdls interfaces which handle
connect/disconnect notifications, scan and p2p
roc events.

Change-Id: Ia860904685fc4783453491effa4518777c7406d0
CRs-Fixed: 2105075
2017-09-28 09:39:41 -07:00
Frank Liu
1a912b2f05 qcacld-3.0: TDLS: remove legacy connection tracker
Clear up the legacy tdls connection tracker function

Change-Id: I9163e8ec7a41750085d8673b25cf4797d1b84714
CRs-Fixed: 2105075
2017-09-28 09:39:39 -07:00
Mukul Sharma
6bdb77be27 qcacld-3.0: Flush pending scan queue during con mode handling
Currently, Host is operating into STA (mission mode) and scan
is pending into the pending queue. As a part of the mission
mode to ftm transition scan pending queue is not flushed. Hence
later during driver unload, host try to flush this pending
request but sta adpater is already freed during con mode
transition which lead to kernel panic.
As a part of this fix, Host ensures to flush pending scan
queue during con mode handling.

Change-Id: I13da323217a36777b9307c1bc76febc1a1b9b591
CRs-Fixed: 2082105
2017-09-28 06:41:35 -07:00
Lin Bai
c5c0688e21 qcacld-3.0: Fix build error without MSM_PLATFORM
Compiler is throwing error - undefined variable 'bus_bw_work' after
MSM_PLATFORM disabled.

Wrap the related code within MSM_PLATFORM.

CRs-Fixed: 2113835
Change-Id: I628df9de911fb17670d63ce577a614408c545aec
2017-09-28 06:41:32 -07:00
Manjeet Singh
70d3d931d9 qcacld-3.0: Check FW support for FW mem dump
Currently HDD sends a FW memory dump request to firmware without
checking support for this feature. This can lead to a crash as firmware
doesn't send the command response if feature is not supported.
Add a check in HDD so that the request is only sent when FW memory dump
capability is advertised by the firmware.

Change-Id: I73b980f50910e13aa5f2d2434f07b6f985dd5010
CRs-fixed: 1090806
2017-09-28 05:39:58 -07:00
Jeff Johnson
1bc784ad68 qcacld-3.0: Remove unnecessary get of CDS context in HDD
Currently in hdd_wlan_shutdown() and hdd_wlan_re_init() there are
calls to cds_get_global_context(), but the returned context isn't
actually used, so remove these calls.

Change-Id: I21b2a4955d926fe0694f4f8a3097d9a5d5bef02e
CRs-Fixed: 2117018
2017-09-28 03:49:15 -07:00
Jeff Johnson
7aaeeea315 qcacld-3.0: Change return value of cds_init()
Currently cds_init() returns a pointer to the CDS Global Context.  At
one time this was necessary since it was required to subsequently pass
this context pointer to other CDS APIs. But now CDS internally
maintains a pointer to its context, and no CDS APIs now require this
pointer, so no longer return the pointer. The ultimate goal is to keep
all references to the CDS context inside CDS.

Change-Id: Id068a2d351e492eca7b84ef23f277939104c8b46
CRs-Fixed: 2117004
2017-09-28 03:49:12 -07:00
Jeff Johnson
adbc45e87d qcacld-3.0: Remove pcds_context from struct hdd_context
The pcds_context field in struct hdd_context is no longer referenced,
so remove the field along with the code that currently initializes it.

Change-Id: Ibac0eedfa0c1e2bd170af9f91812fd25c0ab3ce7
CRs-Fixed: 2116985
2017-09-28 03:49:10 -07:00
Jeff Johnson
bc0ae77d63 qcacld-3.0: Remove logging of CDS context in HDD
In hdd_softap_sta_deauth() and hdd_softap_sta_disassoc() there
currently exist debug logs which are logging the CDS context
pointer. These logs serve no useful purpose, so remove them.

Change-Id: I3844cb1346dcc6050ad16f28caf7b07b1e79cfe4
CRs-Fixed: 2116979
2017-09-28 03:49:08 -07:00
Jeff Johnson
8bd23354cf qcacld-3.0: Remove unused CDS context from RSSI APIs
Currently HDD passes the CDS context to sme_get_rssi(), which in turn
passes it to csr_get_rssi(), which in turn uses it to populate the
p_cds_context field in the tAniGetRssiReq message. Upon processing of
this message by csr_update_rssi() the p_cds_context is checked for
NULL but is otherwise unused. Since the CDS context is not needed,
remove it from all of the RSSI APIs.

Change-Id: I5836e3192205576f6ff4614a29356e73fe674848
CRs-Fixed: 2116954
2017-09-28 03:49:05 -07:00
Jeff Johnson
92675a5d15 qcacld-3.0: Refine API wlansap_get_chan_width()
See change "qcacld-3.0: Refine API wlansap_open()" for the API history.
Update wlansap_get_chan_width() to use the true struct pointer type.

Change-Id: Iec86249524c042ae6dba818bb5983fd91d9e61fd
CRs-Fixed: 2116267
2017-09-28 03:48:37 -07:00
Jeff Johnson
f8ac737767 qcacld-3.0: Refine API wlansap_set_mode()
See change "qcacld-3.0: Refine API wlansap_open()" for the API
history.  Rename wlansap_set_mode() to wlansap_set_acl_mode() to align
with the naming of the "get" function, and update it to use the true
struct pointer type.

Change-Id: Ic4ad32ffa222f5fc70b0619cb150d737a573c474
CRs-Fixed: 2116267
2017-09-28 03:47:57 -07:00
Jeff Johnson
2bc0b727e3 qcacld-3.0: Refine API wlansap_open()
At one time the WLAN driver only supported a single SAP. At that time
most SAP APIs took the global context pointer as a param, and from
that they could extract the pointer to the one & only SAP context.
Later the MBSSID feature was added, and conditional compilation was
introduced such that either the global context pointer or a per-BSS
SAP context pointer was used. Finally in qcacld-3.0 the conditional
compilation was removed, leaving just the MBSSID behavior. However one
of the artifacts that was left behind was that the SAP APIs are
currently defined to take a void *context which prevents the compiler
from performing proper type checking.

Update wlansap_open() to return the true struct pointer type so that
it can then be used by other SAP APIs.

Change-Id: I216ed653e4feb9960357a168d4981e7a7a92411e
CRs-Fixed: 2116267
2017-09-28 03:47:17 -07:00
Jeff Johnson
a1e92618f2 qcacld-3.0: Remove unused cds_ctx param from SME uapsd APIs
Currently sme_enable_uapsd_for_ac() & sme_disable_uapsd_for_ac() take
a cds_ctx parameter. This parameter is no longer used, so remove it.

Change-Id: I36e57975bcfeded648513dce79f32a2fd8f56f5a
CRs-Fixed: 2115518
2017-09-28 03:47:15 -07:00
Jeff Johnson
3543fb202e qcacld-3.0: Fix CDS layering violation in hdd_context_create()
Currently hdd_context_create() directly dereferences the global CDS
context pointer in order to save a pointer to the HDD context. This is
a layering violation. Instead update cds_set_context() to handle the
HDD context, and call that from hdd_context_create() to save the
pointer to the HDD context.

Change-Id: Ie54725225a7dd5653eeb35e94aa3f3a752edc62a
CRs-Fixed: 2115513
2017-09-28 03:47:13 -07:00
Jeff Johnson
2b3c77d539 qcacld-3.0: Remove obsolete struct _WLAN_BKID_LIST
The struct _WLAN_BKID_LIST is unused and obsolete, so remove it.

Change-Id: Ia13570543625824e6f93cefd30670b37118c82db
CRs-Fixed: 2115506
2017-09-28 03:47:09 -07:00
Jeff Johnson
414fd67eef qcacld-3.0: Remove obsolete SAP support for SIOCSIWMLME
At one time the predecessor to the current driver was managed via
wireless extensions, but now the driver is managed by cfg80211. The
SAP implementation of SIOCSIWMLME now performs no useful actions, so
remove it.

Change-Id: I5da7e63d2efbc0d97dbdaec306bad2ae7a9cb0ef
CRs-Fixed: 2115350
2017-09-28 03:47:06 -07:00
Jeff Johnson
8872e1e310 qcacld-3.0: Remove obsolete SAP support for SIOCSIWENCODEEXT
At one time the predecessor to the current driver was managed via
wireless extensions, but now the driver is managed by cfg80211. The
SAP implementation of SIOCSIWENCODEEXT now performs no useful actions,
so remove it.

Change-Id: I10cb2a339a2a5f8be5114a6987a82f4fbad8b497
CRs-Fixed: 2115349
2017-09-28 03:47:04 -07:00
Jeff Johnson
326a04f9dd qcacld-3.0: Remove hdd_softap_tkip_mic_fail_counter_measure()
Change "qcacld-3.0: Remove obsolete SAP support for SIOCSIWAUTH"
removed the only caller of hdd_softap_tkip_mic_fail_counter_measure().
Since this function is now unused and obsolete, remove it.

Change-Id: If69881bbe922220341faad78bc992aa57d7e2f7c
CRs-Fixed: 2115340
2017-09-28 03:46:47 -07:00
Jeff Johnson
c8e1cb86b6 qcacld-3.0: Remove obsolete SAP support for SIOCSIWAUTH
At one time the predecessor to the current driver was managed via
wireless extensions, but now the driver is managed by cfg80211. The
SAP implementation of SIOCSIWAUTH now performs no useful actions, so
remove it.

Change-Id: If9b9fec53b8b594d50528f0fa8deaf611b39930e
CRs-Fixed: 2115339
2017-09-28 03:46:45 -07:00
Jeff Johnson
c4d9f17946 qcacld-3.0: Remove obsolete SAP support for SIOCSIWGENIE
At one time the predecessor to the current driver was managed via
wireless extensions, but now the driver is managed by cfg80211. The
SAP implementation of SIOCSIWGENIE now performs no useful actions, so
remove it.

Change-Id: Ia17f94ce648c41d7c25cf98ff1fbfbe5a5fc4c51
CRs-Fixed: 2114955
2017-09-28 03:46:35 -07:00
Rakesh Pillai
3e534db38b qcacld-3.0: Send ARP/NS/NA packets from HI PRIO queue
ARP/NS/NA packets will not get chance to be transmitted if
netif queues are paused due to low tx descriptor availability.
Send ARP/NS/NA packets from HI PRIO queue so that it can be transmitted
in noisy environment.

Change-Id: Ibb414463d1471c19d5db99e12517c77b02564318
CRs-Fixed: 2081348
2017-09-28 01:57:36 -07:00
Archana Ramachandran
7498d374bc qcacld-3.0: Allow beacon/probe resp update for SAP during connection
Host driver is ignoring beacon/probe response update for SAP before
4-way handshakes completed. Due to this beacon/probe response is not
updated with the latest updates from the userspace. This can lead to
re-connection failure/delay after disconnect.

Change-Id: I3a735a2c867c4cfac9662551221fbf22d5afb29d
CRs-Fixed: 2027658
2017-09-27 20:58:00 -07:00
Mukul Sharma
6398b253fb qcacld-3.0: Add support for changing LISTEN interval dynamically
Current method for calculating LISTEN INTERVAL are static
configuration a.ka. ini based. Now OEM / USER want to take
control of setting LISTEN INTERVAL as per their applications
need. Once if USER configure the LISTEN INTERVAL value using
vendor command then host should avoid changing the LI value
during each suspend/resume. User LI value will be override
configuration. Once USER will Disable the LI using vendor
command then host can fallback to current default method.

Change-Id: Ia9b412b073c059df0cdff7bcda8198f7581e796d
CRs-Fixed: 2040298
2017-09-27 20:57:54 -07:00
tfyu
bdf453e429 qcacld-3.0: Enable the TX orphan by ini key gEnableTxOrphan
Enable the TX orphan by ini key gEnableTxOrphan, which is protected by
TX flow control.

Change-Id: Ib8e6d88ea0c7fda62f2d13ae3c592866ddc82521
CRs-Fixed: 2115621
2017-09-27 20:09:02 -07:00
Houston Hoffman
1942caece7 qcacld-3.0: Fix PRE_CAC_SSID check bounds check
If the ssid_len was greater than the PRE_CAC_SSID string,
memcmp would do an out of bounds memory read. Fix by
adding a length check.

Change-Id: I0d72cfdb2faea74db06640df7418f2a7aecd9afb
CRs-Fixed: 2098988
2017-09-27 17:30:42 -07:00
Will Huang
fe649175aa qcacld-3.0: Differentiate pattern id for legacy firmware
The Wow pattern id should be identified unique for different vdevs of
legacy firmware, and latest firmware accept same Wow pattern id on
different vdevs.

This change is to differentiate this behavior using
WMI_SERVICE_UNIFIED_WOW_CAPABILITY flag, and supply a set of APIs to
manipulate pattern id.

Change-Id: I5fe7623a309a0c3baa14fb7312107c057e994462
CRs-Fixed: 2103017
2017-09-27 17:30:33 -07:00
Yu Wang
46082dc0a6 qcacld-3.0: inject fw crash in crash-shutdown
When kernel panic happen, if WiFi FW is still active,
it may cause NOC errors/memory corruption, to avoid
this, inject a fw crash first.

Propagated from qcacld-2.0

Change-Id: I97a696a02dfd73aaca212ef1bca9f3597df1e382
CRs-Fixed: 2052332
2017-09-26 22:20:06 -07:00
Nachiket Kukade
be8850b4c6 qcacld-3.0: Set up watchdog timers for pld driver ops
Requirement to detect if a PLD OP has stuck for a long time.
Define a timer for 30 seconds and let it run during pld ops
probe, reinit, remove and shutdown. Upon expiry print important
debug information then either trigger recovery or BUG ON.

Change-Id: I6c132cb71917cec7dead9c6c91ce6778e20bffe7
CRs-Fixed: 2090785
2017-09-26 22:20:04 -07:00
Arunk Khandavalli
16d84258e0 qcacld-3.0: Synchronize load/unload with IFF_UP from upper layer
In certain restart sequence of the modem, wlan driver is forcefully
removed and re-probed during the firmware ready. Supplicant receives
the RTM_DELLINK/RTM_NEWLINK events as part of unregistration of netdev
from remove and registration of the netdev again as part of re-probe.

As soon as the RTM_NEWLINK indication is received by the supplicant
it tries to bring up the interface, the request for bringing up
the interface is rejected by the driver since it is still in the
re-probing phase resulting in the scan failure and other failures.

To mitigate issue synchronize the interface up with the loading/unloading
of the driver.

Change-Id: Ie467e729a4736a0ee580c4df8d75099cf070d7bf
CRs-Fixed: 2058390
2017-09-26 22:20:01 -07:00
Arun Khandavalli
75d246bd84 qcacld-3.0: Reject set packet filter params for invalid device mode
Packet filter params is supported only for Station mode presently,
configuring the filter for other modes results in failure in fw.
To mitigate the issue reject the packet filter for other modes than
Station mode.

CRs-Fixed: 2029356
Change-Id: Ic2c1786dcf8d8980a104af2ee6916489dd2ec423
2017-09-26 21:30:30 -07:00
Arun Khandavalli
08479ba85b qcacld-3.0: Register the netdev notifier before the netdevices
Applications in the userspace can sleep on the RTM events from
the driver. One such application waiting of RTM_NEW_LINK indication
does interface up as soon as it recieves the indication, so the
kernel takes rtnl_lock to call the dev_open on the interface.
Load/unload of the driver and dev_open of the interfaces are
synchronized with hdd_init_deinit_lock. So the __hdd_open is waiting
on the hdd_init_deinit_lock which is currently held by the driver
loading context. After registering the interfaces driver goes to
register the netdev notifier which is blocked on the rtnl_lock
currently held by the dev_open resulting in deadlock.

To mitigate the issue register the netdev notifier before the
interfaces are registered.

Change-Id: Ibb0c187a43ad87fa535ff583316af430e1ddf04f
CRs-Fixed: 2078720
2017-09-26 20:43:43 -07:00
Arunk Khandavalli
4b404333ca qcacld-3.0: Move the freeing of tartget memory module_exit to stop_modules
In the Loadonce unload never driver the modules_start and modules_stop
happen multiple times and presently the memory for target_name is
allocated multiple times during the start_modules but freed only
once during the module_exit, so when the driver is unloaded
this can result in  a crash.

Moving this to stop_modules will help in freeing this everytimg.

Change-Id: I87a92c8b411fb0ae148a293d74e6914246b88014
CRs-Fixed: 2107392
2017-09-26 20:43:41 -07:00
Arunk Khandavalli
e1b3a38ec8 qcacld-3.0: Block interface up when recovery is in progress
In certain cases during the SSR/PDR after shutdown the interface
up of the driver can be invoked before complete recovery is completed.
This can lead to accessing the bus which is not clocked or other issues.
Block the interface up from the upper layer until the recovery is completed.

CRs-Fixed: 2096446
Change-Id: I6b6569a10520d58e005e56046288ccc10592f725
2017-09-26 20:43:38 -07:00
Abhishek Singh
d568647705 qcacld-3.0: Drop roam sync indication if user disconnect is in progress
Roam sync indication checks for csr roam state to determine if user
disconnect is not in progress. But there can be a race condition
where the csr roam state is not updated by disconnect and while
roam sync check the state and proceed.

To fix this set the disconnect in progress flag in sme session
as soon as disconnect starts in HDD and use that to determine if user
disconnect is not in progress when roam sync is received.

Change-Id: Icf541b698eb194621d19b03f281ec3dfd552e373
CRs-Fixed: 2112912
2017-09-26 19:58:00 -07:00
Ganesh Kondabattini
b1960e78f4 qcacld-3.0: Add support for QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS
Add support for handling vendor sub command
QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS and parsing its attributes.

CRs-Fixed: 2069865
Change-Id: I38f761f20007a04063b0e0680793aedcabd02c6a
2017-09-26 17:53:02 -07:00