[infiniband] Record multicast GID attachment as part of group membership
[ipxe.git] / src / include / ipxe / ib_mcast.h
1 #ifndef _IPXE_IB_MCAST_H
2 #define _IPXE_IB_MCAST_H
3
4 /** @file
5 *
6 * Infiniband multicast groups
7 *
8 */
9
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12 #include <ipxe/infiniband.h>
13
14 struct ib_mad_transaction;
15
16 /** An Infiniband multicast group membership */
17 struct ib_mc_membership {
18 /** Queue pair */
19 struct ib_queue_pair *qp;
20 /** Multicast GID */
21 union ib_gid gid;
22 /** Attached to multicast GID */
23 int attached;
24 /** Multicast group join transaction */
25 struct ib_mad_transaction *madx;
26 /** Handle join success/failure
27 *
28 * @v ibdev Infiniband device
29 * @v qp Queue pair
30 * @v membership Multicast group membership
31 * @v rc Status code
32 * @v mad Response MAD (or NULL on error)
33 */
34 void ( * complete ) ( struct ib_device *ibdev, struct ib_queue_pair *qp,
35 struct ib_mc_membership *membership, int rc,
36 union ib_mad *mad );
37 };
38
39 extern int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
40 struct ib_mc_membership *membership,
41 union ib_gid *gid,
42 void ( * joined ) ( struct ib_device *ibdev,
43 struct ib_queue_pair *qp,
44 struct ib_mc_membership *memb,
45 int rc, union ib_mad *mad ) );
46
47 extern void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
48 struct ib_mc_membership *membership );
49
50 #endif /* _IPXE_IB_MCAST_H */