usba_ugen.h revision 7492:2387323b838f
175584Sru/*
275584Sru * CDDL HEADER START
375584Sru *
475584Sru * The contents of this file are subject to the terms of the
5114402Sru * Common Development and Distribution License (the "License").
675584Sru * You may not use this file except in compliance with the License.
775584Sru *
875584Sru * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
975584Sru * or http://www.opensolaris.org/os/licensing.
1075584Sru * See the License for the specific language governing permissions
1175584Sru * and limitations under the License.
1275584Sru *
1375584Sru * When distributing Covered Code, include this CDDL HEADER in each
1475584Sru * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1575584Sru * If applicable, add the following below this CDDL HEADER, with the
16104862Sru * fields enclosed by brackets "[]" replaced with your own identifying
17104862Sru * information: Portions Copyright [yyyy] [name of copyright owner]
18114402Sru *
19114402Sru * CDDL HEADER END
20114402Sru *
21114402Sru * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
22114402Sru * Use is subject to license terms.
23114402Sru */
24114402Sru
25114402Sru#ifndef _SYS_USBA_UGEN_H
26114402Sru#define	_SYS_USBA_UGEN_H
27114402Sru
28114402Sru
29114402Sru/*
30114402Sru * UGEN - USB Generic Driver code exported for sharing by USBA
31114402Sru */
32114402Sru#include <sys/usb/usba/usbai_private.h>
33114402Sru
34114402Sru#ifdef	__cplusplus
35114402Sruextern "C" {
36114402Sru#endif
37114402Sru
38114402Srutypedef struct usb_ugen_info {
39114402Sru	uint_t		usb_ugen_flags;
40114402Sru	dev_t		usb_ugen_minor_node_ugen_bits_mask;
41114402Sru	dev_t		usb_ugen_minor_node_instance_mask;
42114402Sru} usb_ugen_info_t;
43114402Sru
44114402Srutypedef struct usb_ugen_hdl *usb_ugen_hdl_t;
45114402Sru
46114402Sru#define	USB_UGEN_ENABLE_PM		0x0001
47114402Sru#define	USB_UGEN_REMOVE_CHILDREN	0x0002
48114402Sru
49114402Sruusb_ugen_hdl_t usb_ugen_get_hdl(dev_info_t *, usb_ugen_info_t *);
50114402Sruvoid	usb_ugen_release_hdl(usb_ugen_hdl_t);
51114402Sruint	usb_ugen_attach(usb_ugen_hdl_t, ddi_attach_cmd_t);
52114402Sruint	usb_ugen_detach(usb_ugen_hdl_t, ddi_detach_cmd_t);
53114402Sruint	usb_ugen_open(usb_ugen_hdl_t, dev_t *, int, int, cred_t *);
54114402Sruint	usb_ugen_close(usb_ugen_hdl_t, dev_t, int, int, cred_t *);
55114402Sruint	usb_ugen_power(usb_ugen_hdl_t, int, int);
56114402Sruint	usb_ugen_read(usb_ugen_hdl_t, dev_t, struct uio *, cred_t *);
57114402Sruint	usb_ugen_write(usb_ugen_hdl_t, dev_t, struct uio *, cred_t *);
58114402Sruint	usb_ugen_poll(usb_ugen_hdl_t, dev_t, short, int,
59114402Sru					short *, struct pollhead **);
60151497Sru
61151497Sruint	usb_ugen_disconnect_ev_cb(usb_ugen_hdl_t);
62151497Sruint	usb_ugen_reconnect_ev_cb(usb_ugen_hdl_t);
63151497Sru
64151497Sru#ifdef	__cplusplus
65151497Sru}
66151497Sru#endif
67151497Sru
68151497Sru#endif	/* _SYS_USBA_UGEN_H */
69151497Sru