Commit Graph

239 Commits

Author SHA1 Message Date
Leo Chang
9b09703f79 qcacld-3.0: cds: change legacy data path api to cdp api
Remove legacy apis call from out side of data path.
Replace legacy apis to cdp apis.
cds module.

Change-Id: I3f26b69711f494bad7fbaf07c5b8961125f13e65
CRs-fixed: 1075736
2016-11-17 19:13:10 -08:00
Houston Hoffman
47a4a05cfa qcacld-3.0: Fix memory leaks when cds_open fails
When cds_open fails, several cleanup actions are missed.
cds_shutdown_notifier_purge
hdd_green_ap_deinit
wlan_hdd_deinit_tx_rx_histogram

Change-Id: I9812b26636b1fd82320de323538777ac048ea824
CRs-Fixed: 1089946
2016-11-15 13:47:51 -08:00
Govind Singh
b048e87f2c qcacld-3.0: Refactor De-init sequence to firmware when the modules are not enabled
With the new statemachine  cds start/stop will not be invoked without an
interface up from upperlayer. As part of cds stop host sends de-initialization
sequence to firmware, If there is no interface up from the upper layer and
driver gets removed, host driver doesn't send the de-init
inidication to firmware and starts closing its modules because of this
fw & host are out of sync.

To mitigate the issue send the de-init sequence during if the modules are
opened but not enabled.

Change-Id: I52fddc1b8765105c44192085ba93bf00d14eb0bd
CRs-Fixed: 1073599
2016-11-14 11:51:19 -08:00
wadesong
f2e86b2814 qcacld-3.0: Fix memory leak during SAP restart
qcacld-2.0 to qcacld-3.0 propagation

IE buffers for probe resp, assoc resp and beacon should be freed
when 1)SAP starting fails; 2)SAP starting success event is signaled

Change-Id: Ic9cc1c8d58667f34fbc877aeca4405b0156b1264
CRs-Fixed: 1071990
2016-11-14 11:50:45 -08:00
Mukul Sharma
b7b575b41b qcacld-3.0: Add support for silent recovery in cds_trigger_recovery()
qcacld-2.0 to qcacld-3.0 propagation

Currently, cds_trigger_recovery does not support silent recovery
instead host send WMI_FORCE_FW_HANG_CMDID and wait for timeout.
In cases where wmi cmd cannot be sent to firmware, host needs
silent recovery.
As a part of this fix, Parameterize the cds_trigger_recovery
function for silent recovery.

Change-Id: I9bb631f7346a267a10348037c49606af43c6be4f
CRs-Fixed: 1053303
2016-11-14 11:50:40 -08:00
Amar Singhal
5f9978661c qcacld-3.0: Consolidate and rename regulatory macros
Consolidate regulatory macros in cds file and rename for
homogeneity.

Change-Id: I572eda616b985a39655dca3944e26fb1e0b5efb4
CRs-Fixed: 1058399
2016-11-12 00:24:03 -08:00
Ganesh Kondabattini
e353184920 qcacld-3.0: Disable GAP when concurrent sessions running
GAP should be enabled by host only when SAP is operating in stand
alone mode. Host should disable when there is a concurrent STA or
P2P session.

CRs-Fixed: 1065543
Change-Id: I1649bd5caca07abf2799892ad92d906474277acc
2016-11-12 00:22:15 -08:00
Sandeep Puligilla
afa5289e90 qcacld-3.0: Trigger host crash for command timeout
Add feature to trigger host crash when firmware
fails to send the response and host timesout.

Change-Id: I47f23e03f2729981a346e2a9e8c8541ba9119af4
CRs-Fixed: 1078192
2016-11-12 00:20:47 -08:00
Tushnim Bhattacharyya
0105770430 qcacld-3.0: Fix buffer overflow issue in cds_update_with_safe_channel_list
Fix the size of pcl_channels & pcl_weight array to be QDF_MAX_NUM_CHAN in
cds_get_nondfs_preferred_channel. Also make sure all the callers of
cds_get_channel_list uses QDF_MAX_NUM_CHAN as channel array size.

Change-Id: I256421f54180d1d8f9f6abd549d417e74d62add5
CRs-Fixed: 1082596
2016-11-03 17:54:03 -07:00
Krunal Soni
35fc8ea8b8 qcacld-3.0: Fix to handle SAP+STA DFS MCC scenario
1) If STA is on 2G channel and SAP is coming up on 5G DFS channel then
   it should be allowed given that DBS is supported.
2) If STA is on 5G channel and SAP is coming up on 5G DFS channel then
   it shoudln't be allowed as it will create DFS MCC scenario
3) If SAP is on 5G DFS and STA is coming up on 2G channel then it should
   be allowed given that DBS is supported.
4) If SAP is on 5G or 2G channel and STA is coming up on either of the
   bands then allow  connections to go through.
Make necessary adjustment to apply all above 4 rules.

Change-Id: I0a4dfe57cad1d2a62ada1bd8c258f7f3f6ac5dc2
CRs-Fixed: 1083376
(cherry picked from commit c6b307e0bc8ea638f44bd8ef86d09737a930b3ba)
2016-10-29 17:29:22 -07:00
Amar Singhal
79da812012 qcacld-3.0: Combine channel states only for 80P80
We dont need to combine channel states if the Channel width is not
80P80MHZ. Fix this so the logic is easier to understand.

CRs-Fixed: 1082221
Change-Id: Ie31d564f63278fe6549a2d54165920c28958c274
(cherry picked from commit a53a28f26e2add8309bb0c2ebacaa8f97f2506d3)
2016-10-29 17:28:23 -07:00
Prashanth Bhatta
f7969a6c2d qcacld-3.0: Mechanism to complete waiting thread
During remove() or shutdown(), driver waits for external thread
to complete but there is no mechanism available today to inform
lower layers that driver is about to go through remove() or
shutdown().  Add mechanism to provide the notification about
remove() or shutdown() so that lower layers can make use of it
and get out of waiting logic and complete the remove() or
shutdown() early without waiting for the timeout to happen.

Change-Id: I1eece21fb63e6d5e0454659795a4dad011483c75
CRs-fixed: 1079299
(cherry picked from commit 305516248006141ef331c8c1b7a4b56999fa496d)
2016-10-28 18:09:16 -07:00
Dustin Brown
cc1753d288 qcacld-3.0: 4.8 Kernel Migration - Remove ablkcipher
As of version 4.8 of the Linux kernel, the ablkcipher Api is removed.
Remove all obsolete crypto functions that reference this Api.

Change-Id: Ia82743d048834a67dfce23b91f660beb59b1e94d
CRs-Fixed: 1079951
(cherry picked from commit bf349575d765f53f207c7cb2ad6c66a198cf07de)
2016-10-28 18:09:06 -07:00
Dustin Brown
a30892e784 qcacld-3.0: 4.8 Kernel Migration - Remove ieee80211_band
Update references from enum ieee80211_band to nl80211_band, as
ieee80211_band was removed in version 4.7 of the Linux Kernel.

Change-Id: Id42cf6e20c3ebe921546d11fd22c3909aeb84ddd
CRs-Fixed: 1077221
(cherry picked from commit 8e62ee9836406b81fe3e418028cdb2ae8f5ec039)
2016-10-28 18:08:23 -07:00
Dustin Brown
b2cef911eb qcacld-3.0: Improve CDS SSR Protecting Logging
Any time SSR protect/unprotect fails, log a count of the pending
functions. Also, periodically dump the protection log when it is
full to help with debugging.

Change-Id: I926b2f8198a14cf0fac4138400e84a6a8ffedc73
CRs-Fixed: 1082070
(cherry picked from commit dfef826bf4883bc59ea1e6bd7dfb227567b95d1d)
2016-10-28 18:04:40 -07:00
Jeff Johnson
28b7151d8d qcacld-3.0: Handle NULL pdev in cds_flush_cache_rx_queue()
Currently cds_flush_cache_rx_queue() does not verify that
cds_get_context() returns a valid pdev which could subsequently lead
to dereferencing an invalid pointer.  Add a validity check for this
pointer.

Change-Id: I326e0b92205fda78854c947248e675d287a7ec04
CRs-Fixed: 1082035
(cherry picked from commit 514e12df3c66ef0e457d76ef8c984874481f5117)
2016-10-28 18:04:21 -07:00
Himanshu Agarwal
46956a5aff qcacld-3.0: Add infrastructure for pktstats based on linkedlist
Proapagation from qcacld-2.0 to qcacld-3.0.

Currently pktstats are stored in static allocated memory. This
pkt stats can be accessed using
1) procEntry function
2) hal_proxy_daemon
If user access it using procEntry then read pointer is moved ahead
in static memory array because of which incomplete data goes when
queried using hal_proxy_daemon.
Fix this by maintaining the pktstats in link list. When the
request comes from hal_proxy_daemon, complete data is sent
to it from this link list

Change-Id: I09bbd03fe378b296e110ce52cc8cbeb8cf8d723d
CRs-Fixed: 958544
(cherry picked from commit c0d86fc4197383d0eb386e091cee5142a35b555a)
2016-10-28 18:04:11 -07:00
Amar Singhal
833aa96a5b qcacld-3.0: Set maximum channel width correctly
In case channel width is defined to be CH_WIDTH_MAX; channel width
set to CH_WIDTH_80P80MHZ. This can be incorrect if the secondary
frequency segment is not defined. So conditionally set maximum
channel width to CH_WITH_160MHZ.

CRs-Fixed: 1082221
Change-Id: Iff28c56de56e5481814b4710eb51920a88f0f5f7
2016-10-26 15:04:51 -07:00
Selvaraj, Sridhar
2cad651a1b qcacld-3.0: Remove redundant mem zero after malloc in DP/UTILS/CDS/WMA
Remove redundant qdf_mem_zero after qdf_mem_malloc since output
of qdf_mem_malloc already gives zeroed memory[i.e. kzalloc].

Change-Id: I385afd98a134c2d79189090ce4c84c4b3adcc94e
CRs-Fixed: 1079691
2016-10-24 16:45:17 -07:00
Houston Hoffman
03890f55a4 qcacld-3.0: Abort cds_deinit_policy_mgr if context is null
Avoid null pointer de-reference.

Change-Id: I5f07ab5eba0d24512a06c5426427ad67ee6f798d
CRs-Fixed: 1081073
2016-10-24 14:48:08 -07:00
Naveen Rawat
91df30a191 qcacld-3.0: Trigger BUG ON only if recovery is disabled
When firmware event times out, panic only if recovery is disabled else
return failure so that driver load can fail gracefully.

Change-Id: I90d110af370842fcd2bc8cc11008d1524c99332e
CRs-Fixed: 1077315
2016-10-24 09:56:28 -07:00
Houston Hoffman
2741d15264 qcacld-3.0: do cds_sched_deinit_mqs if cds_alloc_ol_rx_pkt_freeq fails
Fix error handling to not leave deinit undone after init.

Change-Id: Ic00aa99f52ecfbc866332b71f5902b9261d8c319
CRs-Fixed: 1079503
2016-10-20 16:04:35 -07:00
Houston Hoffman
feb36ba5b1 qcacld-3.0: Continue cds_deinit_policy_mgr despite failures
Cleanup should ignore errors without modifying execution as much
as possible.  If one item was not initialized propperly the
driver should still try to cleanup the rest.

Change-Id: If132c40dffc801972ba801bb4a269b5dd9b954ff
CRs-Fixed: 1079503
2016-10-20 16:04:23 -07:00
Yun Park
a27049adf3 qcacld-3.0: Fix to disable MCC path for DBS and TX_FLOW_CONTROL_V2
Add code to check MCC for DBS case, and remove MCC mode switch
message to IPA when TX_FLOW_CONTROL_V2 is defined.

Change-Id: Ic09d1cbcb2df98b4b62b4fff27d44b67ce57c196
CRs-Fixed: 1077246
2016-10-18 19:54:14 -07:00
Nitesh Shah
044fd675f5 qcacld-3.0: Set SMM if all new/existing conns are in same band
When the device is in DBS mode, and STA session gets
disconnected, then the dbs_opportunistic_timer is started
to wait for 10s and then sets back to SMM (Single MAC
mode) after timeout if DBS mode is not required.

The enhancement is to check the if the device is in DBS mode
and the STA session disconnects and new STA session starts in
the band in which existing connection are there, then stop the
dbs_opportunistic_timer and set hw_mode to SMM.

Change-Id: I16bfbb5135e36f2ab87bd09244d5eb6932846c72
CRs-Fixed: 1077488
2016-10-18 12:40:25 -07:00
Nitesh Shah
73050ff958 qcacld-3.0: Avoid setting hw_mode to SMM when already in SMM
Whenever there is session disconnection, the device sets its
hw_mode to SMM (Single MAC Mode) if the current connections
are not using DBS mode. Thus, if the device is in SMM, it
still sets its hw_mode to SMM after session disconnection.

The enhancement is to check the if the device is already in
SMM, then avoid setting again to SMM.

Change-Id: I4ebb9b6d992e65667a06b3e68d322435c7ec2968
CRs-Fixed: 1076844
2016-10-18 05:31:31 -07:00
Arif Hussain
d944578076 qcacld-3.0: Add helper function cds_combine_channel_states
cds_combine_channel_states to select final channel state based
on the two channel states specially when operating on 80+80 MHZ.

Change-Id: I5f470c96ce499c8d9aa2e41ceff59cdfc2f31151
CRs-Fixed: 1075098
2016-10-17 22:41:25 -07:00
Rajeev Kumar
f7d000060f qcacld-3.0: Clean up obsolete cds_shutdown API
qcacld-3.0 recovery does not use cds_shutdown routine hence
clean up this obsolete API.

Change-Id: I4779c1336062a2cc6357b2a4cf82248d4c457aa8
CRs-Fixed: 1077094
2016-10-17 21:57:35 -07:00
Krunal Soni
15f0db18db qcacld-3.0: Populate correct PCL & ch numbers to avoid in case of SAP
Incorrect PCL is given by policy manager because of incorrect merging of
valid channel list & weight list which results in to unsafe channel selection.

Driver notifies the list of channels to avoid in terms of frequencies rather
than channel numbers which is not correct.

Change-Id: Ic71766e8c917931d4f051b512fb8000cc34a04ad
CRs-Fixed: 1077025
2016-10-17 21:57:24 -07:00
Prashanth Bhatta
2ac92bda55 qcacld-3.0: Stop MC thread during recovery
As part of Dynamic Mode change, optimization is added to not to
stop the MC thread but just to flush the message queues but that
doesn't help in case of recovery where in MC thread is the one
which needs to be stopped first so that lower layers doesn't try
to post any messages and try to process them while firmware
doesn't exist. Processing such messages may cause stability
issues.
Stop the MC thread as part of recovery and bring-up thread again
during re-init.

Change-Id: Ie1cfbfa74f6b3e849361f2213a9d29f277aa09cc
CRs-fixed: 1075224
2016-10-12 17:44:59 -07:00
Jeff Johnson
0d3a9d2a18 qcacld-3.0: Remove unused functions from cds_regdomain.c
Functions get_reg_dmn_for_country & cds_get_reg_dmn_5g are no longer
being used, so remove them.

Change-Id: I03308f6fd7802acf7e80c01f15f42c99bb77ce7e
CRs-Fixed: 1075544
2016-10-11 06:24:37 -07:00
Jeff Johnson
a7d169b1dc qcacld-3.0: Fix -Wmissing-prototypes in CDS
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in CDS.

Change-Id: I40141f7a9e7394e0071b84b32a2d2b95cfa3a09b
CRs-Fixed: 1075544
2016-10-11 06:24:37 -07:00
Naveen Rawat
ac39a10fae qcacld-3.0: Panic when wait for WMI_SERVICE_READY_EXT_EVENT times out
Change ASSERT to BUG_ON when wait for WMI_SERVICE_READY_EXT_EVENT times
out in insmod thread.

Change-Id: Ie666fd0881969a503e6b3635cdc5bb7f223776ec
CRs-Fixed: 1075166
2016-10-10 22:12:20 -07:00
Arif Hussain
4afc226c49 qcacld-3.0: Fix uninitialized variable use in cds_set_5g_channel_params
Initialize pointers bonded_chan_ptr and bonded_chan_ptr2 in function
with NULL and add check to avoid NULL/wild pointer dereference.

Change-Id: I48e4417998d75a7a42d6e55106896709016ac61c
CRs-Fixed: 1075098
2016-10-10 05:12:12 -07:00
Nitesh Shah
5b7bae07fc qcacld-3.0: Add SBS support in hw_mode_list
The enhancement is to add SBS (Single Band Simultaneous)
support in hw_mode_list.

The WMI HW Mode definitions are redefined to use only
for host purpose.

Change-Id: I8b8c966b0130964c8e7de7967766629c955209d3
CRs-Fixed: 1072234
2016-10-10 03:55:02 -07:00
Kabilan Kannan
32eb50281c qcacld-3.0: Clean up and refactor tdls module
Currently the build fails, if we disable TDLS
feature flag in the kbuild.
Fix all the tdls conditional compilation issues
to make a successfull build with tdls feature
flag enabled/disabled.

Change-Id: I78114474d9ebe65e76840cb581389535f3486e4f
CRs-Fixed: 1066077
2016-10-07 19:57:23 -07:00
Padma, Santhosh Kumar
9aba02f52c qcacld-3.0: Dump driver information
qcacld-2.0 to qcacld-3.0 propagation

Dump state information of HDD, SME, PE and WMA layers
into a buffer. Contents of this buffer will be copied
into user space using proc entry /proc/debugdriver/
driverdump.

Change-Id: Ifbb102e440d7df20defa1a397964cb9b55082bf9
CRs-Fixed: 955357
2016-10-07 12:54:36 -07:00
Nitesh Shah
4c48af3db1 qcacld-3.0: Update BW for interface when moving to single MAC mode
If the device is operating in MAC0 and MAC1. If the interface
present is MAC0 is removed, the interface in MAC1 moves to MAC0.
But the bandwidth for the interface is not updated properly.

The fix is to update the bandwidth of the MAC1's interface when
the MAC0's interface is removed, and is replaced by MAC1's
interface.

Change-Id: If114167f66d13a3660f9b92b72706bfc2e782b50
CRs-Fixed: 1073581
2016-10-07 09:49:03 -07:00
Nitesh Shah
d60bde2bb6 qcacld-3.0: Move a cds log to appropriate log level
A cds log for cds_get_channel_list() is printing quite often
and spamming the kernel logs. This log is not for error.
Hence moving this to appropriate log level.

Change-Id: I5d037f47729b612d6754e64f46b627998ec026f8
CRs-Fixed: 1072651
2016-10-07 09:49:00 -07:00
Hanumanth Reddy Pothula
47d2926b35 qcacld-3.0: In FTM mode, don't update config param, max peer limit
Presently, driver configuration from FTM mode to any other mode
is failing due to start module is failing, because configuration
parameter(max peer limit) is set to zero during FTM mode
initialization.

In FTM mode, during start modules, don't update configuration
parameter, max peer limit.

Change-Id: Ie5adea45b2dac099e797a1e25536cc959f3d5525
CRs-Fixed: 1073593
2016-10-06 11:24:30 -07:00
Poddar, Siddarth
1ab0a3db60 qcacld-3.0: Fix memory leak when SSR is triggered
qcacld-2.0 to qcacld-3.0 propagation.

Packets are not freed from cache buffer and causes memory
leak in SSR case. Flush cache RX frame queue to avoid this memory leak.

Change-Id: Idd9edde6fdb3b9ff3ecbe7d8139f9a66468b70af
CRs-Fixed: 1051019
2016-10-03 17:33:01 -07:00
Arunk Khandavalli
4cc97a9b18 qcacld-3.0: set global context to NULL only when all the cleanup is completed
In cds_deint, cds global context is set to NULL and then cleanup handlers of
memory/timer/nbuf manager's are invoked. During the cleanup these handlers
use QDF_TRACE to print the cleanup information which internally tries to
get the global context resulting in not clean unload of driver.

To migitate the issue set global context to NULL once the clean up of
all handlers is completed cleanly.

Change-Id: Ic58962dfd543020d79cabd7b646e483c4f7961f2
CRs-Fixed: 1067340
2016-10-03 16:43:26 -07:00
Naveen Rawat
8cc23b0d9a qcacld-3.0: Update host DBS policy manager in roaming operations
Firmware DBS mode is updated during firmware based roaming. Same change
is reflected in the host policy manager. Process hw_mode TLV in roam sync
indication event. Update cds concurrency policy after roaming. Handle
exceptions for ROAM_ABORT and HO_FAIL conditions.

Change-Id: I826c6766f73441256e5946d3167966e645f23430
CRs-Fixed: 1044336
2016-10-03 16:43:23 -07:00
Krunal Soni
499d364340 qcacld-3.0: Fix dwell-time when 2G-SAP is active and DBS is supported
Old generation of projects, which had only one MAC, are restricted to
use 28ms of fix active and passive dwell time when SAP session is active
but with new generation of projects, which can have two MACs, are
permitted to use longer active and passive dwell time when SAP session
is active on 2G band and DBS is supported.

Change-Id: I2638d9b7a3677c3f0b329ed8109d01baa2cffd68
CRs-Fixed: 1071353
2016-09-28 09:40:21 -07:00
Komal Seelam
78ff65a8c6 qcacld-3.0: Add NL event to indicate SSR shutdown is triggered
propagation from qcacld-2.0 to qcacld-3.0.

On Dual-WiFi Platforms, Radio Device 1 (R1 - SDIO interface) should
be functional only if Radio Device 0 (R0 - PCIe interface) is active.
If SSR is indentified on R0, indicate userspace application to unload
R1 on this event and Reload R1 once R0 SSR and reload is complete.

CRs-Fixed: 1046397
Change-Id: I8a06b569fe536bb93dbb37bdb289295bfce62f6e
2016-09-26 04:49:39 -07:00
Ankit Gupta
a507601be7 qcacld-3.0: Align return value check for qdf_mem_cmp
qdf_mem_cmp api returns zero when comparison string matches
else returns non zero. Checking return value with true/false
can cause confusion and errors.

Replace the return value check from true/false to
zero/non-zero values.

Change-Id: I485d69a4bf85d1e6273ea780af6d0423c3910686
CRs-Fixed: 1066946
2016-09-21 17:08:59 -07:00
Padma, Santhosh Kumar
9509135262 qcacld-3.0: Add timer related messages at the top of PE queue
qcacld-2.0 to qcacld-3.0 propagation

Currently when PE queue is full, timer message gets queued at the
end of PE queue even when timer gets expired in time. This causes
delay in processing timer messages. This delay can be maximum if
timer message is the last message in PE queue. This can take substantial
amount of time to process timer message as timer message will be
processed only after processing of other messages. For instance,
if timer message processing takes substantial amount of time during
scan, it can delay sending max channel timeout and may result in
scan timeout. So, add timer related messages at
the top of PE queue to process those messages immediately.

Change-Id: Iccaf0075c97a7edd2c1de1d168f1a4e7d01381c2
CRs-Fixed: 936179
2016-09-21 17:01:47 -07:00
Naveen Rawat
03e8d95c9e qcacld-3.0: Send HT/VHT CAPs IE to firmware per band
Send HT/VHT CAPs IE to firmware per band. This will allow certain
features like LDPC to be configured per band.

Change-Id: I21c83af984f9be3ade46121ef148b52568c3ad0f
CRs-Fixed: 1055774
(cherry picked from commit 2a94c5666ea0c66477d0086c8d5a401db8e4afcf)
2016-09-11 16:49:46 -07:00
Manjunathappa Prakash
fff753c12e qcacld-3.0: Add option to control Rx flow steering
Add ini configuration to enable/disable Rx flow steering.
Add HTT message to configure RX flow steering.

Change-Id: I80aab262c754716b28bfdae561d1cbf5e1d38e4d
CRs-Fixed: 1055179
2016-09-11 15:23:53 -07:00
Anurag Chouhan
04dbf6de4d qcacld-3.0: Disable RA filter when BPF is enabled
qcacld-2.0 to qcacld-3.0 propagation.

In current implementation, RA filter is enabled irrespective of the
BPF filter status. This change checks if BPF configuration in ini as
well as in target config is enabled, then RA will be disabled.

Change-Id: I85df0828af665d2bcc13c865b0ba40ebf882fffe
CRs-Fixed: 1058884
(cherry picked from commit 8dda6e83eb85ef9f0342ab23954e093c6dfebe2e)
2016-09-10 19:06:41 -07:00