xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/if_hippi.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1*8d67ca89SAndroid Build Coastguard Worker /*
2*8d67ca89SAndroid Build Coastguard Worker  * This file is auto-generated. Modifications will be lost.
3*8d67ca89SAndroid Build Coastguard Worker  *
4*8d67ca89SAndroid Build Coastguard Worker  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5*8d67ca89SAndroid Build Coastguard Worker  * for more information.
6*8d67ca89SAndroid Build Coastguard Worker  */
7*8d67ca89SAndroid Build Coastguard Worker #ifndef _LINUX_IF_HIPPI_H
8*8d67ca89SAndroid Build Coastguard Worker #define _LINUX_IF_HIPPI_H
9*8d67ca89SAndroid Build Coastguard Worker #include <linux/types.h>
10*8d67ca89SAndroid Build Coastguard Worker #include <asm/byteorder.h>
11*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_ALEN 6
12*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_HLEN sizeof(struct hippi_hdr)
13*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_ZLEN 0
14*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_DATA_LEN 65280
15*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
16*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_EXTENDED_SAP 0xAA
17*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_UI_CMD 0x03
18*8d67ca89SAndroid Build Coastguard Worker struct hipnet_statistics {
19*8d67ca89SAndroid Build Coastguard Worker   int rx_packets;
20*8d67ca89SAndroid Build Coastguard Worker   int tx_packets;
21*8d67ca89SAndroid Build Coastguard Worker   int rx_errors;
22*8d67ca89SAndroid Build Coastguard Worker   int tx_errors;
23*8d67ca89SAndroid Build Coastguard Worker   int rx_dropped;
24*8d67ca89SAndroid Build Coastguard Worker   int tx_dropped;
25*8d67ca89SAndroid Build Coastguard Worker   int rx_length_errors;
26*8d67ca89SAndroid Build Coastguard Worker   int rx_over_errors;
27*8d67ca89SAndroid Build Coastguard Worker   int rx_crc_errors;
28*8d67ca89SAndroid Build Coastguard Worker   int rx_frame_errors;
29*8d67ca89SAndroid Build Coastguard Worker   int rx_fifo_errors;
30*8d67ca89SAndroid Build Coastguard Worker   int rx_missed_errors;
31*8d67ca89SAndroid Build Coastguard Worker   int tx_aborted_errors;
32*8d67ca89SAndroid Build Coastguard Worker   int tx_carrier_errors;
33*8d67ca89SAndroid Build Coastguard Worker   int tx_fifo_errors;
34*8d67ca89SAndroid Build Coastguard Worker   int tx_heartbeat_errors;
35*8d67ca89SAndroid Build Coastguard Worker   int tx_window_errors;
36*8d67ca89SAndroid Build Coastguard Worker };
37*8d67ca89SAndroid Build Coastguard Worker struct hippi_fp_hdr {
38*8d67ca89SAndroid Build Coastguard Worker   __be32 fixed;
39*8d67ca89SAndroid Build Coastguard Worker   __be32 d2_size;
40*8d67ca89SAndroid Build Coastguard Worker } __attribute__((packed));
41*8d67ca89SAndroid Build Coastguard Worker struct hippi_le_hdr {
42*8d67ca89SAndroid Build Coastguard Worker #ifdef __BIG_ENDIAN_BITFIELD
43*8d67ca89SAndroid Build Coastguard Worker   __u8 fc : 3;
44*8d67ca89SAndroid Build Coastguard Worker   __u8 double_wide : 1;
45*8d67ca89SAndroid Build Coastguard Worker   __u8 message_type : 4;
46*8d67ca89SAndroid Build Coastguard Worker #elif defined(__LITTLE_ENDIAN_BITFIELD)
47*8d67ca89SAndroid Build Coastguard Worker   __u8 message_type : 4;
48*8d67ca89SAndroid Build Coastguard Worker   __u8 double_wide : 1;
49*8d67ca89SAndroid Build Coastguard Worker   __u8 fc : 3;
50*8d67ca89SAndroid Build Coastguard Worker #endif
51*8d67ca89SAndroid Build Coastguard Worker   __u8 dest_switch_addr[3];
52*8d67ca89SAndroid Build Coastguard Worker #ifdef __BIG_ENDIAN_BITFIELD
53*8d67ca89SAndroid Build Coastguard Worker   __u8 dest_addr_type : 4, src_addr_type : 4;
54*8d67ca89SAndroid Build Coastguard Worker #elif defined(__LITTLE_ENDIAN_BITFIELD)
55*8d67ca89SAndroid Build Coastguard Worker   __u8 src_addr_type : 4, dest_addr_type : 4;
56*8d67ca89SAndroid Build Coastguard Worker #endif
57*8d67ca89SAndroid Build Coastguard Worker   __u8 src_switch_addr[3];
58*8d67ca89SAndroid Build Coastguard Worker   __u16 reserved;
59*8d67ca89SAndroid Build Coastguard Worker   __u8 daddr[HIPPI_ALEN];
60*8d67ca89SAndroid Build Coastguard Worker   __u16 locally_administered;
61*8d67ca89SAndroid Build Coastguard Worker   __u8 saddr[HIPPI_ALEN];
62*8d67ca89SAndroid Build Coastguard Worker } __attribute__((packed));
63*8d67ca89SAndroid Build Coastguard Worker #define HIPPI_OUI_LEN 3
64*8d67ca89SAndroid Build Coastguard Worker struct hippi_snap_hdr {
65*8d67ca89SAndroid Build Coastguard Worker   __u8 dsap;
66*8d67ca89SAndroid Build Coastguard Worker   __u8 ssap;
67*8d67ca89SAndroid Build Coastguard Worker   __u8 ctrl;
68*8d67ca89SAndroid Build Coastguard Worker   __u8 oui[HIPPI_OUI_LEN];
69*8d67ca89SAndroid Build Coastguard Worker   __be16 ethertype;
70*8d67ca89SAndroid Build Coastguard Worker } __attribute__((packed));
71*8d67ca89SAndroid Build Coastguard Worker struct hippi_hdr {
72*8d67ca89SAndroid Build Coastguard Worker   struct hippi_fp_hdr fp;
73*8d67ca89SAndroid Build Coastguard Worker   struct hippi_le_hdr le;
74*8d67ca89SAndroid Build Coastguard Worker   struct hippi_snap_hdr snap;
75*8d67ca89SAndroid Build Coastguard Worker } __attribute__((packed));
76*8d67ca89SAndroid Build Coastguard Worker #endif
77