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