1/*	$NetBSD: if_fddi.h,v 1.13 2007/09/01 07:40:53 dyoung Exp $	*/
2
3/*
4 * Copyright (c) 1995 Matt Thomas (thomas@lkg.dec.com)
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products
13 *    derived from this software without specific prior written permission
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * Id: if_fddi.h,v 1.5 1997/03/21 13:46:50 thomas Exp
27 */
28
29#ifndef _NET_IF_FDDI_H_
30#define _NET_IF_FDDI_H_
31
32/*
33 * Structure of an 100Mb/s FDDI header.
34 */
35struct	fddi_header {
36	u_char	fddi_ph[3];		/* makes the FDDI header 16 bytes */
37	u_char	fddi_fc;
38	u_char	fddi_dhost[6];
39	u_char	fddi_shost[6];
40} __packed;
41
42#define	FDDIIPMTU		4352
43#define	FDDIMTU			4470
44#define	FDDIMIN			3
45
46#define	FDDIFC_C		0x80	/* 0b10000000 */
47#define	FDDIFC_L		0x40	/* 0b01000000 */
48#define	FDDIFC_F		0x30	/* 0b00110000 */
49#define	FDDIFC_Z		0x0F	/* 0b00001111 */
50
51/*
52 * FDDI Frame Control values. (48-bit addressing only).
53 */
54#define	FDDIFC_VOID		0x40		/* Void frame */
55#define	FDDIFC_NRT		0x80		/* Nonrestricted token */
56#define	FDDIFC_RT		0xc0		/* Restricted token */
57#define	FDDIFC_MAC_BEACON	0xc2		/* MAC Beacon frame */
58#define	FDDIFC_MAC_CLAIM	0xc3		/* MAC Claim frame */
59#define	FDDIFC_LLC_ASYNC	0x50
60#define	FDDIFC_LLC_PRIO0	0
61#define	FDDIFC_LLC_PRIO1	1
62#define	FDDIFC_LLC_PRIO2	2
63#define	FDDIFC_LLC_PRIO3	3
64#define	FDDIFC_LLC_PRIO4	4
65#define	FDDIFC_LLC_PRIO5	5
66#define	FDDIFC_LLC_PRIO6	6
67#define	FDDIFC_LLC_PRIO7	7
68#define FDDIFC_LLC_SYNC         0xd0
69#define	FDDIFC_IMP_ASYNC	0x60		/* Implementor Async. */
70#define	FDDIFC_IMP_SYNC		0xe0		/* Implementor Synch. */
71#define	FDDIFC_SMT		0x40
72#define	FDDIFC_SMT_INFO		0x41		/* SMT Info */
73#define	FDDIFC_SMT_NSA		0x4F		/* SMT Next station adrs */
74#define FDDIFC_MAC		0xc0		/* MAC frame */
75
76#define	FDDIFC_CLFF		0xF0		/* Class/Length/Format bits */
77#define	FDDIFC_ZZZZ		0x0F		/* Control bits */
78
79#if defined(KERNEL) || defined(_KERNEL)
80#if defined(__NetBSD__)
81#include <net/if_ether.h>
82#endif
83#define	fddibroadcastaddr	etherbroadcastaddr
84#define	fddi_ipmulticast_min	ether_ipmulticast_min
85#define	fddi_ipmulticast_max	ether_ipmulticast_max
86#define	fddi_sprintf		ether_sprintf
87
88#if defined(__NetBSD__)
89void    fddi_ifattach(struct ifnet *, void *);
90#else
91void    fddi_ifattach(struct ifnet *);
92#endif
93#endif
94
95#endif /* !_NET_IF_FDDI_H_ */
96