qcacmn: Add support for TWT disable operation
Add support for TWT disable operation. Change-Id: I302ac6a3898f53ea25030d9a15d8d14988287b27 CRs-Fixed: 3085373
This commit is contained in:

committed by
Madan Koyyalamudi

父節點
2d0aea5c1d
當前提交
fd35443a0a
@@ -249,7 +249,29 @@ wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req,
|
||||
void *context)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct twt_psoc_priv_obj *twt_psoc;
|
||||
|
||||
if (!psoc) {
|
||||
twt_err("null psoc");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_TWT);
|
||||
if (!twt_psoc) {
|
||||
twt_err("null twt psoc priv obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_psoc->disable_context.twt_role = TWT_ROLE_REQUESTOR;
|
||||
twt_psoc->disable_context.context = context;
|
||||
|
||||
req->twt_role = TWT_ROLE_REQUESTOR;
|
||||
|
||||
twt_debug("TWT req disable: pdev_id:%d role:%d ext:%d",
|
||||
req->pdev_id, req->twt_role, req->ext_conf_present);
|
||||
|
||||
return tgt_twt_disable_req_send(psoc, req);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
@@ -257,7 +279,29 @@ wlan_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req,
|
||||
void *context)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct twt_psoc_priv_obj *twt_psoc;
|
||||
|
||||
if (!psoc) {
|
||||
twt_err("null psoc");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_TWT);
|
||||
if (!twt_psoc) {
|
||||
twt_err("null twt psoc priv obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_psoc->disable_context.twt_role = TWT_ROLE_RESPONDER;
|
||||
twt_psoc->disable_context.context = context;
|
||||
|
||||
req->twt_role = TWT_ROLE_RESPONDER;
|
||||
|
||||
twt_debug("TWT res disable: pdev_id:%d role:%d ext:%d",
|
||||
req->pdev_id, req->twt_role, req->ext_conf_present);
|
||||
|
||||
return tgt_twt_disable_req_send(psoc, req);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
@@ -399,6 +443,42 @@ QDF_STATUS
|
||||
wlan_twt_disable_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct twt_psoc_priv_obj *twt_psoc;
|
||||
struct twt_en_dis_context *twt_context;
|
||||
|
||||
if (!psoc) {
|
||||
twt_err("null psoc");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_TWT);
|
||||
if (!twt_psoc) {
|
||||
twt_err("null twt psoc priv obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
twt_context = &twt_psoc->disable_context;
|
||||
|
||||
twt_debug("pdev_id:%d status:%d twt_role:%d",
|
||||
event->pdev_id, event->status, twt_context->twt_role);
|
||||
switch (event->status) {
|
||||
case HOST_TWT_DISABLE_STATUS_OK:
|
||||
if (twt_context->twt_role == TWT_ROLE_REQUESTOR)
|
||||
wlan_twt_cfg_set_requestor_flag(psoc, false);
|
||||
else if (twt_context->twt_role == TWT_ROLE_RESPONDER)
|
||||
wlan_twt_cfg_set_responder_flag(psoc, false);
|
||||
else
|
||||
twt_err("Invalid role:%d", twt_context->twt_role);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
twt_err("twt disable status:%d", event->status);
|
||||
break;
|
||||
}
|
||||
|
||||
return mlme_twt_osif_disable_complete_ind(psoc, event,
|
||||
twt_context->context);
|
||||
}
|
||||
|
||||
|
@@ -130,7 +130,7 @@ QDF_STATUS wlan_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t dialog_id);
|
||||
|
||||
/**
|
||||
* wlan_twt_disable() - twt disable
|
||||
* wlan_twt_requestor_disable() - twt requestor disable
|
||||
* @psoc: psoc handle
|
||||
* @req: twt disable request structure
|
||||
* @context: context
|
||||
@@ -138,9 +138,22 @@ QDF_STATUS wlan_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
|
||||
* return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_twt_disable(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req,
|
||||
void *context);
|
||||
wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_responder_disable() - twt responder disable
|
||||
* @psoc: psoc handle
|
||||
* @req: twt disable request structure
|
||||
* @context: context
|
||||
*
|
||||
* return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_requestor_enable() - twt requestor enable
|
||||
|
@@ -38,7 +38,7 @@ static QDF_STATUS
|
||||
tgt_twt_disable_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
return wlan_twt_disable_event_handler(psoc, event);
|
||||
}
|
||||
|
||||
void tgt_twt_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
|
@@ -64,5 +64,30 @@ QDF_STATUS
|
||||
tgt_twt_disable_req_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_disable_param *req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct wlan_lmac_if_twt_tx_ops *tx_ops;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!psoc) {
|
||||
twt_err("null psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!req) {
|
||||
twt_err("Invalid input");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops = wlan_twt_get_tx_ops(psoc);
|
||||
if (!tx_ops || !tx_ops->disable_req) {
|
||||
twt_err("twt disable_req tx_ops is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = tx_ops->disable_req(psoc, req);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
twt_err("tx_ops disable_req failed (status=%d)", status);
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user