OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [include/] [net/] [if_llc.h] - Blame information for rev 663

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      include/net/if_llc.h
4
//
5
//      
6
//
7
//==========================================================================
8
//####BSDCOPYRIGHTBEGIN####
9
//
10
// -------------------------------------------
11
//
12
// Portions of this software may have been derived from OpenBSD or other sources,
13
// and are covered by the appropriate copyright disclaimers included herein.
14
//
15
// -------------------------------------------
16
//
17
//####BSDCOPYRIGHTEND####
18
//==========================================================================
19
//#####DESCRIPTIONBEGIN####
20
//
21
// Author(s):    gthomas
22
// Contributors: gthomas
23
// Date:         2000-01-10
24
// Purpose:      
25
// Description:  
26
//              
27
//
28
//####DESCRIPTIONEND####
29
//
30
//==========================================================================
31
 
32
 
33
/*      $OpenBSD: if_llc.h,v 1.3 1999/07/28 20:02:41 fgsch Exp $        */
34
/*      $NetBSD: if_llc.h,v 1.6 1995/03/08 02:56:57 cgd Exp $   */
35
 
36
/*
37
 * Copyright (c) 1988, 1993
38
 *      The Regents of the University of California.  All rights reserved.
39
 *
40
 * Redistribution and use in source and binary forms, with or without
41
 * modification, are permitted provided that the following conditions
42
 * are met:
43
 * 1. Redistributions of source code must retain the above copyright
44
 *    notice, this list of conditions and the following disclaimer.
45
 * 2. Redistributions in binary form must reproduce the above copyright
46
 *    notice, this list of conditions and the following disclaimer in the
47
 *    documentation and/or other materials provided with the distribution.
48
 * 3. All advertising materials mentioning features or use of this software
49
 *    must display the following acknowledgement:
50
 *      This product includes software developed by the University of
51
 *      California, Berkeley and its contributors.
52
 * 4. Neither the name of the University nor the names of its contributors
53
 *    may be used to endorse or promote products derived from this software
54
 *    without specific prior written permission.
55
 *
56
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
57
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
59
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
60
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
61
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
62
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
64
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
65
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
66
 * SUCH DAMAGE.
67
 *
68
 *      @(#)if_llc.h    8.1 (Berkeley) 6/10/93
69
 */
70
 
71
#ifndef _NET_IF_LLC_H_
72
#define _NET_IF_LLC_H_
73
 
74
/*
75
 * IEEE 802.2 Link Level Control headers, for use in conjunction with
76
 * 802.{3,4,5} media access control methods.
77
 *
78
 * Headers here do not use bit fields due to shortcommings in many
79
 * compilers.
80
 */
81
 
82
struct llc {
83
        u_int8_t llc_dsap;
84
        u_int8_t llc_ssap;
85
        union {
86
            struct {
87
                u_int8_t control;
88
                u_int8_t format_id;
89
                u_int8_t class;
90
                u_int8_t window_x2;
91
            } type_u;
92
            struct {
93
                u_int8_t num_snd_x2;
94
                u_int8_t num_rcv_x2;
95
            } type_i;
96
            struct {
97
                u_int8_t control;
98
                u_int8_t num_rcv_x2;
99
            } type_s;
100
            struct {
101
                u_int8_t control;
102
                struct frmrinfo {
103
                        u_int8_t rej_pdu_0;
104
                        u_int8_t rej_pdu_1;
105
                        u_int8_t frmr_control;
106
                        u_int8_t frmr_control_ext;
107
                        u_int8_t frmr_cause;
108
                } frmrinfo;
109
            } type_frmr;
110
            struct {
111
                u_int8_t  control;
112
                u_int8_t  org_code[3];
113
                u_int16_t ether_type;
114
            } type_snap;
115
            struct {
116
                u_int8_t control;
117
                u_int8_t control_ext;
118
            } type_raw;
119
        } llc_un;
120
};
121
#define llc_control            llc_un.type_u.control
122
#define llc_control_ext        llc_un.type_raw.control_ext
123
#define llc_fid                llc_un.type_u.format_id
124
#define llc_class              llc_un.type_u.class
125
#define llc_window             llc_un.type_u.window_x2
126
#define llc_frmrinfo           llc_un.type_frmr.frmrinfo
127
#define llc_frmr_pdu0          llc_un.type_frmr.frmrinfo.rej_pdu0
128
#define llc_frmr_pdu1          llc_un.type_frmr.frmrinfo.rej_pdu1
129
#define llc_frmr_control       llc_un.type_frmr.frmrinfo.frmr_control
130
#define llc_frmr_control_ext   llc_un.type_frmr.frmrinfo.frmr_control_ext
131
#define llc_frmr_cause         llc_un.type_frmr.frmrinfo.frmr_control_ext
132
 
133
/*
134
 * Don't use sizeof(struct llc_un) for LLC header sizes
135
 */
136
#define LLC_UFRAMELEN           3
137
#define LLC_ISFRAMELEN          4
138
#define LLC_FRMRLEN             7
139
#define LLC_SNAPFRAMELEN        8
140
 
141
/*
142
 * Unnumbered LLC format commands
143
 */
144
#define LLC_UI          0x3
145
#define LLC_UI_P        0x13
146
#define LLC_DISC        0x43
147
#define LLC_DISC_P      0x53
148
#define LLC_UA          0x63
149
#define LLC_UA_P        0x73
150
#define LLC_TEST        0xe3
151
#define LLC_TEST_P      0xf3
152
#define LLC_FRMR        0x87
153
#define LLC_FRMR_P      0x97
154
#define LLC_DM          0x0f
155
#define LLC_DM_P        0x1f
156
#define LLC_XID         0xaf
157
#define LLC_XID_P       0xbf
158
#define LLC_SABME       0x6f
159
#define LLC_SABME_P     0x7f
160
 
161
/*
162
 * Supervisory LLC commands
163
 */
164
#define LLC_RR          0x01
165
#define LLC_RNR         0x05
166
#define LLC_REJ         0x09
167
 
168
/*
169
 * Info format - dummy only
170
 */
171
#define LLC_INFO        0x00
172
 
173
/*
174
 * ISO PDTR 10178 contains among others
175
 */
176
#define LLC_X25_LSAP    0x7e
177
#define LLC_SNAP_LSAP   0xaa
178
#define LLC_ISO_LSAP    0xfe
179
 
180
#endif // _NET_IF_LLC_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.