@@ -2380,6 +2380,13 @@ void ull_conn_update_parameters(struct ll_conn *conn, uint8_t is_cu_proc, uint8_
23802380 lll -> tifs_tx_us = EVENT_IFS_DEFAULT_US ;
23812381 lll -> tifs_rx_us = EVENT_IFS_DEFAULT_US ;
23822382 lll -> tifs_hcto_us = EVENT_IFS_DEFAULT_US ;
2383+ for (size_t i = 0 ; i < 3 ; i ++ ) {
2384+ conn -> lll .fsu .perphy [i ].fsu_min = EVENT_IFS_DEFAULT_US ;
2385+ conn -> lll .fsu .perphy [i ].fsu_max = EVENT_IFS_DEFAULT_US ;
2386+ conn -> lll .fsu .perphy [i ].phys = PHY_1M | PHY_2M | PHY_CODED ;
2387+ conn -> lll .fsu .perphy [i ].spacing_type =
2388+ T_IFS_ACL_PC | T_IFS_ACL_CP | T_IFS_CIS ;
2389+ }
23832390
23842391#if defined(CONFIG_BT_CTLR_DATA_LENGTH ) && \
23852392 defined(CONFIG_BT_CTLR_SLOT_RESERVATION_UPDATE )
@@ -2417,6 +2424,14 @@ void ull_conn_update_parameters(struct ll_conn *conn, uint8_t is_cu_proc, uint8_
24172424 lll -> tifs_tx_us = CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US ;
24182425 lll -> tifs_rx_us = CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US ;
24192426 lll -> tifs_hcto_us = CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US ;
2427+ for (size_t i = 0 ; i < 3 ; i ++ ) {
2428+ conn -> lll .fsu .perphy [i ].fsu_min =
2429+ CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US ;
2430+ conn -> lll .fsu .perphy [i ].fsu_max = EVENT_IFS_US ;
2431+ conn -> lll .fsu .perphy [i ].phys = PHY_1M | PHY_2M | PHY_CODED ;
2432+ conn -> lll .fsu .perphy [i ].spacing_type =
2433+ T_IFS_ACL_PC | T_IFS_ACL_CP | T_IFS_CIS ;
2434+ }
24202435 /* Reserve only the processing overhead, on overlap the
24212436 * is_abort_cb mechanism will ensure to continue the event so
24222437 * as to not loose anchor point sync.
@@ -2832,6 +2847,132 @@ void ull_conn_default_tx_time_set(uint16_t tx_time)
28322847}
28332848#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
28342849
2850+ uint8_t ull_fsu_update_eff (struct ll_conn * conn )
2851+ {
2852+ uint8_t fsu_changed = 0U ;
2853+ uint8_t phy_tx ;
2854+ uint8_t phy_rx ;
2855+
2856+ #if defined(CONFIG_BT_PHY_UPDATE )
2857+ phy_tx = conn -> lll .phy_tx ;
2858+ phy_rx = conn -> lll .phy_rx ;
2859+ #else
2860+ phy_tx = PHY_1M ;
2861+ phy_rx = PHY_1M ;
2862+ #endif /* CONFIG_BT_PHY_UPDATE */
2863+
2864+ fsu_changed = ull_fsu_update_eff_from_local (conn );
2865+
2866+ if (fsu_changed ) {
2867+ /* TODO: confirm that we do not need to do something here? */
2868+ }
2869+
2870+ if ((conn -> lll .fsu .local .spacing_type & T_IFS_CIS ) == T_IFS_CIS ) {
2871+
2872+ if (conn -> lll .tifs_cis_us == conn -> lll .fsu .eff .fsu_min ) {
2873+ fsu_changed = 1 ;
2874+ }
2875+ conn -> lll .tifs_cis_us = conn -> lll .fsu .eff .fsu_min ;
2876+ }
2877+
2878+ if ((conn -> lll .fsu .local .spacing_type & T_IFS_ACL_CP ) == T_IFS_ACL_CP ) {
2879+ if (conn -> lll .role == BT_HCI_ROLE_PERIPHERAL ) {
2880+ if (conn -> lll .fsu .local .phys & phy_tx ) {
2881+ if (conn -> lll .tifs_tx_us ==
2882+ conn -> lll .fsu .eff .fsu_min ) {
2883+ fsu_changed = 1 ;
2884+ }
2885+ conn -> lll .tifs_tx_us = conn -> lll .fsu .eff .fsu_min ;
2886+ }
2887+ } else {
2888+ if (conn -> lll .fsu .local .phys & phy_rx ) {
2889+ if (conn -> lll .tifs_rx_us ==
2890+ conn -> lll .fsu .eff .fsu_min ) {
2891+ fsu_changed = 1 ;
2892+ }
2893+ conn -> lll .tifs_rx_us = conn -> lll .fsu .eff .fsu_min ;
2894+ }
2895+ }
2896+ }
2897+
2898+ if ((conn -> lll .fsu .local .spacing_type & T_IFS_ACL_PC ) == T_IFS_ACL_PC ) {
2899+ if (conn -> lll .role == BT_HCI_ROLE_PERIPHERAL ) {
2900+ if (conn -> lll .fsu .local .phys & phy_rx ) {
2901+ if (conn -> lll .tifs_rx_us ==
2902+ conn -> lll .fsu .eff .fsu_min ) {
2903+ fsu_changed = 1 ;
2904+ }
2905+ conn -> lll .tifs_rx_us = conn -> lll .fsu .eff .fsu_min ;
2906+ }
2907+ } else {
2908+ if (conn -> lll .fsu .local .phys & phy_tx ) {
2909+ if (conn -> lll .tifs_tx_us ==
2910+ conn -> lll .fsu .eff .fsu_min ) {
2911+ fsu_changed = 1 ;
2912+ }
2913+ conn -> lll .tifs_tx_us = conn -> lll .fsu .eff .fsu_min ;
2914+ }
2915+ }
2916+ }
2917+ if (fsu_changed == 1 ) {
2918+ conn -> lll .fsu .local .phys = 0 ;
2919+ conn -> lll .fsu .local .spacing_type = 0 ;
2920+ }
2921+
2922+ return fsu_changed ;
2923+ }
2924+
2925+ uint8_t ull_fsu_update_eff_from_local (struct ll_conn * conn )
2926+ {
2927+ uint8_t fsu_changed = 0U ;
2928+ uint16_t fsu_min , fsu_max ;
2929+
2930+ fsu_min = MAX (conn -> lll .fsu .local .fsu_min , CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US );
2931+ fsu_max = MAX (conn -> lll .fsu .local .fsu_max , CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US );
2932+
2933+ conn -> lll .fsu .eff .fsu_min = fsu_min ;
2934+ conn -> lll .fsu .eff .fsu_max = fsu_max ;
2935+ conn -> lll .fsu .local .fsu_min = fsu_min ;
2936+ conn -> lll .fsu .local .fsu_max = fsu_max ;
2937+
2938+ return fsu_changed ;
2939+ }
2940+
2941+ void ull_fsu_local_tx_update (struct ll_conn * conn , uint16_t fsu_min ,
2942+ uint16_t fsu_max , uint8_t phys , uint16_t spacing_type )
2943+ {
2944+ conn -> lll .fsu .local .fsu_min = fsu_min ;
2945+ if (conn -> lll .tifs_rx_us > fsu_max ) {
2946+ fsu_max = conn -> lll .tifs_rx_us ;
2947+ }
2948+ if (conn -> lll .tifs_tx_us > fsu_max ) {
2949+ fsu_max = conn -> lll .tifs_tx_us ;
2950+ }
2951+ conn -> lll .fsu .local .fsu_max = fsu_max ;
2952+ conn -> lll .fsu .local .phys = phys ;
2953+ conn -> lll .fsu .local .spacing_type = spacing_type ;
2954+ }
2955+
2956+ uint8_t ull_fsu_init (struct ll_conn * conn )
2957+ {
2958+ conn -> lll .tifs_rx_us = EVENT_IFS_US ;
2959+ conn -> lll .tifs_tx_us = EVENT_IFS_US ;
2960+ conn -> lll .tifs_cis_us = EVENT_IFS_US ;
2961+ conn -> lll .fsu .local .fsu_min = CONFIG_BT_CTLR_EVENT_IFS_LOW_LAT_US ;
2962+ conn -> lll .fsu .local .fsu_max = EVENT_IFS_MAX_US ;
2963+ conn -> lll .fsu .eff .fsu_min = EVENT_IFS_US ;
2964+ conn -> lll .fsu .eff .fsu_max = EVENT_IFS_US ;
2965+ for (size_t i = 0 ; i < 3 ; i ++ ) {
2966+ conn -> lll .fsu .perphy [i ].fsu_min = EVENT_IFS_US ;
2967+ conn -> lll .fsu .perphy [i ].fsu_max = EVENT_IFS_US ;
2968+ conn -> lll .fsu .perphy [i ].phys = PHY_1M | PHY_2M | PHY_CODED ;
2969+ conn -> lll .fsu .perphy [i ].spacing_type =
2970+ T_IFS_ACL_PC | T_IFS_ACL_CP | T_IFS_CIS ;
2971+ }
2972+
2973+ return 0 ;
2974+ }
2975+
28352976#if defined(CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER )
28362977static bool ticker_op_id_match_func (uint8_t ticker_id , uint32_t ticks_slot ,
28372978 uint32_t ticks_to_expire , void * op_context )
0 commit comments