2
2
* From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
4
* Copyright 2008, Broadcom Corporation
4
* Copyright (C) 2010, Broadcom Corporation
5
5
* All Rights Reserved.
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, available at
10
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"), with the
11
* following added to such license:
12
* As a special exception, the copyright holders of this software give you
13
* permission to link this software with independent modules, regardless of the
14
* license terms of these independent modules, and to copy and distribute the
15
* resulting executable under terms of your choice, provided that you also meet,
16
* for each linked independent module, the terms and conditions of the license
17
* of that module. An independent module is a module which is not derived from
20
7
* THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
21
8
* KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
22
9
* SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
23
10
* FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
25
* $Id: ethernet.h,v 9.45.12.1 2008/08/13 02:24:19 Exp $
12
* $Id: ethernet.h,v 9.50.4.3 2009/10/22 07:38:44 Exp $
28
15
#ifndef _NET_ETHERNET_H_
62
44
#define ETHER_TYPE_BRCM 0x886c
63
45
#define ETHER_TYPE_802_1X 0x888e
64
46
#define ETHER_TYPE_802_1X_PREAUTH 0x88c7
47
#define ETHER_TYPE_WAI 0x88b4
66
49
#define ETHER_BRCM_SUBTYPE_LEN 4
67
50
#define ETHER_BRCM_CRAM 1
84
67
#ifndef __INCif_etherh
69
BWL_PRE_PACKED_STRUCT struct ether_header {
87
70
uint8 ether_dhost[ETHER_ADDR_LEN];
88
71
uint8 ether_shost[ETHER_ADDR_LEN];
73
} BWL_POST_PACKED_STRUCT;
75
BWL_PRE_PACKED_STRUCT struct ether_addr {
93
76
uint8 octet[ETHER_ADDR_LEN];
77
} BWL_POST_PACKED_STRUCT;
97
80
#define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2))
129
112
((uint8 *)(ea))[4] | \
130
113
((uint8 *)(ea))[5]) == 0)
133
#if !defined(__GNUC__)
115
#define ETHER_MOVE_HDR(d, s) \
117
struct ether_header t; \
118
t = *(struct ether_header *)(s); \
119
*(struct ether_header *)(d) = t; \
122
#include <packed_section_end.h>