Commit Graph

158 Commits

Author SHA1 Message Date
gaurank kathpalia
59d68afe2e qcacmn: Remove dual beacon MCC check from SCC check case
In the API policy_mgr_dual_beacon_on_single_mac_scc_capable
the check of wmi_service_dual_beacon_on_single_mac_mcc_support
is there too, which in any case is void, as if the driver supports
SCC, then it will return true from the first check itself,
and if it doesn't support SCC, it will surely not support MCC
too, so the check of MCC after SCC is void anyways

Fix is to remove the check of MCC dual beaconing capability from
policy_mgr_dual_beacon_on_single_mac_scc_capable

Change-Id: Ia427be4fcee0e0267171d81cf7e8e669560d20a9
CRs-Fixed: 2299182
2018-08-20 05:29:54 -07:00
Nirav Shah
18de9c1b54 qcacmn: umac: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: I34ba6f6485f9b506264daf4e116052d2858bed40
CRs-Fixed: 2278876
2018-08-14 21:44:21 -07:00
Liangwei Dong
1a18faf9e8 qcacmn: Limit concurrency of STA(WAPI)
When STA role is coexisting with other sessions(P2P, SAP or IBSS),
WAPI encryption mode is not allowed.
Add a new API to check if the connection/start request should
be rejected when:
1) A STA with WAPI encryption is to be connected while there
   is at least one concurrent session already running.
2) A new session is to be started while there is already a STA
   connection with WAPI encryption enabled.

Change-Id: Idf0d346138eeda339254535f1f7131fda4a5086a
CRs-Fixed: 2290549
2018-08-09 06:38:46 -07:00
Tushnim Bhattacharyya
c304f8924d qcacmn: Do HW mode change based on all the candidate APs for STA
The driver currently changes the hw_mode based upon
the first candidate found in the scan list, and tries
to connect to it. It may happen that the connection
fails, and the STA then tries to connect to the AP
on same channel as the concurrent adapter.
It would result in hw_mode = DBS, as it is not
updated after  connection success/failure.
Also if the first AP channel is in same band as that
of concurrent adapter, and the connection fails,
and the STA tries to connect to an AP in a different
band, this too is not allowed as hw_mode is not DBS

Fix is to change the hw_mode based upon the scan list.
If the driver finds any scan result which may lead to
DBS connection, the hw_mode should be set to DBS.
Once the connection is done or failed, the driver
can check and update the hw_mode again.

Change-Id: I3c186f47dd5528f0af2598bb02c1b7e297d01548
CRs-Fixed: 2290760
2018-08-07 18:10:38 -07:00
Tushnim Bhattacharyya
2b083b6daa qcacmn: Add ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN
Add ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN option for the ini
gDualMacFeatureDisable. This is to enable DBS support for the
connection and disable simultaneous scan from upper layer. But DBS
scan remains enabled in FW.

Change-Id: Ic280de2cc63a3775c0d9dd61985ff89df58a4a89
CRs-Fixed: 2291935
2018-08-07 00:29:50 -07:00
Jeff Johnson
95bec5aa19 qcacmn: Remove struct extended_caps
struct extended_caps is unused, so remove it.

Change-Id: I96fd072b7d6b58a9c237165fcba7ed8c8da0eae3
CRs-Fixed: 2289156
2018-08-02 15:00:30 -07:00
Tushnim Bhattacharyya
0351f170cd qcacmn: Do not invoke get_pcl multiple times during set_pcl to FW
Do not invoke get_pcl when calculating weightage of channels sent to FW
as part of set_pcl WMI command.

Change-Id: I62b39aaf0943cf10deab380d8030d1ef08fbbcb3
CRs-Fixed: 2287649
2018-08-01 12:32:03 -07:00
Liangwei Dong
a590ecd80e qcacmn: Add Band selection for NSS Update API
Add parameter to NSS Update API to specify
which Band to downgrade/upgrade.

Change-Id: I57ae4304fbf8de366531154f03d04792c18e176d
CRs-Fixed: 2256803
2018-07-24 04:46:26 -07:00
Tushnim Bhattacharyya
c0817c6e73 qcacmn: Reduce DBS opportunistic timer value to 5 sec
Drop the timeout to 5 sec on hastings as it is a 2x2 DBS solution,
as IOT issues due to frequent 2x2 to 1x1 or 1x1 to 2x2 transition
can be avoided.

Change-Id: I67f9c97a7190baeadba79d709a8773b154932e76
CRs-Fixed: 2281954
2018-07-20 14:58:49 -07:00
gaurank kathpalia
bdffeb8d95 qcacmn: Fix channel selection in case of DFS in ACS algo
The driver includes the DFS channel in case of force SCC,
on 5GHz band, and rejects all 2.4Ghz band channels in the
ACS scan list in case of band_width > 40. The DFS SCC not
allowed till date prevents the SAP vdev up on that DFS channel,
hence the SAP turns on with default channel of 2.4 Ghz i.e
channel 1, because the ACS scan channel list didn't contain
any 2.4Ghz channel.

Fix is to include the 2.4Ghz channel list, and remove that DFS
channel in case the force SCC is enabled, and STA is already up
on that channel.

Change-Id: I1dc14d3890d8128e83910c2bed1cb95d7f70ea1c
CRs-Fixed: 2261802
2018-07-18 01:52:02 -07:00
Nirav Shah
226214bc25 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Liangwei Dong
9ace8a9dd9 qcacmn: Set hw mode Id to FW
Firmware needs HW MODE ID not list index.
Use HW mode ID to set HW MODE WMI command.

Change-Id: I12f9d83daee1c99706c345d85f03781257b492bf
CRs-Fixed: 2256175
2018-07-13 08:27:23 -07:00
bings
1d78ede2cd qcacmn: Skip DFS channels for SAP/GO when station exists
Currently DFS channels are skipped for SAP/GO in cds_get_channel_list
when ini g_sta_sap_scc_on_dfs_chan is configured as 0.

Refine the logic of DFS channels skipping when station exists. Do not
select DFS channels for SAP/GO when below cases are both satisfied.
1. Station exists.
2. Ini g_sta_sap_scc_on_dfs_chan is set as 0.

Change-Id: I2f082388a662d54968b3c2e95e5713eeffa1b131
CRs-Fixed: 2275724
2018-07-11 23:36:32 -07:00
Abhinav Kumar
77cb42a952 qcacmn: Fix high latency during BTM roaming
While processing the WMA_ROAM_OFFLOAD_SYNCH_IND event, The
driver takes nearly 150 to 200 msec time to just write fatal,
error and info messages to the kmsg log buffer. Also to get
tx power supplicant runs another thread while roaming. These
cause more latency(300ms) to send WMA_ROAM_OFFLOAD_SYNCH_CNF
message to fw. To decrease roam latency, the driver should
write the only necessary error message to kmsg buffer.

Fix is to change irrelevant fatal, error and info message type
to debug.

Change-Id: I521104c692eb42112ce2528c15d09785ff3470b6
CRs-Fixed: 2261592
2018-07-09 12:58:34 -07:00
Pragaspathi Thilagaraj
eabb08f066 qcacmn: Fix OOB read in iw_hdd_set_var_ints_getnone
From the IOCTL command WE_POLICY_MANAGER_PCL_CMD, we get the cds
concurrency mode as argument and pass it to cds_get_pcl to get
the pcl channel list. This concurrency mode parameter is used as
the array index to retrieve the enum cds_pcl_type. If this value
is greater than CDS_MAX_NUM_OF_MODE an OOB read will occur in
iw_hdd_set_var_ints_getnone.

Add check to validate the input cds mode argument against the macro
CDS_MAX_NUM_OF_MODE. Return error if it is violated.

Change-Id: I51073061be363d9680abf0566b77be7c7573d0fe
CRs-Fixed: 2233991
2018-07-09 07:03:07 -07:00
Liangwei Dong
e57b6b7417 qcacmn: Extract Hw mode Id and band info
Extract/Save the Hw mode ID and Mac0 band info
to hw mode list.
This helps to identify the 2x2 5G + 1x1 2G and
2x2 2G + 1x1 5G.

Change-Id: I0682337b1a80c1b502c3307e0847aaa99479d2d3
CRs-Fixed: 2256152
2018-07-09 07:03:04 -07:00
gaurank kathpalia
afa4e1b224 qcacmn: Fix hw mode change issue in case of DBS
The driver stops the oppurtunitistic timer for DBS, when
the start AP requests come, which results in HW mode stuck
in DBS if the next vdev start request comes on the same MAC
This further results in NSS = 1 for the MAC, hence throughput
decreases.

Fix is to set hw mode to single MAC in case the STA/SAP comes up
in the band/channel

Change-Id: I8ec4282c78594ee7e133a1e7768fa230bb2e8180
CRs-Fixed: 2273443
2018-07-06 03:19:19 -07:00
Kiran Kumar Lokere
aa40f60b9c qcacmn: Add support for SRD channels in ETSI domain
Add support for Short Range Devices 25 mW max power
channels in ETSI regulatory domain.

Add Short Range Devices 25 mW max power channels only
if DSRC feature is disabled.
Provide service apis to check SRD and DSRC channels.

Change-Id: Ib2a1d7cf191d07319cb29038ad60130f5cbe7f16
CRs-Fixed: 2264790
2018-07-05 20:49:34 -07:00
Jianmin Zhu
7f6bdd3b9d qcacmn: Move SAP to safe channel after STA disconnection
Standalone SAP is not allowed on lte-coex channel if STA+SAP SCC
enabled on lte-coex channel. So move the SAP to a safe channel
once STA disconnected.

Change-Id: I00682f5bbb3da772e3e26ccd8d08183be28cc9ec
CRs-Fixed: 2265263
2018-07-04 10:22:19 -07:00
Bala Venkatesh
3b3f16f39f qcacmn: Move the SAP to non DFS channel after STA disconnection
Standalone SAP is not allowed on DFS channel if STA+SAP SCC enabled
on DFS channel. So move the SAP to a non DFS channel as soon as STA
gets disconnect.

CRs-Fixed: 2269249
Change-Id: I27d018739f53997641a7113cfc7c844e02bd7e29
2018-07-02 10:59:57 -07:00
Bala Venkatesh
68bdbfa062 qcacmn: Add support to allow user select preferred band for SAP
Add enum QDF_MCC_TO_SCC_WITH_PREFERRED_BAND(6) for this.
If ini gWlanMccToSccSwitchMode is selected to
QDF_MCC_TO_SCC_WITH_PREFERRED_BAND(6) then following will be the
behaviour of STA+SAP concurrency.
1. If second interface(SAP/STA) comes in same band as
   first interface(STA/SAP) respectively then force SCC
   irrespective of channel.
2. If second interface(SAP/STA) comes in other band as
   first interface(STA/SAP) then dont force SCC allow
   interband MCC or DBS based on DBS capability.
Allow interband MCC but not intraband MCC.

Change-Id: I91d41b4b0306ed4e362b5bcab9538f5fd5feea7d
CRs-Fixed: 2260677
2018-07-02 08:45:47 -07:00
Tushnim Bhattacharyya
9b1636dcd4 qcacmn: Don't move SAP if SCC on lte coex channel is allowed
If STA+SAP is doing SCC & g_sta_sap_scc_on_lte_coex_chan is set,
don't move SAP to a different channel when LTE channel avoidance
event comes.

Change-Id: I3dfdbb6d59769a8ff9b3b2e6d828feee94630569
CRs-Fixed: 2268993
2018-06-29 17:27:46 -07:00
Yeshwanth Sriram Guntuka
2854295433 qcacmn: Send mode change event after addkey
On STA connection, mode change event is sent to
userspace after association is completed. This causes
delay in processing of M1 frame at supplicant due to
latency associated with nl80211_get_wiphy_index
function as part of processing mode change vendor event.

Fix is to send mode change event for STA after key
is added.

Change-Id: Id403bfdd26ed3a47449ba3f2967f4b4322ad5da6
CRs-Fixed: 2260483
2018-06-29 03:29:52 -07:00
Bala Venkatesh
378064b5e0 qcacmn: Defer the channel switch if it is already in progress
When sta+sap scc enabled on dfs channel then SAP cannot operate on
DFS channel in standalone mode. If STA+SAP are operating in SCC mode
on a DFS channel and STA gets disconnected from reference AP then driver
schedules a workqueue to move the SAP from DFS channel to user configured
channel. At this time if STA again connects to reference AP within few ms
then driver again schedules one more workqueue to move the SAP to STA's
channel. Sometimes the second workqueue may fail to switch the channel
if first one is not yet completed. So added event variable to schedule
second workqueue only when first one is complete.

CRs-Fixed: 2267005
Change-Id: Ia6ce4b6264c35f6d2c809e2a3f65f535e930874e
2018-06-26 18:53:35 -07:00
Bala Venkatesh
85b42f4930 qcacmn: Ignore CSA if the channel is DFS or disabled
If MCC to SCC switch is enabled, SAP is active and CSA
received for STA interface, then ignore the CSA if channel
is DFS/disabled.

CRs-Fixed: 2263037
Change-Id: I98b8d957766358ea86cc9f50339725cf4bf0038b
2018-06-26 17:36:11 -07:00
Krunal Soni
637eba547a qcacmn: Check HW mode before sending join request to lower layers
When STA's join req times out on current BSS, SME issues next BSS
internally without checking HW mode for new channel

For example, STA tries to connect SSID="abc",
BSSID="a1:a2:a3:a4:a5:a6", channel=36 and lets say it fails. It
should try few more times to same BSSID and after that it will try
next bss. Lets say next BSS it found has, SSID="abc",
BSSID="b1:b2:b3:b4:b5:b6", channel=1 then it needs to check whether
hardware mode change is required for channel=1. If driver fails in
checking hardware mode then following check will prevent the bad
situation.

CRs-Fixed: 2261129
Change-Id: Ie31ac5b8b90c6e63122148647ad333fccfbf9dbf
2018-06-22 06:01:58 -07:00
Bala Venkatesh
7c96e54a19 qcacmn: Allow SAP to move from one DFS chan to another DFS chan
Allow the SAP to move from DFS channel to another DFS channel in
STA+SAP SCC concurrency scenario.

CRs-Fixed: 2263031
Change-Id: I3d1f5e57415ed39a30125d4565bb768926dff4c9
2018-06-21 17:40:40 -07:00
Dundi Raviteja
a02444a206 qcacmn: Incorrect usage of QDF_ARRAY_SIZE macro
In some use cases of QDF_ARRAY_SIZE macro, the argument passing
to it is a pointer instead of array which leads to getting
incorrect array size.

Current implementation of updating main arrays pcl_list_org and
weight_list_org is inefficient. So, update the main arrays directly,
instead of copying the data to local arrays and again updating the
main arrays.

Change-Id: I9a4a7fa813412fd000ce55d2a958e49ab1b02ed5
CRs-Fixed: 2262231
2018-06-20 00:42:57 -07:00
Bala Venkatesh
28477d3975 qcacmn: Populate PCL list correctly using channel select logic ini
Currently, PCL list is populated without checking channel select logic
ini. Check for channel select logic ini before selecting the second
connection pcl table.

Change-Id: I5a64d4ff43a7dcc2c70eac75b51d5f87de2903bb
CRs-FIxed: 2237403
2018-06-19 22:42:35 -07:00
Bala Venkatesh
06a4e7c57e qcacmn: Skip CAC and ignore radar indication for SAP
If STA is already connected on DFS channel and SAP is going to start
on the same channel then skip the CAC for SAP.
If STA and SAP sessions are already operating on same DFS channel,
then ignore radar indication received on SAP interface.

CRs-Fixed: 2262494
Change-Id: Ife0ab6979a07c8773001a43f5a30c9a555dab37a
2018-06-19 22:42:33 -07:00
Zhu Jianmin
5ac66ef3f7 qcacmn: ini parameter to allow STA+SAP SCC on LTE coex channel
When Force SCC and STA+SAP SCC on LTE coex channel are enabled:
   1. When STA on LTE coex channel, start SAP, select STA
      channel.
   2. When SAP on, connect STA on LTE coex channel, then switch
      SAP channel to STA channel.

Change-Id: I7864e0ab2655c3bee95154ea4dedfb60fe8689e4
CRs-Fixed: 2261226
2018-06-19 21:17:14 -07:00
Tushnim Bhattacharyya
b7f839694a qcacmn: Restrict the force SCC logic for STA+SAP only
Restrict the force SCC logic for STA+SAP only unless ini is set for
QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION.

Change-Id: If2c4c285b92ea5eba69679561c32875cff5f7b08
CRs-Fixed: 2261717
2018-06-18 16:34:01 -07:00
Manjunathappa Prakash
cdf1813b35 qcacmn: Add DP callbacks for flow_pool create and delete
Current lithim_dp flow pool created in wma_vdev_start, wma_vdev_start
is called for same vdev multiple times for vdev. This leads to creation
of multiple flow pools for each vdev. Instead create from policy_manager
when session become active.

Register flow pool create/delete callbacks with policy manager.
So that lithium_dp vdev flow pools are created/deleted when vdev
become active/not-active.

Change-Id: Iaf6aaece47c79c7e6f7745feaee35a6bc5cd1297
CRs-Fixed: 2231601
2018-06-06 05:49:26 -07:00
Zhu Jianmin
7f8d1df7e9 qcacmn: Check chip capability when enable AP+AP
Check capability of dbs, mcc and scc on single band when enable
AP+AP, then same driver code can support different chip and
firmware.
Add wmi_service_dual_beacon_on_single_mac_(mcc/scc)_support

Change-Id: I505747122504b2a89813e7bdfcd27dc07539f39e
CRs-Fixed: 2214237
2018-06-02 10:26:19 -07:00
Krunal Soni
3688381753 qcacmn: Pass the arg by reference while calling sme_pdev_set_pcl()
While calling sme_pdev_set_pcl() API, driver is passing the argument
by value. The size of the argument is 280 bytes which is not good
design.

Pass the argument by reference instead of passing it by value to make
design simple.

CRs-Fixed: 2238293
Change-Id: I92849fb125fe864c1c7c7977bce392a7bcfe4121
2018-05-30 13:57:23 -07:00
Jeff Johnson
ee56b4491c qcacmn: Replace new instances of tQDF_ADAPTER_MODE
Previously change "qcacmn: Use enum QDF_OPMODE", Change-Id
Ic6f663dac11a100f168b2626c7c0fbcaccbfca4f, replaced all instances of
tQDF_ADAPTER_MODE to QDF_OPMODE in the qca-wifi-host-cmn
project. However since tQDF_ADAPTER_MODE was originally defined in a
common project, and not all references to it could be immediately
removed, a legacy definition was left with the expectation that it
would be removed when all references to it had been
updated. Unfortunately new instances of using tQDF_ADAPTER_MODE have
been subsequently added to the project, so replace them with
QDF_OPMODE.

Change-Id: I71cead84151cc0411f7cc5cc13a87a281e7502c0
CRs-Fixed: 2245249
2018-05-27 15:02:38 -07:00
Jeff Johnson
c65c98fb3e qcacmn: umac: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I34c7acfad802a3878ffa373489b7f6a4194abb62
CRs-Fixed: 2230684
2018-05-18 02:17:46 -07:00
Jeff Johnson
a4d1ee9066 qcacmn: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I7d88e57b97fa6d217630d4a5d5c365b56e714428
CRs-Fixed: 2238309
2018-05-17 00:47:23 -07:00
Jeff Johnson
114fe088c9 qcacmn: Fix typo "lenght"
Replace typo "lenght" with correct spelling "length".

Change-Id: Ieea0c547c61248e510835d16a9fa55ace486df23
CRs-Fixed: 2238309
2018-05-17 00:47:02 -07:00
Jeff Johnson
656fa9a38f qcacmn: Fix typo "capabilites"
Replace typo "capabilites" with correct spelling "capabilities"

Change-Id: I8efa1d974ecabb1466bdf27ec305fd9960da0616
CRs-Fixed: 2238309
2018-05-17 00:46:46 -07:00
Tushnim Bhattacharyya
f8417d1117 qcacmn: Use channel and vdev_id array for get_mode_specific_conn_info
Use channel and vdev_id array while calling
policy_mgr_get_mode_specific_conn_info.

Change-Id: I64579e2b1af0eca47af5292d456367d059a461f5
CRs-Fixed: 2238386
2018-05-15 00:36:24 -07:00
Srinivas Girigowda
b031fa6e0e qcacmn: Consistently use policy_mgr_dual_mac_config
Remove duplicate structs wmi_dual_mac_config and sir_dual_mac_config
and use policy_mgr_dual_mac_config.

Change-Id: I6da6539f519ec46ee274ba3f3ae042e5fd9c25d2
CRs-Fixed: 2191031
2018-05-12 04:31:30 -07:00
Himanshu Agarwal
70a52d9a29 qcacmn: Add API to stop DBS opportunistic timer
Add API to stop DBS opportunistic timer in policy mgr.

Change-Id: I11a2b2976c59d7cd09695f90c2d2bdd7338dde54
CRs-Fixed: 2236333
2018-05-11 23:57:08 -07:00
Krunal Soni
af29fe9735 qcacmn: Fix uninitialize variables in few policy manager APIs
Few variables are left uninitialized and they are being used
with some random value.

Fix by initializing to default value.

CRs-Fixed: 2232791
Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a
2018-05-07 06:37:09 -07:00
Tushnim Bhattacharyya
2923e70b09 qcacmn: Add range check for mode param in cds_get_pcl
Add range check for mode parameter in cds_get_pcl.

Change-Id: I049bebc5ec62f925e164517d59f94d122dbc5dc2
CRs-Fixed: 2234351
2018-05-04 20:43:14 -07:00
Manjunathappa Prakash
e51aba73e7 qcacmn: add API to get NAPI instance corresponding to NAPI ID
Add API to get NAPI instance from NAPI ID. Handle to NAPI is required
for Rx processing via GRO.

Change-Id: I15535827a03953231670d4138235c4876b16e045
CRs-Fixed: 2062180
2018-05-02 04:35:02 -07:00
jiad
c8754ac4bd qcacmn: fix ipa mcc scc event notification
Issue is under AP-AP MCC config, mcc event is not sent from wlan
to IPA driver. mcc mode is decided with the help of connection
table. But for AP mode, mcc mode is checked and updated before
connection table is updated by adding the SAP vdev entry.

Fix is to make ipa mcc mode check and notification when connection
table is updated.

Change-Id: I1ba3fcb874b014f05cebd8af90530b9aa54980a2
CRs-Fixed: 2214351
2018-04-06 13:25:29 -07:00
Yuanyuan Liu
0d506a4d64 qcacmn: Fix LLVM compiling issues
Remove typedef redefinition, use correct enum type, remove extra
parentheses and correct header guard.

CRs-Fixed: 2214003
Change-Id: I0a75c70cd530590a16f6bfa884955ebc26906de0
2018-04-02 16:41:52 -07:00
Tushnim Bhattacharyya
b4f3063313 qcacmn: Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE
Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE.

Change-Id: Ia7a6bb5e05c6dac650dc6386734462547365a4eb
CRs-Fixed: 2214003
2018-04-02 16:41:50 -07:00
wadesong
a7bff60cf0 qcacmn: Suppress the verbose log from policy mgr
When DBS is disabled in WLAN INI file(e.g. on some platforms
where RM chipset is attached), the policy manager will keep
posting a verbose message saying 'DBS is disabled from ini'.
This isn't exhibiting much useful information, and may cause
watchdog bark when SnS stress is running.

Suppress the verbose log by lowering it's debug level.

Change-Id: Ie8d5a1784940f483cc671da43f734851c0b5adb6
CRs-Fixed: 2214201
2018-03-28 14:44:34 -07:00