iPXE
|
00001 #ifndef _IPXE_IB_PATHREC_H 00002 #define _IPXE_IB_PATHREC_H 00003 00004 /** @file 00005 * 00006 * Infiniband path records 00007 * 00008 */ 00009 00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 00011 00012 #include <ipxe/infiniband.h> 00013 00014 struct ib_mad_transaction; 00015 struct ib_path; 00016 00017 /** Infiniband path operations */ 00018 struct ib_path_operations { 00019 /** Handle path transaction completion 00020 * 00021 * @v ibdev Infiniband device 00022 * @v path Path 00023 * @v rc Status code 00024 * @v av Address vector, or NULL on error 00025 */ 00026 void ( * complete ) ( struct ib_device *ibdev, 00027 struct ib_path *path, int rc, 00028 struct ib_address_vector *av ); 00029 }; 00030 00031 /** An Infiniband path */ 00032 struct ib_path { 00033 /** Infiniband device */ 00034 struct ib_device *ibdev; 00035 /** Address vector */ 00036 struct ib_address_vector av; 00037 /** Management transaction */ 00038 struct ib_mad_transaction *madx; 00039 /** Path operations */ 00040 struct ib_path_operations *op; 00041 /** Owner private data */ 00042 void *owner_priv; 00043 }; 00044 00045 /** 00046 * Set Infiniband path owner-private data 00047 * 00048 * @v path Path 00049 * @v priv Private data 00050 */ 00051 static inline __always_inline void 00052 ib_path_set_ownerdata ( struct ib_path *path, void *priv ) { 00053 path->owner_priv = priv; 00054 } 00055 00056 /** 00057 * Get Infiniband path owner-private data 00058 * 00059 * @v path Path 00060 * @ret priv Private data 00061 */ 00062 static inline __always_inline void * 00063 ib_path_get_ownerdata ( struct ib_path *path ) { 00064 return path->owner_priv; 00065 } 00066 00067 extern struct ib_path * 00068 ib_create_path ( struct ib_device *ibdev, struct ib_address_vector *av, 00069 struct ib_path_operations *op ); 00070 extern void ib_destroy_path ( struct ib_device *ibdev, 00071 struct ib_path *path ); 00072 00073 extern int ib_resolve_path ( struct ib_device *ibdev, 00074 struct ib_address_vector *av ); 00075 00076 #endif /* _IPXE_IB_PATHREC_H */