eisa.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef _LINUX_EISA_H
  2. #define _LINUX_EISA_H
  3. #include <linux/ioport.h>
  4. #include <linux/device.h>
  5. #define EISA_SIG_LEN 8
  6. #define EISA_MAX_SLOTS 8
  7. #define EISA_MAX_RESOURCES 4
  8. /* A few EISA constants/offsets... */
  9. #define EISA_DMA1_STATUS 8
  10. #define EISA_INT1_CTRL 0x20
  11. #define EISA_INT1_MASK 0x21
  12. #define EISA_INT2_CTRL 0xA0
  13. #define EISA_INT2_MASK 0xA1
  14. #define EISA_DMA2_STATUS 0xD0
  15. #define EISA_DMA2_WRITE_SINGLE 0xD4
  16. #define EISA_EXT_NMI_RESET_CTRL 0x461
  17. #define EISA_INT1_EDGE_LEVEL 0x4D0
  18. #define EISA_INT2_EDGE_LEVEL 0x4D1
  19. #define EISA_VENDOR_ID_OFFSET 0xC80
  20. #define EISA_CONFIG_OFFSET 0xC84
  21. #define EISA_CONFIG_ENABLED 1
  22. #define EISA_CONFIG_FORCED 2
  23. /* The EISA signature, in ASCII form, null terminated */
  24. struct eisa_device_id {
  25. char sig[EISA_SIG_LEN];
  26. unsigned long driver_data;
  27. };
  28. /* There is not much we can say about an EISA device, apart from
  29. * signature, slot number, and base address. dma_mask is set by
  30. * default to parent device mask..*/
  31. struct eisa_device {
  32. struct eisa_device_id id;
  33. int slot;
  34. int state;
  35. unsigned long base_addr;
  36. struct resource res[EISA_MAX_RESOURCES];
  37. u64 dma_mask;
  38. struct device dev; /* generic device */
  39. #ifdef CONFIG_EISA_NAMES
  40. char pretty_name[DEVICE_NAME_SIZE];
  41. #endif
  42. };
  43. #define to_eisa_device(n) container_of(n, struct eisa_device, dev)
  44. static inline int eisa_get_region_index (void *addr)
  45. {
  46. unsigned long x = (unsigned long) addr;
  47. x &= 0xc00;
  48. return (x >> 12);
  49. }
  50. struct eisa_driver {
  51. const struct eisa_device_id *id_table;
  52. struct device_driver driver;
  53. };
  54. #define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver)
  55. extern struct bus_type eisa_bus_type;
  56. int eisa_driver_register (struct eisa_driver *edrv);
  57. void eisa_driver_unregister (struct eisa_driver *edrv);
  58. /* Mimics pci.h... */
  59. static inline void *eisa_get_drvdata (struct eisa_device *edev)
  60. {
  61. return edev->dev.driver_data;
  62. }
  63. static inline void eisa_set_drvdata (struct eisa_device *edev, void *data)
  64. {
  65. edev->dev.driver_data = data;
  66. }
  67. /* The EISA root device. There's rumours about machines with multiple
  68. * busses (PA-RISC ?), so we try to handle that. */
  69. struct eisa_root_device {
  70. struct device *dev; /* Pointer to bridge device */
  71. struct resource *res;
  72. unsigned long bus_base_addr;
  73. int slots; /* Max slot number */
  74. int force_probe; /* Probe even when no slot 0 */
  75. u64 dma_mask; /* from bridge device */
  76. int bus_nr; /* Set by eisa_root_register */
  77. struct resource eisa_root_res; /* ditto */
  78. };
  79. int eisa_root_register (struct eisa_root_device *root);
  80. #ifdef CONFIG_EISA
  81. extern int EISA_bus;
  82. #else
  83. # define EISA_bus 0
  84. #endif
  85. #endif