Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * ioctl definitions for qeth driver |
| 3 | * |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 2004 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
| 6 | * Author(s): Thomas Spatzier <tspat@de.ibm.com> |
| 7 | * |
| 8 | */ |
| 9 | #ifndef __ASM_S390_QETH_IOCTL_H__ |
| 10 | #define __ASM_S390_QETH_IOCTL_H__ |
Heiko Carstens | 0680ba0 | 2009-01-09 12:14:52 +0100 | [diff] [blame] | 11 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/ioctl.h> |
| 13 | |
| 14 | #define SIOC_QETH_ARP_SET_NO_ENTRIES (SIOCDEVPRIVATE) |
| 15 | #define SIOC_QETH_ARP_QUERY_INFO (SIOCDEVPRIVATE + 1) |
| 16 | #define SIOC_QETH_ARP_ADD_ENTRY (SIOCDEVPRIVATE + 2) |
| 17 | #define SIOC_QETH_ARP_REMOVE_ENTRY (SIOCDEVPRIVATE + 3) |
| 18 | #define SIOC_QETH_ARP_FLUSH_CACHE (SIOCDEVPRIVATE + 4) |
| 19 | #define SIOC_QETH_ADP_SET_SNMP_CONTROL (SIOCDEVPRIVATE + 5) |
| 20 | #define SIOC_QETH_GET_CARD_TYPE (SIOCDEVPRIVATE + 6) |
Frank Blaschka | c3ab96f | 2012-02-08 00:19:49 +0000 | [diff] [blame] | 21 | #define SIOC_QETH_QUERY_OAT (SIOCDEVPRIVATE + 7) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | struct qeth_arp_cache_entry { |
| 24 | __u8 macaddr[6]; |
| 25 | __u8 reserved1[2]; |
| 26 | __u8 ipaddr[16]; /* for both IPv4 and IPv6 */ |
| 27 | __u8 reserved2[32]; |
| 28 | } __attribute__ ((packed)); |
| 29 | |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 30 | enum qeth_arp_ipaddrtype { |
| 31 | QETHARP_IP_ADDR_V4 = 1, |
| 32 | QETHARP_IP_ADDR_V6 = 2, |
| 33 | }; |
| 34 | struct qeth_arp_entrytype { |
| 35 | __u8 mac; |
| 36 | __u8 ip; |
| 37 | } __attribute__((packed)); |
| 38 | |
| 39 | #define QETH_QARP_MEDIASPECIFIC_BYTES 32 |
| 40 | #define QETH_QARP_MACADDRTYPE_BYTES 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | struct qeth_arp_qi_entry7 { |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 42 | __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES]; |
| 43 | struct qeth_arp_entrytype type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | __u8 macaddr[6]; |
| 45 | __u8 ipaddr[4]; |
| 46 | } __attribute__((packed)); |
| 47 | |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 48 | struct qeth_arp_qi_entry7_ipv6 { |
| 49 | __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES]; |
| 50 | struct qeth_arp_entrytype type; |
| 51 | __u8 macaddr[6]; |
| 52 | __u8 ipaddr[16]; |
| 53 | } __attribute__((packed)); |
| 54 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | struct qeth_arp_qi_entry7_short { |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 56 | struct qeth_arp_entrytype type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | __u8 macaddr[6]; |
| 58 | __u8 ipaddr[4]; |
| 59 | } __attribute__((packed)); |
| 60 | |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 61 | struct qeth_arp_qi_entry7_short_ipv6 { |
| 62 | struct qeth_arp_entrytype type; |
| 63 | __u8 macaddr[6]; |
| 64 | __u8 ipaddr[16]; |
| 65 | } __attribute__((packed)); |
| 66 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | struct qeth_arp_qi_entry5 { |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 68 | __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES]; |
| 69 | struct qeth_arp_entrytype type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | __u8 ipaddr[4]; |
| 71 | } __attribute__((packed)); |
| 72 | |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 73 | struct qeth_arp_qi_entry5_ipv6 { |
| 74 | __u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES]; |
| 75 | struct qeth_arp_entrytype type; |
| 76 | __u8 ipaddr[16]; |
| 77 | } __attribute__((packed)); |
| 78 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | struct qeth_arp_qi_entry5_short { |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 80 | struct qeth_arp_entrytype type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | __u8 ipaddr[4]; |
| 82 | } __attribute__((packed)); |
| 83 | |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 84 | struct qeth_arp_qi_entry5_short_ipv6 { |
| 85 | struct qeth_arp_entrytype type; |
| 86 | __u8 ipaddr[16]; |
| 87 | } __attribute__((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | /* |
| 89 | * can be set by user if no "media specific information" is wanted |
| 90 | * -> saves a lot of space in user space buffer |
| 91 | */ |
| 92 | #define QETH_QARP_STRIP_ENTRIES 0x8000 |
Einar Lueck | d0ddf30f | 2010-12-08 02:57:58 +0000 | [diff] [blame] | 93 | #define QETH_QARP_WITH_IPV6 0x4000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | #define QETH_QARP_REQUEST_MASK 0x00ff |
| 95 | |
| 96 | /* data sent to user space as result of query arp ioctl */ |
| 97 | #define QETH_QARP_USER_DATA_SIZE 20000 |
| 98 | #define QETH_QARP_MASK_OFFSET 4 |
| 99 | #define QETH_QARP_ENTRIES_OFFSET 6 |
| 100 | struct qeth_arp_query_user_data { |
| 101 | union { |
| 102 | __u32 data_len; /* set by user space program */ |
| 103 | __u32 no_entries; /* set by kernel */ |
| 104 | } u; |
| 105 | __u16 mask_bits; |
| 106 | char *entries; |
| 107 | } __attribute__((packed)); |
| 108 | |
Frank Blaschka | c3ab96f | 2012-02-08 00:19:49 +0000 | [diff] [blame] | 109 | struct qeth_query_oat_data { |
| 110 | __u32 command; |
| 111 | __u32 buffer_len; |
| 112 | __u32 response_len; |
| 113 | __u64 ptr; |
| 114 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | #endif /* __ASM_S390_QETH_IOCTL_H__ */ |