qcacld-3.0: Simplify pre-cac flush prevention
Change I875c2f14ffd54272fc9ea0df1cecc6dd1171e310 introduced an elaborate workaround to prevent the pre-cac work from flushing itself during stop adapter. Introduce a less complicated work around by simply checking if the current adapter is the pre-cac adapter before flushing the pre-cac work. Change-Id: Ib3e0716f8d088d124e960dcd724f579fb39a3d74 CRs-Fixed: 2387173
This commit is contained in:
@@ -2132,14 +2132,6 @@ void hdd_deinit_adapter(struct hdd_context *hdd_ctx,
|
|||||||
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
||||||
struct hdd_adapter *adapter);
|
struct hdd_adapter *adapter);
|
||||||
|
|
||||||
enum hdd_adapter_stop_flag_t {
|
|
||||||
HDD_IN_CAC_WORK_TH_CONTEXT = 0x00000001,
|
|
||||||
};
|
|
||||||
|
|
||||||
QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
|
|
||||||
struct hdd_adapter *adapter,
|
|
||||||
enum hdd_adapter_stop_flag_t flag);
|
|
||||||
|
|
||||||
void hdd_set_station_ops(struct net_device *dev);
|
void hdd_set_station_ops(struct net_device *dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1025,32 +1025,6 @@ static int wlan_hdd_set_pre_cac_complete_status(struct hdd_adapter *ap_adapter,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* hdd_check_adapter() - check adapter existing or not
|
|
||||||
* @adapter: adapter
|
|
||||||
*
|
|
||||||
* Check adapter in the hdd global list or not
|
|
||||||
*
|
|
||||||
* Return: true if adapter exists.
|
|
||||||
*/
|
|
||||||
static bool hdd_check_adapter(struct hdd_adapter *adapter)
|
|
||||||
{
|
|
||||||
struct hdd_adapter *temp;
|
|
||||||
struct hdd_context *hdd_ctx;
|
|
||||||
|
|
||||||
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
||||||
if (!hdd_ctx) {
|
|
||||||
hdd_err("HDD context is null");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
hdd_for_each_adapter(hdd_ctx, temp) {
|
|
||||||
if (temp == adapter)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __wlan_hdd_sap_pre_cac_failure() - Process the pre cac failure
|
* __wlan_hdd_sap_pre_cac_failure() - Process the pre cac failure
|
||||||
* @data: AP adapter
|
* @data: AP adapter
|
||||||
@@ -1067,8 +1041,7 @@ static void __wlan_hdd_sap_pre_cac_failure(void *data)
|
|||||||
hdd_enter();
|
hdd_enter();
|
||||||
|
|
||||||
adapter = (struct hdd_adapter *) data;
|
adapter = (struct hdd_adapter *) data;
|
||||||
if (!adapter || !hdd_check_adapter(adapter) ||
|
if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
|
||||||
adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
|
|
||||||
hdd_err("SAP Pre CAC adapter invalid");
|
hdd_err("SAP Pre CAC adapter invalid");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1079,9 +1052,8 @@ static void __wlan_hdd_sap_pre_cac_failure(void *data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlan_hdd_release_intf_addr(hdd_ctx,
|
wlan_hdd_release_intf_addr(hdd_ctx, adapter->mac_addr.bytes);
|
||||||
adapter->mac_addr.bytes);
|
hdd_stop_adapter(hdd_ctx, adapter);
|
||||||
hdd_stop_adapter_ext(hdd_ctx, adapter, HDD_IN_CAC_WORK_TH_CONTEXT);
|
|
||||||
hdd_close_adapter(hdd_ctx, adapter, false);
|
hdd_close_adapter(hdd_ctx, adapter, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1118,8 +1090,7 @@ static void wlan_hdd_sap_pre_cac_success(void *data)
|
|||||||
hdd_enter();
|
hdd_enter();
|
||||||
|
|
||||||
adapter = (struct hdd_adapter *) data;
|
adapter = (struct hdd_adapter *) data;
|
||||||
if (!adapter || !hdd_check_adapter(adapter) ||
|
if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
|
||||||
adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
|
|
||||||
hdd_err("SAP Pre CAC adapter invalid");
|
hdd_err("SAP Pre CAC adapter invalid");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1131,9 +1102,8 @@ static void wlan_hdd_sap_pre_cac_success(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cds_ssr_protect(__func__);
|
cds_ssr_protect(__func__);
|
||||||
wlan_hdd_release_intf_addr(hdd_ctx,
|
wlan_hdd_release_intf_addr(hdd_ctx, adapter->mac_addr.bytes);
|
||||||
adapter->mac_addr.bytes);
|
hdd_stop_adapter(hdd_ctx, adapter);
|
||||||
hdd_stop_adapter_ext(hdd_ctx, adapter, HDD_IN_CAC_WORK_TH_CONTEXT);
|
|
||||||
hdd_close_adapter(hdd_ctx, adapter, false);
|
hdd_close_adapter(hdd_ctx, adapter, false);
|
||||||
cds_ssr_unprotect(__func__);
|
cds_ssr_unprotect(__func__);
|
||||||
|
|
||||||
|
@@ -5377,16 +5377,10 @@ void wlan_hdd_reset_prob_rspies(struct hdd_adapter *adapter)
|
|||||||
|
|
||||||
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
||||||
struct hdd_adapter *adapter)
|
struct hdd_adapter *adapter)
|
||||||
{
|
|
||||||
return hdd_stop_adapter_ext(hdd_ctx, adapter, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
|
|
||||||
struct hdd_adapter *adapter,
|
|
||||||
enum hdd_adapter_stop_flag_t flag)
|
|
||||||
{
|
{
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
struct hdd_station_ctx *sta_ctx;
|
struct hdd_station_ctx *sta_ctx;
|
||||||
|
struct sap_context *sap_ctx;
|
||||||
struct csr_roam_profile *roam_profile;
|
struct csr_roam_profile *roam_profile;
|
||||||
union iwreq_data wrqu;
|
union iwreq_data wrqu;
|
||||||
tSirUpdateIE updateIE;
|
tSirUpdateIE updateIE;
|
||||||
@@ -5539,8 +5533,11 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
|
|||||||
|
|
||||||
ucfg_ipa_flush(hdd_ctx->pdev);
|
ucfg_ipa_flush(hdd_ctx->pdev);
|
||||||
|
|
||||||
if (!(flag & HDD_IN_CAC_WORK_TH_CONTEXT))
|
/* don't flush pre-cac destroy if we are destroying pre-cac */
|
||||||
|
sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
|
||||||
|
if (!wlan_sap_is_pre_cac_context(sap_ctx))
|
||||||
cds_flush_work(&hdd_ctx->sap_pre_cac_work);
|
cds_flush_work(&hdd_ctx->sap_pre_cac_work);
|
||||||
|
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
|
||||||
case QDF_P2P_GO_MODE:
|
case QDF_P2P_GO_MODE:
|
||||||
|
@@ -643,15 +643,15 @@ typedef struct sSapDfsInfo {
|
|||||||
uint16_t reduced_beacon_interval;
|
uint16_t reduced_beacon_interval;
|
||||||
} tSapDfsInfo;
|
} tSapDfsInfo;
|
||||||
|
|
||||||
typedef struct tagSapCtxList {
|
struct sap_ctx_list {
|
||||||
void *sap_context;
|
void *sap_context;
|
||||||
enum QDF_OPMODE sapPersona;
|
enum QDF_OPMODE sapPersona;
|
||||||
} tSapCtxList, tpSapCtxList;
|
};
|
||||||
|
|
||||||
typedef struct tagSapStruct {
|
typedef struct tagSapStruct {
|
||||||
/* Information Required for SAP DFS Master mode */
|
/* Information Required for SAP DFS Master mode */
|
||||||
tSapDfsInfo SapDfsInfo;
|
tSapDfsInfo SapDfsInfo;
|
||||||
tSapCtxList sapCtxList[SAP_MAX_NUM_SESSION];
|
struct sap_ctx_list sapCtxList[SAP_MAX_NUM_SESSION];
|
||||||
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
|
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
|
||||||
bool sap_channel_avoidance;
|
bool sap_channel_avoidance;
|
||||||
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
|
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
|
||||||
@@ -882,6 +882,14 @@ QDF_STATUS wlan_sap_set_chan_before_pre_cac(struct sap_context *sap_ctx,
|
|||||||
QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
|
QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
|
||||||
bool status);
|
bool status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_sap_is_pre_cac_context() - checks if @context is for a pre-cac adapter
|
||||||
|
* @context: the SAP context to check
|
||||||
|
*
|
||||||
|
* Return: true if @context is for a pre-cac adapter
|
||||||
|
*/
|
||||||
|
bool wlan_sap_is_pre_cac_context(struct sap_context *context);
|
||||||
|
|
||||||
bool wlan_sap_is_pre_cac_active(mac_handle_t handle);
|
bool wlan_sap_is_pre_cac_active(mac_handle_t handle);
|
||||||
QDF_STATUS wlan_sap_get_pre_cac_vdev_id(mac_handle_t handle, uint8_t *vdev_id);
|
QDF_STATUS wlan_sap_get_pre_cac_vdev_id(mac_handle_t handle, uint8_t *vdev_id);
|
||||||
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
||||||
|
@@ -1518,6 +1518,11 @@ QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wlan_sap_is_pre_cac_context(struct sap_context *context)
|
||||||
|
{
|
||||||
|
return context && context->is_pre_cac_on;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_sap_is_pre_cac_active() - Checks if pre cac in in progress
|
* wlan_sap_is_pre_cac_active() - Checks if pre cac in in progress
|
||||||
* @handle: Global MAC handle
|
* @handle: Global MAC handle
|
||||||
@@ -1529,6 +1534,7 @@ QDF_STATUS wlan_sap_set_pre_cac_complete_status(struct sap_context *sap_ctx,
|
|||||||
bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
|
bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
|
||||||
{
|
{
|
||||||
struct mac_context *mac = NULL;
|
struct mac_context *mac = NULL;
|
||||||
|
struct sap_ctx_list *ctx_list;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
mac = MAC_CONTEXT(handle);
|
mac = MAC_CONTEXT(handle);
|
||||||
@@ -1538,12 +1544,12 @@ bool wlan_sap_is_pre_cac_active(mac_handle_t handle)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx_list = mac->sap.sapCtxList;
|
||||||
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
|
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
|
||||||
struct sap_context *context =
|
if (wlan_sap_is_pre_cac_context(ctx_list[i].sap_context))
|
||||||
mac->sap.sapCtxList[i].sap_context;
|
|
||||||
if (context && context->is_pre_cac_on)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user