Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / uts / common / io / usb / usba / usba10_calls.c
blob6bcedac076f9e51c7a687a4f62fe1dd9ea7694d6
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
28 * Bridge module containing functions with different names than those in the
29 * usba10 module, so the usba10 module can call functions in this (usba) module.
31 * The usba10 module is present to satisfy a runtime loader dependency for
32 * legacy DDK drivers (V0.8). The usba10 module calls functions in this (usba)
33 * module to carry out driver requests.
35 * The intent is that this file disappear once krtld functionality is improved
36 * so that drivers dependent on usba10 can call into usba without these wrapper
37 * functions.
39 * Please see the on81-patch gate include/sys/usba10/usba10_usbai.h
40 * header file for descriptions and comments for these functions.
43 #include <sys/usb/usba.h>
44 #include <sys/usb/usba/usbai_private.h>
45 #include <sys/usb/usba/usba10.h>
47 #ifndef __lock_lint
49 int
50 usba10_usb_register_client(
51 dev_info_t *dip,
52 uint_t version,
53 usb_client_dev_data_t **dev_data,
54 usb_reg_parse_lvl_t parse_level,
55 usb_flags_t flags)
57 return (usb_register_client(
58 dip, version, dev_data, parse_level, flags));
62 void
63 usba10_usb_unregister_client(
64 dev_info_t *dip,
65 usb_client_dev_data_t *dev_data)
67 usb_unregister_client(dip, dev_data);
71 void
72 usba10_usb_free_descr_tree(
73 dev_info_t *dip,
74 usb_client_dev_data_t *dev_data)
76 usb_free_descr_tree(dip, dev_data);
80 size_t
81 usba10_usb_parse_data(
82 char *format,
83 uchar_t *data,
84 size_t datalen,
85 void *structure,
86 size_t structlen)
88 return (usb_parse_data(
89 format, data, datalen, structure, structlen));
92 usb_ep_data_t *
93 usba10_usb_get_ep_data(
94 dev_info_t *dip,
95 usb_client_dev_data_t *dev_datap,
96 uint_t interface,
97 uint_t alternate,
98 uint_t type,
99 uint_t direction)
101 return (usb_get_ep_data(
102 dip, dev_datap, interface, alternate, type, direction));
107 usba10_usb_get_string_descr(
108 dev_info_t *dip,
109 uint16_t langid,
110 uint8_t index,
111 char *buf,
112 size_t buflen)
114 return (usb_get_string_descr(dip, langid, index, buf, buflen));
119 usba10_usb_get_addr(dev_info_t *dip)
121 return (usb_get_addr(dip));
126 usba10_usb_get_if_number(dev_info_t *dip)
128 return (usb_get_if_number(dip));
132 boolean_t
133 usba10_usb_owns_device(dev_info_t *dip)
135 return (usb_owns_device(dip));
140 usba10_usb_pipe_get_state(
141 usb_pipe_handle_t pipe_handle,
142 usb_pipe_state_t *pipe_state,
143 usb_flags_t flags)
145 return (usb_pipe_get_state(pipe_handle, pipe_state, flags));
150 usba10_usb_ep_num(usb_pipe_handle_t ph)
152 return (usb_ep_num(ph));
157 usba10_usb_pipe_open(
158 dev_info_t *dip,
159 usb_ep_descr_t *ep,
160 usb_pipe_policy_t *pipe_policy,
161 usb_flags_t flags,
162 usb_pipe_handle_t *pipe_handle)
164 return (usb_pipe_open(dip, ep, pipe_policy, flags, pipe_handle));
168 void
169 usba10_usb_pipe_close(
170 dev_info_t *dip,
171 usb_pipe_handle_t pipe_handle,
172 usb_flags_t flags,
173 void (*cb)(
174 usb_pipe_handle_t ph,
175 usb_opaque_t arg, /* cb arg */
176 int rval,
177 usb_cb_flags_t flags),
178 usb_opaque_t cb_arg)
180 usb_pipe_close(dip, pipe_handle, flags, cb, cb_arg);
185 usba10_usb_pipe_drain_reqs(
186 dev_info_t *dip,
187 usb_pipe_handle_t pipe_handle,
188 uint_t time,
189 usb_flags_t flags,
190 void (*cb)(
191 usb_pipe_handle_t ph,
192 usb_opaque_t arg, /* cb arg */
193 int rval,
194 usb_cb_flags_t flags),
195 usb_opaque_t cb_arg)
197 return (usb_pipe_drain_reqs(
198 dip, pipe_handle, time, flags, cb, cb_arg));
203 usba10_usb_pipe_set_private(
204 usb_pipe_handle_t pipe_handle,
205 usb_opaque_t data)
207 return (usb_pipe_set_private(pipe_handle, data));
211 usb_opaque_t
212 usba10_usb_pipe_get_private(usb_pipe_handle_t pipe_handle)
214 return (usb_pipe_get_private(pipe_handle));
218 void
219 usba10_usb_pipe_reset(
220 dev_info_t *dip,
221 usb_pipe_handle_t pipe_handle,
222 usb_flags_t usb_flags,
223 void (*cb)(
224 usb_pipe_handle_t ph,
225 usb_opaque_t arg,
226 int rval,
227 usb_cb_flags_t flags),
228 usb_opaque_t cb_arg)
230 usb_pipe_reset(dip, pipe_handle, usb_flags, cb, cb_arg);
234 usb_ctrl_req_t *
235 usba10_usb_alloc_ctrl_req(
236 dev_info_t *dip,
237 size_t len,
238 usb_flags_t flags)
240 return (usb_alloc_ctrl_req(dip, len, flags));
244 void
245 usba10_usb_free_ctrl_req(usb_ctrl_req_t *reqp)
247 usb_free_ctrl_req(reqp);
252 usba10_usb_pipe_ctrl_xfer(
253 usb_pipe_handle_t pipe_handle,
254 usb_ctrl_req_t *reqp,
255 usb_flags_t flags)
257 return (usb_pipe_ctrl_xfer(pipe_handle, reqp, flags));
262 usba10_usb_get_status(
263 dev_info_t *dip,
264 usb_pipe_handle_t ph,
265 uint_t type, /* bmRequestType */
266 uint_t what, /* 0, interface, endpoint number */
267 uint16_t *status,
268 usb_flags_t flags)
270 return (usb_get_status(dip, ph, type, what, status, flags));
275 usba10_usb_clear_feature(
276 dev_info_t *dip,
277 usb_pipe_handle_t ph,
278 uint_t type, /* bmRequestType */
279 uint_t feature,
280 uint_t what, /* 0, interface, endpoint number */
281 usb_flags_t flags)
283 return (usb_clear_feature(dip, ph, type, feature, what, flags));
288 usba10_usb_pipe_ctrl_xfer_wait(
289 usb_pipe_handle_t pipe_handle,
290 usb_ctrl_setup_t *setup,
291 mblk_t **data,
292 usb_cr_t *completion_reason,
293 usb_cb_flags_t *cb_flags,
294 usb_flags_t flags)
296 return (usb_pipe_ctrl_xfer_wait(
297 pipe_handle, setup, data, completion_reason, cb_flags, flags));
302 usba10_usb_set_cfg(
303 dev_info_t *dip,
304 uint_t cfg_index,
305 usb_flags_t usb_flags,
306 void (*cb)(
307 usb_pipe_handle_t ph,
308 usb_opaque_t arg,
309 int rval,
310 usb_cb_flags_t flags),
311 usb_opaque_t cb_arg)
313 return (usb_set_cfg(dip, cfg_index, usb_flags, cb, cb_arg));
318 usba10_usb_get_cfg(
319 dev_info_t *dip,
320 uint_t *cfgval,
321 usb_flags_t usb_flags)
323 return (usb_get_cfg(dip, cfgval, usb_flags));
328 usba10_usb_set_alt_if(
329 dev_info_t *dip,
330 uint_t interface,
331 uint_t alt_number,
332 usb_flags_t usb_flags,
333 void (*cb)(
334 usb_pipe_handle_t ph,
335 usb_opaque_t arg,
336 int rval,
337 usb_cb_flags_t flags),
338 usb_opaque_t cb_arg)
340 return (usb_set_alt_if(
341 dip, interface, alt_number, usb_flags, cb, cb_arg));
346 usba10_usb_get_alt_if(
347 dev_info_t *dip,
348 uint_t if_number,
349 uint_t *alt_number,
350 usb_flags_t flags)
352 return (usb_get_alt_if(dip, if_number, alt_number, flags));
356 usb_bulk_req_t *
357 usba10_usb_alloc_bulk_req(
358 dev_info_t *dip,
359 size_t len,
360 usb_flags_t flags)
362 return (usb_alloc_bulk_req(dip, len, flags));
366 void
367 usba10_usb_free_bulk_req(usb_bulk_req_t *reqp)
369 usb_free_bulk_req(reqp);
374 usba10_usb_pipe_bulk_xfer(
375 usb_pipe_handle_t pipe_handle,
376 usb_bulk_req_t *reqp,
377 usb_flags_t flags)
379 return (usb_pipe_bulk_xfer(pipe_handle, reqp, flags));
384 usba10_usb_pipe_bulk_transfer_size(
385 dev_info_t *dip,
386 size_t *size)
388 return (usb_pipe_bulk_transfer_size(dip, size));
392 usb_intr_req_t *
393 usba10_usb_alloc_intr_req(
394 dev_info_t *dip,
395 size_t len,
396 usb_flags_t flags)
398 return (usb_alloc_intr_req(dip, len, flags));
402 void
403 usba10_usb_free_intr_req(usb_intr_req_t *reqp)
405 usb_free_intr_req(reqp);
410 usba10_usb_pipe_intr_xfer(
411 usb_pipe_handle_t pipe_handle,
412 usb_intr_req_t *req,
413 usb_flags_t flags)
415 return (usb_pipe_intr_xfer(pipe_handle, req, flags));
419 void
420 usba10_usb_pipe_stop_intr_polling(
421 usb_pipe_handle_t pipe_handle,
422 usb_flags_t flags)
424 usb_pipe_stop_intr_polling(pipe_handle, flags);
428 usb_isoc_req_t *
429 usba10_usb_alloc_isoc_req(
430 dev_info_t *dip,
431 uint_t isoc_pkts_count,
432 size_t len,
433 usb_flags_t flags)
435 return (usb_alloc_isoc_req(dip, isoc_pkts_count, len, flags));
439 void
440 usba10_usb_free_isoc_req(usb_isoc_req_t *usb_isoc_req)
442 usb_free_isoc_req(usb_isoc_req);
446 usb_frame_number_t
447 usba10_usb_get_current_frame_number(dev_info_t *dip)
449 return (usb_get_current_frame_number(dip));
453 uint_t
454 usba10_usb_get_max_isoc_pkts(dev_info_t *dip)
456 return (usb_get_max_isoc_pkts(dip));
461 usba10_usb_pipe_isoc_xfer(
462 usb_pipe_handle_t pipe_handle,
463 usb_isoc_req_t *reqp,
464 usb_flags_t flags)
466 return (usb_pipe_isoc_xfer(pipe_handle, reqp, flags));
470 void
471 usba10_usb_pipe_stop_isoc_polling(
472 usb_pipe_handle_t pipe_handle,
473 usb_flags_t flags)
475 usb_pipe_stop_isoc_polling(pipe_handle, flags);
480 usba10_usb_req_raise_power(
481 dev_info_t *dip,
482 int comp,
483 int level,
484 void (*cb)(void *arg, int rval),
485 void *arg,
486 usb_flags_t flags)
488 return (usb_req_raise_power(dip, comp, level, cb, arg, flags));
493 usba10_usb_req_lower_power(
494 dev_info_t *dip,
495 int comp,
496 int level,
497 void (*cb)(void *arg, int rval),
498 void *arg,
499 usb_flags_t flags)
501 return (usb_req_raise_power(dip, comp, level, cb, arg, flags));
506 usba10_usb_is_pm_enabled(dev_info_t *dip)
508 return (usb_is_pm_enabled(dip));
512 usba10_usb_handle_remote_wakeup(
513 dev_info_t *dip,
514 int cmd)
516 return (usb_handle_remote_wakeup(dip, cmd));
521 usba10_usb_create_pm_components(
522 dev_info_t *dip,
523 uint_t *pwrstates)
525 return (usb_create_pm_components(dip, pwrstates));
530 usba10_usb_set_device_pwrlvl0(dev_info_t *dip)
532 return (usb_set_device_pwrlvl0(dip));
537 usba10_usb_set_device_pwrlvl1(dev_info_t *dip)
539 return (usb_set_device_pwrlvl1(dip));
544 usba10_usb_set_device_pwrlvl2(dev_info_t *dip)
546 return (usb_set_device_pwrlvl2(dip));
551 usba10_usb_set_device_pwrlvl3(dev_info_t *dip)
553 return (usb_set_device_pwrlvl3(dip));
558 usba10_usb_async_req(
559 dev_info_t *dip,
560 void (*func)(void *),
561 void *arg,
562 usb_flags_t flag)
564 return (usb_async_req(dip, func, arg, flag));
569 usba10_usb_register_event_cbs(
570 dev_info_t *dip,
571 usb_event_t *usb_evt_data,
572 usb_flags_t flags)
574 return (usb_register_event_cbs(dip, usb_evt_data, flags));
578 void
579 usba10_usb_unregister_event_cbs(
580 dev_info_t *dip,
581 usb_event_t *usb_evt_data)
583 usb_unregister_event_cbs(dip, usb_evt_data);
587 void
588 usba10_usb_fail_checkpoint(
589 dev_info_t *dip,
590 usb_flags_t flags)
592 usb_fail_checkpoint(dip, flags);
597 usba10_usba_vlog(
598 usb_log_handle_t handle,
599 uint_t level,
600 uint_t mask,
601 char *fmt,
602 va_list ap)
604 return (usba_vlog(handle, level, mask, fmt, ap));
608 usb_log_handle_t
609 usba10_usb_alloc_log_handle(
610 dev_info_t *dip,
611 char *name,
612 uint_t *errlevel,
613 uint_t *mask,
614 uint_t *instance_filter,
615 uint_t show_label,
616 usb_flags_t flags)
618 return (usb_alloc_log_handle(
619 dip, name, errlevel, mask, instance_filter, show_label, flags));
623 void
624 usba10_usb_free_log_handle(usb_log_handle_t handle)
626 usb_free_log_handle(handle);
631 usba10_usb_log_descr_tree(
632 usb_client_dev_data_t *dev_data,
633 usb_log_handle_t log_handle,
634 uint_t level,
635 uint_t mask)
637 return (usb_log_descr_tree(dev_data, log_handle, level, mask));
642 usba10_usb_print_descr_tree(
643 dev_info_t *dip,
644 usb_client_dev_data_t *dev_data)
646 return (usb_print_descr_tree(dip, dev_data));
651 usba10_usb_check_same_device(
652 dev_info_t *dip,
653 usb_log_handle_t log_handle,
654 int log_level,
655 int log_mask,
656 uint_t check_mask,
657 char *device_string)
659 return (usb_check_same_device(
660 dip, log_handle, log_level, log_mask, check_mask, device_string));
664 const char *
665 usba10_usb_str_cr(usb_cr_t cr)
667 return (usb_str_cr(cr));
671 char *
672 usba10_usb_str_cb_flags(
673 usb_cb_flags_t cb_flags,
674 char *buffer,
675 size_t length)
677 return (usb_str_cb_flags(cb_flags, buffer, length));
681 const char *
682 usba10_usb_str_pipe_state(usb_pipe_state_t state)
684 return (usb_str_pipe_state(state));
688 const char *
689 usba10_usb_str_dev_state(int state)
691 return (usb_str_dev_state(state));
695 const char *
696 usba10_usb_str_rval(int rval)
698 return (usb_str_rval(rval));
703 usba10_usb_rval2errno(int rval)
705 return (usb_rval2errno(rval));
709 usb_serialization_t
710 usba10_usb_init_serialization(
711 dev_info_t *s_dip,
712 uint_t flag)
714 return (usb_init_serialization(s_dip, flag));
718 void
719 usba10_usb_fini_serialization(usb_serialization_t usb_serp)
721 usb_fini_serialization(usb_serp);
726 usba10_usb_serialize_access(
727 usb_serialization_t usb_serp,
728 uint_t how_to_wait,
729 uint_t delta_timeout)
731 return (usb_serialize_access(
732 usb_serp, how_to_wait, delta_timeout));
737 usba10_usb_try_serialize_access(
738 usb_serialization_t usb_serp,
739 uint_t flag)
741 return (usb_try_serialize_access(usb_serp, flag));
745 void
746 usba10_usb_release_access(usb_serialization_t usb_serp)
748 usb_release_access(usb_serp);
751 #endif