diff options
Diffstat (limited to 'include')
91 files changed, 1887 insertions, 268 deletions
diff --git a/include/asm-alpha/libata-portmap.h b/include/asm-alpha/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-alpha/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-arm/arch-ep93xx/ep93xx-regs.h b/include/asm-arm/arch-ep93xx/ep93xx-regs.h index 8c322975f96e..593f562f85c3 100644 --- a/include/asm-arm/arch-ep93xx/ep93xx-regs.h +++ b/include/asm-arm/arch-ep93xx/ep93xx-regs.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define EP93XX_DMA_BASE (EP93XX_AHB_VIRT_BASE + 0x00000000) | 27 | #define EP93XX_DMA_BASE (EP93XX_AHB_VIRT_BASE + 0x00000000) |
28 | 28 | ||
29 | #define EP93XX_ETHERNET_BASE (EP93XX_AHB_VIRT_BASE + 0x00010000) | 29 | #define EP93XX_ETHERNET_BASE (EP93XX_AHB_VIRT_BASE + 0x00010000) |
30 | #define EP93XX_ETHERNET_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00010000) | ||
30 | 31 | ||
31 | #define EP93XX_USB_BASE (EP93XX_AHB_VIRT_BASE + 0x00020000) | 32 | #define EP93XX_USB_BASE (EP93XX_AHB_VIRT_BASE + 0x00020000) |
32 | #define EP93XX_USB_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00020000) | 33 | #define EP93XX_USB_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00020000) |
diff --git a/include/asm-arm/arch-ep93xx/platform.h b/include/asm-arm/arch-ep93xx/platform.h index d7a34ce20293..b4a8deb8bdef 100644 --- a/include/asm-arm/arch-ep93xx/platform.h +++ b/include/asm-arm/arch-ep93xx/platform.h | |||
@@ -11,5 +11,11 @@ void ep93xx_init_devices(void); | |||
11 | void ep93xx_clock_init(void); | 11 | void ep93xx_clock_init(void); |
12 | extern struct sys_timer ep93xx_timer; | 12 | extern struct sys_timer ep93xx_timer; |
13 | 13 | ||
14 | struct ep93xx_eth_data | ||
15 | { | ||
16 | unsigned char dev_addr[6]; | ||
17 | unsigned char phy_id; | ||
18 | }; | ||
19 | |||
14 | 20 | ||
15 | #endif | 21 | #endif |
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index ae7baa6c73f7..17f0c656d272 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -8,9 +8,6 @@ | |||
8 | 8 | ||
9 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
10 | #include <asm/user.h> | 10 | #include <asm/user.h> |
11 | #ifdef __KERNEL | ||
12 | #include <asm/procinfo.h> | ||
13 | #endif | ||
14 | 11 | ||
15 | typedef unsigned long elf_greg_t; | 12 | typedef unsigned long elf_greg_t; |
16 | typedef unsigned long elf_freg_t[3]; | 13 | typedef unsigned long elf_freg_t[3]; |
@@ -32,11 +29,6 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |||
32 | typedef struct user_fp elf_fpregset_t; | 29 | typedef struct user_fp elf_fpregset_t; |
33 | 30 | ||
34 | /* | 31 | /* |
35 | * This is used to ensure we don't load something for the wrong architecture. | ||
36 | */ | ||
37 | #define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) ) | ||
38 | |||
39 | /* | ||
40 | * These are used to set parameters in the core dumps. | 32 | * These are used to set parameters in the core dumps. |
41 | */ | 33 | */ |
42 | #define ELF_CLASS ELFCLASS32 | 34 | #define ELF_CLASS ELFCLASS32 |
@@ -47,6 +39,14 @@ typedef struct user_fp elf_fpregset_t; | |||
47 | #endif | 39 | #endif |
48 | #define ELF_ARCH EM_ARM | 40 | #define ELF_ARCH EM_ARM |
49 | 41 | ||
42 | #ifdef __KERNEL__ | ||
43 | #include <asm/procinfo.h> | ||
44 | |||
45 | /* | ||
46 | * This is used to ensure we don't load something for the wrong architecture. | ||
47 | */ | ||
48 | #define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) ) | ||
49 | |||
50 | #define USE_ELF_CORE_DUMP | 50 | #define USE_ELF_CORE_DUMP |
51 | #define ELF_EXEC_PAGESIZE 4096 | 51 | #define ELF_EXEC_PAGESIZE 4096 |
52 | 52 | ||
@@ -83,8 +83,6 @@ typedef struct user_fp elf_fpregset_t; | |||
83 | extern char elf_platform[]; | 83 | extern char elf_platform[]; |
84 | #define ELF_PLATFORM (elf_platform) | 84 | #define ELF_PLATFORM (elf_platform) |
85 | 85 | ||
86 | #ifdef __KERNEL__ | ||
87 | |||
88 | /* | 86 | /* |
89 | * 32-bit code is always OK. Some cpus can do 26-bit, some can't. | 87 | * 32-bit code is always OK. Some cpus can do 26-bit, some can't. |
90 | */ | 88 | */ |
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index b721270b9986..02bd3ee935b0 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h | |||
@@ -11,13 +11,13 @@ | |||
11 | #define _ASMARM_PAGE_H | 11 | #define _ASMARM_PAGE_H |
12 | 12 | ||
13 | 13 | ||
14 | #ifdef __KERNEL__ | ||
15 | |||
14 | /* PAGE_SHIFT determines the page size */ | 16 | /* PAGE_SHIFT determines the page size */ |
15 | #define PAGE_SHIFT 12 | 17 | #define PAGE_SHIFT 12 |
16 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 18 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
17 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 19 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
18 | 20 | ||
19 | #ifdef __KERNEL__ | ||
20 | |||
21 | /* to align the pointer to the (next) page boundary */ | 21 | /* to align the pointer to the (next) page boundary */ |
22 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | 22 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) |
23 | 23 | ||
diff --git a/include/asm-arm26/Kbuild b/include/asm-arm26/Kbuild deleted file mode 100644 index c68e1680da01..000000000000 --- a/include/asm-arm26/Kbuild +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild index c68e1680da01..14498d5a2f65 100644 --- a/include/asm-cris/Kbuild +++ b/include/asm-cris/Kbuild | |||
@@ -1 +1,5 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | |||
3 | header-y += arch-v10/ arch-v32/ | ||
4 | |||
5 | unifdef-y += rs485.h | ||
diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild new file mode 100644 index 000000000000..d7f27dc0941a --- /dev/null +++ b/include/asm-cris/arch-v10/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += ptrace.h | ||
2 | header-y += user.h | ||
diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild new file mode 100644 index 000000000000..d7f27dc0941a --- /dev/null +++ b/include/asm-cris/arch-v32/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += ptrace.h | ||
2 | header-y += user.h | ||
diff --git a/include/asm-cris/byteorder.h b/include/asm-cris/byteorder.h index a1a222adaa9f..0cd9db1cc888 100644 --- a/include/asm-cris/byteorder.h +++ b/include/asm-cris/byteorder.h | |||
@@ -3,14 +3,15 @@ | |||
3 | 3 | ||
4 | #ifdef __GNUC__ | 4 | #ifdef __GNUC__ |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
6 | #include <asm/arch/byteorder.h> | 7 | #include <asm/arch/byteorder.h> |
7 | 8 | ||
8 | /* defines are necessary because the other files detect the presence | 9 | /* defines are necessary because the other files detect the presence |
9 | * of a defined __arch_swab32, not an inline | 10 | * of a defined __arch_swab32, not an inline |
10 | */ | 11 | */ |
11 | |||
12 | #define __arch__swab32(x) ___arch__swab32(x) | 12 | #define __arch__swab32(x) ___arch__swab32(x) |
13 | #define __arch__swab16(x) ___arch__swab16(x) | 13 | #define __arch__swab16(x) ___arch__swab16(x) |
14 | #endif /* __KERNEL__ */ | ||
14 | 15 | ||
15 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | 16 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) |
16 | # define __BYTEORDER_HAS_U64__ | 17 | # define __BYTEORDER_HAS_U64__ |
diff --git a/include/asm-cris/elf.h b/include/asm-cris/elf.h index 87a60bd8e667..96a40c1de57c 100644 --- a/include/asm-cris/elf.h +++ b/include/asm-cris/elf.h | |||
@@ -5,7 +5,6 @@ | |||
5 | * ELF register definitions.. | 5 | * ELF register definitions.. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <asm/arch/elf.h> | ||
9 | #include <asm/user.h> | 8 | #include <asm/user.h> |
10 | 9 | ||
11 | #define R_CRIS_NONE 0 | 10 | #define R_CRIS_NONE 0 |
@@ -46,6 +45,9 @@ typedef unsigned long elf_fpregset_t; | |||
46 | #define ELF_DATA ELFDATA2LSB | 45 | #define ELF_DATA ELFDATA2LSB |
47 | #define ELF_ARCH EM_CRIS | 46 | #define ELF_ARCH EM_CRIS |
48 | 47 | ||
48 | #ifdef __KERNEL__ | ||
49 | #include <asm/arch/elf.h> | ||
50 | |||
49 | /* The master for these definitions is {binutils}/include/elf/cris.h: */ | 51 | /* The master for these definitions is {binutils}/include/elf/cris.h: */ |
50 | /* User symbols in this file have a leading underscore. */ | 52 | /* User symbols in this file have a leading underscore. */ |
51 | #define EF_CRIS_UNDERSCORE 0x00000001 | 53 | #define EF_CRIS_UNDERSCORE 0x00000001 |
@@ -87,8 +89,8 @@ typedef unsigned long elf_fpregset_t; | |||
87 | 89 | ||
88 | #define ELF_PLATFORM (NULL) | 90 | #define ELF_PLATFORM (NULL) |
89 | 91 | ||
90 | #ifdef __KERNEL__ | ||
91 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | 92 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) |
92 | #endif | 93 | |
94 | #endif /* __KERNEL__ */ | ||
93 | 95 | ||
94 | #endif | 96 | #endif |
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index 81832e9e157f..9f13c32552bf 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _CRIS_PAGE_H | 1 | #ifndef _CRIS_PAGE_H |
2 | #define _CRIS_PAGE_H | 2 | #define _CRIS_PAGE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
4 | #include <asm/arch/page.h> | 6 | #include <asm/arch/page.h> |
5 | 7 | ||
6 | /* PAGE_SHIFT determines the page size */ | 8 | /* PAGE_SHIFT determines the page size */ |
@@ -12,8 +14,6 @@ | |||
12 | #endif | 14 | #endif |
13 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 15 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
14 | 16 | ||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 17 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) |
18 | #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) | 18 | #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) |
19 | 19 | ||
@@ -73,10 +73,10 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
73 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 73 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
74 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 74 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
75 | 75 | ||
76 | #endif /* __KERNEL__ */ | ||
77 | |||
78 | #include <asm-generic/memory_model.h> | 76 | #include <asm-generic/memory_model.h> |
79 | #include <asm-generic/page.h> | 77 | #include <asm-generic/page.h> |
80 | 78 | ||
79 | #endif /* __KERNEL__ */ | ||
80 | |||
81 | #endif /* _CRIS_PAGE_H */ | 81 | #endif /* _CRIS_PAGE_H */ |
82 | 82 | ||
diff --git a/include/asm-cris/posix_types.h b/include/asm-cris/posix_types.h index 6d26fee4a614..7b9ed22ab5dd 100644 --- a/include/asm-cris/posix_types.h +++ b/include/asm-cris/posix_types.h | |||
@@ -6,8 +6,6 @@ | |||
6 | #ifndef __ARCH_CRIS_POSIX_TYPES_H | 6 | #ifndef __ARCH_CRIS_POSIX_TYPES_H |
7 | #define __ARCH_CRIS_POSIX_TYPES_H | 7 | #define __ARCH_CRIS_POSIX_TYPES_H |
8 | 8 | ||
9 | #include <asm/bitops.h> | ||
10 | |||
11 | /* | 9 | /* |
12 | * This file is generally used by user-level software, so you need to | 10 | * This file is generally used by user-level software, so you need to |
13 | * be a little careful about namespace pollution etc. Also, we cannot | 11 | * be a little careful about namespace pollution etc. Also, we cannot |
@@ -53,9 +51,8 @@ typedef struct { | |||
53 | #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | 51 | #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ |
54 | } __kernel_fsid_t; | 52 | } __kernel_fsid_t; |
55 | 53 | ||
56 | /* should this ifdef be here ? */ | 54 | #ifdef __KERNEL__ |
57 | 55 | #include <asm/bitops.h> | |
58 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | ||
59 | 56 | ||
60 | #undef __FD_SET | 57 | #undef __FD_SET |
61 | #define __FD_SET(fd,fdsetp) set_bit(fd, (void *)(fdsetp)) | 58 | #define __FD_SET(fd,fdsetp) set_bit(fd, (void *)(fdsetp)) |
@@ -69,6 +66,6 @@ typedef struct { | |||
69 | #undef __FD_ZERO | 66 | #undef __FD_ZERO |
70 | #define __FD_ZERO(fdsetp) memset((void *)(fdsetp), 0, __FDSET_LONGS << 2) | 67 | #define __FD_ZERO(fdsetp) memset((void *)(fdsetp), 0, __FDSET_LONGS << 2) |
71 | 68 | ||
72 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | 69 | #endif /* __KERNEL__ */ |
73 | 70 | ||
74 | #endif /* __ARCH_CRIS_POSIX_TYPES_H */ | 71 | #endif /* __ARCH_CRIS_POSIX_TYPES_H */ |
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index c2954e90aa24..7372efae0516 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_CRIS_UNISTD_H_ | 1 | #ifndef _ASM_CRIS_UNISTD_H_ |
2 | #define _ASM_CRIS_UNISTD_H_ | 2 | #define _ASM_CRIS_UNISTD_H_ |
3 | 3 | ||
4 | #include <asm/arch/unistd.h> | ||
5 | |||
6 | /* | 4 | /* |
7 | * This file contains the system call numbers, and stub macros for libc. | 5 | * This file contains the system call numbers, and stub macros for libc. |
8 | */ | 6 | */ |
@@ -299,6 +297,7 @@ | |||
299 | 297 | ||
300 | #define NR_syscalls 289 | 298 | #define NR_syscalls 289 |
301 | 299 | ||
300 | #include <asm/arch/unistd.h> | ||
302 | 301 | ||
303 | #define __ARCH_WANT_IPC_PARSE_VERSION | 302 | #define __ARCH_WANT_IPC_PARSE_VERSION |
304 | #define __ARCH_WANT_OLD_READDIR | 303 | #define __ARCH_WANT_OLD_READDIR |
@@ -322,7 +321,6 @@ | |||
322 | #define __ARCH_WANT_SYS_SIGPENDING | 321 | #define __ARCH_WANT_SYS_SIGPENDING |
323 | #define __ARCH_WANT_SYS_SIGPROCMASK | 322 | #define __ARCH_WANT_SYS_SIGPROCMASK |
324 | #define __ARCH_WANT_SYS_RT_SIGACTION | 323 | #define __ARCH_WANT_SYS_RT_SIGACTION |
325 | #endif | ||
326 | 324 | ||
327 | #ifdef __KERNEL_SYSCALLS__ | 325 | #ifdef __KERNEL_SYSCALLS__ |
328 | 326 | ||
diff --git a/include/asm-frv/libata-portmap.h b/include/asm-frv/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-frv/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-generic/libata-portmap.h b/include/asm-generic/libata-portmap.h new file mode 100644 index 000000000000..9202fd02d5be --- /dev/null +++ b/include/asm-generic/libata-portmap.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __ASM_GENERIC_LIBATA_PORTMAP_H | ||
2 | #define __ASM_GENERIC_LIBATA_PORTMAP_H | ||
3 | |||
4 | #define ATA_PRIMARY_CMD 0x1F0 | ||
5 | #define ATA_PRIMARY_CTL 0x3F6 | ||
6 | #define ATA_PRIMARY_IRQ 14 | ||
7 | |||
8 | #define ATA_SECONDARY_CMD 0x170 | ||
9 | #define ATA_SECONDARY_CTL 0x376 | ||
10 | #define ATA_SECONDARY_IRQ 15 | ||
11 | |||
12 | #endif | ||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index d673077d2fd6..3b4f2903f91d 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _H8300_PAGE_H | 1 | #ifndef _H8300_PAGE_H |
2 | #define _H8300_PAGE_H | 2 | #define _H8300_PAGE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | 5 | ||
5 | /* PAGE_SHIFT determines the page size */ | 6 | /* PAGE_SHIFT determines the page size */ |
6 | 7 | ||
@@ -8,8 +9,6 @@ | |||
8 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 9 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
9 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 10 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
10 | 11 | ||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | #include <asm/setup.h> | 12 | #include <asm/setup.h> |
14 | 13 | ||
15 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
@@ -76,9 +75,9 @@ extern unsigned long memory_end; | |||
76 | 75 | ||
77 | #endif /* __ASSEMBLY__ */ | 76 | #endif /* __ASSEMBLY__ */ |
78 | 77 | ||
79 | #endif /* __KERNEL__ */ | ||
80 | |||
81 | #include <asm-generic/memory_model.h> | 78 | #include <asm-generic/memory_model.h> |
82 | #include <asm-generic/page.h> | 79 | #include <asm-generic/page.h> |
83 | 80 | ||
81 | #endif /* __KERNEL__ */ | ||
82 | |||
84 | #endif /* _H8300_PAGE_H */ | 83 | #endif /* _H8300_PAGE_H */ |
diff --git a/include/asm-i386/libata-portmap.h b/include/asm-i386/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-i386/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-ia64/libata-portmap.h b/include/asm-ia64/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-ia64/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h index 9688be003620..404a4c24007b 100644 --- a/include/asm-m32r/page.h +++ b/include/asm-m32r/page.h | |||
@@ -87,10 +87,9 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
87 | 87 | ||
88 | #define devmem_is_allowed(x) 1 | 88 | #define devmem_is_allowed(x) 1 |
89 | 89 | ||
90 | #endif /* __KERNEL__ */ | ||
91 | |||
92 | #include <asm-generic/memory_model.h> | 90 | #include <asm-generic/memory_model.h> |
93 | #include <asm-generic/page.h> | 91 | #include <asm-generic/page.h> |
94 | 92 | ||
93 | #endif /* __KERNEL__ */ | ||
95 | #endif /* _ASM_M32R_PAGE_H */ | 94 | #endif /* _ASM_M32R_PAGE_H */ |
96 | 95 | ||
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index a07fa90314d2..2d2a6c97331e 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org> | 12 | * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ | ||
16 | |||
17 | /* 0 - 13 are integer registers (general purpose registers). */ | 15 | /* 0 - 13 are integer registers (general purpose registers). */ |
18 | #define PT_R4 0 | 16 | #define PT_R4 0 |
19 | #define PT_R5 1 | 17 | #define PT_R5 1 |
@@ -140,6 +138,8 @@ struct pt_regs { | |||
140 | 138 | ||
141 | #ifdef __KERNEL__ | 139 | #ifdef __KERNEL__ |
142 | 140 | ||
141 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ | ||
142 | |||
143 | #define __ARCH_SYS_PTRACE 1 | 143 | #define __ARCH_SYS_PTRACE 1 |
144 | 144 | ||
145 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) | 145 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) |
diff --git a/include/asm-m32r/signal.h b/include/asm-m32r/signal.h index e750045164d4..65423bed32b1 100644 --- a/include/asm-m32r/signal.h +++ b/include/asm-m32r/signal.h | |||
@@ -6,7 +6,6 @@ | |||
6 | /* orig : i386 2.4.18 */ | 6 | /* orig : i386 2.4.18 */ |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/linkage.h> | ||
10 | #include <linux/time.h> | 9 | #include <linux/time.h> |
11 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
12 | 11 | ||
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index cc31790d8077..89f376e6229f 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | /* $Id$ */ | 4 | /* $Id$ */ |
5 | 5 | ||
6 | #include <asm/syscall.h> /* SYSCALL_* */ | ||
7 | |||
8 | /* | 6 | /* |
9 | * This file contains the system call numbers. | 7 | * This file contains the system call numbers. |
10 | */ | 8 | */ |
@@ -303,6 +301,8 @@ | |||
303 | * <asm-m32r/errno.h> | 301 | * <asm-m32r/errno.h> |
304 | */ | 302 | */ |
305 | 303 | ||
304 | #include <asm/syscall.h> /* SYSCALL_* */ | ||
305 | |||
306 | #define __syscall_return(type, res) \ | 306 | #define __syscall_return(type, res) \ |
307 | do { \ | 307 | do { \ |
308 | if ((unsigned long)(res) >= (unsigned long)(-(124 + 1))) { \ | 308 | if ((unsigned long)(res) >= (unsigned long)(-(124 + 1))) { \ |
diff --git a/include/asm-m32r/user.h b/include/asm-m32r/user.h index 2ffd0c65a782..1ad4ded8483b 100644 --- a/include/asm-m32r/user.h +++ b/include/asm-m32r/user.h | |||
@@ -8,7 +8,6 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <asm/processor.h> | ||
12 | #include <asm/ptrace.h> | 11 | #include <asm/ptrace.h> |
13 | #include <asm/page.h> | 12 | #include <asm/page.h> |
14 | 13 | ||
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h index a22bf5a88160..2a1b8bdcb29c 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _M68KNOMMU_PAGE_H | 1 | #ifndef _M68KNOMMU_PAGE_H |
2 | #define _M68KNOMMU_PAGE_H | 2 | #define _M68KNOMMU_PAGE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | 5 | ||
5 | /* PAGE_SHIFT determines the page size */ | 6 | /* PAGE_SHIFT determines the page size */ |
6 | 7 | ||
@@ -8,8 +9,6 @@ | |||
8 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 9 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
9 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 10 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
10 | 11 | ||
11 | #ifdef __KERNEL__ | ||
12 | |||
13 | #include <asm/setup.h> | 12 | #include <asm/setup.h> |
14 | 13 | ||
15 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
@@ -76,8 +75,8 @@ extern unsigned long memory_end; | |||
76 | 75 | ||
77 | #endif /* __ASSEMBLY__ */ | 76 | #endif /* __ASSEMBLY__ */ |
78 | 77 | ||
79 | #endif /* __KERNEL__ */ | ||
80 | |||
81 | #include <asm-generic/page.h> | 78 | #include <asm-generic/page.h> |
82 | 79 | ||
80 | #endif /* __KERNEL__ */ | ||
81 | |||
83 | #endif /* _M68KNOMMU_PAGE_H */ | 82 | #endif /* _M68KNOMMU_PAGE_H */ |
diff --git a/include/asm-powerpc/libata-portmap.h b/include/asm-powerpc/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-powerpc/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild index 088969d55e72..e92b429d2be1 100644 --- a/include/asm-s390/Kbuild +++ b/include/asm-s390/Kbuild | |||
@@ -6,7 +6,7 @@ header-y += qeth.h | |||
6 | header-y += tape390.h | 6 | header-y += tape390.h |
7 | header-y += ucontext.h | 7 | header-y += ucontext.h |
8 | header-y += vtoc.h | 8 | header-y += vtoc.h |
9 | header-y += z90crypt.h | 9 | header-y += zcrypt.h |
10 | 10 | ||
11 | unifdef-y += cmb.h | 11 | unifdef-y += cmb.h |
12 | unifdef-y += debug.h | 12 | unifdef-y += debug.h |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 5a057b00f19a..6f7eb8a3aba5 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -112,9 +112,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
112 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 112 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
113 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 113 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
114 | 114 | ||
115 | #endif /* __KERNEL__ */ | ||
116 | |||
117 | #include <asm-generic/memory_model.h> | 115 | #include <asm-generic/memory_model.h> |
118 | #include <asm-generic/page.h> | 116 | #include <asm-generic/page.h> |
119 | 117 | ||
118 | #endif /* __KERNEL__ */ | ||
120 | #endif /* __ASM_SH_PAGE_H */ | 119 | #endif /* __ASM_SH_PAGE_H */ |
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h index 792fc35bd624..ed358a376e6e 100644 --- a/include/asm-sh/ptrace.h +++ b/include/asm-sh/ptrace.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __ASM_SH_PTRACE_H | 1 | #ifndef __ASM_SH_PTRACE_H |
2 | #define __ASM_SH_PTRACE_H | 2 | #define __ASM_SH_PTRACE_H |
3 | 3 | ||
4 | #include <asm/ubc.h> | ||
5 | |||
6 | /* | 4 | /* |
7 | * Copyright (C) 1999, 2000 Niibe Yutaka | 5 | * Copyright (C) 1999, 2000 Niibe Yutaka |
8 | * | 6 | * |
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h index 34fb34754ae6..472089aefc60 100644 --- a/include/asm-sh64/page.h +++ b/include/asm-sh64/page.h | |||
@@ -112,9 +112,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
112 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 112 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
113 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 113 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
114 | 114 | ||
115 | #endif /* __KERNEL__ */ | ||
116 | |||
117 | #include <asm-generic/memory_model.h> | 115 | #include <asm-generic/memory_model.h> |
118 | #include <asm-generic/page.h> | 116 | #include <asm-generic/page.h> |
119 | 117 | ||
118 | #endif /* __KERNEL__ */ | ||
120 | #endif /* __ASM_SH64_PAGE_H */ | 119 | #endif /* __ASM_SH64_PAGE_H */ |
diff --git a/include/asm-sh64/shmparam.h b/include/asm-sh64/shmparam.h index d3a99a4dc0e3..1bb820c833ee 100644 --- a/include/asm-sh64/shmparam.h +++ b/include/asm-sh64/shmparam.h | |||
@@ -2,19 +2,11 @@ | |||
2 | #define __ASM_SH64_SHMPARAM_H | 2 | #define __ASM_SH64_SHMPARAM_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This file is subject to the terms and conditions of the GNU General Public | 5 | * Set this to a sensible safe default, we'll work out the specifics for the |
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * align mask from the cache descriptor at run-time. |
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/shmparam.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | 7 | */ |
8 | #define SHMLBA 0x4000 | ||
14 | 9 | ||
15 | #include <asm/cache.h> | 10 | #define __ARCH_FORCE_SHMLBA |
16 | |||
17 | /* attach addr a multiple of this */ | ||
18 | #define SHMLBA (cpu_data->dcache.sets * L1_CACHE_BYTES) | ||
19 | 11 | ||
20 | #endif /* __ASM_SH64_SHMPARAM_H */ | 12 | #endif /* __ASM_SH64_SHMPARAM_H */ |
diff --git a/include/asm-sh64/signal.h b/include/asm-sh64/signal.h index a5a28203cb3b..244e134730d9 100644 --- a/include/asm-sh64/signal.h +++ b/include/asm-sh64/signal.h | |||
@@ -13,7 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <asm/processor.h> | ||
17 | 16 | ||
18 | /* Avoid too many header ordering problems. */ | 17 | /* Avoid too many header ordering problems. */ |
19 | struct siginfo; | 18 | struct siginfo; |
diff --git a/include/asm-sh64/user.h b/include/asm-sh64/user.h index 8f32f39a8ca9..eb3b33edd73e 100644 --- a/include/asm-sh64/user.h +++ b/include/asm-sh64/user.h | |||
@@ -13,7 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <asm/processor.h> | ||
17 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
18 | #include <asm/page.h> | 17 | #include <asm/page.h> |
19 | 18 | ||
diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild index b22b67a64ecc..c6a55cf0d337 100644 --- a/include/asm-sparc/Kbuild +++ b/include/asm-sparc/Kbuild | |||
@@ -2,20 +2,13 @@ include include/asm-generic/Kbuild.asm | |||
2 | 2 | ||
3 | header-y += apc.h | 3 | header-y += apc.h |
4 | header-y += asi.h | 4 | header-y += asi.h |
5 | header-y += auxio.h | ||
6 | header-y += bpp.h | 5 | header-y += bpp.h |
7 | header-y += head.h | ||
8 | header-y += ipc.h | ||
9 | header-y += jsflash.h | 6 | header-y += jsflash.h |
10 | header-y += openpromio.h | 7 | header-y += openpromio.h |
11 | header-y += pbm.h | ||
12 | header-y += pconf.h | 8 | header-y += pconf.h |
13 | header-y += pgtsun4.h | ||
14 | header-y += reg.h | 9 | header-y += reg.h |
15 | header-y += traps.h | 10 | header-y += traps.h |
16 | header-y += turbosparc.h | ||
17 | header-y += vfc_ioctls.h | 11 | header-y += vfc_ioctls.h |
18 | header-y += winmacro.h | ||
19 | 12 | ||
20 | unifdef-y += fbio.h | 13 | unifdef-y += fbio.h |
21 | unifdef-y += perfctr.h | 14 | unifdef-y += perfctr.h |
diff --git a/include/asm-sparc/libata-portmap.h b/include/asm-sparc/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-sparc/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h index 5bab8a7c25ce..ff57648eb8f8 100644 --- a/include/asm-sparc/page.h +++ b/include/asm-sparc/page.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #ifndef _SPARC_PAGE_H | 8 | #ifndef _SPARC_PAGE_H |
9 | #define _SPARC_PAGE_H | 9 | #define _SPARC_PAGE_H |
10 | 10 | ||
11 | #ifdef __KERNEL__ | ||
12 | |||
11 | #ifdef CONFIG_SUN4 | 13 | #ifdef CONFIG_SUN4 |
12 | #define PAGE_SHIFT 13 | 14 | #define PAGE_SHIFT 13 |
13 | #else | 15 | #else |
@@ -21,8 +23,6 @@ | |||
21 | #endif | 23 | #endif |
22 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 24 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
23 | 25 | ||
24 | #ifdef __KERNEL__ | ||
25 | |||
26 | #include <asm/btfixup.h> | 26 | #include <asm/btfixup.h> |
27 | 27 | ||
28 | #ifndef __ASSEMBLY__ | 28 | #ifndef __ASSEMBLY__ |
@@ -160,9 +160,9 @@ extern unsigned long pfn_base; | |||
160 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 160 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
161 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 161 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
162 | 162 | ||
163 | #endif /* __KERNEL__ */ | ||
164 | |||
165 | #include <asm-generic/memory_model.h> | 163 | #include <asm-generic/memory_model.h> |
166 | #include <asm-generic/page.h> | 164 | #include <asm-generic/page.h> |
167 | 165 | ||
166 | #endif /* __KERNEL__ */ | ||
167 | |||
168 | #endif /* _SPARC_PAGE_H */ | 168 | #endif /* _SPARC_PAGE_H */ |
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild index 4b59ce46cc2d..a7f44408c93b 100644 --- a/include/asm-sparc64/Kbuild +++ b/include/asm-sparc64/Kbuild | |||
@@ -8,15 +8,12 @@ header-y += apb.h | |||
8 | header-y += asi.h | 8 | header-y += asi.h |
9 | header-y += bbc.h | 9 | header-y += bbc.h |
10 | header-y += bpp.h | 10 | header-y += bpp.h |
11 | header-y += const.h | ||
11 | header-y += display7seg.h | 12 | header-y += display7seg.h |
12 | header-y += envctrl.h | 13 | header-y += envctrl.h |
13 | header-y += floppy.h | ||
14 | header-y += ipc.h | 14 | header-y += ipc.h |
15 | header-y += kdebug.h | ||
16 | header-y += mostek.h | ||
17 | header-y += openprom.h | 15 | header-y += openprom.h |
18 | header-y += openpromio.h | 16 | header-y += openpromio.h |
19 | header-y += parport.h | ||
20 | header-y += pconf.h | 17 | header-y += pconf.h |
21 | header-y += psrcompat.h | 18 | header-y += psrcompat.h |
22 | header-y += pstate.h | 19 | header-y += pstate.h |
diff --git a/include/asm-sparc64/libata-portmap.h b/include/asm-sparc64/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-sparc64/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index fdf0ceb76028..ff736eafa64d 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #ifndef _SPARC64_PAGE_H | 3 | #ifndef _SPARC64_PAGE_H |
4 | #define _SPARC64_PAGE_H | 4 | #define _SPARC64_PAGE_H |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
6 | #include <asm/const.h> | 8 | #include <asm/const.h> |
7 | 9 | ||
8 | #if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) | 10 | #if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) |
@@ -27,8 +29,6 @@ | |||
27 | #define DCACHE_ALIASING_POSSIBLE | 29 | #define DCACHE_ALIASING_POSSIBLE |
28 | #endif | 30 | #endif |
29 | 31 | ||
30 | #ifdef __KERNEL__ | ||
31 | |||
32 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) | 32 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) |
33 | #define HPAGE_SHIFT 22 | 33 | #define HPAGE_SHIFT 22 |
34 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) | 34 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) |
@@ -141,8 +141,7 @@ typedef unsigned long pgprot_t; | |||
141 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 141 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
142 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 142 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
143 | 143 | ||
144 | #endif /* !(__KERNEL__) */ | ||
145 | |||
146 | #include <asm-generic/page.h> | 144 | #include <asm-generic/page.h> |
147 | 145 | ||
148 | #endif /* !(_SPARC64_PAGE_H) */ | 146 | #endif /* __KERNEL__ */ |
147 | #endif /* _SPARC64_PAGE_H */ | ||
diff --git a/include/asm-sparc64/shmparam.h b/include/asm-sparc64/shmparam.h index 8c66fded8a32..911d0427de6d 100644 --- a/include/asm-sparc64/shmparam.h +++ b/include/asm-sparc64/shmparam.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* $Id: shmparam.h,v 1.5 2001/09/24 21:17:57 kanoj Exp $ */ | 1 | /* $Id: shmparam.h,v 1.5 2001/09/24 21:17:57 kanoj Exp $ */ |
2 | #ifndef _ASMSPARC64_SHMPARAM_H | 2 | #ifndef _ASMSPARC64_SHMPARAM_H |
3 | #define _ASMSPARC64_SHMPARAM_H | 3 | #define _ASMSPARC64_SHMPARAM_H |
4 | #ifdef __KERNEL__ | ||
4 | 5 | ||
5 | #include <asm/spitfire.h> | 6 | #include <asm/spitfire.h> |
6 | 7 | ||
@@ -8,4 +9,5 @@ | |||
8 | /* attach addr a multiple of this */ | 9 | /* attach addr a multiple of this */ |
9 | #define SHMLBA ((PAGE_SIZE > L1DCACHE_SIZE) ? PAGE_SIZE : L1DCACHE_SIZE) | 10 | #define SHMLBA ((PAGE_SIZE > L1DCACHE_SIZE) ? PAGE_SIZE : L1DCACHE_SIZE) |
10 | 11 | ||
12 | #endif /* __KERNEL__ */ | ||
11 | #endif /* _ASMSPARC64_SHMPARAM_H */ | 13 | #endif /* _ASMSPARC64_SHMPARAM_H */ |
diff --git a/include/asm-um/Kbuild b/include/asm-um/Kbuild deleted file mode 100644 index c68e1680da01..000000000000 --- a/include/asm-um/Kbuild +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h index ad03c46a1f92..d693ffb1364d 100644 --- a/include/asm-v850/page.h +++ b/include/asm-v850/page.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef __V850_PAGE_H__ | 14 | #ifndef __V850_PAGE_H__ |
15 | #define __V850_PAGE_H__ | 15 | #define __V850_PAGE_H__ |
16 | 16 | ||
17 | #ifdef __KERNEL__ | ||
18 | |||
17 | #include <asm/machdep.h> | 19 | #include <asm/machdep.h> |
18 | 20 | ||
19 | 21 | ||
@@ -32,7 +34,6 @@ | |||
32 | #endif | 34 | #endif |
33 | 35 | ||
34 | 36 | ||
35 | #ifdef __KERNEL__ | ||
36 | #ifndef __ASSEMBLY__ | 37 | #ifndef __ASSEMBLY__ |
37 | 38 | ||
38 | #define STRICT_MM_TYPECHECKS | 39 | #define STRICT_MM_TYPECHECKS |
@@ -122,9 +123,9 @@ typedef unsigned long pgprot_t; | |||
122 | #define __va(x) ((void *)__phys_to_virt ((unsigned long)(x))) | 123 | #define __va(x) ((void *)__phys_to_virt ((unsigned long)(x))) |
123 | 124 | ||
124 | 125 | ||
125 | #endif /* KERNEL */ | ||
126 | |||
127 | #include <asm-generic/memory_model.h> | 126 | #include <asm-generic/memory_model.h> |
128 | #include <asm-generic/page.h> | 127 | #include <asm-generic/page.h> |
129 | 128 | ||
129 | #endif /* KERNEL */ | ||
130 | |||
130 | #endif /* __V850_PAGE_H__ */ | 131 | #endif /* __V850_PAGE_H__ */ |
diff --git a/include/asm-v850/param.h b/include/asm-v850/param.h index 8d796e4bff52..3c65bd573782 100644 --- a/include/asm-v850/param.h +++ b/include/asm-v850/param.h | |||
@@ -14,8 +14,6 @@ | |||
14 | #ifndef __V850_PARAM_H__ | 14 | #ifndef __V850_PARAM_H__ |
15 | #define __V850_PARAM_H__ | 15 | #define __V850_PARAM_H__ |
16 | 16 | ||
17 | #include <asm/machdep.h> /* For HZ */ | ||
18 | |||
19 | #define EXEC_PAGESIZE 4096 | 17 | #define EXEC_PAGESIZE 4096 |
20 | 18 | ||
21 | #ifndef NOGROUP | 19 | #ifndef NOGROUP |
@@ -25,6 +23,8 @@ | |||
25 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | 23 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ |
26 | 24 | ||
27 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
26 | #include <asm/machdep.h> /* For HZ */ | ||
27 | |||
28 | # define USER_HZ 100 | 28 | # define USER_HZ 100 |
29 | # define CLOCKS_PER_SEC USER_HZ | 29 | # define CLOCKS_PER_SEC USER_HZ |
30 | #endif | 30 | #endif |
diff --git a/include/asm-x86_64/libata-portmap.h b/include/asm-x86_64/libata-portmap.h new file mode 100644 index 000000000000..75484ef0c743 --- /dev/null +++ b/include/asm-x86_64/libata-portmap.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/libata-portmap.h> | |||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 7d076d97b2f7..1df2ac30a4d2 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -12,7 +12,6 @@ header-y += netfilter_bridge/ | |||
12 | header-y += netfilter_ipv4/ | 12 | header-y += netfilter_ipv4/ |
13 | header-y += netfilter_ipv6/ | 13 | header-y += netfilter_ipv6/ |
14 | 14 | ||
15 | header-y += affs_fs.h | ||
16 | header-y += affs_hardblocks.h | 15 | header-y += affs_hardblocks.h |
17 | header-y += aio_abi.h | 16 | header-y += aio_abi.h |
18 | header-y += a.out.h | 17 | header-y += a.out.h |
@@ -67,7 +66,6 @@ header-y += genetlink.h | |||
67 | header-y += gen_stats.h | 66 | header-y += gen_stats.h |
68 | header-y += gigaset_dev.h | 67 | header-y += gigaset_dev.h |
69 | header-y += hdsmart.h | 68 | header-y += hdsmart.h |
70 | header-y += hpfs_fs.h | ||
71 | header-y += hysdn_if.h | 69 | header-y += hysdn_if.h |
72 | header-y += i2c-dev.h | 70 | header-y += i2c-dev.h |
73 | header-y += i8k.h | 71 | header-y += i8k.h |
@@ -103,6 +101,7 @@ header-y += ixjuser.h | |||
103 | header-y += jffs2.h | 101 | header-y += jffs2.h |
104 | header-y += keyctl.h | 102 | header-y += keyctl.h |
105 | header-y += limits.h | 103 | header-y += limits.h |
104 | header-y += magic.h | ||
106 | header-y += major.h | 105 | header-y += major.h |
107 | header-y += matroxfb.h | 106 | header-y += matroxfb.h |
108 | header-y += meye.h | 107 | header-y += meye.h |
@@ -116,7 +115,6 @@ header-y += netrom.h | |||
116 | header-y += nfs2.h | 115 | header-y += nfs2.h |
117 | header-y += nfs4_mount.h | 116 | header-y += nfs4_mount.h |
118 | header-y += nfs_mount.h | 117 | header-y += nfs_mount.h |
119 | header-y += openprom_fs.h | ||
120 | header-y += param.h | 118 | header-y += param.h |
121 | header-y += pci_ids.h | 119 | header-y += pci_ids.h |
122 | header-y += pci_regs.h | 120 | header-y += pci_regs.h |
@@ -143,7 +141,6 @@ header-y += snmp.h | |||
143 | header-y += sockios.h | 141 | header-y += sockios.h |
144 | header-y += som.h | 142 | header-y += som.h |
145 | header-y += sound.h | 143 | header-y += sound.h |
146 | header-y += stddef.h | ||
147 | header-y += synclink.h | 144 | header-y += synclink.h |
148 | header-y += telephony.h | 145 | header-y += telephony.h |
149 | header-y += termios.h | 146 | header-y += termios.h |
@@ -269,7 +266,6 @@ unifdef-y += netfilter_decnet.h | |||
269 | unifdef-y += netfilter.h | 266 | unifdef-y += netfilter.h |
270 | unifdef-y += netfilter_ipv4.h | 267 | unifdef-y += netfilter_ipv4.h |
271 | unifdef-y += netfilter_ipv6.h | 268 | unifdef-y += netfilter_ipv6.h |
272 | unifdef-y += netfilter_logging.h | ||
273 | unifdef-y += net.h | 269 | unifdef-y += net.h |
274 | unifdef-y += netlink.h | 270 | unifdef-y += netlink.h |
275 | unifdef-y += nfs3.h | 271 | unifdef-y += nfs3.h |
@@ -318,6 +314,7 @@ unifdef-y += sonet.h | |||
318 | unifdef-y += sonypi.h | 314 | unifdef-y += sonypi.h |
319 | unifdef-y += soundcard.h | 315 | unifdef-y += soundcard.h |
320 | unifdef-y += stat.h | 316 | unifdef-y += stat.h |
317 | unifdef-y += stddef.h | ||
321 | unifdef-y += sysctl.h | 318 | unifdef-y += sysctl.h |
322 | unifdef-y += tcp.h | 319 | unifdef-y += tcp.h |
323 | unifdef-y += time.h | 320 | unifdef-y += time.h |
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index 4a5d50c2bdbf..ef788c2085a1 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ADFS_FS_H | 2 | #define _ADFS_FS_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/magic.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Disc Record at disc address 0xc00 | 8 | * Disc Record at disc address 0xc00 |
@@ -38,7 +39,6 @@ struct adfs_discrecord { | |||
38 | #define ADFS_DR_OFFSET (0x1c0) | 39 | #define ADFS_DR_OFFSET (0x1c0) |
39 | #define ADFS_DR_SIZE 60 | 40 | #define ADFS_DR_SIZE 60 |
40 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) | 41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) |
41 | #define ADFS_SUPER_MAGIC 0xadf5 | ||
42 | 42 | ||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | #include <linux/adfs_fs_i.h> | 44 | #include <linux/adfs_fs_i.h> |
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h deleted file mode 100644 index c57b5ee87d55..000000000000 --- a/include/linux/affs_fs.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _AFFS_FS_H | ||
2 | #define _AFFS_FS_H | ||
3 | /* | ||
4 | * The affs filesystem constants/structures | ||
5 | */ | ||
6 | #define AFFS_SUPER_MAGIC 0xadff | ||
7 | #endif | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 3671af869696..d89441907024 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -40,6 +40,8 @@ enum { | |||
40 | ATA_MAX_DEVICES = 2, /* per bus/port */ | 40 | ATA_MAX_DEVICES = 2, /* per bus/port */ |
41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ | 41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ |
42 | ATA_SECT_SIZE = 512, | 42 | ATA_SECT_SIZE = 512, |
43 | ATA_MAX_SECTORS = 256, | ||
44 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | ||
43 | 45 | ||
44 | ATA_ID_WORDS = 256, | 46 | ATA_ID_WORDS = 256, |
45 | ATA_ID_SERNO_OFS = 10, | 47 | ATA_ID_SERNO_OFS = 10, |
@@ -168,12 +170,16 @@ enum { | |||
168 | XFER_UDMA_2 = 0x42, | 170 | XFER_UDMA_2 = 0x42, |
169 | XFER_UDMA_1 = 0x41, | 171 | XFER_UDMA_1 = 0x41, |
170 | XFER_UDMA_0 = 0x40, | 172 | XFER_UDMA_0 = 0x40, |
173 | XFER_MW_DMA_4 = 0x24, /* CFA only */ | ||
174 | XFER_MW_DMA_3 = 0x23, /* CFA only */ | ||
171 | XFER_MW_DMA_2 = 0x22, | 175 | XFER_MW_DMA_2 = 0x22, |
172 | XFER_MW_DMA_1 = 0x21, | 176 | XFER_MW_DMA_1 = 0x21, |
173 | XFER_MW_DMA_0 = 0x20, | 177 | XFER_MW_DMA_0 = 0x20, |
174 | XFER_SW_DMA_2 = 0x12, | 178 | XFER_SW_DMA_2 = 0x12, |
175 | XFER_SW_DMA_1 = 0x11, | 179 | XFER_SW_DMA_1 = 0x11, |
176 | XFER_SW_DMA_0 = 0x10, | 180 | XFER_SW_DMA_0 = 0x10, |
181 | XFER_PIO_6 = 0x0E, /* CFA only */ | ||
182 | XFER_PIO_5 = 0x0D, /* CFA only */ | ||
177 | XFER_PIO_4 = 0x0C, | 183 | XFER_PIO_4 = 0x0C, |
178 | XFER_PIO_3 = 0x0B, | 184 | XFER_PIO_3 = 0x0B, |
179 | XFER_PIO_2 = 0x0A, | 185 | XFER_PIO_2 = 0x0A, |
@@ -272,7 +278,6 @@ struct ata_taskfile { | |||
272 | }; | 278 | }; |
273 | 279 | ||
274 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 280 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
275 | #define ata_id_is_cfa(id) ((id)[0] == 0x848A) | ||
276 | #define ata_id_is_sata(id) ((id)[93] == 0) | 281 | #define ata_id_is_sata(id) ((id)[93] == 0) |
277 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 282 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
278 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 283 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
@@ -304,6 +309,9 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
304 | { | 309 | { |
305 | unsigned int mver; | 310 | unsigned int mver; |
306 | 311 | ||
312 | if (id[ATA_ID_MAJOR_VER] == 0xFFFF) | ||
313 | return 0; | ||
314 | |||
307 | for (mver = 14; mver >= 1; mver--) | 315 | for (mver = 14; mver >= 1; mver--) |
308 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) | 316 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) |
309 | break; | 317 | break; |
@@ -312,8 +320,8 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
312 | 320 | ||
313 | static inline int ata_id_current_chs_valid(const u16 *id) | 321 | static inline int ata_id_current_chs_valid(const u16 *id) |
314 | { | 322 | { |
315 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 323 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
316 | has not been issued to the device then the values of | 324 | has not been issued to the device then the values of |
317 | id[54] to id[56] are vendor specific. */ | 325 | id[54] to id[56] are vendor specific. */ |
318 | return (id[53] & 0x01) && /* Current translation valid */ | 326 | return (id[53] & 0x01) && /* Current translation valid */ |
319 | id[54] && /* cylinders in current translation */ | 327 | id[54] && /* cylinders in current translation */ |
@@ -322,6 +330,18 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
322 | id[56]; /* sectors in current translation */ | 330 | id[56]; /* sectors in current translation */ |
323 | } | 331 | } |
324 | 332 | ||
333 | static inline int ata_id_is_cfa(const u16 *id) | ||
334 | { | ||
335 | u16 v = id[0]; | ||
336 | if (v == 0x848A) /* Standard CF */ | ||
337 | return 1; | ||
338 | /* Could be CF hiding as standard ATA */ | ||
339 | if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF && | ||
340 | (id[82] & ( 1 << 2))) | ||
341 | return 1; | ||
342 | return 0; | ||
343 | } | ||
344 | |||
325 | static inline int atapi_cdb_len(const u16 *dev_id) | 345 | static inline int atapi_cdb_len(const u16 *dev_id) |
326 | { | 346 | { |
327 | u16 tmp = dev_id[0] & 0x3; | 347 | u16 tmp = dev_id[0] & 0x3; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 96c9040c00a8..c773ee545ebd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -746,6 +746,8 @@ extern void blk_queue_free_tags(request_queue_t *); | |||
746 | extern int blk_queue_resize_tags(request_queue_t *, int); | 746 | extern int blk_queue_resize_tags(request_queue_t *, int); |
747 | extern void blk_queue_invalidate_tags(request_queue_t *); | 747 | extern void blk_queue_invalidate_tags(request_queue_t *); |
748 | extern long blk_congestion_wait(int rw, long timeout); | 748 | extern long blk_congestion_wait(int rw, long timeout); |
749 | extern struct blk_queue_tag *blk_init_tags(int); | ||
750 | extern void blk_free_tags(struct blk_queue_tag *); | ||
749 | extern void blk_congestion_end(int rw); | 751 | extern void blk_congestion_end(int rw); |
750 | 752 | ||
751 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); | 753 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 98f6c52c152b..b541bb3d1f4b 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
@@ -1,11 +1,11 @@ | |||
1 | #ifndef __CODA_PSDEV_H | 1 | #ifndef __CODA_PSDEV_H |
2 | #define __CODA_PSDEV_H | 2 | #define __CODA_PSDEV_H |
3 | 3 | ||
4 | #include <linux/magic.h> | ||
5 | |||
4 | #define CODA_PSDEV_MAJOR 67 | 6 | #define CODA_PSDEV_MAJOR 67 |
5 | #define MAX_CODADEVS 5 /* how many do we allow */ | 7 | #define MAX_CODADEVS 5 /* how many do we allow */ |
6 | 8 | ||
7 | #define CODA_SUPER_MAGIC 0x73757245 | ||
8 | |||
9 | struct kstatfs; | 9 | struct kstatfs; |
10 | 10 | ||
11 | struct coda_sb_info | 11 | struct coda_sb_info |
diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h index c76088baef28..ff1945e37790 100644 --- a/include/linux/efs_fs_sb.h +++ b/include/linux/efs_fs_sb.h | |||
@@ -9,8 +9,7 @@ | |||
9 | #ifndef __EFS_FS_SB_H__ | 9 | #ifndef __EFS_FS_SB_H__ |
10 | #define __EFS_FS_SB_H__ | 10 | #define __EFS_FS_SB_H__ |
11 | 11 | ||
12 | /* statfs() magic number for EFS */ | 12 | #include <linux/magic.h> |
13 | #define EFS_SUPER_MAGIC 0x414A53 | ||
14 | 13 | ||
15 | /* EFS superblock magic numbers */ | 14 | /* EFS superblock magic numbers */ |
16 | #define EFS_MAGIC 0x072959 | 15 | #define EFS_MAGIC 0x072959 |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index facf34e98954..33a1aa107329 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define _LINUX_EXT2_FS_H | 17 | #define _LINUX_EXT2_FS_H |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/magic.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * The second extended filesystem constants/structures | 23 | * The second extended filesystem constants/structures |
@@ -63,11 +64,6 @@ | |||
63 | /* First non-reserved inode for old ext2 filesystems */ | 64 | /* First non-reserved inode for old ext2 filesystems */ |
64 | #define EXT2_GOOD_OLD_FIRST_INO 11 | 65 | #define EXT2_GOOD_OLD_FIRST_INO 11 |
65 | 66 | ||
66 | /* | ||
67 | * The second extended file system magic number | ||
68 | */ | ||
69 | #define EXT2_SUPER_MAGIC 0xEF53 | ||
70 | |||
71 | #ifdef __KERNEL__ | 67 | #ifdef __KERNEL__ |
72 | #include <linux/ext2_fs_sb.h> | 68 | #include <linux/ext2_fs_sb.h> |
73 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) | 69 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 9f9cce7bd86d..0eed918b3816 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define _LINUX_EXT3_FS_H | 17 | #define _LINUX_EXT3_FS_H |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/magic.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * The second extended filesystem constants/structures | 23 | * The second extended filesystem constants/structures |
@@ -67,11 +68,6 @@ | |||
67 | #define EXT3_GOOD_OLD_FIRST_INO 11 | 68 | #define EXT3_GOOD_OLD_FIRST_INO 11 |
68 | 69 | ||
69 | /* | 70 | /* |
70 | * The second extended file system magic number | ||
71 | */ | ||
72 | #define EXT3_SUPER_MAGIC 0xEF53 | ||
73 | |||
74 | /* | ||
75 | * Maximal count of links to a file | 71 | * Maximal count of links to a file |
76 | */ | 72 | */ |
77 | #define EXT3_LINK_MAX 32000 | 73 | #define EXT3_LINK_MAX 32000 |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 555bc195c420..1d3e601ece73 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -92,9 +92,10 @@ extern int dir_notify_enable; | |||
92 | #define FS_REQUIRES_DEV 1 | 92 | #define FS_REQUIRES_DEV 1 |
93 | #define FS_BINARY_MOUNTDATA 2 | 93 | #define FS_BINARY_MOUNTDATA 2 |
94 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | 94 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ |
95 | #define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon | 95 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() |
96 | * as nfs_rename() will be cleaned up | 96 | * during rename() internally. |
97 | */ | 97 | */ |
98 | |||
98 | /* | 99 | /* |
99 | * These are the fs-independent mount-flags: up to 32 flags are supported | 100 | * These are the fs-independent mount-flags: up to 32 flags are supported |
100 | */ | 101 | */ |
diff --git a/include/linux/hpfs_fs.h b/include/linux/hpfs_fs.h deleted file mode 100644 index a5028dd94d31..000000000000 --- a/include/linux/hpfs_fs.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef _LINUX_HPFS_FS_H | ||
2 | #define _LINUX_HPFS_FS_H | ||
3 | |||
4 | /* HPFS magic number (word 0 of block 16) */ | ||
5 | |||
6 | #define HPFS_SUPER_MAGIC 0xf995e849 | ||
7 | |||
8 | #endif | ||
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 47967878bfef..4688ac4284e2 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ISOFS_FS_H | 2 | #define _ISOFS_FS_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/magic.h> | ||
6 | |||
5 | /* | 7 | /* |
6 | * The isofs filesystem constants/structures | 8 | * The isofs filesystem constants/structures |
7 | */ | 9 | */ |
@@ -160,6 +162,4 @@ struct iso_directory_record { | |||
160 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) | 162 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) |
161 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) | 163 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) |
162 | 164 | ||
163 | #define ISOFS_SUPER_MAGIC 0x9660 | 165 | #endif /* _ISOFS_FS_H */ |
164 | |||
165 | #endif | ||
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index c9c760700bc3..840631fa5ff1 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -15,12 +15,12 @@ | |||
15 | #ifndef __LINUX_JFFS2_H__ | 15 | #ifndef __LINUX_JFFS2_H__ |
16 | #define __LINUX_JFFS2_H__ | 16 | #define __LINUX_JFFS2_H__ |
17 | 17 | ||
18 | #include <linux/magic.h> | ||
19 | |||
18 | /* You must include something which defines the C99 uintXX_t types. | 20 | /* You must include something which defines the C99 uintXX_t types. |
19 | We don't do it from here because this file is used in too many | 21 | We don't do it from here because this file is used in too many |
20 | different environments. */ | 22 | different environments. */ |
21 | 23 | ||
22 | #define JFFS2_SUPER_MAGIC 0x72b6 | ||
23 | |||
24 | /* Values we may expect to find in the 'magic' field */ | 24 | /* Values we may expect to find in the 'magic' field */ |
25 | #define JFFS2_OLD_MAGIC_BITMASK 0x1984 | 25 | #define JFFS2_OLD_MAGIC_BITMASK 0x1984 |
26 | #define JFFS2_MAGIC_BITMASK 0x1985 | 26 | #define JFFS2_MAGIC_BITMASK 0x1985 |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 66c3100c2b94..1ef3d3901b47 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -36,6 +36,8 @@ | |||
36 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | #include <scsi/scsi_host.h> | 37 | #include <scsi/scsi_host.h> |
38 | 38 | ||
39 | #include <asm/libata-portmap.h> | ||
40 | |||
39 | /* | 41 | /* |
40 | * compile-time options: to be removed as soon as all the drivers are | 42 | * compile-time options: to be removed as soon as all the drivers are |
41 | * converted to the new debugging mechanism | 43 | * converted to the new debugging mechanism |
@@ -44,7 +46,7 @@ | |||
44 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ | 46 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ |
45 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ | 47 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ |
46 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ | 48 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ |
47 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some | 49 | #define ATA_ENABLE_PATA /* define to enable PATA support in some |
48 | * low-level drivers */ | 50 | * low-level drivers */ |
49 | 51 | ||
50 | 52 | ||
@@ -112,8 +114,6 @@ enum { | |||
112 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ | 114 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ |
113 | ATA_MAX_QUEUE = 32, | 115 | ATA_MAX_QUEUE = 32, |
114 | ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, | 116 | ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, |
115 | ATA_MAX_SECTORS = 200, /* FIXME */ | ||
116 | ATA_MAX_SECTORS_LBA48 = 65535, | ||
117 | ATA_MAX_BUS = 2, | 117 | ATA_MAX_BUS = 2, |
118 | ATA_DEF_BUSY_WAIT = 10000, | 118 | ATA_DEF_BUSY_WAIT = 10000, |
119 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, | 119 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, |
@@ -197,8 +197,8 @@ enum { | |||
197 | ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ | 197 | ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ |
198 | 198 | ||
199 | /* host set flags */ | 199 | /* host set flags */ |
200 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ | 200 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
201 | 201 | ||
202 | /* various lengths of time */ | 202 | /* various lengths of time */ |
203 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 203 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
204 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 204 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
@@ -225,8 +225,8 @@ enum { | |||
225 | /* encoding various smaller bitmaps into a single | 225 | /* encoding various smaller bitmaps into a single |
226 | * unsigned int bitmap | 226 | * unsigned int bitmap |
227 | */ | 227 | */ |
228 | ATA_BITS_PIO = 5, | 228 | ATA_BITS_PIO = 7, |
229 | ATA_BITS_MWDMA = 3, | 229 | ATA_BITS_MWDMA = 5, |
230 | ATA_BITS_UDMA = 8, | 230 | ATA_BITS_UDMA = 8, |
231 | 231 | ||
232 | ATA_SHIFT_PIO = 0, | 232 | ATA_SHIFT_PIO = 0, |
@@ -289,6 +289,11 @@ enum { | |||
289 | * most devices. | 289 | * most devices. |
290 | */ | 290 | */ |
291 | ATA_SPINUP_WAIT = 8000, | 291 | ATA_SPINUP_WAIT = 8000, |
292 | |||
293 | /* Horkage types. May be set by libata or controller on drives | ||
294 | (some horkage may be drive/controller pair dependant */ | ||
295 | |||
296 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ | ||
292 | }; | 297 | }; |
293 | 298 | ||
294 | enum hsm_task_states { | 299 | enum hsm_task_states { |
@@ -350,23 +355,32 @@ struct ata_probe_ent { | |||
350 | struct scsi_host_template *sht; | 355 | struct scsi_host_template *sht; |
351 | struct ata_ioports port[ATA_MAX_PORTS]; | 356 | struct ata_ioports port[ATA_MAX_PORTS]; |
352 | unsigned int n_ports; | 357 | unsigned int n_ports; |
353 | unsigned int hard_port_no; | 358 | unsigned int dummy_port_mask; |
354 | unsigned int pio_mask; | 359 | unsigned int pio_mask; |
355 | unsigned int mwdma_mask; | 360 | unsigned int mwdma_mask; |
356 | unsigned int udma_mask; | 361 | unsigned int udma_mask; |
357 | unsigned int legacy_mode; | ||
358 | unsigned long irq; | 362 | unsigned long irq; |
363 | unsigned long irq2; | ||
359 | unsigned int irq_flags; | 364 | unsigned int irq_flags; |
360 | unsigned long host_flags; | 365 | unsigned long port_flags; |
361 | unsigned long host_set_flags; | 366 | unsigned long _host_flags; |
362 | void __iomem *mmio_base; | 367 | void __iomem *mmio_base; |
363 | void *private_data; | 368 | void *private_data; |
369 | |||
370 | /* port_info for the secondary port. Together with irq2, it's | ||
371 | * used to implement non-uniform secondary port. Currently, | ||
372 | * the only user is ata_piix combined mode. This workaround | ||
373 | * will be removed together with ata_probe_ent when init model | ||
374 | * is updated. | ||
375 | */ | ||
376 | const struct ata_port_info *pinfo2; | ||
364 | }; | 377 | }; |
365 | 378 | ||
366 | struct ata_host_set { | 379 | struct ata_host { |
367 | spinlock_t lock; | 380 | spinlock_t lock; |
368 | struct device *dev; | 381 | struct device *dev; |
369 | unsigned long irq; | 382 | unsigned long irq; |
383 | unsigned long irq2; | ||
370 | void __iomem *mmio_base; | 384 | void __iomem *mmio_base; |
371 | unsigned int n_ports; | 385 | unsigned int n_ports; |
372 | void *private_data; | 386 | void *private_data; |
@@ -374,7 +388,6 @@ struct ata_host_set { | |||
374 | unsigned long flags; | 388 | unsigned long flags; |
375 | int simplex_claimed; /* Keep seperate in case we | 389 | int simplex_claimed; /* Keep seperate in case we |
376 | ever need to do this locked */ | 390 | ever need to do this locked */ |
377 | struct ata_host_set *next; /* for legacy mode */ | ||
378 | struct ata_port *ports[0]; | 391 | struct ata_port *ports[0]; |
379 | }; | 392 | }; |
380 | 393 | ||
@@ -420,7 +433,7 @@ struct ata_queued_cmd { | |||
420 | void *private_data; | 433 | void *private_data; |
421 | }; | 434 | }; |
422 | 435 | ||
423 | struct ata_host_stats { | 436 | struct ata_port_stats { |
424 | unsigned long unhandled_irq; | 437 | unsigned long unhandled_irq; |
425 | unsigned long idle_irq; | 438 | unsigned long idle_irq; |
426 | unsigned long rw_reqbuf; | 439 | unsigned long rw_reqbuf; |
@@ -468,6 +481,7 @@ struct ata_device { | |||
468 | 481 | ||
469 | /* error history */ | 482 | /* error history */ |
470 | struct ata_ering ering; | 483 | struct ata_ering ering; |
484 | unsigned int horkage; /* List of broken features */ | ||
471 | }; | 485 | }; |
472 | 486 | ||
473 | /* Offset into struct ata_device. Fields above it are maintained | 487 | /* Offset into struct ata_device. Fields above it are maintained |
@@ -498,14 +512,13 @@ struct ata_eh_context { | |||
498 | }; | 512 | }; |
499 | 513 | ||
500 | struct ata_port { | 514 | struct ata_port { |
501 | struct Scsi_Host *host; /* our co-allocated scsi host */ | 515 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
502 | const struct ata_port_operations *ops; | 516 | const struct ata_port_operations *ops; |
503 | spinlock_t *lock; | 517 | spinlock_t *lock; |
504 | unsigned long flags; /* ATA_FLAG_xxx */ | 518 | unsigned long flags; /* ATA_FLAG_xxx */ |
505 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 519 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
506 | unsigned int id; /* unique id req'd by scsi midlyr */ | 520 | unsigned int id; /* unique id req'd by scsi midlyr */ |
507 | unsigned int port_no; /* unique port #; from zero */ | 521 | unsigned int port_no; /* unique port #; from zero */ |
508 | unsigned int hard_port_no; /* hardware port #; from zero */ | ||
509 | 522 | ||
510 | struct ata_prd *prd; /* our SG list */ | 523 | struct ata_prd *prd; /* our SG list */ |
511 | dma_addr_t prd_dma; /* and its DMA mapping */ | 524 | dma_addr_t prd_dma; /* and its DMA mapping */ |
@@ -524,7 +537,7 @@ struct ata_port { | |||
524 | unsigned int hw_sata_spd_limit; | 537 | unsigned int hw_sata_spd_limit; |
525 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ | 538 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ |
526 | 539 | ||
527 | /* record runtime error info, protected by host_set lock */ | 540 | /* record runtime error info, protected by host lock */ |
528 | struct ata_eh_info eh_info; | 541 | struct ata_eh_info eh_info; |
529 | /* EH context owned by EH */ | 542 | /* EH context owned by EH */ |
530 | struct ata_eh_context eh_context; | 543 | struct ata_eh_context eh_context; |
@@ -538,8 +551,8 @@ struct ata_port { | |||
538 | unsigned int active_tag; | 551 | unsigned int active_tag; |
539 | u32 sactive; | 552 | u32 sactive; |
540 | 553 | ||
541 | struct ata_host_stats stats; | 554 | struct ata_port_stats stats; |
542 | struct ata_host_set *host_set; | 555 | struct ata_host *host; |
543 | struct device *dev; | 556 | struct device *dev; |
544 | 557 | ||
545 | struct work_struct port_task; | 558 | struct work_struct port_task; |
@@ -615,7 +628,7 @@ struct ata_port_operations { | |||
615 | int (*port_start) (struct ata_port *ap); | 628 | int (*port_start) (struct ata_port *ap); |
616 | void (*port_stop) (struct ata_port *ap); | 629 | void (*port_stop) (struct ata_port *ap); |
617 | 630 | ||
618 | void (*host_stop) (struct ata_host_set *host_set); | 631 | void (*host_stop) (struct ata_host *host); |
619 | 632 | ||
620 | void (*bmdma_stop) (struct ata_queued_cmd *qc); | 633 | void (*bmdma_stop) (struct ata_queued_cmd *qc); |
621 | u8 (*bmdma_status) (struct ata_port *ap); | 634 | u8 (*bmdma_status) (struct ata_port *ap); |
@@ -623,7 +636,7 @@ struct ata_port_operations { | |||
623 | 636 | ||
624 | struct ata_port_info { | 637 | struct ata_port_info { |
625 | struct scsi_host_template *sht; | 638 | struct scsi_host_template *sht; |
626 | unsigned long host_flags; | 639 | unsigned long flags; |
627 | unsigned long pio_mask; | 640 | unsigned long pio_mask; |
628 | unsigned long mwdma_mask; | 641 | unsigned long mwdma_mask; |
629 | unsigned long udma_mask; | 642 | unsigned long udma_mask; |
@@ -649,6 +662,8 @@ extern const unsigned long sata_deb_timing_normal[]; | |||
649 | extern const unsigned long sata_deb_timing_hotplug[]; | 662 | extern const unsigned long sata_deb_timing_hotplug[]; |
650 | extern const unsigned long sata_deb_timing_long[]; | 663 | extern const unsigned long sata_deb_timing_long[]; |
651 | 664 | ||
665 | extern const struct ata_port_operations ata_dummy_port_ops; | ||
666 | |||
652 | static inline const unsigned long * | 667 | static inline const unsigned long * |
653 | sata_ehc_deb_timing(struct ata_eh_context *ehc) | 668 | sata_ehc_deb_timing(struct ata_eh_context *ehc) |
654 | { | 669 | { |
@@ -658,6 +673,11 @@ sata_ehc_deb_timing(struct ata_eh_context *ehc) | |||
658 | return sata_deb_timing_normal; | 673 | return sata_deb_timing_normal; |
659 | } | 674 | } |
660 | 675 | ||
676 | static inline int ata_port_is_dummy(struct ata_port *ap) | ||
677 | { | ||
678 | return ap->ops == &ata_dummy_port_ops; | ||
679 | } | ||
680 | |||
661 | extern void ata_port_probe(struct ata_port *); | 681 | extern void ata_port_probe(struct ata_port *); |
662 | extern void __sata_phy_reset(struct ata_port *ap); | 682 | extern void __sata_phy_reset(struct ata_port *ap); |
663 | extern void sata_phy_reset(struct ata_port *ap); | 683 | extern void sata_phy_reset(struct ata_port *ap); |
@@ -676,19 +696,30 @@ extern void ata_std_ports(struct ata_ioports *ioaddr); | |||
676 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 696 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, |
677 | unsigned int n_ports); | 697 | unsigned int n_ports); |
678 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 698 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
679 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state); | 699 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); |
680 | extern void ata_pci_device_do_resume(struct pci_dev *pdev); | 700 | extern void ata_pci_device_do_resume(struct pci_dev *pdev); |
681 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | 701 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); |
682 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 702 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
683 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | 703 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); |
684 | #endif /* CONFIG_PCI */ | 704 | #endif /* CONFIG_PCI */ |
685 | extern int ata_device_add(const struct ata_probe_ent *ent); | 705 | extern int ata_device_add(const struct ata_probe_ent *ent); |
686 | extern void ata_port_detach(struct ata_port *ap); | 706 | extern void ata_port_detach(struct ata_port *ap); |
687 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 707 | extern void ata_host_init(struct ata_host *, struct device *, |
708 | unsigned long, const struct ata_port_operations *); | ||
709 | extern void ata_host_remove(struct ata_host *host); | ||
688 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 710 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
689 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 711 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
690 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 712 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
691 | extern int ata_scsi_release(struct Scsi_Host *host); | 713 | extern int ata_scsi_release(struct Scsi_Host *host); |
714 | extern void ata_sas_port_destroy(struct ata_port *); | ||
715 | extern struct ata_port *ata_sas_port_alloc(struct ata_host *, | ||
716 | struct ata_port_info *, struct Scsi_Host *); | ||
717 | extern int ata_sas_port_init(struct ata_port *); | ||
718 | extern int ata_sas_port_start(struct ata_port *ap); | ||
719 | extern void ata_sas_port_stop(struct ata_port *ap); | ||
720 | extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); | ||
721 | extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), | ||
722 | struct ata_port *ap); | ||
692 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 723 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
693 | extern int sata_scr_valid(struct ata_port *ap); | 724 | extern int sata_scr_valid(struct ata_port *ap); |
694 | extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); | 725 | extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); |
@@ -697,10 +728,9 @@ extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); | |||
697 | extern int ata_port_online(struct ata_port *ap); | 728 | extern int ata_port_online(struct ata_port *ap); |
698 | extern int ata_port_offline(struct ata_port *ap); | 729 | extern int ata_port_offline(struct ata_port *ap); |
699 | extern int ata_scsi_device_resume(struct scsi_device *); | 730 | extern int ata_scsi_device_resume(struct scsi_device *); |
700 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); | 731 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); |
701 | extern int ata_host_set_suspend(struct ata_host_set *host_set, | 732 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
702 | pm_message_t mesg); | 733 | extern void ata_host_resume(struct ata_host *host); |
703 | extern void ata_host_set_resume(struct ata_host_set *host_set); | ||
704 | extern int ata_ratelimit(void); | 734 | extern int ata_ratelimit(void); |
705 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 735 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
706 | unsigned long timeout_pat, | 736 | unsigned long timeout_pat, |
@@ -725,7 +755,7 @@ extern u8 ata_altstatus(struct ata_port *ap); | |||
725 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 755 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
726 | extern int ata_port_start (struct ata_port *ap); | 756 | extern int ata_port_start (struct ata_port *ap); |
727 | extern void ata_port_stop (struct ata_port *ap); | 757 | extern void ata_port_stop (struct ata_port *ap); |
728 | extern void ata_host_stop (struct ata_host_set *host_set); | 758 | extern void ata_host_stop (struct ata_host *host); |
729 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 759 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
730 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, | 760 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, |
731 | unsigned int buflen, int write_data); | 761 | unsigned int buflen, int write_data); |
@@ -811,7 +841,7 @@ struct pci_bits { | |||
811 | unsigned long val; | 841 | unsigned long val; |
812 | }; | 842 | }; |
813 | 843 | ||
814 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | 844 | extern void ata_pci_host_stop (struct ata_host *host); |
815 | extern struct ata_probe_ent * | 845 | extern struct ata_probe_ent * |
816 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); | 846 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
817 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 847 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
diff --git a/include/linux/magic.h b/include/linux/magic.h new file mode 100644 index 000000000000..22036dd2ba36 --- /dev/null +++ b/include/linux/magic.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef __LINUX_MAGIC_H__ | ||
2 | #define __LINUX_MAGIC_H__ | ||
3 | |||
4 | #define ADFS_SUPER_MAGIC 0xadf5 | ||
5 | #define AFFS_SUPER_MAGIC 0xadff | ||
6 | #define AUTOFS_SUPER_MAGIC 0x0187 | ||
7 | #define CODA_SUPER_MAGIC 0x73757245 | ||
8 | #define EFS_SUPER_MAGIC 0x414A53 | ||
9 | #define EXT2_SUPER_MAGIC 0xEF53 | ||
10 | #define EXT3_SUPER_MAGIC 0xEF53 | ||
11 | #define HPFS_SUPER_MAGIC 0xf995e849 | ||
12 | #define ISOFS_SUPER_MAGIC 0x9660 | ||
13 | #define JFFS2_SUPER_MAGIC 0x72b6 | ||
14 | |||
15 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
16 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
17 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
18 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
19 | |||
20 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ | ||
21 | #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ | ||
22 | #define NFS_SUPER_MAGIC 0x6969 | ||
23 | #define OPENPROM_SUPER_MAGIC 0x9fa1 | ||
24 | #define PROC_SUPER_MAGIC 0x9fa0 | ||
25 | #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ | ||
26 | |||
27 | #define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ | ||
28 | /* used by file system utilities that | ||
29 | look at the superblock, etc. */ | ||
30 | #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" | ||
31 | #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" | ||
32 | #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" | ||
33 | |||
34 | #define SMB_SUPER_MAGIC 0x517B | ||
35 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 | ||
36 | |||
37 | #endif /* __LINUX_MAGIC_H__ */ | ||
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 1ecc3cc8cef5..916e8f72c63d 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_MINIX_FS_H | 1 | #ifndef _LINUX_MINIX_FS_H |
2 | #define _LINUX_MINIX_FS_H | 2 | #define _LINUX_MINIX_FS_H |
3 | 3 | ||
4 | #include <linux/magic.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * The minix filesystem constants/structures | 7 | * The minix filesystem constants/structures |
6 | */ | 8 | */ |
@@ -19,10 +21,6 @@ | |||
19 | 21 | ||
20 | #define MINIX_I_MAP_SLOTS 8 | 22 | #define MINIX_I_MAP_SLOTS 8 |
21 | #define MINIX_Z_MAP_SLOTS 64 | 23 | #define MINIX_Z_MAP_SLOTS 64 |
22 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
23 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
24 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
25 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
26 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | 24 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ |
27 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | 25 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ |
28 | 26 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 0dfb794c52d3..d4486cc2e7fe 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -156,6 +156,11 @@ extern struct module __this_module; | |||
156 | */ | 156 | */ |
157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
158 | 158 | ||
159 | /* Optional firmware file (or files) needed by the module | ||
160 | * format is simply firmware file name. Multiple firmware | ||
161 | * files require multiple MODULE_FIRMWARE() specifiers */ | ||
162 | #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) | ||
163 | |||
159 | /* Given an address, look for it in the exception tables */ | 164 | /* Given an address, look for it in the exception tables */ |
160 | const struct exception_table_entry *search_exception_tables(unsigned long add); | 165 | const struct exception_table_entry *search_exception_tables(unsigned long add); |
161 | 166 | ||
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index d9035c73e5d1..bae62d62dc3e 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_MSDOS_FS_H | 1 | #ifndef _LINUX_MSDOS_FS_H |
2 | #define _LINUX_MSDOS_FS_H | 2 | #define _LINUX_MSDOS_FS_H |
3 | 3 | ||
4 | #include <linux/magic.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * The MS-DOS filesystem constants/structures | 7 | * The MS-DOS filesystem constants/structures |
6 | */ | 8 | */ |
@@ -18,8 +20,6 @@ | |||
18 | #define CT_LE_L(v) cpu_to_le32(v) | 20 | #define CT_LE_L(v) cpu_to_le32(v) |
19 | 21 | ||
20 | 22 | ||
21 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ | ||
22 | |||
23 | #define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ | 23 | #define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ |
24 | #define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ | 24 | #define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ |
25 | 25 | ||
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index b208f0cd556b..02e352be717e 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
12 | #include <linux/in.h> | 12 | #include <linux/in.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/magic.h> | ||
14 | 15 | ||
15 | #include <linux/ipx.h> | 16 | #include <linux/ipx.h> |
16 | #include <linux/ncp_no.h> | 17 | #include <linux/ncp_no.h> |
@@ -185,10 +186,6 @@ struct ncp_entry_info { | |||
185 | __u8 file_handle[6]; | 186 | __u8 file_handle[6]; |
186 | }; | 187 | }; |
187 | 188 | ||
188 | /* Guess, what 0x564c is :-) */ | ||
189 | #define NCP_SUPER_MAGIC 0x564c | ||
190 | |||
191 | |||
192 | static inline struct ncp_server *NCP_SBP(struct super_block *sb) | 189 | static inline struct ncp_server *NCP_SBP(struct super_block *sb) |
193 | { | 190 | { |
194 | return sb->s_fs_info; | 191 | return sb->s_fs_info; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4f2c2b6beb5e..43289127b458 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -342,7 +342,7 @@ struct net_device | |||
342 | /* Instance data managed by the core of Wireless Extensions. */ | 342 | /* Instance data managed by the core of Wireless Extensions. */ |
343 | struct iw_public_data * wireless_data; | 343 | struct iw_public_data * wireless_data; |
344 | 344 | ||
345 | struct ethtool_ops *ethtool_ops; | 345 | const struct ethtool_ops *ethtool_ops; |
346 | 346 | ||
347 | /* | 347 | /* |
348 | * This marks the end of the "visible" part of the structure. All | 348 | * This marks the end of the "visible" part of the structure. All |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 9a285cecf249..312bd2ffee33 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -10,6 +10,8 @@ header-y += xt_connmark.h | |||
10 | header-y += xt_CONNMARK.h | 10 | header-y += xt_CONNMARK.h |
11 | header-y += xt_conntrack.h | 11 | header-y += xt_conntrack.h |
12 | header-y += xt_dccp.h | 12 | header-y += xt_dccp.h |
13 | header-y += xt_dscp.h | ||
14 | header-y += xt_DSCP.h | ||
13 | header-y += xt_esp.h | 15 | header-y += xt_esp.h |
14 | header-y += xt_helper.h | 16 | header-y += xt_helper.h |
15 | header-y += xt_length.h | 17 | header-y += xt_length.h |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 739a98eebe2c..04319a76103a 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -390,13 +390,13 @@ extern int xt_compat_match_offset(struct xt_match *match); | |||
390 | extern void xt_compat_match_from_user(struct xt_entry_match *m, | 390 | extern void xt_compat_match_from_user(struct xt_entry_match *m, |
391 | void **dstptr, int *size); | 391 | void **dstptr, int *size); |
392 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 392 | extern int xt_compat_match_to_user(struct xt_entry_match *m, |
393 | void * __user *dstptr, int *size); | 393 | void __user **dstptr, int *size); |
394 | 394 | ||
395 | extern int xt_compat_target_offset(struct xt_target *target); | 395 | extern int xt_compat_target_offset(struct xt_target *target); |
396 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | 396 | extern void xt_compat_target_from_user(struct xt_entry_target *t, |
397 | void **dstptr, int *size); | 397 | void **dstptr, int *size); |
398 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | 398 | extern int xt_compat_target_to_user(struct xt_entry_target *t, |
399 | void * __user *dstptr, int *size); | 399 | void __user **dstptr, int *size); |
400 | 400 | ||
401 | #endif /* CONFIG_COMPAT */ | 401 | #endif /* CONFIG_COMPAT */ |
402 | #endif /* __KERNEL__ */ | 402 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 855b44668caa..66411622e06e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
23 | #define NETLINK_GENERIC 16 | 23 | #define NETLINK_GENERIC 16 |
24 | /* leave room for NETLINK_DM (DM Events) */ | ||
25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ | ||
24 | 26 | ||
25 | #define MAX_LINKS 32 | 27 | #define MAX_LINKS 32 |
26 | 28 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 3b5b04193fee..36f5bcf513b0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #ifndef _LINUX_NFS_FS_H | 9 | #ifndef _LINUX_NFS_FS_H |
10 | #define _LINUX_NFS_FS_H | 10 | #define _LINUX_NFS_FS_H |
11 | 11 | ||
12 | #include <linux/magic.h> | ||
13 | |||
12 | /* | 14 | /* |
13 | * Enable debugging support for nfs client. | 15 | * Enable debugging support for nfs client. |
14 | * Requires RPC_DEBUG. | 16 | * Requires RPC_DEBUG. |
@@ -22,11 +24,6 @@ | |||
22 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) | 24 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) |
23 | 25 | ||
24 | /* | 26 | /* |
25 | * superblock magic number for NFS | ||
26 | */ | ||
27 | #define NFS_SUPER_MAGIC 0x6969 | ||
28 | |||
29 | /* | ||
30 | * When flushing a cluster of dirty pages, there can be different | 27 | * When flushing a cluster of dirty pages, there can be different |
31 | * strategies: | 28 | * strategies: |
32 | */ | 29 | */ |
diff --git a/include/linux/openprom_fs.h b/include/linux/openprom_fs.h deleted file mode 100644 index a837aab8217e..000000000000 --- a/include/linux/openprom_fs.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _LINUX_OPENPROM_FS_H | ||
2 | #define _LINUX_OPENPROM_FS_H | ||
3 | |||
4 | /* | ||
5 | * The openprom filesystem constants/structures | ||
6 | */ | ||
7 | |||
8 | #define OPENPROM_SUPER_MAGIC 0x9fa1 | ||
9 | |||
10 | #endif /* _LINUX_OPENPROM_FS_H */ | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7a249155ee4e..6a1e09834559 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2010,6 +2010,23 @@ | |||
2010 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea | 2010 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea |
2011 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb | 2011 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb |
2012 | 2012 | ||
2013 | #define PCI_VENDOR_ID_ARECA 0x17d3 | ||
2014 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 | ||
2015 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 | ||
2016 | #define PCI_DEVICE_ID_ARECA_1130 0x1130 | ||
2017 | #define PCI_DEVICE_ID_ARECA_1160 0x1160 | ||
2018 | #define PCI_DEVICE_ID_ARECA_1170 0x1170 | ||
2019 | #define PCI_DEVICE_ID_ARECA_1210 0x1210 | ||
2020 | #define PCI_DEVICE_ID_ARECA_1220 0x1220 | ||
2021 | #define PCI_DEVICE_ID_ARECA_1230 0x1230 | ||
2022 | #define PCI_DEVICE_ID_ARECA_1260 0x1260 | ||
2023 | #define PCI_DEVICE_ID_ARECA_1270 0x1270 | ||
2024 | #define PCI_DEVICE_ID_ARECA_1280 0x1280 | ||
2025 | #define PCI_DEVICE_ID_ARECA_1380 0x1380 | ||
2026 | #define PCI_DEVICE_ID_ARECA_1381 0x1381 | ||
2027 | #define PCI_DEVICE_ID_ARECA_1680 0x1680 | ||
2028 | #define PCI_DEVICE_ID_ARECA_1681 0x1681 | ||
2029 | |||
2013 | #define PCI_VENDOR_ID_S2IO 0x17d5 | 2030 | #define PCI_VENDOR_ID_S2IO 0x17d5 |
2014 | #define PCI_DEVICE_ID_S2IO_WIN 0x5731 | 2031 | #define PCI_DEVICE_ID_S2IO_WIN 0x5731 |
2015 | #define PCI_DEVICE_ID_S2IO_UNI 0x5831 | 2032 | #define PCI_DEVICE_ID_S2IO_UNI 0x5831 |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 17e75783e3a5..3435ca38dd14 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/slab.h> | 4 | #include <linux/slab.h> |
5 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/magic.h> | ||
7 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
8 | 9 | ||
9 | /* | 10 | /* |
@@ -24,8 +25,6 @@ enum { | |||
24 | PROC_ROOT_INO = 1, | 25 | PROC_ROOT_INO = 1, |
25 | }; | 26 | }; |
26 | 27 | ||
27 | #define PROC_SUPER_MAGIC 0x9fa0 | ||
28 | |||
29 | /* | 28 | /* |
30 | * This is not completely implemented yet. The idea is to | 29 | * This is not completely implemented yet. The idea is to |
31 | * create an in-memory tree (like the actual /proc filesystem | 30 | * create an in-memory tree (like the actual /proc filesystem |
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 27f49c85d5d6..0c7ac444fd35 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define _LINUX_QNX4_FS_H | 11 | #define _LINUX_QNX4_FS_H |
12 | 12 | ||
13 | #include <linux/qnxtypes.h> | 13 | #include <linux/qnxtypes.h> |
14 | #include <linux/magic.h> | ||
14 | 15 | ||
15 | #define QNX4_ROOT_INO 1 | 16 | #define QNX4_ROOT_INO 1 |
16 | 17 | ||
@@ -25,7 +26,6 @@ | |||
25 | 26 | ||
26 | #define QNX4_I_MAP_SLOTS 8 | 27 | #define QNX4_I_MAP_SLOTS 8 |
27 | #define QNX4_Z_MAP_SLOTS 64 | 28 | #define QNX4_Z_MAP_SLOTS 64 |
28 | #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ | ||
29 | #define QNX4_VALID_FS 0x0001 /* Clean fs. */ | 29 | #define QNX4_VALID_FS 0x0001 /* Clean fs. */ |
30 | #define QNX4_ERROR_FS 0x0002 /* fs has errors. */ | 30 | #define QNX4_ERROR_FS 0x0002 /* fs has errors. */ |
31 | #define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */ | 31 | #define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */ |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index daa2d83cefe8..28493ffaafe7 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #define _LINUX_REISER_FS_H | 12 | #define _LINUX_REISER_FS_H |
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/magic.h> | ||
16 | |||
15 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
16 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
17 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
@@ -227,14 +229,6 @@ struct reiserfs_super_block { | |||
227 | ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ | 229 | ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ |
228 | SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) | 230 | SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) |
229 | 231 | ||
230 | /* used by gcc */ | ||
231 | #define REISERFS_SUPER_MAGIC 0x52654973 | ||
232 | /* used by file system utilities that | ||
233 | look at the superblock, etc. */ | ||
234 | #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" | ||
235 | #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" | ||
236 | #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" | ||
237 | |||
238 | int is_reiserfs_3_5(struct reiserfs_super_block *rs); | 232 | int is_reiserfs_3_5(struct reiserfs_super_block *rs); |
239 | int is_reiserfs_3_6(struct reiserfs_super_block *rs); | 233 | int is_reiserfs_3_6(struct reiserfs_super_block *rs); |
240 | int is_reiserfs_jr(struct reiserfs_super_block *rs); | 234 | int is_reiserfs_jr(struct reiserfs_super_block *rs); |
diff --git a/include/linux/smb.h b/include/linux/smb.h index b0162208c963..6df3b1501559 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _LINUX_SMB_H | 10 | #define _LINUX_SMB_H |
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/magic.h> | ||
13 | 14 | ||
14 | enum smb_protocol { | 15 | enum smb_protocol { |
15 | SMB_PROTOCOL_NONE, | 16 | SMB_PROTOCOL_NONE, |
@@ -101,8 +102,6 @@ enum smb_conn_state { | |||
101 | CONN_RETRYING /* Currently trying to reconnect */ | 102 | CONN_RETRYING /* Currently trying to reconnect */ |
102 | }; | 103 | }; |
103 | 104 | ||
104 | #define SMB_SUPER_MAGIC 0x517B | ||
105 | |||
106 | #define SMB_HEADER_LEN 37 /* includes everything up to, but not | 105 | #define SMB_HEADER_LEN 37 /* includes everything up to, but not |
107 | * including smb_bcc */ | 106 | * including smb_bcc */ |
108 | 107 | ||
diff --git a/include/linux/stddef.h b/include/linux/stddef.h index b3a2cadf90f2..ea65dfb60cd8 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h | |||
@@ -10,11 +10,13 @@ | |||
10 | #define NULL ((void *)0) | 10 | #define NULL ((void *)0) |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
13 | #undef offsetof | 14 | #undef offsetof |
14 | #ifdef __compiler_offsetof | 15 | #ifdef __compiler_offsetof |
15 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | 16 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |
16 | #else | 17 | #else |
17 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | 18 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
18 | #endif | 19 | #endif |
20 | #endif /* __KERNEL__ */ | ||
19 | 21 | ||
20 | #endif | 22 | #endif |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 7b7aadb69092..617d8a1c59ae 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -32,11 +32,10 @@ | |||
32 | #define _LINUX_USBDEVICE_FS_H | 32 | #define _LINUX_USBDEVICE_FS_H |
33 | 33 | ||
34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
35 | #include <linux/magic.h> | ||
35 | 36 | ||
36 | /* --------------------------------------------------------------------- */ | 37 | /* --------------------------------------------------------------------- */ |
37 | 38 | ||
38 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 | ||
39 | |||
40 | /* usbdevfs ioctl codes */ | 39 | /* usbdevfs ioctl codes */ |
41 | 40 | ||
42 | struct usbdevfs_ctrltransfer { | 41 | struct usbdevfs_ctrltransfer { |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index ecc42864b001..b174ebb277a9 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -240,6 +240,11 @@ struct ieee80211_snap_hdr { | |||
240 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 240 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
241 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 241 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
242 | 242 | ||
243 | /* 802.11g ERP information element */ | ||
244 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) | ||
245 | #define WLAN_ERP_USE_PROTECTION (1<<1) | ||
246 | #define WLAN_ERP_BARKER_PREAMBLE (1<<2) | ||
247 | |||
243 | /* Status codes */ | 248 | /* Status codes */ |
244 | enum ieee80211_statuscode { | 249 | enum ieee80211_statuscode { |
245 | WLAN_STATUS_SUCCESS = 0, | 250 | WLAN_STATUS_SUCCESS = 0, |
@@ -747,6 +752,8 @@ struct ieee80211_txb { | |||
747 | #define NETWORK_HAS_IBSS_DFS (1<<8) | 752 | #define NETWORK_HAS_IBSS_DFS (1<<8) |
748 | #define NETWORK_HAS_TPC_REPORT (1<<9) | 753 | #define NETWORK_HAS_TPC_REPORT (1<<9) |
749 | 754 | ||
755 | #define NETWORK_HAS_ERP_VALUE (1<<10) | ||
756 | |||
750 | #define QOS_QUEUE_NUM 4 | 757 | #define QOS_QUEUE_NUM 4 |
751 | #define QOS_OUI_LEN 3 | 758 | #define QOS_OUI_LEN 3 |
752 | #define QOS_OUI_TYPE 2 | 759 | #define QOS_OUI_TYPE 2 |
@@ -1252,6 +1259,8 @@ extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | |||
1252 | int total_len, int encrypt_mpdu); | 1259 | int total_len, int encrypt_mpdu); |
1253 | 1260 | ||
1254 | /* ieee80211_rx.c */ | 1261 | /* ieee80211_rx.c */ |
1262 | extern void ieee80211_rx_any(struct ieee80211_device *ieee, | ||
1263 | struct sk_buff *skb, struct ieee80211_rx_stats *stats); | ||
1255 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 1264 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
1256 | struct ieee80211_rx_stats *rx_stats); | 1265 | struct ieee80211_rx_stats *rx_stats); |
1257 | /* make sure to set stats->len */ | 1266 | /* make sure to set stats->len */ |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 00ad810eb883..425b3a57ac74 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -86,9 +86,6 @@ struct ieee80211softmac_assoc_info { | |||
86 | 86 | ||
87 | /* BSSID we're trying to associate to */ | 87 | /* BSSID we're trying to associate to */ |
88 | char bssid[ETH_ALEN]; | 88 | char bssid[ETH_ALEN]; |
89 | |||
90 | /* Rates supported by the network */ | ||
91 | struct ieee80211softmac_ratesinfo supported_rates; | ||
92 | 89 | ||
93 | /* some flags. | 90 | /* some flags. |
94 | * static_essid is valid if the essid is constant, | 91 | * static_essid is valid if the essid is constant, |
@@ -103,6 +100,7 @@ struct ieee80211softmac_assoc_info { | |||
103 | * bssfixed is used for SIOCSIWAP. | 100 | * bssfixed is used for SIOCSIWAP. |
104 | */ | 101 | */ |
105 | u8 static_essid:1, | 102 | u8 static_essid:1, |
103 | short_preamble_available:1, | ||
106 | associating:1, | 104 | associating:1, |
107 | assoc_wait:1, | 105 | assoc_wait:1, |
108 | bssvalid:1, | 106 | bssvalid:1, |
@@ -115,6 +113,19 @@ struct ieee80211softmac_assoc_info { | |||
115 | struct work_struct timeout; | 113 | struct work_struct timeout; |
116 | }; | 114 | }; |
117 | 115 | ||
116 | struct ieee80211softmac_bss_info { | ||
117 | /* Rates supported by the network */ | ||
118 | struct ieee80211softmac_ratesinfo supported_rates; | ||
119 | |||
120 | /* This indicates whether frames can currently be transmitted with | ||
121 | * short preamble (only use this variable during TX at CCK rates) */ | ||
122 | u8 short_preamble:1; | ||
123 | |||
124 | /* This indicates whether protection (e.g. self-CTS) should be used | ||
125 | * when transmitting with OFDM modulation */ | ||
126 | u8 use_protection:1; | ||
127 | }; | ||
128 | |||
118 | enum { | 129 | enum { |
119 | IEEE80211SOFTMAC_AUTH_OPEN_REQUEST = 1, | 130 | IEEE80211SOFTMAC_AUTH_OPEN_REQUEST = 1, |
120 | IEEE80211SOFTMAC_AUTH_OPEN_RESPONSE = 2, | 131 | IEEE80211SOFTMAC_AUTH_OPEN_RESPONSE = 2, |
@@ -157,6 +168,10 @@ struct ieee80211softmac_txrates { | |||
157 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ | 168 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ |
158 | #define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */ | 169 | #define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */ |
159 | 170 | ||
171 | #define IEEE80211SOFTMAC_BSSINFOCHG_RATES (1 << 0) /* supported_rates */ | ||
172 | #define IEEE80211SOFTMAC_BSSINFOCHG_SHORT_PREAMBLE (1 << 1) /* short_preamble */ | ||
173 | #define IEEE80211SOFTMAC_BSSINFOCHG_PROTECTION (1 << 2) /* use_protection */ | ||
174 | |||
160 | struct ieee80211softmac_device { | 175 | struct ieee80211softmac_device { |
161 | /* 802.11 structure for data stuff */ | 176 | /* 802.11 structure for data stuff */ |
162 | struct ieee80211_device *ieee; | 177 | struct ieee80211_device *ieee; |
@@ -200,10 +215,16 @@ struct ieee80211softmac_device { | |||
200 | * The driver just needs to read them. | 215 | * The driver just needs to read them. |
201 | */ | 216 | */ |
202 | struct ieee80211softmac_txrates txrates; | 217 | struct ieee80211softmac_txrates txrates; |
203 | /* If the driver needs to do stuff on TX rate changes, assign this callback. */ | 218 | |
219 | /* If the driver needs to do stuff on TX rate changes, assign this | ||
220 | * callback. See IEEE80211SOFTMAC_TXRATECHG for change flags. */ | ||
204 | void (*txrates_change)(struct net_device *dev, | 221 | void (*txrates_change)(struct net_device *dev, |
205 | u32 changes, /* see IEEE80211SOFTMAC_TXRATECHG flags */ | 222 | u32 changes); |
206 | const struct ieee80211softmac_txrates *rates_before_change); | 223 | |
224 | /* If the driver needs to do stuff when BSS properties change, assign | ||
225 | * this callback. see IEEE80211SOFTMAC_BSSINFOCHG for change flags. */ | ||
226 | void (*bssinfo_change)(struct net_device *dev, | ||
227 | u32 changes); | ||
207 | 228 | ||
208 | /* private stuff follows */ | 229 | /* private stuff follows */ |
209 | /* this lock protects this structure */ | 230 | /* this lock protects this structure */ |
@@ -216,6 +237,7 @@ struct ieee80211softmac_device { | |||
216 | 237 | ||
217 | struct ieee80211softmac_scaninfo *scaninfo; | 238 | struct ieee80211softmac_scaninfo *scaninfo; |
218 | struct ieee80211softmac_assoc_info associnfo; | 239 | struct ieee80211softmac_assoc_info associnfo; |
240 | struct ieee80211softmac_bss_info bssinfo; | ||
219 | 241 | ||
220 | struct list_head auth_queue; | 242 | struct list_head auth_queue; |
221 | struct list_head events; | 243 | struct list_head events; |
@@ -257,6 +279,14 @@ extern void ieee80211softmac_fragment_lost(struct net_device *dev, | |||
257 | * Note that the rates need to be sorted. */ | 279 | * Note that the rates need to be sorted. */ |
258 | extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); | 280 | extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); |
259 | 281 | ||
282 | /* Finds the highest rate which is: | ||
283 | * 1. Present in ri (optionally a basic rate) | ||
284 | * 2. Supported by the device | ||
285 | * 3. Less than or equal to the user-defined rate | ||
286 | */ | ||
287 | extern u8 ieee80211softmac_highest_supported_rate(struct ieee80211softmac_device *mac, | ||
288 | struct ieee80211softmac_ratesinfo *ri, int basic_only); | ||
289 | |||
260 | /* Helper function which advises you the rate at which a frame should be | 290 | /* Helper function which advises you the rate at which a frame should be |
261 | * transmitted at. */ | 291 | * transmitted at. */ |
262 | static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac, | 292 | static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac, |
@@ -279,6 +309,24 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device | |||
279 | return txrates->mcast_rate; | 309 | return txrates->mcast_rate; |
280 | } | 310 | } |
281 | 311 | ||
312 | /* Helper function which advises you when it is safe to transmit with short | ||
313 | * preamble. | ||
314 | * You should only call this function when transmitting at CCK rates. */ | ||
315 | static inline int ieee80211softmac_short_preamble_ok(struct ieee80211softmac_device *mac, | ||
316 | int is_multicast, | ||
317 | int is_mgt) | ||
318 | { | ||
319 | return (is_multicast && is_mgt) ? 0 : mac->bssinfo.short_preamble; | ||
320 | } | ||
321 | |||
322 | /* Helper function which advises you whether protection (e.g. self-CTS) is | ||
323 | * needed. 1 = protection needed, 0 = no protection needed | ||
324 | * Only use this function when transmitting with OFDM modulation. */ | ||
325 | static inline int ieee80211softmac_protection_needed(struct ieee80211softmac_device *mac) | ||
326 | { | ||
327 | return mac->bssinfo.use_protection; | ||
328 | } | ||
329 | |||
282 | /* Start the SoftMAC. Call this after you initialized the device | 330 | /* Start the SoftMAC. Call this after you initialized the device |
283 | * and it is ready to run. | 331 | * and it is ready to run. |
284 | */ | 332 | */ |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index fc2b72fc7e07..dd5780b36919 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -108,7 +108,7 @@ | |||
108 | */ | 108 | */ |
109 | static inline struct sk_buff *netlbl_netlink_alloc_skb(size_t head, | 109 | static inline struct sk_buff *netlbl_netlink_alloc_skb(size_t head, |
110 | size_t body, | 110 | size_t body, |
111 | int gfp_flags) | 111 | gfp_t gfp_flags) |
112 | { | 112 | { |
113 | struct sk_buff *skb; | 113 | struct sk_buff *skb; |
114 | 114 | ||
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 41904f611d12..401192e56e50 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -102,6 +102,8 @@ struct iscsi_cmd_task { | |||
102 | uint32_t unsol_datasn; | 102 | uint32_t unsol_datasn; |
103 | int imm_count; /* imm-data (bytes) */ | 103 | int imm_count; /* imm-data (bytes) */ |
104 | int unsol_count; /* unsolicited (bytes)*/ | 104 | int unsol_count; /* unsolicited (bytes)*/ |
105 | /* offset in unsolicited stream (bytes); */ | ||
106 | int unsol_offset; | ||
105 | int data_count; /* remaining Data-Out */ | 107 | int data_count; /* remaining Data-Out */ |
106 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ | 108 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ |
107 | int total_length; | 109 | int total_length; |
@@ -110,6 +112,7 @@ struct iscsi_cmd_task { | |||
110 | 112 | ||
111 | /* state set/tested under session->lock */ | 113 | /* state set/tested under session->lock */ |
112 | int state; | 114 | int state; |
115 | atomic_t refcount; | ||
113 | struct list_head running; /* running cmd list */ | 116 | struct list_head running; /* running cmd list */ |
114 | void *dd_data; /* driver/transport data */ | 117 | void *dd_data; /* driver/transport data */ |
115 | }; | 118 | }; |
@@ -290,8 +293,7 @@ extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | |||
290 | extern int iscsi_check_assign_cmdsn(struct iscsi_session *, | 293 | extern int iscsi_check_assign_cmdsn(struct iscsi_session *, |
291 | struct iscsi_nopin *); | 294 | struct iscsi_nopin *); |
292 | extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_cmd_task *, | 295 | extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_cmd_task *, |
293 | struct iscsi_data *hdr, | 296 | struct iscsi_data *hdr); |
294 | int transport_data_cnt); | ||
295 | extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *, | 297 | extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *, |
296 | char *, uint32_t); | 298 | char *, uint32_t); |
297 | extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, | 299 | extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h new file mode 100644 index 000000000000..8e39982fc3db --- /dev/null +++ b/include/scsi/libsas.h | |||
@@ -0,0 +1,627 @@ | |||
1 | /* | ||
2 | * SAS host prototypes and structures header file | ||
3 | * | ||
4 | * Copyright (C) 2005 Adaptec, Inc. All rights reserved. | ||
5 | * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> | ||
6 | * | ||
7 | * This file is licensed under GPLv2. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License as | ||
11 | * published by the Free Software Foundation; either version 2 of the | ||
12 | * License, or (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
22 | * USA | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | #ifndef _LIBSAS_H_ | ||
27 | #define _LIBSAS_H_ | ||
28 | |||
29 | |||
30 | #include <linux/timer.h> | ||
31 | #include <linux/pci.h> | ||
32 | #include <scsi/sas.h> | ||
33 | #include <linux/list.h> | ||
34 | #include <asm/semaphore.h> | ||
35 | #include <scsi/scsi_device.h> | ||
36 | #include <scsi/scsi_cmnd.h> | ||
37 | #include <scsi/scsi_transport_sas.h> | ||
38 | |||
39 | struct block_device; | ||
40 | |||
41 | enum sas_class { | ||
42 | SAS, | ||
43 | EXPANDER | ||
44 | }; | ||
45 | |||
46 | enum sas_phy_role { | ||
47 | PHY_ROLE_NONE = 0, | ||
48 | PHY_ROLE_TARGET = 0x40, | ||
49 | PHY_ROLE_INITIATOR = 0x80, | ||
50 | }; | ||
51 | |||
52 | enum sas_phy_type { | ||
53 | PHY_TYPE_PHYSICAL, | ||
54 | PHY_TYPE_VIRTUAL | ||
55 | }; | ||
56 | |||
57 | /* The events are mnemonically described in sas_dump.c | ||
58 | * so when updating/adding events here, please also | ||
59 | * update the other file too. | ||
60 | */ | ||
61 | enum ha_event { | ||
62 | HAE_RESET = 0U, | ||
63 | HA_NUM_EVENTS = 1, | ||
64 | }; | ||
65 | |||
66 | enum port_event { | ||
67 | PORTE_BYTES_DMAED = 0U, | ||
68 | PORTE_BROADCAST_RCVD = 1, | ||
69 | PORTE_LINK_RESET_ERR = 2, | ||
70 | PORTE_TIMER_EVENT = 3, | ||
71 | PORTE_HARD_RESET = 4, | ||
72 | PORT_NUM_EVENTS = 5, | ||
73 | }; | ||
74 | |||
75 | enum phy_event { | ||
76 | PHYE_LOSS_OF_SIGNAL = 0U, | ||
77 | PHYE_OOB_DONE = 1, | ||
78 | PHYE_OOB_ERROR = 2, | ||
79 | PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */ | ||
80 | PHY_NUM_EVENTS = 4, | ||
81 | }; | ||
82 | |||
83 | enum discover_event { | ||
84 | DISCE_DISCOVER_DOMAIN = 0U, | ||
85 | DISCE_REVALIDATE_DOMAIN = 1, | ||
86 | DISCE_PORT_GONE = 2, | ||
87 | DISC_NUM_EVENTS = 3, | ||
88 | }; | ||
89 | |||
90 | /* ---------- Expander Devices ---------- */ | ||
91 | |||
92 | #define ETASK 0xFA | ||
93 | |||
94 | #define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj) | ||
95 | #define to_dev_attr(_attr) container_of(_attr, struct domain_dev_attribute,\ | ||
96 | attr) | ||
97 | |||
98 | enum routing_attribute { | ||
99 | DIRECT_ROUTING, | ||
100 | SUBTRACTIVE_ROUTING, | ||
101 | TABLE_ROUTING, | ||
102 | }; | ||
103 | |||
104 | enum ex_phy_state { | ||
105 | PHY_EMPTY, | ||
106 | PHY_VACANT, | ||
107 | PHY_NOT_PRESENT, | ||
108 | PHY_DEVICE_DISCOVERED | ||
109 | }; | ||
110 | |||
111 | struct ex_phy { | ||
112 | int phy_id; | ||
113 | |||
114 | enum ex_phy_state phy_state; | ||
115 | |||
116 | enum sas_dev_type attached_dev_type; | ||
117 | enum sas_linkrate linkrate; | ||
118 | |||
119 | u8 attached_sata_host:1; | ||
120 | u8 attached_sata_dev:1; | ||
121 | u8 attached_sata_ps:1; | ||
122 | |||
123 | enum sas_proto attached_tproto; | ||
124 | enum sas_proto attached_iproto; | ||
125 | |||
126 | u8 attached_sas_addr[SAS_ADDR_SIZE]; | ||
127 | u8 attached_phy_id; | ||
128 | |||
129 | u8 phy_change_count; | ||
130 | enum routing_attribute routing_attr; | ||
131 | u8 virtual:1; | ||
132 | |||
133 | int last_da_index; | ||
134 | |||
135 | struct sas_phy *phy; | ||
136 | struct sas_port *port; | ||
137 | }; | ||
138 | |||
139 | struct expander_device { | ||
140 | struct list_head children; | ||
141 | |||
142 | u16 ex_change_count; | ||
143 | u16 max_route_indexes; | ||
144 | u8 num_phys; | ||
145 | u8 configuring:1; | ||
146 | u8 conf_route_table:1; | ||
147 | u8 enclosure_logical_id[8]; | ||
148 | |||
149 | struct ex_phy *ex_phy; | ||
150 | struct sas_port *parent_port; | ||
151 | }; | ||
152 | |||
153 | /* ---------- SATA device ---------- */ | ||
154 | enum ata_command_set { | ||
155 | ATA_COMMAND_SET = 0, | ||
156 | ATAPI_COMMAND_SET = 1, | ||
157 | }; | ||
158 | |||
159 | struct sata_device { | ||
160 | enum ata_command_set command_set; | ||
161 | struct smp_resp rps_resp; /* report_phy_sata_resp */ | ||
162 | __le16 *identify_device; | ||
163 | __le16 *identify_packet_device; | ||
164 | |||
165 | u8 port_no; /* port number, if this is a PM (Port) */ | ||
166 | struct list_head children; /* PM Ports if this is a PM */ | ||
167 | }; | ||
168 | |||
169 | /* ---------- Domain device ---------- */ | ||
170 | struct domain_device { | ||
171 | enum sas_dev_type dev_type; | ||
172 | |||
173 | enum sas_linkrate linkrate; | ||
174 | enum sas_linkrate min_linkrate; | ||
175 | enum sas_linkrate max_linkrate; | ||
176 | |||
177 | int pathways; | ||
178 | |||
179 | struct domain_device *parent; | ||
180 | struct list_head siblings; /* devices on the same level */ | ||
181 | struct asd_sas_port *port; /* shortcut to root of the tree */ | ||
182 | |||
183 | struct list_head dev_list_node; | ||
184 | |||
185 | enum sas_proto iproto; | ||
186 | enum sas_proto tproto; | ||
187 | |||
188 | struct sas_rphy *rphy; | ||
189 | |||
190 | u8 sas_addr[SAS_ADDR_SIZE]; | ||
191 | u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE]; | ||
192 | |||
193 | u8 frame_rcvd[32]; | ||
194 | |||
195 | union { | ||
196 | struct expander_device ex_dev; | ||
197 | struct sata_device sata_dev; /* STP & directly attached */ | ||
198 | }; | ||
199 | |||
200 | void *lldd_dev; | ||
201 | }; | ||
202 | |||
203 | struct sas_discovery { | ||
204 | spinlock_t disc_event_lock; | ||
205 | struct work_struct disc_work[DISC_NUM_EVENTS]; | ||
206 | unsigned long pending; | ||
207 | u8 fanout_sas_addr[8]; | ||
208 | u8 eeds_a[8]; | ||
209 | u8 eeds_b[8]; | ||
210 | int max_level; | ||
211 | }; | ||
212 | |||
213 | |||
214 | /* The port struct is Class:RW, driver:RO */ | ||
215 | struct asd_sas_port { | ||
216 | /* private: */ | ||
217 | struct completion port_gone_completion; | ||
218 | |||
219 | struct sas_discovery disc; | ||
220 | struct domain_device *port_dev; | ||
221 | spinlock_t dev_list_lock; | ||
222 | struct list_head dev_list; | ||
223 | enum sas_linkrate linkrate; | ||
224 | |||
225 | struct sas_phy *phy; | ||
226 | struct work_struct work; | ||
227 | |||
228 | /* public: */ | ||
229 | int id; | ||
230 | |||
231 | enum sas_class class; | ||
232 | u8 sas_addr[SAS_ADDR_SIZE]; | ||
233 | u8 attached_sas_addr[SAS_ADDR_SIZE]; | ||
234 | enum sas_proto iproto; | ||
235 | enum sas_proto tproto; | ||
236 | |||
237 | enum sas_oob_mode oob_mode; | ||
238 | |||
239 | spinlock_t phy_list_lock; | ||
240 | struct list_head phy_list; | ||
241 | int num_phys; | ||
242 | u32 phy_mask; | ||
243 | |||
244 | struct sas_ha_struct *ha; | ||
245 | |||
246 | struct sas_port *port; | ||
247 | |||
248 | void *lldd_port; /* not touched by the sas class code */ | ||
249 | }; | ||
250 | |||
251 | /* The phy pretty much is controlled by the LLDD. | ||
252 | * The class only reads those fields. | ||
253 | */ | ||
254 | struct asd_sas_phy { | ||
255 | /* private: */ | ||
256 | /* protected by ha->event_lock */ | ||
257 | struct work_struct port_events[PORT_NUM_EVENTS]; | ||
258 | struct work_struct phy_events[PHY_NUM_EVENTS]; | ||
259 | |||
260 | unsigned long port_events_pending; | ||
261 | unsigned long phy_events_pending; | ||
262 | |||
263 | int error; | ||
264 | |||
265 | struct sas_phy *phy; | ||
266 | |||
267 | /* public: */ | ||
268 | /* The following are class:RO, driver:R/W */ | ||
269 | int enabled; /* must be set */ | ||
270 | |||
271 | int id; /* must be set */ | ||
272 | enum sas_class class; | ||
273 | enum sas_proto iproto; | ||
274 | enum sas_proto tproto; | ||
275 | |||
276 | enum sas_phy_type type; | ||
277 | enum sas_phy_role role; | ||
278 | enum sas_oob_mode oob_mode; | ||
279 | enum sas_linkrate linkrate; | ||
280 | |||
281 | u8 *sas_addr; /* must be set */ | ||
282 | u8 attached_sas_addr[SAS_ADDR_SIZE]; /* class:RO, driver: R/W */ | ||
283 | |||
284 | spinlock_t frame_rcvd_lock; | ||
285 | u8 *frame_rcvd; /* must be set */ | ||
286 | int frame_rcvd_size; | ||
287 | |||
288 | spinlock_t sas_prim_lock; | ||
289 | u32 sas_prim; | ||
290 | |||
291 | struct list_head port_phy_el; /* driver:RO */ | ||
292 | struct asd_sas_port *port; /* Class:RW, driver: RO */ | ||
293 | |||
294 | struct sas_ha_struct *ha; /* may be set; the class sets it anyway */ | ||
295 | |||
296 | void *lldd_phy; /* not touched by the sas_class_code */ | ||
297 | }; | ||
298 | |||
299 | struct scsi_core { | ||
300 | struct Scsi_Host *shost; | ||
301 | |||
302 | spinlock_t task_queue_lock; | ||
303 | struct list_head task_queue; | ||
304 | int task_queue_size; | ||
305 | |||
306 | struct semaphore queue_thread_sema; | ||
307 | int queue_thread_kill; | ||
308 | }; | ||
309 | |||
310 | struct sas_ha_struct { | ||
311 | /* private: */ | ||
312 | spinlock_t event_lock; | ||
313 | struct work_struct ha_events[HA_NUM_EVENTS]; | ||
314 | unsigned long pending; | ||
315 | |||
316 | struct scsi_core core; | ||
317 | |||
318 | /* public: */ | ||
319 | char *sas_ha_name; | ||
320 | struct pci_dev *pcidev; /* should be set */ | ||
321 | struct module *lldd_module; /* should be set */ | ||
322 | |||
323 | u8 *sas_addr; /* must be set */ | ||
324 | u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE]; | ||
325 | |||
326 | spinlock_t phy_port_lock; | ||
327 | struct asd_sas_phy **sas_phy; /* array of valid pointers, must be set */ | ||
328 | struct asd_sas_port **sas_port; /* array of valid pointers, must be set */ | ||
329 | int num_phys; /* must be set, gt 0, static */ | ||
330 | |||
331 | /* The class calls this to send a task for execution. */ | ||
332 | int lldd_max_execute_num; | ||
333 | int lldd_queue_size; | ||
334 | |||
335 | /* LLDD calls these to notify the class of an event. */ | ||
336 | void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); | ||
337 | void (*notify_port_event)(struct asd_sas_phy *, enum port_event); | ||
338 | void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); | ||
339 | |||
340 | void *lldd_ha; /* not touched by sas class code */ | ||
341 | }; | ||
342 | |||
343 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) | ||
344 | |||
345 | static inline struct domain_device * | ||
346 | starget_to_domain_dev(struct scsi_target *starget) { | ||
347 | return starget->hostdata; | ||
348 | } | ||
349 | |||
350 | static inline struct domain_device * | ||
351 | sdev_to_domain_dev(struct scsi_device *sdev) { | ||
352 | return starget_to_domain_dev(sdev->sdev_target); | ||
353 | } | ||
354 | |||
355 | static inline struct domain_device * | ||
356 | cmd_to_domain_dev(struct scsi_cmnd *cmd) | ||
357 | { | ||
358 | return sdev_to_domain_dev(cmd->device); | ||
359 | } | ||
360 | |||
361 | void sas_hash_addr(u8 *hashed, const u8 *sas_addr); | ||
362 | |||
363 | /* Before calling a notify event, LLDD should use this function | ||
364 | * when the link is severed (possibly from its tasklet). | ||
365 | * The idea is that the Class only reads those, while the LLDD, | ||
366 | * can R/W these (thus avoiding a race). | ||
367 | */ | ||
368 | static inline void sas_phy_disconnected(struct asd_sas_phy *phy) | ||
369 | { | ||
370 | phy->oob_mode = OOB_NOT_CONNECTED; | ||
371 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; | ||
372 | } | ||
373 | |||
374 | /* ---------- Tasks ---------- */ | ||
375 | /* | ||
376 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | | ||
377 | exec_status | | | | ||
378 | ---------------------+---------------------+-----------------------+ | ||
379 | SAM_... | X | | | ||
380 | DEV_NO_RESPONSE | X | X | | ||
381 | INTERRUPTED | X | | | ||
382 | QUEUE_FULL | | X | | ||
383 | DEVICE_UNKNOWN | | X | | ||
384 | SG_ERR | | X | | ||
385 | ---------------------+---------------------+-----------------------+ | ||
386 | */ | ||
387 | |||
388 | enum service_response { | ||
389 | SAS_TASK_COMPLETE, | ||
390 | SAS_TASK_UNDELIVERED = -1, | ||
391 | }; | ||
392 | |||
393 | enum exec_status { | ||
394 | SAM_GOOD = 0, | ||
395 | SAM_CHECK_COND = 2, | ||
396 | SAM_COND_MET = 4, | ||
397 | SAM_BUSY = 8, | ||
398 | SAM_INTERMEDIATE = 0x10, | ||
399 | SAM_IM_COND_MET = 0x12, | ||
400 | SAM_RESV_CONFLICT= 0x14, | ||
401 | SAM_TASK_SET_FULL= 0x28, | ||
402 | SAM_ACA_ACTIVE = 0x30, | ||
403 | SAM_TASK_ABORTED = 0x40, | ||
404 | |||
405 | SAS_DEV_NO_RESPONSE = 0x80, | ||
406 | SAS_DATA_UNDERRUN, | ||
407 | SAS_DATA_OVERRUN, | ||
408 | SAS_INTERRUPTED, | ||
409 | SAS_QUEUE_FULL, | ||
410 | SAS_DEVICE_UNKNOWN, | ||
411 | SAS_SG_ERR, | ||
412 | SAS_OPEN_REJECT, | ||
413 | SAS_OPEN_TO, | ||
414 | SAS_PROTO_RESPONSE, | ||
415 | SAS_PHY_DOWN, | ||
416 | SAS_NAK_R_ERR, | ||
417 | SAS_PENDING, | ||
418 | SAS_ABORTED_TASK, | ||
419 | }; | ||
420 | |||
421 | /* When a task finishes with a response, the LLDD examines the | ||
422 | * response: | ||
423 | * - For an ATA task task_status_struct::stat is set to | ||
424 | * SAS_PROTO_RESPONSE, and the task_status_struct::buf is set to the | ||
425 | * contents of struct ata_task_resp. | ||
426 | * - For SSP tasks, if no data is present or status/TMF response | ||
427 | * is valid, task_status_struct::stat is set. If data is present | ||
428 | * (SENSE data), the LLDD copies up to SAS_STATUS_BUF_SIZE, sets | ||
429 | * task_status_struct::buf_valid_size, and task_status_struct::stat is | ||
430 | * set to SAM_CHECK_COND. | ||
431 | * | ||
432 | * "buf" has format SCSI Sense for SSP task, or struct ata_task_resp | ||
433 | * for ATA task. | ||
434 | * | ||
435 | * "frame_len" is the total frame length, which could be more or less | ||
436 | * than actually copied. | ||
437 | * | ||
438 | * Tasks ending with response, always set the residual field. | ||
439 | */ | ||
440 | struct ata_task_resp { | ||
441 | u16 frame_len; | ||
442 | u8 ending_fis[24]; /* dev to host or data-in */ | ||
443 | u32 sstatus; | ||
444 | u32 serror; | ||
445 | u32 scontrol; | ||
446 | u32 sactive; | ||
447 | }; | ||
448 | |||
449 | #define SAS_STATUS_BUF_SIZE 96 | ||
450 | |||
451 | struct task_status_struct { | ||
452 | enum service_response resp; | ||
453 | enum exec_status stat; | ||
454 | int buf_valid_size; | ||
455 | |||
456 | u8 buf[SAS_STATUS_BUF_SIZE]; | ||
457 | |||
458 | u32 residual; | ||
459 | enum sas_open_rej_reason open_rej_reason; | ||
460 | }; | ||
461 | |||
462 | /* ATA and ATAPI task queuable to a SAS LLDD. | ||
463 | */ | ||
464 | struct sas_ata_task { | ||
465 | struct host_to_dev_fis fis; | ||
466 | u8 atapi_packet[16]; /* 0 if not ATAPI task */ | ||
467 | |||
468 | u8 retry_count; /* hardware retry, should be > 0 */ | ||
469 | |||
470 | u8 dma_xfer:1; /* PIO:0 or DMA:1 */ | ||
471 | u8 use_ncq:1; | ||
472 | u8 set_affil_pol:1; | ||
473 | u8 stp_affil_pol:1; | ||
474 | |||
475 | u8 device_control_reg_update:1; | ||
476 | }; | ||
477 | |||
478 | struct sas_smp_task { | ||
479 | struct scatterlist smp_req; | ||
480 | struct scatterlist smp_resp; | ||
481 | }; | ||
482 | |||
483 | enum task_attribute { | ||
484 | TASK_ATTR_SIMPLE = 0, | ||
485 | TASK_ATTR_HOQ = 1, | ||
486 | TASK_ATTR_ORDERED= 2, | ||
487 | TASK_ATTR_ACA = 4, | ||
488 | }; | ||
489 | |||
490 | struct sas_ssp_task { | ||
491 | u8 retry_count; /* hardware retry, should be > 0 */ | ||
492 | |||
493 | u8 LUN[8]; | ||
494 | u8 enable_first_burst:1; | ||
495 | enum task_attribute task_attr; | ||
496 | u8 task_prio; | ||
497 | u8 cdb[16]; | ||
498 | }; | ||
499 | |||
500 | struct sas_task { | ||
501 | struct domain_device *dev; | ||
502 | struct list_head list; | ||
503 | |||
504 | spinlock_t task_state_lock; | ||
505 | unsigned task_state_flags; | ||
506 | |||
507 | enum sas_proto task_proto; | ||
508 | |||
509 | /* Used by the discovery code. */ | ||
510 | struct timer_list timer; | ||
511 | struct completion completion; | ||
512 | |||
513 | union { | ||
514 | struct sas_ata_task ata_task; | ||
515 | struct sas_smp_task smp_task; | ||
516 | struct sas_ssp_task ssp_task; | ||
517 | }; | ||
518 | |||
519 | struct scatterlist *scatter; | ||
520 | int num_scatter; | ||
521 | u32 total_xfer_len; | ||
522 | u8 data_dir:2; /* Use PCI_DMA_... */ | ||
523 | |||
524 | struct task_status_struct task_status; | ||
525 | void (*task_done)(struct sas_task *); | ||
526 | |||
527 | void *lldd_task; /* for use by LLDDs */ | ||
528 | void *uldd_task; | ||
529 | }; | ||
530 | |||
531 | |||
532 | |||
533 | #define SAS_TASK_STATE_PENDING 1 | ||
534 | #define SAS_TASK_STATE_DONE 2 | ||
535 | #define SAS_TASK_STATE_ABORTED 4 | ||
536 | |||
537 | static inline struct sas_task *sas_alloc_task(unsigned long flags) | ||
538 | { | ||
539 | extern kmem_cache_t *sas_task_cache; | ||
540 | struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); | ||
541 | |||
542 | if (task) { | ||
543 | memset(task, 0, sizeof(*task)); | ||
544 | INIT_LIST_HEAD(&task->list); | ||
545 | spin_lock_init(&task->task_state_lock); | ||
546 | task->task_state_flags = SAS_TASK_STATE_PENDING; | ||
547 | init_timer(&task->timer); | ||
548 | init_completion(&task->completion); | ||
549 | } | ||
550 | |||
551 | return task; | ||
552 | } | ||
553 | |||
554 | static inline void sas_free_task(struct sas_task *task) | ||
555 | { | ||
556 | if (task) { | ||
557 | extern kmem_cache_t *sas_task_cache; | ||
558 | BUG_ON(!list_empty(&task->list)); | ||
559 | kmem_cache_free(sas_task_cache, task); | ||
560 | } | ||
561 | } | ||
562 | |||
563 | struct sas_domain_function_template { | ||
564 | /* The class calls these to notify the LLDD of an event. */ | ||
565 | void (*lldd_port_formed)(struct asd_sas_phy *); | ||
566 | void (*lldd_port_deformed)(struct asd_sas_phy *); | ||
567 | |||
568 | /* The class calls these when a device is found or gone. */ | ||
569 | int (*lldd_dev_found)(struct domain_device *); | ||
570 | void (*lldd_dev_gone)(struct domain_device *); | ||
571 | |||
572 | int (*lldd_execute_task)(struct sas_task *, int num, | ||
573 | unsigned long gfp_flags); | ||
574 | |||
575 | /* Task Management Functions. Must be called from process context. */ | ||
576 | int (*lldd_abort_task)(struct sas_task *); | ||
577 | int (*lldd_abort_task_set)(struct domain_device *, u8 *lun); | ||
578 | int (*lldd_clear_aca)(struct domain_device *, u8 *lun); | ||
579 | int (*lldd_clear_task_set)(struct domain_device *, u8 *lun); | ||
580 | int (*lldd_I_T_nexus_reset)(struct domain_device *); | ||
581 | int (*lldd_lu_reset)(struct domain_device *, u8 *lun); | ||
582 | int (*lldd_query_task)(struct sas_task *); | ||
583 | |||
584 | /* Port and Adapter management */ | ||
585 | int (*lldd_clear_nexus_port)(struct asd_sas_port *); | ||
586 | int (*lldd_clear_nexus_ha)(struct sas_ha_struct *); | ||
587 | |||
588 | /* Phy management */ | ||
589 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); | ||
590 | }; | ||
591 | |||
592 | extern int sas_register_ha(struct sas_ha_struct *); | ||
593 | extern int sas_unregister_ha(struct sas_ha_struct *); | ||
594 | |||
595 | extern int sas_queuecommand(struct scsi_cmnd *, | ||
596 | void (*scsi_done)(struct scsi_cmnd *)); | ||
597 | extern int sas_target_alloc(struct scsi_target *); | ||
598 | extern int sas_slave_alloc(struct scsi_device *); | ||
599 | extern int sas_slave_configure(struct scsi_device *); | ||
600 | extern void sas_slave_destroy(struct scsi_device *); | ||
601 | extern int sas_change_queue_depth(struct scsi_device *, int new_depth); | ||
602 | extern int sas_change_queue_type(struct scsi_device *, int qt); | ||
603 | extern int sas_bios_param(struct scsi_device *, | ||
604 | struct block_device *, | ||
605 | sector_t capacity, int *hsc); | ||
606 | extern struct scsi_transport_template * | ||
607 | sas_domain_attach_transport(struct sas_domain_function_template *); | ||
608 | extern void sas_domain_release_transport(struct scsi_transport_template *); | ||
609 | |||
610 | int sas_discover_root_expander(struct domain_device *); | ||
611 | |||
612 | void sas_init_ex_attr(void); | ||
613 | |||
614 | int sas_ex_revalidate_domain(struct domain_device *); | ||
615 | |||
616 | void sas_unregister_domain_devices(struct asd_sas_port *port); | ||
617 | void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *); | ||
618 | int sas_discover_event(struct asd_sas_port *, enum discover_event ev); | ||
619 | |||
620 | int sas_discover_sata(struct domain_device *); | ||
621 | int sas_discover_end_dev(struct domain_device *); | ||
622 | |||
623 | void sas_unregister_dev(struct domain_device *); | ||
624 | |||
625 | void sas_init_dev(struct domain_device *); | ||
626 | |||
627 | #endif /* _SASLIB_H_ */ | ||
diff --git a/include/scsi/sas.h b/include/scsi/sas.h new file mode 100644 index 000000000000..2f4b6afa34fc --- /dev/null +++ b/include/scsi/sas.h | |||
@@ -0,0 +1,631 @@ | |||
1 | /* | ||
2 | * SAS structures and definitions header file | ||
3 | * | ||
4 | * Copyright (C) 2005 Adaptec, Inc. All rights reserved. | ||
5 | * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> | ||
6 | * | ||
7 | * This file is licensed under GPLv2. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License as | ||
11 | * published by the Free Software Foundation; either version 2 of the | ||
12 | * License, or (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
22 | * USA | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | #ifndef _SAS_H_ | ||
27 | #define _SAS_H_ | ||
28 | |||
29 | #include <linux/types.h> | ||
30 | #include <asm/byteorder.h> | ||
31 | |||
32 | #define SAS_ADDR_SIZE 8 | ||
33 | #define HASHED_SAS_ADDR_SIZE 3 | ||
34 | #define SAS_ADDR(_sa) ((unsigned long long) be64_to_cpu(*(__be64 *)(_sa))) | ||
35 | |||
36 | #define SMP_REQUEST 0x40 | ||
37 | #define SMP_RESPONSE 0x41 | ||
38 | |||
39 | #define SSP_DATA 0x01 | ||
40 | #define SSP_XFER_RDY 0x05 | ||
41 | #define SSP_COMMAND 0x06 | ||
42 | #define SSP_RESPONSE 0x07 | ||
43 | #define SSP_TASK 0x16 | ||
44 | |||
45 | #define SMP_REPORT_GENERAL 0x00 | ||
46 | #define SMP_REPORT_MANUF_INFO 0x01 | ||
47 | #define SMP_READ_GPIO_REG 0x02 | ||
48 | #define SMP_DISCOVER 0x10 | ||
49 | #define SMP_REPORT_PHY_ERR_LOG 0x11 | ||
50 | #define SMP_REPORT_PHY_SATA 0x12 | ||
51 | #define SMP_REPORT_ROUTE_INFO 0x13 | ||
52 | #define SMP_WRITE_GPIO_REG 0x82 | ||
53 | #define SMP_CONF_ROUTE_INFO 0x90 | ||
54 | #define SMP_PHY_CONTROL 0x91 | ||
55 | #define SMP_PHY_TEST_FUNCTION 0x92 | ||
56 | |||
57 | #define SMP_RESP_FUNC_ACC 0x00 | ||
58 | #define SMP_RESP_FUNC_UNK 0x01 | ||
59 | #define SMP_RESP_FUNC_FAILED 0x02 | ||
60 | #define SMP_RESP_INV_FRM_LEN 0x03 | ||
61 | #define SMP_RESP_NO_PHY 0x10 | ||
62 | #define SMP_RESP_NO_INDEX 0x11 | ||
63 | #define SMP_RESP_PHY_NO_SATA 0x12 | ||
64 | #define SMP_RESP_PHY_UNK_OP 0x13 | ||
65 | #define SMP_RESP_PHY_UNK_TESTF 0x14 | ||
66 | #define SMP_RESP_PHY_TEST_INPROG 0x15 | ||
67 | #define SMP_RESP_PHY_VACANT 0x16 | ||
68 | |||
69 | /* SAM TMFs */ | ||
70 | #define TMF_ABORT_TASK 0x01 | ||
71 | #define TMF_ABORT_TASK_SET 0x02 | ||
72 | #define TMF_CLEAR_TASK_SET 0x04 | ||
73 | #define TMF_LU_RESET 0x08 | ||
74 | #define TMF_CLEAR_ACA 0x40 | ||
75 | #define TMF_QUERY_TASK 0x80 | ||
76 | |||
77 | /* SAS TMF responses */ | ||
78 | #define TMF_RESP_FUNC_COMPLETE 0x00 | ||
79 | #define TMF_RESP_INVALID_FRAME 0x02 | ||
80 | #define TMF_RESP_FUNC_ESUPP 0x04 | ||
81 | #define TMF_RESP_FUNC_FAILED 0x05 | ||
82 | #define TMF_RESP_FUNC_SUCC 0x08 | ||
83 | #define TMF_RESP_NO_LUN 0x09 | ||
84 | #define TMF_RESP_OVERLAPPED_TAG 0x0A | ||
85 | |||
86 | enum sas_oob_mode { | ||
87 | OOB_NOT_CONNECTED, | ||
88 | SATA_OOB_MODE, | ||
89 | SAS_OOB_MODE | ||
90 | }; | ||
91 | |||
92 | /* See sas_discover.c if you plan on changing these. | ||
93 | */ | ||
94 | enum sas_dev_type { | ||
95 | NO_DEVICE = 0, /* protocol */ | ||
96 | SAS_END_DEV = 1, /* protocol */ | ||
97 | EDGE_DEV = 2, /* protocol */ | ||
98 | FANOUT_DEV = 3, /* protocol */ | ||
99 | SAS_HA = 4, | ||
100 | SATA_DEV = 5, | ||
101 | SATA_PM = 7, | ||
102 | SATA_PM_PORT= 8, | ||
103 | }; | ||
104 | |||
105 | /* Partly from IDENTIFY address frame. */ | ||
106 | enum sas_proto { | ||
107 | SATA_PROTO = 1, | ||
108 | SAS_PROTO_SMP = 2, /* protocol */ | ||
109 | SAS_PROTO_STP = 4, /* protocol */ | ||
110 | SAS_PROTO_SSP = 8, /* protocol */ | ||
111 | SAS_PROTO_ALL = 0xE, | ||
112 | }; | ||
113 | |||
114 | /* From the spec; local phys only */ | ||
115 | enum phy_func { | ||
116 | PHY_FUNC_NOP, | ||
117 | PHY_FUNC_LINK_RESET, /* Enables the phy */ | ||
118 | PHY_FUNC_HARD_RESET, | ||
119 | PHY_FUNC_DISABLE, | ||
120 | PHY_FUNC_CLEAR_ERROR_LOG = 5, | ||
121 | PHY_FUNC_CLEAR_AFFIL, | ||
122 | PHY_FUNC_TX_SATA_PS_SIGNAL, | ||
123 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ | ||
124 | PHY_FUNC_SET_LINK_RATE, | ||
125 | }; | ||
126 | |||
127 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. | ||
128 | * Most of those are here for completeness. | ||
129 | */ | ||
130 | enum sas_prim { | ||
131 | SAS_PRIM_AIP_NORMAL = 1, | ||
132 | SAS_PRIM_AIP_R0 = 2, | ||
133 | SAS_PRIM_AIP_R1 = 3, | ||
134 | SAS_PRIM_AIP_R2 = 4, | ||
135 | SAS_PRIM_AIP_WC = 5, | ||
136 | SAS_PRIM_AIP_WD = 6, | ||
137 | SAS_PRIM_AIP_WP = 7, | ||
138 | SAS_PRIM_AIP_RWP = 8, | ||
139 | |||
140 | SAS_PRIM_BC_CH = 9, | ||
141 | SAS_PRIM_BC_RCH0 = 10, | ||
142 | SAS_PRIM_BC_RCH1 = 11, | ||
143 | SAS_PRIM_BC_R0 = 12, | ||
144 | SAS_PRIM_BC_R1 = 13, | ||
145 | SAS_PRIM_BC_R2 = 14, | ||
146 | SAS_PRIM_BC_R3 = 15, | ||
147 | SAS_PRIM_BC_R4 = 16, | ||
148 | |||
149 | SAS_PRIM_NOTIFY_ENSP= 17, | ||
150 | SAS_PRIM_NOTIFY_R0 = 18, | ||
151 | SAS_PRIM_NOTIFY_R1 = 19, | ||
152 | SAS_PRIM_NOTIFY_R2 = 20, | ||
153 | |||
154 | SAS_PRIM_CLOSE_CLAF = 21, | ||
155 | SAS_PRIM_CLOSE_NORM = 22, | ||
156 | SAS_PRIM_CLOSE_R0 = 23, | ||
157 | SAS_PRIM_CLOSE_R1 = 24, | ||
158 | |||
159 | SAS_PRIM_OPEN_RTRY = 25, | ||
160 | SAS_PRIM_OPEN_RJCT = 26, | ||
161 | SAS_PRIM_OPEN_ACPT = 27, | ||
162 | |||
163 | SAS_PRIM_DONE = 28, | ||
164 | SAS_PRIM_BREAK = 29, | ||
165 | |||
166 | SATA_PRIM_DMAT = 33, | ||
167 | SATA_PRIM_PMNAK = 34, | ||
168 | SATA_PRIM_PMACK = 35, | ||
169 | SATA_PRIM_PMREQ_S = 36, | ||
170 | SATA_PRIM_PMREQ_P = 37, | ||
171 | SATA_SATA_R_ERR = 38, | ||
172 | }; | ||
173 | |||
174 | enum sas_open_rej_reason { | ||
175 | /* Abandon open */ | ||
176 | SAS_OREJ_UNKNOWN = 0, | ||
177 | SAS_OREJ_BAD_DEST = 1, | ||
178 | SAS_OREJ_CONN_RATE = 2, | ||
179 | SAS_OREJ_EPROTO = 3, | ||
180 | SAS_OREJ_RESV_AB0 = 4, | ||
181 | SAS_OREJ_RESV_AB1 = 5, | ||
182 | SAS_OREJ_RESV_AB2 = 6, | ||
183 | SAS_OREJ_RESV_AB3 = 7, | ||
184 | SAS_OREJ_WRONG_DEST= 8, | ||
185 | SAS_OREJ_STP_NORES = 9, | ||
186 | |||
187 | /* Retry open */ | ||
188 | SAS_OREJ_NO_DEST = 10, | ||
189 | SAS_OREJ_PATH_BLOCKED = 11, | ||
190 | SAS_OREJ_RSVD_CONT0 = 12, | ||
191 | SAS_OREJ_RSVD_CONT1 = 13, | ||
192 | SAS_OREJ_RSVD_INIT0 = 14, | ||
193 | SAS_OREJ_RSVD_INIT1 = 15, | ||
194 | SAS_OREJ_RSVD_STOP0 = 16, | ||
195 | SAS_OREJ_RSVD_STOP1 = 17, | ||
196 | SAS_OREJ_RSVD_RETRY = 18, | ||
197 | }; | ||
198 | |||
199 | struct dev_to_host_fis { | ||
200 | u8 fis_type; /* 0x34 */ | ||
201 | u8 flags; | ||
202 | u8 status; | ||
203 | u8 error; | ||
204 | |||
205 | u8 lbal; | ||
206 | union { u8 lbam; u8 byte_count_low; }; | ||
207 | union { u8 lbah; u8 byte_count_high; }; | ||
208 | u8 device; | ||
209 | |||
210 | u8 lbal_exp; | ||
211 | u8 lbam_exp; | ||
212 | u8 lbah_exp; | ||
213 | u8 _r_a; | ||
214 | |||
215 | union { u8 sector_count; u8 interrupt_reason; }; | ||
216 | u8 sector_count_exp; | ||
217 | u8 _r_b; | ||
218 | u8 _r_c; | ||
219 | |||
220 | u32 _r_d; | ||
221 | } __attribute__ ((packed)); | ||
222 | |||
223 | struct host_to_dev_fis { | ||
224 | u8 fis_type; /* 0x27 */ | ||
225 | u8 flags; | ||
226 | u8 command; | ||
227 | u8 features; | ||
228 | |||
229 | u8 lbal; | ||
230 | union { u8 lbam; u8 byte_count_low; }; | ||
231 | union { u8 lbah; u8 byte_count_high; }; | ||
232 | u8 device; | ||
233 | |||
234 | u8 lbal_exp; | ||
235 | u8 lbam_exp; | ||
236 | u8 lbah_exp; | ||
237 | u8 features_exp; | ||
238 | |||
239 | union { u8 sector_count; u8 interrupt_reason; }; | ||
240 | u8 sector_count_exp; | ||
241 | u8 _r_a; | ||
242 | u8 control; | ||
243 | |||
244 | u32 _r_b; | ||
245 | } __attribute__ ((packed)); | ||
246 | |||
247 | /* Prefer to have code clarity over header file clarity. | ||
248 | */ | ||
249 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
250 | struct sas_identify_frame { | ||
251 | /* Byte 0 */ | ||
252 | u8 frame_type:4; | ||
253 | u8 dev_type:3; | ||
254 | u8 _un0:1; | ||
255 | |||
256 | /* Byte 1 */ | ||
257 | u8 _un1; | ||
258 | |||
259 | /* Byte 2 */ | ||
260 | union { | ||
261 | struct { | ||
262 | u8 _un20:1; | ||
263 | u8 smp_iport:1; | ||
264 | u8 stp_iport:1; | ||
265 | u8 ssp_iport:1; | ||
266 | u8 _un247:4; | ||
267 | }; | ||
268 | u8 initiator_bits; | ||
269 | }; | ||
270 | |||
271 | /* Byte 3 */ | ||
272 | union { | ||
273 | struct { | ||
274 | u8 _un30:1; | ||
275 | u8 smp_tport:1; | ||
276 | u8 stp_tport:1; | ||
277 | u8 ssp_tport:1; | ||
278 | u8 _un347:4; | ||
279 | }; | ||
280 | u8 target_bits; | ||
281 | }; | ||
282 | |||
283 | /* Byte 4 - 11 */ | ||
284 | u8 _un4_11[8]; | ||
285 | |||
286 | /* Byte 12 - 19 */ | ||
287 | u8 sas_addr[SAS_ADDR_SIZE]; | ||
288 | |||
289 | /* Byte 20 */ | ||
290 | u8 phy_id; | ||
291 | |||
292 | u8 _un21_27[7]; | ||
293 | |||
294 | __be32 crc; | ||
295 | } __attribute__ ((packed)); | ||
296 | |||
297 | struct ssp_frame_hdr { | ||
298 | u8 frame_type; | ||
299 | u8 hashed_dest_addr[HASHED_SAS_ADDR_SIZE]; | ||
300 | u8 _r_a; | ||
301 | u8 hashed_src_addr[HASHED_SAS_ADDR_SIZE]; | ||
302 | __be16 _r_b; | ||
303 | |||
304 | u8 changing_data_ptr:1; | ||
305 | u8 retransmit:1; | ||
306 | u8 retry_data_frames:1; | ||
307 | u8 _r_c:5; | ||
308 | |||
309 | u8 num_fill_bytes:2; | ||
310 | u8 _r_d:6; | ||
311 | |||
312 | u32 _r_e; | ||
313 | __be16 tag; | ||
314 | __be16 tptt; | ||
315 | __be32 data_offs; | ||
316 | } __attribute__ ((packed)); | ||
317 | |||
318 | struct ssp_response_iu { | ||
319 | u8 _r_a[10]; | ||
320 | |||
321 | u8 datapres:2; | ||
322 | u8 _r_b:6; | ||
323 | |||
324 | u8 status; | ||
325 | |||
326 | u32 _r_c; | ||
327 | |||
328 | __be32 sense_data_len; | ||
329 | __be32 response_data_len; | ||
330 | |||
331 | u8 resp_data[0]; | ||
332 | u8 sense_data[0]; | ||
333 | } __attribute__ ((packed)); | ||
334 | |||
335 | /* ---------- SMP ---------- */ | ||
336 | |||
337 | struct report_general_resp { | ||
338 | __be16 change_count; | ||
339 | __be16 route_indexes; | ||
340 | u8 _r_a; | ||
341 | u8 num_phys; | ||
342 | |||
343 | u8 conf_route_table:1; | ||
344 | u8 configuring:1; | ||
345 | u8 _r_b:6; | ||
346 | |||
347 | u8 _r_c; | ||
348 | |||
349 | u8 enclosure_logical_id[8]; | ||
350 | |||
351 | u8 _r_d[12]; | ||
352 | } __attribute__ ((packed)); | ||
353 | |||
354 | struct discover_resp { | ||
355 | u8 _r_a[5]; | ||
356 | |||
357 | u8 phy_id; | ||
358 | __be16 _r_b; | ||
359 | |||
360 | u8 _r_c:4; | ||
361 | u8 attached_dev_type:3; | ||
362 | u8 _r_d:1; | ||
363 | |||
364 | u8 linkrate:4; | ||
365 | u8 _r_e:4; | ||
366 | |||
367 | u8 attached_sata_host:1; | ||
368 | u8 iproto:3; | ||
369 | u8 _r_f:4; | ||
370 | |||
371 | u8 attached_sata_dev:1; | ||
372 | u8 tproto:3; | ||
373 | u8 _r_g:3; | ||
374 | u8 attached_sata_ps:1; | ||
375 | |||
376 | u8 sas_addr[8]; | ||
377 | u8 attached_sas_addr[8]; | ||
378 | u8 attached_phy_id; | ||
379 | |||
380 | u8 _r_h[7]; | ||
381 | |||
382 | u8 hmin_linkrate:4; | ||
383 | u8 pmin_linkrate:4; | ||
384 | u8 hmax_linkrate:4; | ||
385 | u8 pmax_linkrate:4; | ||
386 | |||
387 | u8 change_count; | ||
388 | |||
389 | u8 pptv:4; | ||
390 | u8 _r_i:3; | ||
391 | u8 virtual:1; | ||
392 | |||
393 | u8 routing_attr:4; | ||
394 | u8 _r_j:4; | ||
395 | |||
396 | u8 conn_type; | ||
397 | u8 conn_el_index; | ||
398 | u8 conn_phy_link; | ||
399 | |||
400 | u8 _r_k[8]; | ||
401 | } __attribute__ ((packed)); | ||
402 | |||
403 | struct report_phy_sata_resp { | ||
404 | u8 _r_a[5]; | ||
405 | |||
406 | u8 phy_id; | ||
407 | u8 _r_b; | ||
408 | |||
409 | u8 affil_valid:1; | ||
410 | u8 affil_supp:1; | ||
411 | u8 _r_c:6; | ||
412 | |||
413 | u32 _r_d; | ||
414 | |||
415 | u8 stp_sas_addr[8]; | ||
416 | |||
417 | struct dev_to_host_fis fis; | ||
418 | |||
419 | u32 _r_e; | ||
420 | |||
421 | u8 affil_stp_ini_addr[8]; | ||
422 | |||
423 | __be32 crc; | ||
424 | } __attribute__ ((packed)); | ||
425 | |||
426 | struct smp_resp { | ||
427 | u8 frame_type; | ||
428 | u8 function; | ||
429 | u8 result; | ||
430 | u8 reserved; | ||
431 | union { | ||
432 | struct report_general_resp rg; | ||
433 | struct discover_resp disc; | ||
434 | struct report_phy_sata_resp rps; | ||
435 | }; | ||
436 | } __attribute__ ((packed)); | ||
437 | |||
438 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
439 | struct sas_identify_frame { | ||
440 | /* Byte 0 */ | ||
441 | u8 _un0:1; | ||
442 | u8 dev_type:3; | ||
443 | u8 frame_type:4; | ||
444 | |||
445 | /* Byte 1 */ | ||
446 | u8 _un1; | ||
447 | |||
448 | /* Byte 2 */ | ||
449 | union { | ||
450 | struct { | ||
451 | u8 _un247:4; | ||
452 | u8 ssp_iport:1; | ||
453 | u8 stp_iport:1; | ||
454 | u8 smp_iport:1; | ||
455 | u8 _un20:1; | ||
456 | }; | ||
457 | u8 initiator_bits; | ||
458 | }; | ||
459 | |||
460 | /* Byte 3 */ | ||
461 | union { | ||
462 | struct { | ||
463 | u8 _un347:4; | ||
464 | u8 ssp_tport:1; | ||
465 | u8 stp_tport:1; | ||
466 | u8 smp_tport:1; | ||
467 | u8 _un30:1; | ||
468 | }; | ||
469 | u8 target_bits; | ||
470 | }; | ||
471 | |||
472 | /* Byte 4 - 11 */ | ||
473 | u8 _un4_11[8]; | ||
474 | |||
475 | /* Byte 12 - 19 */ | ||
476 | u8 sas_addr[SAS_ADDR_SIZE]; | ||
477 | |||
478 | /* Byte 20 */ | ||
479 | u8 phy_id; | ||
480 | |||
481 | u8 _un21_27[7]; | ||
482 | |||
483 | __be32 crc; | ||
484 | } __attribute__ ((packed)); | ||
485 | |||
486 | struct ssp_frame_hdr { | ||
487 | u8 frame_type; | ||
488 | u8 hashed_dest_addr[HASHED_SAS_ADDR_SIZE]; | ||
489 | u8 _r_a; | ||
490 | u8 hashed_src_addr[HASHED_SAS_ADDR_SIZE]; | ||
491 | __be16 _r_b; | ||
492 | |||
493 | u8 _r_c:5; | ||
494 | u8 retry_data_frames:1; | ||
495 | u8 retransmit:1; | ||
496 | u8 changing_data_ptr:1; | ||
497 | |||
498 | u8 _r_d:6; | ||
499 | u8 num_fill_bytes:2; | ||
500 | |||
501 | u32 _r_e; | ||
502 | __be16 tag; | ||
503 | __be16 tptt; | ||
504 | __be32 data_offs; | ||
505 | } __attribute__ ((packed)); | ||
506 | |||
507 | struct ssp_response_iu { | ||
508 | u8 _r_a[10]; | ||
509 | |||
510 | u8 _r_b:6; | ||
511 | u8 datapres:2; | ||
512 | |||
513 | u8 status; | ||
514 | |||
515 | u32 _r_c; | ||
516 | |||
517 | __be32 sense_data_len; | ||
518 | __be32 response_data_len; | ||
519 | |||
520 | u8 resp_data[0]; | ||
521 | u8 sense_data[0]; | ||
522 | } __attribute__ ((packed)); | ||
523 | |||
524 | /* ---------- SMP ---------- */ | ||
525 | |||
526 | struct report_general_resp { | ||
527 | __be16 change_count; | ||
528 | __be16 route_indexes; | ||
529 | u8 _r_a; | ||
530 | u8 num_phys; | ||
531 | |||
532 | u8 _r_b:6; | ||
533 | u8 configuring:1; | ||
534 | u8 conf_route_table:1; | ||
535 | |||
536 | u8 _r_c; | ||
537 | |||
538 | u8 enclosure_logical_id[8]; | ||
539 | |||
540 | u8 _r_d[12]; | ||
541 | } __attribute__ ((packed)); | ||
542 | |||
543 | struct discover_resp { | ||
544 | u8 _r_a[5]; | ||
545 | |||
546 | u8 phy_id; | ||
547 | __be16 _r_b; | ||
548 | |||
549 | u8 _r_d:1; | ||
550 | u8 attached_dev_type:3; | ||
551 | u8 _r_c:4; | ||
552 | |||
553 | u8 _r_e:4; | ||
554 | u8 linkrate:4; | ||
555 | |||
556 | u8 _r_f:4; | ||
557 | u8 iproto:3; | ||
558 | u8 attached_sata_host:1; | ||
559 | |||
560 | u8 attached_sata_ps:1; | ||
561 | u8 _r_g:3; | ||
562 | u8 tproto:3; | ||
563 | u8 attached_sata_dev:1; | ||
564 | |||
565 | u8 sas_addr[8]; | ||
566 | u8 attached_sas_addr[8]; | ||
567 | u8 attached_phy_id; | ||
568 | |||
569 | u8 _r_h[7]; | ||
570 | |||
571 | u8 pmin_linkrate:4; | ||
572 | u8 hmin_linkrate:4; | ||
573 | u8 pmax_linkrate:4; | ||
574 | u8 hmax_linkrate:4; | ||
575 | |||
576 | u8 change_count; | ||
577 | |||
578 | u8 virtual:1; | ||
579 | u8 _r_i:3; | ||
580 | u8 pptv:4; | ||
581 | |||
582 | u8 _r_j:4; | ||
583 | u8 routing_attr:4; | ||
584 | |||
585 | u8 conn_type; | ||
586 | u8 conn_el_index; | ||
587 | u8 conn_phy_link; | ||
588 | |||
589 | u8 _r_k[8]; | ||
590 | } __attribute__ ((packed)); | ||
591 | |||
592 | struct report_phy_sata_resp { | ||
593 | u8 _r_a[5]; | ||
594 | |||
595 | u8 phy_id; | ||
596 | u8 _r_b; | ||
597 | |||
598 | u8 _r_c:6; | ||
599 | u8 affil_supp:1; | ||
600 | u8 affil_valid:1; | ||
601 | |||
602 | u32 _r_d; | ||
603 | |||
604 | u8 stp_sas_addr[8]; | ||
605 | |||
606 | struct dev_to_host_fis fis; | ||
607 | |||
608 | u32 _r_e; | ||
609 | |||
610 | u8 affil_stp_ini_addr[8]; | ||
611 | |||
612 | __be32 crc; | ||
613 | } __attribute__ ((packed)); | ||
614 | |||
615 | struct smp_resp { | ||
616 | u8 frame_type; | ||
617 | u8 function; | ||
618 | u8 result; | ||
619 | u8 reserved; | ||
620 | union { | ||
621 | struct report_general_resp rg; | ||
622 | struct discover_resp disc; | ||
623 | struct report_phy_sata_resp rps; | ||
624 | }; | ||
625 | } __attribute__ ((packed)); | ||
626 | |||
627 | #else | ||
628 | #error "Bitfield order not defined!" | ||
629 | #endif | ||
630 | |||
631 | #endif /* _SAS_H_ */ | ||
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index c60b8ff2f5e4..84a6d5fe0920 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -25,13 +25,6 @@ extern const unsigned char scsi_command_size[8]; | |||
25 | #define COMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7] | 25 | #define COMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7] |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * SCSI device types | ||
29 | */ | ||
30 | |||
31 | #define MAX_SCSI_DEVICE_CODE 15 | ||
32 | extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | ||
33 | |||
34 | /* | ||
35 | * Special value for scanning to specify scanning or rescanning of all | 28 | * Special value for scanning to specify scanning or rescanning of all |
36 | * possible channels, (target) ids, or luns on a given shost. | 29 | * possible channels, (target) ids, or luns on a given shost. |
37 | */ | 30 | */ |
@@ -225,6 +218,9 @@ static inline int scsi_status_is_good(int status) | |||
225 | #define TYPE_RBC 0x0e | 218 | #define TYPE_RBC 0x0e |
226 | #define TYPE_NO_LUN 0x7f | 219 | #define TYPE_NO_LUN 0x7f |
227 | 220 | ||
221 | /* Returns a human-readable name for the device */ | ||
222 | extern const char * scsi_device_type(unsigned type); | ||
223 | |||
228 | /* | 224 | /* |
229 | * standard mode-select header prepended to all mode-select commands | 225 | * standard mode-select header prepended to all mode-select commands |
230 | */ | 226 | */ |
@@ -433,4 +429,10 @@ struct scsi_lun { | |||
433 | /* Used to obtain the PCI location of a device */ | 429 | /* Used to obtain the PCI location of a device */ |
434 | #define SCSI_IOCTL_GET_PCI 0x5387 | 430 | #define SCSI_IOCTL_GET_PCI 0x5387 |
435 | 431 | ||
432 | /* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ | ||
433 | static inline u32 scsi_to_u32(u8 *ptr) | ||
434 | { | ||
435 | return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; | ||
436 | } | ||
437 | |||
436 | #endif /* _SCSI_SCSI_H */ | 438 | #endif /* _SCSI_SCSI_H */ |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 58e6444eebee..be117f812deb 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -118,20 +118,6 @@ struct scsi_cmnd { | |||
118 | unsigned long pid; /* Process ID, starts at 0. Unique per host. */ | 118 | unsigned long pid; /* Process ID, starts at 0. Unique per host. */ |
119 | }; | 119 | }; |
120 | 120 | ||
121 | /* | ||
122 | * These are the values that scsi_cmd->state can take. | ||
123 | */ | ||
124 | #define SCSI_STATE_TIMEOUT 0x1000 | ||
125 | #define SCSI_STATE_FINISHED 0x1001 | ||
126 | #define SCSI_STATE_FAILED 0x1002 | ||
127 | #define SCSI_STATE_QUEUED 0x1003 | ||
128 | #define SCSI_STATE_UNUSED 0x1006 | ||
129 | #define SCSI_STATE_DISCONNECTING 0x1008 | ||
130 | #define SCSI_STATE_INITIALIZING 0x1009 | ||
131 | #define SCSI_STATE_BHQUEUE 0x100a | ||
132 | #define SCSI_STATE_MLQUEUE 0x100b | ||
133 | |||
134 | |||
135 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); | 121 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
136 | extern void scsi_put_command(struct scsi_cmnd *); | 122 | extern void scsi_put_command(struct scsi_cmnd *); |
137 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); | 123 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index b3dd90f3e858..39c6f8cc20c3 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -16,6 +16,7 @@ struct scsi_target; | |||
16 | struct Scsi_Host; | 16 | struct Scsi_Host; |
17 | struct scsi_host_cmd_pool; | 17 | struct scsi_host_cmd_pool; |
18 | struct scsi_transport_template; | 18 | struct scsi_transport_template; |
19 | struct blk_queue_tags; | ||
19 | 20 | ||
20 | 21 | ||
21 | /* | 22 | /* |
@@ -466,6 +467,12 @@ struct Scsi_Host { | |||
466 | struct scsi_transport_template *transportt; | 467 | struct scsi_transport_template *transportt; |
467 | 468 | ||
468 | /* | 469 | /* |
470 | * area to keep a shared tag map (if needed, will be | ||
471 | * NULL if not) | ||
472 | */ | ||
473 | struct blk_queue_tag *bqt; | ||
474 | |||
475 | /* | ||
469 | * The following two fields are protected with host_lock; | 476 | * The following two fields are protected with host_lock; |
470 | * however, eh routines can safely access during eh processing | 477 | * however, eh routines can safely access during eh processing |
471 | * without acquiring the lock. | 478 | * without acquiring the lock. |
diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h new file mode 100644 index 000000000000..8c1470cc8209 --- /dev/null +++ b/include/scsi/scsi_netlink.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * SCSI Transport Netlink Interface | ||
3 | * Used for the posting of outbound SCSI transport events | ||
4 | * | ||
5 | * Copyright (C) 2006 James Smart, Emulex Corporation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | #ifndef SCSI_NETLINK_H | ||
23 | #define SCSI_NETLINK_H | ||
24 | |||
25 | /* | ||
26 | * This file intended to be included by both kernel and user space | ||
27 | */ | ||
28 | |||
29 | /* Single Netlink Message type to send all SCSI Transport messages */ | ||
30 | #define SCSI_TRANSPORT_MSG NLMSG_MIN_TYPE + 1 | ||
31 | |||
32 | /* SCSI Transport Broadcast Groups */ | ||
33 | /* leaving groups 0 and 1 unassigned */ | ||
34 | #define SCSI_NL_GRP_FC_EVENTS (1<<2) /* Group 2 */ | ||
35 | #define SCSI_NL_GRP_CNT 3 | ||
36 | |||
37 | |||
38 | /* SCSI_TRANSPORT_MSG event message header */ | ||
39 | struct scsi_nl_hdr { | ||
40 | uint8_t version; | ||
41 | uint8_t transport; | ||
42 | uint16_t magic; | ||
43 | uint16_t msgtype; | ||
44 | uint16_t msglen; | ||
45 | } __attribute__((aligned(sizeof(uint64_t)))); | ||
46 | |||
47 | /* scsi_nl_hdr->version value */ | ||
48 | #define SCSI_NL_VERSION 1 | ||
49 | |||
50 | /* scsi_nl_hdr->magic value */ | ||
51 | #define SCSI_NL_MAGIC 0xA1B2 | ||
52 | |||
53 | /* scsi_nl_hdr->transport value */ | ||
54 | #define SCSI_NL_TRANSPORT 0 | ||
55 | #define SCSI_NL_TRANSPORT_FC 1 | ||
56 | #define SCSI_NL_MAX_TRANSPORTS 2 | ||
57 | |||
58 | /* scsi_nl_hdr->msgtype values are defined in each transport */ | ||
59 | |||
60 | |||
61 | /* | ||
62 | * Vendor ID: | ||
63 | * If transports post vendor-unique events, they must pass a well-known | ||
64 | * 32-bit vendor identifier. This identifier consists of 8 bits indicating | ||
65 | * the "type" of identifier contained, and 24 bits of id data. | ||
66 | * | ||
67 | * Identifiers for each type: | ||
68 | * PCI : ID data is the 16 bit PCI Registered Vendor ID | ||
69 | */ | ||
70 | #define SCSI_NL_VID_TYPE_SHIFT 56 | ||
71 | #define SCSI_NL_VID_TYPE_MASK ((u64)0xFF << SCSI_NL_VID_TYPE_SHIFT) | ||
72 | #define SCSI_NL_VID_TYPE_PCI ((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) | ||
73 | #define SCSI_NL_VID_ID_MASK (~ SCSI_NL_VID_TYPE_MASK) | ||
74 | |||
75 | |||
76 | #define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen) \ | ||
77 | { \ | ||
78 | (hdr)->version = SCSI_NL_VERSION; \ | ||
79 | (hdr)->transport = t; \ | ||
80 | (hdr)->magic = SCSI_NL_MAGIC; \ | ||
81 | (hdr)->msgtype = mtype; \ | ||
82 | (hdr)->msglen = mlen; \ | ||
83 | } | ||
84 | |||
85 | |||
86 | #endif /* SCSI_NETLINK_H */ | ||
87 | |||
diff --git a/include/scsi/scsi_netlink_fc.h b/include/scsi/scsi_netlink_fc.h new file mode 100644 index 000000000000..cbf76e479761 --- /dev/null +++ b/include/scsi/scsi_netlink_fc.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * FC Transport Netlink Interface | ||
3 | * | ||
4 | * Copyright (C) 2006 James Smart, Emulex Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | #ifndef SCSI_NETLINK_FC_H | ||
22 | #define SCSI_NETLINK_FC_H | ||
23 | |||
24 | #include <scsi/scsi_netlink.h> | ||
25 | |||
26 | /* | ||
27 | * This file intended to be included by both kernel and user space | ||
28 | */ | ||
29 | |||
30 | /* | ||
31 | * FC Transport Message Types | ||
32 | */ | ||
33 | /* kernel -> user */ | ||
34 | #define FC_NL_ASYNC_EVENT 0x0100 | ||
35 | /* user -> kernel */ | ||
36 | /* none */ | ||
37 | |||
38 | |||
39 | /* | ||
40 | * Message Structures : | ||
41 | */ | ||
42 | |||
43 | /* macro to round up message lengths to 8byte boundary */ | ||
44 | #define FC_NL_MSGALIGN(len) (((len) + 7) & ~7) | ||
45 | |||
46 | |||
47 | /* | ||
48 | * FC Transport Broadcast Event Message : | ||
49 | * FC_NL_ASYNC_EVENT | ||
50 | * | ||
51 | * Note: if Vendor Unique message, &event_data will be start of | ||
52 | * vendor unique payload, and the length of the payload is | ||
53 | * per event_datalen | ||
54 | * | ||
55 | * Note: When specifying vendor_id, be sure to read the Vendor Type and ID | ||
56 | * formatting requirements specified in scsi_netlink.h | ||
57 | */ | ||
58 | struct fc_nl_event { | ||
59 | struct scsi_nl_hdr snlh; /* must be 1st element ! */ | ||
60 | uint64_t seconds; | ||
61 | uint64_t vendor_id; | ||
62 | uint16_t host_no; | ||
63 | uint16_t event_datalen; | ||
64 | uint32_t event_num; | ||
65 | uint32_t event_code; | ||
66 | uint32_t event_data; | ||
67 | } __attribute__((aligned(sizeof(uint64_t)))); | ||
68 | |||
69 | |||
70 | #endif /* SCSI_NETLINK_FC_H */ | ||
71 | |||
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index e47e36a4ef49..d04d05adfa9b 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/blkdev.h> | 4 | #include <linux/blkdev.h> |
5 | #include <scsi/scsi_cmnd.h> | 5 | #include <scsi/scsi_cmnd.h> |
6 | #include <scsi/scsi_device.h> | 6 | #include <scsi/scsi_device.h> |
7 | #include <scsi/scsi_host.h> | ||
7 | 8 | ||
8 | 9 | ||
9 | #define MSG_SIMPLE_TAG 0x20 | 10 | #define MSG_SIMPLE_TAG 0x20 |
@@ -66,7 +67,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
66 | return; | 67 | return; |
67 | 68 | ||
68 | if (!blk_queue_tagged(sdev->request_queue)) | 69 | if (!blk_queue_tagged(sdev->request_queue)) |
69 | blk_queue_init_tags(sdev->request_queue, depth, NULL); | 70 | blk_queue_init_tags(sdev->request_queue, depth, |
71 | sdev->host->bqt); | ||
70 | 72 | ||
71 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | 73 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); |
72 | } | 74 | } |
@@ -131,4 +133,15 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) | |||
131 | return sdev->current_cmnd; | 133 | return sdev->current_cmnd; |
132 | } | 134 | } |
133 | 135 | ||
136 | /** | ||
137 | * scsi_init_shared_tag_map - create a shared tag map | ||
138 | * @shost: the host to share the tag map among all devices | ||
139 | * @depth: the total depth of the map | ||
140 | */ | ||
141 | static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | ||
142 | { | ||
143 | shost->bqt = blk_init_tags(depth); | ||
144 | return shost->bqt ? 0 : -ENOMEM; | ||
145 | } | ||
146 | |||
134 | #endif /* _SCSI_SCSI_TCQ_H */ | 147 | #endif /* _SCSI_SCSI_TCQ_H */ |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 6d28b0317657..fd352323378b 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <scsi/scsi.h> | 31 | #include <scsi/scsi.h> |
32 | #include <scsi/scsi_netlink.h> | ||
32 | 33 | ||
33 | struct scsi_transport_template; | 34 | struct scsi_transport_template; |
34 | 35 | ||
@@ -194,6 +195,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
194 | u32 roles; | 195 | u32 roles; |
195 | enum fc_port_state port_state; /* Will only be ONLINE or UNKNOWN */ | 196 | enum fc_port_state port_state; /* Will only be ONLINE or UNKNOWN */ |
196 | u32 scsi_target_id; | 197 | u32 scsi_target_id; |
198 | u32 fast_io_fail_tmo; | ||
197 | 199 | ||
198 | /* exported data */ | 200 | /* exported data */ |
199 | void *dd_data; /* Used for driver-specific storage */ | 201 | void *dd_data; /* Used for driver-specific storage */ |
@@ -206,6 +208,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
206 | struct device dev; | 208 | struct device dev; |
207 | struct work_struct dev_loss_work; | 209 | struct work_struct dev_loss_work; |
208 | struct work_struct scan_work; | 210 | struct work_struct scan_work; |
211 | struct work_struct fail_io_work; | ||
209 | struct work_struct stgt_delete_work; | 212 | struct work_struct stgt_delete_work; |
210 | struct work_struct rport_delete_work; | 213 | struct work_struct rport_delete_work; |
211 | } __attribute__((aligned(sizeof(unsigned long)))); | 214 | } __attribute__((aligned(sizeof(unsigned long)))); |
@@ -284,6 +287,30 @@ struct fc_host_statistics { | |||
284 | 287 | ||
285 | 288 | ||
286 | /* | 289 | /* |
290 | * FC Event Codes - Polled and Async, following FC HBAAPI v2.0 guidelines | ||
291 | */ | ||
292 | |||
293 | /* | ||
294 | * fc_host_event_code: If you alter this, you also need to alter | ||
295 | * scsi_transport_fc.c (for the ascii descriptions). | ||
296 | */ | ||
297 | enum fc_host_event_code { | ||
298 | FCH_EVT_LIP = 0x1, | ||
299 | FCH_EVT_LINKUP = 0x2, | ||
300 | FCH_EVT_LINKDOWN = 0x3, | ||
301 | FCH_EVT_LIPRESET = 0x4, | ||
302 | FCH_EVT_RSCN = 0x5, | ||
303 | FCH_EVT_ADAPTER_CHANGE = 0x103, | ||
304 | FCH_EVT_PORT_UNKNOWN = 0x200, | ||
305 | FCH_EVT_PORT_OFFLINE = 0x201, | ||
306 | FCH_EVT_PORT_ONLINE = 0x202, | ||
307 | FCH_EVT_PORT_FABRIC = 0x204, | ||
308 | FCH_EVT_LINK_UNKNOWN = 0x500, | ||
309 | FCH_EVT_VENDOR_UNIQUE = 0xffff, | ||
310 | }; | ||
311 | |||
312 | |||
313 | /* | ||
287 | * FC Local Port (Host) Attributes | 314 | * FC Local Port (Host) Attributes |
288 | * | 315 | * |
289 | * Attributes are based on HBAAPI V2.0 definitions. | 316 | * Attributes are based on HBAAPI V2.0 definitions. |
@@ -312,7 +339,6 @@ struct fc_host_attrs { | |||
312 | u64 permanent_port_name; | 339 | u64 permanent_port_name; |
313 | u32 supported_classes; | 340 | u32 supported_classes; |
314 | u8 supported_fc4s[FC_FC4_LIST_SIZE]; | 341 | u8 supported_fc4s[FC_FC4_LIST_SIZE]; |
315 | char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; | ||
316 | u32 supported_speeds; | 342 | u32 supported_speeds; |
317 | u32 maxframe_size; | 343 | u32 maxframe_size; |
318 | char serial_number[FC_SERIAL_NUMBER_SIZE]; | 344 | char serial_number[FC_SERIAL_NUMBER_SIZE]; |
@@ -324,6 +350,8 @@ struct fc_host_attrs { | |||
324 | u8 active_fc4s[FC_FC4_LIST_SIZE]; | 350 | u8 active_fc4s[FC_FC4_LIST_SIZE]; |
325 | u32 speed; | 351 | u32 speed; |
326 | u64 fabric_name; | 352 | u64 fabric_name; |
353 | char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; | ||
354 | char system_hostname[FC_SYMBOLIC_NAME_SIZE]; | ||
327 | 355 | ||
328 | /* Private (Transport-managed) Attributes */ | 356 | /* Private (Transport-managed) Attributes */ |
329 | enum fc_tgtid_binding_type tgtid_bind_type; | 357 | enum fc_tgtid_binding_type tgtid_bind_type; |
@@ -354,8 +382,6 @@ struct fc_host_attrs { | |||
354 | (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) | 382 | (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) |
355 | #define fc_host_supported_fc4s(x) \ | 383 | #define fc_host_supported_fc4s(x) \ |
356 | (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s) | 384 | (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s) |
357 | #define fc_host_symbolic_name(x) \ | ||
358 | (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name) | ||
359 | #define fc_host_supported_speeds(x) \ | 385 | #define fc_host_supported_speeds(x) \ |
360 | (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds) | 386 | (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds) |
361 | #define fc_host_maxframe_size(x) \ | 387 | #define fc_host_maxframe_size(x) \ |
@@ -374,6 +400,10 @@ struct fc_host_attrs { | |||
374 | (((struct fc_host_attrs *)(x)->shost_data)->speed) | 400 | (((struct fc_host_attrs *)(x)->shost_data)->speed) |
375 | #define fc_host_fabric_name(x) \ | 401 | #define fc_host_fabric_name(x) \ |
376 | (((struct fc_host_attrs *)(x)->shost_data)->fabric_name) | 402 | (((struct fc_host_attrs *)(x)->shost_data)->fabric_name) |
403 | #define fc_host_symbolic_name(x) \ | ||
404 | (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name) | ||
405 | #define fc_host_system_hostname(x) \ | ||
406 | (((struct fc_host_attrs *)(x)->shost_data)->system_hostname) | ||
377 | #define fc_host_tgtid_bind_type(x) \ | 407 | #define fc_host_tgtid_bind_type(x) \ |
378 | (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type) | 408 | (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type) |
379 | #define fc_host_rports(x) \ | 409 | #define fc_host_rports(x) \ |
@@ -409,12 +439,17 @@ struct fc_function_template { | |||
409 | void (*get_host_active_fc4s)(struct Scsi_Host *); | 439 | void (*get_host_active_fc4s)(struct Scsi_Host *); |
410 | void (*get_host_speed)(struct Scsi_Host *); | 440 | void (*get_host_speed)(struct Scsi_Host *); |
411 | void (*get_host_fabric_name)(struct Scsi_Host *); | 441 | void (*get_host_fabric_name)(struct Scsi_Host *); |
442 | void (*get_host_symbolic_name)(struct Scsi_Host *); | ||
443 | void (*set_host_system_hostname)(struct Scsi_Host *); | ||
412 | 444 | ||
413 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); | 445 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); |
414 | void (*reset_fc_host_stats)(struct Scsi_Host *); | 446 | void (*reset_fc_host_stats)(struct Scsi_Host *); |
415 | 447 | ||
416 | int (*issue_fc_host_lip)(struct Scsi_Host *); | 448 | int (*issue_fc_host_lip)(struct Scsi_Host *); |
417 | 449 | ||
450 | void (*dev_loss_tmo_callbk)(struct fc_rport *); | ||
451 | void (*terminate_rport_io)(struct fc_rport *); | ||
452 | |||
418 | /* allocation lengths for host-specific data */ | 453 | /* allocation lengths for host-specific data */ |
419 | u32 dd_fcrport_size; | 454 | u32 dd_fcrport_size; |
420 | 455 | ||
@@ -445,7 +480,6 @@ struct fc_function_template { | |||
445 | unsigned long show_host_permanent_port_name:1; | 480 | unsigned long show_host_permanent_port_name:1; |
446 | unsigned long show_host_supported_classes:1; | 481 | unsigned long show_host_supported_classes:1; |
447 | unsigned long show_host_supported_fc4s:1; | 482 | unsigned long show_host_supported_fc4s:1; |
448 | unsigned long show_host_symbolic_name:1; | ||
449 | unsigned long show_host_supported_speeds:1; | 483 | unsigned long show_host_supported_speeds:1; |
450 | unsigned long show_host_maxframe_size:1; | 484 | unsigned long show_host_maxframe_size:1; |
451 | unsigned long show_host_serial_number:1; | 485 | unsigned long show_host_serial_number:1; |
@@ -456,6 +490,8 @@ struct fc_function_template { | |||
456 | unsigned long show_host_active_fc4s:1; | 490 | unsigned long show_host_active_fc4s:1; |
457 | unsigned long show_host_speed:1; | 491 | unsigned long show_host_speed:1; |
458 | unsigned long show_host_fabric_name:1; | 492 | unsigned long show_host_fabric_name:1; |
493 | unsigned long show_host_symbolic_name:1; | ||
494 | unsigned long show_host_system_hostname:1; | ||
459 | }; | 495 | }; |
460 | 496 | ||
461 | 497 | ||
@@ -491,6 +527,25 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
491 | return result; | 527 | return result; |
492 | } | 528 | } |
493 | 529 | ||
530 | static inline u64 wwn_to_u64(u8 *wwn) | ||
531 | { | ||
532 | return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 | | ||
533 | (u64)wwn[2] << 40 | (u64)wwn[3] << 32 | | ||
534 | (u64)wwn[4] << 24 | (u64)wwn[5] << 16 | | ||
535 | (u64)wwn[6] << 8 | (u64)wwn[7]; | ||
536 | } | ||
537 | |||
538 | static inline void u64_to_wwn(u64 inm, u8 *wwn) | ||
539 | { | ||
540 | wwn[0] = (inm >> 56) & 0xff; | ||
541 | wwn[1] = (inm >> 48) & 0xff; | ||
542 | wwn[2] = (inm >> 40) & 0xff; | ||
543 | wwn[3] = (inm >> 32) & 0xff; | ||
544 | wwn[4] = (inm >> 24) & 0xff; | ||
545 | wwn[5] = (inm >> 16) & 0xff; | ||
546 | wwn[6] = (inm >> 8) & 0xff; | ||
547 | wwn[7] = inm & 0xff; | ||
548 | } | ||
494 | 549 | ||
495 | struct scsi_transport_template *fc_attach_transport( | 550 | struct scsi_transport_template *fc_attach_transport( |
496 | struct fc_function_template *); | 551 | struct fc_function_template *); |
@@ -501,13 +556,14 @@ struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost, | |||
501 | void fc_remote_port_delete(struct fc_rport *rport); | 556 | void fc_remote_port_delete(struct fc_rport *rport); |
502 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); | 557 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); |
503 | int scsi_is_fc_rport(const struct device *); | 558 | int scsi_is_fc_rport(const struct device *); |
504 | 559 | u32 fc_get_event_number(void); | |
505 | static inline u64 wwn_to_u64(u8 *wwn) | 560 | void fc_host_post_event(struct Scsi_Host *shost, u32 event_number, |
506 | { | 561 | enum fc_host_event_code event_code, u32 event_data); |
507 | return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 | | 562 | void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, |
508 | (u64)wwn[2] << 40 | (u64)wwn[3] << 32 | | 563 | u32 data_len, char * data_buf, u64 vendor_id); |
509 | (u64)wwn[4] << 24 | (u64)wwn[5] << 16 | | 564 | /* Note: when specifying vendor_id to fc_host_post_vendor_event() |
510 | (u64)wwn[6] << 8 | (u64)wwn[7]; | 565 | * be sure to read the Vendor Type and ID formatting requirements |
511 | } | 566 | * specified in scsi_netlink.h |
567 | */ | ||
512 | 568 | ||
513 | #endif /* SCSI_TRANSPORT_FC_H */ | 569 | #endif /* SCSI_TRANSPORT_FC_H */ |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 6cc2314098cf..53024377f3b8 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -24,15 +24,23 @@ enum sas_protocol { | |||
24 | }; | 24 | }; |
25 | 25 | ||
26 | enum sas_linkrate { | 26 | enum sas_linkrate { |
27 | SAS_LINK_RATE_UNKNOWN, | 27 | /* These Values are defined in the SAS standard */ |
28 | SAS_PHY_DISABLED, | 28 | SAS_LINK_RATE_UNKNOWN = 0, |
29 | SAS_LINK_RATE_FAILED, | 29 | SAS_PHY_DISABLED = 1, |
30 | SAS_SATA_SPINUP_HOLD, | 30 | SAS_PHY_RESET_PROBLEM = 2, |
31 | SAS_SATA_PORT_SELECTOR, | 31 | SAS_SATA_SPINUP_HOLD = 3, |
32 | SAS_LINK_RATE_1_5_GBPS, | 32 | SAS_SATA_PORT_SELECTOR = 4, |
33 | SAS_LINK_RATE_3_0_GBPS, | 33 | SAS_PHY_RESET_IN_PROGRESS = 5, |
34 | SAS_LINK_RATE_6_0_GBPS, | 34 | SAS_LINK_RATE_1_5_GBPS = 8, |
35 | SAS_LINK_VIRTUAL, | 35 | SAS_LINK_RATE_G1 = SAS_LINK_RATE_1_5_GBPS, |
36 | SAS_LINK_RATE_3_0_GBPS = 9, | ||
37 | SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS, | ||
38 | SAS_LINK_RATE_6_0_GBPS = 10, | ||
39 | /* These are virtual to the transport class and may never | ||
40 | * be signalled normally since the standard defined field | ||
41 | * is only 4 bits */ | ||
42 | SAS_LINK_RATE_FAILED = 0x10, | ||
43 | SAS_PHY_VIRTUAL = 0x11, | ||
36 | }; | 44 | }; |
37 | 45 | ||
38 | struct sas_identify { | 46 | struct sas_identify { |
@@ -57,9 +65,6 @@ struct sas_phy { | |||
57 | enum sas_linkrate maximum_linkrate_hw; | 65 | enum sas_linkrate maximum_linkrate_hw; |
58 | enum sas_linkrate maximum_linkrate; | 66 | enum sas_linkrate maximum_linkrate; |
59 | 67 | ||
60 | /* internal state */ | ||
61 | unsigned int local_attached : 1; | ||
62 | |||
63 | /* link error statistics */ | 68 | /* link error statistics */ |
64 | u32 invalid_dword_count; | 69 | u32 invalid_dword_count; |
65 | u32 running_disparity_error_count; | 70 | u32 running_disparity_error_count; |
@@ -145,12 +150,18 @@ struct sas_port { | |||
145 | #define transport_class_to_sas_port(cdev) \ | 150 | #define transport_class_to_sas_port(cdev) \ |
146 | dev_to_sas_port((cdev)->dev) | 151 | dev_to_sas_port((cdev)->dev) |
147 | 152 | ||
153 | struct sas_phy_linkrates { | ||
154 | enum sas_linkrate maximum_linkrate; | ||
155 | enum sas_linkrate minimum_linkrate; | ||
156 | }; | ||
157 | |||
148 | /* The functions by which the transport class and the driver communicate */ | 158 | /* The functions by which the transport class and the driver communicate */ |
149 | struct sas_function_template { | 159 | struct sas_function_template { |
150 | int (*get_linkerrors)(struct sas_phy *); | 160 | int (*get_linkerrors)(struct sas_phy *); |
151 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); | 161 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); |
152 | int (*get_bay_identifier)(struct sas_rphy *); | 162 | int (*get_bay_identifier)(struct sas_rphy *); |
153 | int (*phy_reset)(struct sas_phy *, int); | 163 | int (*phy_reset)(struct sas_phy *, int); |
164 | int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *); | ||
154 | }; | 165 | }; |
155 | 166 | ||
156 | 167 | ||
@@ -196,4 +207,6 @@ scsi_is_sas_expander_device(struct device *dev) | |||
196 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; | 207 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; |
197 | } | 208 | } |
198 | 209 | ||
210 | #define scsi_is_sas_phy_local(phy) scsi_is_host_device((phy)->dev.parent) | ||
211 | |||
199 | #endif /* SCSI_TRANSPORT_SAS_H */ | 212 | #endif /* SCSI_TRANSPORT_SAS_H */ |
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index 302680c0c0de..da180f738477 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h | |||
@@ -53,7 +53,8 @@ struct spi_transport_attrs { | |||
53 | unsigned int support_ius; /* support Information Units */ | 53 | unsigned int support_ius; /* support Information Units */ |
54 | unsigned int support_qas; /* supports quick arbitration and selection */ | 54 | unsigned int support_qas; /* supports quick arbitration and selection */ |
55 | /* Private Fields */ | 55 | /* Private Fields */ |
56 | unsigned int dv_pending:1; /* Internal flag */ | 56 | unsigned int dv_pending:1; /* Internal flag: DV Requested */ |
57 | unsigned int dv_in_progress:1; /* Internal: DV started */ | ||
57 | struct mutex dv_mutex; /* semaphore to serialise dv */ | 58 | struct mutex dv_mutex; /* semaphore to serialise dv */ |
58 | }; | 59 | }; |
59 | 60 | ||