1223534Shselasky/* $FreeBSD$ */ 2223534Shselasky 3223534Shselasky/*- 4223534Shselasky * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. 5223534Shselasky * 6223534Shselasky * Redistribution and use in source and binary forms, with or without 7223534Shselasky * modification, are permitted provided that the following conditions 8223534Shselasky * are met: 9223534Shselasky * 1. Redistributions of source code must retain the above copyright 10223534Shselasky * notice, this list of conditions and the following disclaimer. 11223534Shselasky * 2. Redistributions in binary form must reproduce the above copyright 12223534Shselasky * notice, this list of conditions and the following disclaimer in the 13223534Shselasky * documentation and/or other materials provided with the distribution. 14223534Shselasky * 15223534Shselasky * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16223534Shselasky * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17223534Shselasky * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18223534Shselasky * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19223534Shselasky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20223534Shselasky * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21223534Shselasky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22223534Shselasky * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23223534Shselasky * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24223534Shselasky * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25223534Shselasky * SUCH DAMAGE. 26223534Shselasky */ 27223534Shselasky 28223534Shselasky#ifndef _BUS_USB_H_ 29223534Shselasky#define _BUS_USB_H_ 30223534Shselasky 31223534Shselaskystruct usb_device_id { 32223534Shselasky 33223534Shselasky /* Internal fields */ 34223534Shselasky char module_name[32]; 35223534Shselasky char module_mode[32]; 36223534Shselasky uint8_t is_iface; 37223534Shselasky uint8_t is_vp; 38223534Shselasky uint8_t is_dev; 39223534Shselasky uint8_t is_any; 40223534Shselasky 41223534Shselasky /* Used for product specific matches; the BCD range is inclusive */ 42223534Shselasky uint16_t idVendor; 43223534Shselasky uint16_t idProduct; 44223534Shselasky uint16_t bcdDevice_lo; 45223534Shselasky uint16_t bcdDevice_hi; 46223534Shselasky 47223534Shselasky /* Used for device class matches */ 48223534Shselasky uint8_t bDeviceClass; 49223534Shselasky uint8_t bDeviceSubClass; 50223534Shselasky uint8_t bDeviceProtocol; 51223534Shselasky 52223534Shselasky /* Used for interface class matches */ 53223534Shselasky uint8_t bInterfaceClass; 54223534Shselasky uint8_t bInterfaceSubClass; 55223534Shselasky uint8_t bInterfaceProtocol; 56223534Shselasky 57223534Shselasky /* Select which fields to match against */ 58223534Shselasky uint8_t match_flag_vendor:1; 59223534Shselasky uint8_t match_flag_product:1; 60223534Shselasky uint8_t match_flag_dev_lo:1; 61223534Shselasky uint8_t match_flag_dev_hi:1; 62223534Shselasky uint8_t match_flag_dev_class:1; 63223534Shselasky uint8_t match_flag_dev_subclass:1; 64223534Shselasky uint8_t match_flag_dev_protocol:1; 65223534Shselasky uint8_t match_flag_int_class:1; 66223534Shselasky uint8_t match_flag_int_subclass:1; 67223534Shselasky uint8_t match_flag_int_protocol:1; 68223534Shselasky}; 69223534Shselasky 70223534Shselaskyvoid usb_import_entries(const char *, const char *, const uint8_t *, uint32_t); 71223534Shselaskyvoid usb_dump_entries(void); 72223534Shselasky 73223534Shselasky#endif /* _BUS_USB_H_ */ 74