xref: /onnv-gate/usr/src/uts/common/sys/usb/hubd/hubd_impl.h (revision 7492:2387323b838f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7492SZhigang.Lu@Sun.COM  * Common Development and Distribution License (the "License").
6*7492SZhigang.Lu@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*7492SZhigang.Lu@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7492SZhigang.Lu@Sun.COM  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_USB_HUBD_IMPL_H
270Sstevel@tonic-gate #define	_SYS_USB_HUBD_IMPL_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef	__cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate 
350Sstevel@tonic-gate /*
360Sstevel@tonic-gate  * This file contains info for devctls issued by USB cfgadm plugin.
370Sstevel@tonic-gate  * The only devctl of interest is DEVCTL_AP_CONTROL which uses
380Sstevel@tonic-gate  * these defines and data structures.
390Sstevel@tonic-gate  */
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /*
420Sstevel@tonic-gate  * The following are sub-commands to DEVCTL_AP_CONTROL.
430Sstevel@tonic-gate  * Only exception in this list are sub-commands USB_DESCR_TYPE_DEVICE
440Sstevel@tonic-gate  * and USB_DESCR_TYPE_STRING. Since these are defined in sys/usb/usbai.h
450Sstevel@tonic-gate  * we are not re-defining them here.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate #define	HUBD_GET_CFGADM_NAME		0x10	/* get driver's name */
480Sstevel@tonic-gate #define	HUBD_GET_CURRENT_CONFIG		0x20	/* get current config index */
490Sstevel@tonic-gate #define	HUBD_GET_DEVICE_PATH		0x40	/* get /devices path */
500Sstevel@tonic-gate #define	HUBD_REFRESH_DEVDB		0x80	/* refresh USB device DB */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /*
530Sstevel@tonic-gate  * With USB_DESCR_TYPE_STRING sub-command, these are the various
540Sstevel@tonic-gate  * string sub-options.
550Sstevel@tonic-gate  */
560Sstevel@tonic-gate #define	HUBD_MFG_STR		1		/* get manufacturer string */
570Sstevel@tonic-gate #define	HUBD_PRODUCT_STR	2		/* get product-id string */
580Sstevel@tonic-gate #define	HUBD_SERIALNO_STR	3		/* get serial-no-id string */
590Sstevel@tonic-gate #define	HUBD_CFG_DESCR_STR	4		/* get config descr string */
600Sstevel@tonic-gate 
610Sstevel@tonic-gate 
620Sstevel@tonic-gate typedef struct hubd_ioctl_data {
630Sstevel@tonic-gate 	uint_t		cmd;			/* one of the above commands */
640Sstevel@tonic-gate 	uint_t		port;			/* port of (root)hub */
650Sstevel@tonic-gate 	uint_t		get_size;		/* get size/data flag */
660Sstevel@tonic-gate 	caddr_t		buf;			/* data buffer */
670Sstevel@tonic-gate 	uint_t		bufsiz;			/* data buffer size */
680Sstevel@tonic-gate 	uint_t		misc_arg;		/* reserved */
690Sstevel@tonic-gate } hubd_ioctl_data_t;
700Sstevel@tonic-gate 
710Sstevel@tonic-gate /* For 32-bit app/64-bit kernel */
720Sstevel@tonic-gate typedef struct hubd_ioctl_data_32 {
730Sstevel@tonic-gate 	uint32_t	cmd;			/* one of the above commands */
740Sstevel@tonic-gate 	uint32_t	port;			/* port of (root)hub */
750Sstevel@tonic-gate 	uint32_t	get_size;		/* get size/data flag */
760Sstevel@tonic-gate 	caddr32_t	buf;			/* data buffer */
770Sstevel@tonic-gate 	uint32_t	bufsiz;			/* data buffer size */
780Sstevel@tonic-gate 	uint32_t	misc_arg;		/* reserved */
790Sstevel@tonic-gate } hubd_ioctl_data_32_t;
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #ifdef	__cplusplus
820Sstevel@tonic-gate }
830Sstevel@tonic-gate #endif
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #endif	/* _SYS_USB_HUBD_IMPL_H */
86