2007-03-10 18:08:33 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <byteswap.h>
|
2010-04-19 20:16:01 +01:00
|
|
|
#include <ipxe/isa_ids.h>
|
2005-04-13 12:01:44 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* EISA and ISAPnP IDs are actually mildly human readable, though in a
|
|
|
|
|
* somewhat brain-damaged way.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2007-03-10 18:08:33 +00:00
|
|
|
char * isa_id_string ( unsigned int vendor, unsigned int product ) {
|
|
|
|
|
static char buf[7];
|
2005-04-13 12:01:44 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* Vendor ID is a compressed ASCII string */
|
2005-04-21 16:38:28 +00:00
|
|
|
vendor = bswap_16 ( vendor );
|
2005-04-13 12:01:44 +00:00
|
|
|
for ( i = 2 ; i >= 0 ; i-- ) {
|
|
|
|
|
buf[i] = ( 'A' - 1 + ( vendor & 0x1f ) );
|
|
|
|
|
vendor >>= 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Product ID is a 4-digit hex string */
|
2007-03-10 18:08:33 +00:00
|
|
|
sprintf ( &buf[3], "%04x", bswap_16 ( product ) );
|
2005-04-13 12:01:44 +00:00
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
|
}
|