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