diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 27b42b519d..6c1e8f941c 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11800,6 +11800,67 @@ void wlan_hdd_save_sta_keep_alive_interval(struct hdd_adapter *adapter, adapter->keep_alive_interval = keep_alive_interval; } +#ifdef WLAN_FEATURE_11BE_MLO +/** + * hdd_ml_vdev_set_sta_keep_alive_interval() - Set STA KEEPALIVE interval for + * all connected ml vdev + * @vdev: Pointer to vdev + * @hdd_ctx: Pointer to hdd context + * @keep_alive_interval: KEEPALIVE interval + * + * Return: 0 on success, negative on failure + */ +static int hdd_ml_vdev_set_sta_keep_alive_interval( + struct wlan_objmgr_vdev *vdev, + struct hdd_context *hdd_ctx, + uint16_t keep_alive_interval) +{ + struct wlan_objmgr_vdev *ml_vdev; + uint8_t ml_vdev_id; + struct wlan_mlo_dev_context *mlo_dev_ctx; + struct wlan_hdd_link_info *link_info; + int status, i; + + mlo_dev_ctx = vdev->mlo_dev_ctx; + if (!mlo_dev_ctx) { + hdd_err("MLO dev context null"); + return -EINVAL; + } + + for (i = 0; i < WLAN_UMAC_MLO_MAX_VDEVS ; i++) { + ml_vdev = mlo_dev_ctx->wlan_vdev_list[i]; + if (!ml_vdev) + continue; + + ml_vdev_id = ml_vdev->vdev_objmgr.vdev_id; + link_info = hdd_get_link_info_by_vdev(hdd_ctx, ml_vdev_id); + if (!link_info) + continue; + + if (!hdd_is_vdev_in_conn_state(link_info)) { + hdd_debug("Vdev (id %d) not in connected/started state", + link_info->vdev_id); + continue; + } + + status = hdd_vdev_send_sta_keep_alive_interval(link_info, + hdd_ctx, + keep_alive_interval); + if (status) + return status; + } + + return 0; +} +#else +static inline int hdd_ml_vdev_set_sta_keep_alive_interval( + struct wlan_objmgr_vdev *vdev, + struct hdd_context *hdd_ctx, + uint16_t keep_alive_interval) +{ + return -EINVAL; +} +#endif /** * hdd_vdev_set_sta_keep_alive_interval() - Set sta keep alive interval * @link_info: Link info pointer. @@ -11815,6 +11876,7 @@ static int hdd_vdev_set_sta_keep_alive_interval( struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); enum QDF_OPMODE device_mode = link_info->adapter->device_mode; uint16_t keep_alive_interval; + struct wlan_objmgr_vdev *vdev = link_info->vdev; keep_alive_interval = nla_get_u16(attr); if (keep_alive_interval > STA_KEEPALIVE_INTERVAL_MAX || @@ -11840,8 +11902,13 @@ static int hdd_vdev_set_sta_keep_alive_interval( wlan_hdd_save_sta_keep_alive_interval(adapter, keep_alive_interval); - return hdd_vdev_send_sta_keep_alive_interval(link_info, hdd_ctx, - keep_alive_interval); + if (!wlan_vdev_mlme_is_mlo_vdev(vdev)) + return hdd_vdev_send_sta_keep_alive_interval(link_info, + hdd_ctx, + keep_alive_interval); + + return hdd_ml_vdev_set_sta_keep_alive_interval(vdev, hdd_ctx, + keep_alive_interval); } #ifdef WLAN_FEATURE_11BE_MLO diff --git a/core/hdd/src/wlan_hdd_cm_disconnect.c b/core/hdd/src/wlan_hdd_cm_disconnect.c index 14f50af394..5e955bd729 100644 --- a/core/hdd/src/wlan_hdd_cm_disconnect.c +++ b/core/hdd/src/wlan_hdd_cm_disconnect.c @@ -188,7 +188,10 @@ hdd_reset_sta_keep_alive_interval(struct wlan_hdd_link_info *link_info, return; } - wlan_hdd_save_sta_keep_alive_interval(link_info->adapter, 0); + if (!wlan_vdev_mlme_get_is_mlo_link(hdd_ctx->psoc, + link_info->vdev_id)) + wlan_hdd_save_sta_keep_alive_interval(link_info->adapter, 0); + ucfg_mlme_get_sta_keep_alive_period(hdd_ctx->psoc, &keep_alive_interval); hdd_vdev_send_sta_keep_alive_interval(link_info, hdd_ctx,