Rob --

Are you sure this is the right patch file?  It doesn't look like it
implements the changes you describe...

Matt

On Tue, Mar 27, 2001 at 05:07:27PM -0500, Robert Baruch wrote:
> I updated the SDDR09 driver to dummy up a response for MODE SENSE code 
> page 0x3F. I also made sure that sizeof(mode_page_01) returns the proper 
> size; it does.
> 
> Changes are in the CVS tree, but here is the patch.
> 
> --Rob
> 
> --- sddr09.c.orig     Tue Mar 27 17:05:41 2001
> +++ sddr09.c  Tue Mar 27 17:00:57 2001
> @@ -1,13 +1,13 @@
>   /* Driver for SanDisk SDDR-09 SmartMedia reader
>    *
> - * $Id: sddr09.c,v 1.14 2000/11/21 02:58:26 mdharm Exp $
> + * $Id: sddr09.c,v 1.15 2001/03/27 22:09:17 groovyjava Exp $
>    *
>    * SDDR09 driver v0.1:
>    *
>    * First release
>    *
>    * Current development and maintenance by:
> - *   (c) 2000 Robert Baruch ([EMAIL PROTECTED])
> + *   (c) 2000, 2001 Robert Baruch ([EMAIL PROTECTED])
>    *
>    * The SanDisk SDDR-09 SmartMedia reader uses the Shuttle EUSB-01 chip.
>    * This chip is a programmable USB controller. In the SDDR-09, it has
> @@ -38,7 +38,7 @@
> 
>   #include <linux/sched.h>
>   #include <linux/errno.h>
> -#include <linux/malloc.h>
> +#include <linux/slab.h>
> 
>   #define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )
>   #define LSB_of(s) ((s)&0xFF)
> @@ -812,8 +812,10 @@
>       unsigned char inquiry_response[36] = {
>               0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00
>       };
> - 
> unsigned char mode_page_01[4] = { // write-protected for now
> - 
>       0x03, 0x00, 0x80, 0x00
> + 
> unsigned char mode_page_01[16] = { // write-protected for now
> + 
>       0x03, 0x00, 0x80, 0x00,
> + 
>       0x01, 0x0A,
> + 
>       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>       };
>       unsigned char *ptr;
>       unsigned long capacity;
> @@ -890,10 +892,29 @@
>        
>       // be a check for write-protect here
> 
>               if ( (srb->cmnd[2] & 0x3F) == 0x01 ) {
> - 
>               if (ptr==NULL || srb->request_bufflen<4)
> +
> + 
>               US_DEBUGP(
> + 
>                 "SDDR09: Dummy up request for mode page 1\n");
> +
> + 
>               if (ptr==NULL ||
> + 
>                 srb->request_bufflen<sizeof(mode_page_01))
>        
>               return USB_STOR_TRANSPORT_ERROR;
> +
>        
>       memcpy(ptr, mode_page_01, sizeof(mode_page_01));
>        
>       return USB_STOR_TRANSPORT_GOOD;
> +
> + 
>       } else if ( (srb->cmnd[2] & 0x3F) == 0x3F ) {
> +
> + 
>               US_DEBUGP(
> + 
>                 "SDDR09: Dummy up request for all mode pages\n");
> +
> + 
>               if (ptr==NULL ||
> + 
>                 srb->request_bufflen<sizeof(mode_page_01))
> + 
>                       return USB_STOR_TRANSPORT_ERROR;
> +
> + 
>               memcpy(ptr, mode_page_01, sizeof(mode_page_01));
> + 
>               return USB_STOR_TRANSPORT_GOOD;
> +
>               }
> 
>               // FIXME: sense buffer?
> 
> 
> _______________________________________________
> [EMAIL PROTECTED]
> To unsubscribe, use the last form field at:
> http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

I say, what are all those naked people doing?
                                        -- Big client to Stef
User Friendly, 12/14/1997

PGP signature

Reply via email to