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