ipmi_fru.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistribution of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistribution in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * Neither the name of Sun Microsystems, Inc. or the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * This software is provided "AS IS," without a warranty of any kind.
  20. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  21. * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
  22. * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
  23. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
  24. * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
  25. * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
  26. * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
  27. * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  28. * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  29. * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
  30. * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  31. */
  32. #ifndef IPMI_FRU_H
  33. #define IPMI_FRU_H
  34. #include <inttypes.h>
  35. #include <ipmitool/ipmi.h>
  36. #include <ipmitool/ipmi_sdr.h>
  37. #if HAVE_CONFIG_H
  38. # include <config.h>
  39. #endif
  40. #define GET_FRU_INFO 0x10
  41. #define GET_FRU_DATA 0x11
  42. #define SET_FRU_DATA 0x12
  43. enum {
  44. FRU_CHASSIS_PARTNO,
  45. FRU_CHASSIS_SERIAL,
  46. FRU_BOARD_MANUF,
  47. FRU_BOARD_PRODUCT,
  48. FRU_BOARD_SERIAL,
  49. FRU_BOARD_PARTNO,
  50. FRU_PRODUCT_MANUF,
  51. FRU_PRODUCT_NAME,
  52. FRU_PRODUCT_PARTNO,
  53. FRU_PRODUCT_VERSION,
  54. FRU_PRODUCT_SERIAL,
  55. FRU_PRODUCT_ASSET,
  56. };
  57. struct fru_info {
  58. uint16_t size;
  59. uint8_t access:1;
  60. uint8_t max_read_size;
  61. uint8_t max_write_size;
  62. };
  63. #ifdef HAVE_PRAGMA_PACK
  64. #pragma pack(1)
  65. #endif
  66. struct fru_header {
  67. uint8_t version;
  68. union {
  69. struct {
  70. uint8_t internal;
  71. uint8_t chassis;
  72. uint8_t board;
  73. uint8_t product;
  74. uint8_t multi;
  75. } offset;
  76. uint8_t offsets[5];
  77. };
  78. uint8_t pad;
  79. uint8_t checksum;
  80. }ATTRIBUTE_PACKING;
  81. #ifdef HAVE_PRAGMA_PACK
  82. #pragma pack(0)
  83. #endif
  84. struct fru_area_chassis {
  85. uint8_t area_ver;
  86. uint8_t type;
  87. uint16_t area_len;
  88. char * part;
  89. char * serial;
  90. };
  91. struct fru_area_board {
  92. uint8_t area_ver;
  93. uint8_t lang;
  94. uint16_t area_len;
  95. uint32_t mfg_date_time;
  96. char * mfg;
  97. char * prod;
  98. char * serial;
  99. char * part;
  100. char * fru;
  101. };
  102. struct fru_area_product {
  103. uint8_t area_ver;
  104. uint8_t lang;
  105. uint16_t area_len;
  106. char * mfg;
  107. char * name;
  108. char * part;
  109. char * version;
  110. char * serial;
  111. char * asset;
  112. char * fru;
  113. };
  114. #ifdef HAVE_PRAGMA_PACK
  115. #pragma pack(1)
  116. #endif
  117. struct fru_multirec_header {
  118. #define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
  119. #define FRU_RECORD_TYPE_DC_OUTPUT 0x01
  120. #define FRU_RECORD_TYPE_DC_LOAD 0x02
  121. #define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
  122. #define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
  123. #define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
  124. #define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0
  125. uint8_t type;
  126. uint8_t format;
  127. uint8_t len;
  128. uint8_t record_checksum;
  129. uint8_t header_checksum;
  130. }ATTRIBUTE_PACKING;
  131. #ifdef HAVE_PRAGMA_PACK
  132. #pragma pack(0)
  133. #endif
  134. #ifdef HAVE_PRAGMA_PACK
  135. #pragma pack(1)
  136. #endif
  137. struct fru_multirec_powersupply {
  138. #if WORDS_BIGENDIAN
  139. uint16_t capacity;
  140. #else
  141. uint16_t capacity:12;
  142. uint16_t __reserved1:4;
  143. #endif
  144. uint16_t peak_va;
  145. uint8_t inrush_current;
  146. uint8_t inrush_interval;
  147. uint16_t lowend_input1;
  148. uint16_t highend_input1;
  149. uint16_t lowend_input2;
  150. uint16_t highend_input2;
  151. uint8_t lowend_freq;
  152. uint8_t highend_freq;
  153. uint8_t dropout_tolerance;
  154. #if WORDS_BIGENDIAN
  155. uint8_t __reserved2:3;
  156. uint8_t tach:1;
  157. uint8_t hotswap:1;
  158. uint8_t autoswitch:1;
  159. uint8_t pfc:1;
  160. uint8_t predictive_fail:1;
  161. #else
  162. uint8_t predictive_fail:1;
  163. uint8_t pfc:1;
  164. uint8_t autoswitch:1;
  165. uint8_t hotswap:1;
  166. uint8_t tach:1;
  167. uint8_t __reserved2:3;
  168. #endif
  169. uint16_t peak_cap_ht;
  170. #if WORDS_BIGENDIAN
  171. uint8_t combined_voltage1:4;
  172. uint8_t combined_voltage2:4;
  173. #else
  174. uint8_t combined_voltage2:4;
  175. uint8_t combined_voltage1:4;
  176. #endif
  177. uint16_t combined_capacity;
  178. uint8_t rps_threshold;
  179. }ATTRIBUTE_PACKING;
  180. #ifdef HAVE_PRAGMA_PACK
  181. #pragma pack(0)
  182. #endif
  183. static const char * combined_voltage_desc[] __attribute__((unused)) = {
  184. "12 V", "-12 V", "5 V", "3.3 V"};
  185. #ifdef HAVE_PRAGMA_PACK
  186. #pragma pack(1)
  187. #endif
  188. struct fru_multirec_dcoutput {
  189. #if WORDS_BIGENDIAN
  190. uint8_t standby:1;
  191. uint8_t __reserved:3;
  192. uint8_t output_number:4;
  193. #else
  194. uint8_t output_number:4;
  195. uint8_t __reserved:3;
  196. uint8_t standby:1;
  197. #endif
  198. short nominal_voltage;
  199. short max_neg_dev;
  200. short max_pos_dev;
  201. uint16_t ripple_and_noise;
  202. uint16_t min_current;
  203. uint16_t max_current;
  204. }ATTRIBUTE_PACKING;
  205. #ifdef HAVE_PRAGMA_PACK
  206. #pragma pack(0)
  207. #endif
  208. #ifdef HAVE_PRAGMA_PACK
  209. #pragma pack(1)
  210. #endif
  211. struct fru_multirec_dcload {
  212. #if WORDS_BIGENDIAN
  213. uint8_t __reserved:4;
  214. uint8_t output_number:4;
  215. #else
  216. uint8_t output_number:4;
  217. uint8_t __reserved:4;
  218. #endif
  219. short nominal_voltage;
  220. short min_voltage;
  221. short max_voltage;
  222. uint16_t ripple_and_noise;
  223. uint16_t min_current;
  224. uint16_t max_current;
  225. }ATTRIBUTE_PACKING;
  226. #ifdef HAVE_PRAGMA_PACK
  227. #pragma pack(0)
  228. #endif
  229. #ifdef HAVE_PRAGMA_PACK
  230. #pragma pack(1)
  231. #endif
  232. struct fru_multirec_oem_header {
  233. unsigned char mfg_id[3];
  234. #define FRU_PICMG_BACKPLANE_P2P 0x04
  235. #define FRU_PICMG_ADDRESS_TABLE 0x10
  236. #define FRU_PICMG_SHELF_POWER_DIST 0x11
  237. #define FRU_PICMG_SHELF_ACTIVATION 0x12
  238. #define FRU_PICMG_SHMC_IP_CONN 0x13
  239. #define FRU_PICMG_BOARD_P2P 0x14
  240. #define FRU_AMC_CURRENT 0x16
  241. #define FRU_AMC_ACTIVATION 0x17
  242. #define FRU_AMC_CARRIER_P2P 0x18
  243. #define FRU_AMC_P2P 0x19
  244. #define FRU_AMC_CARRIER_INFO 0x1a
  245. #define FRU_UTCA_FRU_INFO_TABLE 0x20
  246. #define FRU_UTCA_CARRIER_MNG_IP 0x21
  247. #define FRU_UTCA_CARRIER_INFO 0x22
  248. #define FRU_UTCA_CARRIER_LOCATION 0x23
  249. #define FRU_UTCA_SHMC_IP_LINK 0x24
  250. #define FRU_UTCA_POWER_POLICY 0x25
  251. #define FRU_UTCA_ACTIVATION 0x26
  252. #define FRU_UTCA_PM_CAPABILTY 0x27
  253. #define FRU_UTCA_FAN_GEOGRAPHY 0x28
  254. #define FRU_UTCA_CLOCK_MAPPING 0x29
  255. #define FRU_UTCA_MSG_BRIDGE_POLICY 0x2A
  256. #define FRU_UTCA_OEM_MODULE_DESC 0x2B
  257. #define FRU_PICMG_CLK_CARRIER_P2P 0x2C
  258. #define FRU_PICMG_CLK_CONFIG 0x2D
  259. unsigned char record_id;
  260. unsigned char record_version;
  261. }ATTRIBUTE_PACKING;
  262. #ifdef HAVE_PRAGMA_PACK
  263. #pragma pack(0)
  264. #endif
  265. #ifdef HAVE_PRAGMA_PACK
  266. #pragma pack(1)
  267. #endif
  268. struct fru_picmgext_guid {
  269. unsigned char guid[16];
  270. }ATTRIBUTE_PACKING;
  271. #ifdef HAVE_PRAGMA_PACK
  272. #pragma pack(0)
  273. #endif
  274. #ifdef HAVE_PRAGMA_PACK
  275. #pragma pack(1)
  276. #endif
  277. struct fru_picmgext_link_desc {
  278. #ifndef WORDS_BIGENDIAN
  279. unsigned int desig_channel:6;
  280. unsigned int desig_if:2;
  281. unsigned int desig_port:4;
  282. #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
  283. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
  284. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
  285. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
  286. #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
  287. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
  288. unsigned int type:8;
  289. unsigned int ext:4;
  290. unsigned int grouping:8;
  291. #else
  292. unsigned int grouping:8;
  293. unsigned int ext:4;
  294. #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
  295. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
  296. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
  297. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
  298. #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
  299. #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
  300. unsigned int type:8;
  301. unsigned int desig_port:4;
  302. unsigned int desig_if:2;
  303. unsigned int desig_channel:6;
  304. #endif
  305. }ATTRIBUTE_PACKING;
  306. #ifdef HAVE_PRAGMA_PACK
  307. #pragma pack(0)
  308. #endif
  309. #define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00
  310. #define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01
  311. #define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02
  312. #define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03
  313. #define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04
  314. #define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
  315. #define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
  316. #define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
  317. #ifdef HAVE_PRAGMA_PACK
  318. #pragma pack(1)
  319. #endif
  320. /* This is used in command, not in FRU */
  321. struct fru_picmgext_amc_link_info {
  322. unsigned char linkInfo[3];
  323. }ATTRIBUTE_PACKING;
  324. #ifdef HAVE_PRAGMA_PACK
  325. #pragma pack(0)
  326. #endif
  327. #ifdef HAVE_PRAGMA_PACK
  328. #pragma pack(1)
  329. #endif
  330. struct fru_picmgext_amc_link_desc_core {
  331. #ifndef WORDS_BIGENDIAN
  332. unsigned int designator:12;
  333. unsigned int type:8;
  334. unsigned int ext:4;
  335. unsigned int grouping:8;
  336. #else
  337. unsigned int grouping:8;
  338. unsigned int ext:4;
  339. unsigned int type:8;
  340. unsigned int designator:12;
  341. #endif
  342. }ATTRIBUTE_PACKING;
  343. #ifdef HAVE_PRAGMA_PACK
  344. #pragma pack(0)
  345. #endif
  346. #ifdef HAVE_PRAGMA_PACK
  347. #pragma pack(1)
  348. #endif
  349. struct fru_picmgext_amc_link_desc_extra {
  350. #ifndef WORDS_BIGENDIAN
  351. unsigned char asymetricMatch:2;
  352. unsigned char reserved:6;
  353. #else
  354. unsigned char reserved:6;
  355. unsigned char asymetricMatch:2;
  356. #endif
  357. }ATTRIBUTE_PACKING;
  358. #ifdef HAVE_PRAGMA_PACK
  359. #pragma pack(0)
  360. #endif
  361. #ifdef HAVE_PRAGMA_PACK
  362. #pragma pack(1)
  363. #endif
  364. struct fru_picmgext_amc_link_desc {
  365. #ifndef WORDS_BIGENDIAN
  366. struct fru_picmgext_amc_link_desc_core core;/* lsb */
  367. struct fru_picmgext_amc_link_desc_extra extra;
  368. #else
  369. struct fru_picmgext_amc_link_desc_extra extra;
  370. struct fru_picmgext_amc_link_desc_core core;/* lsb */
  371. #endif
  372. }ATTRIBUTE_PACKING;
  373. #ifdef HAVE_PRAGMA_PACK
  374. #pragma pack(0)
  375. #endif
  376. #define FRU_PICMGEXT_OEM_SWFW 0x03
  377. #define OEM_SWFW_NBLOCK_OFFSET 0x05
  378. #define OEM_SWFW_FIELD_START_OFFSET 0x06
  379. #define FRU_PICMGEXT_CHN_DESC_RECORD_SIZE 3
  380. #ifdef HAVE_PRAGMA_PACK
  381. #pragma pack(1)
  382. #endif
  383. struct fru_picmgext_chn_desc {
  384. #ifndef WORDS_BIGENDIAN
  385. unsigned int remote_slot:8;
  386. unsigned int remote_chn:5;
  387. unsigned int local_chn:5;
  388. unsigned int res:14;
  389. #else
  390. unsigned int res:14;
  391. unsigned int local_chn:5;
  392. unsigned int remote_chn:5;
  393. unsigned int remote_slot:8;
  394. #endif
  395. }ATTRIBUTE_PACKING;
  396. #ifdef HAVE_PRAGMA_PACK
  397. #pragma pack(0)
  398. #endif
  399. #ifdef HAVE_PRAGMA_PACK
  400. #pragma pack(1)
  401. #endif
  402. struct fru_picmgext_slot_desc {
  403. unsigned char chan_type;
  404. unsigned char slot_addr;
  405. unsigned char chn_count;
  406. }ATTRIBUTE_PACKING;
  407. #ifdef HAVE_PRAGMA_PACK
  408. #pragma pack(0)
  409. #endif
  410. #define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
  411. #define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
  412. #define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
  413. #define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03
  414. #ifdef HAVE_PRAGMA_PACK
  415. #pragma pack(1)
  416. #endif
  417. struct fru_picmgext_carrier_activation_record {
  418. unsigned short max_internal_curr;
  419. unsigned char allowance_for_readiness;
  420. unsigned char module_activation_record_count;
  421. }ATTRIBUTE_PACKING;
  422. #ifdef HAVE_PRAGMA_PACK
  423. #pragma pack(0)
  424. #endif
  425. #ifdef HAVE_PRAGMA_PACK
  426. #pragma pack(1)
  427. #endif
  428. struct fru_picmgext_activation_record {
  429. unsigned char ibmb_addr;
  430. unsigned char max_module_curr;
  431. unsigned char reserved;
  432. }ATTRIBUTE_PACKING;
  433. #ifdef HAVE_PRAGMA_PACK
  434. #pragma pack(0)
  435. #endif
  436. #ifdef HAVE_PRAGMA_PACK
  437. #pragma pack(1)
  438. #endif
  439. struct fru_picmgext_carrier_p2p_record {
  440. unsigned char resource_id;
  441. unsigned char p2p_count;
  442. }ATTRIBUTE_PACKING;
  443. #ifdef HAVE_PRAGMA_PACK
  444. #pragma pack(0)
  445. #endif
  446. #ifdef HAVE_PRAGMA_PACK
  447. #pragma pack(1)
  448. #endif
  449. struct fru_picmgext_carrier_p2p_descriptor {
  450. #ifndef WORDS_BIGENDIAN
  451. unsigned char remote_resource_id;
  452. unsigned short remote_port:5;
  453. unsigned short local_port:5;
  454. unsigned short reserved:6;
  455. #else
  456. unsigned short reserved:6;
  457. unsigned short local_port:5;
  458. unsigned short remote_port:5;
  459. unsigned char remote_resource_id;
  460. #endif
  461. }ATTRIBUTE_PACKING;
  462. #ifdef HAVE_PRAGMA_PACK
  463. #pragma pack(0)
  464. #endif
  465. #ifdef HAVE_PRAGMA_PACK
  466. #pragma pack(1)
  467. #endif
  468. struct fru_picmgext_amc_p2p_record {
  469. #ifndef WORDS_BIGENDIAN
  470. unsigned char resource_id :4;
  471. unsigned char /* reserved */ :3;
  472. unsigned char record_type :1;
  473. #else
  474. unsigned char record_type :1;
  475. unsigned char /* reserved */ :3;
  476. unsigned char resource_id :4;
  477. #endif
  478. }ATTRIBUTE_PACKING;
  479. #ifdef HAVE_PRAGMA_PACK
  480. #pragma pack(0)
  481. #endif
  482. #define FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE 3
  483. #ifdef HAVE_PRAGMA_PACK
  484. #pragma pack(1)
  485. #endif
  486. struct fru_picmgext_amc_channel_desc_record {
  487. #ifndef WORDS_BIGENDIAN
  488. unsigned int lane0port :5;
  489. unsigned int lane1port :5;
  490. unsigned int lane2port :5;
  491. unsigned int lane3port :5;
  492. unsigned int /* reserved */ :12;
  493. #else
  494. unsigned int /* reserved */ :12;
  495. unsigned int lane3port :5;
  496. unsigned int lane2port :5;
  497. unsigned int lane1port :5;
  498. unsigned int lane0port :5;
  499. #endif
  500. }ATTRIBUTE_PACKING;
  501. #ifdef HAVE_PRAGMA_PACK
  502. #pragma pack(0)
  503. #endif
  504. #define FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE 5
  505. #ifdef HAVE_PRAGMA_PACK
  506. #pragma pack(1)
  507. #endif
  508. struct fru_picmgext_amc_link_desc_record {
  509. #define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE 0x02
  510. #define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS1 0x03
  511. #define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS2 0x04
  512. #define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
  513. #define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
  514. #define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
  515. #define AMC_LINK_TYPE_EXT_PCIE_G1_NSSC 0x00
  516. #define AMC_LINK_TYPE_EXT_PCIE_G1_SSC 0x01
  517. #define AMC_LINK_TYPE_EXT_PCIE_G2_NSSC 0x02
  518. #define AMC_LINK_TYPE_EXT_PCIE_G2_SSC 0x03
  519. #define AMC_LINK_TYPE_EXT_ETH_1000_BX 0x00
  520. #define AMC_LINK_TYPE_EXT_ETH_10G_XAUI 0x01
  521. #define AMC_LINK_TYPE_EXT_STORAGE_FC 0x00
  522. #define AMC_LINK_TYPE_EXT_STORAGE_SATA 0x01
  523. #define AMC_LINK_TYPE_EXT_STORAGE_SAS 0x02
  524. #ifndef WORDS_BIGENDIAN
  525. unsigned int channel_id :8;
  526. unsigned int port_flag_0 :1;
  527. unsigned int port_flag_1 :1;
  528. unsigned int port_flag_2 :1;
  529. unsigned int port_flag_3 :1;
  530. unsigned int type :8;
  531. unsigned int type_ext :4;
  532. unsigned int group_id :8;
  533. unsigned int asym_match :2;
  534. unsigned int /* reserved */ :30;
  535. #else
  536. unsigned int group_id :8;
  537. unsigned int type_ext :4;
  538. unsigned int type :8;
  539. unsigned int port_flag_3 :1;
  540. unsigned int port_flag_2 :1;
  541. unsigned int port_flag_1 :1;
  542. unsigned int port_flag_0 :1;
  543. unsigned int channel_id :8;
  544. unsigned int /* reserved */ :30;
  545. unsigned int asym_match :2;
  546. #endif
  547. }ATTRIBUTE_PACKING;
  548. #ifdef HAVE_PRAGMA_PACK
  549. #pragma pack(0)
  550. #endif
  551. /* FRU Board manufacturing date */
  552. static const uint64_t secs_from_1970_1996 = 820454400;
  553. static const char * chassis_type_desc[] __attribute__((unused)) = {
  554. "Unspecified", "Other", "Unknown",
  555. "Desktop", "Low Profile Desktop", "Pizza Box",
  556. "Mini Tower", "Tower",
  557. "Portable", "LapTop", "Notebook", "Hand Held",
  558. "Docking Station", "All in One", "Sub Notebook",
  559. "Space-saving", "Lunch Box", "Main Server Chassis",
  560. "Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
  561. "Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis",
  562. "Sealed-case PC", "Multi-system Chassis", "CompactPCI",
  563. "AdvancedTCA", "Blade", "Blade Enclosure"
  564. };
  565. typedef struct ipmi_fru_bloc {
  566. struct ipmi_fru_bloc * next;
  567. uint16_t start;
  568. uint16_t size;
  569. uint8_t blocId[32];
  570. } t_ipmi_fru_bloc;
  571. int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
  572. int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
  573. #endif /* IPMI_FRU_H */