On Tue, 19 Oct 2004, bruno wrote:

> It seens encoding is strange with a lot of =20 (firefox??), anyway i 
> found patch in another location
> like
> http://marc.theaimsgroup.com/?l=linux-usb-devel&m=109623013027142&w=2
> 
> 
> but i don't know exactly how to apply patch
> i made   sudo patch -i as356 in /usr/src/linux/
> it don't find the file, i gave it the location of transport.c
> it returns error
> ------------------------------------------------------------------------------------------------------------
>     File to patch: /usr/src/linux/drivers/usb/storage/transport.c
>     patching file /usr/src/linux/drivers/usb/storage/transport.c
>     Hunk #1 FAILED at 911.
>     Hunk #2 FAILED at 922.
>     2 out of 2 hunks FAILED -- saving rejects to file 
> /usr/src/linux/drivers/usb/storage/transport.c.rej
> ------------------------------------------------------------------------------------------------------------
> 
> that's mean perhaps first patch is installed???
> i don't know i try the second..
> 
> ------------------------------------------------------------------------------------------------------------
>     ile to patch: /usr/src/linux/drivers/usb/storage/transport.c
>     patching file /usr/src/linux/drivers/usb/storage/transport.c
>     Reversed (or previously applied) patch detected!  Assume -R? [n]
>     Apply anyway? [n] y
>     Hunk #1 FAILED at 908.
>     Hunk #2 FAILED at 918.
>     Hunk #3 succeeded at 929 with fuzz 1 (offset -4 lines).
>     2 out of 3 hunks FAILED -- saving rejects to file 
> /usr/src/linux/drivers/usb/storage/transport.c.rej
> ------------------------------------------------------------------------------------------------------------

All right, forget the patches.  The changes you need are simple enough 
that you can make them by hand.  Edit the drivers/usb/storage/transport.c 
file, and find where the usb_stor_Bulk_max_lun subroutine is defined.  
Edit the file so that it looks like this (it should already be pretty 
close):

/* Determine what the maximum LUN supported is */
int usb_stor_Bulk_max_lun(struct us_data *us)
{
        int result;

        /* issue the command */
        result = usb_stor_control_msg(us, us->recv_ctrl_pipe,
                                 US_BULK_GET_MAX_LUN, 
                                 USB_DIR_IN | USB_TYPE_CLASS | 
                                 USB_RECIP_INTERFACE,
                                 0, us->ifnum, us->iobuf, 1, HZ);

        US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 
                  result, us->iobuf[0]);

        /* if we have a successful request, return the result */
        if (result > 0)
                return us->iobuf[0];

        /* 
         * Some devices (i.e. Iomega Zip100) need this -- apparently
         * the bulk pipes get STALLed when the GetMaxLUN request is
         * processed.   This is, in theory, harmless to all other devices
         * (regardless of if they stall or not).
         */

        if (result == -EPIPE) {
                usb_stor_clear_halt(us, us->recv_bulk_pipe);
                usb_stor_clear_halt(us, us->send_bulk_pipe);
        }

        /*
         * Some devices don't like GetMaxLUN.  They may STALL the control
         * pipe, they may return a zero-length result, they may do nothing at
         * all and timeout, or they may fail in even more bizarrely creative
         * ways.  In these cases the best approach is to use the default
         * value: only one LUN.
         */
        return 0;
}


> But after that?
>  i need what? recompile the kernel?
> made i mistake?how to repair, if yes?

Once the file looks like the above it should be okay.  Then you need to 
rebuild the kernel, yes.  Follow the instructions in the README file in 
the top-level directory of the kernel source.

Alternatively, Linus just accepted a large bunch of USB patches for 2.6.9.  
The patch you need was among them, so maybe if you try the new kernel it 
will work.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to