david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/drivers/bus/isa_ids.c
Michael Brown 8406115834 [build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated
resources has been revoked by the registrant of the domain.  Work
around this problem by renaming project from gPXE to iPXE, and
updating URLs to match.

Also update README, LOG and COPYRIGHTS to remove obsolete information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:39 +01:00

27 lines
584 B
C

#include <stdint.h>
#include <stdio.h>
#include <byteswap.h>
#include <ipxe/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;
}