@@ -3020,6 +3020,72 @@ static void print_ps_power_and_scale(__le16 ctr_power, __u8 scale)
30203020 }
30213021}
30223022
3023+ static void print_epfrt (__u8 epfrt , __u8 epfr_fqv_ts )
3024+ {
3025+ const char * desc = "emergency power fail recovery time" ;
3026+ int width = 12 + strlen (desc );
3027+ char value [STR_LEN ] = { 0 };
3028+
3029+ switch (epfrt ) {
3030+ case 0 :
3031+ snprintf (value , sizeof (value ), "-" );
3032+ break ;
3033+ case 1 ... 99 :
3034+ snprintf (value , sizeof (value ), "%d (unit: %s)" , epfrt ,
3035+ nvme_time_scale_to_string (epfr_fqv_ts & 0xf ));
3036+ break ;
3037+ default :
3038+ snprintf (value , sizeof (value ), "reserved" );
3039+ break ;
3040+ }
3041+
3042+ printf ("%*s: %s\n" , width , desc , value );
3043+ }
3044+
3045+ static void print_fqvt (__u8 fqvt , __u8 epfr_fqv_ts )
3046+ {
3047+ const char * desc = "forced quiescence vault time" ;
3048+ int width = 12 + strlen (desc );
3049+ char value [STR_LEN ] = { 0 };
3050+
3051+ switch (fqvt ) {
3052+ case 0 :
3053+ snprintf (value , sizeof (value ), "-" );
3054+ break ;
3055+ case 1 ... 99 :
3056+ snprintf (value , sizeof (value ), "%d (unit: %s)" , fqvt ,
3057+ nvme_time_scale_to_string (epfr_fqv_ts >> 4 ));
3058+ break ;
3059+ default :
3060+ snprintf (value , sizeof (value ), "reserved" );
3061+ break ;
3062+ }
3063+
3064+ printf ("%*s: %s\n" , width , desc , value );
3065+ }
3066+
3067+ static void print_epfvt (__u8 epfvt , __u8 epfvts )
3068+ {
3069+ const char * desc = "emergency power fail vault time" ;
3070+ int width = 12 + strlen (desc );
3071+ char value [STR_LEN ] = { 0 };
3072+
3073+ switch (epfvt ) {
3074+ case 0 :
3075+ snprintf (value , sizeof (value ), "-" );
3076+ break ;
3077+ case 1 ... 99 :
3078+ snprintf (value , sizeof (value ), "%d (unit: %s)" , epfvt ,
3079+ nvme_time_scale_to_string (epfvts & 0xf ));
3080+ break ;
3081+ default :
3082+ snprintf (value , sizeof (value ), "reserved" );
3083+ break ;
3084+ }
3085+
3086+ printf ("%*s: %s\n" , width , desc , value );
3087+ }
3088+
30233089static void stdout_id_ctrl_power (struct nvme_id_ctrl * ctrl )
30243090{
30253091 int i ;
@@ -3051,7 +3117,9 @@ static void stdout_id_ctrl_power(struct nvme_id_ctrl *ctrl)
30513117 printf ("\n active_power_workload:" );
30523118 print_psd_workload (ctrl -> psd [i ].apws );
30533119 printf ("\n" );
3054-
3120+ print_epfrt (ctrl -> psd [i ].epfrt , ctrl -> psd [i ].epfr_fqv_ts );
3121+ print_fqvt (ctrl -> psd [i ].fqvt , ctrl -> psd [i ].epfr_fqv_ts );
3122+ print_epfvt (ctrl -> psd [i ].epfvt , ctrl -> psd [i ].epfvts );
30553123 }
30563124}
30573125
0 commit comments