Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2001 17:39:31 -0500
From:      Jim Bryant <kc5vdj@yahoo.com>
To:        kc5vdj@yahoo.com
Cc:        freebsd-scsi@freebsd.org, Phil Knaack <pknaack1@netscape.net>
Subject:   Re: Microtech USB CameraMate patches: update!
Message-ID:  <3B7EEEA3.5030507@yahoo.com>
References:  <3B7C4B47.7010701@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
okay, I screwed up on the scsi_da.patch, and was half right about the include files.

 From the file Makefile.usbdevs, I read:

------------
# The files usbdevs.h and usbdevs_data.h are generated from usbdevs
#
# $FreeBSD: src/sys/dev/usb/Makefile.usbdevs,v 1.2 2000/03/15 22:13:50 n_hibma Exp $

AWK=    awk
UNAME=  uname
RM=     rm

# The targets are always remade.

.PHONY= all

all:    usbdevs devlist2h.awk
         /bin/rm -f usbdevs.h usbdevs_data.h
         ${AWK} -v type=USB -v os=`${UNAME} -s` -f devlist2h.awk usbdevs
------------

In both of the header files, I read that they are automagically generated from the rather elegant awk script.

The problem being that mine had not been regenerated since early-mid June or July [sorry I forgot to write down the date]...

A make of the kernel, with ONLY usbdevs changed DID NOT update these include files, and this makefile had to be run by hand, which 
DID properly generate the include files from usbdevs.

I know this is probably not the -list for this part of this, but since it's all related....

The patches I posted for usbdevs, and umass.c are correct.  The scsi_da.c one is correct, but as I was playing with them to get them 
to patch -current, the line numbers were off, and thus patch tended to dump core rather nastily.

Here is the correct patch for scsi_da.c:

-------------------------------------------------------------------------------------------------
*** scsi_da.c~  Fri Jul 20 04:20:43 2001
--- scsi_da.c   Sat Aug 18 07:32:59 2001
***************
*** 211,216 ****
--- 211,223 ----

         /* Below a list of quirks for USB devices supported by umass. */
         {
+                 /* the Microtech USB CameraMate does not like
+                  * the sync-cache command, or READ_6.
+                  */
+                 {T_DIRECT, SIP_MEDIA_REMOVABLE, "eUSB    Compact*", "Compact Flash*", "*"},
+                 /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
+         },
+         {
                 /*
                  * This USB floppy drive uses the UFI command set. This
                  * command set is a derivative of the ATAPI command set and
--------------------------------------------------------------------------------------------------

Note that the only change is the line numbers.

Jim Bryant wrote:

> I have received, and tested the following patches to usbdevs, umass.c, 
> and scsi_da.c from Phil Knaack.
> 
> These patches do work, and I would like to submit them in Phil's name 
> [please use Phil's name, as all I have done is test the patches he made] 
> to be committed to -current, and if someone can test them in -stable, 
> that too.  I can only vouch for these patches under -current, but I 
> don't see any reason they shouldn't work in -stable.
> 
> BTW: Phil, the patches to usbdevs.h and usbdevs_data.h are not needed, 
> as those get generated automagically from usbdevs at compile-time.
> 
> I also have a question.  How do I make this da1 instead of da0, assuming 
> it's attached all the time?  I understand how to wire down SCSI devices 
> under normal conditions, but not using umass...  Would just wiring down 
> da0 to ahc1:0:0 suffice, or would I have to deal with the umass driver 
> as well, since it seems to preceed ahc in the probe sequence?
> 
> /usr/src/sys/dev/usb/usbdevs:
> -----------------------------------------------------------------------
> *** usbdevs~    Wed Jul 11 04:08:49 2001
> --- usbdevs     Thu Aug 16 15:47:47 2001
> ***************
> *** 923,928 ****
> --- 923,931 ----
>   /* Trek Technology products */
>   product TREK THUMBDRIVE               0x1111  ThumbDrive
> 
> + /* Microtech products */
> + product MICROTECH CAMERAMATE    0x0006  DPCM_USB CameraMate
> +
>   /* UMAX products */
>   product UMAX ASTRA1236U               0x0002  Astra 1236U Scanner
>   product UMAX ASTRA1220U               0x0010  Astra 1220U Scanner
> -----------------------------------------------------------------------
> 
> 
> /usr/src/sys/dev/usb/umass.c:
> -----------------------------------------------------------------------
> *** umass.c~    Thu Aug 16 15:43:08 2001
> --- umass.c     Thu Aug 16 15:45:43 2001
> ***************
> *** 608,613 ****
> --- 608,622 ----
>         }
>   #endif
> 
> +         if (UGETW(dd->idVendor) == USB_VENDOR_MICROTECH
> +            && UGETW(dd->idProduct) == USB_PRODUCT_MICROTECH_CAMERAMATE) {
> +                 /* the cameramate does not provide valid
> +                    class/subclass information. fake it. */
> +                 sc->proto = PROTO_SCSI | PROTO_CBI;
> +                 sc->quirks |= NO_TEST_UNIT_READY | NO_START_STOP;
> +                 return(UMATCH_VENDOR_PRODUCT);
> +         }
> +
>         if (UGETW(dd->idVendor) == USB_VENDOR_YEDATA
>             && UGETW(dd->idProduct) == USB_PRODUCT_YEDATA_FLASHBUSTERU) {
> -----------------------------------------------------------------------
> 
> 
> /usr/src/sys/cam/scsi/scsi_da.c:
> -----------------------------------------------------------------------
> *** scsi_da.c~  Fri Jul 20 04:20:43 2001
> --- scsi_da.c   Thu Aug 16 15:54:41 2001
> ***************
> *** 211,216 ****
> --- 211,224 ----
> 
>         /* Below a list of quirks for USB devices supported by umass. */
>         {
> +                /* the Microtech USB CameraMate does not like
> +                 * the sync-cache command, or READ_6.
> +                 */
> +                {T_DIRECT, SIP_MEDIA_REMOVABLE, "eUSB    Compact*", 
> "Compact Flash*", "*"},
> +                /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
> +        },
> +        {
>                 /*
>                  * This USB floppy drive uses the UFI command set. This
>                  * command set is a derivative of the ATAPI command set and
> -----------------------------------------------------------------------
> 
> umass0: Microtech International, Inc DPCM-USB, rev 1.00/1.00, addr 2
> da0: <eUSB Compact Flash \\0001> Removable Direct Access SCSI-2 device
> 
> Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  
> Mounted on
> /dev/ad0s1a    127023   102858    14004    88%    2126   29616     7%   /
> devfs               1        1        0   100%       0       0   100%   
> /dev
> /dev/ad0s1e   8130540  7364540   115557    98%  350982 1680632    17%   
> /usr
> /dev/ad0s1f    508143    59025   408467    13%   11961  115013     9%   
> /var
> /dev/ad0s1g   8130540  5682999  1797098    76%   57626 1973988     3%   
> /home
> /dev/ad0s1h   1480757   826372   535925    61%    6240  363742     2%   
> /tmp
> /dev/ad1s1e  12938696 11521840   381761    97%   10361 3227525     0%   
> /misc
> procfs              4        4        0   100%     107     425    20%   
> /proc
> linprocfs           4        4        0   100%       1       0   100%   
> /usr/compat/linux/proc
> /dev/da1s1    4184740  3444184   740556    82%       0       0   100%   
> /ms-dog
> /dev/da0s1      16024      212    15812     1%     512       0   100%   
> /cf-reader
> 
> 
> jim


-- 
ET has one helluva sense of humor!
He's always anal-probing right-wing schizos!


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B7EEEA3.5030507>