@@ -3773,7 +3773,26 @@ enum nvme_err_status_field {
37733773 * reached. A value of %0h, indicates that this transition
37743774 * has never occurred or this field is not implemented.
37753775 * @thm_temp2_total_time: Total Time For Thermal Management Temperature 2
3776- * @rsvd232: Reserved
3776+ * @op_lifetime_energy_consumed: Operational Lifetime Energy Consumed: Contains
3777+ * the cumulative operational energy consumed by the NVM
3778+ * subsystem in watt-hours calculated from all interval
3779+ * power measurements collected from the time of
3780+ * manufacture to the point that this log page is read.
3781+ * This value is rounded up (e.g., two indicates the
3782+ * number of watt-hours consumed is greater than 1 and
3783+ * less than or equal to 2). This field shall not wrap
3784+ * once the value %FFFFFFFFFFFFFFFFh is reached. A value
3785+ * of %0h indicates that the cumulative operational energy
3786+ * consumed is not reported.
3787+ * @interval_power_measurement: Interval Power Measurement: Contains the average
3788+ * of power measurement samples over the most recent one
3789+ * second interval at the time of processing the Get Log
3790+ * Page command. The power in Watts is equal to the
3791+ * Interval Power Measurement Value (bits 15:0) multiplied
3792+ * by the scale indicated in the Interval Power Measurement
3793+ * Scale field (bits 17:16). A value of %0h indicates that
3794+ * the interval power measurement is not reported.
3795+ * @rsvd244: Reserved
37773796 */
37783797struct nvme_smart_log {
37793798 __u8 critical_warning ;
@@ -3800,7 +3819,9 @@ struct nvme_smart_log {
38003819 __le32 thm_temp2_trans_count ;
38013820 __le32 thm_temp1_total_time ;
38023821 __le32 thm_temp2_total_time ;
3803- __u8 rsvd232 [280 ];
3822+ __le64 op_lifetime_energy_consumed ;
3823+ __le32 interval_power_measurement ;
3824+ __u8 rsvd244 [268 ];
38043825};
38053826
38063827/**
@@ -4669,6 +4690,23 @@ struct nvme_timestamp {
46694690 __u8 rsvd ;
46704691};
46714692
4693+ /**
4694+ * enum nvme_timestamp_attr - Timestamp Attribute field
4695+ * @NVME_TIMESTAMP_ATTR_SYNC_SHIFT: Shift amount to get the timestamp synch
4696+ * @NVME_TIMESTAMP_ATTR_TO_SHIFT: Shift amount to get the timestamp origin
4697+ * @NVME_TIMESTAMP_ATTR_SYNC_MASK: Mask to get the timestamp synch
4698+ * @NVME_TIMESTAMP_ATTR_TO_MASK: Mask to get the timestamp origin
4699+ */
4700+ enum nvme_timestamp_attr {
4701+ NVME_TIMESTAMP_ATTR_SYNC_SHIFT = 0 ,
4702+ NVME_TIMESTAMP_ATTR_TO_SHIFT = 1 ,
4703+ NVME_TIMESTAMP_ATTR_SYNC_MASK = 0x1 ,
4704+ NVME_TIMESTAMP_ATTR_TO_MASK = 0x7 ,
4705+ };
4706+
4707+ #define NVME_TIMESTAMP_ATTR_SYNC (attr ) NVME_GET(attr, TIMESTAMP_ATTR_SYNC)
4708+ #define NVME_TIMESTAMP_ATTR_TO (attr ) NVME_GET(attr, TIMESTAMP_ATTR_TO)
4709+
46724710/**
46734711 * struct nvme_time_stamp_change_event - Timestamp Change Event
46744712 * @previous_timestamp: Previous Timestamp
@@ -6102,6 +6140,113 @@ struct nvme_fdp_ruh_status {
61026140 struct nvme_fdp_ruh_status_desc ruhss [];
61036141};
61046142
6143+ /**
6144+ * enum nvme_pma - Power Measurement Attributes (PMA) field
6145+ * @NVME_PMA_PME_SHIFT: Shift amount to get the power measurement enable
6146+ * @NVME_PMA_NCPDF_SHIFT: Shift amount to get the non-contiguous power data flag
6147+ * @NVME_PMA_EPF_SHIFT: Shift amount to get the estimated power flag
6148+ * @NVME_PMA_MIPWRTS_SHIFT: Shift amount to get the maximum interval power timestamp support
6149+ * @NVME_PMA_PHDO_SHIFT: Shift amount to get the power histogram descriptor overflow
6150+ * @NVME_PMA_PMT_SHIFT: Shift amount to get the power measurement type
6151+ * @NVME_PMA_PME_MASK: Mask to get the power measurement enable
6152+ * @NVME_PMA_NCPDF_MASK: Mask to get the non-contiguous power data flag
6153+ * @NVME_PMA_EPF_MASK: Mask to get the estimated power flag
6154+ * @NVME_PMA_MIPWRTS_MASK: Mask to get the maximum interval power timestamp support
6155+ * @NVME_PMA_PHDO_MASK: Mask to get the power histogram descriptor overflow
6156+ * @NVME_PMA_PMT_MASK: Mask to get the power measurement type
6157+ */
6158+ enum nvme_pma {
6159+ NVME_PMA_PME_SHIFT = 0 ,
6160+ NVME_PMA_NCPDF_SHIFT = 1 ,
6161+ NVME_PMA_EPF_SHIFT = 2 ,
6162+ NVME_PMA_MIPWRTS_SHIFT = 3 ,
6163+ NVME_PMA_PHDO_SHIFT = 4 ,
6164+ NVME_PMA_PMT_SHIFT = 12 ,
6165+ NVME_PMA_PME_MASK = 0x1 ,
6166+ NVME_PMA_NCPDF_MASK = 0x1 ,
6167+ NVME_PMA_EPF_MASK = 0x1 ,
6168+ NVME_PMA_MIPWRTS_MASK = 0x1 ,
6169+ NVME_PMA_PHDO_MASK = 0x1 ,
6170+ NVME_PMA_PMT_MASK = 0xf ,
6171+ };
6172+
6173+ /**
6174+ * struct nvme_power_histogram_desc - Power Histogram Descriptor
6175+ * @phbc: Power Histogram Bin Count. Does not wrap after %FFFFFFFFh.
6176+ * Cleared to %0h if PMC is %0h.
6177+ * @phblt: Power Histogram Bin Lower Threshold. Bits 17:16 are PWRS
6178+ * (see &enum nvme_psd_ps), bits 15:0 are PWRV.
6179+ */
6180+ struct nvme_power_histogram_desc {
6181+ __le32 phbc ;
6182+ __le32 phblt ;
6183+ };
6184+
6185+ /**
6186+ * struct nvme_power_meas_log - Power Measurement Log Page (Log Identifier 25h)
6187+ * @ver: Version. Shall be cleared to %0h.
6188+ * @pmgn: Power Measurement Generation Number. Incremented each time a
6189+ * Set Features command with Action = %1h (Start Power Measurements)
6190+ * is successfully completed. Rolls over from %FFh to %0h.
6191+ * @pma: Power Measurement Attributes. See &enum nvme_pma.
6192+ * @sze: Size. Indicates the size of this log page in bytes.
6193+ * @pmc: Power Measurement Count. Number of interval power measurements
6194+ * collected. Does not wrap after %FFFFFFFFh. Cleared to %0h when
6195+ * Start Power Measurements succeeds or if no measurement has occurred.
6196+ * @nphd: Number of Power Histogram Descriptors in this log page.
6197+ * @smtr: Stop Measurement Time Remaining. Time remaining in minutes until
6198+ * controller stops collecting interval power measurements.
6199+ * %0h means not specified.
6200+ * @smts: Stop Measurement Timestamp. Timestamp of when interval power
6201+ * measurements stopped being collected. See &struct nvme_timestamp.
6202+ * @phds: Power Histogram Descriptor Size. Size in bytes of each descriptor.
6203+ * @phbs: Power Histogram Bin Size. Size in milliwatts of each bin.
6204+ * Shall be set to 250 milliwatts.
6205+ * @nphds: Number of Power Histogram Descriptors Supported. Maximum number
6206+ * of descriptors that can be reported. If %0h, NPHD shall be
6207+ * cleared to %0h and no descriptors are reported.
6208+ * @vss: Vendor Specific Size. Size in bytes of the Vendor Specific field.
6209+ * @phdoc: Power Histogram Descriptor Overflow Count. Number of interval
6210+ * power measurements greater than the maximum power indicated by
6211+ * the last Power Histogram Descriptor. Does not wrap after %FFFFFFFFh.
6212+ * @rsvd36: Reserved.
6213+ * @aipwr: Average Interval Power. Bits 31:18 are reserved. Bits 17:16
6214+ * contain the Power Scale (PWRS); see &enum nvme_psd_ps. Bits 15:0
6215+ * contain the Power Value (PWRV).
6216+ * @mipwr: Maximum Interval Power. Bits 31:18 are reserved. Bits 17:16
6217+ * contain the Power Scale (PWRS); see &enum nvme_psd_ps. Bits 15:0
6218+ * contain the Power Value (PWRV).
6219+ * @mipwrt: Maximum Interval Power Timestamp. Timestamp of when the maximum
6220+ * interval power was collected. See &struct nvme_timestamp.
6221+ * @ipwrpe: Interval Power Percent Error. Maximum percent error (0-100%).
6222+ * Values 101-254 reserved. 255 indicates not reported.
6223+ * @rsvd57: Reserved.
6224+ * @descs: Power Histogram Descriptors (&struct nvme_power_histogram_desc).
6225+ */
6226+ struct nvme_power_meas_log {
6227+ __u8 ver ;
6228+ __u8 pmgn ;
6229+ __le16 pma ;
6230+ __le32 sze ;
6231+ __le32 pmc ;
6232+ __le16 nphd ;
6233+ __le16 smtr ;
6234+ struct nvme_timestamp smts ;
6235+ __le16 phds ;
6236+ __le16 phbs ;
6237+ __le16 nphds ;
6238+ __le16 vss ;
6239+ __le32 phdoc ;
6240+ __u8 rsvd36 [4 ];
6241+ __le32 aipwr ;
6242+ __le32 mipwr ;
6243+ struct nvme_timestamp mipwrt ;
6244+ __u8 ipwrpe ;
6245+ __u8 rsvd57 [7 ];
6246+ struct nvme_power_histogram_desc descs [];
6247+ };
6248+
6249+
61056250/**
61066251 * struct nvme_lba_status_desc - LBA Status Descriptor Entry
61076252 * @dslba: Descriptor Starting LBA
0 commit comments