blob: 25cab0b6fb41c5c32aa0e9e8b5b926fc65b7707c [file] [log] [blame]
Allen.Wang4a0948d2021-12-15 13:41:18 +08001#!/bin/bash
2#
3# Power Control tool
4# Enable/disable AC relay
5# On/off System by step moter to press power key
6
7export PATH=$PATH:/usr/sbin:/usr/libexec
8
Potin Lai501f4c72022-06-13 13:23:57 +08009# shellcheck source=meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/files/bletchley-common-functions
10source /usr/libexec/bletchley-common-functions
11
Allen.Wang4a0948d2021-12-15 13:41:18 +080012DELAY_POWER_ON="0.5"
13DELAY_POWER_OFF="5"
Potin Lai27083c32022-06-02 19:13:24 +080014DELAY_POWER_RECOVERY_MODE="10"
Allen.Wang4a0948d2021-12-15 13:41:18 +080015POWER_BTN_TIMEOUT_CNT=60
16
Potin Laibb91c1b2022-04-28 15:03:05 +080017REV_EVT="EVT"
18REV_DVT="DVT"
19REV_UNKNOW="UNKNOW"
20
21DBUS_HOST_ST_ON="xyz.openbmc_project.State.Host.HostState.Running"
22DBUS_HOST_ST_OFF="xyz.openbmc_project.State.Host.HostState.Off"
23
24HOST_ST_UNKNOW="Unknow"
25HOST_ST_ON="On"
26HOST_ST_OFF="Off"
Potin Lai27083c32022-06-02 19:13:24 +080027HOST_ST_SLEEP="Sleep"
28HOST_ST_DFU="DFU"
29HOST_ST_RECOVERY="Recovery"
Potin Laibb91c1b2022-04-28 15:03:05 +080030HOST_AC_ON="AC On"
31HOST_AC_OFF="AC Off"
32
Potin Lai27083c32022-06-02 19:13:24 +080033ACTION_ON="on"
34ACTION_OFF="off"
35ACTION_DFU="dfu"
36ACTION_RECOVERY="recovery"
37ACTION_AC_ON="ac-on"
38ACTION_AC_OFF="ac-off"
39ACTION_STATUS="status"
40
41VALID_SLED_ACTIONS="
42 $ACTION_ON
43 $ACTION_OFF
44 $ACTION_AC_ON
45 $ACTION_AC_OFF
46 $ACTION_STATUS
47 $ACTION_DFU
48 $ACTION_RECOVERY
49"
50
51function is_valid_sled_action()
52{
53 local ACTION=$1
54 for i in $VALID_SLED_ACTIONS
55 do
56 if [ "$i" = "$ACTION" ]; then
57 return 0
58 fi
59 done
60 return 1
61}
62
63function get_board_rev()
64{
Potin Laibb91c1b2022-04-28 15:03:05 +080065 local rev_id0
66 local rev_id1
67 local rev_id2
68 local rev_val
69
70 rev_id0=$(get_gpio "REV_ID0")
71 rev_id1=$(get_gpio "REV_ID1")
72 rev_id2=$(get_gpio "REV_ID2")
73 rev_val=$((rev_id0+(rev_id1<<1)+(rev_id2<<2)))
74
75 case $rev_val in
76 0)
77 echo "$REV_EVT"
78 ;;
79 1)
80 echo "$REV_DVT"
81 ;;
82 *)
83 echo "$REV_UNKNOW"
84 return 1
85 ;;
86 esac
87
88 return 0
89}
90
Allen.Wang4a0948d2021-12-15 13:41:18 +080091#Switch pull low while it be touched
Potin Lai27083c32022-06-02 19:13:24 +080092function wait_for_switch()
93{
Allen.Wang4a0948d2021-12-15 13:41:18 +080094 TARGET_PIN=$1
95 TARGET_SWITCH=1
96 TIME_CNT=0
97 while [ "$TARGET_SWITCH" -eq 1 ] ;do
98 TARGET_SWITCH=$(get_gpio "$TARGET_PIN")
99 sleep 0.1
100 TIME_CNT=$(( TIME_CNT +1))
101 if [ $TIME_CNT -gt $POWER_BTN_TIMEOUT_CNT ];then
102 echo "Error: Too long to get target switch, force exit" >&2
103 break
104 fi
105 done
106}
107
Potin Lai27083c32022-06-02 19:13:24 +0800108function trigger_power_button()
109{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800110 local sled_num=$1
Allen.Wang6af0dff2021-12-28 20:23:05 +0800111 local delay_time=$2
Allen.Wang4a0948d2021-12-15 13:41:18 +0800112
113 #SLED{N}_MS_DETECT1 (initial position)
114 GPIO_DETECT_PIN1="SLED${sled_num}_MS_DETECT1"
115 #SLED{N}_MS_DETECT0 (MAC position)
116 GPIO_DETECT_PIN0="SLED${sled_num}_MS_DETECT0"
117
118 echo "Motor go forward to press Power key"
119 motor-ctrl "sled${sled_num}" f >/dev/null
120 wait_for_switch "${GPIO_DETECT_PIN0}"
121 motor-ctrl "sled${sled_num}" s >/dev/null
122
123 if [ "$(get_gpio "$GPIO_DETECT_PIN0")" -eq 0 ];then
124 echo "Power key switch triggered"
125 echo "Press power key for Sled${1} ${delay_time} seconds..."
126 sleep "$delay_time"
127 else
Allen.Wang6af0dff2021-12-28 20:23:05 +0800128 echo "Power key switch not trigger, back motor to initial position"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800129 fi
130
131 motor-ctrl "sled${sled_num}" r >/dev/null
132 wait_for_switch "${GPIO_DETECT_PIN1}"
133 motor-ctrl "sled${sled_num}" s >/dev/null
134 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ];then
135 echo "Motor reverse to initial position successful"
136 else
Allen.Wang6af0dff2021-12-28 20:23:05 +0800137 echo "Initial position switch not trigger, force stop motor"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800138 fi
139}
140
Potin Lai27083c32022-06-02 19:13:24 +0800141function release_power_button()
142{
Potin Laidb5648e2022-02-16 00:57:55 +0800143 local sled_num=$1
144 GPIO_DETECT_PIN1="SLED${sled_num}_MS_DETECT1"
145
146 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ]; then
147 echo "Motor at initial position already"
148 return 0
149 fi
150
151 motor-ctrl "sled${sled_num}" r >/dev/null
152 wait_for_switch "${GPIO_DETECT_PIN1}"
153 motor-ctrl "sled${sled_num}" s >/dev/null
154 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ];then
155 echo "Motor reverse to initial position successful"
156 return 0
157 fi
158
159 echo "Error: Initial position switch not trigger"
160 return 1
161}
162
Potin Lai27083c32022-06-02 19:13:24 +0800163function press_power_button()
164{
Potin Laidb5648e2022-02-16 00:57:55 +0800165 local sled_num=$1
166
167 GPIO_DETECT_PIN0="SLED${sled_num}_MS_DETECT0"
168
169 echo "Motor go forward to press Power button"
170 motor-ctrl "sled${sled_num}" f >/dev/null
171 wait_for_switch "${GPIO_DETECT_PIN0}"
172 motor-ctrl "sled${sled_num}" s >/dev/null
173
174 if [ "$(get_gpio "$GPIO_DETECT_PIN0")" -eq 0 ];then
175 echo "Power button switch triggered"
176 return 0
177 fi
178
179 echo "Error: Power button switch not trigger"
180 return 1
181}
182
Allen.Wang4a0948d2021-12-15 13:41:18 +0800183#Get i2c bus number for sledN
Potin Lai27083c32022-06-02 19:13:24 +0800184function get_bus_num()
185{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800186 SLED_NUM=$1
187 local bus=0
Allen.Wang5ff992e2022-01-04 21:00:38 +0800188 #Mapping Sled number 1~6 to i2c bus number 0~5
189 if [[ "$SLED_NUM" = [1-6] ]]; then
190 bus=$(( SLED_NUM - 1 ))
Allen.Wang4a0948d2021-12-15 13:41:18 +0800191 fi
192 echo "$bus"
193}
194
Potin Lai27083c32022-06-02 19:13:24 +0800195function get_ac_status()
196{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800197 i2c_bus=$(get_bus_num "$1")
198 p1_output_reg=$(i2cget -f -y "$i2c_bus" 0x76 0x03)
199 p1_config_reg=$(i2cget -f -y "$i2c_bus" 0x76 0x07)
200 host_pwr="$(( (p1_output_reg & 0x80)>>7 ))"
201 is_output="$(( (~p1_config_reg & 0x80)>>7 ))"
202
203 if [ "$(( host_pwr & is_output ))" -eq 1 ];then
Potin Laibb91c1b2022-04-28 15:03:05 +0800204 echo "$HOST_AC_ON"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800205 else
Potin Laibb91c1b2022-04-28 15:03:05 +0800206 echo "$HOST_AC_OFF"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800207 fi
208}
209
Potin Laibb91c1b2022-04-28 15:03:05 +0800210function get_host_status_dbus()
211{
212 local sled_num=$1
213 local object="/xyz/openbmc_project/state/host${sled_num}"
214 local service="xyz.openbmc_project.State.Host${sled_num}"
215 local interface="xyz.openbmc_project.State.Host"
216 local property="CurrentHostState"
217 local host_state
218
219 host_state=$(busctl get-property "$service" "$object" "$interface" "$property" | cut -d '"' -f2)
220
221 if [ "$host_state" = "$DBUS_HOST_ST_ON" ]; then
222 echo "$HOST_ST_ON"
223 elif [ "$host_state" = "$DBUS_HOST_ST_OFF" ]; then
224 echo "$HOST_ST_OFF"
225 else
226 echo "$HOST_ST_UNKNOW"
227 return 1
228 fi
229
230 return 0
231}
232
233function get_host_status_mdio()
Potin Laidc251662022-04-01 11:16:50 +0800234{
Potin Lai27083c32022-06-02 19:13:24 +0800235 local SLED_NUM=$1
236 local MDIO_BUS=0
Potin Laibb91c1b2022-04-28 15:03:05 +0800237
Potin Laidc251662022-04-01 11:16:50 +0800238 declare -a PORT_MAP=(0 3 2 1 7 6 5)
239
240 # check /dev/mem
241 if ! create_dev_mem; then
242 return 1
243 fi
244
Potin Lai27083c32022-06-02 19:13:24 +0800245 local CHECK_CNT=0
246 local MDIO_ERR_CNT=0
247 local CUR_HOST_ST=$HOST_ST_UNKNOW
248 local SLED_LAST_ACTION
249
250 if [ -f /tmp/sled"${SLED_NUM}"-last-action ]; then
251 SLED_LAST_ACTION=$(cat /tmp/sled"${SLED_NUM}"-last-action)
252 fi
Potin Laidc251662022-04-01 11:16:50 +0800253
254 while true
255 do
256 if POST_ST_VAL=$(mdio-util c22 r $MDIO_BUS "${PORT_MAP[SLED_NUM]}" 0); then
Potin Lai27083c32022-06-02 19:13:24 +0800257 if [ $((POST_ST_VAL&16#0800)) -eq $((16#0000)) ]; then
258 case $SLED_LAST_ACTION in
259 "$ACTION_DFU")
260 TMP_HOST_ST="$HOST_ST_DFU"
261 ;;
262 *)
263 TMP_HOST_ST="$HOST_ST_OFF"
264 ;;
265 esac
266 elif [ $((POST_ST_VAL&16#0A00)) -eq $((16#0A00)) ]; then
Potin Laidc251662022-04-01 11:16:50 +0800267 TMP_HOST_ST="$HOST_ST_ON"
Potin Lai27083c32022-06-02 19:13:24 +0800268 case $SLED_LAST_ACTION in
269 "$ACTION_RECOVERY")
270 TMP_HOST_ST="$HOST_ST_RECOVERY"
271 ;;
272 *)
273 TMP_HOST_ST="$HOST_ST_ON"
274 ;;
275 esac
276 elif [ $((POST_ST_VAL&16#0900)) -eq $((16#0900)) ]; then
277 TMP_HOST_ST="$HOST_ST_SLEEP"
Potin Laidc251662022-04-01 11:16:50 +0800278 else
Potin Lai27083c32022-06-02 19:13:24 +0800279 TMP_HOST_ST="$HOST_ST_UNKNOW"
Potin Laidc251662022-04-01 11:16:50 +0800280 fi
281
282 if [ "$CUR_HOST_ST" == "$TMP_HOST_ST" ]; then
283 CHECK_CNT=$((CHECK_CNT+1))
284 else
285 CUR_HOST_ST=$TMP_HOST_ST
286 CHECK_CNT=0
287 fi
288
289 if [ "$CHECK_CNT" -ge 5 ]; then
290 echo "$CUR_HOST_ST"
291 break
292 fi
293 else
294 MDIO_ERR_CNT=$((MDIO_ERR_CNT+1))
295 if [ "$MDIO_ERR_CNT" -ge 5 ]; then
296 echo "$HOST_ST_UNKNOW"
297 return 1
298 fi
299 fi
300 done
301
302 return 0
303}
304
Potin Laibb91c1b2022-04-28 15:03:05 +0800305function get_host_status()
306{
307 local sled_num=$1
Potin Laibb91c1b2022-04-28 15:03:05 +0800308
Potin Lai27083c32022-06-02 19:13:24 +0800309 if [ "$(get_ac_status "$SLED_NUM")" == "$HOST_AC_OFF" ];then
310 echo "$HOST_AC_OFF"
311 return 0
312 fi
Potin Laibb91c1b2022-04-28 15:03:05 +0800313
Potin Lai27083c32022-06-02 19:13:24 +0800314 if [ "$(get_board_rev)" = "$REV_EVT" ]; then
Potin Laibb91c1b2022-04-28 15:03:05 +0800315 get_host_status_dbus "$sled_num"
316 else
317 get_host_status_mdio "$sled_num"
318 fi
Potin Laibb91c1b2022-04-28 15:03:05 +0800319 return $?
320}
321
Potin Lai27083c32022-06-02 19:13:24 +0800322function do_action_ac_on()
323{
324 local SLED_NUM=$1
325 echo "sled${SLED_NUM}: turn on AC"
326 set_gpio "power-host${SLED_NUM}" 1
327 echo "$ACTION_AC_ON" > "/tmp/sled${SLED_NUM}-last-action"
328}
329
330function do_action_ac_off()
331{
332 local SLED_NUM=$1
333 echo "sled${SLED_NUM}: turn off AC"
334 set_gpio "power-host${SLED_NUM}" 0
335 echo "$ACTION_AC_OFF" > "/tmp/sled${SLED_NUM}-last-action"
336}
337
338function do_action_on()
339{
340 local SLED_NUM=$1
341 echo "sled${SLED_NUM}: power on host"
342 trigger_power_button "$SLED_NUM" "$DELAY_POWER_ON"
343 echo "$ACTION_ON" > "/tmp/sled${SLED_NUM}-last-action"
344}
345
346function do_action_off()
347{
348 local SLED_NUM=$1
349 echo "sled${SLED_NUM}: power off host"
350 trigger_power_button "$SLED_NUM" "$DELAY_POWER_OFF"
351 echo "$ACTION_OFF" > "/tmp/sled${SLED_NUM}-last-action"
352}
353
354function do_action_recovery()
355{
356 local SLED_NUM=$1
357 echo "sled${SLED_NUM}: trigger host recovery mode"
358 trigger_power_button "$SLED_NUM" "$DELAY_POWER_RECOVERY_MODE"
359 echo "$ACTION_RECOVERY" > "/tmp/sled${SLED_NUM}-last-action"
360}
361
362function do_action_dfu()
363{
364 local SLED_NUM=$1
365 echo "sled${SLED_NUM}: trigger host dfu mode"
366
367 # turn ac off, and hold for 25 seconds
368 do_action_ac_off "$SLED_NUM"
369 sleep 25
370
371 # press power button
372 echo "SLED$SLED_NUM: pressing power button"
373 if ! press_power_button "$SLED_NUM"; then
374 echo "SLED$SLED_NUM: press power button failed"
375 echo "SLED$SLED_NUM: releasing power button"
376 release_power_button "$SLED_NUM"
377 exit 1
378 fi
379 sleep 1
380
381 # turn ac on
382 echo "SLED$SLED_NUM: turn ac-on"
383 do_action_ac_on "$SLED_NUM"
384 sleep 3
385
386 # release power button
387 echo "SLED$SLED_NUM: releasing host power button"
388 if ! release_power_button "$SLED_NUM"; then
389 echo "SLED$SLED_NUM: release power button failed"
390 exit 1
391 fi
392 echo "$ACTION_DFU" > "/tmp/sled${SLED_NUM}-last-action"
393}
394
395function host_state_on_action_handler()
396{
397 local SLED_NUM=$1
398 local ACTION=$2
399
400 case $ACTION in
401 "$ACTION_OFF")
402 do_action_off "$SLED_NUM"
403 ;;
404 "$ACTION_AC_OFF")
405 do_action_ac_off "$SLED_NUM"
406 ;;
407 *)
408 echo "Invalid action ($ACTION) for current host state (On)"
409 return 1
410 ;;
411 esac
412}
413
414function host_state_sleep_action_handler()
415{
416 local SLED_NUM=$1
417 local ACTION=$2
418
419 case $ACTION in
420 "$ACTION_ON")
421 do_action_on "$SLED_NUM"
422 ;;
423 "$ACTION_OFF")
424 do_action_off "$SLED_NUM"
425 ;;
426 "$ACTION_AC_OFF")
427 do_action_ac_off "$SLED_NUM"
428 ;;
429 *)
430 echo "Invalid action ($ACTION) for current host state (Sleep)"
431 return 1
432 ;;
433 esac
434}
435
436function host_state_off_action_handler()
437{
438 local SLED_NUM=$1
439 local ACTION=$2
440
441 case $ACTION in
442 "$ACTION_ON")
443 do_action_on "$SLED_NUM"
444 ;;
445 "$ACTION_RECOVERY")
446 do_action_recovery "$SLED_NUM"
447 ;;
448 "$ACTION_AC_OFF")
449 do_action_ac_off "$SLED_NUM"
450 ;;
451 *)
452 echo "Invalid action ($ACTION) for current host state (Off)"
453 return 1
454 ;;
455 esac
456}
457
458function host_state_ac_off_action_handler()
459{
460 local SLED_NUM=$1
461 local ACTION=$2
462
463 case $ACTION in
464 "$ACTION_AC_ON")
465 do_action_ac_on "$SLED_NUM"
466 ;;
467 "$ACTION_DFU")
468 do_action_dfu "$SLED_NUM"
469 ;;
470 "$ACTION_AC_OFF")
471 echo "sled${SLED_NUM}: already ac off"
472 return 1
473 ;;
474 *)
475 echo "Invalid action ($ACTION) for current host state (AC Off)"
476 return 1
477 ;;
478 esac
479}
480
481function host_state_ac_on_action_handler()
482{
483 local SLED_NUM=$1
484 local ACTION=$2
485
486 case $ACTION in
487 "$ACTION_AC_OFF")
488 do_action_ac_off "$SLED_NUM"
489 ;;
490 *)
491 echo "sled${SLED_NUM}: already ac on"
492 return 1
493 ;;
494 esac
495}
496
497function host_state_recovery_action_handler()
498{
499 local SLED_NUM=$1
500 local ACTION=$2
501
502 case $ACTION in
503 "$ACTION_OFF")
504 do_action_off "$SLED_NUM"
505 ;;
506 "$ACTION_AC_OFF")
507 do_action_ac_off "$SLED_NUM"
508 ;;
509 *)
510 echo "Invalid action ($ACTION) for current host state (Recovery)"
511 return 1
512 ;;
513 esac
514}
515
516function host_state_dfu_action_handler()
517{
518 local SLED_NUM=$1
519 local ACTION=$2
520
521 case $ACTION in
522 "$ACTION_AC_OFF")
523 do_action_ac_off "$SLED_NUM"
524 ;;
525 *)
526 echo "Invalid action ($ACTION) for current host state (DFU)"
527 return 1
528 ;;
529 esac
530}
531
Potin Laidc251662022-04-01 11:16:50 +0800532function create_dev_mem()
533{
534 CHECK_CNT=0
535 while true
536 do
537 CHECK_CNT=$((CHECK_CNT+1))
538 if [ -c /dev/mem ]; then
539 # /dev/mem already exist
540 return 0
541 elif mknod /dev/mem c 1 1; then
542 # mknod success
543 return 0
544 elif [ "$CHECK_CNT" -ge 5 ]; then
545 break
546 fi
547 sleep 1
548 done
549
550 echo "create /dev/mem failed"
551 return 1
552}
553
Allen.Wang4a0948d2021-12-15 13:41:18 +0800554function show_usage(){
Potin Lai27083c32022-06-02 19:13:24 +0800555 echo "Usage: power-ctrl [sled1 | sled2 | sled3 | sled4 | sled5 | sled6] [$VALID_SLED_ACTIONS]"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800556 echo " power-ctrl chassis-cycle"
557}
558
Potin Lai27083c32022-06-02 19:13:24 +0800559
Allen.Wang4a0948d2021-12-15 13:41:18 +0800560if [ $# -eq 1 ]; then
561 if [ "$1" = "chassis-cycle" ];then
562 echo "chassis cycle...."
563 i2cset -y -f 12 0x11 0xd9 c
564 exit 0
565 else
566 echo "Invalid argument: [ $1 ]"
567 show_usage
568 exit 1;
569 fi
570fi
571
572if [ $# -gt 2 ]; then
573 echo "Too many arguments"
574 show_usage
575 exit 1;
576fi
577
Allen.Wang5ff992e2022-01-04 21:00:38 +0800578if [[ "$1" =~ ^(sled[1-6]{1})$ ]]; then
Allen.Wang4a0948d2021-12-15 13:41:18 +0800579 SLED=$1
580 ACTION=$2
581 SLED_NUM=${SLED:4}
582else
583 echo "invalid sled name: ${1}"
584 show_usage
585 exit 1;
586fi
587
588#Check if sled is present
Potin Lai501f4c72022-06-13 13:23:57 +0800589if ! is_sled_present "${SLED_NUM}"; then
Allen.Wang4a0948d2021-12-15 13:41:18 +0800590 echo "${SLED} is not present!"
591 exit 1
Potin Lai27083c32022-06-02 19:13:24 +0800592elif ! is_valid_sled_action "$ACTION"; then
593 echo "Unknown action: $ACTION"
594 show_usage
595 exit 1
Allen.Wang4a0948d2021-12-15 13:41:18 +0800596fi
597
Potin Laia8d258f2022-06-14 18:35:10 +0800598if [ "$ACTION" = "$ACTION_AC_ON" ]; then
599 if [ "$(get_ac_status "$SLED_NUM")" = "$HOST_AC_OFF" ]; then
600 do_action_ac_on "$SLED_NUM"
601 fi
602elif [ "$ACTION" = "$ACTION_AC_OFF" ]; then
603 if [ "$(get_ac_status "$SLED_NUM")" != "$HOST_AC_OFF" ]; then
604 do_action_ac_off "$SLED_NUM"
605 fi
606elif [ "$ACTION" = "$ACTION_STATUS" ];then
607 HOST_CURR_STATUS=$(get_host_status "$SLED_NUM")
Potin Lai27083c32022-06-02 19:13:24 +0800608 echo "$HOST_CURR_STATUS"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800609else
Potin Laia8d258f2022-06-14 18:35:10 +0800610 HOST_CURR_STATUS=$(get_host_status "$SLED_NUM")
Potin Lai27083c32022-06-02 19:13:24 +0800611 case $HOST_CURR_STATUS in
612 "$HOST_AC_OFF")
613 host_state_ac_off_action_handler "$SLED_NUM" "$ACTION"
614 ;;
615 "$HOST_AC_ON")
616 host_state_ac_on_action_handler "$SLED_NUM" "$ACTION"
617 ;;
618 "$HOST_ST_OFF")
619 host_state_off_action_handler "$SLED_NUM" "$ACTION"
620 ;;
621 "$HOST_ST_ON")
622 host_state_on_action_handler "$SLED_NUM" "$ACTION"
623 ;;
624 "$HOST_ST_SLEEP")
625 host_state_sleep_action_handler "$SLED_NUM" "$ACTION"
626 ;;
627 "$HOST_ST_DFU")
628 host_state_dfu_action_handler "$SLED_NUM" "$ACTION"
629 ;;
630 "$HOST_ST_RECOVERY")
631 host_state_recovery_action_handler "$SLED_NUM" "$ACTION"
632 ;;
633 esac
Allen.Wang4a0948d2021-12-15 13:41:18 +0800634fi