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

◆ isa_id_string()

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

Definition at line 11 of file isa_ids.c.

11  {
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 }
static unsigned short vendor
Definition: davicom.c:128
#define sprintf(buf, fmt,...)
Write a formatted string to a buffer.
Definition: stdio.h:36
#define bswap_16(value)
Definition: byteswap.h:58
uint8_t product
Product string.
Definition: smbios.h:16

References bswap_16, product, sprintf, and vendor.

Referenced by eisa_probe(), and isapnp_probe().