diff options
author | msmith <msmith@FreeBSD.org> | 1998-10-22 20:20:51 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-10-22 20:20:51 +0000 |
commit | 973bf974871815ca2ba384da2fac0739f974f4f4 (patch) | |
tree | c9560ed612e5ea610cfd5839bc31a1c176ca427e /sys/boot/common/pnp.c | |
parent | 83d29b9bb2e230f2d2ecb7d559d94c2318241936 (diff) | |
download | FreeBSD-src-973bf974871815ca2ba384da2fac0739f974f4f4.zip FreeBSD-src-973bf974871815ca2ba384da2fac0739f974f4f4.tar.gz |
Export an interface for presetting the ISA PnP read port address.
Make the EISA ID formatter generally available
Diffstat (limited to 'sys/boot/common/pnp.c')
-rw-r--r-- | sys/boot/common/pnp.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/boot/common/pnp.c b/sys/boot/common/pnp.c index 128bb22..9ace16d 100644 --- a/sys/boot/common/pnp.c +++ b/sys/boot/common/pnp.c @@ -74,8 +74,8 @@ pnp_scan(int argc, char *argv[]) if (pi->pi_desc != NULL) { pager_output(" : "); pager_output(pi->pi_desc); - pager_output("\n"); } + pager_output("\n"); } pager_close(); } @@ -355,3 +355,25 @@ pnp_addinfo(struct pnpinfo *pi) STAILQ_INSERT_TAIL(&pnp_devices, pi, pi_link); } + +/* + * Format an EISA id as a string in standard ISA PnP format, AAAIIRR + * where 'AAA' is the EISA vendor ID, II is the product ID and RR the revision ID. + */ +char * +pnp_eisaformat(u_int8_t *data) +{ + static char idbuf[8]; + const char hextoascii[] = "0123456789abcdef"; + + idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); + idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); + idbuf[2] = '@' + (data[1] & 0x1f); + idbuf[3] = hextoascii[(data[2] >> 4)]; + idbuf[4] = hextoascii[(data[2] & 0xf)]; + idbuf[5] = hextoascii[(data[3] >> 4)]; + idbuf[6] = hextoascii[(data[3] & 0xf)]; + idbuf[7] = 0; + return(idbuf); +} + |