mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cxacru: Use a bulk URB to access the command endpoint
@ 2010-08-30 21:50 Simon Arlott
  2010-08-31 22:06 ` Simon Arlott
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Arlott @ 2010-08-30 21:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List

The command endpoint is a bulk endpoint, but interrupt transfers
are used to access it when checking status, load firmware or alter
the configuration.

This causes an error if CONFIG_USB_DEBUG is enabled after commit
f661c6f8c67bd55e93348f160d590ff9edf08904, which checks for this
mismatch.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
 drivers/usb/atm/cxacru.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 593fc5e..3b45f57 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -49,7 +49,7 @@
 
 static const char cxacru_driver_name[] = "cxacru";
 
-#define CXACRU_EP_CMD		0x01	/* Bulk/interrupt in/out */
+#define CXACRU_EP_CMD		0x01	/* Bulk in/out */
 #define CXACRU_EP_DATA		0x02	/* Bulk in/out */
 
 #define CMD_PACKET_SIZE		64	/* Should be maxpacket(ep)? */
@@ -1171,15 +1171,15 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
 		goto fail;
 	}
 
-	usb_fill_int_urb(instance->rcv_urb,
-			usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD),
+	usb_fill_bulk_urb(instance->rcv_urb,
+			usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD),
 			instance->rcv_buf, PAGE_SIZE,
-			cxacru_blocking_completion, &instance->rcv_done, 1);
+			cxacru_blocking_completion, &instance->rcv_done);
 
-	usb_fill_int_urb(instance->snd_urb,
-			usb_dev, usb_sndintpipe(usb_dev, CXACRU_EP_CMD),
+	usb_fill_bulk_urb(instance->snd_urb,
+			usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD),
 			instance->snd_buf, PAGE_SIZE,
-			cxacru_blocking_completion, &instance->snd_done, 4);
+			cxacru_blocking_completion, &instance->snd_done);
 
 	mutex_init(&instance->cm_serialize);
 
-- 
1.7.0.4
-- 
Simon Arlott

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cxacru: Use a bulk URB to access the command endpoint
  2010-08-30 21:50 [PATCH] cxacru: Use a bulk URB to access the command endpoint Simon Arlott
@ 2010-08-31 22:06 ` Simon Arlott
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Arlott @ 2010-08-31 22:06 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List

Please drop this patch, I'll make a version that detects which type of
endpoint it is and uses an interrupt or bulk URB as appropriate. Some
devices which may/may not be compatible appear to have interrupt
command endpoints as referenced in the original comment.

On 30/08/10 22:50, Simon Arlott wrote:
> The command endpoint is a bulk endpoint, but interrupt transfers
> are used to access it when checking status, load firmware or alter
> the configuration.
> 
> This causes an error if CONFIG_USB_DEBUG is enabled after commit
> f661c6f8c67bd55e93348f160d590ff9edf08904, which checks for this
> mismatch.
> 
> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
> ---
>  drivers/usb/atm/cxacru.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
> index 593fc5e..3b45f57 100644
> --- a/drivers/usb/atm/cxacru.c
> +++ b/drivers/usb/atm/cxacru.c
> @@ -49,7 +49,7 @@
>  
>  static const char cxacru_driver_name[] = "cxacru";
>  
> -#define CXACRU_EP_CMD		0x01	/* Bulk/interrupt in/out */
> +#define CXACRU_EP_CMD		0x01	/* Bulk in/out */
>  #define CXACRU_EP_DATA		0x02	/* Bulk in/out */
>  
>  #define CMD_PACKET_SIZE		64	/* Should be maxpacket(ep)? */
> @@ -1171,15 +1171,15 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance,
>  		goto fail;
>  	}
>  
> -	usb_fill_int_urb(instance->rcv_urb,
> -			usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD),
> +	usb_fill_bulk_urb(instance->rcv_urb,
> +			usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD),
>  			instance->rcv_buf, PAGE_SIZE,
> -			cxacru_blocking_completion, &instance->rcv_done, 1);
> +			cxacru_blocking_completion, &instance->rcv_done);
>  
> -	usb_fill_int_urb(instance->snd_urb,
> -			usb_dev, usb_sndintpipe(usb_dev, CXACRU_EP_CMD),
> +	usb_fill_bulk_urb(instance->snd_urb,
> +			usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD),
>  			instance->snd_buf, PAGE_SIZE,
> -			cxacru_blocking_completion, &instance->snd_done, 4);
> +			cxacru_blocking_completion, &instance->snd_done);
>  
>  	mutex_init(&instance->cm_serialize);
>  


-- 
Simon Arlott

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-31 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-30 21:50 [PATCH] cxacru: Use a bulk URB to access the command endpoint Simon Arlott
2010-08-31 22:06 ` Simon Arlott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®