Legacy serial ports detection

Jakub Stachowski qbast at go2.pl
Sat Sep 4 12:20:59 PDT 2004


Hello, 

I have made patch for hald that adds support for legacy serial ports (ttySx). 
For now it has one big problem: it merges also nonexistant devices (for some 
strange reason sysfs always contains all 'potential' serial ports - in most 
cases 8 of them - even on my laptop with one real serial port). I can detect 
them via ioctl but have no idea how to remove 'virtual' ones. I tried 
overloading class_device_in_gdl and removing there but it hald sometimes 
crashed then. Important thing is that fake port can be detected only by 
issuing ioctls over it. I have no more ideas so maybe someone can help me 
with this.


As I am completely new to hal some more answers will be appreciated:
1) it would be good to detect modem - however it takes quite long, and it 
would block hald, maybe separate thread?
2) the same goes for detecting printers on LPT (using ieee1284 detection) - 3 
seconds with my old lexmark 3200. Good think that it won't be frequent - I 
suppose it could go like this:
 - try to detect on startup and remember if there was anything
 - on every tick: try to negotiate 'deviceid' mode - this will fail without      
device
 - if last time deviceid mode failed and now succeeded do full detection. This 
leads to next question:
What is best method to save detection result between ticks (per port).
 - if last time deviceid succeeded and now failed remove 'printer' capability

This scheme fill fail only if someone is capable of replacing driver between 
two ticks. 

I suppose similar scheme could be used for detecting modems - using DSR 
instead of deviceid mode to confirm that there is something to detect.

3) Legacy parallel port driver has its own class - 'ppdev' - and printer 
discovery has to be made on it, not on 'lp' device. I don't know yet how to 
merge "device" from ppdev class (used for printer discovery) into device from 
'lp' class - actual printer. And what to do if lp is merged after ppdev. 
I have seen patch adding support for legacy lp - is it going to be commited 
soon?


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list