您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

isa_ids.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #define ISA_BUS_TYPE 2
  20. /*
  21. * Construct a vendor ID from three ASCII characters
  22. *
  23. */
  24. #define ISA_VENDOR(a,b,c) (((((a)-'A'+1)&0x3f)<<2)|\
  25. ((((b)-'A'+1)&0x18)>>3)|((((b)-'A'+1)&7)<<13)|\
  26. ((((c)-'A'+1)&0x1f)<<8))
  27. #define ISAPNP_VENDOR(a,b,c) ISA_VENDOR(a,b,c)
  28. #define EISA_VENDOR(a,b,c) ISA_VENDOR(a,b,c)
  29. #define GENERIC_ISAPNP_VENDOR ISAPNP_VENDOR('P','N','P')
  30. /*
  31. * Extract product ID and revision from combined product field
  32. *
  33. */
  34. #define ISA_PROD_ID_MASK ( 0xf0ff )
  35. #define ISA_PROD_ID(product) ( (product) & ISA_PROD_ID_MASK )
  36. #define ISA_PROD_REV(product) ( ( (product) & ~ISA_PROD_ID_MASK ) >> 8 )
  37. /* Functions in isa_ids.c */
  38. extern char * isa_id_string ( uint16_t vendor, uint16_t product );
  39. #endif /* ISA_IDS_H */