0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef _LINUX_IF_HIPPI_H
0024 #define _LINUX_IF_HIPPI_H
0025
0026 #include <linux/types.h>
0027 #include <asm/byteorder.h>
0028
0029
0030
0031
0032
0033 #define HIPPI_ALEN 6
0034 #define HIPPI_HLEN sizeof(struct hippi_hdr)
0035 #define HIPPI_ZLEN 0
0036 #define HIPPI_DATA_LEN 65280
0037 #define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
0038
0039
0040
0041
0042
0043 #define HIPPI_EXTENDED_SAP 0xAA
0044 #define HIPPI_UI_CMD 0x03
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 struct hipnet_statistics {
0056 int rx_packets;
0057 int tx_packets;
0058 int rx_errors;
0059 int tx_errors;
0060 int rx_dropped;
0061 int tx_dropped;
0062
0063
0064 int rx_length_errors;
0065 int rx_over_errors;
0066 int rx_crc_errors;
0067 int rx_frame_errors;
0068 int rx_fifo_errors;
0069 int rx_missed_errors;
0070
0071
0072 int tx_aborted_errors;
0073 int tx_carrier_errors;
0074 int tx_fifo_errors;
0075 int tx_heartbeat_errors;
0076 int tx_window_errors;
0077 };
0078
0079
0080 struct hippi_fp_hdr {
0081 #if 0
0082 __u8 ulp;
0083 #if defined (__BIG_ENDIAN_BITFIELD)
0084 __u8 d1_data_present:1;
0085 __u8 start_d2_burst_boundary:1;
0086 __u8 reserved:6;
0087 #if 0
0088 __u16 reserved1:5;
0089 __u16 d1_area_size:8;
0090 __u16 d2_offset:3;
0091 #endif
0092 #elif defined(__LITTLE_ENDIAN_BITFIELD)
0093 __u8 reserved:6;
0094 __u8 start_d2_burst_boundary:1;
0095 __u8 d1_data_present:1;
0096 #if 0
0097 __u16 d2_offset:3;
0098 __u16 d1_area_size:8;
0099 __u16 reserved1:5;
0100 #endif
0101 #else
0102 #error "Please fix <asm/byteorder.h>"
0103 #endif
0104 #else
0105 __be32 fixed;
0106 #endif
0107 __be32 d2_size;
0108 } __attribute__((packed));
0109
0110 struct hippi_le_hdr {
0111 #if defined (__BIG_ENDIAN_BITFIELD)
0112 __u8 fc:3;
0113 __u8 double_wide:1;
0114 __u8 message_type:4;
0115 #elif defined(__LITTLE_ENDIAN_BITFIELD)
0116 __u8 message_type:4;
0117 __u8 double_wide:1;
0118 __u8 fc:3;
0119 #endif
0120 __u8 dest_switch_addr[3];
0121 #if defined (__BIG_ENDIAN_BITFIELD)
0122 __u8 dest_addr_type:4,
0123 src_addr_type:4;
0124 #elif defined(__LITTLE_ENDIAN_BITFIELD)
0125 __u8 src_addr_type:4,
0126 dest_addr_type:4;
0127 #endif
0128 __u8 src_switch_addr[3];
0129 __u16 reserved;
0130 __u8 daddr[HIPPI_ALEN];
0131 __u16 locally_administered;
0132 __u8 saddr[HIPPI_ALEN];
0133 } __attribute__((packed));
0134
0135 #define HIPPI_OUI_LEN 3
0136
0137
0138
0139
0140 struct hippi_snap_hdr {
0141 __u8 dsap;
0142 __u8 ssap;
0143 __u8 ctrl;
0144 __u8 oui[HIPPI_OUI_LEN];
0145 __be16 ethertype;
0146 } __attribute__((packed));
0147
0148 struct hippi_hdr {
0149 struct hippi_fp_hdr fp;
0150 struct hippi_le_hdr le;
0151 struct hippi_snap_hdr snap;
0152 } __attribute__((packed));
0153
0154 #endif