qcacmn: Add support for mlo groups in mlo setup and teardown

Add support for mlo groups in mlo soc/link setup and teardown
sequence participating in mlo.

Change-Id: I2b431b0ee1e5816b92ad183b52ad2998eb5bb46c
CRs-Fixed: 3343170
Этот коммит содержится в:
Surya Prakash Raajen
2022-12-14 15:25:05 +05:30
коммит произвёл Madan Koyyalamudi
родитель aaf04d8bc5
Коммит 0fdd53b791
12 изменённых файлов: 828 добавлений и 213 удалений

Просмотреть файл

@@ -724,16 +724,44 @@ static bool init_deinit_mlo_capable(struct wlan_objmgr_psoc *psoc)
return false;
}
static bool init_deinit_mlo_get_group_id(struct wlan_objmgr_psoc *psoc,
uint8_t *grp_id)
{
struct target_psoc_info *tgt_hdl;
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
return false;
}
if ((tgt_hdl->tif_ops) &&
(tgt_hdl->tif_ops->mlo_get_group_id)) {
*grp_id = tgt_hdl->tif_ops->mlo_get_group_id(psoc);
return true;
}
return false;
}
static void init_deinit_mlo_update_soc_ready(struct wlan_objmgr_psoc *psoc)
{
if (init_deinit_mlo_capable(psoc))
mlo_setup_update_soc_ready(psoc);
uint8_t grp_id = 0;
if (init_deinit_mlo_capable(psoc)) {
if (!init_deinit_mlo_get_group_id(psoc, &grp_id)) {
target_if_err("Invalid MLD group id");
return;
}
mlo_setup_update_soc_ready(psoc, grp_id);
}
}
static void init_deinit_send_ml_link_ready(struct wlan_objmgr_psoc *psoc,
void *object, void *arg)
{
struct wlan_objmgr_pdev *pdev = object;
uint8_t grp_id = 0;
if (!init_deinit_mlo_capable(psoc))
return;
@@ -741,7 +769,10 @@ static void init_deinit_send_ml_link_ready(struct wlan_objmgr_psoc *psoc,
qdf_assert_always(psoc);
qdf_assert_always(pdev);
mlo_setup_link_ready(pdev);
if (!init_deinit_mlo_get_group_id(psoc, &grp_id))
qdf_assert_always(grp_id);
mlo_setup_link_ready(pdev, grp_id);
}
static void init_deinit_mlo_update_pdev_ready(struct wlan_objmgr_psoc *psoc,
@@ -1043,6 +1074,7 @@ static int init_deinit_mlo_setup_comp_event_handler(ol_scn_t scn_handle,
struct target_psoc_info *tgt_hdl;
struct wmi_unified *wmi_handle;
struct wmi_mlo_setup_complete_params params;
uint8_t grp_id = 0;
if (!scn_handle) {
target_if_err("scn handle NULL");
@@ -1050,16 +1082,24 @@ static int init_deinit_mlo_setup_comp_event_handler(ol_scn_t scn_handle,
}
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
if (!psoc) {
target_if_err("psoc is null");
return -EINVAL;
}
if (!init_deinit_mlo_get_group_id(psoc, &grp_id)) {
target_if_err("Invalid MLD group id");
return -EINVAL;
}
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
return -EINVAL;
}
wmi_handle = target_psoc_get_wmi_hdl(tgt_hdl);
if (wmi_extract_mlo_setup_cmpl_event(wmi_handle, event, &params) !=
@@ -1068,8 +1108,9 @@ static int init_deinit_mlo_setup_comp_event_handler(ol_scn_t scn_handle,
pdev = wlan_objmgr_get_pdev_by_id(psoc, params.pdev_id,
WLAN_INIT_DEINIT_ID);
if (pdev) {
mlo_link_setup_complete(pdev);
mlo_link_setup_complete(pdev, grp_id);
wlan_objmgr_pdev_release_ref(pdev, WLAN_INIT_DEINIT_ID);
}
@@ -1087,6 +1128,7 @@ static int init_deinit_mlo_teardown_comp_event_handler(ol_scn_t scn_handle,
struct target_psoc_info *tgt_hdl;
struct wmi_unified *wmi_handle;
struct wmi_mlo_teardown_cmpl_params params;
uint8_t grp_id = 0;
if (!scn_handle) {
target_if_err("scn handle NULL");
@@ -1099,6 +1141,11 @@ static int init_deinit_mlo_teardown_comp_event_handler(ol_scn_t scn_handle,
return -EINVAL;
}
if (!init_deinit_mlo_get_group_id(psoc, &grp_id)) {
target_if_err("Invalid MLD group id");
return -EINVAL;
}
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
@@ -1113,7 +1160,7 @@ static int init_deinit_mlo_teardown_comp_event_handler(ol_scn_t scn_handle,
pdev = wlan_objmgr_get_pdev_by_id(psoc, params.pdev_id,
WLAN_INIT_DEINIT_ID);
if (pdev) {
mlo_link_teardown_complete(pdev);
mlo_link_teardown_complete(pdev, grp_id);
wlan_objmgr_pdev_release_ref(pdev, WLAN_INIT_DEINIT_ID);
}