ide.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * linux/include/asm-i386/ide.h
  3. *
  4. * Copyright (C) 1994-1996 Linus Torvalds & authors
  5. */
  6. /*
  7. * This file contains the i386 architecture specific IDE code.
  8. */
  9. #ifndef __ASMi386_IDE_H
  10. #define __ASMi386_IDE_H
  11. #ifdef __KERNEL__
  12. #include <linux/config.h>
  13. #ifndef MAX_HWIFS
  14. # ifdef CONFIG_BLK_DEV_IDEPCI
  15. #define MAX_HWIFS 10
  16. # else
  17. #define MAX_HWIFS 6
  18. # endif
  19. #endif
  20. #define IDE_ARCH_OBSOLETE_DEFAULTS
  21. static __inline__ int ide_default_irq(unsigned long base)
  22. {
  23. switch (base) {
  24. case 0x1f0: return 14;
  25. case 0x170: return 15;
  26. case 0x1e8: return 11;
  27. case 0x168: return 10;
  28. case 0x1e0: return 8;
  29. case 0x160: return 12;
  30. default:
  31. return 0;
  32. }
  33. }
  34. static __inline__ unsigned long ide_default_io_base(int index)
  35. {
  36. if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
  37. switch(index) {
  38. case 2: return 0x1e8;
  39. case 3: return 0x168;
  40. case 4: return 0x1e0;
  41. case 5: return 0x160;
  42. }
  43. }
  44. switch (index) {
  45. case 0: return 0x1f0;
  46. case 1: return 0x170;
  47. default:
  48. return 0;
  49. }
  50. }
  51. #define IDE_ARCH_OBSOLETE_INIT
  52. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  53. #ifdef CONFIG_BLK_DEV_IDEPCI
  54. #define ide_init_default_irq(base) (0)
  55. #else
  56. #define ide_init_default_irq(base) ide_default_irq(base)
  57. #endif
  58. #include <asm-generic/ide_iops.h>
  59. #endif /* __KERNEL__ */
  60. #endif /* __ASMi386_IDE_H */