You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ib_mad.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. #ifndef _IPXE_IB_MAD_H
  2. #define _IPXE_IB_MAD_H
  3. /** @file
  4. *
  5. * Infiniband management datagrams
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <ipxe/ib_packet.h>
  11. /*****************************************************************************
  12. *
  13. * Subnet management MADs
  14. *
  15. *****************************************************************************
  16. */
  17. /** A subnet management header
  18. *
  19. * Defined in sections 14.2.1.1 and 14.2.1.2 of the IBA.
  20. */
  21. struct ib_smp_hdr {
  22. uint64_t mkey;
  23. uint16_t slid;
  24. uint16_t dlid;
  25. uint8_t reserved[28];
  26. } __attribute__ (( packed ));
  27. /** Subnet management class version */
  28. #define IB_SMP_CLASS_VERSION 1
  29. /** Subnet management direction bit
  30. *
  31. * This bit resides in the "status" field in the MAD header.
  32. */
  33. #define IB_SMP_STATUS_D_INBOUND 0x8000
  34. /* Subnet management attributes */
  35. #define IB_SMP_ATTR_NOTICE 0x0002
  36. #define IB_SMP_ATTR_NODE_DESC 0x0010
  37. #define IB_SMP_ATTR_NODE_INFO 0x0011
  38. #define IB_SMP_ATTR_SWITCH_INFO 0x0012
  39. #define IB_SMP_ATTR_GUID_INFO 0x0014
  40. #define IB_SMP_ATTR_PORT_INFO 0x0015
  41. #define IB_SMP_ATTR_PKEY_TABLE 0x0016
  42. #define IB_SMP_ATTR_SL_TO_VL_TABLE 0x0017
  43. #define IB_SMP_ATTR_VL_ARB_TABLE 0x0018
  44. #define IB_SMP_ATTR_LINEAR_FORWARD_TABLE 0x0019
  45. #define IB_SMP_ATTR_RANDOM_FORWARD_TABLE 0x001A
  46. #define IB_SMP_ATTR_MCAST_FORWARD_TABLE 0x001B
  47. #define IB_SMP_ATTR_SM_INFO 0x0020
  48. #define IB_SMP_ATTR_VENDOR_DIAG 0x0030
  49. #define IB_SMP_ATTR_LED_INFO 0x0031
  50. #define IB_SMP_ATTR_VENDOR_MASK 0xFF00
  51. /**
  52. * A Node Description attribute
  53. *
  54. * Defined in section 14.2.5.2 of the IBA
  55. */
  56. struct ib_node_desc {
  57. char node_string[64];
  58. } __attribute__ (( packed ));
  59. /** A Node Information attribute
  60. *
  61. * Defined in section 14.2.5.3 of the IBA.
  62. */
  63. struct ib_node_info {
  64. uint8_t base_version;
  65. uint8_t class_version;
  66. uint8_t node_type;
  67. uint8_t num_ports;
  68. union ib_guid sys_guid;
  69. union ib_guid node_guid;
  70. union ib_guid port_guid;
  71. uint16_t partition_cap;
  72. uint16_t device_id;
  73. uint32_t revision;
  74. uint8_t local_port_num;
  75. uint8_t vendor_id[3];
  76. } __attribute__ ((packed));
  77. #define IB_NODE_TYPE_HCA 0x01
  78. #define IB_NODE_TYPE_SWITCH 0x02
  79. #define IB_NODE_TYPE_ROUTER 0x03
  80. /** A GUID Information attribute
  81. *
  82. * Defined in section 14.2.5.5 of the IBA.
  83. */
  84. struct ib_guid_info {
  85. uint8_t guid[8][8];
  86. } __attribute__ (( packed ));
  87. /** A Port Information attribute
  88. *
  89. * Defined in section 14.2.5.6 of the IBA.
  90. */
  91. struct ib_port_info {
  92. uint64_t mkey;
  93. uint8_t gid_prefix[8];
  94. uint16_t lid;
  95. uint16_t mastersm_lid;
  96. uint32_t cap_mask;
  97. uint16_t diag_code;
  98. uint16_t mkey_lease_period;
  99. uint8_t local_port_num;
  100. uint8_t link_width_enabled;
  101. uint8_t link_width_supported;
  102. uint8_t link_width_active;
  103. uint8_t link_speed_supported__port_state;
  104. uint8_t port_phys_state__link_down_def_state;
  105. uint8_t mkey_prot_bits__lmc;
  106. uint8_t link_speed_active__link_speed_enabled;
  107. uint8_t neighbour_mtu__mastersm_sl;
  108. uint8_t vl_cap__init_type;
  109. uint8_t vl_high_limit;
  110. uint8_t vl_arbitration_high_cap;
  111. uint8_t vl_arbitration_low_cap;
  112. uint8_t init_type_reply__mtu_cap;
  113. uint8_t vl_stall_count__hoq_life;
  114. uint8_t operational_vls__enforcement;
  115. uint16_t mkey_violations;
  116. uint16_t pkey_violations;
  117. uint16_t qkey_violations;
  118. uint8_t guid_cap;
  119. uint8_t client_reregister__subnet_timeout;
  120. uint8_t resp_time_value;
  121. uint8_t local_phy_errors__overrun_errors;
  122. uint16_t max_credit_hint;
  123. uint32_t link_round_trip_latency;
  124. } __attribute__ (( packed ));
  125. #define IB_LINK_WIDTH_1X 0x01
  126. #define IB_LINK_WIDTH_4X 0x02
  127. #define IB_LINK_WIDTH_8X 0x04
  128. #define IB_LINK_WIDTH_12X 0x08
  129. #define IB_LINK_SPEED_SDR 0x01
  130. #define IB_LINK_SPEED_DDR 0x02
  131. #define IB_LINK_SPEED_QDR 0x04
  132. #define IB_LINK_SPEED_FDR10 0x08
  133. #define IB_LINK_SPEED_FDR 0x10
  134. #define IB_LINK_SPEED_EDR 0x20
  135. #define IB_PORT_STATE_DOWN 0x01
  136. #define IB_PORT_STATE_INIT 0x02
  137. #define IB_PORT_STATE_ARMED 0x03
  138. #define IB_PORT_STATE_ACTIVE 0x04
  139. #define IB_PORT_PHYS_STATE_SLEEP 0x01
  140. #define IB_PORT_PHYS_STATE_POLLING 0x02
  141. #define IB_MTU_256 0x01
  142. #define IB_MTU_512 0x02
  143. #define IB_MTU_1024 0x03
  144. #define IB_MTU_2048 0x04
  145. #define IB_MTU_4096 0x05
  146. #define IB_VL_0 0x01
  147. #define IB_VL_0_1 0x02
  148. #define IB_VL_0_3 0x03
  149. #define IB_VL_0_7 0x04
  150. #define IB_VL_0_14 0x05
  151. /** A Partition Key Table attribute
  152. *
  153. * Defined in section 14.2.5.7 of the IBA.
  154. */
  155. struct ib_pkey_table {
  156. uint16_t pkey[32];
  157. } __attribute__ (( packed ));
  158. /** A subnet management attribute */
  159. union ib_smp_data {
  160. struct ib_node_desc node_desc;
  161. struct ib_node_info node_info;
  162. struct ib_guid_info guid_info;
  163. struct ib_port_info port_info;
  164. struct ib_pkey_table pkey_table;
  165. uint8_t bytes[64];
  166. } __attribute__ (( packed ));
  167. /** A subnet management directed route path */
  168. struct ib_smp_dr_path {
  169. uint8_t hops[64];
  170. } __attribute__ (( packed ));
  171. /** Subnet management MAD class-specific data */
  172. struct ib_smp_class_specific {
  173. uint8_t hop_pointer;
  174. uint8_t hop_count;
  175. } __attribute__ (( packed ));
  176. /*****************************************************************************
  177. *
  178. * Subnet administration MADs
  179. *
  180. *****************************************************************************
  181. */
  182. #define IB_SA_CLASS_VERSION 2
  183. #define IB_SA_METHOD_DELETE_RESP 0x95
  184. struct ib_rmpp_hdr {
  185. uint32_t raw[3];
  186. } __attribute__ (( packed ));
  187. struct ib_sa_hdr {
  188. uint32_t sm_key[2];
  189. uint16_t reserved;
  190. uint16_t attrib_offset;
  191. uint32_t comp_mask[2];
  192. } __attribute__ (( packed ));
  193. #define IB_SA_ATTR_SERVICE_REC 0x31
  194. #define IB_SA_ATTR_PATH_REC 0x35
  195. #define IB_SA_ATTR_MC_MEMBER_REC 0x38
  196. struct ib_service_record {
  197. uint64_t id;
  198. union ib_gid gid;
  199. uint16_t pkey;
  200. uint16_t reserved;
  201. uint32_t lease;
  202. uint8_t key[16];
  203. char name[64];
  204. uint8_t data8[16];
  205. uint16_t data16[8];
  206. uint32_t data32[4];
  207. uint64_t data64[2];
  208. } __attribute__ (( packed ));
  209. #define IB_SA_SERVICE_REC_NAME (1<<6)
  210. struct ib_path_record {
  211. uint32_t reserved0[2];
  212. union ib_gid dgid;
  213. union ib_gid sgid;
  214. uint16_t dlid;
  215. uint16_t slid;
  216. uint32_t hop_limit__flow_label__raw_traffic;
  217. uint32_t pkey__numb_path__reversible__tclass;
  218. uint8_t reserved1;
  219. uint8_t reserved__sl;
  220. uint8_t mtu_selector__mtu;
  221. uint8_t rate_selector__rate;
  222. uint32_t preference__packet_lifetime__packet_lifetime_selector;
  223. uint32_t reserved2[35];
  224. } __attribute__ (( packed ));
  225. #define IB_SA_PATH_REC_DGID (1<<2)
  226. #define IB_SA_PATH_REC_SGID (1<<3)
  227. struct ib_mc_member_record {
  228. union ib_gid mgid;
  229. union ib_gid port_gid;
  230. uint32_t qkey;
  231. uint16_t mlid;
  232. uint8_t mtu_selector__mtu;
  233. uint8_t tclass;
  234. uint16_t pkey;
  235. uint8_t rate_selector__rate;
  236. uint8_t packet_lifetime_selector__packet_lifetime;
  237. uint32_t sl__flow_label__hop_limit;
  238. uint8_t scope__join_state;
  239. uint8_t proxy_join__reserved;
  240. uint16_t reserved0;
  241. uint32_t reserved1[37];
  242. } __attribute__ (( packed ));
  243. #define IB_SA_MCMEMBER_REC_MGID (1<<0)
  244. #define IB_SA_MCMEMBER_REC_PORT_GID (1<<1)
  245. #define IB_SA_MCMEMBER_REC_QKEY (1<<2)
  246. #define IB_SA_MCMEMBER_REC_MLID (1<<3)
  247. #define IB_SA_MCMEMBER_REC_MTU_SELECTOR (1<<4)
  248. #define IB_SA_MCMEMBER_REC_MTU (1<<5)
  249. #define IB_SA_MCMEMBER_REC_TRAFFIC_CLASS (1<<6)
  250. #define IB_SA_MCMEMBER_REC_PKEY (1<<7)
  251. #define IB_SA_MCMEMBER_REC_RATE_SELECTOR (1<<8)
  252. #define IB_SA_MCMEMBER_REC_RATE (1<<9)
  253. #define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME_SELECTOR (1<<10)
  254. #define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME (1<<11)
  255. #define IB_SA_MCMEMBER_REC_SL (1<<12)
  256. #define IB_SA_MCMEMBER_REC_FLOW_LABEL (1<<13)
  257. #define IB_SA_MCMEMBER_REC_HOP_LIMIT (1<<14)
  258. #define IB_SA_MCMEMBER_REC_SCOPE (1<<15)
  259. #define IB_SA_MCMEMBER_REC_JOIN_STATE (1<<16)
  260. #define IB_SA_MCMEMBER_REC_PROXY_JOIN (1<<17)
  261. union ib_sa_data {
  262. struct ib_service_record service_record;
  263. struct ib_path_record path_record;
  264. struct ib_mc_member_record mc_member_record;
  265. } __attribute__ (( packed ));
  266. /*****************************************************************************
  267. *
  268. * Communication management MADs
  269. *
  270. *****************************************************************************
  271. */
  272. /** Communication management class version */
  273. #define IB_CM_CLASS_VERSION 2
  274. /* Communication management attributes */
  275. #define IB_CM_ATTR_CLASS_PORT_INFO 0x0001
  276. #define IB_CM_ATTR_CONNECT_REQUEST 0x0010
  277. #define IB_CM_ATTR_MSG_RCPT_ACK 0x0011
  278. #define IB_CM_ATTR_CONNECT_REJECT 0x0012
  279. #define IB_CM_ATTR_CONNECT_REPLY 0x0013
  280. #define IB_CM_ATTR_READY_TO_USE 0x0014
  281. #define IB_CM_ATTR_DISCONNECT_REQUEST 0x0015
  282. #define IB_CM_ATTR_DISCONNECT_REPLY 0x0016
  283. #define IB_CM_ATTR_SERVICE_ID_RES_REQ 0x0016
  284. #define IB_CM_ATTR_SERVICE_ID_RES_REQ_RESP 0x0018
  285. #define IB_CM_ATTR_LOAD_ALTERNATE_PATH 0x0019
  286. #define IB_CM_ATTR_ALTERNATE_PATH_RESPONSE 0x001a
  287. /** Communication management common fields */
  288. struct ib_cm_common {
  289. /** Local communication ID */
  290. uint32_t local_id;
  291. /** Remote communication ID */
  292. uint32_t remote_id;
  293. /** Reserved */
  294. uint8_t reserved[224];
  295. } __attribute__ (( packed ));
  296. /** A communication management path */
  297. struct ib_cm_path {
  298. /** Local port LID */
  299. uint16_t local_lid;
  300. /** Remote port LID */
  301. uint16_t remote_lid;
  302. /** Local port GID */
  303. union ib_gid local_gid;
  304. /** Remote port GID */
  305. union ib_gid remote_gid;
  306. /** Flow label and rate */
  307. uint32_t flow_label__rate;
  308. /** Traffic class */
  309. uint8_t tc;
  310. /** Hop limit */
  311. uint8_t hop_limit;
  312. /** SL and subnet local*/
  313. uint8_t sl__subnet_local;
  314. /** Local ACK timeout */
  315. uint8_t local_ack_timeout;
  316. } __attribute__ (( packed ));
  317. /** A communication management connection request
  318. *
  319. * Defined in section 12.6.5 of the IBA.
  320. */
  321. struct ib_cm_connect_request {
  322. /** Local communication ID */
  323. uint32_t local_id;
  324. /** Reserved */
  325. uint32_t reserved0[1];
  326. /** Service ID */
  327. union ib_guid service_id;
  328. /** Local CA GUID */
  329. union ib_guid local_ca;
  330. /** Reserved */
  331. uint32_t reserved1[1];
  332. /** Local queue key */
  333. uint32_t local_qkey;
  334. /** Local QPN and responder resources*/
  335. uint32_t local_qpn__responder_resources;
  336. /** Local EECN and initiator depth */
  337. uint32_t local_eecn__initiator_depth;
  338. /** Remote EECN, remote CM response timeout, transport service
  339. * type, EE flow control
  340. */
  341. uint32_t remote_eecn__remote_timeout__service_type__ee_flow_ctrl;
  342. /** Starting PSN, local CM response timeout and retry count */
  343. uint32_t starting_psn__local_timeout__retry_count;
  344. /** Partition key */
  345. uint16_t pkey;
  346. /** Path packet payload MTU, RDC exists, RNR retry count */
  347. uint8_t payload_mtu__rdc_exists__rnr_retry;
  348. /** Max CM retries and SRQ */
  349. uint8_t max_cm_retries__srq;
  350. /** Primary path */
  351. struct ib_cm_path primary;
  352. /** Alternate path */
  353. struct ib_cm_path alternate;
  354. /** Private data */
  355. uint8_t private_data[92];
  356. } __attribute__ (( packed ));
  357. /** CM transport types */
  358. #define IB_CM_TRANSPORT_RC 0
  359. #define IB_CM_TRANSPORT_UC 1
  360. #define IB_CM_TRANSPORT_RD 2
  361. /** A communication management connection rejection
  362. *
  363. * Defined in section 12.6.7 of the IBA.
  364. */
  365. struct ib_cm_connect_reject {
  366. /** Local communication ID */
  367. uint32_t local_id;
  368. /** Remote communication ID */
  369. uint32_t remote_id;
  370. /** Message rejected */
  371. uint8_t message;
  372. /** Reject information length */
  373. uint8_t info_len;
  374. /** Rejection reason */
  375. uint16_t reason;
  376. /** Additional rejection information */
  377. uint8_t info[72];
  378. /** Private data */
  379. uint8_t private_data[148];
  380. } __attribute__ (( packed ));
  381. /** CM rejection reasons */
  382. #define IB_CM_REJECT_BAD_SERVICE_ID 8
  383. #define IB_CM_REJECT_STALE_CONN 10
  384. #define IB_CM_REJECT_CONSUMER 28
  385. /** A communication management connection reply
  386. *
  387. * Defined in section 12.6.8 of the IBA.
  388. */
  389. struct ib_cm_connect_reply {
  390. /** Local communication ID */
  391. uint32_t local_id;
  392. /** Remote communication ID */
  393. uint32_t remote_id;
  394. /** Local queue key */
  395. uint32_t local_qkey;
  396. /** Local QPN */
  397. uint32_t local_qpn;
  398. /** Local EECN */
  399. uint32_t local_eecn;
  400. /** Starting PSN */
  401. uint32_t starting_psn;
  402. /** Responder resources */
  403. uint8_t responder_resources;
  404. /** Initiator depth */
  405. uint8_t initiator_depth;
  406. /** Target ACK delay, failover accepted, and end-to-end flow control */
  407. uint8_t target_ack_delay__failover_accepted__ee_flow_ctrl;
  408. /** RNR retry count, SRQ */
  409. uint8_t rnr_retry__srq;
  410. /** Local CA GUID */
  411. union ib_guid local_ca;
  412. /** Private data */
  413. uint8_t private_data[196];
  414. } __attribute__ (( packed ));
  415. /** A communication management ready to use reply
  416. *
  417. * Defined in section 12.6.9 of the IBA.
  418. */
  419. struct ib_cm_ready_to_use {
  420. /** Local communication ID */
  421. uint32_t local_id;
  422. /** Remote communication ID */
  423. uint32_t remote_id;
  424. /** Private data */
  425. uint8_t private_data[224];
  426. } __attribute__ (( packed ));
  427. /** A communication management disconnection request
  428. *
  429. * Defined in section 12.6.10 of the IBA.
  430. */
  431. struct ib_cm_disconnect_request {
  432. /** Local communication ID */
  433. uint32_t local_id;
  434. /** Remote communication ID */
  435. uint32_t remote_id;
  436. /** Remote QPN/EECN */
  437. uint32_t remote_qpn_eecn;
  438. /** Private data */
  439. uint8_t private_data[220];
  440. } __attribute__ (( packed ));
  441. /** A communication management disconnection reply
  442. *
  443. * Defined in section 12.6.11 of the IBA.
  444. */
  445. struct ib_cm_disconnect_reply {
  446. /** Local communication ID */
  447. uint32_t local_id;
  448. /** Remote communication ID */
  449. uint32_t remote_id;
  450. /** Private data */
  451. uint8_t private_data[224];
  452. } __attribute__ (( packed ));
  453. /** A communication management attribute */
  454. union ib_cm_data {
  455. struct ib_cm_common common;
  456. struct ib_cm_connect_request connect_request;
  457. struct ib_cm_connect_reject connect_reject;
  458. struct ib_cm_connect_reply connect_reply;
  459. struct ib_cm_ready_to_use ready_to_use;
  460. struct ib_cm_disconnect_request disconnect_request;
  461. struct ib_cm_disconnect_reply disconnect_reply;
  462. uint8_t bytes[232];
  463. } __attribute__ (( packed ));
  464. /*****************************************************************************
  465. *
  466. * MADs
  467. *
  468. *****************************************************************************
  469. */
  470. /** Management datagram class_specific data */
  471. union ib_mad_class_specific {
  472. uint16_t raw;
  473. struct ib_smp_class_specific smp;
  474. } __attribute__ (( packed ));
  475. /** A management datagram transaction identifier */
  476. struct ib_mad_tid {
  477. uint32_t high;
  478. uint32_t low;
  479. } __attribute__ (( packed ));
  480. /** A management datagram common header
  481. *
  482. * Defined in section 13.4.2 of the IBA.
  483. */
  484. struct ib_mad_hdr {
  485. uint8_t base_version;
  486. uint8_t mgmt_class;
  487. uint8_t class_version;
  488. uint8_t method;
  489. uint16_t status;
  490. union ib_mad_class_specific class_specific;
  491. struct ib_mad_tid tid;
  492. uint16_t attr_id;
  493. uint8_t reserved[2];
  494. uint32_t attr_mod;
  495. } __attribute__ (( packed ));
  496. /* Management base version */
  497. #define IB_MGMT_BASE_VERSION 1
  498. /* Management classes */
  499. #define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x01
  500. #define IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE 0x81
  501. #define IB_MGMT_CLASS_SUBN_ADM 0x03
  502. #define IB_MGMT_CLASS_PERF_MGMT 0x04
  503. #define IB_MGMT_CLASS_BM 0x05
  504. #define IB_MGMT_CLASS_DEVICE_MGMT 0x06
  505. #define IB_MGMT_CLASS_CM 0x07
  506. #define IB_MGMT_CLASS_SNMP 0x08
  507. #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30
  508. #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4f
  509. #define IB_MGMT_CLASS_MASK 0x7f
  510. /* Management methods */
  511. #define IB_MGMT_METHOD_GET 0x01
  512. #define IB_MGMT_METHOD_SET 0x02
  513. #define IB_MGMT_METHOD_GET_RESP 0x81
  514. #define IB_MGMT_METHOD_SEND 0x03
  515. #define IB_MGMT_METHOD_TRAP 0x05
  516. #define IB_MGMT_METHOD_REPORT 0x06
  517. #define IB_MGMT_METHOD_REPORT_RESP 0x86
  518. #define IB_MGMT_METHOD_TRAP_REPRESS 0x07
  519. #define IB_MGMT_METHOD_DELETE 0x15
  520. /* Status codes */
  521. #define IB_MGMT_STATUS_OK 0x0000
  522. #define IB_MGMT_STATUS_BAD_VERSION 0x0001
  523. #define IB_MGMT_STATUS_UNSUPPORTED_METHOD 0x0002
  524. #define IB_MGMT_STATUS_UNSUPPORTED_METHOD_ATTR 0x0003
  525. #define IB_MGMT_STATUS_INVALID_VALUE 0x0004
  526. /** A subnet management MAD */
  527. struct ib_mad_smp {
  528. struct ib_mad_hdr mad_hdr;
  529. struct ib_smp_hdr smp_hdr;
  530. union ib_smp_data smp_data;
  531. struct ib_smp_dr_path initial_path;
  532. struct ib_smp_dr_path return_path;
  533. } __attribute__ (( packed ));
  534. /** A subnet administration MAD */
  535. struct ib_mad_sa {
  536. struct ib_mad_hdr mad_hdr;
  537. struct ib_rmpp_hdr rmpp_hdr;
  538. struct ib_sa_hdr sa_hdr;
  539. union ib_sa_data sa_data;
  540. } __attribute__ (( packed ));
  541. /** A communication management MAD */
  542. struct ib_mad_cm {
  543. struct ib_mad_hdr mad_hdr;
  544. union ib_cm_data cm_data;
  545. } __attribute__ (( packed ));
  546. /** A management datagram */
  547. union ib_mad {
  548. struct ib_mad_hdr hdr;
  549. struct ib_mad_smp smp;
  550. struct ib_mad_sa sa;
  551. struct ib_mad_cm cm;
  552. uint8_t bytes[256];
  553. } __attribute__ (( packed ));
  554. #endif /* _IPXE_IB_MAD_H */