blob: def4689790d472e3aa47b2dad3597d7384002224 [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
9DELAY_POWER_ON="0.5"
10DELAY_POWER_OFF="5"
Potin Lai27083c32022-06-02 19:13:24 +080011DELAY_POWER_RECOVERY_MODE="10"
Allen.Wang4a0948d2021-12-15 13:41:18 +080012POWER_BTN_TIMEOUT_CNT=60
13
Potin Laibb91c1b2022-04-28 15:03:05 +080014REV_EVT="EVT"
15REV_DVT="DVT"
16REV_UNKNOW="UNKNOW"
17
18DBUS_HOST_ST_ON="xyz.openbmc_project.State.Host.HostState.Running"
19DBUS_HOST_ST_OFF="xyz.openbmc_project.State.Host.HostState.Off"
20
21HOST_ST_UNKNOW="Unknow"
22HOST_ST_ON="On"
23HOST_ST_OFF="Off"
Potin Lai27083c32022-06-02 19:13:24 +080024HOST_ST_SLEEP="Sleep"
25HOST_ST_DFU="DFU"
26HOST_ST_RECOVERY="Recovery"
Potin Laibb91c1b2022-04-28 15:03:05 +080027HOST_AC_ON="AC On"
28HOST_AC_OFF="AC Off"
29
Potin Lai27083c32022-06-02 19:13:24 +080030ACTION_ON="on"
31ACTION_OFF="off"
32ACTION_DFU="dfu"
33ACTION_RECOVERY="recovery"
34ACTION_AC_ON="ac-on"
35ACTION_AC_OFF="ac-off"
36ACTION_STATUS="status"
37
38VALID_SLED_ACTIONS="
39 $ACTION_ON
40 $ACTION_OFF
41 $ACTION_AC_ON
42 $ACTION_AC_OFF
43 $ACTION_STATUS
44 $ACTION_DFU
45 $ACTION_RECOVERY
46"
47
48function is_valid_sled_action()
49{
50 local ACTION=$1
51 for i in $VALID_SLED_ACTIONS
52 do
53 if [ "$i" = "$ACTION" ]; then
54 return 0
55 fi
56 done
57 return 1
58}
59
60function get_board_rev()
61{
Potin Laibb91c1b2022-04-28 15:03:05 +080062 local rev_id0
63 local rev_id1
64 local rev_id2
65 local rev_val
66
67 rev_id0=$(get_gpio "REV_ID0")
68 rev_id1=$(get_gpio "REV_ID1")
69 rev_id2=$(get_gpio "REV_ID2")
70 rev_val=$((rev_id0+(rev_id1<<1)+(rev_id2<<2)))
71
72 case $rev_val in
73 0)
74 echo "$REV_EVT"
75 ;;
76 1)
77 echo "$REV_DVT"
78 ;;
79 *)
80 echo "$REV_UNKNOW"
81 return 1
82 ;;
83 esac
84
85 return 0
86}
87
Allen.Wang4a0948d2021-12-15 13:41:18 +080088#Switch pull low while it be touched
Potin Lai27083c32022-06-02 19:13:24 +080089function wait_for_switch()
90{
Allen.Wang4a0948d2021-12-15 13:41:18 +080091 TARGET_PIN=$1
92 TARGET_SWITCH=1
93 TIME_CNT=0
94 while [ "$TARGET_SWITCH" -eq 1 ] ;do
95 TARGET_SWITCH=$(get_gpio "$TARGET_PIN")
96 sleep 0.1
97 TIME_CNT=$(( TIME_CNT +1))
98 if [ $TIME_CNT -gt $POWER_BTN_TIMEOUT_CNT ];then
99 echo "Error: Too long to get target switch, force exit" >&2
100 break
101 fi
102 done
103}
104
Potin Lai27083c32022-06-02 19:13:24 +0800105function trigger_power_button()
106{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800107 local sled_num=$1
Allen.Wang6af0dff2021-12-28 20:23:05 +0800108 local delay_time=$2
Allen.Wang4a0948d2021-12-15 13:41:18 +0800109
110 #SLED{N}_MS_DETECT1 (initial position)
111 GPIO_DETECT_PIN1="SLED${sled_num}_MS_DETECT1"
112 #SLED{N}_MS_DETECT0 (MAC position)
113 GPIO_DETECT_PIN0="SLED${sled_num}_MS_DETECT0"
114
115 echo "Motor go forward to press Power key"
116 motor-ctrl "sled${sled_num}" f >/dev/null
117 wait_for_switch "${GPIO_DETECT_PIN0}"
118 motor-ctrl "sled${sled_num}" s >/dev/null
119
120 if [ "$(get_gpio "$GPIO_DETECT_PIN0")" -eq 0 ];then
121 echo "Power key switch triggered"
122 echo "Press power key for Sled${1} ${delay_time} seconds..."
123 sleep "$delay_time"
124 else
Allen.Wang6af0dff2021-12-28 20:23:05 +0800125 echo "Power key switch not trigger, back motor to initial position"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800126 fi
127
128 motor-ctrl "sled${sled_num}" r >/dev/null
129 wait_for_switch "${GPIO_DETECT_PIN1}"
130 motor-ctrl "sled${sled_num}" s >/dev/null
131 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ];then
132 echo "Motor reverse to initial position successful"
133 else
Allen.Wang6af0dff2021-12-28 20:23:05 +0800134 echo "Initial position switch not trigger, force stop motor"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800135 fi
136}
137
Potin Lai27083c32022-06-02 19:13:24 +0800138function release_power_button()
139{
Potin Laidb5648e2022-02-16 00:57:55 +0800140 local sled_num=$1
141 GPIO_DETECT_PIN1="SLED${sled_num}_MS_DETECT1"
142
143 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ]; then
144 echo "Motor at initial position already"
145 return 0
146 fi
147
148 motor-ctrl "sled${sled_num}" r >/dev/null
149 wait_for_switch "${GPIO_DETECT_PIN1}"
150 motor-ctrl "sled${sled_num}" s >/dev/null
151 if [ "$(get_gpio "$GPIO_DETECT_PIN1")" -eq 0 ];then
152 echo "Motor reverse to initial position successful"
153 return 0
154 fi
155
156 echo "Error: Initial position switch not trigger"
157 return 1
158}
159
Potin Lai27083c32022-06-02 19:13:24 +0800160function press_power_button()
161{
Potin Laidb5648e2022-02-16 00:57:55 +0800162 local sled_num=$1
163
164 GPIO_DETECT_PIN0="SLED${sled_num}_MS_DETECT0"
165
166 echo "Motor go forward to press Power button"
167 motor-ctrl "sled${sled_num}" f >/dev/null
168 wait_for_switch "${GPIO_DETECT_PIN0}"
169 motor-ctrl "sled${sled_num}" s >/dev/null
170
171 if [ "$(get_gpio "$GPIO_DETECT_PIN0")" -eq 0 ];then
172 echo "Power button switch triggered"
173 return 0
174 fi
175
176 echo "Error: Power button switch not trigger"
177 return 1
178}
179
Allen.Wang4a0948d2021-12-15 13:41:18 +0800180#Get i2c bus number for sledN
Potin Lai27083c32022-06-02 19:13:24 +0800181function get_bus_num()
182{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800183 SLED_NUM=$1
184 local bus=0
Allen.Wang5ff992e2022-01-04 21:00:38 +0800185 #Mapping Sled number 1~6 to i2c bus number 0~5
186 if [[ "$SLED_NUM" = [1-6] ]]; then
187 bus=$(( SLED_NUM - 1 ))
Allen.Wang4a0948d2021-12-15 13:41:18 +0800188 fi
189 echo "$bus"
190}
191
192function set_gpio()
193{
194 NET_NAME=$1
195 OUT_VAL=$2
196 mapfile -t -d " " GPIO_INFO < <(gpiofind "$NET_NAME")
197 if [ "${#GPIO_INFO[@]}" -ne 2 ]; then
198 echo "set_gpio: can not find gpio, $NET_NAME"
199 return 1
200 fi
201 echo -n "set_gpio: set $NET_NAME = $OUT_VAL"
202 if ! gpioset "${GPIO_INFO[0]}" "${GPIO_INFO[1]%$'\n'}"="$OUT_VAL"; then
203 echo " failed"
204 return 1
205 fi
206 echo " success"
207 return 0
208}
209
210function get_gpio()
211{
212 NET_NAME=$1
213 RET_VAL=2
214
215 mapfile -t -d " " GPIO_INFO < <(gpiofind "$NET_NAME")
216 if [ "${#GPIO_INFO[@]}" -ne 2 ]; then
217 echo "get_gpio: can not find gpio, $NET_NAME" >&2
218 return 1
219 fi
220 if ! RET_VAL=$(gpioget "${GPIO_INFO[0]}" "${GPIO_INFO[1]%$'\n'}") ; then
221 echo "get_gpio: get ${NET_NAME} failed" >&2
222 return 1
223 fi
224 echo "${RET_VAL}"
225 return 0
226}
227
Potin Lai27083c32022-06-02 19:13:24 +0800228function get_ac_status()
229{
Allen.Wang4a0948d2021-12-15 13:41:18 +0800230 i2c_bus=$(get_bus_num "$1")
231 p1_output_reg=$(i2cget -f -y "$i2c_bus" 0x76 0x03)
232 p1_config_reg=$(i2cget -f -y "$i2c_bus" 0x76 0x07)
233 host_pwr="$(( (p1_output_reg & 0x80)>>7 ))"
234 is_output="$(( (~p1_config_reg & 0x80)>>7 ))"
235
236 if [ "$(( host_pwr & is_output ))" -eq 1 ];then
Potin Laibb91c1b2022-04-28 15:03:05 +0800237 echo "$HOST_AC_ON"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800238 else
Potin Laibb91c1b2022-04-28 15:03:05 +0800239 echo "$HOST_AC_OFF"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800240 fi
241}
242
Potin Laibb91c1b2022-04-28 15:03:05 +0800243function get_host_status_dbus()
244{
245 local sled_num=$1
246 local object="/xyz/openbmc_project/state/host${sled_num}"
247 local service="xyz.openbmc_project.State.Host${sled_num}"
248 local interface="xyz.openbmc_project.State.Host"
249 local property="CurrentHostState"
250 local host_state
251
252 host_state=$(busctl get-property "$service" "$object" "$interface" "$property" | cut -d '"' -f2)
253
254 if [ "$host_state" = "$DBUS_HOST_ST_ON" ]; then
255 echo "$HOST_ST_ON"
256 elif [ "$host_state" = "$DBUS_HOST_ST_OFF" ]; then
257 echo "$HOST_ST_OFF"
258 else
259 echo "$HOST_ST_UNKNOW"
260 return 1
261 fi
262
263 return 0
264}
265
266function get_host_status_mdio()
Potin Laidc251662022-04-01 11:16:50 +0800267{
Potin Lai27083c32022-06-02 19:13:24 +0800268 local SLED_NUM=$1
269 local MDIO_BUS=0
Potin Laibb91c1b2022-04-28 15:03:05 +0800270
Potin Laidc251662022-04-01 11:16:50 +0800271 declare -a PORT_MAP=(0 3 2 1 7 6 5)
272
273 # check /dev/mem
274 if ! create_dev_mem; then
275 return 1
276 fi
277
Potin Lai27083c32022-06-02 19:13:24 +0800278 local CHECK_CNT=0
279 local MDIO_ERR_CNT=0
280 local CUR_HOST_ST=$HOST_ST_UNKNOW
281 local SLED_LAST_ACTION
282
283 if [ -f /tmp/sled"${SLED_NUM}"-last-action ]; then
284 SLED_LAST_ACTION=$(cat /tmp/sled"${SLED_NUM}"-last-action)
285 fi
Potin Laidc251662022-04-01 11:16:50 +0800286
287 while true
288 do
289 if POST_ST_VAL=$(mdio-util c22 r $MDIO_BUS "${PORT_MAP[SLED_NUM]}" 0); then
Potin Lai27083c32022-06-02 19:13:24 +0800290 if [ $((POST_ST_VAL&16#0800)) -eq $((16#0000)) ]; then
291 case $SLED_LAST_ACTION in
292 "$ACTION_DFU")
293 TMP_HOST_ST="$HOST_ST_DFU"
294 ;;
295 *)
296 TMP_HOST_ST="$HOST_ST_OFF"
297 ;;
298 esac
299 elif [ $((POST_ST_VAL&16#0A00)) -eq $((16#0A00)) ]; then
Potin Laidc251662022-04-01 11:16:50 +0800300 TMP_HOST_ST="$HOST_ST_ON"
Potin Lai27083c32022-06-02 19:13:24 +0800301 case $SLED_LAST_ACTION in
302 "$ACTION_RECOVERY")
303 TMP_HOST_ST="$HOST_ST_RECOVERY"
304 ;;
305 *)
306 TMP_HOST_ST="$HOST_ST_ON"
307 ;;
308 esac
309 elif [ $((POST_ST_VAL&16#0900)) -eq $((16#0900)) ]; then
310 TMP_HOST_ST="$HOST_ST_SLEEP"
Potin Laidc251662022-04-01 11:16:50 +0800311 else
Potin Lai27083c32022-06-02 19:13:24 +0800312 TMP_HOST_ST="$HOST_ST_UNKNOW"
Potin Laidc251662022-04-01 11:16:50 +0800313 fi
314
315 if [ "$CUR_HOST_ST" == "$TMP_HOST_ST" ]; then
316 CHECK_CNT=$((CHECK_CNT+1))
317 else
318 CUR_HOST_ST=$TMP_HOST_ST
319 CHECK_CNT=0
320 fi
321
322 if [ "$CHECK_CNT" -ge 5 ]; then
323 echo "$CUR_HOST_ST"
324 break
325 fi
326 else
327 MDIO_ERR_CNT=$((MDIO_ERR_CNT+1))
328 if [ "$MDIO_ERR_CNT" -ge 5 ]; then
329 echo "$HOST_ST_UNKNOW"
330 return 1
331 fi
332 fi
333 done
334
335 return 0
336}
337
Potin Laibb91c1b2022-04-28 15:03:05 +0800338function get_host_status()
339{
340 local sled_num=$1
Potin Laibb91c1b2022-04-28 15:03:05 +0800341
Potin Lai27083c32022-06-02 19:13:24 +0800342 if [ "$(get_ac_status "$SLED_NUM")" == "$HOST_AC_OFF" ];then
343 echo "$HOST_AC_OFF"
344 return 0
345 fi
Potin Laibb91c1b2022-04-28 15:03:05 +0800346
Potin Lai27083c32022-06-02 19:13:24 +0800347 if [ "$(get_board_rev)" = "$REV_EVT" ]; then
Potin Laibb91c1b2022-04-28 15:03:05 +0800348 get_host_status_dbus "$sled_num"
349 else
350 get_host_status_mdio "$sled_num"
351 fi
Potin Laibb91c1b2022-04-28 15:03:05 +0800352 return $?
353}
354
Potin Lai27083c32022-06-02 19:13:24 +0800355function do_action_ac_on()
356{
357 local SLED_NUM=$1
358 echo "sled${SLED_NUM}: turn on AC"
359 set_gpio "power-host${SLED_NUM}" 1
360 echo "$ACTION_AC_ON" > "/tmp/sled${SLED_NUM}-last-action"
361}
362
363function do_action_ac_off()
364{
365 local SLED_NUM=$1
366 echo "sled${SLED_NUM}: turn off AC"
367 set_gpio "power-host${SLED_NUM}" 0
368 echo "$ACTION_AC_OFF" > "/tmp/sled${SLED_NUM}-last-action"
369}
370
371function do_action_on()
372{
373 local SLED_NUM=$1
374 echo "sled${SLED_NUM}: power on host"
375 trigger_power_button "$SLED_NUM" "$DELAY_POWER_ON"
376 echo "$ACTION_ON" > "/tmp/sled${SLED_NUM}-last-action"
377}
378
379function do_action_off()
380{
381 local SLED_NUM=$1
382 echo "sled${SLED_NUM}: power off host"
383 trigger_power_button "$SLED_NUM" "$DELAY_POWER_OFF"
384 echo "$ACTION_OFF" > "/tmp/sled${SLED_NUM}-last-action"
385}
386
387function do_action_recovery()
388{
389 local SLED_NUM=$1
390 echo "sled${SLED_NUM}: trigger host recovery mode"
391 trigger_power_button "$SLED_NUM" "$DELAY_POWER_RECOVERY_MODE"
392 echo "$ACTION_RECOVERY" > "/tmp/sled${SLED_NUM}-last-action"
393}
394
395function do_action_dfu()
396{
397 local SLED_NUM=$1
398 echo "sled${SLED_NUM}: trigger host dfu mode"
399
400 # turn ac off, and hold for 25 seconds
401 do_action_ac_off "$SLED_NUM"
402 sleep 25
403
404 # press power button
405 echo "SLED$SLED_NUM: pressing power button"
406 if ! press_power_button "$SLED_NUM"; then
407 echo "SLED$SLED_NUM: press power button failed"
408 echo "SLED$SLED_NUM: releasing power button"
409 release_power_button "$SLED_NUM"
410 exit 1
411 fi
412 sleep 1
413
414 # turn ac on
415 echo "SLED$SLED_NUM: turn ac-on"
416 do_action_ac_on "$SLED_NUM"
417 sleep 3
418
419 # release power button
420 echo "SLED$SLED_NUM: releasing host power button"
421 if ! release_power_button "$SLED_NUM"; then
422 echo "SLED$SLED_NUM: release power button failed"
423 exit 1
424 fi
425 echo "$ACTION_DFU" > "/tmp/sled${SLED_NUM}-last-action"
426}
427
428function host_state_on_action_handler()
429{
430 local SLED_NUM=$1
431 local ACTION=$2
432
433 case $ACTION in
434 "$ACTION_OFF")
435 do_action_off "$SLED_NUM"
436 ;;
437 "$ACTION_AC_OFF")
438 do_action_ac_off "$SLED_NUM"
439 ;;
440 *)
441 echo "Invalid action ($ACTION) for current host state (On)"
442 return 1
443 ;;
444 esac
445}
446
447function host_state_sleep_action_handler()
448{
449 local SLED_NUM=$1
450 local ACTION=$2
451
452 case $ACTION in
453 "$ACTION_ON")
454 do_action_on "$SLED_NUM"
455 ;;
456 "$ACTION_OFF")
457 do_action_off "$SLED_NUM"
458 ;;
459 "$ACTION_AC_OFF")
460 do_action_ac_off "$SLED_NUM"
461 ;;
462 *)
463 echo "Invalid action ($ACTION) for current host state (Sleep)"
464 return 1
465 ;;
466 esac
467}
468
469function host_state_off_action_handler()
470{
471 local SLED_NUM=$1
472 local ACTION=$2
473
474 case $ACTION in
475 "$ACTION_ON")
476 do_action_on "$SLED_NUM"
477 ;;
478 "$ACTION_RECOVERY")
479 do_action_recovery "$SLED_NUM"
480 ;;
481 "$ACTION_AC_OFF")
482 do_action_ac_off "$SLED_NUM"
483 ;;
484 *)
485 echo "Invalid action ($ACTION) for current host state (Off)"
486 return 1
487 ;;
488 esac
489}
490
491function host_state_ac_off_action_handler()
492{
493 local SLED_NUM=$1
494 local ACTION=$2
495
496 case $ACTION in
497 "$ACTION_AC_ON")
498 do_action_ac_on "$SLED_NUM"
499 ;;
500 "$ACTION_DFU")
501 do_action_dfu "$SLED_NUM"
502 ;;
503 "$ACTION_AC_OFF")
504 echo "sled${SLED_NUM}: already ac off"
505 return 1
506 ;;
507 *)
508 echo "Invalid action ($ACTION) for current host state (AC Off)"
509 return 1
510 ;;
511 esac
512}
513
514function host_state_ac_on_action_handler()
515{
516 local SLED_NUM=$1
517 local ACTION=$2
518
519 case $ACTION in
520 "$ACTION_AC_OFF")
521 do_action_ac_off "$SLED_NUM"
522 ;;
523 *)
524 echo "sled${SLED_NUM}: already ac on"
525 return 1
526 ;;
527 esac
528}
529
530function host_state_recovery_action_handler()
531{
532 local SLED_NUM=$1
533 local ACTION=$2
534
535 case $ACTION in
536 "$ACTION_OFF")
537 do_action_off "$SLED_NUM"
538 ;;
539 "$ACTION_AC_OFF")
540 do_action_ac_off "$SLED_NUM"
541 ;;
542 *)
543 echo "Invalid action ($ACTION) for current host state (Recovery)"
544 return 1
545 ;;
546 esac
547}
548
549function host_state_dfu_action_handler()
550{
551 local SLED_NUM=$1
552 local ACTION=$2
553
554 case $ACTION in
555 "$ACTION_AC_OFF")
556 do_action_ac_off "$SLED_NUM"
557 ;;
558 *)
559 echo "Invalid action ($ACTION) for current host state (DFU)"
560 return 1
561 ;;
562 esac
563}
564
Potin Laidc251662022-04-01 11:16:50 +0800565function create_dev_mem()
566{
567 CHECK_CNT=0
568 while true
569 do
570 CHECK_CNT=$((CHECK_CNT+1))
571 if [ -c /dev/mem ]; then
572 # /dev/mem already exist
573 return 0
574 elif mknod /dev/mem c 1 1; then
575 # mknod success
576 return 0
577 elif [ "$CHECK_CNT" -ge 5 ]; then
578 break
579 fi
580 sleep 1
581 done
582
583 echo "create /dev/mem failed"
584 return 1
585}
586
Allen.Wang4a0948d2021-12-15 13:41:18 +0800587function show_usage(){
Potin Lai27083c32022-06-02 19:13:24 +0800588 echo "Usage: power-ctrl [sled1 | sled2 | sled3 | sled4 | sled5 | sled6] [$VALID_SLED_ACTIONS]"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800589 echo " power-ctrl chassis-cycle"
590}
591
Potin Lai27083c32022-06-02 19:13:24 +0800592
Allen.Wang4a0948d2021-12-15 13:41:18 +0800593if [ $# -eq 1 ]; then
594 if [ "$1" = "chassis-cycle" ];then
595 echo "chassis cycle...."
596 i2cset -y -f 12 0x11 0xd9 c
597 exit 0
598 else
599 echo "Invalid argument: [ $1 ]"
600 show_usage
601 exit 1;
602 fi
603fi
604
605if [ $# -gt 2 ]; then
606 echo "Too many arguments"
607 show_usage
608 exit 1;
609fi
610
Allen.Wang5ff992e2022-01-04 21:00:38 +0800611if [[ "$1" =~ ^(sled[1-6]{1})$ ]]; then
Allen.Wang4a0948d2021-12-15 13:41:18 +0800612 SLED=$1
613 ACTION=$2
614 SLED_NUM=${SLED:4}
615else
616 echo "invalid sled name: ${1}"
617 show_usage
618 exit 1;
619fi
620
621#Check if sled is present
622SLED_PRESENT=$(get_gpio "presence-sled${SLED_NUM}")
623if [ "$SLED_PRESENT" != 0 ];then
624 echo "${SLED} is not present!"
625 exit 1
Potin Lai27083c32022-06-02 19:13:24 +0800626elif ! is_valid_sled_action "$ACTION"; then
627 echo "Unknown action: $ACTION"
628 show_usage
629 exit 1
Allen.Wang4a0948d2021-12-15 13:41:18 +0800630fi
631
Potin Lai27083c32022-06-02 19:13:24 +0800632HOST_CURR_STATUS=$(get_host_status "$SLED_NUM")
633if [ "$ACTION" = "$ACTION_STATUS" ];then
634 echo "$HOST_CURR_STATUS"
Allen.Wang4a0948d2021-12-15 13:41:18 +0800635else
Potin Lai27083c32022-06-02 19:13:24 +0800636 case $HOST_CURR_STATUS in
637 "$HOST_AC_OFF")
638 host_state_ac_off_action_handler "$SLED_NUM" "$ACTION"
639 ;;
640 "$HOST_AC_ON")
641 host_state_ac_on_action_handler "$SLED_NUM" "$ACTION"
642 ;;
643 "$HOST_ST_OFF")
644 host_state_off_action_handler "$SLED_NUM" "$ACTION"
645 ;;
646 "$HOST_ST_ON")
647 host_state_on_action_handler "$SLED_NUM" "$ACTION"
648 ;;
649 "$HOST_ST_SLEEP")
650 host_state_sleep_action_handler "$SLED_NUM" "$ACTION"
651 ;;
652 "$HOST_ST_DFU")
653 host_state_dfu_action_handler "$SLED_NUM" "$ACTION"
654 ;;
655 "$HOST_ST_RECOVERY")
656 host_state_recovery_action_handler "$SLED_NUM" "$ACTION"
657 ;;
658 esac
Allen.Wang4a0948d2021-12-15 13:41:18 +0800659fi