Skip to content

Commit c006e34

Browse files
committed
nvme: Append "Flags" to CriticalWarning, EnduranceGroupCriticalWarningSummary
Make the naming consistent with almost all the other flag types. Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
1 parent 44662e6 commit c006e34

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/nvme.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub struct LidSupportedAndEffectsDataStructure {
150150

151151
// Base v2.1, 5.1.12.1.3, Figure 206, CW
152152
flags! {
153-
pub enum CriticalWarning: u8 {
153+
pub enum CriticalWarningFlags: u8 {
154154
Ascbt,
155155
Ttc,
156156
Ndr,
@@ -162,7 +162,7 @@ flags! {
162162

163163
// Base v2.1, 5.1.12.1.3, Figure 206, EGCWS
164164
flags! {
165-
pub enum EnduranceGroupCriticalWarningSummary: u8 {
165+
pub enum EnduranceGroupCriticalWarningSummaryFlags: u8 {
166166
Egascbt = 1 << 0,
167167
Egdr = 1 << 2,
168168
Egro = 1 << 3,
@@ -173,12 +173,12 @@ flags! {
173173
#[derive(Debug, Default, DekuRead, DekuWrite)]
174174
#[deku(endian = "little")]
175175
pub struct SmartHealthInformationLogPageResponse {
176-
cw: WireFlagSet<CriticalWarning>,
176+
cw: WireFlagSet<CriticalWarningFlags>,
177177
ctemp: u16,
178178
avsp: u8,
179179
avspt: u8,
180180
pused: u8,
181-
egcws: WireFlagSet<EnduranceGroupCriticalWarningSummary>,
181+
egcws: WireFlagSet<EnduranceGroupCriticalWarningSummaryFlags>,
182182
#[deku(seek_from_current = "25")]
183183
dur: u128,
184184
duw: u128,

src/nvme/mi/dev.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
AdminIdentifyCnsRequestType, AdminIdentifyControllerResponse,
1717
AdminIdentifyNamespaceIdentificationDescriptorListResponse,
1818
AdminIdentifyNvmIdentifyNamespaceResponse, AdminIoCqeGenericCommandStatus,
19-
AdminIoCqeStatus, AdminIoCqeStatusType, ControllerListResponse, CriticalWarning,
19+
AdminIoCqeStatus, AdminIoCqeStatusType, ControllerListResponse, CriticalWarningFlags,
2020
LidSupportedAndEffectsDataStructure, LidSupportedAndEffectsFlags, LogPageAttributes,
2121
NamespaceIdentifierType, SmartHealthInformationLogPageResponse,
2222
mi::{
@@ -970,17 +970,17 @@ impl RequestHandler for AdminGetLogPageRequest {
970970
let mut fs = FlagSet::empty();
971971

972972
if ctlr.spare < ctlr.spare_range.lower {
973-
fs |= CriticalWarning::Ascbt;
973+
fs |= CriticalWarningFlags::Ascbt;
974974
}
975975

976976
if ctlr.temp < ctlr.temp_range.lower || ctlr.temp > ctlr.temp_range.upper {
977-
fs |= CriticalWarning::Ttc;
977+
fs |= CriticalWarningFlags::Ttc;
978978
}
979979

980980
// TODO: NDR
981981

982982
if ctlr.ro {
983-
fs |= CriticalWarning::Amro;
983+
fs |= CriticalWarningFlags::Amro;
984984
}
985985

986986
// TODO: VMBF

0 commit comments

Comments
 (0)