diff options
Diffstat (limited to 'contrib/syslinux-4.02/gpxe/src/drivers/bus/isa_ids.c')
-rw-r--r-- | contrib/syslinux-4.02/gpxe/src/drivers/bus/isa_ids.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/gpxe/src/drivers/bus/isa_ids.c b/contrib/syslinux-4.02/gpxe/src/drivers/bus/isa_ids.c new file mode 100644 index 0000000..7310158 --- /dev/null +++ b/contrib/syslinux-4.02/gpxe/src/drivers/bus/isa_ids.c @@ -0,0 +1,26 @@ +#include <stdint.h> +#include <stdio.h> +#include <byteswap.h> +#include <gpxe/isa_ids.h> + +/* + * EISA and ISAPnP IDs are actually mildly human readable, though in a + * somewhat brain-damaged way. + * + */ +char * isa_id_string ( unsigned int vendor, unsigned int product ) { + static char buf[7]; + int i; + + /* Vendor ID is a compressed ASCII string */ + vendor = bswap_16 ( 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], "%04x", bswap_16 ( product ) ); + + return buf; +} |