Tomato-ND 1.21
[tomato.git] / release / src / include / proto / bcmeth.h
blob1924a891dd536560e4cd25df67330c71e3399478
1 /*
2 * Broadcom Ethernettype protocol definitions
4 * Copyright 2006, 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.
12 * $Id$
16 * Broadcom Ethernet protocol defines
19 #ifndef _BCMETH_H_
20 #define _BCMETH_H_
22 /* enable structure packing */
23 #if defined(__GNUC__)
24 #define PACKED __attribute__((packed))
25 #else
26 #pragma pack(1)
27 #define PACKED
28 #endif
30 /* ETHER_TYPE_BRCM is defined in ethernet.h */
33 * Following the 2byte BRCM ether_type is a 16bit BRCM subtype field
34 * in one of two formats: (only subtypes 32768-65535 are in use now)
36 * subtypes 0-32767:
37 * 8 bit subtype (0-127)
38 * 8 bit length in bytes (0-255)
40 * subtypes 32768-65535:
41 * 16 bit big-endian subtype
42 * 16 bit big-endian length in bytes (0-65535)
44 * length is the number of additional bytes beyond the 4 or 6 byte header
46 * Reserved values:
47 * 0 reserved
48 * 5-15 reserved for iLine protocol assignments
49 * 17-126 reserved, assignable
50 * 127 reserved
51 * 32768 reserved
52 * 32769-65534 reserved, assignable
53 * 65535 reserved
56 /*
57 * While adding the subtypes and their specific processing code make sure
58 * bcmeth_bcm_hdr_t is the first data structure in the user specific data structure definition
61 #define BCMILCP_SUBTYPE_RATE 1
62 #define BCMILCP_SUBTYPE_LINK 2
63 #define BCMILCP_SUBTYPE_CSA 3
64 #define BCMILCP_SUBTYPE_LARQ 4
65 #define BCMILCP_SUBTYPE_VENDOR 5
66 #define BCMILCP_SUBTYPE_FLH 17
68 #define BCMILCP_SUBTYPE_VENDOR_LONG 32769
69 #define BCMILCP_SUBTYPE_CERT 32770
70 #define BCMILCP_SUBTYPE_SES 32771
73 #define BCMILCP_BCM_SUBTYPE_RESERVED 0
74 #define BCMILCP_BCM_SUBTYPE_EVENT 1
75 #define BCMILCP_BCM_SUBTYPE_SES 2
77 * The EAPOL type is not used anymore. Instead EAPOL messages are now embedded
78 * within BCMILCP_BCM_SUBTYPE_EVENT type messages
80 /* #define BCMILCP_BCM_SUBTYPE_EAPOL 3 */
82 #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
83 #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0
85 /* These fields are stored in network order */
86 typedef struct bcmeth_hdr
88 uint16 subtype; /* Vendor specific..32769 */
89 uint16 length;
90 uint8 version; /* Version is 0 */
91 uint8 oui[3]; /* Broadcom OUI */
92 /* user specific Data */
93 uint16 usr_subtype;
94 } PACKED bcmeth_hdr_t;
96 #undef PACKED
97 #if !defined(__GNUC__)
98 #pragma pack()
99 #endif
101 #endif /* _BCMETH_H_ */