Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526
  1. #include "stdint.h"
  2. #include "byteswap.h"
  3. #include "console.h"
  4. #include "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 ( uint16_t vendor, uint16_t product ) {
  11. static unsigned 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], "%hx", __bswap_16 ( product ) );
  21. return buf;
  22. }