1*5deafb75Saaron /* $OpenBSD: usbdi_util.h,v 1.5 2000/03/28 19:37:53 aaron Exp $ */ 2eff3e1aaSaaron /* $NetBSD: usbdi_util.h,v 1.19 1999/11/18 23:32:37 augustss Exp $ */ 3*5deafb75Saaron /* $FreeBSD: src/sys/dev/usb/usbdi_util.h,v 1.9 1999/11/17 22:33:50 n_hibma Exp $ */ 412fe8f0eSfgsch 512fe8f0eSfgsch /* 612fe8f0eSfgsch * Copyright (c) 1998 The NetBSD Foundation, Inc. 712fe8f0eSfgsch * All rights reserved. 812fe8f0eSfgsch * 912fe8f0eSfgsch * This code is derived from software contributed to The NetBSD Foundation 1012fe8f0eSfgsch * by Lennart Augustsson (augustss@carlstedt.se) at 1112fe8f0eSfgsch * Carlstedt Research & Technology. 1212fe8f0eSfgsch * 1312fe8f0eSfgsch * Redistribution and use in source and binary forms, with or without 1412fe8f0eSfgsch * modification, are permitted provided that the following conditions 1512fe8f0eSfgsch * are met: 1612fe8f0eSfgsch * 1. Redistributions of source code must retain the above copyright 1712fe8f0eSfgsch * notice, this list of conditions and the following disclaimer. 1812fe8f0eSfgsch * 2. Redistributions in binary form must reproduce the above copyright 1912fe8f0eSfgsch * notice, this list of conditions and the following disclaimer in the 2012fe8f0eSfgsch * documentation and/or other materials provided with the distribution. 2112fe8f0eSfgsch * 3. All advertising materials mentioning features or use of this software 2212fe8f0eSfgsch * must display the following acknowledgement: 2312fe8f0eSfgsch * This product includes software developed by the NetBSD 2412fe8f0eSfgsch * Foundation, Inc. and its contributors. 2512fe8f0eSfgsch * 4. Neither the name of The NetBSD Foundation nor the names of its 2612fe8f0eSfgsch * contributors may be used to endorse or promote products derived 2712fe8f0eSfgsch * from this software without specific prior written permission. 2812fe8f0eSfgsch * 2912fe8f0eSfgsch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 3012fe8f0eSfgsch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 3112fe8f0eSfgsch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 3212fe8f0eSfgsch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 3312fe8f0eSfgsch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 3412fe8f0eSfgsch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 3512fe8f0eSfgsch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 3612fe8f0eSfgsch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3712fe8f0eSfgsch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3812fe8f0eSfgsch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3912fe8f0eSfgsch * POSSIBILITY OF SUCH DAMAGE. 4012fe8f0eSfgsch */ 4112fe8f0eSfgsch 4212fe8f0eSfgsch usbd_status usbd_get_desc __P((usbd_device_handle dev, int type, 4312fe8f0eSfgsch int index, int len, void *desc)); 4412fe8f0eSfgsch usbd_status usbd_get_config_desc __P((usbd_device_handle, int, 4512fe8f0eSfgsch usb_config_descriptor_t *)); 4612fe8f0eSfgsch usbd_status usbd_get_config_desc_full __P((usbd_device_handle, int, 4712fe8f0eSfgsch void *, int)); 4812fe8f0eSfgsch usbd_status usbd_get_device_desc __P((usbd_device_handle dev, 4912fe8f0eSfgsch usb_device_descriptor_t *d)); 5012fe8f0eSfgsch usbd_status usbd_set_address __P((usbd_device_handle dev, int addr)); 5112fe8f0eSfgsch usbd_status usbd_get_port_status __P((usbd_device_handle, 5212fe8f0eSfgsch int, usb_port_status_t *)); 5312fe8f0eSfgsch usbd_status usbd_set_hub_feature __P((usbd_device_handle dev, int)); 5412fe8f0eSfgsch usbd_status usbd_clear_hub_feature __P((usbd_device_handle, int)); 5512fe8f0eSfgsch usbd_status usbd_set_port_feature __P((usbd_device_handle dev, int, int)); 5612fe8f0eSfgsch usbd_status usbd_clear_port_feature __P((usbd_device_handle, int, int)); 5712fe8f0eSfgsch usbd_status usbd_get_device_status __P((usbd_device_handle,usb_status_t*)); 5812fe8f0eSfgsch usbd_status usbd_get_hub_status __P((usbd_device_handle dev, 5912fe8f0eSfgsch usb_hub_status_t *st)); 6012fe8f0eSfgsch usbd_status usbd_set_protocol __P((usbd_interface_handle dev, int report)); 6112fe8f0eSfgsch usbd_status usbd_get_report_descriptor 6212fe8f0eSfgsch __P((usbd_device_handle dev, int ifcno, int repid, int size, void *d)); 6312fe8f0eSfgsch struct usb_hid_descriptor *usbd_get_hid_descriptor 6412fe8f0eSfgsch __P((usbd_interface_handle ifc)); 6512fe8f0eSfgsch usbd_status usbd_set_report 6612fe8f0eSfgsch __P((usbd_interface_handle iface,int type,int id,void *data,int len)); 6712fe8f0eSfgsch usbd_status usbd_set_report_async 6812fe8f0eSfgsch __P((usbd_interface_handle iface,int type,int id,void *data,int len)); 6912fe8f0eSfgsch usbd_status usbd_get_report 7012fe8f0eSfgsch __P((usbd_interface_handle iface,int type,int id,void *data,int len)); 7112fe8f0eSfgsch usbd_status usbd_set_idle 7212fe8f0eSfgsch __P((usbd_interface_handle iface, int duration, int id)); 7312fe8f0eSfgsch #if defined(__NetBSD__) || defined(__OpenBSD__) 7412fe8f0eSfgsch usbd_status usbd_alloc_report_desc 7512fe8f0eSfgsch __P((usbd_interface_handle ifc, void **descp, int *sizep, int mem)); 7612fe8f0eSfgsch #elif defined(__FreeBSD__) 7712fe8f0eSfgsch usbd_status usbd_alloc_report_desc 7812fe8f0eSfgsch __P((usbd_interface_handle ifc, void **descp, int *sizep, struct malloc_type * mem)); 7912fe8f0eSfgsch #endif 8012fe8f0eSfgsch usbd_status usbd_get_config 8112fe8f0eSfgsch __P((usbd_device_handle dev, u_int8_t *conf)); 8212fe8f0eSfgsch usbd_status usbd_get_string_desc 8312fe8f0eSfgsch __P((usbd_device_handle dev, int sindex, int langid, 8412fe8f0eSfgsch usb_string_descriptor_t *sdesc)); 8512fe8f0eSfgsch void usbd_delay_ms __P((usbd_device_handle, u_int)); 8612fe8f0eSfgsch 8712fe8f0eSfgsch 8812fe8f0eSfgsch usbd_status usbd_set_config_no 8912fe8f0eSfgsch __P((usbd_device_handle dev, int no, int msg)); 9012fe8f0eSfgsch usbd_status usbd_set_config_index 9112fe8f0eSfgsch __P((usbd_device_handle dev, int index, int msg)); 9212fe8f0eSfgsch 9312fe8f0eSfgsch usbd_status usbd_bulk_transfer 94eff3e1aaSaaron __P((usbd_xfer_handle xfer, usbd_pipe_handle pipe, u_int16_t flags, 95f8958cb1Sfgsch u_int32_t timeout, void *buf, u_int32_t *size, char *lbl)); 9612fe8f0eSfgsch 97ce4d7038Sfgsch void usb_detach_wait __P((device_ptr_t)); 98ce4d7038Sfgsch void usb_detach_wakeup __P((device_ptr_t)); 9912fe8f0eSfgsch 100