55//! Types for messages sent from SPs to MGS.
66
77use crate :: BadRequestReason ;
8+ use crate :: PowerRailName ;
89use crate :: PowerState ;
910use crate :: RotResponse ;
1011use crate :: RotSlotId ;
@@ -186,6 +187,17 @@ pub enum SpResponse {
186187
187188 /// Default slot as persisted in non-volatile memory
188189 ComponentPersistentSlot ( u16 ) ,
190+
191+ /// PMBus status of a given rail
192+ PmbusStatus ( PMBusStatusResponse ) ,
193+ }
194+
195+ #[ derive(
196+ Clone , Copy , Debug , PartialEq , Serialize , Deserialize , SerializedSize ,
197+ ) ]
198+ pub struct PMBusStatusResponse {
199+ pub rail : PowerRailName ,
200+ pub result : Result < PmbusStatus , PmbusStatusError > ,
189201}
190202
191203/// Identifier for one of of an SP's KSZ8463 management-network-facing ports.
@@ -712,24 +724,25 @@ pub struct TlvPage {
712724 pub total : u32 ,
713725}
714726
727+ #[ derive(
728+ Debug , Clone , Copy , PartialEq , Eq , Serialize , Deserialize , SerializedSize ,
729+ ) ]
730+ pub enum PmbusStatusError { }
731+
715732#[ derive(
716733 Debug , Clone , Copy , PartialEq , Eq , Serialize , Deserialize , SerializedSize ,
717734) ]
718735pub struct PmbusStatus {
719736 pub status_word : u16 ,
720- pub status_vout : u8 ,
721- pub status_iout : u8 ,
722- pub status_temperature : u8 ,
723- pub status_cml : u8 ,
724- pub status_other : u8 ,
725- pub status_input : u8 ,
726- pub status_mfr_specific : u8 ,
727- pub status_fans_1_2 : u8 ,
728- pub status_fans_3_4 : u8 ,
729- }
730-
731- impl PmbusStatus {
732- pub const TAG : tlv:: Tag = tlv:: Tag ( * b"PMBS" ) ;
737+ pub status_vout : Result < u8 , PmbusStatusError > ,
738+ pub status_iout : Result < u8 , PmbusStatusError > ,
739+ pub status_temperature : Result < u8 , PmbusStatusError > ,
740+ pub status_cml : Result < u8 , PmbusStatusError > ,
741+ pub status_other : Result < u8 , PmbusStatusError > ,
742+ pub status_input : Result < u8 , PmbusStatusError > ,
743+ pub status_mfr_specific : Result < u8 , PmbusStatusError > ,
744+ pub status_fans_1_2 : Result < u8 , PmbusStatusError > ,
745+ pub status_fans_3_4 : Result < u8 , PmbusStatusError > ,
733746}
734747
735748/// Types of component details that can be included in the TLV-encoded data of
@@ -749,7 +762,6 @@ pub enum ComponentDetails {
749762 PostCode ( PostCode ) ,
750763 GpioToggleCount ( GpioToggleCount ) ,
751764 Pcie ( PcieRegisterRead ) ,
752- PmbusStatus ( PmbusStatus ) ,
753765}
754766
755767impl ComponentDetails {
@@ -761,7 +773,6 @@ impl ComponentDetails {
761773 ComponentDetails :: PostCode ( _) => PostCode :: TAG ,
762774 ComponentDetails :: GpioToggleCount ( _) => GpioToggleCount :: TAG ,
763775 ComponentDetails :: Pcie ( _) => PcieRegisterRead :: TAG ,
764- ComponentDetails :: PmbusStatus ( _) => PmbusStatus :: TAG ,
765776 }
766777 }
767778
@@ -791,9 +802,6 @@ impl ComponentDetails {
791802 hubpack:: serialize ( buf, code)
792803 }
793804 ComponentDetails :: Pcie ( p) => hubpack:: serialize ( buf, p) ,
794- ComponentDetails :: PmbusStatus ( stat) => {
795- hubpack:: serialize ( buf, stat)
796- }
797805 }
798806 }
799807}
0 commit comments