Hello ,
I am developing a driver for a usb-serial adapter ( 1 port device with
BULK IN and BULK OUT endpoint). The development is on Redhat kernel
2.6.9.
I find that write call backs are not happening when I unload my driver
module and reload it afterwards , without disconnecting the usb-serial
adapter .
In this case I have analyzed the bus traffic using analyzer . I find
NACK's being returned by the device for the urb submitted on the BULK
OUT endpoint . I have verified that DTR,RTS on the usb-serial end is
asserted when submitting urb on the BULK OUT endpoint of the usb-serial
device.
i am also able to receive data on the BULK IN endpoint . Read callbacks
are happening .
i.e data sent by the device on the serial end is received by the
usb-serial adapter.
If i plug out the device and reconnect it with the driver module loaded
, and try sending data I get the write call backs .
The issue occurs only when the device is plugged in when unloading and
reloading the driver .
My Test setup is as below -
Linux 2.6.9 m/c with ------>- usb port on the host ----> usb-serial
adapter -----> NULL Modem Cable -----> serial port ----> Windows host
with
my usb-serial driver
machine running hyperterminal
I am also unlinking the urbs synchronously using usb_kill_urb in
usb-serial drivers shutdown routine ( routine that gets called when
driver is unloaded with device conencted )
What could be the issue ? Would this be due to incorrect initialization
of the device or the usb-stack on Linux 2.6.9. Has anybody observed
something similar for any other usb / usb-serial device . I would be
glad if anyone could provide pointers to debug this issue .
Regards,
Monali.
Shutdown routine of my usb-serial driver .
static void oxsemi_shutdown (struct usb_serial *serial)
{
struct oxsemi_port *port_info;
struct oxsemi_serial *device_info;
int i =0;
oxsemi_dbg("[ENTRY]", CRITICAL);
/* Any local memory allocated for this device
* should be freed
*/
/* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
port_info = usb_get_serial_port_data(serial->port[i]);
device_info = usb_get_serial_data(serial);
/* Unlink all the URB's. */
if (serial->dev) {
/* shutdown our urbs */
usb_kill_urb(serial->port[i]->write_urb);
usb_kill_urb(serial->port[i]->read_urb);
}
}
oxsemi_tx_buffer_free(port_info->tx_buffer);
kfree(port_info);
usb_set_serial_port_data(serial->port[i], NULL);
}
kfree (usb_get_serial_data(serial));
usb_set_serial_data(serial, NULL);
oxsemi_dbg("[EXIT]", TRACE);
}
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel