xref: /illumos-gate/usr/src/uts/common/sys/usb/hubd/hubd_impl.h (revision 46b592853d0f4f11781b6b0a7533f267c6aee132)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_USB_HUBD_IMPL_H
27 #define	_SYS_USB_HUBD_IMPL_H
28 
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 
35 /*
36  * This file contains info for devctls issued by USB cfgadm plugin.
37  * The only devctl of interest is DEVCTL_AP_CONTROL which uses
38  * these defines and data structures.
39  */
40 
41 /*
42  * The following are sub-commands to DEVCTL_AP_CONTROL.
43  * Only exception in this list are sub-commands USB_DESCR_TYPE_DEVICE
44  * and USB_DESCR_TYPE_STRING. Since these are defined in sys/usb/usbai.h
45  * we are not re-defining them here.
46  */
47 #define	HUBD_GET_CFGADM_NAME		0x10	/* get driver's name */
48 #define	HUBD_GET_CURRENT_CONFIG		0x20	/* get current config index */
49 #define	HUBD_GET_DEVICE_PATH		0x40	/* get /devices path */
50 #define	HUBD_REFRESH_DEVDB		0x80	/* refresh USB device DB */
51 
52 /*
53  * With USB_DESCR_TYPE_STRING sub-command, these are the various
54  * string sub-options.
55  */
56 #define	HUBD_MFG_STR		1		/* get manufacturer string */
57 #define	HUBD_PRODUCT_STR	2		/* get product-id string */
58 #define	HUBD_SERIALNO_STR	3		/* get serial-no-id string */
59 #define	HUBD_CFG_DESCR_STR	4		/* get config descr string */
60 
61 
62 typedef struct hubd_ioctl_data {
63 	uint_t		cmd;			/* one of the above commands */
64 	uint_t		port;			/* port of (root)hub */
65 	uint_t		get_size;		/* get size/data flag */
66 	caddr_t		buf;			/* data buffer */
67 	uint_t		bufsiz;			/* data buffer size */
68 	uint_t		misc_arg;		/* reserved */
69 } hubd_ioctl_data_t;
70 
71 /* For 32-bit app/64-bit kernel */
72 typedef struct hubd_ioctl_data_32 {
73 	uint32_t	cmd;			/* one of the above commands */
74 	uint32_t	port;			/* port of (root)hub */
75 	uint32_t	get_size;		/* get size/data flag */
76 	caddr32_t	buf;			/* data buffer */
77 	uint32_t	bufsiz;			/* data buffer size */
78 	uint32_t	misc_arg;		/* reserved */
79 } hubd_ioctl_data_32_t;
80 
81 #ifdef	__cplusplus
82 }
83 #endif
84 
85 #endif	/* _SYS_USB_HUBD_IMPL_H */
86