Commit Graph

373 Commits

Author SHA1 Message Date
Zhu Jianmin
436827dd13 qcacld-3.0: Use same sap_context for different SAP wrongly
When receive dfs event, if no available channel,  stop all AP,
but send eSAP_STOP_BSS_DUE_TO_NO_CHNL to same AP for 2 times
wrongly during SAP+SAP concurrency, init and schedule same work
queue sap_stop_bss_work 2 times at nearly same time, deadlock
happens

Change-Id: I86cf0ed578e81b3bc1941e057e91c9d952893e07
CRs-Fixed: 2230873
2018-05-24 11:13:27 -07:00
Tushnim Bhattacharyya
6610ff711f qcacld-3.0: Restrict the force SCC logic for STA+SAP only
Restrict the force SCC logic for STA+SAP only, driver shouldn't
use the force scc logic for STA+P2P GO.

Change-Id: I3e62256bc1d8fd35667e6413219077ddc30f0732
CRs-Fixed: 2243537
2018-05-21 10:26:27 -07:00
Jeff Johnson
c7e4d16ff9 qcacld-3.0: sap: Fix misspellings
Address the following issues in the core/sap folder:
CHECK: 'availabe' may be misspelled - perhaps 'available'?
CHECK: 'defult' may be misspelled - perhaps 'default'?
CHECK: 'fucntion' may be misspelled - perhaps 'function'?
CHECK: 'Funtion' may be misspelled - perhaps 'Function'?
CHECK: 'intial' may be misspelled - perhaps 'initial'?

Change-Id: Id1e696f70d4d3c5ff650a353eb8402216909bc2c
CRs-Fixed: 2241944
2018-05-18 00:00:18 -07:00
Wen Gong
bf560c80fb qcacld-3.0: Add sap_indicate_radar stub for DFS master disable
Add sap_indicate_radar for enable / disable DFS master feature

Change-Id: I2b65213033fd6065ae8f1a38e927956410678daf
CRs-Fixed: 2243754
2018-05-17 21:39:03 -07:00
bings
071a4c6d71 qcacld-3.0: Do not call dfs_get_radars if concurrent sap exists
If concurrent sap exists, which means dfs_init_radar_filters has
been called before, there is no need to call it again.

Change-Id: Ibf1805b0dbd27fbdf36c37450bdb95626195fb81
CRs-Fixed: 2241282
2018-05-17 11:35:01 -07:00
Will Huang
9913277e97 qcacld-3.0: Clear mac_ctx->sap.sapCtxList for SAP if SSR happen
While SSR happen, hdd_reset_all_adapters will not clear
mac_ctx->sap.sapCtxList[sapctx->sessionId].pSapContext, and later the
sapctx will assign new sessionId after SSR restart SAP and update to
mac_ctx->sap.sapCtxList. So sapctx/old sessionId still can be
referenced by like wlan_sap_is_pre_cac_active and call pre cac cleanup
on unexpected port.

When SAP restart and set global sapCtxList in sap_set_session_param(),
find matched sapctx and clear it before assigning updated value.

Change-Id: Id02733cb22267ac0c1899d8caf9ac47c65e24a88
CRs-Fixed: 2232398
2018-05-14 10:26:18 -07:00
Jeff Johnson
33142e6fb6 qcacld-3.0: Fix typo "doesnt"
Replace typo "doesnt" with correct spelling "doesn't".

Change-Id: Ic3063f9fe74e10f656e00e86c8f38ccf1132f22d
CRs-Fixed: 2238297
2018-05-12 04:30:58 -07:00
Jeff Johnson
4ceed38fbf qcacld-3.0: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I16de4aedcd0f401da8b11fa0ea4989ad1e73bf57
CRs-Fixed: 2238297
2018-05-12 04:30:02 -07:00
Jeff Johnson
2cc31fdbad qcacld-3.0: Fix typo "choosen"
Replace typo "choosen" with correct spelling "chosen"

Change-Id: I58fc894783093f3d68f3b576906695a9ce201adf
CRs-Fixed: 2237731
2018-05-09 15:19:55 -07:00
Jeff Johnson
e4c11db22a qcacld-3.0: Fix camelCase in tsap_Config_t
Rename typedef tsap_Config_t and the underlying struct sap_Config to
align with the Linux coding standard.

Change-Id: I6e8f8b5ab9555c7781f1acf12a0475902866300c
CRs-Fixed: 2237721
2018-05-09 15:19:47 -07:00
Vignesh Viswanathan
ad47f0a2a8 qcacld-3.0: Modify callers of ObjMgr APIs to include pdev_id
wlan_objmgr_get_vdev_by_macaddr_from_psoc and wlan_objmgr_get_peer
API's definitions have been changed to include pdev_id as an
argument.

Modify the callers of these APIs to include pdev_id as argument.

Change-Id: I3d0de6a0bc1dfefbe1b3cad51ec23f703baaf3ad
CRs-Fixed: 2210728
2018-05-09 01:44:33 -07:00
Naveen Rawat
c3411bbdf8 qcacld-3.0: Fix null pointer dereference in SAP state fsm
Add a check against for NULL pointer before accessing roam_info
object pointer.

Change-Id: Id03a47761fa9624ddf76305f110f1f83bcb0a7cd
CRs-Fixed: 2232419
2018-05-03 18:33:03 -07:00
hqu
8f11faa1c0 qcacld-3.0: Use secondary_ch to calculate ACS result params
In shielding room, bring up one 2.4G SAP with HT40+ on channel 6,
but hostapd_cli command will report HT40-. Root cause is it uses
sec_ch_offset when calculate ACS result params, it's wrong.

Fix is to use secondary_ch when calculate ACS result params.

Change-Id: I41a5d0e4be0d2e3046d0004c25f11f2905a3b911
CRs-Fixed: 2221588
2018-05-02 05:40:13 -07:00
Jeff Johnson
f8b4d424cf qcacld-3.0: sap: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I05b2f8ed3e48de4347475d279d4de409d4eece42
CRs-Fixed: 2229655
2018-04-24 14:48:48 -07:00
Wen Gong
01a2c63468 qcacld-3.0: Add DFS master feature flag
Add config flag to enable / disable DFS master feature

Change-Id: Ibb0bc715c70b471b5e73626cf75ce9785a8eb567
CRs-Fixed: 2222562
2018-04-23 00:30:46 -07:00
Bala Venkatesh
82914ad371 qcacld-3.0: Remove DFS channels from scan list in case of MCC disallow
ACS in 5G channels for STA connected in 5G non DFS channel can result
SAP starting on DFS channel. Making MCC on DFS channel. This is
leading to FW panic if STA tries to roam during SAP is
detecting radar.

Avoid SAP starting on DFS channel if STA connected on 5G non DFS

Remove DFS channels from scan list before acs, if MCC is disllowed.
So, that DFS channel is not selectecd after acs.

Change-Id: I717309b81934852bfd93146b233db6f7fb03f252
CRs-Fixed: 2215332
2018-04-16 16:56:40 -07:00
Jeff Johnson
78772177b6 qcacld-3.0: Remove obsolete WLANTL_DEBUG code
Macro WLANTL_DEBUG is currently used to define some SAP debug
counters, but these counters are unused, so remove this obsolete code.

Change-Id: Ie7d976efcb5fb335b3f60a5af48a70dd214b3bd0
CRs-Fixed: 2220915
2018-04-11 03:37:24 -07:00
Ravi Joshi
9788fcd47d qcacld-3.0: Enhance logging levels for some SAP ACS messages
Enhance logging levels for some auto channel selection messages useful for
debugging.

CRs-Fixed: 2189466
Change-Id: I05c0f8a7c96c8e33f997b00c3d9a9d1714f283e0
2018-04-06 14:47:00 -07:00
Naveen Rawat
b4ea70f96e qcacld-3.0: Fail channel sap channel change request for channel 0
In function wlansap_channel_change_request validate channel requested
before processing the request.

Change-Id: I1cc8c978b15fe6ee043ce6bf712a109994dce50b
CRs-Fixed: 2212078
2018-04-02 19:39:34 -07:00
Ashish Kumar Dhanotiya
d39c8b55db qcacld-3.0: Update correct reason code on receiving del sta
On receiving del station command, SAP is not updating the del
station reason code properly in station info.
Update the correct reason code in station info whenever a
del station or deauth station event comes.

Change-Id: I2004dc21f18682dbc7dee488e7b55bfccd0d242a
CRs-Fixed: 2178538
2018-03-29 17:32:02 -07:00
Himanshu Agarwal
4f503b8676 qcacld-3.0: Compute RSSI and BSS adjustment correctly
When hw_mode=any (both 2.4Ghz nad 5Ghz bands included),
RSSI and BSS adjustment for 2.4Ghz channels happens 2
times, once in sap_interference_rssi_count() and once
in sap_interference_rssi_count_5G() which leads to wrong
computation of weight.

Check whether a channel is 2.4Ghz or 5Ghz channel before
calling the corresponding RSSI, BSS adjustment function.

Change-Id: I6c318e489cfa177c6de088e7cdfb4779ceb99b2f
CRs-Fixed: 2208069
2018-03-28 06:26:08 -07:00
Tushnim Bhattacharyya
3b99f4b181 qcacld-3.0: Deprecate enum sir_conn_update_reason
Deprecate enum sir_conn_update_reason & use enum
policy_mgr_conn_update_reason from policy manager component.

Change-Id: Id592d5405235f29a962a2a7d8b679fa4363f556d
CRs-Fixed: 2213000
2018-03-27 07:29:09 -07:00
bings
fe10dd1441 qcacld-3.0: Do not switch channel when target channel is 0
When all the configured channel are in NOL list, the target channel
will be set as 0 and sap will be stopped.
Currently a workqueue is created to stop sap, so channel switch may
still happens if it is called before this workqueue is executed.

Switch channel should be not happened when target channel is 0.

Change-Id: I368830bddcd9363826f6f2c8898b86ece8dd7d89
CRs-Fixed: 2203899
2018-03-26 23:07:55 -07:00
Jeff Johnson
66ee8a92fe qcacld-3.0: Replace typedef tCsrRoamProfile
The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The tCsrRoamProfile typedef does
not meet any of those criteria, so replace references to it with a
reference to the underlying struct.

Change-Id: Ie78bc34c5c39a56058d0daa0240047ec67392ab3
CRs-Fixed: 2207843
2018-03-19 19:57:58 -07:00
bings
3fe5bc31bf qcacld-3.0: Configure phyerr filter offload before sap starts
Do not send phyerr filter offload to FW when dfs module is doing
initialization, because in target_if_dfs_set_phyerr_filter_offload
routine GET_WMI_HDL_FROM_PDEV returns NULL at this time.

Configure phyerr filter offload before sap starts.

Change-Id: I60436fc1e142937383a3714c727166bc5fa8d0db
CRs-Fixed: 2205229
2018-03-15 06:08:32 -07:00
Vignesh Viswanathan
200f5c19b0 qcacld-3.0: Skip starting SAP after channel change if stop BSS in progress
When stop_bss from HDD is received when a SAP channel change request
is currently in progress and channel change response is not yet
received from the FW, the stop_bss would clear the SAP session and
when channel change response is received, we try to start BSS again.
The CSR roam state is also set to JOINING in this case.

As part of start BSS, we queue set key command to SME active command
list. Since the session has been cleared, eWNI_SME_SETCONTEXT_RSP
sent to lim would not be processed in CSR state JOINING leading to set
key command stuck in the active command list.

Do not restart BSS after channel change response if stop BSS is in
progress. Also handle eWNI_SME_SETCONTEXT_RSP and clear the command
queue in CSR Joining state.

Change-Id: I8dbab054746d26cc92fc2274d35ce76a694035fe
CRs-Fixed: 2193505
2018-02-27 14:07:02 -08:00
Himanshu Agarwal
91c5c0f7d7 qcacld-3.0: Avoid 2.4Ghz channel in 40Mhz for SAP start
When the channel list provided from hostapd contains both
2.4Ghz and 5Ghz channels and channel width is 40Mhz, scan
happens on all the 2.4Ghz  and 5Ghz channels and ACS algo
runs on all the channels to find the best channel for
starting SAP in 40Mhz. If a 2.4Ghz is selected, an OBSS
scan happens on all the 2.4Ghz channels to check if there
is any legacy BSS present on any overlapping channel. If
any BSS is found, channel width fallbacks to 20Mhz and
SAP gets started in 20Mhz bw instead of 40Mhz. This is
generally the case with 2.4Ghz whereas there is no such
issue in 5Ghz channels.

Avoid 2.4Ghz channels for starting SAP in 40Mhz bw by
assigning max weight to all the 2.4Ghz channels if 5Ghz
channels are also present in the channel list provided
from hostapd.

Change-Id: I079d20b912282c9db5c9b51b1ed4b85a4aa9c5df
CRs-Fixed: 2186658
2018-02-26 02:54:49 -08:00
Abhishek Singh
f723e3d31a qcacld-3.0: Cleanup the legacy scan code
Cleanup the unused legacy scan code.

Change-Id: Ia45cf0310c506d3cf6b897b31f9d28b4fac3197c
CRs-Fixed: 2193917
2018-02-22 09:57:12 +05:30
Yeshwanth Sriram Guntuka
273889e7cc qcacld-3.0: Update bss count based on channel offset only for same band
In sap_update_rssi_bsscount, bss count for channels is
incremented based on offset only and does not consider
if channel on which scan result is received and the
offset channel belong to same band. This could result
in incorrect increment of bss count for some channels
when channels from both bands are present.

Fix is to increment bss count based on channel offset
only if both channels belong to same band and also
choose channel with lower bss count among the channels
having least weight.

Change-Id: Icee978fc40047782c79fe36cba29e3feed3c90aa
CRs-Fixed: 2191324
2018-02-21 15:24:23 -08:00
Himanshu Agarwal
75e74413db qcacld-3.0: Avoid selection of irrelevant channel in 80/160MHz config
When channel list contains all channels from channel 1 to channel
165 and ch width is 80MHz, the channel to be selected as part of
ACS algorithm should be a 5GHz channel as 2.4GHz channels does not
support 80MHz but 2.4GHz channel gets selected with channel
width as 40MHz. Similarly when ch width is 160Mhz, the 160Mhz bonding
can be made only by 36-64 and 100-128 channels but 2.4Ghz channel or
some other 5Ghz channel gets selected as a result of ACS algorithm.

Assign max weight to all the 2.4GHz channels in 80Mhz and to all 2.4 Ghz
channels and 5Ghz channels not in the range 36-64 and 100-128 in 160 Mhz
so that only a valid channel is selected after the ACS algorithm is
completed.

Change-Id: I00c40e5d000a1cf8b79397fd4e361838a60b363d
CRs-Fixed: 2182011
2018-02-08 07:55:35 -08:00
bings
1826d9cbd5 qcacld-3.0: Move dfs leakage from cld to cmn
Move dfs leakage from cld to dfs module of cmn.

Change-Id: I17276fedf575f1a4029265be58d8fd088c1d956d
CRs-Fixed: 2174457
2018-02-04 21:43:22 -08:00
bings
02297abea9 qcacld-3.0: Use new APIs to get and set DFS Non-Occupancy-List(NOL)
Current driver is using pld_wlan_set_dfs_nol() and pld_wlan_get_dfs_nol()
directly through eSAP_DFS_NOL_SET and eSAP_DFS_NOL_GET case statements
respectively within HDD module. These methods are obsoleted as per
new driver design.

Use DFS component's utils_dfs_init_nol() and utils_dfs_save_nol() APIs
instead to get and set DFS NOL respectively.

Change-Id: I63e8adac3f99c2052c26e6b01d19071f098e0a4f
CRs-Fixed: 2172024
2018-02-02 00:27:24 -08:00
Liangwei Dong
fc26cdae30 qcacld-3.0: Fix NULL acs_cfg ptr access
acs_cfg is not initialized when sap starts
failed. And acs_cfg is accessed during
Random channel selection when sap interface
gets Radar event.

Fix by checking sap ctx state and acs_cfg
During dfs radar event.

Change-Id: I7e04e1a9e357ccd0b39b4edcc4c8a34b54e388ce
CRs-Fixed: 2174532
2018-01-31 01:28:36 -08:00
Paul Zhang
0f85b41310 qcacld-3.0: Setting the right country IE for SAP
Currently, when sap starts, it will get the default
country code for the country IE if 80211d enabled.
Using api wlan_reg_read_current_country() instead of
wlan_reg_read_default_country() to get the current
country.

Change-Id: I67e63630c56b17d0d6890704bc1852e40185cf48
CRs-Fixed: 2170425
2018-01-30 23:55:11 -08:00
bings
d79e606efb qcacld-3.0: Do not get nol since channel status of nol is disabled
Currently there is no need to get nol when removing nol from candidate
channel list, because status of nol is set to CHANNEL_STATE_DISABLE in
regulatory.

Remove channels whose status are CHANNEL_STATE_DISABLE when trying to
remove nol from candidate channel list.

Change-Id: I90722116814e837fca456de1b2ef88d8519e9aff
CRs-Fixed: 2180752
2018-01-30 23:55:08 -08:00
wadesong
a8637bb1b6 qcacld-3.0: Add more check points for SAP callback
When auth failure occures, hostapd will issue BSS stop
command, resulting in BSS peer deleted. After that, auth
frame may still get received, and SAP callback may still
access BSS peer object for remote peer creation, which
results in an assertion.

Add more check points to make sure SAP callback is
handling the peer object addition correctly based on
different status of SAP state machine.

Change-Id: Icdb7ae2db018f16cb60878bda8bab1e791667cba
CRs-Fixed: 2179494
2018-01-30 21:28:53 -08:00
bings
1f98e9fa79 qcacld-3.0: Process radar event after getting vdev start response
Do not process radar event until receiving vdev start response, because
during channel switch, radar may be detected again in the old channel.

Change-Id: I1a524e38c25f91c684fd2c4962aeaf556d2445eb
CRs-Fixed: 2175891
2018-01-29 02:17:37 -08:00
bings
10f2645d36 qcacld-3.0: Use iwpriv setRadarDbg to configure dfs log level
Use iwpriv command "setRadarDbg" to configure dfs log level because
MCL does not have tools to trigger dfs_control.

Change-Id: I2d7b30b026dfedbf03002463652fead83220fa2a
CRs-Fixed: 2178636
2018-01-26 21:26:47 -08:00
Tushnim Bhattacharyya
691680ed4c qcacld-3.0: Trim the ACS scan channel list as per acs config
Trim the scan channel list for ACS based on the channel list provided
from user space as part of acs config.

Change-Id: Iaafa6f78098c59782478351e206ae360d50b89bc
CRs-Fixed: 2177457
2018-01-26 20:02:46 -08:00
Srinivas Girigowda
80213e5216 qcacld-3.0: Move the logs to appropriate log levels
Move the logs to appropriate log levels.

Change-Id: I67ff9972113f95c51214f8d032c2c20d2ba6d195
CRs-Fixed: 2177347
2018-01-26 00:34:22 -08:00
bings
73e793e2a6 qcacld-3.0: Switch channel when radar is found in dfs channel
When radar is found, the current channel is put in NOL list and the state
is set as CHANNEL_STATE_DISABLE.

Currently if channel state is not CHANNEL_STATE_DFS, it will not do channel
change. This is not correct.

Do channel change when radar is found in dfs channel

Change-Id: Iabc8ef5ee92e9d2dc83a95d8fce36a2271ca056c
CRs-Fixed: 2155835
2018-01-26 00:34:16 -08:00
bings
38b3d4f66c qcacld-3.0: Stop sap if there is no available channel
When radar is found, the current channel is put in NOL list and the state
is set as CHANNEL_STATE_DISABLE.

So change the channel state check from wlan_reg_is_dfs_ch to
wlan_reg_is_passive_or_disable_ch

Change-Id: If0595682100746cb12ddb8a1c3ca0106ccd1af21
CRs-Fixed: 2178842
2018-01-25 23:39:19 -08:00
bings
819bdead9e qcacld-3.0: Do not switch channel in DFS testing mode
If gDisableDFSChSwitch is configured as 1, channel should not be
switched even radar is found.

Set usenol as 0 when gDisableDFSChSwitch is configured as 1.

Change-Id: I05c4afea3eb9af9c541b2324a2d50ea59c05f7d7
CRs-Fixed: 2178652
2018-01-25 21:40:52 -08:00
bings
1f55b66040 qcacld-3.0: update sap_ctx->ch_params after channel is selected
Old ch_width is set as invalid after radar detection, and can't be
used anymore. Update sap_ctx->ch_params after channel is selected.

Change-Id: I9e068785312d7072eeaeaa4b1aae4bd82d62d36f
CRs-Fixed: 2178586
2018-01-25 21:40:49 -08:00
Min Liu
2fef579fc1 qcacld-3.0: Fix safe channel switch failure
For the AP+AP SCC LTE-Coex case, when channel avoidance event
is reported, the channel switch request for SAP will be blocked
by policy manager if the target channel is different with the
operating channel of the existing SAP due to the SCC policy.

Need to update the logic to give higher priority to the channel
avoidance request.

Another change is to move the dfs_radar_found ref counter from
hdd_ctx to hdd_adapter so that the channel switch request of
the 2nd SAP will not be blocked when the 1st one is still in
progress since it might take some time to get VDEV restart
response from FW.

Change-Id: I8594b35b70276f7ed3884697caf69a99ee91b952
CRs-Fixed: 2171958
2018-01-25 11:27:33 -08:00
Abhinav Kumar
5670d365dc qcacld-3.0: Fix to reduce QXDM Log Size
Currently in SAP cases, logging is huge and hence failure
logs are getting overwritten very fast within 2mins itself.
Fix it to delete the some irrelevant log prints.

Change-Id: I90a77ba9348b84eb7e5c3518391f7c98a04bb39f
CRs-Fixed: 2169101
2018-01-25 01:41:36 -08:00
Sourav Mohapatra
ab088faa4a qcacld-3.0: Fix potential buffer overflow
In the function sap_clear_session_param, sapctx->sessionId can have
value more than max value allowed for the array
mac_ctx->sap.sapCtxList.

Add sanity check for the variable sapctx->sessionId

Change-Id: I846a8a1435de63d0a2e34f23bc407e0a8fa53eb2
CRs-Fixed: 2162255
2018-01-24 23:46:52 -08:00
bings
19bf84d3c8 qcacld-3.0: Configure IEEE80211_CHAN_DFS for DFS channel
Configure IEEE80211_CHAN_DFS for DFS channel, otherwise channel changes
does not happen.

Change-Id: I0cfbff43d0fff79ae17f1e96b764d4c213ae2ea1
CRs-Fixed: 2155839
2018-01-24 08:27:12 -08:00
Jiachao Wu
c279f9741b qcacld-3.0: Fix a memory leak in SAP when SSR
Fix a memory leak in SAP when SSR.

Change-Id: I1ceaa9e31f64c7fe4c70eab5d0daf2fc60063ef2
CRs-Fixed: 2176124
2018-01-23 12:30:11 -08:00
Himanshu Agarwal
fee2e36308 qcacld-3.0: Set ACS weight to max for channels not in scan list
When gApAutoChannelSelection is set to 1 in ini, HOST driver ACS
runs in wlan_hdd_cfg80211_start_bss() with all the channel width,
hw mode and start and end channel parameters overridden with the
values from ini. After scan on all the channels, a weight is
assigned to all the channels based on rssi and no. of BSS present
on that channel. Weights of all the channels not present in the
scan list remains 0 as no scan happened on those channels and so
BSS count is 0 and RSSI is max. As the channel with lowest weight
is selected, channel which is not even present in scan list is getting
selected.

Assign SAP_ACS_WEIGHT_MAX to all the channels not in the scan list so
only one of the channel present in scan list gets selected after ACS
algorithm is completed.

Change-Id: Ic567c412ec7f68e2bb5d12e8e982650e56fd0488
CRs-Fixed: 2164979
2018-01-22 05:39:40 -08:00