blob: a17d1189907262baf802bf26d7061e869a029825 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _LINUX_IF_HIPPI_H
8#define _LINUX_IF_HIPPI_H
9#include <linux/types.h>
10#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define HIPPI_ALEN 6
12#define HIPPI_HLEN sizeof(struct hippi_hdr)
13#define HIPPI_ZLEN 0
14#define HIPPI_DATA_LEN 65280
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
16#define HIPPI_EXTENDED_SAP 0xAA
17#define HIPPI_UI_CMD 0x03
18struct hipnet_statistics {
Tao Baod7db5942015-01-28 10:07:51 -080019 int rx_packets;
20 int tx_packets;
21 int rx_errors;
22 int tx_errors;
Tao Baod7db5942015-01-28 10:07:51 -080023 int rx_dropped;
24 int tx_dropped;
25 int rx_length_errors;
26 int rx_over_errors;
Tao Baod7db5942015-01-28 10:07:51 -080027 int rx_crc_errors;
28 int rx_frame_errors;
29 int rx_fifo_errors;
30 int rx_missed_errors;
Tao Baod7db5942015-01-28 10:07:51 -080031 int tx_aborted_errors;
32 int tx_carrier_errors;
33 int tx_fifo_errors;
34 int tx_heartbeat_errors;
Tao Baod7db5942015-01-28 10:07:51 -080035 int tx_window_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -070036};
37struct hippi_fp_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080038 __be32 fixed;
Tao Baod7db5942015-01-28 10:07:51 -080039 __be32 d2_size;
Ben Cheng655a7c02013-10-16 16:09:24 -070040} __attribute__((packed));
41struct hippi_le_hdr {
42#ifdef __BIG_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080043 __u8 fc : 3;
44 __u8 double_wide : 1;
45 __u8 message_type : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070046#elif defined(__LITTLE_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080047 __u8 message_type : 4;
48 __u8 double_wide : 1;
49 __u8 fc : 3;
Ben Cheng655a7c02013-10-16 16:09:24 -070050#endif
Tao Baod7db5942015-01-28 10:07:51 -080051 __u8 dest_switch_addr[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070052#ifdef __BIG_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080053 __u8 dest_addr_type : 4, src_addr_type : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070054#elif defined(__LITTLE_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080055 __u8 src_addr_type : 4, dest_addr_type : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070056#endif
Tao Baod7db5942015-01-28 10:07:51 -080057 __u8 src_switch_addr[3];
58 __u16 reserved;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u8 daddr[HIPPI_ALEN];
60 __u16 locally_administered;
61 __u8 saddr[HIPPI_ALEN];
Ben Cheng655a7c02013-10-16 16:09:24 -070062} __attribute__((packed));
63#define HIPPI_OUI_LEN 3
64struct hippi_snap_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080065 __u8 dsap;
66 __u8 ssap;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u8 ctrl;
68 __u8 oui[HIPPI_OUI_LEN];
69 __be16 ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -070070} __attribute__((packed));
Tao Baod7db5942015-01-28 10:07:51 -080071struct hippi_hdr {
72 struct hippi_fp_hdr fp;
73 struct hippi_le_hdr le;
74 struct hippi_snap_hdr snap;
Ben Cheng655a7c02013-10-16 16:09:24 -070075} __attribute__((packed));
76#endif