On Mon, 10 Jul 2006 14:51:40 -0300
Naranjo Manuel Francisco <[EMAIL PROTECTED]> wrote:
| Here is a brief description of the device to see how the driver works:
| The device works as an standard CDC device, it has 2 interfaces, the first
one is
| for firmware access and the second is the serial one.
| The device simply need some stuff to understand data comming from the usb
buffer:
| The First and Second byte is used for a Header, the Third and Fourth tells
the
| device the amount of information the package holds.
| Packages are 60 bytes long + Header Stuff.
| I have reached a top of 300 bytes per transfer, which I think is being
limited by
| the hardware itself, I do not think it is actually a driver matter any more.
|
| The driver registers himself with the USB-serial core and the USB Core.
| I had to implement a probe function agains USB-serial, because other way, the
| driver was attaching himself to both interfaces. I have tryed with different
| configurations of usb_serial_driver with out exit, only the probe function
could
| handle this correctly.
Maybe, would be good to have this in the top of the file.
| +static int aircable_write(struct usb_serial_port *port,
| + const unsigned char *source, int count)
| +{
[...]
| +
| + port->write_urb_busy = 1;
Shouldn't you protect this with the spinlock?
| +static void aircable_write_bulk_callback (struct urb *urb, struct pt_regs
*regs)
| +{
| + struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
| +
| + /* free up the transfer buffer, as usb_free_urb() does not do this */
| + kfree(urb->transfer_buffer);
| +
| + dbg("%s - port %d", __FUNCTION__, port->number);
| +
| + port->write_urb_busy = 1;
What about this one?
I think there are others..
| +static void aircable_read_bulk_callback(struct urb *urb, struct pt_regs
*regs)
| +{
| + struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
| + struct usb_serial *serial = port->serial;
| + struct tty_struct *tty;
| + unsigned char *data;
| + unsigned long no_packages;
| + unsigned long remaining, package_length;
| + unsigned long i;
| + int result;
| +
| + dbg("%s - port %d", __FUNCTION__, port->number);
| +
| + if (urb->status) {
| + dbg("%s - nonzero read bulk status received: %d", __FUNCTION__,
| + urb->status);
| + return;
| + }
Some other drivers does this, but personally I dislike it.
IMO, you can ignore (ie, report with dbg()) -ECONNRESET, -ENOENT
and -ESHUTDOWN. But all the others should be reported with err().
--
Luiz Fernando N. Capitulino
-------------------------------------------------------------------------
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
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel