Re: patch usb-cdc-acm-work-around-some-broken-devices.patch added to gregkh-2.6 tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2 Jul 2009 gregkh@xxxxxxx wrote:

> This is a note to let you know that I've just added the patch titled
> 
>     Subject: USB: cdc-acm: work around some broken devices
> 
> to my gregkh-2.6 tree.  Its filename is
> 
>     usb-cdc-acm-work-around-some-broken-devices.patch
> 
> This tree can be found at 
>     http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
> 
> 
> From ars3n@xxxxxxxxx  Thu Jul  2 15:48:15 2009
> From: Arseniy Lartsev <ars3n@xxxxxxxxx>
> Date: Wed, 1 Jul 2009 16:27:26 +0400
> Subject: USB: cdc-acm: work around some broken devices
> To: Oliver Neukum <oliver@xxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>, USB list <linux-usb@xxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, greg@xxxxxxxxx
> Message-ID: <200907011627.31170.ars3n@xxxxxxxxx>
> 
> This patch introduces a work around for cdc-acm devices which are
> low speed contrary to the specification, which requires bulk endpoints
> which are banned in low speed and converted by usbcore to virtual
> interrupt endpoints if they are used nevertheless.
> 
> Signed-off-by: Arseniy Lartsev <ars3n@xxxxxxxxx>
> Cc: Oliver Neukum <oliver@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
> 
> ---
>  drivers/usb/class/cdc-acm.c |   31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -387,6 +387,7 @@ static void acm_rx_tasklet(unsigned long
>  	struct acm_ru *rcv;
>  	unsigned long flags;
>  	unsigned char throttled;
> +	struct usb_host_endpoint *ep;
>  
>  	dbg("Entering acm_rx_tasklet");
>  
> @@ -462,11 +463,20 @@ urbs:
>  
>  		rcv->buffer = buf;
>  
> -		usb_fill_bulk_urb(rcv->urb, acm->dev,
> -				  acm->rx_endpoint,
> -				  buf->base,
> -				  acm->readsize,
> -				  acm_read_bulk, rcv);
> +		ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out)
> +				[usb_pipeendpoint(acm->rx_endpoint)];

Arseniy, shouldn't you simplify this?

		ep = acm->dev->ep_in[usb_pipeendpoint(acm->rx_endpoint)];

After all, acm->rx_endpoint has to be an IN endpoint.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux