diff --git a/umac/mlo_mgr/inc/wlan_mlo_t2lm.h b/umac/mlo_mgr/inc/wlan_mlo_t2lm.h index 1cac7a6d49..2d339ca793 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_t2lm.h +++ b/umac/mlo_mgr/inc/wlan_mlo_t2lm.h @@ -364,13 +364,14 @@ struct wlan_mlo_dev_context; /** * typedef wlan_mlo_t2lm_link_update_handler - T2LM handler API to notify the * link update. - * @mldev: Pointer to mlo_dev_context - * @arg: ieee_link_map + * @vdev: Pointer to vdev context + * @t2lm: Pointer to wlan_t2lm_info * * Return: QDF_STATUS */ typedef QDF_STATUS (*wlan_mlo_t2lm_link_update_handler)( - struct wlan_mlo_dev_context *mldev, void *arg); + struct wlan_objmgr_vdev *vdev, + struct wlan_t2lm_info *t2lm); /** * struct wlan_t2lm_context - T2LM IE information @@ -532,12 +533,14 @@ void wlan_unregister_t2lm_link_update_notify_handler( /** * wlan_mlo_dev_t2lm_notify_link_update() - API to call the registered handlers * when there is a link update happens using T2LM - * @mldev: Pointer to mlo context + * @vdev: Pointer to vdev + * @t2lm: Pointer to T2LM info * * Return: QDF_STATUS */ QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update( - struct wlan_mlo_dev_context *mldev); + struct wlan_objmgr_vdev *vdev, + struct wlan_t2lm_info *t2lm); /** * wlan_mlo_parse_t2lm_ie() - API to parse the T2LM IE @@ -845,7 +848,8 @@ void wlan_unregister_t2lm_link_update_notify_handler( } static inline QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update( - struct wlan_mlo_dev_context *mldev) + struct wlan_objmgr_vdev *vdev, + struct wlan_t2lm_info *t2lm) { return QDF_STATUS_SUCCESS; } diff --git a/umac/mlo_mgr/src/wlan_mlo_t2lm.c b/umac/mlo_mgr/src/wlan_mlo_t2lm.c index 7550224f30..5600d0f63d 100644 --- a/umac/mlo_mgr/src/wlan_mlo_t2lm.c +++ b/umac/mlo_mgr/src/wlan_mlo_t2lm.c @@ -637,9 +637,6 @@ static void wlan_mlo_t2lm_handle_mapping_switch_time_expiry( qdf_mem_zero(&t2lm_ctx->upcoming_t2lm, sizeof(struct wlan_mlo_t2lm_ie)); t2lm_ctx->upcoming_t2lm.t2lm.direction = WLAN_T2LM_INVALID_DIRECTION; - - /* Notify the registered caller about the link update*/ - wlan_mlo_dev_t2lm_notify_link_update(vdev->mlo_dev_ctx); } /** @@ -679,9 +676,6 @@ static void wlan_mlo_t2lm_handle_expected_duration_expiry( t2lm_ctx->established_t2lm.disabled_link_bitmap = 0; t2lm_ctx->established_t2lm.t2lm.link_mapping_size = 0; t2lm_debug("Set established mapping to default mapping"); - - /* Notify the registered caller about the link update*/ - wlan_mlo_dev_t2lm_notify_link_update(vdev->mlo_dev_ctx); } QDF_STATUS wlan_mlo_vdev_tid_to_link_map_event( @@ -734,9 +728,17 @@ QDF_STATUS wlan_mlo_vdev_tid_to_link_map_event( case WLAN_MAP_SWITCH_TIMER_EXPIRED: vdev_mlme->proto.ap.mapping_switch_time = 0; wlan_mlo_t2lm_handle_mapping_switch_time_expiry(t2lm_ctx, vdev); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev, + &t2lm_ctx->established_t2lm.t2lm); break; case WLAN_EXPECTED_DUR_EXPIRED: wlan_mlo_t2lm_handle_expected_duration_expiry(t2lm_ctx, vdev); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev, + &t2lm_ctx->established_t2lm.t2lm); break; default: t2lm_err("Invalid status"); @@ -953,6 +955,9 @@ wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev, if (t2lm_info && t2lm_info->direction != WLAN_T2LM_INVALID_DIRECTION) { t2lm_debug("send peer-level mapping to FW for dir: %d", dir); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev, t2lm_info); status = wlan_send_tid_to_link_mapping(vdev, t2lm_info); idx++; } @@ -985,15 +990,22 @@ void wlan_mlo_t2lm_timer_expiry_handler(void *vdev) */ if (t2lm_ctx->established_t2lm.t2lm.expected_duration_present) { wlan_mlo_t2lm_handle_expected_duration_expiry(t2lm_ctx, vdev); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev_ctx, + &t2lm_ctx->established_t2lm.t2lm); wlan_send_tid_to_link_mapping( vdev, &t2lm_ctx->established_t2lm.t2lm); wlan_handle_t2lm_timer(vdev_ctx); } else if (t2lm_ctx->upcoming_t2lm.t2lm.mapping_switch_time_present) { wlan_mlo_t2lm_handle_mapping_switch_time_expiry(t2lm_ctx, vdev); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev_ctx, + &t2lm_ctx->established_t2lm.t2lm); wlan_send_tid_to_link_mapping( vdev, &t2lm_ctx->established_t2lm.t2lm); - wlan_handle_t2lm_timer(vdev_ctx); } @@ -1186,6 +1198,10 @@ static QDF_STATUS wlan_update_mapping_switch_time_expected_dur( qdf_mem_copy(&t2lm_ctx->established_t2lm.t2lm, &rx_t2lm->established_t2lm.t2lm, sizeof(struct wlan_t2lm_info)); + + /* Notify the registered caller about the link update*/ + wlan_mlo_dev_t2lm_notify_link_update(vdev, + &t2lm_ctx->established_t2lm.t2lm); wlan_send_tid_to_link_mapping( vdev, &t2lm_ctx->established_t2lm.t2lm); } @@ -1291,12 +1307,27 @@ void wlan_unregister_t2lm_link_update_notify_handler( } QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update( - struct wlan_mlo_dev_context *mldev) + struct wlan_objmgr_vdev *vdev, + struct wlan_t2lm_info *t2lm) { - struct wlan_t2lm_context *t2lm_ctx = &mldev->t2lm_ctx; + struct wlan_t2lm_context *t2lm_ctx; wlan_mlo_t2lm_link_update_handler handler; int i; + if (!vdev || !vdev->mlo_dev_ctx) + return QDF_STATUS_E_FAILURE; + + if (!wlan_cm_is_vdev_connected(vdev)) { + t2lm_err("Not associated!"); + return QDF_STATUS_E_AGAIN; + } + + if (!wlan_vdev_mlme_is_mlo_vdev(vdev)) { + t2lm_err("failed due to non-ML connection"); + return QDF_STATUS_E_INVAL; + } + + t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx; for (i = 0; i < MAX_T2LM_HANDLERS; i++) { if (!t2lm_ctx->is_valid_handler[i]) continue; @@ -1305,8 +1336,7 @@ QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update( if (!handler) continue; - handler(mldev, - &t2lm_ctx->established_t2lm.t2lm.ieee_link_map_tid[0]); + handler(vdev, t2lm); } return QDF_STATUS_SUCCESS; }