[EMAIL PROTECTED] wrote:
Hello,

I try to create a usb-serial driver for my device.
So far I can send and receive data (cat, minicom)
set the speed, get the control lines (DCD etc) and
set them. I have a terminal attached to the serial
port and run getty on it.

I get a login prompt and can log in. I get the /etc/
motd printed on the terminal, but then it stops. I
don't get a prompt from bash. Bash is running though
(I see it with ps). When I type something on the terminal
I see the debug output of my read_bulk_callback, but
the urb->context->tty is suddenly NULL. Any ideas
what could be wrong here?

I have put some more debugging into this and found the following: when I start the getty and log in, the following sequence executes (with sightly enhanced debug output in usb-serial.c): serial_open pid 633 (getty) serial_open pid 633 (bash) serial_close - port 0 pid 633 (bash) [...]

I can open the port multiple times (open_count is used to track the
opens) but the first serial_close unconditionally sets port->tty to
NULL. I don't know if this is needed (for hotplug or else) but in my
case it is quite destructive. I tried moving the lines "tty->driver_data
= NULL;" and "port->tty = NULL;" to the function __serial_close into the
part that is only executed for the last close.

With that change in place, I can now log in.

So is that a bug in usb-serial.c? Or what else can I do to get around this?

Thanks and regards
  Alexander





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to