1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef _LINUX_IF_HIPPI_H
24 #define _LINUX_IF_HIPPI_H
25
26 #include <linux/types.h>
27 #include <asm/byteorder.h>
28
29
30
31
32
33 #define HIPPI_ALEN 6
34 #define HIPPI_HLEN sizeof(struct hippi_hdr)
35 #define HIPPI_ZLEN 0
36 #define HIPPI_DATA_LEN 65280
37 #define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
38
39
40
41
42
43 #define HIPPI_EXTENDED_SAP 0xAA
44 #define HIPPI_UI_CMD 0x03
45
46
47
48
49
50
51
52
53
54
55 struct hipnet_statistics {
56 int rx_packets;
57 int tx_packets;
58 int rx_errors;
59 int tx_errors;
60 int rx_dropped;
61 int tx_dropped;
62
63
64 int rx_length_errors;
65 int rx_over_errors;
66 int rx_crc_errors;
67 int rx_frame_errors;
68 int rx_fifo_errors;
69 int rx_missed_errors;
70
71
72 int tx_aborted_errors;
73 int tx_carrier_errors;
74 int tx_fifo_errors;
75 int tx_heartbeat_errors;
76 int tx_window_errors;
77 };
78
79
80 struct hippi_fp_hdr {
81 #if 0
82 __u8 ulp;
83 #if defined (__BIG_ENDIAN_BITFIELD)
84 __u8 d1_data_present:1;
85 __u8 start_d2_burst_boundary:1;
86 __u8 reserved:6;
87 #if 0
88 __u16 reserved1:5;
89 __u16 d1_area_size:8;
90 __u16 d2_offset:3;
91 #endif
92 #elif defined(__LITTLE_ENDIAN_BITFIELD)
93 __u8 reserved:6;
94 __u8 start_d2_burst_boundary:1;
95 __u8 d1_data_present:1;
96 #if 0
97 __u16 d2_offset:3;
98 __u16 d1_area_size:8;
99 __u16 reserved1:5;
100 #endif
101 #else
102 #error "Please fix <asm/byteorder.h>"
103 #endif
104 #else
105 __be32 fixed;
106 #endif
107 __be32 d2_size;
108 } __attribute__((packed));
109
110 struct hippi_le_hdr {
111 #if defined (__BIG_ENDIAN_BITFIELD)
112 __u8 fc:3;
113 __u8 double_wide:1;
114 __u8 message_type:4;
115 #elif defined(__LITTLE_ENDIAN_BITFIELD)
116 __u8 message_type:4;
117 __u8 double_wide:1;
118 __u8 fc:3;
119 #endif
120 __u8 dest_switch_addr[3];
121 #if defined (__BIG_ENDIAN_BITFIELD)
122 __u8 dest_addr_type:4,
123 src_addr_type:4;
124 #elif defined(__LITTLE_ENDIAN_BITFIELD)
125 __u8 src_addr_type:4,
126 dest_addr_type:4;
127 #endif
128 __u8 src_switch_addr[3];
129 __u16 reserved;
130 __u8 daddr[HIPPI_ALEN];
131 __u16 locally_administered;
132 __u8 saddr[HIPPI_ALEN];
133 } __attribute__((packed));
134
135 #define HIPPI_OUI_LEN 3
136
137
138
139
140 struct hippi_snap_hdr {
141 __u8 dsap;
142 __u8 ssap;
143 __u8 ctrl;
144 __u8 oui[HIPPI_OUI_LEN];
145 __be16 ethertype;
146 } __attribute__((packed));
147
148 struct hippi_hdr {
149 struct hippi_fp_hdr fp;
150 struct hippi_le_hdr le;
151 struct hippi_snap_hdr snap;
152 } __attribute__((packed));
153
154 #endif