qcacld-3.0: Add vdev state machine for start BSS

Adds vdev state machine changes for start BSS req.

Change-Id: I9c8a5129db4ddc81f179256b077ab0cd038b5b27
CRs-Fixed: 2316552
This commit is contained in:
Abhishek Singh
2018-09-12 15:49:18 +05:30
committed by nshrivas
parent 1ee7600f9f
commit 3d30a3bb0c
17 changed files with 452 additions and 112 deletions

View File

@@ -21,6 +21,8 @@
#include <wlan_objmgr_vdev_obj.h>
#include "wlan_mlme_main.h"
#include "wlan_mlme_vdev_mgr_interface.h"
#include "lim_utils.h"
#include "wma_api.h"
static struct vdev_mlme_ops sta_mlme_ops;
static struct vdev_mlme_ops ap_mlme_ops;
@@ -271,37 +273,93 @@ static QDF_STATUS sta_vdev_notify_down_complete(struct vdev_mlme_obj *vdev_mlme,
return QDF_STATUS_SUCCESS;
}
/**
* ap_mlme_vdev_start_send () - send vdev start
/**
* ap_mlme_vdev_start_send () - send vdev start req
* @vdev_mlme: vdev mlme object
* @event_data_len: event data length
* @event_data: event data
* @data_len: event data length
* @data: event data
*
* This function is called to initiate actions of VDEV start ie start bss
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t event_data_len,
void *event_data)
uint16_t data_len, void *data)
{
return QDF_STATUS_SUCCESS;
return lim_ap_mlme_vdev_start_send(vdev_mlme, data_len, data);
}
/**
* ap_mlme_vdev_start_continue () - vdev start rsp calback
* @vdev_mlme: vdev mlme object
* @event_data_len: event data length
* @event_data: event data
* @data_len: event data length
* @data: event data
*
* This function is called to handle the VDEV START/RESTART calback
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
uint16_t event_data_len,
void *event_data)
uint16_t data_len, void *data)
{
return wma_ap_mlme_vdev_start_continue(vdev_mlme, data_len, data);
}
/**
* ap_mlme_vdev_update_beacon() - callback to initiate beacon update
* @vdev_mlme: vdev mlme object
* @op: beacon operation
* @data_len: event data length
* @data: event data
*
* This function is called to update beacon
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
enum beacon_update_op op,
uint16_t data_len, void *data)
{
return lim_ap_mlme_vdev_update_beacon(vdev_mlme, op, data_len, data);
}
/**
* ap_mlme_vdev_up_send() - callback to send vdev up
* @vdev_mlme: vdev mlme object
* @data_len: event data length
* @data: event data
*
* This function is called to send vdev up req
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{
return lim_ap_mlme_vdev_up_send(vdev_mlme, data_len, data);
}
/**
* ap_mlme_vdev_notify_up_complete() - callback to notify up completion
* @vdev_mlme: vdev mlme object
* @data_len: event data length
* @data: event data
*
* This function is called to indicate up is completed
*
* Return: QDF_STATUS
*/
static QDF_STATUS
ap_mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{
if (!vdev_mlme) {
mlme_err("data is NULL");
return QDF_STATUS_E_INVAL;
}
pe_debug("Vdev %d is up", wlan_vdev_get_id(vdev_mlme->vdev));
return QDF_STATUS_SUCCESS;
}
@@ -322,59 +380,6 @@ static QDF_STATUS ap_mlme_vdev_start_req_failed(struct vdev_mlme_obj *vdev_mlme,
return QDF_STATUS_SUCCESS;
}
/**
* ap_mlme_vdev_update_beacon() - callback to initiate beacon update
* @vdev_mlme: vdev mlme object
* @op: beacon operation
* @event_data_len: event data length
* @event_data: event data
*
* This function is called to update beacon
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
enum beacon_update_op op,
uint16_t event_data_len,
void *event_data)
{
return QDF_STATUS_SUCCESS;
}
/**
* ap_mlme_vdev_up_send() callback to send vdev up
* @vdev_mlme: vdev mlme object
* @event_data_len: event data length
* @event_data: event data
*
* This function is called to send vdev up req
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t event_data_len,
void *event_data)
{
return QDF_STATUS_SUCCESS;
}
/**
* ap_mlme_vdev_notify_up_complete() callback to notify up completion
* @vdev_mlme: vdev mlme object
* @event_data_len: event data length
* @event_data: event data
*
* This function is called to indicate up is completed
*
* Return: QDF_STATUS
*/
static QDF_STATUS ap_mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme,
uint16_t event_data_len,
void *event_data)
{
return QDF_STATUS_SUCCESS;
}
/**
* sap_mlme_vdev_restart_send() a callback to send vdev restart
* @vdev_mlme: vdev mlme object
@@ -393,7 +398,7 @@ static QDF_STATUS ap_mlme_vdev_restart_send(struct vdev_mlme_obj *vdev_mlme,
}
static QDF_STATUS ap_mlme_vdev_stop_start_send(struct vdev_mlme_obj *vdev_mlme,
uint8_t restart,
enum vdev_cmd_type type,
uint16_t event_data_len,
void *event_data)
{
@@ -568,8 +573,6 @@ static struct vdev_mlme_ops sta_mlme_ops = {
/**
* struct ap_mlme_ops - VDEV MLME operation callbacks strucutre for beaconing
* interface
* @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
* @mlme_vdev_reset_proto_params: callback to Reset protocol params
* @mlme_vdev_start_send: callback to initiate actions of VDEV
* MLME start operation
* @mlme_vdev_restart_send: callback to initiate actions of VDEV
@@ -590,14 +593,12 @@ static struct vdev_mlme_ops sta_mlme_ops = {
* MLME stop operation
* @mlme_vdev_stop_continue: callback to initiate operations on
* LMAC/FW stop response
* @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
* peer delete completion
* @mlme_vdev_down_send: callback to initiate actions of VDEV
* MLME down operation
* @mlme_vdev_notify_down_complete: callback to notify VDEV MLME on moving
* to INIT state
* @mlme_vdev_legacy_hdl_create: callback to invoke creation of legacy
* vdev object
* @mlme_vdev_legacy_hdl_post_create: callback to invoke post creation actions
* of legacy vdev object
* @mlme_vdev_legacy_hdl_destroy: callback to invoke destroy of legacy
* vdev object
*/
@@ -611,7 +612,7 @@ static struct vdev_mlme_ops ap_mlme_ops = {
.mlme_vdev_notify_up_complete = ap_mlme_vdev_notify_up_complete,
.mlme_vdev_update_beacon = ap_mlme_vdev_update_beacon,
.mlme_vdev_disconnect_peers = ap_mlme_vdev_disconnect_peers,
.mlme_vdev_disconnect_peers = ap_vdev_dfs_cac_timer_stop,
.mlme_vdev_dfs_cac_timer_stop = ap_vdev_dfs_cac_timer_stop,
.mlme_vdev_stop_send = ap_mlme_vdev_stop_send,
.mlme_vdev_stop_continue = ap_mlme_vdev_stop_continue,
.mlme_vdev_down_send = ap_mlme_vdev_down_send,

View File

@@ -685,6 +685,7 @@ struct sir_mgmt_msg {
#define SIR_HAL_SEND_ADDBA_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 398)
#define SIR_HAL_GET_ROAM_SCAN_STATS (SIR_HAL_ITC_MSG_TYPES_BEGIN + 399)
#define SIR_HAL_SEND_AP_VDEV_UP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 400)
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
/* CFG message types */

View File

@@ -23,6 +23,7 @@
#include <sir_common.h>
#include "ani_global.h"
#include "sys_wrapper.h"
#include "wlan_vdev_mlme_api.h"
/* / System role definition on a per BSS */
typedef enum eBssSystemRole {

View File

@@ -245,7 +245,7 @@ void lim_process_mlm_start_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
FL("Start Beacon with ssid %s Ch %d"),
psessionEntry->ssId.ssId,
psessionEntry->currentOperChannel);
lim_send_beacon_ind(pMac, psessionEntry);
lim_send_beacon(pMac, psessionEntry);
lim_enable_obss_detection_config(pMac, psessionEntry);
lim_send_obss_color_collision_cfg(pMac, psessionEntry,
OBSS_COLOR_COLLISION_DETECTION);

View File

@@ -544,6 +544,16 @@ lim_configure_ap_start_bss_session(tpAniSirGlobal mac_ctx, tpPESession session,
*
* Return: QDF_STATUS
*/
#ifdef CONFIG_VDEV_SM
static QDF_STATUS
lim_send_start_vdev_req(tpPESession session, tLimMlmStartReq *mlm_start_req)
{
return wlan_vdev_mlme_sm_deliver_evt(session->vdev,
WLAN_VDEV_SM_EV_START,
sizeof(*mlm_start_req),
mlm_start_req);
}
#else
static QDF_STATUS
lim_send_start_vdev_req(tpPESession session, tLimMlmStartReq *mlm_start_req)
{
@@ -551,6 +561,7 @@ lim_send_start_vdev_req(tpPESession session, tLimMlmStartReq *mlm_start_req)
return QDF_STATUS_SUCCESS;
}
#endif
/**
* __lim_handle_sme_start_bss_request() - process SME_START_BSS_REQ message
@@ -4891,7 +4902,7 @@ static void lim_process_sme_start_beacon_req(tpAniSirGlobal pMac, uint32_t *pMsg
FL("Start Beacon with ssid %s Ch %d"),
psessionEntry->ssId.ssId,
psessionEntry->currentOperChannel);
lim_send_beacon_ind(pMac, psessionEntry);
lim_send_beacon(pMac, psessionEntry);
lim_enable_obss_detection_config(pMac, psessionEntry);
lim_send_obss_color_collision_cfg(pMac, psessionEntry,
OBSS_COLOR_COLLISION_DETECTION);

View File

@@ -8430,3 +8430,85 @@ void lim_send_start_bss_confirm(tpAniSirGlobal mac_ctx,
(uint32_t *)start_cnf);
}
#ifdef CONFIG_VDEV_SM
void lim_send_beacon(tpAniSirGlobal mac_ctx, tpPESession session)
{
if (wlan_vdev_mlme_get_state(session->vdev) ==
WLAN_VDEV_S_DFS_CAC_WAIT)
wlan_vdev_mlme_sm_deliver_evt(session->vdev,
WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED,
sizeof(*session), session);
else
wlan_vdev_mlme_sm_deliver_evt(session->vdev,
WLAN_VDEV_SM_EV_START_SUCCESS,
sizeof(*session), session);
}
QDF_STATUS lim_ap_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{
tpAniSirGlobal mac_ctx;
mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
if (!mac_ctx) {
pe_err("mac_ctx is NULL");
if (data)
qdf_mem_free(data);
return QDF_STATUS_E_INVAL;
}
lim_process_mlm_start_req(mac_ctx, (tLimMlmStartReq *)data);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS lim_ap_mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
enum beacon_update_op op,
uint16_t data_len, void *data)
{
tpPESession session;
if (!data) {
pe_err("event_data is NULL");
return QDF_STATUS_E_INVAL;
}
if (op == BEACON_INIT) {
session = (tpPESession)data;
lim_send_beacon_ind(session->mac_ctx, session);
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS lim_ap_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{
struct scheduler_msg msg = {0};
QDF_STATUS status;
tpPESession session = (tpPESession)data;
if (!session) {
pe_err("session is NULL");
return QDF_STATUS_E_INVAL;
}
msg.type = SIR_HAL_SEND_AP_VDEV_UP;
msg.bodyval = session->smeSessionId;
status = scheduler_post_msg(QDF_MODULE_ID_WMA, &msg);
if (QDF_IS_STATUS_ERROR(status))
WMA_LOGE("Failed to post SIR_HAL_SEND_AP_VDEV_UP");
return status;
}
#else
void lim_send_beacon(tpAniSirGlobal mac_ctx, tpPESession session)
{
lim_send_beacon_ind(mac_ctx, session);
}
#endif

View File

@@ -36,6 +36,8 @@
#include "lim_scan_result_utils.h"
#include "lim_timer_utils.h"
#include "lim_trace.h"
#include "include/wlan_vdev_mlme.h"
typedef enum {
ONE_BYTE = 1,
TWO_BYTE = 2
@@ -1483,4 +1485,60 @@ static inline void lim_set_peer_twt_cap(tpPESession session,
*/
void lim_rx_invalid_peer_process(tpAniSirGlobal mac_ctx,
struct scheduler_msg *lim_msg);
/**
* lim_send_beacon() - send beacon indication to firmware
* @mac_ctx: Pointer to Global MAC structure
* @session: session pointer
*
* Return: None
*/
void lim_send_beacon(tpAniSirGlobal mac_ctx, tpPESession session);
#ifdef CONFIG_VDEV_SM
/**
* lim_ap_mlme_vdev_start_send() - Invokes VDEV start operation
* @vdev_mlme_obj: VDEV MLME comp object
* @data_len: data size
* @data: event data
*
* API invokes VDEV start operation
*
* Return: SUCCESS on successful completion of start operation
* FAILURE, if it fails due to any
*/
QDF_STATUS lim_ap_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *event);
/*
* lim_ap_mlme_vdev_update_beacon() - Updates beacon
* @vdev_mlme_obj: VDEV MLME comp object
* @op: beacon update type
* @data_len: data size
* @data: event data
*
* API updates/allocates/frees the beacon
*
* Return: SUCCESS on successful update of beacon
* FAILURE, if it fails due to any
*/
QDF_STATUS lim_ap_mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
enum beacon_update_op op,
uint16_t data_len, void *data);
/**
* lim_ap_mlme_vdev_up_send() - VDEV up operation
* @vdev_mlme_obj: VDEV MLME comp object
* @data_len: data size
* @data: event data
*
* API invokes VDEV up operations
*
* Return: SUCCESS on successful completion of up operation
* FAILURE, if it fails due to any
*/
QDF_STATUS lim_ap_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data);
#endif
#endif /* __LIM_UTILS_H */

View File

@@ -578,7 +578,7 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
QDF_STATUS qdf_status;
tWLAN_SAPEvent sap_event;
if (sap_ctx->fsm_state == SAP_DFS_CAC_WAIT) {
if (sap_is_dfs_cac_wait_state(sap_ctx)) {
if (sap_ctx->csr_roamProfile.disableDFSChSwitch) {
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_ERROR,
@@ -889,10 +889,11 @@ wlansap_roam_callback(void *ctx, struct csr_roam_info *csr_roam_info,
}
if (sap_ctx->fsm_state != SAP_STARTED &&
sap_ctx->fsm_state != SAP_DFS_CAC_WAIT) {
!sap_is_dfs_cac_wait_state(sap_ctx)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
FL("Ignore Radar event in sap state %d"),
sap_ctx->fsm_state);
FL("Ignore Radar event in sap state %d cac wait state %d"),
sap_ctx->fsm_state,
sap_is_dfs_cac_wait_state(sap_ctx));
goto EXIT;
}

View File

@@ -105,8 +105,9 @@ static QDF_STATUS sap_get_channel_list(struct sap_context *sapContext,
SIDE EFFECTS
============================================================================*/
#ifndef CONFIG_VDEV_SM
static int sap_stop_dfs_cac_timer(struct sap_context *sapContext);
#endif
/*==========================================================================
FUNCTION sapStartDfsCacTimer
@@ -1820,8 +1821,7 @@ static struct sap_context *sap_find_cac_wait_session(tHalHandle handle)
if (((QDF_SAP_MODE == mac->sap.sapCtxList[i].sapPersona)
||
(QDF_P2P_GO_MODE == mac->sap.sapCtxList[i].sapPersona)) &&
(sap_ctx) &&
(sap_ctx->fsm_state == SAP_DFS_CAC_WAIT)) {
(sap_is_dfs_cac_wait_state(sap_ctx))) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
"%s: found SAP in cac wait state", __func__);
return sap_ctx;
@@ -1942,10 +1942,15 @@ static QDF_STATUS wlansap_update_pre_cac_end(struct sap_context *sap_context,
mac->sap.SapDfsInfo.sap_radar_found_status = false;
sap_context->fsm_state = SAP_STARTED;
#ifndef CONFIG_VDEV_SM
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
"In %s, pre cac end notify on %d: from state %s => %s",
__func__, intf, "SAP_DFS_CAC_WAIT",
"SAP_STARTED");
"In %s, pre cac end notify on %d: from state %s => %s",
__func__, intf, "SAP_DFS_CAC_WAIT", "SAP_STARTED");
#else
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
"In %s, pre cac end notify on %d: from state %s => %s",
__func__, intf, "SAP_STARTING", "SAP_STARTED");
#endif
qdf_status = sap_signal_hdd_event(sap_context,
NULL, eSAP_DFS_PRE_CAC_END,
@@ -1997,7 +2002,7 @@ static QDF_STATUS sap_cac_end_notify(tHalHandle hHal,
(QDF_P2P_GO_MODE == pMac->sap.sapCtxList[intf].sapPersona))
&& pMac->sap.sapCtxList[intf].sap_context != NULL &&
(false == sap_context->isCacEndNotified) &&
(sap_context->fsm_state == SAP_DFS_CAC_WAIT)) {
sap_is_dfs_cac_wait_state(sap_context)) {
sap_context = pMac->sap.sapCtxList[intf].sap_context;
/* Don't check CAC for non-dfs channel */
profile = &sap_context->csr_roamProfile;
@@ -2258,6 +2263,7 @@ sap_fsm_state_init(struct sap_context *sap_ctx,
QDF_TRACE_LEVEL_ERROR,
FL("sap_goto_starting failed"));
} else if (msg == eSAP_DFS_CHANNEL_CAC_START) {
#ifndef CONFIG_VDEV_SM
/*
* No need of state check here, caller is expected to perform
* the checks before sending the event
@@ -2266,6 +2272,7 @@ sap_fsm_state_init(struct sap_context *sap_ctx,
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
FL("from state SAP_INIT => SAP_DFS_CAC_WAIT"));
#endif
if (mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running != true) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
FL("sapdfs: starting dfs cac timer on sapctx[%pK]"),
@@ -2284,6 +2291,7 @@ exit:
return qdf_status;
}
#ifndef CONFIG_VDEV_SM
/**
* sap_fsm_state_dfs_cac_wait() - utility function called from sap fsm
* @sap_ctx: SAP context
@@ -2386,6 +2394,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx,
return qdf_status;
}
#endif
/**
* sap_fsm_state_starting() - utility function called from sap fsm
@@ -2465,10 +2474,12 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_HIGH,
FL("start cac timer"));
#ifdef CONFIG_VDEV_SM
sap_ctx->fsm_state = SAP_STARTING;
#else
/* Move the device in CAC_WAIT_STATE */
sap_ctx->fsm_state = SAP_DFS_CAC_WAIT;
#endif
/*
* Need to stop the OS transmit queues,
* so that no traffic can flow down the stack
@@ -2519,7 +2530,57 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
qdf_status = sap_signal_hdd_event(sap_ctx, roam_info,
eSAP_START_BSS_EVENT,
(void *)eSAP_STATUS_SUCCESS);
} else {
} else
#ifdef CONFIG_VDEV_SM
if (msg == eSAP_DFS_CHANNEL_CAC_RADAR_FOUND) {
uint8_t intf;
if (mac_ctx->sap.SapDfsInfo.target_channel) {
wlan_reg_set_channel_params(mac_ctx->pdev,
mac_ctx->sap.SapDfsInfo.
target_channel, 0,
&sap_ctx->ch_params);
} else {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
FL("Invalid target channel %d"),
mac_ctx->sap.SapDfsInfo.target_channel);
return qdf_status;
}
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
struct sap_context *t_sap_ctx;
struct csr_roam_profile *profile;
t_sap_ctx = mac_ctx->sap.sapCtxList[intf].sap_context;
if (((QDF_SAP_MODE ==
mac_ctx->sap.sapCtxList[intf].sapPersona) ||
(QDF_P2P_GO_MODE ==
mac_ctx->sap.sapCtxList[intf].sapPersona)) &&
t_sap_ctx && t_sap_ctx->fsm_state != SAP_INIT) {
profile = &t_sap_ctx->csr_roamProfile;
if (!wlan_reg_is_passive_or_disable_ch(
mac_ctx->pdev,
profile->operationChannel))
continue;
t_sap_ctx->is_chan_change_inprogress = true;
/*
* eSAP_DFS_CHANNEL_CAC_RADAR_FOUND:
* A Radar is found on current DFS Channel
* while in CAC WAIT period So, do a channel
* switch to randomly selected target channel.
* Send the Channel change message to SME/PE.
* sap_radar_found_status is set to 1
*/
wlansap_channel_change_request(
t_sap_ctx,
mac_ctx->sap.SapDfsInfo.target_channel);
}
}
} else if (msg == eSAP_DFS_CHANNEL_CAC_END) {
qdf_status = sap_cac_end_notify(hal, roam_info);
} else
#endif
{
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
FL("in state %s, invalid event msg %d"),
"SAP_STARTING", msg);
@@ -2705,10 +2766,12 @@ QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event)
mac_ctx, hal);
break;
#ifndef CONFIG_VDEV_SM
case SAP_DFS_CAC_WAIT:
qdf_status = sap_fsm_state_dfs_cac_wait(sap_ctx, sap_event,
mac_ctx, hal);
break;
#endif
case SAP_STARTING:
qdf_status = sap_fsm_state_starting(sap_ctx, sap_event,
@@ -3461,6 +3524,7 @@ void sap_dfs_cac_timer_callback(void *data)
sap_fsm(sapContext, &sapEvent);
}
#ifndef CONFIG_VDEV_SM
/*
* Function to stop the DFS CAC Timer
*/
@@ -3497,7 +3561,7 @@ static int sap_stop_dfs_cac_timer(struct sap_context *sapContext)
return 0;
}
#endif
/*
* Function to start the DFS CAC Timer
@@ -3557,6 +3621,18 @@ static int sap_start_dfs_cac_timer(struct sap_context *sap_ctx)
}
mac->sap.SapDfsInfo.is_dfs_cac_timer_running = true;
#ifdef CONFIG_VDEV_SM
status = wlan_vdev_mlme_sm_deliver_evt(sap_ctx->vdev,
WLAN_VDEV_SM_EV_DFS_CAC_WAIT,
0, NULL);
if (QDF_IS_STATUS_ERROR(status)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
"%s: failed to post WLAN_VDEV_SM_EV_DFS_CAC_WAIT",
__func__);
qdf_mc_timer_stop(&mac->sap.SapDfsInfo.sap_dfs_cac_timer);
goto destroy_timer;
}
#endif
return 0;
destroy_timer:

View File

@@ -34,6 +34,7 @@
#include "sap_ch_select.h"
#include <wlan_scan_public_structs.h>
#include <wlan_objmgr_pdev_obj.h>
#include "wlan_vdev_mlme_api.h"
/*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants
@@ -88,7 +89,9 @@ extern "C" {
*/
enum sap_fsm_state {
SAP_INIT,
#ifndef CONFIG_VDEV_SM
SAP_DFS_CAC_WAIT,
#endif
SAP_STARTING,
SAP_STARTED,
SAP_STOPPING
@@ -467,6 +470,31 @@ static inline uint8_t sap_indicate_radar(struct sap_context *sap_ctx)
*/
uint8_t sap_select_default_oper_chan(struct sap_acs_cfg *acs_cfg);
/*
* sap_is_dfs_cac_wait_state() - check if sap is in cac wait state
* @sap_ctx: sap context to check
*
* Return: true if sap is in cac wait state
*/
#ifdef CONFIG_VDEV_SM
static inline bool sap_is_dfs_cac_wait_state(struct sap_context *sap_ctx)
{
if (!sap_ctx)
return false;
return (wlan_vdev_mlme_get_state(sap_ctx->vdev) ==
WLAN_VDEV_S_DFS_CAC_WAIT);
}
#else
static inline bool sap_is_dfs_cac_wait_state(struct sap_context *sap_ctx)
{
if (!sap_ctx)
return false;
return (sap_ctx->fsm_state == SAP_DFS_CAC_WAIT);
}
#endif
/**
* sap_channel_in_acs_channel_list() - check if channel in acs channel list
* @channel_num: channel to check

View File

@@ -33,6 +33,7 @@
#include "wlan_policy_mgr_api.h"
#include "wma_sar_public_structs.h"
#include <cdp_txrx_ops.h>
#include "include/wlan_vdev_mlme.h"
typedef void *WMA_HANDLE;
@@ -407,4 +408,21 @@ void wma_wmi_stop(void);
*/
uint8_t wma_get_mcs_idx(uint16_t max_rate, uint8_t rate_flags,
uint8_t *nss, uint8_t *mcs_rate_flag);
#ifdef CONFIG_VDEV_SM
/**
* wma_ap_mlme_vdev_start_continue - VDEV start response handling
* @vdev_mlme_obj: VDEV MLME comp object
* @data_len: data size
* @data: event data
*
* API invokes VDEV start response actions
*
* Return: SUCCESS on successful completion of start response operation
* FAILURE, if it fails due to any
*/
QDF_STATUS wma_ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data);
#endif
#endif

View File

@@ -672,9 +672,9 @@ void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
* @wma: wma handle
* @vdev_id: vdev id
*
* Return: none
* Return: QDF_STATUS
*/
void wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);

View File

@@ -446,6 +446,8 @@
#define WMA_SET_PER_ROAM_CONFIG_CMD SIR_HAL_SET_PER_ROAM_CONFIG_CMD
#define WMA_SEND_AP_VDEV_UP SIR_HAL_SEND_AP_VDEV_UP
#define WMA_SET_ARP_STATS_REQ SIR_HAL_SET_ARP_STATS_REQ
#define WMA_GET_ARP_STATS_REQ SIR_HAL_GET_ARP_STATS_REQ
#define WMA_SET_LIMIT_OFF_CHAN SIR_HAL_SET_LIMIT_OFF_CHAN

View File

@@ -903,14 +903,25 @@ send_rsp:
*
* Return: none
*/
#ifdef CONFIG_VDEV_SM
static void wma_send_start_resp(tp_wma_handle wma,
tpAddBssParams add_bss,
wmi_vdev_start_response_event_fixed_param *
resp_event)
tpAddBssParams add_bss,
wmi_vdev_start_response_event_fixed_param *
resp_event)
{
if (!resp_event->status && QDF_IS_STATUS_SUCCESS(add_bss->status)) {
add_bss->status = wlan_vdev_mlme_sm_deliver_evt(
wma->interfaces[resp_event->vdev_id].vdev,
WLAN_VDEV_SM_EV_START_RESP,
sizeof(*add_bss),
add_bss);
if (QDF_IS_STATUS_SUCCESS(add_bss->status))
return;
}
/* Send vdev stop if vdev start was success */
if (QDF_IS_STATUS_ERROR(add_bss->status) &&
!resp_event->status)
!resp_event->status)
if (wma_send_vdev_stop_to_fw(wma, resp_event->vdev_id))
WMA_LOGE(FL("Failed to send vdev stop"));
@@ -918,6 +929,23 @@ static void wma_send_start_resp(tp_wma_handle wma,
resp_event->vdev_id, add_bss->status);
wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
}
#else
static void wma_send_start_resp(tp_wma_handle wma,
tpAddBssParams add_bss,
wmi_vdev_start_response_event_fixed_param *
resp_event)
{
/* Send vdev stop if vdev start was success */
if (QDF_IS_STATUS_ERROR(add_bss->status) &&
!resp_event->status)
if (wma_send_vdev_stop_to_fw(wma, resp_event->vdev_id))
WMA_LOGE(FL("Failed to send vdev stop"));
WMA_LOGD(FL("Sending add bss rsp to umac(vdev %d status %d)"),
resp_event->vdev_id, add_bss->status);
wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
}
#endif
/**
* wma_vdev_start_rsp() - send vdev start response to upper layer

View File

@@ -7921,6 +7921,9 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
wma_send_beacon(wma_handle, (tpSendbeaconParams) msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
case WMA_SEND_AP_VDEV_UP:
wma_set_ap_vdev_up(wma_handle, msg->bodyval);
break;
case WMA_SEND_PROBE_RSP_TMPL:
wma_send_probe_rsp_tmpl(wma_handle,
(tpSendProbeRespParams) msg->bodyptr);

View File

@@ -2880,33 +2880,37 @@ void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
}
}
void wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id)
QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id)
{
struct vdev_up_params param = {0};
QDF_STATUS status;
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (!((qdf_atomic_read(
&wma->interfaces[vdev_id].vdev_restart_params.
hidden_ssid_restart_in_progress)) ||
(wma->interfaces[vdev_id].is_channel_switch))) {
if (!wma_is_vdev_up(vdev_id)) {
param.vdev_id = vdev_id;
param.assoc_id = 0;
status = wma_send_vdev_up_to_fw(wma, &param,
wma->interfaces[vdev_id].bssid);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE(FL("failed to send vdev up"));
policy_mgr_set_do_hw_mode_change_flag(
wma->psoc, false);
return;
}
#ifndef CONFIG_VDEV_SM
wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_RUN);
if (wma_is_vdev_up(vdev_id))
return status;
#endif
wma_set_sap_keepalive(wma, vdev_id);
wma_set_vdev_mgmt_rate(wma, vdev_id);
param.vdev_id = vdev_id;
param.assoc_id = 0;
status = wma_send_vdev_up_to_fw(wma, &param,
wma->interfaces[vdev_id].bssid);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE(FL("failed to send vdev up"));
policy_mgr_set_do_hw_mode_change_flag(
wma->psoc, false);
return status;
}
#ifndef CONFIG_VDEV_SM
wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_RUN);
#endif
wma_set_sap_keepalive(wma, vdev_id);
wma_set_vdev_mgmt_rate(wma, vdev_id);
}
return status;
}
/**
@@ -2961,7 +2965,9 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
WMA_LOGE("%s : wma_store_bcn_tmpl Failed", __func__);
return;
}
#ifndef CONFIG_VDEV_SM
wma_set_ap_vdev_up(wma, vdev_id);
#endif
}
/**

View File

@@ -4546,13 +4546,15 @@ QDF_STATUS wma_send_vdev_up_to_fw(t_wma_handle *wma,
return QDF_STATUS_E_FAILURE;
}
#ifndef CONFIG_VDEV_SM
if (wma_is_vdev_up(params->vdev_id)) {
WMA_LOGD("vdev %d is already up for bssid %pM. Do not send",
params->vdev_id, bssid);
return QDF_STATUS_SUCCESS;
}
#endif
vdev = &wma->interfaces[params->vdev_id];
status = wmi_unified_vdev_up_send(wma->wmi_handle, bssid, params);
wma_release_wakelock(&vdev->vdev_start_wakelock);
@@ -4794,3 +4796,25 @@ QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
return QDF_STATUS_SUCCESS;
}
#ifdef CONFIG_VDEV_SM
static QDF_STATUS
wma_ap_vdev_send_start_resp(struct vdev_mlme_obj *vdev_mlme,
tpAddBssParams add_bss)
{
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
WMA_LOGD(FL("Sending add bss rsp to umac(vdev %d status %d)"),
add_bss->bssIdx, add_bss->status);
wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wma_ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
uint16_t data_len, void *data)
{
return wma_ap_vdev_send_start_resp(vdev_mlme, data);
}
#endif