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