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.

ipoib.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _GPXE_IPOIB_H
  2. #define _GPXE_IPOIB_H
  3. /** @file
  4. *
  5. * IP over Infiniband
  6. */
  7. FILE_LICENCE ( GPL2_OR_LATER );
  8. #include <gpxe/infiniband.h>
  9. /** IPoIB packet length */
  10. #define IPOIB_PKT_LEN 2048
  11. /** IPoIB MAC address length */
  12. #define IPOIB_ALEN 20
  13. /** An IPoIB MAC address */
  14. struct ipoib_mac {
  15. /** Queue pair number
  16. *
  17. * MSB must be zero; QPNs are only 24-bit.
  18. */
  19. uint32_t qpn;
  20. /** Port GID */
  21. struct ib_gid gid;
  22. } __attribute__ (( packed ));
  23. /** IPoIB link-layer header length */
  24. #define IPOIB_HLEN 4
  25. /** IPoIB link-layer header */
  26. struct ipoib_hdr {
  27. /** Network-layer protocol */
  28. uint16_t proto;
  29. /** Reserved, must be zero */
  30. union {
  31. /** Reserved, must be zero */
  32. uint16_t reserved;
  33. /** Peer addresses
  34. *
  35. * We use these fields internally to represent the
  36. * peer addresses using a lookup key. There simply
  37. * isn't enough room in the IPoIB header to store
  38. * literal source or destination MAC addresses.
  39. */
  40. struct {
  41. /** Destination address key */
  42. uint8_t dest;
  43. /** Source address key */
  44. uint8_t src;
  45. } __attribute__ (( packed )) peer;
  46. } __attribute__ (( packed )) u;
  47. } __attribute__ (( packed ));
  48. extern const char * ipoib_ntoa ( const void *ll_addr );
  49. extern void ipoib_link_state_changed ( struct ib_device *ibdev );
  50. extern int ipoib_probe ( struct ib_device *ibdev );
  51. extern void ipoib_remove ( struct ib_device *ibdev );
  52. extern struct net_device * alloc_ipoibdev ( size_t priv_size );
  53. #endif /* _GPXE_IPOIB_H */