bcmeth.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Broadcom Ethernettype protocol definitions
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id: bcmeth.h 681870 2018-01-03 12:34:57Z $
  30. */
  31. /*
  32. * Broadcom Ethernet protocol defines
  33. */
  34. #ifndef _BCMETH_H_
  35. #define _BCMETH_H_
  36. #ifndef _TYPEDEFS_H_
  37. #include <typedefs.h>
  38. #endif // endif
  39. /* This marks the start of a packed structure section. */
  40. #include <packed_section_start.h>
  41. /* ETHER_TYPE_BRCM is defined in ethernet.h */
  42. /*
  43. * Following the 2byte BRCM ether_type is a 16bit BRCM subtype field
  44. * in one of two formats: (only subtypes 32768-65535 are in use now)
  45. *
  46. * subtypes 0-32767:
  47. * 8 bit subtype (0-127)
  48. * 8 bit length in bytes (0-255)
  49. *
  50. * subtypes 32768-65535:
  51. * 16 bit big-endian subtype
  52. * 16 bit big-endian length in bytes (0-65535)
  53. *
  54. * length is the number of additional bytes beyond the 4 or 6 byte header
  55. *
  56. * Reserved values:
  57. * 0 reserved
  58. * 5-15 reserved for iLine protocol assignments
  59. * 17-126 reserved, assignable
  60. * 127 reserved
  61. * 32768 reserved
  62. * 32769-65534 reserved, assignable
  63. * 65535 reserved
  64. */
  65. /*
  66. * While adding the subtypes and their specific processing code make sure
  67. * bcmeth_bcm_hdr_t is the first data structure in the user specific data structure definition
  68. */
  69. #define BCMILCP_SUBTYPE_RATE 1
  70. #define BCMILCP_SUBTYPE_LINK 2
  71. #define BCMILCP_SUBTYPE_CSA 3
  72. #define BCMILCP_SUBTYPE_LARQ 4
  73. #define BCMILCP_SUBTYPE_VENDOR 5
  74. #define BCMILCP_SUBTYPE_FLH 17
  75. #define BCMILCP_SUBTYPE_VENDOR_LONG 32769
  76. #define BCMILCP_SUBTYPE_CERT 32770
  77. #define BCMILCP_SUBTYPE_SES 32771
  78. #define BCMILCP_BCM_SUBTYPE_RESERVED 0
  79. #define BCMILCP_BCM_SUBTYPE_EVENT 1
  80. #define BCMILCP_BCM_SUBTYPE_SES 2
  81. /*
  82. * The EAPOL type is not used anymore. Instead EAPOL messages are now embedded
  83. * within BCMILCP_BCM_SUBTYPE_EVENT type messages
  84. */
  85. /* #define BCMILCP_BCM_SUBTYPE_EAPOL 3 */
  86. #define BCMILCP_BCM_SUBTYPE_DPT 4
  87. #define BCMILCP_BCM_SUBTYPE_DNGLEVENT 5
  88. #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
  89. #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0
  90. #define BCMILCP_BCM_SUBTYPE_EVENT_DATA_PAD 2
  91. /* These fields are stored in network order */
  92. typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr
  93. {
  94. uint16 subtype; /* Vendor specific..32769 */
  95. uint16 length;
  96. uint8 version; /* Version is 0 */
  97. uint8 oui[3]; /* Broadcom OUI */
  98. /* user specific Data */
  99. uint16 usr_subtype;
  100. } BWL_POST_PACKED_STRUCT bcmeth_hdr_t;
  101. /* This marks the end of a packed structure section. */
  102. #include <packed_section_end.h>
  103. #endif /* _BCMETH_H_ */