aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-17 17:57:20 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-17 17:57:20 -0400
commit393d81aa026e19b6ede6f5f11955c97ee62e5df5 (patch)
treea1d9511e488e19d41089ff0a736f6ce52a81c6e5 /include
parent93a0886e2368eafb9df5e2021fb185195cee88b2 (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into xen-64bit
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acdisasm.h1
-rw-r--r--include/acpi/acdispat.h2
-rw-r--r--include/acpi/acexcep.h10
-rw-r--r--include/acpi/acglobal.h2
-rw-r--r--include/acpi/achware.h4
-rw-r--r--include/acpi/acinterp.h5
-rw-r--r--include/acpi/aclocal.h6
-rw-r--r--include/acpi/acmacros.h38
-rw-r--r--include/acpi/acnamesp.h30
-rw-r--r--include/acpi/acpi_bus.h12
-rw-r--r--include/acpi/acpi_drivers.h4
-rw-r--r--include/acpi/acpiosxf.h2
-rw-r--r--include/acpi/acpixf.h12
-rw-r--r--include/acpi/acstruct.h10
-rw-r--r--include/acpi/actables.h27
-rw-r--r--include/acpi/actbl1.h23
-rw-r--r--include/acpi/actypes.h16
-rw-r--r--include/acpi/acutils.h70
-rw-r--r--include/acpi/processor.h2
-rw-r--r--include/acpi/reboot.h14
-rw-r--r--include/asm-arm/arch-at91/at91_mci.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-sdi.h20
-rw-r--r--include/asm-arm/plat-s3c24xx/mci.h15
-rw-r--r--include/asm-avr32/arch-at32ap/board.h6
-rw-r--r--include/asm-avr32/atmel-mci.h9
-rw-r--r--include/asm-generic/vmlinux.lds.h6
-rw-r--r--include/asm-ia64/processor.h2
-rw-r--r--include/asm-mips/mach-au1x00/au1100_mmc.h18
-rw-r--r--include/asm-s390/Kbuild2
-rw-r--r--include/asm-s390/chpid.h6
-rw-r--r--include/asm-s390/qdio.h646
-rw-r--r--include/asm-s390/schid.h3
-rw-r--r--include/asm-s390/setup.h2
-rw-r--r--include/asm-x86/e820.h3
-rw-r--r--include/asm-x86/pci-direct.h4
-rw-r--r--include/asm-x86/processor.h2
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/blkdev.h3
-rw-r--r--include/linux/configfs.h4
-rw-r--r--include/linux/device.h9
-rw-r--r--include/linux/freezer.h10
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/ide.h74
-rw-r--r--include/linux/inet.h7
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/ioport.h5
-rw-r--r--include/linux/mmc/core.h1
-rw-r--r--include/linux/mmc/host.h32
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmc/sdio_func.h21
-rw-r--r--include/linux/nfs_fs.h10
-rw-r--r--include/linux/nfs_iostat.h119
-rw-r--r--include/linux/nfs_page.h9
-rw-r--r--include/linux/nfs_xdr.h3
-rw-r--r--include/linux/pci.h57
-rw-r--r--include/linux/pci_hotplug.h14
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/pm.h314
-rw-r--r--include/linux/pm_wakeup.h28
-rw-r--r--include/linux/pnp.h146
-rw-r--r--include/linux/sched.h27
-rw-r--r--include/linux/spi/mmc_spi.h9
-rw-r--r--include/linux/sunrpc/clnt.h7
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--include/linux/suspend.h14
68 files changed, 1284 insertions, 693 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 28fe8bae1037..4eb75a88795a 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20080321 66#define ACPI_CA_VERSION 0x20080609
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 788f88782012..f53faca8ec80 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -162,6 +162,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
162extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[]; 162extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
163extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[]; 163extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
164extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[]; 164extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
165extern struct acpi_dmtable_info acpi_dm_table_info_dmar2[];
165extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; 166extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
166extern struct acpi_dmtable_info acpi_dm_table_info_einj[]; 167extern struct acpi_dmtable_info acpi_dm_table_info_einj[];
167extern struct acpi_dmtable_info acpi_dm_table_info_einj0[]; 168extern struct acpi_dmtable_info acpi_dm_table_info_einj0[];
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 910f018d92c7..21a73a105d0a 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -221,7 +221,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
221 * dsinit 221 * dsinit
222 */ 222 */
223acpi_status 223acpi_status
224acpi_ds_initialize_objects(acpi_native_uint table_index, 224acpi_ds_initialize_objects(u32 table_index,
225 struct acpi_namespace_node *start_node); 225 struct acpi_namespace_node *start_node);
226 226
227/* 227/*
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 1f591171bf31..e5a890ffeb02 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -108,8 +108,9 @@
108#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) 108#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
109#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) 109#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
110#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) 110#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
111#define AE_MISSING_ARGUMENTS (acpi_status) (0x000A | AE_CODE_PROGRAMMER)
111 112
112#define AE_CODE_PGM_MAX 0x0009 113#define AE_CODE_PGM_MAX 0x000A
113 114
114/* 115/*
115 * Acpi table exceptions 116 * Acpi table exceptions
@@ -225,6 +226,7 @@ char const *acpi_gbl_exception_names_env[] = {
225}; 226};
226 227
227char const *acpi_gbl_exception_names_pgm[] = { 228char const *acpi_gbl_exception_names_pgm[] = {
229 NULL,
228 "AE_BAD_PARAMETER", 230 "AE_BAD_PARAMETER",
229 "AE_BAD_CHARACTER", 231 "AE_BAD_CHARACTER",
230 "AE_BAD_PATHNAME", 232 "AE_BAD_PATHNAME",
@@ -233,10 +235,12 @@ char const *acpi_gbl_exception_names_pgm[] = {
233 "AE_ALIGNMENT", 235 "AE_ALIGNMENT",
234 "AE_BAD_HEX_CONSTANT", 236 "AE_BAD_HEX_CONSTANT",
235 "AE_BAD_OCTAL_CONSTANT", 237 "AE_BAD_OCTAL_CONSTANT",
236 "AE_BAD_DECIMAL_CONSTANT" 238 "AE_BAD_DECIMAL_CONSTANT",
239 "AE_MISSING_ARGUMENTS"
237}; 240};
238 241
239char const *acpi_gbl_exception_names_tbl[] = { 242char const *acpi_gbl_exception_names_tbl[] = {
243 NULL,
240 "AE_BAD_SIGNATURE", 244 "AE_BAD_SIGNATURE",
241 "AE_BAD_HEADER", 245 "AE_BAD_HEADER",
242 "AE_BAD_CHECKSUM", 246 "AE_BAD_CHECKSUM",
@@ -246,6 +250,7 @@ char const *acpi_gbl_exception_names_tbl[] = {
246}; 250};
247 251
248char const *acpi_gbl_exception_names_aml[] = { 252char const *acpi_gbl_exception_names_aml[] = {
253 NULL,
249 "AE_AML_ERROR", 254 "AE_AML_ERROR",
250 "AE_AML_PARSE", 255 "AE_AML_PARSE",
251 "AE_AML_BAD_OPCODE", 256 "AE_AML_BAD_OPCODE",
@@ -283,6 +288,7 @@ char const *acpi_gbl_exception_names_aml[] = {
283}; 288};
284 289
285char const *acpi_gbl_exception_names_ctrl[] = { 290char const *acpi_gbl_exception_names_ctrl[] = {
291 NULL,
286 "AE_CTRL_RETURN_VALUE", 292 "AE_CTRL_RETURN_VALUE",
287 "AE_CTRL_PENDING", 293 "AE_CTRL_PENDING",
288 "AE_CTRL_TERMINATE", 294 "AE_CTRL_TERMINATE",
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 74ad971241db..15dda46b70d1 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -140,7 +140,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
140 */ 140 */
141ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; 141ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
142ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; 142ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
143extern acpi_native_uint acpi_gbl_permanent_mmap; 143extern u8 acpi_gbl_permanent_mmap;
144 144
145/* These addresses are calculated from FADT address values */ 145/* These addresses are calculated from FADT address values */
146 146
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index d4fb9bbc903c..97a72b193276 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -87,6 +87,8 @@ acpi_status acpi_hw_clear_acpi_status(void);
87/* 87/*
88 * hwgpe - GPE support 88 * hwgpe - GPE support
89 */ 89 */
90acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
91
90acpi_status 92acpi_status
91acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info); 93acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
92 94
@@ -100,11 +102,9 @@ acpi_status
100acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 102acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
101 struct acpi_gpe_block_info *gpe_block); 103 struct acpi_gpe_block_info *gpe_block);
102 104
103#ifdef ACPI_FUTURE_USAGE
104acpi_status 105acpi_status
105acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, 106acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
106 acpi_event_status * event_status); 107 acpi_event_status * event_status);
107#endif /* ACPI_FUTURE_USAGE */
108 108
109acpi_status acpi_hw_disable_all_gpes(void); 109acpi_status acpi_hw_disable_all_gpes(void);
110 110
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index e249ce5d3300..e8db7a3143a5 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -366,10 +366,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth);
366 366
367void 367void
368acpi_ex_dump_operands(union acpi_operand_object **operands, 368acpi_ex_dump_operands(union acpi_operand_object **operands,
369 acpi_interpreter_mode interpreter_mode, 369 const char *opcode_name, u32 num_opcodes);
370 char *ident,
371 u32 num_levels,
372 char *note, char *module_name, u32 line_number);
373 370
374#ifdef ACPI_FUTURE_USAGE 371#ifdef ACPI_FUTURE_USAGE
375void 372void
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index c5cdc32ac2f8..b221c8583ddd 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -98,8 +98,8 @@ union acpi_parse_object;
98 98
99static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { 99static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
100 "ACPI_MTX_Interpreter", 100 "ACPI_MTX_Interpreter",
101 "ACPI_MTX_Tables",
102 "ACPI_MTX_Namespace", 101 "ACPI_MTX_Namespace",
102 "ACPI_MTX_Tables",
103 "ACPI_MTX_Events", 103 "ACPI_MTX_Events",
104 "ACPI_MTX_Caches", 104 "ACPI_MTX_Caches",
105 "ACPI_MTX_Memory", 105 "ACPI_MTX_Memory",
@@ -282,8 +282,8 @@ struct acpi_predefined_names {
282/* Info structure used to convert external<->internal namestrings */ 282/* Info structure used to convert external<->internal namestrings */
283 283
284struct acpi_namestring_info { 284struct acpi_namestring_info {
285 char *external_name; 285 const char *external_name;
286 char *next_external_char; 286 const char *next_external_char;
287 char *internal_name; 287 char *internal_name;
288 u32 length; 288 u32 length;
289 u32 num_segments; 289 u32 num_segments;
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index fb41a3b802fc..57ab9e9d7593 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -80,12 +80,12 @@
80 */ 80 */
81#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) 81#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
82#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) 82#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
83#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b))) 83#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_size)(b)))
84#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) 84#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
85 85
86/* Pointer/Integer type conversions */ 86/* Pointer/Integer type conversions */
87 87
88#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) 88#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i)
89#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 89#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
90#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 90#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
91#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 91#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
@@ -296,22 +296,22 @@ struct acpi_integer_overlay {
296/* 296/*
297 * Rounding macros (Power of two boundaries only) 297 * Rounding macros (Power of two boundaries only)
298 */ 298 */
299#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ 299#define ACPI_ROUND_DOWN(value, boundary) (((acpi_size)(value)) & \
300 (~(((acpi_native_uint) boundary)-1))) 300 (~(((acpi_size) boundary)-1)))
301 301
302#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ 302#define ACPI_ROUND_UP(value, boundary) ((((acpi_size)(value)) + \
303 (((acpi_native_uint) boundary)-1)) & \ 303 (((acpi_size) boundary)-1)) & \
304 (~(((acpi_native_uint) boundary)-1))) 304 (~(((acpi_size) boundary)-1)))
305 305
306/* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ 306/* Note: sizeof(acpi_size) evaluates to either 4 or 8 (32- vs 64-bit mode) */
307 307
308#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) 308#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4)
309#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) 309#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8)
310#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) 310#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_size))
311 311
312#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) 312#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4)
313#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) 313#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8)
314#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) 314#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_size))
315 315
316#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) 316#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
317#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) 317#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a))
@@ -322,7 +322,7 @@ struct acpi_integer_overlay {
322 322
323#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) 323#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary))
324 324
325#define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1)) 325#define ACPI_IS_MISALIGNED(value) (((acpi_size)value) & (sizeof(acpi_size)-1))
326 326
327/* 327/*
328 * Bitmask creation 328 * Bitmask creation
@@ -414,7 +414,7 @@ struct acpi_integer_overlay {
414 * error messages. The __FILE__ macro is not very useful for this, because it 414 * error messages. The __FILE__ macro is not very useful for this, because it
415 * often includes the entire pathname to the module 415 * often includes the entire pathname to the module
416 */ 416 */
417#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; 417#define ACPI_MODULE_NAME(name) static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
418#else 418#else
419#define ACPI_MODULE_NAME(name) 419#define ACPI_MODULE_NAME(name)
420#endif 420#endif
@@ -467,19 +467,17 @@ struct acpi_integer_overlay {
467/* 467/*
468 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, 468 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
469 * define it now. This is the case where there the compiler does not support 469 * define it now. This is the case where there the compiler does not support
470 * a __FUNCTION__ macro or equivalent. We save the function name on the 470 * a __FUNCTION__ macro or equivalent.
471 * local stack.
472 */ 471 */
473#ifndef ACPI_GET_FUNCTION_NAME 472#ifndef ACPI_GET_FUNCTION_NAME
474#define ACPI_GET_FUNCTION_NAME _acpi_function_name 473#define ACPI_GET_FUNCTION_NAME _acpi_function_name
475/* 474/*
476 * The Name parameter should be the procedure name as a quoted string. 475 * The Name parameter should be the procedure name as a quoted string.
477 * This is declared as a local string ("MyFunctionName") so that it can 476 * The function name is also used by the function exit macros below.
478 * be also used by the function exit macros below.
479 * Note: (const char) is used to be compatible with the debug interfaces 477 * Note: (const char) is used to be compatible with the debug interfaces
480 * and macros such as __FUNCTION__. 478 * and macros such as __FUNCTION__.
481 */ 479 */
482#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = #name; 480#define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name;
483 481
484#else 482#else
485/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ 483/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
@@ -599,7 +597,7 @@ struct acpi_integer_overlay {
599/* Stack and buffer dumping */ 597/* Stack and buffer dumping */
600 598
601#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) 599#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0)
602#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) 600#define ACPI_DUMP_OPERANDS(a,b,c) acpi_ex_dump_operands(a,b,c)
603 601
604#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 602#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
605#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) 603#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
@@ -635,7 +633,7 @@ struct acpi_integer_overlay {
635#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0) 633#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0)
636#define ACPI_FUNCTION_ENTRY() do { } while(0) 634#define ACPI_FUNCTION_ENTRY() do { } while(0)
637#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0) 635#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0)
638#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0) 636#define ACPI_DUMP_OPERANDS(a,b,c) do { } while(0)
639#define ACPI_DUMP_ENTRY(a,b) do { } while(0) 637#define ACPI_DUMP_ENTRY(a,b) do { } while(0)
640#define ACPI_DUMP_TABLES(a,b) do { } while(0) 638#define ACPI_DUMP_TABLES(a,b) do { } while(0)
641#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0) 639#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0)
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 713b30903fe5..9ed70a050580 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -86,8 +86,7 @@ acpi_status acpi_ns_initialize_devices(void);
86acpi_status acpi_ns_load_namespace(void); 86acpi_status acpi_ns_load_namespace(void);
87 87
88acpi_status 88acpi_status
89acpi_ns_load_table(acpi_native_uint table_index, 89acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node);
90 struct acpi_namespace_node *node);
91 90
92/* 91/*
93 * nswalk - walk the namespace 92 * nswalk - walk the namespace
@@ -108,12 +107,11 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct
108 * nsparse - table parsing 107 * nsparse - table parsing
109 */ 108 */
110acpi_status 109acpi_status
111acpi_ns_parse_table(acpi_native_uint table_index, 110acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);
112 struct acpi_namespace_node *start_node);
113 111
114acpi_status 112acpi_status
115acpi_ns_one_complete_parse(acpi_native_uint pass_number, 113acpi_ns_one_complete_parse(u32 pass_number,
116 acpi_native_uint table_index, 114 u32 table_index,
117 struct acpi_namespace_node *start_node); 115 struct acpi_namespace_node *start_node);
118 116
119/* 117/*
@@ -201,7 +199,7 @@ acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
201 199
202acpi_status 200acpi_status
203acpi_ns_get_node(struct acpi_namespace_node *prefix_node, 201acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
204 char *external_pathname, 202 const char *external_pathname,
205 u32 flags, struct acpi_namespace_node **out_node); 203 u32 flags, struct acpi_namespace_node **out_node);
206 204
207acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); 205acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
@@ -265,28 +263,30 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
265u32 acpi_ns_local(acpi_object_type type); 263u32 acpi_ns_local(acpi_object_type type);
266 264
267void 265void
268acpi_ns_report_error(char *module_name, 266acpi_ns_report_error(const char *module_name,
269 u32 line_number, 267 u32 line_number,
270 char *internal_name, acpi_status lookup_status); 268 const char *internal_name, acpi_status lookup_status);
271 269
272void 270void
273acpi_ns_report_method_error(char *module_name, 271acpi_ns_report_method_error(const char *module_name,
274 u32 line_number, 272 u32 line_number,
275 char *message, 273 const char *message,
276 struct acpi_namespace_node *node, 274 struct acpi_namespace_node *node,
277 char *path, acpi_status lookup_status); 275 const char *path, acpi_status lookup_status);
278 276
279void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg); 277void
278acpi_ns_print_node_pathname(struct acpi_namespace_node *node, const char *msg);
280 279
281acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info); 280acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
282 281
283void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info); 282void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
284 283
285acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name); 284acpi_status
285acpi_ns_internalize_name(const char *dotted_name, char **converted_name);
286 286
287acpi_status 287acpi_status
288acpi_ns_externalize_name(u32 internal_name_length, 288acpi_ns_externalize_name(u32 internal_name_length,
289 char *internal_name, 289 const char *internal_name,
290 u32 * converted_name_length, char **converted_name); 290 u32 * converted_name_length, char **converted_name);
291 291
292struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle); 292struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 2f1c68c7a727..a5ac0bc7f52e 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -259,6 +259,7 @@ struct acpi_device_perf {
259/* Wakeup Management */ 259/* Wakeup Management */
260struct acpi_device_wakeup_flags { 260struct acpi_device_wakeup_flags {
261 u8 valid:1; /* Can successfully enable wakeup? */ 261 u8 valid:1; /* Can successfully enable wakeup? */
262 u8 prepared:1; /* Has the wake-up capability been enabled? */
262 u8 run_wake:1; /* Run-Wake GPE devices */ 263 u8 run_wake:1; /* Run-Wake GPE devices */
263}; 264};
264 265
@@ -335,6 +336,8 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
335int acpi_bus_get_status(struct acpi_device *device); 336int acpi_bus_get_status(struct acpi_device *device);
336int acpi_bus_get_power(acpi_handle handle, int *state); 337int acpi_bus_get_power(acpi_handle handle, int *state);
337int acpi_bus_set_power(acpi_handle handle, int state); 338int acpi_bus_set_power(acpi_handle handle, int state);
339bool acpi_bus_power_manageable(acpi_handle handle);
340bool acpi_bus_can_wakeup(acpi_handle handle);
338#ifdef CONFIG_ACPI_PROC_EVENT 341#ifdef CONFIG_ACPI_PROC_EVENT
339int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); 342int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
340int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); 343int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
@@ -376,14 +379,19 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
376#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 379#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
377 380
378#ifdef CONFIG_PM_SLEEP 381#ifdef CONFIG_PM_SLEEP
379int acpi_pm_device_sleep_state(struct device *, int, int *); 382int acpi_pm_device_sleep_state(struct device *, int *);
383int acpi_pm_device_sleep_wake(struct device *, bool);
380#else /* !CONFIG_PM_SLEEP */ 384#else /* !CONFIG_PM_SLEEP */
381static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p) 385static inline int acpi_pm_device_sleep_state(struct device *d, int *p)
382{ 386{
383 if (p) 387 if (p)
384 *p = ACPI_STATE_D0; 388 *p = ACPI_STATE_D0;
385 return ACPI_STATE_D3; 389 return ACPI_STATE_D3;
386} 390}
391static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
392{
393 return -ENODEV;
394}
387#endif /* !CONFIG_PM_SLEEP */ 395#endif /* !CONFIG_PM_SLEEP */
388 396
389#endif /* CONFIG_ACPI */ 397#endif /* CONFIG_ACPI */
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 9757a040a505..e5f38e5ce86f 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -87,7 +87,9 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain,
87 -------------------------------------------------------------------------- */ 87 -------------------------------------------------------------------------- */
88 88
89#ifdef CONFIG_ACPI_POWER 89#ifdef CONFIG_ACPI_POWER
90int acpi_enable_wakeup_device_power(struct acpi_device *dev); 90int acpi_device_sleep_wake(struct acpi_device *dev,
91 int enable, int sleep_state, int dev_state);
92int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state);
91int acpi_disable_wakeup_device_power(struct acpi_device *dev); 93int acpi_disable_wakeup_device_power(struct acpi_device *dev);
92int acpi_power_get_inferred_state(struct acpi_device *device); 94int acpi_power_get_inferred_state(struct acpi_device *device);
93int acpi_power_transition(struct acpi_device *device, int state); 95int acpi_power_transition(struct acpi_device *device, int state);
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index d4a560d2deb6..3f93a6b4e17f 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -144,7 +144,7 @@ void acpi_os_release_mutex(acpi_mutex handle);
144void *acpi_os_allocate(acpi_size size); 144void *acpi_os_allocate(acpi_size size);
145 145
146void __iomem *acpi_os_map_memory(acpi_physical_address where, 146void __iomem *acpi_os_map_memory(acpi_physical_address where,
147 acpi_native_uint length); 147 acpi_size length);
148 148
149void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); 149void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
150 150
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2c3806e6546f..94d94e126e9f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -98,7 +98,7 @@ void acpi_free(void *address);
98 */ 98 */
99acpi_status acpi_reallocate_root_table(void); 99acpi_status acpi_reallocate_root_table(void);
100 100
101acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address); 101acpi_status acpi_find_root_pointer(acpi_size *rsdp_address);
102 102
103acpi_status acpi_load_tables(void); 103acpi_status acpi_load_tables(void);
104 104
@@ -108,15 +108,15 @@ acpi_status acpi_unload_table_id(acpi_owner_id id);
108 108
109acpi_status 109acpi_status
110acpi_get_table_header(acpi_string signature, 110acpi_get_table_header(acpi_string signature,
111 acpi_native_uint instance, 111 u32 instance,
112 struct acpi_table_header *out_table_header); 112 struct acpi_table_header *out_table_header);
113 113
114acpi_status 114acpi_status
115acpi_get_table(acpi_string signature, 115acpi_get_table(acpi_string signature,
116 acpi_native_uint instance, struct acpi_table_header **out_table); 116 u32 instance, struct acpi_table_header **out_table);
117 117
118acpi_status 118acpi_status
119acpi_get_table_by_index(acpi_native_uint table_index, 119acpi_get_table_by_index(u32 table_index,
120 struct acpi_table_header **out_table); 120 struct acpi_table_header **out_table);
121 121
122acpi_status 122acpi_status
@@ -248,9 +248,7 @@ acpi_status acpi_disable_event(u32 event, u32 flags);
248 248
249acpi_status acpi_clear_event(u32 event); 249acpi_status acpi_clear_event(u32 event);
250 250
251#ifdef ACPI_FUTURE_USAGE
252acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 251acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
253#endif /* ACPI_FUTURE_USAGE */
254 252
255acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); 253acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type);
256 254
@@ -260,12 +258,10 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
260 258
261acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); 259acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
262 260
263#ifdef ACPI_FUTURE_USAGE
264acpi_status 261acpi_status
265acpi_get_gpe_status(acpi_handle gpe_device, 262acpi_get_gpe_status(acpi_handle gpe_device,
266 u32 gpe_number, 263 u32 gpe_number,
267 u32 flags, acpi_event_status * event_status); 264 u32 flags, acpi_event_status * event_status);
268#endif /* ACPI_FUTURE_USAGE */
269 265
270acpi_status 266acpi_status
271acpi_install_gpe_block(acpi_handle gpe_device, 267acpi_install_gpe_block(acpi_handle gpe_device,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index a907c67d651e..7980a26bad35 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -108,7 +108,6 @@ struct acpi_walk_state {
108 union acpi_operand_object **caller_return_desc; 108 union acpi_operand_object **caller_return_desc;
109 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 109 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
110 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 110 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
111 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
112 union acpi_operand_object *implicit_return_obj; 111 union acpi_operand_object *implicit_return_obj;
113 struct acpi_namespace_node *method_call_node; /* Called method Node */ 112 struct acpi_namespace_node *method_call_node; /* Called method Node */
114 union acpi_parse_object *method_call_op; /* method_call Op if running a method */ 113 union acpi_parse_object *method_call_op; /* method_call Op if running a method */
@@ -143,7 +142,7 @@ struct acpi_init_walk_info {
143 u16 package_init; 142 u16 package_init;
144 u16 object_count; 143 u16 object_count;
145 acpi_owner_id owner_id; 144 acpi_owner_id owner_id;
146 acpi_native_uint table_index; 145 u32 table_index;
147}; 146};
148 147
149struct acpi_get_devices_info { 148struct acpi_get_devices_info {
@@ -189,17 +188,12 @@ struct acpi_evaluate_info {
189 union acpi_operand_object **parameters; 188 union acpi_operand_object **parameters;
190 struct acpi_namespace_node *resolved_node; 189 struct acpi_namespace_node *resolved_node;
191 union acpi_operand_object *return_object; 190 union acpi_operand_object *return_object;
191 u8 param_count;
192 u8 pass_number; 192 u8 pass_number;
193 u8 parameter_type;
194 u8 return_object_type; 193 u8 return_object_type;
195 u8 flags; 194 u8 flags;
196}; 195};
197 196
198/* Types for parameter_type above */
199
200#define ACPI_PARAM_ARGS 0
201#define ACPI_PARAM_GPE 1
202
203/* Values for Flags above */ 197/* Values for Flags above */
204 198
205#define ACPI_IGNORE_RETURN_VALUE 1 199#define ACPI_IGNORE_RETURN_VALUE 1
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 4b36a55b0b3b..0cbe1b9ab522 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -49,7 +49,7 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count);
49/* 49/*
50 * tbfadt - FADT parse/convert/validate 50 * tbfadt - FADT parse/convert/validate
51 */ 51 */
52void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags); 52void acpi_tb_parse_fadt(u32 table_index, u8 flags);
53 53
54void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length); 54void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
55 55
@@ -58,8 +58,7 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
58 */ 58 */
59acpi_status 59acpi_status
60acpi_tb_find_table(char *signature, 60acpi_tb_find_table(char *signature,
61 char *oem_id, 61 char *oem_id, char *oem_table_id, u32 *table_index);
62 char *oem_table_id, acpi_native_uint * table_index);
63 62
64/* 63/*
65 * tbinstal - Table removal and deletion 64 * tbinstal - Table removal and deletion
@@ -69,30 +68,28 @@ acpi_status acpi_tb_resize_root_table_list(void);
69acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc); 68acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc);
70 69
71acpi_status 70acpi_status
72acpi_tb_add_table(struct acpi_table_desc *table_desc, 71acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index);
73 acpi_native_uint * table_index);
74 72
75acpi_status 73acpi_status
76acpi_tb_store_table(acpi_physical_address address, 74acpi_tb_store_table(acpi_physical_address address,
77 struct acpi_table_header *table, 75 struct acpi_table_header *table,
78 u32 length, u8 flags, acpi_native_uint * table_index); 76 u32 length, u8 flags, u32 *table_index);
79 77
80void acpi_tb_delete_table(struct acpi_table_desc *table_desc); 78void acpi_tb_delete_table(struct acpi_table_desc *table_desc);
81 79
82void acpi_tb_terminate(void); 80void acpi_tb_terminate(void);
83 81
84void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index); 82void acpi_tb_delete_namespace_by_owner(u32 table_index);
85 83
86acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index); 84acpi_status acpi_tb_allocate_owner_id(u32 table_index);
87 85
88acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index); 86acpi_status acpi_tb_release_owner_id(u32 table_index);
89 87
90acpi_status 88acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id);
91acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id);
92 89
93u8 acpi_tb_is_table_loaded(acpi_native_uint table_index); 90u8 acpi_tb_is_table_loaded(u32 table_index);
94 91
95void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded); 92void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded);
96 93
97/* 94/*
98 * tbutils - table manager utilities 95 * tbutils - table manager utilities
@@ -103,14 +100,14 @@ void
103acpi_tb_print_table_header(acpi_physical_address address, 100acpi_tb_print_table_header(acpi_physical_address address,
104 struct acpi_table_header *header); 101 struct acpi_table_header *header);
105 102
106u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length); 103u8 acpi_tb_checksum(u8 *buffer, u32 length);
107 104
108acpi_status 105acpi_status
109acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length); 106acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
110 107
111void 108void
112acpi_tb_install_table(acpi_physical_address address, 109acpi_tb_install_table(acpi_physical_address address,
113 u8 flags, char *signature, acpi_native_uint table_index); 110 u8 flags, char *signature, u32 table_index);
114 111
115acpi_status 112acpi_status
116acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags); 113acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 9af239bd1153..d38f9be2f6ee 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -300,6 +300,7 @@ struct acpi_table_dbgp {
300/******************************************************************************* 300/*******************************************************************************
301 * 301 *
302 * DMAR - DMA Remapping table 302 * DMAR - DMA Remapping table
303 * From "Intel Virtualization Technology for Directed I/O", Sept. 2007
303 * 304 *
304 ******************************************************************************/ 305 ******************************************************************************/
305 306
@@ -310,6 +311,10 @@ struct acpi_table_dmar {
310 u8 reserved[10]; 311 u8 reserved[10];
311}; 312};
312 313
314/* Flags */
315
316#define ACPI_DMAR_INTR_REMAP (1)
317
313/* DMAR subtable header */ 318/* DMAR subtable header */
314 319
315struct acpi_dmar_header { 320struct acpi_dmar_header {
@@ -382,6 +387,20 @@ struct acpi_dmar_reserved_memory {
382 387
383#define ACPI_DMAR_ALLOW_ALL (1) 388#define ACPI_DMAR_ALLOW_ALL (1)
384 389
390
391/* 2: Root Port ATS Capability Reporting Structure */
392
393struct acpi_dmar_atsr {
394 struct acpi_dmar_header header;
395 u8 flags;
396 u8 reserved;
397 u16 segment;
398};
399
400/* Flags */
401
402#define ACPI_DMAR_ALL_PORTS (1)
403
385/******************************************************************************* 404/*******************************************************************************
386 * 405 *
387 * ECDT - Embedded Controller Boot Resources Table 406 * ECDT - Embedded Controller Boot Resources Table
@@ -1156,9 +1175,9 @@ struct acpi_srat_mem_affinity {
1156 u16 reserved; /* Reserved, must be zero */ 1175 u16 reserved; /* Reserved, must be zero */
1157 u64 base_address; 1176 u64 base_address;
1158 u64 length; 1177 u64 length;
1159 u32 memory_type; /* See acpi_address_range_id */ 1178 u32 reserved1;
1160 u32 flags; 1179 u32 flags;
1161 u64 reserved1; /* Reserved, must be zero */ 1180 u64 reserved2; /* Reserved, must be zero */
1162}; 1181};
1163 1182
1164/* Flags */ 1183/* Flags */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index dfea2d440488..4ea4f40bf894 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -110,10 +110,10 @@
110 * usually used for memory allocation, efficient loop counters, and array 110 * usually used for memory allocation, efficient loop counters, and array
111 * indexes. The types are similar to the size_t type in the C library and are 111 * indexes. The types are similar to the size_t type in the C library and are
112 * required because there is no C type that consistently represents the native 112 * required because there is no C type that consistently represents the native
113 * data width. 113 * data width. ACPI_SIZE is needed because there is no guarantee that a
114 * kernel-level C library is present.
114 * 115 *
115 * ACPI_SIZE 16/32/64-bit unsigned value 116 * ACPI_SIZE 16/32/64-bit unsigned value
116 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
117 * ACPI_NATIVE_INT 16/32/64-bit signed value 117 * ACPI_NATIVE_INT 16/32/64-bit signed value
118 * 118 *
119 */ 119 */
@@ -147,9 +147,9 @@ typedef int INT32;
147 147
148/*! [End] no source code translation !*/ 148/*! [End] no source code translation !*/
149 149
150typedef u64 acpi_native_uint;
151typedef s64 acpi_native_int; 150typedef s64 acpi_native_int;
152 151
152typedef u64 acpi_size;
153typedef u64 acpi_io_address; 153typedef u64 acpi_io_address;
154typedef u64 acpi_physical_address; 154typedef u64 acpi_physical_address;
155 155
@@ -186,9 +186,9 @@ typedef int INT32;
186 186
187/*! [End] no source code translation !*/ 187/*! [End] no source code translation !*/
188 188
189typedef u32 acpi_native_uint;
190typedef s32 acpi_native_int; 189typedef s32 acpi_native_int;
191 190
191typedef u32 acpi_size;
192typedef u32 acpi_io_address; 192typedef u32 acpi_io_address;
193typedef u32 acpi_physical_address; 193typedef u32 acpi_physical_address;
194 194
@@ -202,10 +202,6 @@ typedef u32 acpi_physical_address;
202#error unknown ACPI_MACHINE_WIDTH 202#error unknown ACPI_MACHINE_WIDTH
203#endif 203#endif
204 204
205/* Variable-width type, used instead of clib size_t */
206
207typedef acpi_native_uint acpi_size;
208
209/******************************************************************************* 205/*******************************************************************************
210 * 206 *
211 * OS-dependent and compiler-dependent types 207 * OS-dependent and compiler-dependent types
@@ -219,7 +215,7 @@ typedef acpi_native_uint acpi_size;
219/* Value returned by acpi_os_get_thread_id */ 215/* Value returned by acpi_os_get_thread_id */
220 216
221#ifndef acpi_thread_id 217#ifndef acpi_thread_id
222#define acpi_thread_id acpi_native_uint 218#define acpi_thread_id acpi_size
223#endif 219#endif
224 220
225/* Object returned from acpi_os_create_lock */ 221/* Object returned from acpi_os_create_lock */
@@ -231,7 +227,7 @@ typedef acpi_native_uint acpi_size;
231/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ 227/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
232 228
233#ifndef acpi_cpu_flags 229#ifndef acpi_cpu_flags
234#define acpi_cpu_flags acpi_native_uint 230#define acpi_cpu_flags acpi_size
235#endif 231#endif
236 232
237/* Object returned from acpi_os_create_cache */ 233/* Object returned from acpi_os_create_cache */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index b42cadf07302..69f8888771ff 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -172,7 +172,7 @@ char *acpi_ut_strstr(char *string1, char *string2);
172 172
173void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count); 173void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count);
174 174
175void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count); 175void *acpi_ut_memset(void *dest, u8 value, acpi_size count);
176 176
177int acpi_ut_to_upper(int c); 177int acpi_ut_to_upper(int c);
178 178
@@ -245,41 +245,45 @@ void acpi_ut_track_stack_ptr(void);
245 245
246void 246void
247acpi_ut_trace(u32 line_number, 247acpi_ut_trace(u32 line_number,
248 const char *function_name, char *module_name, u32 component_id); 248 const char *function_name,
249 const char *module_name, u32 component_id);
249 250
250void 251void
251acpi_ut_trace_ptr(u32 line_number, 252acpi_ut_trace_ptr(u32 line_number,
252 const char *function_name, 253 const char *function_name,
253 char *module_name, u32 component_id, void *pointer); 254 const char *module_name, u32 component_id, void *pointer);
254 255
255void 256void
256acpi_ut_trace_u32(u32 line_number, 257acpi_ut_trace_u32(u32 line_number,
257 const char *function_name, 258 const char *function_name,
258 char *module_name, u32 component_id, u32 integer); 259 const char *module_name, u32 component_id, u32 integer);
259 260
260void 261void
261acpi_ut_trace_str(u32 line_number, 262acpi_ut_trace_str(u32 line_number,
262 const char *function_name, 263 const char *function_name,
263 char *module_name, u32 component_id, char *string); 264 const char *module_name, u32 component_id, char *string);
264 265
265void 266void
266acpi_ut_exit(u32 line_number, 267acpi_ut_exit(u32 line_number,
267 const char *function_name, char *module_name, u32 component_id); 268 const char *function_name,
269 const char *module_name, u32 component_id);
268 270
269void 271void
270acpi_ut_status_exit(u32 line_number, 272acpi_ut_status_exit(u32 line_number,
271 const char *function_name, 273 const char *function_name,
272 char *module_name, u32 component_id, acpi_status status); 274 const char *module_name,
275 u32 component_id, acpi_status status);
273 276
274void 277void
275acpi_ut_value_exit(u32 line_number, 278acpi_ut_value_exit(u32 line_number,
276 const char *function_name, 279 const char *function_name,
277 char *module_name, u32 component_id, acpi_integer value); 280 const char *module_name,
281 u32 component_id, acpi_integer value);
278 282
279void 283void
280acpi_ut_ptr_exit(u32 line_number, 284acpi_ut_ptr_exit(u32 line_number,
281 const char *function_name, 285 const char *function_name,
282 char *module_name, u32 component_id, u8 * ptr); 286 const char *module_name, u32 component_id, u8 *ptr);
283 287
284void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); 288void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
285 289
@@ -297,33 +301,35 @@ void ACPI_INTERNAL_VAR_XFACE
297acpi_ut_debug_print(u32 requested_debug_level, 301acpi_ut_debug_print(u32 requested_debug_level,
298 u32 line_number, 302 u32 line_number,
299 const char *function_name, 303 const char *function_name,
300 char *module_name, 304 const char *module_name,
301 u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6); 305 u32 component_id,
306 const char *format, ...) ACPI_PRINTF_LIKE(6);
302 307
303void ACPI_INTERNAL_VAR_XFACE 308void ACPI_INTERNAL_VAR_XFACE
304acpi_ut_debug_print_raw(u32 requested_debug_level, 309acpi_ut_debug_print_raw(u32 requested_debug_level,
305 u32 line_number, 310 u32 line_number,
306 const char *function_name, 311 const char *function_name,
307 char *module_name, 312 const char *module_name,
308 u32 component_id, 313 u32 component_id,
309 char *format, ...) ACPI_PRINTF_LIKE(6); 314 const char *format, ...) ACPI_PRINTF_LIKE(6);
310 315
311void ACPI_INTERNAL_VAR_XFACE 316void ACPI_INTERNAL_VAR_XFACE
312acpi_ut_error(char *module_name, 317acpi_ut_error(const char *module_name,
313 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); 318 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
314 319
315void ACPI_INTERNAL_VAR_XFACE 320void ACPI_INTERNAL_VAR_XFACE
316acpi_ut_exception(char *module_name, 321acpi_ut_exception(const char *module_name,
317 u32 line_number, 322 u32 line_number,
318 acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4); 323 acpi_status status,
324 const char *format, ...) ACPI_PRINTF_LIKE(4);
319 325
320void ACPI_INTERNAL_VAR_XFACE 326void ACPI_INTERNAL_VAR_XFACE
321acpi_ut_warning(char *module_name, 327acpi_ut_warning(const char *module_name,
322 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); 328 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
323 329
324void ACPI_INTERNAL_VAR_XFACE 330void ACPI_INTERNAL_VAR_XFACE
325acpi_ut_info(char *module_name, 331acpi_ut_info(const char *module_name,
326 u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); 332 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
327 333
328/* 334/*
329 * utdelete - Object deletion and reference counts 335 * utdelete - Object deletion and reference counts
@@ -376,13 +382,14 @@ acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
376/* 382/*
377 * utobject - internal object create/delete/cache routines 383 * utobject - internal object create/delete/cache routines
378 */ 384 */
379union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, 385union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
386 *module_name,
380 u32 line_number, 387 u32 line_number,
381 u32 component_id, 388 u32 component_id,
382 acpi_object_type 389 acpi_object_type
383 type); 390 type);
384 391
385void *acpi_ut_allocate_object_desc_dbg(char *module_name, 392void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
386 u32 line_number, u32 component_id); 393 u32 line_number, u32 component_id);
387 394
388#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) 395#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
@@ -476,7 +483,7 @@ u8 acpi_ut_valid_acpi_name(u32 name);
476 483
477acpi_name acpi_ut_repair_name(char *name); 484acpi_name acpi_ut_repair_name(char *name);
478 485
479u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); 486u8 acpi_ut_valid_acpi_char(char character, u32 position);
480 487
481acpi_status 488acpi_status
482acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); 489acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
@@ -543,26 +550,29 @@ acpi_status
543acpi_ut_initialize_buffer(struct acpi_buffer *buffer, 550acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
544 acpi_size required_length); 551 acpi_size required_length);
545 552
546void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); 553void *acpi_ut_allocate(acpi_size size,
554 u32 component, const char *module, u32 line);
547 555
548void *acpi_ut_allocate_zeroed(acpi_size size, 556void *acpi_ut_allocate_zeroed(acpi_size size,
549 u32 component, char *module, u32 line); 557 u32 component, const char *module, u32 line);
550 558
551#ifdef ACPI_DBG_TRACK_ALLOCATIONS 559#ifdef ACPI_DBG_TRACK_ALLOCATIONS
552void *acpi_ut_allocate_and_track(acpi_size size, 560void *acpi_ut_allocate_and_track(acpi_size size,
553 u32 component, char *module, u32 line); 561 u32 component, const char *module, u32 line);
554 562
555void *acpi_ut_allocate_zeroed_and_track(acpi_size size, 563void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
556 u32 component, char *module, u32 line); 564 u32 component,
565 const char *module, u32 line);
557 566
558void 567void
559acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); 568acpi_ut_free_and_track(void *address,
569 u32 component, const char *module, u32 line);
560 570
561#ifdef ACPI_FUTURE_USAGE 571#ifdef ACPI_FUTURE_USAGE
562void acpi_ut_dump_allocation_info(void); 572void acpi_ut_dump_allocation_info(void);
563#endif /* ACPI_FUTURE_USAGE */ 573#endif /* ACPI_FUTURE_USAGE */
564 574
565void acpi_ut_dump_allocations(u32 component, char *module); 575void acpi_ut_dump_allocations(u32 component, const char *module);
566 576
567acpi_status 577acpi_status
568acpi_ut_create_list(char *list_name, 578acpi_ut_create_list(char *list_name,
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 06ebb6ef72aa..3795590e152a 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -255,7 +255,7 @@ extern void acpi_processor_unregister_performance(struct
255int acpi_processor_notify_smm(struct module *calling_module); 255int acpi_processor_notify_smm(struct module *calling_module);
256 256
257/* for communication between multiple parts of the processor kernel module */ 257/* for communication between multiple parts of the processor kernel module */
258extern struct acpi_processor *processors[NR_CPUS]; 258DECLARE_PER_CPU(struct acpi_processor *, processors);
259extern struct acpi_processor_errata errata; 259extern struct acpi_processor_errata errata;
260 260
261void arch_acpi_processor_init_pdc(struct acpi_processor *pr); 261void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
diff --git a/include/acpi/reboot.h b/include/acpi/reboot.h
index 8857f57e0b78..0419184ce886 100644
--- a/include/acpi/reboot.h
+++ b/include/acpi/reboot.h
@@ -1,9 +1,11 @@
1#ifndef __ACPI_REBOOT_H
2#define __ACPI_REBOOT_H
3
4#ifdef CONFIG_ACPI
5extern void acpi_reboot(void);
6#else
7static inline void acpi_reboot(void) { }
8#endif
1 9
2/*
3 * Dummy placeholder to make the EFI patches apply to the x86 tree.
4 * Andrew/Len, please just kill this file if you encounter it.
5 */
6#ifndef acpi_reboot
7# define acpi_reboot() do { } while (0)
8#endif 10#endif
9 11
diff --git a/include/asm-arm/arch-at91/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h
index 1551fc24eb43..400ec10014b4 100644
--- a/include/asm-arm/arch-at91/at91_mci.h
+++ b/include/asm-arm/arch-at91/at91_mci.h
@@ -75,6 +75,10 @@
75#define AT91_MCI_TRTYP_MULTIPLE (1 << 19) 75#define AT91_MCI_TRTYP_MULTIPLE (1 << 19)
76#define AT91_MCI_TRTYP_STREAM (2 << 19) 76#define AT91_MCI_TRTYP_STREAM (2 << 19)
77 77
78#define AT91_MCI_BLKR 0x18 /* Block Register */
79#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */
80#define AT91_MCI_BLKR_BLKLEN(n) ((0xffff & (n)) << 16) /* Block lenght */
81
78#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */ 82#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */
79#define AT91_MCR_RDR 0x30 /* Receive Data Register */ 83#define AT91_MCR_RDR 0x30 /* Receive Data Register */
80#define AT91_MCR_TDR 0x34 /* Transmit Data Register */ 84#define AT91_MCR_TDR 0x34 /* Transmit Data Register */
diff --git a/include/asm-arm/arch-s3c2410/regs-sdi.h b/include/asm-arm/arch-s3c2410/regs-sdi.h
index bb9d30b72952..bfb222fa4abb 100644
--- a/include/asm-arm/arch-s3c2410/regs-sdi.h
+++ b/include/asm-arm/arch-s3c2410/regs-sdi.h
@@ -28,9 +28,15 @@
28#define S3C2410_SDIDCNT (0x30) 28#define S3C2410_SDIDCNT (0x30)
29#define S3C2410_SDIDSTA (0x34) 29#define S3C2410_SDIDSTA (0x34)
30#define S3C2410_SDIFSTA (0x38) 30#define S3C2410_SDIFSTA (0x38)
31
31#define S3C2410_SDIDATA (0x3C) 32#define S3C2410_SDIDATA (0x3C)
32#define S3C2410_SDIIMSK (0x40) 33#define S3C2410_SDIIMSK (0x40)
33 34
35#define S3C2440_SDIDATA (0x40)
36#define S3C2440_SDIIMSK (0x3C)
37
38#define S3C2440_SDICON_SDRESET (1<<8)
39#define S3C2440_SDICON_MMCCLOCK (1<<5)
34#define S3C2410_SDICON_BYTEORDER (1<<4) 40#define S3C2410_SDICON_BYTEORDER (1<<4)
35#define S3C2410_SDICON_SDIOIRQ (1<<3) 41#define S3C2410_SDICON_SDIOIRQ (1<<3)
36#define S3C2410_SDICON_RWAITEN (1<<2) 42#define S3C2410_SDICON_RWAITEN (1<<2)
@@ -42,7 +48,8 @@
42#define S3C2410_SDICMDCON_LONGRSP (1<<10) 48#define S3C2410_SDICMDCON_LONGRSP (1<<10)
43#define S3C2410_SDICMDCON_WAITRSP (1<<9) 49#define S3C2410_SDICMDCON_WAITRSP (1<<9)
44#define S3C2410_SDICMDCON_CMDSTART (1<<8) 50#define S3C2410_SDICMDCON_CMDSTART (1<<8)
45#define S3C2410_SDICMDCON_INDEX (0xff) 51#define S3C2410_SDICMDCON_SENDERHOST (1<<6)
52#define S3C2410_SDICMDCON_INDEX (0x3f)
46 53
47#define S3C2410_SDICMDSTAT_CRCFAIL (1<<12) 54#define S3C2410_SDICMDSTAT_CRCFAIL (1<<12)
48#define S3C2410_SDICMDSTAT_CMDSENT (1<<11) 55#define S3C2410_SDICMDSTAT_CMDSENT (1<<11)
@@ -51,6 +58,9 @@
51#define S3C2410_SDICMDSTAT_XFERING (1<<8) 58#define S3C2410_SDICMDSTAT_XFERING (1<<8)
52#define S3C2410_SDICMDSTAT_INDEX (0xff) 59#define S3C2410_SDICMDSTAT_INDEX (0xff)
53 60
61#define S3C2440_SDIDCON_DS_BYTE (0<<22)
62#define S3C2440_SDIDCON_DS_HALFWORD (1<<22)
63#define S3C2440_SDIDCON_DS_WORD (2<<22)
54#define S3C2410_SDIDCON_IRQPERIOD (1<<21) 64#define S3C2410_SDIDCON_IRQPERIOD (1<<21)
55#define S3C2410_SDIDCON_TXAFTERRESP (1<<20) 65#define S3C2410_SDIDCON_TXAFTERRESP (1<<20)
56#define S3C2410_SDIDCON_RXAFTERCMD (1<<19) 66#define S3C2410_SDIDCON_RXAFTERCMD (1<<19)
@@ -59,6 +69,7 @@
59#define S3C2410_SDIDCON_WIDEBUS (1<<16) 69#define S3C2410_SDIDCON_WIDEBUS (1<<16)
60#define S3C2410_SDIDCON_DMAEN (1<<15) 70#define S3C2410_SDIDCON_DMAEN (1<<15)
61#define S3C2410_SDIDCON_STOP (1<<14) 71#define S3C2410_SDIDCON_STOP (1<<14)
72#define S3C2440_SDIDCON_DATSTART (1<<14)
62#define S3C2410_SDIDCON_DATMODE (3<<12) 73#define S3C2410_SDIDCON_DATMODE (3<<12)
63#define S3C2410_SDIDCON_BLKNUM (0x7ff) 74#define S3C2410_SDIDCON_BLKNUM (0x7ff)
64 75
@@ -68,6 +79,7 @@
68#define S3C2410_SDIDCON_XFER_RXSTART (2<<12) 79#define S3C2410_SDIDCON_XFER_RXSTART (2<<12)
69#define S3C2410_SDIDCON_XFER_TXSTART (3<<12) 80#define S3C2410_SDIDCON_XFER_TXSTART (3<<12)
70 81
82#define S3C2410_SDIDCON_BLKNUM_MASK (0xFFF)
71#define S3C2410_SDIDCNT_BLKNUM_SHIFT (12) 83#define S3C2410_SDIDCNT_BLKNUM_SHIFT (12)
72 84
73#define S3C2410_SDIDSTA_RDYWAITREQ (1<<10) 85#define S3C2410_SDIDSTA_RDYWAITREQ (1<<10)
@@ -82,10 +94,12 @@
82#define S3C2410_SDIDSTA_TXDATAON (1<<1) 94#define S3C2410_SDIDSTA_TXDATAON (1<<1)
83#define S3C2410_SDIDSTA_RXDATAON (1<<0) 95#define S3C2410_SDIDSTA_RXDATAON (1<<0)
84 96
97#define S3C2440_SDIFSTA_FIFORESET (1<<16)
98#define S3C2440_SDIFSTA_FIFOFAIL (3<<14) /* 3 is correct (2 bits) */
85#define S3C2410_SDIFSTA_TFDET (1<<13) 99#define S3C2410_SDIFSTA_TFDET (1<<13)
86#define S3C2410_SDIFSTA_RFDET (1<<12) 100#define S3C2410_SDIFSTA_RFDET (1<<12)
87#define S3C2410_SDIFSTA_TXHALF (1<<11) 101#define S3C2410_SDIFSTA_TFHALF (1<<11)
88#define S3C2410_SDIFSTA_TXEMPTY (1<<10) 102#define S3C2410_SDIFSTA_TFEMPTY (1<<10)
89#define S3C2410_SDIFSTA_RFLAST (1<<9) 103#define S3C2410_SDIFSTA_RFLAST (1<<9)
90#define S3C2410_SDIFSTA_RFFULL (1<<8) 104#define S3C2410_SDIFSTA_RFFULL (1<<8)
91#define S3C2410_SDIFSTA_RFHALF (1<<7) 105#define S3C2410_SDIFSTA_RFHALF (1<<7)
diff --git a/include/asm-arm/plat-s3c24xx/mci.h b/include/asm-arm/plat-s3c24xx/mci.h
new file mode 100644
index 000000000000..2d0852ac3b27
--- /dev/null
+++ b/include/asm-arm/plat-s3c24xx/mci.h
@@ -0,0 +1,15 @@
1#ifndef _ARCH_MCI_H
2#define _ARCH_MCI_H
3
4struct s3c24xx_mci_pdata {
5 unsigned int wprotect_invert : 1;
6 unsigned int detect_invert : 1; /* set => detect active high. */
7
8 unsigned int gpio_detect;
9 unsigned int gpio_wprotect;
10 unsigned long ocr_avail;
11 void (*set_power)(unsigned char power_mode,
12 unsigned short vdd);
13};
14
15#endif /* _ARCH_NCI_H */
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index b4cddfaca90e..a3783861cdd2 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -77,7 +77,11 @@ struct i2c_board_info;
77struct platform_device *at32_add_device_twi(unsigned int id, 77struct platform_device *at32_add_device_twi(unsigned int id,
78 struct i2c_board_info *b, 78 struct i2c_board_info *b,
79 unsigned int n); 79 unsigned int n);
80struct platform_device *at32_add_device_mci(unsigned int id); 80
81struct mci_platform_data;
82struct platform_device *
83at32_add_device_mci(unsigned int id, struct mci_platform_data *data);
84
81struct platform_device *at32_add_device_ac97c(unsigned int id); 85struct platform_device *at32_add_device_ac97c(unsigned int id);
82struct platform_device *at32_add_device_abdac(unsigned int id); 86struct platform_device *at32_add_device_abdac(unsigned int id);
83struct platform_device *at32_add_device_psif(unsigned int id); 87struct platform_device *at32_add_device_psif(unsigned int id);
diff --git a/include/asm-avr32/atmel-mci.h b/include/asm-avr32/atmel-mci.h
new file mode 100644
index 000000000000..c2ea6e1c9aa1
--- /dev/null
+++ b/include/asm-avr32/atmel-mci.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_AVR32_ATMEL_MCI_H
2#define __ASM_AVR32_ATMEL_MCI_H
3
4struct mci_platform_data {
5 int detect_pin;
6 int wp_pin;
7};
8
9#endif /* __ASM_AVR32_ATMEL_MCI_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b20409404c7d..729f6b0a60e9 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -86,6 +86,12 @@
86 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \ 86 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
87 *(.pci_fixup_resume) \ 87 *(.pci_fixup_resume) \
88 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \ 88 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
89 VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
90 *(.pci_fixup_resume_early) \
91 VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
92 VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
93 *(.pci_fixup_suspend) \
94 VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
89 } \ 95 } \
90 \ 96 \
91 /* Built-in firmware blobs */ \ 97 /* Built-in firmware blobs */ \
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 6aff126fc07e..f88fa054d01d 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -763,6 +763,8 @@ prefetchw (const void *x)
763#define spin_lock_prefetch(x) prefetchw(x) 763#define spin_lock_prefetch(x) prefetchw(x)
764 764
765extern unsigned long boot_option_idle_override; 765extern unsigned long boot_option_idle_override;
766extern unsigned long idle_halt;
767extern unsigned long idle_nomwait;
766 768
767#endif /* !__ASSEMBLY__ */ 769#endif /* !__ASSEMBLY__ */
768 770
diff --git a/include/asm-mips/mach-au1x00/au1100_mmc.h b/include/asm-mips/mach-au1x00/au1100_mmc.h
index 9e0028f60a43..c35e20918490 100644
--- a/include/asm-mips/mach-au1x00/au1100_mmc.h
+++ b/include/asm-mips/mach-au1x00/au1100_mmc.h
@@ -38,15 +38,15 @@
38#ifndef __ASM_AU1100_MMC_H 38#ifndef __ASM_AU1100_MMC_H
39#define __ASM_AU1100_MMC_H 39#define __ASM_AU1100_MMC_H
40 40
41 41#include <linux/leds.h>
42#define NUM_AU1100_MMC_CONTROLLERS 2 42
43 43struct au1xmmc_platform_data {
44#if defined(CONFIG_SOC_AU1100) 44 int(*cd_setup)(void *mmc_host, int on);
45#define AU1100_SD_IRQ AU1100_SD_INT 45 int(*card_inserted)(void *mmc_host);
46#elif defined(CONFIG_SOC_AU1200) 46 int(*card_readonly)(void *mmc_host);
47#define AU1100_SD_IRQ AU1200_SD_INT 47 void(*set_power)(void *mmc_host, int state);
48#endif 48 struct led_classdev *led;
49 49};
50 50
51#define SD0_BASE 0xB0600000 51#define SD0_BASE 0xB0600000
52#define SD1_BASE 0xB0680000 52#define SD1_BASE 0xB0680000
diff --git a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild
index 09f312501eb5..bb5e9edb9825 100644
--- a/include/asm-s390/Kbuild
+++ b/include/asm-s390/Kbuild
@@ -8,9 +8,9 @@ header-y += ucontext.h
8header-y += vtoc.h 8header-y += vtoc.h
9header-y += zcrypt.h 9header-y += zcrypt.h
10header-y += kvm.h 10header-y += kvm.h
11header-y += schid.h
12header-y += chsc.h 11header-y += chsc.h
13 12
14unifdef-y += cmb.h 13unifdef-y += cmb.h
15unifdef-y += debug.h 14unifdef-y += debug.h
16unifdef-y += chpid.h 15unifdef-y += chpid.h
16unifdef-y += schid.h
diff --git a/include/asm-s390/chpid.h b/include/asm-s390/chpid.h
index 606844d0a5c3..dfe3c7f3439a 100644
--- a/include/asm-s390/chpid.h
+++ b/include/asm-s390/chpid.h
@@ -20,6 +20,9 @@ struct chp_id {
20 u8 id; 20 u8 id;
21} __attribute__((packed)); 21} __attribute__((packed));
22 22
23#ifdef __KERNEL__
24#include <asm/cio.h>
25
23static inline void chp_id_init(struct chp_id *chpid) 26static inline void chp_id_init(struct chp_id *chpid)
24{ 27{
25 memset(chpid, 0, sizeof(struct chp_id)); 28 memset(chpid, 0, sizeof(struct chp_id));
@@ -40,9 +43,6 @@ static inline void chp_id_next(struct chp_id *chpid)
40 } 43 }
41} 44}
42 45
43#ifdef __KERNEL__
44#include <asm/cio.h>
45
46static inline int chp_id_is_valid(struct chp_id *chpid) 46static inline int chp_id_is_valid(struct chp_id *chpid)
47{ 47{
48 return (chpid->cssid <= __MAX_CSSID); 48 return (chpid->cssid <= __MAX_CSSID);
diff --git a/include/asm-s390/qdio.h b/include/asm-s390/qdio.h
index 11240342a0f4..6813772171f2 100644
--- a/include/asm-s390/qdio.h
+++ b/include/asm-s390/qdio.h
@@ -1,404 +1,382 @@
1/* 1/*
2 * linux/include/asm-s390/qdio.h 2 * linux/include/asm-s390/qdio.h
3 * 3 *
4 * Linux for S/390 QDIO base support, Hipersocket base support 4 * Copyright 2000,2008 IBM Corp.
5 * version 2
6 *
7 * Copyright 2000,2002 IBM Corporation
8 * Author(s): Utz Bacher <utz.bacher@de.ibm.com> 5 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>
6 * Jan Glauber <jang@linux.vnet.ibm.com>
9 * 7 *
10 */ 8 */
11#ifndef __QDIO_H__ 9#ifndef __QDIO_H__
12#define __QDIO_H__ 10#define __QDIO_H__
13 11
14/* note, that most of the typedef's are from ingo. */
15
16#include <linux/interrupt.h> 12#include <linux/interrupt.h>
17#include <asm/cio.h> 13#include <asm/cio.h>
18#include <asm/ccwdev.h> 14#include <asm/ccwdev.h>
19 15
20#define QDIO_NAME "qdio " 16#define QDIO_MAX_QUEUES_PER_IRQ 32
21 17#define QDIO_MAX_BUFFERS_PER_Q 128
22#ifndef __s390x__ 18#define QDIO_MAX_BUFFERS_MASK (QDIO_MAX_BUFFERS_PER_Q - 1)
23#define QDIO_32_BIT 19#define QDIO_MAX_ELEMENTS_PER_BUFFER 16
24#endif /* __s390x__ */ 20#define QDIO_SBAL_SIZE 256
25 21
26/**** CONSTANTS, that are relied on without using these symbols *****/ 22#define QDIO_QETH_QFMT 0
27#define QDIO_MAX_QUEUES_PER_IRQ 32 /* used in width of unsigned int */ 23#define QDIO_ZFCP_QFMT 1
28/************************ END of CONSTANTS **************************/ 24#define QDIO_IQDIO_QFMT 2
29#define QDIO_MAX_BUFFERS_PER_Q 128 /* must be a power of 2 (%x=&(x-1)*/ 25
30#define QDIO_BUF_ORDER 7 /* 2**this == number of pages used for sbals in 1 q */ 26/**
31#define QDIO_MAX_ELEMENTS_PER_BUFFER 16 27 * struct qdesfmt0 - queue descriptor, format 0
32#define SBAL_SIZE 256 28 * @sliba: storage list information block address
33 29 * @sla: storage list address
34#define QDIO_QETH_QFMT 0 30 * @slsba: storage list state block address
35#define QDIO_ZFCP_QFMT 1 31 * @akey: access key for DLIB
36#define QDIO_IQDIO_QFMT 2 32 * @bkey: access key for SL
37#define QDIO_IQDIO_QFMT_ASYNCH 3 33 * @ckey: access key for SBALs
38 34 * @dkey: access key for SLSB
39struct qdio_buffer_element{ 35 */
40 unsigned int flags;
41 unsigned int length;
42#ifdef QDIO_32_BIT
43 void *reserved;
44#endif /* QDIO_32_BIT */
45 void *addr;
46} __attribute__ ((packed,aligned(16)));
47
48struct qdio_buffer{
49 volatile struct qdio_buffer_element element[16];
50} __attribute__ ((packed,aligned(256)));
51
52
53/* params are: ccw_device, status, qdio_error, siga_error,
54 queue_number, first element processed, number of elements processed,
55 int_parm */
56typedef void qdio_handler_t(struct ccw_device *,unsigned int,unsigned int,
57 unsigned int,unsigned int,int,int,unsigned long);
58
59
60#define QDIO_STATUS_INBOUND_INT 0x01
61#define QDIO_STATUS_OUTBOUND_INT 0x02
62#define QDIO_STATUS_LOOK_FOR_ERROR 0x04
63#define QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR 0x08
64#define QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR 0x10
65#define QDIO_STATUS_ACTIVATE_CHECK_CONDITION 0x20
66
67#define QDIO_SIGA_ERROR_ACCESS_EXCEPTION 0x10
68#define QDIO_SIGA_ERROR_B_BIT_SET 0x20
69
70/* for qdio_initialize */
71#define QDIO_INBOUND_0COPY_SBALS 0x01
72#define QDIO_OUTBOUND_0COPY_SBALS 0x02
73#define QDIO_USE_OUTBOUND_PCIS 0x04
74
75/* for qdio_cleanup */
76#define QDIO_FLAG_CLEANUP_USING_CLEAR 0x01
77#define QDIO_FLAG_CLEANUP_USING_HALT 0x02
78
79struct qdio_initialize {
80 struct ccw_device *cdev;
81 unsigned char q_format;
82 unsigned char adapter_name[8];
83 unsigned int qib_param_field_format; /*adapter dependent*/
84 /* pointer to 128 bytes or NULL, if no param field */
85 unsigned char *qib_param_field; /* adapter dependent */
86 /* pointer to no_queues*128 words of data or NULL */
87 unsigned long *input_slib_elements;
88 unsigned long *output_slib_elements;
89 unsigned int min_input_threshold;
90 unsigned int max_input_threshold;
91 unsigned int min_output_threshold;
92 unsigned int max_output_threshold;
93 unsigned int no_input_qs;
94 unsigned int no_output_qs;
95 qdio_handler_t *input_handler;
96 qdio_handler_t *output_handler;
97 unsigned long int_parm;
98 unsigned long flags;
99 void **input_sbal_addr_array; /* addr of n*128 void ptrs */
100 void **output_sbal_addr_array; /* addr of n*128 void ptrs */
101};
102
103extern int qdio_initialize(struct qdio_initialize *init_data);
104extern int qdio_allocate(struct qdio_initialize *init_data);
105extern int qdio_establish(struct qdio_initialize *init_data);
106
107extern int qdio_activate(struct ccw_device *,int flags);
108
109#define QDIO_STATE_MUST_USE_OUTB_PCI 0x00000001
110#define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */
111#define QDIO_STATE_ESTABLISHED 0x00000004 /* after qdio_initialize */
112#define QDIO_STATE_ACTIVE 0x00000008 /* after qdio_activate */
113#define QDIO_STATE_STOPPED 0x00000010 /* after queues went down */
114extern unsigned long qdio_get_status(int irq);
115
116
117#define QDIO_FLAG_SYNC_INPUT 0x01
118#define QDIO_FLAG_SYNC_OUTPUT 0x02
119#define QDIO_FLAG_UNDER_INTERRUPT 0x04
120#define QDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT 0x08 /* no effect on
121 adapter interrupts */
122#define QDIO_FLAG_DONT_SIGA 0x10
123#define QDIO_FLAG_PCI_OUT 0x20
124
125extern int do_QDIO(struct ccw_device*, unsigned int flags,
126 unsigned int queue_number,
127 unsigned int qidx,unsigned int count,
128 struct qdio_buffer *buffers);
129
130extern int qdio_get_ssqd_pct(struct ccw_device*);
131extern int qdio_synchronize(struct ccw_device*, unsigned int flags,
132 unsigned int queue_number);
133
134extern int qdio_cleanup(struct ccw_device*, int how);
135extern int qdio_shutdown(struct ccw_device*, int how);
136extern int qdio_free(struct ccw_device*);
137
138unsigned char qdio_get_slsb_state(struct ccw_device*, unsigned int flag,
139 unsigned int queue_number,
140 unsigned int qidx);
141
142extern void qdio_init_scrubber(void);
143
144struct qdesfmt0 { 36struct qdesfmt0 {
145#ifdef QDIO_32_BIT 37 u64 sliba;
146 unsigned long res1; /* reserved */ 38 u64 sla;
147#endif /* QDIO_32_BIT */ 39 u64 slsba;
148 unsigned long sliba; /* storage-list-information-block 40 u32 : 32;
149 address */ 41 u32 akey : 4;
150#ifdef QDIO_32_BIT 42 u32 bkey : 4;
151 unsigned long res2; /* reserved */ 43 u32 ckey : 4;
152#endif /* QDIO_32_BIT */ 44 u32 dkey : 4;
153 unsigned long sla; /* storage-list address */ 45 u32 : 16;
154#ifdef QDIO_32_BIT
155 unsigned long res3; /* reserved */
156#endif /* QDIO_32_BIT */
157 unsigned long slsba; /* storage-list-state-block address */
158 unsigned int res4; /* reserved */
159 unsigned int akey : 4; /* access key for DLIB */
160 unsigned int bkey : 4; /* access key for SL */
161 unsigned int ckey : 4; /* access key for SBALs */
162 unsigned int dkey : 4; /* access key for SLSB */
163 unsigned int res5 : 16; /* reserved */
164} __attribute__ ((packed)); 46} __attribute__ ((packed));
165 47
166/* 48/**
167 * Queue-Description record (QDR) 49 * struct qdr - queue description record (QDR)
50 * @qfmt: queue format
51 * @pfmt: implementation dependent parameter format
52 * @ac: adapter characteristics
53 * @iqdcnt: input queue descriptor count
54 * @oqdcnt: output queue descriptor count
55 * @iqdsz: inpout queue descriptor size
56 * @oqdsz: output queue descriptor size
57 * @qiba: queue information block address
58 * @qkey: queue information block key
59 * @qdf0: queue descriptions
168 */ 60 */
169struct qdr { 61struct qdr {
170 unsigned int qfmt : 8; /* queue format */ 62 u32 qfmt : 8;
171 unsigned int pfmt : 8; /* impl. dep. parameter format */ 63 u32 pfmt : 8;
172 unsigned int res1 : 8; /* reserved */ 64 u32 : 8;
173 unsigned int ac : 8; /* adapter characteristics */ 65 u32 ac : 8;
174 unsigned int res2 : 8; /* reserved */ 66 u32 : 8;
175 unsigned int iqdcnt : 8; /* input-queue-descriptor count */ 67 u32 iqdcnt : 8;
176 unsigned int res3 : 8; /* reserved */ 68 u32 : 8;
177 unsigned int oqdcnt : 8; /* output-queue-descriptor count */ 69 u32 oqdcnt : 8;
178 unsigned int res4 : 8; /* reserved */ 70 u32 : 8;
179 unsigned int iqdsz : 8; /* input-queue-descriptor size */ 71 u32 iqdsz : 8;
180 unsigned int res5 : 8; /* reserved */ 72 u32 : 8;
181 unsigned int oqdsz : 8; /* output-queue-descriptor size */ 73 u32 oqdsz : 8;
182 unsigned int res6[9]; /* reserved */ 74 /* private: */
183#ifdef QDIO_32_BIT 75 u32 res[9];
184 unsigned long res7; /* reserved */ 76 /* public: */
185#endif /* QDIO_32_BIT */ 77 u64 qiba;
186 unsigned long qiba; /* queue-information-block address */ 78 u32 : 32;
187 unsigned int res8; /* reserved */ 79 u32 qkey : 4;
188 unsigned int qkey : 4; /* queue-information-block key */ 80 u32 : 28;
189 unsigned int res9 : 28; /* reserved */ 81 struct qdesfmt0 qdf0[126];
190/* union _qd {*/ /* why this? */ 82} __attribute__ ((packed, aligned(4096)));
191 struct qdesfmt0 qdf0[126]; 83
192/* } qd;*/ 84#define QIB_AC_OUTBOUND_PCI_SUPPORTED 0x40
193} __attribute__ ((packed,aligned(4096)));
194
195
196/*
197 * queue information block (QIB)
198 */
199#define QIB_AC_INBOUND_PCI_SUPPORTED 0x80
200#define QIB_AC_OUTBOUND_PCI_SUPPORTED 0x40
201#define QIB_RFLAGS_ENABLE_QEBSM 0x80 85#define QIB_RFLAGS_ENABLE_QEBSM 0x80
202 86
87/**
88 * struct qib - queue information block (QIB)
89 * @qfmt: queue format
90 * @pfmt: implementation dependent parameter format
91 * @rflags: QEBSM
92 * @ac: adapter characteristics
93 * @isliba: absolute address of first input SLIB
94 * @osliba: absolute address of first output SLIB
95 * @ebcnam: adapter identifier in EBCDIC
96 * @parm: implementation dependent parameters
97 */
203struct qib { 98struct qib {
204 unsigned int qfmt : 8; /* queue format */ 99 u32 qfmt : 8;
205 unsigned int pfmt : 8; /* impl. dep. parameter format */ 100 u32 pfmt : 8;
206 unsigned int rflags : 8; /* QEBSM */ 101 u32 rflags : 8;
207 unsigned int ac : 8; /* adapter characteristics */ 102 u32 ac : 8;
208 unsigned int res2; /* reserved */ 103 u32 : 32;
209#ifdef QDIO_32_BIT 104 u64 isliba;
210 unsigned long res3; /* reserved */ 105 u64 osliba;
211#endif /* QDIO_32_BIT */ 106 u32 : 32;
212 unsigned long isliba; /* absolute address of 1st 107 u32 : 32;
213 input SLIB */ 108 u8 ebcnam[8];
214#ifdef QDIO_32_BIT 109 /* private: */
215 unsigned long res4; /* reserved */ 110 u8 res[88];
216#endif /* QDIO_32_BIT */ 111 /* public: */
217 unsigned long osliba; /* absolute address of 1st 112 u8 parm[QDIO_MAX_BUFFERS_PER_Q];
218 output SLIB */ 113} __attribute__ ((packed, aligned(256)));
219 unsigned int res5; /* reserved */ 114
220 unsigned int res6; /* reserved */ 115/**
221 unsigned char ebcnam[8]; /* adapter identifier in EBCDIC */ 116 * struct slibe - storage list information block element (SLIBE)
222 unsigned char res7[88]; /* reserved */ 117 * @parms: implementation dependent parameters
223 unsigned char parm[QDIO_MAX_BUFFERS_PER_Q];
224 /* implementation dependent
225 parameters */
226} __attribute__ ((packed,aligned(256)));
227
228
229/*
230 * storage-list-information block element (SLIBE)
231 */ 118 */
232struct slibe { 119struct slibe {
233#ifdef QDIO_32_BIT 120 u64 parms;
234 unsigned long res; /* reserved */
235#endif /* QDIO_32_BIT */
236 unsigned long parms; /* implementation dependent
237 parameters */
238}; 121};
239 122
240/* 123/**
241 * storage-list-information block (SLIB) 124 * struct slib - storage list information block (SLIB)
125 * @nsliba: next SLIB address (if any)
126 * @sla: SL address
127 * @slsba: SLSB address
128 * @slibe: SLIB elements
242 */ 129 */
243struct slib { 130struct slib {
244#ifdef QDIO_32_BIT 131 u64 nsliba;
245 unsigned long res1; /* reserved */ 132 u64 sla;
246#endif /* QDIO_32_BIT */ 133 u64 slsba;
247 unsigned long nsliba; /* next SLIB address (if any) */ 134 /* private: */
248#ifdef QDIO_32_BIT 135 u8 res[1000];
249 unsigned long res2; /* reserved */ 136 /* public: */
250#endif /* QDIO_32_BIT */ 137 struct slibe slibe[QDIO_MAX_BUFFERS_PER_Q];
251 unsigned long sla; /* SL address */ 138} __attribute__ ((packed, aligned(2048)));
252#ifdef QDIO_32_BIT 139
253 unsigned long res3; /* reserved */ 140/**
254#endif /* QDIO_32_BIT */ 141 * struct sbal_flags - storage block address list flags
255 unsigned long slsba; /* SLSB address */ 142 * @last: last entry
256 unsigned char res4[1000]; /* reserved */ 143 * @cont: contiguous storage
257 struct slibe slibe[QDIO_MAX_BUFFERS_PER_Q]; /* SLIB elements */ 144 * @frag: fragmentation
258} __attribute__ ((packed,aligned(2048))); 145 */
259
260struct sbal_flags { 146struct sbal_flags {
261 unsigned char res1 : 1; /* reserved */ 147 u8 : 1;
262 unsigned char last : 1; /* last entry */ 148 u8 last : 1;
263 unsigned char cont : 1; /* contiguous storage */ 149 u8 cont : 1;
264 unsigned char res2 : 1; /* reserved */ 150 u8 : 1;
265 unsigned char frag : 2; /* fragmentation (s.below) */ 151 u8 frag : 2;
266 unsigned char res3 : 2; /* reserved */ 152 u8 : 2;
267} __attribute__ ((packed)); 153} __attribute__ ((packed));
268 154
269#define SBAL_FLAGS_FIRST_FRAG 0x04000000UL 155#define SBAL_FLAGS_FIRST_FRAG 0x04000000UL
270#define SBAL_FLAGS_MIDDLE_FRAG 0x08000000UL 156#define SBAL_FLAGS_MIDDLE_FRAG 0x08000000UL
271#define SBAL_FLAGS_LAST_FRAG 0x0c000000UL 157#define SBAL_FLAGS_LAST_FRAG 0x0c000000UL
272#define SBAL_FLAGS_LAST_ENTRY 0x40000000UL 158#define SBAL_FLAGS_LAST_ENTRY 0x40000000UL
273#define SBAL_FLAGS_CONTIGUOUS 0x20000000UL 159#define SBAL_FLAGS_CONTIGUOUS 0x20000000UL
274 160
275#define SBAL_FLAGS0_DATA_CONTINUATION 0x20UL 161#define SBAL_FLAGS0_DATA_CONTINUATION 0x20UL
276 162
277/* Awesome OpenFCP extensions */ 163/* Awesome OpenFCP extensions */
278#define SBAL_FLAGS0_TYPE_STATUS 0x00UL 164#define SBAL_FLAGS0_TYPE_STATUS 0x00UL
279#define SBAL_FLAGS0_TYPE_WRITE 0x08UL 165#define SBAL_FLAGS0_TYPE_WRITE 0x08UL
280#define SBAL_FLAGS0_TYPE_READ 0x10UL 166#define SBAL_FLAGS0_TYPE_READ 0x10UL
281#define SBAL_FLAGS0_TYPE_WRITE_READ 0x18UL 167#define SBAL_FLAGS0_TYPE_WRITE_READ 0x18UL
282#define SBAL_FLAGS0_MORE_SBALS 0x04UL 168#define SBAL_FLAGS0_MORE_SBALS 0x04UL
283#define SBAL_FLAGS0_COMMAND 0x02UL 169#define SBAL_FLAGS0_COMMAND 0x02UL
284#define SBAL_FLAGS0_LAST_SBAL 0x00UL 170#define SBAL_FLAGS0_LAST_SBAL 0x00UL
285#define SBAL_FLAGS0_ONLY_SBAL SBAL_FLAGS0_COMMAND 171#define SBAL_FLAGS0_ONLY_SBAL SBAL_FLAGS0_COMMAND
286#define SBAL_FLAGS0_MIDDLE_SBAL SBAL_FLAGS0_MORE_SBALS 172#define SBAL_FLAGS0_MIDDLE_SBAL SBAL_FLAGS0_MORE_SBALS
287#define SBAL_FLAGS0_FIRST_SBAL SBAL_FLAGS0_MORE_SBALS | SBAL_FLAGS0_COMMAND 173#define SBAL_FLAGS0_FIRST_SBAL SBAL_FLAGS0_MORE_SBALS | SBAL_FLAGS0_COMMAND
288/* Naught of interest beyond this point */ 174#define SBAL_FLAGS0_PCI 0x40
289 175
290#define SBAL_FLAGS0_PCI 0x40 176/**
177 * struct sbal_sbalf_0 - sbal flags for sbale 0
178 * @pci: PCI indicator
179 * @cont: data continuation
180 * @sbtype: storage-block type (FCP)
181 */
291struct sbal_sbalf_0 { 182struct sbal_sbalf_0 {
292 unsigned char res1 : 1; /* reserved */ 183 u8 : 1;
293 unsigned char pci : 1; /* PCI indicator */ 184 u8 pci : 1;
294 unsigned char cont : 1; /* data continuation */ 185 u8 cont : 1;
295 unsigned char sbtype: 2; /* storage-block type (OpenFCP) */ 186 u8 sbtype : 2;
296 unsigned char res2 : 3; /* reserved */ 187 u8 : 3;
297} __attribute__ ((packed)); 188} __attribute__ ((packed));
298 189
190/**
191 * struct sbal_sbalf_1 - sbal flags for sbale 1
192 * @key: storage key
193 */
299struct sbal_sbalf_1 { 194struct sbal_sbalf_1 {
300 unsigned char res1 : 4; /* reserved */ 195 u8 : 4;
301 unsigned char key : 4; /* storage key */ 196 u8 key : 4;
302} __attribute__ ((packed)); 197} __attribute__ ((packed));
303 198
199/**
200 * struct sbal_sbalf_14 - sbal flags for sbale 14
201 * @erridx: error index
202 */
304struct sbal_sbalf_14 { 203struct sbal_sbalf_14 {
305 unsigned char res1 : 4; /* reserved */ 204 u8 : 4;
306 unsigned char erridx : 4; /* error index */ 205 u8 erridx : 4;
307} __attribute__ ((packed)); 206} __attribute__ ((packed));
308 207
208/**
209 * struct sbal_sbalf_15 - sbal flags for sbale 15
210 * @reason: reason for error state
211 */
309struct sbal_sbalf_15 { 212struct sbal_sbalf_15 {
310 unsigned char reason; /* reserved */ 213 u8 reason;
311} __attribute__ ((packed)); 214} __attribute__ ((packed));
312 215
216/**
217 * union sbal_sbalf - storage block address list flags
218 * @i0: sbalf0
219 * @i1: sbalf1
220 * @i14: sbalf14
221 * @i15: sblaf15
222 * @value: raw value
223 */
313union sbal_sbalf { 224union sbal_sbalf {
314 struct sbal_sbalf_0 i0; 225 struct sbal_sbalf_0 i0;
315 struct sbal_sbalf_1 i1; 226 struct sbal_sbalf_1 i1;
316 struct sbal_sbalf_14 i14; 227 struct sbal_sbalf_14 i14;
317 struct sbal_sbalf_15 i15; 228 struct sbal_sbalf_15 i15;
318 unsigned char value; 229 u8 value;
319}; 230};
320 231
321struct sbal_element { 232/**
322 union { 233 * struct qdio_buffer_element - SBAL entry
323 struct sbal_flags bits; /* flags */ 234 * @flags: flags
324 unsigned char value; 235 * @length: length
325 } flags; 236 * @addr: address
326 unsigned int res1 : 16; /* reserved */ 237*/
327 union sbal_sbalf sbalf; /* SBAL flags */ 238struct qdio_buffer_element {
328 unsigned int res2 : 16; /* reserved */ 239 u32 flags;
329 unsigned int count : 16; /* data count */ 240 u32 length;
330#ifdef QDIO_32_BIT 241#ifdef CONFIG_32BIT
331 unsigned long res3; /* reserved */ 242 /* private: */
332#endif /* QDIO_32_BIT */ 243 void *reserved;
333 unsigned long addr; /* absolute data address */ 244 /* public: */
334} __attribute__ ((packed,aligned(16))); 245#endif
246 void *addr;
247} __attribute__ ((packed, aligned(16)));
335 248
336/* 249/**
337 * strorage-block access-list (SBAL) 250 * struct qdio_buffer - storage block address list (SBAL)
251 * @element: SBAL entries
338 */ 252 */
339struct sbal { 253struct qdio_buffer {
340 struct sbal_element element[QDIO_MAX_ELEMENTS_PER_BUFFER]; 254 struct qdio_buffer_element element[QDIO_MAX_ELEMENTS_PER_BUFFER];
341} __attribute__ ((packed,aligned(256))); 255} __attribute__ ((packed, aligned(256)));
342 256
343/* 257/**
344 * storage-list (SL) 258 * struct sl_element - storage list entry
259 * @sbal: absolute SBAL address
345 */ 260 */
346struct sl_element { 261struct sl_element {
347#ifdef QDIO_32_BIT 262#ifdef CONFIG_32BIT
348 unsigned long res; /* reserved */ 263 /* private: */
349#endif /* QDIO_32_BIT */ 264 unsigned long reserved;
350 unsigned long sbal; /* absolute SBAL address */ 265 /* public: */
266#endif
267 unsigned long sbal;
351} __attribute__ ((packed)); 268} __attribute__ ((packed));
352 269
270/**
271 * struct sl - storage list (SL)
272 * @element: SL entries
273 */
353struct sl { 274struct sl {
354 struct sl_element element[QDIO_MAX_BUFFERS_PER_Q]; 275 struct sl_element element[QDIO_MAX_BUFFERS_PER_Q];
355} __attribute__ ((packed,aligned(1024))); 276} __attribute__ ((packed, aligned(1024)));
356 277
357/* 278/**
358 * storage-list-state block (SLSB) 279 * struct slsb - storage list state block (SLSB)
280 * @val: state per buffer
359 */ 281 */
360struct slsb_flags { 282struct slsb {
361 unsigned char owner : 2; /* SBAL owner */ 283 u8 val[QDIO_MAX_BUFFERS_PER_Q];
362 unsigned char type : 1; /* buffer type */ 284} __attribute__ ((packed, aligned(256)));
363 unsigned char state : 5; /* processing state */ 285
286struct qdio_ssqd_desc {
287 u8 flags;
288 u8:8;
289 u16 sch;
290 u8 qfmt;
291 u8 parm;
292 u8 qdioac1;
293 u8 sch_class;
294 u8 pcnt;
295 u8 icnt;
296 u8:8;
297 u8 ocnt;
298 u8:8;
299 u8 mbccnt;
300 u16 qdioac2;
301 u64 sch_token;
302 u64:64;
364} __attribute__ ((packed)); 303} __attribute__ ((packed));
365 304
305/* params are: ccw_device, qdio_error, queue_number,
306 first element processed, number of elements processed, int_parm */
307typedef void qdio_handler_t(struct ccw_device *, unsigned int, int,
308 int, int, unsigned long);
366 309
367struct slsb { 310/* qdio errors reported to the upper-layer program */
368 union { 311#define QDIO_ERROR_SIGA_ACCESS_EXCEPTION 0x10
369 unsigned char val[QDIO_MAX_BUFFERS_PER_Q]; 312#define QDIO_ERROR_SIGA_BUSY 0x20
370 struct slsb_flags flags[QDIO_MAX_BUFFERS_PER_Q]; 313#define QDIO_ERROR_ACTIVATE_CHECK_CONDITION 0x40
371 } acc; 314#define QDIO_ERROR_SLSB_STATE 0x80
372} __attribute__ ((packed,aligned(256)));
373 315
374/* 316/* for qdio_initialize */
375 * SLSB values 317#define QDIO_INBOUND_0COPY_SBALS 0x01
318#define QDIO_OUTBOUND_0COPY_SBALS 0x02
319#define QDIO_USE_OUTBOUND_PCIS 0x04
320
321/* for qdio_cleanup */
322#define QDIO_FLAG_CLEANUP_USING_CLEAR 0x01
323#define QDIO_FLAG_CLEANUP_USING_HALT 0x02
324
325/**
326 * struct qdio_initialize - qdio initalization data
327 * @cdev: associated ccw device
328 * @q_format: queue format
329 * @adapter_name: name for the adapter
330 * @qib_param_field_format: format for qib_parm_field
331 * @qib_param_field: pointer to 128 bytes or NULL, if no param field
332 * @input_slib_elements: pointer to no_input_qs * 128 words of data or NULL
333 * @output_slib_elements: pointer to no_output_qs * 128 words of data or NULL
334 * @no_input_qs: number of input queues
335 * @no_output_qs: number of output queues
336 * @input_handler: handler to be called for input queues
337 * @output_handler: handler to be called for output queues
338 * @int_parm: interruption parameter
339 * @flags: initialization flags
340 * @input_sbal_addr_array: address of no_input_qs * 128 pointers
341 * @output_sbal_addr_array: address of no_output_qs * 128 pointers
376 */ 342 */
377#define SLSB_OWNER_PROG 1 343struct qdio_initialize {
378#define SLSB_OWNER_CU 2 344 struct ccw_device *cdev;
379 345 unsigned char q_format;
380#define SLSB_TYPE_INPUT 0 346 unsigned char adapter_name[8];
381#define SLSB_TYPE_OUTPUT 1 347 unsigned int qib_param_field_format;
382 348 unsigned char *qib_param_field;
383#define SLSB_STATE_NOT_INIT 0 349 unsigned long *input_slib_elements;
384#define SLSB_STATE_EMPTY 1 350 unsigned long *output_slib_elements;
385#define SLSB_STATE_PRIMED 2 351 unsigned int no_input_qs;
386#define SLSB_STATE_HALTED 0xe 352 unsigned int no_output_qs;
387#define SLSB_STATE_ERROR 0xf 353 qdio_handler_t *input_handler;
388 354 qdio_handler_t *output_handler;
389#define SLSB_P_INPUT_NOT_INIT 0x80 355 unsigned long int_parm;
390#define SLSB_P_INPUT_PROCESSING 0x81 356 unsigned long flags;
391#define SLSB_CU_INPUT_EMPTY 0x41 357 void **input_sbal_addr_array;
392#define SLSB_P_INPUT_PRIMED 0x82 358 void **output_sbal_addr_array;
393#define SLSB_P_INPUT_HALTED 0x8E 359};
394#define SLSB_P_INPUT_ERROR 0x8F 360
395 361#define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */
396#define SLSB_P_OUTPUT_NOT_INIT 0xA0 362#define QDIO_STATE_ESTABLISHED 0x00000004 /* after qdio_establish */
397#define SLSB_P_OUTPUT_EMPTY 0xA1 363#define QDIO_STATE_ACTIVE 0x00000008 /* after qdio_activate */
398#define SLSB_CU_OUTPUT_PRIMED 0x62 364#define QDIO_STATE_STOPPED 0x00000010 /* after queues went down */
399#define SLSB_P_OUTPUT_HALTED 0xAE 365
400#define SLSB_P_OUTPUT_ERROR 0xAF 366#define QDIO_FLAG_SYNC_INPUT 0x01
401 367#define QDIO_FLAG_SYNC_OUTPUT 0x02
402#define SLSB_ERROR_DURING_LOOKUP 0xFF 368#define QDIO_FLAG_PCI_OUT 0x10
369
370extern int qdio_initialize(struct qdio_initialize *init_data);
371extern int qdio_allocate(struct qdio_initialize *init_data);
372extern int qdio_establish(struct qdio_initialize *init_data);
373extern int qdio_activate(struct ccw_device *);
374
375extern int do_QDIO(struct ccw_device*, unsigned int flags,
376 int q_nr, int qidx, int count);
377extern int qdio_cleanup(struct ccw_device*, int how);
378extern int qdio_shutdown(struct ccw_device*, int how);
379extern int qdio_free(struct ccw_device *);
380extern struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev);
403 381
404#endif /* __QDIO_H__ */ 382#endif /* __QDIO_H__ */
diff --git a/include/asm-s390/schid.h b/include/asm-s390/schid.h
index 5017ffa78e04..7bdc0fe15691 100644
--- a/include/asm-s390/schid.h
+++ b/include/asm-s390/schid.h
@@ -10,6 +10,7 @@ struct subchannel_id {
10 __u32 sch_no : 16; 10 __u32 sch_no : 16;
11} __attribute__ ((packed, aligned(4))); 11} __attribute__ ((packed, aligned(4)));
12 12
13#ifdef __KERNEL__
13 14
14/* Helper function for sane state of pre-allocated subchannel_id. */ 15/* Helper function for sane state of pre-allocated subchannel_id. */
15static inline void 16static inline void
@@ -25,4 +26,6 @@ schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
25 return !memcmp(schid1, schid2, sizeof(struct subchannel_id)); 26 return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
26} 27}
27 28
29#endif /* __KERNEL__ */
30
28#endif /* ASM_SCHID_H */ 31#endif /* ASM_SCHID_H */
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index f09ee3f72977..4ba14e463e83 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -65,6 +65,7 @@ extern unsigned long machine_flags;
65 65
66#define MACHINE_FLAG_VM (1UL << 0) 66#define MACHINE_FLAG_VM (1UL << 0)
67#define MACHINE_FLAG_IEEE (1UL << 1) 67#define MACHINE_FLAG_IEEE (1UL << 1)
68#define MACHINE_FLAG_P390 (1UL << 2)
68#define MACHINE_FLAG_CSP (1UL << 3) 69#define MACHINE_FLAG_CSP (1UL << 3)
69#define MACHINE_FLAG_MVPG (1UL << 4) 70#define MACHINE_FLAG_MVPG (1UL << 4)
70#define MACHINE_FLAG_DIAG44 (1UL << 5) 71#define MACHINE_FLAG_DIAG44 (1UL << 5)
@@ -77,7 +78,6 @@ extern unsigned long machine_flags;
77 78
78#define MACHINE_IS_VM (machine_flags & MACHINE_FLAG_VM) 79#define MACHINE_IS_VM (machine_flags & MACHINE_FLAG_VM)
79#define MACHINE_IS_KVM (machine_flags & MACHINE_FLAG_KVM) 80#define MACHINE_IS_KVM (machine_flags & MACHINE_FLAG_KVM)
80#define MACHINE_IS_P390 (machine_flags & MACHINE_FLAG_P390)
81#define MACHINE_HAS_DIAG9C (machine_flags & MACHINE_FLAG_DIAG9C) 81#define MACHINE_HAS_DIAG9C (machine_flags & MACHINE_FLAG_DIAG9C)
82 82
83#ifndef __s390x__ 83#ifndef __s390x__
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h
index 33e793e991d0..06633b01dd5b 100644
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -59,6 +59,7 @@ struct e820map {
59 struct e820entry map[E820_X_MAX]; 59 struct e820entry map[E820_X_MAX];
60}; 60};
61 61
62#ifdef __KERNEL__
62/* see comment in arch/x86/kernel/e820.c */ 63/* see comment in arch/x86/kernel/e820.c */
63extern struct e820map e820; 64extern struct e820map e820;
64extern struct e820map e820_saved; 65extern struct e820map e820_saved;
@@ -115,7 +116,7 @@ extern void setup_memory_map(void);
115extern char *default_machine_specific_memory_setup(void); 116extern char *default_machine_specific_memory_setup(void);
116extern char *machine_specific_memory_setup(void); 117extern char *machine_specific_memory_setup(void);
117extern char *memory_setup(void); 118extern char *memory_setup(void);
118 119#endif /* __KERNEL__ */
119#endif /* __ASSEMBLY__ */ 120#endif /* __ASSEMBLY__ */
120 121
121#define ISA_START_ADDRESS 0xa0000 122#define ISA_START_ADDRESS 0xa0000
diff --git a/include/asm-x86/pci-direct.h b/include/asm-x86/pci-direct.h
index 5b21485be573..80c775d9fe20 100644
--- a/include/asm-x86/pci-direct.h
+++ b/include/asm-x86/pci-direct.h
@@ -11,7 +11,11 @@ extern u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset);
11extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset); 11extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset);
12extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val); 12extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val);
13extern void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val); 13extern void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val);
14extern void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val);
14 15
15extern int early_pci_allowed(void); 16extern int early_pci_allowed(void);
16 17
18extern unsigned int pci_early_dump_regs;
19extern void early_dump_pci_device(u8 bus, u8 slot, u8 func);
20extern void early_dump_pci_devices(void);
17#endif 21#endif
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 7f7382704592..55402d2ab938 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -727,6 +727,8 @@ extern int force_mwait;
727extern void select_idle_routine(const struct cpuinfo_x86 *c); 727extern void select_idle_routine(const struct cpuinfo_x86 *c);
728 728
729extern unsigned long boot_option_idle_override; 729extern unsigned long boot_option_idle_override;
730extern unsigned long idle_halt;
731extern unsigned long idle_nomwait;
730 732
731extern void enable_sep_cpu(void); 733extern void enable_sep_cpu(void);
732extern int sysenter_setup(void); 734extern int sysenter_setup(void);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 0601075d09a1..a17177639376 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -235,6 +235,9 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
235int acpi_check_mem_region(resource_size_t start, resource_size_t n, 235int acpi_check_mem_region(resource_size_t start, resource_size_t n,
236 const char *name); 236 const char *name);
237 237
238#ifdef CONFIG_PM_SLEEP
239void __init acpi_old_suspend_ordering(void);
240#endif /* CONFIG_PM_SLEEP */
238#else /* CONFIG_ACPI */ 241#else /* CONFIG_ACPI */
239 242
240static inline int early_acpi_boot_init(void) 243static inline int early_acpi_boot_init(void)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 32a441b05fd5..88d68081a0f1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -985,6 +985,9 @@ static inline int bdev_integrity_enabled(struct block_device *bdev, int rw)
985 985
986static inline int blk_integrity_rq(struct request *rq) 986static inline int blk_integrity_rq(struct request *rq)
987{ 987{
988 if (rq->bio == NULL)
989 return 0;
990
988 return bio_integrity(rq->bio); 991 return bio_integrity(rq->bio);
989} 992}
990 993
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 3ae65b1bf90f..0488f937634a 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -165,8 +165,8 @@ struct configfs_item_operations {
165}; 165};
166 166
167struct configfs_group_operations { 167struct configfs_group_operations {
168 struct config_item *(*make_item)(struct config_group *group, const char *name); 168 int (*make_item)(struct config_group *group, const char *name, struct config_item **new_item);
169 struct config_group *(*make_group)(struct config_group *group, const char *name); 169 int (*make_group)(struct config_group *group, const char *name, struct config_group **new_group);
170 int (*commit_item)(struct config_item *item); 170 int (*commit_item)(struct config_item *item);
171 void (*disconnect_notify)(struct config_group *group, struct config_item *item); 171 void (*disconnect_notify)(struct config_group *group, struct config_item *item);
172 void (*drop_item)(struct config_group *group, struct config_item *item); 172 void (*drop_item)(struct config_group *group, struct config_item *item);
diff --git a/include/linux/device.h b/include/linux/device.h
index 6a2d04c011bc..f71a78d123ae 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -68,6 +68,8 @@ struct bus_type {
68 int (*resume_early)(struct device *dev); 68 int (*resume_early)(struct device *dev);
69 int (*resume)(struct device *dev); 69 int (*resume)(struct device *dev);
70 70
71 struct pm_ext_ops *pm;
72
71 struct bus_type_private *p; 73 struct bus_type_private *p;
72}; 74};
73 75
@@ -131,6 +133,8 @@ struct device_driver {
131 int (*resume) (struct device *dev); 133 int (*resume) (struct device *dev);
132 struct attribute_group **groups; 134 struct attribute_group **groups;
133 135
136 struct pm_ops *pm;
137
134 struct driver_private *p; 138 struct driver_private *p;
135}; 139};
136 140
@@ -197,6 +201,8 @@ struct class {
197 201
198 int (*suspend)(struct device *dev, pm_message_t state); 202 int (*suspend)(struct device *dev, pm_message_t state);
199 int (*resume)(struct device *dev); 203 int (*resume)(struct device *dev);
204
205 struct pm_ops *pm;
200}; 206};
201 207
202extern int __must_check class_register(struct class *class); 208extern int __must_check class_register(struct class *class);
@@ -248,8 +254,11 @@ struct device_type {
248 struct attribute_group **groups; 254 struct attribute_group **groups;
249 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 255 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
250 void (*release)(struct device *dev); 256 void (*release)(struct device *dev);
257
251 int (*suspend)(struct device *dev, pm_message_t state); 258 int (*suspend)(struct device *dev, pm_message_t state);
252 int (*resume)(struct device *dev); 259 int (*resume)(struct device *dev);
260
261 struct pm_ops *pm;
253}; 262};
254 263
255/* interface for exporting device attributes */ 264/* interface for exporting device attributes */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 08934995c7ab..deddeedf3257 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -128,6 +128,15 @@ static inline void set_freezable(void)
128} 128}
129 129
130/* 130/*
131 * Tell the freezer that the current task should be frozen by it and that it
132 * should send a fake signal to the task to freeze it.
133 */
134static inline void set_freezable_with_signal(void)
135{
136 current->flags &= ~(PF_NOFREEZE | PF_FREEZER_NOSIG);
137}
138
139/*
131 * Freezer-friendly wrappers around wait_event_interruptible() and 140 * Freezer-friendly wrappers around wait_event_interruptible() and
132 * wait_event_interruptible_timeout(), originally defined in <linux/wait.h> 141 * wait_event_interruptible_timeout(), originally defined in <linux/wait.h>
133 */ 142 */
@@ -174,6 +183,7 @@ static inline void freezer_do_not_count(void) {}
174static inline void freezer_count(void) {} 183static inline void freezer_count(void) {}
175static inline int freezer_should_skip(struct task_struct *p) { return 0; } 184static inline int freezer_should_skip(struct task_struct *p) { return 0; }
176static inline void set_freezable(void) {} 185static inline void set_freezable(void) {}
186static inline void set_freezable_with_signal(void) {}
177 187
178#define wait_event_freezable(wq, condition) \ 188#define wait_event_freezable(wq, condition) \
179 wait_event_interruptible(wq, condition) 189 wait_event_interruptible(wq, condition)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 52e510a0aec2..c6455dadb21b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1729,6 +1729,8 @@ static inline void invalidate_remote_inode(struct inode *inode)
1729extern int invalidate_inode_pages2(struct address_space *mapping); 1729extern int invalidate_inode_pages2(struct address_space *mapping);
1730extern int invalidate_inode_pages2_range(struct address_space *mapping, 1730extern int invalidate_inode_pages2_range(struct address_space *mapping,
1731 pgoff_t start, pgoff_t end); 1731 pgoff_t start, pgoff_t end);
1732extern void generic_sync_sb_inodes(struct super_block *sb,
1733 struct writeback_control *wbc);
1732extern int write_inode_now(struct inode *, int); 1734extern int write_inode_now(struct inode *, int);
1733extern int filemap_fdatawrite(struct address_space *); 1735extern int filemap_fdatawrite(struct address_space *);
1734extern int filemap_flush(struct address_space *); 1736extern int filemap_flush(struct address_space *);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ac4eeb2932ef..4726126f5a59 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -139,6 +139,12 @@ struct ide_io_ports {
139#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ 139#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */
140 140
141/* 141/*
142 * Op codes for special requests to be handled by ide_special_rq().
143 * Values should be in the range of 0x20 to 0x3f.
144 */
145#define REQ_DRIVE_RESET 0x20
146
147/*
142 * Check for an interrupt and acknowledge the interrupt status 148 * Check for an interrupt and acknowledge the interrupt status
143 */ 149 */
144struct hwif_s; 150struct hwif_s;
@@ -171,7 +177,7 @@ typedef struct hw_regs_s {
171 int irq; /* our irq number */ 177 int irq; /* our irq number */
172 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 178 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
173 hwif_chipset_t chipset; 179 hwif_chipset_t chipset;
174 struct device *dev; 180 struct device *dev, *parent;
175} hw_regs_t; 181} hw_regs_t;
176 182
177void ide_init_port_data(struct hwif_s *, unsigned int); 183void ide_init_port_data(struct hwif_s *, unsigned int);
@@ -405,8 +411,8 @@ typedef struct ide_drive_s {
405struct ide_port_info; 411struct ide_port_info;
406 412
407struct ide_port_ops { 413struct ide_port_ops {
408 /* host specific initialization of devices on a port */ 414 /* host specific initialization of a device */
409 void (*port_init_devs)(struct hwif_s *); 415 void (*init_dev)(ide_drive_t *);
410 /* routine to program host for PIO mode */ 416 /* routine to program host for PIO mode */
411 void (*set_pio_mode)(ide_drive_t *, const u8); 417 void (*set_pio_mode)(ide_drive_t *, const u8);
412 /* routine to program host for DMA mode */ 418 /* routine to program host for DMA mode */
@@ -565,8 +571,6 @@ typedef struct hwgroup_s {
565 unsigned int sleeping : 1; 571 unsigned int sleeping : 1;
566 /* BOOL: polling active & poll_timeout field valid */ 572 /* BOOL: polling active & poll_timeout field valid */
567 unsigned int polling : 1; 573 unsigned int polling : 1;
568 /* BOOL: in a polling reset situation. Must not trigger another reset yet */
569 unsigned int resetting : 1;
570 574
571 /* current drive */ 575 /* current drive */
572 ide_drive_t *drive; 576 ide_drive_t *drive;
@@ -786,7 +790,6 @@ struct ide_driver_s {
786 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); 790 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
787 int (*end_request)(ide_drive_t *, int, int); 791 int (*end_request)(ide_drive_t *, int, int);
788 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); 792 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
789 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
790 struct device_driver gen_driver; 793 struct device_driver gen_driver;
791 int (*probe)(ide_drive_t *); 794 int (*probe)(ide_drive_t *);
792 void (*remove)(ide_drive_t *); 795 void (*remove)(ide_drive_t *);
@@ -801,18 +804,6 @@ struct ide_driver_s {
801 804
802int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 805int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
803 806
804/*
805 * ide_hwifs[] is the master data structure used to keep track
806 * of just about everything in ide.c. Whenever possible, routines
807 * should be using pointers to a drive (ide_drive_t *) or
808 * pointers to a hwif (ide_hwif_t *), rather than indexing this
809 * structure directly (the allocation/layout may change!).
810 *
811 */
812#ifndef _IDE_C
813extern ide_hwif_t ide_hwifs[]; /* master data repository */
814#endif
815
816extern int ide_vlb_clk; 807extern int ide_vlb_clk;
817extern int ide_pci_clk; 808extern int ide_pci_clk;
818 809
@@ -840,10 +831,6 @@ ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
840 831
841ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); 832ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
842 833
843ide_startstop_t __ide_abort(ide_drive_t *, struct request *);
844
845extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
846
847extern void ide_fix_driveid(struct hd_driveid *); 834extern void ide_fix_driveid(struct hd_driveid *);
848 835
849extern void ide_fixstring(u8 *, const int, const int); 836extern void ide_fixstring(u8 *, const int, const int);
@@ -1271,16 +1258,43 @@ static inline int ide_dev_is_sata(struct hd_driveid *id)
1271u64 ide_get_lba_addr(struct ide_taskfile *, int); 1258u64 ide_get_lba_addr(struct ide_taskfile *, int);
1272u8 ide_dump_status(ide_drive_t *, const char *, u8); 1259u8 ide_dump_status(ide_drive_t *, const char *, u8);
1273 1260
1274typedef struct ide_pio_timings_s { 1261struct ide_timing {
1275 int setup_time; /* Address setup (ns) minimum */ 1262 u8 mode;
1276 int active_time; /* Active pulse (ns) minimum */ 1263 u8 setup; /* t1 */
1277 int cycle_time; /* Cycle time (ns) minimum = */ 1264 u16 act8b; /* t2 for 8-bit io */
1278 /* active + recovery (+ setup for some chips) */ 1265 u16 rec8b; /* t2i for 8-bit io */
1279} ide_pio_timings_t; 1266 u16 cyc8b; /* t0 for 8-bit io */
1267 u16 active; /* t2 or tD */
1268 u16 recover; /* t2i or tK */
1269 u16 cycle; /* t0 */
1270 u16 udma; /* t2CYCTYP/2 */
1271};
1272
1273enum {
1274 IDE_TIMING_SETUP = (1 << 0),
1275 IDE_TIMING_ACT8B = (1 << 1),
1276 IDE_TIMING_REC8B = (1 << 2),
1277 IDE_TIMING_CYC8B = (1 << 3),
1278 IDE_TIMING_8BIT = IDE_TIMING_ACT8B | IDE_TIMING_REC8B |
1279 IDE_TIMING_CYC8B,
1280 IDE_TIMING_ACTIVE = (1 << 4),
1281 IDE_TIMING_RECOVER = (1 << 5),
1282 IDE_TIMING_CYCLE = (1 << 6),
1283 IDE_TIMING_UDMA = (1 << 7),
1284 IDE_TIMING_ALL = IDE_TIMING_SETUP | IDE_TIMING_8BIT |
1285 IDE_TIMING_ACTIVE | IDE_TIMING_RECOVER |
1286 IDE_TIMING_CYCLE | IDE_TIMING_UDMA,
1287};
1288
1289struct ide_timing *ide_timing_find_mode(u8);
1290u16 ide_pio_cycle_time(ide_drive_t *, u8);
1291void ide_timing_merge(struct ide_timing *, struct ide_timing *,
1292 struct ide_timing *, unsigned int);
1293int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
1294
1295int ide_scan_pio_blacklist(char *);
1280 1296
1281unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1282u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); 1297u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1283extern const ide_pio_timings_t ide_pio_timings[6];
1284 1298
1285int ide_set_pio_mode(ide_drive_t *, u8); 1299int ide_set_pio_mode(ide_drive_t *, u8);
1286int ide_set_dma_mode(ide_drive_t *, u8); 1300int ide_set_dma_mode(ide_drive_t *, u8);
diff --git a/include/linux/inet.h b/include/linux/inet.h
index 1354080cf8cf..4cca05c9678e 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -44,6 +44,13 @@
44 44
45#include <linux/types.h> 45#include <linux/types.h>
46 46
47/*
48 * These mimic similar macros defined in user-space for inet_ntop(3).
49 * See /usr/include/netinet/in.h .
50 */
51#define INET_ADDRSTRLEN (16)
52#define INET6_ADDRSTRLEN (48)
53
47extern __be32 in_aton(const char *str); 54extern __be32 in_aton(const char *str);
48extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); 55extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
49extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); 56extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9927a88674a3..93c45acf249a 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -140,8 +140,8 @@ extern struct group_info init_groups;
140 .nr_cpus_allowed = NR_CPUS, \ 140 .nr_cpus_allowed = NR_CPUS, \
141 }, \ 141 }, \
142 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 142 .tasks = LIST_HEAD_INIT(tsk.tasks), \
143 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ 143 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
144 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \ 144 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
145 .real_parent = &tsk, \ 145 .real_parent = &tsk, \
146 .parent = &tsk, \ 146 .parent = &tsk, \
147 .children = LIST_HEAD_INIT(tsk.children), \ 147 .children = LIST_HEAD_INIT(tsk.children), \
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index c6801bffe76d..2cd07cc29687 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -59,6 +59,7 @@ struct resource_list {
59#define IORESOURCE_IRQ_HIGHLEVEL (1<<2) 59#define IORESOURCE_IRQ_HIGHLEVEL (1<<2)
60#define IORESOURCE_IRQ_LOWLEVEL (1<<3) 60#define IORESOURCE_IRQ_LOWLEVEL (1<<3)
61#define IORESOURCE_IRQ_SHAREABLE (1<<4) 61#define IORESOURCE_IRQ_SHAREABLE (1<<4)
62#define IORESOURCE_IRQ_OPTIONAL (1<<5)
62 63
63/* PnP DMA specific bits (IORESOURCE_BITS) */ 64/* PnP DMA specific bits (IORESOURCE_BITS) */
64#define IORESOURCE_DMA_TYPE_MASK (3<<0) 65#define IORESOURCE_DMA_TYPE_MASK (3<<0)
@@ -88,6 +89,10 @@ struct resource_list {
88#define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */ 89#define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */
89#define IORESOURCE_MEM_EXPANSIONROM (1<<6) 90#define IORESOURCE_MEM_EXPANSIONROM (1<<6)
90 91
92/* PnP I/O specific bits (IORESOURCE_BITS) */
93#define IORESOURCE_IO_16BIT_ADDR (1<<0)
94#define IORESOURCE_IO_FIXED (1<<1)
95
91/* PCI ROM control bits (IORESOURCE_BITS) */ 96/* PCI ROM control bits (IORESOURCE_BITS) */
92#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ 97#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
93#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */ 98#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index d0c3abed74c2..143cebf0586f 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -135,6 +135,7 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
135 struct mmc_command *, int); 135 struct mmc_command *, int);
136 136
137extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); 137extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
138extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
138 139
139extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); 140extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
140extern void mmc_release_host(struct mmc_host *host); 141extern void mmc_release_host(struct mmc_host *host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7ab962fa1d73..10a2080086ca 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -51,8 +51,30 @@ struct mmc_ios {
51 51
52struct mmc_host_ops { 52struct mmc_host_ops {
53 void (*request)(struct mmc_host *host, struct mmc_request *req); 53 void (*request)(struct mmc_host *host, struct mmc_request *req);
54 /*
55 * Avoid calling these three functions too often or in a "fast path",
56 * since underlaying controller might implement them in an expensive
57 * and/or slow way.
58 *
59 * Also note that these functions might sleep, so don't call them
60 * in the atomic contexts!
61 *
62 * Return values for the get_ro callback should be:
63 * 0 for a read/write card
64 * 1 for a read-only card
65 * -ENOSYS when not supported (equal to NULL callback)
66 * or a negative errno value when something bad happened
67 *
68 * Return values for the get_ro callback should be:
69 * 0 for a absent card
70 * 1 for a present card
71 * -ENOSYS when not supported (equal to NULL callback)
72 * or a negative errno value when something bad happened
73 */
54 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); 74 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios);
55 int (*get_ro)(struct mmc_host *host); 75 int (*get_ro)(struct mmc_host *host);
76 int (*get_cd)(struct mmc_host *host);
77
56 void (*enable_sdio_irq)(struct mmc_host *host, int enable); 78 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
57}; 79};
58 80
@@ -89,11 +111,11 @@ struct mmc_host {
89 unsigned long caps; /* Host capabilities */ 111 unsigned long caps; /* Host capabilities */
90 112
91#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ 113#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
92#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ 114#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
93#define MMC_CAP_MMC_HIGHSPEED (1 << 2) /* Can do MMC high-speed timing */ 115#define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */
94#define MMC_CAP_SD_HIGHSPEED (1 << 3) /* Can do SD high-speed timing */ 116#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */
95#define MMC_CAP_SDIO_IRQ (1 << 4) /* Can signal pending SDIO IRQs */ 117#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */
96#define MMC_CAP_SPI (1 << 5) /* Talks only SPI protocols */ 118#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
97 119
98 /* host specific block data */ 120 /* host specific block data */
99 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 121 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 4236fbf0b6fb..14b81f3e5232 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -16,7 +16,6 @@
16 * Based strongly on code by: 16 * Based strongly on code by:
17 * 17 *
18 * Author: Yong-iL Joh <tolkien@mizi.com> 18 * Author: Yong-iL Joh <tolkien@mizi.com>
19 * Date : $Date: 2002/06/18 12:37:30 $
20 * 19 *
21 * Author: Andrew Christian 20 * Author: Andrew Christian
22 * 15 May 2002 21 * 15 May 2002
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index b050f4d7b41f..07bee4a0d457 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/linux/mmc/sdio_func.h 2 * include/linux/mmc/sdio_func.h
3 * 3 *
4 * Copyright 2007 Pierre Ossman 4 * Copyright 2007-2008 Pierre Ossman
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License as published by
@@ -46,6 +46,8 @@ struct sdio_func {
46 unsigned max_blksize; /* maximum block size */ 46 unsigned max_blksize; /* maximum block size */
47 unsigned cur_blksize; /* current block size */ 47 unsigned cur_blksize; /* current block size */
48 48
49 unsigned enable_timeout; /* max enable timeout in msec */
50
49 unsigned int state; /* function state */ 51 unsigned int state; /* function state */
50#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */ 52#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
51 53
@@ -120,23 +122,22 @@ extern int sdio_set_block_size(struct sdio_func *func, unsigned blksz);
120extern int sdio_claim_irq(struct sdio_func *func, sdio_irq_handler_t *handler); 122extern int sdio_claim_irq(struct sdio_func *func, sdio_irq_handler_t *handler);
121extern int sdio_release_irq(struct sdio_func *func); 123extern int sdio_release_irq(struct sdio_func *func);
122 124
123extern unsigned char sdio_readb(struct sdio_func *func, 125extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz);
124 unsigned int addr, int *err_ret); 126
125extern unsigned short sdio_readw(struct sdio_func *func, 127extern u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret);
126 unsigned int addr, int *err_ret); 128extern u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret);
127extern unsigned long sdio_readl(struct sdio_func *func, 129extern u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret);
128 unsigned int addr, int *err_ret);
129 130
130extern int sdio_memcpy_fromio(struct sdio_func *func, void *dst, 131extern int sdio_memcpy_fromio(struct sdio_func *func, void *dst,
131 unsigned int addr, int count); 132 unsigned int addr, int count);
132extern int sdio_readsb(struct sdio_func *func, void *dst, 133extern int sdio_readsb(struct sdio_func *func, void *dst,
133 unsigned int addr, int count); 134 unsigned int addr, int count);
134 135
135extern void sdio_writeb(struct sdio_func *func, unsigned char b, 136extern void sdio_writeb(struct sdio_func *func, u8 b,
136 unsigned int addr, int *err_ret); 137 unsigned int addr, int *err_ret);
137extern void sdio_writew(struct sdio_func *func, unsigned short b, 138extern void sdio_writew(struct sdio_func *func, u16 b,
138 unsigned int addr, int *err_ret); 139 unsigned int addr, int *err_ret);
139extern void sdio_writel(struct sdio_func *func, unsigned long b, 140extern void sdio_writel(struct sdio_func *func, u32 b,
140 unsigned int addr, int *err_ret); 141 unsigned int addr, int *err_ret);
141 142
142extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr, 143extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr,
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 27d6a8d98cef..29d261918734 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -12,9 +12,19 @@
12#include <linux/magic.h> 12#include <linux/magic.h>
13 13
14/* Default timeout values */ 14/* Default timeout values */
15#define NFS_DEF_UDP_TIMEO (11)
16#define NFS_DEF_UDP_RETRANS (3)
17#define NFS_DEF_TCP_TIMEO (600)
18#define NFS_DEF_TCP_RETRANS (2)
19
15#define NFS_MAX_UDP_TIMEOUT (60*HZ) 20#define NFS_MAX_UDP_TIMEOUT (60*HZ)
16#define NFS_MAX_TCP_TIMEOUT (600*HZ) 21#define NFS_MAX_TCP_TIMEOUT (600*HZ)
17 22
23#define NFS_DEF_ACREGMIN (3)
24#define NFS_DEF_ACREGMAX (60)
25#define NFS_DEF_ACDIRMIN (30)
26#define NFS_DEF_ACDIRMAX (60)
27
18/* 28/*
19 * When flushing a cluster of dirty pages, there can be different 29 * When flushing a cluster of dirty pages, there can be different
20 * strategies: 30 * strategies:
diff --git a/include/linux/nfs_iostat.h b/include/linux/nfs_iostat.h
new file mode 100644
index 000000000000..1cb9a3fed2b3
--- /dev/null
+++ b/include/linux/nfs_iostat.h
@@ -0,0 +1,119 @@
1/*
2 * User-space visible declarations for NFS client per-mount
3 * point statistics
4 *
5 * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>
6 *
7 * NFS client per-mount statistics provide information about the
8 * health of the NFS client and the health of each NFS mount point.
9 * Generally these are not for detailed problem diagnosis, but
10 * simply to indicate that there is a problem.
11 *
12 * These counters are not meant to be human-readable, but are meant
13 * to be integrated into system monitoring tools such as "sar" and
14 * "iostat". As such, the counters are sampled by the tools over
15 * time, and are never zeroed after a file system is mounted.
16 * Moving averages can be computed by the tools by taking the
17 * difference between two instantaneous samples and dividing that
18 * by the time between the samples.
19 */
20
21#ifndef _LINUX_NFS_IOSTAT
22#define _LINUX_NFS_IOSTAT
23
24#define NFS_IOSTAT_VERS "1.0"
25
26/*
27 * NFS byte counters
28 *
29 * 1. SERVER - the number of payload bytes read from or written
30 * to the server by the NFS client via an NFS READ or WRITE
31 * request.
32 *
33 * 2. NORMAL - the number of bytes read or written by applications
34 * via the read(2) and write(2) system call interfaces.
35 *
36 * 3. DIRECT - the number of bytes read or written from files
37 * opened with the O_DIRECT flag.
38 *
39 * These counters give a view of the data throughput into and out
40 * of the NFS client. Comparing the number of bytes requested by
41 * an application with the number of bytes the client requests from
42 * the server can provide an indication of client efficiency
43 * (per-op, cache hits, etc).
44 *
45 * These counters can also help characterize which access methods
46 * are in use. DIRECT by itself shows whether there is any O_DIRECT
47 * traffic. NORMAL + DIRECT shows how much data is going through
48 * the system call interface. A large amount of SERVER traffic
49 * without much NORMAL or DIRECT traffic shows that applications
50 * are using mapped files.
51 *
52 * NFS page counters
53 *
54 * These count the number of pages read or written via nfs_readpage(),
55 * nfs_readpages(), or their write equivalents.
56 *
57 * NB: When adding new byte counters, please include the measured
58 * units in the name of each byte counter to help users of this
59 * interface determine what exactly is being counted.
60 */
61enum nfs_stat_bytecounters {
62 NFSIOS_NORMALREADBYTES = 0,
63 NFSIOS_NORMALWRITTENBYTES,
64 NFSIOS_DIRECTREADBYTES,
65 NFSIOS_DIRECTWRITTENBYTES,
66 NFSIOS_SERVERREADBYTES,
67 NFSIOS_SERVERWRITTENBYTES,
68 NFSIOS_READPAGES,
69 NFSIOS_WRITEPAGES,
70 __NFSIOS_BYTESMAX,
71};
72
73/*
74 * NFS event counters
75 *
76 * These counters provide a low-overhead way of monitoring client
77 * activity without enabling NFS trace debugging. The counters
78 * show the rate at which VFS requests are made, and how often the
79 * client invalidates its data and attribute caches. This allows
80 * system administrators to monitor such things as how close-to-open
81 * is working, and answer questions such as "why are there so many
82 * GETATTR requests on the wire?"
83 *
84 * They also count anamolous events such as short reads and writes,
85 * silly renames due to close-after-delete, and operations that
86 * change the size of a file (such operations can often be the
87 * source of data corruption if applications aren't using file
88 * locking properly).
89 */
90enum nfs_stat_eventcounters {
91 NFSIOS_INODEREVALIDATE = 0,
92 NFSIOS_DENTRYREVALIDATE,
93 NFSIOS_DATAINVALIDATE,
94 NFSIOS_ATTRINVALIDATE,
95 NFSIOS_VFSOPEN,
96 NFSIOS_VFSLOOKUP,
97 NFSIOS_VFSACCESS,
98 NFSIOS_VFSUPDATEPAGE,
99 NFSIOS_VFSREADPAGE,
100 NFSIOS_VFSREADPAGES,
101 NFSIOS_VFSWRITEPAGE,
102 NFSIOS_VFSWRITEPAGES,
103 NFSIOS_VFSGETDENTS,
104 NFSIOS_VFSSETATTR,
105 NFSIOS_VFSFLUSH,
106 NFSIOS_VFSFSYNC,
107 NFSIOS_VFSLOCK,
108 NFSIOS_VFSRELEASE,
109 NFSIOS_CONGESTIONWAIT,
110 NFSIOS_SETATTRTRUNC,
111 NFSIOS_EXTENDWRITE,
112 NFSIOS_SILLYRENAME,
113 NFSIOS_SHORTREAD,
114 NFSIOS_SHORTWRITE,
115 NFSIOS_DELAY,
116 __NFSIOS_COUNTSMAX,
117};
118
119#endif /* _LINUX_NFS_IOSTAT */
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index a1676e19e491..3c60685d972b 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -27,9 +27,12 @@
27/* 27/*
28 * Valid flags for a dirty buffer 28 * Valid flags for a dirty buffer
29 */ 29 */
30#define PG_BUSY 0 30enum {
31#define PG_NEED_COMMIT 1 31 PG_BUSY = 0,
32#define PG_NEED_RESCHED 2 32 PG_CLEAN,
33 PG_NEED_COMMIT,
34 PG_NEED_RESCHED,
35};
33 36
34struct nfs_inode; 37struct nfs_inode;
35struct nfs_page { 38struct nfs_page {
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 24263bb8e0be..8c77c11224d1 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -829,9 +829,8 @@ struct nfs_rpc_ops {
829 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 829 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
830 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); 830 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
831 int (*commit_done) (struct rpc_task *, struct nfs_write_data *); 831 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
832 int (*file_open) (struct inode *, struct file *);
833 int (*file_release) (struct inode *, struct file *);
834 int (*lock)(struct file *, int, struct file_lock *); 832 int (*lock)(struct file *, int, struct file_lock *);
833 int (*lock_check_bounds)(const struct file_lock *);
835 void (*clear_acl_cache)(struct inode *); 834 void (*clear_acl_cache)(struct inode *);
836}; 835};
837 836
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d18b1dd49fab..a6a088e1a804 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -17,8 +17,7 @@
17#ifndef LINUX_PCI_H 17#ifndef LINUX_PCI_H
18#define LINUX_PCI_H 18#define LINUX_PCI_H
19 19
20/* Include the pci register defines */ 20#include <linux/pci_regs.h> /* The pci register defines */
21#include <linux/pci_regs.h>
22 21
23/* 22/*
24 * The PCI interface treats multi-function devices as independent 23 * The PCI interface treats multi-function devices as independent
@@ -49,12 +48,22 @@
49#include <linux/list.h> 48#include <linux/list.h>
50#include <linux/compiler.h> 49#include <linux/compiler.h>
51#include <linux/errno.h> 50#include <linux/errno.h>
51#include <linux/kobject.h>
52#include <asm/atomic.h> 52#include <asm/atomic.h>
53#include <linux/device.h> 53#include <linux/device.h>
54 54
55/* Include the ID list */ 55/* Include the ID list */
56#include <linux/pci_ids.h> 56#include <linux/pci_ids.h>
57 57
58/* pci_slot represents a physical slot */
59struct pci_slot {
60 struct pci_bus *bus; /* The bus this slot is on */
61 struct list_head list; /* node in list of slots on this bus */
62 struct hotplug_slot *hotplug; /* Hotplug info (migrate over time) */
63 unsigned char number; /* PCI_SLOT(pci_dev->devfn) */
64 struct kobject kobj;
65};
66
58/* File state for mmap()s on /proc/bus/pci/X/Y */ 67/* File state for mmap()s on /proc/bus/pci/X/Y */
59enum pci_mmap_state { 68enum pci_mmap_state {
60 pci_mmap_io, 69 pci_mmap_io,
@@ -142,6 +151,7 @@ struct pci_dev {
142 151
143 void *sysdata; /* hook for sys-specific extension */ 152 void *sysdata; /* hook for sys-specific extension */
144 struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */ 153 struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */
154 struct pci_slot *slot; /* Physical slot this device is in */
145 155
146 unsigned int devfn; /* encoded device & function index */ 156 unsigned int devfn; /* encoded device & function index */
147 unsigned short vendor; 157 unsigned short vendor;
@@ -167,6 +177,13 @@ struct pci_dev {
167 pci_power_t current_state; /* Current operating state. In ACPI-speak, 177 pci_power_t current_state; /* Current operating state. In ACPI-speak,
168 this is D0-D3, D0 being fully functional, 178 this is D0-D3, D0 being fully functional,
169 and D3 being off. */ 179 and D3 being off. */
180 int pm_cap; /* PM capability offset in the
181 configuration space */
182 unsigned int pme_support:5; /* Bitmask of states from which PME#
183 can be generated */
184 unsigned int d1_support:1; /* Low power state D1 is supported */
185 unsigned int d2_support:1; /* Low power state D2 is supported */
186 unsigned int no_d1d2:1; /* Only allow D0 and D3 */
170 187
171#ifdef CONFIG_PCIEASPM 188#ifdef CONFIG_PCIEASPM
172 struct pcie_link_state *link_state; /* ASPM link state. */ 189 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -191,7 +208,6 @@ struct pci_dev {
191 unsigned int is_added:1; 208 unsigned int is_added:1;
192 unsigned int is_busmaster:1; /* device is busmaster */ 209 unsigned int is_busmaster:1; /* device is busmaster */
193 unsigned int no_msi:1; /* device may not use msi */ 210 unsigned int no_msi:1; /* device may not use msi */
194 unsigned int no_d1d2:1; /* only allow d0 or d3 */
195 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 211 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
196 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 212 unsigned int broken_parity_status:1; /* Device generates false positive parity */
197 unsigned int msi_enabled:1; 213 unsigned int msi_enabled:1;
@@ -267,6 +283,7 @@ struct pci_bus {
267 struct list_head children; /* list of child buses */ 283 struct list_head children; /* list of child buses */
268 struct list_head devices; /* list of devices on this bus */ 284 struct list_head devices; /* list of devices on this bus */
269 struct pci_dev *self; /* bridge device as seen by parent */ 285 struct pci_dev *self; /* bridge device as seen by parent */
286 struct list_head slots; /* list of slots on this bus */
270 struct resource *resource[PCI_BUS_NUM_RESOURCES]; 287 struct resource *resource[PCI_BUS_NUM_RESOURCES];
271 /* address space routed to this bus */ 288 /* address space routed to this bus */
272 289
@@ -328,7 +345,7 @@ struct pci_bus_region {
328struct pci_dynids { 345struct pci_dynids {
329 spinlock_t lock; /* protects list, index */ 346 spinlock_t lock; /* protects list, index */
330 struct list_head list; /* for IDs added at runtime */ 347 struct list_head list; /* for IDs added at runtime */
331 unsigned int use_driver_data:1; /* pci_driver->driver_data is used */ 348 unsigned int use_driver_data:1; /* pci_device_id->driver_data is used */
332}; 349};
333 350
334/* ---------------------------------------------------------------- */ 351/* ---------------------------------------------------------------- */
@@ -390,7 +407,7 @@ struct pci_driver {
390 int (*resume_early) (struct pci_dev *dev); 407 int (*resume_early) (struct pci_dev *dev);
391 int (*resume) (struct pci_dev *dev); /* Device woken up */ 408 int (*resume) (struct pci_dev *dev); /* Device woken up */
392 void (*shutdown) (struct pci_dev *dev); 409 void (*shutdown) (struct pci_dev *dev);
393 410 struct pm_ext_ops *pm;
394 struct pci_error_handlers *err_handler; 411 struct pci_error_handlers *err_handler;
395 struct device_driver driver; 412 struct device_driver driver;
396 struct pci_dynids dynids; 413 struct pci_dynids dynids;
@@ -489,6 +506,10 @@ struct pci_bus *pci_create_bus(struct device *parent, int bus,
489 struct pci_ops *ops, void *sysdata); 506 struct pci_ops *ops, void *sysdata);
490struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 507struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
491 int busnr); 508 int busnr);
509struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
510 const char *name);
511void pci_destroy_slot(struct pci_slot *slot);
512void pci_update_slot_number(struct pci_slot *slot, int slot_nr);
492int pci_scan_slot(struct pci_bus *bus, int devfn); 513int pci_scan_slot(struct pci_bus *bus, int devfn);
493struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 514struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
494void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 515void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
@@ -618,6 +639,8 @@ int pci_restore_state(struct pci_dev *dev);
618int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 639int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
619pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 640pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
620int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 641int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
642int pci_prepare_to_sleep(struct pci_dev *dev);
643int pci_back_from_sleep(struct pci_dev *dev);
621 644
622/* Functions for PCI Hotplug drivers to use */ 645/* Functions for PCI Hotplug drivers to use */
623int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 646int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
@@ -839,6 +862,11 @@ static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
839 return -EIO; 862 return -EIO;
840} 863}
841 864
865static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
866{
867 return -EIO;
868}
869
842static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 870static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
843 unsigned int size) 871 unsigned int size)
844{ 872{
@@ -977,9 +1005,9 @@ static inline void pci_set_drvdata(struct pci_dev *pdev, void *data)
977/* If you want to know what to call your pci_dev, ask this function. 1005/* If you want to know what to call your pci_dev, ask this function.
978 * Again, it's a wrapper around the generic device. 1006 * Again, it's a wrapper around the generic device.
979 */ 1007 */
980static inline char *pci_name(struct pci_dev *pdev) 1008static inline const char *pci_name(struct pci_dev *pdev)
981{ 1009{
982 return pdev->dev.bus_id; 1010 return dev_name(&pdev->dev);
983} 1011}
984 1012
985 1013
@@ -1014,7 +1042,9 @@ enum pci_fixup_pass {
1014 pci_fixup_header, /* After reading configuration header */ 1042 pci_fixup_header, /* After reading configuration header */
1015 pci_fixup_final, /* Final phase of device fixups */ 1043 pci_fixup_final, /* Final phase of device fixups */
1016 pci_fixup_enable, /* pci_enable_device() time */ 1044 pci_fixup_enable, /* pci_enable_device() time */
1017 pci_fixup_resume, /* pci_enable_device() time */ 1045 pci_fixup_resume, /* pci_device_resume() */
1046 pci_fixup_suspend, /* pci_device_suspend */
1047 pci_fixup_resume_early, /* pci_device_resume_early() */
1018}; 1048};
1019 1049
1020/* Anonymous variables would be nice... */ 1050/* Anonymous variables would be nice... */
@@ -1036,6 +1066,12 @@ enum pci_fixup_pass {
1036#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ 1066#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \
1037 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ 1067 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
1038 resume##vendor##device##hook, vendor, device, hook) 1068 resume##vendor##device##hook, vendor, device, hook)
1069#define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \
1070 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \
1071 resume_early##vendor##device##hook, vendor, device, hook)
1072#define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \
1073 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \
1074 suspend##vendor##device##hook, vendor, device, hook)
1039 1075
1040 1076
1041void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1077void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
@@ -1060,7 +1096,10 @@ extern int pci_pci_problems;
1060extern unsigned long pci_cardbus_io_size; 1096extern unsigned long pci_cardbus_io_size;
1061extern unsigned long pci_cardbus_mem_size; 1097extern unsigned long pci_cardbus_mem_size;
1062 1098
1063extern int pcibios_add_platform_entries(struct pci_dev *dev); 1099int pcibios_add_platform_entries(struct pci_dev *dev);
1100void pcibios_disable_device(struct pci_dev *dev);
1101int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1102 enum pcie_reset_state state);
1064 1103
1065#ifdef CONFIG_PCI_MMCONFIG 1104#ifdef CONFIG_PCI_MMCONFIG
1066extern void __init pci_mmcfg_early_init(void); 1105extern void __init pci_mmcfg_early_init(void);
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 8f67e8f2a3cc..a08cd06b541a 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -95,9 +95,6 @@ struct hotplug_slot_attribute {
95 * @get_adapter_status: Called to get see if an adapter is present in the slot or not. 95 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
96 * If this field is NULL, the value passed in the struct hotplug_slot_info 96 * If this field is NULL, the value passed in the struct hotplug_slot_info
97 * will be used when this value is requested by a user. 97 * will be used when this value is requested by a user.
98 * @get_address: Called to get pci address of a slot.
99 * If this field is NULL, the value passed in the struct hotplug_slot_info
100 * will be used when this value is requested by a user.
101 * @get_max_bus_speed: Called to get the max bus speed for a slot. 98 * @get_max_bus_speed: Called to get the max bus speed for a slot.
102 * If this field is NULL, the value passed in the struct hotplug_slot_info 99 * If this field is NULL, the value passed in the struct hotplug_slot_info
103 * will be used when this value is requested by a user. 100 * will be used when this value is requested by a user.
@@ -120,7 +117,6 @@ struct hotplug_slot_ops {
120 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); 117 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
121 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); 118 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
122 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); 119 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
123 int (*get_address) (struct hotplug_slot *slot, u32 *value);
124 int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); 120 int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
125 int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); 121 int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
126}; 122};
@@ -140,7 +136,6 @@ struct hotplug_slot_info {
140 u8 attention_status; 136 u8 attention_status;
141 u8 latch_status; 137 u8 latch_status;
142 u8 adapter_status; 138 u8 adapter_status;
143 u32 address;
144 enum pci_bus_speed max_bus_speed; 139 enum pci_bus_speed max_bus_speed;
145 enum pci_bus_speed cur_bus_speed; 140 enum pci_bus_speed cur_bus_speed;
146}; 141};
@@ -166,15 +161,14 @@ struct hotplug_slot {
166 161
167 /* Variables below this are for use only by the hotplug pci core. */ 162 /* Variables below this are for use only by the hotplug pci core. */
168 struct list_head slot_list; 163 struct list_head slot_list;
169 struct kobject kobj; 164 struct pci_slot *pci_slot;
170}; 165};
171#define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj) 166#define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj)
172 167
173extern int pci_hp_register (struct hotplug_slot *slot); 168extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr);
174extern int pci_hp_deregister (struct hotplug_slot *slot); 169extern int pci_hp_deregister(struct hotplug_slot *slot);
175extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 170extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
176 struct hotplug_slot_info *info); 171 struct hotplug_slot_info *info);
177extern struct kset *pci_hotplug_slots_kset;
178 172
179/* PCI Setting Record (Type 0) */ 173/* PCI Setting Record (Type 0) */
180struct hpp_type0 { 174struct hpp_type0 {
@@ -227,9 +221,9 @@ struct hotplug_params {
227#include <acpi/acpi.h> 221#include <acpi/acpi.h>
228#include <acpi/acpi_bus.h> 222#include <acpi/acpi_bus.h>
229#include <acpi/actypes.h> 223#include <acpi/actypes.h>
230extern acpi_status acpi_run_oshp(acpi_handle handle);
231extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, 224extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
232 struct hotplug_params *hpp); 225 struct hotplug_params *hpp);
226int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
233int acpi_root_bridge(acpi_handle handle); 227int acpi_root_bridge(acpi_handle handle);
234#endif 228#endif
235#endif 229#endif
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1cf4084b51e8..6be6a7943d8b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2190,6 +2190,7 @@
2190#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 2190#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
2191#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 2191#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
2192#define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 2192#define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381
2193#define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382
2193#define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 2194#define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383
2194 2195
2195#define PCI_VENDOR_ID_KORENIX 0x1982 2196#define PCI_VENDOR_ID_KORENIX 0x1982
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c0c1223c9194..19958b929905 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -231,6 +231,7 @@
231#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */ 231#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
232#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */ 232#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
233#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */ 233#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
234#define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */
234#define PCI_PM_CTRL 4 /* PM control and status register */ 235#define PCI_PM_CTRL 4 /* PM control and status register */
235#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ 236#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
236#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */ 237#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 3261681c82a4..95ac21ab3a09 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -53,6 +53,7 @@ struct platform_driver {
53 int (*suspend_late)(struct platform_device *, pm_message_t state); 53 int (*suspend_late)(struct platform_device *, pm_message_t state);
54 int (*resume_early)(struct platform_device *); 54 int (*resume_early)(struct platform_device *);
55 int (*resume)(struct platform_device *); 55 int (*resume)(struct platform_device *);
56 struct pm_ext_ops *pm;
56 struct device_driver driver; 57 struct device_driver driver;
57}; 58};
58 59
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 39a7ee859b67..4ad9de94449a 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -112,7 +112,9 @@ typedef struct pm_message {
112 int event; 112 int event;
113} pm_message_t; 113} pm_message_t;
114 114
115/* 115/**
116 * struct pm_ops - device PM callbacks
117 *
116 * Several driver power state transitions are externally visible, affecting 118 * Several driver power state transitions are externally visible, affecting
117 * the state of pending I/O queues and (for drivers that touch hardware) 119 * the state of pending I/O queues and (for drivers that touch hardware)
118 * interrupts, wakeups, DMA, and other hardware state. There may also be 120 * interrupts, wakeups, DMA, and other hardware state. There may also be
@@ -120,6 +122,284 @@ typedef struct pm_message {
120 * to the rest of the driver stack (such as a driver that's ON gating off 122 * to the rest of the driver stack (such as a driver that's ON gating off
121 * clocks which are not in active use). 123 * clocks which are not in active use).
122 * 124 *
125 * The externally visible transitions are handled with the help of the following
126 * callbacks included in this structure:
127 *
128 * @prepare: Prepare the device for the upcoming transition, but do NOT change
129 * its hardware state. Prevent new children of the device from being
130 * registered after @prepare() returns (the driver's subsystem and
131 * generally the rest of the kernel is supposed to prevent new calls to the
132 * probe method from being made too once @prepare() has succeeded). If
133 * @prepare() detects a situation it cannot handle (e.g. registration of a
134 * child already in progress), it may return -EAGAIN, so that the PM core
135 * can execute it once again (e.g. after the new child has been registered)
136 * to recover from the race condition. This method is executed for all
137 * kinds of suspend transitions and is followed by one of the suspend
138 * callbacks: @suspend(), @freeze(), or @poweroff().
139 * The PM core executes @prepare() for all devices before starting to
140 * execute suspend callbacks for any of them, so drivers may assume all of
141 * the other devices to be present and functional while @prepare() is being
142 * executed. In particular, it is safe to make GFP_KERNEL memory
143 * allocations from within @prepare(). However, drivers may NOT assume
144 * anything about the availability of the user space at that time and it
145 * is not correct to request firmware from within @prepare() (it's too
146 * late to do that). [To work around this limitation, drivers may
147 * register suspend and hibernation notifiers that are executed before the
148 * freezing of tasks.]
149 *
150 * @complete: Undo the changes made by @prepare(). This method is executed for
151 * all kinds of resume transitions, following one of the resume callbacks:
152 * @resume(), @thaw(), @restore(). Also called if the state transition
153 * fails before the driver's suspend callback (@suspend(), @freeze(),
154 * @poweroff()) can be executed (e.g. if the suspend callback fails for one
155 * of the other devices that the PM core has unsuccessfully attempted to
156 * suspend earlier).
157 * The PM core executes @complete() after it has executed the appropriate
158 * resume callback for all devices.
159 *
160 * @suspend: Executed before putting the system into a sleep state in which the
161 * contents of main memory are preserved. Quiesce the device, put it into
162 * a low power state appropriate for the upcoming system state (such as
163 * PCI_D3hot), and enable wakeup events as appropriate.
164 *
165 * @resume: Executed after waking the system up from a sleep state in which the
166 * contents of main memory were preserved. Put the device into the
167 * appropriate state, according to the information saved in memory by the
168 * preceding @suspend(). The driver starts working again, responding to
169 * hardware events and software requests. The hardware may have gone
170 * through a power-off reset, or it may have maintained state from the
171 * previous suspend() which the driver may rely on while resuming. On most
172 * platforms, there are no restrictions on availability of resources like
173 * clocks during @resume().
174 *
175 * @freeze: Hibernation-specific, executed before creating a hibernation image.
176 * Quiesce operations so that a consistent image can be created, but do NOT
177 * otherwise put the device into a low power device state and do NOT emit
178 * system wakeup events. Save in main memory the device settings to be
179 * used by @restore() during the subsequent resume from hibernation or by
180 * the subsequent @thaw(), if the creation of the image or the restoration
181 * of main memory contents from it fails.
182 *
183 * @thaw: Hibernation-specific, executed after creating a hibernation image OR
184 * if the creation of the image fails. Also executed after a failing
185 * attempt to restore the contents of main memory from such an image.
186 * Undo the changes made by the preceding @freeze(), so the device can be
187 * operated in the same way as immediately before the call to @freeze().
188 *
189 * @poweroff: Hibernation-specific, executed after saving a hibernation image.
190 * Quiesce the device, put it into a low power state appropriate for the
191 * upcoming system state (such as PCI_D3hot), and enable wakeup events as
192 * appropriate.
193 *
194 * @restore: Hibernation-specific, executed after restoring the contents of main
195 * memory from a hibernation image. Driver starts working again,
196 * responding to hardware events and software requests. Drivers may NOT
197 * make ANY assumptions about the hardware state right prior to @restore().
198 * On most platforms, there are no restrictions on availability of
199 * resources like clocks during @restore().
200 *
201 * All of the above callbacks, except for @complete(), return error codes.
202 * However, the error codes returned by the resume operations, @resume(),
203 * @thaw(), and @restore(), do not cause the PM core to abort the resume
204 * transition during which they are returned. The error codes returned in
205 * that cases are only printed by the PM core to the system logs for debugging
206 * purposes. Still, it is recommended that drivers only return error codes
207 * from their resume methods in case of an unrecoverable failure (i.e. when the
208 * device being handled refuses to resume and becomes unusable) to allow us to
209 * modify the PM core in the future, so that it can avoid attempting to handle
210 * devices that failed to resume and their children.
211 *
212 * It is allowed to unregister devices while the above callbacks are being
213 * executed. However, it is not allowed to unregister a device from within any
214 * of its own callbacks.
215 */
216
217struct pm_ops {
218 int (*prepare)(struct device *dev);
219 void (*complete)(struct device *dev);
220 int (*suspend)(struct device *dev);
221 int (*resume)(struct device *dev);
222 int (*freeze)(struct device *dev);
223 int (*thaw)(struct device *dev);
224 int (*poweroff)(struct device *dev);
225 int (*restore)(struct device *dev);
226};
227
228/**
229 * struct pm_ext_ops - extended device PM callbacks
230 *
231 * Some devices require certain operations related to suspend and hibernation
232 * to be carried out with interrupts disabled. Thus, 'struct pm_ext_ops' below
233 * is defined, adding callbacks to be executed with interrupts disabled to
234 * 'struct pm_ops'.
235 *
236 * The following callbacks included in 'struct pm_ext_ops' are executed with
237 * the nonboot CPUs switched off and with interrupts disabled on the only
238 * functional CPU. They also are executed with the PM core list of devices
239 * locked, so they must NOT unregister any devices.
240 *
241 * @suspend_noirq: Complete the operations of ->suspend() by carrying out any
242 * actions required for suspending the device that need interrupts to be
243 * disabled
244 *
245 * @resume_noirq: Prepare for the execution of ->resume() by carrying out any
246 * actions required for resuming the device that need interrupts to be
247 * disabled
248 *
249 * @freeze_noirq: Complete the operations of ->freeze() by carrying out any
250 * actions required for freezing the device that need interrupts to be
251 * disabled
252 *
253 * @thaw_noirq: Prepare for the execution of ->thaw() by carrying out any
254 * actions required for thawing the device that need interrupts to be
255 * disabled
256 *
257 * @poweroff_noirq: Complete the operations of ->poweroff() by carrying out any
258 * actions required for handling the device that need interrupts to be
259 * disabled
260 *
261 * @restore_noirq: Prepare for the execution of ->restore() by carrying out any
262 * actions required for restoring the operations of the device that need
263 * interrupts to be disabled
264 *
265 * All of the above callbacks return error codes, but the error codes returned
266 * by the resume operations, @resume_noirq(), @thaw_noirq(), and
267 * @restore_noirq(), do not cause the PM core to abort the resume transition
268 * during which they are returned. The error codes returned in that cases are
269 * only printed by the PM core to the system logs for debugging purposes.
270 * Still, as stated above, it is recommended that drivers only return error
271 * codes from their resume methods if the device being handled fails to resume
272 * and is not usable any more.
273 */
274
275struct pm_ext_ops {
276 struct pm_ops base;
277 int (*suspend_noirq)(struct device *dev);
278 int (*resume_noirq)(struct device *dev);
279 int (*freeze_noirq)(struct device *dev);
280 int (*thaw_noirq)(struct device *dev);
281 int (*poweroff_noirq)(struct device *dev);
282 int (*restore_noirq)(struct device *dev);
283};
284
285/**
286 * PM_EVENT_ messages
287 *
288 * The following PM_EVENT_ messages are defined for the internal use of the PM
289 * core, in order to provide a mechanism allowing the high level suspend and
290 * hibernation code to convey the necessary information to the device PM core
291 * code:
292 *
293 * ON No transition.
294 *
295 * FREEZE System is going to hibernate, call ->prepare() and ->freeze()
296 * for all devices.
297 *
298 * SUSPEND System is going to suspend, call ->prepare() and ->suspend()
299 * for all devices.
300 *
301 * HIBERNATE Hibernation image has been saved, call ->prepare() and
302 * ->poweroff() for all devices.
303 *
304 * QUIESCE Contents of main memory are going to be restored from a (loaded)
305 * hibernation image, call ->prepare() and ->freeze() for all
306 * devices.
307 *
308 * RESUME System is resuming, call ->resume() and ->complete() for all
309 * devices.
310 *
311 * THAW Hibernation image has been created, call ->thaw() and
312 * ->complete() for all devices.
313 *
314 * RESTORE Contents of main memory have been restored from a hibernation
315 * image, call ->restore() and ->complete() for all devices.
316 *
317 * RECOVER Creation of a hibernation image or restoration of the main
318 * memory contents from a hibernation image has failed, call
319 * ->thaw() and ->complete() for all devices.
320 */
321
322#define PM_EVENT_ON 0x0000
323#define PM_EVENT_FREEZE 0x0001
324#define PM_EVENT_SUSPEND 0x0002
325#define PM_EVENT_HIBERNATE 0x0004
326#define PM_EVENT_QUIESCE 0x0008
327#define PM_EVENT_RESUME 0x0010
328#define PM_EVENT_THAW 0x0020
329#define PM_EVENT_RESTORE 0x0040
330#define PM_EVENT_RECOVER 0x0080
331
332#define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE)
333
334#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
335#define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, })
336#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
337#define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, })
338#define PMSG_RESUME ((struct pm_message){ .event = PM_EVENT_RESUME, })
339#define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, })
340#define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, })
341#define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, })
342#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
343
344/**
345 * Device power management states
346 *
347 * These state labels are used internally by the PM core to indicate the current
348 * status of a device with respect to the PM core operations.
349 *
350 * DPM_ON Device is regarded as operational. Set this way
351 * initially and when ->complete() is about to be called.
352 * Also set when ->prepare() fails.
353 *
354 * DPM_PREPARING Device is going to be prepared for a PM transition. Set
355 * when ->prepare() is about to be called.
356 *
357 * DPM_RESUMING Device is going to be resumed. Set when ->resume(),
358 * ->thaw(), or ->restore() is about to be called.
359 *
360 * DPM_SUSPENDING Device has been prepared for a power transition. Set
361 * when ->prepare() has just succeeded.
362 *
363 * DPM_OFF Device is regarded as inactive. Set immediately after
364 * ->suspend(), ->freeze(), or ->poweroff() has succeeded.
365 * Also set when ->resume()_noirq, ->thaw_noirq(), or
366 * ->restore_noirq() is about to be called.
367 *
368 * DPM_OFF_IRQ Device is in a "deep sleep". Set immediately after
369 * ->suspend_noirq(), ->freeze_noirq(), or
370 * ->poweroff_noirq() has just succeeded.
371 */
372
373enum dpm_state {
374 DPM_INVALID,
375 DPM_ON,
376 DPM_PREPARING,
377 DPM_RESUMING,
378 DPM_SUSPENDING,
379 DPM_OFF,
380 DPM_OFF_IRQ,
381};
382
383struct dev_pm_info {
384 pm_message_t power_state;
385 unsigned can_wakeup:1;
386 unsigned should_wakeup:1;
387 enum dpm_state status; /* Owned by the PM core */
388#ifdef CONFIG_PM_SLEEP
389 struct list_head entry;
390#endif
391};
392
393/*
394 * The PM_EVENT_ messages are also used by drivers implementing the legacy
395 * suspend framework, based on the ->suspend() and ->resume() callbacks common
396 * for suspend and hibernation transitions, according to the rules below.
397 */
398
399/* Necessary, because several drivers use PM_EVENT_PRETHAW */
400#define PM_EVENT_PRETHAW PM_EVENT_QUIESCE
401
402/*
123 * One transition is triggered by resume(), after a suspend() call; the 403 * One transition is triggered by resume(), after a suspend() call; the
124 * message is implicit: 404 * message is implicit:
125 * 405 *
@@ -164,35 +444,13 @@ typedef struct pm_message {
164 * or from system low-power states such as standby or suspend-to-RAM. 444 * or from system low-power states such as standby or suspend-to-RAM.
165 */ 445 */
166 446
167#define PM_EVENT_ON 0 447#ifdef CONFIG_PM_SLEEP
168#define PM_EVENT_FREEZE 1 448extern void device_pm_lock(void);
169#define PM_EVENT_SUSPEND 2 449extern void device_power_up(pm_message_t state);
170#define PM_EVENT_HIBERNATE 4 450extern void device_resume(pm_message_t state);
171#define PM_EVENT_PRETHAW 8
172
173#define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE)
174
175#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
176#define PMSG_PRETHAW ((struct pm_message){ .event = PM_EVENT_PRETHAW, })
177#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
178#define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, })
179#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
180
181struct dev_pm_info {
182 pm_message_t power_state;
183 unsigned can_wakeup:1;
184 unsigned should_wakeup:1;
185 bool sleeping:1; /* Owned by the PM core */
186#ifdef CONFIG_PM_SLEEP
187 struct list_head entry;
188#endif
189};
190 451
452extern void device_pm_unlock(void);
191extern int device_power_down(pm_message_t state); 453extern int device_power_down(pm_message_t state);
192extern void device_power_up(void);
193extern void device_resume(void);
194
195#ifdef CONFIG_PM_SLEEP
196extern int device_suspend(pm_message_t state); 454extern int device_suspend(pm_message_t state);
197extern int device_prepare_suspend(pm_message_t state); 455extern int device_prepare_suspend(pm_message_t state);
198 456
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index f0d0b2cb8d20..0aae7776185e 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -35,6 +35,11 @@ static inline void device_init_wakeup(struct device *dev, int val)
35 dev->power.can_wakeup = dev->power.should_wakeup = !!val; 35 dev->power.can_wakeup = dev->power.should_wakeup = !!val;
36} 36}
37 37
38static inline void device_set_wakeup_capable(struct device *dev, int val)
39{
40 dev->power.can_wakeup = !!val;
41}
42
38static inline int device_can_wakeup(struct device *dev) 43static inline int device_can_wakeup(struct device *dev)
39{ 44{
40 return dev->power.can_wakeup; 45 return dev->power.can_wakeup;
@@ -47,21 +52,7 @@ static inline void device_set_wakeup_enable(struct device *dev, int val)
47 52
48static inline int device_may_wakeup(struct device *dev) 53static inline int device_may_wakeup(struct device *dev)
49{ 54{
50 return dev->power.can_wakeup & dev->power.should_wakeup; 55 return dev->power.can_wakeup && dev->power.should_wakeup;
51}
52
53/*
54 * Platform hook to activate device wakeup capability, if that's not already
55 * handled by enable_irq_wake() etc.
56 * Returns zero on success, else negative errno
57 */
58extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
59
60static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
61{
62 if (platform_enable_wakeup)
63 return (*platform_enable_wakeup)(dev, is_on);
64 return 0;
65} 56}
66 57
67#else /* !CONFIG_PM */ 58#else /* !CONFIG_PM */
@@ -72,6 +63,8 @@ static inline void device_init_wakeup(struct device *dev, int val)
72 dev->power.can_wakeup = !!val; 63 dev->power.can_wakeup = !!val;
73} 64}
74 65
66static inline void device_set_wakeup_capable(struct device *dev, int val) { }
67
75static inline int device_can_wakeup(struct device *dev) 68static inline int device_can_wakeup(struct device *dev)
76{ 69{
77 return dev->power.can_wakeup; 70 return dev->power.can_wakeup;
@@ -80,11 +73,6 @@ static inline int device_can_wakeup(struct device *dev)
80#define device_set_wakeup_enable(dev, val) do {} while (0) 73#define device_set_wakeup_enable(dev, val) do {} while (0)
81#define device_may_wakeup(dev) 0 74#define device_may_wakeup(dev) 0
82 75
83static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
84{
85 return 0;
86}
87
88#endif /* !CONFIG_PM */ 76#endif /* !CONFIG_PM */
89 77
90#endif /* _LINUX_PM_WAKEUP_H */ 78#endif /* _LINUX_PM_WAKEUP_H */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 63b128d512fb..1ce54b63085d 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * Linux Plug and Play Support 2 * Linux Plug and Play Support
3 * Copyright by Adam Belay <ambx1@neo.rr.com> 3 * Copyright by Adam Belay <ambx1@neo.rr.com>
4 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
5 * Bjorn Helgaas <bjorn.helgaas@hp.com>
4 */ 6 */
5 7
6#ifndef _LINUX_PNP_H 8#ifndef _LINUX_PNP_H
@@ -15,7 +17,6 @@
15 17
16struct pnp_protocol; 18struct pnp_protocol;
17struct pnp_dev; 19struct pnp_dev;
18struct pnp_resource_table;
19 20
20/* 21/*
21 * Resource Management 22 * Resource Management
@@ -24,7 +25,14 @@ struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);
24 25
25static inline int pnp_resource_valid(struct resource *res) 26static inline int pnp_resource_valid(struct resource *res)
26{ 27{
27 if (res && !(res->flags & IORESOURCE_UNSET)) 28 if (res)
29 return 1;
30 return 0;
31}
32
33static inline int pnp_resource_enabled(struct resource *res)
34{
35 if (res && !(res->flags & IORESOURCE_DISABLED))
28 return 1; 36 return 1;
29 return 0; 37 return 0;
30} 38}
@@ -40,19 +48,31 @@ static inline resource_size_t pnp_resource_len(struct resource *res)
40static inline resource_size_t pnp_port_start(struct pnp_dev *dev, 48static inline resource_size_t pnp_port_start(struct pnp_dev *dev,
41 unsigned int bar) 49 unsigned int bar)
42{ 50{
43 return pnp_get_resource(dev, IORESOURCE_IO, bar)->start; 51 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar);
52
53 if (pnp_resource_valid(res))
54 return res->start;
55 return 0;
44} 56}
45 57
46static inline resource_size_t pnp_port_end(struct pnp_dev *dev, 58static inline resource_size_t pnp_port_end(struct pnp_dev *dev,
47 unsigned int bar) 59 unsigned int bar)
48{ 60{
49 return pnp_get_resource(dev, IORESOURCE_IO, bar)->end; 61 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar);
62
63 if (pnp_resource_valid(res))
64 return res->end;
65 return 0;
50} 66}
51 67
52static inline unsigned long pnp_port_flags(struct pnp_dev *dev, 68static inline unsigned long pnp_port_flags(struct pnp_dev *dev,
53 unsigned int bar) 69 unsigned int bar)
54{ 70{
55 return pnp_get_resource(dev, IORESOURCE_IO, bar)->flags; 71 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar);
72
73 if (pnp_resource_valid(res))
74 return res->flags;
75 return IORESOURCE_IO | IORESOURCE_AUTO;
56} 76}
57 77
58static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar) 78static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar)
@@ -63,25 +83,41 @@ static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar)
63static inline resource_size_t pnp_port_len(struct pnp_dev *dev, 83static inline resource_size_t pnp_port_len(struct pnp_dev *dev,
64 unsigned int bar) 84 unsigned int bar)
65{ 85{
66 return pnp_resource_len(pnp_get_resource(dev, IORESOURCE_IO, bar)); 86 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar);
87
88 if (pnp_resource_valid(res))
89 return pnp_resource_len(res);
90 return 0;
67} 91}
68 92
69 93
70static inline resource_size_t pnp_mem_start(struct pnp_dev *dev, 94static inline resource_size_t pnp_mem_start(struct pnp_dev *dev,
71 unsigned int bar) 95 unsigned int bar)
72{ 96{
73 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->start; 97 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar);
98
99 if (pnp_resource_valid(res))
100 return res->start;
101 return 0;
74} 102}
75 103
76static inline resource_size_t pnp_mem_end(struct pnp_dev *dev, 104static inline resource_size_t pnp_mem_end(struct pnp_dev *dev,
77 unsigned int bar) 105 unsigned int bar)
78{ 106{
79 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->end; 107 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar);
108
109 if (pnp_resource_valid(res))
110 return res->end;
111 return 0;
80} 112}
81 113
82static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar) 114static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar)
83{ 115{
84 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->flags; 116 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar);
117
118 if (pnp_resource_valid(res))
119 return res->flags;
120 return IORESOURCE_MEM | IORESOURCE_AUTO;
85} 121}
86 122
87static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar) 123static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar)
@@ -92,18 +128,30 @@ static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar)
92static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, 128static inline resource_size_t pnp_mem_len(struct pnp_dev *dev,
93 unsigned int bar) 129 unsigned int bar)
94{ 130{
95 return pnp_resource_len(pnp_get_resource(dev, IORESOURCE_MEM, bar)); 131 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar);
132
133 if (pnp_resource_valid(res))
134 return pnp_resource_len(res);
135 return 0;
96} 136}
97 137
98 138
99static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) 139static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar)
100{ 140{
101 return pnp_get_resource(dev, IORESOURCE_IRQ, bar)->start; 141 struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar);
142
143 if (pnp_resource_valid(res))
144 return res->start;
145 return -1;
102} 146}
103 147
104static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar) 148static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar)
105{ 149{
106 return pnp_get_resource(dev, IORESOURCE_IRQ, bar)->flags; 150 struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar);
151
152 if (pnp_resource_valid(res))
153 return res->flags;
154 return IORESOURCE_IRQ | IORESOURCE_AUTO;
107} 155}
108 156
109static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar) 157static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar)
@@ -114,12 +162,20 @@ static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar)
114 162
115static inline resource_size_t pnp_dma(struct pnp_dev *dev, unsigned int bar) 163static inline resource_size_t pnp_dma(struct pnp_dev *dev, unsigned int bar)
116{ 164{
117 return pnp_get_resource(dev, IORESOURCE_DMA, bar)->start; 165 struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar);
166
167 if (pnp_resource_valid(res))
168 return res->start;
169 return -1;
118} 170}
119 171
120static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar) 172static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar)
121{ 173{
122 return pnp_get_resource(dev, IORESOURCE_DMA, bar)->flags; 174 struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar);
175
176 if (pnp_resource_valid(res))
177 return res->flags;
178 return IORESOURCE_DMA | IORESOURCE_AUTO;
123} 179}
124 180
125static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar) 181static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar)
@@ -128,57 +184,6 @@ static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar)
128} 184}
129 185
130 186
131#define PNP_PORT_FLAG_16BITADDR (1<<0)
132#define PNP_PORT_FLAG_FIXED (1<<1)
133
134struct pnp_port {
135 unsigned short min; /* min base number */
136 unsigned short max; /* max base number */
137 unsigned char align; /* align boundary */
138 unsigned char size; /* size of range */
139 unsigned char flags; /* port flags */
140 unsigned char pad; /* pad */
141 struct pnp_port *next; /* next port */
142};
143
144#define PNP_IRQ_NR 256
145struct pnp_irq {
146 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmask for IRQ lines */
147 unsigned char flags; /* IRQ flags */
148 unsigned char pad; /* pad */
149 struct pnp_irq *next; /* next IRQ */
150};
151
152struct pnp_dma {
153 unsigned char map; /* bitmask for DMA channels */
154 unsigned char flags; /* DMA flags */
155 struct pnp_dma *next; /* next port */
156};
157
158struct pnp_mem {
159 unsigned int min; /* min base number */
160 unsigned int max; /* max base number */
161 unsigned int align; /* align boundary */
162 unsigned int size; /* size of range */
163 unsigned char flags; /* memory flags */
164 unsigned char pad; /* pad */
165 struct pnp_mem *next; /* next memory resource */
166};
167
168#define PNP_RES_PRIORITY_PREFERRED 0
169#define PNP_RES_PRIORITY_ACCEPTABLE 1
170#define PNP_RES_PRIORITY_FUNCTIONAL 2
171#define PNP_RES_PRIORITY_INVALID 65535
172
173struct pnp_option {
174 unsigned short priority; /* priority */
175 struct pnp_port *port; /* first port */
176 struct pnp_irq *irq; /* first IRQ */
177 struct pnp_dma *dma; /* first DMA */
178 struct pnp_mem *mem; /* first memory resource */
179 struct pnp_option *next; /* used to chain dependent resources */
180};
181
182/* 187/*
183 * Device Management 188 * Device Management
184 */ 189 */
@@ -246,9 +251,9 @@ struct pnp_dev {
246 251
247 int active; 252 int active;
248 int capabilities; 253 int capabilities;
249 struct pnp_option *independent; 254 unsigned int num_dependent_sets;
250 struct pnp_option *dependent; 255 struct list_head resources;
251 struct pnp_resource_table *res; 256 struct list_head options;
252 257
253 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 258 char name[PNP_NAME_LEN]; /* contains a human-readable name */
254 int flags; /* used by protocols */ 259 int flags; /* used by protocols */
@@ -425,6 +430,8 @@ void pnp_unregister_card_driver(struct pnp_card_driver *drv);
425extern struct list_head pnp_cards; 430extern struct list_head pnp_cards;
426 431
427/* resource management */ 432/* resource management */
433int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t base,
434 resource_size_t size);
428int pnp_auto_config_dev(struct pnp_dev *dev); 435int pnp_auto_config_dev(struct pnp_dev *dev);
429int pnp_start_dev(struct pnp_dev *dev); 436int pnp_start_dev(struct pnp_dev *dev);
430int pnp_stop_dev(struct pnp_dev *dev); 437int pnp_stop_dev(struct pnp_dev *dev);
@@ -452,6 +459,9 @@ static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return
452static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { } 459static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
453 460
454/* resource management */ 461/* resource management */
462static inline int pnp_possible_config(struct pnp_dev *dev, int type,
463 resource_size_t base,
464 resource_size_t size) { return 0; }
455static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } 465static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
456static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } 466static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
457static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 467static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 21349173d148..1941d8b5cf11 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1062,12 +1062,6 @@ struct task_struct {
1062#endif 1062#endif
1063 1063
1064 struct list_head tasks; 1064 struct list_head tasks;
1065 /*
1066 * ptrace_list/ptrace_children forms the list of my children
1067 * that were stolen by a ptracer.
1068 */
1069 struct list_head ptrace_children;
1070 struct list_head ptrace_list;
1071 1065
1072 struct mm_struct *mm, *active_mm; 1066 struct mm_struct *mm, *active_mm;
1073 1067
@@ -1089,18 +1083,25 @@ struct task_struct {
1089 /* 1083 /*
1090 * pointers to (original) parent process, youngest child, younger sibling, 1084 * pointers to (original) parent process, youngest child, younger sibling,
1091 * older sibling, respectively. (p->father can be replaced with 1085 * older sibling, respectively. (p->father can be replaced with
1092 * p->parent->pid) 1086 * p->real_parent->pid)
1093 */ 1087 */
1094 struct task_struct *real_parent; /* real parent process (when being debugged) */ 1088 struct task_struct *real_parent; /* real parent process */
1095 struct task_struct *parent; /* parent process */ 1089 struct task_struct *parent; /* recipient of SIGCHLD, wait4() reports */
1096 /* 1090 /*
1097 * children/sibling forms the list of my children plus the 1091 * children/sibling forms the list of my natural children
1098 * tasks I'm ptracing.
1099 */ 1092 */
1100 struct list_head children; /* list of my children */ 1093 struct list_head children; /* list of my children */
1101 struct list_head sibling; /* linkage in my parent's children list */ 1094 struct list_head sibling; /* linkage in my parent's children list */
1102 struct task_struct *group_leader; /* threadgroup leader */ 1095 struct task_struct *group_leader; /* threadgroup leader */
1103 1096
1097 /*
1098 * ptraced is the list of tasks this task is using ptrace on.
1099 * This includes both natural children and PTRACE_ATTACH targets.
1100 * p->ptrace_entry is p's link on the p->parent->ptraced list.
1101 */
1102 struct list_head ptraced;
1103 struct list_head ptrace_entry;
1104
1104 /* PID/PID hash table linkage. */ 1105 /* PID/PID hash table linkage. */
1105 struct pid_link pids[PIDTYPE_MAX]; 1106 struct pid_link pids[PIDTYPE_MAX];
1106 struct list_head thread_group; 1107 struct list_head thread_group;
@@ -1494,6 +1495,7 @@ static inline void put_task_struct(struct task_struct *t)
1494#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 1495#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1495#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1496#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1496#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ 1497#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */
1498#define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */
1497 1499
1498/* 1500/*
1499 * Only the _current_ task can read/write to tsk->flags, but other 1501 * Only the _current_ task can read/write to tsk->flags, but other
@@ -1875,9 +1877,6 @@ extern void wait_task_inactive(struct task_struct * p);
1875#define wait_task_inactive(p) do { } while (0) 1877#define wait_task_inactive(p) do { } while (0)
1876#endif 1878#endif
1877 1879
1878#define remove_parent(p) list_del_init(&(p)->sibling)
1879#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)
1880
1881#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 1880#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
1882 1881
1883#define for_each_process(p) \ 1882#define for_each_process(p) \
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h
index d5ca78b93a3b..a3626aedaec9 100644
--- a/include/linux/spi/mmc_spi.h
+++ b/include/linux/spi/mmc_spi.h
@@ -23,6 +23,15 @@ struct mmc_spi_platform_data {
23 /* sense switch on sd cards */ 23 /* sense switch on sd cards */
24 int (*get_ro)(struct device *); 24 int (*get_ro)(struct device *);
25 25
26 /*
27 * If board does not use CD interrupts, driver can optimize polling
28 * using this function.
29 */
30 int (*get_cd)(struct device *);
31
32 /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
33 unsigned long caps;
34
26 /* how long to debounce card detect, in msecs */ 35 /* how long to debounce card detect, in msecs */
27 u16 detect_delay; 36 u16 detect_delay;
28 37
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 6fff7f82ef12..e5bfe01ee305 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -42,7 +42,8 @@ struct rpc_clnt {
42 42
43 unsigned int cl_softrtry : 1,/* soft timeouts */ 43 unsigned int cl_softrtry : 1,/* soft timeouts */
44 cl_discrtry : 1,/* disconnect before retry */ 44 cl_discrtry : 1,/* disconnect before retry */
45 cl_autobind : 1;/* use getport() */ 45 cl_autobind : 1,/* use getport() */
46 cl_chatty : 1;/* be verbose */
46 47
47 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 48 struct rpc_rtt * cl_rtt; /* RTO estimator data */
48 const struct rpc_timeout *cl_timeout; /* Timeout strategy */ 49 const struct rpc_timeout *cl_timeout; /* Timeout strategy */
@@ -114,6 +115,7 @@ struct rpc_create_args {
114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3) 115#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)
115#define RPC_CLNT_CREATE_NOPING (1UL << 4) 116#define RPC_CLNT_CREATE_NOPING (1UL << 4)
116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) 117#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
118#define RPC_CLNT_CREATE_QUIET (1UL << 6)
117 119
118struct rpc_clnt *rpc_create(struct rpc_create_args *args); 120struct rpc_clnt *rpc_create(struct rpc_create_args *args);
119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 121struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
@@ -123,6 +125,9 @@ void rpc_shutdown_client(struct rpc_clnt *);
123void rpc_release_client(struct rpc_clnt *); 125void rpc_release_client(struct rpc_clnt *);
124 126
125int rpcb_register(u32, u32, int, unsigned short, int *); 127int rpcb_register(u32, u32, int, unsigned short, int *);
128int rpcb_v4_register(const u32 program, const u32 version,
129 const struct sockaddr *address,
130 const char *netid, int *result);
126int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); 131int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int);
127void rpcb_getport_async(struct rpc_task *); 132void rpcb_getport_async(struct rpc_task *);
128 133
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index d1a5c8c1a0f1..64981a2f1cae 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -135,7 +135,6 @@ struct rpc_task_setup {
135#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 135#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
136#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) 136#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
137#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 137#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
138#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
139#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) 138#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
140 139
141#define RPC_TASK_RUNNING 0 140#define RPC_TASK_RUNNING 0
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index a6977423baf7..e8e69159af71 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -86,6 +86,11 @@ typedef int __bitwise suspend_state_t;
86 * that implement @begin(), but platforms implementing @begin() should 86 * that implement @begin(), but platforms implementing @begin() should
87 * also provide a @end() which cleans up transitions aborted before 87 * also provide a @end() which cleans up transitions aborted before
88 * @enter(). 88 * @enter().
89 *
90 * @recover: Recover the platform from a suspend failure.
91 * Called by the PM core if the suspending of devices fails.
92 * This callback is optional and should only be implemented by platforms
93 * which require special recovery actions in that situation.
89 */ 94 */
90struct platform_suspend_ops { 95struct platform_suspend_ops {
91 int (*valid)(suspend_state_t state); 96 int (*valid)(suspend_state_t state);
@@ -94,6 +99,7 @@ struct platform_suspend_ops {
94 int (*enter)(suspend_state_t state); 99 int (*enter)(suspend_state_t state);
95 void (*finish)(void); 100 void (*finish)(void);
96 void (*end)(void); 101 void (*end)(void);
102 void (*recover)(void);
97}; 103};
98 104
99#ifdef CONFIG_SUSPEND 105#ifdef CONFIG_SUSPEND
@@ -149,7 +155,7 @@ extern void mark_free_pages(struct zone *zone);
149 * The methods in this structure allow a platform to carry out special 155 * The methods in this structure allow a platform to carry out special
150 * operations required by it during a hibernation transition. 156 * operations required by it during a hibernation transition.
151 * 157 *
152 * All the methods below must be implemented. 158 * All the methods below, except for @recover(), must be implemented.
153 * 159 *
154 * @begin: Tell the platform driver that we're starting hibernation. 160 * @begin: Tell the platform driver that we're starting hibernation.
155 * Called right after shrinking memory and before freezing devices. 161 * Called right after shrinking memory and before freezing devices.
@@ -189,6 +195,11 @@ extern void mark_free_pages(struct zone *zone);
189 * @restore_cleanup: Clean up after a failing image restoration. 195 * @restore_cleanup: Clean up after a failing image restoration.
190 * Called right after the nonboot CPUs have been enabled and before 196 * Called right after the nonboot CPUs have been enabled and before
191 * thawing devices (runs with IRQs on). 197 * thawing devices (runs with IRQs on).
198 *
199 * @recover: Recover the platform from a failure to suspend devices.
200 * Called by the PM core if the suspending of devices during hibernation
201 * fails. This callback is optional and should only be implemented by
202 * platforms which require special recovery actions in that situation.
192 */ 203 */
193struct platform_hibernation_ops { 204struct platform_hibernation_ops {
194 int (*begin)(void); 205 int (*begin)(void);
@@ -200,6 +211,7 @@ struct platform_hibernation_ops {
200 void (*leave)(void); 211 void (*leave)(void);
201 int (*pre_restore)(void); 212 int (*pre_restore)(void);
202 void (*restore_cleanup)(void); 213 void (*restore_cleanup)(void);
214 void (*recover)(void);
203}; 215};
204 216
205#ifdef CONFIG_HIBERNATION 217#ifdef CONFIG_HIBERNATION