xref: /linux/arch/s390/include/uapi/asm/qeth.h (revision 6f52b16c5b29b89d92c0e7236f4655dc8491ad70)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
29807f759SDavid Howells /*
39807f759SDavid Howells  * ioctl definitions for qeth driver
49807f759SDavid Howells  *
59807f759SDavid Howells  * Copyright IBM Corp. 2004
69807f759SDavid Howells  *
79807f759SDavid Howells  * Author(s):	Thomas Spatzier <tspat@de.ibm.com>
89807f759SDavid Howells  *
99807f759SDavid Howells  */
109807f759SDavid Howells #ifndef __ASM_S390_QETH_IOCTL_H__
119807f759SDavid Howells #define __ASM_S390_QETH_IOCTL_H__
129807f759SDavid Howells #include <linux/types.h>
139807f759SDavid Howells #include <linux/ioctl.h>
149807f759SDavid Howells 
159807f759SDavid Howells #define SIOC_QETH_ARP_SET_NO_ENTRIES    (SIOCDEVPRIVATE)
169807f759SDavid Howells #define SIOC_QETH_ARP_QUERY_INFO        (SIOCDEVPRIVATE + 1)
179807f759SDavid Howells #define SIOC_QETH_ARP_ADD_ENTRY         (SIOCDEVPRIVATE + 2)
189807f759SDavid Howells #define SIOC_QETH_ARP_REMOVE_ENTRY      (SIOCDEVPRIVATE + 3)
199807f759SDavid Howells #define SIOC_QETH_ARP_FLUSH_CACHE       (SIOCDEVPRIVATE + 4)
209807f759SDavid Howells #define SIOC_QETH_ADP_SET_SNMP_CONTROL  (SIOCDEVPRIVATE + 5)
219807f759SDavid Howells #define SIOC_QETH_GET_CARD_TYPE         (SIOCDEVPRIVATE + 6)
229807f759SDavid Howells #define SIOC_QETH_QUERY_OAT		(SIOCDEVPRIVATE + 7)
239807f759SDavid Howells 
249807f759SDavid Howells struct qeth_arp_cache_entry {
259807f759SDavid Howells 	__u8  macaddr[6];
269807f759SDavid Howells 	__u8  reserved1[2];
279807f759SDavid Howells 	__u8  ipaddr[16]; /* for both  IPv4 and IPv6 */
289807f759SDavid Howells 	__u8  reserved2[32];
299807f759SDavid Howells } __attribute__ ((packed));
309807f759SDavid Howells 
319807f759SDavid Howells enum qeth_arp_ipaddrtype {
329807f759SDavid Howells 	QETHARP_IP_ADDR_V4 = 1,
339807f759SDavid Howells 	QETHARP_IP_ADDR_V6 = 2,
349807f759SDavid Howells };
359807f759SDavid Howells struct qeth_arp_entrytype {
369807f759SDavid Howells 	__u8 mac;
379807f759SDavid Howells 	__u8 ip;
389807f759SDavid Howells } __attribute__((packed));
399807f759SDavid Howells 
409807f759SDavid Howells #define QETH_QARP_MEDIASPECIFIC_BYTES 32
419807f759SDavid Howells #define QETH_QARP_MACADDRTYPE_BYTES 1
429807f759SDavid Howells struct qeth_arp_qi_entry7 {
439807f759SDavid Howells 	__u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
449807f759SDavid Howells 	struct qeth_arp_entrytype type;
459807f759SDavid Howells 	__u8 macaddr[6];
469807f759SDavid Howells 	__u8 ipaddr[4];
479807f759SDavid Howells } __attribute__((packed));
489807f759SDavid Howells 
499807f759SDavid Howells struct qeth_arp_qi_entry7_ipv6 {
509807f759SDavid Howells 	__u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
519807f759SDavid Howells 	struct qeth_arp_entrytype type;
529807f759SDavid Howells 	__u8 macaddr[6];
539807f759SDavid Howells 	__u8 ipaddr[16];
549807f759SDavid Howells } __attribute__((packed));
559807f759SDavid Howells 
569807f759SDavid Howells struct qeth_arp_qi_entry7_short {
579807f759SDavid Howells 	struct qeth_arp_entrytype type;
589807f759SDavid Howells 	__u8 macaddr[6];
599807f759SDavid Howells 	__u8 ipaddr[4];
609807f759SDavid Howells } __attribute__((packed));
619807f759SDavid Howells 
629807f759SDavid Howells struct qeth_arp_qi_entry7_short_ipv6 {
639807f759SDavid Howells 	struct qeth_arp_entrytype type;
649807f759SDavid Howells 	__u8 macaddr[6];
659807f759SDavid Howells 	__u8 ipaddr[16];
669807f759SDavid Howells } __attribute__((packed));
679807f759SDavid Howells 
689807f759SDavid Howells struct qeth_arp_qi_entry5 {
699807f759SDavid Howells 	__u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
709807f759SDavid Howells 	struct qeth_arp_entrytype type;
719807f759SDavid Howells 	__u8 ipaddr[4];
729807f759SDavid Howells } __attribute__((packed));
739807f759SDavid Howells 
749807f759SDavid Howells struct qeth_arp_qi_entry5_ipv6 {
759807f759SDavid Howells 	__u8 media_specific[QETH_QARP_MEDIASPECIFIC_BYTES];
769807f759SDavid Howells 	struct qeth_arp_entrytype type;
779807f759SDavid Howells 	__u8 ipaddr[16];
789807f759SDavid Howells } __attribute__((packed));
799807f759SDavid Howells 
809807f759SDavid Howells struct qeth_arp_qi_entry5_short {
819807f759SDavid Howells 	struct qeth_arp_entrytype type;
829807f759SDavid Howells 	__u8 ipaddr[4];
839807f759SDavid Howells } __attribute__((packed));
849807f759SDavid Howells 
859807f759SDavid Howells struct qeth_arp_qi_entry5_short_ipv6 {
869807f759SDavid Howells 	struct qeth_arp_entrytype type;
879807f759SDavid Howells 	__u8 ipaddr[16];
889807f759SDavid Howells } __attribute__((packed));
899807f759SDavid Howells /*
909807f759SDavid Howells  * can be set by user if no "media specific information" is wanted
919807f759SDavid Howells  * -> saves a lot of space in user space buffer
929807f759SDavid Howells  */
939807f759SDavid Howells #define QETH_QARP_STRIP_ENTRIES  0x8000
949807f759SDavid Howells #define QETH_QARP_WITH_IPV6	 0x4000
959807f759SDavid Howells #define QETH_QARP_REQUEST_MASK   0x00ff
969807f759SDavid Howells 
979807f759SDavid Howells /* data sent to user space as result of query arp ioctl */
989807f759SDavid Howells #define QETH_QARP_USER_DATA_SIZE 20000
999807f759SDavid Howells #define QETH_QARP_MASK_OFFSET    4
1009807f759SDavid Howells #define QETH_QARP_ENTRIES_OFFSET 6
1019807f759SDavid Howells struct qeth_arp_query_user_data {
1029807f759SDavid Howells 	union {
1039807f759SDavid Howells 		__u32 data_len;		/* set by user space program */
1049807f759SDavid Howells 		__u32 no_entries;	/* set by kernel */
1059807f759SDavid Howells 	} u;
1069807f759SDavid Howells 	__u16 mask_bits;
1079807f759SDavid Howells 	char *entries;
1089807f759SDavid Howells } __attribute__((packed));
1099807f759SDavid Howells 
1109807f759SDavid Howells struct qeth_query_oat_data {
1119807f759SDavid Howells 	__u32 command;
1129807f759SDavid Howells 	__u32 buffer_len;
1139807f759SDavid Howells 	__u32 response_len;
1149807f759SDavid Howells 	__u64 ptr;
1159807f759SDavid Howells };
1169807f759SDavid Howells #endif /* __ASM_S390_QETH_IOCTL_H__ */
117