Diff for /src/sys/bus/usb/usb_quirks.c between versions 1.3 and 1.4

version 1.3, 2003/08/07 21:16:47 version 1.4, 2003/12/30 01:01:44
Line 1 Line 1
/*        $NetBSD: usb_quirks.c,v 1.26 2000/04/27 15:26:50 augustss Exp $ *//*
/*        $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.21.2.8 2003/02/12 14:05:57 sanpei Exp $  */ * $NetBSD: usb_quirks.c,v 1.26 2000/04/27 15:26:50 augustss Exp $
/*        $DragonFly$     */ * $NetBSD: usb_quirks.c,v 1.42 2003/01/02 04:19:00 imp Exp $
  * $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.34 2003/08/24 17:55:55 obrien Exp $
  * $DragonFly$
  */
   
 /*  /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.   * Copyright (c) 1998 The NetBSD Foundation, Inc.
Line 53  extern int usbdebug; Line 56  extern int usbdebug;
   
 #define ANY 0xffff  #define ANY 0xffff
   
Static struct usbd_quirk_entry {Static const struct usbd_quirk_entry {
         u_int16_t idVendor;          u_int16_t idVendor;
         u_int16_t idProduct;          u_int16_t idProduct;
         u_int16_t bcdDevice;          u_int16_t bcdDevice;
         struct usbd_quirks quirks;          struct usbd_quirks quirks;
 } usb_quirks[] = {  } usb_quirks[] = {
  { USB_VENDOR_KYE, USB_PRODUCT_KYE_NICHE,           0x100, { UQ_NO_SET_PROTO}},   { USB_VENDOR_KYE, USB_PRODUCT_KYE_NICHE,           0x100, { UQ_NO_SET_PROTO}},
 { USB_VENDOR_INSIDEOUT,USB_PRODUCT_INSIDEOUT_EDGEPORT4,  { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4,
                                                     0x094, { UQ_SWAP_UNICODE}},                                                      0x094, { UQ_SWAP_UNICODE}},
  { USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932,         0x100, { UQ_NO_STRINGS }},   { USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932,         0x100, { UQ_NO_STRINGS }},
  { USB_VENDOR_ADS, USB_PRODUCT_ADS_UBS10BT,         0x002, { UQ_NO_STRINGS }},   { USB_VENDOR_ADS, USB_PRODUCT_ADS_UBS10BT,         0x002, { UQ_NO_STRINGS }},
Line 76  Static struct usbd_quirk_entry { Line 79  Static struct usbd_quirk_entry {
  { USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232,          0x102, { UQ_BUS_POWERED }},   { USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232,          0x102, { UQ_BUS_POWERED }},
  { USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS,   { USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS,
         0x100, { UQ_ASSUME_CM_OVER_DATA | UQ_NO_STRINGS }},          0x100, { UQ_ASSUME_CM_OVER_DATA | UQ_NO_STRINGS }},
    { USB_VENDOR_SANYO, USB_PRODUCT_SANYO_SCP4900,
           0x000, { UQ_ASSUME_CM_OVER_DATA | UQ_NO_STRINGS }},
    { USB_VENDOR_TI, USB_PRODUCT_TI_UTUSB41,           0x110, { UQ_POWER_CLAIM }},
  { USB_VENDOR_ACERP, USB_PRODUCT_ACERP_ACERSCAN_320U,   { USB_VENDOR_ACERP, USB_PRODUCT_ACERP_ACERSCAN_320U,
                                                    0x000, { UQ_NO_STRINGS }},                                                    0x000, { UQ_NO_STRINGS }},
  { USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1,         0x009, { UQ_AU_NO_FRAC }},
  { USB_VENDOR_SILICONPORTALS, USB_PRODUCT_SILICONPORTALS_YAPPHONE,
                                                     0x100, { UQ_AU_INP_ASYNC }},
  { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND5010,    0x100, { UQ_NO_STRINGS }},
  /* XXX These should have a revision number, but I don't know what they are. */   /* XXX These should have a revision number, but I don't know what they are. */
  { USB_VENDOR_HP, USB_PRODUCT_HP_895C,              ANY,   { UQ_BROKEN_BIDIR }},   { USB_VENDOR_HP, USB_PRODUCT_HP_895C,              ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_880C,              ANY,   { UQ_BROKEN_BIDIR }},   { USB_VENDOR_HP, USB_PRODUCT_HP_880C,              ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_815C,              ANY,   { UQ_BROKEN_BIDIR }},   { USB_VENDOR_HP, USB_PRODUCT_HP_815C,              ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_810C,              ANY,   { UQ_BROKEN_BIDIR }},   { USB_VENDOR_HP, USB_PRODUCT_HP_810C,              ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_830C,              ANY,   { UQ_BROKEN_BIDIR }},   { USB_VENDOR_HP, USB_PRODUCT_HP_830C,              ANY,   { UQ_BROKEN_BIDIR }},
    { USB_VENDOR_HP, USB_PRODUCT_HP_1220C,             ANY,   { UQ_BROKEN_BIDIR }},
  /* YAMAHA router's ucdDevice is the version of farmware and often changes. */   /* YAMAHA router's ucdDevice is the version of farmware and often changes. */
  { USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_RTA54I,   { USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_RTA54I,
         ANY, { UQ_ASSUME_CM_OVER_DATA }},          ANY, { UQ_ASSUME_CM_OVER_DATA }},
Line 93  Static struct usbd_quirk_entry { Line 104  Static struct usbd_quirk_entry {
         ANY, { UQ_ASSUME_CM_OVER_DATA }},          ANY, { UQ_ASSUME_CM_OVER_DATA }},
  { USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_RTW65I,   { USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_RTW65I,
         ANY, { UQ_ASSUME_CM_OVER_DATA }},          ANY, { UQ_ASSUME_CM_OVER_DATA }},
    { USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_WMRPAD,  ANY, { UQ_NO_STRINGS }},
   
  { 0, 0, 0, { 0 } }   { 0, 0, 0, { 0 } }
 };  };
   
struct usbd_quirks usbd_no_quirk = { 0 };const struct usbd_quirks usbd_no_quirk = { 0 };
   
struct usbd_quirks *const struct usbd_quirks *
 usbd_find_quirk(usb_device_descriptor_t *d)  usbd_find_quirk(usb_device_descriptor_t *d)
 {  {
        struct usbd_quirk_entry *t;        const struct usbd_quirk_entry *t;
         u_int16_t vendor = UGETW(d->idVendor);
         u_int16_t product = UGETW(d->idProduct);
         u_int16_t revision = UGETW(d->bcdDevice);
   
         for (t = usb_quirks; t->idVendor != 0; t++) {          for (t = usb_quirks; t->idVendor != 0; t++) {
                if (t->idVendor  == UGETW(d->idVendor) &&                if (t->idVendor  == vendor &&
                    t->idProduct == UGETW(d->idProduct) &&                    t->idProduct == product &&
                    (t->bcdDevice == ANY || t->bcdDevice == UGETW(d->bcdDevice)))                    (t->bcdDevice == ANY || t->bcdDevice == revision))
                         break;                          break;
         }          }
 #ifdef USB_DEBUG  #ifdef USB_DEBUG
         if (usbdebug && t->quirks.uq_flags)          if (usbdebug && t->quirks.uq_flags)
                logprintf("usbd_find_quirk 0x%04x/0x%04x/%x: %d\n",                 logprintf("usbd_find_quirk 0x%04x/0x%04x/%x: %d\n",
                           UGETW(d->idVendor), UGETW(d->idProduct),                            UGETW(d->idVendor), UGETW(d->idProduct),
                           UGETW(d->bcdDevice), t->quirks.uq_flags);                            UGETW(d->bcdDevice), t->quirks.uq_flags);
 #endif  #endif

Removed from v.1.3  
changed lines
  Added in v.1.4