xref: /titanic_41/usr/src/uts/common/io/usb/usba10/usba10.c (revision e8ed0869d5c65afe0c37c4755bf81f7381d1f43c)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
577e51571Sgongtian zhao - Sun Microsystems - Beijing China  * Common Development and Distribution License (the "License").
677e51571Sgongtian zhao - Sun Microsystems - Beijing China  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
2277e51571Sgongtian zhao - Sun Microsystems - Beijing China  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * Dummy module to load usba module on behalf of legacy drivers.
297c478bd9Sstevel@tonic-gate  *
307c478bd9Sstevel@tonic-gate  * Please see the on81-patch gate usr/src/uts/common/sys/usba10/usba10_usbai.h
317c478bd9Sstevel@tonic-gate  * header file for descriptions and comments for these functions.
327c478bd9Sstevel@tonic-gate  */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #include <sys/usb/usba.h>
357c478bd9Sstevel@tonic-gate #include <sys/usb/usba/usbai_private.h>
367c478bd9Sstevel@tonic-gate #include <sys/usb/usba/usba10.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * modload support
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
42*e8ed0869SJohn Beck static struct modlmisc modlmisc	= {
437c478bd9Sstevel@tonic-gate 	&mod_miscops,	/* Type	of module */
4477e51571Sgongtian zhao - Sun Microsystems - Beijing China 	"USBA10: USB V0.8 Drvr Supp"
457c478bd9Sstevel@tonic-gate };
467c478bd9Sstevel@tonic-gate 
47*e8ed0869SJohn Beck static struct modlinkage modlinkage = {
487c478bd9Sstevel@tonic-gate 	MODREV_1, (void	*)&modlmisc, NULL
497c478bd9Sstevel@tonic-gate };
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate int
_init(void)537c478bd9Sstevel@tonic-gate _init(void)
547c478bd9Sstevel@tonic-gate {
557c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
567c478bd9Sstevel@tonic-gate }
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate int
_fini()597c478bd9Sstevel@tonic-gate _fini()
607c478bd9Sstevel@tonic-gate {
617c478bd9Sstevel@tonic-gate 	return (mod_remove(&modlinkage));
627c478bd9Sstevel@tonic-gate }
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate int
_info(struct modinfo * modinfop)657c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
667c478bd9Sstevel@tonic-gate {
677c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
687c478bd9Sstevel@tonic-gate }
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * Turn off lint checking of this module because it will find duplicate names
727c478bd9Sstevel@tonic-gate  * defined here and in the usbai.c source for the usba module.
737c478bd9Sstevel@tonic-gate  */
747c478bd9Sstevel@tonic-gate #ifndef __lint
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate int
usb_register_client(dev_info_t * dip,uint_t version,usb_client_dev_data_t ** dev_data,usb_reg_parse_lvl_t parse_level,usb_flags_t flags)777c478bd9Sstevel@tonic-gate usb_register_client(
787c478bd9Sstevel@tonic-gate 	dev_info_t			*dip,
797c478bd9Sstevel@tonic-gate 	uint_t				version,
807c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t		**dev_data,
817c478bd9Sstevel@tonic-gate 	usb_reg_parse_lvl_t		parse_level,
827c478bd9Sstevel@tonic-gate 	usb_flags_t			flags)
837c478bd9Sstevel@tonic-gate {
847c478bd9Sstevel@tonic-gate 	return (usba10_usb_register_client(
857c478bd9Sstevel@tonic-gate 	    dip, version, dev_data, parse_level, flags));
867c478bd9Sstevel@tonic-gate }
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate void
usb_unregister_client(dev_info_t * dip,usb_client_dev_data_t * dev_data)907c478bd9Sstevel@tonic-gate usb_unregister_client(
917c478bd9Sstevel@tonic-gate 	dev_info_t			*dip,
927c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t		*dev_data)
937c478bd9Sstevel@tonic-gate {
947c478bd9Sstevel@tonic-gate 	usba10_usb_unregister_client(dip, dev_data);
957c478bd9Sstevel@tonic-gate }
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate void
usb_free_descr_tree(dev_info_t * dip,usb_client_dev_data_t * dev_data)997c478bd9Sstevel@tonic-gate usb_free_descr_tree(
1007c478bd9Sstevel@tonic-gate 	dev_info_t			*dip,
1017c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t		*dev_data)
1027c478bd9Sstevel@tonic-gate {
1037c478bd9Sstevel@tonic-gate 	usba10_usb_free_descr_tree(dip, dev_data);
1047c478bd9Sstevel@tonic-gate }
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate size_t
usb_parse_data(char * format,uchar_t * data,size_t datalen,void * structure,size_t structlen)1087c478bd9Sstevel@tonic-gate usb_parse_data(
1097c478bd9Sstevel@tonic-gate 	char			*format,
1107c478bd9Sstevel@tonic-gate 	uchar_t 		*data,
1117c478bd9Sstevel@tonic-gate 	size_t			datalen,
1127c478bd9Sstevel@tonic-gate 	void			*structure,
1137c478bd9Sstevel@tonic-gate 	size_t			structlen)
1147c478bd9Sstevel@tonic-gate {
1157c478bd9Sstevel@tonic-gate 	return (usba10_usb_parse_data(
1167c478bd9Sstevel@tonic-gate 	    format, data, datalen, structure, structlen));
1177c478bd9Sstevel@tonic-gate }
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate usb_ep_data_t *
usb_get_ep_data(dev_info_t * dip,usb_client_dev_data_t * dev_datap,uint_t interface,uint_t alternate,uint_t type,uint_t direction)1217c478bd9Sstevel@tonic-gate usb_get_ep_data(
1227c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
1237c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t	*dev_datap,
1247c478bd9Sstevel@tonic-gate 	uint_t			interface,
1257c478bd9Sstevel@tonic-gate 	uint_t			alternate,
1267c478bd9Sstevel@tonic-gate 	uint_t			type,
1277c478bd9Sstevel@tonic-gate 	uint_t			direction)
1287c478bd9Sstevel@tonic-gate {
1297c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_ep_data(
1307c478bd9Sstevel@tonic-gate 	    dip, dev_datap, interface, alternate, type, direction));
1317c478bd9Sstevel@tonic-gate }
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate int
usb_get_string_descr(dev_info_t * dip,uint16_t langid,uint8_t index,char * buf,size_t buflen)1357c478bd9Sstevel@tonic-gate usb_get_string_descr(
1367c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
1377c478bd9Sstevel@tonic-gate 	uint16_t		langid,
1387c478bd9Sstevel@tonic-gate 	uint8_t			index,
1397c478bd9Sstevel@tonic-gate 	char			*buf,
1407c478bd9Sstevel@tonic-gate 	size_t			buflen)
1417c478bd9Sstevel@tonic-gate {
1427c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_string_descr(dip, langid, index, buf, buflen));
1437c478bd9Sstevel@tonic-gate }
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate int
usb_get_addr(dev_info_t * dip)1477c478bd9Sstevel@tonic-gate usb_get_addr(dev_info_t *dip)
1487c478bd9Sstevel@tonic-gate {
1497c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_addr(dip));
1507c478bd9Sstevel@tonic-gate }
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate int
usb_get_if_number(dev_info_t * dip)1547c478bd9Sstevel@tonic-gate usb_get_if_number(dev_info_t *dip)
1557c478bd9Sstevel@tonic-gate {
1567c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_if_number(dip));
1577c478bd9Sstevel@tonic-gate }
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate boolean_t
usb_owns_device(dev_info_t * dip)1617c478bd9Sstevel@tonic-gate usb_owns_device(dev_info_t *dip)
1627c478bd9Sstevel@tonic-gate {
1637c478bd9Sstevel@tonic-gate 	return (usba10_usb_owns_device(dip));
1647c478bd9Sstevel@tonic-gate }
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate int
usb_pipe_get_state(usb_pipe_handle_t pipe_handle,usb_pipe_state_t * pipe_state,usb_flags_t flags)1687c478bd9Sstevel@tonic-gate usb_pipe_get_state(
1697c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
1707c478bd9Sstevel@tonic-gate 	usb_pipe_state_t	*pipe_state,
1717c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
1727c478bd9Sstevel@tonic-gate {
1737c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_get_state(pipe_handle, pipe_state, flags));
1747c478bd9Sstevel@tonic-gate }
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate int
usb_ep_num(usb_pipe_handle_t ph)1787c478bd9Sstevel@tonic-gate usb_ep_num(usb_pipe_handle_t ph)
1797c478bd9Sstevel@tonic-gate {
1807c478bd9Sstevel@tonic-gate 	return (usba10_usb_ep_num(ph));
1817c478bd9Sstevel@tonic-gate }
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate int
usb_pipe_open(dev_info_t * dip,usb_ep_descr_t * ep,usb_pipe_policy_t * pipe_policy,usb_flags_t flags,usb_pipe_handle_t * pipe_handle)1857c478bd9Sstevel@tonic-gate usb_pipe_open(
1867c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
1877c478bd9Sstevel@tonic-gate 	usb_ep_descr_t		*ep,
1887c478bd9Sstevel@tonic-gate 	usb_pipe_policy_t	*pipe_policy,
1897c478bd9Sstevel@tonic-gate 	usb_flags_t		flags,
1907c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	*pipe_handle)
1917c478bd9Sstevel@tonic-gate {
1927c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_open(dip, ep, pipe_policy, flags, pipe_handle));
1937c478bd9Sstevel@tonic-gate }
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate void
usb_pipe_close(dev_info_t * dip,usb_pipe_handle_t pipe_handle,usb_flags_t flags,void (* cb)(usb_pipe_handle_t ph,usb_opaque_t arg,int rval,usb_cb_flags_t flags),usb_opaque_t cb_arg)1977c478bd9Sstevel@tonic-gate usb_pipe_close(
1987c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
1997c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
2007c478bd9Sstevel@tonic-gate 	usb_flags_t		flags,
2017c478bd9Sstevel@tonic-gate 	void			(*cb)(
2027c478bd9Sstevel@tonic-gate 				    usb_pipe_handle_t	ph,
2037c478bd9Sstevel@tonic-gate 				    usb_opaque_t	arg,	/* cb arg */
2047c478bd9Sstevel@tonic-gate 				    int			rval,
2057c478bd9Sstevel@tonic-gate 				    usb_cb_flags_t	flags),
2067c478bd9Sstevel@tonic-gate 	usb_opaque_t		cb_arg)
2077c478bd9Sstevel@tonic-gate {
2087c478bd9Sstevel@tonic-gate 	usba10_usb_pipe_close(dip, pipe_handle, flags, cb, cb_arg);
2097c478bd9Sstevel@tonic-gate }
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate int
usb_pipe_drain_reqs(dev_info_t * dip,usb_pipe_handle_t pipe_handle,uint_t time,usb_flags_t flags,void (* cb)(usb_pipe_handle_t ph,usb_opaque_t arg,int rval,usb_cb_flags_t flags),usb_opaque_t cb_arg)2137c478bd9Sstevel@tonic-gate usb_pipe_drain_reqs(
2147c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
2157c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
2167c478bd9Sstevel@tonic-gate 	uint_t			time,
2177c478bd9Sstevel@tonic-gate 	usb_flags_t		flags,
2187c478bd9Sstevel@tonic-gate 	void			(*cb)(
2197c478bd9Sstevel@tonic-gate 				    usb_pipe_handle_t	ph,
2207c478bd9Sstevel@tonic-gate 				    usb_opaque_t	arg,	/* cb arg */
2217c478bd9Sstevel@tonic-gate 				    int			rval,
2227c478bd9Sstevel@tonic-gate 				    usb_cb_flags_t	flags),
2237c478bd9Sstevel@tonic-gate 	usb_opaque_t		cb_arg)
2247c478bd9Sstevel@tonic-gate {
2257c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_drain_reqs(
2267c478bd9Sstevel@tonic-gate 	    dip, pipe_handle, time, flags, cb, cb_arg));
2277c478bd9Sstevel@tonic-gate }
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate 
2307c478bd9Sstevel@tonic-gate int
usb_pipe_set_private(usb_pipe_handle_t pipe_handle,usb_opaque_t data)2317c478bd9Sstevel@tonic-gate usb_pipe_set_private(
2327c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
2337c478bd9Sstevel@tonic-gate 	usb_opaque_t		data)
2347c478bd9Sstevel@tonic-gate {
2357c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_set_private(pipe_handle, data));
2367c478bd9Sstevel@tonic-gate }
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate usb_opaque_t
usb_pipe_get_private(usb_pipe_handle_t pipe_handle)2407c478bd9Sstevel@tonic-gate usb_pipe_get_private(usb_pipe_handle_t pipe_handle)
2417c478bd9Sstevel@tonic-gate {
2427c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_get_private(pipe_handle));
2437c478bd9Sstevel@tonic-gate }
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate void
usb_pipe_reset(dev_info_t * dip,usb_pipe_handle_t pipe_handle,usb_flags_t usb_flags,void (* cb)(usb_pipe_handle_t ph,usb_opaque_t arg,int rval,usb_cb_flags_t flags),usb_opaque_t cb_arg)2477c478bd9Sstevel@tonic-gate usb_pipe_reset(
2487c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
2497c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
2507c478bd9Sstevel@tonic-gate 	usb_flags_t		usb_flags,
2517c478bd9Sstevel@tonic-gate 	void			(*cb)(
2527c478bd9Sstevel@tonic-gate 					usb_pipe_handle_t ph,
2537c478bd9Sstevel@tonic-gate 					usb_opaque_t	arg,
2547c478bd9Sstevel@tonic-gate 					int		rval,
2557c478bd9Sstevel@tonic-gate 					usb_cb_flags_t	flags),
2567c478bd9Sstevel@tonic-gate 	usb_opaque_t		cb_arg)
2577c478bd9Sstevel@tonic-gate {
2587c478bd9Sstevel@tonic-gate 	usba10_usb_pipe_reset(dip, pipe_handle, usb_flags, cb, cb_arg);
2597c478bd9Sstevel@tonic-gate }
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate usb_ctrl_req_t *
usb_alloc_ctrl_req(dev_info_t * dip,size_t len,usb_flags_t flags)2637c478bd9Sstevel@tonic-gate usb_alloc_ctrl_req(
2647c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
2657c478bd9Sstevel@tonic-gate 	size_t			len,
2667c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
2677c478bd9Sstevel@tonic-gate {
2687c478bd9Sstevel@tonic-gate 	return (usba10_usb_alloc_ctrl_req(dip, len, flags));
2697c478bd9Sstevel@tonic-gate }
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate void
usb_free_ctrl_req(usb_ctrl_req_t * reqp)2737c478bd9Sstevel@tonic-gate usb_free_ctrl_req(usb_ctrl_req_t *reqp)
2747c478bd9Sstevel@tonic-gate {
2757c478bd9Sstevel@tonic-gate 	usba10_usb_free_ctrl_req(reqp);
2767c478bd9Sstevel@tonic-gate }
2777c478bd9Sstevel@tonic-gate 
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate int
usb_pipe_ctrl_xfer(usb_pipe_handle_t pipe_handle,usb_ctrl_req_t * reqp,usb_flags_t flags)2807c478bd9Sstevel@tonic-gate usb_pipe_ctrl_xfer(
2817c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
2827c478bd9Sstevel@tonic-gate 	usb_ctrl_req_t		*reqp,
2837c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
2847c478bd9Sstevel@tonic-gate {
2857c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_ctrl_xfer(pipe_handle, reqp, flags));
2867c478bd9Sstevel@tonic-gate }
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate 
2897c478bd9Sstevel@tonic-gate int
usb_get_status(dev_info_t * dip,usb_pipe_handle_t ph,uint_t type,uint_t what,uint16_t * status,usb_flags_t flags)2907c478bd9Sstevel@tonic-gate usb_get_status(
2917c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
2927c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	ph,
2937c478bd9Sstevel@tonic-gate 	uint_t			type,	/* bmRequestType */
2947c478bd9Sstevel@tonic-gate 	uint_t			what,	/* 0, interface, endpoint number */
2957c478bd9Sstevel@tonic-gate 	uint16_t		*status,
2967c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
2977c478bd9Sstevel@tonic-gate {
2987c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_status(dip, ph, type, what, status, flags));
2997c478bd9Sstevel@tonic-gate }
3007c478bd9Sstevel@tonic-gate 
3017c478bd9Sstevel@tonic-gate 
3027c478bd9Sstevel@tonic-gate int
usb_clear_feature(dev_info_t * dip,usb_pipe_handle_t ph,uint_t type,uint_t feature,uint_t what,usb_flags_t flags)3037c478bd9Sstevel@tonic-gate usb_clear_feature(
3047c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3057c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	ph,
3067c478bd9Sstevel@tonic-gate 	uint_t			type,	/* bmRequestType */
3077c478bd9Sstevel@tonic-gate 	uint_t			feature,
3087c478bd9Sstevel@tonic-gate 	uint_t			what,	/* 0, interface, endpoint number */
3097c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
3107c478bd9Sstevel@tonic-gate {
3117c478bd9Sstevel@tonic-gate 	return (usba10_usb_clear_feature(dip, ph, type, feature, what, flags));
3127c478bd9Sstevel@tonic-gate }
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate int
usb_pipe_ctrl_xfer_wait(usb_pipe_handle_t pipe_handle,usb_ctrl_setup_t * setup,mblk_t ** data,usb_cr_t * completion_reason,usb_cb_flags_t * cb_flags,usb_flags_t flags)3167c478bd9Sstevel@tonic-gate usb_pipe_ctrl_xfer_wait(
3177c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
3187c478bd9Sstevel@tonic-gate 	usb_ctrl_setup_t	*setup,
3197c478bd9Sstevel@tonic-gate 	mblk_t			**data,
3207c478bd9Sstevel@tonic-gate 	usb_cr_t		*completion_reason,
3217c478bd9Sstevel@tonic-gate 	usb_cb_flags_t		*cb_flags,
3227c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
3237c478bd9Sstevel@tonic-gate {
3247c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_ctrl_xfer_wait(
3257c478bd9Sstevel@tonic-gate 	    pipe_handle, setup, data, completion_reason, cb_flags, flags));
3267c478bd9Sstevel@tonic-gate }
3277c478bd9Sstevel@tonic-gate 
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate int
usb_set_cfg(dev_info_t * dip,uint_t cfg_index,usb_flags_t usb_flags,void (* cb)(usb_pipe_handle_t ph,usb_opaque_t arg,int rval,usb_cb_flags_t flags),usb_opaque_t cb_arg)3307c478bd9Sstevel@tonic-gate usb_set_cfg(
3317c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3327c478bd9Sstevel@tonic-gate 	uint_t			cfg_index,
3337c478bd9Sstevel@tonic-gate 	usb_flags_t		usb_flags,
3347c478bd9Sstevel@tonic-gate 	void			(*cb)(
3357c478bd9Sstevel@tonic-gate 					usb_pipe_handle_t ph,
3367c478bd9Sstevel@tonic-gate 					usb_opaque_t	arg,
3377c478bd9Sstevel@tonic-gate 					int		rval,
3387c478bd9Sstevel@tonic-gate 					usb_cb_flags_t	flags),
3397c478bd9Sstevel@tonic-gate 	usb_opaque_t		cb_arg)
3407c478bd9Sstevel@tonic-gate {
3417c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_cfg(dip, cfg_index, usb_flags, cb, cb_arg));
3427c478bd9Sstevel@tonic-gate }
3437c478bd9Sstevel@tonic-gate 
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate int
usb_get_cfg(dev_info_t * dip,uint_t * cfgval,usb_flags_t usb_flags)3467c478bd9Sstevel@tonic-gate usb_get_cfg(
3477c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3487c478bd9Sstevel@tonic-gate 	uint_t			*cfgval,
3497c478bd9Sstevel@tonic-gate 	usb_flags_t		usb_flags)
3507c478bd9Sstevel@tonic-gate {
3517c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_cfg(dip, cfgval, usb_flags));
3527c478bd9Sstevel@tonic-gate }
3537c478bd9Sstevel@tonic-gate 
3547c478bd9Sstevel@tonic-gate 
3557c478bd9Sstevel@tonic-gate int
usb_set_alt_if(dev_info_t * dip,uint_t interface,uint_t alt_number,usb_flags_t usb_flags,void (* cb)(usb_pipe_handle_t ph,usb_opaque_t arg,int rval,usb_cb_flags_t flags),usb_opaque_t cb_arg)3567c478bd9Sstevel@tonic-gate usb_set_alt_if(
3577c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3587c478bd9Sstevel@tonic-gate 	uint_t			interface,
3597c478bd9Sstevel@tonic-gate 	uint_t			alt_number,
3607c478bd9Sstevel@tonic-gate 	usb_flags_t		usb_flags,
3617c478bd9Sstevel@tonic-gate 	void			(*cb)(
3627c478bd9Sstevel@tonic-gate 					usb_pipe_handle_t ph,
3637c478bd9Sstevel@tonic-gate 					usb_opaque_t	arg,
3647c478bd9Sstevel@tonic-gate 					int		rval,
3657c478bd9Sstevel@tonic-gate 					usb_cb_flags_t	flags),
3667c478bd9Sstevel@tonic-gate 	usb_opaque_t		cb_arg)
3677c478bd9Sstevel@tonic-gate {
3687c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_alt_if(
3697c478bd9Sstevel@tonic-gate 	    dip, interface, alt_number, usb_flags, cb, cb_arg));
3707c478bd9Sstevel@tonic-gate }
3717c478bd9Sstevel@tonic-gate 
3727c478bd9Sstevel@tonic-gate 
3737c478bd9Sstevel@tonic-gate int
usb_get_alt_if(dev_info_t * dip,uint_t if_number,uint_t * alt_number,usb_flags_t flags)3747c478bd9Sstevel@tonic-gate usb_get_alt_if(
3757c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3767c478bd9Sstevel@tonic-gate 	uint_t			if_number,
3777c478bd9Sstevel@tonic-gate 	uint_t			*alt_number,
3787c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
3797c478bd9Sstevel@tonic-gate {
3807c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_alt_if(dip, if_number, alt_number, flags));
3817c478bd9Sstevel@tonic-gate }
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate 
3847c478bd9Sstevel@tonic-gate usb_bulk_req_t *
usb_alloc_bulk_req(dev_info_t * dip,size_t len,usb_flags_t flags)3857c478bd9Sstevel@tonic-gate usb_alloc_bulk_req(
3867c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
3877c478bd9Sstevel@tonic-gate 	size_t			len,
3887c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
3897c478bd9Sstevel@tonic-gate {
3907c478bd9Sstevel@tonic-gate 	return (usba10_usb_alloc_bulk_req(dip, len, flags));
3917c478bd9Sstevel@tonic-gate }
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate 
3947c478bd9Sstevel@tonic-gate void
usb_free_bulk_req(usb_bulk_req_t * reqp)3957c478bd9Sstevel@tonic-gate usb_free_bulk_req(usb_bulk_req_t *reqp)
3967c478bd9Sstevel@tonic-gate {
3977c478bd9Sstevel@tonic-gate 	usba10_usb_free_bulk_req(reqp);
3987c478bd9Sstevel@tonic-gate }
3997c478bd9Sstevel@tonic-gate 
4007c478bd9Sstevel@tonic-gate 
4017c478bd9Sstevel@tonic-gate int
usb_pipe_bulk_xfer(usb_pipe_handle_t pipe_handle,usb_bulk_req_t * reqp,usb_flags_t flags)4027c478bd9Sstevel@tonic-gate usb_pipe_bulk_xfer(
4037c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
4047c478bd9Sstevel@tonic-gate 	usb_bulk_req_t		*reqp,
4057c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4067c478bd9Sstevel@tonic-gate {
4077c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_bulk_xfer(pipe_handle, reqp, flags));
4087c478bd9Sstevel@tonic-gate }
4097c478bd9Sstevel@tonic-gate 
4107c478bd9Sstevel@tonic-gate 
4117c478bd9Sstevel@tonic-gate int
usb_pipe_bulk_transfer_size(dev_info_t * dip,size_t * size)4127c478bd9Sstevel@tonic-gate usb_pipe_bulk_transfer_size(
4137c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
4147c478bd9Sstevel@tonic-gate 	size_t			*size)
4157c478bd9Sstevel@tonic-gate {
4167c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_bulk_transfer_size(dip, size));
4177c478bd9Sstevel@tonic-gate }
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate 
4207c478bd9Sstevel@tonic-gate usb_intr_req_t *
usb_alloc_intr_req(dev_info_t * dip,size_t len,usb_flags_t flags)4217c478bd9Sstevel@tonic-gate usb_alloc_intr_req(
4227c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
4237c478bd9Sstevel@tonic-gate 	size_t			len,
4247c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4257c478bd9Sstevel@tonic-gate {
4267c478bd9Sstevel@tonic-gate 	return (usba10_usb_alloc_intr_req(dip, len, flags));
4277c478bd9Sstevel@tonic-gate }
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate 
4307c478bd9Sstevel@tonic-gate void
usb_free_intr_req(usb_intr_req_t * reqp)4317c478bd9Sstevel@tonic-gate usb_free_intr_req(usb_intr_req_t *reqp)
4327c478bd9Sstevel@tonic-gate {
4337c478bd9Sstevel@tonic-gate 	usba10_usb_free_intr_req(reqp);
4347c478bd9Sstevel@tonic-gate }
4357c478bd9Sstevel@tonic-gate 
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate int
usb_pipe_intr_xfer(usb_pipe_handle_t pipe_handle,usb_intr_req_t * req,usb_flags_t flags)4387c478bd9Sstevel@tonic-gate usb_pipe_intr_xfer(
4397c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
4407c478bd9Sstevel@tonic-gate 	usb_intr_req_t		*req,
4417c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4427c478bd9Sstevel@tonic-gate {
4437c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_intr_xfer(pipe_handle, req, flags));
4447c478bd9Sstevel@tonic-gate }
4457c478bd9Sstevel@tonic-gate 
4467c478bd9Sstevel@tonic-gate 
4477c478bd9Sstevel@tonic-gate void
usb_pipe_stop_intr_polling(usb_pipe_handle_t pipe_handle,usb_flags_t flags)4487c478bd9Sstevel@tonic-gate usb_pipe_stop_intr_polling(
4497c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
4507c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4517c478bd9Sstevel@tonic-gate {
4527c478bd9Sstevel@tonic-gate 	usba10_usb_pipe_stop_intr_polling(pipe_handle, flags);
4537c478bd9Sstevel@tonic-gate }
4547c478bd9Sstevel@tonic-gate 
4557c478bd9Sstevel@tonic-gate 
4567c478bd9Sstevel@tonic-gate usb_isoc_req_t *
usb_alloc_isoc_req(dev_info_t * dip,uint_t isoc_pkts_count,size_t len,usb_flags_t flags)4577c478bd9Sstevel@tonic-gate usb_alloc_isoc_req(
4587c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
4597c478bd9Sstevel@tonic-gate 	uint_t			isoc_pkts_count,
4607c478bd9Sstevel@tonic-gate 	size_t			len,
4617c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4627c478bd9Sstevel@tonic-gate {
4637c478bd9Sstevel@tonic-gate 	return (usba10_usb_alloc_isoc_req(dip, isoc_pkts_count, len, flags));
4647c478bd9Sstevel@tonic-gate }
4657c478bd9Sstevel@tonic-gate 
4667c478bd9Sstevel@tonic-gate 
4677c478bd9Sstevel@tonic-gate void
usb_free_isoc_req(usb_isoc_req_t * usb_isoc_req)4687c478bd9Sstevel@tonic-gate usb_free_isoc_req(usb_isoc_req_t *usb_isoc_req)
4697c478bd9Sstevel@tonic-gate {
4707c478bd9Sstevel@tonic-gate 	usba10_usb_free_isoc_req(usb_isoc_req);
4717c478bd9Sstevel@tonic-gate }
4727c478bd9Sstevel@tonic-gate 
4737c478bd9Sstevel@tonic-gate 
4747c478bd9Sstevel@tonic-gate usb_frame_number_t
usb_get_current_frame_number(dev_info_t * dip)4757c478bd9Sstevel@tonic-gate usb_get_current_frame_number(dev_info_t	*dip)
4767c478bd9Sstevel@tonic-gate {
4777c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_current_frame_number(dip));
4787c478bd9Sstevel@tonic-gate }
4797c478bd9Sstevel@tonic-gate 
4807c478bd9Sstevel@tonic-gate 
4817c478bd9Sstevel@tonic-gate uint_t
usb_get_max_isoc_pkts(dev_info_t * dip)4827c478bd9Sstevel@tonic-gate usb_get_max_isoc_pkts(dev_info_t *dip)
4837c478bd9Sstevel@tonic-gate {
4847c478bd9Sstevel@tonic-gate 	return (usba10_usb_get_max_isoc_pkts(dip));
4857c478bd9Sstevel@tonic-gate }
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate 
4887c478bd9Sstevel@tonic-gate int
usb_pipe_isoc_xfer(usb_pipe_handle_t pipe_handle,usb_isoc_req_t * reqp,usb_flags_t flags)4897c478bd9Sstevel@tonic-gate usb_pipe_isoc_xfer(
4907c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
4917c478bd9Sstevel@tonic-gate 	usb_isoc_req_t		*reqp,
4927c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
4937c478bd9Sstevel@tonic-gate {
4947c478bd9Sstevel@tonic-gate 	return (usba10_usb_pipe_isoc_xfer(pipe_handle, reqp, flags));
4957c478bd9Sstevel@tonic-gate }
4967c478bd9Sstevel@tonic-gate 
4977c478bd9Sstevel@tonic-gate 
4987c478bd9Sstevel@tonic-gate void
usb_pipe_stop_isoc_polling(usb_pipe_handle_t pipe_handle,usb_flags_t flags)4997c478bd9Sstevel@tonic-gate usb_pipe_stop_isoc_polling(
5007c478bd9Sstevel@tonic-gate 	usb_pipe_handle_t	pipe_handle,
5017c478bd9Sstevel@tonic-gate 	usb_flags_t		flags)
5027c478bd9Sstevel@tonic-gate {
5037c478bd9Sstevel@tonic-gate 	usba10_usb_pipe_stop_isoc_polling(pipe_handle, flags);
5047c478bd9Sstevel@tonic-gate }
5057c478bd9Sstevel@tonic-gate 
5067c478bd9Sstevel@tonic-gate 
5077c478bd9Sstevel@tonic-gate int
usb_req_raise_power(dev_info_t * dip,int comp,int level,void (* cb)(void * arg,int rval),void * arg,usb_flags_t flags)5087c478bd9Sstevel@tonic-gate usb_req_raise_power(
5097c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5107c478bd9Sstevel@tonic-gate 	int		comp,
5117c478bd9Sstevel@tonic-gate 	int		level,
5127c478bd9Sstevel@tonic-gate 	void		(*cb)(void *arg, int rval),
5137c478bd9Sstevel@tonic-gate 	void		*arg,
5147c478bd9Sstevel@tonic-gate 	usb_flags_t	flags)
5157c478bd9Sstevel@tonic-gate {
5167c478bd9Sstevel@tonic-gate 	return (usba10_usb_req_raise_power(dip, comp, level, cb, arg, flags));
5177c478bd9Sstevel@tonic-gate }
5187c478bd9Sstevel@tonic-gate 
5197c478bd9Sstevel@tonic-gate 
5207c478bd9Sstevel@tonic-gate int
usb_req_lower_power(dev_info_t * dip,int comp,int level,void (* cb)(void * arg,int rval),void * arg,usb_flags_t flags)5217c478bd9Sstevel@tonic-gate usb_req_lower_power(
5227c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5237c478bd9Sstevel@tonic-gate 	int		comp,
5247c478bd9Sstevel@tonic-gate 	int		level,
5257c478bd9Sstevel@tonic-gate 	void		(*cb)(void *arg, int rval),
5267c478bd9Sstevel@tonic-gate 	void		*arg,
5277c478bd9Sstevel@tonic-gate 	usb_flags_t	flags)
5287c478bd9Sstevel@tonic-gate {
5297c478bd9Sstevel@tonic-gate 	return (usba10_usb_req_raise_power(dip, comp, level, cb, arg, flags));
5307c478bd9Sstevel@tonic-gate }
5317c478bd9Sstevel@tonic-gate 
5327c478bd9Sstevel@tonic-gate 
5337c478bd9Sstevel@tonic-gate int
usb_is_pm_enabled(dev_info_t * dip)5347c478bd9Sstevel@tonic-gate usb_is_pm_enabled(dev_info_t *dip)
5357c478bd9Sstevel@tonic-gate {
5367c478bd9Sstevel@tonic-gate 	return (usba10_usb_is_pm_enabled(dip));
5377c478bd9Sstevel@tonic-gate }
5387c478bd9Sstevel@tonic-gate 
5397c478bd9Sstevel@tonic-gate int
usb_handle_remote_wakeup(dev_info_t * dip,int cmd)5407c478bd9Sstevel@tonic-gate usb_handle_remote_wakeup(
5417c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5427c478bd9Sstevel@tonic-gate 	int		cmd)
5437c478bd9Sstevel@tonic-gate {
5447c478bd9Sstevel@tonic-gate 	return (usba10_usb_handle_remote_wakeup(dip, cmd));
5457c478bd9Sstevel@tonic-gate }
5467c478bd9Sstevel@tonic-gate 
5477c478bd9Sstevel@tonic-gate 
5487c478bd9Sstevel@tonic-gate int
usb_create_pm_components(dev_info_t * dip,uint_t * pwrstates)5497c478bd9Sstevel@tonic-gate usb_create_pm_components(
5507c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5517c478bd9Sstevel@tonic-gate 	uint_t		*pwrstates)
5527c478bd9Sstevel@tonic-gate {
5537c478bd9Sstevel@tonic-gate 	return (usba10_usb_create_pm_components(dip, pwrstates));
5547c478bd9Sstevel@tonic-gate }
5557c478bd9Sstevel@tonic-gate 
5567c478bd9Sstevel@tonic-gate 
5577c478bd9Sstevel@tonic-gate int
usb_set_device_pwrlvl0(dev_info_t * dip)5587c478bd9Sstevel@tonic-gate usb_set_device_pwrlvl0(dev_info_t *dip)
5597c478bd9Sstevel@tonic-gate {
5607c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_device_pwrlvl0(dip));
5617c478bd9Sstevel@tonic-gate }
5627c478bd9Sstevel@tonic-gate 
5637c478bd9Sstevel@tonic-gate 
5647c478bd9Sstevel@tonic-gate int
usb_set_device_pwrlvl1(dev_info_t * dip)5657c478bd9Sstevel@tonic-gate usb_set_device_pwrlvl1(dev_info_t *dip)
5667c478bd9Sstevel@tonic-gate {
5677c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_device_pwrlvl1(dip));
5687c478bd9Sstevel@tonic-gate }
5697c478bd9Sstevel@tonic-gate 
5707c478bd9Sstevel@tonic-gate 
5717c478bd9Sstevel@tonic-gate int
usb_set_device_pwrlvl2(dev_info_t * dip)5727c478bd9Sstevel@tonic-gate usb_set_device_pwrlvl2(dev_info_t *dip)
5737c478bd9Sstevel@tonic-gate {
5747c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_device_pwrlvl2(dip));
5757c478bd9Sstevel@tonic-gate }
5767c478bd9Sstevel@tonic-gate 
5777c478bd9Sstevel@tonic-gate 
5787c478bd9Sstevel@tonic-gate int
usb_set_device_pwrlvl3(dev_info_t * dip)5797c478bd9Sstevel@tonic-gate usb_set_device_pwrlvl3(dev_info_t *dip)
5807c478bd9Sstevel@tonic-gate {
5817c478bd9Sstevel@tonic-gate 	return (usba10_usb_set_device_pwrlvl3(dip));
5827c478bd9Sstevel@tonic-gate }
5837c478bd9Sstevel@tonic-gate 
5847c478bd9Sstevel@tonic-gate 
5857c478bd9Sstevel@tonic-gate int
usb_async_req(dev_info_t * dip,void (* func)(void *),void * arg,usb_flags_t flag)5867c478bd9Sstevel@tonic-gate usb_async_req(
5877c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5887c478bd9Sstevel@tonic-gate 	void		(*func)(void *),
5897c478bd9Sstevel@tonic-gate 	void		*arg,
5907c478bd9Sstevel@tonic-gate 	usb_flags_t	flag)
5917c478bd9Sstevel@tonic-gate {
5927c478bd9Sstevel@tonic-gate 	return (usba10_usb_async_req(dip, func, arg, flag));
5937c478bd9Sstevel@tonic-gate }
5947c478bd9Sstevel@tonic-gate 
5957c478bd9Sstevel@tonic-gate 
5967c478bd9Sstevel@tonic-gate int
usb_register_event_cbs(dev_info_t * dip,usb_event_t * usb_evt_data,usb_flags_t flags)5977c478bd9Sstevel@tonic-gate usb_register_event_cbs(
5987c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
5997c478bd9Sstevel@tonic-gate 	usb_event_t	*usb_evt_data,
6007c478bd9Sstevel@tonic-gate 	usb_flags_t	flags)
6017c478bd9Sstevel@tonic-gate {
6027c478bd9Sstevel@tonic-gate 	return (usba10_usb_register_event_cbs(dip, usb_evt_data, flags));
6037c478bd9Sstevel@tonic-gate }
6047c478bd9Sstevel@tonic-gate 
6057c478bd9Sstevel@tonic-gate 
6067c478bd9Sstevel@tonic-gate void
usb_unregister_event_cbs(dev_info_t * dip,usb_event_t * usb_evt_data)6077c478bd9Sstevel@tonic-gate usb_unregister_event_cbs(
6087c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
6097c478bd9Sstevel@tonic-gate 	usb_event_t	*usb_evt_data)
6107c478bd9Sstevel@tonic-gate {
6117c478bd9Sstevel@tonic-gate 	usba10_usb_unregister_event_cbs(dip, usb_evt_data);
6127c478bd9Sstevel@tonic-gate }
6137c478bd9Sstevel@tonic-gate 
6147c478bd9Sstevel@tonic-gate 
6157c478bd9Sstevel@tonic-gate void
usb_fail_checkpoint(dev_info_t * dip,usb_flags_t flags)6167c478bd9Sstevel@tonic-gate usb_fail_checkpoint(
6177c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
6187c478bd9Sstevel@tonic-gate 	usb_flags_t	flags)
6197c478bd9Sstevel@tonic-gate {
6207c478bd9Sstevel@tonic-gate 	usba10_usb_fail_checkpoint(dip, flags);
6217c478bd9Sstevel@tonic-gate }
6227c478bd9Sstevel@tonic-gate 
6237c478bd9Sstevel@tonic-gate #ifdef DEBUG
6247c478bd9Sstevel@tonic-gate 
usb_dprintf4(uint_t mask,usb_log_handle_t handle,char * fmt,...)6257c478bd9Sstevel@tonic-gate void usb_dprintf4(
6267c478bd9Sstevel@tonic-gate 	uint_t		mask,
6277c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
6287c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
6297c478bd9Sstevel@tonic-gate {
6307c478bd9Sstevel@tonic-gate 	va_list ap;
6317c478bd9Sstevel@tonic-gate 
6327c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
6337c478bd9Sstevel@tonic-gate 	(void) usba10_usba_vlog(handle, USB_LOG_L4, mask, fmt, ap);
6347c478bd9Sstevel@tonic-gate 	va_end(ap);
6357c478bd9Sstevel@tonic-gate }
6367c478bd9Sstevel@tonic-gate 
6377c478bd9Sstevel@tonic-gate 
usb_dprintf3(uint_t mask,usb_log_handle_t handle,char * fmt,...)6387c478bd9Sstevel@tonic-gate void usb_dprintf3(
6397c478bd9Sstevel@tonic-gate 	uint_t		mask,
6407c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
6417c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
6427c478bd9Sstevel@tonic-gate {
6437c478bd9Sstevel@tonic-gate 	va_list ap;
6447c478bd9Sstevel@tonic-gate 
6457c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
6467c478bd9Sstevel@tonic-gate 	(void) usba10_usba_vlog(handle, USB_LOG_L3, mask, fmt, ap);
6477c478bd9Sstevel@tonic-gate 	va_end(ap);
6487c478bd9Sstevel@tonic-gate }
6497c478bd9Sstevel@tonic-gate 
6507c478bd9Sstevel@tonic-gate 
usb_dprintf2(uint_t mask,usb_log_handle_t handle,char * fmt,...)6517c478bd9Sstevel@tonic-gate void usb_dprintf2(
6527c478bd9Sstevel@tonic-gate 	uint_t		mask,
6537c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
6547c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
6557c478bd9Sstevel@tonic-gate {
6567c478bd9Sstevel@tonic-gate 	va_list ap;
6577c478bd9Sstevel@tonic-gate 
6587c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
6597c478bd9Sstevel@tonic-gate 	(void) usba10_usba_vlog(handle, USB_LOG_L2, mask, fmt, ap);
6607c478bd9Sstevel@tonic-gate 	va_end(ap);
6617c478bd9Sstevel@tonic-gate }
6627c478bd9Sstevel@tonic-gate 
6637c478bd9Sstevel@tonic-gate #endif
6647c478bd9Sstevel@tonic-gate 
usb_dprintf1(uint_t mask,usb_log_handle_t handle,char * fmt,...)6657c478bd9Sstevel@tonic-gate void usb_dprintf1(
6667c478bd9Sstevel@tonic-gate 	uint_t		mask,
6677c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
6687c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
6697c478bd9Sstevel@tonic-gate {
6707c478bd9Sstevel@tonic-gate 	va_list ap;
6717c478bd9Sstevel@tonic-gate 
6727c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
6737c478bd9Sstevel@tonic-gate 	(void) usba10_usba_vlog(handle, USB_LOG_L1, mask, fmt, ap);
6747c478bd9Sstevel@tonic-gate 	va_end(ap);
6757c478bd9Sstevel@tonic-gate }
6767c478bd9Sstevel@tonic-gate 
6777c478bd9Sstevel@tonic-gate 
6787c478bd9Sstevel@tonic-gate 
usb_dprintf0(uint_t mask,usb_log_handle_t handle,char * fmt,...)6797c478bd9Sstevel@tonic-gate void usb_dprintf0(
6807c478bd9Sstevel@tonic-gate 	uint_t		mask,
6817c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
6827c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
6837c478bd9Sstevel@tonic-gate {
6847c478bd9Sstevel@tonic-gate 	va_list ap;
6857c478bd9Sstevel@tonic-gate 
6867c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
6877c478bd9Sstevel@tonic-gate 	(void) usba10_usba_vlog(handle, USB_LOG_L4, mask, fmt, ap);
6887c478bd9Sstevel@tonic-gate 	va_end(ap);
6897c478bd9Sstevel@tonic-gate }
6907c478bd9Sstevel@tonic-gate 
6917c478bd9Sstevel@tonic-gate usb_log_handle_t
usb_alloc_log_handle(dev_info_t * dip,char * name,uint_t * errlevel,uint_t * mask,uint_t * instance_filter,uint_t show_label,usb_flags_t flags)6927c478bd9Sstevel@tonic-gate usb_alloc_log_handle(
6937c478bd9Sstevel@tonic-gate 	dev_info_t	*dip,
6947c478bd9Sstevel@tonic-gate 	char		*name,
6957c478bd9Sstevel@tonic-gate 	uint_t		*errlevel,
6967c478bd9Sstevel@tonic-gate 	uint_t		*mask,
6977c478bd9Sstevel@tonic-gate 	uint_t		*instance_filter,
6987c478bd9Sstevel@tonic-gate 	uint_t		show_label,
6997c478bd9Sstevel@tonic-gate 	usb_flags_t	flags)
7007c478bd9Sstevel@tonic-gate {
7017c478bd9Sstevel@tonic-gate 	return (usba10_usb_alloc_log_handle(
7027c478bd9Sstevel@tonic-gate 	    dip, name, errlevel, mask, instance_filter, show_label, flags));
7037c478bd9Sstevel@tonic-gate }
7047c478bd9Sstevel@tonic-gate 
7057c478bd9Sstevel@tonic-gate 
7067c478bd9Sstevel@tonic-gate void
usb_free_log_handle(usb_log_handle_t handle)7077c478bd9Sstevel@tonic-gate usb_free_log_handle(usb_log_handle_t handle)
7087c478bd9Sstevel@tonic-gate {
7097c478bd9Sstevel@tonic-gate 	usba10_usb_free_log_handle(handle);
7107c478bd9Sstevel@tonic-gate }
7117c478bd9Sstevel@tonic-gate 
7127c478bd9Sstevel@tonic-gate 
7137c478bd9Sstevel@tonic-gate int
usb_log(usb_log_handle_t handle,uint_t level,uint_t mask,char * fmt,...)7147c478bd9Sstevel@tonic-gate usb_log(
7157c478bd9Sstevel@tonic-gate 	usb_log_handle_t handle,
7167c478bd9Sstevel@tonic-gate 	uint_t		level,
7177c478bd9Sstevel@tonic-gate 	uint_t		mask,
7187c478bd9Sstevel@tonic-gate 	char		*fmt, ...)
7197c478bd9Sstevel@tonic-gate {
7207c478bd9Sstevel@tonic-gate 	va_list ap;
7217c478bd9Sstevel@tonic-gate 	int rval;
7227c478bd9Sstevel@tonic-gate 
7237c478bd9Sstevel@tonic-gate 	va_start(ap, fmt);
7247c478bd9Sstevel@tonic-gate 	rval = usba10_usba_vlog(handle, level, mask, fmt, ap);
7257c478bd9Sstevel@tonic-gate 	va_end(ap);
7267c478bd9Sstevel@tonic-gate 
7277c478bd9Sstevel@tonic-gate 	return (rval);
7287c478bd9Sstevel@tonic-gate }
7297c478bd9Sstevel@tonic-gate 
7307c478bd9Sstevel@tonic-gate 
7317c478bd9Sstevel@tonic-gate 
7327c478bd9Sstevel@tonic-gate int
usb_log_descr_tree(usb_client_dev_data_t * dev_data,usb_log_handle_t log_handle,uint_t level,uint_t mask)7337c478bd9Sstevel@tonic-gate usb_log_descr_tree(
7347c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t	*dev_data,
7357c478bd9Sstevel@tonic-gate 	usb_log_handle_t	log_handle,
7367c478bd9Sstevel@tonic-gate 	uint_t			level,
7377c478bd9Sstevel@tonic-gate 	uint_t			mask)
7387c478bd9Sstevel@tonic-gate {
7397c478bd9Sstevel@tonic-gate 	return (usba10_usb_log_descr_tree(dev_data, log_handle, level, mask));
7407c478bd9Sstevel@tonic-gate }
7417c478bd9Sstevel@tonic-gate 
7427c478bd9Sstevel@tonic-gate 
7437c478bd9Sstevel@tonic-gate int
usb_print_descr_tree(dev_info_t * dip,usb_client_dev_data_t * dev_data)7447c478bd9Sstevel@tonic-gate usb_print_descr_tree(
7457c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
7467c478bd9Sstevel@tonic-gate 	usb_client_dev_data_t	*dev_data)
7477c478bd9Sstevel@tonic-gate {
7487c478bd9Sstevel@tonic-gate 	return (usba10_usb_print_descr_tree(dip, dev_data));
7497c478bd9Sstevel@tonic-gate }
7507c478bd9Sstevel@tonic-gate 
7517c478bd9Sstevel@tonic-gate 
7527c478bd9Sstevel@tonic-gate int
usb_check_same_device(dev_info_t * dip,usb_log_handle_t log_handle,int log_level,int log_mask,uint_t check_mask,char * device_string)7537c478bd9Sstevel@tonic-gate usb_check_same_device(
7547c478bd9Sstevel@tonic-gate 	dev_info_t		*dip,
7557c478bd9Sstevel@tonic-gate 	usb_log_handle_t	log_handle,
7567c478bd9Sstevel@tonic-gate 	int			log_level,
7577c478bd9Sstevel@tonic-gate 	int			log_mask,
7587c478bd9Sstevel@tonic-gate 	uint_t			check_mask,
7597c478bd9Sstevel@tonic-gate 	char			*device_string)
7607c478bd9Sstevel@tonic-gate {
7617c478bd9Sstevel@tonic-gate 	return (usba10_usb_check_same_device(
7627c478bd9Sstevel@tonic-gate 	    dip, log_handle, log_level, log_mask, check_mask, device_string));
7637c478bd9Sstevel@tonic-gate }
7647c478bd9Sstevel@tonic-gate 
7657c478bd9Sstevel@tonic-gate 
7667c478bd9Sstevel@tonic-gate const char *
usb_str_cr(usb_cr_t cr)7677c478bd9Sstevel@tonic-gate usb_str_cr(usb_cr_t cr)
7687c478bd9Sstevel@tonic-gate {
7697c478bd9Sstevel@tonic-gate 	return (usba10_usb_str_cr(cr));
7707c478bd9Sstevel@tonic-gate }
7717c478bd9Sstevel@tonic-gate 
7727c478bd9Sstevel@tonic-gate 
7737c478bd9Sstevel@tonic-gate char *
usb_str_cb_flags(usb_cb_flags_t cb_flags,char * buffer,size_t length)7747c478bd9Sstevel@tonic-gate usb_str_cb_flags(
7757c478bd9Sstevel@tonic-gate 	usb_cb_flags_t cb_flags,
7767c478bd9Sstevel@tonic-gate 	char *buffer,
7777c478bd9Sstevel@tonic-gate 	size_t length)
7787c478bd9Sstevel@tonic-gate {
7797c478bd9Sstevel@tonic-gate 	return (usba10_usb_str_cb_flags(cb_flags, buffer, length));
7807c478bd9Sstevel@tonic-gate }
7817c478bd9Sstevel@tonic-gate 
7827c478bd9Sstevel@tonic-gate 
7837c478bd9Sstevel@tonic-gate const char *
usb_str_pipe_state(usb_pipe_state_t state)7847c478bd9Sstevel@tonic-gate usb_str_pipe_state(usb_pipe_state_t state)
7857c478bd9Sstevel@tonic-gate {
7867c478bd9Sstevel@tonic-gate 	return (usba10_usb_str_pipe_state(state));
7877c478bd9Sstevel@tonic-gate }
7887c478bd9Sstevel@tonic-gate 
7897c478bd9Sstevel@tonic-gate 
7907c478bd9Sstevel@tonic-gate const char *
usb_str_dev_state(int state)7917c478bd9Sstevel@tonic-gate usb_str_dev_state(int state)
7927c478bd9Sstevel@tonic-gate {
7937c478bd9Sstevel@tonic-gate 	return (usba10_usb_str_dev_state(state));
7947c478bd9Sstevel@tonic-gate }
7957c478bd9Sstevel@tonic-gate 
7967c478bd9Sstevel@tonic-gate 
7977c478bd9Sstevel@tonic-gate const char *
usb_str_rval(int rval)7987c478bd9Sstevel@tonic-gate usb_str_rval(int rval)
7997c478bd9Sstevel@tonic-gate {
8007c478bd9Sstevel@tonic-gate 	return (usba10_usb_str_rval(rval));
8017c478bd9Sstevel@tonic-gate }
8027c478bd9Sstevel@tonic-gate 
8037c478bd9Sstevel@tonic-gate 
8047c478bd9Sstevel@tonic-gate int
usb_rval2errno(int rval)8057c478bd9Sstevel@tonic-gate usb_rval2errno(int rval)
8067c478bd9Sstevel@tonic-gate {
8077c478bd9Sstevel@tonic-gate 	return (usba10_usb_rval2errno(rval));
8087c478bd9Sstevel@tonic-gate }
8097c478bd9Sstevel@tonic-gate 
8107c478bd9Sstevel@tonic-gate 
8117c478bd9Sstevel@tonic-gate usb_serialization_t
usb_init_serialization(dev_info_t * s_dip,uint_t flag)8127c478bd9Sstevel@tonic-gate usb_init_serialization(
8137c478bd9Sstevel@tonic-gate 	dev_info_t	*s_dip,
8147c478bd9Sstevel@tonic-gate 	uint_t		flag)
8157c478bd9Sstevel@tonic-gate {
8167c478bd9Sstevel@tonic-gate 	return (usba10_usb_init_serialization(s_dip, flag));
8177c478bd9Sstevel@tonic-gate }
8187c478bd9Sstevel@tonic-gate 
8197c478bd9Sstevel@tonic-gate 
8207c478bd9Sstevel@tonic-gate void
usb_fini_serialization(usb_serialization_t usb_serp)8217c478bd9Sstevel@tonic-gate usb_fini_serialization(usb_serialization_t usb_serp)
8227c478bd9Sstevel@tonic-gate {
8237c478bd9Sstevel@tonic-gate 	usba10_usb_fini_serialization(usb_serp);
8247c478bd9Sstevel@tonic-gate }
8257c478bd9Sstevel@tonic-gate 
8267c478bd9Sstevel@tonic-gate 
8277c478bd9Sstevel@tonic-gate int
usb_serialize_access(usb_serialization_t usb_serp,uint_t how_to_wait,uint_t delta_timeout)8287c478bd9Sstevel@tonic-gate usb_serialize_access(
8297c478bd9Sstevel@tonic-gate 	usb_serialization_t	usb_serp,
8307c478bd9Sstevel@tonic-gate 	uint_t			how_to_wait,
8317c478bd9Sstevel@tonic-gate 	uint_t			delta_timeout)
8327c478bd9Sstevel@tonic-gate {
8337c478bd9Sstevel@tonic-gate 	return (usba10_usb_serialize_access(
8347c478bd9Sstevel@tonic-gate 	    usb_serp, how_to_wait, delta_timeout));
8357c478bd9Sstevel@tonic-gate }
8367c478bd9Sstevel@tonic-gate 
8377c478bd9Sstevel@tonic-gate 
8387c478bd9Sstevel@tonic-gate int
usb_try_serialize_access(usb_serialization_t usb_serp,uint_t flag)8397c478bd9Sstevel@tonic-gate usb_try_serialize_access(
8407c478bd9Sstevel@tonic-gate 	usb_serialization_t usb_serp,
8417c478bd9Sstevel@tonic-gate 	uint_t flag)
8427c478bd9Sstevel@tonic-gate {
8437c478bd9Sstevel@tonic-gate 	return (usba10_usb_try_serialize_access(usb_serp, flag));
8447c478bd9Sstevel@tonic-gate }
8457c478bd9Sstevel@tonic-gate 
8467c478bd9Sstevel@tonic-gate 
8477c478bd9Sstevel@tonic-gate void
usb_release_access(usb_serialization_t usb_serp)8487c478bd9Sstevel@tonic-gate usb_release_access(usb_serialization_t usb_serp)
8497c478bd9Sstevel@tonic-gate {
8507c478bd9Sstevel@tonic-gate 	usba10_usb_release_access(usb_serp);
8517c478bd9Sstevel@tonic-gate }
8527c478bd9Sstevel@tonic-gate 
8537c478bd9Sstevel@tonic-gate #endif
854