iPXE
Functions
isa_ids.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <byteswap.h>
#include <ipxe/isa_ids.h>

Go to the source code of this file.

Functions

char * isa_id_string (unsigned int vendor, unsigned int product)

Function Documentation

char* isa_id_string ( unsigned int  vendor,
unsigned int  product 
)

Definition at line 11 of file isa_ids.c.

References bswap_16, and sprintf.

Referenced by eisa_probe(), and isapnp_probe().

                                                                   {
        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;
}