source: bootcd/isolinux/syslinux-6.03/gpxe/src/drivers/bus/isa_ids.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 584 bytes
Line 
1#include <stdint.h>
2#include <stdio.h>
3#include <byteswap.h>
4#include <gpxe/isa_ids.h>
5
6/*
7 * EISA and ISAPnP IDs are actually mildly human readable, though in a
8 * somewhat brain-damaged way.
9 *
10 */
11char * isa_id_string ( unsigned int vendor, unsigned int product ) {
12        static char buf[7];
13        int i;
14
15        /* Vendor ID is a compressed ASCII string */
16        vendor = bswap_16 ( vendor );
17        for ( i = 2 ; i >= 0 ; i-- ) {
18                buf[i] = ( 'A' - 1 + ( vendor & 0x1f ) );
19                vendor >>= 5;
20        }
21       
22        /* Product ID is a 4-digit hex string */
23        sprintf ( &buf[3], "%04x", bswap_16 ( product ) );
24
25        return buf;
26}
Note: See TracBrowser for help on using the repository browser.