1 #ifndef _IPXE_IB_PATHREC_H
2 #define _IPXE_IB_PATHREC_H
6 * Infiniband path records
10 FILE_LICENCE ( GPL2_OR_LATER );
12 #include <ipxe/infiniband.h>
14 struct ib_mad_transaction;
17 /** Infiniband path operations */
18 struct ib_path_operations {
19 /** Handle path transaction completion
21 * @v ibdev Infiniband device
24 * @v av Address vector, or NULL on error
26 void ( * complete ) ( struct ib_device *ibdev,
27 struct ib_path *path, int rc,
28 struct ib_address_vector *av );
31 /** An Infiniband path */
33 /** Infiniband device */
34 struct ib_device *ibdev;
36 struct ib_address_vector av;
37 /** Management transaction */
38 struct ib_mad_transaction *madx;
39 /** Path operations */
40 struct ib_path_operations *op;
41 /** Owner private data */
46 * Set Infiniband path owner-private data
49 * @v priv Private data
51 static inline __always_inline void
52 ib_path_set_ownerdata ( struct ib_path *path, void *priv ) {
53 path->owner_priv = priv;
57 * Get Infiniband path owner-private data
60 * @ret priv Private data
62 static inline __always_inline void *
63 ib_path_get_ownerdata ( struct ib_path *path ) {
64 return path->owner_priv;
67 extern struct ib_path *
68 ib_create_path ( struct ib_device *ibdev, struct ib_address_vector *av,
69 struct ib_path_operations *op );
70 extern void ib_destroy_path ( struct ib_device *ibdev,
71 struct ib_path *path );
73 extern int ib_resolve_path ( struct ib_device *ibdev,
74 struct ib_address_vector *av );
76 #endif /* _IPXE_IB_PATHREC_H */