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.

mca.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * MCA bus driver code
  3. *
  4. * Abstracted from 3c509.c.
  5. *
  6. */
  7. #ifndef MCA_H
  8. #define MCA_H
  9. /*
  10. * MCA constants
  11. *
  12. */
  13. #define MCA_MOTHERBOARD_SETUP_REG 0x94
  14. #define MCA_ADAPTER_SETUP_REG 0x96
  15. #define MCA_MAX_SLOT_NR 8
  16. #define MCA_POS_REG(n) (0x100+(n))
  17. /* Is there a standard that would define this? */
  18. #include "isa_ids.h"
  19. #define GENERIC_MCA_VENDOR ISA_VENDOR ( 'M', 'C', 'A' )
  20. /*
  21. * A physical MCA device
  22. *
  23. */
  24. struct dev;
  25. struct mca_device {
  26. char *magic; /* must be first */
  27. struct dev *dev;
  28. unsigned int slot;
  29. unsigned char pos[8];
  30. int already_tried;
  31. };
  32. #define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
  33. /*
  34. * An individual MCA device identified by ID
  35. *
  36. */
  37. struct mca_id {
  38. const char *name;
  39. int id;
  40. };
  41. /*
  42. * An MCA driver, with a device ID (struct mca_id) table.
  43. *
  44. */
  45. struct mca_driver {
  46. const char *name;
  47. struct mca_id *ids;
  48. unsigned int id_count;
  49. };
  50. /*
  51. * Define an MCA driver
  52. *
  53. */
  54. #define MCA_DRIVER( driver_name, mca_ids ) { \
  55. .name = driver_name, \
  56. .ids = mca_ids, \
  57. .id_count = sizeof ( mca_ids ) / sizeof ( mca_ids[0] ), \
  58. }
  59. /*
  60. * Functions in mca.c
  61. *
  62. */
  63. extern struct mca_device * mca_device ( struct dev *dev );
  64. extern int find_mca_device ( struct mca_device *mca,
  65. struct mca_driver *driver );
  66. #endif