diff options
Diffstat (limited to 'include')
215 files changed, 5973 insertions, 1478 deletions
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 17714beb868e..5b6c391efc8e 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 9cf736ea4691..fc1575fd4596 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index bc4a6deb73b0..ef1cef77d32b 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index a091cabca4b1..de39915f6b7f 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 359ef11725a6..78ca429929f7 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -148,9 +148,7 @@ struct acpi_device_flags { | |||
148 | u32 suprise_removal_ok:1; | 148 | u32 suprise_removal_ok:1; |
149 | u32 power_manageable:1; | 149 | u32 power_manageable:1; |
150 | u32 performance_manageable:1; | 150 | u32 performance_manageable:1; |
151 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ | 151 | u32 reserved:24; |
152 | u32 force_power_state:1; | ||
153 | u32 reserved:22; | ||
154 | }; | 152 | }; |
155 | 153 | ||
156 | /* File System */ | 154 | /* File System */ |
@@ -242,20 +240,14 @@ struct acpi_device_perf { | |||
242 | struct acpi_device_wakeup_flags { | 240 | struct acpi_device_wakeup_flags { |
243 | u8 valid:1; /* Can successfully enable wakeup? */ | 241 | u8 valid:1; /* Can successfully enable wakeup? */ |
244 | u8 run_wake:1; /* Run-Wake GPE devices */ | 242 | u8 run_wake:1; /* Run-Wake GPE devices */ |
245 | u8 always_enabled:1; /* Run-wake devices that are always enabled */ | ||
246 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ | 243 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ |
247 | }; | 244 | }; |
248 | 245 | ||
249 | struct acpi_device_wakeup_state { | ||
250 | u8 enabled:1; | ||
251 | }; | ||
252 | |||
253 | struct acpi_device_wakeup { | 246 | struct acpi_device_wakeup { |
254 | acpi_handle gpe_device; | 247 | acpi_handle gpe_device; |
255 | u64 gpe_number; | 248 | u64 gpe_number; |
256 | u64 sleep_state; | 249 | u64 sleep_state; |
257 | struct acpi_handle_list resources; | 250 | struct acpi_handle_list resources; |
258 | struct acpi_device_wakeup_state state; | ||
259 | struct acpi_device_wakeup_flags flags; | 251 | struct acpi_device_wakeup_flags flags; |
260 | int prepare_count; | 252 | int prepare_count; |
261 | int run_wake_count; | 253 | int run_wake_count; |
@@ -328,8 +320,8 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); | |||
328 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 320 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
329 | unsigned long long *sta); | 321 | unsigned long long *sta); |
330 | int acpi_bus_get_status(struct acpi_device *device); | 322 | int acpi_bus_get_status(struct acpi_device *device); |
331 | int acpi_bus_get_power(acpi_handle handle, int *state); | ||
332 | int acpi_bus_set_power(acpi_handle handle, int state); | 323 | int acpi_bus_set_power(acpi_handle handle, int state); |
324 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | ||
333 | bool acpi_bus_power_manageable(acpi_handle handle); | 325 | bool acpi_bus_power_manageable(acpi_handle handle); |
334 | bool acpi_bus_can_wakeup(acpi_handle handle); | 326 | bool acpi_bus_can_wakeup(acpi_handle handle); |
335 | #ifdef CONFIG_ACPI_PROC_EVENT | 327 | #ifdef CONFIG_ACPI_PROC_EVENT |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 65b3f5888f42..a3252a5ead66 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -8,7 +8,7 @@ | |||
8 | *****************************************************************************/ | 8 | *****************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Copyright (C) 2000 - 2010, Intel Corp. | 11 | * Copyright (C) 2000 - 2011, Intel Corp. |
12 | * All rights reserved. | 12 | * All rights reserved. |
13 | * | 13 | * |
14 | * Redistribution and use in source and binary forms, with or without | 14 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 53b7cfd924a3..e46ec95a8ada 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -6,7 +6,7 @@ | |||
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * Copyright (C) 2000 - 2010, Intel Corp. | 9 | * Copyright (C) 2000 - 2011, Intel Corp. |
10 | * All rights reserved. | 10 | * All rights reserved. |
11 | * | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without |
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20101013 | 50 | #define ACPI_CA_VERSION 0x20110112 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
@@ -229,6 +229,10 @@ acpi_status | |||
229 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); | 229 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); |
230 | 230 | ||
231 | acpi_status | 231 | acpi_status |
232 | acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, | ||
233 | void *context); | ||
234 | |||
235 | acpi_status | ||
232 | acpi_install_fixed_event_handler(u32 acpi_event, | 236 | acpi_install_fixed_event_handler(u32 acpi_event, |
233 | acpi_event_handler handler, void *context); | 237 | acpi_event_handler handler, void *context); |
234 | 238 | ||
@@ -258,11 +262,11 @@ acpi_remove_address_space_handler(acpi_handle device, | |||
258 | acpi_status | 262 | acpi_status |
259 | acpi_install_gpe_handler(acpi_handle gpe_device, | 263 | acpi_install_gpe_handler(acpi_handle gpe_device, |
260 | u32 gpe_number, | 264 | u32 gpe_number, |
261 | u32 type, acpi_event_handler address, void *context); | 265 | u32 type, acpi_gpe_handler address, void *context); |
262 | 266 | ||
263 | acpi_status | 267 | acpi_status |
264 | acpi_remove_gpe_handler(acpi_handle gpe_device, | 268 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
265 | u32 gpe_number, acpi_event_handler address); | 269 | u32 gpe_number, acpi_gpe_handler address); |
266 | 270 | ||
267 | #ifdef ACPI_FUTURE_USAGE | 271 | #ifdef ACPI_FUTURE_USAGE |
268 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); | 272 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); |
@@ -292,11 +296,13 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); | |||
292 | 296 | ||
293 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); | 297 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); |
294 | 298 | ||
295 | acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number); | ||
296 | |||
297 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); | 299 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); |
298 | 300 | ||
299 | acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action); | 301 | acpi_status |
302 | acpi_setup_gpe_for_wake(acpi_handle parent_device, | ||
303 | acpi_handle gpe_device, u32 gpe_number); | ||
304 | |||
305 | acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); | ||
300 | 306 | ||
301 | acpi_status | 307 | acpi_status |
302 | acpi_get_gpe_status(acpi_handle gpe_device, | 308 | acpi_get_gpe_status(acpi_handle gpe_device, |
@@ -315,7 +321,7 @@ acpi_install_gpe_block(acpi_handle gpe_device, | |||
315 | 321 | ||
316 | acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); | 322 | acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); |
317 | 323 | ||
318 | acpi_status acpi_update_gpes(void); | 324 | acpi_status acpi_update_all_gpes(void); |
319 | 325 | ||
320 | /* | 326 | /* |
321 | * Resource interfaces | 327 | * Resource interfaces |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index e5526354ba5e..0a66cc45dd6b 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index ad2001683ba7..7e42bfee0e29 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index c637b75b9f3f..7504bc99b29b 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -119,7 +119,7 @@ struct acpi_whea_header { | |||
119 | struct acpi_table_bert { | 119 | struct acpi_table_bert { |
120 | struct acpi_table_header header; /* Common ACPI table header */ | 120 | struct acpi_table_header header; /* Common ACPI table header */ |
121 | u32 region_length; /* Length of the boot error region */ | 121 | u32 region_length; /* Length of the boot error region */ |
122 | u64 address; /* Physical addresss of the error region */ | 122 | u64 address; /* Physical address of the error region */ |
123 | }; | 123 | }; |
124 | 124 | ||
125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ | 125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index d4136b28011f..0fc15dfb2e22 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 2b134b691e34..64f838beaabf 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -656,33 +656,34 @@ typedef u32 acpi_event_status; | |||
656 | #define ACPI_GPE_MAX 0xFF | 656 | #define ACPI_GPE_MAX 0xFF |
657 | #define ACPI_NUM_GPE 256 | 657 | #define ACPI_NUM_GPE 256 |
658 | 658 | ||
659 | /* Actions for acpi_gpe_wakeup, acpi_hw_low_set_gpe */ | 659 | /* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */ |
660 | 660 | ||
661 | #define ACPI_GPE_ENABLE 0 | 661 | #define ACPI_GPE_ENABLE 0 |
662 | #define ACPI_GPE_DISABLE 1 | 662 | #define ACPI_GPE_DISABLE 1 |
663 | #define ACPI_GPE_COND_ENABLE 2 | 663 | #define ACPI_GPE_CONDITIONAL_ENABLE 2 |
664 | 664 | ||
665 | /* | 665 | /* |
666 | * GPE info flags - Per GPE | 666 | * GPE info flags - Per GPE |
667 | * +-------+---+-+-+ | 667 | * +-------+-+-+---+ |
668 | * | 7:4 |3:2|1|0| | 668 | * | 7:4 |3|2|1:0| |
669 | * +-------+---+-+-+ | 669 | * +-------+-+-+---+ |
670 | * | | | | | 670 | * | | | | |
671 | * | | | +--- Interrupt type: edge or level triggered | 671 | * | | | +-- Type of dispatch:to method, handler, notify, or none |
672 | * | | +----- GPE can wake the system | 672 | * | | +----- Interrupt type: edge or level triggered |
673 | * | +-------- Type of dispatch:to method, handler, or none | 673 | * | +------- Is a Wake GPE |
674 | * +-------------- <Reserved> | 674 | * +------------ <Reserved> |
675 | */ | 675 | */ |
676 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 | 676 | #define ACPI_GPE_DISPATCH_NONE (u8) 0x00 |
677 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 | 677 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x01 |
678 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | 678 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x02 |
679 | #define ACPI_GPE_DISPATCH_NOTIFY (u8) 0x03 | ||
680 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x03 | ||
679 | 681 | ||
680 | #define ACPI_GPE_CAN_WAKE (u8) 0x02 | 682 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x04 |
683 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | ||
684 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x04 | ||
681 | 685 | ||
682 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x0C | 686 | #define ACPI_GPE_CAN_WAKE (u8) 0x08 |
683 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x04 | ||
684 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x08 | ||
685 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 | ||
686 | 687 | ||
687 | /* | 688 | /* |
688 | * Flags for GPE and Lock interfaces | 689 | * Flags for GPE and Lock interfaces |
@@ -894,9 +895,20 @@ typedef void | |||
894 | /* | 895 | /* |
895 | * Various handlers and callback procedures | 896 | * Various handlers and callback procedures |
896 | */ | 897 | */ |
898 | typedef | ||
899 | void (*ACPI_GBL_EVENT_HANDLER) (u32 event_type, | ||
900 | acpi_handle device, | ||
901 | u32 event_number, void *context); | ||
902 | |||
903 | #define ACPI_EVENT_TYPE_GPE 0 | ||
904 | #define ACPI_EVENT_TYPE_FIXED 1 | ||
905 | |||
897 | typedef u32(*acpi_event_handler) (void *context); | 906 | typedef u32(*acpi_event_handler) (void *context); |
898 | 907 | ||
899 | typedef | 908 | typedef |
909 | u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context); | ||
910 | |||
911 | typedef | ||
900 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); | 912 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); |
901 | 913 | ||
902 | typedef | 914 | typedef |
@@ -951,6 +963,10 @@ u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); | |||
951 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 | 963 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 |
952 | #define ACPI_INTERRUPT_HANDLED 0x01 | 964 | #define ACPI_INTERRUPT_HANDLED 0x01 |
953 | 965 | ||
966 | /* GPE handler return values */ | ||
967 | |||
968 | #define ACPI_REENABLE_GPE 0x80 | ||
969 | |||
954 | /* Length of 32-bit EISAID values when converted back to a string */ | 970 | /* Length of 32-bit EISAID values when converted back to a string */ |
955 | 971 | ||
956 | #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ | 972 | #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ |
diff --git a/include/acpi/apei.h b/include/acpi/apei.h index b3365025ff8d..c4dbb132d902 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h | |||
@@ -19,6 +19,12 @@ | |||
19 | extern int hest_disable; | 19 | extern int hest_disable; |
20 | extern int erst_disable; | 20 | extern int erst_disable; |
21 | 21 | ||
22 | #ifdef CONFIG_ACPI_APEI | ||
23 | void __init acpi_hest_init(void); | ||
24 | #else | ||
25 | static inline void acpi_hest_init(void) { return; } | ||
26 | #endif | ||
27 | |||
22 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); | 28 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); |
23 | int apei_hest_parse(apei_hest_func_t func, void *data); | 29 | int apei_hest_parse(apei_hest_func_t func, void *data); |
24 | 30 | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index a3e334ab1119..5af3ed52ef98 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 5dcb9537343c..e228893591a9 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 572189e37133..5d2a5e9544d9 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 1b62102fbb67..55192ac0cede 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -324,6 +324,12 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | |||
324 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 324 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
325 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, | 325 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, |
326 | int state, bool force); | 326 | int state, bool force); |
327 | /* | ||
328 | * Reevaluate whether the T-state is invalid after one cpu is | ||
329 | * onlined/offlined. In such case the flags.throttling will be updated. | ||
330 | */ | ||
331 | extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr, | ||
332 | unsigned long action); | ||
327 | extern const struct file_operations acpi_processor_throttling_fops; | 333 | extern const struct file_operations acpi_processor_throttling_fops; |
328 | extern void acpi_processor_throttling_init(void); | 334 | extern void acpi_processor_throttling_init(void); |
329 | /* in processor_idle.c */ | 335 | /* in processor_idle.c */ |
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 3da9e2742fa0..787abbb6d867 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
@@ -45,6 +45,9 @@ | |||
45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | 45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ |
46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | 46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ |
47 | 47 | ||
48 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
49 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
50 | |||
48 | /* compatibility flags */ | 51 | /* compatibility flags */ |
49 | #define MAP_FILE 0 | 52 | #define MAP_FILE 0 |
50 | 53 | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 6f3c6ae4fe03..31b6188df221 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -5,67 +5,100 @@ | |||
5 | #ifdef CONFIG_MMU | 5 | #ifdef CONFIG_MMU |
6 | 6 | ||
7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
8 | /* | 8 | extern int ptep_set_access_flags(struct vm_area_struct *vma, |
9 | * Largely same as above, but only sets the access flags (dirty, | 9 | unsigned long address, pte_t *ptep, |
10 | * accessed, and writable). Furthermore, we know it always gets set | 10 | pte_t entry, int dirty); |
11 | * to a "more permissive" setting, which allows most architectures | 11 | #endif |
12 | * to optimize this. We return whether the PTE actually changed, which | 12 | |
13 | * in turn instructs the caller to do things like update__mmu_cache. | 13 | #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS |
14 | * This used to be done in the caller, but sparc needs minor faults to | 14 | extern int pmdp_set_access_flags(struct vm_area_struct *vma, |
15 | * force that call on sun4c so we changed this macro slightly | 15 | unsigned long address, pmd_t *pmdp, |
16 | */ | 16 | pmd_t entry, int dirty); |
17 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | ||
18 | ({ \ | ||
19 | int __changed = !pte_same(*(__ptep), __entry); \ | ||
20 | if (__changed) { \ | ||
21 | set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ | ||
22 | flush_tlb_page(__vma, __address); \ | ||
23 | } \ | ||
24 | __changed; \ | ||
25 | }) | ||
26 | #endif | 17 | #endif |
27 | 18 | ||
28 | #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 19 | #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
29 | #define ptep_test_and_clear_young(__vma, __address, __ptep) \ | 20 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, |
30 | ({ \ | 21 | unsigned long address, |
31 | pte_t __pte = *(__ptep); \ | 22 | pte_t *ptep) |
32 | int r = 1; \ | 23 | { |
33 | if (!pte_young(__pte)) \ | 24 | pte_t pte = *ptep; |
34 | r = 0; \ | 25 | int r = 1; |
35 | else \ | 26 | if (!pte_young(pte)) |
36 | set_pte_at((__vma)->vm_mm, (__address), \ | 27 | r = 0; |
37 | (__ptep), pte_mkold(__pte)); \ | 28 | else |
38 | r; \ | 29 | set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte)); |
39 | }) | 30 | return r; |
31 | } | ||
32 | #endif | ||
33 | |||
34 | #ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG | ||
35 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
36 | static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, | ||
37 | unsigned long address, | ||
38 | pmd_t *pmdp) | ||
39 | { | ||
40 | pmd_t pmd = *pmdp; | ||
41 | int r = 1; | ||
42 | if (!pmd_young(pmd)) | ||
43 | r = 0; | ||
44 | else | ||
45 | set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); | ||
46 | return r; | ||
47 | } | ||
48 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
49 | static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, | ||
50 | unsigned long address, | ||
51 | pmd_t *pmdp) | ||
52 | { | ||
53 | BUG(); | ||
54 | return 0; | ||
55 | } | ||
56 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
40 | #endif | 57 | #endif |
41 | 58 | ||
42 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | 59 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |
43 | #define ptep_clear_flush_young(__vma, __address, __ptep) \ | 60 | int ptep_clear_flush_young(struct vm_area_struct *vma, |
44 | ({ \ | 61 | unsigned long address, pte_t *ptep); |
45 | int __young; \ | 62 | #endif |
46 | __young = ptep_test_and_clear_young(__vma, __address, __ptep); \ | 63 | |
47 | if (__young) \ | 64 | #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH |
48 | flush_tlb_page(__vma, __address); \ | 65 | int pmdp_clear_flush_young(struct vm_area_struct *vma, |
49 | __young; \ | 66 | unsigned long address, pmd_t *pmdp); |
50 | }) | ||
51 | #endif | 67 | #endif |
52 | 68 | ||
53 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR | 69 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR |
54 | #define ptep_get_and_clear(__mm, __address, __ptep) \ | 70 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, |
55 | ({ \ | 71 | unsigned long address, |
56 | pte_t __pte = *(__ptep); \ | 72 | pte_t *ptep) |
57 | pte_clear((__mm), (__address), (__ptep)); \ | 73 | { |
58 | __pte; \ | 74 | pte_t pte = *ptep; |
75 | pte_clear(mm, address, ptep); | ||
76 | return pte; | ||
77 | } | ||
78 | #endif | ||
79 | |||
80 | #ifndef __HAVE_ARCH_PMDP_GET_AND_CLEAR | ||
81 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
82 | static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, | ||
83 | unsigned long address, | ||
84 | pmd_t *pmdp) | ||
85 | { | ||
86 | pmd_t pmd = *pmdp; | ||
87 | pmd_clear(mm, address, pmdp); | ||
88 | return pmd; | ||
59 | }) | 89 | }) |
90 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
60 | #endif | 91 | #endif |
61 | 92 | ||
62 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL | 93 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL |
63 | #define ptep_get_and_clear_full(__mm, __address, __ptep, __full) \ | 94 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, |
64 | ({ \ | 95 | unsigned long address, pte_t *ptep, |
65 | pte_t __pte; \ | 96 | int full) |
66 | __pte = ptep_get_and_clear((__mm), (__address), (__ptep)); \ | 97 | { |
67 | __pte; \ | 98 | pte_t pte; |
68 | }) | 99 | pte = ptep_get_and_clear(mm, address, ptep); |
100 | return pte; | ||
101 | } | ||
69 | #endif | 102 | #endif |
70 | 103 | ||
71 | /* | 104 | /* |
@@ -74,20 +107,25 @@ | |||
74 | * not present, or in the process of an address space destruction. | 107 | * not present, or in the process of an address space destruction. |
75 | */ | 108 | */ |
76 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL | 109 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL |
77 | #define pte_clear_not_present_full(__mm, __address, __ptep, __full) \ | 110 | static inline void pte_clear_not_present_full(struct mm_struct *mm, |
78 | do { \ | 111 | unsigned long address, |
79 | pte_clear((__mm), (__address), (__ptep)); \ | 112 | pte_t *ptep, |
80 | } while (0) | 113 | int full) |
114 | { | ||
115 | pte_clear(mm, address, ptep); | ||
116 | } | ||
81 | #endif | 117 | #endif |
82 | 118 | ||
83 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH | 119 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH |
84 | #define ptep_clear_flush(__vma, __address, __ptep) \ | 120 | extern pte_t ptep_clear_flush(struct vm_area_struct *vma, |
85 | ({ \ | 121 | unsigned long address, |
86 | pte_t __pte; \ | 122 | pte_t *ptep); |
87 | __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep); \ | 123 | #endif |
88 | flush_tlb_page(__vma, __address); \ | 124 | |
89 | __pte; \ | 125 | #ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH |
90 | }) | 126 | extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma, |
127 | unsigned long address, | ||
128 | pmd_t *pmdp); | ||
91 | #endif | 129 | #endif |
92 | 130 | ||
93 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT | 131 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT |
@@ -99,8 +137,49 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
99 | } | 137 | } |
100 | #endif | 138 | #endif |
101 | 139 | ||
140 | #ifndef __HAVE_ARCH_PMDP_SET_WRPROTECT | ||
141 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
142 | static inline void pmdp_set_wrprotect(struct mm_struct *mm, | ||
143 | unsigned long address, pmd_t *pmdp) | ||
144 | { | ||
145 | pmd_t old_pmd = *pmdp; | ||
146 | set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd)); | ||
147 | } | ||
148 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
149 | static inline void pmdp_set_wrprotect(struct mm_struct *mm, | ||
150 | unsigned long address, pmd_t *pmdp) | ||
151 | { | ||
152 | BUG(); | ||
153 | } | ||
154 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
155 | #endif | ||
156 | |||
157 | #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH | ||
158 | extern pmd_t pmdp_splitting_flush(struct vm_area_struct *vma, | ||
159 | unsigned long address, | ||
160 | pmd_t *pmdp); | ||
161 | #endif | ||
162 | |||
102 | #ifndef __HAVE_ARCH_PTE_SAME | 163 | #ifndef __HAVE_ARCH_PTE_SAME |
103 | #define pte_same(A,B) (pte_val(A) == pte_val(B)) | 164 | static inline int pte_same(pte_t pte_a, pte_t pte_b) |
165 | { | ||
166 | return pte_val(pte_a) == pte_val(pte_b); | ||
167 | } | ||
168 | #endif | ||
169 | |||
170 | #ifndef __HAVE_ARCH_PMD_SAME | ||
171 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
172 | static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | ||
173 | { | ||
174 | return pmd_val(pmd_a) == pmd_val(pmd_b); | ||
175 | } | ||
176 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
177 | static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | ||
178 | { | ||
179 | BUG(); | ||
180 | return 0; | ||
181 | } | ||
182 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
104 | #endif | 183 | #endif |
105 | 184 | ||
106 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY | 185 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY |
@@ -348,6 +427,24 @@ extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, | |||
348 | unsigned long size); | 427 | unsigned long size); |
349 | #endif | 428 | #endif |
350 | 429 | ||
430 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE | ||
431 | static inline int pmd_trans_huge(pmd_t pmd) | ||
432 | { | ||
433 | return 0; | ||
434 | } | ||
435 | static inline int pmd_trans_splitting(pmd_t pmd) | ||
436 | { | ||
437 | return 0; | ||
438 | } | ||
439 | #ifndef __HAVE_ARCH_PMD_WRITE | ||
440 | static inline int pmd_write(pmd_t pmd) | ||
441 | { | ||
442 | BUG(); | ||
443 | return 0; | ||
444 | } | ||
445 | #endif /* __HAVE_ARCH_PMD_WRITE */ | ||
446 | #endif | ||
447 | |||
351 | #endif /* !__ASSEMBLY__ */ | 448 | #endif /* !__ASSEMBLY__ */ |
352 | 449 | ||
353 | #endif /* _ASM_GENERIC_PGTABLE_H */ | 450 | #endif /* _ASM_GENERIC_PGTABLE_H */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 05cbad03c5ab..68649336c4ad 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -200,7 +200,8 @@ | |||
200 | 200 | ||
201 | #define READ_MOSTLY_DATA(align) \ | 201 | #define READ_MOSTLY_DATA(align) \ |
202 | . = ALIGN(align); \ | 202 | . = ALIGN(align); \ |
203 | *(.data..read_mostly) | 203 | *(.data..read_mostly) \ |
204 | . = ALIGN(align); | ||
204 | 205 | ||
205 | #define CACHELINE_ALIGNED_DATA(align) \ | 206 | #define CACHELINE_ALIGNED_DATA(align) \ |
206 | . = ALIGN(align); \ | 207 | . = ALIGN(align); \ |
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h new file mode 100644 index 000000000000..c5813c87de06 --- /dev/null +++ b/include/crypto/if_alg.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * if_alg: User-space algorithm interface | ||
3 | * | ||
4 | * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_IF_ALG_H | ||
14 | #define _CRYPTO_IF_ALG_H | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/completion.h> | ||
18 | #include <linux/if_alg.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <net/sock.h> | ||
21 | |||
22 | #define ALG_MAX_PAGES 16 | ||
23 | |||
24 | struct crypto_async_request; | ||
25 | |||
26 | struct alg_sock { | ||
27 | /* struct sock must be the first member of struct alg_sock */ | ||
28 | struct sock sk; | ||
29 | |||
30 | struct sock *parent; | ||
31 | |||
32 | const struct af_alg_type *type; | ||
33 | void *private; | ||
34 | }; | ||
35 | |||
36 | struct af_alg_completion { | ||
37 | struct completion completion; | ||
38 | int err; | ||
39 | }; | ||
40 | |||
41 | struct af_alg_control { | ||
42 | struct af_alg_iv *iv; | ||
43 | int op; | ||
44 | }; | ||
45 | |||
46 | struct af_alg_type { | ||
47 | void *(*bind)(const char *name, u32 type, u32 mask); | ||
48 | void (*release)(void *private); | ||
49 | int (*setkey)(void *private, const u8 *key, unsigned int keylen); | ||
50 | int (*accept)(void *private, struct sock *sk); | ||
51 | |||
52 | struct proto_ops *ops; | ||
53 | struct module *owner; | ||
54 | char name[14]; | ||
55 | }; | ||
56 | |||
57 | struct af_alg_sgl { | ||
58 | struct scatterlist sg[ALG_MAX_PAGES]; | ||
59 | struct page *pages[ALG_MAX_PAGES]; | ||
60 | }; | ||
61 | |||
62 | int af_alg_register_type(const struct af_alg_type *type); | ||
63 | int af_alg_unregister_type(const struct af_alg_type *type); | ||
64 | |||
65 | int af_alg_release(struct socket *sock); | ||
66 | int af_alg_accept(struct sock *sk, struct socket *newsock); | ||
67 | |||
68 | int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len, | ||
69 | int write); | ||
70 | void af_alg_free_sg(struct af_alg_sgl *sgl); | ||
71 | |||
72 | int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con); | ||
73 | |||
74 | int af_alg_wait_for_completion(int err, struct af_alg_completion *completion); | ||
75 | void af_alg_complete(struct crypto_async_request *req, int err); | ||
76 | |||
77 | static inline struct alg_sock *alg_sk(struct sock *sk) | ||
78 | { | ||
79 | return (struct alg_sock *)sk; | ||
80 | } | ||
81 | |||
82 | static inline void af_alg_release_parent(struct sock *sk) | ||
83 | { | ||
84 | sock_put(alg_sk(sk)->parent); | ||
85 | } | ||
86 | |||
87 | static inline void af_alg_init_completion(struct af_alg_completion *completion) | ||
88 | { | ||
89 | init_completion(&completion->completion); | ||
90 | } | ||
91 | |||
92 | #endif /* _CRYPTO_IF_ALG_H */ | ||
diff --git a/include/crypto/padlock.h b/include/crypto/padlock.h new file mode 100644 index 000000000000..d2cfa2ef49e8 --- /dev/null +++ b/include/crypto/padlock.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Driver for VIA PadLock | ||
3 | * | ||
4 | * Copyright (c) 2004 Michal Ludvig <michal@logix.cz> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_PADLOCK_H | ||
14 | #define _CRYPTO_PADLOCK_H | ||
15 | |||
16 | #define PADLOCK_ALIGNMENT 16 | ||
17 | |||
18 | #define PFX KBUILD_MODNAME ": " | ||
19 | |||
20 | #define PADLOCK_CRA_PRIORITY 300 | ||
21 | #define PADLOCK_COMPOSITE_PRIORITY 400 | ||
22 | |||
23 | #ifdef CONFIG_64BIT | ||
24 | #define STACK_ALIGN 16 | ||
25 | #else | ||
26 | #define STACK_ALIGN 4 | ||
27 | #endif | ||
28 | |||
29 | #endif /* _CRYPTO_PADLOCK_H */ | ||
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 833d208c25d6..4fd95a323beb 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -68,6 +68,21 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | |||
68 | return (++sg)->length ? sg : (void *)sg_page(sg); | 68 | return (++sg)->length ? sg : (void *)sg_page(sg); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | ||
72 | struct scatterlist *sg, | ||
73 | int chain, int num) | ||
74 | { | ||
75 | if (chain) { | ||
76 | head->length += sg->length; | ||
77 | sg = scatterwalk_sg_next(sg); | ||
78 | } | ||
79 | |||
80 | if (sg) | ||
81 | scatterwalk_sg_chain(head, num, sg); | ||
82 | else | ||
83 | sg_mark_end(head); | ||
84 | } | ||
85 | |||
71 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, | 86 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, |
72 | struct scatter_walk *walk_out) | 87 | struct scatter_walk *walk_out) |
73 | { | 88 | { |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index aac27bd56e89..f22e7fe4b6db 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -121,6 +121,9 @@ int drm_fb_helper_setcolreg(unsigned regno, | |||
121 | void drm_fb_helper_restore(void); | 121 | void drm_fb_helper_restore(void); |
122 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, | 122 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, |
123 | uint32_t fb_width, uint32_t fb_height); | 123 | uint32_t fb_width, uint32_t fb_height); |
124 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | ||
125 | uint32_t depth); | ||
126 | |||
124 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); | 127 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); |
125 | 128 | ||
126 | bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); | 129 | bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index d1580c17cab3..2296d8b1931f 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -158,6 +158,7 @@ header-y += icmpv6.h | |||
158 | header-y += if.h | 158 | header-y += if.h |
159 | header-y += if_addr.h | 159 | header-y += if_addr.h |
160 | header-y += if_addrlabel.h | 160 | header-y += if_addrlabel.h |
161 | header-y += if_alg.h | ||
161 | header-y += if_arcnet.h | 162 | header-y += if_arcnet.h |
162 | header-y += if_arp.h | 163 | header-y += if_arp.h |
163 | header-y += if_bonding.h | 164 | header-y += if_bonding.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 67c91b4418b0..a2e910e01293 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -306,9 +306,6 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
306 | u32 *mask, u32 req); | 306 | u32 *mask, u32 req); |
307 | extern void acpi_early_init(void); | 307 | extern void acpi_early_init(void); |
308 | 308 | ||
309 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
310 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
311 | |||
312 | #else /* !CONFIG_ACPI */ | 309 | #else /* !CONFIG_ACPI */ |
313 | 310 | ||
314 | #define acpi_disabled 1 | 311 | #define acpi_disabled 1 |
@@ -352,4 +349,14 @@ static inline int acpi_table_parse(char *id, | |||
352 | return -1; | 349 | return -1; |
353 | } | 350 | } |
354 | #endif /* !CONFIG_ACPI */ | 351 | #endif /* !CONFIG_ACPI */ |
352 | |||
353 | #ifdef CONFIG_ACPI_SLEEP | ||
354 | int suspend_nvs_register(unsigned long start, unsigned long size); | ||
355 | #else | ||
356 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
357 | { | ||
358 | return 0; | ||
359 | } | ||
360 | #endif | ||
361 | |||
355 | #endif /*_LINUX_ACPI_H*/ | 362 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h new file mode 100644 index 000000000000..7180013a4a3a --- /dev/null +++ b/include/linux/acpi_io.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _ACPI_IO_H_ | ||
2 | #define _ACPI_IO_H_ | ||
3 | |||
4 | #include <linux/io.h> | ||
5 | #include <acpi/acpi.h> | ||
6 | |||
7 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | ||
8 | acpi_size size) | ||
9 | { | ||
10 | return ioremap_cache(phys, size); | ||
11 | } | ||
12 | |||
13 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
14 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
15 | |||
16 | #endif | ||
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 521a0f8974ac..3111385b8ca7 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -12,7 +12,6 @@ | |||
12 | * | 12 | * |
13 | * Please credit ARM.com | 13 | * Please credit ARM.com |
14 | * Documentation: ARM DDI 0196D | 14 | * Documentation: ARM DDI 0196D |
15 | * | ||
16 | */ | 15 | */ |
17 | 16 | ||
18 | #ifndef AMBA_PL08X_H | 17 | #ifndef AMBA_PL08X_H |
@@ -22,6 +21,15 @@ | |||
22 | #include <linux/dmaengine.h> | 21 | #include <linux/dmaengine.h> |
23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
24 | 23 | ||
24 | struct pl08x_lli; | ||
25 | struct pl08x_driver_data; | ||
26 | |||
27 | /* Bitmasks for selecting AHB ports for DMA transfers */ | ||
28 | enum { | ||
29 | PL08X_AHB1 = (1 << 0), | ||
30 | PL08X_AHB2 = (1 << 1) | ||
31 | }; | ||
32 | |||
25 | /** | 33 | /** |
26 | * struct pl08x_channel_data - data structure to pass info between | 34 | * struct pl08x_channel_data - data structure to pass info between |
27 | * platform and PL08x driver regarding channel configuration | 35 | * platform and PL08x driver regarding channel configuration |
@@ -46,8 +54,10 @@ | |||
46 | * @circular_buffer: whether the buffer passed in is circular and | 54 | * @circular_buffer: whether the buffer passed in is circular and |
47 | * shall simply be looped round round (like a record baby round | 55 | * shall simply be looped round round (like a record baby round |
48 | * round round round) | 56 | * round round round) |
49 | * @single: the device connected to this channel will request single | 57 | * @single: the device connected to this channel will request single DMA |
50 | * DMA transfers, not bursts. (Bursts are default.) | 58 | * transfers, not bursts. (Bursts are default.) |
59 | * @periph_buses: the device connected to this channel is accessible via | ||
60 | * these buses (use PL08X_AHB1 | PL08X_AHB2). | ||
51 | */ | 61 | */ |
52 | struct pl08x_channel_data { | 62 | struct pl08x_channel_data { |
53 | char *bus_id; | 63 | char *bus_id; |
@@ -55,10 +65,10 @@ struct pl08x_channel_data { | |||
55 | int max_signal; | 65 | int max_signal; |
56 | u32 muxval; | 66 | u32 muxval; |
57 | u32 cctl; | 67 | u32 cctl; |
58 | u32 ccfg; | ||
59 | dma_addr_t addr; | 68 | dma_addr_t addr; |
60 | bool circular_buffer; | 69 | bool circular_buffer; |
61 | bool single; | 70 | bool single; |
71 | u8 periph_buses; | ||
62 | }; | 72 | }; |
63 | 73 | ||
64 | /** | 74 | /** |
@@ -67,24 +77,23 @@ struct pl08x_channel_data { | |||
67 | * @addr: current address | 77 | * @addr: current address |
68 | * @maxwidth: the maximum width of a transfer on this bus | 78 | * @maxwidth: the maximum width of a transfer on this bus |
69 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 | 79 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 |
70 | * @fill_bytes: bytes required to fill to the next bus memory | 80 | * @fill_bytes: bytes required to fill to the next bus memory boundary |
71 | * boundary | ||
72 | */ | 81 | */ |
73 | struct pl08x_bus_data { | 82 | struct pl08x_bus_data { |
74 | dma_addr_t addr; | 83 | dma_addr_t addr; |
75 | u8 maxwidth; | 84 | u8 maxwidth; |
76 | u8 buswidth; | 85 | u8 buswidth; |
77 | u32 fill_bytes; | 86 | size_t fill_bytes; |
78 | }; | 87 | }; |
79 | 88 | ||
80 | /** | 89 | /** |
81 | * struct pl08x_phy_chan - holder for the physical channels | 90 | * struct pl08x_phy_chan - holder for the physical channels |
82 | * @id: physical index to this channel | 91 | * @id: physical index to this channel |
83 | * @lock: a lock to use when altering an instance of this struct | 92 | * @lock: a lock to use when altering an instance of this struct |
84 | * @signal: the physical signal (aka channel) serving this | 93 | * @signal: the physical signal (aka channel) serving this physical channel |
85 | * physical channel right now | 94 | * right now |
86 | * @serving: the virtual channel currently being served by this | 95 | * @serving: the virtual channel currently being served by this physical |
87 | * physical channel | 96 | * channel |
88 | */ | 97 | */ |
89 | struct pl08x_phy_chan { | 98 | struct pl08x_phy_chan { |
90 | unsigned int id; | 99 | unsigned int id; |
@@ -92,11 +101,6 @@ struct pl08x_phy_chan { | |||
92 | spinlock_t lock; | 101 | spinlock_t lock; |
93 | int signal; | 102 | int signal; |
94 | struct pl08x_dma_chan *serving; | 103 | struct pl08x_dma_chan *serving; |
95 | u32 csrc; | ||
96 | u32 cdst; | ||
97 | u32 clli; | ||
98 | u32 cctl; | ||
99 | u32 ccfg; | ||
100 | }; | 104 | }; |
101 | 105 | ||
102 | /** | 106 | /** |
@@ -108,26 +112,23 @@ struct pl08x_txd { | |||
108 | struct dma_async_tx_descriptor tx; | 112 | struct dma_async_tx_descriptor tx; |
109 | struct list_head node; | 113 | struct list_head node; |
110 | enum dma_data_direction direction; | 114 | enum dma_data_direction direction; |
111 | struct pl08x_bus_data srcbus; | 115 | dma_addr_t src_addr; |
112 | struct pl08x_bus_data dstbus; | 116 | dma_addr_t dst_addr; |
113 | int len; | 117 | size_t len; |
114 | dma_addr_t llis_bus; | 118 | dma_addr_t llis_bus; |
115 | void *llis_va; | 119 | struct pl08x_lli *llis_va; |
116 | struct pl08x_channel_data *cd; | 120 | /* Default cctl value for LLIs */ |
117 | bool active; | 121 | u32 cctl; |
118 | /* | 122 | /* |
119 | * Settings to be put into the physical channel when we | 123 | * Settings to be put into the physical channel when we |
120 | * trigger this txd | 124 | * trigger this txd. Other registers are in llis_va[0]. |
121 | */ | 125 | */ |
122 | u32 csrc; | 126 | u32 ccfg; |
123 | u32 cdst; | ||
124 | u32 clli; | ||
125 | u32 cctl; | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | /** | 129 | /** |
129 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual | 130 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel |
130 | * channel states | 131 | * states |
131 | * @PL08X_CHAN_IDLE: the channel is idle | 132 | * @PL08X_CHAN_IDLE: the channel is idle |
132 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | 133 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport |
133 | * channel and is running a transfer on it | 134 | * channel and is running a transfer on it |
@@ -147,6 +148,8 @@ enum pl08x_dma_chan_state { | |||
147 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel | 148 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel |
148 | * @chan: wrappped abstract channel | 149 | * @chan: wrappped abstract channel |
149 | * @phychan: the physical channel utilized by this channel, if there is one | 150 | * @phychan: the physical channel utilized by this channel, if there is one |
151 | * @phychan_hold: if non-zero, hold on to the physical channel even if we | ||
152 | * have no pending entries | ||
150 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc | 153 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc |
151 | * @name: name of channel | 154 | * @name: name of channel |
152 | * @cd: channel platform data | 155 | * @cd: channel platform data |
@@ -154,53 +157,49 @@ enum pl08x_dma_chan_state { | |||
154 | * @runtime_direction: current direction of this channel according to | 157 | * @runtime_direction: current direction of this channel according to |
155 | * runtime config | 158 | * runtime config |
156 | * @lc: last completed transaction on this channel | 159 | * @lc: last completed transaction on this channel |
157 | * @desc_list: queued transactions pending on this channel | 160 | * @pend_list: queued transactions pending on this channel |
158 | * @at: active transaction on this channel | 161 | * @at: active transaction on this channel |
159 | * @lockflags: sometimes we let a lock last between two function calls, | ||
160 | * especially prep/submit, and then we need to store the IRQ flags | ||
161 | * in the channel state, here | ||
162 | * @lock: a lock for this channel data | 162 | * @lock: a lock for this channel data |
163 | * @host: a pointer to the host (internal use) | 163 | * @host: a pointer to the host (internal use) |
164 | * @state: whether the channel is idle, paused, running etc | 164 | * @state: whether the channel is idle, paused, running etc |
165 | * @slave: whether this channel is a device (slave) or for memcpy | 165 | * @slave: whether this channel is a device (slave) or for memcpy |
166 | * @waiting: a TX descriptor on this channel which is waiting for | 166 | * @waiting: a TX descriptor on this channel which is waiting for a physical |
167 | * a physical channel to become available | 167 | * channel to become available |
168 | */ | 168 | */ |
169 | struct pl08x_dma_chan { | 169 | struct pl08x_dma_chan { |
170 | struct dma_chan chan; | 170 | struct dma_chan chan; |
171 | struct pl08x_phy_chan *phychan; | 171 | struct pl08x_phy_chan *phychan; |
172 | int phychan_hold; | ||
172 | struct tasklet_struct tasklet; | 173 | struct tasklet_struct tasklet; |
173 | char *name; | 174 | char *name; |
174 | struct pl08x_channel_data *cd; | 175 | struct pl08x_channel_data *cd; |
175 | dma_addr_t runtime_addr; | 176 | dma_addr_t runtime_addr; |
176 | enum dma_data_direction runtime_direction; | 177 | enum dma_data_direction runtime_direction; |
177 | atomic_t last_issued; | ||
178 | dma_cookie_t lc; | 178 | dma_cookie_t lc; |
179 | struct list_head desc_list; | 179 | struct list_head pend_list; |
180 | struct pl08x_txd *at; | 180 | struct pl08x_txd *at; |
181 | unsigned long lockflags; | ||
182 | spinlock_t lock; | 181 | spinlock_t lock; |
183 | void *host; | 182 | struct pl08x_driver_data *host; |
184 | enum pl08x_dma_chan_state state; | 183 | enum pl08x_dma_chan_state state; |
185 | bool slave; | 184 | bool slave; |
186 | struct pl08x_txd *waiting; | 185 | struct pl08x_txd *waiting; |
187 | }; | 186 | }; |
188 | 187 | ||
189 | /** | 188 | /** |
190 | * struct pl08x_platform_data - the platform configuration for the | 189 | * struct pl08x_platform_data - the platform configuration for the PL08x |
191 | * PL08x PrimeCells. | 190 | * PrimeCells. |
192 | * @slave_channels: the channels defined for the different devices on the | 191 | * @slave_channels: the channels defined for the different devices on the |
193 | * platform, all inclusive, including multiplexed channels. The available | 192 | * platform, all inclusive, including multiplexed channels. The available |
194 | * physical channels will be multiplexed around these signals as they | 193 | * physical channels will be multiplexed around these signals as they are |
195 | * are requested, just enumerate all possible channels. | 194 | * requested, just enumerate all possible channels. |
196 | * @get_signal: request a physical signal to be used for a DMA | 195 | * @get_signal: request a physical signal to be used for a DMA transfer |
197 | * transfer immediately: if there is some multiplexing or similar blocking | 196 | * immediately: if there is some multiplexing or similar blocking the use |
198 | * the use of the channel the transfer can be denied by returning | 197 | * of the channel the transfer can be denied by returning less than zero, |
199 | * less than zero, else it returns the allocated signal number | 198 | * else it returns the allocated signal number |
200 | * @put_signal: indicate to the platform that this physical signal is not | 199 | * @put_signal: indicate to the platform that this physical signal is not |
201 | * running any DMA transfer and multiplexing can be recycled | 200 | * running any DMA transfer and multiplexing can be recycled |
202 | * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the | 201 | * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 |
203 | * LLI addresses are on 0/1 Master 1/2. | 202 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 |
204 | */ | 203 | */ |
205 | struct pl08x_platform_data { | 204 | struct pl08x_platform_data { |
206 | struct pl08x_channel_data *slave_channels; | 205 | struct pl08x_channel_data *slave_channels; |
@@ -208,6 +207,8 @@ struct pl08x_platform_data { | |||
208 | struct pl08x_channel_data memcpy_channel; | 207 | struct pl08x_channel_data memcpy_channel; |
209 | int (*get_signal)(struct pl08x_dma_chan *); | 208 | int (*get_signal)(struct pl08x_dma_chan *); |
210 | void (*put_signal)(struct pl08x_dma_chan *); | 209 | void (*put_signal)(struct pl08x_dma_chan *); |
210 | u8 lli_buses; | ||
211 | u8 mem_buses; | ||
211 | }; | 212 | }; |
212 | 213 | ||
213 | #ifdef CONFIG_AMBA_PL08X | 214 | #ifdef CONFIG_AMBA_PL08X |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 8b49ac48a5b7..e02982fa2953 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #define AUTOFS_MIN_PROTO_VERSION 3 | 24 | #define AUTOFS_MIN_PROTO_VERSION 3 |
25 | #define AUTOFS_MAX_PROTO_VERSION 5 | 25 | #define AUTOFS_MAX_PROTO_VERSION 5 |
26 | 26 | ||
27 | #define AUTOFS_PROTO_SUBVERSION 1 | 27 | #define AUTOFS_PROTO_SUBVERSION 2 |
28 | 28 | ||
29 | /* Mask for expire behaviour */ | 29 | /* Mask for expire behaviour */ |
30 | #define AUTOFS_EXP_IMMEDIATE 1 | 30 | #define AUTOFS_EXP_IMMEDIATE 1 |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 64a7114a9394..c3d6512eded1 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -25,7 +25,7 @@ struct pt_regs; | |||
25 | /* | 25 | /* |
26 | * This structure is used to hold the arguments that are used when loading binaries. | 26 | * This structure is used to hold the arguments that are used when loading binaries. |
27 | */ | 27 | */ |
28 | struct linux_binprm{ | 28 | struct linux_binprm { |
29 | char buf[BINPRM_BUF_SIZE]; | 29 | char buf[BINPRM_BUF_SIZE]; |
30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
31 | struct vm_area_struct *vma; | 31 | struct vm_area_struct *vma; |
@@ -93,7 +93,6 @@ struct linux_binfmt { | |||
93 | int (*load_shlib)(struct file *); | 93 | int (*load_shlib)(struct file *); |
94 | int (*core_dump)(struct coredump_params *cprm); | 94 | int (*core_dump)(struct coredump_params *cprm); |
95 | unsigned long min_coredump; /* minimal dump size */ | 95 | unsigned long min_coredump; /* minimal dump size */ |
96 | int hasvdso; | ||
97 | }; | 96 | }; |
98 | 97 | ||
99 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); | 98 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); |
@@ -113,7 +112,7 @@ extern void unregister_binfmt(struct linux_binfmt *); | |||
113 | 112 | ||
114 | extern int prepare_binprm(struct linux_binprm *); | 113 | extern int prepare_binprm(struct linux_binprm *); |
115 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 114 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
116 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 115 | extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); |
117 | extern int flush_old_exec(struct linux_binprm * bprm); | 116 | extern int flush_old_exec(struct linux_binprm * bprm); |
118 | extern void setup_new_exec(struct linux_binprm * bprm); | 117 | extern void setup_new_exec(struct linux_binprm * bprm); |
119 | 118 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 36ab42c9bb99..4d18ff34670a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -115,6 +115,7 @@ struct request { | |||
115 | void *elevator_private3; | 115 | void *elevator_private3; |
116 | 116 | ||
117 | struct gendisk *rq_disk; | 117 | struct gendisk *rq_disk; |
118 | struct hd_struct *part; | ||
118 | unsigned long start_time; | 119 | unsigned long start_time; |
119 | #ifdef CONFIG_BLK_CGROUP | 120 | #ifdef CONFIG_BLK_CGROUP |
120 | unsigned long long start_time_ns; | 121 | unsigned long long start_time_ns; |
@@ -646,7 +647,6 @@ static inline void rq_flush_dcache_pages(struct request *rq) | |||
646 | 647 | ||
647 | extern int blk_register_queue(struct gendisk *disk); | 648 | extern int blk_register_queue(struct gendisk *disk); |
648 | extern void blk_unregister_queue(struct gendisk *disk); | 649 | extern void blk_unregister_queue(struct gendisk *disk); |
649 | extern void register_disk(struct gendisk *dev); | ||
650 | extern void generic_make_request(struct bio *bio); | 650 | extern void generic_make_request(struct bio *bio); |
651 | extern void blk_rq_init(struct request_queue *q, struct request *rq); | 651 | extern void blk_rq_init(struct request_queue *q, struct request *rq); |
652 | extern void blk_put_request(struct request *); | 652 | extern void blk_put_request(struct request *); |
@@ -1256,6 +1256,9 @@ struct block_device_operations { | |||
1256 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1256 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1257 | int (*direct_access) (struct block_device *, sector_t, | 1257 | int (*direct_access) (struct block_device *, sector_t, |
1258 | void **, unsigned long *); | 1258 | void **, unsigned long *); |
1259 | unsigned int (*check_events) (struct gendisk *disk, | ||
1260 | unsigned int clearing); | ||
1261 | /* ->media_changed() is DEPRECATED, use ->check_events() instead */ | ||
1259 | int (*media_changed) (struct gendisk *); | 1262 | int (*media_changed) (struct gendisk *); |
1260 | void (*unlock_native_capacity) (struct gendisk *); | 1263 | void (*unlock_native_capacity) (struct gendisk *); |
1261 | int (*revalidate_disk) (struct gendisk *); | 1264 | int (*revalidate_disk) (struct gendisk *); |
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index f389e319a454..fb4591977b03 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -28,8 +28,6 @@ int cdev_add(struct cdev *, dev_t, unsigned); | |||
28 | 28 | ||
29 | void cdev_del(struct cdev *); | 29 | void cdev_del(struct cdev *); |
30 | 30 | ||
31 | int cdev_index(struct inode *inode); | ||
32 | |||
33 | void cd_forget(struct inode *); | 31 | void cd_forget(struct inode *); |
34 | 32 | ||
35 | extern struct backing_dev_info directly_mappable_cdev_bdi; | 33 | extern struct backing_dev_info directly_mappable_cdev_bdi; |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 78e904796622..35eae4b67503 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -946,6 +946,8 @@ struct cdrom_device_info { | |||
946 | /* device-related storage */ | 946 | /* device-related storage */ |
947 | unsigned int options : 30; /* options flags */ | 947 | unsigned int options : 30; /* options flags */ |
948 | unsigned mc_flags : 2; /* media change buffer flags */ | 948 | unsigned mc_flags : 2; /* media change buffer flags */ |
949 | unsigned int vfs_events; /* cached events for vfs path */ | ||
950 | unsigned int ioctl_events; /* cached events for ioctl path */ | ||
949 | int use_count; /* number of times device opened */ | 951 | int use_count; /* number of times device opened */ |
950 | char name[20]; /* name of the device type */ | 952 | char name[20]; /* name of the device type */ |
951 | /* per-device flags */ | 953 | /* per-device flags */ |
@@ -965,6 +967,8 @@ struct cdrom_device_ops { | |||
965 | int (*open) (struct cdrom_device_info *, int); | 967 | int (*open) (struct cdrom_device_info *, int); |
966 | void (*release) (struct cdrom_device_info *); | 968 | void (*release) (struct cdrom_device_info *); |
967 | int (*drive_status) (struct cdrom_device_info *, int); | 969 | int (*drive_status) (struct cdrom_device_info *, int); |
970 | unsigned int (*check_events) (struct cdrom_device_info *cdi, | ||
971 | unsigned int clearing, int slot); | ||
968 | int (*media_changed) (struct cdrom_device_info *, int); | 972 | int (*media_changed) (struct cdrom_device_info *, int); |
969 | int (*tray_move) (struct cdrom_device_info *, int); | 973 | int (*tray_move) (struct cdrom_device_info *, int); |
970 | int (*lock_door) (struct cdrom_device_info *, int); | 974 | int (*lock_door) (struct cdrom_device_info *, int); |
@@ -993,6 +997,8 @@ extern int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, | |||
993 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); | 997 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); |
994 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, | 998 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, |
995 | fmode_t mode, unsigned int cmd, unsigned long arg); | 999 | fmode_t mode, unsigned int cmd, unsigned long arg); |
1000 | extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi, | ||
1001 | unsigned int clearing); | ||
996 | extern int cdrom_media_changed(struct cdrom_device_info *); | 1002 | extern int cdrom_media_changed(struct cdrom_device_info *); |
997 | 1003 | ||
998 | extern int register_cdrom(struct cdrom_device_info *cdi); | 1004 | extern int register_cdrom(struct cdrom_device_info *cdi); |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index c3c74aef289d..09dcc0c2ffd5 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -43,6 +43,10 @@ | |||
43 | #define CEPH_FEATURE_NOSRCADDR (1<<1) | 43 | #define CEPH_FEATURE_NOSRCADDR (1<<1) |
44 | #define CEPH_FEATURE_MONCLOCKCHECK (1<<2) | 44 | #define CEPH_FEATURE_MONCLOCKCHECK (1<<2) |
45 | #define CEPH_FEATURE_FLOCK (1<<3) | 45 | #define CEPH_FEATURE_FLOCK (1<<3) |
46 | #define CEPH_FEATURE_SUBSCRIBE2 (1<<4) | ||
47 | #define CEPH_FEATURE_MONNAMES (1<<5) | ||
48 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) | ||
49 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) | ||
46 | 50 | ||
47 | 51 | ||
48 | /* | 52 | /* |
@@ -55,10 +59,10 @@ struct ceph_file_layout { | |||
55 | __le32 fl_stripe_count; /* over this many objects */ | 59 | __le32 fl_stripe_count; /* over this many objects */ |
56 | __le32 fl_object_size; /* until objects are this big, then move to | 60 | __le32 fl_object_size; /* until objects are this big, then move to |
57 | new objects */ | 61 | new objects */ |
58 | __le32 fl_cas_hash; /* 0 = none; 1 = sha256 */ | 62 | __le32 fl_cas_hash; /* UNUSED. 0 = none; 1 = sha256 */ |
59 | 63 | ||
60 | /* pg -> disk layout */ | 64 | /* pg -> disk layout */ |
61 | __le32 fl_object_stripe_unit; /* for per-object parity, if any */ | 65 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ |
62 | 66 | ||
63 | /* object -> pg layout */ | 67 | /* object -> pg layout */ |
64 | __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ | 68 | __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ |
@@ -69,6 +73,12 @@ struct ceph_file_layout { | |||
69 | 73 | ||
70 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); | 74 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); |
71 | 75 | ||
76 | struct ceph_dir_layout { | ||
77 | __u8 dl_dir_hash; /* see ceph_hash.h for ids */ | ||
78 | __u8 dl_unused1; | ||
79 | __u16 dl_unused2; | ||
80 | __u32 dl_unused3; | ||
81 | } __attribute__ ((packed)); | ||
72 | 82 | ||
73 | /* crypto algorithms */ | 83 | /* crypto algorithms */ |
74 | #define CEPH_CRYPTO_NONE 0x0 | 84 | #define CEPH_CRYPTO_NONE 0x0 |
@@ -457,7 +467,7 @@ struct ceph_mds_reply_inode { | |||
457 | struct ceph_timespec rctime; | 467 | struct ceph_timespec rctime; |
458 | struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */ | 468 | struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */ |
459 | } __attribute__ ((packed)); | 469 | } __attribute__ ((packed)); |
460 | /* followed by frag array, then symlink string, then xattr blob */ | 470 | /* followed by frag array, symlink string, dir layout, xattr blob */ |
461 | 471 | ||
462 | /* reply_lease follows dname, and reply_inode */ | 472 | /* reply_lease follows dname, and reply_inode */ |
463 | struct ceph_mds_reply_lease { | 473 | struct ceph_mds_reply_lease { |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index a108b425fee2..c3011beac30d 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -110,17 +110,12 @@ struct ceph_msg_pos { | |||
110 | 110 | ||
111 | /* | 111 | /* |
112 | * ceph_connection state bit flags | 112 | * ceph_connection state bit flags |
113 | * | ||
114 | * QUEUED and BUSY are used together to ensure that only a single | ||
115 | * thread is currently opening, reading or writing data to the socket. | ||
116 | */ | 113 | */ |
117 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ | 114 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ |
118 | #define CONNECTING 1 | 115 | #define CONNECTING 1 |
119 | #define NEGOTIATING 2 | 116 | #define NEGOTIATING 2 |
120 | #define KEEPALIVE_PENDING 3 | 117 | #define KEEPALIVE_PENDING 3 |
121 | #define WRITE_PENDING 4 /* we have data ready to send */ | 118 | #define WRITE_PENDING 4 /* we have data ready to send */ |
122 | #define QUEUED 5 /* there is work queued on this connection */ | ||
123 | #define BUSY 6 /* work is being done */ | ||
124 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep | 119 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep |
125 | * the ceph_connection around to maintain shared | 120 | * the ceph_connection around to maintain shared |
126 | * state with the peer. */ | 121 | * state with the peer. */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed4ba111bc8d..ce104e33cd22 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -564,7 +564,7 @@ struct cgroup_iter { | |||
564 | /* | 564 | /* |
565 | * To iterate across the tasks in a cgroup: | 565 | * To iterate across the tasks in a cgroup: |
566 | * | 566 | * |
567 | * 1) call cgroup_iter_start to intialize an iterator | 567 | * 1) call cgroup_iter_start to initialize an iterator |
568 | * | 568 | * |
569 | * 2) call cgroup_iter_next() to retrieve member tasks until it | 569 | * 2) call cgroup_iter_next() to retrieve member tasks until it |
570 | * returns NULL or until you want to end the iteration | 570 | * returns NULL or until you want to end the iteration |
diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h deleted file mode 100644 index c910b5eb1ceb..000000000000 --- a/include/linux/coda_cache.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* Coda filesystem -- Linux Minicache | ||
2 | * | ||
3 | * Copyright (C) 1989 - 1997 Carnegie Mellon University | ||
4 | * | ||
5 | * Carnegie Mellon University encourages users of this software to | ||
6 | * contribute improvements to the Coda project. Contact Peter Braam | ||
7 | * <coda@cs.cmu.edu> | ||
8 | */ | ||
9 | |||
10 | #ifndef _CFSNC_HEADER_ | ||
11 | #define _CFSNC_HEADER_ | ||
12 | |||
13 | /* credential cache */ | ||
14 | void coda_cache_enter(struct inode *inode, int mask); | ||
15 | void coda_cache_clear_inode(struct inode *); | ||
16 | void coda_cache_clear_all(struct super_block *sb); | ||
17 | int coda_cache_check(struct inode *inode, int mask); | ||
18 | |||
19 | /* for downcalls and attributes and lookups */ | ||
20 | void coda_flag_inode_children(struct inode *inode, int flag); | ||
21 | |||
22 | #endif /* _CFSNC_HEADER_ */ | ||
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h deleted file mode 100644 index e35071b1de0e..000000000000 --- a/include/linux/coda_fs_i.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * coda_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1998 Carnegie Mellon University | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_CODA_FS_I | ||
9 | #define _LINUX_CODA_FS_I | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/list.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/coda.h> | ||
15 | |||
16 | /* | ||
17 | * coda fs inode data | ||
18 | * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and | ||
19 | * c_cached_perm. | ||
20 | * vfs_inode is set only when the inode is created and never changes. | ||
21 | * c_fid is set when the inode is created and should be considered immutable. | ||
22 | */ | ||
23 | struct coda_inode_info { | ||
24 | struct CodaFid c_fid; /* Coda identifier */ | ||
25 | u_short c_flags; /* flags (see below) */ | ||
26 | unsigned int c_mapcount; /* nr of times this inode is mapped */ | ||
27 | unsigned int c_cached_epoch; /* epoch for cached permissions */ | ||
28 | vuid_t c_uid; /* fsuid for cached permissions */ | ||
29 | unsigned int c_cached_perm; /* cached access permissions */ | ||
30 | spinlock_t c_lock; | ||
31 | struct inode vfs_inode; | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * coda fs file private data | ||
36 | */ | ||
37 | #define CODA_MAGIC 0xC0DAC0DA | ||
38 | struct coda_file_info { | ||
39 | int cfi_magic; /* magic number */ | ||
40 | struct file *cfi_container; /* container file for this cnode */ | ||
41 | unsigned int cfi_mapcount; /* nr of times this file is mapped */ | ||
42 | }; | ||
43 | |||
44 | #define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data)) | ||
45 | |||
46 | /* flags */ | ||
47 | #define C_VATTR 0x1 /* Validity of vattr in inode */ | ||
48 | #define C_FLUSH 0x2 /* used after a flush */ | ||
49 | #define C_DYING 0x4 /* from venus (which died) */ | ||
50 | #define C_PURGE 0x8 | ||
51 | |||
52 | int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *); | ||
53 | struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr); | ||
54 | int coda_cnode_makectl(struct inode **inode, struct super_block *sb); | ||
55 | struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb); | ||
56 | void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *); | ||
57 | |||
58 | #endif | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h deleted file mode 100644 index 4ccc59c1ea82..000000000000 --- a/include/linux/coda_linux.h +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * Coda File System, Linux Kernel module | ||
3 | * | ||
4 | * Original version, adapted from cfs_mach.c, (C) Carnegie Mellon University | ||
5 | * Linux modifications (C) 1996, Peter J. Braam | ||
6 | * Rewritten for Linux 2.1 (C) 1997 Carnegie Mellon University | ||
7 | * | ||
8 | * Carnegie Mellon University encourages users of this software to | ||
9 | * contribute improvements to the Coda project. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_CODA_FS | ||
13 | #define _LINUX_CODA_FS | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/param.h> | ||
17 | #include <linux/mm.h> | ||
18 | #include <linux/vmalloc.h> | ||
19 | #include <linux/slab.h> | ||
20 | #include <linux/wait.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/fs.h> | ||
23 | #include <linux/coda_fs_i.h> | ||
24 | |||
25 | /* operations */ | ||
26 | extern const struct inode_operations coda_dir_inode_operations; | ||
27 | extern const struct inode_operations coda_file_inode_operations; | ||
28 | extern const struct inode_operations coda_ioctl_inode_operations; | ||
29 | |||
30 | extern const struct address_space_operations coda_file_aops; | ||
31 | extern const struct address_space_operations coda_symlink_aops; | ||
32 | |||
33 | extern const struct file_operations coda_dir_operations; | ||
34 | extern const struct file_operations coda_file_operations; | ||
35 | extern const struct file_operations coda_ioctl_operations; | ||
36 | |||
37 | /* operations shared over more than one file */ | ||
38 | int coda_open(struct inode *i, struct file *f); | ||
39 | int coda_release(struct inode *i, struct file *f); | ||
40 | int coda_permission(struct inode *inode, int mask, unsigned int flags); | ||
41 | int coda_revalidate_inode(struct dentry *); | ||
42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | ||
43 | int coda_setattr(struct dentry *, struct iattr *); | ||
44 | |||
45 | /* this file: heloers */ | ||
46 | char *coda_f2s(struct CodaFid *f); | ||
47 | int coda_isroot(struct inode *i); | ||
48 | int coda_iscontrol(const char *name, size_t length); | ||
49 | |||
50 | void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); | ||
51 | void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); | ||
52 | unsigned short coda_flags_to_cflags(unsigned short); | ||
53 | |||
54 | /* sysctl.h */ | ||
55 | void coda_sysctl_init(void); | ||
56 | void coda_sysctl_clean(void); | ||
57 | |||
58 | #define CODA_ALLOC(ptr, cast, size) do { \ | ||
59 | if (size < PAGE_SIZE) \ | ||
60 | ptr = kmalloc((unsigned long) size, GFP_KERNEL); \ | ||
61 | else \ | ||
62 | ptr = (cast)vmalloc((unsigned long) size); \ | ||
63 | if (!ptr) \ | ||
64 | printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ | ||
65 | else memset( ptr, 0, size ); \ | ||
66 | } while (0) | ||
67 | |||
68 | |||
69 | #define CODA_FREE(ptr,size) \ | ||
70 | do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0) | ||
71 | |||
72 | /* inode to cnode access functions */ | ||
73 | |||
74 | static inline struct coda_inode_info *ITOC(struct inode *inode) | ||
75 | { | ||
76 | return list_entry(inode, struct coda_inode_info, vfs_inode); | ||
77 | } | ||
78 | |||
79 | static __inline__ struct CodaFid *coda_i2f(struct inode *inode) | ||
80 | { | ||
81 | return &(ITOC(inode)->c_fid); | ||
82 | } | ||
83 | |||
84 | static __inline__ char *coda_i2s(struct inode *inode) | ||
85 | { | ||
86 | return coda_f2s(&(ITOC(inode)->c_fid)); | ||
87 | } | ||
88 | |||
89 | /* this will not zap the inode away */ | ||
90 | static __inline__ void coda_flag_inode(struct inode *inode, int flag) | ||
91 | { | ||
92 | struct coda_inode_info *cii = ITOC(inode); | ||
93 | |||
94 | spin_lock(&cii->c_lock); | ||
95 | cii->c_flags |= flag; | ||
96 | spin_unlock(&cii->c_lock); | ||
97 | } | ||
98 | |||
99 | #endif | ||
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 5ac51552d908..dfa2ed4c0d26 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -11,6 +11,9 @@ | |||
11 | /* The full zone was compacted */ | 11 | /* The full zone was compacted */ |
12 | #define COMPACT_COMPLETE 3 | 12 | #define COMPACT_COMPLETE 3 |
13 | 13 | ||
14 | #define COMPACT_MODE_DIRECT_RECLAIM 0 | ||
15 | #define COMPACT_MODE_KSWAPD 1 | ||
16 | |||
14 | #ifdef CONFIG_COMPACTION | 17 | #ifdef CONFIG_COMPACTION |
15 | extern int sysctl_compact_memory; | 18 | extern int sysctl_compact_memory; |
16 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 19 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
@@ -21,7 +24,12 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
21 | 24 | ||
22 | extern int fragmentation_index(struct zone *zone, unsigned int order); | 25 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 26 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
24 | int order, gfp_t gfp_mask, nodemask_t *mask); | 27 | int order, gfp_t gfp_mask, nodemask_t *mask, |
28 | bool sync); | ||
29 | extern unsigned long compaction_suitable(struct zone *zone, int order); | ||
30 | extern unsigned long compact_zone_order(struct zone *zone, int order, | ||
31 | gfp_t gfp_mask, bool sync, | ||
32 | int compact_mode); | ||
25 | 33 | ||
26 | /* Do not skip compaction more than 64 times */ | 34 | /* Do not skip compaction more than 64 times */ |
27 | #define COMPACT_MAX_DEFER_SHIFT 6 | 35 | #define COMPACT_MAX_DEFER_SHIFT 6 |
@@ -54,7 +62,20 @@ static inline bool compaction_deferred(struct zone *zone) | |||
54 | 62 | ||
55 | #else | 63 | #else |
56 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 64 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, |
57 | int order, gfp_t gfp_mask, nodemask_t *nodemask) | 65 | int order, gfp_t gfp_mask, nodemask_t *nodemask, |
66 | bool sync) | ||
67 | { | ||
68 | return COMPACT_CONTINUE; | ||
69 | } | ||
70 | |||
71 | static inline unsigned long compaction_suitable(struct zone *zone, int order) | ||
72 | { | ||
73 | return COMPACT_SKIPPED; | ||
74 | } | ||
75 | |||
76 | static inline unsigned long compact_zone_order(struct zone *zone, int order, | ||
77 | gfp_t gfp_mask, bool sync, | ||
78 | int compact_mode) | ||
58 | { | 79 | { |
59 | return COMPACT_CONTINUE; | 80 | return COMPACT_CONTINUE; |
60 | } | 81 | } |
diff --git a/include/linux/cper.h b/include/linux/cper.h index bf972f81e2a7..3104aaff5dd0 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -39,10 +39,12 @@ | |||
39 | * Severity difinition for error_severity in struct cper_record_header | 39 | * Severity difinition for error_severity in struct cper_record_header |
40 | * and section_severity in struct cper_section_descriptor | 40 | * and section_severity in struct cper_section_descriptor |
41 | */ | 41 | */ |
42 | #define CPER_SEV_RECOVERABLE 0x0 | 42 | enum { |
43 | #define CPER_SEV_FATAL 0x1 | 43 | CPER_SEV_RECOVERABLE, |
44 | #define CPER_SEV_CORRECTED 0x2 | 44 | CPER_SEV_FATAL, |
45 | #define CPER_SEV_INFORMATIONAL 0x3 | 45 | CPER_SEV_CORRECTED, |
46 | CPER_SEV_INFORMATIONAL, | ||
47 | }; | ||
46 | 48 | ||
47 | /* | 49 | /* |
48 | * Validation bits difinition for validation_bits in struct | 50 | * Validation bits difinition for validation_bits in struct |
@@ -201,6 +203,47 @@ | |||
201 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ | 203 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ |
202 | 0xDF, 0xAA, 0x84, 0xEC) | 204 | 0xDF, 0xAA, 0x84, 0xEC) |
203 | 205 | ||
206 | #define CPER_PROC_VALID_TYPE 0x0001 | ||
207 | #define CPER_PROC_VALID_ISA 0x0002 | ||
208 | #define CPER_PROC_VALID_ERROR_TYPE 0x0004 | ||
209 | #define CPER_PROC_VALID_OPERATION 0x0008 | ||
210 | #define CPER_PROC_VALID_FLAGS 0x0010 | ||
211 | #define CPER_PROC_VALID_LEVEL 0x0020 | ||
212 | #define CPER_PROC_VALID_VERSION 0x0040 | ||
213 | #define CPER_PROC_VALID_BRAND_INFO 0x0080 | ||
214 | #define CPER_PROC_VALID_ID 0x0100 | ||
215 | #define CPER_PROC_VALID_TARGET_ADDRESS 0x0200 | ||
216 | #define CPER_PROC_VALID_REQUESTOR_ID 0x0400 | ||
217 | #define CPER_PROC_VALID_RESPONDER_ID 0x0800 | ||
218 | #define CPER_PROC_VALID_IP 0x1000 | ||
219 | |||
220 | #define CPER_MEM_VALID_ERROR_STATUS 0x0001 | ||
221 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002 | ||
222 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004 | ||
223 | #define CPER_MEM_VALID_NODE 0x0008 | ||
224 | #define CPER_MEM_VALID_CARD 0x0010 | ||
225 | #define CPER_MEM_VALID_MODULE 0x0020 | ||
226 | #define CPER_MEM_VALID_BANK 0x0040 | ||
227 | #define CPER_MEM_VALID_DEVICE 0x0080 | ||
228 | #define CPER_MEM_VALID_ROW 0x0100 | ||
229 | #define CPER_MEM_VALID_COLUMN 0x0200 | ||
230 | #define CPER_MEM_VALID_BIT_POSITION 0x0400 | ||
231 | #define CPER_MEM_VALID_REQUESTOR_ID 0x0800 | ||
232 | #define CPER_MEM_VALID_RESPONDER_ID 0x1000 | ||
233 | #define CPER_MEM_VALID_TARGET_ID 0x2000 | ||
234 | #define CPER_MEM_VALID_ERROR_TYPE 0x4000 | ||
235 | |||
236 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 | ||
237 | #define CPER_PCIE_VALID_VERSION 0x0002 | ||
238 | #define CPER_PCIE_VALID_COMMAND_STATUS 0x0004 | ||
239 | #define CPER_PCIE_VALID_DEVICE_ID 0x0008 | ||
240 | #define CPER_PCIE_VALID_SERIAL_NUMBER 0x0010 | ||
241 | #define CPER_PCIE_VALID_BRIDGE_CONTROL_STATUS 0x0020 | ||
242 | #define CPER_PCIE_VALID_CAPABILITY 0x0040 | ||
243 | #define CPER_PCIE_VALID_AER_INFO 0x0080 | ||
244 | |||
245 | #define CPER_PCIE_SLOT_SHIFT 3 | ||
246 | |||
204 | /* | 247 | /* |
205 | * All tables and structs must be byte-packed to match CPER | 248 | * All tables and structs must be byte-packed to match CPER |
206 | * specification, since the tables are provided by the system BIOS | 249 | * specification, since the tables are provided by the system BIOS |
@@ -306,6 +349,41 @@ struct cper_sec_mem_err { | |||
306 | __u8 error_type; | 349 | __u8 error_type; |
307 | }; | 350 | }; |
308 | 351 | ||
352 | struct cper_sec_pcie { | ||
353 | __u64 validation_bits; | ||
354 | __u32 port_type; | ||
355 | struct { | ||
356 | __u8 minor; | ||
357 | __u8 major; | ||
358 | __u8 reserved[2]; | ||
359 | } version; | ||
360 | __u16 command; | ||
361 | __u16 status; | ||
362 | __u32 reserved; | ||
363 | struct { | ||
364 | __u16 vendor_id; | ||
365 | __u16 device_id; | ||
366 | __u8 class_code[3]; | ||
367 | __u8 function; | ||
368 | __u8 device; | ||
369 | __u16 segment; | ||
370 | __u8 bus; | ||
371 | __u8 secondary_bus; | ||
372 | __u16 slot; | ||
373 | __u8 reserved; | ||
374 | } device_id; | ||
375 | struct { | ||
376 | __u32 lower; | ||
377 | __u32 upper; | ||
378 | } serial_number; | ||
379 | struct { | ||
380 | __u16 secondary_status; | ||
381 | __u16 control; | ||
382 | } bridge; | ||
383 | __u8 capability[60]; | ||
384 | __u8 aer_info[96]; | ||
385 | }; | ||
386 | |||
309 | /* Reset to default packing */ | 387 | /* Reset to default packing */ |
310 | #pragma pack() | 388 | #pragma pack() |
311 | 389 | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 1be416bbbb82..36719ead50e8 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -47,13 +47,7 @@ struct cpuidle_state { | |||
47 | 47 | ||
48 | /* Idle State Flags */ | 48 | /* Idle State Flags */ |
49 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | 49 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ |
50 | #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ | ||
51 | #define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */ | ||
52 | #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ | ||
53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ | ||
54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ | ||
55 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ | 50 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ |
56 | #define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */ | ||
57 | 51 | ||
58 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 52 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
59 | 53 | ||
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index 6fc2bed368b8..0e7bf272ec2f 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
@@ -84,9 +84,11 @@ struct cramfs_super { | |||
84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ | 84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ |
85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) | 85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) |
86 | 86 | ||
87 | #ifdef __KERNEL__ | ||
87 | /* Uncompression interfaces to the underlying zlib */ | 88 | /* Uncompression interfaces to the underlying zlib */ |
88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); | 89 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); |
89 | int cramfs_uncompress_init(void); | 90 | int cramfs_uncompress_init(void); |
90 | void cramfs_uncompress_exit(void); | 91 | void cramfs_uncompress_exit(void); |
92 | #endif /* __KERNEL__ */ | ||
91 | 93 | ||
92 | #endif | 94 | #endif |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h index d5a1d4810b80..6fe2114f8ad2 100644 --- a/include/linux/cs5535.h +++ b/include/linux/cs5535.h | |||
@@ -103,14 +103,20 @@ static inline int cs5535_has_vsa2(void) | |||
103 | #define GPIO_POSITIVE_EDGE_STS 0x48 | 103 | #define GPIO_POSITIVE_EDGE_STS 0x48 |
104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C | 104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C |
105 | 105 | ||
106 | #define GPIO_FLTR7_AMOUNT 0xD8 | ||
107 | |||
106 | #define GPIO_MAP_X 0xE0 | 108 | #define GPIO_MAP_X 0xE0 |
107 | #define GPIO_MAP_Y 0xE4 | 109 | #define GPIO_MAP_Y 0xE4 |
108 | #define GPIO_MAP_Z 0xE8 | 110 | #define GPIO_MAP_Z 0xE8 |
109 | #define GPIO_MAP_W 0xEC | 111 | #define GPIO_MAP_W 0xEC |
110 | 112 | ||
113 | #define GPIO_FE7_SEL 0xF7 | ||
114 | |||
111 | void cs5535_gpio_set(unsigned offset, unsigned int reg); | 115 | void cs5535_gpio_set(unsigned offset, unsigned int reg); |
112 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); | 116 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); |
113 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); | 117 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); |
118 | int cs5535_gpio_set_irq(unsigned group, unsigned irq); | ||
119 | void cs5535_gpio_setup_event(unsigned offset, int pair, int pme); | ||
114 | 120 | ||
115 | /* MFGPTs */ | 121 | /* MFGPTs */ |
116 | 122 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 59fcd24b1468..f958c19e3ca5 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -167,6 +167,8 @@ struct dentry_operations { | |||
167 | void (*d_release)(struct dentry *); | 167 | void (*d_release)(struct dentry *); |
168 | void (*d_iput)(struct dentry *, struct inode *); | 168 | void (*d_iput)(struct dentry *, struct inode *); |
169 | char *(*d_dname)(struct dentry *, char *, int); | 169 | char *(*d_dname)(struct dentry *, char *, int); |
170 | struct vfsmount *(*d_automount)(struct path *); | ||
171 | int (*d_manage)(struct dentry *, bool, bool); | ||
170 | } ____cacheline_aligned; | 172 | } ____cacheline_aligned; |
171 | 173 | ||
172 | /* | 174 | /* |
@@ -205,13 +207,18 @@ struct dentry_operations { | |||
205 | 207 | ||
206 | #define DCACHE_CANT_MOUNT 0x0100 | 208 | #define DCACHE_CANT_MOUNT 0x0100 |
207 | #define DCACHE_GENOCIDE 0x0200 | 209 | #define DCACHE_GENOCIDE 0x0200 |
208 | #define DCACHE_MOUNTED 0x0400 /* is a mountpoint */ | ||
209 | 210 | ||
210 | #define DCACHE_OP_HASH 0x1000 | 211 | #define DCACHE_OP_HASH 0x1000 |
211 | #define DCACHE_OP_COMPARE 0x2000 | 212 | #define DCACHE_OP_COMPARE 0x2000 |
212 | #define DCACHE_OP_REVALIDATE 0x4000 | 213 | #define DCACHE_OP_REVALIDATE 0x4000 |
213 | #define DCACHE_OP_DELETE 0x8000 | 214 | #define DCACHE_OP_DELETE 0x8000 |
214 | 215 | ||
216 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ | ||
217 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ | ||
218 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ | ||
219 | #define DCACHE_MANAGED_DENTRY \ | ||
220 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | ||
221 | |||
215 | extern seqlock_t rename_lock; | 222 | extern seqlock_t rename_lock; |
216 | 223 | ||
217 | static inline int dname_external(struct dentry *dentry) | 224 | static inline int dname_external(struct dentry *dentry) |
@@ -399,7 +406,12 @@ static inline void dont_mount(struct dentry *dentry) | |||
399 | 406 | ||
400 | extern void dput(struct dentry *); | 407 | extern void dput(struct dentry *); |
401 | 408 | ||
402 | static inline int d_mountpoint(struct dentry *dentry) | 409 | static inline bool d_managed(struct dentry *dentry) |
410 | { | ||
411 | return dentry->d_flags & DCACHE_MANAGED_DENTRY; | ||
412 | } | ||
413 | |||
414 | static inline bool d_mountpoint(struct dentry *dentry) | ||
403 | { | 415 | { |
404 | return dentry->d_flags & DCACHE_MOUNTED; | 416 | return dentry->d_flags & DCACHE_MOUNTED; |
405 | } | 417 | } |
diff --git a/include/linux/decompress/inflate.h b/include/linux/decompress/inflate.h index f9b06ccc3e5c..8c0aef1ba5f5 100644 --- a/include/linux/decompress/inflate.h +++ b/include/linux/decompress/inflate.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef INFLATE_H | 1 | #ifndef INFLATE_H |
2 | #define INFLATE_H | 2 | #define INFLATE_H |
3 | 3 | ||
4 | /* Other housekeeping constants */ | ||
5 | #define INBUFSIZ 4096 | ||
6 | |||
7 | int gunzip(unsigned char *inbuf, int len, | 4 | int gunzip(unsigned char *inbuf, int len, |
8 | int(*fill)(void*, unsigned int), | 5 | int(*fill)(void*, unsigned int), |
9 | int(*flush)(void*, unsigned int), | 6 | int(*flush)(void*, unsigned int), |
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index ad5ec1d0475e..4cb72b920c74 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
@@ -61,8 +61,6 @@ static void free(void *where) | |||
61 | #define large_malloc(a) malloc(a) | 61 | #define large_malloc(a) malloc(a) |
62 | #define large_free(a) free(a) | 62 | #define large_free(a) free(a) |
63 | 63 | ||
64 | #define set_error_fn(x) | ||
65 | |||
66 | #define INIT | 64 | #define INIT |
67 | 65 | ||
68 | #else /* STATIC */ | 66 | #else /* STATIC */ |
@@ -72,6 +70,7 @@ static void free(void *where) | |||
72 | #include <linux/kernel.h> | 70 | #include <linux/kernel.h> |
73 | #include <linux/fs.h> | 71 | #include <linux/fs.h> |
74 | #include <linux/string.h> | 72 | #include <linux/string.h> |
73 | #include <linux/slab.h> | ||
75 | #include <linux/vmalloc.h> | 74 | #include <linux/vmalloc.h> |
76 | 75 | ||
77 | /* Use defines rather than static inline in order to avoid spurious | 76 | /* Use defines rather than static inline in order to avoid spurious |
@@ -84,9 +83,6 @@ static void free(void *where) | |||
84 | #define large_malloc(a) vmalloc(a) | 83 | #define large_malloc(a) vmalloc(a) |
85 | #define large_free(a) vfree(a) | 84 | #define large_free(a) vfree(a) |
86 | 85 | ||
87 | static void(*error)(char *m); | ||
88 | #define set_error_fn(x) error = x; | ||
89 | |||
90 | #define INIT __init | 86 | #define INIT __init |
91 | #define STATIC | 87 | #define STATIC |
92 | 88 | ||
diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h new file mode 100644 index 000000000000..41728fc6c8a1 --- /dev/null +++ b/include/linux/decompress/unxz.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd | ||
3 | * | ||
4 | * Author: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * | ||
6 | * This file has been put into the public domain. | ||
7 | * You can do whatever you want with this file. | ||
8 | */ | ||
9 | |||
10 | #ifndef DECOMPRESS_UNXZ_H | ||
11 | #define DECOMPRESS_UNXZ_H | ||
12 | |||
13 | int unxz(unsigned char *in, int in_size, | ||
14 | int (*fill)(void *dest, unsigned int size), | ||
15 | int (*flush)(void *src, unsigned int size), | ||
16 | unsigned char *out, int *in_used, | ||
17 | void (*error)(char *x)); | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 2970022faa63..272496d1fae4 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -193,6 +193,13 @@ struct dm_target { | |||
193 | char *error; | 193 | char *error; |
194 | }; | 194 | }; |
195 | 195 | ||
196 | /* Each target can link one of these into the table */ | ||
197 | struct dm_target_callbacks { | ||
198 | struct list_head list; | ||
199 | int (*congested_fn) (struct dm_target_callbacks *, int); | ||
200 | void (*unplug_fn)(struct dm_target_callbacks *); | ||
201 | }; | ||
202 | |||
196 | int dm_register_target(struct target_type *t); | 203 | int dm_register_target(struct target_type *t); |
197 | void dm_unregister_target(struct target_type *t); | 204 | void dm_unregister_target(struct target_type *t); |
198 | 205 | ||
@@ -269,6 +276,11 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
269 | sector_t start, sector_t len, char *params); | 276 | sector_t start, sector_t len, char *params); |
270 | 277 | ||
271 | /* | 278 | /* |
279 | * Target_ctr should call this if it needs to add any callbacks. | ||
280 | */ | ||
281 | void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb); | ||
282 | |||
283 | /* | ||
272 | * Finally call this to make the table ready for use. | 284 | * Finally call this to make the table ready for use. |
273 | */ | 285 | */ |
274 | int dm_table_complete(struct dm_table *t); | 286 | int dm_table_complete(struct dm_table *t); |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 49eab360d5d4..78bbf47bbb96 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -44,7 +44,7 @@ | |||
44 | * Remove a device, destroy any tables. | 44 | * Remove a device, destroy any tables. |
45 | * | 45 | * |
46 | * DM_DEV_RENAME: | 46 | * DM_DEV_RENAME: |
47 | * Rename a device. | 47 | * Rename a device or set its uuid if none was previously supplied. |
48 | * | 48 | * |
49 | * DM_SUSPEND: | 49 | * DM_SUSPEND: |
50 | * This performs both suspend and resume, depending which flag is | 50 | * This performs both suspend and resume, depending which flag is |
@@ -267,9 +267,9 @@ enum { | |||
267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
268 | 268 | ||
269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
270 | #define DM_VERSION_MINOR 18 | 270 | #define DM_VERSION_MINOR 19 |
271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 1 |
272 | #define DM_VERSION_EXTRA "-ioctl (2010-06-29)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2011-01-07)" |
273 | 273 | ||
274 | /* Status bits */ | 274 | /* Status bits */ |
275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -322,4 +322,10 @@ enum { | |||
322 | */ | 322 | */ |
323 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */ | 323 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */ |
324 | 324 | ||
325 | /* | ||
326 | * If set, rename changes the uuid not the name. Only permitted | ||
327 | * if no uuid was previously supplied: an existing uuid cannot be changed. | ||
328 | */ | ||
329 | #define DM_UUID_FLAG (1 << 14) /* In */ | ||
330 | |||
325 | #endif /* _LINUX_DM_IOCTL_H */ | 331 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h index 0c3c3a2110c4..eeace7d3ff15 100644 --- a/include/linux/dm-log-userspace.h +++ b/include/linux/dm-log-userspace.h | |||
@@ -370,6 +370,16 @@ | |||
370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ | 370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ |
371 | (DM_ULOG_REQUEST_MASK & (request_type)) | 371 | (DM_ULOG_REQUEST_MASK & (request_type)) |
372 | 372 | ||
373 | /* | ||
374 | * DM_ULOG_REQUEST_VERSION is incremented when there is a | ||
375 | * change to the way information is passed between kernel | ||
376 | * and userspace. This could be a structure change of | ||
377 | * dm_ulog_request or a change in the way requests are | ||
378 | * issued/handled. Changes are outlined here: | ||
379 | * version 1: Initial implementation | ||
380 | */ | ||
381 | #define DM_ULOG_REQUEST_VERSION 1 | ||
382 | |||
373 | struct dm_ulog_request { | 383 | struct dm_ulog_request { |
374 | /* | 384 | /* |
375 | * The local unique identifier (luid) and the universally unique | 385 | * The local unique identifier (luid) and the universally unique |
@@ -383,8 +393,9 @@ struct dm_ulog_request { | |||
383 | */ | 393 | */ |
384 | uint64_t luid; | 394 | uint64_t luid; |
385 | char uuid[DM_UUID_LEN]; | 395 | char uuid[DM_UUID_LEN]; |
386 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ | 396 | char padding[3]; /* Padding because DM_UUID_LEN = 129 */ |
387 | 397 | ||
398 | uint32_t version; /* See DM_ULOG_REQUEST_VERSION */ | ||
388 | int32_t error; /* Used to report back processing errors */ | 399 | int32_t error; /* Used to report back processing errors */ |
389 | 400 | ||
390 | uint32_t seq; /* Sequence number for request */ | 401 | uint32_t seq; /* Sequence number for request */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 8cd00ad98d37..9bebd7f16ef1 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -532,7 +532,7 @@ static inline int dmaengine_resume(struct dma_chan *chan) | |||
532 | return dmaengine_device_control(chan, DMA_RESUME, 0); | 532 | return dmaengine_device_control(chan, DMA_RESUME, 0); |
533 | } | 533 | } |
534 | 534 | ||
535 | static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc) | 535 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) |
536 | { | 536 | { |
537 | return desc->tx_submit(desc); | 537 | return desc->tx_submit(desc); |
538 | } | 538 | } |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index bec8b82889bf..ab68f785fd19 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -99,6 +99,17 @@ static inline int is_broadcast_ether_addr(const u8 *addr) | |||
99 | } | 99 | } |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * is_unicast_ether_addr - Determine if the Ethernet address is unicast | ||
103 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
104 | * | ||
105 | * Return true if the address is a unicast address. | ||
106 | */ | ||
107 | static inline int is_unicast_ether_addr(const u8 *addr) | ||
108 | { | ||
109 | return !is_multicast_ether_addr(addr); | ||
110 | } | ||
111 | |||
112 | /** | ||
102 | * is_valid_ether_addr - Determine if the given Ethernet address is valid | 113 | * is_valid_ether_addr - Determine if the given Ethernet address is valid |
103 | * @addr: Pointer to a six-byte array containing the Ethernet address | 114 | * @addr: Pointer to a six-byte array containing the Ethernet address |
104 | * | 115 | * |
diff --git a/include/linux/falloc.h b/include/linux/falloc.h index 3c155107d61f..73e0b628e058 100644 --- a/include/linux/falloc.h +++ b/include/linux/falloc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _FALLOC_H_ | 2 | #define _FALLOC_H_ |
3 | 3 | ||
4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ | 4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ |
5 | #define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */ | ||
5 | 6 | ||
6 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
7 | 8 | ||
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index afc00af3229b..a562fa5fb4e3 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of | 45 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of |
46 | unlinking file. */ | 46 | unlinking file. */ |
47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ | 47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ |
48 | #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */ | ||
48 | 49 | ||
49 | #ifdef __KERNEL__ | 50 | #ifdef __KERNEL__ |
50 | 51 | ||
diff --git a/include/linux/file.h b/include/linux/file.h index b1e12970f617..e85baebf6279 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -23,7 +23,7 @@ extern struct file *alloc_file(struct path *, fmode_t mode, | |||
23 | 23 | ||
24 | static inline void fput_light(struct file *file, int fput_needed) | 24 | static inline void fput_light(struct file *file, int fput_needed) |
25 | { | 25 | { |
26 | if (unlikely(fput_needed)) | 26 | if (fput_needed) |
27 | fput(file); | 27 | fput(file); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 68c642d8843d..59ea406be7f6 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -273,7 +273,7 @@ struct fw_cdev_event_iso_interrupt { | |||
273 | * @closure: See &fw_cdev_event_common; | 273 | * @closure: See &fw_cdev_event_common; |
274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | 274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl |
275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL | 275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL |
276 | * @completed: Offset into the receive buffer; data before this offest is valid | 276 | * @completed: Offset into the receive buffer; data before this offset is valid |
277 | * | 277 | * |
278 | * This event is sent in multichannel contexts (context type | 278 | * This event is sent in multichannel contexts (context type |
279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer | 279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f84d9928bdb1..32b38cd829d3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -242,6 +242,7 @@ struct inodes_stat_t { | |||
242 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ | 242 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ |
243 | #define S_PRIVATE 512 /* Inode is fs-internal */ | 243 | #define S_PRIVATE 512 /* Inode is fs-internal */ |
244 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | 244 | #define S_IMA 1024 /* Inode has an associated IMA struct */ |
245 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Note that nosuid etc flags are inode-specific: setting some file-system | 248 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -277,6 +278,7 @@ struct inodes_stat_t { | |||
277 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | 278 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) |
278 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | 279 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) |
279 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | 280 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) |
281 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | ||
280 | 282 | ||
281 | /* the read-only stuff doesn't really belong here, but any other place is | 283 | /* the read-only stuff doesn't really belong here, but any other place is |
282 | probably as bad and I don't want to create yet another include file. */ | 284 | probably as bad and I don't want to create yet another include file. */ |
@@ -664,8 +666,9 @@ struct block_device { | |||
664 | void * bd_claiming; | 666 | void * bd_claiming; |
665 | void * bd_holder; | 667 | void * bd_holder; |
666 | int bd_holders; | 668 | int bd_holders; |
669 | bool bd_write_holder; | ||
667 | #ifdef CONFIG_SYSFS | 670 | #ifdef CONFIG_SYSFS |
668 | struct list_head bd_holder_list; | 671 | struct list_head bd_holder_disks; |
669 | #endif | 672 | #endif |
670 | struct block_device * bd_contains; | 673 | struct block_device * bd_contains; |
671 | unsigned bd_block_size; | 674 | unsigned bd_block_size; |
@@ -1065,7 +1068,6 @@ struct lock_manager_operations { | |||
1065 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1068 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
1066 | void (*fl_release_private)(struct file_lock *); | 1069 | void (*fl_release_private)(struct file_lock *); |
1067 | void (*fl_break)(struct file_lock *); | 1070 | void (*fl_break)(struct file_lock *); |
1068 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | ||
1069 | int (*fl_change)(struct file_lock **, int); | 1071 | int (*fl_change)(struct file_lock **, int); |
1070 | }; | 1072 | }; |
1071 | 1073 | ||
@@ -1423,6 +1425,7 @@ struct super_block { | |||
1423 | * generic_show_options() | 1425 | * generic_show_options() |
1424 | */ | 1426 | */ |
1425 | char __rcu *s_options; | 1427 | char __rcu *s_options; |
1428 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ | ||
1426 | }; | 1429 | }; |
1427 | 1430 | ||
1428 | extern struct timespec current_fs_time(struct super_block *sb); | 1431 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1480,8 +1483,8 @@ struct fiemap_extent_info { | |||
1480 | unsigned int fi_flags; /* Flags as passed from user */ | 1483 | unsigned int fi_flags; /* Flags as passed from user */ |
1481 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | 1484 | unsigned int fi_extents_mapped; /* Number of mapped extents */ |
1482 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | 1485 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ |
1483 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | 1486 | struct fiemap_extent __user *fi_extents_start; /* Start of |
1484 | * array */ | 1487 | fiemap_extent array */ |
1485 | }; | 1488 | }; |
1486 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | 1489 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, |
1487 | u64 phys, u64 len, u32 flags); | 1490 | u64 phys, u64 len, u32 flags); |
@@ -1549,6 +1552,8 @@ struct file_operations { | |||
1549 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | 1552 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1550 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | 1553 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
1551 | int (*setlease)(struct file *, long, struct file_lock **); | 1554 | int (*setlease)(struct file *, long, struct file_lock **); |
1555 | long (*fallocate)(struct file *file, int mode, loff_t offset, | ||
1556 | loff_t len); | ||
1552 | }; | 1557 | }; |
1553 | 1558 | ||
1554 | #define IPERM_FLAG_RCU 0x0001 | 1559 | #define IPERM_FLAG_RCU 0x0001 |
@@ -1579,8 +1584,6 @@ struct inode_operations { | |||
1579 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1584 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1580 | int (*removexattr) (struct dentry *, const char *); | 1585 | int (*removexattr) (struct dentry *, const char *); |
1581 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1586 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1582 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | ||
1583 | loff_t len); | ||
1584 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1587 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1585 | u64 len); | 1588 | u64 len); |
1586 | } ____cacheline_aligned; | 1589 | } ____cacheline_aligned; |
@@ -1834,7 +1837,9 @@ struct super_block *sget(struct file_system_type *type, | |||
1834 | int (*set)(struct super_block *,void *), | 1837 | int (*set)(struct super_block *,void *), |
1835 | void *data); | 1838 | void *data); |
1836 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, | 1839 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
1837 | const struct super_operations *ops, unsigned long); | 1840 | const struct super_operations *ops, |
1841 | const struct dentry_operations *dops, | ||
1842 | unsigned long); | ||
1838 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1843 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1839 | 1844 | ||
1840 | static inline void sb_mark_dirty(struct super_block *sb) | 1845 | static inline void sb_mark_dirty(struct super_block *sb) |
@@ -2016,7 +2021,6 @@ extern struct block_device *bdgrab(struct block_device *bdev); | |||
2016 | extern void bd_set_size(struct block_device *, loff_t size); | 2021 | extern void bd_set_size(struct block_device *, loff_t size); |
2017 | extern void bd_forget(struct inode *inode); | 2022 | extern void bd_forget(struct inode *inode); |
2018 | extern void bdput(struct block_device *); | 2023 | extern void bdput(struct block_device *); |
2019 | extern struct block_device *open_by_devnum(dev_t, fmode_t); | ||
2020 | extern void invalidate_bdev(struct block_device *); | 2024 | extern void invalidate_bdev(struct block_device *); |
2021 | extern int sync_blockdev(struct block_device *bdev); | 2025 | extern int sync_blockdev(struct block_device *bdev); |
2022 | extern struct super_block *freeze_bdev(struct block_device *); | 2026 | extern struct super_block *freeze_bdev(struct block_device *); |
@@ -2047,16 +2051,26 @@ extern const struct file_operations def_fifo_fops; | |||
2047 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 2051 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
2048 | extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long); | 2052 | extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long); |
2049 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 2053 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
2050 | extern int blkdev_get(struct block_device *, fmode_t); | 2054 | extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder); |
2051 | extern int blkdev_put(struct block_device *, fmode_t); | 2055 | extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, |
2052 | extern int bd_claim(struct block_device *, void *); | 2056 | void *holder); |
2053 | extern void bd_release(struct block_device *); | 2057 | extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, |
2058 | void *holder); | ||
2059 | extern int blkdev_put(struct block_device *bdev, fmode_t mode); | ||
2054 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
2055 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | 2061 | extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk); |
2056 | extern void bd_release_from_disk(struct block_device *, struct gendisk *); | 2062 | extern void bd_unlink_disk_holder(struct block_device *bdev, |
2063 | struct gendisk *disk); | ||
2057 | #else | 2064 | #else |
2058 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 2065 | static inline int bd_link_disk_holder(struct block_device *bdev, |
2059 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 2066 | struct gendisk *disk) |
2067 | { | ||
2068 | return 0; | ||
2069 | } | ||
2070 | static inline void bd_unlink_disk_holder(struct block_device *bdev, | ||
2071 | struct gendisk *disk) | ||
2072 | { | ||
2073 | } | ||
2060 | #endif | 2074 | #endif |
2061 | #endif | 2075 | #endif |
2062 | 2076 | ||
@@ -2092,8 +2106,6 @@ static inline void unregister_chrdev(unsigned int major, const char *name) | |||
2092 | extern const char *__bdevname(dev_t, char *buffer); | 2106 | extern const char *__bdevname(dev_t, char *buffer); |
2093 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 2107 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
2094 | extern struct block_device *lookup_bdev(const char *); | 2108 | extern struct block_device *lookup_bdev(const char *); |
2095 | extern struct block_device *open_bdev_exclusive(const char *, fmode_t, void *); | ||
2096 | extern void close_bdev_exclusive(struct block_device *, fmode_t); | ||
2097 | extern void blkdev_show(struct seq_file *,off_t); | 2109 | extern void blkdev_show(struct seq_file *,off_t); |
2098 | 2110 | ||
2099 | #else | 2111 | #else |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 7a7b9c1644e4..c0d5f6945c1e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -115,6 +115,7 @@ struct hd_struct { | |||
115 | #else | 115 | #else |
116 | struct disk_stats dkstats; | 116 | struct disk_stats dkstats; |
117 | #endif | 117 | #endif |
118 | atomic_t ref; | ||
118 | struct rcu_head rcu_head; | 119 | struct rcu_head rcu_head; |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -127,6 +128,11 @@ struct hd_struct { | |||
127 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
128 | #define GENHD_FL_NATIVE_CAPACITY 128 | 129 | #define GENHD_FL_NATIVE_CAPACITY 128 |
129 | 130 | ||
131 | enum { | ||
132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | ||
133 | DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */ | ||
134 | }; | ||
135 | |||
130 | #define BLK_SCSI_MAX_CMDS (256) | 136 | #define BLK_SCSI_MAX_CMDS (256) |
131 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 137 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
132 | 138 | ||
@@ -143,6 +149,8 @@ struct disk_part_tbl { | |||
143 | struct hd_struct __rcu *part[]; | 149 | struct hd_struct __rcu *part[]; |
144 | }; | 150 | }; |
145 | 151 | ||
152 | struct disk_events; | ||
153 | |||
146 | struct gendisk { | 154 | struct gendisk { |
147 | /* major, first_minor and minors are input parameters only, | 155 | /* major, first_minor and minors are input parameters only, |
148 | * don't use directly. Use disk_devt() and disk_max_parts(). | 156 | * don't use directly. Use disk_devt() and disk_max_parts(). |
@@ -154,6 +162,10 @@ struct gendisk { | |||
154 | 162 | ||
155 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 163 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
156 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 164 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
165 | |||
166 | unsigned int events; /* supported events */ | ||
167 | unsigned int async_events; /* async events, subset of all */ | ||
168 | |||
157 | /* Array of pointers to partitions indexed by partno. | 169 | /* Array of pointers to partitions indexed by partno. |
158 | * Protected with matching bdev lock but stat and other | 170 | * Protected with matching bdev lock but stat and other |
159 | * non-critical accesses use RCU. Always access through | 171 | * non-critical accesses use RCU. Always access through |
@@ -171,9 +183,8 @@ struct gendisk { | |||
171 | struct kobject *slave_dir; | 183 | struct kobject *slave_dir; |
172 | 184 | ||
173 | struct timer_rand_state *random; | 185 | struct timer_rand_state *random; |
174 | |||
175 | atomic_t sync_io; /* RAID */ | 186 | atomic_t sync_io; /* RAID */ |
176 | struct work_struct async_notify; | 187 | struct disk_events *ev; |
177 | #ifdef CONFIG_BLK_DEV_INTEGRITY | 188 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
178 | struct blk_integrity *integrity; | 189 | struct blk_integrity *integrity; |
179 | #endif | 190 | #endif |
@@ -395,7 +406,6 @@ extern void part_round_stats(int cpu, struct hd_struct *part); | |||
395 | /* block/genhd.c */ | 406 | /* block/genhd.c */ |
396 | extern void add_disk(struct gendisk *disk); | 407 | extern void add_disk(struct gendisk *disk); |
397 | extern void del_gendisk(struct gendisk *gp); | 408 | extern void del_gendisk(struct gendisk *gp); |
398 | extern void unlink_gendisk(struct gendisk *gp); | ||
399 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); | 409 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); |
400 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); | 410 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); |
401 | 411 | ||
@@ -407,6 +417,11 @@ static inline int get_disk_ro(struct gendisk *disk) | |||
407 | return disk->part0.policy; | 417 | return disk->part0.policy; |
408 | } | 418 | } |
409 | 419 | ||
420 | extern void disk_block_events(struct gendisk *disk); | ||
421 | extern void disk_unblock_events(struct gendisk *disk); | ||
422 | extern void disk_check_events(struct gendisk *disk); | ||
423 | extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); | ||
424 | |||
410 | /* drivers/char/random.c */ | 425 | /* drivers/char/random.c */ |
411 | extern void add_disk_randomness(struct gendisk *disk); | 426 | extern void add_disk_randomness(struct gendisk *disk); |
412 | extern void rand_initialize_disk(struct gendisk *disk); | 427 | extern void rand_initialize_disk(struct gendisk *disk); |
@@ -583,6 +598,7 @@ extern struct hd_struct * __must_check add_partition(struct gendisk *disk, | |||
583 | sector_t len, int flags, | 598 | sector_t len, int flags, |
584 | struct partition_meta_info | 599 | struct partition_meta_info |
585 | *info); | 600 | *info); |
601 | extern void __delete_partition(struct hd_struct *); | ||
586 | extern void delete_partition(struct gendisk *, int); | 602 | extern void delete_partition(struct gendisk *, int); |
587 | extern void printk_all_partitions(void); | 603 | extern void printk_all_partitions(void); |
588 | 604 | ||
@@ -611,6 +627,29 @@ extern ssize_t part_fail_store(struct device *dev, | |||
611 | const char *buf, size_t count); | 627 | const char *buf, size_t count); |
612 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ | 628 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ |
613 | 629 | ||
630 | static inline void hd_ref_init(struct hd_struct *part) | ||
631 | { | ||
632 | atomic_set(&part->ref, 1); | ||
633 | smp_mb(); | ||
634 | } | ||
635 | |||
636 | static inline void hd_struct_get(struct hd_struct *part) | ||
637 | { | ||
638 | atomic_inc(&part->ref); | ||
639 | smp_mb__after_atomic_inc(); | ||
640 | } | ||
641 | |||
642 | static inline int hd_struct_try_get(struct hd_struct *part) | ||
643 | { | ||
644 | return atomic_inc_not_zero(&part->ref); | ||
645 | } | ||
646 | |||
647 | static inline void hd_struct_put(struct hd_struct *part) | ||
648 | { | ||
649 | if (atomic_dec_and_test(&part->ref)) | ||
650 | __delete_partition(part); | ||
651 | } | ||
652 | |||
614 | #else /* CONFIG_BLOCK */ | 653 | #else /* CONFIG_BLOCK */ |
615 | 654 | ||
616 | static inline void printk_all_partitions(void) { } | 655 | static inline void printk_all_partitions(void) { } |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index f54adfcbec9c..a3b148a91874 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -34,6 +34,7 @@ struct vm_area_struct; | |||
34 | #else | 34 | #else |
35 | #define ___GFP_NOTRACK 0 | 35 | #define ___GFP_NOTRACK 0 |
36 | #endif | 36 | #endif |
37 | #define ___GFP_NO_KSWAPD 0x400000u | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * GFP bitmasks.. | 40 | * GFP bitmasks.. |
@@ -81,13 +82,15 @@ struct vm_area_struct; | |||
81 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ | 82 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ |
82 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ | 83 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ |
83 | 84 | ||
85 | #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) | ||
86 | |||
84 | /* | 87 | /* |
85 | * This may seem redundant, but it's a way of annotating false positives vs. | 88 | * This may seem redundant, but it's a way of annotating false positives vs. |
86 | * allocations that simply cannot be supported (e.g. page tables). | 89 | * allocations that simply cannot be supported (e.g. page tables). |
87 | */ | 90 | */ |
88 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) | 91 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) |
89 | 92 | ||
90 | #define __GFP_BITS_SHIFT 22 /* Room for 22 __GFP_FOO bits */ | 93 | #define __GFP_BITS_SHIFT 23 /* Room for 23 __GFP_FOO bits */ |
91 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 94 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
92 | 95 | ||
93 | /* This equals 0, but use constants in case they ever change */ | 96 | /* This equals 0, but use constants in case they ever change */ |
@@ -106,6 +109,9 @@ struct vm_area_struct; | |||
106 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | 109 | __GFP_HARDWALL | __GFP_HIGHMEM | \ |
107 | __GFP_MOVABLE) | 110 | __GFP_MOVABLE) |
108 | #define GFP_IOFS (__GFP_IO | __GFP_FS) | 111 | #define GFP_IOFS (__GFP_IO | __GFP_FS) |
112 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ | ||
113 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ | ||
114 | __GFP_NO_KSWAPD) | ||
109 | 115 | ||
110 | #ifdef CONFIG_NUMA | 116 | #ifdef CONFIG_NUMA |
111 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 117 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
@@ -325,14 +331,17 @@ alloc_pages(gfp_t gfp_mask, unsigned int order) | |||
325 | { | 331 | { |
326 | return alloc_pages_current(gfp_mask, order); | 332 | return alloc_pages_current(gfp_mask, order); |
327 | } | 333 | } |
328 | extern struct page *alloc_page_vma(gfp_t gfp_mask, | 334 | extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, |
329 | struct vm_area_struct *vma, unsigned long addr); | 335 | struct vm_area_struct *vma, unsigned long addr); |
330 | #else | 336 | #else |
331 | #define alloc_pages(gfp_mask, order) \ | 337 | #define alloc_pages(gfp_mask, order) \ |
332 | alloc_pages_node(numa_node_id(), gfp_mask, order) | 338 | alloc_pages_node(numa_node_id(), gfp_mask, order) |
333 | #define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0) | 339 | #define alloc_pages_vma(gfp_mask, order, vma, addr) \ |
340 | alloc_pages(gfp_mask, order) | ||
334 | #endif | 341 | #endif |
335 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 342 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
343 | #define alloc_page_vma(gfp_mask, vma, addr) \ | ||
344 | alloc_pages_vma(gfp_mask, 0, vma, addr) | ||
336 | 345 | ||
337 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); | 346 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); |
338 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); | 347 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e41f7dd1ae67..32720baf70f1 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | 14 | ||
15 | struct device; | 15 | struct device; |
16 | struct gpio; | ||
16 | struct gpio_chip; | 17 | struct gpio_chip; |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -34,6 +35,17 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
34 | return -ENOSYS; | 35 | return -ENOSYS; |
35 | } | 36 | } |
36 | 37 | ||
38 | static inline int gpio_request_one(unsigned gpio, | ||
39 | unsigned long flags, const char *label) | ||
40 | { | ||
41 | return -ENOSYS; | ||
42 | } | ||
43 | |||
44 | static inline int gpio_request_array(struct gpio *array, size_t num) | ||
45 | { | ||
46 | return -ENOSYS; | ||
47 | } | ||
48 | |||
37 | static inline void gpio_free(unsigned gpio) | 49 | static inline void gpio_free(unsigned gpio) |
38 | { | 50 | { |
39 | might_sleep(); | 51 | might_sleep(); |
@@ -42,6 +54,14 @@ static inline void gpio_free(unsigned gpio) | |||
42 | WARN_ON(1); | 54 | WARN_ON(1); |
43 | } | 55 | } |
44 | 56 | ||
57 | static inline void gpio_free_array(struct gpio *array, size_t num) | ||
58 | { | ||
59 | might_sleep(); | ||
60 | |||
61 | /* GPIO can never have been requested */ | ||
62 | WARN_ON(1); | ||
63 | } | ||
64 | |||
45 | static inline int gpio_direction_input(unsigned gpio) | 65 | static inline int gpio_direction_input(unsigned gpio) |
46 | { | 66 | { |
47 | return -ENOSYS; | 67 | return -ENOSYS; |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 20b9801f669b..d91c25e253c8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -402,7 +402,7 @@ struct hid_field { | |||
402 | __u16 dpad; /* dpad input code */ | 402 | __u16 dpad; /* dpad input code */ |
403 | }; | 403 | }; |
404 | 404 | ||
405 | #define HID_MAX_FIELDS 64 | 405 | #define HID_MAX_FIELDS 128 |
406 | 406 | ||
407 | struct hid_report { | 407 | struct hid_report { |
408 | struct list_head list; | 408 | struct list_head list; |
@@ -593,6 +593,7 @@ struct hid_usage_id { | |||
593 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 593 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
594 | * @input_mapping: invoked on input registering before mapping an usage | 594 | * @input_mapping: invoked on input registering before mapping an usage |
595 | * @input_mapped: invoked on input registering after mapping an usage | 595 | * @input_mapped: invoked on input registering after mapping an usage |
596 | * @feature_mapping: invoked on feature registering | ||
596 | * @suspend: invoked on suspend (NULL means nop) | 597 | * @suspend: invoked on suspend (NULL means nop) |
597 | * @resume: invoked on resume if device was not reset (NULL means nop) | 598 | * @resume: invoked on resume if device was not reset (NULL means nop) |
598 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 599 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
@@ -636,6 +637,9 @@ struct hid_driver { | |||
636 | int (*input_mapped)(struct hid_device *hdev, | 637 | int (*input_mapped)(struct hid_device *hdev, |
637 | struct hid_input *hidinput, struct hid_field *field, | 638 | struct hid_input *hidinput, struct hid_field *field, |
638 | struct hid_usage *usage, unsigned long **bit, int *max); | 639 | struct hid_usage *usage, unsigned long **bit, int *max); |
640 | void (*feature_mapping)(struct hid_device *hdev, | ||
641 | struct hid_input *hidinput, struct hid_field *field, | ||
642 | struct hid_usage *usage); | ||
639 | #ifdef CONFIG_PM | 643 | #ifdef CONFIG_PM |
640 | int (*suspend)(struct hid_device *hdev, pm_message_t message); | 644 | int (*suspend)(struct hid_device *hdev, pm_message_t message); |
641 | int (*resume)(struct hid_device *hdev); | 645 | int (*resume)(struct hid_device *hdev); |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h new file mode 100644 index 000000000000..8e6c8c42bc3c --- /dev/null +++ b/include/linux/huge_mm.h | |||
@@ -0,0 +1,179 @@ | |||
1 | #ifndef _LINUX_HUGE_MM_H | ||
2 | #define _LINUX_HUGE_MM_H | ||
3 | |||
4 | extern int do_huge_pmd_anonymous_page(struct mm_struct *mm, | ||
5 | struct vm_area_struct *vma, | ||
6 | unsigned long address, pmd_t *pmd, | ||
7 | unsigned int flags); | ||
8 | extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, | ||
9 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, | ||
10 | struct vm_area_struct *vma); | ||
11 | extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | ||
12 | unsigned long address, pmd_t *pmd, | ||
13 | pmd_t orig_pmd); | ||
14 | extern pgtable_t get_pmd_huge_pte(struct mm_struct *mm); | ||
15 | extern struct page *follow_trans_huge_pmd(struct mm_struct *mm, | ||
16 | unsigned long addr, | ||
17 | pmd_t *pmd, | ||
18 | unsigned int flags); | ||
19 | extern int zap_huge_pmd(struct mmu_gather *tlb, | ||
20 | struct vm_area_struct *vma, | ||
21 | pmd_t *pmd); | ||
22 | extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | ||
23 | unsigned long addr, unsigned long end, | ||
24 | unsigned char *vec); | ||
25 | extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | ||
26 | unsigned long addr, pgprot_t newprot); | ||
27 | |||
28 | enum transparent_hugepage_flag { | ||
29 | TRANSPARENT_HUGEPAGE_FLAG, | ||
30 | TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG, | ||
31 | TRANSPARENT_HUGEPAGE_DEFRAG_FLAG, | ||
32 | TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, | ||
33 | TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, | ||
34 | #ifdef CONFIG_DEBUG_VM | ||
35 | TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, | ||
36 | #endif | ||
37 | }; | ||
38 | |||
39 | enum page_check_address_pmd_flag { | ||
40 | PAGE_CHECK_ADDRESS_PMD_FLAG, | ||
41 | PAGE_CHECK_ADDRESS_PMD_NOTSPLITTING_FLAG, | ||
42 | PAGE_CHECK_ADDRESS_PMD_SPLITTING_FLAG, | ||
43 | }; | ||
44 | extern pmd_t *page_check_address_pmd(struct page *page, | ||
45 | struct mm_struct *mm, | ||
46 | unsigned long address, | ||
47 | enum page_check_address_pmd_flag flag); | ||
48 | |||
49 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
50 | #define HPAGE_PMD_SHIFT HPAGE_SHIFT | ||
51 | #define HPAGE_PMD_MASK HPAGE_MASK | ||
52 | #define HPAGE_PMD_SIZE HPAGE_SIZE | ||
53 | |||
54 | #define transparent_hugepage_enabled(__vma) \ | ||
55 | ((transparent_hugepage_flags & \ | ||
56 | (1<<TRANSPARENT_HUGEPAGE_FLAG) || \ | ||
57 | (transparent_hugepage_flags & \ | ||
58 | (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG) && \ | ||
59 | ((__vma)->vm_flags & VM_HUGEPAGE))) && \ | ||
60 | !((__vma)->vm_flags & VM_NOHUGEPAGE)) | ||
61 | #define transparent_hugepage_defrag(__vma) \ | ||
62 | ((transparent_hugepage_flags & \ | ||
63 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_FLAG)) || \ | ||
64 | (transparent_hugepage_flags & \ | ||
65 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ | ||
66 | (__vma)->vm_flags & VM_HUGEPAGE)) | ||
67 | #ifdef CONFIG_DEBUG_VM | ||
68 | #define transparent_hugepage_debug_cow() \ | ||
69 | (transparent_hugepage_flags & \ | ||
70 | (1<<TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG)) | ||
71 | #else /* CONFIG_DEBUG_VM */ | ||
72 | #define transparent_hugepage_debug_cow() 0 | ||
73 | #endif /* CONFIG_DEBUG_VM */ | ||
74 | |||
75 | extern unsigned long transparent_hugepage_flags; | ||
76 | extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, | ||
77 | pmd_t *dst_pmd, pmd_t *src_pmd, | ||
78 | struct vm_area_struct *vma, | ||
79 | unsigned long addr, unsigned long end); | ||
80 | extern int handle_pte_fault(struct mm_struct *mm, | ||
81 | struct vm_area_struct *vma, unsigned long address, | ||
82 | pte_t *pte, pmd_t *pmd, unsigned int flags); | ||
83 | extern int split_huge_page(struct page *page); | ||
84 | extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); | ||
85 | #define split_huge_page_pmd(__mm, __pmd) \ | ||
86 | do { \ | ||
87 | pmd_t *____pmd = (__pmd); \ | ||
88 | if (unlikely(pmd_trans_huge(*____pmd))) \ | ||
89 | __split_huge_page_pmd(__mm, ____pmd); \ | ||
90 | } while (0) | ||
91 | #define wait_split_huge_page(__anon_vma, __pmd) \ | ||
92 | do { \ | ||
93 | pmd_t *____pmd = (__pmd); \ | ||
94 | spin_unlock_wait(&(__anon_vma)->root->lock); \ | ||
95 | /* \ | ||
96 | * spin_unlock_wait() is just a loop in C and so the \ | ||
97 | * CPU can reorder anything around it. \ | ||
98 | */ \ | ||
99 | smp_mb(); \ | ||
100 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | ||
101 | pmd_trans_huge(*____pmd)); \ | ||
102 | } while (0) | ||
103 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ||
104 | #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) | ||
105 | #if HPAGE_PMD_ORDER > MAX_ORDER | ||
106 | #error "hugepages can't be allocated by the buddy allocator" | ||
107 | #endif | ||
108 | extern int hugepage_madvise(struct vm_area_struct *vma, | ||
109 | unsigned long *vm_flags, int advice); | ||
110 | extern void __vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
111 | unsigned long start, | ||
112 | unsigned long end, | ||
113 | long adjust_next); | ||
114 | static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
115 | unsigned long start, | ||
116 | unsigned long end, | ||
117 | long adjust_next) | ||
118 | { | ||
119 | if (!vma->anon_vma || vma->vm_ops || vma->vm_file) | ||
120 | return; | ||
121 | __vma_adjust_trans_huge(vma, start, end, adjust_next); | ||
122 | } | ||
123 | static inline int hpage_nr_pages(struct page *page) | ||
124 | { | ||
125 | if (unlikely(PageTransHuge(page))) | ||
126 | return HPAGE_PMD_NR; | ||
127 | return 1; | ||
128 | } | ||
129 | static inline struct page *compound_trans_head(struct page *page) | ||
130 | { | ||
131 | if (PageTail(page)) { | ||
132 | struct page *head; | ||
133 | head = page->first_page; | ||
134 | smp_rmb(); | ||
135 | /* | ||
136 | * head may be a dangling pointer. | ||
137 | * __split_huge_page_refcount clears PageTail before | ||
138 | * overwriting first_page, so if PageTail is still | ||
139 | * there it means the head pointer isn't dangling. | ||
140 | */ | ||
141 | if (PageTail(page)) | ||
142 | return head; | ||
143 | } | ||
144 | return page; | ||
145 | } | ||
146 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
147 | #define HPAGE_PMD_SHIFT ({ BUG(); 0; }) | ||
148 | #define HPAGE_PMD_MASK ({ BUG(); 0; }) | ||
149 | #define HPAGE_PMD_SIZE ({ BUG(); 0; }) | ||
150 | |||
151 | #define hpage_nr_pages(x) 1 | ||
152 | |||
153 | #define transparent_hugepage_enabled(__vma) 0 | ||
154 | |||
155 | #define transparent_hugepage_flags 0UL | ||
156 | static inline int split_huge_page(struct page *page) | ||
157 | { | ||
158 | return 0; | ||
159 | } | ||
160 | #define split_huge_page_pmd(__mm, __pmd) \ | ||
161 | do { } while (0) | ||
162 | #define wait_split_huge_page(__anon_vma, __pmd) \ | ||
163 | do { } while (0) | ||
164 | #define compound_trans_head(page) compound_head(page) | ||
165 | static inline int hugepage_madvise(struct vm_area_struct *vma, | ||
166 | unsigned long *vm_flags, int advice) | ||
167 | { | ||
168 | BUG(); | ||
169 | return 0; | ||
170 | } | ||
171 | static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
172 | unsigned long start, | ||
173 | unsigned long end, | ||
174 | long adjust_next) | ||
175 | { | ||
176 | } | ||
177 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
178 | |||
179 | #endif /* _LINUX_HUGE_MM_H */ | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 6042228954a7..294169e31364 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -959,7 +959,7 @@ struct ieee80211_ht_info { | |||
959 | /* block-ack parameters */ | 959 | /* block-ack parameters */ |
960 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 | 960 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
961 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C | 961 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C |
962 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 | 962 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 |
963 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 | 963 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 |
964 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 | 964 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 |
965 | 965 | ||
diff --git a/include/linux/if_alg.h b/include/linux/if_alg.h new file mode 100644 index 000000000000..0f9acce5b1ff --- /dev/null +++ b/include/linux/if_alg.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * if_alg: User-space algorithm interface | ||
3 | * | ||
4 | * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _LINUX_IF_ALG_H | ||
14 | #define _LINUX_IF_ALG_H | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct sockaddr_alg { | ||
19 | __u16 salg_family; | ||
20 | __u8 salg_type[14]; | ||
21 | __u32 salg_feat; | ||
22 | __u32 salg_mask; | ||
23 | __u8 salg_name[64]; | ||
24 | }; | ||
25 | |||
26 | struct af_alg_iv { | ||
27 | __u32 ivlen; | ||
28 | __u8 iv[0]; | ||
29 | }; | ||
30 | |||
31 | /* Socket options */ | ||
32 | #define ALG_SET_KEY 1 | ||
33 | #define ALG_SET_IV 2 | ||
34 | #define ALG_SET_OP 3 | ||
35 | |||
36 | /* Operations */ | ||
37 | #define ALG_OP_DECRYPT 0 | ||
38 | #define ALG_OP_ENCRYPT 1 | ||
39 | |||
40 | #endif /* _LINUX_IF_ALG_H */ | ||
diff --git a/include/linux/input.h b/include/linux/input.h index c4e9d91ec979..e428382ca28a 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -802,6 +802,7 @@ struct input_keymap_entry { | |||
802 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ | 802 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ |
803 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | 803 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ |
804 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 804 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
805 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | ||
805 | #define SW_MAX 0x0f | 806 | #define SW_MAX 0x0f |
806 | #define SW_CNT (SW_MAX+1) | 807 | #define SW_CNT (SW_MAX+1) |
807 | 808 | ||
diff --git a/include/linux/input/as5011.h b/include/linux/input/as5011.h new file mode 100644 index 000000000000..1affd0ddfa9d --- /dev/null +++ b/include/linux/input/as5011.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _AS5011_H | ||
2 | #define _AS5011_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | struct as5011_platform_data { | ||
13 | unsigned int button_gpio; | ||
14 | unsigned int axis_irq; /* irq number */ | ||
15 | unsigned long axis_irqflags; | ||
16 | char xp, xn; /* threshold for x axis */ | ||
17 | char yp, yn; /* threshold for y axis */ | ||
18 | }; | ||
19 | |||
20 | #endif /* _AS5011_H */ | ||
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 65aae34759de..045f2f275cd0 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -454,6 +454,44 @@ unsigned int ipmi_addr_length(int addr_type); | |||
454 | /* Validate that the given IPMI address is valid. */ | 454 | /* Validate that the given IPMI address is valid. */ |
455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); | 455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); |
456 | 456 | ||
457 | /* | ||
458 | * How did the IPMI driver find out about the device? | ||
459 | */ | ||
460 | enum ipmi_addr_src { | ||
461 | SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS, | ||
462 | SI_PCI, SI_DEVICETREE, SI_DEFAULT | ||
463 | }; | ||
464 | |||
465 | union ipmi_smi_info_union { | ||
466 | /* | ||
467 | * the acpi_info element is defined for the SI_ACPI | ||
468 | * address type | ||
469 | */ | ||
470 | struct { | ||
471 | void *acpi_handle; | ||
472 | } acpi_info; | ||
473 | }; | ||
474 | |||
475 | struct ipmi_smi_info { | ||
476 | enum ipmi_addr_src addr_src; | ||
477 | |||
478 | /* | ||
479 | * Base device for the interface. Don't forget to put this when | ||
480 | * you are done. | ||
481 | */ | ||
482 | struct device *dev; | ||
483 | |||
484 | /* | ||
485 | * The addr_info provides more detailed info for some IPMI | ||
486 | * devices, depending on the addr_src. Currently only SI_ACPI | ||
487 | * info is provided. | ||
488 | */ | ||
489 | union ipmi_smi_info_union addr_info; | ||
490 | }; | ||
491 | |||
492 | /* This is to get the private info of ipmi_smi_t */ | ||
493 | extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data); | ||
494 | |||
457 | #endif /* __KERNEL__ */ | 495 | #endif /* __KERNEL__ */ |
458 | 496 | ||
459 | 497 | ||
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 4b48318ac542..906590aa6907 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
42 | #include <linux/ipmi.h> | ||
42 | 43 | ||
43 | /* This files describes the interface for IPMI system management interface | 44 | /* This files describes the interface for IPMI system management interface |
44 | drivers to bind into the IPMI message handler. */ | 45 | drivers to bind into the IPMI message handler. */ |
@@ -86,6 +87,13 @@ struct ipmi_smi_handlers { | |||
86 | int (*start_processing)(void *send_info, | 87 | int (*start_processing)(void *send_info, |
87 | ipmi_smi_t new_intf); | 88 | ipmi_smi_t new_intf); |
88 | 89 | ||
90 | /* | ||
91 | * Get the detailed private info of the low level interface and store | ||
92 | * it into the structure of ipmi_smi_data. For example: the | ||
93 | * ACPI device handle will be returned for the pnp_acpi IPMI device. | ||
94 | */ | ||
95 | int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data); | ||
96 | |||
89 | /* Called to enqueue an SMI message to be sent. This | 97 | /* Called to enqueue an SMI message to be sent. This |
90 | operation is not allowed to fail. If an error occurs, it | 98 | operation is not allowed to fail. If an error occurs, it |
91 | should report back the error in a received message. It may | 99 | should report back the error in a received message. It may |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 979c68cc7458..6a64c6fa81af 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -57,7 +57,7 @@ struct irq_desc { | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | struct timer_rand_state *timer_rand_state; | 59 | struct timer_rand_state *timer_rand_state; |
60 | unsigned int *kstat_irqs; | 60 | unsigned int __percpu *kstat_irqs; |
61 | irq_flow_handler_t handle_irq; | 61 | irq_flow_handler_t handle_irq; |
62 | struct irqaction *action; /* IRQ action list */ | 62 | struct irqaction *action; /* IRQ action list */ |
63 | unsigned int status; /* IRQ status */ | 63 | unsigned int status; /* IRQ status */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d0fbc043de60..d07d8057e440 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -143,9 +143,22 @@ extern int _cond_resched(void); | |||
143 | 143 | ||
144 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 144 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
145 | 145 | ||
146 | #define abs(x) ({ \ | 146 | /* |
147 | long __x = (x); \ | 147 | * abs() handles unsigned and signed longs, ints, shorts and chars. For all |
148 | (__x < 0) ? -__x : __x; \ | 148 | * input types abs() returns a signed long. |
149 | * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64() | ||
150 | * for those. | ||
151 | */ | ||
152 | #define abs(x) ({ \ | ||
153 | long ret; \ | ||
154 | if (sizeof(x) == sizeof(long)) { \ | ||
155 | long __x = (x); \ | ||
156 | ret = (__x < 0) ? -__x : __x; \ | ||
157 | } else { \ | ||
158 | int __x = (x); \ | ||
159 | ret = (__x < 0) ? -__x : __x; \ | ||
160 | } \ | ||
161 | ret; \ | ||
149 | }) | 162 | }) |
150 | 163 | ||
151 | #define abs64(x) ({ \ | 164 | #define abs64(x) ({ \ |
@@ -230,6 +243,8 @@ extern int test_taint(unsigned flag); | |||
230 | extern unsigned long get_taint(void); | 243 | extern unsigned long get_taint(void); |
231 | extern int root_mountflags; | 244 | extern int root_mountflags; |
232 | 245 | ||
246 | extern bool early_boot_irqs_disabled; | ||
247 | |||
233 | /* Values used for system_state */ | 248 | /* Values used for system_state */ |
234 | extern enum system_states { | 249 | extern enum system_states { |
235 | SYSTEM_BOOTING, | 250 | SYSTEM_BOOTING, |
@@ -587,6 +602,13 @@ struct sysinfo { | |||
587 | #define NUMA_BUILD 0 | 602 | #define NUMA_BUILD 0 |
588 | #endif | 603 | #endif |
589 | 604 | ||
605 | /* This helps us avoid #ifdef CONFIG_COMPACTION */ | ||
606 | #ifdef CONFIG_COMPACTION | ||
607 | #define COMPACTION_BUILD 1 | ||
608 | #else | ||
609 | #define COMPACTION_BUILD 0 | ||
610 | #endif | ||
611 | |||
590 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ | 612 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ |
591 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 613 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
592 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD | 614 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 44e83ba12b5b..0cce2db580c3 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -46,16 +46,14 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
46 | extern unsigned long long nr_context_switches(void); | 46 | extern unsigned long long nr_context_switches(void); |
47 | 47 | ||
48 | #ifndef CONFIG_GENERIC_HARDIRQS | 48 | #ifndef CONFIG_GENERIC_HARDIRQS |
49 | #define kstat_irqs_this_cpu(irq) \ | ||
50 | (this_cpu_read(kstat.irqs[irq]) | ||
51 | 49 | ||
52 | struct irq_desc; | 50 | struct irq_desc; |
53 | 51 | ||
54 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | 52 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, |
55 | struct irq_desc *desc) | 53 | struct irq_desc *desc) |
56 | { | 54 | { |
57 | kstat_this_cpu.irqs[irq]++; | 55 | __this_cpu_inc(kstat.irqs[irq]); |
58 | kstat_this_cpu.irqs_sum++; | 56 | __this_cpu_inc(kstat.irqs_sum); |
59 | } | 57 | } |
60 | 58 | ||
61 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
@@ -65,17 +63,18 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | |||
65 | #else | 63 | #else |
66 | #include <linux/irq.h> | 64 | #include <linux/irq.h> |
67 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 65 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
68 | #define kstat_irqs_this_cpu(DESC) \ | 66 | |
69 | ((DESC)->kstat_irqs[smp_processor_id()]) | 67 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ |
70 | #define kstat_incr_irqs_this_cpu(irqno, DESC) do {\ | 68 | do { \ |
71 | ((DESC)->kstat_irqs[smp_processor_id()]++);\ | 69 | __this_cpu_inc(*(DESC)->kstat_irqs); \ |
72 | kstat_this_cpu.irqs_sum++; } while (0) | 70 | __this_cpu_inc(kstat.irqs_sum); \ |
71 | } while (0) | ||
73 | 72 | ||
74 | #endif | 73 | #endif |
75 | 74 | ||
76 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | 75 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) |
77 | { | 76 | { |
78 | kstat_this_cpu.softirqs[irq]++; | 77 | __this_cpu_inc(kstat.softirqs[irq]); |
79 | } | 78 | } |
80 | 79 | ||
81 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | 80 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) |
diff --git a/include/linux/khugepaged.h b/include/linux/khugepaged.h new file mode 100644 index 000000000000..6b394f0b5148 --- /dev/null +++ b/include/linux/khugepaged.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef _LINUX_KHUGEPAGED_H | ||
2 | #define _LINUX_KHUGEPAGED_H | ||
3 | |||
4 | #include <linux/sched.h> /* MMF_VM_HUGEPAGE */ | ||
5 | |||
6 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
7 | extern int __khugepaged_enter(struct mm_struct *mm); | ||
8 | extern void __khugepaged_exit(struct mm_struct *mm); | ||
9 | extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma); | ||
10 | |||
11 | #define khugepaged_enabled() \ | ||
12 | (transparent_hugepage_flags & \ | ||
13 | ((1<<TRANSPARENT_HUGEPAGE_FLAG) | \ | ||
14 | (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG))) | ||
15 | #define khugepaged_always() \ | ||
16 | (transparent_hugepage_flags & \ | ||
17 | (1<<TRANSPARENT_HUGEPAGE_FLAG)) | ||
18 | #define khugepaged_req_madv() \ | ||
19 | (transparent_hugepage_flags & \ | ||
20 | (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)) | ||
21 | #define khugepaged_defrag() \ | ||
22 | (transparent_hugepage_flags & \ | ||
23 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)) | ||
24 | |||
25 | static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
26 | { | ||
27 | if (test_bit(MMF_VM_HUGEPAGE, &oldmm->flags)) | ||
28 | return __khugepaged_enter(mm); | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | static inline void khugepaged_exit(struct mm_struct *mm) | ||
33 | { | ||
34 | if (test_bit(MMF_VM_HUGEPAGE, &mm->flags)) | ||
35 | __khugepaged_exit(mm); | ||
36 | } | ||
37 | |||
38 | static inline int khugepaged_enter(struct vm_area_struct *vma) | ||
39 | { | ||
40 | if (!test_bit(MMF_VM_HUGEPAGE, &vma->vm_mm->flags)) | ||
41 | if ((khugepaged_always() || | ||
42 | (khugepaged_req_madv() && | ||
43 | vma->vm_flags & VM_HUGEPAGE)) && | ||
44 | !(vma->vm_flags & VM_NOHUGEPAGE)) | ||
45 | if (__khugepaged_enter(vma->vm_mm)) | ||
46 | return -ENOMEM; | ||
47 | return 0; | ||
48 | } | ||
49 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
50 | static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | static inline void khugepaged_exit(struct mm_struct *mm) | ||
55 | { | ||
56 | } | ||
57 | static inline int khugepaged_enter(struct vm_area_struct *vma) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | static inline int khugepaged_enter_vma_merge(struct vm_area_struct *vma) | ||
62 | { | ||
63 | return 0; | ||
64 | } | ||
65 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
66 | |||
67 | #endif /* _LINUX_KHUGEPAGED_H */ | ||
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index 24b44145a886..2a0d7d651dc3 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -18,6 +18,10 @@ enum kmsg_dump_reason { | |||
18 | KMSG_DUMP_OOPS, | 18 | KMSG_DUMP_OOPS, |
19 | KMSG_DUMP_PANIC, | 19 | KMSG_DUMP_PANIC, |
20 | KMSG_DUMP_KEXEC, | 20 | KMSG_DUMP_KEXEC, |
21 | KMSG_DUMP_RESTART, | ||
22 | KMSG_DUMP_HALT, | ||
23 | KMSG_DUMP_POWEROFF, | ||
24 | KMSG_DUMP_EMERG, | ||
21 | }; | 25 | }; |
22 | 26 | ||
23 | /** | 27 | /** |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 919ae53adc5c..ea2dc1a2e13d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -540,6 +540,7 @@ struct kvm_ppc_pvinfo { | |||
540 | #endif | 540 | #endif |
541 | #define KVM_CAP_PPC_GET_PVINFO 57 | 541 | #define KVM_CAP_PPC_GET_PVINFO 57 |
542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 | 542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 |
543 | #define KVM_CAP_ASYNC_PF 59 | ||
543 | 544 | ||
544 | #ifdef KVM_CAP_IRQ_ROUTING | 545 | #ifdef KVM_CAP_IRQ_ROUTING |
545 | 546 | ||
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a0557422715e..b5021db21858 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
18 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
19 | #include <linux/slab.h> | ||
20 | #include <linux/rcupdate.h> | ||
19 | #include <asm/signal.h> | 21 | #include <asm/signal.h> |
20 | 22 | ||
21 | #include <linux/kvm.h> | 23 | #include <linux/kvm.h> |
@@ -40,6 +42,7 @@ | |||
40 | #define KVM_REQ_KICK 9 | 42 | #define KVM_REQ_KICK 9 |
41 | #define KVM_REQ_DEACTIVATE_FPU 10 | 43 | #define KVM_REQ_DEACTIVATE_FPU 10 |
42 | #define KVM_REQ_EVENT 11 | 44 | #define KVM_REQ_EVENT 11 |
45 | #define KVM_REQ_APF_HALT 12 | ||
43 | 46 | ||
44 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 47 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
45 | 48 | ||
@@ -74,6 +77,27 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | |||
74 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 77 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
75 | struct kvm_io_device *dev); | 78 | struct kvm_io_device *dev); |
76 | 79 | ||
80 | #ifdef CONFIG_KVM_ASYNC_PF | ||
81 | struct kvm_async_pf { | ||
82 | struct work_struct work; | ||
83 | struct list_head link; | ||
84 | struct list_head queue; | ||
85 | struct kvm_vcpu *vcpu; | ||
86 | struct mm_struct *mm; | ||
87 | gva_t gva; | ||
88 | unsigned long addr; | ||
89 | struct kvm_arch_async_pf arch; | ||
90 | struct page *page; | ||
91 | bool done; | ||
92 | }; | ||
93 | |||
94 | void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); | ||
95 | void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu); | ||
96 | int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, | ||
97 | struct kvm_arch_async_pf *arch); | ||
98 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | ||
99 | #endif | ||
100 | |||
77 | struct kvm_vcpu { | 101 | struct kvm_vcpu { |
78 | struct kvm *kvm; | 102 | struct kvm *kvm; |
79 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 103 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
@@ -104,6 +128,15 @@ struct kvm_vcpu { | |||
104 | gpa_t mmio_phys_addr; | 128 | gpa_t mmio_phys_addr; |
105 | #endif | 129 | #endif |
106 | 130 | ||
131 | #ifdef CONFIG_KVM_ASYNC_PF | ||
132 | struct { | ||
133 | u32 queued; | ||
134 | struct list_head queue; | ||
135 | struct list_head done; | ||
136 | spinlock_t lock; | ||
137 | } async_pf; | ||
138 | #endif | ||
139 | |||
107 | struct kvm_vcpu_arch arch; | 140 | struct kvm_vcpu_arch arch; |
108 | }; | 141 | }; |
109 | 142 | ||
@@ -113,16 +146,19 @@ struct kvm_vcpu { | |||
113 | */ | 146 | */ |
114 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | 147 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) |
115 | 148 | ||
149 | struct kvm_lpage_info { | ||
150 | unsigned long rmap_pde; | ||
151 | int write_count; | ||
152 | }; | ||
153 | |||
116 | struct kvm_memory_slot { | 154 | struct kvm_memory_slot { |
117 | gfn_t base_gfn; | 155 | gfn_t base_gfn; |
118 | unsigned long npages; | 156 | unsigned long npages; |
119 | unsigned long flags; | 157 | unsigned long flags; |
120 | unsigned long *rmap; | 158 | unsigned long *rmap; |
121 | unsigned long *dirty_bitmap; | 159 | unsigned long *dirty_bitmap; |
122 | struct { | 160 | unsigned long *dirty_bitmap_head; |
123 | unsigned long rmap_pde; | 161 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
124 | int write_count; | ||
125 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; | ||
126 | unsigned long userspace_addr; | 162 | unsigned long userspace_addr; |
127 | int user_alloc; | 163 | int user_alloc; |
128 | int id; | 164 | int id; |
@@ -169,6 +205,7 @@ struct kvm_irq_routing_table {}; | |||
169 | 205 | ||
170 | struct kvm_memslots { | 206 | struct kvm_memslots { |
171 | int nmemslots; | 207 | int nmemslots; |
208 | u64 generation; | ||
172 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 209 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
173 | KVM_PRIVATE_MEM_SLOTS]; | 210 | KVM_PRIVATE_MEM_SLOTS]; |
174 | }; | 211 | }; |
@@ -206,6 +243,10 @@ struct kvm { | |||
206 | 243 | ||
207 | struct mutex irq_lock; | 244 | struct mutex irq_lock; |
208 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 245 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
246 | /* | ||
247 | * Update side is protected by irq_lock and, | ||
248 | * if configured, irqfds.lock. | ||
249 | */ | ||
209 | struct kvm_irq_routing_table __rcu *irq_routing; | 250 | struct kvm_irq_routing_table __rcu *irq_routing; |
210 | struct hlist_head mask_notifier_list; | 251 | struct hlist_head mask_notifier_list; |
211 | struct hlist_head irq_ack_notifier_list; | 252 | struct hlist_head irq_ack_notifier_list; |
@@ -216,6 +257,7 @@ struct kvm { | |||
216 | unsigned long mmu_notifier_seq; | 257 | unsigned long mmu_notifier_seq; |
217 | long mmu_notifier_count; | 258 | long mmu_notifier_count; |
218 | #endif | 259 | #endif |
260 | long tlbs_dirty; | ||
219 | }; | 261 | }; |
220 | 262 | ||
221 | /* The guest did something we don't support. */ | 263 | /* The guest did something we don't support. */ |
@@ -302,7 +344,11 @@ void kvm_set_page_accessed(struct page *page); | |||
302 | 344 | ||
303 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); | 345 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); |
304 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); | 346 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); |
347 | pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async, | ||
348 | bool write_fault, bool *writable); | ||
305 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); | 349 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); |
350 | pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | ||
351 | bool *writable); | ||
306 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 352 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
307 | struct kvm_memory_slot *slot, gfn_t gfn); | 353 | struct kvm_memory_slot *slot, gfn_t gfn); |
308 | int memslot_id(struct kvm *kvm, gfn_t gfn); | 354 | int memslot_id(struct kvm *kvm, gfn_t gfn); |
@@ -321,18 +367,25 @@ int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, | |||
321 | int offset, int len); | 367 | int offset, int len); |
322 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | 368 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, |
323 | unsigned long len); | 369 | unsigned long len); |
370 | int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
371 | void *data, unsigned long len); | ||
372 | int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
373 | gpa_t gpa); | ||
324 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); | 374 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); |
325 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); | 375 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); |
326 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | 376 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); |
327 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | 377 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); |
328 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); | 378 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); |
329 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 379 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
380 | void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | ||
381 | gfn_t gfn); | ||
330 | 382 | ||
331 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 383 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
332 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 384 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
333 | void kvm_resched(struct kvm_vcpu *vcpu); | 385 | void kvm_resched(struct kvm_vcpu *vcpu); |
334 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 386 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
335 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 387 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
388 | |||
336 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 389 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
337 | void kvm_reload_remote_mmus(struct kvm *kvm); | 390 | void kvm_reload_remote_mmus(struct kvm *kvm); |
338 | 391 | ||
@@ -398,7 +451,19 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | |||
398 | 451 | ||
399 | void kvm_free_physmem(struct kvm *kvm); | 452 | void kvm_free_physmem(struct kvm *kvm); |
400 | 453 | ||
401 | struct kvm *kvm_arch_create_vm(void); | 454 | #ifndef __KVM_HAVE_ARCH_VM_ALLOC |
455 | static inline struct kvm *kvm_arch_alloc_vm(void) | ||
456 | { | ||
457 | return kzalloc(sizeof(struct kvm), GFP_KERNEL); | ||
458 | } | ||
459 | |||
460 | static inline void kvm_arch_free_vm(struct kvm *kvm) | ||
461 | { | ||
462 | kfree(kvm); | ||
463 | } | ||
464 | #endif | ||
465 | |||
466 | int kvm_arch_init_vm(struct kvm *kvm); | ||
402 | void kvm_arch_destroy_vm(struct kvm *kvm); | 467 | void kvm_arch_destroy_vm(struct kvm *kvm); |
403 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 468 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
404 | void kvm_arch_sync_events(struct kvm *kvm); | 469 | void kvm_arch_sync_events(struct kvm *kvm); |
@@ -414,16 +479,8 @@ struct kvm_irq_ack_notifier { | |||
414 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | 479 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); |
415 | }; | 480 | }; |
416 | 481 | ||
417 | #define KVM_ASSIGNED_MSIX_PENDING 0x1 | ||
418 | struct kvm_guest_msix_entry { | ||
419 | u32 vector; | ||
420 | u16 entry; | ||
421 | u16 flags; | ||
422 | }; | ||
423 | |||
424 | struct kvm_assigned_dev_kernel { | 482 | struct kvm_assigned_dev_kernel { |
425 | struct kvm_irq_ack_notifier ack_notifier; | 483 | struct kvm_irq_ack_notifier ack_notifier; |
426 | struct work_struct interrupt_work; | ||
427 | struct list_head list; | 484 | struct list_head list; |
428 | int assigned_dev_id; | 485 | int assigned_dev_id; |
429 | int host_segnr; | 486 | int host_segnr; |
@@ -434,13 +491,14 @@ struct kvm_assigned_dev_kernel { | |||
434 | bool host_irq_disabled; | 491 | bool host_irq_disabled; |
435 | struct msix_entry *host_msix_entries; | 492 | struct msix_entry *host_msix_entries; |
436 | int guest_irq; | 493 | int guest_irq; |
437 | struct kvm_guest_msix_entry *guest_msix_entries; | 494 | struct msix_entry *guest_msix_entries; |
438 | unsigned long irq_requested_type; | 495 | unsigned long irq_requested_type; |
439 | int irq_source_id; | 496 | int irq_source_id; |
440 | int flags; | 497 | int flags; |
441 | struct pci_dev *dev; | 498 | struct pci_dev *dev; |
442 | struct kvm *kvm; | 499 | struct kvm *kvm; |
443 | spinlock_t assigned_dev_lock; | 500 | spinlock_t intx_lock; |
501 | char irq_name[32]; | ||
444 | }; | 502 | }; |
445 | 503 | ||
446 | struct kvm_irq_mask_notifier { | 504 | struct kvm_irq_mask_notifier { |
@@ -462,6 +520,8 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | |||
462 | unsigned long *deliver_bitmask); | 520 | unsigned long *deliver_bitmask); |
463 | #endif | 521 | #endif |
464 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 522 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
523 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | ||
524 | int irq_source_id, int level); | ||
465 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 525 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
466 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 526 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
467 | struct kvm_irq_ack_notifier *kian); | 527 | struct kvm_irq_ack_notifier *kian); |
@@ -603,17 +663,28 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {} | |||
603 | void kvm_eventfd_init(struct kvm *kvm); | 663 | void kvm_eventfd_init(struct kvm *kvm); |
604 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); | 664 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); |
605 | void kvm_irqfd_release(struct kvm *kvm); | 665 | void kvm_irqfd_release(struct kvm *kvm); |
666 | void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); | ||
606 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | 667 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); |
607 | 668 | ||
608 | #else | 669 | #else |
609 | 670 | ||
610 | static inline void kvm_eventfd_init(struct kvm *kvm) {} | 671 | static inline void kvm_eventfd_init(struct kvm *kvm) {} |
672 | |||
611 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) | 673 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) |
612 | { | 674 | { |
613 | return -EINVAL; | 675 | return -EINVAL; |
614 | } | 676 | } |
615 | 677 | ||
616 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | 678 | static inline void kvm_irqfd_release(struct kvm *kvm) {} |
679 | |||
680 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | ||
681 | static inline void kvm_irq_routing_update(struct kvm *kvm, | ||
682 | struct kvm_irq_routing_table *irq_rt) | ||
683 | { | ||
684 | rcu_assign_pointer(kvm->irq_routing, irq_rt); | ||
685 | } | ||
686 | #endif | ||
687 | |||
617 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 688 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) |
618 | { | 689 | { |
619 | return -ENOSYS; | 690 | return -ENOSYS; |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 7ac0d4eee430..fa7cc7244cbd 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
@@ -67,4 +67,11 @@ struct kvm_lapic_irq { | |||
67 | u32 dest_id; | 67 | u32 dest_id; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct gfn_to_hva_cache { | ||
71 | u64 generation; | ||
72 | gpa_t gpa; | ||
73 | unsigned long hva; | ||
74 | struct kvm_memory_slot *memslot; | ||
75 | }; | ||
76 | |||
70 | #endif /* __KVM_TYPES_H__ */ | 77 | #endif /* __KVM_TYPES_H__ */ |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h index 38368d785f08..fd548d2a8775 100644 --- a/include/linux/leds-lp5521.h +++ b/include/linux/leds-lp5521.h | |||
@@ -42,6 +42,7 @@ struct lp5521_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5521_H */ | 48 | #endif /* __LINUX_LP5521_H */ |
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h index 796747637b80..2694289babd0 100644 --- a/include/linux/leds-lp5523.h +++ b/include/linux/leds-lp5523.h | |||
@@ -42,6 +42,7 @@ struct lp5523_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5523_H */ | 48 | #endif /* __LINUX_LP5523_H */ |
diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index 9ee97e7f2be4..5bad17d1acde 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h | |||
@@ -62,7 +62,8 @@ static inline void hlist_bl_set_first(struct hlist_bl_head *h, | |||
62 | struct hlist_bl_node *n) | 62 | struct hlist_bl_node *n) |
63 | { | 63 | { |
64 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | 64 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); |
65 | LIST_BL_BUG_ON(!((unsigned long)h->first & LIST_BL_LOCKMASK)); | 65 | LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != |
66 | LIST_BL_LOCKMASK); | ||
66 | h->first = (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK); | 67 | h->first = (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK); |
67 | } | 68 | } |
68 | 69 | ||
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 71c09b26c759..f638fd78d106 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -436,16 +436,8 @@ do { \ | |||
436 | #endif /* CONFIG_LOCKDEP */ | 436 | #endif /* CONFIG_LOCKDEP */ |
437 | 437 | ||
438 | #ifdef CONFIG_TRACE_IRQFLAGS | 438 | #ifdef CONFIG_TRACE_IRQFLAGS |
439 | extern void early_boot_irqs_off(void); | ||
440 | extern void early_boot_irqs_on(void); | ||
441 | extern void print_irqtrace_events(struct task_struct *curr); | 439 | extern void print_irqtrace_events(struct task_struct *curr); |
442 | #else | 440 | #else |
443 | static inline void early_boot_irqs_off(void) | ||
444 | { | ||
445 | } | ||
446 | static inline void early_boot_irqs_on(void) | ||
447 | { | ||
448 | } | ||
449 | static inline void print_irqtrace_events(struct task_struct *curr) | 441 | static inline void print_irqtrace_events(struct task_struct *curr) |
450 | { | 442 | { |
451 | } | 443 | } |
diff --git a/include/linux/magic.h b/include/linux/magic.h index ff690d05f129..62730ea2b56e 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define TMPFS_MAGIC 0x01021994 | 16 | #define TMPFS_MAGIC 0x01021994 |
17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | 17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ |
18 | #define SQUASHFS_MAGIC 0x73717368 | 18 | #define SQUASHFS_MAGIC 0x73717368 |
19 | #define ECRYPTFS_SUPER_MAGIC 0xf15f | ||
19 | #define EFS_SUPER_MAGIC 0x414A53 | 20 | #define EFS_SUPER_MAGIC 0x414A53 |
20 | #define EXT2_SUPER_MAGIC 0xEF53 | 21 | #define EXT2_SUPER_MAGIC 0xEF53 |
21 | #define EXT3_SUPER_MAGIC 0xEF53 | 22 | #define EXT3_SUPER_MAGIC 0xEF53 |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 159a0762aeaf..f512e189be5a 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -25,6 +25,11 @@ struct page_cgroup; | |||
25 | struct page; | 25 | struct page; |
26 | struct mm_struct; | 26 | struct mm_struct; |
27 | 27 | ||
28 | /* Stats that can be updated by kernel. */ | ||
29 | enum mem_cgroup_page_stat_item { | ||
30 | MEMCG_NR_FILE_MAPPED, /* # of pages charged as file rss */ | ||
31 | }; | ||
32 | |||
28 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 33 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
29 | struct list_head *dst, | 34 | struct list_head *dst, |
30 | unsigned long *scanned, int order, | 35 | unsigned long *scanned, int order, |
@@ -93,7 +98,7 @@ extern int | |||
93 | mem_cgroup_prepare_migration(struct page *page, | 98 | mem_cgroup_prepare_migration(struct page *page, |
94 | struct page *newpage, struct mem_cgroup **ptr); | 99 | struct page *newpage, struct mem_cgroup **ptr); |
95 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 100 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, |
96 | struct page *oldpage, struct page *newpage); | 101 | struct page *oldpage, struct page *newpage, bool migration_ok); |
97 | 102 | ||
98 | /* | 103 | /* |
99 | * For memory reclaim. | 104 | * For memory reclaim. |
@@ -121,11 +126,30 @@ static inline bool mem_cgroup_disabled(void) | |||
121 | return false; | 126 | return false; |
122 | } | 127 | } |
123 | 128 | ||
124 | void mem_cgroup_update_file_mapped(struct page *page, int val); | 129 | void mem_cgroup_update_page_stat(struct page *page, |
130 | enum mem_cgroup_page_stat_item idx, | ||
131 | int val); | ||
132 | |||
133 | static inline void mem_cgroup_inc_page_stat(struct page *page, | ||
134 | enum mem_cgroup_page_stat_item idx) | ||
135 | { | ||
136 | mem_cgroup_update_page_stat(page, idx, 1); | ||
137 | } | ||
138 | |||
139 | static inline void mem_cgroup_dec_page_stat(struct page *page, | ||
140 | enum mem_cgroup_page_stat_item idx) | ||
141 | { | ||
142 | mem_cgroup_update_page_stat(page, idx, -1); | ||
143 | } | ||
144 | |||
125 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 145 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
126 | gfp_t gfp_mask); | 146 | gfp_t gfp_mask); |
127 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 147 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); |
128 | 148 | ||
149 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
150 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | ||
151 | #endif | ||
152 | |||
129 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 153 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
130 | struct mem_cgroup; | 154 | struct mem_cgroup; |
131 | 155 | ||
@@ -231,8 +255,7 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage, | |||
231 | } | 255 | } |
232 | 256 | ||
233 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, | 257 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, |
234 | struct page *oldpage, | 258 | struct page *oldpage, struct page *newpage, bool migration_ok) |
235 | struct page *newpage) | ||
236 | { | 259 | { |
237 | } | 260 | } |
238 | 261 | ||
@@ -293,8 +316,13 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
293 | { | 316 | { |
294 | } | 317 | } |
295 | 318 | ||
296 | static inline void mem_cgroup_update_file_mapped(struct page *page, | 319 | static inline void mem_cgroup_inc_page_stat(struct page *page, |
297 | int val) | 320 | enum mem_cgroup_page_stat_item idx) |
321 | { | ||
322 | } | ||
323 | |||
324 | static inline void mem_cgroup_dec_page_stat(struct page *page, | ||
325 | enum mem_cgroup_page_stat_item idx) | ||
298 | { | 326 | { |
299 | } | 327 | } |
300 | 328 | ||
@@ -311,6 +339,11 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | |||
311 | return 0; | 339 | return 0; |
312 | } | 340 | } |
313 | 341 | ||
342 | static inline void mem_cgroup_split_huge_fixup(struct page *head, | ||
343 | struct page *tail) | ||
344 | { | ||
345 | } | ||
346 | |||
314 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 347 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
315 | 348 | ||
316 | #endif /* _LINUX_MEMCONTROL_H */ | 349 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 31c237a00c48..8122018d3000 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -13,12 +13,16 @@ struct mem_section; | |||
13 | #ifdef CONFIG_MEMORY_HOTPLUG | 13 | #ifdef CONFIG_MEMORY_HOTPLUG |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Types for free bootmem. | 16 | * Types for free bootmem stored in page->lru.next. These have to be in |
17 | * The normal smallest mapcount is -1. Here is smaller value than it. | 17 | * some random range in unsigned long space for debugging purposes. |
18 | */ | 18 | */ |
19 | #define SECTION_INFO (-1 - 1) | 19 | enum { |
20 | #define MIX_SECTION_INFO (-1 - 2) | 20 | MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 12, |
21 | #define NODE_INFO (-1 - 3) | 21 | SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE, |
22 | MIX_SECTION_INFO, | ||
23 | NODE_INFO, | ||
24 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, | ||
25 | }; | ||
22 | 26 | ||
23 | /* | 27 | /* |
24 | * pgdat resizing functions | 28 | * pgdat resizing functions |
@@ -161,6 +165,12 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
161 | extern void put_page_bootmem(struct page *page); | 165 | extern void put_page_bootmem(struct page *page); |
162 | #endif | 166 | #endif |
163 | 167 | ||
168 | /* | ||
169 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | ||
170 | * notifier will be called under this. 2) offline/online/add/remove memory | ||
171 | * will not run simultaneously. | ||
172 | */ | ||
173 | |||
164 | void lock_memory_hotplug(void); | 174 | void lock_memory_hotplug(void); |
165 | void unlock_memory_hotplug(void); | 175 | void unlock_memory_hotplug(void); |
166 | 176 | ||
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index d63b6050b183..37f56b7c4c15 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -74,32 +74,37 @@ | |||
74 | #define AB8500_INT_ACC_DETECT_21DB_F 37 | 74 | #define AB8500_INT_ACC_DETECT_21DB_F 37 |
75 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | 75 | #define AB8500_INT_ACC_DETECT_21DB_R 38 |
76 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | 76 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 |
77 | #define AB8500_INT_BTEMP_LOW 72 | 77 | #define AB8500_INT_ADP_SOURCE_ERROR 72 |
78 | #define AB8500_INT_BTEMP_LOW_MEDIUM 73 | 78 | #define AB8500_INT_ADP_SINK_ERROR 73 |
79 | #define AB8500_INT_BTEMP_MEDIUM_HIGH 74 | 79 | #define AB8500_INT_ADP_PROBE_PLUG 74 |
80 | #define AB8500_INT_BTEMP_HIGH 75 | 80 | #define AB8500_INT_ADP_PROBE_UNPLUG 75 |
81 | #define AB8500_INT_USB_CHARGER_NOT_OK 81 | 81 | #define AB8500_INT_ADP_SENSE_OFF 76 |
82 | #define AB8500_INT_ID_WAKEUP_R 82 | 82 | #define AB8500_INT_USB_PHY_POWER_ERR 78 |
83 | #define AB8500_INT_ID_DET_R1R 84 | 83 | #define AB8500_INT_USB_LINK_STATUS 79 |
84 | #define AB8500_INT_ID_DET_R2R 85 | 84 | #define AB8500_INT_BTEMP_LOW 80 |
85 | #define AB8500_INT_ID_DET_R3R 86 | 85 | #define AB8500_INT_BTEMP_LOW_MEDIUM 81 |
86 | #define AB8500_INT_ID_DET_R4R 87 | 86 | #define AB8500_INT_BTEMP_MEDIUM_HIGH 82 |
87 | #define AB8500_INT_ID_WAKEUP_F 88 | 87 | #define AB8500_INT_BTEMP_HIGH 83 |
88 | #define AB8500_INT_ID_DET_R1F 90 | 88 | #define AB8500_INT_USB_CHARGER_NOT_OK 89 |
89 | #define AB8500_INT_ID_DET_R2F 91 | 89 | #define AB8500_INT_ID_WAKEUP_R 90 |
90 | #define AB8500_INT_ID_DET_R3F 92 | 90 | #define AB8500_INT_ID_DET_R1R 92 |
91 | #define AB8500_INT_ID_DET_R4F 93 | 91 | #define AB8500_INT_ID_DET_R2R 93 |
92 | #define AB8500_INT_USB_CHG_DET_DONE 94 | 92 | #define AB8500_INT_ID_DET_R3R 94 |
93 | #define AB8500_INT_USB_CH_TH_PROT_F 96 | 93 | #define AB8500_INT_ID_DET_R4R 95 |
94 | #define AB8500_INT_USB_CH_TH_PROP_R 97 | 94 | #define AB8500_INT_ID_WAKEUP_F 96 |
95 | #define AB8500_INT_MAIN_CH_TH_PROP_F 98 | 95 | #define AB8500_INT_ID_DET_R1F 98 |
96 | #define AB8500_INT_MAIN_CH_TH_PROT_R 99 | 96 | #define AB8500_INT_ID_DET_R2F 99 |
97 | #define AB8500_INT_USB_CHARGER_NOT_OKF 103 | 97 | #define AB8500_INT_ID_DET_R3F 100 |
98 | #define AB8500_INT_ID_DET_R4F 101 | ||
99 | #define AB8500_INT_USB_CHG_DET_DONE 102 | ||
100 | #define AB8500_INT_USB_CH_TH_PROT_F 104 | ||
101 | #define AB8500_INT_USB_CH_TH_PROT_R 105 | ||
102 | #define AB8500_INT_MAIN_CH_TH_PROT_F 106 | ||
103 | #define AB8500_INT_MAIN_CH_TH_PROT_R 107 | ||
104 | #define AB8500_INT_USB_CHARGER_NOT_OKF 111 | ||
98 | 105 | ||
99 | #define AB8500_NR_IRQS 104 | 106 | #define AB8500_NR_IRQS 112 |
100 | #define AB8500_NUM_IRQ_REGS 13 | 107 | #define AB8500_NUM_IRQ_REGS 14 |
101 | |||
102 | #define AB8500_NUM_REGULATORS 15 | ||
103 | 108 | ||
104 | /** | 109 | /** |
105 | * struct ab8500 - ab8500 internal structure | 110 | * struct ab8500 - ab8500 internal structure |
@@ -145,7 +150,8 @@ struct regulator_init_data; | |||
145 | struct ab8500_platform_data { | 150 | struct ab8500_platform_data { |
146 | int irq_base; | 151 | int irq_base; |
147 | void (*init) (struct ab8500 *); | 152 | void (*init) (struct ab8500 *); |
148 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; | 153 | int num_regulator; |
154 | struct regulator_init_data *regulator; | ||
149 | }; | 155 | }; |
150 | 156 | ||
151 | extern int __devinit ab8500_init(struct ab8500 *ab8500); | 157 | extern int __devinit ab8500_init(struct ab8500 *ab8500); |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cb93d80aa642..835996e167e1 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -39,7 +39,7 @@ struct mfd_cell { | |||
39 | size_t data_size; | 39 | size_t data_size; |
40 | 40 | ||
41 | /* | 41 | /* |
42 | * This resources can be specified relatievly to the parent device. | 42 | * This resources can be specified relatively to the parent device. |
43 | * For accessing device you should use resources from device | 43 | * For accessing device you should use resources from device |
44 | */ | 44 | */ |
45 | int num_resources; | 45 | int num_resources; |
@@ -47,6 +47,12 @@ struct mfd_cell { | |||
47 | 47 | ||
48 | /* don't check for resource conflicts */ | 48 | /* don't check for resource conflicts */ |
49 | bool ignore_resource_conflicts; | 49 | bool ignore_resource_conflicts; |
50 | |||
51 | /* | ||
52 | * Disable runtime PM callbacks for this subdevice - see | ||
53 | * pm_runtime_no_callbacks(). | ||
54 | */ | ||
55 | bool pm_runtime_no_callbacks; | ||
50 | }; | 56 | }; |
51 | 57 | ||
52 | extern int mfd_add_devices(struct device *parent, int id, | 58 | extern int mfd_add_devices(struct device *parent, int id, |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 7363dea6bbcd..effa5d3b96ae 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
@@ -159,10 +159,12 @@ struct max8998_dev { | |||
159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; | 159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; |
160 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; | 160 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; |
161 | int type; | 161 | int type; |
162 | bool wakeup; | ||
162 | }; | 163 | }; |
163 | 164 | ||
164 | int max8998_irq_init(struct max8998_dev *max8998); | 165 | int max8998_irq_init(struct max8998_dev *max8998); |
165 | void max8998_irq_exit(struct max8998_dev *max8998); | 166 | void max8998_irq_exit(struct max8998_dev *max8998); |
167 | int max8998_irq_resume(struct max8998_dev *max8998); | ||
166 | 168 | ||
167 | extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); | 169 | extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); |
168 | extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count, | 170 | extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count, |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index f8c9f884aff2..61daa167b576 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -70,24 +70,43 @@ struct max8998_regulator_data { | |||
70 | * @num_regulators: number of regultors used | 70 | * @num_regulators: number of regultors used |
71 | * @irq_base: base IRQ number for max8998, required for IRQs | 71 | * @irq_base: base IRQ number for max8998, required for IRQs |
72 | * @ono: power onoff IRQ number for max8998 | 72 | * @ono: power onoff IRQ number for max8998 |
73 | * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1 | 73 | * @buck_voltage_lock: Do NOT change the values of the following six |
74 | * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2 | 74 | * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot |
75 | * @buck2_max_voltage: BUCK2 maximum alowed voltage | 75 | * be other than the preset values. |
76 | * @buck1_voltage1: BUCK1 DVS mode 1 voltage register | ||
77 | * @buck1_voltage2: BUCK1 DVS mode 2 voltage register | ||
78 | * @buck1_voltage3: BUCK1 DVS mode 3 voltage register | ||
79 | * @buck1_voltage4: BUCK1 DVS mode 4 voltage register | ||
80 | * @buck2_voltage1: BUCK2 DVS mode 1 voltage register | ||
81 | * @buck2_voltage2: BUCK2 DVS mode 2 voltage register | ||
76 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage | 82 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage |
77 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage | 83 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage |
84 | * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 | ||
78 | * @buck2_set3: BUCK2 gpio pin to set output voltage | 85 | * @buck2_set3: BUCK2 gpio pin to set output voltage |
86 | * @buck2_default_idx: Default for BUCK2 gpio pin. | ||
87 | * @wakeup: Allow to wake up from suspend | ||
88 | * @rtc_delay: LP3974 RTC chip bug that requires delay after a register | ||
89 | * write before reading it. | ||
79 | */ | 90 | */ |
80 | struct max8998_platform_data { | 91 | struct max8998_platform_data { |
81 | struct max8998_regulator_data *regulators; | 92 | struct max8998_regulator_data *regulators; |
82 | int num_regulators; | 93 | int num_regulators; |
83 | int irq_base; | 94 | int irq_base; |
84 | int ono; | 95 | int ono; |
85 | int buck1_max_voltage1; | 96 | bool buck_voltage_lock; |
86 | int buck1_max_voltage2; | 97 | int buck1_voltage1; |
87 | int buck2_max_voltage; | 98 | int buck1_voltage2; |
99 | int buck1_voltage3; | ||
100 | int buck1_voltage4; | ||
101 | int buck2_voltage1; | ||
102 | int buck2_voltage2; | ||
88 | int buck1_set1; | 103 | int buck1_set1; |
89 | int buck1_set2; | 104 | int buck1_set2; |
105 | int buck1_default_idx; | ||
90 | int buck2_set3; | 106 | int buck2_set3; |
107 | int buck2_default_idx; | ||
108 | bool wakeup; | ||
109 | bool rtc_delay; | ||
91 | }; | 110 | }; |
92 | 111 | ||
93 | #endif /* __LINUX_MFD_MAX8998_H */ | 112 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index b4c741e352c2..7d0f3d6a0002 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
2 | * Copyright 2009-2010 Pengutronix | 3 | * Copyright 2009-2010 Pengutronix |
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | 4 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
4 | * | 5 | * |
@@ -122,39 +123,39 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
122 | unsigned int channel, unsigned int *sample); | 123 | unsigned int channel, unsigned int *sample); |
123 | 124 | ||
124 | 125 | ||
125 | #define MC13783_SW_SW1A 0 | 126 | #define MC13783_REG_SW1A 0 |
126 | #define MC13783_SW_SW1B 1 | 127 | #define MC13783_REG_SW1B 1 |
127 | #define MC13783_SW_SW2A 2 | 128 | #define MC13783_REG_SW2A 2 |
128 | #define MC13783_SW_SW2B 3 | 129 | #define MC13783_REG_SW2B 3 |
129 | #define MC13783_SW_SW3 4 | 130 | #define MC13783_REG_SW3 4 |
130 | #define MC13783_SW_PLL 5 | 131 | #define MC13783_REG_PLL 5 |
131 | #define MC13783_REGU_VAUDIO 6 | 132 | #define MC13783_REG_VAUDIO 6 |
132 | #define MC13783_REGU_VIOHI 7 | 133 | #define MC13783_REG_VIOHI 7 |
133 | #define MC13783_REGU_VIOLO 8 | 134 | #define MC13783_REG_VIOLO 8 |
134 | #define MC13783_REGU_VDIG 9 | 135 | #define MC13783_REG_VDIG 9 |
135 | #define MC13783_REGU_VGEN 10 | 136 | #define MC13783_REG_VGEN 10 |
136 | #define MC13783_REGU_VRFDIG 11 | 137 | #define MC13783_REG_VRFDIG 11 |
137 | #define MC13783_REGU_VRFREF 12 | 138 | #define MC13783_REG_VRFREF 12 |
138 | #define MC13783_REGU_VRFCP 13 | 139 | #define MC13783_REG_VRFCP 13 |
139 | #define MC13783_REGU_VSIM 14 | 140 | #define MC13783_REG_VSIM 14 |
140 | #define MC13783_REGU_VESIM 15 | 141 | #define MC13783_REG_VESIM 15 |
141 | #define MC13783_REGU_VCAM 16 | 142 | #define MC13783_REG_VCAM 16 |
142 | #define MC13783_REGU_VRFBG 17 | 143 | #define MC13783_REG_VRFBG 17 |
143 | #define MC13783_REGU_VVIB 18 | 144 | #define MC13783_REG_VVIB 18 |
144 | #define MC13783_REGU_VRF1 19 | 145 | #define MC13783_REG_VRF1 19 |
145 | #define MC13783_REGU_VRF2 20 | 146 | #define MC13783_REG_VRF2 20 |
146 | #define MC13783_REGU_VMMC1 21 | 147 | #define MC13783_REG_VMMC1 21 |
147 | #define MC13783_REGU_VMMC2 22 | 148 | #define MC13783_REG_VMMC2 22 |
148 | #define MC13783_REGU_GPO1 23 | 149 | #define MC13783_REG_GPO1 23 |
149 | #define MC13783_REGU_GPO2 24 | 150 | #define MC13783_REG_GPO2 24 |
150 | #define MC13783_REGU_GPO3 25 | 151 | #define MC13783_REG_GPO3 25 |
151 | #define MC13783_REGU_GPO4 26 | 152 | #define MC13783_REG_GPO4 26 |
152 | #define MC13783_REGU_V1 27 | 153 | #define MC13783_REG_V1 27 |
153 | #define MC13783_REGU_V2 28 | 154 | #define MC13783_REG_V2 28 |
154 | #define MC13783_REGU_V3 29 | 155 | #define MC13783_REG_V3 29 |
155 | #define MC13783_REGU_V4 30 | 156 | #define MC13783_REG_V4 30 |
156 | #define MC13783_REGU_PWGT1SPI 31 | 157 | #define MC13783_REG_PWGT1SPI 31 |
157 | #define MC13783_REGU_PWGT2SPI 32 | 158 | #define MC13783_REG_PWGT2SPI 32 |
158 | 159 | ||
159 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE | 160 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE |
160 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE | 161 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE |
diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h new file mode 100644 index 000000000000..a00f2bec178c --- /dev/null +++ b/include/linux/mfd/mc13892.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_MFD_MC13892_H | ||
10 | #define __LINUX_MFD_MC13892_H | ||
11 | |||
12 | #include <linux/mfd/mc13xxx.h> | ||
13 | |||
14 | #define MC13892_SW1 0 | ||
15 | #define MC13892_SW2 1 | ||
16 | #define MC13892_SW3 2 | ||
17 | #define MC13892_SW4 3 | ||
18 | #define MC13892_SWBST 4 | ||
19 | #define MC13892_VIOHI 5 | ||
20 | #define MC13892_VPLL 6 | ||
21 | #define MC13892_VDIG 7 | ||
22 | #define MC13892_VSD 8 | ||
23 | #define MC13892_VUSB2 9 | ||
24 | #define MC13892_VVIDEO 10 | ||
25 | #define MC13892_VAUDIO 11 | ||
26 | #define MC13892_VCAM 12 | ||
27 | #define MC13892_VGEN1 13 | ||
28 | #define MC13892_VGEN2 14 | ||
29 | #define MC13892_VGEN3 15 | ||
30 | #define MC13892_VUSB 16 | ||
31 | #define MC13892_GPO1 17 | ||
32 | #define MC13892_GPO2 18 | ||
33 | #define MC13892_GPO3 19 | ||
34 | #define MC13892_GPO4 20 | ||
35 | #define MC13892_PWGT1SPI 21 | ||
36 | #define MC13892_PWGT2SPI 22 | ||
37 | #define MC13892_VCOINCELL 23 | ||
38 | |||
39 | #endif | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index a1239c48b41a..903280d21866 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -245,6 +245,7 @@ enum wm831x_parent { | |||
245 | WM8320 = 0x8320, | 245 | WM8320 = 0x8320, |
246 | WM8321 = 0x8321, | 246 | WM8321 = 0x8321, |
247 | WM8325 = 0x8325, | 247 | WM8325 = 0x8325, |
248 | WM8326 = 0x8326, | ||
248 | }; | 249 | }; |
249 | 250 | ||
250 | struct wm831x { | 251 | struct wm831x { |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index de79baee4925..3fd36845ca45 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -17,6 +17,11 @@ | |||
17 | 17 | ||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | 19 | ||
20 | enum wm8994_type { | ||
21 | WM8994 = 0, | ||
22 | WM8958 = 1, | ||
23 | }; | ||
24 | |||
20 | struct regulator_dev; | 25 | struct regulator_dev; |
21 | struct regulator_bulk_data; | 26 | struct regulator_bulk_data; |
22 | 27 | ||
@@ -48,6 +53,8 @@ struct wm8994 { | |||
48 | struct mutex io_lock; | 53 | struct mutex io_lock; |
49 | struct mutex irq_lock; | 54 | struct mutex irq_lock; |
50 | 55 | ||
56 | enum wm8994_type type; | ||
57 | |||
51 | struct device *dev; | 58 | struct device *dev; |
52 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | 59 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, |
53 | int bytes, void *dest); | 60 | int bytes, void *dest); |
@@ -68,6 +75,7 @@ struct wm8994 { | |||
68 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; | 75 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; |
69 | 76 | ||
70 | struct regulator_dev *dbvdd; | 77 | struct regulator_dev *dbvdd; |
78 | int num_supplies; | ||
71 | struct regulator_bulk_data *supplies; | 79 | struct regulator_bulk_data *supplies; |
72 | }; | 80 | }; |
73 | 81 | ||
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index add8a1b8bcf0..9eab263658be 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -30,6 +30,8 @@ struct wm8994_ldo_pdata { | |||
30 | 30 | ||
31 | #define WM8994_DRC_REGS 5 | 31 | #define WM8994_DRC_REGS 5 |
32 | #define WM8994_EQ_REGS 20 | 32 | #define WM8994_EQ_REGS 20 |
33 | #define WM8958_MBC_CUTOFF_REGS 20 | ||
34 | #define WM8958_MBC_COEFF_REGS 48 | ||
33 | 35 | ||
34 | /** | 36 | /** |
35 | * DRC configurations are specified with a label and a set of register | 37 | * DRC configurations are specified with a label and a set of register |
@@ -59,6 +61,18 @@ struct wm8994_retune_mobile_cfg { | |||
59 | u16 regs[WM8994_EQ_REGS]; | 61 | u16 regs[WM8994_EQ_REGS]; |
60 | }; | 62 | }; |
61 | 63 | ||
64 | /** | ||
65 | * Multiband compressor configurations are specified with a label and | ||
66 | * two sets of values to write. Configurations are expected to be | ||
67 | * generated using the multiband compressor configuration panel in | ||
68 | * WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
69 | */ | ||
70 | struct wm8958_mbc_cfg { | ||
71 | const char *name; | ||
72 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; | ||
73 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; | ||
74 | }; | ||
75 | |||
62 | struct wm8994_pdata { | 76 | struct wm8994_pdata { |
63 | int gpio_base; | 77 | int gpio_base; |
64 | 78 | ||
@@ -78,6 +92,9 @@ struct wm8994_pdata { | |||
78 | int num_retune_mobile_cfgs; | 92 | int num_retune_mobile_cfgs; |
79 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; | 93 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; |
80 | 94 | ||
95 | int num_mbc_cfgs; | ||
96 | struct wm8958_mbc_cfg *mbc_cfgs; | ||
97 | |||
81 | /* LINEOUT can be differential or single ended */ | 98 | /* LINEOUT can be differential or single ended */ |
82 | unsigned int lineout1_diff:1; | 99 | unsigned int lineout1_diff:1; |
83 | unsigned int lineout2_diff:1; | 100 | unsigned int lineout2_diff:1; |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index 967f62f54159..be072faec6f0 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -64,12 +64,16 @@ | |||
64 | #define WM8994_LDO_1 0x3B | 64 | #define WM8994_LDO_1 0x3B |
65 | #define WM8994_LDO_2 0x3C | 65 | #define WM8994_LDO_2 0x3C |
66 | #define WM8994_CHARGE_PUMP_1 0x4C | 66 | #define WM8994_CHARGE_PUMP_1 0x4C |
67 | #define WM8958_CHARGE_PUMP_2 0x4D | ||
67 | #define WM8994_CLASS_W_1 0x51 | 68 | #define WM8994_CLASS_W_1 0x51 |
68 | #define WM8994_DC_SERVO_1 0x54 | 69 | #define WM8994_DC_SERVO_1 0x54 |
69 | #define WM8994_DC_SERVO_2 0x55 | 70 | #define WM8994_DC_SERVO_2 0x55 |
70 | #define WM8994_DC_SERVO_4 0x57 | 71 | #define WM8994_DC_SERVO_4 0x57 |
71 | #define WM8994_DC_SERVO_READBACK 0x58 | 72 | #define WM8994_DC_SERVO_READBACK 0x58 |
72 | #define WM8994_ANALOGUE_HP_1 0x60 | 73 | #define WM8994_ANALOGUE_HP_1 0x60 |
74 | #define WM8958_MIC_DETECT_1 0xD0 | ||
75 | #define WM8958_MIC_DETECT_2 0xD1 | ||
76 | #define WM8958_MIC_DETECT_3 0xD2 | ||
73 | #define WM8994_CHIP_REVISION 0x100 | 77 | #define WM8994_CHIP_REVISION 0x100 |
74 | #define WM8994_CONTROL_INTERFACE 0x101 | 78 | #define WM8994_CONTROL_INTERFACE 0x101 |
75 | #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 | 79 | #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 |
@@ -109,6 +113,10 @@ | |||
109 | #define WM8994_AIF2DAC_LRCLK 0x315 | 113 | #define WM8994_AIF2DAC_LRCLK 0x315 |
110 | #define WM8994_AIF2DAC_DATA 0x316 | 114 | #define WM8994_AIF2DAC_DATA 0x316 |
111 | #define WM8994_AIF2ADC_DATA 0x317 | 115 | #define WM8994_AIF2ADC_DATA 0x317 |
116 | #define WM8958_AIF3_CONTROL_1 0x320 | ||
117 | #define WM8958_AIF3_CONTROL_2 0x321 | ||
118 | #define WM8958_AIF3DAC_DATA 0x322 | ||
119 | #define WM8958_AIF3ADC_DATA 0x323 | ||
112 | #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 | 120 | #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 |
113 | #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 | 121 | #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 |
114 | #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 | 122 | #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 |
@@ -242,6 +250,83 @@ | |||
242 | #define WM8994_INTERRUPT_STATUS_2_MASK 0x739 | 250 | #define WM8994_INTERRUPT_STATUS_2_MASK 0x739 |
243 | #define WM8994_INTERRUPT_CONTROL 0x740 | 251 | #define WM8994_INTERRUPT_CONTROL 0x740 |
244 | #define WM8994_IRQ_DEBOUNCE 0x748 | 252 | #define WM8994_IRQ_DEBOUNCE 0x748 |
253 | #define WM8958_DSP2_PROGRAM 0x900 | ||
254 | #define WM8958_DSP2_CONFIG 0x901 | ||
255 | #define WM8958_DSP2_MAGICNUM 0xA00 | ||
256 | #define WM8958_DSP2_RELEASEYEAR 0xA01 | ||
257 | #define WM8958_DSP2_RELEASEMONTHDAY 0xA02 | ||
258 | #define WM8958_DSP2_RELEASETIME 0xA03 | ||
259 | #define WM8958_DSP2_VERMAJMIN 0xA04 | ||
260 | #define WM8958_DSP2_VERBUILD 0xA05 | ||
261 | #define WM8958_DSP2_EXECCONTROL 0xA0D | ||
262 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200 | ||
263 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201 | ||
264 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202 | ||
265 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_2 0x2203 | ||
266 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_1 0x2204 | ||
267 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_2 0x2205 | ||
268 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_1 0x2206 | ||
269 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_2 0x2207 | ||
270 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_1 0x2208 | ||
271 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_2 0x2209 | ||
272 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_1 0x220A | ||
273 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_2 0x220B | ||
274 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_1 0x220C | ||
275 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_2 0x220D | ||
276 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_1 0x220E | ||
277 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_2 0x220F | ||
278 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_1 0x2210 | ||
279 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_2 0x2211 | ||
280 | #define WM8958_MBC_BAND_1_LOWER_CUTOFF_1 0x2212 | ||
281 | #define WM8958_MBC_BAND_1_LOWER_CUTOFF_2 0x2213 | ||
282 | #define WM8958_MBC_BAND_1_K_1 0x2400 | ||
283 | #define WM8958_MBC_BAND_1_K_2 0x2401 | ||
284 | #define WM8958_MBC_BAND_1_N1_1 0x2402 | ||
285 | #define WM8958_MBC_BAND_1_N1_2 0x2403 | ||
286 | #define WM8958_MBC_BAND_1_N2_1 0x2404 | ||
287 | #define WM8958_MBC_BAND_1_N2_2 0x2405 | ||
288 | #define WM8958_MBC_BAND_1_N3_1 0x2406 | ||
289 | #define WM8958_MBC_BAND_1_N3_2 0x2407 | ||
290 | #define WM8958_MBC_BAND_1_N4_1 0x2408 | ||
291 | #define WM8958_MBC_BAND_1_N4_2 0x2409 | ||
292 | #define WM8958_MBC_BAND_1_N5_1 0x240A | ||
293 | #define WM8958_MBC_BAND_1_N5_2 0x240B | ||
294 | #define WM8958_MBC_BAND_1_X1_1 0x240C | ||
295 | #define WM8958_MBC_BAND_1_X1_2 0x240D | ||
296 | #define WM8958_MBC_BAND_1_X2_1 0x240E | ||
297 | #define WM8958_MBC_BAND_1_X2_2 0x240F | ||
298 | #define WM8958_MBC_BAND_1_X3_1 0x2410 | ||
299 | #define WM8958_MBC_BAND_1_X3_2 0x2411 | ||
300 | #define WM8958_MBC_BAND_1_ATTACK_1 0x2412 | ||
301 | #define WM8958_MBC_BAND_1_ATTACK_2 0x2413 | ||
302 | #define WM8958_MBC_BAND_1_DECAY_1 0x2414 | ||
303 | #define WM8958_MBC_BAND_1_DECAY_2 0x2415 | ||
304 | #define WM8958_MBC_BAND_2_K_1 0x2416 | ||
305 | #define WM8958_MBC_BAND_2_K_2 0x2417 | ||
306 | #define WM8958_MBC_BAND_2_N1_1 0x2418 | ||
307 | #define WM8958_MBC_BAND_2_N1_2 0x2419 | ||
308 | #define WM8958_MBC_BAND_2_N2_1 0x241A | ||
309 | #define WM8958_MBC_BAND_2_N2_2 0x241B | ||
310 | #define WM8958_MBC_BAND_2_N3_1 0x241C | ||
311 | #define WM8958_MBC_BAND_2_N3_2 0x241D | ||
312 | #define WM8958_MBC_BAND_2_N4_1 0x241E | ||
313 | #define WM8958_MBC_BAND_2_N4_2 0x241F | ||
314 | #define WM8958_MBC_BAND_2_N5_1 0x2420 | ||
315 | #define WM8958_MBC_BAND_2_N5_2 0x2421 | ||
316 | #define WM8958_MBC_BAND_2_X1_1 0x2422 | ||
317 | #define WM8958_MBC_BAND_2_X1_2 0x2423 | ||
318 | #define WM8958_MBC_BAND_2_X2_1 0x2424 | ||
319 | #define WM8958_MBC_BAND_2_X2_2 0x2425 | ||
320 | #define WM8958_MBC_BAND_2_X3_1 0x2426 | ||
321 | #define WM8958_MBC_BAND_2_X3_2 0x2427 | ||
322 | #define WM8958_MBC_BAND_2_ATTACK_1 0x2428 | ||
323 | #define WM8958_MBC_BAND_2_ATTACK_2 0x2429 | ||
324 | #define WM8958_MBC_BAND_2_DECAY_1 0x242A | ||
325 | #define WM8958_MBC_BAND_2_DECAY_2 0x242B | ||
326 | #define WM8958_MBC_B2_PG2_1 0x242C | ||
327 | #define WM8958_MBC_B2_PG2_2 0x242D | ||
328 | #define WM8958_MBC_B1_PG2_1 0x242E | ||
329 | #define WM8958_MBC_B1_PG2_2 0x242F | ||
245 | #define WM8994_WRITE_SEQUENCER_0 0x3000 | 330 | #define WM8994_WRITE_SEQUENCER_0 0x3000 |
246 | #define WM8994_WRITE_SEQUENCER_1 0x3001 | 331 | #define WM8994_WRITE_SEQUENCER_1 0x3001 |
247 | #define WM8994_WRITE_SEQUENCER_2 0x3002 | 332 | #define WM8994_WRITE_SEQUENCER_2 0x3002 |
@@ -992,6 +1077,12 @@ | |||
992 | /* | 1077 | /* |
993 | * R6 (0x06) - Power Management (6) | 1078 | * R6 (0x06) - Power Management (6) |
994 | */ | 1079 | */ |
1080 | #define WM8958_AIF3ADC_SRC_MASK 0x0600 /* AIF3ADC_SRC - [10:9] */ | ||
1081 | #define WM8958_AIF3ADC_SRC_SHIFT 9 /* AIF3ADC_SRC - [10:9] */ | ||
1082 | #define WM8958_AIF3ADC_SRC_WIDTH 2 /* AIF3ADC_SRC - [10:9] */ | ||
1083 | #define WM8958_AIF2DAC_SRC_MASK 0x0180 /* AIF2DAC_SRC - [8:7] */ | ||
1084 | #define WM8958_AIF2DAC_SRC_SHIFT 7 /* AIF2DAC_SRC - [8:7] */ | ||
1085 | #define WM8958_AIF2DAC_SRC_WIDTH 2 /* AIF2DAC_SRC - [8:7] */ | ||
995 | #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ | 1086 | #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ |
996 | #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ | 1087 | #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ |
997 | #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ | 1088 | #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ |
@@ -1836,6 +1927,14 @@ | |||
1836 | #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ | 1927 | #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ |
1837 | 1928 | ||
1838 | /* | 1929 | /* |
1930 | * R77 (0x4D) - Charge Pump (2) | ||
1931 | */ | ||
1932 | #define WM8958_CP_DISCH 0x8000 /* CP_DISCH */ | ||
1933 | #define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */ | ||
1934 | #define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */ | ||
1935 | #define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */ | ||
1936 | |||
1937 | /* | ||
1839 | * R81 (0x51) - Class W (1) | 1938 | * R81 (0x51) - Class W (1) |
1840 | */ | 1939 | */ |
1841 | #define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ | 1940 | #define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ |
@@ -1952,6 +2051,46 @@ | |||
1952 | #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ | 2051 | #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ |
1953 | 2052 | ||
1954 | /* | 2053 | /* |
2054 | * R208 (0xD0) - Mic Detect 1 | ||
2055 | */ | ||
2056 | #define WM8958_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2057 | #define WM8958_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2058 | #define WM8958_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2059 | #define WM8958_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */ | ||
2060 | #define WM8958_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */ | ||
2061 | #define WM8958_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */ | ||
2062 | #define WM8958_MICD_DBTIME 0x0002 /* MICD_DBTIME */ | ||
2063 | #define WM8958_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */ | ||
2064 | #define WM8958_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */ | ||
2065 | #define WM8958_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */ | ||
2066 | #define WM8958_MICD_ENA 0x0001 /* MICD_ENA */ | ||
2067 | #define WM8958_MICD_ENA_MASK 0x0001 /* MICD_ENA */ | ||
2068 | #define WM8958_MICD_ENA_SHIFT 0 /* MICD_ENA */ | ||
2069 | #define WM8958_MICD_ENA_WIDTH 1 /* MICD_ENA */ | ||
2070 | |||
2071 | /* | ||
2072 | * R209 (0xD1) - Mic Detect 2 | ||
2073 | */ | ||
2074 | #define WM8958_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */ | ||
2075 | #define WM8958_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */ | ||
2076 | #define WM8958_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */ | ||
2077 | |||
2078 | /* | ||
2079 | * R210 (0xD2) - Mic Detect 3 | ||
2080 | */ | ||
2081 | #define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | ||
2082 | #define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | ||
2083 | #define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | ||
2084 | #define WM8958_MICD_VALID 0x0002 /* MICD_VALID */ | ||
2085 | #define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */ | ||
2086 | #define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */ | ||
2087 | #define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */ | ||
2088 | #define WM8958_MICD_STS 0x0001 /* MICD_STS */ | ||
2089 | #define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */ | ||
2090 | #define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */ | ||
2091 | #define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */ | ||
2092 | |||
2093 | /* | ||
1955 | * R256 (0x100) - Chip Revision | 2094 | * R256 (0x100) - Chip Revision |
1956 | */ | 2095 | */ |
1957 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ | 2096 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ |
@@ -2069,6 +2208,14 @@ | |||
2069 | /* | 2208 | /* |
2070 | * R520 (0x208) - Clocking (1) | 2209 | * R520 (0x208) - Clocking (1) |
2071 | */ | 2210 | */ |
2211 | #define WM8958_DSP2CLK_ENA 0x4000 /* DSP2CLK_ENA */ | ||
2212 | #define WM8958_DSP2CLK_ENA_MASK 0x4000 /* DSP2CLK_ENA */ | ||
2213 | #define WM8958_DSP2CLK_ENA_SHIFT 14 /* DSP2CLK_ENA */ | ||
2214 | #define WM8958_DSP2CLK_ENA_WIDTH 1 /* DSP2CLK_ENA */ | ||
2215 | #define WM8958_DSP2CLK_SRC 0x1000 /* DSP2CLK_SRC */ | ||
2216 | #define WM8958_DSP2CLK_SRC_MASK 0x1000 /* DSP2CLK_SRC */ | ||
2217 | #define WM8958_DSP2CLK_SRC_SHIFT 12 /* DSP2CLK_SRC */ | ||
2218 | #define WM8958_DSP2CLK_SRC_WIDTH 1 /* DSP2CLK_SRC */ | ||
2072 | #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ | 2219 | #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ |
2073 | #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ | 2220 | #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ |
2074 | #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ | 2221 | #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ |
@@ -2553,6 +2700,63 @@ | |||
2553 | #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ | 2700 | #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ |
2554 | 2701 | ||
2555 | /* | 2702 | /* |
2703 | * R800 (0x320) - AIF3 Control (1) | ||
2704 | */ | ||
2705 | #define WM8958_AIF3_LRCLK_INV 0x0080 /* AIF3_LRCLK_INV */ | ||
2706 | #define WM8958_AIF3_LRCLK_INV_MASK 0x0080 /* AIF3_LRCLK_INV */ | ||
2707 | #define WM8958_AIF3_LRCLK_INV_SHIFT 7 /* AIF3_LRCLK_INV */ | ||
2708 | #define WM8958_AIF3_LRCLK_INV_WIDTH 1 /* AIF3_LRCLK_INV */ | ||
2709 | #define WM8958_AIF3_WL_MASK 0x0060 /* AIF3_WL - [6:5] */ | ||
2710 | #define WM8958_AIF3_WL_SHIFT 5 /* AIF3_WL - [6:5] */ | ||
2711 | #define WM8958_AIF3_WL_WIDTH 2 /* AIF3_WL - [6:5] */ | ||
2712 | #define WM8958_AIF3_FMT_MASK 0x0018 /* AIF3_FMT - [4:3] */ | ||
2713 | #define WM8958_AIF3_FMT_SHIFT 3 /* AIF3_FMT - [4:3] */ | ||
2714 | #define WM8958_AIF3_FMT_WIDTH 2 /* AIF3_FMT - [4:3] */ | ||
2715 | |||
2716 | /* | ||
2717 | * R801 (0x321) - AIF3 Control (2) | ||
2718 | */ | ||
2719 | #define WM8958_AIF3DAC_BOOST_MASK 0x0C00 /* AIF3DAC_BOOST - [11:10] */ | ||
2720 | #define WM8958_AIF3DAC_BOOST_SHIFT 10 /* AIF3DAC_BOOST - [11:10] */ | ||
2721 | #define WM8958_AIF3DAC_BOOST_WIDTH 2 /* AIF3DAC_BOOST - [11:10] */ | ||
2722 | #define WM8958_AIF3DAC_COMP 0x0010 /* AIF3DAC_COMP */ | ||
2723 | #define WM8958_AIF3DAC_COMP_MASK 0x0010 /* AIF3DAC_COMP */ | ||
2724 | #define WM8958_AIF3DAC_COMP_SHIFT 4 /* AIF3DAC_COMP */ | ||
2725 | #define WM8958_AIF3DAC_COMP_WIDTH 1 /* AIF3DAC_COMP */ | ||
2726 | #define WM8958_AIF3DAC_COMPMODE 0x0008 /* AIF3DAC_COMPMODE */ | ||
2727 | #define WM8958_AIF3DAC_COMPMODE_MASK 0x0008 /* AIF3DAC_COMPMODE */ | ||
2728 | #define WM8958_AIF3DAC_COMPMODE_SHIFT 3 /* AIF3DAC_COMPMODE */ | ||
2729 | #define WM8958_AIF3DAC_COMPMODE_WIDTH 1 /* AIF3DAC_COMPMODE */ | ||
2730 | #define WM8958_AIF3ADC_COMP 0x0004 /* AIF3ADC_COMP */ | ||
2731 | #define WM8958_AIF3ADC_COMP_MASK 0x0004 /* AIF3ADC_COMP */ | ||
2732 | #define WM8958_AIF3ADC_COMP_SHIFT 2 /* AIF3ADC_COMP */ | ||
2733 | #define WM8958_AIF3ADC_COMP_WIDTH 1 /* AIF3ADC_COMP */ | ||
2734 | #define WM8958_AIF3ADC_COMPMODE 0x0002 /* AIF3ADC_COMPMODE */ | ||
2735 | #define WM8958_AIF3ADC_COMPMODE_MASK 0x0002 /* AIF3ADC_COMPMODE */ | ||
2736 | #define WM8958_AIF3ADC_COMPMODE_SHIFT 1 /* AIF3ADC_COMPMODE */ | ||
2737 | #define WM8958_AIF3ADC_COMPMODE_WIDTH 1 /* AIF3ADC_COMPMODE */ | ||
2738 | #define WM8958_AIF3_LOOPBACK 0x0001 /* AIF3_LOOPBACK */ | ||
2739 | #define WM8958_AIF3_LOOPBACK_MASK 0x0001 /* AIF3_LOOPBACK */ | ||
2740 | #define WM8958_AIF3_LOOPBACK_SHIFT 0 /* AIF3_LOOPBACK */ | ||
2741 | #define WM8958_AIF3_LOOPBACK_WIDTH 1 /* AIF3_LOOPBACK */ | ||
2742 | |||
2743 | /* | ||
2744 | * R802 (0x322) - AIF3DAC Data | ||
2745 | */ | ||
2746 | #define WM8958_AIF3DAC_DAT_INV 0x0001 /* AIF3DAC_DAT_INV */ | ||
2747 | #define WM8958_AIF3DAC_DAT_INV_MASK 0x0001 /* AIF3DAC_DAT_INV */ | ||
2748 | #define WM8958_AIF3DAC_DAT_INV_SHIFT 0 /* AIF3DAC_DAT_INV */ | ||
2749 | #define WM8958_AIF3DAC_DAT_INV_WIDTH 1 /* AIF3DAC_DAT_INV */ | ||
2750 | |||
2751 | /* | ||
2752 | * R803 (0x323) - AIF3ADC Data | ||
2753 | */ | ||
2754 | #define WM8958_AIF3ADC_DAT_INV 0x0001 /* AIF3ADC_DAT_INV */ | ||
2755 | #define WM8958_AIF3ADC_DAT_INV_MASK 0x0001 /* AIF3ADC_DAT_INV */ | ||
2756 | #define WM8958_AIF3ADC_DAT_INV_SHIFT 0 /* AIF3ADC_DAT_INV */ | ||
2757 | #define WM8958_AIF3ADC_DAT_INV_WIDTH 1 /* AIF3ADC_DAT_INV */ | ||
2758 | |||
2759 | /* | ||
2556 | * R1024 (0x400) - AIF1 ADC1 Left Volume | 2760 | * R1024 (0x400) - AIF1 ADC1 Left Volume |
2557 | */ | 2761 | */ |
2558 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ | 2762 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ |
@@ -4289,4 +4493,102 @@ | |||
4289 | #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ | 4493 | #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ |
4290 | #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ | 4494 | #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ |
4291 | 4495 | ||
4496 | /* | ||
4497 | * R2304 (0x900) - DSP2_Program | ||
4498 | */ | ||
4499 | #define WM8958_DSP2_ENA 0x0001 /* DSP2_ENA */ | ||
4500 | #define WM8958_DSP2_ENA_MASK 0x0001 /* DSP2_ENA */ | ||
4501 | #define WM8958_DSP2_ENA_SHIFT 0 /* DSP2_ENA */ | ||
4502 | #define WM8958_DSP2_ENA_WIDTH 1 /* DSP2_ENA */ | ||
4503 | |||
4504 | /* | ||
4505 | * R2305 (0x901) - DSP2_Config | ||
4506 | */ | ||
4507 | #define WM8958_MBC_SEL_MASK 0x0030 /* MBC_SEL - [5:4] */ | ||
4508 | #define WM8958_MBC_SEL_SHIFT 4 /* MBC_SEL - [5:4] */ | ||
4509 | #define WM8958_MBC_SEL_WIDTH 2 /* MBC_SEL - [5:4] */ | ||
4510 | #define WM8958_MBC_ENA 0x0001 /* MBC_ENA */ | ||
4511 | #define WM8958_MBC_ENA_MASK 0x0001 /* MBC_ENA */ | ||
4512 | #define WM8958_MBC_ENA_SHIFT 0 /* MBC_ENA */ | ||
4513 | #define WM8958_MBC_ENA_WIDTH 1 /* MBC_ENA */ | ||
4514 | |||
4515 | /* | ||
4516 | * R2560 (0xA00) - DSP2_MagicNum | ||
4517 | */ | ||
4518 | #define WM8958_DSP2_MAGIC_NUM_MASK 0xFFFF /* DSP2_MAGIC_NUM - [15:0] */ | ||
4519 | #define WM8958_DSP2_MAGIC_NUM_SHIFT 0 /* DSP2_MAGIC_NUM - [15:0] */ | ||
4520 | #define WM8958_DSP2_MAGIC_NUM_WIDTH 16 /* DSP2_MAGIC_NUM - [15:0] */ | ||
4521 | |||
4522 | /* | ||
4523 | * R2561 (0xA01) - DSP2_ReleaseYear | ||
4524 | */ | ||
4525 | #define WM8958_DSP2_RELEASE_YEAR_MASK 0xFFFF /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4526 | #define WM8958_DSP2_RELEASE_YEAR_SHIFT 0 /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4527 | #define WM8958_DSP2_RELEASE_YEAR_WIDTH 16 /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4528 | |||
4529 | /* | ||
4530 | * R2562 (0xA02) - DSP2_ReleaseMonthDay | ||
4531 | */ | ||
4532 | #define WM8958_DSP2_RELEASE_MONTH_MASK 0xFF00 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4533 | #define WM8958_DSP2_RELEASE_MONTH_SHIFT 8 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4534 | #define WM8958_DSP2_RELEASE_MONTH_WIDTH 8 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4535 | #define WM8958_DSP2_RELEASE_DAY_MASK 0x00FF /* DSP2_RELEASE_DAY - [7:0] */ | ||
4536 | #define WM8958_DSP2_RELEASE_DAY_SHIFT 0 /* DSP2_RELEASE_DAY - [7:0] */ | ||
4537 | #define WM8958_DSP2_RELEASE_DAY_WIDTH 8 /* DSP2_RELEASE_DAY - [7:0] */ | ||
4538 | |||
4539 | /* | ||
4540 | * R2563 (0xA03) - DSP2_ReleaseTime | ||
4541 | */ | ||
4542 | #define WM8958_DSP2_RELEASE_HOURS_MASK 0xFF00 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4543 | #define WM8958_DSP2_RELEASE_HOURS_SHIFT 8 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4544 | #define WM8958_DSP2_RELEASE_HOURS_WIDTH 8 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4545 | #define WM8958_DSP2_RELEASE_MINS_MASK 0x00FF /* DSP2_RELEASE_MINS - [7:0] */ | ||
4546 | #define WM8958_DSP2_RELEASE_MINS_SHIFT 0 /* DSP2_RELEASE_MINS - [7:0] */ | ||
4547 | #define WM8958_DSP2_RELEASE_MINS_WIDTH 8 /* DSP2_RELEASE_MINS - [7:0] */ | ||
4548 | |||
4549 | /* | ||
4550 | * R2564 (0xA04) - DSP2_VerMajMin | ||
4551 | */ | ||
4552 | #define WM8958_DSP2_MAJOR_VER_MASK 0xFF00 /* DSP2_MAJOR_VER - [15:8] */ | ||
4553 | #define WM8958_DSP2_MAJOR_VER_SHIFT 8 /* DSP2_MAJOR_VER - [15:8] */ | ||
4554 | #define WM8958_DSP2_MAJOR_VER_WIDTH 8 /* DSP2_MAJOR_VER - [15:8] */ | ||
4555 | #define WM8958_DSP2_MINOR_VER_MASK 0x00FF /* DSP2_MINOR_VER - [7:0] */ | ||
4556 | #define WM8958_DSP2_MINOR_VER_SHIFT 0 /* DSP2_MINOR_VER - [7:0] */ | ||
4557 | #define WM8958_DSP2_MINOR_VER_WIDTH 8 /* DSP2_MINOR_VER - [7:0] */ | ||
4558 | |||
4559 | /* | ||
4560 | * R2565 (0xA05) - DSP2_VerBuild | ||
4561 | */ | ||
4562 | #define WM8958_DSP2_BUILD_VER_MASK 0xFFFF /* DSP2_BUILD_VER - [15:0] */ | ||
4563 | #define WM8958_DSP2_BUILD_VER_SHIFT 0 /* DSP2_BUILD_VER - [15:0] */ | ||
4564 | #define WM8958_DSP2_BUILD_VER_WIDTH 16 /* DSP2_BUILD_VER - [15:0] */ | ||
4565 | |||
4566 | /* | ||
4567 | * R2573 (0xA0D) - DSP2_ExecControl | ||
4568 | */ | ||
4569 | #define WM8958_DSP2_STOPC 0x0020 /* DSP2_STOPC */ | ||
4570 | #define WM8958_DSP2_STOPC_MASK 0x0020 /* DSP2_STOPC */ | ||
4571 | #define WM8958_DSP2_STOPC_SHIFT 5 /* DSP2_STOPC */ | ||
4572 | #define WM8958_DSP2_STOPC_WIDTH 1 /* DSP2_STOPC */ | ||
4573 | #define WM8958_DSP2_STOPS 0x0010 /* DSP2_STOPS */ | ||
4574 | #define WM8958_DSP2_STOPS_MASK 0x0010 /* DSP2_STOPS */ | ||
4575 | #define WM8958_DSP2_STOPS_SHIFT 4 /* DSP2_STOPS */ | ||
4576 | #define WM8958_DSP2_STOPS_WIDTH 1 /* DSP2_STOPS */ | ||
4577 | #define WM8958_DSP2_STOPI 0x0008 /* DSP2_STOPI */ | ||
4578 | #define WM8958_DSP2_STOPI_MASK 0x0008 /* DSP2_STOPI */ | ||
4579 | #define WM8958_DSP2_STOPI_SHIFT 3 /* DSP2_STOPI */ | ||
4580 | #define WM8958_DSP2_STOPI_WIDTH 1 /* DSP2_STOPI */ | ||
4581 | #define WM8958_DSP2_STOP 0x0004 /* DSP2_STOP */ | ||
4582 | #define WM8958_DSP2_STOP_MASK 0x0004 /* DSP2_STOP */ | ||
4583 | #define WM8958_DSP2_STOP_SHIFT 2 /* DSP2_STOP */ | ||
4584 | #define WM8958_DSP2_STOP_WIDTH 1 /* DSP2_STOP */ | ||
4585 | #define WM8958_DSP2_RUNR 0x0002 /* DSP2_RUNR */ | ||
4586 | #define WM8958_DSP2_RUNR_MASK 0x0002 /* DSP2_RUNR */ | ||
4587 | #define WM8958_DSP2_RUNR_SHIFT 1 /* DSP2_RUNR */ | ||
4588 | #define WM8958_DSP2_RUNR_WIDTH 1 /* DSP2_RUNR */ | ||
4589 | #define WM8958_DSP2_RUN 0x0001 /* DSP2_RUN */ | ||
4590 | #define WM8958_DSP2_RUN_MASK 0x0001 /* DSP2_RUN */ | ||
4591 | #define WM8958_DSP2_RUN_SHIFT 0 /* DSP2_RUN */ | ||
4592 | #define WM8958_DSP2_RUN_WIDTH 1 /* DSP2_RUN */ | ||
4593 | |||
4292 | #endif | 4594 | #endif |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 085527fb8261..e39aeecfe9a2 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -13,9 +13,11 @@ extern void putback_lru_pages(struct list_head *l); | |||
13 | extern int migrate_page(struct address_space *, | 13 | extern int migrate_page(struct address_space *, |
14 | struct page *, struct page *); | 14 | struct page *, struct page *); |
15 | extern int migrate_pages(struct list_head *l, new_page_t x, | 15 | extern int migrate_pages(struct list_head *l, new_page_t x, |
16 | unsigned long private, int offlining); | 16 | unsigned long private, bool offlining, |
17 | bool sync); | ||
17 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, | 18 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, |
18 | unsigned long private, int offlining); | 19 | unsigned long private, bool offlining, |
20 | bool sync); | ||
19 | 21 | ||
20 | extern int fail_migrate_page(struct address_space *, | 22 | extern int fail_migrate_page(struct address_space *, |
21 | struct page *, struct page *); | 23 | struct page *, struct page *); |
@@ -33,9 +35,11 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
33 | 35 | ||
34 | static inline void putback_lru_pages(struct list_head *l) {} | 36 | static inline void putback_lru_pages(struct list_head *l) {} |
35 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 37 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
36 | unsigned long private, int offlining) { return -ENOSYS; } | 38 | unsigned long private, bool offlining, |
39 | bool sync) { return -ENOSYS; } | ||
37 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, | 40 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, |
38 | unsigned long private, int offlining) { return -ENOSYS; } | 41 | unsigned long private, bool offlining, |
42 | bool sync) { return -ENOSYS; } | ||
39 | 43 | ||
40 | static inline int migrate_prep(void) { return -ENOSYS; } | 44 | static inline int migrate_prep(void) { return -ENOSYS; } |
41 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 45 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index a7b15bc7648e..049214642036 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -144,6 +144,11 @@ enum { | |||
144 | MLX4_STAT_RATE_OFFSET = 5 | 144 | MLX4_STAT_RATE_OFFSET = 5 |
145 | }; | 145 | }; |
146 | 146 | ||
147 | enum mlx4_protocol { | ||
148 | MLX4_PROTOCOL_IB, | ||
149 | MLX4_PROTOCOL_EN, | ||
150 | }; | ||
151 | |||
147 | enum { | 152 | enum { |
148 | MLX4_MTT_FLAG_PRESENT = 1 | 153 | MLX4_MTT_FLAG_PRESENT = 1 |
149 | }; | 154 | }; |
@@ -500,8 +505,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); | |||
500 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); | 505 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); |
501 | 506 | ||
502 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | 507 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
503 | int block_mcast_loopback); | 508 | int block_mcast_loopback, enum mlx4_protocol protocol); |
504 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | 509 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
510 | enum mlx4_protocol protocol); | ||
505 | 511 | ||
506 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); | 512 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); |
507 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); | 513 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index f407cd4bfb34..e1eebf78caba 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define MLX4_DRIVER_H | 34 | #define MLX4_DRIVER_H |
35 | 35 | ||
36 | #include <linux/device.h> | 36 | #include <linux/device.h> |
37 | #include <linux/mlx4/device.h> | ||
37 | 38 | ||
38 | struct mlx4_dev; | 39 | struct mlx4_dev; |
39 | 40 | ||
@@ -44,11 +45,6 @@ enum mlx4_dev_event { | |||
44 | MLX4_DEV_EVENT_PORT_REINIT, | 45 | MLX4_DEV_EVENT_PORT_REINIT, |
45 | }; | 46 | }; |
46 | 47 | ||
47 | enum mlx4_protocol { | ||
48 | MLX4_PROTOCOL_IB, | ||
49 | MLX4_PROTOCOL_EN, | ||
50 | }; | ||
51 | |||
52 | struct mlx4_interface { | 48 | struct mlx4_interface { |
53 | void * (*add) (struct mlx4_dev *dev); | 49 | void * (*add) (struct mlx4_dev *dev); |
54 | void (*remove)(struct mlx4_dev *dev, void *context); | 50 | void (*remove)(struct mlx4_dev *dev, void *context); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 721f451c3029..956a35532f47 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mm_types.h> | 14 | #include <linux/mm_types.h> |
15 | #include <linux/range.h> | 15 | #include <linux/range.h> |
16 | #include <linux/pfn.h> | 16 | #include <linux/pfn.h> |
17 | #include <linux/bit_spinlock.h> | ||
17 | 18 | ||
18 | struct mempolicy; | 19 | struct mempolicy; |
19 | struct anon_vma; | 20 | struct anon_vma; |
@@ -82,6 +83,7 @@ extern unsigned int kobjsize(const void *objp); | |||
82 | #define VM_GROWSUP 0x00000200 | 83 | #define VM_GROWSUP 0x00000200 |
83 | #else | 84 | #else |
84 | #define VM_GROWSUP 0x00000000 | 85 | #define VM_GROWSUP 0x00000000 |
86 | #define VM_NOHUGEPAGE 0x00000200 /* MADV_NOHUGEPAGE marked this vma */ | ||
85 | #endif | 87 | #endif |
86 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 88 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
87 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 89 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
@@ -101,7 +103,11 @@ extern unsigned int kobjsize(const void *objp); | |||
101 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | 103 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ |
102 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 104 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
103 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 105 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
106 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE | ||
104 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ | 107 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ |
108 | #else | ||
109 | #define VM_HUGEPAGE 0x01000000 /* MADV_HUGEPAGE marked this vma */ | ||
110 | #endif | ||
105 | #define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ | 111 | #define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ |
106 | #define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ | 112 | #define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ |
107 | 113 | ||
@@ -242,6 +248,7 @@ struct inode; | |||
242 | * files which need it (119 of them) | 248 | * files which need it (119 of them) |
243 | */ | 249 | */ |
244 | #include <linux/page-flags.h> | 250 | #include <linux/page-flags.h> |
251 | #include <linux/huge_mm.h> | ||
245 | 252 | ||
246 | /* | 253 | /* |
247 | * Methods to modify the page usage count. | 254 | * Methods to modify the page usage count. |
@@ -305,6 +312,39 @@ static inline int is_vmalloc_or_module_addr(const void *x) | |||
305 | } | 312 | } |
306 | #endif | 313 | #endif |
307 | 314 | ||
315 | static inline void compound_lock(struct page *page) | ||
316 | { | ||
317 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
318 | bit_spin_lock(PG_compound_lock, &page->flags); | ||
319 | #endif | ||
320 | } | ||
321 | |||
322 | static inline void compound_unlock(struct page *page) | ||
323 | { | ||
324 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
325 | bit_spin_unlock(PG_compound_lock, &page->flags); | ||
326 | #endif | ||
327 | } | ||
328 | |||
329 | static inline unsigned long compound_lock_irqsave(struct page *page) | ||
330 | { | ||
331 | unsigned long uninitialized_var(flags); | ||
332 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
333 | local_irq_save(flags); | ||
334 | compound_lock(page); | ||
335 | #endif | ||
336 | return flags; | ||
337 | } | ||
338 | |||
339 | static inline void compound_unlock_irqrestore(struct page *page, | ||
340 | unsigned long flags) | ||
341 | { | ||
342 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
343 | compound_unlock(page); | ||
344 | local_irq_restore(flags); | ||
345 | #endif | ||
346 | } | ||
347 | |||
308 | static inline struct page *compound_head(struct page *page) | 348 | static inline struct page *compound_head(struct page *page) |
309 | { | 349 | { |
310 | if (unlikely(PageTail(page))) | 350 | if (unlikely(PageTail(page))) |
@@ -319,9 +359,29 @@ static inline int page_count(struct page *page) | |||
319 | 359 | ||
320 | static inline void get_page(struct page *page) | 360 | static inline void get_page(struct page *page) |
321 | { | 361 | { |
322 | page = compound_head(page); | 362 | /* |
323 | VM_BUG_ON(atomic_read(&page->_count) == 0); | 363 | * Getting a normal page or the head of a compound page |
364 | * requires to already have an elevated page->_count. Only if | ||
365 | * we're getting a tail page, the elevated page->_count is | ||
366 | * required only in the head page, so for tail pages the | ||
367 | * bugcheck only verifies that the page->_count isn't | ||
368 | * negative. | ||
369 | */ | ||
370 | VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page)); | ||
324 | atomic_inc(&page->_count); | 371 | atomic_inc(&page->_count); |
372 | /* | ||
373 | * Getting a tail page will elevate both the head and tail | ||
374 | * page->_count(s). | ||
375 | */ | ||
376 | if (unlikely(PageTail(page))) { | ||
377 | /* | ||
378 | * This is safe only because | ||
379 | * __split_huge_page_refcount can't run under | ||
380 | * get_page(). | ||
381 | */ | ||
382 | VM_BUG_ON(atomic_read(&page->first_page->_count) <= 0); | ||
383 | atomic_inc(&page->first_page->_count); | ||
384 | } | ||
325 | } | 385 | } |
326 | 386 | ||
327 | static inline struct page *virt_to_head_page(const void *x) | 387 | static inline struct page *virt_to_head_page(const void *x) |
@@ -339,6 +399,27 @@ static inline void init_page_count(struct page *page) | |||
339 | atomic_set(&page->_count, 1); | 399 | atomic_set(&page->_count, 1); |
340 | } | 400 | } |
341 | 401 | ||
402 | /* | ||
403 | * PageBuddy() indicate that the page is free and in the buddy system | ||
404 | * (see mm/page_alloc.c). | ||
405 | */ | ||
406 | static inline int PageBuddy(struct page *page) | ||
407 | { | ||
408 | return atomic_read(&page->_mapcount) == -2; | ||
409 | } | ||
410 | |||
411 | static inline void __SetPageBuddy(struct page *page) | ||
412 | { | ||
413 | VM_BUG_ON(atomic_read(&page->_mapcount) != -1); | ||
414 | atomic_set(&page->_mapcount, -2); | ||
415 | } | ||
416 | |||
417 | static inline void __ClearPageBuddy(struct page *page) | ||
418 | { | ||
419 | VM_BUG_ON(!PageBuddy(page)); | ||
420 | atomic_set(&page->_mapcount, -1); | ||
421 | } | ||
422 | |||
342 | void put_page(struct page *page); | 423 | void put_page(struct page *page); |
343 | void put_pages_list(struct list_head *pages); | 424 | void put_pages_list(struct list_head *pages); |
344 | 425 | ||
@@ -370,12 +451,39 @@ static inline int compound_order(struct page *page) | |||
370 | return (unsigned long)page[1].lru.prev; | 451 | return (unsigned long)page[1].lru.prev; |
371 | } | 452 | } |
372 | 453 | ||
454 | static inline int compound_trans_order(struct page *page) | ||
455 | { | ||
456 | int order; | ||
457 | unsigned long flags; | ||
458 | |||
459 | if (!PageHead(page)) | ||
460 | return 0; | ||
461 | |||
462 | flags = compound_lock_irqsave(page); | ||
463 | order = compound_order(page); | ||
464 | compound_unlock_irqrestore(page, flags); | ||
465 | return order; | ||
466 | } | ||
467 | |||
373 | static inline void set_compound_order(struct page *page, unsigned long order) | 468 | static inline void set_compound_order(struct page *page, unsigned long order) |
374 | { | 469 | { |
375 | page[1].lru.prev = (void *)order; | 470 | page[1].lru.prev = (void *)order; |
376 | } | 471 | } |
377 | 472 | ||
378 | /* | 473 | /* |
474 | * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when | ||
475 | * servicing faults for write access. In the normal case, do always want | ||
476 | * pte_mkwrite. But get_user_pages can cause write faults for mappings | ||
477 | * that do not have writing enabled, when used by access_process_vm. | ||
478 | */ | ||
479 | static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | ||
480 | { | ||
481 | if (likely(vma->vm_flags & VM_WRITE)) | ||
482 | pte = pte_mkwrite(pte); | ||
483 | return pte; | ||
484 | } | ||
485 | |||
486 | /* | ||
379 | * Multiple processes may "see" the same page. E.g. for untouched | 487 | * Multiple processes may "see" the same page. E.g. for untouched |
380 | * mappings of /dev/null, all processes see the same page full of | 488 | * mappings of /dev/null, all processes see the same page full of |
381 | * zeroes, and text pages of executables and shared libraries have | 489 | * zeroes, and text pages of executables and shared libraries have |
@@ -657,7 +765,7 @@ static inline struct address_space *page_mapping(struct page *page) | |||
657 | VM_BUG_ON(PageSlab(page)); | 765 | VM_BUG_ON(PageSlab(page)); |
658 | if (unlikely(PageSwapCache(page))) | 766 | if (unlikely(PageSwapCache(page))) |
659 | mapping = &swapper_space; | 767 | mapping = &swapper_space; |
660 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) | 768 | else if ((unsigned long)mapping & PAGE_MAPPING_ANON) |
661 | mapping = NULL; | 769 | mapping = NULL; |
662 | return mapping; | 770 | return mapping; |
663 | } | 771 | } |
@@ -1064,7 +1172,8 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, | |||
1064 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | 1172 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
1065 | #endif | 1173 | #endif |
1066 | 1174 | ||
1067 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); | 1175 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
1176 | pmd_t *pmd, unsigned long address); | ||
1068 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); | 1177 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); |
1069 | 1178 | ||
1070 | /* | 1179 | /* |
@@ -1133,16 +1242,18 @@ static inline void pgtable_page_dtor(struct page *page) | |||
1133 | pte_unmap(pte); \ | 1242 | pte_unmap(pte); \ |
1134 | } while (0) | 1243 | } while (0) |
1135 | 1244 | ||
1136 | #define pte_alloc_map(mm, pmd, address) \ | 1245 | #define pte_alloc_map(mm, vma, pmd, address) \ |
1137 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1246 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, vma, \ |
1138 | NULL: pte_offset_map(pmd, address)) | 1247 | pmd, address))? \ |
1248 | NULL: pte_offset_map(pmd, address)) | ||
1139 | 1249 | ||
1140 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ | 1250 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ |
1141 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1251 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, NULL, \ |
1252 | pmd, address))? \ | ||
1142 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) | 1253 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) |
1143 | 1254 | ||
1144 | #define pte_alloc_kernel(pmd, address) \ | 1255 | #define pte_alloc_kernel(pmd, address) \ |
1145 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ | 1256 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ |
1146 | NULL: pte_offset_kernel(pmd, address)) | 1257 | NULL: pte_offset_kernel(pmd, address)) |
1147 | 1258 | ||
1148 | extern void free_area_init(unsigned long * zones_size); | 1259 | extern void free_area_init(unsigned long * zones_size); |
@@ -1415,6 +1526,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1415 | #define FOLL_GET 0x04 /* do get_page on page */ | 1526 | #define FOLL_GET 0x04 /* do get_page on page */ |
1416 | #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ | 1527 | #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ |
1417 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ | 1528 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ |
1529 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ | ||
1530 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | ||
1418 | 1531 | ||
1419 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1532 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1420 | void *data); | 1533 | void *data); |
@@ -1518,5 +1631,14 @@ static inline int is_hwpoison_address(unsigned long addr) | |||
1518 | 1631 | ||
1519 | extern void dump_page(struct page *page); | 1632 | extern void dump_page(struct page *page); |
1520 | 1633 | ||
1634 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) | ||
1635 | extern void clear_huge_page(struct page *page, | ||
1636 | unsigned long addr, | ||
1637 | unsigned int pages_per_huge_page); | ||
1638 | extern void copy_user_huge_page(struct page *dst, struct page *src, | ||
1639 | unsigned long addr, struct vm_area_struct *vma, | ||
1640 | unsigned int pages_per_huge_page); | ||
1641 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ | ||
1642 | |||
1521 | #endif /* __KERNEL__ */ | 1643 | #endif /* __KERNEL__ */ |
1522 | #endif /* _LINUX_MM_H */ | 1644 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8835b877b8db..8f7d24712dc1 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef LINUX_MM_INLINE_H | 1 | #ifndef LINUX_MM_INLINE_H |
2 | #define LINUX_MM_INLINE_H | 2 | #define LINUX_MM_INLINE_H |
3 | 3 | ||
4 | #include <linux/huge_mm.h> | ||
5 | |||
4 | /** | 6 | /** |
5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? | 7 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
6 | * @page: the page to test | 8 | * @page: the page to test |
@@ -20,18 +22,25 @@ static inline int page_is_file_cache(struct page *page) | |||
20 | } | 22 | } |
21 | 23 | ||
22 | static inline void | 24 | static inline void |
23 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 25 | __add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, |
26 | struct list_head *head) | ||
24 | { | 27 | { |
25 | list_add(&page->lru, &zone->lru[l].list); | 28 | list_add(&page->lru, head); |
26 | __inc_zone_state(zone, NR_LRU_BASE + l); | 29 | __mod_zone_page_state(zone, NR_LRU_BASE + l, hpage_nr_pages(page)); |
27 | mem_cgroup_add_lru_list(page, l); | 30 | mem_cgroup_add_lru_list(page, l); |
28 | } | 31 | } |
29 | 32 | ||
30 | static inline void | 33 | static inline void |
34 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | ||
35 | { | ||
36 | __add_page_to_lru_list(zone, page, l, &zone->lru[l].list); | ||
37 | } | ||
38 | |||
39 | static inline void | ||
31 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 40 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) |
32 | { | 41 | { |
33 | list_del(&page->lru); | 42 | list_del(&page->lru); |
34 | __dec_zone_state(zone, NR_LRU_BASE + l); | 43 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
35 | mem_cgroup_del_lru_list(page, l); | 44 | mem_cgroup_del_lru_list(page, l); |
36 | } | 45 | } |
37 | 46 | ||
@@ -66,7 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
66 | l += LRU_ACTIVE; | 75 | l += LRU_ACTIVE; |
67 | } | 76 | } |
68 | } | 77 | } |
69 | __dec_zone_state(zone, NR_LRU_BASE + l); | 78 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
70 | mem_cgroup_del_lru_list(page, l); | 79 | mem_cgroup_del_lru_list(page, l); |
71 | } | 80 | } |
72 | 81 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bb7288a782fd..26bc4e2cd275 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -310,6 +310,9 @@ struct mm_struct { | |||
310 | #ifdef CONFIG_MMU_NOTIFIER | 310 | #ifdef CONFIG_MMU_NOTIFIER |
311 | struct mmu_notifier_mm *mmu_notifier_mm; | 311 | struct mmu_notifier_mm *mmu_notifier_mm; |
312 | #endif | 312 | #endif |
313 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
314 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | ||
315 | #endif | ||
313 | /* How many tasks sharing this mm are OOM_DISABLE */ | 316 | /* How many tasks sharing this mm are OOM_DISABLE */ |
314 | atomic_t oom_disable_count; | 317 | atomic_t oom_disable_count; |
315 | }; | 318 | }; |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 44fc5348fd5d..bf173502d744 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -104,6 +104,9 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | |||
104 | 104 | ||
105 | #define SH_MMCIF_BBS 512 /* boot block size */ | 105 | #define SH_MMCIF_BBS 512 /* boot block size */ |
106 | 106 | ||
107 | enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT, | ||
108 | MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE }; | ||
109 | |||
107 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 110 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
108 | unsigned long cmd, unsigned long arg) | 111 | unsigned long cmd, unsigned long arg) |
109 | { | 112 | { |
@@ -166,6 +169,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
166 | unsigned long k; | 169 | unsigned long k; |
167 | int ret = 0; | 170 | int ret = 0; |
168 | 171 | ||
172 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | ||
173 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, | ||
174 | CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | | ||
175 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
176 | |||
177 | /* CMD9 - Get CSD */ | ||
178 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | ||
179 | |||
180 | /* CMD7 - Select the card */ | ||
181 | sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); | ||
182 | |||
169 | /* CMD16 - Set the block size */ | 183 | /* CMD16 - Set the block size */ |
170 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); | 184 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); |
171 | 185 | ||
@@ -209,27 +223,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base) | |||
209 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 223 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
210 | } | 224 | } |
211 | 225 | ||
212 | static inline void sh_mmcif_boot_slurp(void __iomem *base, | ||
213 | unsigned char *buf, | ||
214 | unsigned long no_bytes) | ||
215 | { | ||
216 | unsigned long tmp; | ||
217 | |||
218 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | ||
219 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, | ||
220 | CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | | ||
221 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
222 | |||
223 | /* CMD9 - Get CSD */ | ||
224 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | ||
225 | |||
226 | /* CMD7 - Select the card */ | ||
227 | sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); | ||
228 | |||
229 | tmp = no_bytes / SH_MMCIF_BBS; | ||
230 | tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0; | ||
231 | |||
232 | sh_mmcif_boot_do_read(base, 512, tmp, buf); | ||
233 | } | ||
234 | |||
235 | #endif /* __SH_MMCIF_H__ */ | 226 | #endif /* __SH_MMCIF_H__ */ |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 43dcfbdc39de..cc2e7dfea9d7 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -62,6 +62,16 @@ struct mmu_notifier_ops { | |||
62 | unsigned long address); | 62 | unsigned long address); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * test_young is called to check the young/accessed bitflag in | ||
66 | * the secondary pte. This is used to know if the page is | ||
67 | * frequently used without actually clearing the flag or tearing | ||
68 | * down the secondary mapping on the page. | ||
69 | */ | ||
70 | int (*test_young)(struct mmu_notifier *mn, | ||
71 | struct mm_struct *mm, | ||
72 | unsigned long address); | ||
73 | |||
74 | /* | ||
65 | * change_pte is called in cases that pte mapping to page is changed: | 75 | * change_pte is called in cases that pte mapping to page is changed: |
66 | * for example, when ksm remaps pte to point to a new shared page. | 76 | * for example, when ksm remaps pte to point to a new shared page. |
67 | */ | 77 | */ |
@@ -163,6 +173,8 @@ extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | |||
163 | extern void __mmu_notifier_release(struct mm_struct *mm); | 173 | extern void __mmu_notifier_release(struct mm_struct *mm); |
164 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | 174 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, |
165 | unsigned long address); | 175 | unsigned long address); |
176 | extern int __mmu_notifier_test_young(struct mm_struct *mm, | ||
177 | unsigned long address); | ||
166 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, | 178 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, |
167 | unsigned long address, pte_t pte); | 179 | unsigned long address, pte_t pte); |
168 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | 180 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, |
@@ -186,6 +198,14 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
186 | return 0; | 198 | return 0; |
187 | } | 199 | } |
188 | 200 | ||
201 | static inline int mmu_notifier_test_young(struct mm_struct *mm, | ||
202 | unsigned long address) | ||
203 | { | ||
204 | if (mm_has_notifiers(mm)) | ||
205 | return __mmu_notifier_test_young(mm, address); | ||
206 | return 0; | ||
207 | } | ||
208 | |||
189 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | 209 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, |
190 | unsigned long address, pte_t pte) | 210 | unsigned long address, pte_t pte) |
191 | { | 211 | { |
@@ -243,6 +263,32 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
243 | __pte; \ | 263 | __pte; \ |
244 | }) | 264 | }) |
245 | 265 | ||
266 | #define pmdp_clear_flush_notify(__vma, __address, __pmdp) \ | ||
267 | ({ \ | ||
268 | pmd_t __pmd; \ | ||
269 | struct vm_area_struct *___vma = __vma; \ | ||
270 | unsigned long ___address = __address; \ | ||
271 | VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \ | ||
272 | mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \ | ||
273 | (__address)+HPAGE_PMD_SIZE);\ | ||
274 | __pmd = pmdp_clear_flush(___vma, ___address, __pmdp); \ | ||
275 | mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \ | ||
276 | (__address)+HPAGE_PMD_SIZE); \ | ||
277 | __pmd; \ | ||
278 | }) | ||
279 | |||
280 | #define pmdp_splitting_flush_notify(__vma, __address, __pmdp) \ | ||
281 | ({ \ | ||
282 | struct vm_area_struct *___vma = __vma; \ | ||
283 | unsigned long ___address = __address; \ | ||
284 | VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \ | ||
285 | mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \ | ||
286 | (__address)+HPAGE_PMD_SIZE);\ | ||
287 | pmdp_splitting_flush(___vma, ___address, __pmdp); \ | ||
288 | mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \ | ||
289 | (__address)+HPAGE_PMD_SIZE); \ | ||
290 | }) | ||
291 | |||
246 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ | 292 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ |
247 | ({ \ | 293 | ({ \ |
248 | int __young; \ | 294 | int __young; \ |
@@ -254,6 +300,17 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
254 | __young; \ | 300 | __young; \ |
255 | }) | 301 | }) |
256 | 302 | ||
303 | #define pmdp_clear_flush_young_notify(__vma, __address, __pmdp) \ | ||
304 | ({ \ | ||
305 | int __young; \ | ||
306 | struct vm_area_struct *___vma = __vma; \ | ||
307 | unsigned long ___address = __address; \ | ||
308 | __young = pmdp_clear_flush_young(___vma, ___address, __pmdp); \ | ||
309 | __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \ | ||
310 | ___address); \ | ||
311 | __young; \ | ||
312 | }) | ||
313 | |||
257 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ | 314 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ |
258 | ({ \ | 315 | ({ \ |
259 | struct mm_struct *___mm = __mm; \ | 316 | struct mm_struct *___mm = __mm; \ |
@@ -276,6 +333,12 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
276 | return 0; | 333 | return 0; |
277 | } | 334 | } |
278 | 335 | ||
336 | static inline int mmu_notifier_test_young(struct mm_struct *mm, | ||
337 | unsigned long address) | ||
338 | { | ||
339 | return 0; | ||
340 | } | ||
341 | |||
279 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | 342 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, |
280 | unsigned long address, pte_t pte) | 343 | unsigned long address, pte_t pte) |
281 | { | 344 | { |
@@ -305,7 +368,10 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
305 | } | 368 | } |
306 | 369 | ||
307 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | 370 | #define ptep_clear_flush_young_notify ptep_clear_flush_young |
371 | #define pmdp_clear_flush_young_notify pmdp_clear_flush_young | ||
308 | #define ptep_clear_flush_notify ptep_clear_flush | 372 | #define ptep_clear_flush_notify ptep_clear_flush |
373 | #define pmdp_clear_flush_notify pmdp_clear_flush | ||
374 | #define pmdp_splitting_flush_notify pmdp_splitting_flush | ||
309 | #define set_pte_at_notify set_pte_at | 375 | #define set_pte_at_notify set_pte_at |
310 | 376 | ||
311 | #endif /* CONFIG_MMU_NOTIFIER */ | 377 | #endif /* CONFIG_MMU_NOTIFIER */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 39c24ebe9cfd..02ecb0189b1d 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -114,6 +114,7 @@ enum zone_stat_item { | |||
114 | NUMA_LOCAL, /* allocation from local node */ | 114 | NUMA_LOCAL, /* allocation from local node */ |
115 | NUMA_OTHER, /* allocation from other node */ | 115 | NUMA_OTHER, /* allocation from other node */ |
116 | #endif | 116 | #endif |
117 | NR_ANON_TRANSPARENT_HUGEPAGES, | ||
117 | NR_VM_ZONE_STAT_ITEMS }; | 118 | NR_VM_ZONE_STAT_ITEMS }; |
118 | 119 | ||
119 | /* | 120 | /* |
@@ -458,12 +459,6 @@ static inline int zone_is_oom_locked(const struct zone *zone) | |||
458 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | 459 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); |
459 | } | 460 | } |
460 | 461 | ||
461 | #ifdef CONFIG_SMP | ||
462 | unsigned long zone_nr_free_pages(struct zone *zone); | ||
463 | #else | ||
464 | #define zone_nr_free_pages(zone) zone_page_state(zone, NR_FREE_PAGES) | ||
465 | #endif /* CONFIG_SMP */ | ||
466 | |||
467 | /* | 462 | /* |
468 | * The "priority" of VM scanning is how much of the queues we will scan in one | 463 | * The "priority" of VM scanning is how much of the queues we will scan in one |
469 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the | 464 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the |
@@ -645,6 +640,7 @@ typedef struct pglist_data { | |||
645 | wait_queue_head_t kswapd_wait; | 640 | wait_queue_head_t kswapd_wait; |
646 | struct task_struct *kswapd; | 641 | struct task_struct *kswapd; |
647 | int kswapd_max_order; | 642 | int kswapd_max_order; |
643 | enum zone_type classzone_idx; | ||
648 | } pg_data_t; | 644 | } pg_data_t; |
649 | 645 | ||
650 | #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) | 646 | #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) |
@@ -660,8 +656,10 @@ typedef struct pglist_data { | |||
660 | 656 | ||
661 | extern struct mutex zonelists_mutex; | 657 | extern struct mutex zonelists_mutex; |
662 | void build_all_zonelists(void *data); | 658 | void build_all_zonelists(void *data); |
663 | void wakeup_kswapd(struct zone *zone, int order); | 659 | void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx); |
664 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 660 | bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
661 | int classzone_idx, int alloc_flags); | ||
662 | bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark, | ||
665 | int classzone_idx, int alloc_flags); | 663 | int classzone_idx, int alloc_flags); |
666 | enum memmap_context { | 664 | enum memmap_context { |
667 | MEMMAP_EARLY, | 665 | MEMMAP_EARLY, |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 1869ea24a739..604f122a2326 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -60,7 +60,7 @@ struct vfsmount { | |||
60 | struct super_block *mnt_sb; /* pointer to superblock */ | 60 | struct super_block *mnt_sb; /* pointer to superblock */ |
61 | #ifdef CONFIG_SMP | 61 | #ifdef CONFIG_SMP |
62 | struct mnt_pcp __percpu *mnt_pcp; | 62 | struct mnt_pcp __percpu *mnt_pcp; |
63 | atomic_t mnt_longrefs; | 63 | atomic_t mnt_longterm; /* how many of the refs are longterm */ |
64 | #else | 64 | #else |
65 | int mnt_count; | 65 | int mnt_count; |
66 | int mnt_writers; | 66 | int mnt_writers; |
@@ -96,8 +96,6 @@ extern int mnt_clone_write(struct vfsmount *mnt); | |||
96 | extern void mnt_drop_write(struct vfsmount *mnt); | 96 | extern void mnt_drop_write(struct vfsmount *mnt); |
97 | extern void mntput(struct vfsmount *mnt); | 97 | extern void mntput(struct vfsmount *mnt); |
98 | extern struct vfsmount *mntget(struct vfsmount *mnt); | 98 | extern struct vfsmount *mntget(struct vfsmount *mnt); |
99 | extern void mntput_long(struct vfsmount *mnt); | ||
100 | extern struct vfsmount *mntget_long(struct vfsmount *mnt); | ||
101 | extern void mnt_pin(struct vfsmount *mnt); | 99 | extern void mnt_pin(struct vfsmount *mnt); |
102 | extern void mnt_unpin(struct vfsmount *mnt); | 100 | extern void mnt_unpin(struct vfsmount *mnt); |
103 | extern int __mnt_is_readonly(struct vfsmount *mnt); | 101 | extern int __mnt_is_readonly(struct vfsmount *mnt); |
@@ -110,12 +108,7 @@ extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, | |||
110 | int flags, const char *name, | 108 | int flags, const char *name, |
111 | void *data); | 109 | void *data); |
112 | 110 | ||
113 | struct nameidata; | 111 | extern void mnt_set_expiry(struct vfsmount *mnt, struct list_head *expiry_list); |
114 | |||
115 | struct path; | ||
116 | extern int do_add_mount(struct vfsmount *newmnt, struct path *path, | ||
117 | int mnt_flags, struct list_head *fslist); | ||
118 | |||
119 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 112 | extern void mark_mounts_for_expiry(struct list_head *mounts); |
120 | 113 | ||
121 | extern dev_t name_to_dev_t(char *name); | 114 | extern dev_t name_to_dev_t(char *name); |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 4dd0c2cd7659..a9baee6864af 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -527,8 +527,7 @@ struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t s | |||
527 | struct cfi_fixup { | 527 | struct cfi_fixup { |
528 | uint16_t mfr; | 528 | uint16_t mfr; |
529 | uint16_t id; | 529 | uint16_t id; |
530 | void (*fixup)(struct mtd_info *mtd, void* param); | 530 | void (*fixup)(struct mtd_info *mtd); |
531 | void* param; | ||
532 | }; | 531 | }; |
533 | 532 | ||
534 | #define CFI_MFR_ANY 0xFFFF | 533 | #define CFI_MFR_ANY 0xFFFF |
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h index 5d2556700ec2..6987995ad3cf 100644 --- a/include/linux/mtd/fsmc.h +++ b/include/linux/mtd/fsmc.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #ifndef __MTD_FSMC_H | 16 | #ifndef __MTD_FSMC_H |
17 | #define __MTD_FSMC_H | 17 | #define __MTD_FSMC_H |
18 | 18 | ||
19 | #include <linux/io.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
21 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -27,7 +28,7 @@ | |||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * The placement of the Command Latch Enable (CLE) and | 30 | * The placement of the Command Latch Enable (CLE) and |
30 | * Address Latch Enable (ALE) is twised around in the | 31 | * Address Latch Enable (ALE) is twisted around in the |
31 | * SPEAR310 implementation. | 32 | * SPEAR310 implementation. |
32 | */ | 33 | */ |
33 | #if defined(CONFIG_MACH_SPEAR310) | 34 | #if defined(CONFIG_MACH_SPEAR310) |
@@ -62,7 +63,7 @@ struct fsmc_nor_bank_regs { | |||
62 | 63 | ||
63 | /* ctrl_tim register definitions */ | 64 | /* ctrl_tim register definitions */ |
64 | 65 | ||
65 | struct fsms_nand_bank_regs { | 66 | struct fsmc_nand_bank_regs { |
66 | uint32_t pc; | 67 | uint32_t pc; |
67 | uint32_t sts; | 68 | uint32_t sts; |
68 | uint32_t comm; | 69 | uint32_t comm; |
@@ -78,7 +79,7 @@ struct fsms_nand_bank_regs { | |||
78 | struct fsmc_regs { | 79 | struct fsmc_regs { |
79 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; | 80 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; |
80 | uint8_t reserved_1[0x40 - 0x20]; | 81 | uint8_t reserved_1[0x40 - 0x20]; |
81 | struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; | 82 | struct fsmc_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; |
82 | uint8_t reserved_2[0xfe0 - 0xc0]; | 83 | uint8_t reserved_2[0xfe0 - 0xc0]; |
83 | uint32_t peripid0; /* 0xfe0 */ | 84 | uint32_t peripid0; /* 0xfe0 */ |
84 | uint32_t peripid1; /* 0xfe4 */ | 85 | uint32_t peripid1; /* 0xfe4 */ |
@@ -114,25 +115,6 @@ struct fsmc_regs { | |||
114 | #define FSMC_THOLD_4 (4 << 16) | 115 | #define FSMC_THOLD_4 (4 << 16) |
115 | #define FSMC_THIZ_1 (1 << 24) | 116 | #define FSMC_THIZ_1 (1 << 24) |
116 | 117 | ||
117 | /* peripid2 register definitions */ | ||
118 | #define FSMC_REVISION_MSK (0xf) | ||
119 | #define FSMC_REVISION_SHFT (0x4) | ||
120 | |||
121 | #define FSMC_VER1 1 | ||
122 | #define FSMC_VER2 2 | ||
123 | #define FSMC_VER3 3 | ||
124 | #define FSMC_VER4 4 | ||
125 | #define FSMC_VER5 5 | ||
126 | #define FSMC_VER6 6 | ||
127 | #define FSMC_VER7 7 | ||
128 | #define FSMC_VER8 8 | ||
129 | |||
130 | static inline uint32_t get_fsmc_version(struct fsmc_regs *regs) | ||
131 | { | ||
132 | return (readl(®s->peripid2) >> FSMC_REVISION_SHFT) & | ||
133 | FSMC_REVISION_MSK; | ||
134 | } | ||
135 | |||
136 | /* | 118 | /* |
137 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 | 119 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 |
138 | * and it has to be read consecutively and immediately after the 512 | 120 | * and it has to be read consecutively and immediately after the 512 |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index fe8d77ebec13..9d5306bad117 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -144,6 +144,17 @@ struct mtd_info { | |||
144 | */ | 144 | */ |
145 | uint32_t writesize; | 145 | uint32_t writesize; |
146 | 146 | ||
147 | /* | ||
148 | * Size of the write buffer used by the MTD. MTD devices having a write | ||
149 | * buffer can write multiple writesize chunks at a time. E.g. while | ||
150 | * writing 4 * writesize bytes to a device with 2 * writesize bytes | ||
151 | * buffer the MTD driver can (but doesn't have to) do 2 writesize | ||
152 | * operations, but not 4. Currently, all NANDs have writebufsize | ||
153 | * equivalent to writesize (NAND page size). Some NOR flashes do have | ||
154 | * writebufsize greater than writesize. | ||
155 | */ | ||
156 | uint32_t writebufsize; | ||
157 | |||
147 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) | 158 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) |
148 | uint32_t oobavail; // Available OOB bytes per block | 159 | uint32_t oobavail; // Available OOB bytes per block |
149 | 160 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 63e17d01fde9..1f489b247a29 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -448,6 +448,8 @@ struct nand_buffers { | |||
448 | * See the defines for further explanation. | 448 | * See the defines for further explanation. |
449 | * @badblockpos: [INTERN] position of the bad block marker in the oob | 449 | * @badblockpos: [INTERN] position of the bad block marker in the oob |
450 | * area. | 450 | * area. |
451 | * @badblockbits: [INTERN] number of bits to left-shift the bad block | ||
452 | * number | ||
451 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 453 | * @cellinfo: [INTERN] MLC/multichip data from chip ident |
452 | * @numchips: [INTERN] number of physical chips | 454 | * @numchips: [INTERN] number of physical chips |
453 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 455 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 0c8815bfae1c..ae418e41d8f5 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -118,6 +118,8 @@ struct onenand_chip { | |||
118 | int (*chip_probe)(struct mtd_info *mtd); | 118 | int (*chip_probe)(struct mtd_info *mtd); |
119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
120 | int (*scan_bbt)(struct mtd_info *mtd); | 120 | int (*scan_bbt)(struct mtd_info *mtd); |
121 | int (*enable)(struct mtd_info *mtd); | ||
122 | int (*disable)(struct mtd_info *mtd); | ||
121 | 123 | ||
122 | struct completion complete; | 124 | struct completion complete; |
123 | int irq; | 125 | int irq; |
@@ -137,6 +139,14 @@ struct onenand_chip { | |||
137 | void *bbm; | 139 | void *bbm; |
138 | 140 | ||
139 | void *priv; | 141 | void *priv; |
142 | |||
143 | /* | ||
144 | * Shows that the current operation is composed | ||
145 | * of sequence of commands. For example, cache program. | ||
146 | * Such command status OnGo bit is checked at the end of | ||
147 | * sequence. | ||
148 | */ | ||
149 | unsigned int ongoing; | ||
140 | }; | 150 | }; |
141 | 151 | ||
142 | /* | 152 | /* |
@@ -171,6 +181,9 @@ struct onenand_chip { | |||
171 | #define ONENAND_IS_2PLANE(this) (0) | 181 | #define ONENAND_IS_2PLANE(this) (0) |
172 | #endif | 182 | #endif |
173 | 183 | ||
184 | #define ONENAND_IS_CACHE_PROGRAM(this) \ | ||
185 | (this->options & ONENAND_HAS_CACHE_PROGRAM) | ||
186 | |||
174 | /* Check byte access in OneNAND */ | 187 | /* Check byte access in OneNAND */ |
175 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 188 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
176 | 189 | ||
@@ -181,6 +194,7 @@ struct onenand_chip { | |||
181 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 194 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
182 | #define ONENAND_HAS_2PLANE (0x0004) | 195 | #define ONENAND_HAS_2PLANE (0x0004) |
183 | #define ONENAND_HAS_4KB_PAGE (0x0008) | 196 | #define ONENAND_HAS_4KB_PAGE (0x0008) |
197 | #define ONENAND_HAS_CACHE_PROGRAM (0x0010) | ||
184 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | 198 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) |
185 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 199 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
186 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 200 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 2b54316591d2..4a0a8ba90a72 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -89,7 +89,7 @@ static inline int mtd_has_cmdlinepart(void) { return 1; } | |||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | 89 | static inline int mtd_has_cmdlinepart(void) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | int mtd_is_master(struct mtd_info *mtd); | 92 | int mtd_is_partition(struct mtd_info *mtd); |
93 | int mtd_add_partition(struct mtd_info *master, char *name, | 93 | int mtd_add_partition(struct mtd_info *master, char *name, |
94 | long long offset, long long length); | 94 | long long offset, long long length); |
95 | int mtd_del_partition(struct mtd_info *master, int partno); | 95 | int mtd_del_partition(struct mtd_info *master, int partno); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 18d06add0a40..f276d4fa01fc 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -45,6 +45,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
45 | * - ending slashes ok even for nonexistent files | 45 | * - ending slashes ok even for nonexistent files |
46 | * - internal "there are more path components" flag | 46 | * - internal "there are more path components" flag |
47 | * - dentry cache is untrusted; force a real lookup | 47 | * - dentry cache is untrusted; force a real lookup |
48 | * - suppress terminal automount | ||
48 | */ | 49 | */ |
49 | #define LOOKUP_FOLLOW 0x0001 | 50 | #define LOOKUP_FOLLOW 0x0001 |
50 | #define LOOKUP_DIRECTORY 0x0002 | 51 | #define LOOKUP_DIRECTORY 0x0002 |
@@ -53,6 +54,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
53 | #define LOOKUP_PARENT 0x0010 | 54 | #define LOOKUP_PARENT 0x0010 |
54 | #define LOOKUP_REVAL 0x0020 | 55 | #define LOOKUP_REVAL 0x0020 |
55 | #define LOOKUP_RCU 0x0040 | 56 | #define LOOKUP_RCU 0x0040 |
57 | #define LOOKUP_NO_AUTOMOUNT 0x0080 | ||
56 | /* | 58 | /* |
57 | * Intent data | 59 | * Intent data |
58 | */ | 60 | */ |
@@ -79,7 +81,8 @@ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry | |||
79 | 81 | ||
80 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 82 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
81 | 83 | ||
82 | extern int follow_down(struct path *); | 84 | extern int follow_down_one(struct path *); |
85 | extern int follow_down(struct path *, bool); | ||
83 | extern int follow_up(struct path *); | 86 | extern int follow_up(struct path *); |
84 | 87 | ||
85 | extern struct dentry *lock_rename(struct dentry *, struct dentry *); | 88 | extern struct dentry *lock_rename(struct dentry *, struct dentry *); |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 1c27f201c856..e13eefef0653 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -143,104 +143,4 @@ struct ncp_nls_ioctl | |||
143 | #define NCP_MAXPATHLEN 255 | 143 | #define NCP_MAXPATHLEN 255 |
144 | #define NCP_MAXNAMELEN 14 | 144 | #define NCP_MAXNAMELEN 14 |
145 | 145 | ||
146 | #ifdef __KERNEL__ | ||
147 | |||
148 | #include <linux/ncp_fs_i.h> | ||
149 | #include <linux/ncp_fs_sb.h> | ||
150 | |||
151 | /* define because it is easy to change PRINTK to {*}PRINTK */ | ||
152 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) | ||
153 | |||
154 | #undef NCPFS_PARANOIA | ||
155 | #ifdef NCPFS_PARANOIA | ||
156 | #define PPRINTK(format, args...) PRINTK(format , ## args) | ||
157 | #else | ||
158 | #define PPRINTK(format, args...) | ||
159 | #endif | ||
160 | |||
161 | #ifndef DEBUG_NCP | ||
162 | #define DEBUG_NCP 0 | ||
163 | #endif | ||
164 | #if DEBUG_NCP > 0 | ||
165 | #define DPRINTK(format, args...) PRINTK(format , ## args) | ||
166 | #else | ||
167 | #define DPRINTK(format, args...) | ||
168 | #endif | ||
169 | #if DEBUG_NCP > 1 | ||
170 | #define DDPRINTK(format, args...) PRINTK(format , ## args) | ||
171 | #else | ||
172 | #define DDPRINTK(format, args...) | ||
173 | #endif | ||
174 | |||
175 | #define NCP_MAX_RPC_TIMEOUT (6*HZ) | ||
176 | |||
177 | |||
178 | struct ncp_entry_info { | ||
179 | struct nw_info_struct i; | ||
180 | ino_t ino; | ||
181 | int opened; | ||
182 | int access; | ||
183 | unsigned int volume; | ||
184 | __u8 file_handle[6]; | ||
185 | }; | ||
186 | |||
187 | static inline struct ncp_server *NCP_SBP(const struct super_block *sb) | ||
188 | { | ||
189 | return sb->s_fs_info; | ||
190 | } | ||
191 | |||
192 | #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb) | ||
193 | static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode) | ||
194 | { | ||
195 | return container_of(inode, struct ncp_inode_info, vfs_inode); | ||
196 | } | ||
197 | |||
198 | /* linux/fs/ncpfs/inode.c */ | ||
199 | int ncp_notify_change(struct dentry *, struct iattr *); | ||
200 | struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *); | ||
201 | void ncp_update_inode(struct inode *, struct ncp_entry_info *); | ||
202 | void ncp_update_inode2(struct inode *, struct ncp_entry_info *); | ||
203 | |||
204 | /* linux/fs/ncpfs/dir.c */ | ||
205 | extern const struct inode_operations ncp_dir_inode_operations; | ||
206 | extern const struct file_operations ncp_dir_operations; | ||
207 | extern const struct dentry_operations ncp_root_dentry_operations; | ||
208 | int ncp_conn_logged_in(struct super_block *); | ||
209 | int ncp_date_dos2unix(__le16 time, __le16 date); | ||
210 | void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | ||
211 | |||
212 | /* linux/fs/ncpfs/ioctl.c */ | ||
213 | long ncp_ioctl(struct file *, unsigned int, unsigned long); | ||
214 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
215 | |||
216 | /* linux/fs/ncpfs/sock.c */ | ||
217 | int ncp_request2(struct ncp_server *server, int function, | ||
218 | void* reply, int max_reply_size); | ||
219 | static inline int ncp_request(struct ncp_server *server, int function) { | ||
220 | return ncp_request2(server, function, server->packet, server->packet_size); | ||
221 | } | ||
222 | int ncp_connect(struct ncp_server *server); | ||
223 | int ncp_disconnect(struct ncp_server *server); | ||
224 | void ncp_lock_server(struct ncp_server *server); | ||
225 | void ncp_unlock_server(struct ncp_server *server); | ||
226 | |||
227 | /* linux/fs/ncpfs/symlink.c */ | ||
228 | #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) | ||
229 | extern const struct address_space_operations ncp_symlink_aops; | ||
230 | int ncp_symlink(struct inode*, struct dentry*, const char*); | ||
231 | #endif | ||
232 | |||
233 | /* linux/fs/ncpfs/file.c */ | ||
234 | extern const struct inode_operations ncp_file_inode_operations; | ||
235 | extern const struct file_operations ncp_file_operations; | ||
236 | int ncp_make_open(struct inode *, int); | ||
237 | |||
238 | /* linux/fs/ncpfs/mmap.c */ | ||
239 | int ncp_mmap(struct file *, struct vm_area_struct *); | ||
240 | |||
241 | /* linux/fs/ncpfs/ncplib_kernel.c */ | ||
242 | int ncp_make_closed(struct inode *); | ||
243 | |||
244 | #endif /* __KERNEL__ */ | ||
245 | |||
246 | #endif /* _LINUX_NCP_FS_H */ | 146 | #endif /* _LINUX_NCP_FS_H */ |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h deleted file mode 100644 index 4b0bec477846..000000000000 --- a/include/linux/ncp_fs_i.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1995 Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_NCP_FS_I | ||
9 | #define _LINUX_NCP_FS_I | ||
10 | |||
11 | /* | ||
12 | * This is the ncpfs part of the inode structure. This must contain | ||
13 | * all the information we need to work with an inode after creation. | ||
14 | */ | ||
15 | struct ncp_inode_info { | ||
16 | __le32 dirEntNum; | ||
17 | __le32 DosDirNum; | ||
18 | __u8 volNumber; | ||
19 | __le32 nwattr; | ||
20 | struct mutex open_mutex; | ||
21 | atomic_t opened; | ||
22 | int access; | ||
23 | int flags; | ||
24 | #define NCPI_KLUDGE_SYMLINK 0x0001 | ||
25 | __u8 file_handle[6]; | ||
26 | struct inode vfs_inode; | ||
27 | }; | ||
28 | |||
29 | #endif /* _LINUX_NCP_FS_I */ | ||
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h deleted file mode 100644 index d64b0e894336..000000000000 --- a/include/linux/ncp_fs_sb.h +++ /dev/null | |||
@@ -1,164 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996 by Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _NCP_FS_SB | ||
9 | #define _NCP_FS_SB | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/ncp_mount.h> | ||
13 | #include <linux/net.h> | ||
14 | #include <linux/mutex.h> | ||
15 | #include <linux/backing-dev.h> | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <linux/workqueue.h> | ||
20 | |||
21 | #define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */ | ||
22 | |||
23 | struct sock; | ||
24 | |||
25 | struct ncp_server { | ||
26 | |||
27 | struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of | ||
28 | interest for us later, so we store | ||
29 | it completely. */ | ||
30 | |||
31 | __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2]; | ||
32 | |||
33 | struct file *ncp_filp; /* File pointer to ncp socket */ | ||
34 | struct socket *ncp_sock;/* ncp socket */ | ||
35 | struct file *info_filp; | ||
36 | struct socket *info_sock; | ||
37 | |||
38 | u8 sequence; | ||
39 | u8 task; | ||
40 | u16 connection; /* Remote connection number */ | ||
41 | |||
42 | u8 completion; /* Status message from server */ | ||
43 | u8 conn_status; /* Bit 4 = 1 ==> Server going down, no | ||
44 | requests allowed anymore. | ||
45 | Bit 0 = 1 ==> Server is down. */ | ||
46 | |||
47 | int buffer_size; /* Negotiated bufsize */ | ||
48 | |||
49 | int reply_size; /* Size of last reply */ | ||
50 | |||
51 | int packet_size; | ||
52 | unsigned char *packet; /* Here we prepare requests and | ||
53 | receive replies */ | ||
54 | unsigned char *txbuf; /* Storage for current request */ | ||
55 | unsigned char *rxbuf; /* Storage for reply to current request */ | ||
56 | |||
57 | int lock; /* To prevent mismatch in protocols. */ | ||
58 | struct mutex mutex; | ||
59 | |||
60 | int current_size; /* for packet preparation */ | ||
61 | int has_subfunction; | ||
62 | int ncp_reply_size; | ||
63 | |||
64 | int root_setuped; | ||
65 | struct mutex root_setup_lock; | ||
66 | |||
67 | /* info for packet signing */ | ||
68 | int sign_wanted; /* 1=Server needs signed packets */ | ||
69 | int sign_active; /* 0=don't do signing, 1=do */ | ||
70 | char sign_root[8]; /* generated from password and encr. key */ | ||
71 | char sign_last[16]; | ||
72 | |||
73 | /* Authentication info: NDS or BINDERY, username */ | ||
74 | struct { | ||
75 | int auth_type; | ||
76 | size_t object_name_len; | ||
77 | void* object_name; | ||
78 | int object_type; | ||
79 | } auth; | ||
80 | /* Password info */ | ||
81 | struct { | ||
82 | size_t len; | ||
83 | void* data; | ||
84 | } priv; | ||
85 | struct rw_semaphore auth_rwsem; | ||
86 | |||
87 | /* nls info: codepage for volume and charset for I/O */ | ||
88 | struct nls_table *nls_vol; | ||
89 | struct nls_table *nls_io; | ||
90 | |||
91 | /* maximum age in jiffies */ | ||
92 | atomic_t dentry_ttl; | ||
93 | |||
94 | /* miscellaneous */ | ||
95 | unsigned int flags; | ||
96 | |||
97 | spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */ | ||
98 | |||
99 | void (*data_ready)(struct sock* sk, int len); | ||
100 | void (*error_report)(struct sock* sk); | ||
101 | void (*write_space)(struct sock* sk); /* STREAM mode only */ | ||
102 | struct { | ||
103 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | ||
104 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | ||
105 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ | ||
106 | |||
107 | unsigned int state; /* STREAM only: receiver state */ | ||
108 | struct { | ||
109 | __u32 magic __packed; | ||
110 | __u32 len __packed; | ||
111 | __u16 type __packed; | ||
112 | __u16 p1 __packed; | ||
113 | __u16 p2 __packed; | ||
114 | __u16 p3 __packed; | ||
115 | __u16 type2 __packed; | ||
116 | } buf; /* STREAM only: temporary buffer */ | ||
117 | unsigned char* ptr; /* STREAM only: pointer to data */ | ||
118 | size_t len; /* STREAM only: length of data to receive */ | ||
119 | } rcv; | ||
120 | struct { | ||
121 | struct list_head requests; /* STREAM only: queued requests */ | ||
122 | struct work_struct tq; /* STREAM only: transmitter ready */ | ||
123 | struct ncp_request_reply* creq; /* STREAM only: currently transmitted entry */ | ||
124 | } tx; | ||
125 | struct timer_list timeout_tm; /* DGRAM only: timeout timer */ | ||
126 | struct work_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */ | ||
127 | int timeout_last; /* DGRAM only: current timeout length */ | ||
128 | int timeout_retries; /* DGRAM only: retries left */ | ||
129 | struct { | ||
130 | size_t len; | ||
131 | __u8 data[128]; | ||
132 | } unexpected_packet; | ||
133 | struct backing_dev_info bdi; | ||
134 | }; | ||
135 | |||
136 | extern void ncp_tcp_rcv_proc(struct work_struct *work); | ||
137 | extern void ncp_tcp_tx_proc(struct work_struct *work); | ||
138 | extern void ncpdgram_rcv_proc(struct work_struct *work); | ||
139 | extern void ncpdgram_timeout_proc(struct work_struct *work); | ||
140 | extern void ncpdgram_timeout_call(unsigned long server); | ||
141 | extern void ncp_tcp_data_ready(struct sock* sk, int len); | ||
142 | extern void ncp_tcp_write_space(struct sock* sk); | ||
143 | extern void ncp_tcp_error_report(struct sock* sk); | ||
144 | |||
145 | #define NCP_FLAG_UTF8 1 | ||
146 | |||
147 | #define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag)) | ||
148 | #define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag)) | ||
149 | #define NCP_IS_FLAG(server, flag) ((server)->flags & (flag)) | ||
150 | |||
151 | static inline int ncp_conn_valid(struct ncp_server *server) | ||
152 | { | ||
153 | return ((server->conn_status & 0x11) == 0); | ||
154 | } | ||
155 | |||
156 | static inline void ncp_invalidate_conn(struct ncp_server *server) | ||
157 | { | ||
158 | server->conn_status |= 0x01; | ||
159 | } | ||
160 | |||
161 | #endif /* __KERNEL__ */ | ||
162 | |||
163 | #endif | ||
164 | |||
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h index a2b549eb1eca..dfcbea2d889f 100644 --- a/include/linux/ncp_mount.h +++ b/include/linux/ncp_mount.h | |||
@@ -68,26 +68,4 @@ struct ncp_mount_data_v4 { | |||
68 | 68 | ||
69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ | 69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ |
70 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct ncp_mount_data_kernel { | ||
74 | unsigned long flags; /* NCP_MOUNT_* flags */ | ||
75 | unsigned int int_flags; /* internal flags */ | ||
76 | #define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001 | ||
77 | __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */ | ||
78 | struct pid *wdog_pid; /* Who cares for our watchdog packets? */ | ||
79 | unsigned int ncp_fd; /* The socket to the ncp port */ | ||
80 | unsigned int time_out; /* How long should I wait after | ||
81 | sending a NCP request? */ | ||
82 | unsigned int retry_count; /* And how often should I retry? */ | ||
83 | unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; | ||
84 | __kernel_uid32_t uid; | ||
85 | __kernel_gid32_t gid; | ||
86 | __kernel_mode_t file_mode; | ||
87 | __kernel_mode_t dir_mode; | ||
88 | int info_fd; | ||
89 | }; | ||
90 | |||
91 | #endif /* __KERNEL__ */ | ||
92 | |||
93 | #endif | 71 | #endif |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index be4957cf6511..d971346b0340 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -520,9 +520,6 @@ struct netdev_queue { | |||
520 | * please use this field instead of dev->trans_start | 520 | * please use this field instead of dev->trans_start |
521 | */ | 521 | */ |
522 | unsigned long trans_start; | 522 | unsigned long trans_start; |
523 | u64 tx_bytes; | ||
524 | u64 tx_packets; | ||
525 | u64 tx_dropped; | ||
526 | } ____cacheline_aligned_in_smp; | 523 | } ____cacheline_aligned_in_smp; |
527 | 524 | ||
528 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) | 525 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) |
@@ -2265,8 +2262,6 @@ extern void dev_load(struct net *net, const char *name); | |||
2265 | extern void dev_mcast_init(void); | 2262 | extern void dev_mcast_init(void); |
2266 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | 2263 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, |
2267 | struct rtnl_link_stats64 *storage); | 2264 | struct rtnl_link_stats64 *storage); |
2268 | extern void dev_txq_stats_fold(const struct net_device *dev, | ||
2269 | struct rtnl_link_stats64 *stats); | ||
2270 | 2265 | ||
2271 | extern int netdev_max_backlog; | 2266 | extern int netdev_max_backlog; |
2272 | extern int netdev_tstamp_prequeue; | 2267 | extern int netdev_tstamp_prequeue; |
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h new file mode 100644 index 000000000000..7ab8521f2347 --- /dev/null +++ b/include/linux/nfc/pn544.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #define PN544_DRIVER_NAME "pn544" | ||
29 | #define PN544_MAXWINDOW_SIZE 7 | ||
30 | #define PN544_WINDOW_SIZE 4 | ||
31 | #define PN544_RETRIES 10 | ||
32 | #define PN544_MAX_I2C_TRANSFER 0x0400 | ||
33 | #define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */ | ||
34 | |||
35 | /* ioctl */ | ||
36 | #define PN544_CHAR_BASE 'P' | ||
37 | #define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype) | ||
38 | #define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype) | ||
39 | #define PN544_GET_FW_MODE PN544_IOW(1, unsigned int) | ||
40 | #define PN544_SET_FW_MODE PN544_IOW(2, unsigned int) | ||
41 | #define PN544_GET_DEBUG PN544_IOW(3, unsigned int) | ||
42 | #define PN544_SET_DEBUG PN544_IOW(4, unsigned int) | ||
43 | |||
44 | /* Timing restrictions (ms) */ | ||
45 | #define PN544_RESETVEN_TIME 30 /* 7 */ | ||
46 | #define PN544_PVDDVEN_TIME 0 | ||
47 | #define PN544_VBATVEN_TIME 0 | ||
48 | #define PN544_GPIO4VEN_TIME 0 | ||
49 | #define PN544_WAKEUP_ACK 5 | ||
50 | #define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1) | ||
51 | #define PN544_INACTIVITY_TIME 1000 | ||
52 | #define PN544_INTERFRAME_DELAY 200 /* us */ | ||
53 | #define PN544_BAUDRATE_CHANGE 150 /* us */ | ||
54 | |||
55 | /* Debug bits */ | ||
56 | #define PN544_DEBUG_BUF 0x01 | ||
57 | #define PN544_DEBUG_READ 0x02 | ||
58 | #define PN544_DEBUG_WRITE 0x04 | ||
59 | #define PN544_DEBUG_IRQ 0x08 | ||
60 | #define PN544_DEBUG_CALLS 0x10 | ||
61 | #define PN544_DEBUG_MODE 0x20 | ||
62 | |||
63 | /* Normal (HCI) mode */ | ||
64 | #define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */ | ||
65 | #define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */ | ||
66 | #define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2) | ||
67 | #define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2) | ||
68 | |||
69 | struct pn544_llc_packet { | ||
70 | unsigned char length; /* of rest of packet */ | ||
71 | unsigned char header; | ||
72 | unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */ | ||
73 | }; | ||
74 | |||
75 | /* Firmware upgrade mode */ | ||
76 | #define PN544_FW_HEADER_SIZE 3 | ||
77 | /* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */ | ||
78 | #define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE) | ||
79 | |||
80 | struct pn544_fw_packet { | ||
81 | unsigned char command; /* status in answer */ | ||
82 | unsigned char length[2]; /* big-endian order (msf) */ | ||
83 | unsigned char data[PN544_MAX_FW_DATA]; | ||
84 | }; | ||
85 | |||
86 | #ifdef __KERNEL__ | ||
87 | /* board config */ | ||
88 | struct pn544_nfc_platform_data { | ||
89 | int (*request_resources) (struct i2c_client *client); | ||
90 | void (*free_resources) (void); | ||
91 | void (*enable) (int fw); | ||
92 | int (*test) (void); | ||
93 | void (*disable) (void); | ||
94 | }; | ||
95 | #endif /* __KERNEL__ */ | ||
96 | |||
97 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 9b46300b4305..134716e5e350 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -65,6 +65,9 @@ | |||
65 | 65 | ||
66 | #define NFS4_CDFC4_FORE 0x1 | 66 | #define NFS4_CDFC4_FORE 0x1 |
67 | #define NFS4_CDFC4_BACK 0x2 | 67 | #define NFS4_CDFC4_BACK 0x2 |
68 | #define NFS4_CDFC4_BOTH 0x3 | ||
69 | #define NFS4_CDFC4_FORE_OR_BOTH 0x3 | ||
70 | #define NFS4_CDFC4_BACK_OR_BOTH 0x7 | ||
68 | 71 | ||
69 | #define NFS4_SET_TO_SERVER_TIME 0 | 72 | #define NFS4_SET_TO_SERVER_TIME 0 |
70 | #define NFS4_SET_TO_CLIENT_TIME 1 | 73 | #define NFS4_SET_TO_CLIENT_TIME 1 |
@@ -140,6 +143,9 @@ | |||
140 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 | 143 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 |
141 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 | 144 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 |
142 | 145 | ||
146 | #define NFS4_SECINFO_STYLE4_CURRENT_FH 0 | ||
147 | #define NFS4_SECINFO_STYLE4_PARENT 1 | ||
148 | |||
143 | #define NFS4_MAX_UINT64 (~(u64)0) | 149 | #define NFS4_MAX_UINT64 (~(u64)0) |
144 | 150 | ||
145 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. | 151 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. |
diff --git a/include/linux/nfs4_acl.h b/include/linux/nfs4_acl.h deleted file mode 100644 index c9c05a78e9bb..000000000000 --- a/include/linux/nfs4_acl.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfs4_acl.c | ||
3 | * | ||
4 | * Common NFSv4 ACL handling definitions. | ||
5 | * | ||
6 | * Copyright (c) 2002 The Regents of the University of Michigan. | ||
7 | * All rights reserved. | ||
8 | * | ||
9 | * Marius Aamodt Eriksen <marius@umich.edu> | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * | ||
15 | * 1. Redistributions of source code must retain the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer. | ||
17 | * 2. Redistributions in binary form must reproduce the above copyright | ||
18 | * notice, this list of conditions and the following disclaimer in the | ||
19 | * documentation and/or other materials provided with the distribution. | ||
20 | * 3. Neither the name of the University nor the names of its | ||
21 | * contributors may be used to endorse or promote products derived | ||
22 | * from this software without specific prior written permission. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef LINUX_NFS4_ACL_H | ||
38 | #define LINUX_NFS4_ACL_H | ||
39 | |||
40 | #include <linux/posix_acl.h> | ||
41 | |||
42 | /* Maximum ACL we'll accept from client; chosen (somewhat arbitrarily) to | ||
43 | * fit in a page: */ | ||
44 | #define NFS4_ACL_MAX 170 | ||
45 | |||
46 | struct nfs4_acl *nfs4_acl_new(int); | ||
47 | int nfs4_acl_get_whotype(char *, u32); | ||
48 | int nfs4_acl_write_who(int who, char *p); | ||
49 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, | ||
50 | uid_t who, u32 mask); | ||
51 | |||
52 | #define NFS4_ACL_TYPE_DEFAULT 0x01 | ||
53 | #define NFS4_ACL_DIR 0x02 | ||
54 | #define NFS4_ACL_OWNER 0x04 | ||
55 | |||
56 | struct nfs4_acl *nfs4_acl_posix_to_nfsv4(struct posix_acl *, | ||
57 | struct posix_acl *, unsigned int flags); | ||
58 | int nfs4_acl_nfsv4_to_posix(struct nfs4_acl *, struct posix_acl **, | ||
59 | struct posix_acl **, unsigned int flags); | ||
60 | |||
61 | #endif /* LINUX_NFS4_ACL_H */ | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 0779bb8f95be..6023efa9f5d9 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -215,7 +215,6 @@ struct nfs_inode { | |||
215 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ | 215 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ |
216 | #define NFS_INO_STALE (1) /* possible stale inode */ | 216 | #define NFS_INO_STALE (1) /* possible stale inode */ |
217 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ | 217 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ |
218 | #define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */ | ||
219 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ | 218 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ |
220 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ | 219 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ |
221 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ | 220 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 8ae78a61eea4..bd316159278c 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define NFSEXP_NOHIDE 0x0200 | 35 | #define NFSEXP_NOHIDE 0x0200 |
36 | #define NFSEXP_NOSUBTREECHECK 0x0400 | 36 | #define NFSEXP_NOSUBTREECHECK 0x0400 |
37 | #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */ | 37 | #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */ |
38 | #define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */ | 38 | #define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect; no longer supported */ |
39 | #define NFSEXP_FSID 0x2000 | 39 | #define NFSEXP_FSID 0x2000 |
40 | #define NFSEXP_CROSSMOUNT 0x4000 | 40 | #define NFSEXP_CROSSMOUNT 0x4000 |
41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
diff --git a/include/linux/nfsd_idmap.h b/include/linux/nfsd_idmap.h deleted file mode 100644 index d4a2ac18bd4c..000000000000 --- a/include/linux/nfsd_idmap.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd_idmap.h | ||
3 | * | ||
4 | * Mapping of UID to name and vice versa. | ||
5 | * | ||
6 | * Copyright (c) 2002, 2003 The Regents of the University of | ||
7 | * Michigan. All rights reserved. | ||
8 | > * | ||
9 | * Marius Aamodt Eriksen <marius@umich.edu> | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * | ||
15 | * 1. Redistributions of source code must retain the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer. | ||
17 | * 2. Redistributions in binary form must reproduce the above copyright | ||
18 | * notice, this list of conditions and the following disclaimer in the | ||
19 | * documentation and/or other materials provided with the distribution. | ||
20 | * 3. Neither the name of the University nor the names of its | ||
21 | * contributors may be used to endorse or promote products derived | ||
22 | * from this software without specific prior written permission. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef LINUX_NFSD_IDMAP_H | ||
38 | #define LINUX_NFSD_IDMAP_H | ||
39 | |||
40 | #include <linux/in.h> | ||
41 | #include <linux/sunrpc/svc.h> | ||
42 | |||
43 | /* XXX from linux/nfs_idmap.h */ | ||
44 | #define IDMAP_NAMESZ 128 | ||
45 | |||
46 | #ifdef CONFIG_NFSD_V4 | ||
47 | int nfsd_idmap_init(void); | ||
48 | void nfsd_idmap_shutdown(void); | ||
49 | #else | ||
50 | static inline int nfsd_idmap_init(void) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | static inline void nfsd_idmap_shutdown(void) | ||
55 | { | ||
56 | } | ||
57 | #endif | ||
58 | |||
59 | int nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, __u32 *); | ||
60 | int nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, __u32 *); | ||
61 | int nfsd_map_uid_to_name(struct svc_rqst *, __u32, char *); | ||
62 | int nfsd_map_gid_to_name(struct svc_rqst *, __u32, char *); | ||
63 | |||
64 | #endif /* LINUX_NFSD_IDMAP_H */ | ||
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 2b89b712565b..821ffb954f14 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -148,6 +148,10 @@ | |||
148 | * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to | 148 | * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to |
149 | * destination %NL80211_ATTR_MAC on the interface identified by | 149 | * destination %NL80211_ATTR_MAC on the interface identified by |
150 | * %NL80211_ATTR_IFINDEX. | 150 | * %NL80211_ATTR_IFINDEX. |
151 | * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by | ||
152 | * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. | ||
153 | * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by | ||
154 | * %NL80211_ATTR_MAC. | ||
151 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the | 155 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the |
152 | * the interface identified by %NL80211_ATTR_IFINDEX. | 156 | * the interface identified by %NL80211_ATTR_IFINDEX. |
153 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC | 157 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC |
@@ -612,7 +616,7 @@ enum nl80211_commands { | |||
612 | * consisting of a nested array. | 616 | * consisting of a nested array. |
613 | * | 617 | * |
614 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). | 618 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). |
615 | * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. | 619 | * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. |
616 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. | 620 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. |
617 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path | 621 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path |
618 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at | 622 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at |
@@ -879,7 +883,9 @@ enum nl80211_commands { | |||
879 | * See &enum nl80211_key_default_types. | 883 | * See &enum nl80211_key_default_types. |
880 | * | 884 | * |
881 | * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be | 885 | * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be |
882 | * changed once the mesh is active. | 886 | * changed once the mesh is active. |
887 | * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute | ||
888 | * containing attributes from &enum nl80211_meshconf_params. | ||
883 | * | 889 | * |
884 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 890 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
885 | * @__NL80211_ATTR_AFTER_LAST: internal use | 891 | * @__NL80211_ATTR_AFTER_LAST: internal use |
@@ -1225,8 +1231,6 @@ enum nl80211_rate_info { | |||
1225 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) | 1231 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) |
1226 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) | 1232 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) |
1227 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 1233 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
1228 | * @__NL80211_STA_INFO_AFTER_LAST: internal | ||
1229 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | ||
1230 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | 1234 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) |
1231 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | 1235 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute |
1232 | * containing info as possible, see &enum nl80211_sta_info_txrate. | 1236 | * containing info as possible, see &enum nl80211_sta_info_txrate. |
@@ -1236,6 +1240,11 @@ enum nl80211_rate_info { | |||
1236 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | 1240 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) |
1237 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | 1241 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) |
1238 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) | 1242 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) |
1243 | * @NL80211_STA_INFO_LLID: the station's mesh LLID | ||
1244 | * @NL80211_STA_INFO_PLID: the station's mesh PLID | ||
1245 | * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station | ||
1246 | * @__NL80211_STA_INFO_AFTER_LAST: internal | ||
1247 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | ||
1239 | */ | 1248 | */ |
1240 | enum nl80211_sta_info { | 1249 | enum nl80211_sta_info { |
1241 | __NL80211_STA_INFO_INVALID, | 1250 | __NL80211_STA_INFO_INVALID, |
@@ -1626,7 +1635,7 @@ enum nl80211_mntr_flags { | |||
1626 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | 1635 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) |
1627 | * that it takes for an HWMP information element to propagate across the mesh | 1636 | * that it takes for an HWMP information element to propagate across the mesh |
1628 | * | 1637 | * |
1629 | * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not | 1638 | * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not |
1630 | * | 1639 | * |
1631 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a | 1640 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a |
1632 | * source mesh point for path selection elements. | 1641 | * source mesh point for path selection elements. |
@@ -1678,6 +1687,7 @@ enum nl80211_meshconf_params { | |||
1678 | * element that vendors will use to identify the path selection methods and | 1687 | * element that vendors will use to identify the path selection methods and |
1679 | * metrics in use. | 1688 | * metrics in use. |
1680 | * | 1689 | * |
1690 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number | ||
1681 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use | 1691 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use |
1682 | */ | 1692 | */ |
1683 | enum nl80211_mesh_setup_params { | 1693 | enum nl80211_mesh_setup_params { |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 0ef22a1f129e..c84d900fbbb3 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -97,7 +97,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node); | |||
97 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | 97 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, |
98 | int depth, void *data); | 98 | int depth, void *data); |
99 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | 99 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); |
100 | extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); | 100 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); |
101 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | 101 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); |
102 | 102 | ||
103 | /* | 103 | /* |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5f38c460367e..0db8037e2725 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -48,9 +48,6 @@ | |||
48 | * struct page (these bits with information) are always mapped into kernel | 48 | * struct page (these bits with information) are always mapped into kernel |
49 | * address space... | 49 | * address space... |
50 | * | 50 | * |
51 | * PG_buddy is set to indicate that the page is free and in the buddy system | ||
52 | * (see mm/page_alloc.c). | ||
53 | * | ||
54 | * PG_hwpoison indicates that a page got corrupted in hardware and contains | 51 | * PG_hwpoison indicates that a page got corrupted in hardware and contains |
55 | * data with incorrect ECC bits that triggered a machine check. Accessing is | 52 | * data with incorrect ECC bits that triggered a machine check. Accessing is |
56 | * not safe since it may cause another machine check. Don't touch! | 53 | * not safe since it may cause another machine check. Don't touch! |
@@ -96,7 +93,6 @@ enum pageflags { | |||
96 | PG_swapcache, /* Swap page: swp_entry_t in private */ | 93 | PG_swapcache, /* Swap page: swp_entry_t in private */ |
97 | PG_mappedtodisk, /* Has blocks allocated on-disk */ | 94 | PG_mappedtodisk, /* Has blocks allocated on-disk */ |
98 | PG_reclaim, /* To be reclaimed asap */ | 95 | PG_reclaim, /* To be reclaimed asap */ |
99 | PG_buddy, /* Page is free, on buddy lists */ | ||
100 | PG_swapbacked, /* Page is backed by RAM/swap */ | 96 | PG_swapbacked, /* Page is backed by RAM/swap */ |
101 | PG_unevictable, /* Page is "unevictable" */ | 97 | PG_unevictable, /* Page is "unevictable" */ |
102 | #ifdef CONFIG_MMU | 98 | #ifdef CONFIG_MMU |
@@ -108,6 +104,9 @@ enum pageflags { | |||
108 | #ifdef CONFIG_MEMORY_FAILURE | 104 | #ifdef CONFIG_MEMORY_FAILURE |
109 | PG_hwpoison, /* hardware poisoned page. Don't touch */ | 105 | PG_hwpoison, /* hardware poisoned page. Don't touch */ |
110 | #endif | 106 | #endif |
107 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
108 | PG_compound_lock, | ||
109 | #endif | ||
111 | __NR_PAGEFLAGS, | 110 | __NR_PAGEFLAGS, |
112 | 111 | ||
113 | /* Filesystems */ | 112 | /* Filesystems */ |
@@ -198,7 +197,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; } | |||
198 | struct page; /* forward declaration */ | 197 | struct page; /* forward declaration */ |
199 | 198 | ||
200 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 199 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
201 | PAGEFLAG(Error, error) | 200 | PAGEFLAG(Error, error) TESTCLEARFLAG(Error, error) |
202 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | 201 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) |
203 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 202 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) |
204 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 203 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |
@@ -230,7 +229,6 @@ PAGEFLAG(OwnerPriv1, owner_priv_1) TESTCLEARFLAG(OwnerPriv1, owner_priv_1) | |||
230 | * risky: they bypass page accounting. | 229 | * risky: they bypass page accounting. |
231 | */ | 230 | */ |
232 | TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback) | 231 | TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback) |
233 | __PAGEFLAG(Buddy, buddy) | ||
234 | PAGEFLAG(MappedToDisk, mappedtodisk) | 232 | PAGEFLAG(MappedToDisk, mappedtodisk) |
235 | 233 | ||
236 | /* PG_readahead is only used for file reads; PG_reclaim is only for writes */ | 234 | /* PG_readahead is only used for file reads; PG_reclaim is only for writes */ |
@@ -344,7 +342,7 @@ static inline void set_page_writeback(struct page *page) | |||
344 | * tests can be used in performance sensitive paths. PageCompound is | 342 | * tests can be used in performance sensitive paths. PageCompound is |
345 | * generally not used in hot code paths. | 343 | * generally not used in hot code paths. |
346 | */ | 344 | */ |
347 | __PAGEFLAG(Head, head) | 345 | __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) |
348 | __PAGEFLAG(Tail, tail) | 346 | __PAGEFLAG(Tail, tail) |
349 | 347 | ||
350 | static inline int PageCompound(struct page *page) | 348 | static inline int PageCompound(struct page *page) |
@@ -352,6 +350,13 @@ static inline int PageCompound(struct page *page) | |||
352 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); | 350 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); |
353 | 351 | ||
354 | } | 352 | } |
353 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
354 | static inline void ClearPageCompound(struct page *page) | ||
355 | { | ||
356 | BUG_ON(!PageHead(page)); | ||
357 | ClearPageHead(page); | ||
358 | } | ||
359 | #endif | ||
355 | #else | 360 | #else |
356 | /* | 361 | /* |
357 | * Reduce page flag use as much as possible by overlapping | 362 | * Reduce page flag use as much as possible by overlapping |
@@ -389,14 +394,61 @@ static inline void __ClearPageTail(struct page *page) | |||
389 | page->flags &= ~PG_head_tail_mask; | 394 | page->flags &= ~PG_head_tail_mask; |
390 | } | 395 | } |
391 | 396 | ||
397 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
398 | static inline void ClearPageCompound(struct page *page) | ||
399 | { | ||
400 | BUG_ON((page->flags & PG_head_tail_mask) != (1 << PG_compound)); | ||
401 | clear_bit(PG_compound, &page->flags); | ||
402 | } | ||
403 | #endif | ||
404 | |||
392 | #endif /* !PAGEFLAGS_EXTENDED */ | 405 | #endif /* !PAGEFLAGS_EXTENDED */ |
393 | 406 | ||
407 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
408 | /* | ||
409 | * PageHuge() only returns true for hugetlbfs pages, but not for | ||
410 | * normal or transparent huge pages. | ||
411 | * | ||
412 | * PageTransHuge() returns true for both transparent huge and | ||
413 | * hugetlbfs pages, but not normal pages. PageTransHuge() can only be | ||
414 | * called only in the core VM paths where hugetlbfs pages can't exist. | ||
415 | */ | ||
416 | static inline int PageTransHuge(struct page *page) | ||
417 | { | ||
418 | VM_BUG_ON(PageTail(page)); | ||
419 | return PageHead(page); | ||
420 | } | ||
421 | |||
422 | static inline int PageTransCompound(struct page *page) | ||
423 | { | ||
424 | return PageCompound(page); | ||
425 | } | ||
426 | |||
427 | #else | ||
428 | |||
429 | static inline int PageTransHuge(struct page *page) | ||
430 | { | ||
431 | return 0; | ||
432 | } | ||
433 | |||
434 | static inline int PageTransCompound(struct page *page) | ||
435 | { | ||
436 | return 0; | ||
437 | } | ||
438 | #endif | ||
439 | |||
394 | #ifdef CONFIG_MMU | 440 | #ifdef CONFIG_MMU |
395 | #define __PG_MLOCKED (1 << PG_mlocked) | 441 | #define __PG_MLOCKED (1 << PG_mlocked) |
396 | #else | 442 | #else |
397 | #define __PG_MLOCKED 0 | 443 | #define __PG_MLOCKED 0 |
398 | #endif | 444 | #endif |
399 | 445 | ||
446 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
447 | #define __PG_COMPOUND_LOCK (1 << PG_compound_lock) | ||
448 | #else | ||
449 | #define __PG_COMPOUND_LOCK 0 | ||
450 | #endif | ||
451 | |||
400 | /* | 452 | /* |
401 | * Flags checked when a page is freed. Pages being freed should not have | 453 | * Flags checked when a page is freed. Pages being freed should not have |
402 | * these flags set. It they are, there is a problem. | 454 | * these flags set. It they are, there is a problem. |
@@ -404,9 +456,10 @@ static inline void __ClearPageTail(struct page *page) | |||
404 | #define PAGE_FLAGS_CHECK_AT_FREE \ | 456 | #define PAGE_FLAGS_CHECK_AT_FREE \ |
405 | (1 << PG_lru | 1 << PG_locked | \ | 457 | (1 << PG_lru | 1 << PG_locked | \ |
406 | 1 << PG_private | 1 << PG_private_2 | \ | 458 | 1 << PG_private | 1 << PG_private_2 | \ |
407 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 459 | 1 << PG_writeback | 1 << PG_reserved | \ |
408 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 460 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
409 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON) | 461 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON | \ |
462 | __PG_COMPOUND_LOCK) | ||
410 | 463 | ||
411 | /* | 464 | /* |
412 | * Flags checked when a page is prepped for return by the page allocator. | 465 | * Flags checked when a page is prepped for return by the page allocator. |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index b02195dfc1b0..6d6cb7a57bb3 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -35,12 +35,15 @@ struct page_cgroup *lookup_page_cgroup(struct page *page); | |||
35 | 35 | ||
36 | enum { | 36 | enum { |
37 | /* flags for mem_cgroup */ | 37 | /* flags for mem_cgroup */ |
38 | PCG_LOCK, /* page cgroup is locked */ | 38 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ |
39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | ||
42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
43 | PCG_MIGRATION, /* under page migration */ | 41 | PCG_MIGRATION, /* under page migration */ |
42 | /* flags for mem_cgroup and file and I/O status */ | ||
43 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | ||
44 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
45 | /* No lock in page_cgroup */ | ||
46 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
44 | }; | 47 | }; |
45 | 48 | ||
46 | #define TESTPCGFLAG(uname, lname) \ | 49 | #define TESTPCGFLAG(uname, lname) \ |
@@ -94,6 +97,10 @@ static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc) | |||
94 | 97 | ||
95 | static inline void lock_page_cgroup(struct page_cgroup *pc) | 98 | static inline void lock_page_cgroup(struct page_cgroup *pc) |
96 | { | 99 | { |
100 | /* | ||
101 | * Don't take this lock in IRQ context. | ||
102 | * This lock is for pc->mem_cgroup, USED, CACHE, MIGRATION | ||
103 | */ | ||
97 | bit_spin_lock(PCG_LOCK, &pc->flags); | 104 | bit_spin_lock(PCG_LOCK, &pc->flags); |
98 | } | 105 | } |
99 | 106 | ||
@@ -107,6 +114,24 @@ static inline int page_is_cgroup_locked(struct page_cgroup *pc) | |||
107 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); | 114 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); |
108 | } | 115 | } |
109 | 116 | ||
117 | static inline void move_lock_page_cgroup(struct page_cgroup *pc, | ||
118 | unsigned long *flags) | ||
119 | { | ||
120 | /* | ||
121 | * We know updates to pc->flags of page cache's stats are from both of | ||
122 | * usual context or IRQ context. Disable IRQ to avoid deadlock. | ||
123 | */ | ||
124 | local_irq_save(*flags); | ||
125 | bit_spin_lock(PCG_MOVE_LOCK, &pc->flags); | ||
126 | } | ||
127 | |||
128 | static inline void move_unlock_page_cgroup(struct page_cgroup *pc, | ||
129 | unsigned long *flags) | ||
130 | { | ||
131 | bit_spin_unlock(PCG_MOVE_LOCK, &pc->flags); | ||
132 | local_irq_restore(*flags); | ||
133 | } | ||
134 | |||
110 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 135 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
111 | struct page_cgroup; | 136 | struct page_cgroup; |
112 | 137 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 2d1ffe3cf1ee..9c66e994540f 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -48,7 +48,7 @@ static inline void mapping_clear_unevictable(struct address_space *mapping) | |||
48 | 48 | ||
49 | static inline int mapping_unevictable(struct address_space *mapping) | 49 | static inline int mapping_unevictable(struct address_space *mapping) |
50 | { | 50 | { |
51 | if (likely(mapping)) | 51 | if (mapping) |
52 | return test_bit(AS_UNEVICTABLE, &mapping->flags); | 52 | return test_bit(AS_UNEVICTABLE, &mapping->flags); |
53 | return !!mapping; | 53 | return !!mapping; |
54 | } | 54 | } |
diff --git a/include/linux/path.h b/include/linux/path.h index a581e8c06533..edc98dec6266 100644 --- a/include/linux/path.h +++ b/include/linux/path.h | |||
@@ -10,9 +10,7 @@ struct path { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | extern void path_get(struct path *); | 12 | extern void path_get(struct path *); |
13 | extern void path_get_long(struct path *); | ||
14 | extern void path_put(struct path *); | 13 | extern void path_put(struct path *); |
15 | extern void path_put_long(struct path *); | ||
16 | 14 | ||
17 | static inline int path_equal(const struct path *path1, const struct path *path2) | 15 | static inline int path_equal(const struct path *path1, const struct path *path2) |
18 | { | 16 | { |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index c8b6473c5f42..44623500f419 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -35,9 +35,12 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
35 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 35 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
36 | pbus->number); | 36 | pbus->number); |
37 | } | 37 | } |
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_ACPI_APEI | ||
41 | extern bool aer_acpi_firmware_first(void); | ||
38 | #else | 42 | #else |
39 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 43 | static inline bool aer_acpi_firmware_first(void) { return false; } |
40 | { return NULL; } | ||
41 | #endif | 44 | #endif |
42 | 45 | ||
43 | #endif /* _PCI_ACPI_H_ */ | 46 | #endif /* _PCI_ACPI_H_ */ |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 91ba0b338b47..ce6810512c66 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | |||
27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
30 | extern void pcie_clear_aspm(void); | ||
30 | extern void pcie_no_aspm(void); | 31 | extern void pcie_no_aspm(void); |
31 | #else | 32 | #else |
32 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 33 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
@@ -41,7 +42,9 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) | |||
41 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 42 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
42 | { | 43 | { |
43 | } | 44 | } |
44 | 45 | static inline void pcie_clear_aspm(void) | |
46 | { | ||
47 | } | ||
45 | static inline void pcie_no_aspm(void) | 48 | static inline void pcie_no_aspm(void) |
46 | { | 49 | { |
47 | } | 50 | } |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7454408c41b6..559d02897075 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -806,7 +806,7 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | |||
806 | 806 | ||
807 | /* Power management related routines */ | 807 | /* Power management related routines */ |
808 | int pci_save_state(struct pci_dev *dev); | 808 | int pci_save_state(struct pci_dev *dev); |
809 | int pci_restore_state(struct pci_dev *dev); | 809 | void pci_restore_state(struct pci_dev *dev); |
810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
@@ -820,7 +820,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev); | |||
820 | int pci_back_from_sleep(struct pci_dev *dev); | 820 | int pci_back_from_sleep(struct pci_dev *dev); |
821 | bool pci_dev_run_wake(struct pci_dev *dev); | 821 | bool pci_dev_run_wake(struct pci_dev *dev); |
822 | bool pci_check_pme_status(struct pci_dev *dev); | 822 | bool pci_check_pme_status(struct pci_dev *dev); |
823 | void pci_wakeup_event(struct pci_dev *dev); | ||
824 | void pci_pme_wakeup_bus(struct pci_bus *bus); | 823 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
825 | 824 | ||
826 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 825 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
@@ -994,6 +993,14 @@ extern void pci_restore_msi_state(struct pci_dev *dev); | |||
994 | extern int pci_msi_enabled(void); | 993 | extern int pci_msi_enabled(void); |
995 | #endif | 994 | #endif |
996 | 995 | ||
996 | #ifdef CONFIG_PCIEPORTBUS | ||
997 | extern bool pcie_ports_disabled; | ||
998 | extern bool pcie_ports_auto; | ||
999 | #else | ||
1000 | #define pcie_ports_disabled true | ||
1001 | #define pcie_ports_auto false | ||
1002 | #endif | ||
1003 | |||
997 | #ifndef CONFIG_PCIEASPM | 1004 | #ifndef CONFIG_PCIEASPM |
998 | static inline int pcie_aspm_enabled(void) | 1005 | static inline int pcie_aspm_enabled(void) |
999 | { | 1006 | { |
@@ -1003,6 +1010,14 @@ static inline int pcie_aspm_enabled(void) | |||
1003 | extern int pcie_aspm_enabled(void); | 1010 | extern int pcie_aspm_enabled(void); |
1004 | #endif | 1011 | #endif |
1005 | 1012 | ||
1013 | #ifdef CONFIG_PCIEAER | ||
1014 | void pci_no_aer(void); | ||
1015 | bool pci_aer_available(void); | ||
1016 | #else | ||
1017 | static inline void pci_no_aer(void) { } | ||
1018 | static inline bool pci_aer_available(void) { return false; } | ||
1019 | #endif | ||
1020 | |||
1006 | #ifndef CONFIG_PCIE_ECRC | 1021 | #ifndef CONFIG_PCIE_ECRC |
1007 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | 1022 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) |
1008 | { | 1023 | { |
@@ -1168,10 +1183,8 @@ static inline int pci_save_state(struct pci_dev *dev) | |||
1168 | return 0; | 1183 | return 0; |
1169 | } | 1184 | } |
1170 | 1185 | ||
1171 | static inline int pci_restore_state(struct pci_dev *dev) | 1186 | static inline void pci_restore_state(struct pci_dev *dev) |
1172 | { | 1187 | { } |
1173 | return 0; | ||
1174 | } | ||
1175 | 1188 | ||
1176 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1189 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
1177 | { | 1190 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ab47732d81e0..3adb06ebf841 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2369,8 +2369,10 @@ | |||
2369 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 | 2369 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 |
2370 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 | 2370 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 |
2371 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 | 2371 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 |
2372 | #define PCI_DEVICE_ID_JMICRON_JMB385_MS 0x2388 | ||
2372 | #define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 | 2373 | #define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 |
2373 | #define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 | 2374 | #define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 |
2375 | #define PCI_DEVICE_ID_JMICRON_JMB390_MS 0x2393 | ||
2374 | 2376 | ||
2375 | #define PCI_VENDOR_ID_KORENIX 0x1982 | 2377 | #define PCI_VENDOR_ID_KORENIX 0x1982 |
2376 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 | 2378 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 |
@@ -2476,7 +2478,8 @@ | |||
2476 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 | 2478 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 |
2477 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2479 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
2478 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | 2480 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 |
2479 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40 | 2481 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 |
2482 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 | ||
2480 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2483 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
2481 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2484 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
2482 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 2485 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index af83076c31a6..5b7e6b1ba54f 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -309,6 +309,14 @@ | |||
309 | #define PCI_MSIX_PBA 8 | 309 | #define PCI_MSIX_PBA 8 |
310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
311 | 311 | ||
312 | /* MSI-X entry's format */ | ||
313 | #define PCI_MSIX_ENTRY_SIZE 16 | ||
314 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 | ||
315 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 | ||
316 | #define PCI_MSIX_ENTRY_DATA 8 | ||
317 | #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 | ||
318 | #define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 | ||
319 | |||
312 | /* CompactPCI Hotswap Register */ | 320 | /* CompactPCI Hotswap Register */ |
313 | 321 | ||
314 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ | 322 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ |
@@ -496,6 +504,8 @@ | |||
496 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ | 504 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ |
497 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ | 505 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ |
498 | #define PCI_EXP_RTSTA 32 /* Root Status */ | 506 | #define PCI_EXP_RTSTA 32 /* Root Status */ |
507 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ | ||
508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | ||
499 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
500 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
501 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 56e76af78102..1a2ccd6f3823 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -57,7 +57,7 @@ struct poll_table_entry { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * Structures and helpers for sys_poll/sys_poll | 60 | * Structures and helpers for select/poll syscall |
61 | */ | 61 | */ |
62 | struct poll_wqueues { | 62 | struct poll_wqueues { |
63 | poll_table pt; | 63 | poll_table pt; |
diff --git a/include/linux/power/gpio-charger.h b/include/linux/power/gpio-charger.h new file mode 100644 index 000000000000..de1dfe09a03d --- /dev/null +++ b/include/linux/power/gpio-charger.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | * | ||
9 | * You should have received a copy of the GNU General Public License along | ||
10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_POWER_GPIO_CHARGER_H__ | ||
16 | #define __LINUX_POWER_GPIO_CHARGER_H__ | ||
17 | |||
18 | #include <linux/power_supply.h> | ||
19 | #include <linux/types.h> | ||
20 | |||
21 | /** | ||
22 | * struct gpio_charger_platform_data - platform_data for gpio_charger devices | ||
23 | * @name: Name for the chargers power_supply device | ||
24 | * @type: Type of the charger | ||
25 | * @gpio: GPIO which is used to indicate the chargers status | ||
26 | * @gpio_active_low: Should be set to 1 if the GPIO is active low otherwise 0 | ||
27 | * @supplied_to: Array of battery names to which this chargers supplies power | ||
28 | * @num_supplicants: Number of entries in the supplied_to array | ||
29 | */ | ||
30 | struct gpio_charger_platform_data { | ||
31 | const char *name; | ||
32 | enum power_supply_type type; | ||
33 | |||
34 | int gpio; | ||
35 | int gpio_active_low; | ||
36 | |||
37 | char **supplied_to; | ||
38 | size_t num_supplicants; | ||
39 | }; | ||
40 | |||
41 | #endif | ||
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h new file mode 100644 index 000000000000..7995deb8bfc1 --- /dev/null +++ b/include/linux/power/max17042_battery.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Fuel gauge driver for Maxim 17042 / 8966 / 8997 | ||
3 | * Note that Maxim 8966 and 8997 are mfd and this is its subdevice. | ||
4 | * | ||
5 | * Copyright (C) 2011 Samsung Electronics | ||
6 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __MAX17042_BATTERY_H_ | ||
24 | #define __MAX17042_BATTERY_H_ | ||
25 | |||
26 | struct max17042_platform_data { | ||
27 | bool enable_current_sense; | ||
28 | }; | ||
29 | |||
30 | #endif /* __MAX17042_BATTERY_H_ */ | ||
diff --git a/include/linux/pps.h b/include/linux/pps.h index 0194ab06177b..a9bb1d93451a 100644 --- a/include/linux/pps.h +++ b/include/linux/pps.h | |||
@@ -114,11 +114,18 @@ struct pps_fdata { | |||
114 | struct pps_ktime timeout; | 114 | struct pps_ktime timeout; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | struct pps_bind_args { | ||
118 | int tsformat; /* format of time stamps */ | ||
119 | int edge; /* selected event type */ | ||
120 | int consumer; /* selected kernel consumer */ | ||
121 | }; | ||
122 | |||
117 | #include <linux/ioctl.h> | 123 | #include <linux/ioctl.h> |
118 | 124 | ||
119 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) | 125 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) |
120 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) | 126 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) |
121 | #define PPS_GETCAP _IOR('p', 0xa3, int *) | 127 | #define PPS_GETCAP _IOR('p', 0xa3, int *) |
122 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) | 128 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) |
129 | #define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *) | ||
123 | 130 | ||
124 | #endif /* _PPS_H_ */ | 131 | #endif /* _PPS_H_ */ |
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index e0a193f830ef..94048547f29a 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -18,6 +18,9 @@ | |||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef LINUX_PPS_KERNEL_H | ||
22 | #define LINUX_PPS_KERNEL_H | ||
23 | |||
21 | #include <linux/pps.h> | 24 | #include <linux/pps.h> |
22 | 25 | ||
23 | #include <linux/cdev.h> | 26 | #include <linux/cdev.h> |
@@ -28,18 +31,28 @@ | |||
28 | * Global defines | 31 | * Global defines |
29 | */ | 32 | */ |
30 | 33 | ||
34 | struct pps_device; | ||
35 | |||
31 | /* The specific PPS source info */ | 36 | /* The specific PPS source info */ |
32 | struct pps_source_info { | 37 | struct pps_source_info { |
33 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ | 38 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ |
34 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ | 39 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ |
35 | int mode; /* PPS's allowed mode */ | 40 | int mode; /* PPS's allowed mode */ |
36 | 41 | ||
37 | void (*echo)(int source, int event, void *data); /* PPS echo function */ | 42 | void (*echo)(struct pps_device *pps, |
43 | int event, void *data); /* PPS echo function */ | ||
38 | 44 | ||
39 | struct module *owner; | 45 | struct module *owner; |
40 | struct device *dev; | 46 | struct device *dev; |
41 | }; | 47 | }; |
42 | 48 | ||
49 | struct pps_event_time { | ||
50 | #ifdef CONFIG_NTP_PPS | ||
51 | struct timespec ts_raw; | ||
52 | #endif /* CONFIG_NTP_PPS */ | ||
53 | struct timespec ts_real; | ||
54 | }; | ||
55 | |||
43 | /* The main struct */ | 56 | /* The main struct */ |
44 | struct pps_device { | 57 | struct pps_device { |
45 | struct pps_source_info info; /* PSS source info */ | 58 | struct pps_source_info info; /* PSS source info */ |
@@ -52,38 +65,56 @@ struct pps_device { | |||
52 | struct pps_ktime clear_tu; | 65 | struct pps_ktime clear_tu; |
53 | int current_mode; /* PPS mode at event time */ | 66 | int current_mode; /* PPS mode at event time */ |
54 | 67 | ||
55 | int go; /* PPS event is arrived? */ | 68 | unsigned int last_ev; /* last PPS event id */ |
56 | wait_queue_head_t queue; /* PPS event queue */ | 69 | wait_queue_head_t queue; /* PPS event queue */ |
57 | 70 | ||
58 | unsigned int id; /* PPS source unique ID */ | 71 | unsigned int id; /* PPS source unique ID */ |
59 | struct cdev cdev; | 72 | struct cdev cdev; |
60 | struct device *dev; | 73 | struct device *dev; |
61 | int devno; | ||
62 | struct fasync_struct *async_queue; /* fasync method */ | 74 | struct fasync_struct *async_queue; /* fasync method */ |
63 | spinlock_t lock; | 75 | spinlock_t lock; |
64 | |||
65 | atomic_t usage; /* usage count */ | ||
66 | }; | 76 | }; |
67 | 77 | ||
68 | /* | 78 | /* |
69 | * Global variables | 79 | * Global variables |
70 | */ | 80 | */ |
71 | 81 | ||
72 | extern spinlock_t pps_idr_lock; | ||
73 | extern struct idr pps_idr; | ||
74 | extern struct timespec pps_irq_ts[]; | ||
75 | |||
76 | extern struct device_attribute pps_attrs[]; | 82 | extern struct device_attribute pps_attrs[]; |
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Exported functions | 85 | * Exported functions |
80 | */ | 86 | */ |
81 | 87 | ||
82 | struct pps_device *pps_get_source(int source); | 88 | extern struct pps_device *pps_register_source( |
83 | extern void pps_put_source(struct pps_device *pps); | 89 | struct pps_source_info *info, int default_params); |
84 | extern int pps_register_source(struct pps_source_info *info, | 90 | extern void pps_unregister_source(struct pps_device *pps); |
85 | int default_params); | ||
86 | extern void pps_unregister_source(int source); | ||
87 | extern int pps_register_cdev(struct pps_device *pps); | 91 | extern int pps_register_cdev(struct pps_device *pps); |
88 | extern void pps_unregister_cdev(struct pps_device *pps); | 92 | extern void pps_unregister_cdev(struct pps_device *pps); |
89 | extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); | 93 | extern void pps_event(struct pps_device *pps, |
94 | struct pps_event_time *ts, int event, void *data); | ||
95 | |||
96 | static inline void timespec_to_pps_ktime(struct pps_ktime *kt, | ||
97 | struct timespec ts) | ||
98 | { | ||
99 | kt->sec = ts.tv_sec; | ||
100 | kt->nsec = ts.tv_nsec; | ||
101 | } | ||
102 | |||
103 | #ifdef CONFIG_NTP_PPS | ||
104 | |||
105 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
106 | { | ||
107 | getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real); | ||
108 | } | ||
109 | |||
110 | #else /* CONFIG_NTP_PPS */ | ||
111 | |||
112 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
113 | { | ||
114 | getnstimeofday(&ts->ts_real); | ||
115 | } | ||
116 | |||
117 | #endif /* CONFIG_NTP_PPS */ | ||
118 | |||
119 | #endif /* LINUX_PPS_KERNEL_H */ | ||
120 | |||
diff --git a/include/linux/printk.h b/include/linux/printk.h index b772ca5fbdf0..ee048e77e1ae 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -4,14 +4,14 @@ | |||
4 | extern const char linux_banner[]; | 4 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 5 | extern const char linux_proc_banner[]; |
6 | 6 | ||
7 | #define KERN_EMERG "<0>" /* system is unusable */ | 7 | #define KERN_EMERG "<0>" /* system is unusable */ |
8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
9 | #define KERN_CRIT "<2>" /* critical conditions */ | 9 | #define KERN_CRIT "<2>" /* critical conditions */ |
10 | #define KERN_ERR "<3>" /* error conditions */ | 10 | #define KERN_ERR "<3>" /* error conditions */ |
11 | #define KERN_WARNING "<4>" /* warning conditions */ | 11 | #define KERN_WARNING "<4>" /* warning conditions */ |
12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | 12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ |
13 | #define KERN_INFO "<6>" /* informational */ | 13 | #define KERN_INFO "<6>" /* informational */ |
14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | 14 | #define KERN_DEBUG "<7>" /* debug-level messages */ |
15 | 15 | ||
16 | /* Use the default kernel loglevel */ | 16 | /* Use the default kernel loglevel */ |
17 | #define KERN_DEFAULT "<d>" | 17 | #define KERN_DEFAULT "<d>" |
@@ -20,7 +20,7 @@ extern const char linux_proc_banner[]; | |||
20 | * line that had no enclosing \n). Only to be used by core/arch code | 20 | * line that had no enclosing \n). Only to be used by core/arch code |
21 | * during early bootup (a continued line is not SMP-safe otherwise). | 21 | * during early bootup (a continued line is not SMP-safe otherwise). |
22 | */ | 22 | */ |
23 | #define KERN_CONT "<c>" | 23 | #define KERN_CONT "<c>" |
24 | 24 | ||
25 | extern int console_printk[]; | 25 | extern int console_printk[]; |
26 | 26 | ||
@@ -29,6 +29,17 @@ extern int console_printk[]; | |||
29 | #define minimum_console_loglevel (console_printk[2]) | 29 | #define minimum_console_loglevel (console_printk[2]) |
30 | #define default_console_loglevel (console_printk[3]) | 30 | #define default_console_loglevel (console_printk[3]) |
31 | 31 | ||
32 | static inline void console_silent(void) | ||
33 | { | ||
34 | console_loglevel = 0; | ||
35 | } | ||
36 | |||
37 | static inline void console_verbose(void) | ||
38 | { | ||
39 | if (console_loglevel) | ||
40 | console_loglevel = 15; | ||
41 | } | ||
42 | |||
32 | struct va_format { | 43 | struct va_format { |
33 | const char *fmt; | 44 | const char *fmt; |
34 | va_list *va; | 45 | va_list *va; |
@@ -65,11 +76,27 @@ struct va_format { | |||
65 | */ | 76 | */ |
66 | #define HW_ERR "[Hardware Error]: " | 77 | #define HW_ERR "[Hardware Error]: " |
67 | 78 | ||
79 | /* | ||
80 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
81 | * gcc's format and side-effect checking. | ||
82 | */ | ||
83 | static inline __attribute__ ((format (printf, 1, 2))) | ||
84 | int no_printk(const char *fmt, ...) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | extern asmlinkage __attribute__ ((format (printf, 1, 2))) | ||
90 | void early_printk(const char *fmt, ...); | ||
91 | |||
92 | extern int printk_needs_cpu(int cpu); | ||
93 | extern void printk_tick(void); | ||
94 | |||
68 | #ifdef CONFIG_PRINTK | 95 | #ifdef CONFIG_PRINTK |
69 | asmlinkage int vprintk(const char *fmt, va_list args) | 96 | asmlinkage __attribute__ ((format (printf, 1, 0))) |
70 | __attribute__ ((format (printf, 1, 0))); | 97 | int vprintk(const char *fmt, va_list args); |
71 | asmlinkage int printk(const char * fmt, ...) | 98 | asmlinkage __attribute__ ((format (printf, 1, 2))) __cold |
72 | __attribute__ ((format (printf, 1, 2))) __cold; | 99 | int printk(const char *fmt, ...); |
73 | 100 | ||
74 | /* | 101 | /* |
75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | 102 | * Please don't use printk_ratelimit(), because it shares ratelimiting state |
@@ -83,99 +110,56 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
83 | 110 | ||
84 | extern int printk_delay_msec; | 111 | extern int printk_delay_msec; |
85 | extern int dmesg_restrict; | 112 | extern int dmesg_restrict; |
86 | 113 | extern int kptr_restrict; | |
87 | /* | ||
88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
89 | */ | ||
90 | #define printk_once(x...) ({ \ | ||
91 | static bool __print_once; \ | ||
92 | \ | ||
93 | if (!__print_once) { \ | ||
94 | __print_once = true; \ | ||
95 | printk(x); \ | ||
96 | } \ | ||
97 | }) | ||
98 | 114 | ||
99 | void log_buf_kexec_setup(void); | 115 | void log_buf_kexec_setup(void); |
100 | #else | 116 | #else |
101 | static inline int vprintk(const char *s, va_list args) | 117 | static inline __attribute__ ((format (printf, 1, 0))) |
102 | __attribute__ ((format (printf, 1, 0))); | 118 | int vprintk(const char *s, va_list args) |
103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
104 | static inline int printk(const char *s, ...) | ||
105 | __attribute__ ((format (printf, 1, 2))); | ||
106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
107 | static inline int printk_ratelimit(void) { return 0; } | ||
108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
109 | unsigned int interval_msec) \ | ||
110 | { return false; } | ||
111 | |||
112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
113 | #define printk_once(x...) printk(x) | ||
114 | |||
115 | static inline void log_buf_kexec_setup(void) | ||
116 | { | 119 | { |
120 | return 0; | ||
117 | } | 121 | } |
118 | #endif | 122 | static inline __attribute__ ((format (printf, 1, 2))) __cold |
119 | 123 | int printk(const char *s, ...) | |
120 | /* | ||
121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
122 | * gcc's format and side-effect checking. | ||
123 | */ | ||
124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
125 | int no_printk(const char *s, ...) { return 0; } | ||
126 | |||
127 | extern int printk_needs_cpu(int cpu); | ||
128 | extern void printk_tick(void); | ||
129 | |||
130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
131 | early_printk(const char *fmt, ...); | ||
132 | |||
133 | static inline void console_silent(void) | ||
134 | { | 124 | { |
135 | console_loglevel = 0; | 125 | return 0; |
126 | } | ||
127 | static inline int printk_ratelimit(void) | ||
128 | { | ||
129 | return 0; | ||
130 | } | ||
131 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
132 | unsigned int interval_msec) | ||
133 | { | ||
134 | return false; | ||
136 | } | 135 | } |
137 | 136 | ||
138 | static inline void console_verbose(void) | 137 | static inline void log_buf_kexec_setup(void) |
139 | { | 138 | { |
140 | if (console_loglevel) | ||
141 | console_loglevel = 15; | ||
142 | } | 139 | } |
140 | #endif | ||
143 | 141 | ||
144 | extern void dump_stack(void) __cold; | 142 | extern void dump_stack(void) __cold; |
145 | 143 | ||
146 | enum { | ||
147 | DUMP_PREFIX_NONE, | ||
148 | DUMP_PREFIX_ADDRESS, | ||
149 | DUMP_PREFIX_OFFSET | ||
150 | }; | ||
151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
152 | int rowsize, int groupsize, | ||
153 | char *linebuf, size_t linebuflen, bool ascii); | ||
154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
155 | int prefix_type, int rowsize, int groupsize, | ||
156 | const void *buf, size_t len, bool ascii); | ||
157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
158 | const void *buf, size_t len); | ||
159 | |||
160 | #ifndef pr_fmt | 144 | #ifndef pr_fmt |
161 | #define pr_fmt(fmt) fmt | 145 | #define pr_fmt(fmt) fmt |
162 | #endif | 146 | #endif |
163 | 147 | ||
164 | #define pr_emerg(fmt, ...) \ | 148 | #define pr_emerg(fmt, ...) \ |
165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 149 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
166 | #define pr_alert(fmt, ...) \ | 150 | #define pr_alert(fmt, ...) \ |
167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 151 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
168 | #define pr_crit(fmt, ...) \ | 152 | #define pr_crit(fmt, ...) \ |
169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 153 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
170 | #define pr_err(fmt, ...) \ | 154 | #define pr_err(fmt, ...) \ |
171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 155 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
172 | #define pr_warning(fmt, ...) \ | 156 | #define pr_warning(fmt, ...) \ |
173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 157 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
174 | #define pr_warn pr_warning | 158 | #define pr_warn pr_warning |
175 | #define pr_notice(fmt, ...) \ | 159 | #define pr_notice(fmt, ...) \ |
176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 160 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
177 | #define pr_info(fmt, ...) \ | 161 | #define pr_info(fmt, ...) \ |
178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 162 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
179 | #define pr_cont(fmt, ...) \ | 163 | #define pr_cont(fmt, ...) \ |
180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | 164 | printk(KERN_CONT fmt, ##__VA_ARGS__) |
181 | 165 | ||
@@ -185,7 +169,7 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 169 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #else | 170 | #else |
187 | #define pr_devel(fmt, ...) \ | 171 | #define pr_devel(fmt, ...) \ |
188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 172 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
189 | #endif | 173 | #endif |
190 | 174 | ||
191 | /* If you are writing a driver, please use dev_dbg instead */ | 175 | /* If you are writing a driver, please use dev_dbg instead */ |
@@ -198,7 +182,51 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | 182 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
199 | #else | 183 | #else |
200 | #define pr_debug(fmt, ...) \ | 184 | #define pr_debug(fmt, ...) \ |
201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 185 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #endif | ||
187 | |||
188 | /* | ||
189 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
190 | */ | ||
191 | |||
192 | #ifdef CONFIG_PRINTK | ||
193 | #define printk_once(fmt, ...) \ | ||
194 | ({ \ | ||
195 | static bool __print_once; \ | ||
196 | \ | ||
197 | if (!__print_once) { \ | ||
198 | __print_once = true; \ | ||
199 | printk(fmt, ##__VA_ARGS__); \ | ||
200 | } \ | ||
201 | }) | ||
202 | #else | ||
203 | #define printk_once(fmt, ...) \ | ||
204 | no_printk(fmt, ##__VA_ARGS__) | ||
205 | #endif | ||
206 | |||
207 | #define pr_emerg_once(fmt, ...) \ | ||
208 | printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
209 | #define pr_alert_once(fmt, ...) \ | ||
210 | printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
211 | #define pr_crit_once(fmt, ...) \ | ||
212 | printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
213 | #define pr_err_once(fmt, ...) \ | ||
214 | printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
215 | #define pr_warn_once(fmt, ...) \ | ||
216 | printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
217 | #define pr_notice_once(fmt, ...) \ | ||
218 | printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
219 | #define pr_info_once(fmt, ...) \ | ||
220 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
221 | #define pr_cont_once(fmt, ...) \ | ||
222 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) | ||
223 | /* If you are writing a driver, please use dev_dbg instead */ | ||
224 | #if defined(DEBUG) | ||
225 | #define pr_debug_once(fmt, ...) \ | ||
226 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
227 | #else | ||
228 | #define pr_debug_once(fmt, ...) \ | ||
229 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
202 | #endif | 230 | #endif |
203 | 231 | ||
204 | /* | 232 | /* |
@@ -206,7 +234,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
206 | * no local ratelimit_state used in the !PRINTK case | 234 | * no local ratelimit_state used in the !PRINTK case |
207 | */ | 235 | */ |
208 | #ifdef CONFIG_PRINTK | 236 | #ifdef CONFIG_PRINTK |
209 | #define printk_ratelimited(fmt, ...) ({ \ | 237 | #define printk_ratelimited(fmt, ...) \ |
238 | ({ \ | ||
210 | static DEFINE_RATELIMIT_STATE(_rs, \ | 239 | static DEFINE_RATELIMIT_STATE(_rs, \ |
211 | DEFAULT_RATELIMIT_INTERVAL, \ | 240 | DEFAULT_RATELIMIT_INTERVAL, \ |
212 | DEFAULT_RATELIMIT_BURST); \ | 241 | DEFAULT_RATELIMIT_BURST); \ |
@@ -215,34 +244,59 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
215 | printk(fmt, ##__VA_ARGS__); \ | 244 | printk(fmt, ##__VA_ARGS__); \ |
216 | }) | 245 | }) |
217 | #else | 246 | #else |
218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | 247 | #define printk_ratelimited(fmt, ...) \ |
219 | #define printk_ratelimited printk | 248 | no_printk(fmt, ##__VA_ARGS__) |
220 | #endif | 249 | #endif |
221 | 250 | ||
222 | #define pr_emerg_ratelimited(fmt, ...) \ | 251 | #define pr_emerg_ratelimited(fmt, ...) \ |
223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 252 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
224 | #define pr_alert_ratelimited(fmt, ...) \ | 253 | #define pr_alert_ratelimited(fmt, ...) \ |
225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 254 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
226 | #define pr_crit_ratelimited(fmt, ...) \ | 255 | #define pr_crit_ratelimited(fmt, ...) \ |
227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 256 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
228 | #define pr_err_ratelimited(fmt, ...) \ | 257 | #define pr_err_ratelimited(fmt, ...) \ |
229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 258 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
230 | #define pr_warning_ratelimited(fmt, ...) \ | 259 | #define pr_warn_ratelimited(fmt, ...) \ |
231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 260 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
232 | #define pr_warn_ratelimited pr_warning_ratelimited | 261 | #define pr_notice_ratelimited(fmt, ...) \ |
233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 262 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
235 | #define pr_info_ratelimited(fmt, ...) \ | 263 | #define pr_info_ratelimited(fmt, ...) \ |
236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 264 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
237 | /* no pr_cont_ratelimited, don't do that... */ | 265 | /* no pr_cont_ratelimited, don't do that... */ |
238 | /* If you are writing a driver, please use dev_dbg instead */ | 266 | /* If you are writing a driver, please use dev_dbg instead */ |
239 | #if defined(DEBUG) | 267 | #if defined(DEBUG) |
240 | #define pr_debug_ratelimited(fmt, ...) \ | 268 | #define pr_debug_ratelimited(fmt, ...) \ |
241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 269 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
242 | #else | 270 | #else |
243 | #define pr_debug_ratelimited(fmt, ...) \ | 271 | #define pr_debug_ratelimited(fmt, ...) \ |
244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | 272 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
245 | ##__VA_ARGS__); 0; }) | 273 | #endif |
274 | |||
275 | enum { | ||
276 | DUMP_PREFIX_NONE, | ||
277 | DUMP_PREFIX_ADDRESS, | ||
278 | DUMP_PREFIX_OFFSET | ||
279 | }; | ||
280 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
281 | int rowsize, int groupsize, | ||
282 | char *linebuf, size_t linebuflen, bool ascii); | ||
283 | #ifdef CONFIG_PRINTK | ||
284 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
285 | int prefix_type, int rowsize, int groupsize, | ||
286 | const void *buf, size_t len, bool ascii); | ||
287 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
288 | const void *buf, size_t len); | ||
289 | #else | ||
290 | static inline void print_hex_dump(const char *level, const char *prefix_str, | ||
291 | int prefix_type, int rowsize, int groupsize, | ||
292 | const void *buf, size_t len, bool ascii) | ||
293 | { | ||
294 | } | ||
295 | static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
296 | const void *buf, size_t len) | ||
297 | { | ||
298 | } | ||
299 | |||
246 | #endif | 300 | #endif |
247 | 301 | ||
248 | #endif | 302 | #endif |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index ab2baa5c4884..23241c2fecce 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -146,6 +146,22 @@ static inline void *radix_tree_deref_slot(void **pslot) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * radix_tree_deref_slot_protected - dereference a slot without RCU lock but with tree lock held | ||
150 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot | ||
151 | * Returns: item that was stored in that slot with any direct pointer flag | ||
152 | * removed. | ||
153 | * | ||
154 | * Similar to radix_tree_deref_slot but only used during migration when a pages | ||
155 | * mapping is being moved. The caller does not hold the RCU read lock but it | ||
156 | * must hold the tree lock to prevent parallel updates. | ||
157 | */ | ||
158 | static inline void *radix_tree_deref_slot_protected(void **pslot, | ||
159 | spinlock_t *treelock) | ||
160 | { | ||
161 | return rcu_dereference_protected(*pslot, lockdep_is_held(treelock)); | ||
162 | } | ||
163 | |||
164 | /** | ||
149 | * radix_tree_deref_retry - check radix_tree_deref_slot | 165 | * radix_tree_deref_retry - check radix_tree_deref_slot |
150 | * @arg: pointer returned by radix_tree_deref_slot | 166 | * @arg: pointer returned by radix_tree_deref_slot |
151 | * Returns: 0 if retry is not required, otherwise retry is required | 167 | * Returns: 0 if retry is not required, otherwise retry is required |
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index b872b493724d..cf1244fbf3b6 100644 --- a/include/linux/rculist_bl.h +++ b/include/linux/rculist_bl.h | |||
@@ -11,7 +11,8 @@ static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h, | |||
11 | struct hlist_bl_node *n) | 11 | struct hlist_bl_node *n) |
12 | { | 12 | { |
13 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | 13 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); |
14 | LIST_BL_BUG_ON(!((unsigned long)h->first & LIST_BL_LOCKMASK)); | 14 | LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != |
15 | LIST_BL_LOCKMASK); | ||
15 | rcu_assign_pointer(h->first, | 16 | rcu_assign_pointer(h->first, |
16 | (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK)); | 17 | (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK)); |
17 | } | 18 | } |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index f509877c2ed4..6a210f1511fc 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
@@ -11,15 +11,17 @@ | |||
11 | #define __LINUX_MFD_AB8500_REGULATOR_H | 11 | #define __LINUX_MFD_AB8500_REGULATOR_H |
12 | 12 | ||
13 | /* AB8500 regulators */ | 13 | /* AB8500 regulators */ |
14 | #define AB8500_LDO_AUX1 0 | 14 | enum ab8500_regulator_id { |
15 | #define AB8500_LDO_AUX2 1 | 15 | AB8500_LDO_AUX1, |
16 | #define AB8500_LDO_AUX3 2 | 16 | AB8500_LDO_AUX2, |
17 | #define AB8500_LDO_INTCORE 3 | 17 | AB8500_LDO_AUX3, |
18 | #define AB8500_LDO_TVOUT 4 | 18 | AB8500_LDO_INTCORE, |
19 | #define AB8500_LDO_AUDIO 5 | 19 | AB8500_LDO_TVOUT, |
20 | #define AB8500_LDO_ANAMIC1 6 | 20 | AB8500_LDO_AUDIO, |
21 | #define AB8500_LDO_ANAMIC2 7 | 21 | AB8500_LDO_ANAMIC1, |
22 | #define AB8500_LDO_DMIC 8 | 22 | AB8500_LDO_ANAMIC2, |
23 | #define AB8500_LDO_ANA 9 | 23 | AB8500_LDO_DMIC, |
24 | 24 | AB8500_LDO_ANA, | |
25 | AB8500_NUM_REGULATORS, | ||
26 | }; | ||
25 | #endif | 27 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index ebd747265294..7954f6bd7edb 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -154,6 +154,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | |||
154 | int min_uV, int max_uV); | 154 | int min_uV, int max_uV); |
155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
156 | int regulator_get_voltage(struct regulator *regulator); | 156 | int regulator_get_voltage(struct regulator *regulator); |
157 | int regulator_sync_voltage(struct regulator *regulator); | ||
157 | int regulator_set_current_limit(struct regulator *regulator, | 158 | int regulator_set_current_limit(struct regulator *regulator, |
158 | int min_uA, int max_uA); | 159 | int min_uA, int max_uA); |
159 | int regulator_get_current_limit(struct regulator *regulator); | 160 | int regulator_get_current_limit(struct regulator *regulator); |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 592cd7c642c2..b8ed16a33c47 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -42,7 +42,11 @@ enum regulator_status { | |||
42 | * | 42 | * |
43 | * @set_voltage: Set the voltage for the regulator within the range specified. | 43 | * @set_voltage: Set the voltage for the regulator within the range specified. |
44 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
45 | * @set_voltage_sel: Set the voltage for the regulator using the specified | ||
46 | * selector. | ||
45 | * @get_voltage: Return the currently configured voltage for the regulator. | 47 | * @get_voltage: Return the currently configured voltage for the regulator. |
48 | * @get_voltage_sel: Return the currently configured voltage selector for the | ||
49 | * regulator. | ||
46 | * @list_voltage: Return one of the supported voltages, in microvolts; zero | 50 | * @list_voltage: Return one of the supported voltages, in microvolts; zero |
47 | * if the selector indicates a voltage that is unusable on this system; | 51 | * if the selector indicates a voltage that is unusable on this system; |
48 | * or negative errno. Selectors range from zero to one less than | 52 | * or negative errno. Selectors range from zero to one less than |
@@ -79,8 +83,11 @@ struct regulator_ops { | |||
79 | int (*list_voltage) (struct regulator_dev *, unsigned selector); | 83 | int (*list_voltage) (struct regulator_dev *, unsigned selector); |
80 | 84 | ||
81 | /* get/set regulator voltage */ | 85 | /* get/set regulator voltage */ |
82 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); | 86 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV, |
87 | unsigned *selector); | ||
88 | int (*set_voltage_sel) (struct regulator_dev *, unsigned selector); | ||
83 | int (*get_voltage) (struct regulator_dev *); | 89 | int (*get_voltage) (struct regulator_dev *); |
90 | int (*get_voltage_sel) (struct regulator_dev *); | ||
84 | 91 | ||
85 | /* get/set regulator current */ | 92 | /* get/set regulator current */ |
86 | int (*set_current_limit) (struct regulator_dev *, | 93 | int (*set_current_limit) (struct regulator_dev *, |
@@ -168,9 +175,9 @@ struct regulator_desc { | |||
168 | */ | 175 | */ |
169 | struct regulator_dev { | 176 | struct regulator_dev { |
170 | struct regulator_desc *desc; | 177 | struct regulator_desc *desc; |
171 | int use_count; | ||
172 | int open_count; | ||
173 | int exclusive; | 178 | int exclusive; |
179 | u32 use_count; | ||
180 | u32 open_count; | ||
174 | 181 | ||
175 | /* lists we belong to */ | 182 | /* lists we belong to */ |
176 | struct list_head list; /* list of all regulators */ | 183 | struct list_head list; /* list of all regulators */ |
@@ -188,10 +195,14 @@ struct regulator_dev { | |||
188 | struct regulator_dev *supply; /* for tree */ | 195 | struct regulator_dev *supply; /* for tree */ |
189 | 196 | ||
190 | void *reg_data; /* regulator_dev data */ | 197 | void *reg_data; /* regulator_dev data */ |
198 | |||
199 | #ifdef CONFIG_DEBUG_FS | ||
200 | struct dentry *debugfs; | ||
201 | #endif | ||
191 | }; | 202 | }; |
192 | 203 | ||
193 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 204 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
194 | struct device *dev, struct regulator_init_data *init_data, | 205 | struct device *dev, const struct regulator_init_data *init_data, |
195 | void *driver_data); | 206 | void *driver_data); |
196 | void regulator_unregister(struct regulator_dev *rdev); | 207 | void regulator_unregister(struct regulator_dev *rdev); |
197 | 208 | ||
diff --git a/include/linux/rio.h b/include/linux/rio.h index 0bed941f9b13..ff681ebba585 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -66,14 +66,62 @@ | |||
66 | 66 | ||
67 | #define RIO_PW_MSG_SIZE 64 | 67 | #define RIO_PW_MSG_SIZE 64 |
68 | 68 | ||
69 | /* | ||
70 | * A component tag value (stored in the component tag CSR) is used as device's | ||
71 | * unique identifier assigned during enumeration. Besides being used for | ||
72 | * identifying switches (which do not have device ID register), it also is used | ||
73 | * by error management notification and therefore has to be assigned | ||
74 | * to endpoints as well. | ||
75 | */ | ||
76 | #define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */ | ||
77 | #define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ | ||
78 | |||
69 | extern struct bus_type rio_bus_type; | 79 | extern struct bus_type rio_bus_type; |
70 | extern struct device rio_bus; | 80 | extern struct device rio_bus; |
71 | extern struct list_head rio_devices; /* list of all devices */ | 81 | extern struct list_head rio_devices; /* list of all devices */ |
72 | 82 | ||
73 | struct rio_mport; | 83 | struct rio_mport; |
84 | struct rio_dev; | ||
74 | union rio_pw_msg; | 85 | union rio_pw_msg; |
75 | 86 | ||
76 | /** | 87 | /** |
88 | * struct rio_switch - RIO switch info | ||
89 | * @node: Node in global list of switches | ||
90 | * @switchid: Switch ID that is unique across a network | ||
91 | * @route_table: Copy of switch routing table | ||
92 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
93 | * @add_entry: Callback for switch-specific route add function | ||
94 | * @get_entry: Callback for switch-specific route get function | ||
95 | * @clr_table: Callback for switch-specific clear route table function | ||
96 | * @set_domain: Callback for switch-specific domain setting function | ||
97 | * @get_domain: Callback for switch-specific domain get function | ||
98 | * @em_init: Callback for switch-specific error management init function | ||
99 | * @em_handle: Callback for switch-specific error management handler function | ||
100 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
101 | * @nextdev: Array of per-port pointers to the next attached device | ||
102 | */ | ||
103 | struct rio_switch { | ||
104 | struct list_head node; | ||
105 | u16 switchid; | ||
106 | u8 *route_table; | ||
107 | u32 port_ok; | ||
108 | int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
109 | u16 table, u16 route_destid, u8 route_port); | ||
110 | int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
111 | u16 table, u16 route_destid, u8 *route_port); | ||
112 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
113 | u16 table); | ||
114 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
115 | u8 sw_domain); | ||
116 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
117 | u8 *sw_domain); | ||
118 | int (*em_init) (struct rio_dev *dev); | ||
119 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
120 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
121 | struct rio_dev *nextdev[0]; | ||
122 | }; | ||
123 | |||
124 | /** | ||
77 | * struct rio_dev - RIO device info | 125 | * struct rio_dev - RIO device info |
78 | * @global_list: Node in list of all RIO devices | 126 | * @global_list: Node in list of all RIO devices |
79 | * @net_list: Node in list of RIO devices in a network | 127 | * @net_list: Node in list of RIO devices in a network |
@@ -93,13 +141,14 @@ union rio_pw_msg; | |||
93 | * @phys_efptr: RIO device extended features pointer | 141 | * @phys_efptr: RIO device extended features pointer |
94 | * @em_efptr: RIO Error Management features pointer | 142 | * @em_efptr: RIO Error Management features pointer |
95 | * @dma_mask: Mask of bits of RIO address this device implements | 143 | * @dma_mask: Mask of bits of RIO address this device implements |
96 | * @rswitch: Pointer to &struct rio_switch if valid for this device | ||
97 | * @driver: Driver claiming this device | 144 | * @driver: Driver claiming this device |
98 | * @dev: Device model device | 145 | * @dev: Device model device |
99 | * @riores: RIO resources this device owns | 146 | * @riores: RIO resources this device owns |
100 | * @pwcback: port-write callback function for this device | 147 | * @pwcback: port-write callback function for this device |
101 | * @destid: Network destination ID | 148 | * @destid: Network destination ID (or associated destid for switch) |
149 | * @hopcount: Hopcount to this device | ||
102 | * @prev: Previous RIO device connected to the current one | 150 | * @prev: Previous RIO device connected to the current one |
151 | * @rswitch: struct rio_switch (if valid for this device) | ||
103 | */ | 152 | */ |
104 | struct rio_dev { | 153 | struct rio_dev { |
105 | struct list_head global_list; /* node in list of all RIO devices */ | 154 | struct list_head global_list; /* node in list of all RIO devices */ |
@@ -120,18 +169,20 @@ struct rio_dev { | |||
120 | u32 phys_efptr; | 169 | u32 phys_efptr; |
121 | u32 em_efptr; | 170 | u32 em_efptr; |
122 | u64 dma_mask; | 171 | u64 dma_mask; |
123 | struct rio_switch *rswitch; /* RIO switch info */ | ||
124 | struct rio_driver *driver; /* RIO driver claiming this device */ | 172 | struct rio_driver *driver; /* RIO driver claiming this device */ |
125 | struct device dev; /* LDM device structure */ | 173 | struct device dev; /* LDM device structure */ |
126 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | 174 | struct resource riores[RIO_MAX_DEV_RESOURCES]; |
127 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); | 175 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); |
128 | u16 destid; | 176 | u16 destid; |
177 | u8 hopcount; | ||
129 | struct rio_dev *prev; | 178 | struct rio_dev *prev; |
179 | struct rio_switch rswitch[0]; /* RIO switch info */ | ||
130 | }; | 180 | }; |
131 | 181 | ||
132 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) | 182 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) |
133 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) | 183 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) |
134 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) | 184 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) |
185 | #define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0]) | ||
135 | 186 | ||
136 | /** | 187 | /** |
137 | * struct rio_msg - RIO message event | 188 | * struct rio_msg - RIO message event |
@@ -224,49 +275,6 @@ struct rio_net { | |||
224 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ | 275 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ |
225 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ | 276 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ |
226 | 277 | ||
227 | /** | ||
228 | * struct rio_switch - RIO switch info | ||
229 | * @node: Node in global list of switches | ||
230 | * @rdev: Associated RIO device structure | ||
231 | * @switchid: Switch ID that is unique across a network | ||
232 | * @hopcount: Hopcount to this switch | ||
233 | * @destid: Associated destid in the path | ||
234 | * @route_table: Copy of switch routing table | ||
235 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
236 | * @add_entry: Callback for switch-specific route add function | ||
237 | * @get_entry: Callback for switch-specific route get function | ||
238 | * @clr_table: Callback for switch-specific clear route table function | ||
239 | * @set_domain: Callback for switch-specific domain setting function | ||
240 | * @get_domain: Callback for switch-specific domain get function | ||
241 | * @em_init: Callback for switch-specific error management initialization function | ||
242 | * @em_handle: Callback for switch-specific error management handler function | ||
243 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
244 | * @nextdev: Array of per-port pointers to the next attached device | ||
245 | */ | ||
246 | struct rio_switch { | ||
247 | struct list_head node; | ||
248 | struct rio_dev *rdev; | ||
249 | u16 switchid; | ||
250 | u16 hopcount; | ||
251 | u16 destid; | ||
252 | u8 *route_table; | ||
253 | u32 port_ok; | ||
254 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
255 | u16 table, u16 route_destid, u8 route_port); | ||
256 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
257 | u16 table, u16 route_destid, u8 * route_port); | ||
258 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
259 | u16 table); | ||
260 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
261 | u8 sw_domain); | ||
262 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
263 | u8 *sw_domain); | ||
264 | int (*em_init) (struct rio_dev *dev); | ||
265 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
266 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
267 | struct rio_dev *nextdev[0]; | ||
268 | }; | ||
269 | |||
270 | /* Low-level architecture-dependent routines */ | 278 | /* Low-level architecture-dependent routines */ |
271 | 279 | ||
272 | /** | 280 | /** |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index edc55da717b3..e09e565c4bce 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -150,16 +150,8 @@ static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset, | |||
150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | 150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, |
151 | u32 * data) | 151 | u32 * data) |
152 | { | 152 | { |
153 | u8 hopcount = 0xff; | 153 | return rio_mport_read_config_32(rdev->net->hport, rdev->destid, |
154 | u16 destid = rdev->destid; | 154 | rdev->hopcount, offset, data); |
155 | |||
156 | if (rdev->rswitch) { | ||
157 | destid = rdev->rswitch->destid; | ||
158 | hopcount = rdev->rswitch->hopcount; | ||
159 | } | ||
160 | |||
161 | return rio_mport_read_config_32(rdev->net->hport, destid, hopcount, | ||
162 | offset, data); | ||
163 | }; | 155 | }; |
164 | 156 | ||
165 | /** | 157 | /** |
@@ -174,16 +166,8 @@ static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | |||
174 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | 166 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, |
175 | u32 data) | 167 | u32 data) |
176 | { | 168 | { |
177 | u8 hopcount = 0xff; | 169 | return rio_mport_write_config_32(rdev->net->hport, rdev->destid, |
178 | u16 destid = rdev->destid; | 170 | rdev->hopcount, offset, data); |
179 | |||
180 | if (rdev->rswitch) { | ||
181 | destid = rdev->rswitch->destid; | ||
182 | hopcount = rdev->rswitch->hopcount; | ||
183 | } | ||
184 | |||
185 | return rio_mport_write_config_32(rdev->net->hport, destid, hopcount, | ||
186 | offset, data); | ||
187 | }; | 171 | }; |
188 | 172 | ||
189 | /** | 173 | /** |
@@ -198,16 +182,8 @@ static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | |||
198 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | 182 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, |
199 | u16 * data) | 183 | u16 * data) |
200 | { | 184 | { |
201 | u8 hopcount = 0xff; | 185 | return rio_mport_read_config_16(rdev->net->hport, rdev->destid, |
202 | u16 destid = rdev->destid; | 186 | rdev->hopcount, offset, data); |
203 | |||
204 | if (rdev->rswitch) { | ||
205 | destid = rdev->rswitch->destid; | ||
206 | hopcount = rdev->rswitch->hopcount; | ||
207 | } | ||
208 | |||
209 | return rio_mport_read_config_16(rdev->net->hport, destid, hopcount, | ||
210 | offset, data); | ||
211 | }; | 187 | }; |
212 | 188 | ||
213 | /** | 189 | /** |
@@ -222,16 +198,8 @@ static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | |||
222 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | 198 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, |
223 | u16 data) | 199 | u16 data) |
224 | { | 200 | { |
225 | u8 hopcount = 0xff; | 201 | return rio_mport_write_config_16(rdev->net->hport, rdev->destid, |
226 | u16 destid = rdev->destid; | 202 | rdev->hopcount, offset, data); |
227 | |||
228 | if (rdev->rswitch) { | ||
229 | destid = rdev->rswitch->destid; | ||
230 | hopcount = rdev->rswitch->hopcount; | ||
231 | } | ||
232 | |||
233 | return rio_mport_write_config_16(rdev->net->hport, destid, hopcount, | ||
234 | offset, data); | ||
235 | }; | 203 | }; |
236 | 204 | ||
237 | /** | 205 | /** |
@@ -245,16 +213,8 @@ static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | |||
245 | */ | 213 | */ |
246 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | 214 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) |
247 | { | 215 | { |
248 | u8 hopcount = 0xff; | 216 | return rio_mport_read_config_8(rdev->net->hport, rdev->destid, |
249 | u16 destid = rdev->destid; | 217 | rdev->hopcount, offset, data); |
250 | |||
251 | if (rdev->rswitch) { | ||
252 | destid = rdev->rswitch->destid; | ||
253 | hopcount = rdev->rswitch->hopcount; | ||
254 | } | ||
255 | |||
256 | return rio_mport_read_config_8(rdev->net->hport, destid, hopcount, | ||
257 | offset, data); | ||
258 | }; | 218 | }; |
259 | 219 | ||
260 | /** | 220 | /** |
@@ -268,16 +228,8 @@ static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | |||
268 | */ | 228 | */ |
269 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) | 229 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) |
270 | { | 230 | { |
271 | u8 hopcount = 0xff; | 231 | return rio_mport_write_config_8(rdev->net->hport, rdev->destid, |
272 | u16 destid = rdev->destid; | 232 | rdev->hopcount, offset, data); |
273 | |||
274 | if (rdev->rswitch) { | ||
275 | destid = rdev->rswitch->destid; | ||
276 | hopcount = rdev->rswitch->hopcount; | ||
277 | } | ||
278 | |||
279 | return rio_mport_write_config_8(rdev->net->hport, destid, hopcount, | ||
280 | offset, data); | ||
281 | }; | 233 | }; |
282 | 234 | ||
283 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, | 235 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index ee7b6ada188f..7410d3365e2a 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -36,5 +36,7 @@ | |||
36 | #define RIO_DID_IDTCPS10Q 0x035e | 36 | #define RIO_DID_IDTCPS10Q 0x035e |
37 | #define RIO_DID_IDTCPS1848 0x0374 | 37 | #define RIO_DID_IDTCPS1848 0x0374 |
38 | #define RIO_DID_IDTCPS1616 0x0379 | 38 | #define RIO_DID_IDTCPS1616 0x0379 |
39 | #define RIO_DID_IDTVPS1616 0x0377 | ||
40 | #define RIO_DID_IDTSPS1616 0x0378 | ||
39 | 41 | ||
40 | #endif /* LINUX_RIO_IDS_H */ | 42 | #endif /* LINUX_RIO_IDS_H */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bb83c0da2071..e9fd04ca1e51 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -198,6 +198,8 @@ enum ttu_flags { | |||
198 | }; | 198 | }; |
199 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 199 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
200 | 200 | ||
201 | bool is_vma_temporary_stack(struct vm_area_struct *vma); | ||
202 | |||
201 | int try_to_unmap(struct page *, enum ttu_flags flags); | 203 | int try_to_unmap(struct page *, enum ttu_flags flags); |
202 | int try_to_unmap_one(struct page *, struct vm_area_struct *, | 204 | int try_to_unmap_one(struct page *, struct vm_area_struct *, |
203 | unsigned long address, enum ttu_flags flags); | 205 | unsigned long address, enum ttu_flags flags); |
diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h index c490fbc43fe2..5f57f93b284f 100644 --- a/include/linux/romfs_fs.h +++ b/include/linux/romfs_fs.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __LINUX_ROMFS_FS_H | 1 | #ifndef __LINUX_ROMFS_FS_H |
2 | #define __LINUX_ROMFS_FS_H | 2 | #define __LINUX_ROMFS_FS_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/fs.h> | ||
6 | |||
4 | /* The basic structures of the romfs filesystem */ | 7 | /* The basic structures of the romfs filesystem */ |
5 | 8 | ||
6 | #define ROMBSIZE BLOCK_SIZE | 9 | #define ROMBSIZE BLOCK_SIZE |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index dbce22faa660..fbe58b7e63eb 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h | |||
@@ -14,6 +14,7 @@ struct s3c_adc_bat_pdata { | |||
14 | void (*disable_charger)(void); | 14 | void (*disable_charger)(void); |
15 | 15 | ||
16 | int gpio_charge_finished; | 16 | int gpio_charge_finished; |
17 | int gpio_inverted; | ||
17 | 18 | ||
18 | const struct s3c_adc_bat_thresh *lut_noac; | 19 | const struct s3c_adc_bat_thresh *lut_noac; |
19 | unsigned int lut_noac_cnt; | 20 | unsigned int lut_noac_cnt; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index abc527aa8550..d747f948b34e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #define CLONE_DETACHED 0x00400000 /* Unused, ignored */ | 21 | #define CLONE_DETACHED 0x00400000 /* Unused, ignored */ |
22 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ | 22 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ |
23 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ | 23 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ |
24 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 24 | /* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state) |
25 | and is now available for re-use. */ | ||
25 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | 26 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ |
26 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | 27 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ |
27 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | 28 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ |
@@ -433,6 +434,7 @@ extern int get_dumpable(struct mm_struct *mm); | |||
433 | #endif | 434 | #endif |
434 | /* leave room for more dump flags */ | 435 | /* leave room for more dump flags */ |
435 | #define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */ | 436 | #define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */ |
437 | #define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ | ||
436 | 438 | ||
437 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | 439 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) |
438 | 440 | ||
@@ -633,6 +635,8 @@ struct signal_struct { | |||
633 | 635 | ||
634 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 636 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
635 | int oom_score_adj; /* OOM kill score adjustment */ | 637 | int oom_score_adj; /* OOM kill score adjustment */ |
638 | int oom_score_adj_min; /* OOM kill score adjustment minimum value. | ||
639 | * Only settable by CAP_SYS_RESOURCE. */ | ||
636 | 640 | ||
637 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 641 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
638 | * credential calculations | 642 | * credential calculations |
@@ -683,7 +687,7 @@ struct user_struct { | |||
683 | atomic_t fanotify_listeners; | 687 | atomic_t fanotify_listeners; |
684 | #endif | 688 | #endif |
685 | #ifdef CONFIG_EPOLL | 689 | #ifdef CONFIG_EPOLL |
686 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 690 | atomic_long_t epoll_watches; /* The number of file descriptors currently watched */ |
687 | #endif | 691 | #endif |
688 | #ifdef CONFIG_POSIX_MQUEUE | 692 | #ifdef CONFIG_POSIX_MQUEUE |
689 | /* protected by mq_lock */ | 693 | /* protected by mq_lock */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a23fa29d4eb0..758c5b0c6fd3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -212,6 +212,7 @@ | |||
212 | #include <linux/tty.h> | 212 | #include <linux/tty.h> |
213 | #include <linux/mutex.h> | 213 | #include <linux/mutex.h> |
214 | #include <linux/sysrq.h> | 214 | #include <linux/sysrq.h> |
215 | #include <linux/pps_kernel.h> | ||
215 | 216 | ||
216 | struct uart_port; | 217 | struct uart_port; |
217 | struct serial_struct; | 218 | struct serial_struct; |
@@ -528,10 +529,10 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
528 | struct uart_state *state = uport->state; | 529 | struct uart_state *state = uport->state; |
529 | struct tty_port *port = &state->port; | 530 | struct tty_port *port = &state->port; |
530 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | 531 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); |
531 | struct timespec ts; | 532 | struct pps_event_time ts; |
532 | 533 | ||
533 | if (ld && ld->ops->dcd_change) | 534 | if (ld && ld->ops->dcd_change) |
534 | getnstimeofday(&ts); | 535 | pps_get_ts(&ts); |
535 | 536 | ||
536 | uport->icount.dcd++; | 537 | uport->icount.dcd++; |
537 | #ifdef CONFIG_HARD_PPS | 538 | #ifdef CONFIG_HARD_PPS |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index baed2122c5a6..1630d9cae22a 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -8,6 +8,23 @@ | |||
8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | enum { | ||
12 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | ||
13 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | ||
14 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | ||
15 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | ||
16 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | ||
17 | }; | ||
18 | |||
19 | #define SCSCR_TIE (1 << 7) | ||
20 | #define SCSCR_RIE (1 << 6) | ||
21 | #define SCSCR_TE (1 << 5) | ||
22 | #define SCSCR_RE (1 << 4) | ||
23 | #define SCSCR_REIE (1 << 3) /* not supported by all parts */ | ||
24 | #define SCSCR_TOIE (1 << 2) /* not supported by all parts */ | ||
25 | #define SCSCR_CKE1 (1 << 1) | ||
26 | #define SCSCR_CKE0 (1 << 0) | ||
27 | |||
11 | /* Offsets into the sci_port->irqs array */ | 28 | /* Offsets into the sci_port->irqs array */ |
12 | enum { | 29 | enum { |
13 | SCIx_ERI_IRQ, | 30 | SCIx_ERI_IRQ, |
@@ -29,7 +46,12 @@ struct plat_sci_port { | |||
29 | unsigned int type; /* SCI / SCIF / IRDA */ | 46 | unsigned int type; /* SCI / SCIF / IRDA */ |
30 | upf_t flags; /* UPF_* flags */ | 47 | upf_t flags; /* UPF_* flags */ |
31 | char *clk; /* clock string */ | 48 | char *clk; /* clock string */ |
49 | |||
50 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | ||
51 | unsigned int scscr; /* SCSCR initialization */ | ||
52 | |||
32 | struct device *dma_dev; | 53 | struct device *dma_dev; |
54 | |||
33 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 55 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
34 | unsigned int dma_slave_tx; | 56 | unsigned int dma_slave_tx; |
35 | unsigned int dma_slave_rx; | 57 | unsigned int dma_slave_rx; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 20ec0a64cb9f..bf221d65d9ad 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -255,6 +255,11 @@ typedef unsigned int sk_buff_data_t; | |||
255 | typedef unsigned char *sk_buff_data_t; | 255 | typedef unsigned char *sk_buff_data_t; |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ | ||
259 | defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
260 | #define NET_SKBUFF_NF_DEFRAG_NEEDED 1 | ||
261 | #endif | ||
262 | |||
258 | /** | 263 | /** |
259 | * struct sk_buff - socket buffer | 264 | * struct sk_buff - socket buffer |
260 | * @next: Next buffer in list | 265 | * @next: Next buffer in list |
@@ -362,6 +367,8 @@ struct sk_buff { | |||
362 | void (*destructor)(struct sk_buff *skb); | 367 | void (*destructor)(struct sk_buff *skb); |
363 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 368 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
364 | struct nf_conntrack *nfct; | 369 | struct nf_conntrack *nfct; |
370 | #endif | ||
371 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
365 | struct sk_buff *nfct_reasm; | 372 | struct sk_buff *nfct_reasm; |
366 | #endif | 373 | #endif |
367 | #ifdef CONFIG_BRIDGE_NETFILTER | 374 | #ifdef CONFIG_BRIDGE_NETFILTER |
@@ -2057,6 +2064,8 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
2057 | if (nfct) | 2064 | if (nfct) |
2058 | atomic_inc(&nfct->use); | 2065 | atomic_inc(&nfct->use); |
2059 | } | 2066 | } |
2067 | #endif | ||
2068 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2060 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | 2069 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) |
2061 | { | 2070 | { |
2062 | if (skb) | 2071 | if (skb) |
@@ -2085,6 +2094,8 @@ static inline void nf_reset(struct sk_buff *skb) | |||
2085 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2094 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2086 | nf_conntrack_put(skb->nfct); | 2095 | nf_conntrack_put(skb->nfct); |
2087 | skb->nfct = NULL; | 2096 | skb->nfct = NULL; |
2097 | #endif | ||
2098 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2088 | nf_conntrack_put_reasm(skb->nfct_reasm); | 2099 | nf_conntrack_put_reasm(skb->nfct_reasm); |
2089 | skb->nfct_reasm = NULL; | 2100 | skb->nfct_reasm = NULL; |
2090 | #endif | 2101 | #endif |
@@ -2101,6 +2112,8 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2101 | dst->nfct = src->nfct; | 2112 | dst->nfct = src->nfct; |
2102 | nf_conntrack_get(src->nfct); | 2113 | nf_conntrack_get(src->nfct); |
2103 | dst->nfctinfo = src->nfctinfo; | 2114 | dst->nfctinfo = src->nfctinfo; |
2115 | #endif | ||
2116 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2104 | dst->nfct_reasm = src->nfct_reasm; | 2117 | dst->nfct_reasm = src->nfct_reasm; |
2105 | nf_conntrack_get_reasm(src->nfct_reasm); | 2118 | nf_conntrack_get_reasm(src->nfct_reasm); |
2106 | #endif | 2119 | #endif |
@@ -2114,6 +2127,8 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2114 | { | 2127 | { |
2115 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2128 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2116 | nf_conntrack_put(dst->nfct); | 2129 | nf_conntrack_put(dst->nfct); |
2130 | #endif | ||
2131 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2117 | nf_conntrack_put_reasm(dst->nfct_reasm); | 2132 | nf_conntrack_put_reasm(dst->nfct_reasm); |
2118 | #endif | 2133 | #endif |
2119 | #ifdef CONFIG_BRIDGE_NETFILTER | 2134 | #ifdef CONFIG_BRIDGE_NETFILTER |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 5f65f14c4f44..edbb1d07ddf4 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -191,7 +191,8 @@ struct ucred { | |||
191 | #define AF_PHONET 35 /* Phonet sockets */ | 191 | #define AF_PHONET 35 /* Phonet sockets */ |
192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ | 192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
193 | #define AF_CAIF 37 /* CAIF sockets */ | 193 | #define AF_CAIF 37 /* CAIF sockets */ |
194 | #define AF_MAX 38 /* For now.. */ | 194 | #define AF_ALG 38 /* Algorithm sockets */ |
195 | #define AF_MAX 39 /* For now.. */ | ||
195 | 196 | ||
196 | /* Protocol families, same as address families. */ | 197 | /* Protocol families, same as address families. */ |
197 | #define PF_UNSPEC AF_UNSPEC | 198 | #define PF_UNSPEC AF_UNSPEC |
@@ -232,6 +233,7 @@ struct ucred { | |||
232 | #define PF_PHONET AF_PHONET | 233 | #define PF_PHONET AF_PHONET |
233 | #define PF_IEEE802154 AF_IEEE802154 | 234 | #define PF_IEEE802154 AF_IEEE802154 |
234 | #define PF_CAIF AF_CAIF | 235 | #define PF_CAIF AF_CAIF |
236 | #define PF_ALG AF_ALG | ||
235 | #define PF_MAX AF_MAX | 237 | #define PF_MAX AF_MAX |
236 | 238 | ||
237 | /* Maximum queue length specifiable by listen. */ | 239 | /* Maximum queue length specifiable by listen. */ |
@@ -305,6 +307,7 @@ struct ucred { | |||
305 | #define SOL_RDS 276 | 307 | #define SOL_RDS 276 |
306 | #define SOL_IUCV 277 | 308 | #define SOL_IUCV 277 |
307 | #define SOL_CAIF 278 | 309 | #define SOL_CAIF 278 |
310 | #define SOL_ALG 279 | ||
308 | 311 | ||
309 | /* IPX options */ | 312 | /* IPX options */ |
310 | #define IPX_TYPE 1 | 313 | #define IPX_TYPE 1 |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 78aa104250b7..7898ea13de70 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -256,10 +256,13 @@ static inline time_t get_expiry(char **bpp) | |||
256 | return rv - boot.tv_sec; | 256 | return rv - boot.tv_sec; |
257 | } | 257 | } |
258 | 258 | ||
259 | #ifdef CONFIG_NFSD_DEPRECATED | ||
259 | static inline void sunrpc_invalidate(struct cache_head *h, | 260 | static inline void sunrpc_invalidate(struct cache_head *h, |
260 | struct cache_detail *detail) | 261 | struct cache_detail *detail) |
261 | { | 262 | { |
262 | h->expiry_time = seconds_since_boot() - 1; | 263 | h->expiry_time = seconds_since_boot() - 1; |
263 | detail->nextcheck = seconds_since_boot(); | 264 | detail->nextcheck = seconds_since_boot(); |
264 | } | 265 | } |
266 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
267 | |||
265 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ | 268 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index c81d4d8be3a9..ea29330b78bd 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -269,6 +269,7 @@ struct svc_rqst { | |||
269 | struct cache_req rq_chandle; /* handle passed to caches for | 269 | struct cache_req rq_chandle; /* handle passed to caches for |
270 | * request delaying | 270 | * request delaying |
271 | */ | 271 | */ |
272 | bool rq_dropme; | ||
272 | /* Catering to nfsd */ | 273 | /* Catering to nfsd */ |
273 | struct auth_domain * rq_client; /* RPC peer info */ | 274 | struct auth_domain * rq_client; /* RPC peer info */ |
274 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 275 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 357da5e0daa3..059877b4d85b 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -63,7 +63,6 @@ struct svc_xprt { | |||
63 | #define XPT_LISTENER 11 /* listening endpoint */ | 63 | #define XPT_LISTENER 11 /* listening endpoint */ |
64 | #define XPT_CACHE_AUTH 12 /* cache auth info */ | 64 | #define XPT_CACHE_AUTH 12 /* cache auth info */ |
65 | 65 | ||
66 | struct svc_pool *xpt_pool; /* current pool iff queued */ | ||
67 | struct svc_serv *xpt_server; /* service for transport */ | 66 | struct svc_serv *xpt_server; /* service for transport */ |
68 | atomic_t xpt_reserved; /* space on outq that is rsvd */ | 67 | atomic_t xpt_reserved; /* space on outq that is rsvd */ |
69 | struct mutex xpt_mutex; /* to serialize sending data */ | 68 | struct mutex xpt_mutex; /* to serialize sending data */ |
@@ -81,6 +80,7 @@ struct svc_xprt { | |||
81 | void *xpt_bc_sid; /* back channel session ID */ | 80 | void *xpt_bc_sid; /* back channel session ID */ |
82 | 81 | ||
83 | struct net *xpt_net; | 82 | struct net *xpt_net; |
83 | struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */ | ||
84 | }; | 84 | }; |
85 | 85 | ||
86 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 86 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 1b353a76c304..04dba23c59f2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -28,7 +28,6 @@ struct svc_sock { | |||
28 | /* private TCP part */ | 28 | /* private TCP part */ |
29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
31 | struct rpc_xprt *sk_bc_xprt; /* NFSv4.1 backchannel xprt */ | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | /* | 33 | /* |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 89d10d279a20..bef0f535f746 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -321,6 +321,7 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | |||
321 | #define XPRT_CLOSING (6) | 321 | #define XPRT_CLOSING (6) |
322 | #define XPRT_CONNECTION_ABORT (7) | 322 | #define XPRT_CONNECTION_ABORT (7) |
323 | #define XPRT_CONNECTION_CLOSE (8) | 323 | #define XPRT_CONNECTION_CLOSE (8) |
324 | #define XPRT_INITIALIZED (9) | ||
324 | 325 | ||
325 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 326 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
326 | { | 327 | { |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 144b34be5c32..5a89e3612875 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -122,7 +122,7 @@ struct platform_suspend_ops { | |||
122 | * suspend_set_ops - set platform dependent suspend operations | 122 | * suspend_set_ops - set platform dependent suspend operations |
123 | * @ops: The new suspend operations to set. | 123 | * @ops: The new suspend operations to set. |
124 | */ | 124 | */ |
125 | extern void suspend_set_ops(struct platform_suspend_ops *ops); | 125 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
126 | extern int suspend_valid_only_mem(suspend_state_t state); | 126 | extern int suspend_valid_only_mem(suspend_state_t state); |
127 | 127 | ||
128 | /** | 128 | /** |
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state); | |||
147 | #else /* !CONFIG_SUSPEND */ | 147 | #else /* !CONFIG_SUSPEND */ |
148 | #define suspend_valid_only_mem NULL | 148 | #define suspend_valid_only_mem NULL |
149 | 149 | ||
150 | static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} | 150 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
152 | #endif /* !CONFIG_SUSPEND */ | 152 | #endif /* !CONFIG_SUSPEND */ |
153 | 153 | ||
@@ -245,7 +245,7 @@ extern void swsusp_set_page_free(struct page *); | |||
245 | extern void swsusp_unset_page_free(struct page *); | 245 | extern void swsusp_unset_page_free(struct page *); |
246 | extern unsigned long get_safe_page(gfp_t gfp_mask); | 246 | extern unsigned long get_safe_page(gfp_t gfp_mask); |
247 | 247 | ||
248 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 248 | extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); |
249 | extern int hibernate(void); | 249 | extern int hibernate(void); |
250 | extern bool system_entering_hibernation(void); | 250 | extern bool system_entering_hibernation(void); |
251 | #else /* CONFIG_HIBERNATION */ | 251 | #else /* CONFIG_HIBERNATION */ |
@@ -253,28 +253,11 @@ static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | |||
253 | static inline void swsusp_set_page_free(struct page *p) {} | 253 | static inline void swsusp_set_page_free(struct page *p) {} |
254 | static inline void swsusp_unset_page_free(struct page *p) {} | 254 | static inline void swsusp_unset_page_free(struct page *p) {} |
255 | 255 | ||
256 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 256 | static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {} |
257 | static inline int hibernate(void) { return -ENOSYS; } | 257 | static inline int hibernate(void) { return -ENOSYS; } |
258 | static inline bool system_entering_hibernation(void) { return false; } | 258 | static inline bool system_entering_hibernation(void) { return false; } |
259 | #endif /* CONFIG_HIBERNATION */ | 259 | #endif /* CONFIG_HIBERNATION */ |
260 | 260 | ||
261 | #ifdef CONFIG_SUSPEND_NVS | ||
262 | extern int suspend_nvs_register(unsigned long start, unsigned long size); | ||
263 | extern int suspend_nvs_alloc(void); | ||
264 | extern void suspend_nvs_free(void); | ||
265 | extern void suspend_nvs_save(void); | ||
266 | extern void suspend_nvs_restore(void); | ||
267 | #else /* CONFIG_SUSPEND_NVS */ | ||
268 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
269 | { | ||
270 | return 0; | ||
271 | } | ||
272 | static inline int suspend_nvs_alloc(void) { return 0; } | ||
273 | static inline void suspend_nvs_free(void) {} | ||
274 | static inline void suspend_nvs_save(void) {} | ||
275 | static inline void suspend_nvs_restore(void) {} | ||
276 | #endif /* CONFIG_SUSPEND_NVS */ | ||
277 | |||
278 | #ifdef CONFIG_PM_SLEEP | 261 | #ifdef CONFIG_PM_SLEEP |
279 | void save_processor_state(void); | 262 | void save_processor_state(void); |
280 | void restore_processor_state(void); | 263 | void restore_processor_state(void); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index eba53e71d2cc..4d559325d919 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -208,6 +208,8 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
208 | /* linux/mm/swap.c */ | 208 | /* linux/mm/swap.c */ |
209 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 209 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
210 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 210 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
211 | extern void lru_add_page_tail(struct zone* zone, | ||
212 | struct page *page, struct page *page_tail); | ||
211 | extern void activate_page(struct page *); | 213 | extern void activate_page(struct page *); |
212 | extern void mark_page_accessed(struct page *); | 214 | extern void mark_page_accessed(struct page *); |
213 | extern void lru_add_drain(void); | 215 | extern void lru_add_drain(void); |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1de8b9eb841b..8651556dbd52 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -77,7 +77,7 @@ struct thermal_cooling_device { | |||
77 | char type[THERMAL_NAME_LENGTH]; | 77 | char type[THERMAL_NAME_LENGTH]; |
78 | struct device device; | 78 | struct device device; |
79 | void *devdata; | 79 | void *devdata; |
80 | struct thermal_cooling_device_ops *ops; | 80 | const struct thermal_cooling_device_ops *ops; |
81 | struct list_head node; | 81 | struct list_head node; |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -114,7 +114,7 @@ struct thermal_zone_device { | |||
114 | int last_temperature; | 114 | int last_temperature; |
115 | bool passive; | 115 | bool passive; |
116 | unsigned int forced_passive; | 116 | unsigned int forced_passive; |
117 | struct thermal_zone_device_ops *ops; | 117 | const struct thermal_zone_device_ops *ops; |
118 | struct list_head cooling_devices; | 118 | struct list_head cooling_devices; |
119 | struct idr idr; | 119 | struct idr idr; |
120 | struct mutex lock; /* protect cooling devices list */ | 120 | struct mutex lock; /* protect cooling devices list */ |
@@ -127,13 +127,41 @@ struct thermal_zone_device { | |||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | 127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ |
128 | #endif | 128 | #endif |
129 | }; | 129 | }; |
130 | /* Adding event notification support elements */ | ||
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
132 | #define THERMAL_GENL_VERSION 0x01 | ||
133 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
134 | |||
135 | enum events { | ||
136 | THERMAL_AUX0, | ||
137 | THERMAL_AUX1, | ||
138 | THERMAL_CRITICAL, | ||
139 | THERMAL_DEV_FAULT, | ||
140 | }; | ||
141 | |||
142 | struct thermal_genl_event { | ||
143 | u32 orig; | ||
144 | enum events event; | ||
145 | }; | ||
146 | /* attributes of thermal_genl_family */ | ||
147 | enum { | ||
148 | THERMAL_GENL_ATTR_UNSPEC, | ||
149 | THERMAL_GENL_ATTR_EVENT, | ||
150 | __THERMAL_GENL_ATTR_MAX, | ||
151 | }; | ||
152 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
153 | |||
154 | /* commands supported by the thermal_genl_family */ | ||
155 | enum { | ||
156 | THERMAL_GENL_CMD_UNSPEC, | ||
157 | THERMAL_GENL_CMD_EVENT, | ||
158 | __THERMAL_GENL_CMD_MAX, | ||
159 | }; | ||
160 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
130 | 161 | ||
131 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | 162 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, |
132 | struct | 163 | const struct thermal_zone_device_ops *, int tc1, int tc2, |
133 | thermal_zone_device_ops | 164 | int passive_freq, int polling_freq); |
134 | *, int tc1, int tc2, | ||
135 | int passive_freq, | ||
136 | int polling_freq); | ||
137 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 165 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
138 | 166 | ||
139 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 167 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
@@ -142,9 +170,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | |||
142 | struct thermal_cooling_device *); | 170 | struct thermal_cooling_device *); |
143 | void thermal_zone_device_update(struct thermal_zone_device *); | 171 | void thermal_zone_device_update(struct thermal_zone_device *); |
144 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
145 | struct | 173 | const struct thermal_cooling_device_ops *); |
146 | thermal_cooling_device_ops | ||
147 | *); | ||
148 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
175 | extern int generate_netlink_event(u32 orig, enum events event); | ||
149 | 176 | ||
150 | #endif /* __THERMAL_H__ */ | 177 | #endif /* __THERMAL_H__ */ |
diff --git a/include/linux/time.h b/include/linux/time.h index 9f15ac7ab92a..1e6d3b59238d 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -158,6 +158,8 @@ extern unsigned int alarm_setitimer(unsigned int seconds); | |||
158 | extern int do_getitimer(int which, struct itimerval *value); | 158 | extern int do_getitimer(int which, struct itimerval *value); |
159 | extern void getnstimeofday(struct timespec *tv); | 159 | extern void getnstimeofday(struct timespec *tv); |
160 | extern void getrawmonotonic(struct timespec *ts); | 160 | extern void getrawmonotonic(struct timespec *ts); |
161 | extern void getnstime_raw_and_real(struct timespec *ts_raw, | ||
162 | struct timespec *ts_real); | ||
161 | extern void getboottime(struct timespec *ts); | 163 | extern void getboottime(struct timespec *ts); |
162 | extern void monotonic_to_bootbased(struct timespec *ts); | 164 | extern void monotonic_to_bootbased(struct timespec *ts); |
163 | 165 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index 32d852f8cbe4..d23999f9499d 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -268,6 +268,7 @@ extern u64 tick_length; | |||
268 | extern void second_overflow(void); | 268 | extern void second_overflow(void); |
269 | extern void update_ntp_one_tick(void); | 269 | extern void update_ntp_one_tick(void); |
270 | extern int do_adjtimex(struct timex *); | 270 | extern int do_adjtimex(struct timex *); |
271 | extern void hardpps(const struct timespec *, const struct timespec *); | ||
271 | 272 | ||
272 | int read_current_timer(unsigned long *timer_val); | 273 | int read_current_timer(unsigned long *timer_val); |
273 | 274 | ||
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h index 6a7c4edf0e13..772dedbc3a22 100644 --- a/include/linux/toshiba.h +++ b/include/linux/toshiba.h | |||
@@ -33,6 +33,8 @@ typedef struct { | |||
33 | unsigned int edi __attribute__ ((packed)); | 33 | unsigned int edi __attribute__ ((packed)); |
34 | } SMMRegisters; | 34 | } SMMRegisters; |
35 | 35 | ||
36 | #ifdef __KERNEL__ | ||
36 | int tosh_smm(SMMRegisters *regs); | 37 | int tosh_smm(SMMRegisters *regs); |
38 | #endif /* __KERNEL__ */ | ||
37 | 39 | ||
38 | #endif | 40 | #endif |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 526d66f066a3..ff7dc08696a8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -101,14 +101,15 @@ | |||
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, | 103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, |
104 | * struct timespec *ts) | 104 | * struct pps_event_time *ts) |
105 | * | 105 | * |
106 | * Tells the discipline that the DCD pin has changed its status and | 106 | * Tells the discipline that the DCD pin has changed its status and |
107 | * the relative timestamp. Pointer ts can be NULL. | 107 | * the relative timestamp. Pointer ts cannot be NULL. |
108 | */ | 108 | */ |
109 | 109 | ||
110 | #include <linux/fs.h> | 110 | #include <linux/fs.h> |
111 | #include <linux/wait.h> | 111 | #include <linux/wait.h> |
112 | #include <linux/pps_kernel.h> | ||
112 | 113 | ||
113 | struct tty_ldisc_ops { | 114 | struct tty_ldisc_ops { |
114 | int magic; | 115 | int magic; |
@@ -143,7 +144,7 @@ struct tty_ldisc_ops { | |||
143 | char *fp, int count); | 144 | char *fp, int count); |
144 | void (*write_wakeup)(struct tty_struct *); | 145 | void (*write_wakeup)(struct tty_struct *); |
145 | void (*dcd_change)(struct tty_struct *, unsigned int, | 146 | void (*dcd_change)(struct tty_struct *, unsigned int, |
146 | struct timespec *); | 147 | struct pps_event_time *); |
147 | 148 | ||
148 | struct module *owner; | 149 | struct module *owner; |
149 | 150 | ||
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index fa261a0da280..8da8c4e87da3 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h | |||
@@ -67,21 +67,21 @@ struct u64_stats_sync { | |||
67 | #endif | 67 | #endif |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static void inline u64_stats_update_begin(struct u64_stats_sync *syncp) | 70 | static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) |
71 | { | 71 | { |
72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
73 | write_seqcount_begin(&syncp->seq); | 73 | write_seqcount_begin(&syncp->seq); |
74 | #endif | 74 | #endif |
75 | } | 75 | } |
76 | 76 | ||
77 | static void inline u64_stats_update_end(struct u64_stats_sync *syncp) | 77 | static inline void u64_stats_update_end(struct u64_stats_sync *syncp) |
78 | { | 78 | { |
79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
80 | write_seqcount_end(&syncp->seq); | 80 | write_seqcount_end(&syncp->seq); |
81 | #endif | 81 | #endif |
82 | } | 82 | } |
83 | 83 | ||
84 | static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp) | 84 | static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp) |
85 | { | 85 | { |
86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
87 | return read_seqcount_begin(&syncp->seq); | 87 | return read_seqcount_begin(&syncp->seq); |
@@ -93,7 +93,7 @@ static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *sy | |||
93 | #endif | 93 | #endif |
94 | } | 94 | } |
95 | 95 | ||
96 | static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | 96 | static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, |
97 | unsigned int start) | 97 | unsigned int start) |
98 | { | 98 | { |
99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
@@ -112,7 +112,7 @@ static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | |||
112 | * - UP 32bit must disable BH. | 112 | * - UP 32bit must disable BH. |
113 | * - 64bit have no problem atomically reading u64 values, irq safe. | 113 | * - 64bit have no problem atomically reading u64 values, irq safe. |
114 | */ | 114 | */ |
115 | static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) | 115 | static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) |
116 | { | 116 | { |
117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
118 | return read_seqcount_begin(&syncp->seq); | 118 | return read_seqcount_begin(&syncp->seq); |
@@ -124,7 +124,7 @@ static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync | |||
124 | #endif | 124 | #endif |
125 | } | 125 | } |
126 | 126 | ||
127 | static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, | 127 | static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, |
128 | unsigned int start) | 128 | unsigned int start) |
129 | { | 129 | { |
130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h index c9a6abd972a1..c0d817de4df2 100644 --- a/include/linux/unaligned/packed_struct.h +++ b/include/linux/unaligned/packed_struct.h | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | 5 | ||
6 | struct __una_u16 { u16 x; } __attribute__((packed)); | 6 | struct __una_u16 { u16 x; } __packed; |
7 | struct __una_u32 { u32 x; } __attribute__((packed)); | 7 | struct __una_u32 { u32 x; } __packed; |
8 | struct __una_u64 { u64 x; } __attribute__((packed)); | 8 | struct __una_u64 { u64 x; } __packed; |
9 | 9 | ||
10 | static inline u16 __get_unaligned_cpu16(const void *p) | 10 | static inline u16 __get_unaligned_cpu16(const void *p) |
11 | { | 11 | { |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 8178156711f9..faf467944baf 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/err.h> | 7 | #include <linux/err.h> |
8 | 8 | ||
9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) | 9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) |
10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) | 10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) |
11 | 11 | ||
12 | struct user_namespace { | 12 | struct user_namespace { |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 44b54f619ac6..4ed6fcd6b726 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -59,8 +59,9 @@ extern void *vmalloc_exec(unsigned long size); | |||
59 | extern void *vmalloc_32(unsigned long size); | 59 | extern void *vmalloc_32(unsigned long size); |
60 | extern void *vmalloc_32_user(unsigned long size); | 60 | extern void *vmalloc_32_user(unsigned long size); |
61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
62 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 62 | extern void *__vmalloc_node_range(unsigned long size, unsigned long align, |
63 | pgprot_t prot); | 63 | unsigned long start, unsigned long end, gfp_t gfp_mask, |
64 | pgprot_t prot, int node, void *caller); | ||
64 | extern void vfree(const void *addr); | 65 | extern void vfree(const void *addr); |
65 | 66 | ||
66 | extern void *vmap(struct page **pages, unsigned int count, | 67 | extern void *vmap(struct page **pages, unsigned int count, |
@@ -90,9 +91,6 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size, | |||
90 | unsigned long flags, | 91 | unsigned long flags, |
91 | unsigned long start, unsigned long end, | 92 | unsigned long start, unsigned long end, |
92 | void *caller); | 93 | void *caller); |
93 | extern struct vm_struct *get_vm_area_node(unsigned long size, | ||
94 | unsigned long flags, int node, | ||
95 | gfp_t gfp_mask); | ||
96 | extern struct vm_struct *remove_vm_area(const void *addr); | 94 | extern struct vm_struct *remove_vm_area(const void *addr); |
97 | 95 | ||
98 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 96 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
@@ -120,7 +118,7 @@ extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | |||
120 | #ifdef CONFIG_SMP | 118 | #ifdef CONFIG_SMP |
121 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | 119 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, |
122 | const size_t *sizes, int nr_vms, | 120 | const size_t *sizes, int nr_vms, |
123 | size_t align, gfp_t gfp_mask); | 121 | size_t align); |
124 | 122 | ||
125 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); | 123 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); |
126 | #endif | 124 | #endif |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index eaaea37b3b75..833e676d6d92 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -254,6 +254,11 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
254 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 254 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
255 | 255 | ||
256 | void refresh_cpu_vm_stats(int); | 256 | void refresh_cpu_vm_stats(int); |
257 | |||
258 | int calculate_pressure_threshold(struct zone *zone); | ||
259 | int calculate_normal_threshold(struct zone *zone); | ||
260 | void set_pgdat_percpu_threshold(pg_data_t *pgdat, | ||
261 | int (*calculate_pressure)(struct zone *)); | ||
257 | #else /* CONFIG_SMP */ | 262 | #else /* CONFIG_SMP */ |
258 | 263 | ||
259 | /* | 264 | /* |
@@ -298,6 +303,8 @@ static inline void __dec_zone_page_state(struct page *page, | |||
298 | #define dec_zone_page_state __dec_zone_page_state | 303 | #define dec_zone_page_state __dec_zone_page_state |
299 | #define mod_zone_page_state __mod_zone_page_state | 304 | #define mod_zone_page_state __mod_zone_page_state |
300 | 305 | ||
306 | #define set_pgdat_percpu_threshold(pgdat, callback) { } | ||
307 | |||
301 | static inline void refresh_cpu_vm_stats(int cpu) { } | 308 | static inline void refresh_cpu_vm_stats(int cpu) { } |
302 | #endif | 309 | #endif |
303 | 310 | ||
diff --git a/include/linux/xz.h b/include/linux/xz.h new file mode 100644 index 000000000000..64cffa6ddfce --- /dev/null +++ b/include/linux/xz.h | |||
@@ -0,0 +1,264 @@ | |||
1 | /* | ||
2 | * XZ decompressor | ||
3 | * | ||
4 | * Authors: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * Igor Pavlov <http://7-zip.org/> | ||
6 | * | ||
7 | * This file has been put into the public domain. | ||
8 | * You can do whatever you want with this file. | ||
9 | */ | ||
10 | |||
11 | #ifndef XZ_H | ||
12 | #define XZ_H | ||
13 | |||
14 | #ifdef __KERNEL__ | ||
15 | # include <linux/stddef.h> | ||
16 | # include <linux/types.h> | ||
17 | #else | ||
18 | # include <stddef.h> | ||
19 | # include <stdint.h> | ||
20 | #endif | ||
21 | |||
22 | /* In Linux, this is used to make extern functions static when needed. */ | ||
23 | #ifndef XZ_EXTERN | ||
24 | # define XZ_EXTERN extern | ||
25 | #endif | ||
26 | |||
27 | /** | ||
28 | * enum xz_mode - Operation mode | ||
29 | * | ||
30 | * @XZ_SINGLE: Single-call mode. This uses less RAM than | ||
31 | * than multi-call modes, because the LZMA2 | ||
32 | * dictionary doesn't need to be allocated as | ||
33 | * part of the decoder state. All required data | ||
34 | * structures are allocated at initialization, | ||
35 | * so xz_dec_run() cannot return XZ_MEM_ERROR. | ||
36 | * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2 | ||
37 | * dictionary buffer. All data structures are | ||
38 | * allocated at initialization, so xz_dec_run() | ||
39 | * cannot return XZ_MEM_ERROR. | ||
40 | * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is | ||
41 | * allocated once the required size has been | ||
42 | * parsed from the stream headers. If the | ||
43 | * allocation fails, xz_dec_run() will return | ||
44 | * XZ_MEM_ERROR. | ||
45 | * | ||
46 | * It is possible to enable support only for a subset of the above | ||
47 | * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, | ||
48 | * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled | ||
49 | * with support for all operation modes, but the preboot code may | ||
50 | * be built with fewer features to minimize code size. | ||
51 | */ | ||
52 | enum xz_mode { | ||
53 | XZ_SINGLE, | ||
54 | XZ_PREALLOC, | ||
55 | XZ_DYNALLOC | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * enum xz_ret - Return codes | ||
60 | * @XZ_OK: Everything is OK so far. More input or more | ||
61 | * output space is required to continue. This | ||
62 | * return code is possible only in multi-call mode | ||
63 | * (XZ_PREALLOC or XZ_DYNALLOC). | ||
64 | * @XZ_STREAM_END: Operation finished successfully. | ||
65 | * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding | ||
66 | * is still possible in multi-call mode by simply | ||
67 | * calling xz_dec_run() again. | ||
68 | * Note that this return value is used only if | ||
69 | * XZ_DEC_ANY_CHECK was defined at build time, | ||
70 | * which is not used in the kernel. Unsupported | ||
71 | * check types return XZ_OPTIONS_ERROR if | ||
72 | * XZ_DEC_ANY_CHECK was not defined at build time. | ||
73 | * @XZ_MEM_ERROR: Allocating memory failed. This return code is | ||
74 | * possible only if the decoder was initialized | ||
75 | * with XZ_DYNALLOC. The amount of memory that was | ||
76 | * tried to be allocated was no more than the | ||
77 | * dict_max argument given to xz_dec_init(). | ||
78 | * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than | ||
79 | * allowed by the dict_max argument given to | ||
80 | * xz_dec_init(). This return value is possible | ||
81 | * only in multi-call mode (XZ_PREALLOC or | ||
82 | * XZ_DYNALLOC); the single-call mode (XZ_SINGLE) | ||
83 | * ignores the dict_max argument. | ||
84 | * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic | ||
85 | * bytes). | ||
86 | * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested | ||
87 | * compression options. In the decoder this means | ||
88 | * that the header CRC32 matches, but the header | ||
89 | * itself specifies something that we don't support. | ||
90 | * @XZ_DATA_ERROR: Compressed data is corrupt. | ||
91 | * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly | ||
92 | * different between multi-call and single-call | ||
93 | * mode; more information below. | ||
94 | * | ||
95 | * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls | ||
96 | * to XZ code cannot consume any input and cannot produce any new output. | ||
97 | * This happens when there is no new input available, or the output buffer | ||
98 | * is full while at least one output byte is still pending. Assuming your | ||
99 | * code is not buggy, you can get this error only when decoding a compressed | ||
100 | * stream that is truncated or otherwise corrupt. | ||
101 | * | ||
102 | * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer | ||
103 | * is too small or the compressed input is corrupt in a way that makes the | ||
104 | * decoder produce more output than the caller expected. When it is | ||
105 | * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR | ||
106 | * is used instead of XZ_BUF_ERROR. | ||
107 | */ | ||
108 | enum xz_ret { | ||
109 | XZ_OK, | ||
110 | XZ_STREAM_END, | ||
111 | XZ_UNSUPPORTED_CHECK, | ||
112 | XZ_MEM_ERROR, | ||
113 | XZ_MEMLIMIT_ERROR, | ||
114 | XZ_FORMAT_ERROR, | ||
115 | XZ_OPTIONS_ERROR, | ||
116 | XZ_DATA_ERROR, | ||
117 | XZ_BUF_ERROR | ||
118 | }; | ||
119 | |||
120 | /** | ||
121 | * struct xz_buf - Passing input and output buffers to XZ code | ||
122 | * @in: Beginning of the input buffer. This may be NULL if and only | ||
123 | * if in_pos is equal to in_size. | ||
124 | * @in_pos: Current position in the input buffer. This must not exceed | ||
125 | * in_size. | ||
126 | * @in_size: Size of the input buffer | ||
127 | * @out: Beginning of the output buffer. This may be NULL if and only | ||
128 | * if out_pos is equal to out_size. | ||
129 | * @out_pos: Current position in the output buffer. This must not exceed | ||
130 | * out_size. | ||
131 | * @out_size: Size of the output buffer | ||
132 | * | ||
133 | * Only the contents of the output buffer from out[out_pos] onward, and | ||
134 | * the variables in_pos and out_pos are modified by the XZ code. | ||
135 | */ | ||
136 | struct xz_buf { | ||
137 | const uint8_t *in; | ||
138 | size_t in_pos; | ||
139 | size_t in_size; | ||
140 | |||
141 | uint8_t *out; | ||
142 | size_t out_pos; | ||
143 | size_t out_size; | ||
144 | }; | ||
145 | |||
146 | /** | ||
147 | * struct xz_dec - Opaque type to hold the XZ decoder state | ||
148 | */ | ||
149 | struct xz_dec; | ||
150 | |||
151 | /** | ||
152 | * xz_dec_init() - Allocate and initialize a XZ decoder state | ||
153 | * @mode: Operation mode | ||
154 | * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for | ||
155 | * multi-call decoding. This is ignored in single-call mode | ||
156 | * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes | ||
157 | * or 2^n + 2^(n-1) bytes (the latter sizes are less common | ||
158 | * in practice), so other values for dict_max don't make sense. | ||
159 | * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB, | ||
160 | * 512 KiB, and 1 MiB are probably the only reasonable values, | ||
161 | * except for kernel and initramfs images where a bigger | ||
162 | * dictionary can be fine and useful. | ||
163 | * | ||
164 | * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at | ||
165 | * once. The caller must provide enough output space or the decoding will | ||
166 | * fail. The output space is used as the dictionary buffer, which is why | ||
167 | * there is no need to allocate the dictionary as part of the decoder's | ||
168 | * internal state. | ||
169 | * | ||
170 | * Because the output buffer is used as the workspace, streams encoded using | ||
171 | * a big dictionary are not a problem in single-call mode. It is enough that | ||
172 | * the output buffer is big enough to hold the actual uncompressed data; it | ||
173 | * can be smaller than the dictionary size stored in the stream headers. | ||
174 | * | ||
175 | * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes | ||
176 | * of memory is preallocated for the LZMA2 dictionary. This way there is no | ||
177 | * risk that xz_dec_run() could run out of memory, since xz_dec_run() will | ||
178 | * never allocate any memory. Instead, if the preallocated dictionary is too | ||
179 | * small for decoding the given input stream, xz_dec_run() will return | ||
180 | * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be | ||
181 | * decoded to avoid allocating excessive amount of memory for the dictionary. | ||
182 | * | ||
183 | * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC): | ||
184 | * dict_max specifies the maximum allowed dictionary size that xz_dec_run() | ||
185 | * may allocate once it has parsed the dictionary size from the stream | ||
186 | * headers. This way excessive allocations can be avoided while still | ||
187 | * limiting the maximum memory usage to a sane value to prevent running the | ||
188 | * system out of memory when decompressing streams from untrusted sources. | ||
189 | * | ||
190 | * On success, xz_dec_init() returns a pointer to struct xz_dec, which is | ||
191 | * ready to be used with xz_dec_run(). If memory allocation fails, | ||
192 | * xz_dec_init() returns NULL. | ||
193 | */ | ||
194 | XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max); | ||
195 | |||
196 | /** | ||
197 | * xz_dec_run() - Run the XZ decoder | ||
198 | * @s: Decoder state allocated using xz_dec_init() | ||
199 | * @b: Input and output buffers | ||
200 | * | ||
201 | * The possible return values depend on build options and operation mode. | ||
202 | * See enum xz_ret for details. | ||
203 | * | ||
204 | * Note that if an error occurs in single-call mode (return value is not | ||
205 | * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the | ||
206 | * contents of the output buffer from b->out[b->out_pos] onward are | ||
207 | * undefined. This is true even after XZ_BUF_ERROR, because with some filter | ||
208 | * chains, there may be a second pass over the output buffer, and this pass | ||
209 | * cannot be properly done if the output buffer is truncated. Thus, you | ||
210 | * cannot give the single-call decoder a too small buffer and then expect to | ||
211 | * get that amount valid data from the beginning of the stream. You must use | ||
212 | * the multi-call decoder if you don't want to uncompress the whole stream. | ||
213 | */ | ||
214 | XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b); | ||
215 | |||
216 | /** | ||
217 | * xz_dec_reset() - Reset an already allocated decoder state | ||
218 | * @s: Decoder state allocated using xz_dec_init() | ||
219 | * | ||
220 | * This function can be used to reset the multi-call decoder state without | ||
221 | * freeing and reallocating memory with xz_dec_end() and xz_dec_init(). | ||
222 | * | ||
223 | * In single-call mode, xz_dec_reset() is always called in the beginning of | ||
224 | * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in | ||
225 | * multi-call mode. | ||
226 | */ | ||
227 | XZ_EXTERN void xz_dec_reset(struct xz_dec *s); | ||
228 | |||
229 | /** | ||
230 | * xz_dec_end() - Free the memory allocated for the decoder state | ||
231 | * @s: Decoder state allocated using xz_dec_init(). If s is NULL, | ||
232 | * this function does nothing. | ||
233 | */ | ||
234 | XZ_EXTERN void xz_dec_end(struct xz_dec *s); | ||
235 | |||
236 | /* | ||
237 | * Standalone build (userspace build or in-kernel build for boot time use) | ||
238 | * needs a CRC32 implementation. For normal in-kernel use, kernel's own | ||
239 | * CRC32 module is used instead, and users of this module don't need to | ||
240 | * care about the functions below. | ||
241 | */ | ||
242 | #ifndef XZ_INTERNAL_CRC32 | ||
243 | # ifdef __KERNEL__ | ||
244 | # define XZ_INTERNAL_CRC32 0 | ||
245 | # else | ||
246 | # define XZ_INTERNAL_CRC32 1 | ||
247 | # endif | ||
248 | #endif | ||
249 | |||
250 | #if XZ_INTERNAL_CRC32 | ||
251 | /* | ||
252 | * This must be called before any other xz_* function to initialize | ||
253 | * the CRC32 lookup table. | ||
254 | */ | ||
255 | XZ_EXTERN void xz_crc32_init(void); | ||
256 | |||
257 | /* | ||
258 | * Update CRC32 value using the polynomial from IEEE-802.3. To start a new | ||
259 | * calculation, the third argument must be zero. To continue the calculation, | ||
260 | * the previously returned value is passed as the third argument. | ||
261 | */ | ||
262 | XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc); | ||
263 | #endif | ||
264 | #endif | ||
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index c59cc029c74a..b586495bcd53 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
@@ -44,7 +44,7 @@ struct vpss_pg_frame_size { | |||
44 | short pplen; | 44 | short pplen; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* Used for enable/diable VPSS Clock */ | 47 | /* Used for enable/disable VPSS Clock */ |
48 | enum vpss_clock_sel { | 48 | enum vpss_clock_sel { |
49 | /* DM355/DM365 */ | 49 | /* DM355/DM365 */ |
50 | VPSS_CCDC_CLOCK, | 50 | VPSS_CCDC_CLOCK, |
diff --git a/include/net/ah.h b/include/net/ah.h index be7798dea6f4..ca95b98969dd 100644 --- a/include/net/ah.h +++ b/include/net/ah.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/skbuff.h> | 4 | #include <linux/skbuff.h> |
5 | 5 | ||
6 | /* This is the maximum truncated ICV length that we know of. */ | 6 | /* This is the maximum truncated ICV length that we know of. */ |
7 | #define MAX_AH_AUTH_LEN 16 | 7 | #define MAX_AH_AUTH_LEN 64 |
8 | 8 | ||
9 | struct crypto_ahash; | 9 | struct crypto_ahash; |
10 | 10 | ||
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index bcc9f448ec4e..1322695beb52 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1103,6 +1103,8 @@ struct cfg80211_pmksa { | |||
1103 | * @change_mpath: change a given mesh path | 1103 | * @change_mpath: change a given mesh path |
1104 | * @get_mpath: get a mesh path for the given parameters | 1104 | * @get_mpath: get a mesh path for the given parameters |
1105 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | 1105 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx |
1106 | * @join_mesh: join the mesh network with the specified parameters | ||
1107 | * @leave_mesh: leave the current mesh network | ||
1106 | * | 1108 | * |
1107 | * @get_mesh_config: Get the current mesh configuration | 1109 | * @get_mesh_config: Get the current mesh configuration |
1108 | * | 1110 | * |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5b3fd5add7a4..62c0ce2d1dc8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -337,6 +337,10 @@ struct ieee80211_bss_conf { | |||
337 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | 337 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame |
338 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | 338 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this |
339 | * frame and selects the maximum number of streams that it can use. | 339 | * frame and selects the maximum number of streams that it can use. |
340 | * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on | ||
341 | * the off-channel channel when a remain-on-channel offload is done | ||
342 | * in hardware -- normal packets still flow and are expected to be | ||
343 | * handled properly by the device. | ||
340 | * | 344 | * |
341 | * Note: If you have to add new flags to the enumeration, then don't | 345 | * Note: If you have to add new flags to the enumeration, then don't |
342 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 346 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
@@ -1753,6 +1757,16 @@ enum ieee80211_ampdu_mlme_action { | |||
1753 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | 1757 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). |
1754 | * | 1758 | * |
1755 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | 1759 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). |
1760 | * | ||
1761 | * @remain_on_channel: Starts an off-channel period on the given channel, must | ||
1762 | * call back to ieee80211_ready_on_channel() when on that channel. Note | ||
1763 | * that normal channel traffic is not stopped as this is intended for hw | ||
1764 | * offload. Frames to transmit on the off-channel channel are transmitted | ||
1765 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the | ||
1766 | * duration (which will always be non-zero) expires, the driver must call | ||
1767 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | ||
1768 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | ||
1769 | * aborted before it expires. This callback may sleep. | ||
1756 | */ | 1770 | */ |
1757 | struct ieee80211_ops { | 1771 | struct ieee80211_ops { |
1758 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1772 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index 1ee717eb5b09..a4c993685795 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -7,16 +7,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; | |||
7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; | 7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; |
8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | 8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; |
9 | 9 | ||
10 | extern int nf_ct_frag6_init(void); | ||
11 | extern void nf_ct_frag6_cleanup(void); | ||
12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); | ||
13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | ||
14 | struct net_device *in, | ||
15 | struct net_device *out, | ||
16 | int (*okfn)(struct sk_buff *)); | ||
17 | |||
18 | struct inet_frags_ctl; | ||
19 | |||
20 | #include <linux/sysctl.h> | 10 | #include <linux/sysctl.h> |
21 | extern struct ctl_table nf_ct_ipv6_sysctl_table[]; | 11 | extern struct ctl_table nf_ct_ipv6_sysctl_table[]; |
22 | 12 | ||
diff --git a/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/include/net/netfilter/ipv6/nf_defrag_ipv6.h index 94dd54d76b48..fd79c9a1779d 100644 --- a/include/net/netfilter/ipv6/nf_defrag_ipv6.h +++ b/include/net/netfilter/ipv6/nf_defrag_ipv6.h | |||
@@ -3,4 +3,14 @@ | |||
3 | 3 | ||
4 | extern void nf_defrag_ipv6_enable(void); | 4 | extern void nf_defrag_ipv6_enable(void); |
5 | 5 | ||
6 | extern int nf_ct_frag6_init(void); | ||
7 | extern void nf_ct_frag6_cleanup(void); | ||
8 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); | ||
9 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | ||
10 | struct net_device *in, | ||
11 | struct net_device *out, | ||
12 | int (*okfn)(struct sk_buff *)); | ||
13 | |||
14 | struct inet_frags_ctl; | ||
15 | |||
6 | #endif /* _NF_DEFRAG_IPV6_H */ | 16 | #endif /* _NF_DEFRAG_IPV6_H */ |
diff --git a/include/net/red.h b/include/net/red.h index 995108e54d9f..3319f16b3beb 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -97,7 +97,6 @@ struct red_stats { | |||
97 | u32 forced_mark; /* Forced marks, qavg > max_thresh */ | 97 | u32 forced_mark; /* Forced marks, qavg > max_thresh */ |
98 | u32 pdrop; /* Drops due to queue limits */ | 98 | u32 pdrop; /* Drops due to queue limits */ |
99 | u32 other; /* Drops due to drop() calls */ | 99 | u32 other; /* Drops due to drop() calls */ |
100 | u32 backlog; | ||
101 | }; | 100 | }; |
102 | 101 | ||
103 | struct red_parms { | 102 | struct red_parms { |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 2b2769c5ca9f..e73ebdae323d 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -78,6 +78,7 @@ typedef __s32 sctp_assoc_t; | |||
78 | #define SCTP_GET_PEER_ADDR_INFO 15 | 78 | #define SCTP_GET_PEER_ADDR_INFO 15 |
79 | #define SCTP_DELAYED_ACK_TIME 16 | 79 | #define SCTP_DELAYED_ACK_TIME 16 |
80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME | 80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME |
81 | #define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME | ||
81 | #define SCTP_CONTEXT 17 | 82 | #define SCTP_CONTEXT 17 |
82 | #define SCTP_FRAGMENT_INTERLEAVE 18 | 83 | #define SCTP_FRAGMENT_INTERLEAVE 18 |
83 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ | 84 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ |
@@ -99,8 +100,8 @@ typedef __s32 sctp_assoc_t; | |||
99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ | 100 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
100 | /* Options 104-106 are deprecated and removed. Do not use this space */ | 101 | /* Options 104-106 are deprecated and removed. Do not use this space */ |
101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ | 102 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ | 103 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */ |
103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ | 104 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ |
104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ | 105 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ | 106 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
106 | 107 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e04c4888d1fd..55cd0a0bc977 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -47,10 +47,13 @@ | |||
47 | #include <linux/list.h> | 47 | #include <linux/list.h> |
48 | #include <linux/rwsem.h> | 48 | #include <linux/rwsem.h> |
49 | #include <linux/scatterlist.h> | 49 | #include <linux/scatterlist.h> |
50 | #include <linux/workqueue.h> | ||
50 | 51 | ||
51 | #include <asm/atomic.h> | 52 | #include <asm/atomic.h> |
52 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
53 | 54 | ||
55 | extern struct workqueue_struct *ib_wq; | ||
56 | |||
54 | union ib_gid { | 57 | union ib_gid { |
55 | u8 raw[16]; | 58 | u8 raw[16]; |
56 | struct { | 59 | struct { |
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 8e9b222251c2..8a143ca79878 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
@@ -46,7 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | struct fcp_cmnd { | 47 | struct fcp_cmnd { |
48 | __u8 fc_lun[8]; /* logical unit number */ | 48 | __u8 fc_lun[8]; /* logical unit number */ |
49 | __u8 fc_cmdref; /* commmand reference number */ | 49 | __u8 fc_cmdref; /* command reference number */ |
50 | __u8 fc_pri_ta; /* priority and task attribute */ | 50 | __u8 fc_pri_ta; /* priority and task attribute */ |
51 | __u8 fc_tm_flags; /* task management flags */ | 51 | __u8 fc_tm_flags; /* task management flags */ |
52 | __u8 fc_flags; /* additional len & flags */ | 52 | __u8 fc_flags; /* additional len & flags */ |
@@ -58,7 +58,7 @@ struct fcp_cmnd { | |||
58 | 58 | ||
59 | struct fcp_cmnd32 { | 59 | struct fcp_cmnd32 { |
60 | __u8 fc_lun[8]; /* logical unit number */ | 60 | __u8 fc_lun[8]; /* logical unit number */ |
61 | __u8 fc_cmdref; /* commmand reference number */ | 61 | __u8 fc_cmdref; /* command reference number */ |
62 | __u8 fc_pri_ta; /* priority and task attribute */ | 62 | __u8 fc_pri_ta; /* priority and task attribute */ |
63 | __u8 fc_tm_flags; /* task management flags */ | 63 | __u8 fc_tm_flags; /* task management flags */ |
64 | __u8 fc_flags; /* additional len & flags */ | 64 | __u8 fc_flags; /* additional len & flags */ |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 1651fef18831..648d23358038 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -104,6 +104,7 @@ struct scsi_cmnd; | |||
104 | #define UNMAP 0x42 | 104 | #define UNMAP 0x42 |
105 | #define READ_TOC 0x43 | 105 | #define READ_TOC 0x43 |
106 | #define READ_HEADER 0x44 | 106 | #define READ_HEADER 0x44 |
107 | #define GET_EVENT_STATUS_NOTIFICATION 0x4a | ||
107 | #define LOG_SELECT 0x4c | 108 | #define LOG_SELECT 0x4c |
108 | #define LOG_SENSE 0x4d | 109 | #define LOG_SENSE 0x4d |
109 | #define XDWRITEREAD_10 0x53 | 110 | #define XDWRITEREAD_10 0x53 |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 49400459b477..b602f475cdbb 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -477,7 +477,7 @@ struct snd_ac97_template { | |||
477 | 477 | ||
478 | struct snd_ac97 { | 478 | struct snd_ac97 { |
479 | /* -- lowlevel (hardware) driver specific -- */ | 479 | /* -- lowlevel (hardware) driver specific -- */ |
480 | struct snd_ac97_build_ops * build_ops; | 480 | const struct snd_ac97_build_ops *build_ops; |
481 | void *private_data; | 481 | void *private_data; |
482 | void (*private_free) (struct snd_ac97 *ac97); | 482 | void (*private_free) (struct snd_ac97 *ac97); |
483 | /* --- */ | 483 | /* --- */ |
diff --git a/include/sound/alc5623.h b/include/sound/alc5623.h new file mode 100644 index 000000000000..422c97d43df3 --- /dev/null +++ b/include/sound/alc5623.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _INCLUDE_SOUND_ALC5623_H | ||
2 | #define _INCLUDE_SOUND_ALC5623_H | ||
3 | struct alc5623_platform_data { | ||
4 | /* configure : */ | ||
5 | /* Lineout/Speaker Amps Vmid ratio control */ | ||
6 | /* enable/disable adc/dac high pass filters */ | ||
7 | unsigned int add_ctrl; | ||
8 | /* configure : */ | ||
9 | /* output to enable when jack is low */ | ||
10 | /* output to enable when jack is high */ | ||
11 | /* jack detect (gpio/nc/jack detect [12] */ | ||
12 | unsigned int jack_det_ctrl; | ||
13 | }; | ||
14 | #endif | ||
15 | |||
diff --git a/include/sound/asound.h b/include/sound/asound.h index a1803ecea34d..5d6074faa279 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | 259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ |
260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
262 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | ||
262 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | 263 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
263 | 264 | ||
264 | typedef int __bitwise snd_pcm_state_t; | 265 | typedef int __bitwise snd_pcm_state_t; |
@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t; | |||
334 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | 335 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME |
335 | 336 | ||
336 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | 337 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
338 | #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ | ||
339 | #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ | ||
337 | 340 | ||
338 | struct snd_interval { | 341 | struct snd_interval { |
339 | unsigned int min, max; | 342 | unsigned int min, max; |
diff --git a/include/sound/control.h b/include/sound/control.h index 112374dc0c58..7715e6f00d38 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -160,12 +160,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id | |||
160 | } | 160 | } |
161 | 161 | ||
162 | /* | 162 | /* |
163 | * Frequently used control callbacks | 163 | * Frequently used control callbacks/helpers |
164 | */ | 164 | */ |
165 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, | 165 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, |
166 | struct snd_ctl_elem_info *uinfo); | 166 | struct snd_ctl_elem_info *uinfo); |
167 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, | 167 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, |
168 | struct snd_ctl_elem_info *uinfo); | 168 | struct snd_ctl_elem_info *uinfo); |
169 | int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, | ||
170 | unsigned int items, const char *const names[]); | ||
169 | 171 | ||
170 | /* | 172 | /* |
171 | * virtual master control | 173 | * virtual master control |
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h index d98a78dff2db..0909a3843479 100644 --- a/include/sound/hdsp.h +++ b/include/sound/hdsp.h | |||
@@ -28,6 +28,7 @@ enum HDSP_IO_Type { | |||
28 | Multiface, | 28 | Multiface, |
29 | H9652, | 29 | H9652, |
30 | H9632, | 30 | H9632, |
31 | RPM, | ||
31 | Undefined, | 32 | Undefined, |
32 | }; | 33 | }; |
33 | 34 | ||
diff --git a/include/sound/minors.h b/include/sound/minors.h index a81798ab73ed..8f764204a856 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h | |||
@@ -31,8 +31,8 @@ | |||
31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ | 31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ |
32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ | 32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ |
33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ | 33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ |
34 | #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) | 34 | #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */ |
35 | #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) | 35 | #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ |
36 | 36 | ||
37 | #ifndef CONFIG_SND_DYNAMIC_MINORS | 37 | #ifndef CONFIG_SND_DYNAMIC_MINORS |
38 | /* 2 - 3 (reserved) */ | 38 | /* 2 - 3 (reserved) */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index dfd9b76b1853..e731f8d71934 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -297,6 +297,7 @@ struct snd_pcm_runtime { | |||
297 | unsigned int info; | 297 | unsigned int info; |
298 | unsigned int rate_num; | 298 | unsigned int rate_num; |
299 | unsigned int rate_den; | 299 | unsigned int rate_den; |
300 | unsigned int no_period_wakeup: 1; | ||
300 | 301 | ||
301 | /* -- SW params -- */ | 302 | /* -- SW params -- */ |
302 | int tstamp_mode; /* mmap timestamp is updated */ | 303 | int tstamp_mode; /* mmap timestamp is updated */ |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index e7b680248006..1bafe95dcf41 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | 18 | ||
19 | #include <sound/soc.h> | ||
20 | |||
21 | struct snd_pcm_substream; | 19 | struct snd_pcm_substream; |
22 | 20 | ||
23 | /* | 21 | /* |
@@ -205,7 +203,7 @@ struct snd_soc_dai_driver { | |||
205 | int (*resume)(struct snd_soc_dai *dai); | 203 | int (*resume)(struct snd_soc_dai *dai); |
206 | 204 | ||
207 | /* ops */ | 205 | /* ops */ |
208 | struct snd_soc_dai_ops *ops; | 206 | const struct snd_soc_dai_ops *ops; |
209 | 207 | ||
210 | /* DAI capabilities */ | 208 | /* DAI capabilities */ |
211 | struct snd_soc_pcm_stream capture; | 209 | struct snd_soc_pcm_stream capture; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 8fd3b41b763f..8031769ac485 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <sound/control.h> | 18 | #include <sound/control.h> |
19 | #include <sound/soc.h> | ||
20 | 19 | ||
21 | /* widget has no PM register bit */ | 20 | /* widget has no PM register bit */ |
22 | #define SND_SOC_NOPM -1 | 21 | #define SND_SOC_NOPM -1 |
@@ -72,6 +71,10 @@ | |||
72 | wcontrols, wncontrols) \ | 71 | wcontrols, wncontrols) \ |
73 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 72 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
74 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 73 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} |
74 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ | ||
75 | wcontrols, wncontrols) \ | ||
76 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | ||
77 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | ||
75 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ | 78 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ |
76 | wcontrols, wncontrols)\ | 79 | wcontrols, wncontrols)\ |
77 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 80 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
@@ -90,6 +93,9 @@ | |||
90 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
91 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
92 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 95 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} |
96 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | ||
97 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
98 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | ||
93 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 99 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
94 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 100 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ |
95 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 101 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ |
@@ -116,6 +122,11 @@ | |||
116 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 122 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
117 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 123 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ |
118 | .event = wevent, .event_flags = wflags} | 124 | .event = wevent, .event_flags = wflags} |
125 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ | ||
126 | wncontrols, wevent, wflags) \ | ||
127 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | ||
128 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | ||
129 | .event = wevent, .event_flags = wflags} | ||
119 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ | 130 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ |
120 | wncontrols, wevent, wflags) \ | 131 | wncontrols, wevent, wflags) \ |
121 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 132 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
@@ -140,6 +151,11 @@ | |||
140 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
141 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 152 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ |
142 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | ||
155 | wevent, wflags) \ | ||
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | ||
158 | .event = wevent, .event_flags = wflags} | ||
143 | 159 | ||
144 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 160 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
145 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 161 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
@@ -219,13 +235,6 @@ | |||
219 | .info = snd_soc_info_volsw, \ | 235 | .info = snd_soc_info_volsw, \ |
220 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 236 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
221 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 237 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
222 | #define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \ | ||
223 | power) \ | ||
224 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
225 | .info = snd_soc_info_volsw, \ | ||
226 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
227 | .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ | ||
228 | ((max) << 16) | ((invert) << 24) } | ||
229 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 238 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
230 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 239 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
231 | .info = snd_soc_info_volsw, \ | 240 | .info = snd_soc_info_volsw, \ |
@@ -233,15 +242,6 @@ | |||
233 | .tlv.p = (tlv_array), \ | 242 | .tlv.p = (tlv_array), \ |
234 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 243 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
235 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 244 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
236 | #define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \ | ||
237 | power, tlv_array) \ | ||
238 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
239 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
240 | .tlv.p = (tlv_array), \ | ||
241 | .info = snd_soc_info_volsw, \ | ||
242 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
243 | .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ | ||
244 | ((max) << 16) | ((invert) << 24) } | ||
245 | #define SOC_DAPM_ENUM(xname, xenum) \ | 245 | #define SOC_DAPM_ENUM(xname, xenum) \ |
246 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 246 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
247 | .info = snd_soc_info_enum_double, \ | 247 | .info = snd_soc_info_enum_double, \ |
@@ -297,6 +297,7 @@ enum snd_soc_dapm_type; | |||
297 | struct snd_soc_dapm_path; | 297 | struct snd_soc_dapm_path; |
298 | struct snd_soc_dapm_pin; | 298 | struct snd_soc_dapm_pin; |
299 | struct snd_soc_dapm_route; | 299 | struct snd_soc_dapm_route; |
300 | struct snd_soc_dapm_context; | ||
300 | 301 | ||
301 | int dapm_reg_event(struct snd_soc_dapm_widget *w, | 302 | int dapm_reg_event(struct snd_soc_dapm_widget *w, |
302 | struct snd_kcontrol *kcontrol, int event); | 303 | struct snd_kcontrol *kcontrol, int event); |
@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, | |||
324 | struct snd_ctl_elem_value *uncontrol); | 325 | struct snd_ctl_elem_value *uncontrol); |
325 | int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, | 326 | int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, |
326 | struct snd_ctl_elem_value *uncontrol); | 327 | struct snd_ctl_elem_value *uncontrol); |
327 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, | 328 | int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, |
328 | const struct snd_soc_dapm_widget *widget); | 329 | const struct snd_soc_dapm_widget *widget); |
329 | int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | 330 | int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, |
330 | const struct snd_soc_dapm_widget *widget, | 331 | const struct snd_soc_dapm_widget *widget, |
331 | int num); | 332 | int num); |
332 | 333 | ||
333 | /* dapm path setup */ | 334 | /* dapm path setup */ |
334 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 335 | int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); |
335 | void snd_soc_dapm_free(struct snd_soc_codec *codec); | 336 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); |
336 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | 337 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, |
337 | const struct snd_soc_dapm_route *route, int num); | 338 | const struct snd_soc_dapm_route *route, int num); |
338 | 339 | ||
339 | /* dapm events */ | 340 | /* dapm events */ |
@@ -343,27 +344,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); | |||
343 | 344 | ||
344 | /* dapm sys fs - used by the core */ | 345 | /* dapm sys fs - used by the core */ |
345 | int snd_soc_dapm_sys_add(struct device *dev); | 346 | int snd_soc_dapm_sys_add(struct device *dev); |
346 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | 347 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); |
347 | 348 | ||
348 | /* dapm audio pin control and status */ | 349 | /* dapm audio pin control and status */ |
349 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 350 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, |
350 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); | 351 | const char *pin); |
351 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); | 352 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, |
352 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); | 353 | const char *pin); |
353 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 354 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); |
354 | int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, | 355 | int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, |
356 | const char *pin); | ||
357 | int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); | ||
358 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | ||
355 | const char *pin); | 359 | const char *pin); |
356 | int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); | 360 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
361 | const char *pin); | ||
357 | 362 | ||
358 | /* dapm widget types */ | 363 | /* dapm widget types */ |
359 | enum snd_soc_dapm_type { | 364 | enum snd_soc_dapm_type { |
360 | snd_soc_dapm_input = 0, /* input pin */ | 365 | snd_soc_dapm_input = 0, /* input pin */ |
361 | snd_soc_dapm_output, /* output pin */ | 366 | snd_soc_dapm_output, /* output pin */ |
362 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ | 367 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ |
368 | snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */ | ||
363 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ | 369 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ |
364 | snd_soc_dapm_mixer, /* mixes several analog signals together */ | 370 | snd_soc_dapm_mixer, /* mixes several analog signals together */ |
365 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ | 371 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ |
366 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ | 372 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ |
373 | snd_soc_dapm_out_drv, /* output driver */ | ||
367 | snd_soc_dapm_adc, /* analog to digital converter */ | 374 | snd_soc_dapm_adc, /* analog to digital converter */ |
368 | snd_soc_dapm_dac, /* digital to analog converter */ | 375 | snd_soc_dapm_dac, /* digital to analog converter */ |
369 | snd_soc_dapm_micbias, /* microphone bias (power) */ | 376 | snd_soc_dapm_micbias, /* microphone bias (power) */ |
@@ -425,6 +432,7 @@ struct snd_soc_dapm_widget { | |||
425 | char *sname; /* stream name */ | 432 | char *sname; /* stream name */ |
426 | struct snd_soc_codec *codec; | 433 | struct snd_soc_codec *codec; |
427 | struct list_head list; | 434 | struct list_head list; |
435 | struct snd_soc_dapm_context *dapm; | ||
428 | 436 | ||
429 | /* dapm control */ | 437 | /* dapm control */ |
430 | short reg; /* negative reg = no direct dapm */ | 438 | short reg; /* negative reg = no direct dapm */ |
@@ -461,4 +469,35 @@ struct snd_soc_dapm_widget { | |||
461 | struct list_head power_list; | 469 | struct list_head power_list; |
462 | }; | 470 | }; |
463 | 471 | ||
472 | struct snd_soc_dapm_update { | ||
473 | struct snd_soc_dapm_widget *widget; | ||
474 | struct snd_kcontrol *kcontrol; | ||
475 | int reg; | ||
476 | int mask; | ||
477 | int val; | ||
478 | }; | ||
479 | |||
480 | /* DAPM context */ | ||
481 | struct snd_soc_dapm_context { | ||
482 | int n_widgets; /* number of widgets in this context */ | ||
483 | enum snd_soc_bias_level bias_level; | ||
484 | enum snd_soc_bias_level suspend_bias_level; | ||
485 | struct delayed_work delayed_work; | ||
486 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | ||
487 | |||
488 | struct snd_soc_dapm_update *update; | ||
489 | |||
490 | struct device *dev; /* from parent - for debug */ | ||
491 | struct snd_soc_codec *codec; /* parent codec */ | ||
492 | struct snd_soc_card *card; /* parent card */ | ||
493 | |||
494 | /* used during DAPM updates */ | ||
495 | int dev_power; | ||
496 | struct list_head list; | ||
497 | |||
498 | #ifdef CONFIG_DEBUG_FS | ||
499 | struct dentry *debugfs_dapm; | ||
500 | #endif | ||
501 | }; | ||
502 | |||
464 | #endif | 503 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 5c3bce83f28a..74921f20a1d8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -222,10 +222,8 @@ enum snd_soc_bias_level { | |||
222 | 222 | ||
223 | struct snd_jack; | 223 | struct snd_jack; |
224 | struct snd_soc_card; | 224 | struct snd_soc_card; |
225 | struct snd_soc_device; | ||
226 | struct snd_soc_pcm_stream; | 225 | struct snd_soc_pcm_stream; |
227 | struct snd_soc_ops; | 226 | struct snd_soc_ops; |
228 | struct snd_soc_dai_mode; | ||
229 | struct snd_soc_pcm_runtime; | 227 | struct snd_soc_pcm_runtime; |
230 | struct snd_soc_dai; | 228 | struct snd_soc_dai; |
231 | struct snd_soc_dai_driver; | 229 | struct snd_soc_dai_driver; |
@@ -235,9 +233,10 @@ struct snd_soc_platform_driver; | |||
235 | struct snd_soc_codec; | 233 | struct snd_soc_codec; |
236 | struct snd_soc_codec_driver; | 234 | struct snd_soc_codec_driver; |
237 | struct soc_enum; | 235 | struct soc_enum; |
238 | struct snd_soc_ac97_ops; | ||
239 | struct snd_soc_jack; | 236 | struct snd_soc_jack; |
240 | struct snd_soc_jack_pin; | 237 | struct snd_soc_jack_pin; |
238 | struct snd_soc_cache_ops; | ||
239 | #include <sound/soc-dapm.h> | ||
241 | 240 | ||
242 | #ifdef CONFIG_GPIOLIB | 241 | #ifdef CONFIG_GPIOLIB |
243 | struct snd_soc_jack_gpio; | 242 | struct snd_soc_jack_gpio; |
@@ -253,17 +252,30 @@ enum snd_soc_control_type { | |||
253 | SND_SOC_SPI, | 252 | SND_SOC_SPI, |
254 | }; | 253 | }; |
255 | 254 | ||
255 | enum snd_soc_compress_type { | ||
256 | SND_SOC_FLAT_COMPRESSION = 1, | ||
257 | SND_SOC_LZO_COMPRESSION, | ||
258 | SND_SOC_RBTREE_COMPRESSION | ||
259 | }; | ||
260 | |||
256 | int snd_soc_register_platform(struct device *dev, | 261 | int snd_soc_register_platform(struct device *dev, |
257 | struct snd_soc_platform_driver *platform_drv); | 262 | struct snd_soc_platform_driver *platform_drv); |
258 | void snd_soc_unregister_platform(struct device *dev); | 263 | void snd_soc_unregister_platform(struct device *dev); |
259 | int snd_soc_register_codec(struct device *dev, | 264 | int snd_soc_register_codec(struct device *dev, |
260 | struct snd_soc_codec_driver *codec_drv, | 265 | const struct snd_soc_codec_driver *codec_drv, |
261 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 266 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
262 | void snd_soc_unregister_codec(struct device *dev); | 267 | void snd_soc_unregister_codec(struct device *dev); |
263 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | 268 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); |
264 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 269 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
265 | int addr_bits, int data_bits, | 270 | int addr_bits, int data_bits, |
266 | enum snd_soc_control_type control); | 271 | enum snd_soc_control_type control); |
272 | int snd_soc_cache_sync(struct snd_soc_codec *codec); | ||
273 | int snd_soc_cache_init(struct snd_soc_codec *codec); | ||
274 | int snd_soc_cache_exit(struct snd_soc_codec *codec); | ||
275 | int snd_soc_cache_write(struct snd_soc_codec *codec, | ||
276 | unsigned int reg, unsigned int value); | ||
277 | int snd_soc_cache_read(struct snd_soc_codec *codec, | ||
278 | unsigned int reg, unsigned int *value); | ||
267 | 279 | ||
268 | /* Utility functions to get clock rates from various things */ | 280 | /* Utility functions to get clock rates from various things */ |
269 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 281 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -420,23 +432,37 @@ struct snd_soc_ops { | |||
420 | int (*trigger)(struct snd_pcm_substream *, int); | 432 | int (*trigger)(struct snd_pcm_substream *, int); |
421 | }; | 433 | }; |
422 | 434 | ||
435 | /* SoC cache ops */ | ||
436 | struct snd_soc_cache_ops { | ||
437 | const char *name; | ||
438 | enum snd_soc_compress_type id; | ||
439 | int (*init)(struct snd_soc_codec *codec); | ||
440 | int (*exit)(struct snd_soc_codec *codec); | ||
441 | int (*read)(struct snd_soc_codec *codec, unsigned int reg, | ||
442 | unsigned int *value); | ||
443 | int (*write)(struct snd_soc_codec *codec, unsigned int reg, | ||
444 | unsigned int value); | ||
445 | int (*sync)(struct snd_soc_codec *codec); | ||
446 | }; | ||
447 | |||
423 | /* SoC Audio Codec device */ | 448 | /* SoC Audio Codec device */ |
424 | struct snd_soc_codec { | 449 | struct snd_soc_codec { |
425 | const char *name; | 450 | const char *name; |
451 | const char *name_prefix; | ||
426 | int id; | 452 | int id; |
427 | struct device *dev; | 453 | struct device *dev; |
428 | struct snd_soc_codec_driver *driver; | 454 | const struct snd_soc_codec_driver *driver; |
429 | 455 | ||
430 | struct mutex mutex; | 456 | struct mutex mutex; |
431 | struct snd_soc_card *card; | 457 | struct snd_soc_card *card; |
432 | struct list_head list; | 458 | struct list_head list; |
433 | struct list_head card_list; | 459 | struct list_head card_list; |
434 | int num_dai; | 460 | int num_dai; |
461 | enum snd_soc_compress_type compress_type; | ||
435 | 462 | ||
436 | /* runtime */ | 463 | /* runtime */ |
437 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 464 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
438 | unsigned int active; | 465 | unsigned int active; |
439 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | ||
440 | unsigned int cache_only:1; /* Suppress writes to hardware */ | 466 | unsigned int cache_only:1; /* Suppress writes to hardware */ |
441 | unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ | 467 | unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ |
442 | unsigned int suspended:1; /* Codec is in suspend PM state */ | 468 | unsigned int suspended:1; /* Codec is in suspend PM state */ |
@@ -444,25 +470,25 @@ struct snd_soc_codec { | |||
444 | unsigned int ac97_registered:1; /* Codec has been AC97 registered */ | 470 | unsigned int ac97_registered:1; /* Codec has been AC97 registered */ |
445 | unsigned int ac97_created:1; /* Codec has been created by SoC */ | 471 | unsigned int ac97_created:1; /* Codec has been created by SoC */ |
446 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ | 472 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ |
473 | unsigned int cache_init:1; /* codec cache has been initialized */ | ||
447 | 474 | ||
448 | /* codec IO */ | 475 | /* codec IO */ |
449 | void *control_data; /* codec control (i2c/3wire) data */ | 476 | void *control_data; /* codec control (i2c/3wire) data */ |
450 | hw_write_t hw_write; | 477 | hw_write_t hw_write; |
451 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); | 478 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
479 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | ||
480 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | ||
452 | void *reg_cache; | 481 | void *reg_cache; |
482 | const void *reg_def_copy; | ||
483 | const struct snd_soc_cache_ops *cache_ops; | ||
484 | struct mutex cache_rw_mutex; | ||
453 | 485 | ||
454 | /* dapm */ | 486 | /* dapm */ |
455 | u32 pop_time; | 487 | struct snd_soc_dapm_context dapm; |
456 | struct list_head dapm_widgets; | ||
457 | struct list_head dapm_paths; | ||
458 | enum snd_soc_bias_level bias_level; | ||
459 | enum snd_soc_bias_level suspend_bias_level; | ||
460 | struct delayed_work delayed_work; | ||
461 | 488 | ||
462 | #ifdef CONFIG_DEBUG_FS | 489 | #ifdef CONFIG_DEBUG_FS |
463 | struct dentry *debugfs_codec_root; | 490 | struct dentry *debugfs_codec_root; |
464 | struct dentry *debugfs_reg; | 491 | struct dentry *debugfs_reg; |
465 | struct dentry *debugfs_pop_time; | ||
466 | struct dentry *debugfs_dapm; | 492 | struct dentry *debugfs_dapm; |
467 | #endif | 493 | #endif |
468 | }; | 494 | }; |
@@ -488,6 +514,7 @@ struct snd_soc_codec_driver { | |||
488 | short reg_cache_step; | 514 | short reg_cache_step; |
489 | short reg_word_size; | 515 | short reg_word_size; |
490 | const void *reg_cache_default; | 516 | const void *reg_cache_default; |
517 | enum snd_soc_compress_type compress_type; | ||
491 | 518 | ||
492 | /* codec bias level */ | 519 | /* codec bias level */ |
493 | int (*set_bias_level)(struct snd_soc_codec *, | 520 | int (*set_bias_level)(struct snd_soc_codec *, |
@@ -554,6 +581,30 @@ struct snd_soc_dai_link { | |||
554 | struct snd_soc_ops *ops; | 581 | struct snd_soc_ops *ops; |
555 | }; | 582 | }; |
556 | 583 | ||
584 | struct snd_soc_codec_conf { | ||
585 | const char *dev_name; | ||
586 | |||
587 | /* | ||
588 | * optional map of kcontrol, widget and path name prefixes that are | ||
589 | * associated per device | ||
590 | */ | ||
591 | const char *name_prefix; | ||
592 | |||
593 | /* | ||
594 | * set this to the desired compression type if you want to | ||
595 | * override the one supplied in codec->driver->compress_type | ||
596 | */ | ||
597 | enum snd_soc_compress_type compress_type; | ||
598 | }; | ||
599 | |||
600 | struct snd_soc_aux_dev { | ||
601 | const char *name; /* Codec name */ | ||
602 | const char *codec_name; /* for multi-codec */ | ||
603 | |||
604 | /* codec/machine specific init - e.g. add machine controls */ | ||
605 | int (*init)(struct snd_soc_dapm_context *dapm); | ||
606 | }; | ||
607 | |||
557 | /* SoC card */ | 608 | /* SoC card */ |
558 | struct snd_soc_card { | 609 | struct snd_soc_card { |
559 | const char *name; | 610 | const char *name; |
@@ -579,6 +630,8 @@ struct snd_soc_card { | |||
579 | /* callbacks */ | 630 | /* callbacks */ |
580 | int (*set_bias_level)(struct snd_soc_card *, | 631 | int (*set_bias_level)(struct snd_soc_card *, |
581 | enum snd_soc_bias_level level); | 632 | enum snd_soc_bias_level level); |
633 | int (*set_bias_level_post)(struct snd_soc_card *, | ||
634 | enum snd_soc_bias_level level); | ||
582 | 635 | ||
583 | long pmdown_time; | 636 | long pmdown_time; |
584 | 637 | ||
@@ -588,12 +641,35 @@ struct snd_soc_card { | |||
588 | struct snd_soc_pcm_runtime *rtd; | 641 | struct snd_soc_pcm_runtime *rtd; |
589 | int num_rtd; | 642 | int num_rtd; |
590 | 643 | ||
644 | /* optional codec specific configuration */ | ||
645 | struct snd_soc_codec_conf *codec_conf; | ||
646 | int num_configs; | ||
647 | |||
648 | /* | ||
649 | * optional auxiliary devices such as amplifiers or codecs with DAI | ||
650 | * link unused | ||
651 | */ | ||
652 | struct snd_soc_aux_dev *aux_dev; | ||
653 | int num_aux_devs; | ||
654 | struct snd_soc_pcm_runtime *rtd_aux; | ||
655 | int num_aux_rtd; | ||
656 | |||
591 | struct work_struct deferred_resume_work; | 657 | struct work_struct deferred_resume_work; |
592 | 658 | ||
593 | /* lists of probed devices belonging to this card */ | 659 | /* lists of probed devices belonging to this card */ |
594 | struct list_head codec_dev_list; | 660 | struct list_head codec_dev_list; |
595 | struct list_head platform_dev_list; | 661 | struct list_head platform_dev_list; |
596 | struct list_head dai_dev_list; | 662 | struct list_head dai_dev_list; |
663 | |||
664 | struct list_head widgets; | ||
665 | struct list_head paths; | ||
666 | struct list_head dapm_list; | ||
667 | |||
668 | #ifdef CONFIG_DEBUG_FS | ||
669 | struct dentry *debugfs_card_root; | ||
670 | struct dentry *debugfs_pop_time; | ||
671 | #endif | ||
672 | u32 pop_time; | ||
597 | }; | 673 | }; |
598 | 674 | ||
599 | /* SoC machine DAI configuration, glues a codec and cpu DAI together */ | 675 | /* SoC machine DAI configuration, glues a codec and cpu DAI together */ |
@@ -639,17 +715,9 @@ struct soc_enum { | |||
639 | }; | 715 | }; |
640 | 716 | ||
641 | /* codec IO */ | 717 | /* codec IO */ |
642 | static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, | 718 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
643 | unsigned int reg) | 719 | unsigned int snd_soc_write(struct snd_soc_codec *codec, |
644 | { | 720 | unsigned int reg, unsigned int val); |
645 | return codec->driver->read(codec, reg); | ||
646 | } | ||
647 | |||
648 | static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | ||
649 | unsigned int reg, unsigned int val) | ||
650 | { | ||
651 | return codec->driver->write(codec, reg, val); | ||
652 | } | ||
653 | 721 | ||
654 | /* device driver data */ | 722 | /* device driver data */ |
655 | 723 | ||
diff --git a/include/target/configfs_macros.h b/include/target/configfs_macros.h new file mode 100644 index 000000000000..7fe74608b437 --- /dev/null +++ b/include/target/configfs_macros.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
3 | * | ||
4 | * configfs_macros.h - extends macros for configfs | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public | ||
8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public | ||
17 | * License along with this program; if not, write to the | ||
18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
19 | * Boston, MA 021110-1307, USA. | ||
20 | * | ||
21 | * Based on sysfs: | ||
22 | * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel | ||
23 | * | ||
24 | * Based on kobject.h: | ||
25 | * Copyright (c) 2002-2003 Patrick Mochel | ||
26 | * Copyright (c) 2002-2003 Open Source Development Labs | ||
27 | * | ||
28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | ||
29 | * | ||
30 | * Added CONFIGFS_EATTR() macros from original configfs.h macros | ||
31 | * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org> | ||
32 | * | ||
33 | * Please read Documentation/filesystems/configfs.txt before using the | ||
34 | * configfs interface, ESPECIALLY the parts about reference counts and | ||
35 | * item destructors. | ||
36 | */ | ||
37 | |||
38 | #ifndef _CONFIGFS_MACROS_H_ | ||
39 | #define _CONFIGFS_MACROS_H_ | ||
40 | |||
41 | #include <linux/configfs.h> | ||
42 | |||
43 | /* | ||
44 | * Users often need to create attribute structures for their configurable | ||
45 | * attributes, containing a configfs_attribute member and function pointers | ||
46 | * for the show() and store() operations on that attribute. If they don't | ||
47 | * need anything else on the extended attribute structure, they can use | ||
48 | * this macro to define it. The argument _name isends up as | ||
49 | * 'struct _name_attribute, as well as names of to CONFIGFS_ATTR_OPS() below. | ||
50 | * The argument _item is the name of the structure containing the | ||
51 | * struct config_item or struct config_group structure members | ||
52 | */ | ||
53 | #define CONFIGFS_EATTR_STRUCT(_name, _item) \ | ||
54 | struct _name##_attribute { \ | ||
55 | struct configfs_attribute attr; \ | ||
56 | ssize_t (*show)(struct _item *, char *); \ | ||
57 | ssize_t (*store)(struct _item *, const char *, size_t); \ | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * With the extended attribute structure, users can use this macro | ||
62 | * (similar to sysfs' __ATTR) to make defining attributes easier. | ||
63 | * An example: | ||
64 | * #define MYITEM_EATTR(_name, _mode, _show, _store) \ | ||
65 | * struct myitem_attribute childless_attr_##_name = \ | ||
66 | * __CONFIGFS_EATTR(_name, _mode, _show, _store) | ||
67 | */ | ||
68 | #define __CONFIGFS_EATTR(_name, _mode, _show, _store) \ | ||
69 | { \ | ||
70 | .attr = { \ | ||
71 | .ca_name = __stringify(_name), \ | ||
72 | .ca_mode = _mode, \ | ||
73 | .ca_owner = THIS_MODULE, \ | ||
74 | }, \ | ||
75 | .show = _show, \ | ||
76 | .store = _store, \ | ||
77 | } | ||
78 | /* Here is a readonly version, only requiring a show() operation */ | ||
79 | #define __CONFIGFS_EATTR_RO(_name, _show) \ | ||
80 | { \ | ||
81 | .attr = { \ | ||
82 | .ca_name = __stringify(_name), \ | ||
83 | .ca_mode = 0444, \ | ||
84 | .ca_owner = THIS_MODULE, \ | ||
85 | }, \ | ||
86 | .show = _show, \ | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * With these extended attributes, the simple show_attribute() and | ||
91 | * store_attribute() operations need to call the show() and store() of the | ||
92 | * attributes. This is a common pattern, so we provide a macro to define | ||
93 | * them. The argument _name is the name of the attribute defined by | ||
94 | * CONFIGFS_ATTR_STRUCT(). The argument _item is the name of the structure | ||
95 | * containing the struct config_item or struct config_group structure member. | ||
96 | * The argument _item_member is the actual name of the struct config_* struct | ||
97 | * in your _item structure. Meaning my_structure->some_config_group. | ||
98 | * ^^_item^^^^^ ^^_item_member^^^ | ||
99 | * This macro expects the attributes to be named "struct <name>_attribute". | ||
100 | */ | ||
101 | #define CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member) \ | ||
102 | static struct _item *to_##_name(struct config_item *ci) \ | ||
103 | { \ | ||
104 | return (ci) ? container_of(to_config_group(ci), struct _item, \ | ||
105 | _item_member) : NULL; \ | ||
106 | } | ||
107 | |||
108 | #define CONFIGFS_EATTR_OPS_SHOW(_name, _item) \ | ||
109 | static ssize_t _name##_attr_show(struct config_item *item, \ | ||
110 | struct configfs_attribute *attr, \ | ||
111 | char *page) \ | ||
112 | { \ | ||
113 | struct _item *_item = to_##_name(item); \ | ||
114 | struct _name##_attribute * _name##_attr = \ | ||
115 | container_of(attr, struct _name##_attribute, attr); \ | ||
116 | ssize_t ret = 0; \ | ||
117 | \ | ||
118 | if (_name##_attr->show) \ | ||
119 | ret = _name##_attr->show(_item, page); \ | ||
120 | return ret; \ | ||
121 | } | ||
122 | |||
123 | #define CONFIGFS_EATTR_OPS_STORE(_name, _item) \ | ||
124 | static ssize_t _name##_attr_store(struct config_item *item, \ | ||
125 | struct configfs_attribute *attr, \ | ||
126 | const char *page, size_t count) \ | ||
127 | { \ | ||
128 | struct _item *_item = to_##_name(item); \ | ||
129 | struct _name##_attribute * _name##_attr = \ | ||
130 | container_of(attr, struct _name##_attribute, attr); \ | ||
131 | ssize_t ret = -EINVAL; \ | ||
132 | \ | ||
133 | if (_name##_attr->store) \ | ||
134 | ret = _name##_attr->store(_item, page, count); \ | ||
135 | return ret; \ | ||
136 | } | ||
137 | |||
138 | #define CONFIGFS_EATTR_OPS(_name, _item, _item_member) \ | ||
139 | CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \ | ||
140 | CONFIGFS_EATTR_OPS_SHOW(_name, _item); \ | ||
141 | CONFIGFS_EATTR_OPS_STORE(_name, _item); | ||
142 | |||
143 | #define CONFIGFS_EATTR_OPS_RO(_name, _item, _item_member) \ | ||
144 | CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \ | ||
145 | CONFIGFS_EATTR_OPS_SHOW(_name, _item); | ||
146 | |||
147 | #endif /* _CONFIGFS_MACROS_H_ */ | ||
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h new file mode 100644 index 000000000000..07fdfb6b9a9a --- /dev/null +++ b/include/target/target_core_base.h | |||
@@ -0,0 +1,937 @@ | |||
1 | #ifndef TARGET_CORE_BASE_H | ||
2 | #define TARGET_CORE_BASE_H | ||
3 | |||
4 | #include <linux/in.h> | ||
5 | #include <linux/configfs.h> | ||
6 | #include <linux/dma-mapping.h> | ||
7 | #include <linux/blkdev.h> | ||
8 | #include <scsi/scsi_cmnd.h> | ||
9 | #include <net/sock.h> | ||
10 | #include <net/tcp.h> | ||
11 | #include "target_core_mib.h" | ||
12 | |||
13 | #define TARGET_CORE_MOD_VERSION "v4.0.0-rc6" | ||
14 | #define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) | ||
15 | |||
16 | /* Used by transport_generic_allocate_iovecs() */ | ||
17 | #define TRANSPORT_IOV_DATA_BUFFER 5 | ||
18 | /* Maximum Number of LUNs per Target Portal Group */ | ||
19 | #define TRANSPORT_MAX_LUNS_PER_TPG 256 | ||
20 | /* | ||
21 | * By default we use 32-byte CDBs in TCM Core and subsystem plugin code. | ||
22 | * | ||
23 | * Note that both include/scsi/scsi_cmnd.h:MAX_COMMAND_SIZE and | ||
24 | * include/linux/blkdev.h:BLOCK_MAX_CDB as of v2.6.36-rc4 still use | ||
25 | * 16-byte CDBs by default and require an extra allocation for | ||
26 | * 32-byte CDBs to becasue of legacy issues. | ||
27 | * | ||
28 | * Within TCM Core there are no such legacy limitiations, so we go ahead | ||
29 | * use 32-byte CDBs by default and use include/scsi/scsi.h:scsi_command_size() | ||
30 | * within all TCM Core and subsystem plugin code. | ||
31 | */ | ||
32 | #define TCM_MAX_COMMAND_SIZE 32 | ||
33 | /* | ||
34 | * From include/scsi/scsi_cmnd.h:SCSI_SENSE_BUFFERSIZE, currently | ||
35 | * defined 96, but the real limit is 252 (or 260 including the header) | ||
36 | */ | ||
37 | #define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE | ||
38 | /* Used by transport_send_check_condition_and_sense() */ | ||
39 | #define SPC_SENSE_KEY_OFFSET 2 | ||
40 | #define SPC_ASC_KEY_OFFSET 12 | ||
41 | #define SPC_ASCQ_KEY_OFFSET 13 | ||
42 | #define TRANSPORT_IQN_LEN 224 | ||
43 | /* Used by target_core_store_alua_lu_gp() and target_core_alua_lu_gp_show_attr_members() */ | ||
44 | #define LU_GROUP_NAME_BUF 256 | ||
45 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ | ||
46 | #define TG_PT_GROUP_NAME_BUF 256 | ||
47 | /* Used to parse VPD into struct t10_vpd */ | ||
48 | #define VPD_TMP_BUF_SIZE 128 | ||
49 | /* Used by transport_generic_cmd_sequencer() */ | ||
50 | #define READ_BLOCK_LEN 6 | ||
51 | #define READ_CAP_LEN 8 | ||
52 | #define READ_POSITION_LEN 20 | ||
53 | #define INQUIRY_LEN 36 | ||
54 | /* Used by transport_get_inquiry_vpd_serial() */ | ||
55 | #define INQUIRY_VPD_SERIAL_LEN 254 | ||
56 | /* Used by transport_get_inquiry_vpd_device_ident() */ | ||
57 | #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254 | ||
58 | |||
59 | /* struct se_hba->hba_flags */ | ||
60 | enum hba_flags_table { | ||
61 | HBA_FLAGS_INTERNAL_USE = 0x01, | ||
62 | HBA_FLAGS_PSCSI_MODE = 0x02, | ||
63 | }; | ||
64 | |||
65 | /* struct se_lun->lun_status */ | ||
66 | enum transport_lun_status_table { | ||
67 | TRANSPORT_LUN_STATUS_FREE = 0, | ||
68 | TRANSPORT_LUN_STATUS_ACTIVE = 1, | ||
69 | }; | ||
70 | |||
71 | /* struct se_portal_group->se_tpg_type */ | ||
72 | enum transport_tpg_type_table { | ||
73 | TRANSPORT_TPG_TYPE_NORMAL = 0, | ||
74 | TRANSPORT_TPG_TYPE_DISCOVERY = 1, | ||
75 | }; | ||
76 | |||
77 | /* Used for generate timer flags */ | ||
78 | enum timer_flags_table { | ||
79 | TF_RUNNING = 0x01, | ||
80 | TF_STOP = 0x02, | ||
81 | }; | ||
82 | |||
83 | /* Special transport agnostic struct se_cmd->t_states */ | ||
84 | enum transport_state_table { | ||
85 | TRANSPORT_NO_STATE = 0, | ||
86 | TRANSPORT_NEW_CMD = 1, | ||
87 | TRANSPORT_DEFERRED_CMD = 2, | ||
88 | TRANSPORT_WRITE_PENDING = 3, | ||
89 | TRANSPORT_PROCESS_WRITE = 4, | ||
90 | TRANSPORT_PROCESSING = 5, | ||
91 | TRANSPORT_COMPLETE_OK = 6, | ||
92 | TRANSPORT_COMPLETE_FAILURE = 7, | ||
93 | TRANSPORT_COMPLETE_TIMEOUT = 8, | ||
94 | TRANSPORT_PROCESS_TMR = 9, | ||
95 | TRANSPORT_TMR_COMPLETE = 10, | ||
96 | TRANSPORT_ISTATE_PROCESSING = 11, | ||
97 | TRANSPORT_ISTATE_PROCESSED = 12, | ||
98 | TRANSPORT_KILL = 13, | ||
99 | TRANSPORT_REMOVE = 14, | ||
100 | TRANSPORT_FREE = 15, | ||
101 | TRANSPORT_NEW_CMD_MAP = 16, | ||
102 | }; | ||
103 | |||
104 | /* Used for struct se_cmd->se_cmd_flags */ | ||
105 | enum se_cmd_flags_table { | ||
106 | SCF_SUPPORTED_SAM_OPCODE = 0x00000001, | ||
107 | SCF_TRANSPORT_TASK_SENSE = 0x00000002, | ||
108 | SCF_EMULATED_TASK_SENSE = 0x00000004, | ||
109 | SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, | ||
110 | SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, | ||
111 | SCF_SCSI_CONTROL_NONSG_IO_CDB = 0x00000020, | ||
112 | SCF_SCSI_NON_DATA_CDB = 0x00000040, | ||
113 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, | ||
114 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, | ||
115 | SCF_CMD_PASSTHROUGH_NOALLOC = 0x00000200, | ||
116 | SCF_SE_CMD_FAILED = 0x00000400, | ||
117 | SCF_SE_LUN_CMD = 0x00000800, | ||
118 | SCF_SE_ALLOW_EOO = 0x00001000, | ||
119 | SCF_SE_DISABLE_ONLINE_CHECK = 0x00002000, | ||
120 | SCF_SENT_CHECK_CONDITION = 0x00004000, | ||
121 | SCF_OVERFLOW_BIT = 0x00008000, | ||
122 | SCF_UNDERFLOW_BIT = 0x00010000, | ||
123 | SCF_SENT_DELAYED_TAS = 0x00020000, | ||
124 | SCF_ALUA_NON_OPTIMIZED = 0x00040000, | ||
125 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, | ||
126 | SCF_PASSTHROUGH_SG_TO_MEM = 0x00100000, | ||
127 | SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000, | ||
128 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, | ||
129 | SCF_EMULATE_SYNC_CACHE = 0x00800000, | ||
130 | SCF_EMULATE_CDB_ASYNC = 0x01000000, | ||
131 | SCF_EMULATE_SYNC_UNMAP = 0x02000000 | ||
132 | }; | ||
133 | |||
134 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ | ||
135 | enum transport_lunflags_table { | ||
136 | TRANSPORT_LUNFLAGS_NO_ACCESS = 0x00, | ||
137 | TRANSPORT_LUNFLAGS_INITIATOR_ACCESS = 0x01, | ||
138 | TRANSPORT_LUNFLAGS_READ_ONLY = 0x02, | ||
139 | TRANSPORT_LUNFLAGS_READ_WRITE = 0x04, | ||
140 | }; | ||
141 | |||
142 | /* struct se_device->dev_status */ | ||
143 | enum transport_device_status_table { | ||
144 | TRANSPORT_DEVICE_ACTIVATED = 0x01, | ||
145 | TRANSPORT_DEVICE_DEACTIVATED = 0x02, | ||
146 | TRANSPORT_DEVICE_QUEUE_FULL = 0x04, | ||
147 | TRANSPORT_DEVICE_SHUTDOWN = 0x08, | ||
148 | TRANSPORT_DEVICE_OFFLINE_ACTIVATED = 0x10, | ||
149 | TRANSPORT_DEVICE_OFFLINE_DEACTIVATED = 0x20, | ||
150 | }; | ||
151 | |||
152 | /* | ||
153 | * Used by transport_send_check_condition_and_sense() and se_cmd->scsi_sense_reason | ||
154 | * to signal which ASC/ASCQ sense payload should be built. | ||
155 | */ | ||
156 | enum tcm_sense_reason_table { | ||
157 | TCM_NON_EXISTENT_LUN = 0x01, | ||
158 | TCM_UNSUPPORTED_SCSI_OPCODE = 0x02, | ||
159 | TCM_INCORRECT_AMOUNT_OF_DATA = 0x03, | ||
160 | TCM_UNEXPECTED_UNSOLICITED_DATA = 0x04, | ||
161 | TCM_SERVICE_CRC_ERROR = 0x05, | ||
162 | TCM_SNACK_REJECTED = 0x06, | ||
163 | TCM_SECTOR_COUNT_TOO_MANY = 0x07, | ||
164 | TCM_INVALID_CDB_FIELD = 0x08, | ||
165 | TCM_INVALID_PARAMETER_LIST = 0x09, | ||
166 | TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE = 0x0a, | ||
167 | TCM_UNKNOWN_MODE_PAGE = 0x0b, | ||
168 | TCM_WRITE_PROTECTED = 0x0c, | ||
169 | TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, | ||
170 | TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, | ||
171 | TCM_CHECK_CONDITION_NOT_READY = 0x0f, | ||
172 | }; | ||
173 | |||
174 | struct se_obj { | ||
175 | atomic_t obj_access_count; | ||
176 | } ____cacheline_aligned; | ||
177 | |||
178 | /* | ||
179 | * Used by TCM Core internally to signal if ALUA emulation is enabled or | ||
180 | * disabled, or running in with TCM/pSCSI passthrough mode | ||
181 | */ | ||
182 | typedef enum { | ||
183 | SPC_ALUA_PASSTHROUGH, | ||
184 | SPC2_ALUA_DISABLED, | ||
185 | SPC3_ALUA_EMULATED | ||
186 | } t10_alua_index_t; | ||
187 | |||
188 | /* | ||
189 | * Used by TCM Core internally to signal if SAM Task Attribute emulation | ||
190 | * is enabled or disabled, or running in with TCM/pSCSI passthrough mode | ||
191 | */ | ||
192 | typedef enum { | ||
193 | SAM_TASK_ATTR_PASSTHROUGH, | ||
194 | SAM_TASK_ATTR_UNTAGGED, | ||
195 | SAM_TASK_ATTR_EMULATED | ||
196 | } t10_task_attr_index_t; | ||
197 | |||
198 | struct se_cmd; | ||
199 | |||
200 | struct t10_alua { | ||
201 | t10_alua_index_t alua_type; | ||
202 | /* ALUA Target Port Group ID */ | ||
203 | u16 alua_tg_pt_gps_counter; | ||
204 | u32 alua_tg_pt_gps_count; | ||
205 | spinlock_t tg_pt_gps_lock; | ||
206 | struct se_subsystem_dev *t10_sub_dev; | ||
207 | /* Used for default ALUA Target Port Group */ | ||
208 | struct t10_alua_tg_pt_gp *default_tg_pt_gp; | ||
209 | /* Used for default ALUA Target Port Group ConfigFS group */ | ||
210 | struct config_group alua_tg_pt_gps_group; | ||
211 | int (*alua_state_check)(struct se_cmd *, unsigned char *, u8 *); | ||
212 | struct list_head tg_pt_gps_list; | ||
213 | } ____cacheline_aligned; | ||
214 | |||
215 | struct t10_alua_lu_gp { | ||
216 | u16 lu_gp_id; | ||
217 | int lu_gp_valid_id; | ||
218 | u32 lu_gp_members; | ||
219 | atomic_t lu_gp_shutdown; | ||
220 | atomic_t lu_gp_ref_cnt; | ||
221 | spinlock_t lu_gp_lock; | ||
222 | struct config_group lu_gp_group; | ||
223 | struct list_head lu_gp_list; | ||
224 | struct list_head lu_gp_mem_list; | ||
225 | } ____cacheline_aligned; | ||
226 | |||
227 | struct t10_alua_lu_gp_member { | ||
228 | int lu_gp_assoc:1; | ||
229 | atomic_t lu_gp_mem_ref_cnt; | ||
230 | spinlock_t lu_gp_mem_lock; | ||
231 | struct t10_alua_lu_gp *lu_gp; | ||
232 | struct se_device *lu_gp_mem_dev; | ||
233 | struct list_head lu_gp_mem_list; | ||
234 | } ____cacheline_aligned; | ||
235 | |||
236 | struct t10_alua_tg_pt_gp { | ||
237 | u16 tg_pt_gp_id; | ||
238 | int tg_pt_gp_valid_id; | ||
239 | int tg_pt_gp_alua_access_status; | ||
240 | int tg_pt_gp_alua_access_type; | ||
241 | int tg_pt_gp_nonop_delay_msecs; | ||
242 | int tg_pt_gp_trans_delay_msecs; | ||
243 | int tg_pt_gp_pref; | ||
244 | int tg_pt_gp_write_metadata; | ||
245 | /* Used by struct t10_alua_tg_pt_gp->tg_pt_gp_md_buf_len */ | ||
246 | #define ALUA_MD_BUF_LEN 1024 | ||
247 | u32 tg_pt_gp_md_buf_len; | ||
248 | u32 tg_pt_gp_members; | ||
249 | atomic_t tg_pt_gp_alua_access_state; | ||
250 | atomic_t tg_pt_gp_ref_cnt; | ||
251 | spinlock_t tg_pt_gp_lock; | ||
252 | struct mutex tg_pt_gp_md_mutex; | ||
253 | struct se_subsystem_dev *tg_pt_gp_su_dev; | ||
254 | struct config_group tg_pt_gp_group; | ||
255 | struct list_head tg_pt_gp_list; | ||
256 | struct list_head tg_pt_gp_mem_list; | ||
257 | } ____cacheline_aligned; | ||
258 | |||
259 | struct t10_alua_tg_pt_gp_member { | ||
260 | int tg_pt_gp_assoc:1; | ||
261 | atomic_t tg_pt_gp_mem_ref_cnt; | ||
262 | spinlock_t tg_pt_gp_mem_lock; | ||
263 | struct t10_alua_tg_pt_gp *tg_pt_gp; | ||
264 | struct se_port *tg_pt; | ||
265 | struct list_head tg_pt_gp_mem_list; | ||
266 | } ____cacheline_aligned; | ||
267 | |||
268 | struct t10_vpd { | ||
269 | unsigned char device_identifier[INQUIRY_VPD_DEVICE_IDENTIFIER_LEN]; | ||
270 | int protocol_identifier_set; | ||
271 | u32 protocol_identifier; | ||
272 | u32 device_identifier_code_set; | ||
273 | u32 association; | ||
274 | u32 device_identifier_type; | ||
275 | struct list_head vpd_list; | ||
276 | } ____cacheline_aligned; | ||
277 | |||
278 | struct t10_wwn { | ||
279 | unsigned char vendor[8]; | ||
280 | unsigned char model[16]; | ||
281 | unsigned char revision[4]; | ||
282 | unsigned char unit_serial[INQUIRY_VPD_SERIAL_LEN]; | ||
283 | spinlock_t t10_vpd_lock; | ||
284 | struct se_subsystem_dev *t10_sub_dev; | ||
285 | struct config_group t10_wwn_group; | ||
286 | struct list_head t10_vpd_list; | ||
287 | } ____cacheline_aligned; | ||
288 | |||
289 | |||
290 | /* | ||
291 | * Used by TCM Core internally to signal if >= SPC-3 peristent reservations | ||
292 | * emulation is enabled or disabled, or running in with TCM/pSCSI passthrough | ||
293 | * mode | ||
294 | */ | ||
295 | typedef enum { | ||
296 | SPC_PASSTHROUGH, | ||
297 | SPC2_RESERVATIONS, | ||
298 | SPC3_PERSISTENT_RESERVATIONS | ||
299 | } t10_reservations_index_t; | ||
300 | |||
301 | struct t10_pr_registration { | ||
302 | /* Used for fabrics that contain WWN+ISID */ | ||
303 | #define PR_REG_ISID_LEN 16 | ||
304 | /* PR_REG_ISID_LEN + ',i,0x' */ | ||
305 | #define PR_REG_ISID_ID_LEN (PR_REG_ISID_LEN + 5) | ||
306 | char pr_reg_isid[PR_REG_ISID_LEN]; | ||
307 | /* Used during APTPL metadata reading */ | ||
308 | #define PR_APTPL_MAX_IPORT_LEN 256 | ||
309 | unsigned char pr_iport[PR_APTPL_MAX_IPORT_LEN]; | ||
310 | /* Used during APTPL metadata reading */ | ||
311 | #define PR_APTPL_MAX_TPORT_LEN 256 | ||
312 | unsigned char pr_tport[PR_APTPL_MAX_TPORT_LEN]; | ||
313 | /* For writing out live meta data */ | ||
314 | unsigned char *pr_aptpl_buf; | ||
315 | u16 pr_aptpl_rpti; | ||
316 | u16 pr_reg_tpgt; | ||
317 | /* Reservation effects all target ports */ | ||
318 | int pr_reg_all_tg_pt; | ||
319 | /* Activate Persistence across Target Power Loss */ | ||
320 | int pr_reg_aptpl; | ||
321 | int pr_res_holder; | ||
322 | int pr_res_type; | ||
323 | int pr_res_scope; | ||
324 | /* Used for fabric initiator WWPNs using a ISID */ | ||
325 | int isid_present_at_reg:1; | ||
326 | u32 pr_res_mapped_lun; | ||
327 | u32 pr_aptpl_target_lun; | ||
328 | u32 pr_res_generation; | ||
329 | u64 pr_reg_bin_isid; | ||
330 | u64 pr_res_key; | ||
331 | atomic_t pr_res_holders; | ||
332 | struct se_node_acl *pr_reg_nacl; | ||
333 | struct se_dev_entry *pr_reg_deve; | ||
334 | struct se_lun *pr_reg_tg_pt_lun; | ||
335 | struct list_head pr_reg_list; | ||
336 | struct list_head pr_reg_abort_list; | ||
337 | struct list_head pr_reg_aptpl_list; | ||
338 | struct list_head pr_reg_atp_list; | ||
339 | struct list_head pr_reg_atp_mem_list; | ||
340 | } ____cacheline_aligned; | ||
341 | |||
342 | /* | ||
343 | * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS, | ||
344 | * SPC2_RESERVATIONS or SPC_PASSTHROUGH in drivers/target/target_core_pr.c: | ||
345 | * core_setup_reservations() | ||
346 | */ | ||
347 | struct t10_reservation_ops { | ||
348 | int (*t10_reservation_check)(struct se_cmd *, u32 *); | ||
349 | int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32); | ||
350 | int (*t10_pr_register)(struct se_cmd *); | ||
351 | int (*t10_pr_clear)(struct se_cmd *); | ||
352 | }; | ||
353 | |||
354 | struct t10_reservation_template { | ||
355 | /* Reservation effects all target ports */ | ||
356 | int pr_all_tg_pt; | ||
357 | /* Activate Persistence across Target Power Loss enabled | ||
358 | * for SCSI device */ | ||
359 | int pr_aptpl_active; | ||
360 | /* Used by struct t10_reservation_template->pr_aptpl_buf_len */ | ||
361 | #define PR_APTPL_BUF_LEN 8192 | ||
362 | u32 pr_aptpl_buf_len; | ||
363 | u32 pr_generation; | ||
364 | t10_reservations_index_t res_type; | ||
365 | spinlock_t registration_lock; | ||
366 | spinlock_t aptpl_reg_lock; | ||
367 | /* | ||
368 | * This will always be set by one individual I_T Nexus. | ||
369 | * However with all_tg_pt=1, other I_T Nexus from the | ||
370 | * same initiator can access PR reg/res info on a different | ||
371 | * target port. | ||
372 | * | ||
373 | * There is also the 'All Registrants' case, where there is | ||
374 | * a single *pr_res_holder of the reservation, but all | ||
375 | * registrations are considered reservation holders. | ||
376 | */ | ||
377 | struct se_node_acl *pr_res_holder; | ||
378 | struct list_head registration_list; | ||
379 | struct list_head aptpl_reg_list; | ||
380 | struct t10_reservation_ops pr_ops; | ||
381 | } ____cacheline_aligned; | ||
382 | |||
383 | struct se_queue_req { | ||
384 | int state; | ||
385 | void *cmd; | ||
386 | struct list_head qr_list; | ||
387 | } ____cacheline_aligned; | ||
388 | |||
389 | struct se_queue_obj { | ||
390 | atomic_t queue_cnt; | ||
391 | spinlock_t cmd_queue_lock; | ||
392 | struct list_head qobj_list; | ||
393 | wait_queue_head_t thread_wq; | ||
394 | } ____cacheline_aligned; | ||
395 | |||
396 | /* | ||
397 | * Used one per struct se_cmd to hold all extra struct se_task | ||
398 | * metadata. This structure is setup and allocated in | ||
399 | * drivers/target/target_core_transport.c:__transport_alloc_se_cmd() | ||
400 | */ | ||
401 | struct se_transport_task { | ||
402 | unsigned char *t_task_cdb; | ||
403 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; | ||
404 | unsigned long long t_task_lba; | ||
405 | int t_tasks_failed; | ||
406 | int t_tasks_fua; | ||
407 | int t_tasks_bidi:1; | ||
408 | u32 t_task_cdbs; | ||
409 | u32 t_tasks_check; | ||
410 | u32 t_tasks_no; | ||
411 | u32 t_tasks_sectors; | ||
412 | u32 t_tasks_se_num; | ||
413 | u32 t_tasks_se_bidi_num; | ||
414 | u32 t_tasks_sg_chained_no; | ||
415 | atomic_t t_fe_count; | ||
416 | atomic_t t_se_count; | ||
417 | atomic_t t_task_cdbs_left; | ||
418 | atomic_t t_task_cdbs_ex_left; | ||
419 | atomic_t t_task_cdbs_timeout_left; | ||
420 | atomic_t t_task_cdbs_sent; | ||
421 | atomic_t t_transport_aborted; | ||
422 | atomic_t t_transport_active; | ||
423 | atomic_t t_transport_complete; | ||
424 | atomic_t t_transport_queue_active; | ||
425 | atomic_t t_transport_sent; | ||
426 | atomic_t t_transport_stop; | ||
427 | atomic_t t_transport_timeout; | ||
428 | atomic_t transport_dev_active; | ||
429 | atomic_t transport_lun_active; | ||
430 | atomic_t transport_lun_fe_stop; | ||
431 | atomic_t transport_lun_stop; | ||
432 | spinlock_t t_state_lock; | ||
433 | struct completion t_transport_stop_comp; | ||
434 | struct completion transport_lun_fe_stop_comp; | ||
435 | struct completion transport_lun_stop_comp; | ||
436 | struct scatterlist *t_tasks_sg_chained; | ||
437 | struct scatterlist t_tasks_sg_bounce; | ||
438 | void *t_task_buf; | ||
439 | /* | ||
440 | * Used for pre-registered fabric SGL passthrough WRITE and READ | ||
441 | * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop | ||
442 | * and other HW target mode fabric modules. | ||
443 | */ | ||
444 | struct scatterlist *t_task_pt_sgl; | ||
445 | struct list_head *t_mem_list; | ||
446 | /* Used for BIDI READ */ | ||
447 | struct list_head *t_mem_bidi_list; | ||
448 | struct list_head t_task_list; | ||
449 | } ____cacheline_aligned; | ||
450 | |||
451 | struct se_task { | ||
452 | unsigned char task_sense; | ||
453 | struct scatterlist *task_sg; | ||
454 | struct scatterlist *task_sg_bidi; | ||
455 | u8 task_scsi_status; | ||
456 | u8 task_flags; | ||
457 | int task_error_status; | ||
458 | int task_state_flags; | ||
459 | int task_padded_sg:1; | ||
460 | unsigned long long task_lba; | ||
461 | u32 task_no; | ||
462 | u32 task_sectors; | ||
463 | u32 task_size; | ||
464 | u32 task_sg_num; | ||
465 | u32 task_sg_offset; | ||
466 | enum dma_data_direction task_data_direction; | ||
467 | struct se_cmd *task_se_cmd; | ||
468 | struct se_device *se_dev; | ||
469 | struct completion task_stop_comp; | ||
470 | atomic_t task_active; | ||
471 | atomic_t task_execute_queue; | ||
472 | atomic_t task_timeout; | ||
473 | atomic_t task_sent; | ||
474 | atomic_t task_stop; | ||
475 | atomic_t task_state_active; | ||
476 | struct timer_list task_timer; | ||
477 | struct se_device *se_obj_ptr; | ||
478 | struct list_head t_list; | ||
479 | struct list_head t_execute_list; | ||
480 | struct list_head t_state_list; | ||
481 | } ____cacheline_aligned; | ||
482 | |||
483 | #define TASK_CMD(task) ((struct se_cmd *)task->task_se_cmd) | ||
484 | #define TASK_DEV(task) ((struct se_device *)task->se_dev) | ||
485 | |||
486 | struct se_cmd { | ||
487 | /* SAM response code being sent to initiator */ | ||
488 | u8 scsi_status; | ||
489 | u8 scsi_asc; | ||
490 | u8 scsi_ascq; | ||
491 | u8 scsi_sense_reason; | ||
492 | u16 scsi_sense_length; | ||
493 | /* Delay for ALUA Active/NonOptimized state access in milliseconds */ | ||
494 | int alua_nonop_delay; | ||
495 | /* See include/linux/dma-mapping.h */ | ||
496 | enum dma_data_direction data_direction; | ||
497 | /* For SAM Task Attribute */ | ||
498 | int sam_task_attr; | ||
499 | /* Transport protocol dependent state, see transport_state_table */ | ||
500 | enum transport_state_table t_state; | ||
501 | /* Transport protocol dependent state for out of order CmdSNs */ | ||
502 | int deferred_t_state; | ||
503 | /* Transport specific error status */ | ||
504 | int transport_error_status; | ||
505 | /* See se_cmd_flags_table */ | ||
506 | u32 se_cmd_flags; | ||
507 | u32 se_ordered_id; | ||
508 | /* Total size in bytes associated with command */ | ||
509 | u32 data_length; | ||
510 | /* SCSI Presented Data Transfer Length */ | ||
511 | u32 cmd_spdtl; | ||
512 | u32 residual_count; | ||
513 | u32 orig_fe_lun; | ||
514 | /* Persistent Reservation key */ | ||
515 | u64 pr_res_key; | ||
516 | atomic_t transport_sent; | ||
517 | /* Used for sense data */ | ||
518 | void *sense_buffer; | ||
519 | struct list_head se_delayed_list; | ||
520 | struct list_head se_ordered_list; | ||
521 | struct list_head se_lun_list; | ||
522 | struct se_device *se_dev; | ||
523 | struct se_dev_entry *se_deve; | ||
524 | struct se_device *se_obj_ptr; | ||
525 | struct se_device *se_orig_obj_ptr; | ||
526 | struct se_lun *se_lun; | ||
527 | /* Only used for internal passthrough and legacy TCM fabric modules */ | ||
528 | struct se_session *se_sess; | ||
529 | struct se_tmr_req *se_tmr_req; | ||
530 | /* t_task is setup to t_task_backstore in transport_init_se_cmd() */ | ||
531 | struct se_transport_task *t_task; | ||
532 | struct se_transport_task t_task_backstore; | ||
533 | struct target_core_fabric_ops *se_tfo; | ||
534 | int (*transport_emulate_cdb)(struct se_cmd *); | ||
535 | void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); | ||
536 | void (*transport_wait_for_tasks)(struct se_cmd *, int, int); | ||
537 | void (*transport_complete_callback)(struct se_cmd *); | ||
538 | } ____cacheline_aligned; | ||
539 | |||
540 | #define T_TASK(cmd) ((struct se_transport_task *)(cmd->t_task)) | ||
541 | #define CMD_TFO(cmd) ((struct target_core_fabric_ops *)cmd->se_tfo) | ||
542 | |||
543 | struct se_tmr_req { | ||
544 | /* Task Management function to be preformed */ | ||
545 | u8 function; | ||
546 | /* Task Management response to send */ | ||
547 | u8 response; | ||
548 | int call_transport; | ||
549 | /* Reference to ITT that Task Mgmt should be preformed */ | ||
550 | u32 ref_task_tag; | ||
551 | /* 64-bit encoded SAM LUN from $FABRIC_MOD TMR header */ | ||
552 | u64 ref_task_lun; | ||
553 | void *fabric_tmr_ptr; | ||
554 | struct se_cmd *task_cmd; | ||
555 | struct se_cmd *ref_cmd; | ||
556 | struct se_device *tmr_dev; | ||
557 | struct se_lun *tmr_lun; | ||
558 | struct list_head tmr_list; | ||
559 | } ____cacheline_aligned; | ||
560 | |||
561 | struct se_ua { | ||
562 | u8 ua_asc; | ||
563 | u8 ua_ascq; | ||
564 | struct se_node_acl *ua_nacl; | ||
565 | struct list_head ua_dev_list; | ||
566 | struct list_head ua_nacl_list; | ||
567 | } ____cacheline_aligned; | ||
568 | |||
569 | struct se_node_acl { | ||
570 | char initiatorname[TRANSPORT_IQN_LEN]; | ||
571 | /* Used to signal demo mode created ACL, disabled by default */ | ||
572 | int dynamic_node_acl:1; | ||
573 | u32 queue_depth; | ||
574 | u32 acl_index; | ||
575 | u64 num_cmds; | ||
576 | u64 read_bytes; | ||
577 | u64 write_bytes; | ||
578 | spinlock_t stats_lock; | ||
579 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
580 | atomic_t acl_pr_ref_count; | ||
581 | /* Used for MIB access */ | ||
582 | atomic_t mib_ref_count; | ||
583 | struct se_dev_entry *device_list; | ||
584 | struct se_session *nacl_sess; | ||
585 | struct se_portal_group *se_tpg; | ||
586 | spinlock_t device_list_lock; | ||
587 | spinlock_t nacl_sess_lock; | ||
588 | struct config_group acl_group; | ||
589 | struct config_group acl_attrib_group; | ||
590 | struct config_group acl_auth_group; | ||
591 | struct config_group acl_param_group; | ||
592 | struct config_group *acl_default_groups[4]; | ||
593 | struct list_head acl_list; | ||
594 | struct list_head acl_sess_list; | ||
595 | } ____cacheline_aligned; | ||
596 | |||
597 | struct se_session { | ||
598 | /* Used for MIB access */ | ||
599 | atomic_t mib_ref_count; | ||
600 | u64 sess_bin_isid; | ||
601 | struct se_node_acl *se_node_acl; | ||
602 | struct se_portal_group *se_tpg; | ||
603 | void *fabric_sess_ptr; | ||
604 | struct list_head sess_list; | ||
605 | struct list_head sess_acl_list; | ||
606 | } ____cacheline_aligned; | ||
607 | |||
608 | #define SE_SESS(cmd) ((struct se_session *)(cmd)->se_sess) | ||
609 | #define SE_NODE_ACL(sess) ((struct se_node_acl *)(sess)->se_node_acl) | ||
610 | |||
611 | struct se_device; | ||
612 | struct se_transform_info; | ||
613 | struct scatterlist; | ||
614 | |||
615 | struct se_lun_acl { | ||
616 | char initiatorname[TRANSPORT_IQN_LEN]; | ||
617 | u32 mapped_lun; | ||
618 | struct se_node_acl *se_lun_nacl; | ||
619 | struct se_lun *se_lun; | ||
620 | struct list_head lacl_list; | ||
621 | struct config_group se_lun_group; | ||
622 | } ____cacheline_aligned; | ||
623 | |||
624 | struct se_dev_entry { | ||
625 | int def_pr_registered:1; | ||
626 | /* See transport_lunflags_table */ | ||
627 | u32 lun_flags; | ||
628 | u32 deve_cmds; | ||
629 | u32 mapped_lun; | ||
630 | u32 average_bytes; | ||
631 | u32 last_byte_count; | ||
632 | u32 total_cmds; | ||
633 | u32 total_bytes; | ||
634 | u64 pr_res_key; | ||
635 | u64 creation_time; | ||
636 | u32 attach_count; | ||
637 | u64 read_bytes; | ||
638 | u64 write_bytes; | ||
639 | atomic_t ua_count; | ||
640 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
641 | atomic_t pr_ref_count; | ||
642 | struct se_lun_acl *se_lun_acl; | ||
643 | spinlock_t ua_lock; | ||
644 | struct se_lun *se_lun; | ||
645 | struct list_head alua_port_list; | ||
646 | struct list_head ua_list; | ||
647 | } ____cacheline_aligned; | ||
648 | |||
649 | struct se_dev_limits { | ||
650 | /* Max supported HW queue depth */ | ||
651 | u32 hw_queue_depth; | ||
652 | /* Max supported virtual queue depth */ | ||
653 | u32 queue_depth; | ||
654 | /* From include/linux/blkdev.h for the other HW/SW limits. */ | ||
655 | struct queue_limits limits; | ||
656 | } ____cacheline_aligned; | ||
657 | |||
658 | struct se_dev_attrib { | ||
659 | int emulate_dpo; | ||
660 | int emulate_fua_write; | ||
661 | int emulate_fua_read; | ||
662 | int emulate_write_cache; | ||
663 | int emulate_ua_intlck_ctrl; | ||
664 | int emulate_tas; | ||
665 | int emulate_tpu; | ||
666 | int emulate_tpws; | ||
667 | int emulate_reservations; | ||
668 | int emulate_alua; | ||
669 | int enforce_pr_isids; | ||
670 | u32 hw_block_size; | ||
671 | u32 block_size; | ||
672 | u32 hw_max_sectors; | ||
673 | u32 max_sectors; | ||
674 | u32 optimal_sectors; | ||
675 | u32 hw_queue_depth; | ||
676 | u32 queue_depth; | ||
677 | u32 task_timeout; | ||
678 | u32 max_unmap_lba_count; | ||
679 | u32 max_unmap_block_desc_count; | ||
680 | u32 unmap_granularity; | ||
681 | u32 unmap_granularity_alignment; | ||
682 | struct se_subsystem_dev *da_sub_dev; | ||
683 | struct config_group da_group; | ||
684 | } ____cacheline_aligned; | ||
685 | |||
686 | struct se_subsystem_dev { | ||
687 | /* Used for struct se_subsystem_dev-->se_dev_alias, must be less than PAGE_SIZE */ | ||
688 | #define SE_DEV_ALIAS_LEN 512 | ||
689 | unsigned char se_dev_alias[SE_DEV_ALIAS_LEN]; | ||
690 | /* Used for struct se_subsystem_dev->se_dev_udev_path[], must be less than PAGE_SIZE */ | ||
691 | #define SE_UDEV_PATH_LEN 512 | ||
692 | unsigned char se_dev_udev_path[SE_UDEV_PATH_LEN]; | ||
693 | u32 su_dev_flags; | ||
694 | struct se_hba *se_dev_hba; | ||
695 | struct se_device *se_dev_ptr; | ||
696 | struct se_dev_attrib se_dev_attrib; | ||
697 | /* T10 Asymmetric Logical Unit Assignment for Target Ports */ | ||
698 | struct t10_alua t10_alua; | ||
699 | /* T10 Inquiry and VPD WWN Information */ | ||
700 | struct t10_wwn t10_wwn; | ||
701 | /* T10 SPC-2 + SPC-3 Reservations */ | ||
702 | struct t10_reservation_template t10_reservation; | ||
703 | spinlock_t se_dev_lock; | ||
704 | void *se_dev_su_ptr; | ||
705 | struct list_head g_se_dev_list; | ||
706 | struct config_group se_dev_group; | ||
707 | /* For T10 Reservations */ | ||
708 | struct config_group se_dev_pr_group; | ||
709 | } ____cacheline_aligned; | ||
710 | |||
711 | #define T10_ALUA(su_dev) (&(su_dev)->t10_alua) | ||
712 | #define T10_RES(su_dev) (&(su_dev)->t10_reservation) | ||
713 | #define T10_PR_OPS(su_dev) (&(su_dev)->t10_reservation.pr_ops) | ||
714 | |||
715 | struct se_device { | ||
716 | /* Set to 1 if thread is NOT sleeping on thread_sem */ | ||
717 | u8 thread_active; | ||
718 | u8 dev_status_timer_flags; | ||
719 | /* RELATIVE TARGET PORT IDENTIFER Counter */ | ||
720 | u16 dev_rpti_counter; | ||
721 | /* Used for SAM Task Attribute ordering */ | ||
722 | u32 dev_cur_ordered_id; | ||
723 | u32 dev_flags; | ||
724 | u32 dev_port_count; | ||
725 | /* See transport_device_status_table */ | ||
726 | u32 dev_status; | ||
727 | u32 dev_tcq_window_closed; | ||
728 | /* Physical device queue depth */ | ||
729 | u32 queue_depth; | ||
730 | /* Used for SPC-2 reservations enforce of ISIDs */ | ||
731 | u64 dev_res_bin_isid; | ||
732 | t10_task_attr_index_t dev_task_attr_type; | ||
733 | /* Pointer to transport specific device structure */ | ||
734 | void *dev_ptr; | ||
735 | u32 dev_index; | ||
736 | u64 creation_time; | ||
737 | u32 num_resets; | ||
738 | u64 num_cmds; | ||
739 | u64 read_bytes; | ||
740 | u64 write_bytes; | ||
741 | spinlock_t stats_lock; | ||
742 | /* Active commands on this virtual SE device */ | ||
743 | atomic_t active_cmds; | ||
744 | atomic_t simple_cmds; | ||
745 | atomic_t depth_left; | ||
746 | atomic_t dev_ordered_id; | ||
747 | atomic_t dev_tur_active; | ||
748 | atomic_t execute_tasks; | ||
749 | atomic_t dev_status_thr_count; | ||
750 | atomic_t dev_hoq_count; | ||
751 | atomic_t dev_ordered_sync; | ||
752 | struct se_obj dev_obj; | ||
753 | struct se_obj dev_access_obj; | ||
754 | struct se_obj dev_export_obj; | ||
755 | struct se_queue_obj *dev_queue_obj; | ||
756 | struct se_queue_obj *dev_status_queue_obj; | ||
757 | spinlock_t delayed_cmd_lock; | ||
758 | spinlock_t ordered_cmd_lock; | ||
759 | spinlock_t execute_task_lock; | ||
760 | spinlock_t state_task_lock; | ||
761 | spinlock_t dev_alua_lock; | ||
762 | spinlock_t dev_reservation_lock; | ||
763 | spinlock_t dev_state_lock; | ||
764 | spinlock_t dev_status_lock; | ||
765 | spinlock_t dev_status_thr_lock; | ||
766 | spinlock_t se_port_lock; | ||
767 | spinlock_t se_tmr_lock; | ||
768 | /* Used for legacy SPC-2 reservationsa */ | ||
769 | struct se_node_acl *dev_reserved_node_acl; | ||
770 | /* Used for ALUA Logical Unit Group membership */ | ||
771 | struct t10_alua_lu_gp_member *dev_alua_lu_gp_mem; | ||
772 | /* Used for SPC-3 Persistent Reservations */ | ||
773 | struct t10_pr_registration *dev_pr_res_holder; | ||
774 | struct list_head dev_sep_list; | ||
775 | struct list_head dev_tmr_list; | ||
776 | struct timer_list dev_status_timer; | ||
777 | /* Pointer to descriptor for processing thread */ | ||
778 | struct task_struct *process_thread; | ||
779 | pid_t process_thread_pid; | ||
780 | struct task_struct *dev_mgmt_thread; | ||
781 | struct list_head delayed_cmd_list; | ||
782 | struct list_head ordered_cmd_list; | ||
783 | struct list_head execute_task_list; | ||
784 | struct list_head state_task_list; | ||
785 | /* Pointer to associated SE HBA */ | ||
786 | struct se_hba *se_hba; | ||
787 | struct se_subsystem_dev *se_sub_dev; | ||
788 | /* Pointer to template of function pointers for transport */ | ||
789 | struct se_subsystem_api *transport; | ||
790 | /* Linked list for struct se_hba struct se_device list */ | ||
791 | struct list_head dev_list; | ||
792 | /* Linked list for struct se_global->g_se_dev_list */ | ||
793 | struct list_head g_se_dev_list; | ||
794 | } ____cacheline_aligned; | ||
795 | |||
796 | #define SE_DEV(cmd) ((struct se_device *)(cmd)->se_lun->lun_se_dev) | ||
797 | #define SU_DEV(dev) ((struct se_subsystem_dev *)(dev)->se_sub_dev) | ||
798 | #define DEV_ATTRIB(dev) (&(dev)->se_sub_dev->se_dev_attrib) | ||
799 | #define DEV_T10_WWN(dev) (&(dev)->se_sub_dev->t10_wwn) | ||
800 | |||
801 | struct se_hba { | ||
802 | u16 hba_tpgt; | ||
803 | u32 hba_id; | ||
804 | /* See hba_flags_table */ | ||
805 | u32 hba_flags; | ||
806 | /* Virtual iSCSI devices attached. */ | ||
807 | u32 dev_count; | ||
808 | u32 hba_index; | ||
809 | atomic_t dev_mib_access_count; | ||
810 | atomic_t load_balance_queue; | ||
811 | atomic_t left_queue_depth; | ||
812 | /* Maximum queue depth the HBA can handle. */ | ||
813 | atomic_t max_queue_depth; | ||
814 | /* Pointer to transport specific host structure. */ | ||
815 | void *hba_ptr; | ||
816 | /* Linked list for struct se_device */ | ||
817 | struct list_head hba_dev_list; | ||
818 | struct list_head hba_list; | ||
819 | spinlock_t device_lock; | ||
820 | spinlock_t hba_queue_lock; | ||
821 | struct config_group hba_group; | ||
822 | struct mutex hba_access_mutex; | ||
823 | struct se_subsystem_api *transport; | ||
824 | } ____cacheline_aligned; | ||
825 | |||
826 | #define SE_HBA(d) ((struct se_hba *)(d)->se_hba) | ||
827 | |||
828 | struct se_lun { | ||
829 | /* See transport_lun_status_table */ | ||
830 | enum transport_lun_status_table lun_status; | ||
831 | u32 lun_access; | ||
832 | u32 lun_flags; | ||
833 | u32 unpacked_lun; | ||
834 | atomic_t lun_acl_count; | ||
835 | spinlock_t lun_acl_lock; | ||
836 | spinlock_t lun_cmd_lock; | ||
837 | spinlock_t lun_sep_lock; | ||
838 | struct completion lun_shutdown_comp; | ||
839 | struct list_head lun_cmd_list; | ||
840 | struct list_head lun_acl_list; | ||
841 | struct se_device *lun_se_dev; | ||
842 | struct config_group lun_group; | ||
843 | struct se_port *lun_sep; | ||
844 | } ____cacheline_aligned; | ||
845 | |||
846 | #define SE_LUN(c) ((struct se_lun *)(c)->se_lun) | ||
847 | |||
848 | struct se_port { | ||
849 | /* RELATIVE TARGET PORT IDENTIFER */ | ||
850 | u16 sep_rtpi; | ||
851 | int sep_tg_pt_secondary_stat; | ||
852 | int sep_tg_pt_secondary_write_md; | ||
853 | u32 sep_index; | ||
854 | struct scsi_port_stats sep_stats; | ||
855 | /* Used for ALUA Target Port Groups membership */ | ||
856 | atomic_t sep_tg_pt_gp_active; | ||
857 | atomic_t sep_tg_pt_secondary_offline; | ||
858 | /* Used for PR ALL_TG_PT=1 */ | ||
859 | atomic_t sep_tg_pt_ref_cnt; | ||
860 | spinlock_t sep_alua_lock; | ||
861 | struct mutex sep_tg_pt_md_mutex; | ||
862 | struct t10_alua_tg_pt_gp_member *sep_alua_tg_pt_gp_mem; | ||
863 | struct se_lun *sep_lun; | ||
864 | struct se_portal_group *sep_tpg; | ||
865 | struct list_head sep_alua_list; | ||
866 | struct list_head sep_list; | ||
867 | } ____cacheline_aligned; | ||
868 | |||
869 | struct se_tpg_np { | ||
870 | struct config_group tpg_np_group; | ||
871 | } ____cacheline_aligned; | ||
872 | |||
873 | struct se_portal_group { | ||
874 | /* Type of target portal group, see transport_tpg_type_table */ | ||
875 | enum transport_tpg_type_table se_tpg_type; | ||
876 | /* Number of ACLed Initiator Nodes for this TPG */ | ||
877 | u32 num_node_acls; | ||
878 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
879 | atomic_t tpg_pr_ref_count; | ||
880 | /* Spinlock for adding/removing ACLed Nodes */ | ||
881 | spinlock_t acl_node_lock; | ||
882 | /* Spinlock for adding/removing sessions */ | ||
883 | spinlock_t session_lock; | ||
884 | spinlock_t tpg_lun_lock; | ||
885 | /* Pointer to $FABRIC_MOD portal group */ | ||
886 | void *se_tpg_fabric_ptr; | ||
887 | struct list_head se_tpg_list; | ||
888 | /* linked list for initiator ACL list */ | ||
889 | struct list_head acl_node_list; | ||
890 | struct se_lun *tpg_lun_list; | ||
891 | struct se_lun tpg_virt_lun0; | ||
892 | /* List of TCM sessions assoicated wth this TPG */ | ||
893 | struct list_head tpg_sess_list; | ||
894 | /* Pointer to $FABRIC_MOD dependent code */ | ||
895 | struct target_core_fabric_ops *se_tpg_tfo; | ||
896 | struct se_wwn *se_tpg_wwn; | ||
897 | struct config_group tpg_group; | ||
898 | struct config_group *tpg_default_groups[6]; | ||
899 | struct config_group tpg_lun_group; | ||
900 | struct config_group tpg_np_group; | ||
901 | struct config_group tpg_acl_group; | ||
902 | struct config_group tpg_attrib_group; | ||
903 | struct config_group tpg_param_group; | ||
904 | } ____cacheline_aligned; | ||
905 | |||
906 | #define TPG_TFO(se_tpg) ((struct target_core_fabric_ops *)(se_tpg)->se_tpg_tfo) | ||
907 | |||
908 | struct se_wwn { | ||
909 | struct target_fabric_configfs *wwn_tf; | ||
910 | struct config_group wwn_group; | ||
911 | } ____cacheline_aligned; | ||
912 | |||
913 | struct se_global { | ||
914 | u16 alua_lu_gps_counter; | ||
915 | int g_sub_api_initialized; | ||
916 | u32 in_shutdown; | ||
917 | u32 alua_lu_gps_count; | ||
918 | u32 g_hba_id_counter; | ||
919 | struct config_group target_core_hbagroup; | ||
920 | struct config_group alua_group; | ||
921 | struct config_group alua_lu_gps_group; | ||
922 | struct list_head g_lu_gps_list; | ||
923 | struct list_head g_se_tpg_list; | ||
924 | struct list_head g_hba_list; | ||
925 | struct list_head g_se_dev_list; | ||
926 | struct se_hba *g_lun0_hba; | ||
927 | struct se_subsystem_dev *g_lun0_su_dev; | ||
928 | struct se_device *g_lun0_dev; | ||
929 | struct t10_alua_lu_gp *default_lu_gp; | ||
930 | spinlock_t g_device_lock; | ||
931 | spinlock_t hba_lock; | ||
932 | spinlock_t se_tpg_lock; | ||
933 | spinlock_t lu_gps_lock; | ||
934 | spinlock_t plugin_class_lock; | ||
935 | } ____cacheline_aligned; | ||
936 | |||
937 | #endif /* TARGET_CORE_BASE_H */ | ||
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h new file mode 100644 index 000000000000..40e6e740527c --- /dev/null +++ b/include/target/target_core_configfs.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #define TARGET_CORE_CONFIGFS_VERSION TARGET_CORE_MOD_VERSION | ||
2 | |||
3 | #define TARGET_CORE_CONFIG_ROOT "/sys/kernel/config" | ||
4 | |||
5 | #define TARGET_CORE_NAME_MAX_LEN 64 | ||
6 | #define TARGET_FABRIC_NAME_SIZE 32 | ||
7 | |||
8 | extern struct target_fabric_configfs *target_fabric_configfs_init( | ||
9 | struct module *, const char *); | ||
10 | extern void target_fabric_configfs_free(struct target_fabric_configfs *); | ||
11 | extern int target_fabric_configfs_register(struct target_fabric_configfs *); | ||
12 | extern void target_fabric_configfs_deregister(struct target_fabric_configfs *); | ||
13 | |||
14 | struct target_fabric_configfs_template { | ||
15 | struct config_item_type tfc_discovery_cit; | ||
16 | struct config_item_type tfc_wwn_cit; | ||
17 | struct config_item_type tfc_tpg_cit; | ||
18 | struct config_item_type tfc_tpg_base_cit; | ||
19 | struct config_item_type tfc_tpg_lun_cit; | ||
20 | struct config_item_type tfc_tpg_port_cit; | ||
21 | struct config_item_type tfc_tpg_np_cit; | ||
22 | struct config_item_type tfc_tpg_np_base_cit; | ||
23 | struct config_item_type tfc_tpg_attrib_cit; | ||
24 | struct config_item_type tfc_tpg_param_cit; | ||
25 | struct config_item_type tfc_tpg_nacl_cit; | ||
26 | struct config_item_type tfc_tpg_nacl_base_cit; | ||
27 | struct config_item_type tfc_tpg_nacl_attrib_cit; | ||
28 | struct config_item_type tfc_tpg_nacl_auth_cit; | ||
29 | struct config_item_type tfc_tpg_nacl_param_cit; | ||
30 | struct config_item_type tfc_tpg_mappedlun_cit; | ||
31 | }; | ||
32 | |||
33 | struct target_fabric_configfs { | ||
34 | char tf_name[TARGET_FABRIC_NAME_SIZE]; | ||
35 | atomic_t tf_access_cnt; | ||
36 | struct list_head tf_list; | ||
37 | struct config_group tf_group; | ||
38 | struct config_group tf_disc_group; | ||
39 | struct config_group *tf_default_groups[2]; | ||
40 | /* Pointer to fabric's config_item */ | ||
41 | struct config_item *tf_fabric; | ||
42 | /* Passed from fabric modules */ | ||
43 | struct config_item_type *tf_fabric_cit; | ||
44 | /* Pointer to target core subsystem */ | ||
45 | struct configfs_subsystem *tf_subsys; | ||
46 | /* Pointer to fabric's struct module */ | ||
47 | struct module *tf_module; | ||
48 | struct target_core_fabric_ops tf_ops; | ||
49 | struct target_fabric_configfs_template tf_cit_tmpl; | ||
50 | }; | ||
51 | |||
52 | #define TF_CIT_TMPL(tf) (&(tf)->tf_cit_tmpl) | ||
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h new file mode 100644 index 000000000000..52b18a5752c9 --- /dev/null +++ b/include/target/target_core_device.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #ifndef TARGET_CORE_DEVICE_H | ||
2 | #define TARGET_CORE_DEVICE_H | ||
3 | |||
4 | extern int transport_get_lun_for_cmd(struct se_cmd *, unsigned char *, u32); | ||
5 | extern int transport_get_lun_for_tmr(struct se_cmd *, u32); | ||
6 | extern struct se_dev_entry *core_get_se_deve_from_rtpi( | ||
7 | struct se_node_acl *, u16); | ||
8 | extern int core_free_device_list_for_node(struct se_node_acl *, | ||
9 | struct se_portal_group *); | ||
10 | extern void core_dec_lacl_count(struct se_node_acl *, struct se_cmd *); | ||
11 | extern void core_update_device_list_access(u32, u32, struct se_node_acl *); | ||
12 | extern int core_update_device_list_for_node(struct se_lun *, struct se_lun_acl *, u32, | ||
13 | u32, struct se_node_acl *, | ||
14 | struct se_portal_group *, int); | ||
15 | extern void core_clear_lun_from_tpg(struct se_lun *, struct se_portal_group *); | ||
16 | extern int core_dev_export(struct se_device *, struct se_portal_group *, | ||
17 | struct se_lun *); | ||
18 | extern void core_dev_unexport(struct se_device *, struct se_portal_group *, | ||
19 | struct se_lun *); | ||
20 | extern int transport_core_report_lun_response(struct se_cmd *); | ||
21 | extern void se_release_device_for_hba(struct se_device *); | ||
22 | extern void se_release_vpd_for_dev(struct se_device *); | ||
23 | extern void se_clear_dev_ports(struct se_device *); | ||
24 | extern int se_free_virtual_device(struct se_device *, struct se_hba *); | ||
25 | extern int se_dev_check_online(struct se_device *); | ||
26 | extern int se_dev_check_shutdown(struct se_device *); | ||
27 | extern void se_dev_set_default_attribs(struct se_device *, struct se_dev_limits *); | ||
28 | extern int se_dev_set_task_timeout(struct se_device *, u32); | ||
29 | extern int se_dev_set_max_unmap_lba_count(struct se_device *, u32); | ||
30 | extern int se_dev_set_max_unmap_block_desc_count(struct se_device *, u32); | ||
31 | extern int se_dev_set_unmap_granularity(struct se_device *, u32); | ||
32 | extern int se_dev_set_unmap_granularity_alignment(struct se_device *, u32); | ||
33 | extern int se_dev_set_emulate_dpo(struct se_device *, int); | ||
34 | extern int se_dev_set_emulate_fua_write(struct se_device *, int); | ||
35 | extern int se_dev_set_emulate_fua_read(struct se_device *, int); | ||
36 | extern int se_dev_set_emulate_write_cache(struct se_device *, int); | ||
37 | extern int se_dev_set_emulate_ua_intlck_ctrl(struct se_device *, int); | ||
38 | extern int se_dev_set_emulate_tas(struct se_device *, int); | ||
39 | extern int se_dev_set_emulate_tpu(struct se_device *, int); | ||
40 | extern int se_dev_set_emulate_tpws(struct se_device *, int); | ||
41 | extern int se_dev_set_enforce_pr_isids(struct se_device *, int); | ||
42 | extern int se_dev_set_queue_depth(struct se_device *, u32); | ||
43 | extern int se_dev_set_max_sectors(struct se_device *, u32); | ||
44 | extern int se_dev_set_optimal_sectors(struct se_device *, u32); | ||
45 | extern int se_dev_set_block_size(struct se_device *, u32); | ||
46 | extern struct se_lun *core_dev_add_lun(struct se_portal_group *, struct se_hba *, | ||
47 | struct se_device *, u32); | ||
48 | extern int core_dev_del_lun(struct se_portal_group *, u32); | ||
49 | extern struct se_lun *core_get_lun_from_tpg(struct se_portal_group *, u32); | ||
50 | extern struct se_lun_acl *core_dev_init_initiator_node_lun_acl(struct se_portal_group *, | ||
51 | u32, char *, int *); | ||
52 | extern int core_dev_add_initiator_node_lun_acl(struct se_portal_group *, | ||
53 | struct se_lun_acl *, u32, u32); | ||
54 | extern int core_dev_del_initiator_node_lun_acl(struct se_portal_group *, | ||
55 | struct se_lun *, struct se_lun_acl *); | ||
56 | extern void core_dev_free_initiator_node_lun_acl(struct se_portal_group *, | ||
57 | struct se_lun_acl *lacl); | ||
58 | extern int core_dev_setup_virtual_lun0(void); | ||
59 | extern void core_dev_release_virtual_lun0(void); | ||
60 | |||
61 | #endif /* TARGET_CORE_DEVICE_H */ | ||
diff --git a/include/target/target_core_fabric_configfs.h b/include/target/target_core_fabric_configfs.h new file mode 100644 index 000000000000..a26fb7586a09 --- /dev/null +++ b/include/target/target_core_fabric_configfs.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * Used for tfc_wwn_cit attributes | ||
3 | */ | ||
4 | |||
5 | #include <target/configfs_macros.h> | ||
6 | |||
7 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_attrib, se_node_acl); | ||
8 | #define TF_NACL_ATTRIB_ATTR(_fabric, _name, _mode) \ | ||
9 | static struct target_fabric_nacl_attrib_attribute _fabric##_nacl_attrib_##_name = \ | ||
10 | __CONFIGFS_EATTR(_name, _mode, \ | ||
11 | _fabric##_nacl_attrib_show_##_name, \ | ||
12 | _fabric##_nacl_attrib_store_##_name); | ||
13 | |||
14 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_auth, se_node_acl); | ||
15 | #define TF_NACL_AUTH_ATTR(_fabric, _name, _mode) \ | ||
16 | static struct target_fabric_nacl_auth_attribute _fabric##_nacl_auth_##_name = \ | ||
17 | __CONFIGFS_EATTR(_name, _mode, \ | ||
18 | _fabric##_nacl_auth_show_##_name, \ | ||
19 | _fabric##_nacl_auth_store_##_name); | ||
20 | |||
21 | #define TF_NACL_AUTH_ATTR_RO(_fabric, _name) \ | ||
22 | static struct target_fabric_nacl_auth_attribute _fabric##_nacl_auth_##_name = \ | ||
23 | __CONFIGFS_EATTR_RO(_name, \ | ||
24 | _fabric##_nacl_auth_show_##_name); | ||
25 | |||
26 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_param, se_node_acl); | ||
27 | #define TF_NACL_PARAM_ATTR(_fabric, _name, _mode) \ | ||
28 | static struct target_fabric_nacl_param_attribute _fabric##_nacl_param_##_name = \ | ||
29 | __CONFIGFS_EATTR(_name, _mode, \ | ||
30 | _fabric##_nacl_param_show_##_name, \ | ||
31 | _fabric##_nacl_param_store_##_name); | ||
32 | |||
33 | #define TF_NACL_PARAM_ATTR_RO(_fabric, _name) \ | ||
34 | static struct target_fabric_nacl_param_attribute _fabric##_nacl_param_##_name = \ | ||
35 | __CONFIGFS_EATTR_RO(_name, \ | ||
36 | _fabric##_nacl_param_show_##_name); | ||
37 | |||
38 | |||
39 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_base, se_node_acl); | ||
40 | #define TF_NACL_BASE_ATTR(_fabric, _name, _mode) \ | ||
41 | static struct target_fabric_nacl_base_attribute _fabric##_nacl_##_name = \ | ||
42 | __CONFIGFS_EATTR(_name, _mode, \ | ||
43 | _fabric##_nacl_show_##_name, \ | ||
44 | _fabric##_nacl_store_##_name); | ||
45 | |||
46 | #define TF_NACL_BASE_ATTR_RO(_fabric, _name) \ | ||
47 | static struct target_fabric_nacl_base_attribute _fabric##_nacl_##_name = \ | ||
48 | __CONFIGFS_EATTR_RO(_name, \ | ||
49 | _fabric##_nacl_show_##_name); | ||
50 | |||
51 | CONFIGFS_EATTR_STRUCT(target_fabric_np_base, se_tpg_np); | ||
52 | #define TF_NP_BASE_ATTR(_fabric, _name, _mode) \ | ||
53 | static struct target_fabric_np_base_attribute _fabric##_np_##_name = \ | ||
54 | __CONFIGFS_EATTR(_name, _mode, \ | ||
55 | _fabric##_np_show_##_name, \ | ||
56 | _fabric##_np_store_##_name); | ||
57 | |||
58 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg_attrib, se_portal_group); | ||
59 | #define TF_TPG_ATTRIB_ATTR(_fabric, _name, _mode) \ | ||
60 | static struct target_fabric_tpg_attrib_attribute _fabric##_tpg_attrib_##_name = \ | ||
61 | __CONFIGFS_EATTR(_name, _mode, \ | ||
62 | _fabric##_tpg_attrib_show_##_name, \ | ||
63 | _fabric##_tpg_attrib_store_##_name); | ||
64 | |||
65 | |||
66 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group); | ||
67 | #define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \ | ||
68 | static struct target_fabric_tpg_param_attribute _fabric##_tpg_param_##_name = \ | ||
69 | __CONFIGFS_EATTR(_name, _mode, \ | ||
70 | _fabric##_tpg_param_show_##_name, \ | ||
71 | _fabric##_tpg_param_store_##_name); | ||
72 | |||
73 | |||
74 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg, se_portal_group); | ||
75 | #define TF_TPG_BASE_ATTR(_fabric, _name, _mode) \ | ||
76 | static struct target_fabric_tpg_attribute _fabric##_tpg_##_name = \ | ||
77 | __CONFIGFS_EATTR(_name, _mode, \ | ||
78 | _fabric##_tpg_show_##_name, \ | ||
79 | _fabric##_tpg_store_##_name); | ||
80 | |||
81 | |||
82 | CONFIGFS_EATTR_STRUCT(target_fabric_wwn, target_fabric_configfs); | ||
83 | #define TF_WWN_ATTR(_fabric, _name, _mode) \ | ||
84 | static struct target_fabric_wwn_attribute _fabric##_wwn_##_name = \ | ||
85 | __CONFIGFS_EATTR(_name, _mode, \ | ||
86 | _fabric##_wwn_show_attr_##_name, \ | ||
87 | _fabric##_wwn_store_attr_##_name); | ||
88 | |||
89 | #define TF_WWN_ATTR_RO(_fabric, _name) \ | ||
90 | static struct target_fabric_wwn_attribute _fabric##_wwn_##_name = \ | ||
91 | __CONFIGFS_EATTR_RO(_name, \ | ||
92 | _fabric##_wwn_show_attr_##_name); | ||
93 | |||
94 | CONFIGFS_EATTR_STRUCT(target_fabric_discovery, target_fabric_configfs); | ||
95 | #define TF_DISC_ATTR(_fabric, _name, _mode) \ | ||
96 | static struct target_fabric_discovery_attribute _fabric##_disc_##_name = \ | ||
97 | __CONFIGFS_EATTR(_name, _mode, \ | ||
98 | _fabric##_disc_show_##_name, \ | ||
99 | _fabric##_disc_store_##_name); | ||
100 | |||
101 | #define TF_DISC_ATTR_RO(_fabric, _name) \ | ||
102 | static struct target_fabric_discovery_attribute _fabric##_disc_##_name = \ | ||
103 | __CONFIGFS_EATTR_RO(_name, \ | ||
104 | _fabric##_disc_show_##_name); | ||
105 | |||
106 | extern int target_fabric_setup_cits(struct target_fabric_configfs *); | ||
diff --git a/include/target/target_core_fabric_lib.h b/include/target/target_core_fabric_lib.h new file mode 100644 index 000000000000..c2f8d0e3a03b --- /dev/null +++ b/include/target/target_core_fabric_lib.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef TARGET_CORE_FABRIC_LIB_H | ||
2 | #define TARGET_CORE_FABRIC_LIB_H | ||
3 | |||
4 | extern u8 sas_get_fabric_proto_ident(struct se_portal_group *); | ||
5 | extern u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
6 | struct t10_pr_registration *, int *, unsigned char *); | ||
7 | extern u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
8 | struct t10_pr_registration *, int *); | ||
9 | extern char *sas_parse_pr_out_transport_id(struct se_portal_group *, | ||
10 | const char *, u32 *, char **); | ||
11 | |||
12 | extern u8 fc_get_fabric_proto_ident(struct se_portal_group *); | ||
13 | extern u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
14 | struct t10_pr_registration *, int *, unsigned char *); | ||
15 | extern u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
16 | struct t10_pr_registration *, int *); | ||
17 | extern char *fc_parse_pr_out_transport_id(struct se_portal_group *, | ||
18 | const char *, u32 *, char **); | ||
19 | |||
20 | extern u8 iscsi_get_fabric_proto_ident(struct se_portal_group *); | ||
21 | extern u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
22 | struct t10_pr_registration *, int *, unsigned char *); | ||
23 | extern u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
24 | struct t10_pr_registration *, int *); | ||
25 | extern char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, | ||
26 | const char *, u32 *, char **); | ||
27 | |||
28 | #endif /* TARGET_CORE_FABRIC_LIB_H */ | ||
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h new file mode 100644 index 000000000000..f3ac12b019c2 --- /dev/null +++ b/include/target/target_core_fabric_ops.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* Defined in target_core_configfs.h */ | ||
2 | struct target_fabric_configfs; | ||
3 | |||
4 | struct target_core_fabric_ops { | ||
5 | struct configfs_subsystem *tf_subsys; | ||
6 | /* | ||
7 | * Optional to signal struct se_task->task_sg[] padding entries | ||
8 | * for scatterlist chaining using transport_do_task_sg_link(), | ||
9 | * disabled by default | ||
10 | */ | ||
11 | int task_sg_chaining:1; | ||
12 | char *(*get_fabric_name)(void); | ||
13 | u8 (*get_fabric_proto_ident)(struct se_portal_group *); | ||
14 | char *(*tpg_get_wwn)(struct se_portal_group *); | ||
15 | u16 (*tpg_get_tag)(struct se_portal_group *); | ||
16 | u32 (*tpg_get_default_depth)(struct se_portal_group *); | ||
17 | u32 (*tpg_get_pr_transport_id)(struct se_portal_group *, | ||
18 | struct se_node_acl *, | ||
19 | struct t10_pr_registration *, int *, | ||
20 | unsigned char *); | ||
21 | u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group *, | ||
22 | struct se_node_acl *, | ||
23 | struct t10_pr_registration *, int *); | ||
24 | char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *, | ||
25 | const char *, u32 *, char **); | ||
26 | int (*tpg_check_demo_mode)(struct se_portal_group *); | ||
27 | int (*tpg_check_demo_mode_cache)(struct se_portal_group *); | ||
28 | int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); | ||
29 | int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); | ||
30 | struct se_node_acl *(*tpg_alloc_fabric_acl)( | ||
31 | struct se_portal_group *); | ||
32 | void (*tpg_release_fabric_acl)(struct se_portal_group *, | ||
33 | struct se_node_acl *); | ||
34 | u32 (*tpg_get_inst_index)(struct se_portal_group *); | ||
35 | /* | ||
36 | * Optional function pointer for TCM to perform command map | ||
37 | * from TCM processing thread context, for those struct se_cmd | ||
38 | * initally allocated in interrupt context. | ||
39 | */ | ||
40 | int (*new_cmd_map)(struct se_cmd *); | ||
41 | /* | ||
42 | * Optional function pointer for TCM fabric modules that use | ||
43 | * Linux/NET sockets to allocate struct iovec array to struct se_cmd | ||
44 | */ | ||
45 | int (*alloc_cmd_iovecs)(struct se_cmd *); | ||
46 | /* | ||
47 | * Optional to release struct se_cmd and fabric dependent allocated | ||
48 | * I/O descriptor in transport_cmd_check_stop() | ||
49 | */ | ||
50 | void (*check_stop_free)(struct se_cmd *); | ||
51 | void (*release_cmd_to_pool)(struct se_cmd *); | ||
52 | void (*release_cmd_direct)(struct se_cmd *); | ||
53 | /* | ||
54 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. | ||
55 | */ | ||
56 | int (*shutdown_session)(struct se_session *); | ||
57 | void (*close_session)(struct se_session *); | ||
58 | void (*stop_session)(struct se_session *, int, int); | ||
59 | void (*fall_back_to_erl0)(struct se_session *); | ||
60 | int (*sess_logged_in)(struct se_session *); | ||
61 | u32 (*sess_get_index)(struct se_session *); | ||
62 | /* | ||
63 | * Used only for SCSI fabrics that contain multi-value TransportIDs | ||
64 | * (like iSCSI). All other SCSI fabrics should set this to NULL. | ||
65 | */ | ||
66 | u32 (*sess_get_initiator_sid)(struct se_session *, | ||
67 | unsigned char *, u32); | ||
68 | int (*write_pending)(struct se_cmd *); | ||
69 | int (*write_pending_status)(struct se_cmd *); | ||
70 | void (*set_default_node_attributes)(struct se_node_acl *); | ||
71 | u32 (*get_task_tag)(struct se_cmd *); | ||
72 | int (*get_cmd_state)(struct se_cmd *); | ||
73 | void (*new_cmd_failure)(struct se_cmd *); | ||
74 | int (*queue_data_in)(struct se_cmd *); | ||
75 | int (*queue_status)(struct se_cmd *); | ||
76 | int (*queue_tm_rsp)(struct se_cmd *); | ||
77 | u16 (*set_fabric_sense_len)(struct se_cmd *, u32); | ||
78 | u16 (*get_fabric_sense_len)(void); | ||
79 | int (*is_state_remove)(struct se_cmd *); | ||
80 | u64 (*pack_lun)(unsigned int); | ||
81 | /* | ||
82 | * fabric module calls for target_core_fabric_configfs.c | ||
83 | */ | ||
84 | struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *, | ||
85 | struct config_group *, const char *); | ||
86 | void (*fabric_drop_wwn)(struct se_wwn *); | ||
87 | struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *, | ||
88 | struct config_group *, const char *); | ||
89 | void (*fabric_drop_tpg)(struct se_portal_group *); | ||
90 | int (*fabric_post_link)(struct se_portal_group *, | ||
91 | struct se_lun *); | ||
92 | void (*fabric_pre_unlink)(struct se_portal_group *, | ||
93 | struct se_lun *); | ||
94 | struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *, | ||
95 | struct config_group *, const char *); | ||
96 | void (*fabric_drop_np)(struct se_tpg_np *); | ||
97 | struct se_node_acl *(*fabric_make_nodeacl)(struct se_portal_group *, | ||
98 | struct config_group *, const char *); | ||
99 | void (*fabric_drop_nodeacl)(struct se_node_acl *); | ||
100 | }; | ||
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h new file mode 100644 index 000000000000..6c8248bc2c66 --- /dev/null +++ b/include/target/target_core_tmr.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef TARGET_CORE_TMR_H | ||
2 | #define TARGET_CORE_TMR_H | ||
3 | |||
4 | /* task management function values */ | ||
5 | #ifdef ABORT_TASK | ||
6 | #undef ABORT_TASK | ||
7 | #endif /* ABORT_TASK */ | ||
8 | #define ABORT_TASK 1 | ||
9 | #ifdef ABORT_TASK_SET | ||
10 | #undef ABORT_TASK_SET | ||
11 | #endif /* ABORT_TASK_SET */ | ||
12 | #define ABORT_TASK_SET 2 | ||
13 | #ifdef CLEAR_ACA | ||
14 | #undef CLEAR_ACA | ||
15 | #endif /* CLEAR_ACA */ | ||
16 | #define CLEAR_ACA 3 | ||
17 | #ifdef CLEAR_TASK_SET | ||
18 | #undef CLEAR_TASK_SET | ||
19 | #endif /* CLEAR_TASK_SET */ | ||
20 | #define CLEAR_TASK_SET 4 | ||
21 | #define LUN_RESET 5 | ||
22 | #define TARGET_WARM_RESET 6 | ||
23 | #define TARGET_COLD_RESET 7 | ||
24 | #define TASK_REASSIGN 8 | ||
25 | |||
26 | /* task management response values */ | ||
27 | #define TMR_FUNCTION_COMPLETE 0 | ||
28 | #define TMR_TASK_DOES_NOT_EXIST 1 | ||
29 | #define TMR_LUN_DOES_NOT_EXIST 2 | ||
30 | #define TMR_TASK_STILL_ALLEGIANT 3 | ||
31 | #define TMR_TASK_FAILOVER_NOT_SUPPORTED 4 | ||
32 | #define TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED 5 | ||
33 | #define TMR_FUNCTION_AUTHORIZATION_FAILED 6 | ||
34 | #define TMR_FUNCTION_REJECTED 255 | ||
35 | |||
36 | extern struct kmem_cache *se_tmr_req_cache; | ||
37 | |||
38 | extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8); | ||
39 | extern void core_tmr_release_req(struct se_tmr_req *); | ||
40 | extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *, | ||
41 | struct list_head *, struct se_cmd *); | ||
42 | |||
43 | #endif /* TARGET_CORE_TMR_H */ | ||
diff --git a/include/target/target_core_tpg.h b/include/target/target_core_tpg.h new file mode 100644 index 000000000000..77e18729c4c1 --- /dev/null +++ b/include/target/target_core_tpg.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef TARGET_CORE_TPG_H | ||
2 | #define TARGET_CORE_TPG_H | ||
3 | |||
4 | extern struct se_node_acl *__core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, | ||
5 | const char *); | ||
6 | extern struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, | ||
7 | unsigned char *); | ||
8 | extern void core_tpg_add_node_to_devs(struct se_node_acl *, | ||
9 | struct se_portal_group *); | ||
10 | extern struct se_node_acl *core_tpg_check_initiator_node_acl( | ||
11 | struct se_portal_group *, | ||
12 | unsigned char *); | ||
13 | extern void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *); | ||
14 | extern void core_tpg_wait_for_mib_ref(struct se_node_acl *); | ||
15 | extern void core_tpg_clear_object_luns(struct se_portal_group *); | ||
16 | extern struct se_node_acl *core_tpg_add_initiator_node_acl( | ||
17 | struct se_portal_group *, | ||
18 | struct se_node_acl *, | ||
19 | const char *, u32); | ||
20 | extern int core_tpg_del_initiator_node_acl(struct se_portal_group *, | ||
21 | struct se_node_acl *, int); | ||
22 | extern int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *, | ||
23 | unsigned char *, u32, int); | ||
24 | extern int core_tpg_register(struct target_core_fabric_ops *, | ||
25 | struct se_wwn *, | ||
26 | struct se_portal_group *, void *, | ||
27 | int); | ||
28 | extern int core_tpg_deregister(struct se_portal_group *); | ||
29 | extern struct se_lun *core_tpg_pre_addlun(struct se_portal_group *, u32); | ||
30 | extern int core_tpg_post_addlun(struct se_portal_group *, struct se_lun *, u32, | ||
31 | void *); | ||
32 | extern struct se_lun *core_tpg_pre_dellun(struct se_portal_group *, u32, int *); | ||
33 | extern int core_tpg_post_dellun(struct se_portal_group *, struct se_lun *); | ||
34 | |||
35 | #endif /* TARGET_CORE_TPG_H */ | ||
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h new file mode 100644 index 000000000000..66f44e56eb80 --- /dev/null +++ b/include/target/target_core_transport.h | |||
@@ -0,0 +1,351 @@ | |||
1 | #ifndef TARGET_CORE_TRANSPORT_H | ||
2 | #define TARGET_CORE_TRANSPORT_H | ||
3 | |||
4 | #define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION | ||
5 | |||
6 | /* Attempts before moving from SHORT to LONG */ | ||
7 | #define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3 | ||
8 | #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */ | ||
9 | #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */ | ||
10 | |||
11 | #define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */ | ||
12 | |||
13 | #define PYX_TRANSPORT_SENT_TO_TRANSPORT 0 | ||
14 | #define PYX_TRANSPORT_WRITE_PENDING 1 | ||
15 | |||
16 | #define PYX_TRANSPORT_UNKNOWN_SAM_OPCODE -1 | ||
17 | #define PYX_TRANSPORT_HBA_QUEUE_FULL -2 | ||
18 | #define PYX_TRANSPORT_REQ_TOO_MANY_SECTORS -3 | ||
19 | #define PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES -4 | ||
20 | #define PYX_TRANSPORT_INVALID_CDB_FIELD -5 | ||
21 | #define PYX_TRANSPORT_INVALID_PARAMETER_LIST -6 | ||
22 | #define PYX_TRANSPORT_LU_COMM_FAILURE -7 | ||
23 | #define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8 | ||
24 | #define PYX_TRANSPORT_WRITE_PROTECTED -9 | ||
25 | #define PYX_TRANSPORT_TASK_TIMEOUT -10 | ||
26 | #define PYX_TRANSPORT_RESERVATION_CONFLICT -11 | ||
27 | #define PYX_TRANSPORT_ILLEGAL_REQUEST -12 | ||
28 | #define PYX_TRANSPORT_USE_SENSE_REASON -13 | ||
29 | |||
30 | #ifndef SAM_STAT_RESERVATION_CONFLICT | ||
31 | #define SAM_STAT_RESERVATION_CONFLICT 0x18 | ||
32 | #endif | ||
33 | |||
34 | #define TRANSPORT_PLUGIN_FREE 0 | ||
35 | #define TRANSPORT_PLUGIN_REGISTERED 1 | ||
36 | |||
37 | #define TRANSPORT_PLUGIN_PHBA_PDEV 1 | ||
38 | #define TRANSPORT_PLUGIN_VHBA_PDEV 2 | ||
39 | #define TRANSPORT_PLUGIN_VHBA_VDEV 3 | ||
40 | |||
41 | /* For SE OBJ Plugins, in seconds */ | ||
42 | #define TRANSPORT_TIMEOUT_TUR 10 | ||
43 | #define TRANSPORT_TIMEOUT_TYPE_DISK 60 | ||
44 | #define TRANSPORT_TIMEOUT_TYPE_ROM 120 | ||
45 | #define TRANSPORT_TIMEOUT_TYPE_TAPE 600 | ||
46 | #define TRANSPORT_TIMEOUT_TYPE_OTHER 300 | ||
47 | |||
48 | /* For se_task->task_state_flags */ | ||
49 | #define TSF_EXCEPTION_CLEARED 0x01 | ||
50 | |||
51 | /* | ||
52 | * struct se_subsystem_dev->su_dev_flags | ||
53 | */ | ||
54 | #define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001 | ||
55 | #define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002 | ||
56 | #define SDF_USING_UDEV_PATH 0x00000004 | ||
57 | #define SDF_USING_ALIAS 0x00000008 | ||
58 | |||
59 | /* | ||
60 | * struct se_device->dev_flags | ||
61 | */ | ||
62 | #define DF_READ_ONLY 0x00000001 | ||
63 | #define DF_SPC2_RESERVATIONS 0x00000002 | ||
64 | #define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004 | ||
65 | |||
66 | /* struct se_dev_attrib sanity values */ | ||
67 | /* 10 Minutes */ | ||
68 | #define DA_TASK_TIMEOUT_MAX 600 | ||
69 | /* Default max_unmap_lba_count */ | ||
70 | #define DA_MAX_UNMAP_LBA_COUNT 0 | ||
71 | /* Default max_unmap_block_desc_count */ | ||
72 | #define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0 | ||
73 | /* Default unmap_granularity */ | ||
74 | #define DA_UNMAP_GRANULARITY_DEFAULT 0 | ||
75 | /* Default unmap_granularity_alignment */ | ||
76 | #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 | ||
77 | /* Emulation for Direct Page Out */ | ||
78 | #define DA_EMULATE_DPO 0 | ||
79 | /* Emulation for Forced Unit Access WRITEs */ | ||
80 | #define DA_EMULATE_FUA_WRITE 1 | ||
81 | /* Emulation for Forced Unit Access READs */ | ||
82 | #define DA_EMULATE_FUA_READ 0 | ||
83 | /* Emulation for WriteCache and SYNCHRONIZE_CACHE */ | ||
84 | #define DA_EMULATE_WRITE_CACHE 0 | ||
85 | /* Emulation for UNIT ATTENTION Interlock Control */ | ||
86 | #define DA_EMULATE_UA_INTLLCK_CTRL 0 | ||
87 | /* Emulation for TASK_ABORTED status (TAS) by default */ | ||
88 | #define DA_EMULATE_TAS 1 | ||
89 | /* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */ | ||
90 | #define DA_EMULATE_TPU 0 | ||
91 | /* | ||
92 | * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using | ||
93 | * block/blk-lib.c:blkdev_issue_discard() | ||
94 | */ | ||
95 | #define DA_EMULATE_TPWS 0 | ||
96 | /* No Emulation for PSCSI by default */ | ||
97 | #define DA_EMULATE_RESERVATIONS 0 | ||
98 | /* No Emulation for PSCSI by default */ | ||
99 | #define DA_EMULATE_ALUA 0 | ||
100 | /* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ | ||
101 | #define DA_ENFORCE_PR_ISIDS 1 | ||
102 | #define DA_STATUS_MAX_SECTORS_MIN 16 | ||
103 | #define DA_STATUS_MAX_SECTORS_MAX 8192 | ||
104 | |||
105 | #define SE_MODE_PAGE_BUF 512 | ||
106 | |||
107 | #define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs)) | ||
108 | |||
109 | struct se_mem; | ||
110 | struct se_subsystem_api; | ||
111 | |||
112 | extern int init_se_global(void); | ||
113 | extern void release_se_global(void); | ||
114 | extern void transport_init_queue_obj(struct se_queue_obj *); | ||
115 | extern int transport_subsystem_check_init(void); | ||
116 | extern int transport_subsystem_register(struct se_subsystem_api *); | ||
117 | extern void transport_subsystem_release(struct se_subsystem_api *); | ||
118 | extern void transport_load_plugins(void); | ||
119 | extern struct se_session *transport_init_session(void); | ||
120 | extern void __transport_register_session(struct se_portal_group *, | ||
121 | struct se_node_acl *, | ||
122 | struct se_session *, void *); | ||
123 | extern void transport_register_session(struct se_portal_group *, | ||
124 | struct se_node_acl *, | ||
125 | struct se_session *, void *); | ||
126 | extern void transport_free_session(struct se_session *); | ||
127 | extern void transport_deregister_session_configfs(struct se_session *); | ||
128 | extern void transport_deregister_session(struct se_session *); | ||
129 | extern void transport_cmd_finish_abort(struct se_cmd *, int); | ||
130 | extern void transport_cmd_finish_abort_tmr(struct se_cmd *); | ||
131 | extern void transport_complete_sync_cache(struct se_cmd *, int); | ||
132 | extern void transport_complete_task(struct se_task *, int); | ||
133 | extern void transport_add_task_to_execute_queue(struct se_task *, | ||
134 | struct se_task *, | ||
135 | struct se_device *); | ||
136 | unsigned char *transport_dump_cmd_direction(struct se_cmd *); | ||
137 | extern void transport_dump_dev_state(struct se_device *, char *, int *); | ||
138 | extern void transport_dump_dev_info(struct se_device *, struct se_lun *, | ||
139 | unsigned long long, char *, int *); | ||
140 | extern void transport_dump_vpd_proto_id(struct t10_vpd *, | ||
141 | unsigned char *, int); | ||
142 | extern void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); | ||
143 | extern int transport_dump_vpd_assoc(struct t10_vpd *, | ||
144 | unsigned char *, int); | ||
145 | extern int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); | ||
146 | extern int transport_dump_vpd_ident_type(struct t10_vpd *, | ||
147 | unsigned char *, int); | ||
148 | extern int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *); | ||
149 | extern int transport_dump_vpd_ident(struct t10_vpd *, | ||
150 | unsigned char *, int); | ||
151 | extern int transport_set_vpd_ident(struct t10_vpd *, unsigned char *); | ||
152 | extern struct se_device *transport_add_device_to_core_hba(struct se_hba *, | ||
153 | struct se_subsystem_api *, | ||
154 | struct se_subsystem_dev *, u32, | ||
155 | void *, struct se_dev_limits *, | ||
156 | const char *, const char *); | ||
157 | extern void transport_device_setup_cmd(struct se_cmd *); | ||
158 | extern void transport_init_se_cmd(struct se_cmd *, | ||
159 | struct target_core_fabric_ops *, | ||
160 | struct se_session *, u32, int, int, | ||
161 | unsigned char *); | ||
162 | extern void transport_free_se_cmd(struct se_cmd *); | ||
163 | extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); | ||
164 | extern int transport_generic_handle_cdb(struct se_cmd *); | ||
165 | extern int transport_generic_handle_cdb_map(struct se_cmd *); | ||
166 | extern int transport_generic_handle_data(struct se_cmd *); | ||
167 | extern void transport_new_cmd_failure(struct se_cmd *); | ||
168 | extern int transport_generic_handle_tmr(struct se_cmd *); | ||
169 | extern void __transport_stop_task_timer(struct se_task *, unsigned long *); | ||
170 | extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]); | ||
171 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, | ||
172 | struct scatterlist *, u32); | ||
173 | extern int transport_clear_lun_from_sessions(struct se_lun *); | ||
174 | extern int transport_check_aborted_status(struct se_cmd *, int); | ||
175 | extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); | ||
176 | extern void transport_send_task_abort(struct se_cmd *); | ||
177 | extern void transport_release_cmd_to_pool(struct se_cmd *); | ||
178 | extern void transport_generic_free_cmd(struct se_cmd *, int, int, int); | ||
179 | extern void transport_generic_wait_for_cmds(struct se_cmd *, int); | ||
180 | extern u32 transport_calc_sg_num(struct se_task *, struct se_mem *, u32); | ||
181 | extern int transport_map_mem_to_sg(struct se_task *, struct list_head *, | ||
182 | void *, struct se_mem *, | ||
183 | struct se_mem **, u32 *, u32 *); | ||
184 | extern void transport_do_task_sg_chain(struct se_cmd *); | ||
185 | extern void transport_generic_process_write(struct se_cmd *); | ||
186 | extern int transport_generic_do_tmr(struct se_cmd *); | ||
187 | /* From target_core_alua.c */ | ||
188 | extern int core_alua_check_nonop_delay(struct se_cmd *); | ||
189 | |||
190 | /* | ||
191 | * Each se_transport_task_t can have N number of possible struct se_task's | ||
192 | * for the storage transport(s) to possibly execute. | ||
193 | * Used primarily for splitting up CDBs that exceed the physical storage | ||
194 | * HBA's maximum sector count per task. | ||
195 | */ | ||
196 | struct se_mem { | ||
197 | struct page *se_page; | ||
198 | u32 se_len; | ||
199 | u32 se_off; | ||
200 | struct list_head se_list; | ||
201 | } ____cacheline_aligned; | ||
202 | |||
203 | /* | ||
204 | * Each type of disk transport supported MUST have a template defined | ||
205 | * within its .h file. | ||
206 | */ | ||
207 | struct se_subsystem_api { | ||
208 | /* | ||
209 | * The Name. :-) | ||
210 | */ | ||
211 | char name[16]; | ||
212 | /* | ||
213 | * Transport Type. | ||
214 | */ | ||
215 | u8 transport_type; | ||
216 | /* | ||
217 | * struct module for struct se_hba references | ||
218 | */ | ||
219 | struct module *owner; | ||
220 | /* | ||
221 | * Used for global se_subsystem_api list_head | ||
222 | */ | ||
223 | struct list_head sub_api_list; | ||
224 | /* | ||
225 | * For SCF_SCSI_NON_DATA_CDB | ||
226 | */ | ||
227 | int (*cdb_none)(struct se_task *); | ||
228 | /* | ||
229 | * For SCF_SCSI_CONTROL_NONSG_IO_CDB | ||
230 | */ | ||
231 | int (*map_task_non_SG)(struct se_task *); | ||
232 | /* | ||
233 | * For SCF_SCSI_DATA_SG_IO_CDB and SCF_SCSI_CONTROL_SG_IO_CDB | ||
234 | */ | ||
235 | int (*map_task_SG)(struct se_task *); | ||
236 | /* | ||
237 | * attach_hba(): | ||
238 | */ | ||
239 | int (*attach_hba)(struct se_hba *, u32); | ||
240 | /* | ||
241 | * detach_hba(): | ||
242 | */ | ||
243 | void (*detach_hba)(struct se_hba *); | ||
244 | /* | ||
245 | * pmode_hba(): Used for TCM/pSCSI subsystem plugin HBA -> | ||
246 | * Linux/SCSI struct Scsi_Host passthrough | ||
247 | */ | ||
248 | int (*pmode_enable_hba)(struct se_hba *, unsigned long); | ||
249 | /* | ||
250 | * allocate_virtdevice(): | ||
251 | */ | ||
252 | void *(*allocate_virtdevice)(struct se_hba *, const char *); | ||
253 | /* | ||
254 | * create_virtdevice(): Only for Virtual HBAs | ||
255 | */ | ||
256 | struct se_device *(*create_virtdevice)(struct se_hba *, | ||
257 | struct se_subsystem_dev *, void *); | ||
258 | /* | ||
259 | * free_device(): | ||
260 | */ | ||
261 | void (*free_device)(void *); | ||
262 | |||
263 | /* | ||
264 | * dpo_emulated(): | ||
265 | */ | ||
266 | int (*dpo_emulated)(struct se_device *); | ||
267 | /* | ||
268 | * fua_write_emulated(): | ||
269 | */ | ||
270 | int (*fua_write_emulated)(struct se_device *); | ||
271 | /* | ||
272 | * fua_read_emulated(): | ||
273 | */ | ||
274 | int (*fua_read_emulated)(struct se_device *); | ||
275 | /* | ||
276 | * write_cache_emulated(): | ||
277 | */ | ||
278 | int (*write_cache_emulated)(struct se_device *); | ||
279 | /* | ||
280 | * transport_complete(): | ||
281 | * | ||
282 | * Use transport_generic_complete() for majority of DAS transport | ||
283 | * drivers. Provided out of convenience. | ||
284 | */ | ||
285 | int (*transport_complete)(struct se_task *task); | ||
286 | struct se_task *(*alloc_task)(struct se_cmd *); | ||
287 | /* | ||
288 | * do_task(): | ||
289 | */ | ||
290 | int (*do_task)(struct se_task *); | ||
291 | /* | ||
292 | * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate | ||
293 | * UNMAP and WRITE_SAME_* w/ UNMAP=1 <-> Linux/Block Discard | ||
294 | */ | ||
295 | int (*do_discard)(struct se_device *, sector_t, u32); | ||
296 | /* | ||
297 | * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate | ||
298 | * SYNCHRONIZE_CACHE_* <-> Linux/Block blkdev_issue_flush() | ||
299 | */ | ||
300 | void (*do_sync_cache)(struct se_task *); | ||
301 | /* | ||
302 | * free_task(): | ||
303 | */ | ||
304 | void (*free_task)(struct se_task *); | ||
305 | /* | ||
306 | * check_configfs_dev_params(): | ||
307 | */ | ||
308 | ssize_t (*check_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *); | ||
309 | /* | ||
310 | * set_configfs_dev_params(): | ||
311 | */ | ||
312 | ssize_t (*set_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, | ||
313 | const char *, ssize_t); | ||
314 | /* | ||
315 | * show_configfs_dev_params(): | ||
316 | */ | ||
317 | ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, | ||
318 | char *); | ||
319 | /* | ||
320 | * get_cdb(): | ||
321 | */ | ||
322 | unsigned char *(*get_cdb)(struct se_task *); | ||
323 | /* | ||
324 | * get_device_rev(): | ||
325 | */ | ||
326 | u32 (*get_device_rev)(struct se_device *); | ||
327 | /* | ||
328 | * get_device_type(): | ||
329 | */ | ||
330 | u32 (*get_device_type)(struct se_device *); | ||
331 | /* | ||
332 | * Get the sector_t from a subsystem backstore.. | ||
333 | */ | ||
334 | sector_t (*get_blocks)(struct se_device *); | ||
335 | /* | ||
336 | * do_se_mem_map(): | ||
337 | */ | ||
338 | int (*do_se_mem_map)(struct se_task *, struct list_head *, void *, | ||
339 | struct se_mem *, struct se_mem **, u32 *, u32 *); | ||
340 | /* | ||
341 | * get_sense_buffer(): | ||
342 | */ | ||
343 | unsigned char *(*get_sense_buffer)(struct se_task *); | ||
344 | } ____cacheline_aligned; | ||
345 | |||
346 | #define TRANSPORT(dev) ((dev)->transport) | ||
347 | #define HBA_TRANSPORT(hba) ((hba)->transport) | ||
348 | |||
349 | extern struct se_global *se_global; | ||
350 | |||
351 | #endif /* TARGET_CORE_TRANSPORT_H */ | ||
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h new file mode 100644 index 000000000000..186e84db4b54 --- /dev/null +++ b/include/trace/events/asoc.h | |||
@@ -0,0 +1,235 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM asoc | ||
3 | |||
4 | #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_ASOC_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | struct snd_soc_jack; | ||
11 | struct snd_soc_codec; | ||
12 | struct snd_soc_card; | ||
13 | struct snd_soc_dapm_widget; | ||
14 | |||
15 | /* | ||
16 | * Log register events | ||
17 | */ | ||
18 | DECLARE_EVENT_CLASS(snd_soc_reg, | ||
19 | |||
20 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
21 | unsigned int val), | ||
22 | |||
23 | TP_ARGS(codec, reg, val), | ||
24 | |||
25 | TP_STRUCT__entry( | ||
26 | __string( name, codec->name ) | ||
27 | __field( int, id ) | ||
28 | __field( unsigned int, reg ) | ||
29 | __field( unsigned int, val ) | ||
30 | ), | ||
31 | |||
32 | TP_fast_assign( | ||
33 | __assign_str(name, codec->name); | ||
34 | __entry->id = codec->id; | ||
35 | __entry->reg = reg; | ||
36 | __entry->val = val; | ||
37 | ), | ||
38 | |||
39 | TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name), | ||
40 | (int)__entry->id, (unsigned int)__entry->reg, | ||
41 | (unsigned int)__entry->val) | ||
42 | ); | ||
43 | |||
44 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write, | ||
45 | |||
46 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
47 | unsigned int val), | ||
48 | |||
49 | TP_ARGS(codec, reg, val) | ||
50 | |||
51 | ); | ||
52 | |||
53 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | ||
54 | |||
55 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
56 | unsigned int val), | ||
57 | |||
58 | TP_ARGS(codec, reg, val) | ||
59 | |||
60 | ); | ||
61 | |||
62 | DECLARE_EVENT_CLASS(snd_soc_card, | ||
63 | |||
64 | TP_PROTO(struct snd_soc_card *card, int val), | ||
65 | |||
66 | TP_ARGS(card, val), | ||
67 | |||
68 | TP_STRUCT__entry( | ||
69 | __string( name, card->name ) | ||
70 | __field( int, val ) | ||
71 | ), | ||
72 | |||
73 | TP_fast_assign( | ||
74 | __assign_str(name, card->name); | ||
75 | __entry->val = val; | ||
76 | ), | ||
77 | |||
78 | TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) | ||
79 | ); | ||
80 | |||
81 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, | ||
82 | |||
83 | TP_PROTO(struct snd_soc_card *card, int val), | ||
84 | |||
85 | TP_ARGS(card, val) | ||
86 | |||
87 | ); | ||
88 | |||
89 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, | ||
90 | |||
91 | TP_PROTO(struct snd_soc_card *card, int val), | ||
92 | |||
93 | TP_ARGS(card, val) | ||
94 | |||
95 | ); | ||
96 | |||
97 | DECLARE_EVENT_CLASS(snd_soc_dapm_basic, | ||
98 | |||
99 | TP_PROTO(struct snd_soc_card *card), | ||
100 | |||
101 | TP_ARGS(card), | ||
102 | |||
103 | TP_STRUCT__entry( | ||
104 | __string( name, card->name ) | ||
105 | ), | ||
106 | |||
107 | TP_fast_assign( | ||
108 | __assign_str(name, card->name); | ||
109 | ), | ||
110 | |||
111 | TP_printk("card=%s", __get_str(name)) | ||
112 | ); | ||
113 | |||
114 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, | ||
115 | |||
116 | TP_PROTO(struct snd_soc_card *card), | ||
117 | |||
118 | TP_ARGS(card) | ||
119 | |||
120 | ); | ||
121 | |||
122 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, | ||
123 | |||
124 | TP_PROTO(struct snd_soc_card *card), | ||
125 | |||
126 | TP_ARGS(card) | ||
127 | |||
128 | ); | ||
129 | |||
130 | DECLARE_EVENT_CLASS(snd_soc_dapm_widget, | ||
131 | |||
132 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
133 | |||
134 | TP_ARGS(w, val), | ||
135 | |||
136 | TP_STRUCT__entry( | ||
137 | __string( name, w->name ) | ||
138 | __field( int, val ) | ||
139 | ), | ||
140 | |||
141 | TP_fast_assign( | ||
142 | __assign_str(name, w->name); | ||
143 | __entry->val = val; | ||
144 | ), | ||
145 | |||
146 | TP_printk("widget=%s val=%d", __get_str(name), | ||
147 | (int)__entry->val) | ||
148 | ); | ||
149 | |||
150 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, | ||
151 | |||
152 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
153 | |||
154 | TP_ARGS(w, val) | ||
155 | |||
156 | ); | ||
157 | |||
158 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, | ||
159 | |||
160 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
161 | |||
162 | TP_ARGS(w, val) | ||
163 | |||
164 | ); | ||
165 | |||
166 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, | ||
167 | |||
168 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
169 | |||
170 | TP_ARGS(w, val) | ||
171 | |||
172 | ); | ||
173 | |||
174 | TRACE_EVENT(snd_soc_jack_irq, | ||
175 | |||
176 | TP_PROTO(const char *name), | ||
177 | |||
178 | TP_ARGS(name), | ||
179 | |||
180 | TP_STRUCT__entry( | ||
181 | __string( name, name ) | ||
182 | ), | ||
183 | |||
184 | TP_fast_assign( | ||
185 | __assign_str(name, name); | ||
186 | ), | ||
187 | |||
188 | TP_printk("%s", __get_str(name)) | ||
189 | ); | ||
190 | |||
191 | TRACE_EVENT(snd_soc_jack_report, | ||
192 | |||
193 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), | ||
194 | |||
195 | TP_ARGS(jack, mask, val), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __string( name, jack->jack->name ) | ||
199 | __field( int, mask ) | ||
200 | __field( int, val ) | ||
201 | ), | ||
202 | |||
203 | TP_fast_assign( | ||
204 | __assign_str(name, jack->jack->name); | ||
205 | __entry->mask = mask; | ||
206 | __entry->val = val; | ||
207 | ), | ||
208 | |||
209 | TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val, | ||
210 | (int)__entry->mask) | ||
211 | ); | ||
212 | |||
213 | TRACE_EVENT(snd_soc_jack_notify, | ||
214 | |||
215 | TP_PROTO(struct snd_soc_jack *jack, int val), | ||
216 | |||
217 | TP_ARGS(jack, val), | ||
218 | |||
219 | TP_STRUCT__entry( | ||
220 | __string( name, jack->jack->name ) | ||
221 | __field( int, val ) | ||
222 | ), | ||
223 | |||
224 | TP_fast_assign( | ||
225 | __assign_str(name, jack->jack->name); | ||
226 | __entry->val = val; | ||
227 | ), | ||
228 | |||
229 | TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) | ||
230 | ); | ||
231 | |||
232 | #endif /* _TRACE_ASOC_H */ | ||
233 | |||
234 | /* This part must be outside protection */ | ||
235 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d8ce278515c3..aba421d68f6f 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -206,15 +206,16 @@ TRACE_EVENT(block_bio_bounce, | |||
206 | * block_bio_complete - completed all work on the block operation | 206 | * block_bio_complete - completed all work on the block operation |
207 | * @q: queue holding the block operation | 207 | * @q: queue holding the block operation |
208 | * @bio: block operation completed | 208 | * @bio: block operation completed |
209 | * @error: io error value | ||
209 | * | 210 | * |
210 | * This tracepoint indicates there is no further work to do on this | 211 | * This tracepoint indicates there is no further work to do on this |
211 | * block IO operation @bio. | 212 | * block IO operation @bio. |
212 | */ | 213 | */ |
213 | TRACE_EVENT(block_bio_complete, | 214 | TRACE_EVENT(block_bio_complete, |
214 | 215 | ||
215 | TP_PROTO(struct request_queue *q, struct bio *bio), | 216 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), |
216 | 217 | ||
217 | TP_ARGS(q, bio), | 218 | TP_ARGS(q, bio, error), |
218 | 219 | ||
219 | TP_STRUCT__entry( | 220 | TP_STRUCT__entry( |
220 | __field( dev_t, dev ) | 221 | __field( dev_t, dev ) |
@@ -228,6 +229,7 @@ TRACE_EVENT(block_bio_complete, | |||
228 | __entry->dev = bio->bi_bdev->bd_dev; | 229 | __entry->dev = bio->bi_bdev->bd_dev; |
229 | __entry->sector = bio->bi_sector; | 230 | __entry->sector = bio->bi_sector; |
230 | __entry->nr_sector = bio->bi_size >> 9; | 231 | __entry->nr_sector = bio->bi_size >> 9; |
232 | __entry->error = error; | ||
231 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | 233 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
232 | ), | 234 | ), |
233 | 235 | ||
@@ -486,16 +488,16 @@ TRACE_EVENT(block_split, | |||
486 | ); | 488 | ); |
487 | 489 | ||
488 | /** | 490 | /** |
489 | * block_remap - map request for a partition to the raw device | 491 | * block_bio_remap - map request for a logical device to the raw device |
490 | * @q: queue holding the operation | 492 | * @q: queue holding the operation |
491 | * @bio: revised operation | 493 | * @bio: revised operation |
492 | * @dev: device for the operation | 494 | * @dev: device for the operation |
493 | * @from: original sector for the operation | 495 | * @from: original sector for the operation |
494 | * | 496 | * |
495 | * An operation for a partition on a block device has been mapped to the | 497 | * An operation for a logical device has been mapped to the |
496 | * raw block device. | 498 | * raw block device. |
497 | */ | 499 | */ |
498 | TRACE_EVENT(block_remap, | 500 | TRACE_EVENT(block_bio_remap, |
499 | 501 | ||
500 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | 502 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, |
501 | sector_t from), | 503 | sector_t from), |
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h new file mode 100644 index 000000000000..388bcdd26d46 --- /dev/null +++ b/include/trace/events/compaction.h | |||
@@ -0,0 +1,74 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM compaction | ||
3 | |||
4 | #if !defined(_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_COMPACTION_H | ||
6 | |||
7 | #include <linux/types.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | #include "gfpflags.h" | ||
10 | |||
11 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, | ||
12 | |||
13 | TP_PROTO(unsigned long nr_scanned, | ||
14 | unsigned long nr_taken), | ||
15 | |||
16 | TP_ARGS(nr_scanned, nr_taken), | ||
17 | |||
18 | TP_STRUCT__entry( | ||
19 | __field(unsigned long, nr_scanned) | ||
20 | __field(unsigned long, nr_taken) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | __entry->nr_scanned = nr_scanned; | ||
25 | __entry->nr_taken = nr_taken; | ||
26 | ), | ||
27 | |||
28 | TP_printk("nr_scanned=%lu nr_taken=%lu", | ||
29 | __entry->nr_scanned, | ||
30 | __entry->nr_taken) | ||
31 | ); | ||
32 | |||
33 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, | ||
34 | |||
35 | TP_PROTO(unsigned long nr_scanned, | ||
36 | unsigned long nr_taken), | ||
37 | |||
38 | TP_ARGS(nr_scanned, nr_taken) | ||
39 | ); | ||
40 | |||
41 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, | ||
42 | TP_PROTO(unsigned long nr_scanned, | ||
43 | unsigned long nr_taken), | ||
44 | |||
45 | TP_ARGS(nr_scanned, nr_taken) | ||
46 | ); | ||
47 | |||
48 | TRACE_EVENT(mm_compaction_migratepages, | ||
49 | |||
50 | TP_PROTO(unsigned long nr_migrated, | ||
51 | unsigned long nr_failed), | ||
52 | |||
53 | TP_ARGS(nr_migrated, nr_failed), | ||
54 | |||
55 | TP_STRUCT__entry( | ||
56 | __field(unsigned long, nr_migrated) | ||
57 | __field(unsigned long, nr_failed) | ||
58 | ), | ||
59 | |||
60 | TP_fast_assign( | ||
61 | __entry->nr_migrated = nr_migrated; | ||
62 | __entry->nr_failed = nr_failed; | ||
63 | ), | ||
64 | |||
65 | TP_printk("nr_migrated=%lu nr_failed=%lu", | ||
66 | __entry->nr_migrated, | ||
67 | __entry->nr_failed) | ||
68 | ); | ||
69 | |||
70 | |||
71 | #endif /* _TRACE_COMPACTION_H */ | ||
72 | |||
73 | /* This part must be outside protection */ | ||
74 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 6dd3a51ab1cb..46e3cd8e197a 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -6,6 +6,36 @@ | |||
6 | #undef TRACE_SYSTEM | 6 | #undef TRACE_SYSTEM |
7 | #define TRACE_SYSTEM kvm | 7 | #define TRACE_SYSTEM kvm |
8 | 8 | ||
9 | #define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } | ||
10 | |||
11 | #define kvm_trace_exit_reason \ | ||
12 | ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ | ||
13 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ | ||
14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | ||
15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | ||
16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) | ||
17 | |||
18 | TRACE_EVENT(kvm_userspace_exit, | ||
19 | TP_PROTO(__u32 reason, int errno), | ||
20 | TP_ARGS(reason, errno), | ||
21 | |||
22 | TP_STRUCT__entry( | ||
23 | __field( __u32, reason ) | ||
24 | __field( int, errno ) | ||
25 | ), | ||
26 | |||
27 | TP_fast_assign( | ||
28 | __entry->reason = reason; | ||
29 | __entry->errno = errno; | ||
30 | ), | ||
31 | |||
32 | TP_printk("reason %s (%d)", | ||
33 | __entry->errno < 0 ? | ||
34 | (__entry->errno == -EINTR ? "restart" : "error") : | ||
35 | __print_symbolic(__entry->reason, kvm_trace_exit_reason), | ||
36 | __entry->errno < 0 ? -__entry->errno : __entry->reason) | ||
37 | ); | ||
38 | |||
9 | #if defined(__KVM_HAVE_IOAPIC) | 39 | #if defined(__KVM_HAVE_IOAPIC) |
10 | TRACE_EVENT(kvm_set_irq, | 40 | TRACE_EVENT(kvm_set_irq, |
11 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | 41 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
@@ -185,6 +215,97 @@ TRACE_EVENT(kvm_age_page, | |||
185 | __entry->referenced ? "YOUNG" : "OLD") | 215 | __entry->referenced ? "YOUNG" : "OLD") |
186 | ); | 216 | ); |
187 | 217 | ||
218 | #ifdef CONFIG_KVM_ASYNC_PF | ||
219 | DECLARE_EVENT_CLASS(kvm_async_get_page_class, | ||
220 | |||
221 | TP_PROTO(u64 gva, u64 gfn), | ||
222 | |||
223 | TP_ARGS(gva, gfn), | ||
224 | |||
225 | TP_STRUCT__entry( | ||
226 | __field(__u64, gva) | ||
227 | __field(u64, gfn) | ||
228 | ), | ||
229 | |||
230 | TP_fast_assign( | ||
231 | __entry->gva = gva; | ||
232 | __entry->gfn = gfn; | ||
233 | ), | ||
234 | |||
235 | TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn) | ||
236 | ); | ||
237 | |||
238 | DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page, | ||
239 | |||
240 | TP_PROTO(u64 gva, u64 gfn), | ||
241 | |||
242 | TP_ARGS(gva, gfn) | ||
243 | ); | ||
244 | |||
245 | DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault, | ||
246 | |||
247 | TP_PROTO(u64 gva, u64 gfn), | ||
248 | |||
249 | TP_ARGS(gva, gfn) | ||
250 | ); | ||
251 | |||
252 | DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready, | ||
253 | |||
254 | TP_PROTO(u64 token, u64 gva), | ||
255 | |||
256 | TP_ARGS(token, gva), | ||
257 | |||
258 | TP_STRUCT__entry( | ||
259 | __field(__u64, token) | ||
260 | __field(__u64, gva) | ||
261 | ), | ||
262 | |||
263 | TP_fast_assign( | ||
264 | __entry->token = token; | ||
265 | __entry->gva = gva; | ||
266 | ), | ||
267 | |||
268 | TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva) | ||
269 | |||
270 | ); | ||
271 | |||
272 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, | ||
273 | |||
274 | TP_PROTO(u64 token, u64 gva), | ||
275 | |||
276 | TP_ARGS(token, gva) | ||
277 | ); | ||
278 | |||
279 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, | ||
280 | |||
281 | TP_PROTO(u64 token, u64 gva), | ||
282 | |||
283 | TP_ARGS(token, gva) | ||
284 | ); | ||
285 | |||
286 | TRACE_EVENT( | ||
287 | kvm_async_pf_completed, | ||
288 | TP_PROTO(unsigned long address, struct page *page, u64 gva), | ||
289 | TP_ARGS(address, page, gva), | ||
290 | |||
291 | TP_STRUCT__entry( | ||
292 | __field(unsigned long, address) | ||
293 | __field(pfn_t, pfn) | ||
294 | __field(u64, gva) | ||
295 | ), | ||
296 | |||
297 | TP_fast_assign( | ||
298 | __entry->address = address; | ||
299 | __entry->pfn = page ? page_to_pfn(page) : 0; | ||
300 | __entry->gva = gva; | ||
301 | ), | ||
302 | |||
303 | TP_printk("gva %#llx address %#lx pfn %#llx", __entry->gva, | ||
304 | __entry->address, __entry->pfn) | ||
305 | ); | ||
306 | |||
307 | #endif | ||
308 | |||
188 | #endif /* _TRACE_KVM_MAIN_H */ | 309 | #endif /* _TRACE_KVM_MAIN_H */ |
189 | 310 | ||
190 | /* This part must be outside protection */ | 311 | /* This part must be outside protection */ |
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index c7bb2f0482fe..c6bae36547e5 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -1,5 +1,15 @@ | |||
1 | /* | ||
2 | * Because linux/module.h has tracepoints in the header, and ftrace.h | ||
3 | * eventually includes this file, define_trace.h includes linux/module.h | ||
4 | * But we do not want the module.h to override the TRACE_SYSTEM macro | ||
5 | * variable that define_trace.h is processing, so we only set it | ||
6 | * when module events are being processed, which would happen when | ||
7 | * CREATE_TRACE_POINTS is defined. | ||
8 | */ | ||
9 | #ifdef CREATE_TRACE_POINTS | ||
1 | #undef TRACE_SYSTEM | 10 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM module | 11 | #define TRACE_SYSTEM module |
12 | #endif | ||
3 | 13 | ||
4 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) | 14 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define _TRACE_MODULE_H | 15 | #define _TRACE_MODULE_H |
diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h new file mode 100644 index 000000000000..37502a7404b7 --- /dev/null +++ b/include/trace/events/regulator.h | |||
@@ -0,0 +1,141 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM regulator | ||
3 | |||
4 | #if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_REGULATOR_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | /* | ||
11 | * Events which just log themselves and the regulator name for enable/disable | ||
12 | * type tracking. | ||
13 | */ | ||
14 | DECLARE_EVENT_CLASS(regulator_basic, | ||
15 | |||
16 | TP_PROTO(const char *name), | ||
17 | |||
18 | TP_ARGS(name), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __string( name, name ) | ||
22 | ), | ||
23 | |||
24 | TP_fast_assign( | ||
25 | __assign_str(name, name); | ||
26 | ), | ||
27 | |||
28 | TP_printk("name=%s", __get_str(name)) | ||
29 | |||
30 | ); | ||
31 | |||
32 | DEFINE_EVENT(regulator_basic, regulator_enable, | ||
33 | |||
34 | TP_PROTO(const char *name), | ||
35 | |||
36 | TP_ARGS(name) | ||
37 | |||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(regulator_basic, regulator_enable_delay, | ||
41 | |||
42 | TP_PROTO(const char *name), | ||
43 | |||
44 | TP_ARGS(name) | ||
45 | |||
46 | ); | ||
47 | |||
48 | DEFINE_EVENT(regulator_basic, regulator_enable_complete, | ||
49 | |||
50 | TP_PROTO(const char *name), | ||
51 | |||
52 | TP_ARGS(name) | ||
53 | |||
54 | ); | ||
55 | |||
56 | DEFINE_EVENT(regulator_basic, regulator_disable, | ||
57 | |||
58 | TP_PROTO(const char *name), | ||
59 | |||
60 | TP_ARGS(name) | ||
61 | |||
62 | ); | ||
63 | |||
64 | DEFINE_EVENT(regulator_basic, regulator_disable_complete, | ||
65 | |||
66 | TP_PROTO(const char *name), | ||
67 | |||
68 | TP_ARGS(name) | ||
69 | |||
70 | ); | ||
71 | |||
72 | /* | ||
73 | * Events that take a range of numerical values, mostly for voltages | ||
74 | * and so on. | ||
75 | */ | ||
76 | DECLARE_EVENT_CLASS(regulator_range, | ||
77 | |||
78 | TP_PROTO(const char *name, int min, int max), | ||
79 | |||
80 | TP_ARGS(name, min, max), | ||
81 | |||
82 | TP_STRUCT__entry( | ||
83 | __string( name, name ) | ||
84 | __field( int, min ) | ||
85 | __field( int, max ) | ||
86 | ), | ||
87 | |||
88 | TP_fast_assign( | ||
89 | __assign_str(name, name); | ||
90 | __entry->min = min; | ||
91 | __entry->max = max; | ||
92 | ), | ||
93 | |||
94 | TP_printk("name=%s (%d-%d)", __get_str(name), | ||
95 | (int)__entry->min, (int)__entry->max) | ||
96 | ); | ||
97 | |||
98 | DEFINE_EVENT(regulator_range, regulator_set_voltage, | ||
99 | |||
100 | TP_PROTO(const char *name, int min, int max), | ||
101 | |||
102 | TP_ARGS(name, min, max) | ||
103 | |||
104 | ); | ||
105 | |||
106 | |||
107 | /* | ||
108 | * Events that take a single value, mostly for readback and refcounts. | ||
109 | */ | ||
110 | DECLARE_EVENT_CLASS(regulator_value, | ||
111 | |||
112 | TP_PROTO(const char *name, unsigned int val), | ||
113 | |||
114 | TP_ARGS(name, val), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __string( name, name ) | ||
118 | __field( unsigned int, val ) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | __assign_str(name, name); | ||
123 | __entry->val = val; | ||
124 | ), | ||
125 | |||
126 | TP_printk("name=%s, val=%u", __get_str(name), | ||
127 | (int)__entry->val) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(regulator_value, regulator_set_voltage_complete, | ||
131 | |||
132 | TP_PROTO(const char *name, unsigned int value), | ||
133 | |||
134 | TP_ARGS(name, value) | ||
135 | |||
136 | ); | ||
137 | |||
138 | #endif /* _TRACE_POWER_H */ | ||
139 | |||
140 | /* This part must be outside protection */ | ||
141 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index c255fcc587bf..ea422aaa23e1 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -25,13 +25,13 @@ | |||
25 | 25 | ||
26 | #define trace_reclaim_flags(page, sync) ( \ | 26 | #define trace_reclaim_flags(page, sync) ( \ |
27 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | 27 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ |
28 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ | 28 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ |
29 | ) | 29 | ) |
30 | 30 | ||
31 | #define trace_shrink_flags(file, sync) ( \ | 31 | #define trace_shrink_flags(file, sync) ( \ |
32 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_MIXED : \ | 32 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_MIXED : \ |
33 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \ | 33 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \ |
34 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ | 34 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ |
35 | ) | 35 | ) |
36 | 36 | ||
37 | TRACE_EVENT(mm_vmscan_kswapd_sleep, | 37 | TRACE_EVENT(mm_vmscan_kswapd_sleep, |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 89a2b2db4375..4e249b927eaa 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -81,6 +81,7 @@ DEFINE_EVENT(writeback_class, name, \ | |||
81 | TP_ARGS(bdi)) | 81 | TP_ARGS(bdi)) |
82 | 82 | ||
83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); | 83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); |
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_background); | ||
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); | 85 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); |
85 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); | 86 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); |
86 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | 87 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); |
diff --git a/include/xen/gntdev.h b/include/xen/gntdev.h new file mode 100644 index 000000000000..eb23f4188f5a --- /dev/null +++ b/include/xen/gntdev.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /****************************************************************************** | ||
2 | * gntdev.h | ||
3 | * | ||
4 | * Interface to /dev/xen/gntdev. | ||
5 | * | ||
6 | * Copyright (c) 2007, D G Murray | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation; or, when distributed | ||
11 | * separately from the Linux kernel or incorporated into other | ||
12 | * software packages, subject to the following license: | ||
13 | * | ||
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
15 | * of this source file (the "Software"), to deal in the Software without | ||
16 | * restriction, including without limitation the rights to use, copy, modify, | ||
17 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
18 | * and to permit persons to whom the Software is furnished to do so, subject to | ||
19 | * the following conditions: | ||
20 | * | ||
21 | * The above copyright notice and this permission notice shall be included in | ||
22 | * all copies or substantial portions of the Software. | ||
23 | * | ||
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
30 | * IN THE SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef __LINUX_PUBLIC_GNTDEV_H__ | ||
34 | #define __LINUX_PUBLIC_GNTDEV_H__ | ||
35 | |||
36 | struct ioctl_gntdev_grant_ref { | ||
37 | /* The domain ID of the grant to be mapped. */ | ||
38 | uint32_t domid; | ||
39 | /* The grant reference of the grant to be mapped. */ | ||
40 | uint32_t ref; | ||
41 | }; | ||
42 | |||
43 | /* | ||
44 | * Inserts the grant references into the mapping table of an instance | ||
45 | * of gntdev. N.B. This does not perform the mapping, which is deferred | ||
46 | * until mmap() is called with @index as the offset. | ||
47 | */ | ||
48 | #define IOCTL_GNTDEV_MAP_GRANT_REF \ | ||
49 | _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref)) | ||
50 | struct ioctl_gntdev_map_grant_ref { | ||
51 | /* IN parameters */ | ||
52 | /* The number of grants to be mapped. */ | ||
53 | uint32_t count; | ||
54 | uint32_t pad; | ||
55 | /* OUT parameters */ | ||
56 | /* The offset to be used on a subsequent call to mmap(). */ | ||
57 | uint64_t index; | ||
58 | /* Variable IN parameter. */ | ||
59 | /* Array of grant references, of size @count. */ | ||
60 | struct ioctl_gntdev_grant_ref refs[1]; | ||
61 | }; | ||
62 | |||
63 | /* | ||
64 | * Removes the grant references from the mapping table of an instance of | ||
65 | * of gntdev. N.B. munmap() must be called on the relevant virtual address(es) | ||
66 | * before this ioctl is called, or an error will result. | ||
67 | */ | ||
68 | #define IOCTL_GNTDEV_UNMAP_GRANT_REF \ | ||
69 | _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref)) | ||
70 | struct ioctl_gntdev_unmap_grant_ref { | ||
71 | /* IN parameters */ | ||
72 | /* The offset was returned by the corresponding map operation. */ | ||
73 | uint64_t index; | ||
74 | /* The number of pages to be unmapped. */ | ||
75 | uint32_t count; | ||
76 | uint32_t pad; | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * Returns the offset in the driver's address space that corresponds | ||
81 | * to @vaddr. This can be used to perform a munmap(), followed by an | ||
82 | * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by | ||
83 | * the caller. The number of pages that were allocated at the same time as | ||
84 | * @vaddr is returned in @count. | ||
85 | * | ||
86 | * N.B. Where more than one page has been mapped into a contiguous range, the | ||
87 | * supplied @vaddr must correspond to the start of the range; otherwise | ||
88 | * an error will result. It is only possible to munmap() the entire | ||
89 | * contiguously-allocated range at once, and not any subrange thereof. | ||
90 | */ | ||
91 | #define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \ | ||
92 | _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr)) | ||
93 | struct ioctl_gntdev_get_offset_for_vaddr { | ||
94 | /* IN parameters */ | ||
95 | /* The virtual address of the first mapped page in a range. */ | ||
96 | uint64_t vaddr; | ||
97 | /* OUT parameters */ | ||
98 | /* The offset that was used in the initial mmap() operation. */ | ||
99 | uint64_t offset; | ||
100 | /* The number of pages mapped in the VM area that begins at @vaddr. */ | ||
101 | uint32_t count; | ||
102 | uint32_t pad; | ||
103 | }; | ||
104 | |||
105 | /* | ||
106 | * Sets the maximum number of grants that may mapped at once by this gntdev | ||
107 | * instance. | ||
108 | * | ||
109 | * N.B. This must be called before any other ioctl is performed on the device. | ||
110 | */ | ||
111 | #define IOCTL_GNTDEV_SET_MAX_GRANTS \ | ||
112 | _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants)) | ||
113 | struct ioctl_gntdev_set_max_grants { | ||
114 | /* IN parameter */ | ||
115 | /* The maximum number of grants that may be mapped at once. */ | ||
116 | uint32_t count; | ||
117 | }; | ||
118 | |||
119 | #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ | ||
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 9a731706a016..b1fab6b5b3ef 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -37,10 +37,16 @@ | |||
37 | #ifndef __ASM_GNTTAB_H__ | 37 | #ifndef __ASM_GNTTAB_H__ |
38 | #define __ASM_GNTTAB_H__ | 38 | #define __ASM_GNTTAB_H__ |
39 | 39 | ||
40 | #include <asm/xen/hypervisor.h> | 40 | #include <asm/page.h> |
41 | |||
42 | #include <xen/interface/xen.h> | ||
41 | #include <xen/interface/grant_table.h> | 43 | #include <xen/interface/grant_table.h> |
44 | |||
45 | #include <asm/xen/hypervisor.h> | ||
42 | #include <asm/xen/grant_table.h> | 46 | #include <asm/xen/grant_table.h> |
43 | 47 | ||
48 | #include <xen/features.h> | ||
49 | |||
44 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ | 50 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ |
45 | #define NR_GRANT_FRAMES 4 | 51 | #define NR_GRANT_FRAMES 4 |
46 | 52 | ||
@@ -107,6 +113,37 @@ void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid, | |||
107 | void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid, | 113 | void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid, |
108 | unsigned long pfn); | 114 | unsigned long pfn); |
109 | 115 | ||
116 | static inline void | ||
117 | gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr, | ||
118 | uint32_t flags, grant_ref_t ref, domid_t domid) | ||
119 | { | ||
120 | if (flags & GNTMAP_contains_pte) | ||
121 | map->host_addr = addr; | ||
122 | else if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
123 | map->host_addr = __pa(addr); | ||
124 | else | ||
125 | map->host_addr = addr; | ||
126 | |||
127 | map->flags = flags; | ||
128 | map->ref = ref; | ||
129 | map->dom = domid; | ||
130 | } | ||
131 | |||
132 | static inline void | ||
133 | gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, phys_addr_t addr, | ||
134 | uint32_t flags, grant_handle_t handle) | ||
135 | { | ||
136 | if (flags & GNTMAP_contains_pte) | ||
137 | unmap->host_addr = addr; | ||
138 | else if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
139 | unmap->host_addr = __pa(addr); | ||
140 | else | ||
141 | unmap->host_addr = addr; | ||
142 | |||
143 | unmap->handle = handle; | ||
144 | unmap->dev_bus_addr = 0; | ||
145 | } | ||
146 | |||
110 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | 147 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, |
111 | unsigned long max_nr_gframes, | 148 | unsigned long max_nr_gframes, |
112 | struct grant_entry **__shared); | 149 | struct grant_entry **__shared); |
@@ -118,4 +155,9 @@ unsigned int gnttab_max_grant_frames(void); | |||
118 | 155 | ||
119 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 156 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
120 | 157 | ||
158 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | ||
159 | struct page **pages, unsigned int count); | ||
160 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | ||
161 | struct page **pages, unsigned int count); | ||
162 | |||
121 | #endif /* __ASM_GNTTAB_H__ */ | 163 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 43e2d7d33976..7a1d15ff19b7 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -94,7 +94,7 @@ struct xenbus_driver { | |||
94 | int (*remove)(struct xenbus_device *dev); | 94 | int (*remove)(struct xenbus_device *dev); |
95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); | 95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); |
96 | int (*resume)(struct xenbus_device *dev); | 96 | int (*resume)(struct xenbus_device *dev); |
97 | int (*uevent)(struct xenbus_device *, char **, int, char *, int); | 97 | int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *); |
98 | struct device_driver driver; | 98 | struct device_driver driver; |
99 | int (*read_otherend_details)(struct xenbus_device *dev); | 99 | int (*read_otherend_details)(struct xenbus_device *dev); |
100 | int (*is_ready)(struct xenbus_device *dev); | 100 | int (*is_ready)(struct xenbus_device *dev); |