144d362409d5469aed47d19e7908d19bd194493aThomas Graf/*
244d362409d5469aed47d19e7908d19bd194493aThomas Graf * INET		An implementation of the TCP/IP protocol suite for the LINUX
344d362409d5469aed47d19e7908d19bd194493aThomas Graf *		operating system.  INET is implemented using the  BSD Socket
444d362409d5469aed47d19e7908d19bd194493aThomas Graf *		interface as the means of communication with the user level.
544d362409d5469aed47d19e7908d19bd194493aThomas Graf *
644d362409d5469aed47d19e7908d19bd194493aThomas Graf *		Global definitions for the INET interface module.
744d362409d5469aed47d19e7908d19bd194493aThomas Graf *
844d362409d5469aed47d19e7908d19bd194493aThomas Graf * Version:	@(#)if.h	1.0.2	04/18/93
944d362409d5469aed47d19e7908d19bd194493aThomas Graf *
1044d362409d5469aed47d19e7908d19bd194493aThomas Graf * Authors:	Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
1144d362409d5469aed47d19e7908d19bd194493aThomas Graf *		Ross Biro
1244d362409d5469aed47d19e7908d19bd194493aThomas Graf *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
1344d362409d5469aed47d19e7908d19bd194493aThomas Graf *
1444d362409d5469aed47d19e7908d19bd194493aThomas Graf *		This program is free software; you can redistribute it and/or
1544d362409d5469aed47d19e7908d19bd194493aThomas Graf *		modify it under the terms of the GNU General Public License
1644d362409d5469aed47d19e7908d19bd194493aThomas Graf *		as published by the Free Software Foundation; either version
1744d362409d5469aed47d19e7908d19bd194493aThomas Graf *		2 of the License, or (at your option) any later version.
1844d362409d5469aed47d19e7908d19bd194493aThomas Graf */
1944d362409d5469aed47d19e7908d19bd194493aThomas Graf#ifndef _LINUX_IF_H
2044d362409d5469aed47d19e7908d19bd194493aThomas Graf#define _LINUX_IF_H
2144d362409d5469aed47d19e7908d19bd194493aThomas Graf
223ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#include <linux/types.h>		/* for "__kernel_caddr_t" et al	*/
233ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
2444d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFNAMSIZ	16
2544d362409d5469aed47d19e7908d19bd194493aThomas Graf
2644d362409d5469aed47d19e7908d19bd194493aThomas Graf/* Standard interface flags (netdevice->flags). */
2744d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_UP		0x1		/* interface is up		*/
2844d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_BROADCAST	0x2		/* broadcast address valid	*/
2944d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_DEBUG	0x4		/* turn on debugging		*/
3044d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_LOOPBACK	0x8		/* is a loopback net		*/
3144d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_POINTOPOINT	0x10		/* interface is has p-p link	*/
3244d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_NOTRAILERS	0x20		/* avoid use of trailers	*/
333ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define	IFF_RUNNING	0x40		/* interface RFC2863 OPER_UP	*/
3444d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_NOARP	0x80		/* no ARP protocol		*/
3544d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_PROMISC	0x100		/* receive all packets		*/
3644d362409d5469aed47d19e7908d19bd194493aThomas Graf#define	IFF_ALLMULTI	0x200		/* receive all multicast packets*/
3744d362409d5469aed47d19e7908d19bd194493aThomas Graf
3844d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_MASTER	0x400		/* master of a load balancer 	*/
3944d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_SLAVE	0x800		/* slave of a load balancer	*/
4044d362409d5469aed47d19e7908d19bd194493aThomas Graf
4144d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_MULTICAST	0x1000		/* Supports multicast		*/
4244d362409d5469aed47d19e7908d19bd194493aThomas Graf
4344d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_PORTSEL	0x2000          /* can set media type		*/
4444d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_AUTOMEDIA	0x4000		/* auto media select active	*/
4544d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_DYNAMIC	0x8000		/* dialup device with changing addresses*/
463ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
4744d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_LOWER_UP	0x10000		/* driver signals L1 up		*/
4844d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_DORMANT	0x20000		/* driver signals dormant	*/
4944d362409d5469aed47d19e7908d19bd194493aThomas Graf
503ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_ECHO	0x40000		/* echo sent packets		*/
513ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
523ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_VOLATILE	(IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
533ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf		IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
543ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
5544d362409d5469aed47d19e7908d19bd194493aThomas Graf/* Private (from user) interface flags (netdevice->priv_flags). */
5644d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_802_1Q_VLAN 0x1             /* 802.1Q VLAN device.          */
5744d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IFF_EBRIDGE	0x2		/* Ethernet bridging device.	*/
583ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_SLAVE_INACTIVE	0x4	/* bonding slave not the curr. active */
593ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_MASTER_8023AD	0x8	/* bonding master, 802.3ad. 	*/
603ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_MASTER_ALB	0x10		/* bonding master, balance-alb.	*/
613ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_BONDING	0x20		/* bonding master or slave	*/
623ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_SLAVE_NEEDARP 0x40		/* need ARPs for validation	*/
633ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf#define IFF_ISATAP	0x80		/* ISATAP interface (RFC4214)	*/
6444d362409d5469aed47d19e7908d19bd194493aThomas Graf
6544d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_GET_IFACE	0x0001		/* for querying only */
6644d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_GET_PROTO	0x0002
6744d362409d5469aed47d19e7908d19bd194493aThomas Graf
6844d362409d5469aed47d19e7908d19bd194493aThomas Graf/* For definitions see hdlc.h */
6944d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_V35	0x1000		/* V.35 serial interface	*/
7044d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_V24	0x1001		/* V.24 serial interface	*/
7144d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_X21	0x1002		/* X.21 serial interface	*/
7244d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_T1	0x1003		/* T1 telco serial interface	*/
7344d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_E1	0x1004		/* E1 telco serial interface	*/
7444d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_SYNC_SERIAL 0x1005	/* can't be set by software	*/
7544d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_IFACE_X21D   0x1006          /* X.21 Dual Clocking (FarSite) */
7644d362409d5469aed47d19e7908d19bd194493aThomas Graf
7744d362409d5469aed47d19e7908d19bd194493aThomas Graf/* For definitions see hdlc.h */
7844d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_HDLC	0x2000		/* raw HDLC protocol		*/
7944d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_PPP	0x2001		/* PPP protocol			*/
8044d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_CISCO	0x2002		/* Cisco HDLC protocol		*/
8144d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR	0x2003		/* Frame Relay protocol		*/
8244d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_ADD_PVC 0x2004	/*    Create FR PVC		*/
8344d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_DEL_PVC 0x2005	/*    Delete FR PVC		*/
8444d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_X25	0x2006		/* X.25				*/
8544d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_HDLC_ETH 0x2007	/* raw HDLC, Ethernet emulation	*/
8644d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_ADD_ETH_PVC 0x2008	/*  Create FR Ethernet-bridged PVC */
8744d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_DEL_ETH_PVC 0x2009	/*  Delete FR Ethernet-bridged PVC */
8844d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_PVC	0x200A		/* for reading PVC status	*/
8944d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_FR_ETH_PVC 0x200B
9044d362409d5469aed47d19e7908d19bd194493aThomas Graf#define IF_PROTO_RAW    0x200C          /* RAW Socket                   */
9144d362409d5469aed47d19e7908d19bd194493aThomas Graf
923ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf/* RFC 2863 operational status */
933ad4665be2f192291238cbe78118a57ec42436c6Thomas Grafenum {
943ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_UNKNOWN,
953ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_NOTPRESENT,
963ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_DOWN,
973ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_LOWERLAYERDOWN,
983ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_TESTING,
993ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_DORMANT,
1003ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_OPER_UP,
1013ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf};
1023ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
1033ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf/* link modes */
1043ad4665be2f192291238cbe78118a57ec42436c6Thomas Grafenum {
1053ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_LINK_MODE_DEFAULT,
1063ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf	IF_LINK_MODE_DORMANT,	/* limit upward transition to dormant */
1073ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf};
10844d362409d5469aed47d19e7908d19bd194493aThomas Graf
10944d362409d5469aed47d19e7908d19bd194493aThomas Graf/*
110d8928c19bba91a9e6fd6bcfb74db97e00ab512e9Mathieu Poirier *	Device mapping structure. I'd just gone off and designed a
11144d362409d5469aed47d19e7908d19bd194493aThomas Graf *	beautiful scheme using only loadable modules with arguments
11244d362409d5469aed47d19e7908d19bd194493aThomas Graf *	for driver options and along come the PCMCIA people 8)
11344d362409d5469aed47d19e7908d19bd194493aThomas Graf *
11444d362409d5469aed47d19e7908d19bd194493aThomas Graf *	Ah well. The get() side of this is good for WDSETUP, and it'll
11544d362409d5469aed47d19e7908d19bd194493aThomas Graf *	be handy for debugging things. The set side is fine for now and
11644d362409d5469aed47d19e7908d19bd194493aThomas Graf *	being very small might be worth keeping for clean configuration.
11744d362409d5469aed47d19e7908d19bd194493aThomas Graf */
11844d362409d5469aed47d19e7908d19bd194493aThomas Graf
119d8928c19bba91a9e6fd6bcfb74db97e00ab512e9Mathieu Poirierstruct ifmap
12044d362409d5469aed47d19e7908d19bd194493aThomas Graf{
12144d362409d5469aed47d19e7908d19bd194493aThomas Graf	unsigned long mem_start;
12244d362409d5469aed47d19e7908d19bd194493aThomas Graf	unsigned long mem_end;
123d8928c19bba91a9e6fd6bcfb74db97e00ab512e9Mathieu Poirier	unsigned short base_addr;
12444d362409d5469aed47d19e7908d19bd194493aThomas Graf	unsigned char irq;
12544d362409d5469aed47d19e7908d19bd194493aThomas Graf	unsigned char dma;
12644d362409d5469aed47d19e7908d19bd194493aThomas Graf	unsigned char port;
12744d362409d5469aed47d19e7908d19bd194493aThomas Graf	/* 3 bytes spare */
12844d362409d5469aed47d19e7908d19bd194493aThomas Graf};
12944d362409d5469aed47d19e7908d19bd194493aThomas Graf
1303ad4665be2f192291238cbe78118a57ec42436c6Thomas Graf
13144d362409d5469aed47d19e7908d19bd194493aThomas Graf#endif /* _LINUX_IF_H */
132