aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_pack.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/ib_pack.h')
-rw-r--r--include/rdma/ib_pack.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index cbb50f4da3dd..b37fe3b10a9d 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -37,6 +37,8 @@
37 37
38enum { 38enum {
39 IB_LRH_BYTES = 8, 39 IB_LRH_BYTES = 8,
40 IB_ETH_BYTES = 14,
41 IB_VLAN_BYTES = 4,
40 IB_GRH_BYTES = 40, 42 IB_GRH_BYTES = 40,
41 IB_BTH_BYTES = 12, 43 IB_BTH_BYTES = 12,
42 IB_DETH_BYTES = 8 44 IB_DETH_BYTES = 8
@@ -210,14 +212,32 @@ struct ib_unpacked_deth {
210 __be32 source_qpn; 212 __be32 source_qpn;
211}; 213};
212 214
215struct ib_unpacked_eth {
216 u8 dmac_h[4];
217 u8 dmac_l[2];
218 u8 smac_h[2];
219 u8 smac_l[4];
220 __be16 type;
221};
222
223struct ib_unpacked_vlan {
224 __be16 tag;
225 __be16 type;
226};
227
213struct ib_ud_header { 228struct ib_ud_header {
229 int lrh_present;
214 struct ib_unpacked_lrh lrh; 230 struct ib_unpacked_lrh lrh;
215 int grh_present; 231 int eth_present;
216 struct ib_unpacked_grh grh; 232 struct ib_unpacked_eth eth;
217 struct ib_unpacked_bth bth; 233 int vlan_present;
234 struct ib_unpacked_vlan vlan;
235 int grh_present;
236 struct ib_unpacked_grh grh;
237 struct ib_unpacked_bth bth;
218 struct ib_unpacked_deth deth; 238 struct ib_unpacked_deth deth;
219 int immediate_present; 239 int immediate_present;
220 __be32 immediate_data; 240 __be32 immediate_data;
221}; 241};
222 242
223void ib_pack(const struct ib_field *desc, 243void ib_pack(const struct ib_field *desc,
@@ -230,9 +250,12 @@ void ib_unpack(const struct ib_field *desc,
230 void *buf, 250 void *buf,
231 void *structure); 251 void *structure);
232 252
233void ib_ud_header_init(int payload_bytes, 253void ib_ud_header_init(int payload_bytes,
234 int grh_present, 254 int lrh_present,
235 int immediate_present, 255 int eth_present,
256 int vlan_present,
257 int grh_present,
258 int immediate_present,
236 struct ib_ud_header *header); 259 struct ib_ud_header *header);
237 260
238int ib_ud_header_pack(struct ib_ud_header *header, 261int ib_ud_header_pack(struct ib_ud_header *header,