diff options
author | jhb <jhb@FreeBSD.org> | 2006-02-28 21:12:16 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-02-28 21:12:16 +0000 |
commit | ea13fb1a9ce74ec6eaf9fd0d3ae042a78108d669 (patch) | |
tree | dd262117f7e80af13cc068bc18b4e58070bc82dd /usr.sbin/sade/devices.c | |
parent | ce138ec14dae0fec68c23973e74c90e32f9c1aba (diff) | |
download | FreeBSD-src-ea13fb1a9ce74ec6eaf9fd0d3ae042a78108d669.zip FreeBSD-src-ea13fb1a9ce74ec6eaf9fd0d3ae042a78108d669.tar.gz |
Use some helper macros for the device table so it can fit in 80 columns and
to allow us to use default values in some entries to quiet warnings. This
table is actually readable again now.
Diffstat (limited to 'usr.sbin/sade/devices.c')
-rw-r--r-- | usr.sbin/sade/devices.c | 166 |
1 files changed, 89 insertions, 77 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index bf15789..e795f8e 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -53,91 +53,103 @@ static Device *Devices[DEV_MAX]; static int numDevs; +#define DEVICE_ENTRY(type, name, descr, max) { type, name, descr, max } + +#define CDROM(name, descr, max) \ + DEVICE_ENTRY(DEVICE_TYPE_CDROM, name, descr, max) +#define TAPE(name, descr, max) \ + DEVICE_ENTRY(DEVICE_TYPE_TAPE, name, descr, max) +#define DISK(name, descr, max) \ + DEVICE_ENTRY(DEVICE_TYPE_DISK, name, descr, max) +#define FLOPPY(name, descr, max) \ + DEVICE_ENTRY(DEVICE_TYPE_FLOPPY, name, descr, max) +#define NETWORK(name, descr) \ + DEVICE_ENTRY(DEVICE_TYPE_NETWORK, name, descr, 0) +#define SERIAL(name, descr, max) \ + DEVICE_ENTRY(DEVICE_TYPE_NETWORK, name, descr, max) + static struct _devname { DeviceType type; char *name; char *description; int max; } device_names[] = { - { DEVICE_TYPE_CDROM, "cd%d", "SCSI CDROM drive", 4 }, - { DEVICE_TYPE_CDROM, "mcd%d", "Mitsumi (old model) CDROM drive", 4 }, - { DEVICE_TYPE_CDROM, "scd%d", "Sony CDROM drive - CDU31/33A type", 4 }, -#ifdef notdef - { DEVICE_TYPE_CDROM, "matcd%d", "Matsushita CDROM ('sound blaster' type)", 4 }, -#endif - { DEVICE_TYPE_CDROM, "acd%d", "ATAPI/IDE CDROM", 4 }, - { DEVICE_TYPE_TAPE, "sa%d", "SCSI tape drive", 4 }, - { DEVICE_TYPE_TAPE, "rwt%d", "Wangtek tape drive", 4 }, - { DEVICE_TYPE_DISK, "da%d", "SCSI disk device", 16 }, - { DEVICE_TYPE_DISK, "ad%d", "ATA/IDE disk device", 16 }, - { DEVICE_TYPE_DISK, "ar%d", "ATA/IDE RAID device", 16 }, - { DEVICE_TYPE_DISK, "afd%d", "ATAPI/IDE floppy device", 4 }, - { DEVICE_TYPE_DISK, "mlxd%d", "Mylex RAID disk", 4 }, - { DEVICE_TYPE_DISK, "amrd%d", "AMI MegaRAID drive", 4 }, - { DEVICE_TYPE_DISK, "idad%d", "Compaq RAID array", 4 }, - { DEVICE_TYPE_DISK, "twed%d", "3ware ATA RAID array", 4 }, - { DEVICE_TYPE_DISK, "aacd%d", "Adaptec FSA RAID array", 4 }, - { DEVICE_TYPE_DISK, "ipsd%d", "IBM ServeRAID RAID array", 4 }, - { DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 4 }, - { DEVICE_TYPE_NETWORK, "an", "Aironet 4500/4800 802.11 wireless adapter" }, - { DEVICE_TYPE_NETWORK, "aue", "ADMtek USB ethernet adapter" }, - { DEVICE_TYPE_NETWORK, "axe", "ASIX Electronics USB ethernet adapter" }, - { DEVICE_TYPE_NETWORK, "bfe", "Broadcom BCM440x PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "bge", "Broadcom BCM570x PCI gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "cue", "CATC USB ethernet adapter" }, - { DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" }, - { DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" }, - { DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" }, - { DEVICE_TYPE_NETWORK, "en", "Efficient Networks ATM PCI card" }, - { DEVICE_TYPE_NETWORK, "dc", "DEC/Intel 21143 (and clones) PCI fast ethernet card" }, - { DEVICE_TYPE_NETWORK, "de", "DEC DE435 PCI NIC or other DC21040-AA based card" }, - { DEVICE_TYPE_NETWORK, "fxp", "Intel EtherExpress Pro/100B PCI Fast Ethernet card" }, - { DEVICE_TYPE_NETWORK, "ed", "Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA" }, - { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 ethernet card/3C589 PCMCIA" }, - { DEVICE_TYPE_NETWORK, "el", "3Com 3C501 ethernet card" }, - { DEVICE_TYPE_NETWORK, "em", "Intel(R) PRO/1000 ethernet card" }, - { DEVICE_TYPE_NETWORK, "ex", "Intel EtherExpress Pro/10 ethernet card" }, - { DEVICE_TYPE_NETWORK, "fe", "Fujitsu MB86960A/MB86965A ethernet card" }, - { DEVICE_TYPE_NETWORK, "gem", "Apple/Sun GMAC ethernet adapter" }, - { DEVICE_TYPE_NETWORK, "ie", "AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210" }, - { DEVICE_TYPE_NETWORK, "ix", "Intel Etherexpress ethernet card" }, - { DEVICE_TYPE_NETWORK, "kue", "Kawasaki LSI USB ethernet adapter" }, - { DEVICE_TYPE_NETWORK, "le", "DEC EtherWorks 2 or 3 ethernet card" }, - { DEVICE_TYPE_NETWORK, "lnc", "Lance/PCnet (Isolan/Novell NE2100/NE32-VL) ethernet" }, - { DEVICE_TYPE_NETWORK, "lge", "Level 1 LXT1001 gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "nge", "NatSemi PCI gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "pcn", "AMD Am79c79x PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "ray", "Raytheon Raylink 802.11 wireless adaptor" }, - { DEVICE_TYPE_NETWORK, "re", "RealTek 8139C+/8169/8169S/8110S PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "rl", "RealTek 8129/8139 PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "rue", "RealTek USB ethernet card" }, - { DEVICE_TYPE_NETWORK, "sf", "Adaptec AIC-6915 PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "sis", "SiS 900/SiS 7016 PCI ethernet card" }, + CDROM("cd%d", "SCSI CDROM drive", 4), + CDROM("mcd%d", "Mitsumi (old model) CDROM drive", 4), + CDROM("scd%d", "Sony CDROM drive - CDU31/33A type", 4), + CDROM("acd%d", "ATAPI/IDE CDROM", 4), + TAPE("sa%d", "SCSI tape drive", 4), + TAPE("rwt%d", "Wangtek tape drive", 4), + DISK("da%d", "SCSI disk device", 16), + DISK("ad%d", "ATA/IDE disk device", 16), + DISK("ar%d", "ATA/IDE RAID device", 16), + DISK("afd%d", "ATAPI/IDE floppy device", 4), + DISK("mlxd%d", "Mylex RAID disk", 4), + DISK("amrd%d", "AMI MegaRAID drive", 4), + DISK("idad%d", "Compaq RAID array", 4), + DISK("twed%d", "3ware ATA RAID array", 4), + DISK("aacd%d", "Adaptec FSA RAID array", 4), + DISK("ipsd%d", "IBM ServeRAID RAID array", 4), + FLOPPY("fd%d", "floppy drive unit A", 4), + SERIAL("cuad%d", "%s on device %s (COM%d)", 16), + NETWORK("an", "Aironet 4500/4800 802.11 wireless adapter"), + NETWORK("aue", "ADMtek USB ethernet adapter"), + NETWORK("axe", "ASIX Electronics USB ethernet adapter"), + NETWORK("bfe", "Broadcom BCM440x PCI ethernet card"), + NETWORK("bge", "Broadcom BCM570x PCI gigabit ethernet card"), + NETWORK("cue", "CATC USB ethernet adapter"), + NETWORK("fpa", "DEC DEFPA PCI FDDI card"), + NETWORK("sr", "SDL T1/E1 sync serial PCI card"), + NETWORK("cc3i", "SDL HSSI sync serial PCI card"), + NETWORK("en", "Efficient Networks ATM PCI card"), + NETWORK("dc", "DEC/Intel 21143 (and clones) PCI fast ethernet card"), + NETWORK("de", "DEC DE435 PCI NIC or other DC21040-AA based card"), + NETWORK("fxp", "Intel EtherExpress Pro/100B PCI Fast Ethernet card"), + NETWORK("ed", "Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA"), + NETWORK("ep", "3Com 3C509 ethernet card/3C589 PCMCIA"), + NETWORK("el", "3Com 3C501 ethernet card"), + NETWORK("em", "Intel(R) PRO/1000 ethernet card"), + NETWORK("ex", "Intel EtherExpress Pro/10 ethernet card"), + NETWORK("fe", "Fujitsu MB86960A/MB86965A ethernet card"), + NETWORK("gem", "Apple/Sun GMAC ethernet adapter"), + NETWORK("ie", "AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210"), + NETWORK("ix", "Intel Etherexpress ethernet card"), + NETWORK("kue", "Kawasaki LSI USB ethernet adapter"), + NETWORK("le", "DEC EtherWorks 2 or 3 ethernet card"), + NETWORK("lnc", "Lance/PCnet (Isolan/Novell NE2100/NE32-VL) ethernet"), + NETWORK("lge", "Level 1 LXT1001 gigabit ethernet card"), + NETWORK("nge", "NatSemi PCI gigabit ethernet card"), + NETWORK("pcn", "AMD Am79c79x PCI ethernet card"), + NETWORK("ray", "Raytheon Raylink 802.11 wireless adaptor"), + NETWORK("re", "RealTek 8139C+/8169/8169S/8110S PCI ethernet card"), + NETWORK("rl", "RealTek 8129/8139 PCI ethernet card"), + NETWORK("rue", "RealTek USB ethernet card"), + NETWORK("sf", "Adaptec AIC-6915 PCI ethernet card"), + NETWORK("sis", "SiS 900/SiS 7016 PCI ethernet card"), #ifdef PC98 - { DEVICE_TYPE_NETWORK, "snc", "SONIC ethernet card" }, + NETWORK("snc", "SONIC ethernet card"), #endif - { DEVICE_TYPE_NETWORK, "sn", "SMC/Megahertz ethernet card" }, - { DEVICE_TYPE_NETWORK, "ste", "Sundance ST201 PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "sk", "SysKonnect PCI gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "tx", "SMC 9432TX ethernet card" }, - { DEVICE_TYPE_NETWORK, "txp", "3Com 3cR990 ethernet card" }, - { DEVICE_TYPE_NETWORK, "ti", "Alteon Networks PCI gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "tl", "Texas Instruments ThunderLAN PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "vge", "VIA VT612x PCI gigabit ethernet card" }, - { DEVICE_TYPE_NETWORK, "vr", "VIA VT3043/VT86C100A Rhine PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "vlan", "IEEE 802.1Q VLAN network interface" }, - { DEVICE_TYPE_NETWORK, "vx", "3COM 3c590 / 3c595 ethernet card" }, - { DEVICE_TYPE_NETWORK, "wb", "Winbond W89C840F PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "wi", "Lucent WaveLAN/IEEE 802.11 wireless adapter" }, - { DEVICE_TYPE_NETWORK, "wx", "Intel Gigabit Ethernet (82452) card" }, - { DEVICE_TYPE_NETWORK, "xe", "Xircom/Intel EtherExpress Pro100/16 ethernet card" }, - { DEVICE_TYPE_NETWORK, "xl", "3COM 3c90x / 3c90xB PCI ethernet card" }, - { DEVICE_TYPE_NETWORK, "cuad%d", "%s on device %s (COM%d)", 16 }, - { DEVICE_TYPE_NETWORK, "fwe", "FireWire Ethernet emulation" }, - { DEVICE_TYPE_NETWORK, "plip", "Parallel Port IP (PLIP) peer connection" }, - { DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" }, - { DEVICE_TYPE_NETWORK, "disc", "Software discard network interface" }, - { 0 }, + NETWORK("sn", "SMC/Megahertz ethernet card"), + NETWORK("ste", "Sundance ST201 PCI ethernet card"), + NETWORK("sk", "SysKonnect PCI gigabit ethernet card"), + NETWORK("tx", "SMC 9432TX ethernet card"), + NETWORK("txp", "3Com 3cR990 ethernet card"), + NETWORK("ti", "Alteon Networks PCI gigabit ethernet card"), + NETWORK("tl", "Texas Instruments ThunderLAN PCI ethernet card"), + NETWORK("vge", "VIA VT612x PCI gigabit ethernet card"), + NETWORK("vr", "VIA VT3043/VT86C100A Rhine PCI ethernet card"), + NETWORK("vlan", "IEEE 802.1Q VLAN network interface"), + NETWORK("vx", "3COM 3c590 / 3c595 ethernet card"), + NETWORK("wb", "Winbond W89C840F PCI ethernet card"), + NETWORK("wi", "Lucent WaveLAN/IEEE 802.11 wireless adapter"), + NETWORK("wx", "Intel Gigabit Ethernet (82452) card"), + NETWORK("xe", "Xircom/Intel EtherExpress Pro100/16 ethernet card"), + NETWORK("xl", "3COM 3c90x / 3c90xB PCI ethernet card"), + NETWORK("fwe", "FireWire Ethernet emulation"), + NETWORK("plip", "Parallel Port IP (PLIP) peer connection"), + NETWORK("lo", "Loop-back (local) network interface"), + NETWORK("disc", "Software discard network interface"), + { 0, NULL, NULL, 0 } }; Device * |