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
@@ -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 */
+
 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;
        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). */
+        
+        /* 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);
        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);
+        }
 
        return result;
 }
 
 static struct usb_serial_driver anydata_device = {


-------------------------------------------------------
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&kid0709&bid&3057&dat1642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to