qcacmn: Add r-twt related changes

Add changes to read R-TWT svc bit from FW and update capabilities on
host accordingly. Update add twt session command to include new
params required for R-TWT.

Change-Id: I91cea65ef737b6fa445cb3680dac15e0f1063446
CRs-Fixed: 3399205
This commit is contained in:
Kiran Venkatappa
2023-01-09 16:24:37 +05:30
committed by Madan Koyyalamudi
parent f518df0727
commit 7260b2db76
12 changed files with 93 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -230,6 +230,11 @@ target_if_twt_fill_tgt_caps(struct wlan_objmgr_psoc *psoc,
else
caps->twt_stats_enabled = false;
if (wmi_service_enabled(wmi_handle, wmi_service_restricted_twt))
caps->restricted_twt_support = true;
else
caps->restricted_twt_support = false;
target_if_debug("req:%d res:%d legacy_bcast_twt_support:%d",
caps->twt_requestor,
caps->twt_responder,
@@ -241,6 +246,8 @@ target_if_twt_fill_tgt_caps(struct wlan_objmgr_psoc *psoc,
caps->twt_nudge_enabled,
caps->all_twt_enabled,
caps->twt_stats_enabled);
target_if_debug("restricted_twt_support:%d",
caps->restricted_twt_support);
return QDF_STATUS_SUCCESS;
}

View File

@@ -250,6 +250,9 @@
/* Delete all vdev peer support */
#define WLAN_VDEV_DELETE_ALL_PEER_SUPPORT 0x00000040
/* Restricted TWT */
#define WLAN_SOC_F_RESTRICTED_TWT 0x00000080
/* PSOC op flags */
/* Invalid VHT cap */

View File

@@ -179,6 +179,28 @@ wlan_twt_tgt_caps_get_ack_supported(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_twt_tgt_caps_get_restricted_support(struct wlan_objmgr_psoc *psoc,
bool *val)
{
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;
}
*val = twt_psoc->twt_caps.restricted_twt_support;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
struct twt_disable_param *req,

View File

@@ -209,3 +209,15 @@ wlan_twt_enable_event_handler(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
wlan_twt_disable_event_handler(struct wlan_objmgr_psoc *psoc,
struct twt_disable_complete_event_param *event);
/**
* wlan_twt_tgt_caps_get_restricted_support() - Get tgt restricted-twt
* support caps
* @psoc: psoc handle
* @val: pointer to get caps enabled/disabled
*
* return: QDF_STATUS
*/
QDF_STATUS
wlan_twt_tgt_caps_get_restricted_support(struct wlan_objmgr_psoc *psoc,
bool *val);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -41,6 +41,7 @@
* @all_twt_enabled: all twt enabled
* @twt_stats_enabled: twt stats enabled
* @twt_ack_supported: twt ack supported
* @restricted_twt_support: Restricted TWT supported
*/
struct twt_tgt_caps {
bool twt_requestor;
@@ -52,6 +53,7 @@ struct twt_tgt_caps {
bool all_twt_enabled;
bool twt_stats_enabled;
bool twt_ack_supported;
bool restricted_twt_support;
};
/**

View File

@@ -152,6 +152,7 @@ enum TWT_OPERATION {
* @b_twt_enable: Enable or disable broadcast TWT.
* @b_twt_legacy_mbss_enable: Enable or disable legacy MBSSID TWT.
* @b_twt_ax_mbss_enable: Enable or disable 11AX MBSSID TWT.
* @r_twt_enable: Restricted TWT enable or disable.
*/
struct twt_enable_param {
uint32_t pdev_id;
@@ -177,6 +178,7 @@ struct twt_enable_param {
uint32_t b_twt_enable:1,
b_twt_legacy_mbss_enable:1,
b_twt_ax_mbss_enable:1;
bool r_twt_enable;
};
/**
@@ -457,6 +459,9 @@ enum HOST_TWT_COMMAND {
* @b_twt_persistence: Countdown VAL frames to param update/teardown
* @wake_time_tsf: Absolute TSF value to start first TWT service period
* @announce_timeout_us: Timeout value before sending QoS NULL frame.
* @link_id_bitmap: MLD links to which R-TWT element applies
* @r_twt_dl_tid_bitmap: DL TIDs for R-TWT scheduling
* @r_twt_ul_tid_bitmap: UL TIDs for R-TWT scheduling
*/
struct twt_add_dialog_param {
uint32_t vdev_id;
@@ -482,6 +487,9 @@ struct twt_add_dialog_param {
b_twt_recommendation:3;
uint64_t wake_time_tsf;
uint32_t announce_timeout_us;
uint32_t link_id_bitmap;
uint32_t r_twt_dl_tid_bitmap;
uint32_t r_twt_ul_tid_bitmap;
};
/**

View File

@@ -302,4 +302,15 @@ QDF_STATUS
ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
struct qdf_mac_addr *peer_mac,
uint8_t *peer_cap);
/**
* ucfg_twt_get_restricted_twt_supported() - Get tgt restricted-twt
* support caps
* @psoc: psoc handle
* @val: pointer to get caps enabled/disabled
*
* return: QDF_STATUS
*/
QDF_STATUS ucfg_twt_get_restricted_twt_supported(struct wlan_objmgr_psoc *psoc,
bool *val);
#endif /* _WLAN_TWT_UCFG_API_H_ */

View File

@@ -105,3 +105,9 @@ ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
{
return wlan_twt_get_peer_capabilities(psoc, peer_mac, peer_cap);
}
QDF_STATUS ucfg_twt_get_restricted_twt_supported(struct wlan_objmgr_psoc *psoc,
bool *val)
{
return wlan_twt_tgt_caps_get_restricted_support(psoc, val);
}

View File

@@ -6126,6 +6126,7 @@ typedef enum {
wmi_service_twt_nudge,
wmi_service_all_twt,
wmi_service_twt_statistics,
wmi_service_restricted_twt,
#endif
wmi_service_wapi_concurrency_supported,
wmi_service_sap_connected_d3_wow,

View File

@@ -90,6 +90,7 @@ enum WMI_TWT_OPERATION {
* @b_twt_enable: Enable or disable broadcast TWT.
* @b_twt_legacy_mbss_enable: Enable or disable legacy MBSSID TWT.
* @b_twt_ax_mbss_enable: Enable or disable 11AX MBSSID TWT.
* @r_twt_enable: Enable or disable restricted TWT.
*/
struct wmi_twt_enable_param {
uint32_t pdev_id;
@@ -115,6 +116,7 @@ struct wmi_twt_enable_param {
uint32_t b_twt_enable:1,
b_twt_legacy_mbss_enable:1,
b_twt_ax_mbss_enable:1;
bool r_twt_enable;
};
/* status code of enabling TWT
@@ -291,6 +293,10 @@ enum WMI_HOST_TWT_COMMAND {
* @b_twt_persistence: Countdown VAL frames to param update/teardown
* @wake_time_tsf: Absolute TSF value to start first TWT service period
* @announce_timeout_us: Timeout value before sending QoS NULL frame.
* @link_id_bitmap: MLD links to which R-TWT element applies
* @r_twt_dl_tid_bitmap: DL TIDs for R-TWT scheduling
* @r_twt_ul_tid_bitmap: UL TIDs for R-TWT scheduling
*
*/
struct wmi_twt_add_dialog_param {
uint32_t vdev_id;
@@ -316,6 +322,9 @@ struct wmi_twt_add_dialog_param {
b_twt_recommendation:3;
uint64_t wake_time_tsf;
uint32_t announce_timeout_us;
uint32_t link_id_bitmap;
uint32_t r_twt_dl_tid_bitmap;
uint32_t r_twt_ul_tid_bitmap;
};
/* enum - status code of Get stats TWT dialog

View File

@@ -21783,6 +21783,7 @@ static void populate_tlv_service(uint32_t *wmi_service)
WMI_SERVICE_TWT_ALL_DIALOG_ID;
wmi_service[wmi_service_twt_statistics] =
WMI_SERVICE_TWT_STATS;
wmi_service[wmi_service_restricted_twt] = WMI_SERVICE_RESTRICTED_TWT;
#endif
wmi_service[wmi_service_spectral_scan_disabled] =
WMI_SERVICE_SPECTRAL_SCAN_DISABLED;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -66,6 +66,7 @@ static QDF_STATUS send_twt_enable_cmd_tlv(wmi_unified_t wmi_handle,
cmd->remove_sta_slot_interval = params->remove_sta_slot_interval;
TWT_EN_DIS_FLAGS_SET_BTWT(cmd->flags, params->b_twt_enable);
TWT_EN_DIS_FLAGS_SET_B_R_TWT(cmd->flags, params->r_twt_enable);
TWT_EN_DIS_FLAGS_SET_L_MBSSID(cmd->flags,
params->b_twt_legacy_mbss_enable);
TWT_EN_DIS_FLAGS_SET_AX_MBSSID(cmd->flags,
@@ -198,6 +199,9 @@ send_twt_add_dialog_cmd_tlv(wmi_unified_t wmi_handle,
cmd->sp_start_tsf_lo = (uint32_t)(params->wake_time_tsf & 0xFFFFFFFF);
cmd->sp_start_tsf_hi = (uint32_t)(params->wake_time_tsf >> 32);
cmd->announce_timeout_us = params->announce_timeout_us;
cmd->link_id_bitmap = params->link_id_bitmap;
cmd->r_twt_dl_tid_bitmap = params->r_twt_dl_tid_bitmap;
cmd->r_twt_ul_tid_bitmap = params->r_twt_ul_tid_bitmap;
TWT_FLAGS_SET_CMD(cmd->flags, params->twt_cmd);
TWT_FLAGS_SET_BROADCAST(cmd->flags, params->flag_bcast);
TWT_FLAGS_SET_TRIGGER(cmd->flags, params->flag_trigger);
@@ -1255,6 +1259,7 @@ static QDF_STATUS send_twt_enable_cmd_tlv(wmi_unified_t wmi_handle,
cmd->remove_sta_slot_interval = params->remove_sta_slot_interval;
TWT_EN_DIS_FLAGS_SET_BTWT(cmd->flags, params->b_twt_enable);
TWT_EN_DIS_FLAGS_SET_B_R_TWT(cmd->flags, params->r_twt_enable);
TWT_EN_DIS_FLAGS_SET_L_MBSSID(cmd->flags,
params->b_twt_legacy_mbss_enable);
TWT_EN_DIS_FLAGS_SET_AX_MBSSID(cmd->flags,
@@ -1365,6 +1370,9 @@ send_twt_add_dialog_cmd_tlv(wmi_unified_t wmi_handle,
cmd->sp_start_tsf_lo = (uint32_t)(params->wake_time_tsf & 0xFFFFFFFF);
cmd->sp_start_tsf_hi = (uint32_t)(params->wake_time_tsf >> 32);
cmd->announce_timeout_us = params->announce_timeout_us;
cmd->link_id_bitmap = params->link_id_bitmap;
cmd->r_twt_dl_tid_bitmap = params->r_twt_dl_tid_bitmap;
cmd->r_twt_ul_tid_bitmap = params->r_twt_ul_tid_bitmap;
TWT_FLAGS_SET_CMD(cmd->flags, params->twt_cmd);
TWT_FLAGS_SET_BROADCAST(cmd->flags, params->flag_bcast);
TWT_FLAGS_SET_TRIGGER(cmd->flags, params->flag_trigger);