@@ -106,6 +106,7 @@ unsafe impl Discriminant<u8> for AdminIoCqeStatusType {}
106106#[ repr( u8 ) ]
107107enum AdminIoCqeGenericCommandStatus {
108108 SuccessfulCompletion = 0x00 ,
109+ InvalidFieldInCommand = 0x02 ,
109110}
110111unsafe impl Discriminant < u8 > for AdminIoCqeGenericCommandStatus { }
111112
@@ -152,6 +153,95 @@ pub struct AdminIdentifyNvmIdentifyNamespaceResponse {
152153}
153154impl Encode < 4096 > for AdminIdentifyNvmIdentifyNamespaceResponse { }
154155
156+ // Base v2.1, 5.1.12, Figure 202
157+ // MI v2.0, 6.3, Figure 141
158+ #[ derive( Debug , DekuRead , DekuWrite , Eq , PartialEq ) ]
159+ #[ deku( ctx = "endian: Endian, lid: u8" , id = "lid" , endian = "endian" ) ]
160+ #[ repr( u8 ) ]
161+ pub enum AdminGetLogPageLidRequestType {
162+ SupportedLogPages = 0x00 ,
163+ ErrorInformation = 0x01 ,
164+ SmartHealthInformation = 0x02 ,
165+ FeatureIdentifiersSupportedAndEffects = 0x12 ,
166+ }
167+ unsafe impl Discriminant < u8 > for AdminGetLogPageLidRequestType { }
168+
169+ // Base v2.1, 5.1.12.1.1, Figure 203
170+ #[ derive( Debug , DekuRead , DekuWrite ) ]
171+ #[ deku( endian = "little" ) ]
172+ pub struct AdminGetLogPageSupportedLogPagesResponse {
173+ lsids : WireVec < LidSupportedAndEffectsDataStructure , 256 > ,
174+ }
175+ impl Encode < 1024 > for AdminGetLogPageSupportedLogPagesResponse { }
176+
177+ // Base v2.1, 5.1.12.1.1, Figure 204
178+ flags ! {
179+ pub enum LidSupportedAndEffectsFlags : u8 {
180+ Lsupp ,
181+ Ios ,
182+ }
183+ }
184+
185+ // Base v2.1, 5.1.12.1.1, Figure 204
186+ #[ derive( Clone , Copy , Debug , DekuRead , DekuWrite ) ]
187+ #[ deku( ctx = "endian: Endian" , endian = "endian" ) ]
188+ pub struct LidSupportedAndEffectsDataStructure {
189+ flags : WireFlagSet < LidSupportedAndEffectsFlags > ,
190+ #[ deku( seek_from_current = "1" ) ]
191+ lidsp : u16 ,
192+ }
193+
194+ // Base v2.1, 5.1.12.1.3, Figure 206, CW
195+ flags ! {
196+ pub enum CriticalWarning : u8 {
197+ Ascbt ,
198+ Ttc ,
199+ Ndr ,
200+ Amro ,
201+ Vmbf ,
202+ Pmrro ,
203+ }
204+ }
205+
206+ // Base v2.1, 5.1.12.1.3, Figure 206, EGCWS
207+ flags ! {
208+ pub enum EnduranceGroupCriticalWarningSummary : u8 {
209+ Egascbt = 1 << 0 ,
210+ Egdr = 1 << 2 ,
211+ Egro = 1 << 3 ,
212+ }
213+ }
214+
215+ // Base v2.1, 5.1.12.1.3, Figure 206
216+ #[ derive( Debug , Default , DekuRead , DekuWrite ) ]
217+ #[ deku( endian = "little" ) ]
218+ pub struct SmartHealthInformationLogPageResponse {
219+ cw : WireFlagSet < CriticalWarning > ,
220+ ctemp : u16 ,
221+ avsp : u8 ,
222+ avspt : u8 ,
223+ pused : u8 ,
224+ egcws : WireFlagSet < EnduranceGroupCriticalWarningSummary > ,
225+ #[ deku( seek_from_current = "25" ) ]
226+ dur : u128 ,
227+ duw : u128 ,
228+ hrc : u128 ,
229+ hwc : u128 ,
230+ cbt : u128 ,
231+ pwrc : u128 ,
232+ poh : u128 ,
233+ upl : u128 ,
234+ mdie : u128 ,
235+ neile : u128 ,
236+ wctt : u32 ,
237+ cctt : u32 ,
238+ tsen : [ u16 ; 8 ] ,
239+ tmttc : [ u32 ; 2 ] ,
240+ #[ deku( pad_bytes_after = "280" ) ]
241+ tttmt : [ u32 ; 2 ] ,
242+ }
243+ impl Encode < 512 > for SmartHealthInformationLogPageResponse { }
244+
155245// Base v2.1, 5.1.13.1, Figure 311
156246#[ derive( Clone , Copy , Debug , DekuRead , DekuWrite ) ]
157247#[ deku( id_type = "u8" , endian = "endian" , ctx = "endian: Endian" ) ]
0 commit comments