Signed-off-by: Michael Brown <mcb30@ipxe.org>
.notify = ipoib_notify,
.remove = ipoib_remove,
};
+
+/**
+ * Find IPoIB network device
+ *
+ * @v ibdev Infiniband device
+ * @ret netdev IPoIB network device, or NULL if not found
+ */
+struct net_device * ipoib_netdev ( struct ib_device *ibdev ) {
+ struct ipoib_device *ipoib;
+
+ /* Find matching IPoIB device */
+ list_for_each_entry ( ipoib, &ipoib_devices, list ) {
+ if ( ipoib->ibdev != ibdev )
+ continue;
+ return ipoib->netdev;
+ }
+ return NULL;
+}
extern const char * ipoib_ntoa ( const void *ll_addr );
extern struct net_device * alloc_ipoibdev ( size_t priv_size );
+extern struct net_device * ipoib_netdev ( struct ib_device *ibdev );
#endif /* _IPXE_IPOIB_H */