bcmeth.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Broadcom Ethernettype protocol definitions
  3. *
  4. * Copyright 2007, Broadcom Corporation
  5. * All Rights Reserved.
  6. *
  7. * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
  8. * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
  9. * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
  10. * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
  11. *
  12. */
  13. /*
  14. * Broadcom Ethernet protocol defines
  15. */
  16. #ifndef _BCMETH_H_
  17. #define _BCMETH_H_
  18. /* enable structure packing */
  19. #if defined(__GNUC__)
  20. #define PACKED __attribute__((packed))
  21. #else
  22. #pragma pack(1)
  23. #define PACKED
  24. #endif
  25. /* ETHER_TYPE_BRCM is defined in ethernet.h */
  26. /*
  27. * Following the 2byte BRCM ether_type is a 16bit BRCM subtype field
  28. * in one of two formats: (only subtypes 32768-65535 are in use now)
  29. *
  30. * subtypes 0-32767:
  31. * 8 bit subtype (0-127)
  32. * 8 bit length in bytes (0-255)
  33. *
  34. * subtypes 32768-65535:
  35. * 16 bit big-endian subtype
  36. * 16 bit big-endian length in bytes (0-65535)
  37. *
  38. * length is the number of additional bytes beyond the 4 or 6 byte header
  39. *
  40. * Reserved values:
  41. * 0 reserved
  42. * 5-15 reserved for iLine protocol assignments
  43. * 17-126 reserved, assignable
  44. * 127 reserved
  45. * 32768 reserved
  46. * 32769-65534 reserved, assignable
  47. * 65535 reserved
  48. */
  49. /*
  50. * While adding the subtypes and their specific processing code make sure
  51. * bcmeth_bcm_hdr_t is the first data structure in the user specific data structure definition
  52. */
  53. #define BCMILCP_SUBTYPE_RATE 1
  54. #define BCMILCP_SUBTYPE_LINK 2
  55. #define BCMILCP_SUBTYPE_CSA 3
  56. #define BCMILCP_SUBTYPE_LARQ 4
  57. #define BCMILCP_SUBTYPE_VENDOR 5
  58. #define BCMILCP_SUBTYPE_FLH 17
  59. #define BCMILCP_SUBTYPE_VENDOR_LONG 32769
  60. #define BCMILCP_SUBTYPE_CERT 32770
  61. #define BCMILCP_SUBTYPE_SES 32771
  62. #define BCMILCP_BCM_SUBTYPE_RESERVED 0
  63. #define BCMILCP_BCM_SUBTYPE_EVENT 1
  64. #define BCMILCP_BCM_SUBTYPE_SES 2
  65. /*
  66. * The EAPOL type is not used anymore. Instead EAPOL messages are now embedded
  67. * within BCMILCP_BCM_SUBTYPE_EVENT type messages
  68. */
  69. /* #define BCMILCP_BCM_SUBTYPE_EAPOL 3 */
  70. #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
  71. #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0
  72. /* These fields are stored in network order */
  73. typedef struct bcmeth_hdr
  74. {
  75. uint16 subtype; /* Vendor specific..32769 */
  76. uint16 length;
  77. uint8 version; /* Version is 0 */
  78. uint8 oui[3]; /* Broadcom OUI */
  79. /* user specific Data */
  80. uint16 usr_subtype;
  81. } PACKED bcmeth_hdr_t;
  82. #undef PACKED
  83. #if !defined(__GNUC__)
  84. #pragma pack()
  85. #endif
  86. #endif /* _BCMETH_H_ */