summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-11-21 17:09:00 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-11-21 17:09:00 +0000
commit9938f4264e1db36f12c1faef8e57b7641942dfeb (patch)
tree5c87b738a42a5cf1fbb73053425e7cd87c15541c /tools
parentc21139e9999865ec9d3c9cc90d92b95e28c8a28d (diff)
downloaddrakx-9938f4264e1db36f12c1faef8e57b7641942dfeb.tar
drakx-9938f4264e1db36f12c1faef8e57b7641942dfeb.tar.gz
drakx-9938f4264e1db36f12c1faef8e57b7641942dfeb.tar.bz2
drakx-9938f4264e1db36f12c1faef8e57b7641942dfeb.tar.xz
drakx-9938f4264e1db36f12c1faef8e57b7641942dfeb.zip
- sync with rh
- keep CLASS_UNSPEC handling
Diffstat (limited to 'tools')
-rw-r--r--tools/serial_probe/device.h28
-rw-r--r--tools/serial_probe/serial.c11
2 files changed, 29 insertions, 10 deletions
diff --git a/tools/serial_probe/device.h b/tools/serial_probe/device.h
index 15fc3191d..58d1414a0 100644
--- a/tools/serial_probe/device.h
+++ b/tools/serial_probe/device.h
@@ -17,10 +17,28 @@
enum deviceClass {
/* device classes... this is somewhat ad-hoc */
- CLASS_UNSPEC, CLASS_OTHER, CLASS_NETWORK, CLASS_SCSI, CLASS_VIDEO,
- CLASS_AUDIO, CLASS_MOUSE, CLASS_MODEM, CLASS_CDROM, CLASS_TAPE,
- CLASS_FLOPPY, CLASS_SCANNER, CLASS_HD, CLASS_RAID, CLASS_PRINTER,
- CLASS_CAPTURE, CLASS_KEYBOARD, CLASS_PCMCIA
+ CLASS_UNSPEC = ~0,
+ CLASS_OTHER = (1 << 0),
+ CLASS_NETWORK = (1 << 1),
+ CLASS_SCSI = (1 << 2),
+ CLASS_MOUSE = (1 << 3),
+ CLASS_AUDIO = (1 << 4),
+ CLASS_CDROM = (1 << 5),
+ CLASS_MODEM = (1 << 6),
+ CLASS_VIDEO = (1 << 7),
+ CLASS_TAPE = (1 << 8),
+ CLASS_FLOPPY = (1 << 9),
+ CLASS_SCANNER = (1 << 10),
+ CLASS_HD = (1 << 11),
+ CLASS_RAID = (1 << 12),
+ CLASS_PRINTER = (1 << 13),
+ CLASS_CAPTURE = (1 << 14),
+ CLASS_KEYBOARD = (1 << 15),
+ CLASS_MONITOR = (1 << 16),
+ CLASS_USB = (1 << 17),
+ CLASS_SOCKET = (1 << 18),
+ CLASS_FIREWIRE = (1 << 19),
+ CLASS_IDE = (1 << 20)
};
/* Update this if needed */
@@ -30,7 +48,7 @@ enum deviceBus {
/* 'bus' that a device is attached to... this is also ad-hoc */
/* BUS_SBUS is sort of a misnomer - it's more or less Sun */
/* OpenPROM probing of all various associated non-PCI buses */
- BUS_UNSPEC = 0,
+ BUS_UNSPEC = ~0,
BUS_OTHER = (1 << 0),
BUS_PCI = (1 << 1),
BUS_SBUS = (1 << 2),
diff --git a/tools/serial_probe/serial.c b/tools/serial_probe/serial.c
index 332ae1861..bf1944553 100644
--- a/tools/serial_probe/serial.c
+++ b/tools/serial_probe/serial.c
@@ -937,13 +937,14 @@ struct device *serialProbe(enum deviceClass probeClass, int probeFlags,
if (
- (probeClass == CLASS_UNSPEC) ||
- (probeClass == CLASS_OTHER) ||
- (probeClass == CLASS_MOUSE) ||
- (probeClass == CLASS_MODEM) ||
- (probeClass == CLASS_PRINTER)
+ (probeClass & CLASS_UNSPEC) ||
+ (probeClass & CLASS_OTHER) ||
+ (probeClass & CLASS_MOUSE) ||
+ (probeClass & CLASS_MODEM) ||
+ (probeClass & CLASS_PRINTER)
) {
int x;
+
for (x=0; x<=3 ; x++) {
struct stat sbuf;
char lockfile[32];