Thanks for the help.

Anyway, I came up with a sort of solution of my own. Perhaps someboby may find
it useful, so here it goes:

Near the end of /location/of/kernel/sources/linux-2.2.20/drivers/scsi/sd.c
I've found

        if ( the_result ) {
            printk ("%s: test WP failed, assume Write Protected\n",nbuff);
            rscsi_disks[i].write_prot = 1;
        } else {
            rscsi_disks[i].write_prot = ((buffer[2] & 0x80) != 0);
            printk ("%s: Write Protect is %s\n",nbuff,
                    rscsi_disks[i].write_prot ? "on" : "off");
        }

which I've modified to

        if ( the_result ) {
            printk ("%s: test WP failed, assume Write Enabled\n",nbuff);
            rscsi_disks[i].write_prot = 0;
        } else {
            rscsi_disks[i].write_prot = ((buffer[2] & 0x80) != 0);
            printk ("%s: Write Protect is %s\n",nbuff,
                    rscsi_disks[i].write_prot ? "on" : "off");
        }

Then I recompiled the kernel. Now I can write on the camera's memory stick.

I'm aware of potential unexpected behaviors from the kernel. Even worse,
I have no idea of programming (not at this level, anyway). But this quick
and dirty hacking seems to work just fine.

>===== Original Message From [EMAIL PROTECTED] =====
>If you read the FAQ you'll discover that USB Storage isn't supported in
>the 2.2 kernel.
>
>On Sat, 9 Nov 2002, Julio H. Toloza wrote:
>
>> Hi,
>>
>> I have linux box with kernel 2.2.20, which I've compiled with USB support
>> and the (experimental) usb-storage module. In order to get my Sony DSC P51
>> properly detected, I followed several hints I found in this mail list 
concerning
>> the use of this camera with kernel 2.4.17. So I've modified usb-storage.c 
by
>> adding the following lines
>>
>>      { 0x054c, 0x0010, 0x0410,
>>        "Sony DSC-P51", US_SC_SCSI, US_PR_CB,
>>        US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE |         
US_FL_ALT_LENGTH},
>>
>> to the list of devices recognized. After recompiling the kernel, I'vet got 
my
>> camera well detected. So I can read the files from the camera. But alas! I 
can't
>> delete them. From /var/log/messages I get
>>
>> Nov  9 13:52:50 cucaracha kernel: hub.c: USB new device connect on bus2/2, 
assigned device number 2
>> Nov  9 13:52:50 cucaracha kernel: usb.c: USB new device connect, assigned 
device number 2
>> Nov  9 13:52:50 cucaracha kernel: scsi1 : SCSI emulation for USB Mass 
Storage devices
>> Nov  9 13:52:50 cucaracha kernel: scsi : 2 hosts.
>> Nov  9 13:52:50 cucaracha kernel:   Vendor: Sony      Model: Sony DSC
   Rev: 4.10
>> Nov  9 13:52:50 cucaracha kernel:   Type:   Direct-Access
   ANSI SCSI revision: 02
>> Nov  9 13:52:50 cucaracha kernel: Detected scsi removable disk sda at 
scsi1, channel 0, id 0, lun 0
>> Nov  9 13:52:50 cucaracha kernel: SCSI device sda: hdwr sector= 512 bytes. 
Sectors= 31680 [15 MB] [0.0 GB]
>> Nov  9 13:52:50 cucaracha kernel: usb-uhci.c: interrupt, status 3, frame# 
1426
>> Nov  9 13:52:50 cucaracha kernel: sda: test WP failed, assume Write 
Protected
>> Nov  9 13:52:50 cucaracha kernel:  sda: sda1
>> Nov  9 13:53:28 cucaracha kernel: usb.c: USB disconnect on device 2
>>
>> So the camera is assumed to the be Write Protected. Same messages appear 
with
>> kernel 2.4.17, but the camera is assumed to be Write Enable (and then 
everybody
>> is happy). So the question is: Does anydoby know how to make the kernel
>> (2.2.20) assume that the device is Write Enabled?
>>
>> Thanks a lot.
>>
>> Julio Hugo Toloza
>> Physics Department
>> Virginia Polytechnic Institute and State University
>> Blacksburg, VA 24061-0435, USA
>> E-mail: [EMAIL PROTECTED]
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> [EMAIL PROTECTED]
>> To unsubscribe, use the last form field at:
>> https://lists.sourceforge.net/lists/listinfo/linux-usb-users
>>
>
>--
> /------------------------------------+-------------------------\
>|Stephen J. Gowdy                     | SLAC, MailStop 34,       |
>|http://www.slac.stanford.edu/~gowdy/ | 2575 Sand Hill Road,     |
>|http://calendar.yahoo.com/gowdy      | Menlo Park CA 94025, USA |
>|EMail: [EMAIL PROTECTED]       | Tel: +1 650 926 3144     |
> \------------------------------------+-------------------------/



-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about 
your web server security? Click here for a FREE Thawte 
Apache SSL Guide and answer your Apache SSL security 
needs: http://www.gothawte.com/rd523.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to