[PATCH] finish iso support retry

matthieu castet castet.matthieu at free.fr
Tue Sep 6 05:32:52 EDT 2005


matthieu castet wrote:
> Hi Duncan,
> 
> Duncan Sands wrote:
> 
>>
>> I think I will incorporate the "options" version.
> 
> I attach a patch for options version.
> 
> There are 3 options : one for using iso, one for ignoring ELISEQ errors 
> and one for using packet size = maw_packet_size.
Hi Duncan,

if you came back from holidays and aren't busy anymore, could you review 
this patch and the ueagle sub-driver 
(http://svn.gna.org/viewcvs/ueagleatm/trunk/ueagle-atm/)

Thanks

Matthieu


> ------------------------------------------------------------------------
> 
> Index: usbatm.c
> ===================================================================
> RCS file: /home/cvs/usbatm/usbatm.c,v
> retrieving revision 1.47
> diff -u -r1.47 usbatm.c
> --- usbatm.c	27 May 2005 16:17:23 -0000	1.47
> +++ usbatm.c	6 Jul 2005 19:22:42 -0000
> @@ -269,7 +269,9 @@
>  
>  	spin_unlock_irqrestore(&channel->lock, flags);
>  
> -	if (unlikely(urb->status))
> +	if (unlikely(urb->status) && 
> +			(!(channel->usbatm->driver->options & IGNORE_ELISEQ) ||
> +			  urb->status != -EILSEQ ))
>  		/* throttle processing in case of an error */
>  		mod_timer(&channel->delay, jiffies + msecs_to_jiffies(THROTTLE_MSECS));
>  	else
> @@ -1017,7 +1019,10 @@
>  	usbatm_init_channel(&instance->tx_channel);
>  	tasklet_init(&instance->rx_channel.tasklet, usbatm_rx_process, (unsigned long)instance);
>  	tasklet_init(&instance->tx_channel.tasklet, usbatm_tx_process, (unsigned long)instance);
> -	instance->rx_channel.endpoint = usb_rcvbulkpipe(usb_dev, driver->in);
> +	if (driver->options & USE_ISO)
> +		instance->rx_channel.endpoint = usb_rcvisocpipe(usb_dev, driver->in);
> +	else
> +		instance->rx_channel.endpoint = usb_rcvbulkpipe(usb_dev, driver->in);
>  	instance->tx_channel.endpoint = usb_sndbulkpipe(usb_dev, driver->out);
>  	instance->rx_channel.stride = ATM_CELL_SIZE + driver->rx_padding;
>  	instance->tx_channel.stride = ATM_CELL_SIZE + driver->tx_padding;
> @@ -1039,7 +1044,15 @@
>  			iso_size = usb_maxpacket(instance->usb_dev, channel->endpoint, 0);
>  			iso_size -= iso_size % channel->stride;	/* alignment */
>  			BUG_ON(!iso_size);
> -			iso_packets = (channel->buf_size - 1) / iso_size + 1;
> +			if (driver->options & ISO_PACKET_MAX_SIZE) {
> +				/* Some modem have problem when packet size is
> +				 * not maxpacket size.
> +				 */
> +				iso_packets = channel->buf_size / iso_size;
> +				channel->buf_size = iso_packets * iso_size;
> +			}
> +			else 
> +				iso_packets = (channel->buf_size - 1) / iso_size + 1;
>  		}
>  
>  		urb = usb_alloc_urb(iso_packets, GFP_KERNEL);
> Index: usbatm.h
> ===================================================================
> RCS file: /home/cvs/usbatm/usbatm.h,v
> retrieving revision 1.19
> diff -u -r1.19 usbatm.h
> --- usbatm.h	30 May 2005 08:48:13 -0000	1.19
> +++ usbatm.h	6 Jul 2005 19:22:42 -0000
> @@ -79,6 +79,11 @@
>  	do {} while (0)
>  #endif
>  
> +/* options */
> +#define USE_ISO			0x01 /* use iso pipe for rx data */
> +#define IGNORE_ELISEQ		0x02 /* ignore ELISEQ errors */
> +#define ISO_PACKET_MAX_SIZE	0x04 /* don't try to use iso packets that
> +					have a size != max_packet_size */
>  
>  /* mini driver */
>  
> @@ -119,6 +124,7 @@
>  
>  	unsigned rx_padding;
>  	unsigned tx_padding;
> +	unsigned int options;
>  };
>  
>  extern int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Usbatm mailing list
> Usbatm at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/usbatm




More information about the Usbatm mailing list