xref: /onnv-gate/usr/src/uts/common/sys/usb/usba/usba_ugen.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  *
21*7492SZhigang.Lu@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
220Sstevel@tonic-gate  * Use is subject to license terms.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef _SYS_USBA_UGEN_H
260Sstevel@tonic-gate #define	_SYS_USBA_UGEN_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * UGEN - USB Generic Driver code exported for sharing by USBA
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate #include <sys/usb/usba/usbai_private.h>
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifdef	__cplusplus
350Sstevel@tonic-gate extern "C" {
360Sstevel@tonic-gate #endif
370Sstevel@tonic-gate 
380Sstevel@tonic-gate typedef struct usb_ugen_info {
390Sstevel@tonic-gate 	uint_t		usb_ugen_flags;
400Sstevel@tonic-gate 	dev_t		usb_ugen_minor_node_ugen_bits_mask;
410Sstevel@tonic-gate 	dev_t		usb_ugen_minor_node_instance_mask;
420Sstevel@tonic-gate } usb_ugen_info_t;
430Sstevel@tonic-gate 
440Sstevel@tonic-gate typedef struct usb_ugen_hdl *usb_ugen_hdl_t;
450Sstevel@tonic-gate 
460Sstevel@tonic-gate #define	USB_UGEN_ENABLE_PM		0x0001
470Sstevel@tonic-gate #define	USB_UGEN_REMOVE_CHILDREN	0x0002
480Sstevel@tonic-gate 
490Sstevel@tonic-gate usb_ugen_hdl_t usb_ugen_get_hdl(dev_info_t *, usb_ugen_info_t *);
500Sstevel@tonic-gate void	usb_ugen_release_hdl(usb_ugen_hdl_t);
510Sstevel@tonic-gate int	usb_ugen_attach(usb_ugen_hdl_t, ddi_attach_cmd_t);
520Sstevel@tonic-gate int	usb_ugen_detach(usb_ugen_hdl_t, ddi_detach_cmd_t);
530Sstevel@tonic-gate int	usb_ugen_open(usb_ugen_hdl_t, dev_t *, int, int, cred_t *);
540Sstevel@tonic-gate int	usb_ugen_close(usb_ugen_hdl_t, dev_t, int, int, cred_t *);
550Sstevel@tonic-gate int	usb_ugen_power(usb_ugen_hdl_t, int, int);
560Sstevel@tonic-gate int	usb_ugen_read(usb_ugen_hdl_t, dev_t, struct uio *, cred_t *);
570Sstevel@tonic-gate int	usb_ugen_write(usb_ugen_hdl_t, dev_t, struct uio *, cred_t *);
580Sstevel@tonic-gate int	usb_ugen_poll(usb_ugen_hdl_t, dev_t, short, int,
590Sstevel@tonic-gate 					short *, struct pollhead **);
600Sstevel@tonic-gate 
610Sstevel@tonic-gate int	usb_ugen_disconnect_ev_cb(usb_ugen_hdl_t);
620Sstevel@tonic-gate int	usb_ugen_reconnect_ev_cb(usb_ugen_hdl_t);
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #ifdef	__cplusplus
650Sstevel@tonic-gate }
660Sstevel@tonic-gate #endif
670Sstevel@tonic-gate 
680Sstevel@tonic-gate #endif	/* _SYS_USBA_UGEN_H */
69