You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _GPXE_IPOIB_H
  2. #define _GPXE_IPOIB_H
  3. /** @file
  4. *
  5. * IP over Infiniband
  6. */
  7. #include <gpxe/infiniband.h>
  8. /** IPoIB MAC address length */
  9. #define IPOIB_ALEN 20
  10. /** An IPoIB MAC address */
  11. struct ipoib_mac {
  12. /** Queue pair number
  13. *
  14. * MSB must be zero; QPNs are only 24-bit.
  15. */
  16. uint32_t qpn;
  17. /** Port GID */
  18. struct ib_gid gid;
  19. } __attribute__ (( packed ));
  20. /** IPoIB link-layer header length */
  21. #define IPOIB_HLEN 24
  22. /**
  23. * IPoIB link-layer header pseudo portion
  24. *
  25. * This part doesn't actually exist on the wire, but it provides a
  26. * convenient way to fit into the typical network device model.
  27. */
  28. struct ipoib_pseudo_hdr {
  29. /** Peer address */
  30. struct ipoib_mac peer;
  31. } __attribute__ (( packed ));
  32. /** IPoIB link-layer header real portion */
  33. struct ipoib_real_hdr {
  34. /** Network-layer protocol */
  35. uint16_t proto;
  36. /** Reserved, must be zero */
  37. uint16_t reserved;
  38. } __attribute__ (( packed ));
  39. /** An IPoIB link-layer header */
  40. struct ipoib_hdr {
  41. /** Pseudo portion */
  42. struct ipoib_pseudo_hdr pseudo;
  43. /** Real portion */
  44. struct ipoib_real_hdr real;
  45. } __attribute__ (( packed ));
  46. extern struct ll_protocol ipoib_protocol;
  47. extern const char * ipoib_ntoa ( const void *ll_addr );
  48. /**
  49. * Allocate IPoIB device
  50. *
  51. * @v priv_size Size of driver private data
  52. * @ret netdev Network device, or NULL
  53. */
  54. static inline struct net_device * alloc_ipoibdev ( size_t priv_size ) {
  55. struct net_device *netdev;
  56. netdev = alloc_netdev ( priv_size );
  57. if ( netdev ) {
  58. netdev->ll_protocol = &ipoib_protocol;
  59. }
  60. return netdev;
  61. }
  62. extern void ipoib_link_state_changed ( struct ib_device *ibdev );
  63. extern int ipoib_probe ( struct ib_device *ibdev );
  64. extern void ipoib_remove ( struct ib_device *ibdev );
  65. #endif /* _GPXE_IPOIB_H */