blob: 90efda0b137d7ed13a35418fcfab774c82ca4ed1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-s390/qeth.h
3 *
4 * ioctl definitions for qeth driver
5 *
6 * Copyright (C) 2004 IBM Corporation
7 *
8 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
9 *
10 */
11#ifndef __ASM_S390_QETH_IOCTL_H__
12#define __ASM_S390_QETH_IOCTL_H__
Heiko Carstens0680ba02009-01-09 12:14:52 +010013#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/ioctl.h>
15
16#define SIOC_QETH_ARP_SET_NO_ENTRIES (SIOCDEVPRIVATE)
17#define SIOC_QETH_ARP_QUERY_INFO (SIOCDEVPRIVATE + 1)
18#define SIOC_QETH_ARP_ADD_ENTRY (SIOCDEVPRIVATE + 2)
19#define SIOC_QETH_ARP_REMOVE_ENTRY (SIOCDEVPRIVATE + 3)
20#define SIOC_QETH_ARP_FLUSH_CACHE (SIOCDEVPRIVATE + 4)
21#define SIOC_QETH_ADP_SET_SNMP_CONTROL (SIOCDEVPRIVATE + 5)
22#define SIOC_QETH_GET_CARD_TYPE (SIOCDEVPRIVATE + 6)
23
24struct qeth_arp_cache_entry {
25 __u8 macaddr[6];
26 __u8 reserved1[2];
27 __u8 ipaddr[16]; /* for both IPv4 and IPv6 */
28 __u8 reserved2[32];
29} __attribute__ ((packed));
30
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000031enum qeth_arp_ipaddrtype {
32 QETHARP_IP_ADDR_V4 = 1,
33 QETHARP_IP_ADDR_V6 = 2,
34};
35struct qeth_arp_entrytype {
36 __u8 mac;
37 __u8 ip;
38} __attribute__((packed));
39
40#define QETH_QARP_MEDIASPECIFIC_BYTES 32
41#define QETH_QARP_MACADDRTYPE_BYTES 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070042struct qeth_arp_qi_entry7 {
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000043 __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
44 struct qeth_arp_entrytype type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 __u8 macaddr[6];
46 __u8 ipaddr[4];
47} __attribute__((packed));
48
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000049struct qeth_arp_qi_entry7_ipv6 {
50 __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
51 struct qeth_arp_entrytype type;
52 __u8 macaddr[6];
53 __u8 ipaddr[16];
54} __attribute__((packed));
55
Linus Torvalds1da177e2005-04-16 15:20:36 -070056struct qeth_arp_qi_entry7_short {
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000057 struct qeth_arp_entrytype type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 __u8 macaddr[6];
59 __u8 ipaddr[4];
60} __attribute__((packed));
61
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000062struct qeth_arp_qi_entry7_short_ipv6 {
63 struct qeth_arp_entrytype type;
64 __u8 macaddr[6];
65 __u8 ipaddr[16];
66} __attribute__((packed));
67
Linus Torvalds1da177e2005-04-16 15:20:36 -070068struct qeth_arp_qi_entry5 {
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000069 __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
70 struct qeth_arp_entrytype type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 __u8 ipaddr[4];
72} __attribute__((packed));
73
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000074struct qeth_arp_qi_entry5_ipv6 {
75 __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
76 struct qeth_arp_entrytype type;
77 __u8 ipaddr[16];
78} __attribute__((packed));
79
Linus Torvalds1da177e2005-04-16 15:20:36 -070080struct qeth_arp_qi_entry5_short {
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000081 struct qeth_arp_entrytype type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070082 __u8 ipaddr[4];
83} __attribute__((packed));
84
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000085struct qeth_arp_qi_entry5_short_ipv6 {
86 struct qeth_arp_entrytype type;
87 __u8 ipaddr[16];
88} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070089/*
90 * can be set by user if no "media specific information" is wanted
91 * -> saves a lot of space in user space buffer
92 */
93#define QETH_QARP_STRIP_ENTRIES 0x8000
Einar Lueckd0ddf30f2010-12-08 02:57:58 +000094#define QETH_QARP_WITH_IPV6 0x4000
Linus Torvalds1da177e2005-04-16 15:20:36 -070095#define QETH_QARP_REQUEST_MASK 0x00ff
96
97/* data sent to user space as result of query arp ioctl */
98#define QETH_QARP_USER_DATA_SIZE 20000
99#define QETH_QARP_MASK_OFFSET 4
100#define QETH_QARP_ENTRIES_OFFSET 6
101struct qeth_arp_query_user_data {
102 union {
103 __u32 data_len; /* set by user space program */
104 __u32 no_entries; /* set by kernel */
105 } u;
106 __u16 mask_bits;
107 char *entries;
108} __attribute__((packed));
109
110#endif /* __ASM_S390_QETH_IOCTL_H__ */