qcacld-3.0: Move vdev to DFS CAC state if channel is dfs

After got restart channel rsp from fw, vdev state will change
as: ST-RESTART_PROG->ST-CONN_PROG.

In lim_send_sme_ap_channel_switch_resp, if channel is non-dfs,
vdev state will change to up; if dfs channel, later it will
change to DFS CAC when starting cac timer.

Current issue is if there is ap stop after restart channel rsp,
while processing WLAN_VDEV_SM_EV_DOWN, there is no hanler in
ST-CONN_PROG > ST-DISCONN_PROG.

From design perspective, In SAP, ST_CONN_PROG is a dummy state,
ideally, SAP state should change as below without preemption :
	RESTART_PROGRESS->CONN_PROGRESS->UP
	RESTART_PROGRESS->CONN_PROGRESS->DFS_CAC_WAIT

To fix issue, change vdev state to DFS_CAC_WAIT in
lim_send_sme_ap_channel_switch_resp; So WLAN_VDEV_SM_EV_DOWN will
be handled in DFS_CAC_WAIT state.

At the same time, set DFS_CAC_WAIT when starting SAP, and clear
sap_move_to_cac_wait_state in sap state machine.

Change-Id: Iee89521471e456a553f40577da6d1e69aef3b803
CRs-Fixed: 2501339
This commit is contained in:
Jingxiang Ge 2019-08-05 16:05:31 +08:00 • committed by nshrivas
commit ace2c3c6a4
5 changed files with 31 additions and 27 deletions

View file

@ -242,6 +242,8 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
lim_enable_obss_detection_config(mac, pe_session);
lim_send_obss_color_collision_cfg(mac, pe_session,
OBSS_COLOR_COLLISION_DETECTION);
} else {
lim_sap_move_to_cac_wait_state(pe_session);
}
}
}

View file

@ -1962,6 +1962,11 @@ lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
mmhMsg.bodyval = 0;
lim_sys_process_mmh_msg_api(mac, &mmhMsg);
if (QDF_IS_STATUS_ERROR(pChnlParams->status)) {
pe_err("failed to change sap channel to %u", channelId);
return;
}
/*
* We should start beacon transmission only if the new
* channel after channel change is Non-DFS. For a DFS
@ -1985,7 +1990,10 @@ lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
is_ch_dfs = true;
}
if (!is_ch_dfs) {
if (is_ch_dfs) {
lim_sap_move_to_cac_wait_state(pe_session);
} else {
if (channelId == wlan_reg_freq_to_chan(
mac->pdev, pe_session->curr_op_freq)) {
lim_apply_configuration(mac, pe_session);

View file

@ -8013,6 +8013,17 @@ void lim_ndi_mlme_vdev_up_transition(struct pe_session *session)
sizeof(*session), session);
}
QDF_STATUS lim_sap_move_to_cac_wait_state(struct pe_session *session)
{
QDF_STATUS status;
status =
wlan_vdev_mlme_sm_deliver_evt(session->vdev,
WLAN_VDEV_SM_EV_DFS_CAC_WAIT,
sizeof(*session), session);
return status;
}
QDF_STATUS lim_ap_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{

View file

@ -1530,6 +1530,14 @@ void lim_send_beacon(struct mac_context *mac_ctx, struct pe_session *session);
*/
void lim_ndi_mlme_vdev_up_transition(struct pe_session *session);
/**
* lim_sap_move_to_cac_wait_state() - move to cac wait state
* @sap_ctx: SAP context
*
* Return: QDF_STATUS
*/
QDF_STATUS lim_sap_move_to_cac_wait_state(struct pe_session *session);
/**
* lim_disconnect_complete - Deliver vdev disconnect complete event or
* STA send deleting bss

View file

@ -2321,23 +2321,6 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
return qdf_status;
}
/**
* sap_move_to_cac_wait_state() - move to cac wait state
* @sap_ctx: SAP context
*
* Return: QDF_STATUS
*/
static QDF_STATUS sap_move_to_cac_wait_state(struct sap_context *sap_ctx)
{
QDF_STATUS status;
status =
wlan_vdev_mlme_sm_deliver_evt(sap_ctx->vdev,
WLAN_VDEV_SM_EV_DFS_CAC_WAIT,
0, NULL);
return status;
}
/**
* sap_fsm_cac_start() - start cac wait timer
* @sap_ctx: SAP context
@ -2359,8 +2342,6 @@ static QDF_STATUS sap_fsm_cac_start(struct sap_context *sap_ctx,
FL("sapdfs: starting dfs cac timer on sapctx[%pK]"),
sap_ctx);
sap_start_dfs_cac_timer(sap_ctx);
} else {
sap_move_to_cac_wait_state(sap_ctx);
}
return sap_cac_start_notify(mac_handle);
@ -3690,8 +3671,6 @@ static int sap_start_dfs_cac_timer(struct sap_context *sap_ctx)
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
"%s: cac timer offloaded to firmware", __func__);
mac->sap.SapDfsInfo.is_dfs_cac_timer_running = true;
sap_move_to_cac_wait_state(sap_ctx);
return 1;
}
@ -3720,11 +3699,7 @@ static int sap_start_dfs_cac_timer(struct sap_context *sap_ctx)
}
mac->sap.SapDfsInfo.is_dfs_cac_timer_running = true;
status = sap_move_to_cac_wait_state(sap_ctx);
if (QDF_IS_STATUS_ERROR(status)) {
qdf_mc_timer_stop(&mac->sap.SapDfsInfo.sap_dfs_cac_timer);
goto destroy_timer;
}
return 0;
destroy_timer: