Commit Graph

147 Commits

Author SHA1 Message Date
Krishna Kumaar Natarajan
4f1d7724a8 qcacld-3.0: [11AX] Add dot11mode changes to support 11ax
Add new dot11mode and update the utility functions to derive
the dot11mode based on the userspace config, INI config and
FW capability.

Change-Id: I5780120ef7bc2b78fd596e937fe14a2c8ad88348
CRs-Fixed: 1073481
2017-03-22 09:09:29 -07:00
Arif Hussain
405587c313 qcacld-3.0: Remove unnecessary log from wlansap_roam_callback
wlansap_roam_callback function logging an error message if
roam_status is not handled, in default case of switch, but same
information is logged before switch. So remove this log.

Change-Id: Id53eb392929d9328f959c7e54d7f0a5dd77b0739
CRs-Fixed: 2007415
2017-03-17 16:19:41 -07:00
Kapil Gupta
43c2f997ea qcacld-3.0: Correct API for acs channel range validation
qcacld-2.0 to qcacld-3.0 propagation

Add changes to correct the function to check for acs channel range.

CRs-Fixed: 1117328
Change-Id: Ie0a53c2f5ee26552d36da0e6c4dcda124abc71a7
2017-03-13 04:39:13 -07:00
yeshwanth sriram guntuka
92fefea5ed qcacld-3.0: Fix rate population on channel change of SAP
On channel change of SAP to 5G, SAP is populating 2.4G basic
rates in 5G beacon.

Set number of supported and extended rates to zero for populating
rates based on network type. CSR layer will pick default rates if
hostapd rates are passed as zero

Change-Id: Ia393f7b6067f31dc8f792cda2bd74c441c2112e6
CRs-Fixed: 1105867
2017-03-10 01:36:34 -08:00
Sandeep Puligilla
91273c2799 qcacld-3.0: Conditional compile scan registration
Move scan registration API under NAPIER_SCAN conditional
compilation flag.

Change-Id: I177fd66f72fc8d9e27613dbb0ee479709d11b5da
CRs-Fixed: 2013212
2017-03-09 01:15:02 -08:00
Ashish Kumar Dhanotiya
48c6b6e708 qcacld-3.0: Handle the channel selection failure case for ACS mode
In case of auto channel selction failure, clean exit does not happens
which results as scan completion event timeout in start bss API.

Add appropriate  API call with channel selection failure
case.

Change-Id: I66a81f586234adb5a0edc4c85cfbaa221424217f
CRs-Fixed: 2006960
2017-03-09 00:39:05 -08:00
Sandeep Puligilla
0806e0f980 qcacld-3.0: Modify SAP ACS scan
Modify SAP ACS scan logic according to new
scan common component.

Change-Id: Id85b6c8a9a1500eeec488b30ee3fd1707b402347
CRs-Fixed: 2013212
2017-03-07 10:49:53 -08:00
gbian
32b067081b qcacld-3.0: Fix the compiling error for macros SM/MS redefinition
Fix the compiling error for macors SM/MS redefinition in both htc.h
and dfs_phyerr_tlv.h.

Change-Id: I591bc8a55542ff8f3b6ce27201c33164e4bdfb66
CRs-Fixed: 1102190
2017-03-04 09:45:56 -08:00
Tang Yingying
523322db1a qcacld-3.0: Add "static" before function to fix compilation error
Some functions are only used in the file which it is defined
in. Add "static" before function to fix compilation error.

Change-Id: Ie99c8e2a2c4dd6564c19876f8456a47786d3e5cb
CRs-Fixed: 1112463
2017-02-15 19:11:23 -08:00
Kapil Gupta
8878ad9517 qcacld-3.0: Add support for external auto channel selection
Add changes to enabled driver to use external auto selection
logic instead of current driver based implementation.
In case external application is not present, driver will fall
back to current solution.

Change-Id: Ib7474e82bc7f5878af46c91ea09711775a7c046a
CRs-Fixed: 1110061
2017-02-13 23:01:23 -08:00
Kapil Gupta
94ca6f67f6 qcacld-3.0: Add APIs to validate vendor ACS channel
If channel set is coming from external application, it could be
possible that it doesn't fall into valid channel criteria.

Add APIs to validate the channel.

Change-Id: I1aa855b64c7702418471111d59c92ebaebe8be49
CRs-Fixed: 1110061
2017-02-13 23:01:21 -08:00
Kapil Gupta
086c6206de qcacld-3.0: Add changes to collect channel info from regulatory
Vendor ACS requires regulatory channel info for each channel.

Add changes to collect channel information of each channel
and save it in sap config.

Change-Id: Ib96c3f7ddfc8476306e9a13127472be9dd0a9488
CRs-Fixed: 1110061
2017-02-13 23:01:19 -08:00
Arif Hussain
4d43b9b9a6 qcacld-3.0: DFS CAC duration fix for emulation platform
For emulation platform, timer value multiplied by  100,
Set the CAC value accordingly, to get timer expire after
intended duration.

Change-Id: Ia99ee6f36b88bca3c297fc06d1f3b777a2114d14
CRs-Fixed: 1114332
2017-01-27 12:02:13 -08:00
bings
394afddedf qcacld-3.0: Do not set ACS flag if no ACS to be done
qcacld-2.0 to qcacld-3.0 propagation

wlan_hdd_cfg80211_change_iface will abort if ACS_IN_PROGRESS
is set, which causes iface type mismatch between hostapd and
driver.

When force SCC if same band is enabled, driver will not do ACS
for the second AP. So do not set ACS_IN_PROGRESS if no ACS to
be done.

Change-Id: I2c975c89dc1cf0d11980ad11c8d0d256c680594d
CRs-Fixed: 1105386
2017-01-25 17:14:46 -08:00
Arif Hussain
2988e45d5c qcacld-3.0: Fix incorrect condition in sap_add_mac_to_acl function
Currently sap_add_mac_to_acl() function has incorrect validation check,
size of MacList will be always zero if no elements added to the list.

Validating size always be greater than zero will prevent adding first
element itself. There by breaking whole ACL functionality.

To fix this, remove ‘*size == 0’ condition in validation code.

Change-Id: Ic3e51db798a996870ef65cda0eddfd1ec738d290
CRs-Fixed: 1104152
2017-01-16 20:40:23 -08:00
Naveen Rawat
b56880cd83 qcacld-3.0: Match the timeout values at HDD with SME cmd timeout
Change the timeout values at HDD to match sme cmd timeout in all the
instances where HDD is sending cmd via SME command queue.

Change-Id: I00337169804b9ce71562cb114e4c2b92a7534dba
Crs-Fixed: 1100854
2017-01-11 09:06:29 -08:00
Sandeep Puligilla
7a5b84d5b0 qcacld-3.0: Increase SAP open session timeout value
In failure scenario host got two commands, one is connect
request on the STA interface and the second one is add
interface/open session on softAP interface.
HDD/SAP queues the eSmeCommandRoam first to
the SME active list and then eSmeCommandAddStaSession to
sme pending list with timeout value of 2 secs at SAP.
Connect takes more than 2 secs due to which addStaSession
gets timedout.

Configure SME active timeout value to 30sec.
Increase the wait time at SAP for open session to 30secs
which is equal to the SME active command timeout value.

Change-Id: I77a0279421566ded7cd0eb7cde7871d3074ec5cf
CRs-Fixed: 1096771
2017-01-10 10:52:33 -08:00
Sandeep Puligilla
db1c590eae qcacld-3.0: correct module id in log messages
SAP module dubug message log contains QDF
module id.

Replace cds_err API with QDF_TRACE API to
log the correct module id in debug messages.

Change-Id: Ib39a95cd0688d6029c802c4710127a4c72ae6411
CRs-Fixed: 1098145
2017-01-10 10:52:30 -08:00
Wu Gao
a61310a3bb qcacld-3.0: protect channel list buffer
propagation from qcacld-2.0 to qcacld-3.0

AP+AP case, one is started, another one start fails and its channel
list buffer is NULL. When radar signal found, it will change channel
with second sap's context, then crashed since channel list is NULL.

Change-Id: I73f2c1c2fa0667e7517e2a6867d79175c47d4582
CRs-Fixed: 1091122
2017-01-10 10:52:15 -08:00
Wu Gao
3671743bd5 qcacld-3.0: Stop SAP and indicate event more earlier after SSR
propagation from qcacld-2.0 to qcacld-3.0

DUT is SAP + STA SBSC mode, it takes very long time to recover after
SSR. There are two problems:

1. It clear STA session and create new after SSR, but just clear SAP
session. With sessionId in SAP context, it wrongly use new STA session
to close SAP when terminate hostapd. This is the reason why host wait
stop_bss_event for 10 seconds in cfg80211 stop ap. Set sessionId to
invalid if adapter is SAP mode.

2. In dual-wifi mode, it will start second WLAN if SSR and
WLAN_SVC_FW_CRASHED_IND late. Send this event more earlier.

Change-Id: I10a3f300ac5621463fcce4d0a5e18b2cf1cb8491
CRs-Fixed: 1054612
2017-01-09 11:21:28 -08:00
Hanumantha Reddy Pothula
3e5d6aae27 qcacld-3.0: Send disconnect indication to upperlayer after clean up in PE
qcacld-2.0 to qcacld-3.0 propagation.

Supplicant may send PNO command as disconnection was already informed
to supplicant while disconnection might still be in progress in PE
layer(DEL_STA/DEL_BSS).
Fix to send disconnect indication to upper layers after complete
cleanup.

Change-Id: I976044186eb8e79f709bda618b38815827a3e0c5
CRs-Fixed: 951162
2017-01-09 11:21:23 -08:00
Wu Gao
03dd0f68f4 qcacld-3.0: Process channel change request only when SAP is started
propagation from qcacld-2.0 to qcacld-3.0

When SAP starts (DFS channel) on default interface and a new interface
for SAP is created, if eSAP_DFS_CHANNEL_CAC_RADAR_FOUND event is
triggered then kernel panic happens. This is because for the new
interface SAP is created but not started and due to this channel list
is NULL. Fix is to add state check for SAP interface to know if SAP is
started or not

Change-Id: If613ec3ed0afad8a66d545bcd858fe73640a0273
CRs-Fixed: 1062516
2016-12-14 14:07:46 -08:00
Wu Gao
d35bcb8db6 qcacld-3.0: Cleanup DFS CAC timer
propagation from qcacld-2.0 to qcacld-3.0

Start SAP with DFS channel on default interface and create new AP
interface without any operation, then terminate SAP and rmmod WLAN
driver, DUT crash since it doesn't clean up sap_dfs_cac_timer. The
solution is return cocurrent session only when state machine isn't
disconnected in sap context.

Change-Id: Iffc1d9239c303c25067da2e2d30e37648a44e599
CRs-Fixed: 1051755
2016-12-14 14:07:37 -08:00
Yingying Tang
b4832f7faf qcacld-3.0: Add SAP TX leakage threshold into ini file
Propagate from qcacld-2.0 to qcacld-3.0

Current value of SAP TX leakage threshold is a fixed value 310,
since different product may need different threshold, add it
into ini file now.

Change-Id: I0df8ac14f5e9e812a8ec5e5127df21eff0a8502b
CRs-Fixed: 955258
2016-12-14 14:07:25 -08:00
Abhishek Singh
34a4d86ce1 qcacld-3.0: Use offset to get the ie length from bss descriptor
qcacld-2.0 to qcacld-3.0 propagation

The length of bss descriptor is calculated using offset of IE
field but when lim tries to get the ielength it doesnt use the
offset which results in incorrect IE length.

To fix use offset to get the ie length from bss descriptor

Change-Id: I7abbde83aea1e0a1cfcd7bdb1a184158f75f2455
CRs-Fixed: 1082001
2016-12-14 14:06:38 -08:00
Yingying Tang
76caff9ef2 qcacld-3.0: Fix improper type casting and return status
Propagate from qcacld-2.0 to qcacld-3.0

In rrmProcessBeaconReportReq(), the return value is not the same
enum type with the routine definition. In dfs_process_radarevent(),
2 variables type are not same in a comparison. Add fix to correct
it.

Change-Id: Ibc5fbf70e2632a22971f33b769b31737a40123e7
CRs-Fixed: 979671
2016-12-14 14:06:35 -08:00
Yingying Tang
aca4a22487 qcacld-3.0: Update radar timestamp in NOL list when receive a radar event
Propagate from qcacld-2.0 to qcacld-3.0

If a channel is already in NOL list and DFS period has been expired, the
radar timestamp will not be updated when a radar event received. Update
radar timestamp in sap_mark_dfs_channels() to resolve this issue.

Change-Id: Ie9132f84bf5f35146e518b2a8a71998ddb2de901
CRs-Fixed: 1000945
2016-12-14 14:06:33 -08:00
Yingying Tang
e5f658e2e8 qcacld-3.0: Remove the unnecessary compiler marco
Propagate from qcacld-2.0 to qcacld-3.0

In WLANSAP_ScanCallback(), the local variable event is contained
in a unnecessary compiler marco. Remove it to avoid some compilation
error risk.

Change-Id: Ia3249c464f909896af5f242510742c68ad02cc5a
CRs-Fixed: 979671
2016-11-14 11:50:52 -08:00
wadesong
4e55519a5a qcacld-3.0: Replace literal number usage with a proper macro
qcacld-2.0 to qcacld-3.0 propagation

A macro should be used for radar table allocation/freeing
instead of a literal number

Change-Id: Iccf2aee57f52dedeebb87f1445edd9d30bbdeec3
CRs-Fixed: 1072046
2016-11-14 11:50:46 -08:00
Jeff Johnson
7160ff0131 qcacld-3.0: SAP: Fix incorrect use of "\" line continuation
Currently there are instances of the "\" line continuation character
being used inside quoted strings. This has the undesired side effect
of including the indentation of the continued line as part of the
quoted string. In addition per the Linux Coding Style user-visible
strings should not be split. So remove all incorrect instances of "\"
line continuation from SAP.

Change-Id: Ic53b6570df501e8eb7f9812279aca1c748b66fba
CRs-Fixed: 1087292
2016-11-14 11:50:33 -08:00
Liangwei Dong
aef84347a8 qcacld-3.0: On demand OBSS scan of SAP
qcacld-2.0 to qcacld-3.0 propagation

To shorten the SAP starting time, the OBSS scan
can be skipped if the ACS scan is performed
and the ACS scan channels cover the OBSS scan
channel list.
This change caches the ACS channel list and
skip the OBSS scan if necessary.

Change-Id: Iae54115051ae037c83b8dd2b639754f941c1d0f5
CRs-Fixed: 1073053
2016-11-08 17:48:18 -08:00
Liangwei Dong
df50df97c3 qcacld-3.0: Fix SapAllChnlList memory leak
qcacld-2.0 to qcacld-3.0 propagation

"MEMORY_DEBUG" enabled driver shows the
SapAllChnlList is not freed upon driver unloading
in SNS test. This commit fixes this issue by
freeing channel list in WLANSAP_CLOSE API.

Change-Id: I1c954336e14746060fec19f3ad89b3d4882306af
CRs-Fixed: 985334
2016-11-03 17:54:07 -07:00
Liangwei Dong
71ed6502ea qcacld-3.0: Fix pSpectInfoParams memory corruption
qcacld-2.0 to qcacld-3.0 propagation

Before write to array member of pSpectInfoParams
in sapSelectChannel, we need to check the memory
access range to avoid the write overflow of the
memory.

CRs-Fixed: 998557
Change-Id: I0c05f65fd2ab62919272464a3be7cd138f12e2ec
2016-11-03 17:54:07 -07:00
Kai Liu
a6cd4e0137 qcacld-3.0: Filter all channels that affected by radar signal leaking
qcacld-2.0 to qcacld-3.0 propagation

When radar detected in sap channel, it needs switch channel. Those
channels affected by radar signal leaking should be filtered out
from candidate channels.

Change-Id: I86e6e849e7822f1c82c0f8951a8d91c5baebdcfe
CRs-Fixed: 945388
2016-11-03 17:54:07 -07:00
Liangwei Dong
9cfaa707b2 qcacld-3.0: Fix SAP restart failure
qcacld-2.0 to qcacld-3.0 propagation

When the driver is configured to "force SCC" mode by
gWlanMccToSccSwitchMode = 2, in STA+SAP case, the
driver will check the SAP channel to avoid the
MCC in same band(2.4G or 5G) and override if necessary.
During ACS process, the SAP sapContext->channel is 0.
The driver doesn't validate it before uses it in
sapGotoChannelSel when applies the "force SCC" logic.
That causes an invalid channel selection for the SAP.
And finally causes the hostapd starting failed.
This fix is to skip the override logic if the
sapContext->channel is 0. When the SAP is starting with
a valid channel, the override logic will be activated
again.

Change-Id: I8e3d171ac47d8be149df98ae3e30c8df391a15b0
CRs-Fixed: 1033277
2016-11-03 17:54:07 -07: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
Sandeep Puligilla
9d81e7d7d5 qcacld-3.0: Fix freed pointer dereference
In an HDD timeout failure scenario, HDD frees the sap context. A
delayed WMA response will try to access the previously freed sap
context.

Add a validation check to prevent dereferencing the freed pointer.

Change-Id: Ifcc7d840680b05f4b136722ae204e7a55b66c6cc
CRs-Fixed: 1083677
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
Arif Hussain
16f1dae19a qcacld-3.0: Fix possible buffer overflow in sap_random_channel_sel
In function sap_random_channel_sel change final_lst  array size from
WNI_CFG_VALID_CHANNEL_LIST_LEN (100) to QDF_MAX_NUM_CHAN (128) to
avoid possible buffer overflow, as sap_apply_rules function can return
rule_adjusted_cnt QDF_MAX_NUM_CHAN size.

Change-Id: I367dc54966fa57a7ef0195279953e31def06fd21
CRs-Fixed: 1082162
(cherry picked from commit bceffc9b2cfb622fbb44b5ec768fd7ebc6ecadb2)
2016-10-29 17:23:49 -07:00
Arif Hussain
165aa4cf98 qcacld-3.0: Fix null pointer dereference in sap_signal_hdd_event
sap_signal_hdd_event function caller may pass NULL csr_romeinfo,
So validate csr_roaminfo to avoid null pointer dereference.

Change-Id: I17364d9c3eb7b84786a86c29bc03b99dc2c0149a
CRs-Fixed: 1082162
(cherry picked from commit 023028cc64383d062d10a3922dc06ba6c4cac54a)
2016-10-29 17:20:56 -07:00
Dustin Brown
53c3aa6a24 qcacld-3.0: 4.8 Kernel Migration - Update calls to abs()
As of the Linux kernel 4.5, the abs() macro has changed so the results
are no longer promoted to long. Fix related issues.

Change-Id: Ic1e71327427df5fe2b47587f4dc164cbd50b86ee
CRs-Fixed: 1079308
(cherry picked from commit c980b6d8cf8f9a8beeebd702b2fc98e6b8ffc948)
2016-10-28 18:09:04 -07:00
Kai Liu
e30491fbfe qcacld-3.0: add channel 144 in sap channel leakage matrix
qcacld-2.0 to qcacld-3.0 propagation

Host driver will use sap channel leakage matrix to identify whether
this channel is leakage due to radar detected in sap channel. channel
144 is missed in this table.

Change-Id: I15b8cce29da8ba5d7beef1b4e684200121a4aa61
CRs-Fixed: 945408
2016-10-26 15:41:55 -07:00
Liangwei Dong
87a1ecce02 qcacld-3.0: Handle dfs channel switch failure
qcacld-2.0 to qcacld-3.0 propagation

We need to stop SAP bss and destroy the SAP
session if the channel switch failed. Otherwise,
the vdev will leak and it will cause SoftAP
start failed in following test.

Change-Id: Ieb3a2d62c8698f245f787be3c215ee4365b2e8ba
CRs-Fixed: 944741
2016-10-26 15:41:54 -07:00
Dustin Brown
0ce56d3b83 qcacld-3.0: Fix SAP 'Channel Avoid' Build Issues
The CLD driver does not compile when FEATURE_WLAN_CH_AVOID is not
defined. Fix related issues.

Change-Id: I3c3f14c16bd6a004670b6105231e591a13039fdc
CRs-Fixed: 1078863
2016-10-25 11:26:51 -07:00
Selvaraj, Sridhar
6ada9ffd8c qcacld-3.0: Remove redundant mem zero after malloc in SME
Remove redundant qdf_mem_zero after qdf_mem_malloc since output
of qdf_mem_malloc already gives zeroed memory[i.e. kzalloc].

Change-Id: I15e16bbe8caa8c03ffd1fefdabd415619393e117
CRs-Fixed: 1079684
2016-10-24 16:45:19 -07:00
Kai Liu
bdd5fcb83f qcacld-3.0: Add interface to get channel width in sap mode
qcacld-2.0 to qcacld-3.0 propagation

Add iwpriv interface to get channel width when working in sap mode.

Change-Id: I9900655861032636af1b4147ec6322e5aa76e614
CRs-Fixed: 1009861
2016-10-19 17:42:26 -07:00
Jeff Johnson
464f7ea7b7 qcacld-3.0: Fix -Wmissing-prototypes in sap/src
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in sap/src.

Change-Id: I92193d6209c5e62468197a1aae8a4187f60b0891
CRs-Fixed: 1075555
2016-10-17 22:41:33 -07:00
Jeff Johnson
8a621308c2 qcacld-3.0: Fix -Wmissing-prototypes in sap/dfs
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in sap/dfs.

Change-Id: I05b091f33d94a0219d4113d49c392828ed4350b8
CRs-Fixed: 1075555
2016-10-17 21:59:06 -07:00
Agrawal Ashish
06e76d2909 qcacld-3.0: Populate correct supported rates from hostapd.conf file
qcacld-2.0 to qcacld-3.0 propagation

Currently driver populates default supported and extended supported
rates in beacons even if hostapd.conf file wants to change
supported and extended supported rates.
Fix this by parsing beacon head and tail to get supported
and extended rates and populate them in sap config.
If Driver force acs is enabled, driver acs will get priority.
In case of driver based acs, driver should
ignore basic and extended rates from hostapd.conf and should
populate default rates.

Change-Id: I3226438b908a96f1b1bd3c2968a0c20eef81a799
CRs-Fixed: 1035768
2016-10-06 04:08:57 -07:00
Agrawal Ashish
6563461fa7 qcacld-3.0: Implement vendor command for ACS policy
qcacld-2.0 to qcacld-3.0 propagation

Add support for vendor command which informs the driver about the
ACS policy.
QCA_NL80211_VENDOR_SUBCMD_ACS_POLICY is used to inform driver about
ACS policies.
QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE attribute tells if DFS channel
should be enabled or disabled in ACS.
QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL attribute provides channel number to SAP
module to skip ACS and use this channel as operating channel.

Change-Id: I1ba69ed8fdf1c56a90e857054c725b830293d6bf
CRs-Fixed: 997433
2016-09-28 10:14:15 -07:00