On Sat, May 06, 2006 at 04:42:35AM -0700, Thomas L. Marshall wrote:
> I hope you all can use this...
> 
> I thought I would try using the anydata.c driver to get a couple of CMDA cards
> working (reference a thread on the airprime driver and buffer size). ?I spent
> a bunch of time fooling around with pppd configurations before I realized
> that there was no data coming back from the cards. ?After using Kermit to
> find that the card was actually getting the data that I was typing (the card
> connected even though there was no echo or data coming back), I borrowed
> a couple of lines of code from the generic driver to get it working properly.
> 
> While I was there, I added a couple of additional cards that I was able to
> test with the change.
> 
> --- drivers/usb/serial/anydata.c.orig 2006-05-06 03:46:59.000000000 -0700
> +++ drivers/usb/serial/anydata.c      2006-05-06 04:02:19.000000000 -0700

Take a look at Documentation/SubmittingPatches for how to properly
format patches so that they can be applied (proper patch directory
level, Signed-off-by: line, etc.)

> @@ -13,12 +13,17 @@
>  #include <linux/tty.h>
>  #include <linux/module.h>
>  #include <linux/usb.h>
>  #include "usb-serial.h"
>  
> +
> +/* as long as I'm here, thought I'd add a couple additional cards.  cheers */
> +

That really can't be added as part of the driver :)

>  static struct usb_device_id id_table [] = {
>       { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device      */
> +     { USB_DEVICE(0x1410, 0x1110) }, /* Novatel S620 EVDO device */
> +     { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera KPC 650 EVDO dev */
>       { },
>  };
>  MODULE_DEVICE_TABLE(usb, id_table);
>  
>  /* if overridden by the user, then use their value for the size of the
> @@ -35,10 +40,11 @@
>  };
>  
>  static int anydata_open(struct usb_serial_port *port, struct file *filp)
>  {
>       char *buffer;
> +        struct usb_serial *serial = port->serial;

Please use tabs instead of spaces.  See Documentation/CodingStyle for
more details as to the proper kernel coding style.

>       int result = 0;
>  
>       dbg("%s - port %d", __FUNCTION__, port->number);
>  
>       if (buffer_size) {
> @@ -63,22 +69,35 @@
>               port->write_urb->transfer_buffer = buffer;
>               port->write_urb->transfer_buffer_length = buffer_size;
>               port->bulk_out_size = buffer_size;
>       }
>  
> +        /* the low latency force and the bulk interrupt check were pulled 
> from the
> +           generic driver code to fix a read problem.  Writes seemed OK but 
> the reads
> +           were evaporating before getting back to the application (pppd, 
> wermit, etc). */

This commend doesn't need to be here.  Put it in the changelog comments
instead.

> +        /* force low_latency on so that our tty_push actually forces the 
> data through, 
> +           otherwise it is scheduled, and with high data rates (like with 
> OHCI) data
> +           can get lost. */
> +        if (port->tty)
> +            port->tty->low_latency = 1;
> +        
> +        /* if we have a bulk interrupt, start reading from it */
> +        if (serial->num_bulk_in) {
>       /* Start reading from the device */
> -     usb_fill_bulk_urb(port->read_urb, port->serial->dev,
> -                       usb_rcvbulkpipe(port->serial->dev,
> -                                       port->bulk_in_endpointAddress),
> +            usb_fill_bulk_urb (port->read_urb, serial->dev,
> +                               usb_rcvbulkpipe(serial->dev, 
> port->bulk_in_endpointAddress),
>                         port->read_urb->transfer_buffer,
>                         port->read_urb->transfer_buffer_length,
> -                       usb_serial_generic_write_bulk_callback, port);
> +                               ((serial->type->read_bulk_callback) ?
> +                                serial->type->read_bulk_callback :
> +                                usb_serial_generic_read_bulk_callback),
> +                               port);


Why the callback change?  We know what this will be :)

>       result = usb_submit_urb(port->read_urb, GFP_KERNEL);
>       if (result)
> -             dev_err(&port->dev,
> -                     "%s - failed submitting read urb, error %d\n",
> -                     __FUNCTION__, result);
> +                dev_err(&port->dev, "%s - failed resubmitting read urb, 
> error %d\n", __FUNCTION__, result);
> +        }

Why change this line?  It's now over 80 columns long (see CodingStyle
again...)

thanks,

greg k-h


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to