qcacld-3.0: Send HW mode change before switching channel in DBS mode

If DBS 2x2 mode is supported, to operate in 2.4Ghz the driver needs to
be in DBS mode before vdev start/restart is sent on 2.4Ghz channel.
In scenareo with gWlanMccToSccSwitchMode 4, when AP is in 5Ghz and
STA connect to any other channel in 5ghz, it force AP to switch to 2.4 Ghz
channel. Thus AP sends vdev restart without sending the HW mode change
to firmware.

Fix is to set HW mode before the AP start channel switch.

Change-Id: I2a1c176d5f3ed8cc2f62dc24c72959db1afbaae3
CRs-Fixed: 2414034
This commit is contained in:
Abhishek Singh 2019-03-07 12:39:17 +05:30 committed by nshrivas
parent 7206901a1b
commit a0f55ea6b1
3 changed files with 51 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -1762,6 +1762,18 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch(
struct wlan_objmgr_psoc *psoc, uint8_t session_id);
/**
* policy_mgr_set_hw_mode_before_channel_switch() - Set hw mode
* before channel switch, this is required if DBS mode is 2x2
* @psoc: PSOC object information
* @vdev_id: vdev id on which channel switch is required
* @chan: New channel to which channel switch is requested
*
* Return: QDF_STATUS
*/
QDF_STATUS policy_mgr_set_hw_mode_before_channel_switch(
struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t chan);
/**
* policy_mgr_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change
* @psoc: PSOC object information

View File

@ -1910,6 +1910,40 @@ done:
return status;
}
QDF_STATUS policy_mgr_set_hw_mode_before_channel_switch(
struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t chan)
{
QDF_STATUS status;
struct policy_mgr_conc_connection_info info;
uint8_t num_cxn_del = 0;
if (!policy_mgr_is_hw_dbs_capable(psoc)) {
policy_mgr_err("DBS is disabled");
return QDF_STATUS_E_NOSUPPORT;
}
/*
* Store the connection's parameter and temporarily delete it
* from the concurrency table. This way the allow concurrency
* check can be used as though a new connection is coming up,
* after check, restore the connection to concurrency table.
*/
policy_mgr_store_and_del_conn_info_by_vdev_id(psoc, vdev_id,
&info, &num_cxn_del);
status = policy_mgr_update_and_wait_for_connection_update(psoc,
vdev_id, chan,
POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH);
if (QDF_IS_STATUS_ERROR(status))
policy_mgr_err("Failed to update HW modeStatus %d", status);
/* Restore the connection entry */
if (num_cxn_del)
policy_mgr_restore_deleted_conn_info(psoc, &info, num_cxn_del);
return status;
}
void policy_mgr_checkn_update_hw_mode_single_mac_mode(
struct wlan_objmgr_psoc *psoc, uint8_t channel)
{

View File

@ -1376,6 +1376,10 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sapContext,
if (status != QDF_STATUS_SUCCESS)
return status;
policy_mgr_set_hw_mode_before_channel_switch(mac->psoc,
sapContext->sessionId,
targetChannel);
/*
* Copy the requested target channel
* to sap context.