2 * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
3 * Copyright (c) 2013 Qualcomm Atheros, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted (subject to the limitations in the
9 * disclaimer below) provided that the following conditions are met:
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the
19 * * Neither the name of Qualcomm Atheros nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * Alternatively, this software may be distributed under the terms of the
24 * GNU General Public License ("GPL") version 2 as published by the Free
25 * Software Foundation.
27 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
28 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
29 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
36 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
37 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
38 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
39 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 * Copyright (c) 1988, 1993
43 * The Regents of the University of California. All rights reserved.
45 * Redistribution and use in source and binary forms, with or without
46 * modification, are permitted provided that the following conditions
48 * 1. Redistributions of source code must retain the above copyright
49 * notice, this list of conditions and the following disclaimer.
50 * 2. Redistributions in binary form must reproduce the above copyright
51 * notice, this list of conditions and the following disclaimer in the
52 * documentation and/or other materials provided with the distribution.
53 * 4. Neither the name of the University nor the names of its contributors
54 * may be used to endorse or promote products derived from this software
55 * without specific prior written permission.
57 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
58 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
59 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
60 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
61 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
62 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
63 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
64 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
65 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
66 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * @(#)if_llc.h 8.1 (Berkeley) 6/10/93
70 * $FreeBSD: src/sys/net/if_llc.h,v 1.9 2002/09/23 06:25:08 alfred Exp $
73 #ifndef _NET_IF_LLC_H_
74 #define _NET_IF_LLC_H_
77 * IEEE 802.2 Link Level Control headers, for use in conjunction with
78 * 802.{3,4,5} media access control methods.
80 * Headers here do not use bit fields due to shortcommings in many
93 } adf_os_packed type_u;
97 } adf_os_packed type_i;
100 a_uint8_t num_rcv_x2;
101 } adf_os_packed type_s;
105 * We cannot put the following fields in a structure because
106 * the structure rounding might cause padding.
108 a_uint8_t frmr_rej_pdu0;
109 a_uint8_t frmr_rej_pdu1;
110 a_uint8_t frmr_control;
111 a_uint8_t frmr_control_ext;
112 a_uint8_t frmr_cause;
113 } adf_os_packed type_frmr;
116 a_uint8_t org_code[3];
117 a_uint16_t ether_type;
118 } adf_os_packed type_snap;
121 a_uint8_t control_ext;
122 } adf_os_packed type_raw;
123 } llc_un /* XXX adf_os_packed ??? */;
127 a_uint8_t frmr_rej_pdu0;
128 a_uint8_t frmr_rej_pdu1;
129 a_uint8_t frmr_control;
130 a_uint8_t frmr_control_ext;
131 a_uint8_t frmr_cause;
134 #define llc_control llc_un.type_u.control
135 #define llc_control_ext llc_un.type_raw.control_ext
136 #define llc_fid llc_un.type_u.format_id
137 #define llc_class llc_un.type_u.class
138 #define llc_window llc_un.type_u.window_x2
139 #define llc_frmrinfo llc_un.type_frmr.frmr_rej_pdu0
140 #define llc_frmr_pdu0 llc_un.type_frmr.frmr_rej_pdu0
141 #define llc_frmr_pdu1 llc_un.type_frmr.frmr_rej_pdu1
142 #define llc_frmr_control llc_un.type_frmr.frmr_control
143 #define llc_frmr_control_ext llc_un.type_frmr.frmr_control_ext
144 #define llc_frmr_cause llc_un.type_frmr.frmr_cause
145 #define llc_snap llc_un.type_snap
148 * Don't use sizeof(struct llc_un) for LLC header sizes
150 #define LLC_ISFRAMELEN 4
151 #define LLC_UFRAMELEN 3
152 #define LLC_FRMRLEN 7
153 #define LLC_SNAPFRAMELEN 8
156 * Unnumbered LLC format commands
159 #define LLC_UI_P 0x13
160 #define LLC_DISC 0x43
161 #define LLC_DISC_P 0x53
163 #define LLC_UA_P 0x73
164 #define LLC_TEST 0xe3
165 #define LLC_TEST_P 0xf3
166 #define LLC_FRMR 0x87
167 #define LLC_FRMR_P 0x97
169 #define LLC_DM_P 0x1f
171 #define LLC_XID_P 0xbf
172 #define LLC_SABME 0x6f
173 #define LLC_SABME_P 0x7f
176 * Supervisory LLC commands
183 * Info format - dummy only
185 #define LLC_INFO 0x00
188 * ISO PDTR 10178 contains among others
190 #define LLC_X25_LSAP 0x7e
191 #define LLC_SNAP_LSAP 0xaa
192 #define LLC_ISO_LSAP 0xfe
194 #endif /* _NET_IF_LLC_H_ */