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.

eisa.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef EISA_H
  2. #define EISA_H
  3. #include "isa_ids.h"
  4. /*
  5. * EISA constants
  6. *
  7. */
  8. #define EISA_MIN_SLOT (0x1)
  9. #define EISA_MAX_SLOT (0xf)
  10. #define EISA_SLOT_BASE( n ) ( 0x1000 * (n) )
  11. #define EISA_MFG_ID_HI ( 0xc80 )
  12. #define EISA_MFG_ID_LO ( 0xc81 )
  13. #define EISA_PROD_ID_HI ( 0xc82 )
  14. #define EISA_PROD_ID_LO ( 0xc83 )
  15. #define EISA_GLOBAL_CONFIG ( 0xc84 )
  16. #define EISA_CMD_RESET ( 1 << 2 )
  17. #define EISA_CMD_ENABLE ( 1 << 0 )
  18. /*
  19. * A physical EISA device
  20. *
  21. */
  22. struct dev;
  23. struct eisa_device {
  24. char *magic; /* must be first */
  25. struct dev *dev;
  26. unsigned int slot;
  27. uint16_t ioaddr;
  28. uint16_t mfg_id;
  29. uint16_t prod_id;
  30. int already_tried;
  31. };
  32. /*
  33. * An individual EISA device identified by ID
  34. *
  35. */
  36. struct eisa_id {
  37. const char *name;
  38. uint16_t mfg_id, prod_id;
  39. };
  40. /*
  41. * An EISA driver, with a device ID (struct eisa_id) table.
  42. *
  43. */
  44. struct eisa_driver {
  45. const char *name;
  46. struct eisa_id *ids;
  47. unsigned int id_count;
  48. };
  49. /*
  50. * Define an EISA driver
  51. *
  52. */
  53. #define EISA_DRIVER( driver_name, eisa_ids ) { \
  54. .name = driver_name, \
  55. .ids = eisa_ids, \
  56. .id_count = sizeof ( eisa_ids ) / sizeof ( eisa_ids[0] ), \
  57. }
  58. /*
  59. * Functions in eisa.c
  60. *
  61. */
  62. extern struct eisa_device * eisa_device ( struct dev *dev );
  63. extern int find_eisa_device ( struct eisa_device *eisa,
  64. struct eisa_driver *driver );
  65. extern void enable_eisa_device ( struct eisa_device *eisa );
  66. #endif /* EISA_H */