ide.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. switch (index) {
  37. case 0: return 0x1f0;
  38. case 1: return 0x170;
  39. case 2: return 0x1e8;
  40. case 3: return 0x168;
  41. case 4: return 0x1e0;
  42. case 5: return 0x160;
  43. default:
  44. return 0;
  45. }
  46. }
  47. #define IDE_ARCH_OBSOLETE_INIT
  48. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  49. #ifdef CONFIG_BLK_DEV_IDEPCI
  50. #define ide_init_default_irq(base) (0)
  51. #else
  52. #define ide_init_default_irq(base) ide_default_irq(base)
  53. #endif
  54. #include <asm-generic/ide_iops.h>
  55. #endif /* __KERNEL__ */
  56. #endif /* __ASMi386_IDE_H */