iPXE
Macros | Functions
isa_ids.h File Reference
#include <byteswap.h>

Go to the source code of this file.

Macros

#define ISA_VENDOR(a, b, c)
 
#define ISAPNP_VENDOR(a, b, c)   ISA_VENDOR ( a, b, c )
 
#define EISA_VENDOR(a, b, c)   ISA_VENDOR ( a, b, c )
 
#define GENERIC_ISAPNP_VENDOR   ISAPNP_VENDOR ( 'P','N','P' )
 
#define ISA_PROD_ID_MASK   ( 0xf0ff )
 
#define ISA_PROD_ID(product)   ( (product) & ISA_PROD_ID_MASK )
 
#define ISA_PROD_REV(product)   ( ( (product) & ~ISA_PROD_ID_MASK ) >> 8 )
 

Functions

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

Macro Definition Documentation

◆ ISA_VENDOR

#define ISA_VENDOR (   a,
  b,
  c 
)
Value:
bswap_16 ( ( ( ( (a) - 'A' + 1 ) & 0x1f ) << 10 ) | \
( ( ( (b) - 'A' + 1 ) & 0x1f ) << 5 ) | \
( ( ( (c) - 'A' + 1 ) & 0x1f ) << 0 ) )
uint32_t c
Definition: md4.c:30
uint32_t a
Definition: md4.c:28
#define bswap_16(value)
Definition: byteswap.h:58
uint32_t b
Definition: md4.c:29

Definition at line 30 of file isa_ids.h.

◆ ISAPNP_VENDOR

#define ISAPNP_VENDOR (   a,
  b,
  c 
)    ISA_VENDOR ( a, b, c )

Definition at line 35 of file isa_ids.h.

◆ EISA_VENDOR

#define EISA_VENDOR (   a,
  b,
  c 
)    ISA_VENDOR ( a, b, c )

Definition at line 36 of file isa_ids.h.

◆ GENERIC_ISAPNP_VENDOR

#define GENERIC_ISAPNP_VENDOR   ISAPNP_VENDOR ( 'P','N','P' )

Definition at line 38 of file isa_ids.h.

◆ ISA_PROD_ID_MASK

#define ISA_PROD_ID_MASK   ( 0xf0ff )

Definition at line 44 of file isa_ids.h.

◆ ISA_PROD_ID

#define ISA_PROD_ID (   product)    ( (product) & ISA_PROD_ID_MASK )

Definition at line 45 of file isa_ids.h.

◆ ISA_PROD_REV

#define ISA_PROD_REV (   product)    ( ( (product) & ~ISA_PROD_ID_MASK ) >> 8 )

Definition at line 46 of file isa_ids.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ 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 }
#define sprintf(buf, fmt,...)
Write a formatted string to a buffer.
Definition: stdio.h:36
#define bswap_16(value)
Definition: byteswap.h:58
union bootph_vendor vendor
uint8_t product
Product string.
Definition: smbios.h:16

References bswap_16, product, sprintf, and vendor.

Referenced by eisa_probe(), and isapnp_probe().