1*993e3fafSRobert Mustacchi /*
2*993e3fafSRobert Mustacchi  * This file and its contents are supplied under the terms of the
3*993e3fafSRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
4*993e3fafSRobert Mustacchi  * You may only use this file in accordance with the terms of version
5*993e3fafSRobert Mustacchi  * 1.0 of the CDDL.
6*993e3fafSRobert Mustacchi  *
7*993e3fafSRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
8*993e3fafSRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
9*993e3fafSRobert Mustacchi  * http://www.illumos.org/license/CDDL.
10*993e3fafSRobert Mustacchi  */
11*993e3fafSRobert Mustacchi 
12*993e3fafSRobert Mustacchi /*
13*993e3fafSRobert Mustacchi  * Copyright 2016 Joyent, Inc.
14*993e3fafSRobert Mustacchi  */
15*993e3fafSRobert Mustacchi 
16*993e3fafSRobert Mustacchi #ifndef _SYS_USB_XHCI_XHCI_IOCTL_H
17*993e3fafSRobert Mustacchi #define	_SYS_USB_XHCI_XHCI_IOCTL_H
18*993e3fafSRobert Mustacchi 
19*993e3fafSRobert Mustacchi /*
20*993e3fafSRobert Mustacchi  * Private ioctls for the xhci driver.
21*993e3fafSRobert Mustacchi  */
22*993e3fafSRobert Mustacchi 
23*993e3fafSRobert Mustacchi #include <sys/types.h>
24*993e3fafSRobert Mustacchi 
25*993e3fafSRobert Mustacchi #ifdef __cplusplus
26*993e3fafSRobert Mustacchi extern "C" {
27*993e3fafSRobert Mustacchi #endif
28*993e3fafSRobert Mustacchi 
29*993e3fafSRobert Mustacchi #define	XHCI_IOCTL	(('x' << 24) | ('h' << 16 | ('i' << 8)))
30*993e3fafSRobert Mustacchi 
31*993e3fafSRobert Mustacchi #define	XHCI_PORTSC_NPORTS	256
32*993e3fafSRobert Mustacchi #define	XHCI_IOCTL_PORTSC	(XHCI_IOCTL | 0x01)
33*993e3fafSRobert Mustacchi #define	XHCI_IOCTL_SETPLS	(XHCI_IOCTL | 0x02)
34*993e3fafSRobert Mustacchi #define	XHCI_IOCTL_CLEAR	(XHCI_IOCTL | 0x03)
35*993e3fafSRobert Mustacchi 
36*993e3fafSRobert Mustacchi typedef struct xhci_ioctl_portsc {
37*993e3fafSRobert Mustacchi 	uint32_t 	xhi_nports;
38*993e3fafSRobert Mustacchi 	uint32_t	xhi_pad;
39*993e3fafSRobert Mustacchi 	uint32_t	xhi_portsc[XHCI_PORTSC_NPORTS];
40*993e3fafSRobert Mustacchi } xhci_ioctl_portsc_t;
41*993e3fafSRobert Mustacchi 
42*993e3fafSRobert Mustacchi typedef struct xhci_ioctl_setpls {
43*993e3fafSRobert Mustacchi 	uint32_t	xis_port;
44*993e3fafSRobert Mustacchi 	uint32_t	xis_pls;
45*993e3fafSRobert Mustacchi } xhci_ioctl_setpls_t;
46*993e3fafSRobert Mustacchi 
47*993e3fafSRobert Mustacchi typedef struct xhci_ioctl_clear {
48*993e3fafSRobert Mustacchi 	uint32_t	xic_port;
49*993e3fafSRobert Mustacchi 	uint32_t 	xic_pad;
50*993e3fafSRobert Mustacchi } xhci_ioctl_clear_t;
51*993e3fafSRobert Mustacchi 
52*993e3fafSRobert Mustacchi #ifdef __cplusplus
53*993e3fafSRobert Mustacchi }
54*993e3fafSRobert Mustacchi #endif
55*993e3fafSRobert Mustacchi 
56*993e3fafSRobert Mustacchi #endif /* _SYS_USB_XHCI_XHCI_IOCTL_H */