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

Go to the source code of this file.

Defines

#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)

Define Documentation

#define ISA_VENDOR (   a,
  b,
 
)
Value:
bswap_16 ( ( ( ( (a) - 'A' + 1 ) & 0x1f ) << 10 ) |     \
                   ( ( ( (b) - 'A' + 1 ) & 0x1f ) << 5 ) |      \
                   ( ( ( (c) - 'A' + 1 ) & 0x1f ) << 0 ) )

Definition at line 30 of file isa_ids.h.

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

Definition at line 35 of file isa_ids.h.

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

Definition at line 36 of file isa_ids.h.

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

Definition at line 38 of file isa_ids.h.

Referenced by eth_probe().

#define ISA_PROD_ID_MASK   ( 0xf0ff )

Definition at line 44 of file isa_ids.h.

Referenced by el3_eisa_probe(), and legacy_t509_probe().

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

Definition at line 45 of file isa_ids.h.

Referenced by eisa_probe(), el3_eisa_probe(), isapnp_probe(), and legacy_t509_probe().

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

Definition at line 46 of file isa_ids.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
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;
}