summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2005-04-13 14:01:44 +0200
committerMichael Brown2005-04-13 14:01:44 +0200
commit9711f50e204c6e918a983e9dbfa864fd006acb01 (patch)
treeb1bab7a3a7040ee3c4e27670a13586140b0c494d /src/drivers
parentAdd MCA devices (diff)
downloadipxe-9711f50e204c6e918a983e9dbfa864fd006acb01.tar.gz
ipxe-9711f50e204c6e918a983e9dbfa864fd006acb01.tar.xz
ipxe-9711f50e204c6e918a983e9dbfa864fd006acb01.zip
Created separate isa_ids.h file and a utility function to print out ISA
IDs in a human-readable format.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/bus/isa_ids.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/drivers/bus/isa_ids.c b/src/drivers/bus/isa_ids.c
new file mode 100644
index 000000000..f7be1129c
--- /dev/null
+++ b/src/drivers/bus/isa_ids.c
@@ -0,0 +1,24 @@
+#include "etherboot.h"
+#include "isa_ids.h"
+
+/*
+ * EISA and ISAPnP IDs are actually mildly human readable, though in a
+ * somewhat brain-damaged way.
+ *
+ */
+char * isa_id_string ( uint16_t vendor, uint16_t product ) {
+ static unsigned char buf[7];
+ int i;
+
+ /* Vendor ID is a compressed ASCII string */
+ vendor = htons ( vendor );
+ for ( i = 2 ; i >= 0 ; i-- ) {
+ buf[i] = ( 'A' - 1 + ( vendor & 0x1f ) );
+ vendor >>= 5;
+ }
+
+ /* Product ID is a 4-digit hex string */
+ sprintf ( &buf[3], "%hx", htons ( product ) );
+
+ return buf;
+}