qcacld-3.0: Add TWT nudge support to componentization
In TWT component, add support for TWT nudge command i.e when host wants to suspend the TWT session. Change-Id: I176fdaf0f2ccc2d0656f9108484fc80b409268ef CRs-Fixed: 3085999
Dieser Commit ist enthalten in:

committet von
Madan Koyyalamudi

Ursprung
82b323d139
Commit
8d529074a0
@@ -1319,6 +1319,52 @@ QDF_STATUS wlan_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_twt_nudge_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_cmd_param *req,
|
||||
void *context)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
bool cmd_in_progress;
|
||||
bool setup_done;
|
||||
enum wlan_twt_commands active_cmd = WLAN_TWT_NONE;
|
||||
|
||||
status = wlan_twt_check_all_twt_support(psoc, req->dialog_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
twt_err("All TWT sessions not supported by target");
|
||||
return status;
|
||||
}
|
||||
|
||||
setup_done = wlan_twt_is_setup_done(psoc, &req->peer_macaddr,
|
||||
req->dialog_id);
|
||||
if (!setup_done) {
|
||||
twt_err("TWT setup is not complete for dialog_id:%d",
|
||||
req->dialog_id);
|
||||
return QDF_STATUS_E_AGAIN;
|
||||
}
|
||||
|
||||
cmd_in_progress = wlan_twt_is_command_in_progress(psoc,
|
||||
&req->peer_macaddr, req->dialog_id,
|
||||
WLAN_TWT_ANY, &active_cmd);
|
||||
if (cmd_in_progress) {
|
||||
twt_debug("Already TWT command:%d is in progress", active_cmd);
|
||||
return QDF_STATUS_E_PENDING;
|
||||
}
|
||||
|
||||
wlan_twt_set_command_in_progress(psoc, &req->peer_macaddr,
|
||||
req->dialog_id, WLAN_TWT_NUDGE);
|
||||
wlan_twt_set_ack_context(psoc, &req->peer_macaddr, req->dialog_id,
|
||||
context);
|
||||
|
||||
status = tgt_twt_nudge_req_send(psoc, req);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
twt_err("tgt_twt_nudge_req_send failed (status=%d)", status);
|
||||
wlan_twt_set_command_in_progress(psoc, &req->peer_macaddr,
|
||||
req->dialog_id, WLAN_TWT_NONE);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_twt_sap_teardown_req() - sap TWT teardown request
|
||||
* @psoc: Pointer to psoc object
|
||||
@@ -1908,7 +1954,63 @@ QDF_STATUS
|
||||
wlan_twt_nudge_complete_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
bool is_evt_allowed;
|
||||
enum HOST_TWT_NUDGE_STATUS status = event->status;
|
||||
enum QDF_OPMODE opmode;
|
||||
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
||||
enum wlan_twt_commands active_cmd = WLAN_TWT_NONE;
|
||||
uint32_t pdev_id, vdev_id;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
|
||||
vdev_id = event->vdev_id;
|
||||
pdev_id = wlan_get_pdev_id_from_vdev_id(psoc, vdev_id, WLAN_TWT_ID);
|
||||
if (pdev_id == WLAN_INVALID_PDEV_ID) {
|
||||
twt_err("Invalid pdev id");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, WLAN_TWT_ID);
|
||||
if (!pdev) {
|
||||
twt_err("Invalid pdev");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
opmode = wlan_get_opmode_from_vdev_id(pdev, vdev_id);
|
||||
|
||||
switch (opmode) {
|
||||
case QDF_SAP_MODE:
|
||||
qdf_status = mlme_twt_osif_nudge_complete_ind(psoc, event);
|
||||
break;
|
||||
case QDF_STA_MODE:
|
||||
is_evt_allowed = wlan_twt_is_command_in_progress(
|
||||
psoc,
|
||||
&event->peer_macaddr,
|
||||
event->dialog_id,
|
||||
WLAN_TWT_NUDGE, &active_cmd);
|
||||
|
||||
if (!is_evt_allowed &&
|
||||
event->dialog_id != TWT_ALL_SESSIONS_DIALOG_ID) {
|
||||
twt_debug("Drop TWT nudge dialog event for dialog_id:%d status:%d active_cmd:%d",
|
||||
event->dialog_id, status,
|
||||
active_cmd);
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
mlme_twt_osif_nudge_complete_ind(psoc, event);
|
||||
qdf_status = wlan_twt_set_command_in_progress(psoc,
|
||||
&event->peer_macaddr,
|
||||
event->dialog_id, WLAN_TWT_NONE);
|
||||
break;
|
||||
default:
|
||||
twt_debug("TWT nudge is not supported on %s",
|
||||
qdf_opmode_str(opmode));
|
||||
break;
|
||||
}
|
||||
|
||||
fail:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_TWT_ID);
|
||||
return qdf_status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -103,6 +103,19 @@ wlan_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_nudge_req() - Process TWT nudge req
|
||||
* @psoc: psoc
|
||||
* @req: nudge dialog cmd param
|
||||
* @context: context
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_twt_nudge_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_cmd_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_is_setup_in_progress() - Get if TWT setup command is in progress
|
||||
* for given dialog id
|
||||
|
@@ -111,6 +111,21 @@ QDF_STATUS ucfg_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *params,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ucfg_twt_nudge_req() - Process TWT nudge req
|
||||
* @psoc: psoc
|
||||
* @params: nudge dialog cmd param
|
||||
* @context: context
|
||||
*
|
||||
* Perform validations and set WLAN_TWT_NUDGE
|
||||
* in progress
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_twt_nudge_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_cmd_param *params,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ucfg_twt_is_max_sessions_reached() - Check if the maximum number of
|
||||
* TWT sessions reached or not excluding the given dialog_id
|
||||
|
@@ -58,7 +58,7 @@ static QDF_STATUS
|
||||
tgt_twt_nudge_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
return wlan_twt_nudge_complete_event_handler(psoc, event);
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
|
@@ -148,6 +148,28 @@ QDF_STATUS
|
||||
tgt_twt_nudge_req_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_cmd_param *req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct wlan_lmac_if_twt_tx_ops *tx_ops;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!psoc) {
|
||||
twt_err("psoc is null");
|
||||
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->nudge_req) {
|
||||
twt_err("nudge tx_ops is null");
|
||||
status = QDF_STATUS_E_NULL_VALUE;
|
||||
return status;
|
||||
}
|
||||
|
||||
status = tx_ops->nudge_req(psoc, req);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@@ -78,6 +78,14 @@ ucfg_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
return wlan_twt_resume_req(psoc, params, context);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_twt_nudge_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_nudge_dialog_cmd_param *params,
|
||||
void *context)
|
||||
{
|
||||
return wlan_twt_nudge_req(psoc, params, context);
|
||||
}
|
||||
|
||||
bool ucfg_twt_is_max_sessions_reached(struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac,
|
||||
uint8_t dialog_id)
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren