qcacld-3.0: Add TWT resume support to componentization
Add TWT resume support to componentization. Change-Id: I3e6d81591e9a7739050445e4a67d81626febf68f CRs-Fixed: 3085995
このコミットが含まれているのは:
@@ -73,7 +73,15 @@ QDF_STATUS
|
||||
target_if_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
return wmi_unified_twt_resume_dialog_cmd(wmi_handle, req);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -190,11 +190,62 @@ done:
|
||||
return qdf_status_to_os_return(qdf_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_twt_resume_dialog_complete_event_handler - TWT resume dlg
|
||||
* complete evt handler
|
||||
* @scn: scn
|
||||
* @event: buffer with event
|
||||
* @len: buffer length
|
||||
*
|
||||
* Return: 0 on success, negative value on failure
|
||||
*/
|
||||
static int
|
||||
target_if_twt_resume_complete_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct twt_resume_dialog_complete_event_param *param;
|
||||
struct wlan_lmac_if_twt_rx_ops *twt_rx_ops;
|
||||
|
||||
TARGET_IF_ENTER();
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
twt_rx_ops = wlan_twt_get_rx_ops(psoc);
|
||||
if (!twt_rx_ops || !twt_rx_ops->twt_resume_comp_cb) {
|
||||
target_if_err("No valid twt resume complete rx ops");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
param = qdf_mem_malloc(sizeof(*param));
|
||||
if (!param)
|
||||
return -ENOMEM;
|
||||
|
||||
qdf_status = wmi_extract_twt_resume_dialog_comp_event(wmi_handle,
|
||||
event, param);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("extract twt resume event failed (status=%d)",
|
||||
qdf_status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
qdf_status = twt_rx_ops->twt_resume_comp_cb(psoc, param);
|
||||
|
||||
done:
|
||||
qdf_mem_free(param);
|
||||
return qdf_status_to_os_return(qdf_status);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@@ -1272,6 +1272,53 @@ QDF_STATUS wlan_twt_pause_req(struct wlan_objmgr_psoc *psoc,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *req,
|
||||
void *context)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
bool cmd_in_progress;
|
||||
bool is_twt_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;
|
||||
}
|
||||
|
||||
is_twt_setup_done = wlan_twt_is_setup_done(psoc, &req->peer_macaddr,
|
||||
req->dialog_id);
|
||||
if (!is_twt_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_RESUME);
|
||||
wlan_twt_set_ack_context(psoc, &req->peer_macaddr,
|
||||
req->dialog_id, context);
|
||||
|
||||
status = tgt_twt_resume_req_send(psoc, req);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
twt_err("tgt_twt_resume_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
|
||||
@@ -1811,7 +1858,50 @@ QDF_STATUS
|
||||
wlan_twt_resume_complete_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
enum QDF_OPMODE opmode;
|
||||
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
||||
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_resume_complete_ind(psoc, event);
|
||||
break;
|
||||
case QDF_STA_MODE:
|
||||
qdf_status = mlme_twt_osif_resume_complete_ind(psoc, event);
|
||||
|
||||
wlan_twt_set_session_state(psoc, &event->peer_macaddr,
|
||||
event->dialog_id,
|
||||
WLAN_TWT_SETUP_STATE_ACTIVE);
|
||||
|
||||
qdf_status = wlan_twt_set_command_in_progress(psoc,
|
||||
&event->peer_macaddr,
|
||||
event->dialog_id,
|
||||
WLAN_TWT_NONE);
|
||||
break;
|
||||
default:
|
||||
twt_debug("TWT Resume is not supported on %s",
|
||||
qdf_opmode_str(opmode));
|
||||
break;
|
||||
}
|
||||
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_TWT_ID);
|
||||
return qdf_status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -90,6 +90,19 @@ wlan_twt_pause_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_pause_dialog_cmd_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_resume_req() - Process TWT resume req
|
||||
* @psoc: psoc
|
||||
* @req: resume dialog cmd param
|
||||
* @context: context
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *req,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* wlan_twt_is_setup_in_progress() - Get if TWT setup command is in progress
|
||||
* for given dialog id
|
||||
|
@@ -96,6 +96,21 @@ QDF_STATUS ucfg_twt_pause_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_pause_dialog_cmd_param *params,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ucfg_twt_resume_req() - Process TWT resume req
|
||||
* @psoc: psoc
|
||||
* @params: resume dialog cmd param
|
||||
* @context: context
|
||||
*
|
||||
* Perform validations and set WLAN_TWT_RESUME
|
||||
* in progress
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_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
|
||||
@@ -239,6 +254,14 @@ QDF_STATUS ucfg_twt_pause_req(struct wlan_objmgr_psoc *psoc,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS ucfg_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *params,
|
||||
void *context)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
ucfg_twt_init_context(struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac,
|
||||
|
@@ -51,7 +51,7 @@ static QDF_STATUS
|
||||
tgt_twt_resume_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_complete_event_param *event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
return wlan_twt_resume_complete_event_handler(psoc, event);
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
|
@@ -119,7 +119,29 @@ QDF_STATUS
|
||||
tgt_twt_resume_req_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_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->resume_req) {
|
||||
twt_err("resume tx_ops is null");
|
||||
status = QDF_STATUS_E_NULL_VALUE;
|
||||
return status;
|
||||
}
|
||||
|
||||
status = tx_ops->resume_req(psoc, req);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -70,6 +70,14 @@ ucfg_twt_pause_req(struct wlan_objmgr_psoc *psoc,
|
||||
return wlan_twt_pause_req(psoc, params, context);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_twt_resume_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct twt_resume_dialog_cmd_param *params,
|
||||
void *context)
|
||||
{
|
||||
return wlan_twt_resume_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)
|
||||
|
新しいイシューから参照
ユーザーをブロックする