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.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef ISA_IDS_H
  2. #define ISA_IDS_H
  3. /*
  4. * This file defines IDs as used by ISAPnP and EISA devices. These
  5. * IDs have the format:
  6. *
  7. * vendor byte 0 bit 7 must be zero
  8. * bits 6-2 first vendor char in compressed ASCII
  9. * bits 1-0 second vendor char in compressed ASCII (bits 4-3)
  10. * byte 1 bits 7-5 second vendor char in compressed ASCII (bits 2-0)
  11. * bits 4-0 third vendor char in compressed ASCII
  12. * product byte 0 bits 7-4 first hex digit of product number
  13. * bits 3-0 second hex digit of product number
  14. * byte 1 bits 7-4 third hex digit of product number
  15. * bits 3-0 hex digit of revision level
  16. *
  17. */
  18. #include "stdint.h"
  19. /*
  20. * Construct a vendor ID from three ASCII characters
  21. *
  22. */
  23. #define ISA_VENDOR(a,b,c) (((((a)-'A'+1)&0x3f)<<2)|\
  24. ((((b)-'A'+1)&0x18)>>3)|((((b)-'A'+1)&7)<<13)|\
  25. ((((c)-'A'+1)&0x1f)<<8))
  26. #define ISAPNP_VENDOR(a,b,c) ISA_VENDOR(a,b,c)
  27. #define EISA_VENDOR(a,b,c) ISA_VENDOR(a,b,c)
  28. #define GENERIC_ISAPNP_VENDOR ISAPNP_VENDOR('P','N','P')
  29. /*
  30. * Extract product ID and revision from combined product field
  31. *
  32. */
  33. #define ISA_PROD_ID_MASK ( 0xf0ff )
  34. #define ISA_PROD_ID(product) ( (product) & ISA_PROD_ID_MASK )
  35. #define ISA_PROD_REV(product) ( ( (product) & ~ISA_PROD_ID_MASK ) >> 8 )
  36. /* Functions in isa_ids.c */
  37. extern char * isa_id_string ( uint16_t vendor, uint16_t product );
  38. #endif /* ISA_IDS_H */