1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright 2013 Pluribus Networks Inc. 14 * Copyright 2018 Joyent, Inc. 15 */ 16 17 #ifndef _VIONA_IO_H_ 18 #define _VIONA_IO_H_ 19 20 #define VNA_IOC (('V' << 16)|('C' << 8)) 21 #define VNA_IOC_CREATE (VNA_IOC | 0x01) 22 #define VNA_IOC_DELETE (VNA_IOC | 0x02) 23 24 #define VNA_IOC_RING_INIT (VNA_IOC | 0x10) 25 #define VNA_IOC_RING_RESET (VNA_IOC | 0x11) 26 #define VNA_IOC_RING_KICK (VNA_IOC | 0x12) 27 #define VNA_IOC_RING_SET_MSI (VNA_IOC | 0x13) 28 #define VNA_IOC_RING_INTR_CLR (VNA_IOC | 0x14) 29 30 #define VNA_IOC_INTR_POLL (VNA_IOC | 0x20) 31 #define VNA_IOC_SET_FEATURES (VNA_IOC | 0x21) 32 #define VNA_IOC_GET_FEATURES (VNA_IOC | 0x22) 33 #define VNA_IOC_SET_NOTIFY_IOP (VNA_IOC | 0x23) 34 35 typedef struct vioc_create { 36 datalink_id_t c_linkid; 37 int c_vmfd; 38 } vioc_create_t; 39 40 typedef struct vioc_ring_init { 41 uint16_t ri_index; 42 uint16_t ri_qsize; 43 uint64_t ri_qaddr; 44 } vioc_ring_init_t; 45 46 typedef struct vioc_ring_msi { 47 uint16_t rm_index; 48 uint64_t rm_addr; 49 uint64_t rm_msg; 50 } vioc_ring_msi_t; 51 52 enum viona_vq_id { 53 VIONA_VQ_RX = 0, 54 VIONA_VQ_TX = 1, 55 VIONA_VQ_MAX = 2 56 }; 57 58 typedef struct vioc_intr_poll { 59 uint32_t vip_status[VIONA_VQ_MAX]; 60 } vioc_intr_poll_t; 61 62 63 #endif /* _VIONA_IO_H_ */ 64