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