summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/acrn.h36
-rw-r--r--include/uapi/linux/gpib.h104
-rw-r--r--include/uapi/linux/gpib_ioctl.h167
-rw-r--r--include/uapi/linux/usb/cdc.h12
4 files changed, 300 insertions, 19 deletions
diff --git a/include/uapi/linux/acrn.h b/include/uapi/linux/acrn.h
index 7b714c1902eb..79e7855a8c42 100644
--- a/include/uapi/linux/acrn.h
+++ b/include/uapi/linux/acrn.h
@@ -418,26 +418,32 @@ struct acrn_pcidev {
};
/**
- * struct acrn_mmiodev - Info for assigning or de-assigning a MMIO device
- * @name: Name of the MMIO device.
- * @res[].user_vm_pa: Physical address of User VM of the MMIO region
- * for the MMIO device.
- * @res[].service_vm_pa: Physical address of Service VM of the MMIO
- * region for the MMIO device.
- * @res[].size: Size of the MMIO region for the MMIO device.
- * @res[].mem_type: Memory type of the MMIO region for the MMIO
- * device.
+ * struct acrn_mmio_dev_res - MMIO device resource description
+ * @user_vm_pa: Physical address of User VM of the MMIO region
+ * for the MMIO device.
+ * @service_vm_pa: Physical address of Service VM of the MMIO
+ * region for the MMIO device.
+ * @size: Size of the MMIO region for the MMIO device.
+ * @mem_type: Memory type of the MMIO region for the MMIO
+ * device.
+ */
+struct acrn_mmio_dev_res {
+ __u64 user_vm_pa;
+ __u64 service_vm_pa;
+ __u64 size;
+ __u64 mem_type;
+};
+
+/**
+ * struct acrn_mmiodev - Info for assigning or de-assigning an MMIO device
+ * @name: Name of the MMIO device.
+ * @res: Array of MMIO device descriptions
*
* This structure will be passed to hypervisor directly.
*/
struct acrn_mmiodev {
__u8 name[8];
- struct {
- __u64 user_vm_pa;
- __u64 service_vm_pa;
- __u64 size;
- __u64 mem_type;
- } res[ACRN_MMIODEV_RES_NUM];
+ struct acrn_mmio_dev_res res[ACRN_MMIODEV_RES_NUM];
};
/**
diff --git a/include/uapi/linux/gpib.h b/include/uapi/linux/gpib.h
new file mode 100644
index 000000000000..2a7f5eeb9777
--- /dev/null
+++ b/include/uapi/linux/gpib.h
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+/***************************************************************************
+ * copyright : (C) 2002 by Frank Mori Hess
+ ***************************************************************************/
+
+#ifndef _GPIB_H
+#define _GPIB_H
+
+#define GPIB_MAX_NUM_BOARDS 16
+#define GPIB_MAX_NUM_DESCRIPTORS 0x1000
+
+enum ibsta_bit_numbers {
+ DCAS_NUM = 0,
+ DTAS_NUM = 1,
+ LACS_NUM = 2,
+ TACS_NUM = 3,
+ ATN_NUM = 4,
+ CIC_NUM = 5,
+ REM_NUM = 6,
+ LOK_NUM = 7,
+ CMPL_NUM = 8,
+ EVENT_NUM = 9,
+ SPOLL_NUM = 10,
+ RQS_NUM = 11,
+ SRQI_NUM = 12,
+ END_NUM = 13,
+ TIMO_NUM = 14,
+ ERR_NUM = 15
+};
+
+/* IBSTA status bits (returned by all functions) */
+enum ibsta_bits {
+ DCAS = (1 << DCAS_NUM), /* device clear state */
+ DTAS = (1 << DTAS_NUM), /* device trigger state */
+ LACS = (1 << LACS_NUM), /* GPIB interface is addressed as Listener */
+ TACS = (1 << TACS_NUM), /* GPIB interface is addressed as Talker */
+ ATN = (1 << ATN_NUM), /* Attention is asserted */
+ CIC = (1 << CIC_NUM), /* GPIB interface is Controller-in-Charge */
+ REM = (1 << REM_NUM), /* remote state */
+ LOK = (1 << LOK_NUM), /* lockout state */
+ CMPL = (1 << CMPL_NUM), /* I/O is complete */
+ EVENT = (1 << EVENT_NUM), /* DCAS, DTAS, or IFC has occurred */
+ SPOLL = (1 << SPOLL_NUM), /* board serial polled by busmaster */
+ RQS = (1 << RQS_NUM), /* Device requesting service */
+ SRQI = (1 << SRQI_NUM), /* SRQ is asserted */
+ END = (1 << END_NUM), /* EOI or EOS encountered */
+ TIMO = (1 << TIMO_NUM), /* Time limit on I/O or wait function exceeded */
+ ERR = (1 << ERR_NUM), /* Function call terminated on error */
+
+ device_status_mask = ERR | TIMO | END | CMPL | RQS,
+ board_status_mask = ERR | TIMO | END | CMPL | SPOLL |
+ EVENT | LOK | REM | CIC | ATN | TACS | LACS | DTAS | DCAS | SRQI,
+};
+
+/* End-of-string (EOS) modes for use with ibeos */
+
+enum eos_flags {
+ EOS_MASK = 0x1c00,
+ REOS = 0x0400, /* Terminate reads on EOS */
+ XEOS = 0x800, /* assert EOI when EOS char is sent */
+ BIN = 0x1000 /* Do 8-bit compare on EOS */
+};
+
+/* GPIB Bus Control Lines bit vector */
+enum bus_control_line {
+ VALID_DAV = 0x01,
+ VALID_NDAC = 0x02,
+ VALID_NRFD = 0x04,
+ VALID_IFC = 0x08,
+ VALID_REN = 0x10,
+ VALID_SRQ = 0x20,
+ VALID_ATN = 0x40,
+ VALID_EOI = 0x80,
+ VALID_ALL = 0xff,
+ BUS_DAV = 0x0100, /* DAV line status bit */
+ BUS_NDAC = 0x0200, /* NDAC line status bit */
+ BUS_NRFD = 0x0400, /* NRFD line status bit */
+ BUS_IFC = 0x0800, /* IFC line status bit */
+ BUS_REN = 0x1000, /* REN line status bit */
+ BUS_SRQ = 0x2000, /* SRQ line status bit */
+ BUS_ATN = 0x4000, /* ATN line status bit */
+ BUS_EOI = 0x8000 /* EOI line status bit */
+};
+
+enum ppe_bits {
+ PPC_DISABLE = 0x10,
+ PPC_SENSE = 0x8, /* parallel poll sense bit */
+ PPC_DIO_MASK = 0x7
+};
+
+enum {
+ request_service_bit = 0x40,
+};
+
+enum gpib_events {
+ EVENT_NONE = 0,
+ EVENT_DEV_TRG = 1,
+ EVENT_DEV_CLR = 2,
+ EVENT_IFC = 3
+};
+
+#endif /* _GPIB_H */
+
diff --git a/include/uapi/linux/gpib_ioctl.h b/include/uapi/linux/gpib_ioctl.h
new file mode 100644
index 000000000000..d544d8e4362c
--- /dev/null
+++ b/include/uapi/linux/gpib_ioctl.h
@@ -0,0 +1,167 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+/***************************************************************************
+ * copyright : (C) 2002 by Frank Mori Hess
+ ***************************************************************************/
+
+#ifndef _GPIB_IOCTL_H
+#define _GPIB_IOCTL_H
+
+#include <asm/ioctl.h>
+#include <linux/types.h>
+
+#define GPIB_CODE 160
+
+struct gpib_board_type_ioctl {
+ char name[100];
+};
+
+/* argument for read/write/command ioctls */
+struct gpib_read_write_ioctl {
+ __u64 buffer_ptr;
+ __u32 requested_transfer_count;
+ __u32 completed_transfer_count;
+ __s32 end; /* end flag return for reads, end io suppression request for cmd*/
+ __s32 handle;
+};
+
+struct gpib_open_dev_ioctl {
+ __u32 handle;
+ __u32 pad;
+ __s32 sad;
+ __u32 is_board;
+};
+
+struct gpib_close_dev_ioctl {
+ __u32 handle;
+};
+
+struct gpib_serial_poll_ioctl {
+ __u32 pad;
+ __s32 sad;
+ __u8 status_byte;
+ __u8 padding[3]; /* align to 32 bit boundary */
+};
+
+struct gpib_eos_ioctl {
+ __s32 eos;
+ __s32 eos_flags;
+};
+
+struct gpib_wait_ioctl {
+ __s32 handle;
+ __s32 wait_mask;
+ __s32 clear_mask;
+ __s32 set_mask;
+ __s32 ibsta;
+ __s32 pad;
+ __s32 sad;
+ __u32 usec_timeout;
+};
+
+struct gpib_online_ioctl {
+ __u64 init_data_ptr;
+ __s32 init_data_length;
+ __s32 online;
+};
+
+struct gpib_spoll_bytes_ioctl {
+ __u32 num_bytes;
+ __u32 pad;
+ __s32 sad;
+};
+
+struct gpib_board_info_ioctl {
+ __u32 pad;
+ __s32 sad;
+ __s32 parallel_poll_configuration;
+ __s32 autopolling;
+ __s32 is_system_controller;
+ __u32 t1_delay;
+ unsigned ist : 1;
+ unsigned no_7_bit_eos : 1;
+ unsigned padding :30; /* align to 32 bit boundary */
+};
+
+struct gpib_select_pci_ioctl {
+ __s32 pci_bus;
+ __s32 pci_slot;
+};
+
+struct gpib_ppoll_config_ioctl {
+ __u8 config;
+ unsigned set_ist : 1;
+ unsigned clear_ist : 1;
+ unsigned padding :22; /* align to 32 bit boundary */
+};
+
+struct gpib_pad_ioctl {
+ __u32 handle;
+ __u32 pad;
+};
+
+struct gpib_sad_ioctl {
+ __u32 handle;
+ __s32 sad;
+};
+
+/* select a piece of hardware to attach by its sysfs device path */
+struct gpib_select_device_path_ioctl {
+ char device_path[0x1000];
+};
+
+/* update status byte and request service */
+struct gpib_request_service2 {
+ __u8 status_byte;
+ __u8 padding[3]; /* align to 32 bit boundary */
+ __s32 new_reason_for_service;
+};
+
+/* Standard functions. */
+enum gpib_ioctl {
+ IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl),
+ IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl),
+ IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl),
+ IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl),
+ IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl),
+ IBWAIT = _IOWR(GPIB_CODE, 5, struct gpib_wait_ioctl),
+ IBRPP = _IOWR(GPIB_CODE, 6, __u8),
+
+ IBSIC = _IOW(GPIB_CODE, 9, __u32),
+ IBSRE = _IOW(GPIB_CODE, 10, __s32),
+ IBGTS = _IO(GPIB_CODE, 11),
+ IBCAC = _IOW(GPIB_CODE, 12, __s32),
+ IBLINES = _IOR(GPIB_CODE, 14, __s16),
+ IBPAD = _IOW(GPIB_CODE, 15, struct gpib_pad_ioctl),
+ IBSAD = _IOW(GPIB_CODE, 16, struct gpib_sad_ioctl),
+ IBTMO = _IOW(GPIB_CODE, 17, __u32),
+ IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
+ IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl),
+ IBRSV = _IOW(GPIB_CODE, 20, __u8),
+ CFCBASE = _IOW(GPIB_CODE, 21, __u64),
+ CFCIRQ = _IOW(GPIB_CODE, 22, __u32),
+ CFCDMA = _IOW(GPIB_CODE, 23, __u32),
+ CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl),
+
+ IBMUTEX = _IOW(GPIB_CODE, 26, __s32),
+ IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl),
+ IBPPC = _IOW(GPIB_CODE, 28, struct gpib_ppoll_config_ioctl),
+ IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl),
+
+ IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, __s32),
+ IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl),
+ IBEVENT = _IOR(GPIB_CODE, 33, __s16),
+ IBRSC = _IOW(GPIB_CODE, 34, __s32),
+ IB_T1_DELAY = _IOW(GPIB_CODE, 35, __u32),
+ IBLOC = _IO(GPIB_CODE, 36),
+
+ IBAUTOSPOLL = _IOW(GPIB_CODE, 38, __s16),
+ IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl),
+ IBPP2_SET = _IOW(GPIB_CODE, 40, __s16),
+ IBPP2_GET = _IOR(GPIB_CODE, 41, __s16),
+ IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl),
+ /* 44 was IBSELECT_SERIAL_NUMBER */
+ IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2)
+};
+
+#endif /* _GPIB_IOCTL_H */
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h
index 1924cf665448..7bd5d12d8b26 100644
--- a/include/uapi/linux/usb/cdc.h
+++ b/include/uapi/linux/usb/cdc.h
@@ -104,8 +104,10 @@ struct usb_cdc_union_desc {
__u8 bDescriptorSubType;
__u8 bMasterInterface0;
- __u8 bSlaveInterface0;
- /* ... and there could be other slave interfaces */
+ union {
+ __u8 bSlaveInterface0;
+ __DECLARE_FLEX_ARRAY(__u8, bSlaveInterfaces);
+ };
} __attribute__ ((packed));
/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
@@ -115,8 +117,10 @@ struct usb_cdc_country_functional_desc {
__u8 bDescriptorSubType;
__u8 iCountryCodeRelDate;
- __le16 wCountyCode0;
- /* ... and there can be a lot of country codes */
+ union {
+ __le16 wCountryCode0;
+ __DECLARE_FLEX_ARRAY(__le16, wCountryCodes);
+ };
} __attribute__ ((packed));
/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */