1c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
2c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * INET         An implementation of the TCP/IP protocol suite for the LINUX
3c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              operating system.  INET is implemented using the  BSD Socket
4c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              interface as the means of communication with the user level.
5c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *
6c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              Global definitions for the ARCnet interface.
7c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *
8c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * Authors:     David Woodhouse and Avery Pennarun
9c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *
10c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              This program is free software; you can redistribute it and/or
11c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              modify it under the terms of the GNU General Public License
12c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              as published by the Free Software Foundation; either version
13c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *              2 of the License, or (at your option) any later version.
14c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
15c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
16c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#ifndef _LINUX_IF_ARCNET_H
17c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define _LINUX_IF_ARCNET_H
18c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
19c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#include <linux/if_ether.h>
20c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
21c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
22c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
23c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *    These are the defined ARCnet Protocol ID's.
24c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
25c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
26c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* CAP mode */
27c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* No macro but uses 1-8 */
28c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
29c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* RFC1201 Protocol ID's */
30c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_IP		212	/* 0xD4 */
31c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_IPV6		196	/* 0xC4: RFC2497 */
32c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_ARP		213	/* 0xD5 */
33c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_RARP		214	/* 0xD6 */
34c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_IPX		250	/* 0xFA */
35c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_NOVELL_EC		236	/* 0xEC */
36c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
37c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* Old RFC1051 Protocol ID's */
38c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_IP_RFC1051	240	/* 0xF0 */
39c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_ARP_RFC1051	241	/* 0xF1 */
40c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
41c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* MS LanMan/WfWg "NDIS" encapsulation */
42c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_ETHER		232	/* 0xE8 */
43c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
44c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* Unsupported/indirectly supported protocols */
45c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_DATAPOINT_BOOT	0	/* very old Datapoint equipment */
46c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_DATAPOINT_MOUNT	1
47c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_POWERLAN_BEACON	8	/* Probably ATA-Netbios related */
48c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_POWERLAN_BEACON2	243	/* 0xF3 */
49c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_LANSOFT		251	/* 0xFB - what is this? */
50c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_P_ATALK		0xDD
51c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
52c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* Hardware address length */
53c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARCNET_ALEN	1
54c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
55c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
56c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * The RFC1201-specific components of an arcnet packet header.
57c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
58c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct arc_rfc1201
59c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
60c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t  proto;		/* protocol ID field - varies		*/
61c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t  split_flag;	/* for use with split packets		*/
62c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint16_t sequence;		/* sequence number			*/
63c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t  payload[0];	/* space remaining in packet (504 bytes)*/
64c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
65c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define RFC1201_HDR_SIZE 4
66c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
67c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
68c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
69c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * The RFC1051-specific components.
70c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
71c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct arc_rfc1051
72c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
73c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t proto;		/* ARC_P_RFC1051_ARP/RFC1051_IP	*/
74c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t payload[0];		/* 507 bytes			*/
75c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
76c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define RFC1051_HDR_SIZE 1
77c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
78c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
79c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
80c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * The ethernet-encap-specific components.  We have a real ethernet header
81c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * and some data.
82c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
83c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct arc_eth_encap
84c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
85c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t proto;		/* Always ARC_P_ETHER			*/
86c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    struct ethhdr eth;		/* standard ethernet header (yuck!)	*/
87c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t payload[0];		/* 493 bytes				*/
88c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
89c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ETH_ENCAP_HDR_SIZE 14
90c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
91c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
92c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct arc_cap
93c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
94c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	uint8_t proto;
95c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	uint8_t cookie[sizeof(int)];   /* Actually NOT sent over the network */
96c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	union {
97c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru		uint8_t ack;
98c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru		uint8_t raw[0];		/* 507 bytes */
99c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	} mes;
100c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
101c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
102c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
103c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * The data needed by the actual arcnet hardware.
104c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *
105c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * Now, in the real arcnet hardware, the third and fourth bytes are the
106c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * 'offset' specification instead of the length, and the soft data is at
107c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * the _end_ of the 512-byte buffer.  We hide this complexity inside the
108c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * driver.
109c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
110c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct arc_hardware
111c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
112c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    uint8_t  source,		/* source ARCnet - filled in automagically */
113c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru             dest,		/* destination ARCnet - 0 for broadcast    */
114c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    	     offset[2];		/* offset bytes (some weird semantics)     */
115c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
116c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define ARC_HDR_SIZE 4
117c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
118c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
119c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * This is an ARCnet frame header, as seen by the kernel (and userspace,
120c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * when you do a raw packet capture).
121c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
122c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct archdr
123c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru{
124c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    /* hardware requirements */
125c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    struct arc_hardware hard;
126c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
127c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    /* arcnet encapsulation-specific bits */
128c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    union {
129c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	struct arc_rfc1201   rfc1201;
130c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	struct arc_rfc1051   rfc1051;
131c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	struct arc_eth_encap eth_encap;
132c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	struct arc_cap       cap;
133c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	uint8_t raw[0];		/* 508 bytes				*/
134c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru    } soft;
135c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
136c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
137c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#endif				/* _LINUX_IF_ARCNET_H */
138