On Friday 27 April 2007, Hamish Moffatt wrote: > I'd like to run a getty on /dev/ttygs to allow logins over to the > g_serial gadget. However I note a couple of issues; > > When the link is not up, opening the device returns ENODEV, so the getty > respawns continuously. Also, g_serial itself logs the following each > time: > > gs_open: (0,c3ffc000,c3c05320) device is not connected > gs_close: NULL port pointer
Both those seem wrong. You can open a "real" serial line without something on the other end; this driver should allow that too ... > Next, if you disconnect the link while the device is open, blocking > reads don't appear to fail, so the getty (or shell or whatever) doesn't > notice. Also seems wrong. An EOF should be reported, right? > I think it would be useful to have g_serial (optionally) pretend to > userspace that the link was always connected; if the link is down, > discard (or buffer) written data, and fail/block reads. Does this sound > useful? As for "always connected", if the serial line model has a "no connection" state, that's what it should use. Otherwise, block reads and writes until a host is there. Discarding is generally wrong, and buffering doesn't seem correct here (although maybe there are serial line modes where it's OK to let the read and write sides get out of sync). > Another way to solve this would be to launch the getty when the link comes > up (and also act on link down) however I don't see any hotplug events > for this. Would it make sense to have events for this case? Hotplug events on gadget connect/disconnect have always seemed especially racey to me. Partly that's because of folk wanting to us that to trigger things like configuring one gadget driver vs another, but in general I remain uncomfortable with such approaches. - Dave ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel