Home | History | Annotate | Line # | Download | only in usb
umass_quirks.c revision 1.8.2.10
      1  1.8.2.10  thorpej /*	$NetBSD: umass_quirks.c,v 1.8.2.10 2002/12/29 20:49:32 thorpej Exp $	*/
      2   1.8.2.2  nathanw 
      3   1.8.2.2  nathanw /*
      4   1.8.2.2  nathanw  * Copyright (c) 2001 The NetBSD Foundation, Inc.
      5   1.8.2.2  nathanw  * All rights reserved.
      6   1.8.2.2  nathanw  *
      7   1.8.2.2  nathanw  * This code is derived from software contributed to The NetBSD Foundation
      8   1.8.2.2  nathanw  * by MAEKAWA Masahide (gehenna (at) NetBSD.org).
      9   1.8.2.2  nathanw  *
     10   1.8.2.2  nathanw  * Redistribution and use in source and binary forms, with or without
     11   1.8.2.2  nathanw  * modification, are permitted provided that the following conditions
     12   1.8.2.2  nathanw  * are met:
     13   1.8.2.2  nathanw  * 1. Redistributions of source code must retain the above copyright
     14   1.8.2.2  nathanw  *    notice, this list of conditions and the following disclaimer.
     15   1.8.2.2  nathanw  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.8.2.2  nathanw  *    notice, this list of conditions and the following disclaimer in the
     17   1.8.2.2  nathanw  *    documentation and/or other materials provided with the distribution.
     18   1.8.2.2  nathanw  * 3. All advertising materials mentioning features or use of this software
     19   1.8.2.2  nathanw  *    must display the following acknowledgement:
     20   1.8.2.2  nathanw  *	  This product includes software developed by the NetBSD
     21   1.8.2.2  nathanw  *	  Foundation, Inc. and its contributors.
     22   1.8.2.2  nathanw  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23   1.8.2.2  nathanw  *    contributors may be used to endorse or promote products derived
     24   1.8.2.2  nathanw  *    from this software without specific prior written permission.
     25   1.8.2.2  nathanw  *
     26   1.8.2.2  nathanw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27   1.8.2.2  nathanw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28   1.8.2.2  nathanw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29   1.8.2.2  nathanw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30   1.8.2.2  nathanw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31   1.8.2.2  nathanw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32   1.8.2.2  nathanw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33   1.8.2.2  nathanw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34   1.8.2.2  nathanw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35   1.8.2.2  nathanw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36   1.8.2.2  nathanw  * POSSIBILITY OF SUCH DAMAGE.
     37   1.8.2.2  nathanw  */
     38   1.8.2.2  nathanw 
     39   1.8.2.2  nathanw #include <sys/param.h>
     40   1.8.2.2  nathanw #include <sys/systm.h>
     41   1.8.2.2  nathanw #include <sys/device.h>
     42   1.8.2.2  nathanw #include <sys/buf.h>
     43   1.8.2.2  nathanw 
     44   1.8.2.2  nathanw #include <dev/scsipi/scsipi_all.h> /* for scsiconf.h below */
     45   1.8.2.2  nathanw #include <dev/scsipi/scsiconf.h> /* for quirks defines */
     46   1.8.2.2  nathanw 
     47   1.8.2.2  nathanw #include <dev/usb/usb.h>
     48   1.8.2.2  nathanw #include <dev/usb/usbdi.h>
     49   1.8.2.2  nathanw #include <dev/usb/usbdevs.h>
     50   1.8.2.2  nathanw 
     51   1.8.2.2  nathanw #include <dev/usb/umassvar.h>
     52   1.8.2.2  nathanw #include <dev/usb/umass_quirks.h>
     53   1.8.2.2  nathanw 
     54   1.8.2.2  nathanw Static usbd_status umass_init_insystem(struct umass_softc *);
     55   1.8.2.2  nathanw Static usbd_status umass_init_shuttle(struct umass_softc *);
     56   1.8.2.2  nathanw 
     57   1.8.2.8  nathanw Static void umass_fixup_sony(struct umass_softc *);
     58   1.8.2.2  nathanw Static void umass_fixup_yedata(struct umass_softc *);
     59   1.8.2.2  nathanw 
     60   1.8.2.2  nathanw Static const struct umass_quirk umass_quirks[] = {
     61   1.8.2.7  nathanw 	{ { USB_VENDOR_ATI, USB_PRODUCT_ATI2_205 },
     62   1.8.2.7  nathanw 	  UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
     63   1.8.2.7  nathanw 	  0,
     64   1.8.2.7  nathanw 	  0,
     65   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
     66   1.8.2.7  nathanw 	  NULL, NULL
     67   1.8.2.7  nathanw 	},
     68   1.8.2.7  nathanw 
     69   1.8.2.7  nathanw 	{ { USB_VENDOR_DMI, USB_PRODUCT_DMI_SA2_0 },
     70   1.8.2.5  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
     71   1.8.2.7  nathanw 	  0,
     72   1.8.2.7  nathanw 	  PQUIRK_NOMODESENSE,
     73   1.8.2.5  nathanw 	  UMATCH_VENDOR_PRODUCT,
     74   1.8.2.5  nathanw 	  NULL, NULL
     75   1.8.2.5  nathanw 	},
     76   1.8.2.5  nathanw 
     77   1.8.2.9  thorpej 	{ { USB_VENDOR_EASYDISK, USB_PRODUCT_EASYDISK_EASYDISK },
     78   1.8.2.9  thorpej 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
     79   1.8.2.9  thorpej 	  0,
     80   1.8.2.9  thorpej 	  PQUIRK_NOMODESENSE,
     81   1.8.2.9  thorpej 	  UMATCH_VENDOR_PRODUCT,
     82   1.8.2.9  thorpej 	  NULL, NULL
     83   1.8.2.9  thorpej 	},
     84   1.8.2.9  thorpej 
     85   1.8.2.2  nathanw 	{ { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100 },
     86   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
     87   1.8.2.2  nathanw 	  UMASS_QUIRK_NO_START_STOP,
     88   1.8.2.2  nathanw 	  PQUIRK_NOTUR | PQUIRK_NOSENSE,
     89   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
     90   1.8.2.2  nathanw 	  NULL, NULL
     91   1.8.2.2  nathanw 	},
     92   1.8.2.2  nathanw 
     93   1.8.2.7  nathanw 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ADAPTERV2 },
     94   1.8.2.7  nathanw 	  UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
     95   1.8.2.7  nathanw 	  0,
     96   1.8.2.7  nathanw 	  0,
     97   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
     98   1.8.2.7  nathanw 	  NULL, NULL
     99   1.8.2.7  nathanw 	},
    100   1.8.2.7  nathanw 
    101   1.8.2.7  nathanw 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ATAPI },
    102   1.8.2.7  nathanw 	  UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
    103   1.8.2.7  nathanw 	  0,
    104   1.8.2.7  nathanw 	  0,
    105   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    106   1.8.2.7  nathanw 	  NULL, NULL
    107   1.8.2.7  nathanw 	},
    108   1.8.2.7  nathanw 
    109   1.8.2.7  nathanw 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_DRIVEV2_5 },
    110   1.8.2.7  nathanw 	  UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
    111   1.8.2.7  nathanw 	  0,
    112   1.8.2.7  nathanw 	  0,
    113   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    114   1.8.2.7  nathanw 	  NULL, NULL
    115   1.8.2.7  nathanw 	},
    116   1.8.2.7  nathanw 
    117   1.8.2.7  nathanw 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_IDEUSB2 },
    118   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    119   1.8.2.7  nathanw 	  0,
    120   1.8.2.7  nathanw 	  PQUIRK_NOMODESENSE,
    121   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    122   1.8.2.7  nathanw 	  NULL, NULL
    123   1.8.2.7  nathanw 	},
    124   1.8.2.7  nathanw 
    125   1.8.2.2  nathanw 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE },
    126   1.8.2.2  nathanw 	  UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
    127   1.8.2.2  nathanw 	  UMASS_QUIRK_NO_START_STOP,
    128   1.8.2.2  nathanw 	  PQUIRK_NOTUR,
    129   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    130   1.8.2.2  nathanw 	  umass_init_insystem, NULL
    131   1.8.2.2  nathanw 	},
    132   1.8.2.2  nathanw 
    133   1.8.2.2  nathanw 	{ { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100 },
    134   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    135   1.8.2.2  nathanw 	  0,
    136   1.8.2.2  nathanw 	  PQUIRK_NOTUR,
    137   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    138   1.8.2.2  nathanw 	  NULL, NULL
    139   1.8.2.2  nathanw 	},
    140   1.8.2.2  nathanw 
    141   1.8.2.2  nathanw 	{ { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP250 },
    142   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    143   1.8.2.2  nathanw 	  0,
    144   1.8.2.2  nathanw 	  PQUIRK_NOTUR,
    145   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    146   1.8.2.2  nathanw 	  NULL, NULL
    147   1.8.2.2  nathanw 	},
    148   1.8.2.2  nathanw 
    149   1.8.2.2  nathanw 	{ { USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM },
    150   1.8.2.2  nathanw 	  UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
    151   1.8.2.2  nathanw 	  0,
    152   1.8.2.2  nathanw 	  0,
    153   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    154   1.8.2.2  nathanw 	  NULL, NULL
    155   1.8.2.2  nathanw 	},
    156   1.8.2.2  nathanw 
    157   1.8.2.7  nathanw 	{ { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_S304 },
    158   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    159   1.8.2.7  nathanw 	  UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
    160   1.8.2.7  nathanw 	  0,
    161   1.8.2.7  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    162   1.8.2.7  nathanw 	  NULL, NULL
    163   1.8.2.7  nathanw 	},
    164   1.8.2.7  nathanw 
    165   1.8.2.7  nathanw 	{ { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_X },
    166   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    167   1.8.2.7  nathanw 	  UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
    168   1.8.2.7  nathanw 	  0,
    169   1.8.2.7  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    170   1.8.2.7  nathanw 	  NULL, NULL
    171   1.8.2.7  nathanw 	},
    172   1.8.2.7  nathanw 
    173   1.8.2.2  nathanw 	{ { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY },
    174   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    175   1.8.2.6  nathanw 	  UMASS_QUIRK_NO_MAX_LUN,
    176   1.8.2.2  nathanw 	  PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK | PQUIRK_NOBIGMODESENSE,
    177   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    178   1.8.2.2  nathanw 	  NULL, NULL
    179   1.8.2.2  nathanw 	},
    180   1.8.2.2  nathanw 
    181   1.8.2.7  nathanw 	{ { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND5010 },
    182   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    183   1.8.2.7  nathanw 	  0,
    184   1.8.2.7  nathanw 	  PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
    185   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    186   1.8.2.7  nathanw 	  NULL, NULL
    187   1.8.2.7  nathanw 	},
    188   1.8.2.7  nathanw 
    189   1.8.2.2  nathanw 	{ { USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1 },
    190   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    191   1.8.2.2  nathanw 	  UMASS_QUIRK_WRONG_CSWSIG,
    192   1.8.2.2  nathanw 	  0,
    193   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    194   1.8.2.2  nathanw 	  NULL, NULL
    195   1.8.2.2  nathanw 	},
    196   1.8.2.2  nathanw 
    197   1.8.2.7  nathanw 	{ { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD1II },
    198   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    199   1.8.2.7  nathanw 	  UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
    200   1.8.2.7  nathanw 	  PQUIRK_NOMODESENSE,
    201   1.8.2.7  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    202   1.8.2.7  nathanw 	  NULL, NULL
    203   1.8.2.7  nathanw 	},
    204   1.8.2.7  nathanw 
    205   1.8.2.3  nathanw 	{ { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD2 },
    206   1.8.2.3  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    207   1.8.2.3  nathanw 	  0,
    208   1.8.2.3  nathanw 	  PQUIRK_NOMODESENSE,
    209   1.8.2.3  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    210   1.8.2.3  nathanw 	  NULL, NULL
    211   1.8.2.3  nathanw 	},
    212   1.8.2.3  nathanw 
    213   1.8.2.9  thorpej 	{ { USB_VENDOR_OTI, USB_PRODUCT_OTI_SOLID },
    214   1.8.2.9  thorpej 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    215   1.8.2.9  thorpej 	  0,
    216   1.8.2.9  thorpej 	  PQUIRK_NOMODESENSE,
    217   1.8.2.9  thorpej 	  UMATCH_VENDOR_PRODUCT,
    218   1.8.2.9  thorpej 	  NULL, NULL
    219   1.8.2.9  thorpej 	},
    220   1.8.2.9  thorpej 
    221   1.8.2.7  nathanw 	{ { USB_VENDOR_PEN, USB_PRODUCT_PEN_USBDISK },
    222   1.8.2.3  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    223   1.8.2.3  nathanw 	  UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
    224   1.8.2.7  nathanw 	  0,
    225   1.8.2.3  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    226   1.8.2.3  nathanw 	  NULL, NULL
    227   1.8.2.3  nathanw 	},
    228   1.8.2.3  nathanw 
    229   1.8.2.7  nathanw 	{ { USB_VENDOR_PQI, USB_PRODUCT_PQI_TRAVELFLASH },
    230   1.8.2.7  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    231   1.8.2.7  nathanw 	  0,
    232   1.8.2.7  nathanw 	  PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK,
    233   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    234   1.8.2.7  nathanw 	  NULL, NULL
    235   1.8.2.7  nathanw 	},
    236   1.8.2.7  nathanw 
    237   1.8.2.2  nathanw 	{ { USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R },
    238   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
    239   1.8.2.9  thorpej 	  UMASS_QUIRK_WRONG_CSWTAG,
    240   1.8.2.2  nathanw 	  0,
    241   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    242   1.8.2.2  nathanw 	  NULL, NULL
    243   1.8.2.2  nathanw 	},
    244   1.8.2.2  nathanw 
    245   1.8.2.2  nathanw 	{ { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB },
    246   1.8.2.2  nathanw 	  UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
    247   1.8.2.2  nathanw 	  UMASS_QUIRK_NO_START_STOP,
    248   1.8.2.2  nathanw 	  PQUIRK_NOTUR,
    249   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    250   1.8.2.2  nathanw 	  umass_init_shuttle, NULL
    251   1.8.2.2  nathanw 	},
    252   1.8.2.2  nathanw 
    253   1.8.2.2  nathanw 	{ { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_ZIOMMC },
    254   1.8.2.2  nathanw 	  UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
    255   1.8.2.2  nathanw 	  UMASS_QUIRK_NO_START_STOP,
    256   1.8.2.2  nathanw 	  PQUIRK_NOTUR,
    257   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    258   1.8.2.2  nathanw 	  NULL, NULL
    259   1.8.2.2  nathanw 	},
    260   1.8.2.2  nathanw 
    261  1.8.2.10  thorpej 	{ { USB_VENDOR_SIIG, USB_PRODUCT_SIIG_MULTICARDREADER },
    262  1.8.2.10  thorpej 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    263  1.8.2.10  thorpej 	  UMASS_QUIRK_NO_START_STOP,
    264  1.8.2.10  thorpej 	  0,
    265  1.8.2.10  thorpej 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    266  1.8.2.10  thorpej 	  NULL,NULL
    267  1.8.2.10  thorpej 	},
    268  1.8.2.10  thorpej 
    269   1.8.2.7  nathanw 	{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_DRIVEV2 },
    270   1.8.2.7  nathanw 	  UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
    271   1.8.2.7  nathanw 	  0,
    272   1.8.2.7  nathanw 	  0,
    273   1.8.2.7  nathanw 	  UMATCH_VENDOR_PRODUCT,
    274   1.8.2.7  nathanw 	  NULL, NULL
    275   1.8.2.7  nathanw 	},
    276   1.8.2.7  nathanw 
    277   1.8.2.8  nathanw 	{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC },
    278   1.8.2.8  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    279   1.8.2.8  nathanw 	  0,
    280   1.8.2.8  nathanw 	  0,
    281   1.8.2.8  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    282   1.8.2.8  nathanw 	  NULL, umass_fixup_sony
    283   1.8.2.8  nathanw 	},
    284   1.8.2.8  nathanw 
    285   1.8.2.2  nathanw 	{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC },
    286   1.8.2.4  nathanw 	  UMASS_WPROTO_CBI, UMASS_CPROTO_UFI,
    287   1.8.2.4  nathanw 	  UMASS_QUIRK_FORCE_SHORT_INQUIRY | UMASS_QUIRK_RS_NO_CLEAR_UA,
    288   1.8.2.4  nathanw 	  PQUIRK_NOMODESENSE,
    289   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    290   1.8.2.4  nathanw 	  NULL, NULL
    291   1.8.2.2  nathanw 	},
    292   1.8.2.2  nathanw 
    293   1.8.2.2  nathanw 	{ { USB_VENDOR_TEAC, USB_PRODUCT_TEAC_FD05PUB },
    294   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
    295   1.8.2.2  nathanw 	  0,
    296   1.8.2.2  nathanw 	  PQUIRK_NOMODESENSE,
    297   1.8.2.2  nathanw 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
    298   1.8.2.2  nathanw 	  NULL, NULL
    299   1.8.2.2  nathanw 	},
    300   1.8.2.2  nathanw 
    301   1.8.2.5  nathanw 	{ { USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_XXX1100 },
    302   1.8.2.5  nathanw 	  UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
    303   1.8.2.5  nathanw 	  0,
    304   1.8.2.5  nathanw 	  0,
    305   1.8.2.5  nathanw 	  UMATCH_VENDOR_PRODUCT,
    306   1.8.2.5  nathanw 	  NULL, NULL
    307   1.8.2.5  nathanw 	},
    308   1.8.2.5  nathanw 
    309   1.8.2.2  nathanw 	{ { USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO },
    310   1.8.2.2  nathanw 	  UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
    311   1.8.2.2  nathanw 	  UMASS_QUIRK_FORCE_SHORT_INQUIRY,
    312   1.8.2.2  nathanw 	  0,
    313   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT,
    314   1.8.2.2  nathanw 	  NULL, NULL
    315   1.8.2.2  nathanw 	},
    316   1.8.2.2  nathanw 
    317   1.8.2.2  nathanw 	{ { USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU },
    318   1.8.2.2  nathanw 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
    319   1.8.2.2  nathanw 	  UMASS_QUIRK_RS_NO_CLEAR_UA,
    320   1.8.2.2  nathanw 	  PQUIRK_NOMODESENSE,
    321   1.8.2.2  nathanw 	  UMATCH_VENDOR_PRODUCT_REV,
    322   1.8.2.2  nathanw 	  NULL, umass_fixup_yedata
    323   1.8.2.2  nathanw 	},
    324   1.8.2.2  nathanw };
    325   1.8.2.2  nathanw 
    326   1.8.2.2  nathanw const struct umass_quirk *
    327   1.8.2.2  nathanw umass_lookup(u_int16_t vendor, u_int16_t product)
    328   1.8.2.2  nathanw {
    329   1.8.2.2  nathanw 	return ((const struct umass_quirk *)
    330   1.8.2.2  nathanw 		usb_lookup(umass_quirks, vendor, product));
    331   1.8.2.2  nathanw }
    332   1.8.2.2  nathanw 
    333   1.8.2.2  nathanw Static usbd_status
    334   1.8.2.2  nathanw umass_init_insystem(struct umass_softc *sc)
    335   1.8.2.2  nathanw {
    336   1.8.2.2  nathanw 	usbd_status err;
    337   1.8.2.2  nathanw 
    338   1.8.2.2  nathanw 	err = usbd_set_interface(sc->sc_iface, 1);
    339   1.8.2.2  nathanw 	if (err) {
    340   1.8.2.2  nathanw 		DPRINTF(UDMASS_USB,
    341   1.8.2.2  nathanw 			("%s: could not switch to Alt Interface 1\n",
    342   1.8.2.2  nathanw 			USBDEVNAME(sc->sc_dev)));
    343   1.8.2.2  nathanw 		return (err);
    344   1.8.2.2  nathanw 	}
    345   1.8.2.2  nathanw 
    346   1.8.2.2  nathanw 	return (USBD_NORMAL_COMPLETION);
    347   1.8.2.2  nathanw }
    348   1.8.2.2  nathanw 
    349   1.8.2.2  nathanw Static usbd_status
    350   1.8.2.2  nathanw umass_init_shuttle(struct umass_softc *sc)
    351   1.8.2.2  nathanw {
    352   1.8.2.2  nathanw 	usb_device_request_t req;
    353   1.8.2.2  nathanw 	u_int8_t status[2];
    354   1.8.2.2  nathanw 
    355   1.8.2.2  nathanw 	/* The Linux driver does this */
    356   1.8.2.2  nathanw 	req.bmRequestType = UT_READ_VENDOR_DEVICE;
    357   1.8.2.2  nathanw 	req.bRequest = 1;
    358   1.8.2.2  nathanw 	USETW(req.wValue, 0);
    359   1.8.2.2  nathanw 	USETW(req.wIndex, sc->sc_ifaceno);
    360   1.8.2.2  nathanw 	USETW(req.wLength, sizeof(status));
    361   1.8.2.2  nathanw 
    362   1.8.2.2  nathanw 	return (usbd_do_request(sc->sc_udev, &req, &status));
    363   1.8.2.2  nathanw }
    364   1.8.2.2  nathanw 
    365   1.8.2.2  nathanw Static void
    366   1.8.2.8  nathanw umass_fixup_sony(struct umass_softc *sc)
    367   1.8.2.8  nathanw {
    368   1.8.2.8  nathanw 	usb_interface_descriptor_t *id;
    369   1.8.2.8  nathanw 
    370   1.8.2.8  nathanw 	id = usbd_get_interface_descriptor(sc->sc_iface);
    371   1.8.2.8  nathanw 	if (id->bInterfaceSubClass == 0xff) {
    372   1.8.2.8  nathanw 		sc->sc_cmd = UMASS_CPROTO_RBC;
    373   1.8.2.8  nathanw 	}
    374   1.8.2.8  nathanw }
    375   1.8.2.8  nathanw 
    376   1.8.2.8  nathanw Static void
    377   1.8.2.2  nathanw umass_fixup_yedata(struct umass_softc *sc)
    378   1.8.2.2  nathanw {
    379   1.8.2.2  nathanw 	usb_device_descriptor_t *dd;
    380   1.8.2.2  nathanw 
    381   1.8.2.2  nathanw 	dd = usbd_get_device_descriptor(sc->sc_udev);
    382   1.8.2.2  nathanw 
    383   1.8.2.2  nathanw 	/*
    384   1.8.2.2  nathanw 	 * Revisions < 1.28 do not handle the interrupt endpoint very well.
    385   1.8.2.2  nathanw 	 */
    386   1.8.2.2  nathanw 	if (UGETW(dd->bcdDevice) < 0x128)
    387   1.8.2.2  nathanw 		sc->sc_wire = UMASS_WPROTO_CBI;
    388   1.8.2.2  nathanw 	else
    389   1.8.2.2  nathanw 		sc->sc_wire = UMASS_WPROTO_CBI_I;
    390   1.8.2.2  nathanw 
    391   1.8.2.2  nathanw 	/*
    392   1.8.2.2  nathanw 	 * Revisions < 1.28 do not have the TEST UNIT READY command
    393   1.8.2.2  nathanw 	 * Revisions == 1.28 have a broken TEST UNIT READY
    394   1.8.2.2  nathanw 	 */
    395   1.8.2.2  nathanw 	if (UGETW(dd->bcdDevice) <= 0x128)
    396   1.8.2.2  nathanw 		sc->sc_busquirks |= PQUIRK_NOTUR;
    397   1.8.2.2  nathanw }
    398