You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isa_ids.c 584B

1234567891011121314151617181920212223242526
  1. #include <stdint.h>
  2. #include <stdio.h>
  3. #include <byteswap.h>
  4. #include <ipxe/isa_ids.h>
  5. /*
  6. * EISA and ISAPnP IDs are actually mildly human readable, though in a
  7. * somewhat brain-damaged way.
  8. *
  9. */
  10. char * isa_id_string ( unsigned int vendor, unsigned int product ) {
  11. static char buf[7];
  12. int i;
  13. /* Vendor ID is a compressed ASCII string */
  14. vendor = bswap_16 ( vendor );
  15. for ( i = 2 ; i >= 0 ; i-- ) {
  16. buf[i] = ( 'A' - 1 + ( vendor & 0x1f ) );
  17. vendor >>= 5;
  18. }
  19. /* Product ID is a 4-digit hex string */
  20. sprintf ( &buf[3], "%04x", bswap_16 ( product ) );
  21. return buf;
  22. }