qcacmn: Move rsp timer stop logic from tgt to target if

Currently vdev response start timer logic is in
target_if layer and stop timer logic is in tgt
layer which is asymmetry.

So, move stop timer logic from tgt layer to
target_if layer for vdev start, stop and delete.

Change-Id: Ia06e2e6d90cf9c4366d654e016e2eeab8c2a0719
CRs-Fixed: 2442199
This commit is contained in:
Abhishek Ambure
2019-04-24 14:41:35 -07:00
committed by nshrivas
parent 2a1312cd25
commit 6825cfe7fe
5 changed files with 163 additions and 63 deletions

View File

@@ -86,13 +86,34 @@ static void target_if_vdev_mgr_assert_mgmt(
QDF_ASSERT(0);
}
#endif
#else
/**
* target_if_vdev_mgr_rsp_timer_stop() - API to stop response timer for
* vdev manager operations
* @vdev: pointer to vdev object
* @vdev_rsp: pointer to response timer
* @clear_bit: acton bit
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
*/
QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
uint8_t clear_bit);
#else
static inline QDF_STATUS
target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
{
return QDF_STATUS_SUCCESS;
}
static inline
QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
uint8_t clear_bit)
{
return QDF_STATUS_SUCCESS;
}
#endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
#endif /* __TARGET_IF_VDEV_MGR_TX_OPS_H__ */

View File

@@ -139,12 +139,14 @@ static int target_if_vdev_mgr_start_response_handler(
uint8_t *data,
uint32_t datalen)
{
QDF_STATUS status;
QDF_STATUS status = QDF_STATUS_E_INVAL;
struct wlan_objmgr_psoc *psoc;
struct wmi_unified *wmi_handle;
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
struct vdev_start_response rsp = {0};
wmi_host_vdev_start_resp vdev_start_resp;
struct vdev_response_timer *vdev_rsp;
struct wlan_objmgr_vdev *vdev;
if (!scn || !data) {
mlme_err("Invalid input");
@@ -174,6 +176,37 @@ static int target_if_vdev_mgr_start_response_handler(
return -EINVAL;
}
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
psoc,
vdev_start_resp.vdev_id,
WLAN_VDEV_TARGET_IF_ID);
if (!vdev) {
mlme_err("PSOC_%d :VDEV_%d is NULL", psoc->soc_objmgr.psoc_id,
vdev_start_resp.vdev_id);
return -EINVAL;
}
vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
if (!vdev_rsp) {
mlme_err("PSOC_%d VDEV_%d: VDEV RSP is NULL",
psoc->soc_objmgr.psoc_id, vdev_start_resp.vdev_id);
goto release_vdev_target_if_ref;
}
if (vdev_start_resp.resp_type == WMI_HOST_VDEV_RESTART_RESP_EVENT)
status = target_if_vdev_mgr_rsp_timer_stop(
vdev, vdev_rsp,
RESTART_RESPONSE_BIT);
else
status = target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
START_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("PSOC_%d VDEV_%d: VDE MGR RSP Timer stop failed",
psoc->soc_objmgr.psoc_id, vdev_start_resp.vdev_id);
goto release_vdev_target_if_ref;
}
rsp.vdev_id = vdev_start_resp.vdev_id;
rsp.requestor_id = vdev_start_resp.requestor_id;
rsp.status = vdev_start_resp.status;
@@ -186,6 +219,8 @@ static int target_if_vdev_mgr_start_response_handler(
status = rx_ops->vdev_mgr_start_response(psoc, &rsp);
release_vdev_target_if_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return qdf_status_to_os_return(status);
}
@@ -194,12 +229,14 @@ static int target_if_vdev_mgr_stop_response_handler(
uint8_t *data,
uint32_t datalen)
{
QDF_STATUS status;
QDF_STATUS status = QDF_STATUS_E_INVAL;
struct wlan_objmgr_psoc *psoc;
struct wmi_unified *wmi_handle;
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
struct vdev_stop_response rsp = {0};
uint32_t vdev_id;
struct vdev_response_timer *vdev_rsp;
struct wlan_objmgr_vdev *vdev;
if (!scn || !data) {
mlme_err("Invalid input");
@@ -229,9 +266,37 @@ static int target_if_vdev_mgr_stop_response_handler(
return -EINVAL;
}
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
psoc,
vdev_id,
WLAN_VDEV_TARGET_IF_ID);
if (!vdev) {
mlme_err("PSOC_%d: VDEV_%d is NULL", psoc->soc_objmgr.psoc_id,
vdev_id);
return -EINVAL;
}
vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
if (!vdev_rsp) {
mlme_err("PSOC_%d VDEV_%d: VDEV RSP is NULL",
psoc->soc_objmgr.psoc_id, vdev_id);
goto release_vdev_target_if_ref;
}
status = target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
STOP_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("PSOC_%d VDEV_%d: VDE MGR RSP Timer stop failed",
psoc->soc_objmgr.psoc_id, vdev_id);
goto release_vdev_target_if_ref;
}
rsp.vdev_id = vdev_id;
status = rx_ops->vdev_mgr_stop_response(psoc, &rsp);
release_vdev_target_if_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return qdf_status_to_os_return(status);
}
@@ -240,12 +305,14 @@ static int target_if_vdev_mgr_delete_response_handler(
uint8_t *data,
uint32_t datalen)
{
QDF_STATUS status;
QDF_STATUS status = QDF_STATUS_E_INVAL;
struct wlan_objmgr_psoc *psoc;
struct wmi_unified *wmi_handle;
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
struct vdev_delete_response rsp = {0};
struct wmi_host_vdev_delete_resp vdev_del_resp;
struct vdev_response_timer *vdev_rsp;
struct wlan_objmgr_vdev *vdev;
if (!scn || !data) {
mlme_err("Invalid input");
@@ -275,9 +342,38 @@ static int target_if_vdev_mgr_delete_response_handler(
return -EINVAL;
}
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
psoc,
vdev_del_resp.vdev_id,
WLAN_VDEV_TARGET_IF_ID);
if (!vdev) {
mlme_err("PSOC_%d: VDEV_%d is NULL", psoc->soc_objmgr.psoc_id,
vdev_del_resp.vdev_id);
return -EINVAL;
}
vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
if (!vdev_rsp) {
mlme_err("PSOC_%d VDEV_%d: VDEV RSP is NULL",
psoc->soc_objmgr.psoc_id, vdev_del_resp.vdev_id);
goto release_vdev_target_if_ref;
}
status = target_if_vdev_mgr_rsp_timer_stop(
vdev, vdev_rsp,
DELETE_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("PSOC_%d VDEV_%d: VDE MGR RSP Timer stop failed",
psoc->soc_objmgr.psoc_id, vdev_del_resp.vdev_id);
goto release_vdev_target_if_ref;
}
rsp.vdev_id = vdev_del_resp.vdev_id;
status = rx_ops->vdev_mgr_delete_response(psoc, &rsp);
release_vdev_target_if_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return qdf_status_to_os_return(status);
}
@@ -286,13 +382,15 @@ static int target_if_vdev_mgr_peer_delete_all_response_handler(
uint8_t *data,
uint32_t datalen)
{
QDF_STATUS status;
QDF_STATUS status = QDF_STATUS_E_INVAL;
struct wlan_objmgr_psoc *psoc;
struct wmi_unified *wmi_handle;
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
struct peer_delete_all_response rsp = {0};
struct wmi_host_vdev_peer_delete_all_response_event
vdev_peer_del_all_resp;
struct vdev_response_timer *vdev_rsp;
struct wlan_objmgr_vdev *vdev;
if (!scn || !data) {
mlme_err("Invalid input");
@@ -324,10 +422,41 @@ static int target_if_vdev_mgr_peer_delete_all_response_handler(
return -EINVAL;
}
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
psoc,
vdev_peer_del_all_resp.vdev_id,
WLAN_VDEV_TARGET_IF_ID);
if (!vdev) {
mlme_err("PSOC_%d: VDEV_%d is NULL", psoc->soc_objmgr.psoc_id,
vdev_peer_del_all_resp.vdev_id);
return -EINVAL;
}
vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
if (!vdev_rsp) {
mlme_err("PSOC_%d VDEV_%d: VDEV RSP is NULL",
psoc->soc_objmgr.psoc_id,
vdev_peer_del_all_resp.vdev_id);
goto release_vdev_target_if_ref;
}
status = target_if_vdev_mgr_rsp_timer_stop(
vdev, vdev_rsp,
PEER_DELETE_ALL_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("PSOC_%d VDEV_%d: VDE MGR RSP Timer stop failed",
psoc->soc_objmgr.psoc_id,
vdev_peer_del_all_resp.vdev_id);
goto release_vdev_target_if_ref;
}
rsp.vdev_id = vdev_peer_del_all_resp.vdev_id;
rsp.status = vdev_peer_del_all_resp.status;
status = rx_ops->vdev_mgr_peer_delete_all_response(psoc, &rsp);
release_vdev_target_if_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return qdf_status_to_os_return(status);
}

View File

@@ -62,7 +62,7 @@ static QDF_STATUS target_if_vdev_mgr_rsp_timer_mod(
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
uint8_t clear_bit)
@@ -488,8 +488,11 @@ static QDF_STATUS target_if_vdev_mgr_delete_send(
if (!wmi_service_enabled(wmi_handle,
wmi_service_sync_delete_cmds) ||
wlan_psoc_nif_feat_cap_get(psoc,
WLAN_SOC_F_TESTMODE_ENABLE))
WLAN_SOC_F_TESTMODE_ENABLE)) {
target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
DELETE_RESPONSE_BIT);
target_if_vdev_mgr_delete_response_send(vdev, rx_ops);
}
} else {
target_if_wake_lock_timeout_release(vdev, DELETE_WAKELOCK);
vdev_rsp->expire_time = 0;
@@ -1065,8 +1068,6 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
target_if_vdev_mgr_rsp_timer_init;
mlme_tx_ops->vdev_mgr_rsp_timer_mod =
target_if_vdev_mgr_rsp_timer_mod;
mlme_tx_ops->vdev_mgr_rsp_timer_stop =
target_if_vdev_mgr_rsp_timer_stop;
mlme_tx_ops->peer_delete_all_send =
target_if_vdev_mgr_peer_delete_all_send;

View File

@@ -193,7 +193,6 @@ struct wlan_lmac_if_ftm_tx_ops {
* @vdev_mlme_detach: function to unregister events
* @vdev_mgr_rsp_timer_init: function to initialize vdev response timer
* @vdev_mgr_rsp_timer_mod: function to timer_mod vdev response timer
* @vdev_mgr_rsp_timer_stop: function to stop vdev response timer
* @vdev_create_send: function to send vdev create
* @vdev_start_send: function to send vdev start
* @vdev_up_send: function to send vdev up
@@ -230,10 +229,6 @@ struct wlan_lmac_if_mlme_tx_ops {
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
int mseconds);
QDF_STATUS (*vdev_mgr_rsp_timer_stop)(
struct wlan_objmgr_vdev *vdev,
struct vdev_response_timer *vdev_rsp,
uint8_t clear_bit);
QDF_STATUS (*vdev_create_send)(struct wlan_objmgr_vdev *vdev,
struct vdev_create_params *param);
QDF_STATUS (*vdev_start_send)(struct wlan_objmgr_vdev *vdev,

View File

@@ -50,8 +50,6 @@ static QDF_STATUS tgt_vdev_mgr_start_response_handler(
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct vdev_mlme_obj *vdev_mlme;
struct wlan_objmgr_vdev *vdev;
struct vdev_response_timer *vdev_rsp;
struct wlan_lmac_if_mlme_tx_ops *tx_ops;
if (!rsp || !psoc) {
mlme_err("Invalid input");
@@ -71,23 +69,11 @@ static QDF_STATUS tgt_vdev_mgr_start_response_handler(
goto tgt_vdev_mgr_start_response_handler_end;
}
vdev_rsp = &vdev_mlme->vdev_rt;
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
if (rsp->resp_type == RESTART_RESPONSE)
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
RESTART_RESPONSE_BIT);
else
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
START_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
goto tgt_vdev_mgr_start_response_handler_end;
}
if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_ext_start_rsp)
status = vdev_mlme->ops->mlme_vdev_ext_start_rsp(
vdev_mlme,
rsp);
tgt_vdev_mgr_start_response_handler_end:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return status;
@@ -100,8 +86,6 @@ static QDF_STATUS tgt_vdev_mgr_stop_response_handler(
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct vdev_mlme_obj *vdev_mlme;
struct wlan_objmgr_vdev *vdev;
struct vdev_response_timer *vdev_rsp;
struct wlan_lmac_if_mlme_tx_ops *tx_ops;
if (!rsp || !psoc) {
mlme_err("Invalid input");
@@ -121,19 +105,11 @@ static QDF_STATUS tgt_vdev_mgr_stop_response_handler(
goto tgt_vdev_mgr_stop_response_handler_end;
}
vdev_rsp = &vdev_mlme->vdev_rt;
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
STOP_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
goto tgt_vdev_mgr_stop_response_handler_end;
}
if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_ext_stop_rsp)
status = vdev_mlme->ops->mlme_vdev_ext_stop_rsp(
vdev_mlme,
rsp);
tgt_vdev_mgr_stop_response_handler_end:
wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
return status;
@@ -146,8 +122,6 @@ static QDF_STATUS tgt_vdev_mgr_delete_response_handler(
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct vdev_mlme_obj *vdev_mlme;
struct wlan_objmgr_vdev *vdev;
struct vdev_response_timer *vdev_rsp;
struct wlan_lmac_if_mlme_tx_ops *tx_ops;
if (!rsp || !psoc) {
mlme_err("Invalid input");
@@ -168,15 +142,6 @@ static QDF_STATUS tgt_vdev_mgr_delete_response_handler(
goto tgt_vdev_mgr_delete_response_handler_end;
}
vdev_rsp = &vdev_mlme->vdev_rt;
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
DELETE_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
goto tgt_vdev_mgr_delete_response_handler_end;
}
if ((vdev_mlme->ops) &&
vdev_mlme->ops->mlme_vdev_ext_delete_rsp)
status = vdev_mlme->ops->mlme_vdev_ext_delete_rsp(
@@ -195,8 +160,6 @@ static QDF_STATUS tgt_vdev_mgr_peer_delete_all_response_handler(
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct vdev_mlme_obj *vdev_mlme;
struct wlan_objmgr_vdev *vdev;
struct vdev_response_timer *vdev_rsp;
struct wlan_lmac_if_mlme_tx_ops *tx_ops;
if (!rsp || !psoc) {
mlme_err("Invalid input");
@@ -217,15 +180,6 @@ static QDF_STATUS tgt_vdev_mgr_peer_delete_all_response_handler(
goto tgt_vdev_mgr_peer_delete_all_response_handler_end;
}
vdev_rsp = &vdev_mlme->vdev_rt;
tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
PEER_DELETE_ALL_RESPONSE_BIT);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
goto tgt_vdev_mgr_peer_delete_all_response_handler_end;
}
if ((vdev_mlme->ops) &&
vdev_mlme->ops->mlme_vdev_ext_peer_delete_all_rsp)
status = vdev_mlme->ops->mlme_vdev_ext_peer_delete_all_rsp(