ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / ide.h
1 /*
2  *  linux/include/asm-ia64/ide.h
3  *
4  *  Copyright (C) 1994-1996  Linus Torvalds & authors
5  */
6
7 /*
8  *  This file contains the ia64 architecture specific IDE code.
9  */
10
11 #ifndef __ASM_IA64_IDE_H
12 #define __ASM_IA64_IDE_H
13
14 #ifdef __KERNEL__
15
16 #include <linux/config.h>
17
18 #include <linux/irq.h>
19
20 #ifndef MAX_HWIFS
21 # ifdef CONFIG_PCI
22 #define MAX_HWIFS       10
23 # else
24 #define MAX_HWIFS       6
25 # endif
26 #endif
27
28 static inline int ide_default_irq(unsigned long base)
29 {
30         switch (base) {
31               case 0x1f0: return isa_irq_to_vector(14);
32               case 0x170: return isa_irq_to_vector(15);
33               case 0x1e8: return isa_irq_to_vector(11);
34               case 0x168: return isa_irq_to_vector(10);
35               case 0x1e0: return isa_irq_to_vector(8);
36               case 0x160: return isa_irq_to_vector(12);
37               default:
38                 return 0;
39         }
40 }
41
42 static inline unsigned long ide_default_io_base(int index)
43 {
44         switch (index) {
45               case 0: return 0x1f0;
46               case 1: return 0x170;
47               case 2: return 0x1e8;
48               case 3: return 0x168;
49               case 4: return 0x1e0;
50               case 5: return 0x160;
51               default:
52                 return 0;
53         }
54 }
55
56 #ifdef CONFIG_PCI
57 #define ide_init_default_irq(base)      (0)
58 #else
59 #define ide_init_default_irq(base)      ide_default_irq(base)
60 #endif
61
62 #include <asm-generic/ide_iops.h>
63
64 #endif /* __KERNEL__ */
65
66 #endif /* __ASM_IA64_IDE_H */