@@ -1227,34 +1227,25 @@ struct smart_log_add_item {
12271227 char * attr ;
12281228};
12291229
1230- struct __packed wear_level {
1231- __le16 min ;
1232- __le16 max ;
1233- __le16 avg ;
1230+ struct __packed raw_array {
1231+ __le16 r0 ;
1232+ __le16 r2 ;
1233+ __le16 r4 ;
1234+ };
1235+
1236+ struct __packed raw_array1 {
1237+ __le32 r0 ;
1238+ __le16 r4 ;
12341239};
12351240
12361241struct __packed smart_log_add_item_12 {
12371242 uint8_t id ;
1238- uint8_t rsvd [2 ];
1243+ uint8_t rsvd1 [2 ];
12391244 uint8_t norm ;
1240- uint8_t rsvd1 ;
1245+ uint8_t rsvd11 ;
12411246 union {
1242- struct wear_level wear_level ; // 0xad
1243- struct __packed temp_since_born { // 0xe7
1244- __le16 max ;
1245- __le16 min ;
1246- __le16 curr ;
1247- } temp_since_born ;
1248- struct __packed power_consumption { // 0xe8
1249- __le16 max ;
1250- __le16 min ;
1251- __le16 curr ;
1252- } power_consumption ;
1253- struct __packed temp_since_power_on { // 0xaf
1254- __le16 max ;
1255- __le16 min ;
1256- __le16 curr ;
1257- } temp_since_power_on ;
1247+ struct raw_array ra ;
1248+ struct raw_array1 ra1 ;
12581249 uint8_t raw [6 ];
12591250 };
12601251 uint8_t rsvd2 ;
@@ -1264,10 +1255,11 @@ struct __packed smart_log_add_item_10 {
12641255 uint8_t id ;
12651256 uint8_t norm ;
12661257 union {
1267- struct wear_level wear_level ; // 0xad
1268- uint8_t raw [6 ];
1258+ struct raw_array ra ;
1259+ struct raw_array1 ra1 ;
1260+ uint8_t raw [6 ];
12691261 };
1270- uint8_t rsvd [2 ];
1262+ uint8_t rsvd8 [2 ];
12711263};
12721264
12731265struct __packed smart_log_add {
@@ -1330,9 +1322,11 @@ struct __packed smart_log_add {
13301322 struct smart_log_add_item_12 power_consumption ;
13311323 struct smart_log_add_item_12 temp_since_bootup ;
13321324 struct smart_log_add_item_12 thermal_throttle_time ;
1325+ struct smart_log_add_item_12 capacitor_capacitance ;
1326+ struct smart_log_add_item_12 free_xblock_status ;
13331327 } v2 ;
13341328
1335- struct smart_log_add_item_12 v2_raw [27 ];
1329+ struct smart_log_add_item_12 v2_raw [29 ];
13361330 };
13371331
13381332 union {
@@ -1348,20 +1342,27 @@ struct __packed smart_log_add {
13481342 struct smart_log_add_item_10 uncorrectable_sector_count ;
13491343 struct smart_log_add_item_10 nand_uecc_detection ;
13501344 struct smart_log_add_item_10 nand_xor_correction ;
1345+ struct smart_log_add_item_10 rsvd11 ;
13511346 struct smart_log_add_item_10 gc_count ;
13521347 struct smart_log_add_item_10 dram_uecc_detection_count ;
13531348 struct smart_log_add_item_10 sram_uecc_detection_count ;
13541349 struct smart_log_add_item_10 internal_raid_recovery_fail_count ;
13551350 struct smart_log_add_item_10 inflight_cmds ;
13561351 struct smart_log_add_item_10 internal_e2e_err_count ;
1352+ struct smart_log_add_item_10 rsvd18 ;
13571353 struct smart_log_add_item_10 die_fail_count ;
13581354 struct smart_log_add_item_10 wear_leveling_execution_count ;
13591355 struct smart_log_add_item_10 read_disturb_count ;
13601356 struct smart_log_add_item_10 data_retention_count ;
13611357 struct smart_log_add_item_10 capacitor_health ;
1358+ struct smart_log_add_item_10 dram_cecc_count ;
1359+ struct smart_log_add_item_10 dram_cecc_address ;
1360+ struct smart_log_add_item_10 sram_cecc_count ;
1361+ struct smart_log_add_item_10 sram_cecc_address ;
1362+ struct smart_log_add_item_10 write_throttle_status ;
13621363 } v3 ;
13631364
1364- struct smart_log_add_item_10 v3_raw [24 ];
1365+ struct smart_log_add_item_10 v3_raw [29 ];
13651366 };
13661367
13671368 uint8_t raw [512 ];
@@ -1403,33 +1404,33 @@ static void smart_log_add_v0_print(struct smart_log_add_item_12 *item, int item_
14031404 switch (item -> id ) {
14041405 case 0xad :
14051406 printf ("min: %d, max: %d, avg: %d\n" ,
1406- le16_to_cpu (item -> wear_level . min ),
1407- le16_to_cpu (item -> wear_level . max ),
1408- le16_to_cpu (item -> wear_level . avg ));
1407+ le16_to_cpu (item -> ra . r0 ),
1408+ le16_to_cpu (item -> ra . r2 ),
1409+ le16_to_cpu (item -> ra . r4 ));
14091410 break ;
14101411 case 0xe7 :
14111412 printf ("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n" ,
1412- K2C (le16_to_cpu (item -> temp_since_born . max )),
1413- le16_to_cpu (item -> temp_since_born . max ),
1414- K2C (le16_to_cpu (item -> temp_since_born . min )),
1415- le16_to_cpu (item -> temp_since_born . min ),
1416- K2C (le16_to_cpu (item -> temp_since_born . curr )),
1417- le16_to_cpu (item -> temp_since_born . curr ));
1413+ K2C (le16_to_cpu (item -> ra . r0 )),
1414+ le16_to_cpu (item -> ra . r0 ),
1415+ K2C (le16_to_cpu (item -> ra . r2 )),
1416+ le16_to_cpu (item -> ra . r2 ),
1417+ K2C (le16_to_cpu (item -> ra . r4 )),
1418+ le16_to_cpu (item -> ra . r4 ));
14181419 break ;
14191420 case 0xe8 :
14201421 printf ("max: %d, min: %d, curr: %d\n" ,
1421- le16_to_cpu (item -> power_consumption . max ),
1422- le16_to_cpu (item -> power_consumption . min ),
1423- le16_to_cpu (item -> power_consumption . curr ));
1422+ le16_to_cpu (item -> ra . r0 ),
1423+ le16_to_cpu (item -> ra . r2 ),
1424+ le16_to_cpu (item -> ra . r4 ));
14241425 break ;
14251426 case 0xaf :
14261427 printf ("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n" ,
1427- K2C (le16_to_cpu (item -> temp_since_power_on . max )),
1428- le16_to_cpu (item -> temp_since_power_on . max ),
1429- K2C (le16_to_cpu (item -> temp_since_power_on . min )),
1430- le16_to_cpu (item -> temp_since_power_on . min ),
1431- K2C (le16_to_cpu (item -> temp_since_power_on . curr )),
1432- le16_to_cpu (item -> temp_since_power_on . curr ));
1428+ K2C (le16_to_cpu (item -> ra . r0 )),
1429+ le16_to_cpu (item -> ra . r0 ),
1430+ K2C (le16_to_cpu (item -> ra . r2 )),
1431+ le16_to_cpu (item -> ra . r2 ),
1432+ K2C (le16_to_cpu (item -> ra . r4 )),
1433+ le16_to_cpu (item -> ra . r4 ));
14331434 break ;
14341435 default :
14351436 printf ("%" PRIu64 "\n" , int48_to_long (item -> raw ));
@@ -1468,6 +1469,8 @@ static void smart_log_add_v2_print(struct smart_log_add_item_12 *item, int item_
14681469 [0xe8 ] = {24 , "power_consumption" },
14691470 [0xaf ] = {25 , "temp_since_bootup" },
14701471 [0xeb ] = {26 , "thermal_throttle_time" },
1472+ [0xec ] = {27 , "capacitor_capacitance" },
1473+ [0xed ] = {28 , "free_xblock_status" },
14711474 };
14721475
14731476 for (int i = 0 ; i < item_count ; i ++ , item ++ ) {
@@ -1478,33 +1481,44 @@ static void smart_log_add_v2_print(struct smart_log_add_item_12 *item, int item_
14781481 switch (item -> id ) {
14791482 case 0xad :
14801483 printf ("min: %d, max: %d, avg: %d\n" ,
1481- le16_to_cpu (item -> wear_level . min ),
1482- le16_to_cpu (item -> wear_level . max ),
1483- le16_to_cpu (item -> wear_level . avg ));
1484+ le16_to_cpu (item -> ra . r0 ),
1485+ le16_to_cpu (item -> ra . r2 ),
1486+ le16_to_cpu (item -> ra . r4 ));
14841487 break ;
14851488 case 0xe7 :
14861489 printf ("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n" ,
1487- K2C (le16_to_cpu (item -> temp_since_born . max )),
1488- le16_to_cpu (item -> temp_since_born . max ),
1489- K2C (le16_to_cpu (item -> temp_since_born . min )),
1490- le16_to_cpu (item -> temp_since_born . min ),
1491- K2C (le16_to_cpu (item -> temp_since_born . curr )),
1492- le16_to_cpu (item -> temp_since_born . curr ));
1490+ K2C (le16_to_cpu (item -> ra . r0 )),
1491+ le16_to_cpu (item -> ra . r0 ),
1492+ K2C (le16_to_cpu (item -> ra . r2 )),
1493+ le16_to_cpu (item -> ra . r2 ),
1494+ K2C (le16_to_cpu (item -> ra . r4 )),
1495+ le16_to_cpu (item -> ra . r4 ));
14931496 break ;
14941497 case 0xe8 :
14951498 printf ("max: %d, min: %d, curr: %d\n" ,
1496- le16_to_cpu (item -> power_consumption . max ),
1497- le16_to_cpu (item -> power_consumption . min ),
1498- le16_to_cpu (item -> power_consumption . curr ));
1499+ le16_to_cpu (item -> ra . r0 ),
1500+ le16_to_cpu (item -> ra . r2 ),
1501+ le16_to_cpu (item -> ra . r4 ));
14991502 break ;
15001503 case 0xaf :
15011504 printf ("max: %d °C (%d K), min: %d °C (%d K), curr: %d °C (%d K)\n" ,
1502- K2C (le16_to_cpu (item -> temp_since_power_on .max )),
1503- le16_to_cpu (item -> temp_since_power_on .max ),
1504- K2C (le16_to_cpu (item -> temp_since_power_on .min )),
1505- le16_to_cpu (item -> temp_since_power_on .min ),
1506- K2C (le16_to_cpu (item -> temp_since_power_on .curr )),
1507- le16_to_cpu (item -> temp_since_power_on .curr ));
1505+ K2C (le16_to_cpu (item -> ra .r0 )),
1506+ le16_to_cpu (item -> ra .r0 ),
1507+ K2C (le16_to_cpu (item -> ra .r2 )),
1508+ le16_to_cpu (item -> ra .r2 ),
1509+ K2C (le16_to_cpu (item -> ra .r4 )),
1510+ le16_to_cpu (item -> ra .r4 ));
1511+ break ;
1512+ case 0xeb :
1513+ printf ("throttle status: %d, total throttling time: %d\n" ,
1514+ item -> raw [0 ],
1515+ le32_to_cpu (* (uint32_t * )& item -> raw [1 ]));
1516+ break ;
1517+ case 0xec :
1518+ printf ("current: %d, norminal: %d, threshold: %d\n" ,
1519+ le16_to_cpu (item -> ra .r0 ),
1520+ le16_to_cpu (item -> ra .r2 ),
1521+ le16_to_cpu (item -> ra .r4 ));
15081522 break ;
15091523 default :
15101524 printf ("%" PRIu64 "\n" , int48_to_long (item -> raw ));
@@ -1538,6 +1552,11 @@ static void smart_log_add_v3_print(struct smart_log_add_item_10 *item, int item_
15381552 [0xdc ] = {21 , "read_disturb_count" },
15391553 [0xdd ] = {22 , "data_retention_count" },
15401554 [0xde ] = {23 , "capacitor_health" },
1555+ [0xf6 ] = {24 , "dram_cecc_count" },
1556+ [0xf7 ] = {25 , "dram_cecc_address" },
1557+ [0xf8 ] = {26 , "sram_cecc_count" },
1558+ [0xf9 ] = {27 , "sram_cecc_address" },
1559+ [0xfa ] = {28 , "write_throttle_status" },
15411560 };
15421561
15431562 for (int i = 0 ; i < item_count ; i ++ , item ++ ) {
@@ -1548,9 +1567,19 @@ static void smart_log_add_v3_print(struct smart_log_add_item_10 *item, int item_
15481567 switch (item -> id ) {
15491568 case 0xad :
15501569 printf ("min: %d, max: %d, avg: %d\n" ,
1551- le16_to_cpu (item -> wear_level .min ),
1552- le16_to_cpu (item -> wear_level .max ),
1553- le16_to_cpu (item -> wear_level .avg ));
1570+ le16_to_cpu (item -> ra .r0 ),
1571+ le16_to_cpu (item -> ra .r2 ),
1572+ le16_to_cpu (item -> ra .r4 ));
1573+ break ;
1574+ case 0xf6 :
1575+ case 0xf8 :
1576+ case 0xf9 :
1577+ printf ("%d\n" , le32_to_cpu (item -> ra1 .r0 ));
1578+ break ;
1579+ case 0xfa :
1580+ printf ("curr: %d, total: %d\n" ,
1581+ le16_to_cpu (item -> ra .r0 ),
1582+ le16_to_cpu (item -> ra .r2 ));
15541583 break ;
15551584 default :
15561585 printf ("%" PRIu64 "\n" , int48_to_long (item -> raw ));
0 commit comments