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
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
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
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
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
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
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
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
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
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
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)
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)
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)
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)
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
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
The CLD driver does not compile when FEATURE_WLAN_CH_AVOID is not
defined. Fix related issues.
Change-Id: I3c3f14c16bd6a004670b6105231e591a13039fdc
CRs-Fixed: 1078863
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
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
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
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
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
qcacld-2.0 to qcacld-3.0 propagation.
Currently, SAP start's on 2.4ghz channels on detecting unsafe
channels even though operating band ACS hw mode is configured
on 5ghz channels.
Fix is to start BSS on band based on ACS hw mode
Change-Id: I210937b4b464c408d5a22c348c028fa9a11b2142
CRs-Fixed: 1005327
qcacld-2.0 to qcacld-3.0 propagation
At the time of driver load, sap session is opened as part of
hdd_init_ap_mode but in case of sap restart, sme_open_session
is called from sapFsm.
At the time of opening session, sme_open_session register
wlansap_roam_callback callback for connection status.
If this callback is not registered, HDD will not get connection
status and HDD will start cleanup after SAP connection timeout which
will result in SAP failure.
Need to register wlansap_roam_callback as part of sme_open_session
when session is not created as part of hdd_init_ap_mode.
Change-Id: Ifd2cec5fec432f1dcd2b39c59df1f1c5b13c55d5
CRs-Fixed: 1051097
qcacld-2.0 to qcacld-3.0 propagation
use the same reason code in the disassoc, which the upper
layer has passed to the driver
Change-Id: I6302a5c8318a8e3c1221b9272637455da4e7f150
CRs-Fixed: 852387
In sap_random_channel_sel function, new channel and channel width will
be calculated based on the available channels. New channel width is
populated to only new_chanWidth and this new channel width value will be
assigned to new_ch_params in wlansap_set_channel_change_with_csa.
This channel width from new_ch_params will be used as new channel width
on restarting SAP on Radar detection.
wlansap_set_channel_change_with_csa will get called only when radar is
detected when SAP started beaconing (after CAC wait).
If radar is detected during CAC_WAIT state, new_ch_params will not be
having new calculated channel width, it will be having zero, So during
this scenario SAP will be restarted with 20MHz bandwidth.
To fix this, populate new channel width to new_ch_params in
sap_random_channel_sel along with new_chanWidth.
Change-Id: If07f875dda3a4f6d29480c84b784ca7995c19c7f
CRs-Fixed: 1063038
(cherry picked from commit 714eb0a7fae9c4e50b1c52fa27001705991ab6eb)
qcacld-2.0 to qcacld-3.0 propagation
We do not support SAP on DSRC channels, so skip the DRSC channels
during sap channel initialization.
CRs-Fixed: 1050454
Change-Id: If5544027bca7bc0a578978dfe91adc37e897e992
(cherry picked from commit 0005bfa2adcbe4bc06b96523bb387a7df902a6c7)
(cherry picked from commit b8f62655ae5a86b745ca099fa371914a702abf59)
qcacld-2.0 to qcacld-3.0 propagation
During P2P functionality, Host will send GO NEG REQ and
receives ACK completion from firmware which will be queued
to indicate HDD. Meanwhile if host receives GO-NEG RESP it
will be sent directly to HDD via function callback. In HDD as
we got GO NEG RESP before ACK completion for GO-NEG REQ, HDD
will generate pkt completion for GO NEG Request.
Now GO NEG CONFORMATION frame will be sent and driver will be
expecting completion for this. The GO NEG REQ ACK completion
which got buffered in PE will be delivered to Supplicant and
Supplicant assumes that this is the ACK for GO NEG CONF frame.
This causes early termination of remain on channel due to which
firmware may drop the GO NEG CONF frame and may not retry as ROC
is terminated.
Fix this by making ACK Completion indication to HDD via function
callback.
Git-commit: 32ddf4196f423b8eaea7ec6c0816e2961aa7fc45
Change-Id: I0dd3acb236b270839649d2becfdc007e7aae9fdd
CRs-Fixed: 1012547
(cherry picked from commit a3996d421de7f55d5a6f7da19d7ff4b568ce7c50)
(cherry picked from commit 42405db3bd3f4b10800cde8cdcd14f521461a5a7)
qcacld-2.0 to qcacld-3.0 propagation
In function "sap_select_channel" avoid selecting DFS channel if
DFS master mode is disabled.
Change-Id: I4b45401500db32f0677e5364e4cf415dca2ca23c
CRs-Fixed: 939153
(cherry picked from commit 0a1ecad5876e7526a9283cba331e22453e03490e)
Check for active STA and SAP connections before switching the operating
channel of SAP to a DFS channel. SAP moves to a DFS channel only if
this movement ensures that the SAP does not go off the DFS channel which
is needed for continuous radar detection.
The existing check looks for the number of open sessions. But these
sessions may or may not be active. So, replace this check with suitable
APIs which will check for active sessions.
Change-Id: Ib37427a9c62a785abb5e22c14ec23f09e60bf4b7
CRs-Fixed: 1063212
(cherry picked from commit d470e33f6d390b84dd98892a1b4526fd45348c2b)
NULL check is not required before freeing the memory allocated to
dfs_radartable.
Add the changes to remove unnecessary NULL checks.
Change-Id: I063c036024e6bfc235a418056d15843646bc5a3c
CRs-Fixed: 1063843
qcacld-2.0 to qcacld-3.0 propagation
As per the current logic during start bss failure scenario
SAP/GO session is not closed resulting in vdev leakage.
Due to above leakage new interface creation with same MAC
address results in target assert.
Make change to cleanup SAP/GO session on start bss failure.
Change-Id: I785b4486f439646e2119adc87895ed95c6b80de6
CRs-Fixed: 954601
qcacld-2.0 to qcacld-3.0 propagation
Currently there are many logs which adds new line
explicitly. As part of logging enhancement, remove
such extra space lines.
Change-Id: Idee9ff6a2e0452991f7d50a986c26f36303defd1
CRs-Fixed: 974415
qcacld-2.0 to qcacld-3.0 propagation
In some case when complete preferred channel list is unsafe,
SAP won't be able to pick any channel as operating channel.
This will lead to SAP start failure.
Fix this issue by making first channel from preferred channel
list as operating channel.
Change-Id: Id2bd177b15bd7089250a49019a9c751a691dac01
CRs-Fixed: 1026420
qcacld-2.0 to qcacld-3.0 propagation
Memory allocated for dfs filters in dfs_attach() API
does not get freed in failure case.
Add changes to fix memory leak issue.
Change-Id: Icdd4a382685471c0d3cf8115cec30fcb307eedfb
CRs-Fixed: 1038603
In sap_acs_channel_check fix ‘if’ condition will be always true for any
given channel, this will fail to validate if the given channel is in ACS
channel range.
Fix the if condition check from logical OR to AND to validate given channel
is within the ACS start and end channel range.
Change-Id: I1d69c9d440e641b052fd6098d1c99f22a64e9a9d
CRs-Fixed: 1056036
KR and CN have different DFS regions than what kernel provides.
Assign the correct DFS regions for KR and CN. Also use "enum
dfs_region" as the parameter type in functions that have
dfs region as parameter.
CRs-Fixed: 1047214
Change-Id: I2ddd67d3c29a448dd2a1d3a63113750783fb6731
Add support for pre CAC on SAP for the user requested channel.
The reason for the requirement is to have SAP operations without
interruptions due to CAC. After starting SAP on the 2.4GHz
channel, the driver will start a pre CAC on the 5GHz DFS channel
requested. If no radar is detected, SAP is expected to switch
from the 2.4GHz channel to the DFS channel mentioned in the pre
CAC request. If radar is detected SAP will continue to operate on
the 2.4GHz channel. To provide the pre CAC channel to the driver,
vendor commands/attributes are used .
Change-Id: I4cf4bb5a861eea05f37fafb3bf35d327f5377aab
CRs-Fixed: 1045242
RSSI_COMB is not reliable indicator of RSSI for extension80
when operating in 80p80 non-contiguous mode due to existing
hardware bug.
Add workaround in software to use pulse_rssi instead of RSSI_COMB.
Change-Id: I89c829ecefca2dcc75bb494943c98bdb77470de6
CRs-Fixed: 1043760
gPolicyManagerEnable INI item is no longer needed. Remove this
INI item and make policy manager code enabled by default.
Change-Id: I57822f47325c03e940b2802fb02900c64d3587e1
CRs-Fixed: 1034888
This is qcacld-2.0 to qcacld-3.0 propagation.
Destroy sap_dfs_cac_timer at callback function based on check if timer
is still valid.
Change-Id: Ib8b92ac11444b63a0d8002edff35cd9238bb2573
CRs-Fixed: 967907
Ensure that the SAP operations make use of the mandatory
channel list during SAP channel selection with INI option
'gWlanMccToSccSwitchMode' set to the value of '4' which
will make use of this channel list while trying to avoid
MCC scenarios.
Change-Id: Ia43ee1d2c598c81a5ef0add9246c400577f6f694
CRs-Fixed: 1014128
Ensure that the SAP context is sanitized before extracting
the global handle. The context passed in the callback could
be freed by the time it is accessed.
Change-Id: I4a08717abce2a0ecbe4055360fd8d31c3e50a701
CRs-Fixed: 1031855
Ensure that the SAP context is validated before access in
its callback. The global SAP context is now an array of
contexts rather than a single global context to help
validate the session. Increasing the SAP open session
timeout helps to configure all the commands to the FW and
helps to further avoid any crashes.
Change-Id: I6f722dcc4ab671fef010c816a7c7d38fc1bdebe4
CRs-Fixed: 1031855