diff options
| author | David S. Miller <davem@davemloft.net> | 2011-01-24 16:17:06 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-01-24 16:17:06 -0500 |
| commit | e92427b289d252cfbd4cb5282d92f4ce1a5bb1fb (patch) | |
| tree | 6d30e5e7b7f8e9aaa51d43b7128ac56860fa03bb /include | |
| parent | c506653d35249bb4738bb139c24362e1ae724bc1 (diff) | |
| parent | ec30f343d61391ab23705e50a525da1d55395780 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
281 files changed, 7244 insertions, 1812 deletions
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 17714beb868..5b6c391efc8 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 9cf736ea469..fc1575fd459 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 bc4a6deb73b..ef1cef77d32 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 a091cabca4b..de39915f6b7 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 359ef11725a..78ca429929f 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 65b3f5888f4..a3252a5ead6 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 53b7cfd924a..e46ec95a8ad 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 e5526354ba5..0a66cc45dd6 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 ad2001683ba..7e42bfee0e2 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 c637b75b9f3..7504bc99b29 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 d4136b28011..0fc15dfb2e2 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 2b134b691e3..64f838beaab 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 b3365025ff8..c4dbb132d90 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 a3e334ab111..5af3ed52ef9 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 5dcb9537343..e228893591a 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 572189e3713..5d2a5e9544d 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 1b62102fbb6..55192ac0ced 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/io.h b/include/asm-generic/io.h index 3577ca11a0b..4644c9a7f72 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
| @@ -211,6 +211,36 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
| 211 | } | 211 | } |
| 212 | #endif | 212 | #endif |
| 213 | 213 | ||
| 214 | static inline void readsl(const void __iomem *addr, void *buf, int len) | ||
| 215 | { | ||
| 216 | insl((unsigned long)addr, buf, len); | ||
| 217 | } | ||
| 218 | |||
| 219 | static inline void readsw(const void __iomem *addr, void *buf, int len) | ||
| 220 | { | ||
| 221 | insw((unsigned long)addr, buf, len); | ||
| 222 | } | ||
| 223 | |||
| 224 | static inline void readsb(const void __iomem *addr, void *buf, int len) | ||
| 225 | { | ||
| 226 | insb((unsigned long)addr, buf, len); | ||
| 227 | } | ||
| 228 | |||
| 229 | static inline void writesl(const void __iomem *addr, const void *buf, int len) | ||
| 230 | { | ||
| 231 | outsl((unsigned long)addr, buf, len); | ||
| 232 | } | ||
| 233 | |||
| 234 | static inline void writesw(const void __iomem *addr, const void *buf, int len) | ||
| 235 | { | ||
| 236 | outsw((unsigned long)addr, buf, len); | ||
| 237 | } | ||
| 238 | |||
| 239 | static inline void writesb(const void __iomem *addr, const void *buf, int len) | ||
| 240 | { | ||
| 241 | outsb((unsigned long)addr, buf, len); | ||
| 242 | } | ||
| 243 | |||
| 214 | #ifndef CONFIG_GENERIC_IOMAP | 244 | #ifndef CONFIG_GENERIC_IOMAP |
| 215 | #define ioread8(addr) readb(addr) | 245 | #define ioread8(addr) readb(addr) |
| 216 | #define ioread16(addr) readw(addr) | 246 | #define ioread16(addr) readw(addr) |
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 3da9e2742fa..787abbb6d86 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 6f3c6ae4fe0..31b6188df22 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 bd69d79208d..6ebb81030d2 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -67,7 +67,8 @@ | |||
| 67 | * Align to a 32 byte boundary equal to the | 67 | * Align to a 32 byte boundary equal to the |
| 68 | * alignment gcc 4.5 uses for a struct | 68 | * alignment gcc 4.5 uses for a struct |
| 69 | */ | 69 | */ |
| 70 | #define STRUCT_ALIGN() . = ALIGN(32) | 70 | #define STRUCT_ALIGNMENT 32 |
| 71 | #define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) | ||
| 71 | 72 | ||
| 72 | /* The actual configuration determine if the init/exit sections | 73 | /* The actual configuration determine if the init/exit sections |
| 73 | * are handled as text/data or they can be discarded (which | 74 | * are handled as text/data or they can be discarded (which |
| @@ -146,6 +147,13 @@ | |||
| 146 | #define TRACE_SYSCALLS() | 147 | #define TRACE_SYSCALLS() |
| 147 | #endif | 148 | #endif |
| 148 | 149 | ||
| 150 | |||
| 151 | #define KERNEL_DTB() \ | ||
| 152 | STRUCT_ALIGN(); \ | ||
| 153 | VMLINUX_SYMBOL(__dtb_start) = .; \ | ||
| 154 | *(.dtb.init.rodata) \ | ||
| 155 | VMLINUX_SYMBOL(__dtb_end) = .; | ||
| 156 | |||
| 149 | /* .data section */ | 157 | /* .data section */ |
| 150 | #define DATA_DATA \ | 158 | #define DATA_DATA \ |
| 151 | *(.data) \ | 159 | *(.data) \ |
| @@ -192,7 +200,8 @@ | |||
| 192 | 200 | ||
| 193 | #define READ_MOSTLY_DATA(align) \ | 201 | #define READ_MOSTLY_DATA(align) \ |
| 194 | . = ALIGN(align); \ | 202 | . = ALIGN(align); \ |
| 195 | *(.data..read_mostly) | 203 | *(.data..read_mostly) \ |
| 204 | . = ALIGN(align); | ||
| 196 | 205 | ||
| 197 | #define CACHELINE_ALIGNED_DATA(align) \ | 206 | #define CACHELINE_ALIGNED_DATA(align) \ |
| 198 | . = ALIGN(align); \ | 207 | . = ALIGN(align); \ |
| @@ -355,6 +364,13 @@ | |||
| 355 | VMLINUX_SYMBOL(__start___param) = .; \ | 364 | VMLINUX_SYMBOL(__start___param) = .; \ |
| 356 | *(__param) \ | 365 | *(__param) \ |
| 357 | VMLINUX_SYMBOL(__stop___param) = .; \ | 366 | VMLINUX_SYMBOL(__stop___param) = .; \ |
| 367 | } \ | ||
| 368 | \ | ||
| 369 | /* Built-in module versions. */ \ | ||
| 370 | __modver : AT(ADDR(__modver) - LOAD_OFFSET) { \ | ||
| 371 | VMLINUX_SYMBOL(__start___modver) = .; \ | ||
| 372 | *(__modver) \ | ||
| 373 | VMLINUX_SYMBOL(__stop___modver) = .; \ | ||
| 358 | . = ALIGN((align)); \ | 374 | . = ALIGN((align)); \ |
| 359 | VMLINUX_SYMBOL(__end_rodata) = .; \ | 375 | VMLINUX_SYMBOL(__end_rodata) = .; \ |
| 360 | } \ | 376 | } \ |
| @@ -468,7 +484,8 @@ | |||
| 468 | MCOUNT_REC() \ | 484 | MCOUNT_REC() \ |
| 469 | DEV_DISCARD(init.rodata) \ | 485 | DEV_DISCARD(init.rodata) \ |
| 470 | CPU_DISCARD(init.rodata) \ | 486 | CPU_DISCARD(init.rodata) \ |
| 471 | MEM_DISCARD(init.rodata) | 487 | MEM_DISCARD(init.rodata) \ |
| 488 | KERNEL_DTB() | ||
| 472 | 489 | ||
| 473 | #define INIT_TEXT \ | 490 | #define INIT_TEXT \ |
| 474 | *(.init.text) \ | 491 | *(.init.text) \ |
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h new file mode 100644 index 00000000000..c5813c87de0 --- /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 00000000000..d2cfa2ef49e --- /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 833d208c25d..4fd95a323be 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/drmP.h b/include/drm/drmP.h index 274eaaa15c3..a4694c61033 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -683,6 +683,21 @@ struct drm_master { | |||
| 683 | void *driver_priv; /**< Private structure for driver to use */ | 683 | void *driver_priv; /**< Private structure for driver to use */ |
| 684 | }; | 684 | }; |
| 685 | 685 | ||
| 686 | /* Size of ringbuffer for vblank timestamps. Just double-buffer | ||
| 687 | * in initial implementation. | ||
| 688 | */ | ||
| 689 | #define DRM_VBLANKTIME_RBSIZE 2 | ||
| 690 | |||
| 691 | /* Flags and return codes for get_vblank_timestamp() driver function. */ | ||
| 692 | #define DRM_CALLED_FROM_VBLIRQ 1 | ||
| 693 | #define DRM_VBLANKTIME_SCANOUTPOS_METHOD (1 << 0) | ||
| 694 | #define DRM_VBLANKTIME_INVBL (1 << 1) | ||
| 695 | |||
| 696 | /* get_scanout_position() return flags */ | ||
| 697 | #define DRM_SCANOUTPOS_VALID (1 << 0) | ||
| 698 | #define DRM_SCANOUTPOS_INVBL (1 << 1) | ||
| 699 | #define DRM_SCANOUTPOS_ACCURATE (1 << 2) | ||
| 700 | |||
| 686 | /** | 701 | /** |
| 687 | * DRM driver structure. This structure represent the common code for | 702 | * DRM driver structure. This structure represent the common code for |
| 688 | * a family of cards. There will one drm_device for each card present | 703 | * a family of cards. There will one drm_device for each card present |
| @@ -760,6 +775,68 @@ struct drm_driver { | |||
| 760 | */ | 775 | */ |
| 761 | int (*device_is_agp) (struct drm_device *dev); | 776 | int (*device_is_agp) (struct drm_device *dev); |
| 762 | 777 | ||
| 778 | /** | ||
| 779 | * Called by vblank timestamping code. | ||
| 780 | * | ||
| 781 | * Return the current display scanout position from a crtc. | ||
| 782 | * | ||
| 783 | * \param dev DRM device. | ||
| 784 | * \param crtc Id of the crtc to query. | ||
| 785 | * \param *vpos Target location for current vertical scanout position. | ||
| 786 | * \param *hpos Target location for current horizontal scanout position. | ||
| 787 | * | ||
| 788 | * Returns vpos as a positive number while in active scanout area. | ||
| 789 | * Returns vpos as a negative number inside vblank, counting the number | ||
| 790 | * of scanlines to go until end of vblank, e.g., -1 means "one scanline | ||
| 791 | * until start of active scanout / end of vblank." | ||
| 792 | * | ||
| 793 | * \return Flags, or'ed together as follows: | ||
| 794 | * | ||
| 795 | * DRM_SCANOUTPOS_VALID = Query successfull. | ||
| 796 | * DRM_SCANOUTPOS_INVBL = Inside vblank. | ||
| 797 | * DRM_SCANOUTPOS_ACCURATE = Returned position is accurate. A lack of | ||
| 798 | * this flag means that returned position may be offset by a constant | ||
| 799 | * but unknown small number of scanlines wrt. real scanout position. | ||
| 800 | * | ||
| 801 | */ | ||
| 802 | int (*get_scanout_position) (struct drm_device *dev, int crtc, | ||
| 803 | int *vpos, int *hpos); | ||
| 804 | |||
| 805 | /** | ||
| 806 | * Called by \c drm_get_last_vbltimestamp. Should return a precise | ||
| 807 | * timestamp when the most recent VBLANK interval ended or will end. | ||
| 808 | * | ||
| 809 | * Specifically, the timestamp in @vblank_time should correspond as | ||
| 810 | * closely as possible to the time when the first video scanline of | ||
| 811 | * the video frame after the end of VBLANK will start scanning out, | ||
| 812 | * the time immmediately after end of the VBLANK interval. If the | ||
| 813 | * @crtc is currently inside VBLANK, this will be a time in the future. | ||
| 814 | * If the @crtc is currently scanning out a frame, this will be the | ||
| 815 | * past start time of the current scanout. This is meant to adhere | ||
| 816 | * to the OpenML OML_sync_control extension specification. | ||
| 817 | * | ||
| 818 | * \param dev dev DRM device handle. | ||
| 819 | * \param crtc crtc for which timestamp should be returned. | ||
| 820 | * \param *max_error Maximum allowable timestamp error in nanoseconds. | ||
| 821 | * Implementation should strive to provide timestamp | ||
| 822 | * with an error of at most *max_error nanoseconds. | ||
| 823 | * Returns true upper bound on error for timestamp. | ||
| 824 | * \param *vblank_time Target location for returned vblank timestamp. | ||
| 825 | * \param flags 0 = Defaults, no special treatment needed. | ||
| 826 | * \param DRM_CALLED_FROM_VBLIRQ = Function is called from vblank | ||
| 827 | * irq handler. Some drivers need to apply some workarounds | ||
| 828 | * for gpu-specific vblank irq quirks if flag is set. | ||
| 829 | * | ||
| 830 | * \returns | ||
| 831 | * Zero if timestamping isn't supported in current display mode or a | ||
| 832 | * negative number on failure. A positive status code on success, | ||
| 833 | * which describes how the vblank_time timestamp was computed. | ||
| 834 | */ | ||
| 835 | int (*get_vblank_timestamp) (struct drm_device *dev, int crtc, | ||
| 836 | int *max_error, | ||
| 837 | struct timeval *vblank_time, | ||
| 838 | unsigned flags); | ||
| 839 | |||
| 763 | /* these have to be filled in */ | 840 | /* these have to be filled in */ |
| 764 | 841 | ||
| 765 | irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); | 842 | irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); |
| @@ -983,6 +1060,8 @@ struct drm_device { | |||
| 983 | 1060 | ||
| 984 | wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ | 1061 | wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ |
| 985 | atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ | 1062 | atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ |
| 1063 | struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */ | ||
| 1064 | spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ | ||
| 986 | spinlock_t vbl_lock; | 1065 | spinlock_t vbl_lock; |
| 987 | atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ | 1066 | atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ |
| 988 | u32 *last_vblank; /* protected by dev->vbl_lock, used */ | 1067 | u32 *last_vblank; /* protected by dev->vbl_lock, used */ |
| @@ -1041,12 +1120,14 @@ struct drm_device { | |||
| 1041 | /*@{ */ | 1120 | /*@{ */ |
| 1042 | spinlock_t object_name_lock; | 1121 | spinlock_t object_name_lock; |
| 1043 | struct idr object_name_idr; | 1122 | struct idr object_name_idr; |
| 1044 | uint32_t invalidate_domains; /* domains pending invalidation */ | ||
| 1045 | uint32_t flush_domains; /* domains pending flush */ | ||
| 1046 | /*@} */ | 1123 | /*@} */ |
| 1047 | 1124 | int switch_power_state; | |
| 1048 | }; | 1125 | }; |
| 1049 | 1126 | ||
| 1127 | #define DRM_SWITCH_POWER_ON 0 | ||
| 1128 | #define DRM_SWITCH_POWER_OFF 1 | ||
| 1129 | #define DRM_SWITCH_POWER_CHANGING 2 | ||
| 1130 | |||
| 1050 | static __inline__ int drm_core_check_feature(struct drm_device *dev, | 1131 | static __inline__ int drm_core_check_feature(struct drm_device *dev, |
| 1051 | int feature) | 1132 | int feature) |
| 1052 | { | 1133 | { |
| @@ -1284,11 +1365,22 @@ extern int drm_wait_vblank(struct drm_device *dev, void *data, | |||
| 1284 | struct drm_file *filp); | 1365 | struct drm_file *filp); |
| 1285 | extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); | 1366 | extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); |
| 1286 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | 1367 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); |
| 1368 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, | ||
| 1369 | struct timeval *vblanktime); | ||
| 1287 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1370 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); |
| 1288 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | 1371 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
| 1289 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1372 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
| 1290 | extern void drm_vblank_off(struct drm_device *dev, int crtc); | 1373 | extern void drm_vblank_off(struct drm_device *dev, int crtc); |
| 1291 | extern void drm_vblank_cleanup(struct drm_device *dev); | 1374 | extern void drm_vblank_cleanup(struct drm_device *dev); |
| 1375 | extern u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc, | ||
| 1376 | struct timeval *tvblank, unsigned flags); | ||
| 1377 | extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | ||
| 1378 | int crtc, int *max_error, | ||
| 1379 | struct timeval *vblank_time, | ||
| 1380 | unsigned flags, | ||
| 1381 | struct drm_crtc *refcrtc); | ||
| 1382 | extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); | ||
| 1383 | |||
| 1292 | /* Modesetting support */ | 1384 | /* Modesetting support */ |
| 1293 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1385 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
| 1294 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | 1386 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
| @@ -1321,7 +1413,6 @@ extern int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, | |||
| 1321 | extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); | 1413 | extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); |
| 1322 | extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data, | 1414 | extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data, |
| 1323 | struct drm_file *file_priv); | 1415 | struct drm_file *file_priv); |
| 1324 | extern void drm_agp_chipset_flush(struct drm_device *dev); | ||
| 1325 | 1416 | ||
| 1326 | /* Stub support (drm_stub.h) */ | 1417 | /* Stub support (drm_stub.h) */ |
| 1327 | extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, | 1418 | extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, |
| @@ -1340,6 +1431,9 @@ extern void drm_put_dev(struct drm_device *dev); | |||
| 1340 | extern int drm_put_minor(struct drm_minor **minor); | 1431 | extern int drm_put_minor(struct drm_minor **minor); |
| 1341 | extern unsigned int drm_debug; | 1432 | extern unsigned int drm_debug; |
| 1342 | 1433 | ||
| 1434 | extern unsigned int drm_vblank_offdelay; | ||
| 1435 | extern unsigned int drm_timestamp_precision; | ||
| 1436 | |||
| 1343 | extern struct class *drm_class; | 1437 | extern struct class *drm_class; |
| 1344 | extern struct proc_dir_entry *drm_proc_root; | 1438 | extern struct proc_dir_entry *drm_proc_root; |
| 1345 | extern struct dentry *drm_debugfs_root; | 1439 | extern struct dentry *drm_debugfs_root; |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 029aa688e78..acd7fade160 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -351,8 +351,14 @@ struct drm_crtc { | |||
| 351 | 351 | ||
| 352 | bool enabled; | 352 | bool enabled; |
| 353 | 353 | ||
| 354 | /* Requested mode from modesetting. */ | ||
| 354 | struct drm_display_mode mode; | 355 | struct drm_display_mode mode; |
| 355 | 356 | ||
| 357 | /* Programmed mode in hw, after adjustments for encoders, | ||
| 358 | * crtc, panel scaling etc. Needed for timestamping etc. | ||
| 359 | */ | ||
| 360 | struct drm_display_mode hwmode; | ||
| 361 | |||
| 356 | int x, y; | 362 | int x, y; |
| 357 | const struct drm_crtc_funcs *funcs; | 363 | const struct drm_crtc_funcs *funcs; |
| 358 | 364 | ||
| @@ -360,6 +366,9 @@ struct drm_crtc { | |||
| 360 | uint32_t gamma_size; | 366 | uint32_t gamma_size; |
| 361 | uint16_t *gamma_store; | 367 | uint16_t *gamma_store; |
| 362 | 368 | ||
| 369 | /* Constants needed for precise vblank and swap timestamping. */ | ||
| 370 | s64 framedur_ns, linedur_ns, pixeldur_ns; | ||
| 371 | |||
| 363 | /* if you are using the helper */ | 372 | /* if you are using the helper */ |
| 364 | void *helper_private; | 373 | void *helper_private; |
| 365 | }; | 374 | }; |
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index bf01531193d..e3917777860 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
| @@ -62,11 +62,14 @@ struct drm_mm { | |||
| 62 | struct list_head unused_nodes; | 62 | struct list_head unused_nodes; |
| 63 | int num_unused; | 63 | int num_unused; |
| 64 | spinlock_t unused_lock; | 64 | spinlock_t unused_lock; |
| 65 | unsigned int scan_check_range : 1; | ||
| 65 | unsigned scan_alignment; | 66 | unsigned scan_alignment; |
| 66 | unsigned long scan_size; | 67 | unsigned long scan_size; |
| 67 | unsigned long scan_hit_start; | 68 | unsigned long scan_hit_start; |
| 68 | unsigned scan_hit_size; | 69 | unsigned scan_hit_size; |
| 69 | unsigned scanned_blocks; | 70 | unsigned scanned_blocks; |
| 71 | unsigned long scan_start; | ||
| 72 | unsigned long scan_end; | ||
| 70 | }; | 73 | }; |
| 71 | 74 | ||
| 72 | /* | 75 | /* |
| @@ -145,6 +148,10 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block) | |||
| 145 | 148 | ||
| 146 | void drm_mm_init_scan(struct drm_mm *mm, unsigned long size, | 149 | void drm_mm_init_scan(struct drm_mm *mm, unsigned long size, |
| 147 | unsigned alignment); | 150 | unsigned alignment); |
| 151 | void drm_mm_init_scan_with_range(struct drm_mm *mm, unsigned long size, | ||
| 152 | unsigned alignment, | ||
| 153 | unsigned long start, | ||
| 154 | unsigned long end); | ||
| 148 | int drm_mm_scan_add_block(struct drm_mm_node *node); | 155 | int drm_mm_scan_add_block(struct drm_mm_node *node); |
| 149 | int drm_mm_scan_remove_block(struct drm_mm_node *node); | 156 | int drm_mm_scan_remove_block(struct drm_mm_node *node); |
| 150 | 157 | ||
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 883c1d43989..fe29ae328bd 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -142,6 +142,42 @@ | |||
| 142 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 142 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 143 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 143 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 144 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 144 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 145 | {0x1002, 0x6720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 146 | {0x1002, 0x6721, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 147 | {0x1002, 0x6722, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 148 | {0x1002, 0x6723, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 149 | {0x1002, 0x6724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 150 | {0x1002, 0x6725, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 151 | {0x1002, 0x6726, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 152 | {0x1002, 0x6727, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 153 | {0x1002, 0x6728, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 154 | {0x1002, 0x6729, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 155 | {0x1002, 0x6738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 156 | {0x1002, 0x6739, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
| 157 | {0x1002, 0x6740, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 158 | {0x1002, 0x6741, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 159 | {0x1002, 0x6742, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 160 | {0x1002, 0x6743, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 161 | {0x1002, 0x6744, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 162 | {0x1002, 0x6745, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 163 | {0x1002, 0x6746, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 164 | {0x1002, 0x6747, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 165 | {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 166 | {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 167 | {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 168 | {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 169 | {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
| 170 | {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 171 | {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 172 | {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 173 | {0x1002, 0x6763, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 174 | {0x1002, 0x6764, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 175 | {0x1002, 0x6765, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 176 | {0x1002, 0x6766, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 177 | {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 178 | {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 179 | {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 180 | {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
| 145 | {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 181 | {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 146 | {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 182 | {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 147 | {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 183 | {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| @@ -419,6 +455,10 @@ | |||
| 419 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 455 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 420 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 456 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 421 | {0x1002, 0x9715, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 457 | {0x1002, 0x9715, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 458 | {0x1002, 0x9802, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 459 | {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 460 | {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 461 | {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 422 | {0, 0, 0} | 462 | {0, 0, 0} |
| 423 | 463 | ||
| 424 | #define r128_PCI_IDS \ | 464 | #define r128_PCI_IDS \ |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index a2776e2807a..0039f1f97ad 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
| @@ -289,6 +289,7 @@ typedef struct drm_i915_irq_wait { | |||
| 289 | #define I915_PARAM_HAS_BLT 11 | 289 | #define I915_PARAM_HAS_BLT 11 |
| 290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 | 290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 |
| 291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 | 291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 |
| 292 | #define I915_PARAM_HAS_EXEC_CONSTANTS 14 | ||
| 292 | 293 | ||
| 293 | typedef struct drm_i915_getparam { | 294 | typedef struct drm_i915_getparam { |
| 294 | int param; | 295 | int param; |
| @@ -635,6 +636,17 @@ struct drm_i915_gem_execbuffer2 { | |||
| 635 | #define I915_EXEC_RENDER (1<<0) | 636 | #define I915_EXEC_RENDER (1<<0) |
| 636 | #define I915_EXEC_BSD (2<<0) | 637 | #define I915_EXEC_BSD (2<<0) |
| 637 | #define I915_EXEC_BLT (3<<0) | 638 | #define I915_EXEC_BLT (3<<0) |
| 639 | |||
| 640 | /* Used for switching the constants addressing mode on gen4+ RENDER ring. | ||
| 641 | * Gen6+ only supports relative addressing to dynamic state (default) and | ||
| 642 | * absolute addressing. | ||
| 643 | * | ||
| 644 | * These flags are ignored for the BSD and BLT rings. | ||
| 645 | */ | ||
| 646 | #define I915_EXEC_CONSTANTS_MASK (3<<6) | ||
| 647 | #define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */ | ||
| 648 | #define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) | ||
| 649 | #define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */ | ||
| 638 | __u64 flags; | 650 | __u64 flags; |
| 639 | __u64 rsvd1; | 651 | __u64 rsvd1; |
| 640 | __u64 rsvd2; | 652 | __u64 rsvd2; |
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index d3c81946f61..9e343c0998b 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h | |||
| @@ -2,17 +2,40 @@ | |||
| 2 | 2 | ||
| 3 | #ifndef _DRM_INTEL_GTT_H | 3 | #ifndef _DRM_INTEL_GTT_H |
| 4 | #define _DRM_INTEL_GTT_H | 4 | #define _DRM_INTEL_GTT_H |
| 5 | struct intel_gtt { | 5 | |
| 6 | /* Number of stolen gtt entries at the beginning. */ | 6 | const struct intel_gtt { |
| 7 | unsigned int gtt_stolen_entries; | 7 | /* Size of memory reserved for graphics by the BIOS */ |
| 8 | unsigned int stolen_size; | ||
| 8 | /* Total number of gtt entries. */ | 9 | /* Total number of gtt entries. */ |
| 9 | unsigned int gtt_total_entries; | 10 | unsigned int gtt_total_entries; |
| 10 | /* Part of the gtt that is mappable by the cpu, for those chips where | 11 | /* Part of the gtt that is mappable by the cpu, for those chips where |
| 11 | * this is not the full gtt. */ | 12 | * this is not the full gtt. */ |
| 12 | unsigned int gtt_mappable_entries; | 13 | unsigned int gtt_mappable_entries; |
| 13 | }; | 14 | /* Whether i915 needs to use the dmar apis or not. */ |
| 15 | unsigned int needs_dmar : 1; | ||
| 16 | } *intel_gtt_get(void); | ||
| 14 | 17 | ||
| 15 | struct intel_gtt *intel_gtt_get(void); | 18 | void intel_gtt_chipset_flush(void); |
| 19 | void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg); | ||
| 20 | void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries); | ||
| 21 | int intel_gtt_map_memory(struct page **pages, unsigned int num_entries, | ||
| 22 | struct scatterlist **sg_list, int *num_sg); | ||
| 23 | void intel_gtt_insert_sg_entries(struct scatterlist *sg_list, | ||
| 24 | unsigned int sg_len, | ||
| 25 | unsigned int pg_start, | ||
| 26 | unsigned int flags); | ||
| 27 | void intel_gtt_insert_pages(unsigned int first_entry, unsigned int num_entries, | ||
| 28 | struct page **pages, unsigned int flags); | ||
| 16 | 29 | ||
| 17 | #endif | 30 | /* Special gtt memory types */ |
| 31 | #define AGP_DCACHE_MEMORY 1 | ||
| 32 | #define AGP_PHYS_MEMORY 2 | ||
| 33 | |||
| 34 | /* New caching attributes for gen6/sandybridge */ | ||
| 35 | #define AGP_USER_CACHED_MEMORY_LLC_MLC (AGP_USER_TYPES + 2) | ||
| 36 | #define AGP_USER_UNCACHED_MEMORY (AGP_USER_TYPES + 4) | ||
| 18 | 37 | ||
| 38 | /* flag for GFDT type */ | ||
| 39 | #define AGP_USER_CACHED_MEMORY_GFDT (1 << 3) | ||
| 40 | |||
| 41 | #endif | ||
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index bc5590b1a1a..e2cfe80f6fc 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
| @@ -71,16 +71,14 @@ struct drm_nouveau_gpuobj_free { | |||
| 71 | #define NOUVEAU_GETPARAM_PCI_VENDOR 3 | 71 | #define NOUVEAU_GETPARAM_PCI_VENDOR 3 |
| 72 | #define NOUVEAU_GETPARAM_PCI_DEVICE 4 | 72 | #define NOUVEAU_GETPARAM_PCI_DEVICE 4 |
| 73 | #define NOUVEAU_GETPARAM_BUS_TYPE 5 | 73 | #define NOUVEAU_GETPARAM_BUS_TYPE 5 |
| 74 | #define NOUVEAU_GETPARAM_FB_PHYSICAL 6 | ||
| 75 | #define NOUVEAU_GETPARAM_AGP_PHYSICAL 7 | ||
| 76 | #define NOUVEAU_GETPARAM_FB_SIZE 8 | 74 | #define NOUVEAU_GETPARAM_FB_SIZE 8 |
| 77 | #define NOUVEAU_GETPARAM_AGP_SIZE 9 | 75 | #define NOUVEAU_GETPARAM_AGP_SIZE 9 |
| 78 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 | ||
| 79 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 | 76 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 |
| 80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 77 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
| 81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | 78 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 |
| 82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 | 79 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 |
| 83 | #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15 | 80 | #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15 |
| 81 | #define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16 | ||
| 84 | struct drm_nouveau_getparam { | 82 | struct drm_nouveau_getparam { |
| 85 | uint64_t param; | 83 | uint64_t param; |
| 86 | uint64_t value; | 84 | uint64_t value; |
| @@ -171,7 +169,6 @@ struct drm_nouveau_gem_pushbuf { | |||
| 171 | }; | 169 | }; |
| 172 | 170 | ||
| 173 | #define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001 | 171 | #define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001 |
| 174 | #define NOUVEAU_GEM_CPU_PREP_NOBLOCK 0x00000002 | ||
| 175 | #define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004 | 172 | #define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004 |
| 176 | struct drm_nouveau_gem_cpu_prep { | 173 | struct drm_nouveau_gem_cpu_prep { |
| 177 | uint32_t handle; | 174 | uint32_t handle; |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 10f8b53bdd4..e95a86b8b68 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
| @@ -906,6 +906,7 @@ struct drm_radeon_cs { | |||
| 906 | #define RADEON_INFO_ACCEL_WORKING2 0x05 | 906 | #define RADEON_INFO_ACCEL_WORKING2 0x05 |
| 907 | #define RADEON_INFO_TILING_CONFIG 0x06 | 907 | #define RADEON_INFO_TILING_CONFIG 0x06 |
| 908 | #define RADEON_INFO_WANT_HYPERZ 0x07 | 908 | #define RADEON_INFO_WANT_HYPERZ 0x07 |
| 909 | #define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */ | ||
| 909 | 910 | ||
| 910 | struct drm_radeon_info { | 911 | struct drm_radeon_info { |
| 911 | uint32_t request; | 912 | uint32_t request; |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index beafc156a53..50852aad260 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
| @@ -74,6 +74,8 @@ struct ttm_placement { | |||
| 74 | * @is_iomem: is this io memory ? | 74 | * @is_iomem: is this io memory ? |
| 75 | * @size: size in byte | 75 | * @size: size in byte |
| 76 | * @offset: offset from the base address | 76 | * @offset: offset from the base address |
| 77 | * @io_reserved_vm: The VM system has a refcount in @io_reserved_count | ||
| 78 | * @io_reserved_count: Refcounting the numbers of callers to ttm_mem_io_reserve | ||
| 77 | * | 79 | * |
| 78 | * Structure indicating the bus placement of an object. | 80 | * Structure indicating the bus placement of an object. |
| 79 | */ | 81 | */ |
| @@ -83,7 +85,8 @@ struct ttm_bus_placement { | |||
| 83 | unsigned long size; | 85 | unsigned long size; |
| 84 | unsigned long offset; | 86 | unsigned long offset; |
| 85 | bool is_iomem; | 87 | bool is_iomem; |
| 86 | bool io_reserved; | 88 | bool io_reserved_vm; |
| 89 | uint64_t io_reserved_count; | ||
| 87 | }; | 90 | }; |
| 88 | 91 | ||
| 89 | 92 | ||
| @@ -154,7 +157,6 @@ struct ttm_tt; | |||
| 154 | * keeps one refcount. When this refcount reaches zero, | 157 | * keeps one refcount. When this refcount reaches zero, |
| 155 | * the object is destroyed. | 158 | * the object is destroyed. |
| 156 | * @event_queue: Queue for processes waiting on buffer object status change. | 159 | * @event_queue: Queue for processes waiting on buffer object status change. |
| 157 | * @lock: spinlock protecting mostly synchronization members. | ||
| 158 | * @mem: structure describing current placement. | 160 | * @mem: structure describing current placement. |
| 159 | * @persistant_swap_storage: Usually the swap storage is deleted for buffers | 161 | * @persistant_swap_storage: Usually the swap storage is deleted for buffers |
| 160 | * pinned in physical memory. If this behaviour is not desired, this member | 162 | * pinned in physical memory. If this behaviour is not desired, this member |
| @@ -213,7 +215,6 @@ struct ttm_buffer_object { | |||
| 213 | struct kref kref; | 215 | struct kref kref; |
| 214 | struct kref list_kref; | 216 | struct kref list_kref; |
| 215 | wait_queue_head_t event_queue; | 217 | wait_queue_head_t event_queue; |
| 216 | spinlock_t lock; | ||
| 217 | 218 | ||
| 218 | /** | 219 | /** |
| 219 | * Members protected by the bo::reserved lock. | 220 | * Members protected by the bo::reserved lock. |
| @@ -237,6 +238,7 @@ struct ttm_buffer_object { | |||
| 237 | struct list_head lru; | 238 | struct list_head lru; |
| 238 | struct list_head ddestroy; | 239 | struct list_head ddestroy; |
| 239 | struct list_head swap; | 240 | struct list_head swap; |
| 241 | struct list_head io_reserve_lru; | ||
| 240 | uint32_t val_seq; | 242 | uint32_t val_seq; |
| 241 | bool seq_valid; | 243 | bool seq_valid; |
| 242 | 244 | ||
| @@ -248,10 +250,10 @@ struct ttm_buffer_object { | |||
| 248 | atomic_t reserved; | 250 | atomic_t reserved; |
| 249 | 251 | ||
| 250 | /** | 252 | /** |
| 251 | * Members protected by the bo::lock | 253 | * Members protected by struct buffer_object_device::fence_lock |
| 252 | * In addition, setting sync_obj to anything else | 254 | * In addition, setting sync_obj to anything else |
| 253 | * than NULL requires bo::reserved to be held. This allows for | 255 | * than NULL requires bo::reserved to be held. This allows for |
| 254 | * checking NULL while reserved but not holding bo::lock. | 256 | * checking NULL while reserved but not holding the mentioned lock. |
| 255 | */ | 257 | */ |
| 256 | 258 | ||
| 257 | void *sync_obj_arg; | 259 | void *sync_obj_arg; |
| @@ -364,6 +366,44 @@ extern int ttm_bo_validate(struct ttm_buffer_object *bo, | |||
| 364 | */ | 366 | */ |
| 365 | extern void ttm_bo_unref(struct ttm_buffer_object **bo); | 367 | extern void ttm_bo_unref(struct ttm_buffer_object **bo); |
| 366 | 368 | ||
| 369 | |||
| 370 | /** | ||
| 371 | * ttm_bo_list_ref_sub | ||
| 372 | * | ||
| 373 | * @bo: The buffer object. | ||
| 374 | * @count: The number of references with which to decrease @bo::list_kref; | ||
| 375 | * @never_free: The refcount should not reach zero with this operation. | ||
| 376 | * | ||
| 377 | * Release @count lru list references to this buffer object. | ||
| 378 | */ | ||
| 379 | extern void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, | ||
| 380 | bool never_free); | ||
| 381 | |||
| 382 | /** | ||
| 383 | * ttm_bo_add_to_lru | ||
| 384 | * | ||
| 385 | * @bo: The buffer object. | ||
| 386 | * | ||
| 387 | * Add this bo to the relevant mem type lru and, if it's backed by | ||
| 388 | * system pages (ttms) to the swap list. | ||
| 389 | * This function must be called with struct ttm_bo_global::lru_lock held, and | ||
| 390 | * is typically called immediately prior to unreserving a bo. | ||
| 391 | */ | ||
| 392 | extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); | ||
| 393 | |||
| 394 | /** | ||
| 395 | * ttm_bo_del_from_lru | ||
| 396 | * | ||
| 397 | * @bo: The buffer object. | ||
| 398 | * | ||
| 399 | * Remove this bo from all lru lists used to lookup and reserve an object. | ||
| 400 | * This function must be called with struct ttm_bo_global::lru_lock held, | ||
| 401 | * and is usually called just immediately after the bo has been reserved to | ||
| 402 | * avoid recursive reservation from lru lists. | ||
| 403 | */ | ||
| 404 | extern int ttm_bo_del_from_lru(struct ttm_buffer_object *bo); | ||
| 405 | |||
| 406 | |||
| 367 | /** | 407 | /** |
| 368 | * ttm_bo_lock_delayed_workqueue | 408 | * ttm_bo_lock_delayed_workqueue |
| 369 | * | 409 | * |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 8e0c848326b..1da8af6ac88 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -179,30 +179,6 @@ struct ttm_tt { | |||
| 179 | #define TTM_MEMTYPE_FLAG_MAPPABLE (1 << 1) /* Memory mappable */ | 179 | #define TTM_MEMTYPE_FLAG_MAPPABLE (1 << 1) /* Memory mappable */ |
| 180 | #define TTM_MEMTYPE_FLAG_CMA (1 << 3) /* Can't map aperture */ | 180 | #define TTM_MEMTYPE_FLAG_CMA (1 << 3) /* Can't map aperture */ |
| 181 | 181 | ||
| 182 | /** | ||
| 183 | * struct ttm_mem_type_manager | ||
| 184 | * | ||
| 185 | * @has_type: The memory type has been initialized. | ||
| 186 | * @use_type: The memory type is enabled. | ||
| 187 | * @flags: TTM_MEMTYPE_XX flags identifying the traits of the memory | ||
| 188 | * managed by this memory type. | ||
| 189 | * @gpu_offset: If used, the GPU offset of the first managed page of | ||
| 190 | * fixed memory or the first managed location in an aperture. | ||
| 191 | * @size: Size of the managed region. | ||
| 192 | * @available_caching: A mask of available caching types, TTM_PL_FLAG_XX, | ||
| 193 | * as defined in ttm_placement_common.h | ||
| 194 | * @default_caching: The default caching policy used for a buffer object | ||
| 195 | * placed in this memory type if the user doesn't provide one. | ||
| 196 | * @manager: The range manager used for this memory type. FIXME: If the aperture | ||
| 197 | * has a page size different from the underlying system, the granularity | ||
| 198 | * of this manager should take care of this. But the range allocating code | ||
| 199 | * in ttm_bo.c needs to be modified for this. | ||
| 200 | * @lru: The lru list for this memory type. | ||
| 201 | * | ||
| 202 | * This structure is used to identify and manage memory types for a device. | ||
| 203 | * It's set up by the ttm_bo_driver::init_mem_type method. | ||
| 204 | */ | ||
| 205 | |||
| 206 | struct ttm_mem_type_manager; | 182 | struct ttm_mem_type_manager; |
| 207 | 183 | ||
| 208 | struct ttm_mem_type_manager_func { | 184 | struct ttm_mem_type_manager_func { |
| @@ -287,6 +263,36 @@ struct ttm_mem_type_manager_func { | |||
| 287 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); | 263 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); |
| 288 | }; | 264 | }; |
| 289 | 265 | ||
| 266 | /** | ||
| 267 | * struct ttm_mem_type_manager | ||
| 268 | * | ||
| 269 | * @has_type: The memory type has been initialized. | ||
| 270 | * @use_type: The memory type is enabled. | ||
| 271 | * @flags: TTM_MEMTYPE_XX flags identifying the traits of the memory | ||
| 272 | * managed by this memory type. | ||
| 273 | * @gpu_offset: If used, the GPU offset of the first managed page of | ||
| 274 | * fixed memory or the first managed location in an aperture. | ||
| 275 | * @size: Size of the managed region. | ||
| 276 | * @available_caching: A mask of available caching types, TTM_PL_FLAG_XX, | ||
| 277 | * as defined in ttm_placement_common.h | ||
| 278 | * @default_caching: The default caching policy used for a buffer object | ||
| 279 | * placed in this memory type if the user doesn't provide one. | ||
| 280 | * @func: structure pointer implementing the range manager. See above | ||
| 281 | * @priv: Driver private closure for @func. | ||
| 282 | * @io_reserve_mutex: Mutex optionally protecting shared io_reserve structures | ||
| 283 | * @use_io_reserve_lru: Use an lru list to try to unreserve io_mem_regions | ||
| 284 | * reserved by the TTM vm system. | ||
| 285 | * @io_reserve_lru: Optional lru list for unreserving io mem regions. | ||
| 286 | * @io_reserve_fastpath: Only use bdev::driver::io_mem_reserve to obtain | ||
| 287 | * static information. bdev::driver::io_mem_free is never used. | ||
| 288 | * @lru: The lru list for this memory type. | ||
| 289 | * | ||
| 290 | * This structure is used to identify and manage memory types for a device. | ||
| 291 | * It's set up by the ttm_bo_driver::init_mem_type method. | ||
| 292 | */ | ||
| 293 | |||
| 294 | |||
| 295 | |||
| 290 | struct ttm_mem_type_manager { | 296 | struct ttm_mem_type_manager { |
| 291 | struct ttm_bo_device *bdev; | 297 | struct ttm_bo_device *bdev; |
| 292 | 298 | ||
| @@ -303,6 +309,15 @@ struct ttm_mem_type_manager { | |||
| 303 | uint32_t default_caching; | 309 | uint32_t default_caching; |
| 304 | const struct ttm_mem_type_manager_func *func; | 310 | const struct ttm_mem_type_manager_func *func; |
| 305 | void *priv; | 311 | void *priv; |
| 312 | struct mutex io_reserve_mutex; | ||
| 313 | bool use_io_reserve_lru; | ||
| 314 | bool io_reserve_fastpath; | ||
| 315 | |||
| 316 | /* | ||
| 317 | * Protected by @io_reserve_mutex: | ||
| 318 | */ | ||
| 319 | |||
| 320 | struct list_head io_reserve_lru; | ||
| 306 | 321 | ||
| 307 | /* | 322 | /* |
| 308 | * Protected by the global->lru_lock. | 323 | * Protected by the global->lru_lock. |
| @@ -510,9 +525,12 @@ struct ttm_bo_global { | |||
| 510 | * | 525 | * |
| 511 | * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. | 526 | * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. |
| 512 | * @man: An array of mem_type_managers. | 527 | * @man: An array of mem_type_managers. |
| 528 | * @fence_lock: Protects the synchronizing members on *all* bos belonging | ||
| 529 | * to this device. | ||
| 513 | * @addr_space_mm: Range manager for the device address space. | 530 | * @addr_space_mm: Range manager for the device address space. |
| 514 | * lru_lock: Spinlock that protects the buffer+device lru lists and | 531 | * lru_lock: Spinlock that protects the buffer+device lru lists and |
| 515 | * ddestroy lists. | 532 | * ddestroy lists. |
| 533 | * @val_seq: Current validation sequence. | ||
| 516 | * @nice_mode: Try nicely to wait for buffer idle when cleaning a manager. | 534 | * @nice_mode: Try nicely to wait for buffer idle when cleaning a manager. |
| 517 | * If a GPU lockup has been detected, this is forced to 0. | 535 | * If a GPU lockup has been detected, this is forced to 0. |
| 518 | * @dev_mapping: A pointer to the struct address_space representing the | 536 | * @dev_mapping: A pointer to the struct address_space representing the |
| @@ -531,6 +549,7 @@ struct ttm_bo_device { | |||
| 531 | struct ttm_bo_driver *driver; | 549 | struct ttm_bo_driver *driver; |
| 532 | rwlock_t vm_lock; | 550 | rwlock_t vm_lock; |
| 533 | struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; | 551 | struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; |
| 552 | spinlock_t fence_lock; | ||
| 534 | /* | 553 | /* |
| 535 | * Protected by the vm lock. | 554 | * Protected by the vm lock. |
| 536 | */ | 555 | */ |
| @@ -541,6 +560,7 @@ struct ttm_bo_device { | |||
| 541 | * Protected by the global:lru lock. | 560 | * Protected by the global:lru lock. |
| 542 | */ | 561 | */ |
| 543 | struct list_head ddestroy; | 562 | struct list_head ddestroy; |
| 563 | uint32_t val_seq; | ||
| 544 | 564 | ||
| 545 | /* | 565 | /* |
| 546 | * Protected by load / firstopen / lastclose /unload sync. | 566 | * Protected by load / firstopen / lastclose /unload sync. |
| @@ -753,31 +773,6 @@ extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, | |||
| 753 | 773 | ||
| 754 | extern int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait); | 774 | extern int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait); |
| 755 | 775 | ||
| 756 | /** | ||
| 757 | * ttm_bo_pci_offset - Get the PCI offset for the buffer object memory. | ||
| 758 | * | ||
| 759 | * @bo Pointer to a struct ttm_buffer_object. | ||
| 760 | * @bus_base On return the base of the PCI region | ||
| 761 | * @bus_offset On return the byte offset into the PCI region | ||
| 762 | * @bus_size On return the byte size of the buffer object or zero if | ||
| 763 | * the buffer object memory is not accessible through a PCI region. | ||
| 764 | * | ||
| 765 | * Returns: | ||
| 766 | * -EINVAL if the buffer object is currently not mappable. | ||
| 767 | * 0 otherwise. | ||
| 768 | */ | ||
| 769 | |||
| 770 | extern int ttm_bo_pci_offset(struct ttm_bo_device *bdev, | ||
| 771 | struct ttm_mem_reg *mem, | ||
| 772 | unsigned long *bus_base, | ||
| 773 | unsigned long *bus_offset, | ||
| 774 | unsigned long *bus_size); | ||
| 775 | |||
| 776 | extern int ttm_mem_io_reserve(struct ttm_bo_device *bdev, | ||
| 777 | struct ttm_mem_reg *mem); | ||
| 778 | extern void ttm_mem_io_free(struct ttm_bo_device *bdev, | ||
| 779 | struct ttm_mem_reg *mem); | ||
| 780 | |||
| 781 | extern void ttm_bo_global_release(struct drm_global_reference *ref); | 776 | extern void ttm_bo_global_release(struct drm_global_reference *ref); |
| 782 | extern int ttm_bo_global_init(struct drm_global_reference *ref); | 777 | extern int ttm_bo_global_init(struct drm_global_reference *ref); |
| 783 | 778 | ||
| @@ -810,6 +805,22 @@ extern int ttm_bo_device_init(struct ttm_bo_device *bdev, | |||
| 810 | extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | 805 | extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); |
| 811 | 806 | ||
| 812 | /** | 807 | /** |
| 808 | * ttm_bo_unmap_virtual | ||
| 809 | * | ||
| 810 | * @bo: tear down the virtual mappings for this BO | ||
| 811 | * | ||
| 812 | * The caller must take ttm_mem_io_lock before calling this function. | ||
| 813 | */ | ||
| 814 | extern void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo); | ||
| 815 | |||
| 816 | extern int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo); | ||
| 817 | extern void ttm_mem_io_free_vm(struct ttm_buffer_object *bo); | ||
| 818 | extern int ttm_mem_io_lock(struct ttm_mem_type_manager *man, | ||
| 819 | bool interruptible); | ||
| 820 | extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); | ||
| 821 | |||
| 822 | |||
| 823 | /** | ||
| 813 | * ttm_bo_reserve: | 824 | * ttm_bo_reserve: |
| 814 | * | 825 | * |
| 815 | * @bo: A pointer to a struct ttm_buffer_object. | 826 | * @bo: A pointer to a struct ttm_buffer_object. |
| @@ -859,11 +870,44 @@ extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | |||
| 859 | * try again. (only if use_sequence == 1). | 870 | * try again. (only if use_sequence == 1). |
| 860 | * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by | 871 | * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by |
| 861 | * a signal. Release all buffer reservations and return to user-space. | 872 | * a signal. Release all buffer reservations and return to user-space. |
| 873 | * -EBUSY: The function needed to sleep, but @no_wait was true | ||
| 874 | * -EDEADLK: Bo already reserved using @sequence. This error code will only | ||
| 875 | * be returned if @use_sequence is set to true. | ||
| 862 | */ | 876 | */ |
| 863 | extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | 877 | extern int ttm_bo_reserve(struct ttm_buffer_object *bo, |
| 864 | bool interruptible, | 878 | bool interruptible, |
| 865 | bool no_wait, bool use_sequence, uint32_t sequence); | 879 | bool no_wait, bool use_sequence, uint32_t sequence); |
| 866 | 880 | ||
| 881 | |||
| 882 | /** | ||
| 883 | * ttm_bo_reserve_locked: | ||
| 884 | * | ||
| 885 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 886 | * @interruptible: Sleep interruptible if waiting. | ||
| 887 | * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY. | ||
| 888 | * @use_sequence: If @bo is already reserved, Only sleep waiting for | ||
| 889 | * it to become unreserved if @sequence < (@bo)->sequence. | ||
| 890 | * | ||
| 891 | * Must be called with struct ttm_bo_global::lru_lock held, | ||
| 892 | * and will not remove reserved buffers from the lru lists. | ||
| 893 | * The function may release the LRU spinlock if it needs to sleep. | ||
| 894 | * Otherwise identical to ttm_bo_reserve. | ||
| 895 | * | ||
| 896 | * Returns: | ||
| 897 | * -EAGAIN: The reservation may cause a deadlock. | ||
| 898 | * Release all buffer reservations, wait for @bo to become unreserved and | ||
| 899 | * try again. (only if use_sequence == 1). | ||
| 900 | * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by | ||
| 901 | * a signal. Release all buffer reservations and return to user-space. | ||
| 902 | * -EBUSY: The function needed to sleep, but @no_wait was true | ||
| 903 | * -EDEADLK: Bo already reserved using @sequence. This error code will only | ||
| 904 | * be returned if @use_sequence is set to true. | ||
| 905 | */ | ||
| 906 | extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | ||
| 907 | bool interruptible, | ||
| 908 | bool no_wait, bool use_sequence, | ||
| 909 | uint32_t sequence); | ||
| 910 | |||
| 867 | /** | 911 | /** |
| 868 | * ttm_bo_unreserve | 912 | * ttm_bo_unreserve |
| 869 | * | 913 | * |
| @@ -874,6 +918,16 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
| 874 | extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); | 918 | extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); |
| 875 | 919 | ||
| 876 | /** | 920 | /** |
| 921 | * ttm_bo_unreserve_locked | ||
| 922 | * | ||
| 923 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 924 | * | ||
| 925 | * Unreserve a previous reservation of @bo. | ||
| 926 | * Needs to be called with struct ttm_bo_global::lru_lock held. | ||
| 927 | */ | ||
| 928 | extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); | ||
| 929 | |||
| 930 | /** | ||
| 877 | * ttm_bo_wait_unreserved | 931 | * ttm_bo_wait_unreserved |
| 878 | * | 932 | * |
| 879 | * @bo: A pointer to a struct ttm_buffer_object. | 933 | * @bo: A pointer to a struct ttm_buffer_object. |
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h index cd2c475da9e..26cc7f9ffa4 100644 --- a/include/drm/ttm/ttm_execbuf_util.h +++ b/include/drm/ttm/ttm_execbuf_util.h | |||
| @@ -41,7 +41,10 @@ | |||
| 41 | * @bo: refcounted buffer object pointer. | 41 | * @bo: refcounted buffer object pointer. |
| 42 | * @new_sync_obj_arg: New sync_obj_arg for @bo, to be used once | 42 | * @new_sync_obj_arg: New sync_obj_arg for @bo, to be used once |
| 43 | * adding a new sync object. | 43 | * adding a new sync object. |
| 44 | * @reservied: Indicates whether @bo has been reserved for validation. | 44 | * @reserved: Indicates whether @bo has been reserved for validation. |
| 45 | * @removed: Indicates whether @bo has been removed from lru lists. | ||
| 46 | * @put_count: Number of outstanding references on bo::list_kref. | ||
| 47 | * @old_sync_obj: Pointer to a sync object about to be unreferenced | ||
| 45 | */ | 48 | */ |
| 46 | 49 | ||
| 47 | struct ttm_validate_buffer { | 50 | struct ttm_validate_buffer { |
| @@ -49,6 +52,9 @@ struct ttm_validate_buffer { | |||
| 49 | struct ttm_buffer_object *bo; | 52 | struct ttm_buffer_object *bo; |
| 50 | void *new_sync_obj_arg; | 53 | void *new_sync_obj_arg; |
| 51 | bool reserved; | 54 | bool reserved; |
| 55 | bool removed; | ||
| 56 | int put_count; | ||
| 57 | void *old_sync_obj; | ||
| 52 | }; | 58 | }; |
| 53 | 59 | ||
| 54 | /** | 60 | /** |
| @@ -66,7 +72,6 @@ extern void ttm_eu_backoff_reservation(struct list_head *list); | |||
| 66 | * function ttm_eu_reserve_buffers | 72 | * function ttm_eu_reserve_buffers |
| 67 | * | 73 | * |
| 68 | * @list: thread private list of ttm_validate_buffer structs. | 74 | * @list: thread private list of ttm_validate_buffer structs. |
| 69 | * @val_seq: A unique sequence number. | ||
| 70 | * | 75 | * |
| 71 | * Tries to reserve bos pointed to by the list entries for validation. | 76 | * Tries to reserve bos pointed to by the list entries for validation. |
| 72 | * If the function returns 0, all buffers are marked as "unfenced", | 77 | * If the function returns 0, all buffers are marked as "unfenced", |
| @@ -88,7 +93,7 @@ extern void ttm_eu_backoff_reservation(struct list_head *list); | |||
| 88 | * has failed. | 93 | * has failed. |
| 89 | */ | 94 | */ |
| 90 | 95 | ||
| 91 | extern int ttm_eu_reserve_buffers(struct list_head *list, uint32_t val_seq); | 96 | extern int ttm_eu_reserve_buffers(struct list_head *list); |
| 92 | 97 | ||
| 93 | /** | 98 | /** |
| 94 | * function ttm_eu_fence_buffer_objects. | 99 | * function ttm_eu_fence_buffer_objects. |
diff --git a/include/keys/encrypted-type.h b/include/keys/encrypted-type.h new file mode 100644 index 00000000000..95855017a32 --- /dev/null +++ b/include/keys/encrypted-type.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 IBM Corporation | ||
| 3 | * Author: Mimi Zohar <zohar@us.ibm.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, version 2 of the License. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _KEYS_ENCRYPTED_TYPE_H | ||
| 11 | #define _KEYS_ENCRYPTED_TYPE_H | ||
| 12 | |||
| 13 | #include <linux/key.h> | ||
| 14 | #include <linux/rcupdate.h> | ||
| 15 | |||
| 16 | struct encrypted_key_payload { | ||
| 17 | struct rcu_head rcu; | ||
| 18 | char *master_desc; /* datablob: master key name */ | ||
| 19 | char *datalen; /* datablob: decrypted key length */ | ||
| 20 | u8 *iv; /* datablob: iv */ | ||
| 21 | u8 *encrypted_data; /* datablob: encrypted data */ | ||
| 22 | unsigned short datablob_len; /* length of datablob */ | ||
| 23 | unsigned short decrypted_datalen; /* decrypted data length */ | ||
| 24 | u8 decrypted_data[0]; /* decrypted data + datablob + hmac */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | extern struct key_type key_type_encrypted; | ||
| 28 | |||
| 29 | #endif /* _KEYS_ENCRYPTED_TYPE_H */ | ||
diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h new file mode 100644 index 00000000000..56f82e5c997 --- /dev/null +++ b/include/keys/trusted-type.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 IBM Corporation | ||
| 3 | * Author: David Safford <safford@us.ibm.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, version 2 of the License. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _KEYS_TRUSTED_TYPE_H | ||
| 11 | #define _KEYS_TRUSTED_TYPE_H | ||
| 12 | |||
| 13 | #include <linux/key.h> | ||
| 14 | #include <linux/rcupdate.h> | ||
| 15 | |||
| 16 | #define MIN_KEY_SIZE 32 | ||
| 17 | #define MAX_KEY_SIZE 128 | ||
| 18 | #define MAX_BLOB_SIZE 320 | ||
| 19 | |||
| 20 | struct trusted_key_payload { | ||
| 21 | struct rcu_head rcu; | ||
| 22 | unsigned int key_len; | ||
| 23 | unsigned int blob_len; | ||
| 24 | unsigned char migratable; | ||
| 25 | unsigned char key[MAX_KEY_SIZE + 1]; | ||
| 26 | unsigned char blob[MAX_BLOB_SIZE]; | ||
| 27 | }; | ||
| 28 | |||
| 29 | extern struct key_type key_type_trusted; | ||
| 30 | |||
| 31 | #endif /* _KEYS_TRUSTED_TYPE_H */ | ||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index a354c199ab9..2296d8b1931 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -20,15 +20,18 @@ header-y += wimax/ | |||
| 20 | objhdr-y += version.h | 20 | objhdr-y += version.h |
| 21 | 21 | ||
| 22 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | 22 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
| 23 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 23 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ |
| 24 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) | ||
| 24 | header-y += a.out.h | 25 | header-y += a.out.h |
| 25 | endif | 26 | endif |
| 26 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | 27 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
| 27 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 28 | $(srctree)/include/asm-$(SRCARCH)/kvm.h \ |
| 29 | $(INSTALL_HDR_PATH)/include/asm-*/kvm.h),) | ||
| 28 | header-y += kvm.h | 30 | header-y += kvm.h |
| 29 | endif | 31 | endif |
| 30 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | 32 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ |
| 31 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | 33 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h \ |
| 34 | $(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),) | ||
| 32 | header-y += kvm_para.h | 35 | header-y += kvm_para.h |
| 33 | endif | 36 | endif |
| 34 | 37 | ||
| @@ -155,6 +158,7 @@ header-y += icmpv6.h | |||
| 155 | header-y += if.h | 158 | header-y += if.h |
| 156 | header-y += if_addr.h | 159 | header-y += if_addr.h |
| 157 | header-y += if_addrlabel.h | 160 | header-y += if_addrlabel.h |
| 161 | header-y += if_alg.h | ||
| 158 | header-y += if_arcnet.h | 162 | header-y += if_arcnet.h |
| 159 | header-y += if_arp.h | 163 | header-y += if_arp.h |
| 160 | header-y += if_bonding.h | 164 | header-y += if_bonding.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 67c91b4418b..a2e910e0129 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 00000000000..7180013a4a3 --- /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/agp_backend.h b/include/linux/agp_backend.h index 09ea4a1e950..eaf6cd75a1b 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
| @@ -102,10 +102,8 @@ extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, | |||
| 102 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); | 102 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); |
| 103 | extern int agp_bind_memory(struct agp_memory *, off_t); | 103 | extern int agp_bind_memory(struct agp_memory *, off_t); |
| 104 | extern int agp_unbind_memory(struct agp_memory *); | 104 | extern int agp_unbind_memory(struct agp_memory *); |
| 105 | extern int agp_rebind_memory(void); | ||
| 106 | extern void agp_enable(struct agp_bridge_data *, u32); | 105 | extern void agp_enable(struct agp_bridge_data *, u32); |
| 107 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 106 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
| 108 | extern void agp_backend_release(struct agp_bridge_data *); | 107 | extern void agp_backend_release(struct agp_bridge_data *); |
| 109 | extern void agp_flush_chipset(struct agp_bridge_data *); | ||
| 110 | 108 | ||
| 111 | #endif /* _AGP_BACKEND_H */ | 109 | #endif /* _AGP_BACKEND_H */ |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 521a0f8974a..3111385b8ca 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/audit.h b/include/linux/audit.h index 8b5c0620abf..359df048769 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -372,6 +372,7 @@ struct audit_buffer; | |||
| 372 | struct audit_context; | 372 | struct audit_context; |
| 373 | struct inode; | 373 | struct inode; |
| 374 | struct netlink_skb_parms; | 374 | struct netlink_skb_parms; |
| 375 | struct path; | ||
| 375 | struct linux_binprm; | 376 | struct linux_binprm; |
| 376 | struct mq_attr; | 377 | struct mq_attr; |
| 377 | struct mqstat; | 378 | struct mqstat; |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 8b49ac48a5b..e02982fa295 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 64a7114a939..c3d6512eded 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 36ab42c9bb9..4d18ff34670 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/capability.h b/include/linux/capability.h index 90012b9ddbf..fb16a3699b9 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -246,7 +246,6 @@ struct cpu_vfs_cap_data { | |||
| 246 | /* Allow configuration of the secure attention key */ | 246 | /* Allow configuration of the secure attention key */ |
| 247 | /* Allow administration of the random device */ | 247 | /* Allow administration of the random device */ |
| 248 | /* Allow examination and configuration of disk quotas */ | 248 | /* Allow examination and configuration of disk quotas */ |
| 249 | /* Allow configuring the kernel's syslog (printk behaviour) */ | ||
| 250 | /* Allow setting the domainname */ | 249 | /* Allow setting the domainname */ |
| 251 | /* Allow setting the hostname */ | 250 | /* Allow setting the hostname */ |
| 252 | /* Allow calling bdflush() */ | 251 | /* Allow calling bdflush() */ |
| @@ -352,7 +351,11 @@ struct cpu_vfs_cap_data { | |||
| 352 | 351 | ||
| 353 | #define CAP_MAC_ADMIN 33 | 352 | #define CAP_MAC_ADMIN 33 |
| 354 | 353 | ||
| 355 | #define CAP_LAST_CAP CAP_MAC_ADMIN | 354 | /* Allow configuring the kernel's syslog (printk behaviour) */ |
| 355 | |||
| 356 | #define CAP_SYSLOG 34 | ||
| 357 | |||
| 358 | #define CAP_LAST_CAP CAP_SYSLOG | ||
| 356 | 359 | ||
| 357 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | 360 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) |
| 358 | 361 | ||
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index f389e319a45..fb4591977b0 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 78e90479662..35eae4b6750 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 c3c74aef289..09dcc0c2ffd 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 a108b425fee..c3011beac30 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 ed4ba111bc8..ce104e33cd2 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 c910b5eb1ce..00000000000 --- 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 e35071b1de0..00000000000 --- 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 4ccc59c1ea8..00000000000 --- 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 5ac51552d90..dfa2ed4c0d2 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 bf972f81e2a..3104aaff5dd 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 1be416bbbb8..36719ead50e 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 6fc2bed368b..0e7bf272ec2 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 d5a1d4810b8..6fe2114f8ad 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 bd07758943e..f958c19e3ca 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) |
| @@ -307,7 +314,7 @@ extern struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | |||
| 307 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok | 314 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok |
| 308 | * @dentry: dentry to take a ref on | 315 | * @dentry: dentry to take a ref on |
| 309 | * @seq: seqcount to verify against | 316 | * @seq: seqcount to verify against |
| 310 | * @Returns: 0 on failure, else 1. | 317 | * Returns: 0 on failure, else 1. |
| 311 | * | 318 | * |
| 312 | * __d_rcu_to_refcount operates on a dentry,seq pair that was returned | 319 | * __d_rcu_to_refcount operates on a dentry,seq pair that was returned |
| 313 | * by __d_lookup_rcu, to get a reference on an rcu-walk dentry. | 320 | * by __d_lookup_rcu, to get a reference on an rcu-walk 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/dcookies.h b/include/linux/dcookies.h index 24c806f12a6..5ac3bdd5cee 100644 --- a/include/linux/dcookies.h +++ b/include/linux/dcookies.h | |||
| @@ -13,10 +13,10 @@ | |||
| 13 | #ifdef CONFIG_PROFILING | 13 | #ifdef CONFIG_PROFILING |
| 14 | 14 | ||
| 15 | #include <linux/dcache.h> | 15 | #include <linux/dcache.h> |
| 16 | #include <linux/path.h> | ||
| 17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 18 | 17 | ||
| 19 | struct dcookie_user; | 18 | struct dcookie_user; |
| 19 | struct path; | ||
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * dcookie_register - register a user of dcookies | 22 | * dcookie_register - register a user of dcookies |
diff --git a/include/linux/decompress/inflate.h b/include/linux/decompress/inflate.h index f9b06ccc3e5..8c0aef1ba5f 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 ad5ec1d0475..4cb72b920c7 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 00000000000..41728fc6c8a --- /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 2970022faa6..272496d1fae 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/device.h b/include/linux/device.h index dd489531346..1bf5cf0b451 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -30,9 +30,8 @@ struct device_private; | |||
| 30 | struct device_driver; | 30 | struct device_driver; |
| 31 | struct driver_private; | 31 | struct driver_private; |
| 32 | struct class; | 32 | struct class; |
| 33 | struct class_private; | 33 | struct subsys_private; |
| 34 | struct bus_type; | 34 | struct bus_type; |
| 35 | struct bus_type_private; | ||
| 36 | struct device_node; | 35 | struct device_node; |
| 37 | 36 | ||
| 38 | struct bus_attribute { | 37 | struct bus_attribute { |
| @@ -65,7 +64,7 @@ struct bus_type { | |||
| 65 | 64 | ||
| 66 | const struct dev_pm_ops *pm; | 65 | const struct dev_pm_ops *pm; |
| 67 | 66 | ||
| 68 | struct bus_type_private *p; | 67 | struct subsys_private *p; |
| 69 | }; | 68 | }; |
| 70 | 69 | ||
| 71 | extern int __must_check bus_register(struct bus_type *bus); | 70 | extern int __must_check bus_register(struct bus_type *bus); |
| @@ -197,6 +196,7 @@ struct class { | |||
| 197 | 196 | ||
| 198 | struct class_attribute *class_attrs; | 197 | struct class_attribute *class_attrs; |
| 199 | struct device_attribute *dev_attrs; | 198 | struct device_attribute *dev_attrs; |
| 199 | struct bin_attribute *dev_bin_attrs; | ||
| 200 | struct kobject *dev_kobj; | 200 | struct kobject *dev_kobj; |
| 201 | 201 | ||
| 202 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 202 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
| @@ -213,7 +213,7 @@ struct class { | |||
| 213 | 213 | ||
| 214 | const struct dev_pm_ops *pm; | 214 | const struct dev_pm_ops *pm; |
| 215 | 215 | ||
| 216 | struct class_private *p; | 216 | struct subsys_private *p; |
| 217 | }; | 217 | }; |
| 218 | 218 | ||
| 219 | struct class_dev_iter { | 219 | struct class_dev_iter { |
| @@ -508,13 +508,13 @@ static inline int device_is_registered(struct device *dev) | |||
| 508 | 508 | ||
| 509 | static inline void device_enable_async_suspend(struct device *dev) | 509 | static inline void device_enable_async_suspend(struct device *dev) |
| 510 | { | 510 | { |
| 511 | if (dev->power.status == DPM_ON) | 511 | if (!dev->power.in_suspend) |
| 512 | dev->power.async_suspend = true; | 512 | dev->power.async_suspend = true; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static inline void device_disable_async_suspend(struct device *dev) | 515 | static inline void device_disable_async_suspend(struct device *dev) |
| 516 | { | 516 | { |
| 517 | if (dev->power.status == DPM_ON) | 517 | if (!dev->power.in_suspend) |
| 518 | dev->power.async_suspend = false; | 518 | dev->power.async_suspend = false; |
| 519 | } | 519 | } |
| 520 | 520 | ||
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 49eab360d5d..78bbf47bbb9 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 0c3c3a2110c..eeace7d3ff1 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 8cd00ad98d3..9bebd7f16ef 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/dynamic_debug.h b/include/linux/dynamic_debug.h index a90b3892074..1c70028f81f 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
| @@ -44,34 +44,24 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, | |||
| 44 | extern int ddebug_remove_module(const char *mod_name); | 44 | extern int ddebug_remove_module(const char *mod_name); |
| 45 | 45 | ||
| 46 | #define dynamic_pr_debug(fmt, ...) do { \ | 46 | #define dynamic_pr_debug(fmt, ...) do { \ |
| 47 | __label__ do_printk; \ | ||
| 48 | __label__ out; \ | ||
| 49 | static struct _ddebug descriptor \ | 47 | static struct _ddebug descriptor \ |
| 50 | __used \ | 48 | __used \ |
| 51 | __attribute__((section("__verbose"), aligned(8))) = \ | 49 | __attribute__((section("__verbose"), aligned(8))) = \ |
| 52 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 50 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
| 53 | _DPRINTK_FLAGS_DEFAULT }; \ | 51 | _DPRINTK_FLAGS_DEFAULT }; \ |
| 54 | JUMP_LABEL(&descriptor.enabled, do_printk); \ | 52 | if (unlikely(descriptor.enabled)) \ |
| 55 | goto out; \ | 53 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ |
| 56 | do_printk: \ | ||
| 57 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ | ||
| 58 | out: ; \ | ||
| 59 | } while (0) | 54 | } while (0) |
| 60 | 55 | ||
| 61 | 56 | ||
| 62 | #define dynamic_dev_dbg(dev, fmt, ...) do { \ | 57 | #define dynamic_dev_dbg(dev, fmt, ...) do { \ |
| 63 | __label__ do_printk; \ | ||
| 64 | __label__ out; \ | ||
| 65 | static struct _ddebug descriptor \ | 58 | static struct _ddebug descriptor \ |
| 66 | __used \ | 59 | __used \ |
| 67 | __attribute__((section("__verbose"), aligned(8))) = \ | 60 | __attribute__((section("__verbose"), aligned(8))) = \ |
| 68 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | 61 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ |
| 69 | _DPRINTK_FLAGS_DEFAULT }; \ | 62 | _DPRINTK_FLAGS_DEFAULT }; \ |
| 70 | JUMP_LABEL(&descriptor.enabled, do_printk); \ | 63 | if (unlikely(descriptor.enabled)) \ |
| 71 | goto out; \ | 64 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ |
| 72 | do_printk: \ | ||
| 73 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ | ||
| 74 | out: ; \ | ||
| 75 | } while (0) | 65 | } while (0) |
| 76 | 66 | ||
| 77 | #else | 67 | #else |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 6ce1bca0172..65990ef612f 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -724,21 +724,30 @@ struct ext3_dir_entry_2 { | |||
| 724 | ~EXT3_DIR_ROUND) | 724 | ~EXT3_DIR_ROUND) |
| 725 | #define EXT3_MAX_REC_LEN ((1<<16)-1) | 725 | #define EXT3_MAX_REC_LEN ((1<<16)-1) |
| 726 | 726 | ||
| 727 | /* | ||
| 728 | * Tests against MAX_REC_LEN etc were put in place for 64k block | ||
| 729 | * sizes; if that is not possible on this arch, we can skip | ||
| 730 | * those tests and speed things up. | ||
| 731 | */ | ||
| 727 | static inline unsigned ext3_rec_len_from_disk(__le16 dlen) | 732 | static inline unsigned ext3_rec_len_from_disk(__le16 dlen) |
| 728 | { | 733 | { |
| 729 | unsigned len = le16_to_cpu(dlen); | 734 | unsigned len = le16_to_cpu(dlen); |
| 730 | 735 | ||
| 736 | #if (PAGE_CACHE_SIZE >= 65536) | ||
| 731 | if (len == EXT3_MAX_REC_LEN) | 737 | if (len == EXT3_MAX_REC_LEN) |
| 732 | return 1 << 16; | 738 | return 1 << 16; |
| 739 | #endif | ||
| 733 | return len; | 740 | return len; |
| 734 | } | 741 | } |
| 735 | 742 | ||
| 736 | static inline __le16 ext3_rec_len_to_disk(unsigned len) | 743 | static inline __le16 ext3_rec_len_to_disk(unsigned len) |
| 737 | { | 744 | { |
| 745 | #if (PAGE_CACHE_SIZE >= 65536) | ||
| 738 | if (len == (1 << 16)) | 746 | if (len == (1 << 16)) |
| 739 | return cpu_to_le16(EXT3_MAX_REC_LEN); | 747 | return cpu_to_le16(EXT3_MAX_REC_LEN); |
| 740 | else if (len > (1 << 16)) | 748 | else if (len > (1 << 16)) |
| 741 | BUG(); | 749 | BUG(); |
| 750 | #endif | ||
| 742 | return cpu_to_le16(len); | 751 | return cpu_to_le16(len); |
| 743 | } | 752 | } |
| 744 | 753 | ||
| @@ -856,6 +865,7 @@ extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, | |||
| 856 | extern int ext3_should_retry_alloc(struct super_block *sb, int *retries); | 865 | extern int ext3_should_retry_alloc(struct super_block *sb, int *retries); |
| 857 | extern void ext3_init_block_alloc_info(struct inode *); | 866 | extern void ext3_init_block_alloc_info(struct inode *); |
| 858 | extern void ext3_rsv_window_add(struct super_block *sb, struct ext3_reserve_window_node *rsv); | 867 | extern void ext3_rsv_window_add(struct super_block *sb, struct ext3_reserve_window_node *rsv); |
| 868 | extern int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range); | ||
| 859 | 869 | ||
| 860 | /* dir.c */ | 870 | /* dir.c */ |
| 861 | extern int ext3_check_dir_entry(const char *, struct inode *, | 871 | extern int ext3_check_dir_entry(const char *, struct inode *, |
diff --git a/include/linux/falloc.h b/include/linux/falloc.h index 3c155107d61..73e0b628e05 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 afc00af3229..a562fa5fb4e 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 b1e12970f61..e85baebf627 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 68c642d8843..59ea406be7f 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/firewire.h b/include/linux/firewire.h index 1cd637ef62d..9a3f5f9383f 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -302,9 +302,9 @@ struct fw_packet { | |||
| 302 | struct fw_transaction { | 302 | struct fw_transaction { |
| 303 | int node_id; /* The generation is implied; it is always the current. */ | 303 | int node_id; /* The generation is implied; it is always the current. */ |
| 304 | int tlabel; | 304 | int tlabel; |
| 305 | int timestamp; | ||
| 306 | struct list_head link; | 305 | struct list_head link; |
| 307 | struct fw_card *card; | 306 | struct fw_card *card; |
| 307 | bool is_split_transaction; | ||
| 308 | struct timer_list split_timeout_timer; | 308 | struct timer_list split_timeout_timer; |
| 309 | 309 | ||
| 310 | struct fw_packet packet; | 310 | struct fw_packet packet; |
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index c6dcc1dfe78..43fe52fcef0 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #define _LINUX_FIRMWARE_MAP_H | 17 | #define _LINUX_FIRMWARE_MAP_H |
| 18 | 18 | ||
| 19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
| 20 | #include <linux/kobject.h> | ||
| 21 | 20 | ||
| 22 | /* | 21 | /* |
| 23 | * provide a dummy interface if CONFIG_FIRMWARE_MEMMAP is disabled | 22 | * provide a dummy interface if CONFIG_FIRMWARE_MEMMAP is disabled |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 631b77f2ac7..70e4efabe0f 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
| @@ -71,7 +71,7 @@ void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | |||
| 71 | int flex_array_shrink(struct flex_array *fa); | 71 | int flex_array_shrink(struct flex_array *fa); |
| 72 | 72 | ||
| 73 | #define flex_array_put_ptr(fa, nr, src, gfp) \ | 73 | #define flex_array_put_ptr(fa, nr, src, gfp) \ |
| 74 | flex_array_put(fa, nr, &(void *)(src), gfp) | 74 | flex_array_put(fa, nr, (void *)&(src), gfp) |
| 75 | 75 | ||
| 76 | void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr); | 76 | void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr); |
| 77 | 77 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index baf3e556ff0..32b38cd829d 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. */ |
| @@ -382,7 +384,6 @@ struct inodes_stat_t { | |||
| 382 | #include <linux/path.h> | 384 | #include <linux/path.h> |
| 383 | #include <linux/stat.h> | 385 | #include <linux/stat.h> |
| 384 | #include <linux/cache.h> | 386 | #include <linux/cache.h> |
| 385 | #include <linux/kobject.h> | ||
| 386 | #include <linux/list.h> | 387 | #include <linux/list.h> |
| 387 | #include <linux/radix-tree.h> | 388 | #include <linux/radix-tree.h> |
| 388 | #include <linux/prio_tree.h> | 389 | #include <linux/prio_tree.h> |
| @@ -402,6 +403,7 @@ struct hd_geometry; | |||
| 402 | struct iovec; | 403 | struct iovec; |
| 403 | struct nameidata; | 404 | struct nameidata; |
| 404 | struct kiocb; | 405 | struct kiocb; |
| 406 | struct kobject; | ||
| 405 | struct pipe_inode_info; | 407 | struct pipe_inode_info; |
| 406 | struct poll_table_struct; | 408 | struct poll_table_struct; |
| 407 | struct kstatfs; | 409 | struct kstatfs; |
| @@ -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/fuse.h b/include/linux/fuse.h index c3c578e0983..d464de53db4 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -41,6 +41,12 @@ | |||
| 41 | * 7.15 | 41 | * 7.15 |
| 42 | * - add store notify | 42 | * - add store notify |
| 43 | * - add retrieve notify | 43 | * - add retrieve notify |
| 44 | * | ||
| 45 | * 7.16 | ||
| 46 | * - add BATCH_FORGET request | ||
| 47 | * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct | ||
| 48 | * fuse_ioctl_iovec' instead of ambiguous 'struct iovec' | ||
| 49 | * - add FUSE_IOCTL_32BIT flag | ||
| 44 | */ | 50 | */ |
| 45 | 51 | ||
| 46 | #ifndef _LINUX_FUSE_H | 52 | #ifndef _LINUX_FUSE_H |
| @@ -72,7 +78,7 @@ | |||
| 72 | #define FUSE_KERNEL_VERSION 7 | 78 | #define FUSE_KERNEL_VERSION 7 |
| 73 | 79 | ||
| 74 | /** Minor version number of this interface */ | 80 | /** Minor version number of this interface */ |
| 75 | #define FUSE_KERNEL_MINOR_VERSION 15 | 81 | #define FUSE_KERNEL_MINOR_VERSION 16 |
| 76 | 82 | ||
| 77 | /** The node ID of the root inode */ | 83 | /** The node ID of the root inode */ |
| 78 | #define FUSE_ROOT_ID 1 | 84 | #define FUSE_ROOT_ID 1 |
| @@ -200,12 +206,14 @@ struct fuse_file_lock { | |||
| 200 | * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine | 206 | * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine |
| 201 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed | 207 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed |
| 202 | * FUSE_IOCTL_RETRY: retry with new iovecs | 208 | * FUSE_IOCTL_RETRY: retry with new iovecs |
| 209 | * FUSE_IOCTL_32BIT: 32bit ioctl | ||
| 203 | * | 210 | * |
| 204 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs | 211 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs |
| 205 | */ | 212 | */ |
| 206 | #define FUSE_IOCTL_COMPAT (1 << 0) | 213 | #define FUSE_IOCTL_COMPAT (1 << 0) |
| 207 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) | 214 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) |
| 208 | #define FUSE_IOCTL_RETRY (1 << 2) | 215 | #define FUSE_IOCTL_RETRY (1 << 2) |
| 216 | #define FUSE_IOCTL_32BIT (1 << 3) | ||
| 209 | 217 | ||
| 210 | #define FUSE_IOCTL_MAX_IOV 256 | 218 | #define FUSE_IOCTL_MAX_IOV 256 |
| 211 | 219 | ||
| @@ -256,6 +264,7 @@ enum fuse_opcode { | |||
| 256 | FUSE_IOCTL = 39, | 264 | FUSE_IOCTL = 39, |
| 257 | FUSE_POLL = 40, | 265 | FUSE_POLL = 40, |
| 258 | FUSE_NOTIFY_REPLY = 41, | 266 | FUSE_NOTIFY_REPLY = 41, |
| 267 | FUSE_BATCH_FORGET = 42, | ||
| 259 | 268 | ||
| 260 | /* CUSE specific operations */ | 269 | /* CUSE specific operations */ |
| 261 | CUSE_INIT = 4096, | 270 | CUSE_INIT = 4096, |
| @@ -290,6 +299,16 @@ struct fuse_forget_in { | |||
| 290 | __u64 nlookup; | 299 | __u64 nlookup; |
| 291 | }; | 300 | }; |
| 292 | 301 | ||
| 302 | struct fuse_forget_one { | ||
| 303 | __u64 nodeid; | ||
| 304 | __u64 nlookup; | ||
| 305 | }; | ||
| 306 | |||
| 307 | struct fuse_batch_forget_in { | ||
| 308 | __u32 count; | ||
| 309 | __u32 dummy; | ||
| 310 | }; | ||
| 311 | |||
| 293 | struct fuse_getattr_in { | 312 | struct fuse_getattr_in { |
| 294 | __u32 getattr_flags; | 313 | __u32 getattr_flags; |
| 295 | __u32 dummy; | 314 | __u32 dummy; |
| @@ -510,6 +529,11 @@ struct fuse_ioctl_in { | |||
| 510 | __u32 out_size; | 529 | __u32 out_size; |
| 511 | }; | 530 | }; |
| 512 | 531 | ||
| 532 | struct fuse_ioctl_iovec { | ||
| 533 | __u64 base; | ||
| 534 | __u64 len; | ||
| 535 | }; | ||
| 536 | |||
| 513 | struct fuse_ioctl_out { | 537 | struct fuse_ioctl_out { |
| 514 | __s32 result; | 538 | __s32 result; |
| 515 | __u32 flags; | 539 | __u32 flags; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 7a7b9c1644e..c0d5f6945c1 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 f54adfcbec9..0b84c61607e 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) |
| @@ -243,7 +249,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
| 243 | ((1 << ZONES_SHIFT) - 1); | 249 | ((1 << ZONES_SHIFT) - 1); |
| 244 | 250 | ||
| 245 | if (__builtin_constant_p(bit)) | 251 | if (__builtin_constant_p(bit)) |
| 246 | MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 252 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
| 247 | else { | 253 | else { |
| 248 | #ifdef CONFIG_DEBUG_VM | 254 | #ifdef CONFIG_DEBUG_VM |
| 249 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 255 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
| @@ -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-i2cmux.h b/include/linux/gpio-i2cmux.h new file mode 100644 index 00000000000..4a333bb0bd0 --- /dev/null +++ b/include/linux/gpio-i2cmux.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * gpio-i2cmux interface to platform code | ||
| 3 | * | ||
| 4 | * Peter Korsgaard <peter.korsgaard@barco.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _LINUX_GPIO_I2CMUX_H | ||
| 12 | #define _LINUX_GPIO_I2CMUX_H | ||
| 13 | |||
| 14 | /* MUX has no specific idle mode */ | ||
| 15 | #define GPIO_I2CMUX_NO_IDLE ((unsigned)-1) | ||
| 16 | |||
| 17 | /** | ||
| 18 | * struct gpio_i2cmux_platform_data - Platform-dependent data for gpio-i2cmux | ||
| 19 | * @parent: Parent I2C bus adapter number | ||
| 20 | * @base_nr: Base I2C bus number to number adapters from or zero for dynamic | ||
| 21 | * @values: Array of bitmasks of GPIO settings (low/high) for each | ||
| 22 | * position | ||
| 23 | * @n_values: Number of multiplexer positions (busses to instantiate) | ||
| 24 | * @gpios: Array of GPIO numbers used to control MUX | ||
| 25 | * @n_gpios: Number of GPIOs used to control MUX | ||
| 26 | * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used | ||
| 27 | */ | ||
| 28 | struct gpio_i2cmux_platform_data { | ||
| 29 | int parent; | ||
| 30 | int base_nr; | ||
| 31 | const unsigned *values; | ||
| 32 | int n_values; | ||
| 33 | const unsigned *gpios; | ||
| 34 | int n_gpios; | ||
| 35 | unsigned idle; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* _LINUX_GPIO_I2CMUX_H */ | ||
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e41f7dd1ae6..32720baf70f 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 bb0f56f5c01..d91c25e253c 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); |
| @@ -820,6 +824,49 @@ static inline void hid_hw_stop(struct hid_device *hdev) | |||
| 820 | hdev->ll_driver->stop(hdev); | 824 | hdev->ll_driver->stop(hdev); |
| 821 | } | 825 | } |
| 822 | 826 | ||
| 827 | /** | ||
| 828 | * hid_hw_open - signal underlaying HW to start delivering events | ||
| 829 | * | ||
| 830 | * @hdev: hid device | ||
| 831 | * | ||
| 832 | * Tell underlying HW to start delivering events from the device. | ||
| 833 | * This function should be called sometime after successful call | ||
| 834 | * to hid_hiw_start(). | ||
| 835 | */ | ||
| 836 | static inline int __must_check hid_hw_open(struct hid_device *hdev) | ||
| 837 | { | ||
| 838 | return hdev->ll_driver->open(hdev); | ||
| 839 | } | ||
| 840 | |||
| 841 | /** | ||
| 842 | * hid_hw_close - signal underlaying HW to stop delivering events | ||
| 843 | * | ||
| 844 | * @hdev: hid device | ||
| 845 | * | ||
| 846 | * This function indicates that we are not interested in the events | ||
| 847 | * from this device anymore. Delivery of events may or may not stop, | ||
| 848 | * depending on the number of users still outstanding. | ||
| 849 | */ | ||
| 850 | static inline void hid_hw_close(struct hid_device *hdev) | ||
| 851 | { | ||
| 852 | hdev->ll_driver->close(hdev); | ||
| 853 | } | ||
| 854 | |||
| 855 | /** | ||
| 856 | * hid_hw_power - requests underlying HW to go into given power mode | ||
| 857 | * | ||
| 858 | * @hdev: hid device | ||
| 859 | * @level: requested power level (one of %PM_HINT_* defines) | ||
| 860 | * | ||
| 861 | * This function requests underlying hardware to enter requested power | ||
| 862 | * mode. | ||
| 863 | */ | ||
| 864 | |||
| 865 | static inline int hid_hw_power(struct hid_device *hdev, int level) | ||
| 866 | { | ||
| 867 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; | ||
| 868 | } | ||
| 869 | |||
| 823 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 870 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
| 824 | int interrupt); | 871 | int interrupt); |
| 825 | 872 | ||
| @@ -838,12 +885,32 @@ int hid_pidff_init(struct hid_device *hid); | |||
| 838 | #define hid_pidff_init NULL | 885 | #define hid_pidff_init NULL |
| 839 | #endif | 886 | #endif |
| 840 | 887 | ||
| 841 | #define dbg_hid(format, arg...) if (hid_debug) \ | 888 | #define dbg_hid(format, arg...) \ |
| 842 | printk(KERN_DEBUG "%s: " format ,\ | 889 | do { \ |
| 843 | __FILE__ , ## arg) | 890 | if (hid_debug) \ |
| 844 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 891 | printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ |
| 845 | __FILE__ , ## arg) | 892 | } while (0) |
| 846 | #endif /* HID_FF */ | 893 | |
| 894 | #define hid_printk(level, hid, fmt, arg...) \ | ||
| 895 | dev_printk(level, &(hid)->dev, fmt, ##arg) | ||
| 896 | #define hid_emerg(hid, fmt, arg...) \ | ||
| 897 | dev_emerg(&(hid)->dev, fmt, ##arg) | ||
| 898 | #define hid_crit(hid, fmt, arg...) \ | ||
| 899 | dev_crit(&(hid)->dev, fmt, ##arg) | ||
| 900 | #define hid_alert(hid, fmt, arg...) \ | ||
| 901 | dev_alert(&(hid)->dev, fmt, ##arg) | ||
| 902 | #define hid_err(hid, fmt, arg...) \ | ||
| 903 | dev_err(&(hid)->dev, fmt, ##arg) | ||
| 904 | #define hid_notice(hid, fmt, arg...) \ | ||
| 905 | dev_notice(&(hid)->dev, fmt, ##arg) | ||
| 906 | #define hid_warn(hid, fmt, arg...) \ | ||
| 907 | dev_warn(&(hid)->dev, fmt, ##arg) | ||
| 908 | #define hid_info(hid, fmt, arg...) \ | ||
| 909 | dev_info(&(hid)->dev, fmt, ##arg) | ||
| 910 | #define hid_dbg(hid, fmt, arg...) \ | ||
| 911 | dev_dbg(&(hid)->dev, fmt, ##arg) | ||
| 912 | |||
| 913 | #endif /* __KERNEL__ */ | ||
| 847 | 914 | ||
| 848 | #endif | 915 | #endif |
| 849 | 916 | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 330586ffffb..f376ddc64c4 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -131,7 +131,6 @@ struct hrtimer_sleeper { | |||
| 131 | * @index: clock type index for per_cpu support when moving a | 131 | * @index: clock type index for per_cpu support when moving a |
| 132 | * timer to a base on another cpu. | 132 | * timer to a base on another cpu. |
| 133 | * @active: red black tree root node for the active timers | 133 | * @active: red black tree root node for the active timers |
| 134 | * @first: pointer to the timer node which expires first | ||
| 135 | * @resolution: the resolution of the clock, in nanoseconds | 134 | * @resolution: the resolution of the clock, in nanoseconds |
| 136 | * @get_time: function to retrieve the current time of the clock | 135 | * @get_time: function to retrieve the current time of the clock |
| 137 | * @softirq_time: the time when running the hrtimer queue in the softirq | 136 | * @softirq_time: the time when running the hrtimer queue in the softirq |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h new file mode 100644 index 00000000000..8e6c8c42bc3 --- /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/i2c.h b/include/linux/i2c.h index 56cfe23ffb3..903576df88d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -57,9 +57,10 @@ struct i2c_board_info; | |||
| 57 | * transmit an arbitrary number of messages without interruption. | 57 | * transmit an arbitrary number of messages without interruption. |
| 58 | * @count must be be less than 64k since msg.len is u16. | 58 | * @count must be be less than 64k since msg.len is u16. |
| 59 | */ | 59 | */ |
| 60 | extern int i2c_master_send(struct i2c_client *client, const char *buf, | 60 | extern int i2c_master_send(const struct i2c_client *client, const char *buf, |
| 61 | int count); | ||
| 62 | extern int i2c_master_recv(const struct i2c_client *client, char *buf, | ||
| 61 | int count); | 63 | int count); |
| 62 | extern int i2c_master_recv(struct i2c_client *client, char *buf, int count); | ||
| 63 | 64 | ||
| 64 | /* Transfer num messages. | 65 | /* Transfer num messages. |
| 65 | */ | 66 | */ |
| @@ -78,23 +79,25 @@ extern s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, | |||
| 78 | /* Now follow the 'nice' access routines. These also document the calling | 79 | /* Now follow the 'nice' access routines. These also document the calling |
| 79 | conventions of i2c_smbus_xfer. */ | 80 | conventions of i2c_smbus_xfer. */ |
| 80 | 81 | ||
| 81 | extern s32 i2c_smbus_read_byte(struct i2c_client *client); | 82 | extern s32 i2c_smbus_read_byte(const struct i2c_client *client); |
| 82 | extern s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); | 83 | extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value); |
| 83 | extern s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); | 84 | extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client, |
| 84 | extern s32 i2c_smbus_write_byte_data(struct i2c_client *client, | 85 | u8 command); |
| 86 | extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client, | ||
| 85 | u8 command, u8 value); | 87 | u8 command, u8 value); |
| 86 | extern s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command); | 88 | extern s32 i2c_smbus_read_word_data(const struct i2c_client *client, |
| 87 | extern s32 i2c_smbus_write_word_data(struct i2c_client *client, | 89 | u8 command); |
| 90 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, | ||
| 88 | u8 command, u16 value); | 91 | u8 command, u16 value); |
| 89 | /* Returns the number of read bytes */ | 92 | /* Returns the number of read bytes */ |
| 90 | extern s32 i2c_smbus_read_block_data(struct i2c_client *client, | 93 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, |
| 91 | u8 command, u8 *values); | 94 | u8 command, u8 *values); |
| 92 | extern s32 i2c_smbus_write_block_data(struct i2c_client *client, | 95 | extern s32 i2c_smbus_write_block_data(const struct i2c_client *client, |
| 93 | u8 command, u8 length, const u8 *values); | 96 | u8 command, u8 length, const u8 *values); |
| 94 | /* Returns the number of read bytes */ | 97 | /* Returns the number of read bytes */ |
| 95 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, | 98 | extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client, |
| 96 | u8 command, u8 length, u8 *values); | 99 | u8 command, u8 length, u8 *values); |
| 97 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | 100 | extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, |
| 98 | u8 command, u8 length, | 101 | u8 command, u8 length, |
| 99 | const u8 *values); | 102 | const u8 *values); |
| 100 | #endif /* I2C */ | 103 | #endif /* I2C */ |
diff --git a/include/linux/i2c/ds620.h b/include/linux/i2c/ds620.h new file mode 100644 index 00000000000..736bb87ac0f --- /dev/null +++ b/include/linux/i2c/ds620.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef _LINUX_DS620_H | ||
| 2 | #define _LINUX_DS620_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/i2c.h> | ||
| 6 | |||
| 7 | /* platform data for the DS620 temperature sensor and thermostat */ | ||
| 8 | |||
| 9 | struct ds620_platform_data { | ||
| 10 | /* | ||
| 11 | * Thermostat output pin PO mode: | ||
| 12 | * 0 = always low (default) | ||
| 13 | * 1 = PO_LOW | ||
| 14 | * 2 = PO_HIGH | ||
| 15 | * | ||
| 16 | * (see Documentation/hwmon/ds620) | ||
| 17 | */ | ||
| 18 | int pomode; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /* _LINUX_DS620_H */ | ||
diff --git a/include/linux/if_alg.h b/include/linux/if_alg.h new file mode 100644 index 00000000000..0f9acce5b1f --- /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 c4e9d91ec97..e428382ca28 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 00000000000..1affd0ddfa9 --- /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/intel-gtt.h b/include/linux/intel-gtt.h deleted file mode 100644 index 1d19ab2afa3..00000000000 --- a/include/linux/intel-gtt.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Common Intel AGPGART and GTT definitions. | ||
| 3 | */ | ||
| 4 | #ifndef _INTEL_GTT_H | ||
| 5 | #define _INTEL_GTT_H | ||
| 6 | |||
| 7 | #include <linux/agp_backend.h> | ||
| 8 | |||
| 9 | /* This is for Intel only GTT controls. | ||
| 10 | * | ||
| 11 | * Sandybridge: AGP_USER_CACHED_MEMORY default to LLC only | ||
| 12 | */ | ||
| 13 | |||
| 14 | #define AGP_USER_CACHED_MEMORY_LLC_MLC (AGP_USER_TYPES + 2) | ||
| 15 | #define AGP_USER_UNCACHED_MEMORY (AGP_USER_TYPES + 4) | ||
| 16 | |||
| 17 | /* flag for GFDT type */ | ||
| 18 | #define AGP_USER_CACHED_MEMORY_GFDT (1 << 3) | ||
| 19 | |||
| 20 | #endif | ||
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 65aae34759d..045f2f275cd 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 4b48318ac54..906590aa690 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 979c68cc745..c1a95b7b58d 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 */ |
| @@ -101,13 +101,6 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | |||
| 101 | #define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) | 101 | #define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) |
| 102 | 102 | ||
| 103 | /* | 103 | /* |
| 104 | * Monolithic do_IRQ implementation. | ||
| 105 | */ | ||
| 106 | #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ | ||
| 107 | extern unsigned int __do_IRQ(unsigned int irq); | ||
| 108 | #endif | ||
| 109 | |||
| 110 | /* | ||
| 111 | * Architectures call this to let the generic IRQ layer | 104 | * Architectures call this to let the generic IRQ layer |
| 112 | * handle an interrupt. If the descriptor is attached to an | 105 | * handle an interrupt. If the descriptor is attached to an |
| 113 | * irqchip-style controller then we call the ->handle_irq() handler, | 106 | * irqchip-style controller then we call the ->handle_irq() handler, |
| @@ -115,14 +108,7 @@ extern unsigned int __do_IRQ(unsigned int irq); | |||
| 115 | */ | 108 | */ |
| 116 | static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) | 109 | static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) |
| 117 | { | 110 | { |
| 118 | #ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ | ||
| 119 | desc->handle_irq(irq, desc); | 111 | desc->handle_irq(irq, desc); |
| 120 | #else | ||
| 121 | if (likely(desc->handle_irq)) | ||
| 122 | desc->handle_irq(irq, desc); | ||
| 123 | else | ||
| 124 | __do_IRQ(irq); | ||
| 125 | #endif | ||
| 126 | } | 112 | } |
| 127 | 113 | ||
| 128 | static inline void generic_handle_irq(unsigned int irq) | 114 | static inline void generic_handle_irq(unsigned int irq) |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 2ae86aa21fc..27e79c27ba0 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -94,7 +94,7 @@ extern void jbd2_free(void *ptr, size_t size); | |||
| 94 | * | 94 | * |
| 95 | * This is an opaque datatype. | 95 | * This is an opaque datatype. |
| 96 | **/ | 96 | **/ |
| 97 | typedef struct handle_s handle_t; /* Atomic operation type */ | 97 | typedef struct jbd2_journal_handle handle_t; /* Atomic operation type */ |
| 98 | 98 | ||
| 99 | 99 | ||
| 100 | /** | 100 | /** |
| @@ -416,7 +416,7 @@ struct jbd2_revoke_table_s; | |||
| 416 | * in so it can be fixed later. | 416 | * in so it can be fixed later. |
| 417 | */ | 417 | */ |
| 418 | 418 | ||
| 419 | struct handle_s | 419 | struct jbd2_journal_handle |
| 420 | { | 420 | { |
| 421 | /* Which compound transaction is this update a part of? */ | 421 | /* Which compound transaction is this update a part of? */ |
| 422 | transaction_t *h_transaction; | 422 | transaction_t *h_transaction; |
| @@ -1158,6 +1158,22 @@ static inline void jbd2_free_handle(handle_t *handle) | |||
| 1158 | kmem_cache_free(jbd2_handle_cache, handle); | 1158 | kmem_cache_free(jbd2_handle_cache, handle); |
| 1159 | } | 1159 | } |
| 1160 | 1160 | ||
| 1161 | /* | ||
| 1162 | * jbd2_inode management (optional, for those file systems that want to use | ||
| 1163 | * dynamically allocated jbd2_inode structures) | ||
| 1164 | */ | ||
| 1165 | extern struct kmem_cache *jbd2_inode_cache; | ||
| 1166 | |||
| 1167 | static inline struct jbd2_inode *jbd2_alloc_inode(gfp_t gfp_flags) | ||
| 1168 | { | ||
| 1169 | return kmem_cache_alloc(jbd2_inode_cache, gfp_flags); | ||
| 1170 | } | ||
| 1171 | |||
| 1172 | static inline void jbd2_free_inode(struct jbd2_inode *jinode) | ||
| 1173 | { | ||
| 1174 | kmem_cache_free(jbd2_inode_cache, jinode); | ||
| 1175 | } | ||
| 1176 | |||
| 1161 | /* Primary revoke support */ | 1177 | /* Primary revoke support */ |
| 1162 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 | 1178 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 |
| 1163 | extern int jbd2_journal_init_revoke(journal_t *, int); | 1179 | extern int jbd2_journal_init_revoke(journal_t *, int); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b6de9a6f701..e2f4d6af212 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -56,6 +56,8 @@ | |||
| 56 | 56 | ||
| 57 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 57 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
| 58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
| 59 | |||
| 60 | /* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ | ||
| 59 | #define roundup(x, y) ( \ | 61 | #define roundup(x, y) ( \ |
| 60 | { \ | 62 | { \ |
| 61 | const typeof(y) __y = y; \ | 63 | const typeof(y) __y = y; \ |
| @@ -141,9 +143,22 @@ extern int _cond_resched(void); | |||
| 141 | 143 | ||
| 142 | #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) |
| 143 | 145 | ||
| 144 | #define abs(x) ({ \ | 146 | /* |
| 145 | long __x = (x); \ | 147 | * abs() handles unsigned and signed longs, ints, shorts and chars. For all |
| 146 | (__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; \ | ||
| 147 | }) | 162 | }) |
| 148 | 163 | ||
| 149 | #define abs64(x) ({ \ | 164 | #define abs64(x) ({ \ |
| @@ -228,6 +243,8 @@ extern int test_taint(unsigned flag); | |||
| 228 | extern unsigned long get_taint(void); | 243 | extern unsigned long get_taint(void); |
| 229 | extern int root_mountflags; | 244 | extern int root_mountflags; |
| 230 | 245 | ||
| 246 | extern bool early_boot_irqs_disabled; | ||
| 247 | |||
| 231 | /* Values used for system_state */ | 248 | /* Values used for system_state */ |
| 232 | extern enum system_states { | 249 | extern enum system_states { |
| 233 | SYSTEM_BOOTING, | 250 | SYSTEM_BOOTING, |
| @@ -263,6 +280,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 263 | } | 280 | } |
| 264 | 281 | ||
| 265 | extern int hex_to_bin(char ch); | 282 | extern int hex_to_bin(char ch); |
| 283 | extern void hex2bin(u8 *dst, const char *src, size_t count); | ||
| 266 | 284 | ||
| 267 | /* | 285 | /* |
| 268 | * General tracing related utility functions - trace_printk(), | 286 | * General tracing related utility functions - trace_printk(), |
| @@ -557,12 +575,6 @@ struct sysinfo { | |||
| 557 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | 575 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
| 558 | }; | 576 | }; |
| 559 | 577 | ||
| 560 | /* Force a compilation error if condition is true */ | ||
| 561 | #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) | ||
| 562 | |||
| 563 | /* Force a compilation error if condition is constant and true */ | ||
| 564 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | ||
| 565 | |||
| 566 | /* Force a compilation error if a constant expression is not a power of 2 */ | 578 | /* Force a compilation error if a constant expression is not a power of 2 */ |
| 567 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | 579 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ |
| 568 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | 580 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) |
| @@ -574,6 +586,32 @@ struct sysinfo { | |||
| 574 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) | 586 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) |
| 575 | #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) | 587 | #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) |
| 576 | 588 | ||
| 589 | /** | ||
| 590 | * BUILD_BUG_ON - break compile if a condition is true. | ||
| 591 | * @cond: the condition which the compiler should know is false. | ||
| 592 | * | ||
| 593 | * If you have some code which relies on certain constants being equal, or | ||
| 594 | * other compile-time-evaluated condition, you should use BUILD_BUG_ON to | ||
| 595 | * detect if someone changes it. | ||
| 596 | * | ||
| 597 | * The implementation uses gcc's reluctance to create a negative array, but | ||
| 598 | * gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments | ||
| 599 | * to inline functions). So as a fallback we use the optimizer; if it can't | ||
| 600 | * prove the condition is false, it will cause a link error on the undefined | ||
| 601 | * "__build_bug_on_failed". This error message can be harder to track down | ||
| 602 | * though, hence the two different methods. | ||
| 603 | */ | ||
| 604 | #ifndef __OPTIMIZE__ | ||
| 605 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | ||
| 606 | #else | ||
| 607 | extern int __build_bug_on_failed; | ||
| 608 | #define BUILD_BUG_ON(condition) \ | ||
| 609 | do { \ | ||
| 610 | ((void)sizeof(char[1 - 2*!!(condition)])); \ | ||
| 611 | if (condition) __build_bug_on_failed = 1; \ | ||
| 612 | } while(0) | ||
| 613 | #endif | ||
| 614 | |||
| 577 | /* Trap pasters of __FUNCTION__ at compile-time */ | 615 | /* Trap pasters of __FUNCTION__ at compile-time */ |
| 578 | #define __FUNCTION__ (__func__) | 616 | #define __FUNCTION__ (__func__) |
| 579 | 617 | ||
| @@ -584,6 +622,13 @@ struct sysinfo { | |||
| 584 | #define NUMA_BUILD 0 | 622 | #define NUMA_BUILD 0 |
| 585 | #endif | 623 | #endif |
| 586 | 624 | ||
| 625 | /* This helps us avoid #ifdef CONFIG_COMPACTION */ | ||
| 626 | #ifdef CONFIG_COMPACTION | ||
| 627 | #define COMPACTION_BUILD 1 | ||
| 628 | #else | ||
| 629 | #define COMPACTION_BUILD 0 | ||
| 630 | #endif | ||
| 631 | |||
| 587 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ | 632 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ |
| 588 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 633 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 589 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD | 634 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 44e83ba12b5..0cce2db580c 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 00000000000..6b394f0b514 --- /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/kmemcheck.h b/include/linux/kmemcheck.h index 08d7dc4ddf4..39f8453239f 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
| @@ -76,7 +76,7 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | |||
| 76 | \ | 76 | \ |
| 77 | _n = (long) &((ptr)->name##_end) \ | 77 | _n = (long) &((ptr)->name##_end) \ |
| 78 | - (long) &((ptr)->name##_begin); \ | 78 | - (long) &((ptr)->name##_begin); \ |
| 79 | MAYBE_BUILD_BUG_ON(_n < 0); \ | 79 | BUILD_BUG_ON(_n < 0); \ |
| 80 | \ | 80 | \ |
| 81 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | 81 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ |
| 82 | } while (0) | 82 | } while (0) |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index 24b44145a88..2a0d7d651dc 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/kref.h b/include/linux/kref.h index 6cc38fc07ab..d4a62ab2ee5 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
| @@ -24,5 +24,7 @@ struct kref { | |||
| 24 | void kref_init(struct kref *kref); | 24 | void kref_init(struct kref *kref); |
| 25 | void kref_get(struct kref *kref); | 25 | void kref_get(struct kref *kref); |
| 26 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | 26 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); |
| 27 | int kref_sub(struct kref *kref, unsigned int count, | ||
| 28 | void (*release) (struct kref *kref)); | ||
| 27 | 29 | ||
| 28 | #endif /* _KREF_H_ */ | 30 | #endif /* _KREF_H_ */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 919ae53adc5..ea2dc1a2e13 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 a0557422715..b5021db2185 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 7ac0d4eee43..fa7cc7244cb 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 38368d785f0..fd548d2a877 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 796747637b8..2694289babd 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/libata.h b/include/linux/libata.h index d947b123166..c9c5d7ad1a2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -996,8 +996,7 @@ extern int ata_sas_port_init(struct ata_port *); | |||
| 996 | extern int ata_sas_port_start(struct ata_port *ap); | 996 | extern int ata_sas_port_start(struct ata_port *ap); |
| 997 | extern void ata_sas_port_stop(struct ata_port *ap); | 997 | extern void ata_sas_port_stop(struct ata_port *ap); |
| 998 | extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); | 998 | extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); |
| 999 | extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), | 999 | extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap); |
| 1000 | struct ata_port *ap); | ||
| 1001 | extern int sata_scr_valid(struct ata_link *link); | 1000 | extern int sata_scr_valid(struct ata_link *link); |
| 1002 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); | 1001 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); |
| 1003 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); | 1002 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); |
| @@ -1040,8 +1039,7 @@ extern unsigned int ata_do_dev_read_id(struct ata_device *dev, | |||
| 1040 | struct ata_taskfile *tf, u16 *id); | 1039 | struct ata_taskfile *tf, u16 *id); |
| 1041 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 1040 | extern void ata_qc_complete(struct ata_queued_cmd *qc); |
| 1042 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); | 1041 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); |
| 1043 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | 1042 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd); |
| 1044 | void (*done)(struct scsi_cmnd *)); | ||
| 1045 | extern int ata_std_bios_param(struct scsi_device *sdev, | 1043 | extern int ata_std_bios_param(struct scsi_device *sdev, |
| 1046 | struct block_device *bdev, | 1044 | struct block_device *bdev, |
| 1047 | sector_t capacity, int geom[]); | 1045 | sector_t capacity, int geom[]); |
diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index 9ee97e7f2be..5bad17d1acd 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/lockd/debug.h b/include/linux/lockd/debug.h index 34b2b7f33c3..257d3779f2a 100644 --- a/include/linux/lockd/debug.h +++ b/include/linux/lockd/debug.h | |||
| @@ -44,14 +44,4 @@ | |||
| 44 | #define NLMDBG_XDR 0x0100 | 44 | #define NLMDBG_XDR 0x0100 |
| 45 | #define NLMDBG_ALL 0x7fff | 45 | #define NLMDBG_ALL 0x7fff |
| 46 | 46 | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Support for printing NLM cookies in dprintk() | ||
| 50 | */ | ||
| 51 | #ifdef RPC_DEBUG | ||
| 52 | struct nlm_cookie; | ||
| 53 | /* Call this function with the BKL held (it uses a static buffer) */ | ||
| 54 | extern const char *nlmdbg_cookie2a(const struct nlm_cookie *); | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #endif /* LINUX_LOCKD_DEBUG_H */ | 47 | #endif /* LINUX_LOCKD_DEBUG_H */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 2dee05e5119..ff9abff55aa 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -202,9 +202,9 @@ extern u32 nsm_local_state; | |||
| 202 | * Lockd client functions | 202 | * Lockd client functions |
| 203 | */ | 203 | */ |
| 204 | struct nlm_rqst * nlm_alloc_call(struct nlm_host *host); | 204 | struct nlm_rqst * nlm_alloc_call(struct nlm_host *host); |
| 205 | void nlm_release_call(struct nlm_rqst *); | ||
| 206 | int nlm_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *); | 205 | int nlm_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *); |
| 207 | int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); | 206 | int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); |
| 207 | void nlmclnt_release_call(struct nlm_rqst *); | ||
| 208 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); | 208 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); |
| 209 | void nlmclnt_finish_block(struct nlm_wait *block); | 209 | void nlmclnt_finish_block(struct nlm_wait *block); |
| 210 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); | 210 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); |
| @@ -223,13 +223,14 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 223 | const u32 version, | 223 | const u32 version, |
| 224 | const char *hostname, | 224 | const char *hostname, |
| 225 | int noresvport); | 225 | int noresvport); |
| 226 | void nlmclnt_release_host(struct nlm_host *); | ||
| 226 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, | 227 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, |
| 227 | const char *hostname, | 228 | const char *hostname, |
| 228 | const size_t hostname_len); | 229 | const size_t hostname_len); |
| 230 | void nlmsvc_release_host(struct nlm_host *); | ||
| 229 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); | 231 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); |
| 230 | void nlm_rebind_host(struct nlm_host *); | 232 | void nlm_rebind_host(struct nlm_host *); |
| 231 | struct nlm_host * nlm_get_host(struct nlm_host *); | 233 | struct nlm_host * nlm_get_host(struct nlm_host *); |
| 232 | void nlm_release_host(struct nlm_host *); | ||
| 233 | void nlm_shutdown_hosts(void); | 234 | void nlm_shutdown_hosts(void); |
| 234 | void nlm_host_rebooted(const struct nlm_reboot *); | 235 | void nlm_host_rebooted(const struct nlm_reboot *); |
| 235 | 236 | ||
| @@ -267,6 +268,7 @@ unsigned long nlmsvc_retry_blocked(void); | |||
| 267 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 268 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
| 268 | nlm_host_match_fn_t match); | 269 | nlm_host_match_fn_t match); |
| 269 | void nlmsvc_grant_reply(struct nlm_cookie *, __be32); | 270 | void nlmsvc_grant_reply(struct nlm_cookie *, __be32); |
| 271 | void nlmsvc_release_call(struct nlm_rqst *); | ||
| 270 | 272 | ||
| 271 | /* | 273 | /* |
| 272 | * File handling for the server personality | 274 | * File handling for the server personality |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 71c09b26c75..4aef1dda640 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 | } |
| @@ -522,12 +514,15 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
| 522 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 514 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 523 | # ifdef CONFIG_PROVE_LOCKING | 515 | # ifdef CONFIG_PROVE_LOCKING |
| 524 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_) | 516 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_) |
| 517 | # define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_) | ||
| 525 | # else | 518 | # else |
| 526 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_) | 519 | # define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_) |
| 520 | # define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 527 | # endif | 521 | # endif |
| 528 | # define lock_map_release(l) lock_release(l, 1, _THIS_IP_) | 522 | # define lock_map_release(l) lock_release(l, 1, _THIS_IP_) |
| 529 | #else | 523 | #else |
| 530 | # define lock_map_acquire(l) do { } while (0) | 524 | # define lock_map_acquire(l) do { } while (0) |
| 525 | # define lock_map_acquire_read(l) do { } while (0) | ||
| 531 | # define lock_map_release(l) do { } while (0) | 526 | # define lock_map_release(l) do { } while (0) |
| 532 | #endif | 527 | #endif |
| 533 | 528 | ||
diff --git a/include/linux/magic.h b/include/linux/magic.h index ff690d05f12..62730ea2b56 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/mbcache.h b/include/linux/mbcache.h index 54cbbac1e71..5525d370701 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h | |||
| @@ -18,6 +18,17 @@ struct mb_cache_entry { | |||
| 18 | } e_index; | 18 | } e_index; |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | struct mb_cache { | ||
| 22 | struct list_head c_cache_list; | ||
| 23 | const char *c_name; | ||
| 24 | atomic_t c_entry_count; | ||
| 25 | int c_max_entries; | ||
| 26 | int c_bucket_bits; | ||
| 27 | struct kmem_cache *c_entry_cache; | ||
| 28 | struct list_head *c_block_hash; | ||
| 29 | struct list_head *c_index_hash; | ||
| 30 | }; | ||
| 31 | |||
| 21 | /* Functions on caches */ | 32 | /* Functions on caches */ |
| 22 | 33 | ||
| 23 | struct mb_cache *mb_cache_create(const char *, int); | 34 | struct mb_cache *mb_cache_create(const char *, int); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 159a0762aea..f512e189be5 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 31c237a00c4..8122018d300 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 d63b6050b18..37f56b7c4c1 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 cb93d80aa64..835996e167e 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 7363dea6bbc..effa5d3b96a 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 f8c9f884aff..61daa167b57 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 b4c741e352c..7d0f3d6a000 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 00000000000..a00f2bec178 --- /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/tmio.h b/include/linux/mfd/tmio.h index 085f041197d..8e70310ee94 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -57,6 +57,10 @@ | |||
| 57 | * is configured in 4-bit mode. | 57 | * is configured in 4-bit mode. |
| 58 | */ | 58 | */ |
| 59 | #define TMIO_MMC_BLKSZ_2BYTES (1 << 1) | 59 | #define TMIO_MMC_BLKSZ_2BYTES (1 << 1) |
| 60 | /* | ||
| 61 | * Some controllers can support SDIO IRQ signalling. | ||
| 62 | */ | ||
| 63 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | ||
| 60 | 64 | ||
| 61 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 65 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
| 62 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 66 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
| @@ -66,6 +70,7 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | |||
| 66 | struct tmio_mmc_dma { | 70 | struct tmio_mmc_dma { |
| 67 | void *chan_priv_tx; | 71 | void *chan_priv_tx; |
| 68 | void *chan_priv_rx; | 72 | void *chan_priv_rx; |
| 73 | int alignment_shift; | ||
| 69 | }; | 74 | }; |
| 70 | 75 | ||
| 71 | /* | 76 | /* |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index a1239c48b41..903280d2186 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 de79baee492..3fd36845ca4 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 add8a1b8bcf..9eab263658b 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 967f62f5415..be072faec6f 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 085527fb826..e39aeecfe9a 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 a7b15bc7648..04921464203 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 f407cd4bfb3..e1eebf78cab 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 721f451c302..f6385fc17ad 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,11 +451,40 @@ 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 | ||
| 473 | #ifdef CONFIG_MMU | ||
| 474 | /* | ||
| 475 | * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when | ||
| 476 | * servicing faults for write access. In the normal case, do always want | ||
| 477 | * pte_mkwrite. But get_user_pages can cause write faults for mappings | ||
| 478 | * that do not have writing enabled, when used by access_process_vm. | ||
| 479 | */ | ||
| 480 | static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | ||
| 481 | { | ||
| 482 | if (likely(vma->vm_flags & VM_WRITE)) | ||
| 483 | pte = pte_mkwrite(pte); | ||
| 484 | return pte; | ||
| 485 | } | ||
| 486 | #endif | ||
| 487 | |||
| 378 | /* | 488 | /* |
| 379 | * Multiple processes may "see" the same page. E.g. for untouched | 489 | * Multiple processes may "see" the same page. E.g. for untouched |
| 380 | * mappings of /dev/null, all processes see the same page full of | 490 | * mappings of /dev/null, all processes see the same page full of |
| @@ -657,7 +767,7 @@ static inline struct address_space *page_mapping(struct page *page) | |||
| 657 | VM_BUG_ON(PageSlab(page)); | 767 | VM_BUG_ON(PageSlab(page)); |
| 658 | if (unlikely(PageSwapCache(page))) | 768 | if (unlikely(PageSwapCache(page))) |
| 659 | mapping = &swapper_space; | 769 | mapping = &swapper_space; |
| 660 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) | 770 | else if ((unsigned long)mapping & PAGE_MAPPING_ANON) |
| 661 | mapping = NULL; | 771 | mapping = NULL; |
| 662 | return mapping; | 772 | return mapping; |
| 663 | } | 773 | } |
| @@ -1064,7 +1174,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); | 1174 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
| 1065 | #endif | 1175 | #endif |
| 1066 | 1176 | ||
| 1067 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); | 1177 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
| 1178 | pmd_t *pmd, unsigned long address); | ||
| 1068 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); | 1179 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); |
| 1069 | 1180 | ||
| 1070 | /* | 1181 | /* |
| @@ -1133,16 +1244,18 @@ static inline void pgtable_page_dtor(struct page *page) | |||
| 1133 | pte_unmap(pte); \ | 1244 | pte_unmap(pte); \ |
| 1134 | } while (0) | 1245 | } while (0) |
| 1135 | 1246 | ||
| 1136 | #define pte_alloc_map(mm, pmd, address) \ | 1247 | #define pte_alloc_map(mm, vma, pmd, address) \ |
| 1137 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1248 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, vma, \ |
| 1138 | NULL: pte_offset_map(pmd, address)) | 1249 | pmd, address))? \ |
| 1250 | NULL: pte_offset_map(pmd, address)) | ||
| 1139 | 1251 | ||
| 1140 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ | 1252 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ |
| 1141 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1253 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, NULL, \ |
| 1254 | pmd, address))? \ | ||
| 1142 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) | 1255 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) |
| 1143 | 1256 | ||
| 1144 | #define pte_alloc_kernel(pmd, address) \ | 1257 | #define pte_alloc_kernel(pmd, address) \ |
| 1145 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ | 1258 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ |
| 1146 | NULL: pte_offset_kernel(pmd, address)) | 1259 | NULL: pte_offset_kernel(pmd, address)) |
| 1147 | 1260 | ||
| 1148 | extern void free_area_init(unsigned long * zones_size); | 1261 | extern void free_area_init(unsigned long * zones_size); |
| @@ -1415,6 +1528,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
| 1415 | #define FOLL_GET 0x04 /* do get_page on page */ | 1528 | #define FOLL_GET 0x04 /* do get_page on page */ |
| 1416 | #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ | 1529 | #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 */ | 1530 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ |
| 1531 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ | ||
| 1532 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | ||
| 1418 | 1533 | ||
| 1419 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1534 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
| 1420 | void *data); | 1535 | void *data); |
| @@ -1518,5 +1633,14 @@ static inline int is_hwpoison_address(unsigned long addr) | |||
| 1518 | 1633 | ||
| 1519 | extern void dump_page(struct page *page); | 1634 | extern void dump_page(struct page *page); |
| 1520 | 1635 | ||
| 1636 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) | ||
| 1637 | extern void clear_huge_page(struct page *page, | ||
| 1638 | unsigned long addr, | ||
| 1639 | unsigned int pages_per_huge_page); | ||
| 1640 | extern void copy_user_huge_page(struct page *dst, struct page *src, | ||
| 1641 | unsigned long addr, struct vm_area_struct *vma, | ||
| 1642 | unsigned int pages_per_huge_page); | ||
| 1643 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ | ||
| 1644 | |||
| 1521 | #endif /* __KERNEL__ */ | 1645 | #endif /* __KERNEL__ */ |
| 1522 | #endif /* _LINUX_MM_H */ | 1646 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8835b877b8d..8f7d24712dc 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 bb7288a782f..26bc4e2cd27 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/dw_mmc.h b/include/linux/mmc/dw_mmc.h new file mode 100644 index 00000000000..16b0261763e --- /dev/null +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* | ||
| 2 | * Synopsys DesignWare Multimedia Card Interface driver | ||
| 3 | * (Based on NXP driver for lpc 31xx) | ||
| 4 | * | ||
| 5 | * Copyright (C) 2009 NXP Semiconductors | ||
| 6 | * Copyright (C) 2009, 2010 Imagination Technologies Ltd. | ||
| 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 | |||
| 14 | #ifndef _LINUX_MMC_DW_MMC_H_ | ||
| 15 | #define _LINUX_MMC_DW_MMC_H_ | ||
| 16 | |||
| 17 | #define MAX_MCI_SLOTS 2 | ||
| 18 | |||
| 19 | enum dw_mci_state { | ||
| 20 | STATE_IDLE = 0, | ||
| 21 | STATE_SENDING_CMD, | ||
| 22 | STATE_SENDING_DATA, | ||
| 23 | STATE_DATA_BUSY, | ||
| 24 | STATE_SENDING_STOP, | ||
| 25 | STATE_DATA_ERROR, | ||
| 26 | }; | ||
| 27 | |||
| 28 | enum { | ||
| 29 | EVENT_CMD_COMPLETE = 0, | ||
| 30 | EVENT_XFER_COMPLETE, | ||
| 31 | EVENT_DATA_COMPLETE, | ||
| 32 | EVENT_DATA_ERROR, | ||
| 33 | EVENT_XFER_ERROR | ||
| 34 | }; | ||
| 35 | |||
| 36 | struct mmc_data; | ||
| 37 | |||
| 38 | /** | ||
| 39 | * struct dw_mci - MMC controller state shared between all slots | ||
| 40 | * @lock: Spinlock protecting the queue and associated data. | ||
| 41 | * @regs: Pointer to MMIO registers. | ||
| 42 | * @sg: Scatterlist entry currently being processed by PIO code, if any. | ||
| 43 | * @pio_offset: Offset into the current scatterlist entry. | ||
| 44 | * @cur_slot: The slot which is currently using the controller. | ||
| 45 | * @mrq: The request currently being processed on @cur_slot, | ||
| 46 | * or NULL if the controller is idle. | ||
| 47 | * @cmd: The command currently being sent to the card, or NULL. | ||
| 48 | * @data: The data currently being transferred, or NULL if no data | ||
| 49 | * transfer is in progress. | ||
| 50 | * @use_dma: Whether DMA channel is initialized or not. | ||
| 51 | * @sg_dma: Bus address of DMA buffer. | ||
| 52 | * @sg_cpu: Virtual address of DMA buffer. | ||
| 53 | * @dma_ops: Pointer to platform-specific DMA callbacks. | ||
| 54 | * @cmd_status: Snapshot of SR taken upon completion of the current | ||
| 55 | * command. Only valid when EVENT_CMD_COMPLETE is pending. | ||
| 56 | * @data_status: Snapshot of SR taken upon completion of the current | ||
| 57 | * data transfer. Only valid when EVENT_DATA_COMPLETE or | ||
| 58 | * EVENT_DATA_ERROR is pending. | ||
| 59 | * @stop_cmdr: Value to be loaded into CMDR when the stop command is | ||
| 60 | * to be sent. | ||
| 61 | * @dir_status: Direction of current transfer. | ||
| 62 | * @tasklet: Tasklet running the request state machine. | ||
| 63 | * @card_tasklet: Tasklet handling card detect. | ||
| 64 | * @pending_events: Bitmask of events flagged by the interrupt handler | ||
| 65 | * to be processed by the tasklet. | ||
| 66 | * @completed_events: Bitmask of events which the state machine has | ||
| 67 | * processed. | ||
| 68 | * @state: Tasklet state. | ||
| 69 | * @queue: List of slots waiting for access to the controller. | ||
| 70 | * @bus_hz: The rate of @mck in Hz. This forms the basis for MMC bus | ||
| 71 | * rate and timeout calculations. | ||
| 72 | * @current_speed: Configured rate of the controller. | ||
| 73 | * @num_slots: Number of slots available. | ||
| 74 | * @pdev: Platform device associated with the MMC controller. | ||
| 75 | * @pdata: Platform data associated with the MMC controller. | ||
| 76 | * @slot: Slots sharing this MMC controller. | ||
| 77 | * @data_shift: log2 of FIFO item size. | ||
| 78 | * @push_data: Pointer to FIFO push function. | ||
| 79 | * @pull_data: Pointer to FIFO pull function. | ||
| 80 | * @quirks: Set of quirks that apply to specific versions of the IP. | ||
| 81 | * | ||
| 82 | * Locking | ||
| 83 | * ======= | ||
| 84 | * | ||
| 85 | * @lock is a softirq-safe spinlock protecting @queue as well as | ||
| 86 | * @cur_slot, @mrq and @state. These must always be updated | ||
| 87 | * at the same time while holding @lock. | ||
| 88 | * | ||
| 89 | * The @mrq field of struct dw_mci_slot is also protected by @lock, | ||
| 90 | * and must always be written at the same time as the slot is added to | ||
| 91 | * @queue. | ||
| 92 | * | ||
| 93 | * @pending_events and @completed_events are accessed using atomic bit | ||
| 94 | * operations, so they don't need any locking. | ||
| 95 | * | ||
| 96 | * None of the fields touched by the interrupt handler need any | ||
| 97 | * locking. However, ordering is important: Before EVENT_DATA_ERROR or | ||
| 98 | * EVENT_DATA_COMPLETE is set in @pending_events, all data-related | ||
| 99 | * interrupts must be disabled and @data_status updated with a | ||
| 100 | * snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the | ||
| 101 | * CMDRDY interupt must be disabled and @cmd_status updated with a | ||
| 102 | * snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the | ||
| 103 | * bytes_xfered field of @data must be written. This is ensured by | ||
| 104 | * using barriers. | ||
| 105 | */ | ||
| 106 | struct dw_mci { | ||
| 107 | spinlock_t lock; | ||
| 108 | void __iomem *regs; | ||
| 109 | |||
| 110 | struct scatterlist *sg; | ||
| 111 | unsigned int pio_offset; | ||
| 112 | |||
| 113 | struct dw_mci_slot *cur_slot; | ||
| 114 | struct mmc_request *mrq; | ||
| 115 | struct mmc_command *cmd; | ||
| 116 | struct mmc_data *data; | ||
| 117 | |||
| 118 | /* DMA interface members*/ | ||
| 119 | int use_dma; | ||
| 120 | |||
| 121 | dma_addr_t sg_dma; | ||
| 122 | void *sg_cpu; | ||
| 123 | struct dw_mci_dma_ops *dma_ops; | ||
| 124 | #ifdef CONFIG_MMC_DW_IDMAC | ||
| 125 | unsigned int ring_size; | ||
| 126 | #else | ||
| 127 | struct dw_mci_dma_data *dma_data; | ||
| 128 | #endif | ||
| 129 | u32 cmd_status; | ||
| 130 | u32 data_status; | ||
| 131 | u32 stop_cmdr; | ||
| 132 | u32 dir_status; | ||
| 133 | struct tasklet_struct tasklet; | ||
| 134 | struct tasklet_struct card_tasklet; | ||
| 135 | unsigned long pending_events; | ||
| 136 | unsigned long completed_events; | ||
| 137 | enum dw_mci_state state; | ||
| 138 | struct list_head queue; | ||
| 139 | |||
| 140 | u32 bus_hz; | ||
| 141 | u32 current_speed; | ||
| 142 | u32 num_slots; | ||
| 143 | struct platform_device *pdev; | ||
| 144 | struct dw_mci_board *pdata; | ||
| 145 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | ||
| 146 | |||
| 147 | /* FIFO push and pull */ | ||
| 148 | int data_shift; | ||
| 149 | void (*push_data)(struct dw_mci *host, void *buf, int cnt); | ||
| 150 | void (*pull_data)(struct dw_mci *host, void *buf, int cnt); | ||
| 151 | |||
| 152 | /* Workaround flags */ | ||
| 153 | u32 quirks; | ||
| 154 | }; | ||
| 155 | |||
| 156 | /* DMA ops for Internal/External DMAC interface */ | ||
| 157 | struct dw_mci_dma_ops { | ||
| 158 | /* DMA Ops */ | ||
| 159 | int (*init)(struct dw_mci *host); | ||
| 160 | void (*start)(struct dw_mci *host, unsigned int sg_len); | ||
| 161 | void (*complete)(struct dw_mci *host); | ||
| 162 | void (*stop)(struct dw_mci *host); | ||
| 163 | void (*cleanup)(struct dw_mci *host); | ||
| 164 | void (*exit)(struct dw_mci *host); | ||
| 165 | }; | ||
| 166 | |||
| 167 | /* IP Quirks/flags. */ | ||
| 168 | /* No special quirks or flags to cater for */ | ||
| 169 | #define DW_MCI_QUIRK_NONE 0 | ||
| 170 | /* DTO fix for command transmission with IDMAC configured */ | ||
| 171 | #define DW_MCI_QUIRK_IDMAC_DTO 1 | ||
| 172 | /* delay needed between retries on some 2.11a implementations */ | ||
| 173 | #define DW_MCI_QUIRK_RETRY_DELAY 2 | ||
| 174 | /* High Speed Capable - Supports HS cards (upto 50MHz) */ | ||
| 175 | #define DW_MCI_QUIRK_HIGHSPEED 4 | ||
| 176 | |||
| 177 | |||
| 178 | struct dma_pdata; | ||
| 179 | |||
| 180 | struct block_settings { | ||
| 181 | unsigned short max_segs; /* see blk_queue_max_segments */ | ||
| 182 | unsigned int max_blk_size; /* maximum size of one mmc block */ | ||
| 183 | unsigned int max_blk_count; /* maximum number of blocks in one req*/ | ||
| 184 | unsigned int max_req_size; /* maximum number of bytes in one req*/ | ||
| 185 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | ||
| 186 | }; | ||
| 187 | |||
| 188 | /* Board platform data */ | ||
| 189 | struct dw_mci_board { | ||
| 190 | u32 num_slots; | ||
| 191 | |||
| 192 | u32 quirks; /* Workaround / Quirk flags */ | ||
| 193 | unsigned int bus_hz; /* Bus speed */ | ||
| 194 | |||
| 195 | /* delay in mS before detecting cards after interrupt */ | ||
| 196 | u32 detect_delay_ms; | ||
| 197 | |||
| 198 | int (*init)(u32 slot_id, irq_handler_t , void *); | ||
| 199 | int (*get_ro)(u32 slot_id); | ||
| 200 | int (*get_cd)(u32 slot_id); | ||
| 201 | int (*get_ocr)(u32 slot_id); | ||
| 202 | int (*get_bus_wd)(u32 slot_id); | ||
| 203 | /* | ||
| 204 | * Enable power to selected slot and set voltage to desired level. | ||
| 205 | * Voltage levels are specified using MMC_VDD_xxx defines defined | ||
| 206 | * in linux/mmc/host.h file. | ||
| 207 | */ | ||
| 208 | void (*setpower)(u32 slot_id, u32 volt); | ||
| 209 | void (*exit)(u32 slot_id); | ||
| 210 | void (*select_slot)(u32 slot_id); | ||
| 211 | |||
| 212 | struct dw_mci_dma_ops *dma_ops; | ||
| 213 | struct dma_pdata *data; | ||
| 214 | struct block_settings *blk_settings; | ||
| 215 | }; | ||
| 216 | |||
| 217 | #endif /* _LINUX_MMC_DW_MMC_H_ */ | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 30f6fad99a5..bcb793ec737 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -131,6 +131,9 @@ struct mmc_host { | |||
| 131 | unsigned int f_max; | 131 | unsigned int f_max; |
| 132 | unsigned int f_init; | 132 | unsigned int f_init; |
| 133 | u32 ocr_avail; | 133 | u32 ocr_avail; |
| 134 | u32 ocr_avail_sdio; /* SDIO-specific OCR */ | ||
| 135 | u32 ocr_avail_sd; /* SD-specific OCR */ | ||
| 136 | u32 ocr_avail_mmc; /* MMC-specific OCR */ | ||
| 134 | struct notifier_block pm_notify; | 137 | struct notifier_block pm_notify; |
| 135 | 138 | ||
| 136 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ | 139 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ |
| @@ -169,9 +172,20 @@ struct mmc_host { | |||
| 169 | #define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ | 172 | #define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ |
| 170 | /* DDR mode at 1.2V */ | 173 | /* DDR mode at 1.2V */ |
| 171 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ | 174 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ |
| 175 | #define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ | ||
| 172 | 176 | ||
| 173 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 177 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 174 | 178 | ||
| 179 | #ifdef CONFIG_MMC_CLKGATE | ||
| 180 | int clk_requests; /* internal reference counter */ | ||
| 181 | unsigned int clk_delay; /* number of MCI clk hold cycles */ | ||
| 182 | bool clk_gated; /* clock gated */ | ||
| 183 | struct work_struct clk_gate_work; /* delayed clock gate */ | ||
| 184 | unsigned int clk_old; /* old clock value cache */ | ||
| 185 | spinlock_t clk_lock; /* lock for clk fields */ | ||
| 186 | struct mutex clk_gate_mutex; /* mutex for clock gating */ | ||
| 187 | #endif | ||
| 188 | |||
| 175 | /* host specific block data */ | 189 | /* host specific block data */ |
| 176 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 190 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
| 177 | unsigned short max_segs; /* see blk_queue_max_segments */ | 191 | unsigned short max_segs; /* see blk_queue_max_segments */ |
| @@ -307,5 +321,10 @@ static inline int mmc_card_is_removable(struct mmc_host *host) | |||
| 307 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; | 321 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; |
| 308 | } | 322 | } |
| 309 | 323 | ||
| 324 | static inline int mmc_card_is_powered_resumed(struct mmc_host *host) | ||
| 325 | { | ||
| 326 | return host->pm_flags & MMC_PM_KEEP_POWER; | ||
| 327 | } | ||
| 328 | |||
| 310 | #endif | 329 | #endif |
| 311 | 330 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 956fbd87769..612301f85d1 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -40,7 +40,9 @@ | |||
| 40 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ | 40 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ |
| 41 | #define MMC_STOP_TRANSMISSION 12 /* ac R1b */ | 41 | #define MMC_STOP_TRANSMISSION 12 /* ac R1b */ |
| 42 | #define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ | 42 | #define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ |
| 43 | #define MMC_BUS_TEST_R 14 /* adtc R1 */ | ||
| 43 | #define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ | 44 | #define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ |
| 45 | #define MMC_BUS_TEST_W 19 /* adtc R1 */ | ||
| 44 | #define MMC_SPI_READ_OCR 58 /* spi spi_R3 */ | 46 | #define MMC_SPI_READ_OCR 58 /* spi spi_R3 */ |
| 45 | #define MMC_SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */ | 47 | #define MMC_SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */ |
| 46 | 48 | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1fdc673f239..83bd9f76709 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -83,6 +83,8 @@ struct sdhci_host { | |||
| 83 | #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) | 83 | #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) |
| 84 | /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ | 84 | /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ |
| 85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) | 85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) |
| 86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ | ||
| 87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) | ||
| 86 | 88 | ||
| 87 | int irq; /* Device IRQ */ | 89 | int irq; /* Device IRQ */ |
| 88 | void __iomem *ioaddr; /* Mapped address */ | 90 | void __iomem *ioaddr; /* Mapped address */ |
| @@ -139,6 +141,10 @@ struct sdhci_host { | |||
| 139 | 141 | ||
| 140 | unsigned int caps; /* Alternative capabilities */ | 142 | unsigned int caps; /* Alternative capabilities */ |
| 141 | 143 | ||
| 144 | unsigned int ocr_avail_sdio; /* OCR bit masks */ | ||
| 145 | unsigned int ocr_avail_sd; | ||
| 146 | unsigned int ocr_avail_mmc; | ||
| 147 | |||
| 142 | unsigned long private[0] ____cacheline_aligned; | 148 | unsigned long private[0] ____cacheline_aligned; |
| 143 | }; | 149 | }; |
| 144 | #endif /* __SDHCI_H */ | 150 | #endif /* __SDHCI_H */ |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 44fc5348fd5..bf173502d74 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 43dcfbdc39d..cc2e7dfea9d 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 39c24ebe9cf..02ecb0189b1 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/module.h b/include/linux/module.h index 8b17fd8c790..e7c6385c668 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -58,6 +58,12 @@ struct module_attribute { | |||
| 58 | void (*free)(struct module *); | 58 | void (*free)(struct module *); |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | struct module_version_attribute { | ||
| 62 | struct module_attribute mattr; | ||
| 63 | const char *module_name; | ||
| 64 | const char *version; | ||
| 65 | }; | ||
| 66 | |||
| 61 | struct module_kobject | 67 | struct module_kobject |
| 62 | { | 68 | { |
| 63 | struct kobject kobj; | 69 | struct kobject kobj; |
| @@ -161,7 +167,28 @@ extern struct module __this_module; | |||
| 161 | Using this automatically adds a checksum of the .c files and the | 167 | Using this automatically adds a checksum of the .c files and the |
| 162 | local headers in "srcversion". | 168 | local headers in "srcversion". |
| 163 | */ | 169 | */ |
| 170 | |||
| 171 | #if defined(MODULE) || !defined(CONFIG_SYSFS) | ||
| 164 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 172 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
| 173 | #else | ||
| 174 | #define MODULE_VERSION(_version) \ | ||
| 175 | extern ssize_t __modver_version_show(struct module_attribute *, \ | ||
| 176 | struct module *, char *); \ | ||
| 177 | static struct module_version_attribute __modver_version_attr \ | ||
| 178 | __used \ | ||
| 179 | __attribute__ ((__section__ ("__modver"),aligned(sizeof(void *)))) \ | ||
| 180 | = { \ | ||
| 181 | .mattr = { \ | ||
| 182 | .attr = { \ | ||
| 183 | .name = "version", \ | ||
| 184 | .mode = S_IRUGO, \ | ||
| 185 | }, \ | ||
| 186 | .show = __modver_version_show, \ | ||
| 187 | }, \ | ||
| 188 | .module_name = KBUILD_MODNAME, \ | ||
| 189 | .version = _version, \ | ||
| 190 | } | ||
| 191 | #endif | ||
| 165 | 192 | ||
| 166 | /* Optional firmware file (or files) needed by the module | 193 | /* Optional firmware file (or files) needed by the module |
| 167 | * format is simply firmware file name. Multiple firmware | 194 | * format is simply firmware file name. Multiple firmware |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 112adf8bd47..07b41951e3f 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -16,15 +16,17 @@ | |||
| 16 | /* Chosen so that structs with an unsigned long line up. */ | 16 | /* Chosen so that structs with an unsigned long line up. */ |
| 17 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) | 17 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) |
| 18 | 18 | ||
| 19 | #ifdef MODULE | ||
| 20 | #define ___module_cat(a,b) __mod_ ## a ## b | 19 | #define ___module_cat(a,b) __mod_ ## a ## b |
| 21 | #define __module_cat(a,b) ___module_cat(a,b) | 20 | #define __module_cat(a,b) ___module_cat(a,b) |
| 21 | #ifdef MODULE | ||
| 22 | #define __MODULE_INFO(tag, name, info) \ | 22 | #define __MODULE_INFO(tag, name, info) \ |
| 23 | static const char __module_cat(name,__LINE__)[] \ | 23 | static const char __module_cat(name,__LINE__)[] \ |
| 24 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ | 24 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ |
| 25 | = __stringify(tag) "=" info | 25 | = __stringify(tag) "=" info |
| 26 | #else /* !MODULE */ | 26 | #else /* !MODULE */ |
| 27 | #define __MODULE_INFO(tag, name, info) | 27 | /* This struct is here for syntactic coherency, it is not used */ |
| 28 | #define __MODULE_INFO(tag, name, info) \ | ||
| 29 | struct __module_cat(name,__LINE__) {} | ||
| 28 | #endif | 30 | #endif |
| 29 | #define __MODULE_PARM_TYPE(name, _type) \ | 31 | #define __MODULE_PARM_TYPE(name, _type) \ |
| 30 | __MODULE_INFO(parmtype, name##type, #name ":" _type) | 32 | __MODULE_INFO(parmtype, name##type, #name ":" _type) |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 1869ea24a73..604f122a232 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 4dd0c2cd765..a9baee6864a 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 5d2556700ec..6987995ad3c 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 fe8d77ebec1..9d5306bad11 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 63e17d01fde..1f489b247a2 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 0c8815bfae1..ae418e41d8f 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 2b54316591d..4a0a8ba90a7 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 18d06add0a4..f276d4fa01f 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 1c27f201c85..e13eefef065 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 4b0bec47784..00000000000 --- 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 d64b0e89433..00000000000 --- 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 a2b549eb1ec..dfcbea2d889 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/nfc/pn544.h b/include/linux/nfc/pn544.h new file mode 100644 index 00000000000..7ab8521f234 --- /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/nfs3.h b/include/linux/nfs3.h index ac33806ec7f..6ccfe3b641e 100644 --- a/include/linux/nfs3.h +++ b/include/linux/nfs3.h | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | #define NFS3_MAXGROUPS 16 | 11 | #define NFS3_MAXGROUPS 16 |
| 12 | #define NFS3_FHSIZE 64 | 12 | #define NFS3_FHSIZE 64 |
| 13 | #define NFS3_COOKIESIZE 4 | 13 | #define NFS3_COOKIESIZE 4 |
| 14 | #define NFS3_CREATEVERFSIZE 8 | ||
| 15 | #define NFS3_COOKIEVERFSIZE 8 | ||
| 16 | #define NFS3_WRITEVERFSIZE 8 | ||
| 14 | #define NFS3_FIFO_DEV (-1) | 17 | #define NFS3_FIFO_DEV (-1) |
| 15 | #define NFS3MODE_FMT 0170000 | 18 | #define NFS3MODE_FMT 0170000 |
| 16 | #define NFS3MODE_DIR 0040000 | 19 | #define NFS3MODE_DIR 0040000 |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 4925b22219d..134716e5e35 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 |
| @@ -111,9 +114,13 @@ | |||
| 111 | 114 | ||
| 112 | #define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001 | 115 | #define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001 |
| 113 | #define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002 | 116 | #define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002 |
| 117 | #define EXCHGID4_FLAG_BIND_PRINC_STATEID 0x00000100 | ||
| 118 | |||
| 114 | #define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000 | 119 | #define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000 |
| 115 | #define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000 | 120 | #define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000 |
| 116 | #define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000 | 121 | #define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000 |
| 122 | #define EXCHGID4_FLAG_MASK_PNFS 0x00070000 | ||
| 123 | |||
| 117 | #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 | 124 | #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 |
| 118 | #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 | 125 | #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 |
| 119 | /* | 126 | /* |
| @@ -121,8 +128,8 @@ | |||
| 121 | * they're set in the argument or response, have separate | 128 | * they're set in the argument or response, have separate |
| 122 | * invalid flag masks for arg (_A) and resp (_R). | 129 | * invalid flag masks for arg (_A) and resp (_R). |
| 123 | */ | 130 | */ |
| 124 | #define EXCHGID4_FLAG_MASK_A 0x40070003 | 131 | #define EXCHGID4_FLAG_MASK_A 0x40070103 |
| 125 | #define EXCHGID4_FLAG_MASK_R 0x80070003 | 132 | #define EXCHGID4_FLAG_MASK_R 0x80070103 |
| 126 | 133 | ||
| 127 | #define SEQ4_STATUS_CB_PATH_DOWN 0x00000001 | 134 | #define SEQ4_STATUS_CB_PATH_DOWN 0x00000001 |
| 128 | #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002 | 135 | #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002 |
| @@ -136,6 +143,9 @@ | |||
| 136 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 | 143 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 |
| 137 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 | 144 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 |
| 138 | 145 | ||
| 146 | #define NFS4_SECINFO_STYLE4_CURRENT_FH 0 | ||
| 147 | #define NFS4_SECINFO_STYLE4_PARENT 1 | ||
| 148 | |||
| 139 | #define NFS4_MAX_UINT64 (~(u64)0) | 149 | #define NFS4_MAX_UINT64 (~(u64)0) |
| 140 | 150 | ||
| 141 | /* 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 c9c05a78e9b..00000000000 --- 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 0779bb8f95b..6023efa9f5d 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/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 452d96436d2..b197563913b 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -47,11 +47,6 @@ struct nfs_client { | |||
| 47 | u64 cl_clientid; /* constant */ | 47 | u64 cl_clientid; /* constant */ |
| 48 | unsigned long cl_state; | 48 | unsigned long cl_state; |
| 49 | 49 | ||
| 50 | struct rb_root cl_openowner_id; | ||
| 51 | struct rb_root cl_lockowner_id; | ||
| 52 | |||
| 53 | struct list_head cl_delegations; | ||
| 54 | struct rb_root cl_state_owners; | ||
| 55 | spinlock_t cl_lock; | 50 | spinlock_t cl_lock; |
| 56 | 51 | ||
| 57 | unsigned long cl_lease_time; | 52 | unsigned long cl_lease_time; |
| @@ -71,6 +66,7 @@ struct nfs_client { | |||
| 71 | */ | 66 | */ |
| 72 | char cl_ipaddr[48]; | 67 | char cl_ipaddr[48]; |
| 73 | unsigned char cl_id_uniquifier; | 68 | unsigned char cl_id_uniquifier; |
| 69 | u32 cl_cb_ident; /* v4.0 callback identifier */ | ||
| 74 | const struct nfs4_minor_version_ops *cl_mvops; | 70 | const struct nfs4_minor_version_ops *cl_mvops; |
| 75 | #endif /* CONFIG_NFS_V4 */ | 71 | #endif /* CONFIG_NFS_V4 */ |
| 76 | 72 | ||
| @@ -148,7 +144,14 @@ struct nfs_server { | |||
| 148 | that are supported on this | 144 | that are supported on this |
| 149 | filesystem */ | 145 | filesystem */ |
| 150 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ | 146 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ |
| 147 | struct rpc_wait_queue roc_rpcwaitq; | ||
| 148 | |||
| 149 | /* the following fields are protected by nfs_client->cl_lock */ | ||
| 150 | struct rb_root state_owners; | ||
| 151 | struct rb_root openowner_id; | ||
| 152 | struct rb_root lockowner_id; | ||
| 151 | #endif | 153 | #endif |
| 154 | struct list_head delegations; | ||
| 152 | void (*destroy)(struct nfs_server *); | 155 | void (*destroy)(struct nfs_server *); |
| 153 | 156 | ||
| 154 | atomic_t active; /* Keep trace of any activity to this server */ | 157 | atomic_t active; /* Keep trace of any activity to this server */ |
| @@ -196,6 +199,7 @@ struct nfs4_slot_table { | |||
| 196 | * op for dynamic resizing */ | 199 | * op for dynamic resizing */ |
| 197 | int target_max_slots; /* Set by CB_RECALL_SLOT as | 200 | int target_max_slots; /* Set by CB_RECALL_SLOT as |
| 198 | * the new max_slots */ | 201 | * the new max_slots */ |
| 202 | struct completion complete; | ||
| 199 | }; | 203 | }; |
| 200 | 204 | ||
| 201 | static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp) | 205 | static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp) |
| @@ -212,7 +216,6 @@ struct nfs4_session { | |||
| 212 | unsigned long session_state; | 216 | unsigned long session_state; |
| 213 | u32 hash_alg; | 217 | u32 hash_alg; |
| 214 | u32 ssv_len; | 218 | u32 ssv_len; |
| 215 | struct completion complete; | ||
| 216 | 219 | ||
| 217 | /* The fore and back channel */ | 220 | /* The fore and back channel */ |
| 218 | struct nfs4_channel_attrs fc_attrs; | 221 | struct nfs4_channel_attrs fc_attrs; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 80f07198a31..b0068579bec 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -208,6 +208,7 @@ struct nfs4_layoutget_args { | |||
| 208 | struct inode *inode; | 208 | struct inode *inode; |
| 209 | struct nfs_open_context *ctx; | 209 | struct nfs_open_context *ctx; |
| 210 | struct nfs4_sequence_args seq_args; | 210 | struct nfs4_sequence_args seq_args; |
| 211 | nfs4_stateid stateid; | ||
| 211 | }; | 212 | }; |
| 212 | 213 | ||
| 213 | struct nfs4_layoutget_res { | 214 | struct nfs4_layoutget_res { |
| @@ -223,7 +224,6 @@ struct nfs4_layoutget { | |||
| 223 | struct nfs4_layoutget_args args; | 224 | struct nfs4_layoutget_args args; |
| 224 | struct nfs4_layoutget_res res; | 225 | struct nfs4_layoutget_res res; |
| 225 | struct pnfs_layout_segment **lsegpp; | 226 | struct pnfs_layout_segment **lsegpp; |
| 226 | int status; | ||
| 227 | }; | 227 | }; |
| 228 | 228 | ||
| 229 | struct nfs4_getdeviceinfo_args { | 229 | struct nfs4_getdeviceinfo_args { |
| @@ -317,6 +317,7 @@ struct nfs_closeres { | |||
| 317 | struct nfs_lowner { | 317 | struct nfs_lowner { |
| 318 | __u64 clientid; | 318 | __u64 clientid; |
| 319 | __u64 id; | 319 | __u64 id; |
| 320 | dev_t s_dev; | ||
| 320 | }; | 321 | }; |
| 321 | 322 | ||
| 322 | struct nfs_lock_args { | 323 | struct nfs_lock_args { |
| @@ -484,6 +485,7 @@ struct nfs_entry { | |||
| 484 | struct nfs_fh * fh; | 485 | struct nfs_fh * fh; |
| 485 | struct nfs_fattr * fattr; | 486 | struct nfs_fattr * fattr; |
| 486 | unsigned char d_type; | 487 | unsigned char d_type; |
| 488 | struct nfs_server * server; | ||
| 487 | }; | 489 | }; |
| 488 | 490 | ||
| 489 | /* | 491 | /* |
| @@ -1089,7 +1091,7 @@ struct nfs_rpc_ops { | |||
| 1089 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | 1091 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
| 1090 | struct nfs_pathconf *); | 1092 | struct nfs_pathconf *); |
| 1091 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 1093 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
| 1092 | __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus); | 1094 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); |
| 1093 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); | 1095 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); |
| 1094 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 1096 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
| 1095 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); | 1097 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 8ae78a61eea..bd316159278 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 d4a2ac18bd4..00000000000 --- 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/of_address.h b/include/linux/of_address.h index 8aea06f0564..2feda6ee614 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #include <linux/ioport.h> | 3 | #include <linux/ioport.h> |
| 4 | #include <linux/of.h> | 4 | #include <linux/of.h> |
| 5 | 5 | ||
| 6 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | 6 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
| 7 | extern int of_address_to_resource(struct device_node *dev, int index, | 7 | extern int of_address_to_resource(struct device_node *dev, int index, |
| 8 | struct resource *r); | 8 | struct resource *r); |
| 9 | extern void __iomem *of_iomap(struct device_node *device, int index); | 9 | extern void __iomem *of_iomap(struct device_node *device, int index); |
| @@ -21,7 +21,7 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | |||
| 21 | #endif | 21 | #endif |
| 22 | 22 | ||
| 23 | #ifdef CONFIG_PCI | 23 | #ifdef CONFIG_PCI |
| 24 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | 24 | extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, |
| 25 | u64 *size, unsigned int *flags); | 25 | u64 *size, unsigned int *flags); |
| 26 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | 26 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, |
| 27 | struct resource *r); | 27 | struct resource *r); |
| @@ -32,7 +32,7 @@ static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | |||
| 32 | return -ENOSYS; | 32 | return -ENOSYS; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | static inline const u32 *of_get_pci_address(struct device_node *dev, | 35 | static inline const __be32 *of_get_pci_address(struct device_node *dev, |
| 36 | int bar_no, u64 *size, unsigned int *flags) | 36 | int bar_no, u64 *size, unsigned int *flags) |
| 37 | { | 37 | { |
| 38 | return NULL; | 38 | return NULL; |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 7bbf5b32843..c84d900fbbb 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -58,6 +58,23 @@ struct boot_param_header { | |||
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | #if defined(CONFIG_OF_FLATTREE) | 60 | #if defined(CONFIG_OF_FLATTREE) |
| 61 | |||
| 62 | struct device_node; | ||
| 63 | |||
| 64 | /* For scanning an arbitrary device-tree at any time */ | ||
| 65 | extern char *of_fdt_get_string(struct boot_param_header *blob, u32 offset); | ||
| 66 | extern void *of_fdt_get_property(struct boot_param_header *blob, | ||
| 67 | unsigned long node, | ||
| 68 | const char *name, | ||
| 69 | unsigned long *size); | ||
| 70 | extern int of_fdt_is_compatible(struct boot_param_header *blob, | ||
| 71 | unsigned long node, | ||
| 72 | const char *compat); | ||
| 73 | extern int of_fdt_match(struct boot_param_header *blob, unsigned long node, | ||
| 74 | const char **compat); | ||
| 75 | extern void of_fdt_unflatten_tree(unsigned long *blob, | ||
| 76 | struct device_node **mynodes); | ||
| 77 | |||
| 61 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ | 78 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ |
| 62 | extern int __initdata dt_root_addr_cells; | 79 | extern int __initdata dt_root_addr_cells; |
| 63 | extern int __initdata dt_root_size_cells; | 80 | extern int __initdata dt_root_size_cells; |
| @@ -71,6 +88,7 @@ extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, | |||
| 71 | extern void *of_get_flat_dt_prop(unsigned long node, const char *name, | 88 | extern void *of_get_flat_dt_prop(unsigned long node, const char *name, |
| 72 | unsigned long *size); | 89 | unsigned long *size); |
| 73 | extern int of_flat_dt_is_compatible(unsigned long node, const char *name); | 90 | extern int of_flat_dt_is_compatible(unsigned long node, const char *name); |
| 91 | extern int of_flat_dt_match(unsigned long node, const char **matches); | ||
| 74 | extern unsigned long of_get_flat_dt_root(void); | 92 | extern unsigned long of_get_flat_dt_root(void); |
| 75 | 93 | ||
| 76 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | 94 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, |
| @@ -79,7 +97,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node); | |||
| 79 | 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, |
| 80 | int depth, void *data); | 98 | int depth, void *data); |
| 81 | 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); |
| 82 | 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); |
| 83 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | 101 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); |
| 84 | 102 | ||
| 85 | /* | 103 | /* |
diff --git a/include/linux/of_net.h b/include/linux/of_net.h new file mode 100644 index 00000000000..e913081fb52 --- /dev/null +++ b/include/linux/of_net.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | /* | ||
| 2 | * OF helpers for network devices. | ||
| 3 | * | ||
| 4 | * This file is released under the GPLv2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __LINUX_OF_NET_H | ||
| 8 | #define __LINUX_OF_NET_H | ||
| 9 | |||
| 10 | #ifdef CONFIG_OF_NET | ||
| 11 | #include <linux/of.h> | ||
| 12 | extern const void *of_get_mac_address(struct device_node *np); | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #endif /* __LINUX_OF_NET_H */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5f38c460367..0db8037e272 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 b02195dfc1b..6d6cb7a57bb 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 2d1ffe3cf1e..9c66e994540 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 a581e8c0653..edc98dec626 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 c8b6473c5f4..44623500f41 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 91ba0b338b4..ce6810512c6 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 7454408c41b..559d0289707 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 cb845c16ad7..3adb06ebf84 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -518,6 +518,7 @@ | |||
| 518 | #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 | 518 | #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 |
| 519 | #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 | 519 | #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 |
| 520 | #define PCI_DEVICE_ID_AMD_15H_NB_MISC 0x1603 | 520 | #define PCI_DEVICE_ID_AMD_15H_NB_MISC 0x1603 |
| 521 | #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 | ||
| 521 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 522 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
| 522 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 523 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
| 523 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 524 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
| @@ -1650,6 +1651,11 @@ | |||
| 1650 | #define PCI_DEVICE_ID_O2_6836 0x6836 | 1651 | #define PCI_DEVICE_ID_O2_6836 0x6836 |
| 1651 | #define PCI_DEVICE_ID_O2_6812 0x6872 | 1652 | #define PCI_DEVICE_ID_O2_6812 0x6872 |
| 1652 | #define PCI_DEVICE_ID_O2_6933 0x6933 | 1653 | #define PCI_DEVICE_ID_O2_6933 0x6933 |
| 1654 | #define PCI_DEVICE_ID_O2_8120 0x8120 | ||
| 1655 | #define PCI_DEVICE_ID_O2_8220 0x8220 | ||
| 1656 | #define PCI_DEVICE_ID_O2_8221 0x8221 | ||
| 1657 | #define PCI_DEVICE_ID_O2_8320 0x8320 | ||
| 1658 | #define PCI_DEVICE_ID_O2_8321 0x8321 | ||
| 1653 | 1659 | ||
| 1654 | #define PCI_VENDOR_ID_3DFX 0x121a | 1660 | #define PCI_VENDOR_ID_3DFX 0x121a |
| 1655 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 | 1661 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 |
| @@ -2363,6 +2369,10 @@ | |||
| 2363 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 | 2369 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 |
| 2364 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 | 2370 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 |
| 2365 | #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 | ||
| 2373 | #define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 | ||
| 2374 | #define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 | ||
| 2375 | #define PCI_DEVICE_ID_JMICRON_JMB390_MS 0x2393 | ||
| 2366 | 2376 | ||
| 2367 | #define PCI_VENDOR_ID_KORENIX 0x1982 | 2377 | #define PCI_VENDOR_ID_KORENIX 0x1982 |
| 2368 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 | 2378 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 |
| @@ -2468,7 +2478,8 @@ | |||
| 2468 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 | 2478 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 |
| 2469 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2479 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
| 2470 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | 2480 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 |
| 2471 | #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 | ||
| 2472 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2483 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
| 2473 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2484 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
| 2474 | #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 af83076c31a..5b7e6b1ba54 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/pipe_fs_i.h b/include/linux/pipe_fs_i.h index bb27d7ec2fb..77257c92155 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
| @@ -30,6 +30,7 @@ struct pipe_buffer { | |||
| 30 | * struct pipe_inode_info - a linux kernel pipe | 30 | * struct pipe_inode_info - a linux kernel pipe |
| 31 | * @wait: reader/writer wait point in case of empty/full pipe | 31 | * @wait: reader/writer wait point in case of empty/full pipe |
| 32 | * @nrbufs: the number of non-empty pipe buffers in this pipe | 32 | * @nrbufs: the number of non-empty pipe buffers in this pipe |
| 33 | * @buffers: total number of buffers (should be a power of 2) | ||
| 33 | * @curbuf: the current pipe buffer entry | 34 | * @curbuf: the current pipe buffer entry |
| 34 | * @tmp_page: cached released page | 35 | * @tmp_page: cached released page |
| 35 | * @readers: number of current readers of this pipe | 36 | * @readers: number of current readers of this pipe |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 40f3f45702b..dd9c7ab3827 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -367,45 +367,6 @@ extern struct dev_pm_ops generic_subsys_pm_ops; | |||
| 367 | { .event = PM_EVENT_AUTO_RESUME, }) | 367 | { .event = PM_EVENT_AUTO_RESUME, }) |
| 368 | 368 | ||
| 369 | /** | 369 | /** |
| 370 | * Device power management states | ||
| 371 | * | ||
| 372 | * These state labels are used internally by the PM core to indicate the current | ||
| 373 | * status of a device with respect to the PM core operations. | ||
| 374 | * | ||
| 375 | * DPM_ON Device is regarded as operational. Set this way | ||
| 376 | * initially and when ->complete() is about to be called. | ||
| 377 | * Also set when ->prepare() fails. | ||
| 378 | * | ||
| 379 | * DPM_PREPARING Device is going to be prepared for a PM transition. Set | ||
| 380 | * when ->prepare() is about to be called. | ||
| 381 | * | ||
| 382 | * DPM_RESUMING Device is going to be resumed. Set when ->resume(), | ||
| 383 | * ->thaw(), or ->restore() is about to be called. | ||
| 384 | * | ||
| 385 | * DPM_SUSPENDING Device has been prepared for a power transition. Set | ||
| 386 | * when ->prepare() has just succeeded. | ||
| 387 | * | ||
| 388 | * DPM_OFF Device is regarded as inactive. Set immediately after | ||
| 389 | * ->suspend(), ->freeze(), or ->poweroff() has succeeded. | ||
| 390 | * Also set when ->resume()_noirq, ->thaw_noirq(), or | ||
| 391 | * ->restore_noirq() is about to be called. | ||
| 392 | * | ||
| 393 | * DPM_OFF_IRQ Device is in a "deep sleep". Set immediately after | ||
| 394 | * ->suspend_noirq(), ->freeze_noirq(), or | ||
| 395 | * ->poweroff_noirq() has just succeeded. | ||
| 396 | */ | ||
| 397 | |||
| 398 | enum dpm_state { | ||
| 399 | DPM_INVALID, | ||
| 400 | DPM_ON, | ||
| 401 | DPM_PREPARING, | ||
| 402 | DPM_RESUMING, | ||
| 403 | DPM_SUSPENDING, | ||
| 404 | DPM_OFF, | ||
| 405 | DPM_OFF_IRQ, | ||
| 406 | }; | ||
| 407 | |||
| 408 | /** | ||
| 409 | * Device run-time power management status. | 370 | * Device run-time power management status. |
| 410 | * | 371 | * |
| 411 | * These status labels are used internally by the PM core to indicate the | 372 | * These status labels are used internally by the PM core to indicate the |
| @@ -463,8 +424,8 @@ struct wakeup_source; | |||
| 463 | struct dev_pm_info { | 424 | struct dev_pm_info { |
| 464 | pm_message_t power_state; | 425 | pm_message_t power_state; |
| 465 | unsigned int can_wakeup:1; | 426 | unsigned int can_wakeup:1; |
| 466 | unsigned async_suspend:1; | 427 | unsigned int async_suspend:1; |
| 467 | enum dpm_state status; /* Owned by the PM core */ | 428 | unsigned int in_suspend:1; /* Owned by the PM core */ |
| 468 | spinlock_t lock; | 429 | spinlock_t lock; |
| 469 | #ifdef CONFIG_PM_SLEEP | 430 | #ifdef CONFIG_PM_SLEEP |
| 470 | struct list_head entry; | 431 | struct list_head entry; |
| @@ -486,6 +447,7 @@ struct dev_pm_info { | |||
| 486 | unsigned int run_wake:1; | 447 | unsigned int run_wake:1; |
| 487 | unsigned int runtime_auto:1; | 448 | unsigned int runtime_auto:1; |
| 488 | unsigned int no_callbacks:1; | 449 | unsigned int no_callbacks:1; |
| 450 | unsigned int irq_safe:1; | ||
| 489 | unsigned int use_autosuspend:1; | 451 | unsigned int use_autosuspend:1; |
| 490 | unsigned int timer_autosuspends:1; | 452 | unsigned int timer_autosuspends:1; |
| 491 | enum rpm_request request; | 453 | enum rpm_request request; |
| @@ -610,4 +572,11 @@ extern unsigned int pm_flags; | |||
| 610 | #define PM_APM 1 | 572 | #define PM_APM 1 |
| 611 | #define PM_ACPI 2 | 573 | #define PM_ACPI 2 |
| 612 | 574 | ||
| 575 | extern int pm_generic_suspend(struct device *dev); | ||
| 576 | extern int pm_generic_resume(struct device *dev); | ||
| 577 | extern int pm_generic_freeze(struct device *dev); | ||
| 578 | extern int pm_generic_thaw(struct device *dev); | ||
| 579 | extern int pm_generic_restore(struct device *dev); | ||
| 580 | extern int pm_generic_poweroff(struct device *dev); | ||
| 581 | |||
| 613 | #endif /* _LINUX_PM_H */ | 582 | #endif /* _LINUX_PM_H */ |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index d19f1cca7f7..d34f067e2a7 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -40,6 +40,7 @@ extern int pm_generic_runtime_idle(struct device *dev); | |||
| 40 | extern int pm_generic_runtime_suspend(struct device *dev); | 40 | extern int pm_generic_runtime_suspend(struct device *dev); |
| 41 | extern int pm_generic_runtime_resume(struct device *dev); | 41 | extern int pm_generic_runtime_resume(struct device *dev); |
| 42 | extern void pm_runtime_no_callbacks(struct device *dev); | 42 | extern void pm_runtime_no_callbacks(struct device *dev); |
| 43 | extern void pm_runtime_irq_safe(struct device *dev); | ||
| 43 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); | 44 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); |
| 44 | extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | 45 | extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); |
| 45 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | 46 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); |
| @@ -81,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev) | |||
| 81 | && !dev->power.disable_depth; | 82 | && !dev->power.disable_depth; |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 85 | static inline bool pm_runtime_enabled(struct device *dev) | ||
| 86 | { | ||
| 87 | return !dev->power.disable_depth; | ||
| 88 | } | ||
| 89 | |||
| 84 | static inline void pm_runtime_mark_last_busy(struct device *dev) | 90 | static inline void pm_runtime_mark_last_busy(struct device *dev) |
| 85 | { | 91 | { |
| 86 | ACCESS_ONCE(dev->power.last_busy) = jiffies; | 92 | ACCESS_ONCE(dev->power.last_busy) = jiffies; |
| @@ -119,11 +125,13 @@ static inline void pm_runtime_put_noidle(struct device *dev) {} | |||
| 119 | static inline bool device_run_wake(struct device *dev) { return false; } | 125 | static inline bool device_run_wake(struct device *dev) { return false; } |
| 120 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 126 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
| 121 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 127 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
| 128 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | ||
| 122 | 129 | ||
| 123 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | 130 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } |
| 124 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 131 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
| 125 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 132 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
| 126 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 133 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
| 134 | static inline void pm_runtime_irq_safe(struct device *dev) {} | ||
| 127 | 135 | ||
| 128 | static inline void pm_runtime_mark_last_busy(struct device *dev) {} | 136 | static inline void pm_runtime_mark_last_busy(struct device *dev) {} |
| 129 | static inline void __pm_runtime_use_autosuspend(struct device *dev, | 137 | static inline void __pm_runtime_use_autosuspend(struct device *dev, |
| @@ -196,6 +204,11 @@ static inline int pm_runtime_put_sync(struct device *dev) | |||
| 196 | return __pm_runtime_idle(dev, RPM_GET_PUT); | 204 | return __pm_runtime_idle(dev, RPM_GET_PUT); |
| 197 | } | 205 | } |
| 198 | 206 | ||
| 207 | static inline int pm_runtime_put_sync_suspend(struct device *dev) | ||
| 208 | { | ||
| 209 | return __pm_runtime_suspend(dev, RPM_GET_PUT); | ||
| 210 | } | ||
| 211 | |||
| 199 | static inline int pm_runtime_put_sync_autosuspend(struct device *dev) | 212 | static inline int pm_runtime_put_sync_autosuspend(struct device *dev) |
| 200 | { | 213 | { |
| 201 | return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); | 214 | return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 56e76af7810..1a2ccd6f382 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 00000000000..de1dfe09a03 --- /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 00000000000..7995deb8bfc --- /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 0194ab06177..a9bb1d93451 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 e0a193f830e..94048547f29 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 b772ca5fbdf..ee048e77e1a 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/quota.h b/include/linux/quota.h index 94c1f03b50e..9a85412e0db 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -322,9 +322,12 @@ struct dquot_operations { | |||
| 322 | qsize_t *(*get_reserved_space) (struct inode *); | 322 | qsize_t *(*get_reserved_space) (struct inode *); |
| 323 | }; | 323 | }; |
| 324 | 324 | ||
| 325 | struct path; | ||
| 326 | |||
| 325 | /* Operations handling requests from userspace */ | 327 | /* Operations handling requests from userspace */ |
| 326 | struct quotactl_ops { | 328 | struct quotactl_ops { |
| 327 | int (*quota_on)(struct super_block *, int, int, char *); | 329 | int (*quota_on)(struct super_block *, int, int, struct path *); |
| 330 | int (*quota_on_meta)(struct super_block *, int, int); | ||
| 328 | int (*quota_off)(struct super_block *, int); | 331 | int (*quota_off)(struct super_block *, int); |
| 329 | int (*quota_sync)(struct super_block *, int, int); | 332 | int (*quota_sync)(struct super_block *, int, int); |
| 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 333 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index d1a9193960f..eb354f6f26b 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -31,8 +31,9 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia) | |||
| 31 | #define quota_error(sb, fmt, args...) \ | 31 | #define quota_error(sb, fmt, args...) \ |
| 32 | __quota_error((sb), __func__, fmt , ## args) | 32 | __quota_error((sb), __func__, fmt , ## args) |
| 33 | 33 | ||
| 34 | extern void __quota_error(struct super_block *sb, const char *func, | 34 | extern __attribute__((format (printf, 3, 4))) |
| 35 | const char *fmt, ...); | 35 | void __quota_error(struct super_block *sb, const char *func, |
| 36 | const char *fmt, ...); | ||
| 36 | 37 | ||
| 37 | /* | 38 | /* |
| 38 | * declaration of quota_function calls in kernel. | 39 | * declaration of quota_function calls in kernel. |
| @@ -75,11 +76,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
| 75 | 76 | ||
| 76 | int dquot_file_open(struct inode *inode, struct file *file); | 77 | int dquot_file_open(struct inode *inode, struct file *file); |
| 77 | 78 | ||
| 78 | int dquot_quota_on(struct super_block *sb, int type, int format_id, | ||
| 79 | char *path); | ||
| 80 | int dquot_enable(struct inode *inode, int type, int format_id, | 79 | int dquot_enable(struct inode *inode, int type, int format_id, |
| 81 | unsigned int flags); | 80 | unsigned int flags); |
| 82 | int dquot_quota_on_path(struct super_block *sb, int type, int format_id, | 81 | int dquot_quota_on(struct super_block *sb, int type, int format_id, |
| 83 | struct path *path); | 82 | struct path *path); |
| 84 | int dquot_quota_on_mount(struct super_block *sb, char *qf_name, | 83 | int dquot_quota_on_mount(struct super_block *sb, char *qf_name, |
| 85 | int format_id, int type); | 84 | int format_id, int type); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index ab2baa5c488..23241c2fecc 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/rar_register.h b/include/linux/rar_register.h index ffa805780f8..5c611818936 100644 --- a/include/linux/rar_register.h +++ b/include/linux/rar_register.h | |||
| @@ -34,11 +34,27 @@ | |||
| 34 | 34 | ||
| 35 | struct rar_device; | 35 | struct rar_device; |
| 36 | 36 | ||
| 37 | #if defined(CONFIG_RAR_REGISTER) | ||
| 37 | int register_rar(int num, | 38 | int register_rar(int num, |
| 38 | int (*callback)(unsigned long data), unsigned long data); | 39 | int (*callback)(unsigned long data), unsigned long data); |
| 39 | void unregister_rar(int num); | 40 | void unregister_rar(int num); |
| 40 | int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end); | 41 | int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end); |
| 41 | int rar_lock(int rar_index); | 42 | int rar_lock(int rar_index); |
| 43 | #else | ||
| 44 | extern void unregister_rar(int num) { } | ||
| 45 | extern int rar_lock(int rar_index) { return -EIO; } | ||
| 46 | |||
| 47 | extern inline int register_rar(int num, | ||
| 48 | int (*callback)(unsigned long data), unsigned long data) | ||
| 49 | { | ||
| 50 | return -ENODEV; | ||
| 51 | } | ||
| 52 | |||
| 53 | extern int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end) | ||
| 54 | { | ||
| 55 | return -ENODEV; | ||
| 56 | } | ||
| 57 | #endif /* RAR_REGISTER */ | ||
| 42 | 58 | ||
| 43 | #endif /* __KERNEL__ */ | 59 | #endif /* __KERNEL__ */ |
| 44 | #endif /* _RAR_REGISTER_H */ | 60 | #endif /* _RAR_REGISTER_H */ |
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index b872b493724..cf1244fbf3b 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 f509877c2ed..6a210f1511f 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 ebd74726529..7954f6bd7ed 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 592cd7c642c..b8ed16a33c4 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 0bed941f9b1..ff681ebba58 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 edc55da717b..e09e565c4bc 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 ee7b6ada188..7410d3365e2 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 bb83c0da207..e9fd04ca1e5 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 c490fbc43fe..5f57f93b284 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/rtc.h b/include/linux/rtc.h index 14dbc83ded2..a0b639f8e80 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -107,12 +107,17 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year | |||
| 107 | extern int rtc_valid_tm(struct rtc_time *tm); | 107 | extern int rtc_valid_tm(struct rtc_time *tm); |
| 108 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 108 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); |
| 109 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 109 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); |
| 110 | ktime_t rtc_tm_to_ktime(struct rtc_time tm); | ||
| 111 | struct rtc_time rtc_ktime_to_tm(ktime_t kt); | ||
| 112 | |||
| 110 | 113 | ||
| 111 | #include <linux/device.h> | 114 | #include <linux/device.h> |
| 112 | #include <linux/seq_file.h> | 115 | #include <linux/seq_file.h> |
| 113 | #include <linux/cdev.h> | 116 | #include <linux/cdev.h> |
| 114 | #include <linux/poll.h> | 117 | #include <linux/poll.h> |
| 115 | #include <linux/mutex.h> | 118 | #include <linux/mutex.h> |
| 119 | #include <linux/timerqueue.h> | ||
| 120 | #include <linux/workqueue.h> | ||
| 116 | 121 | ||
| 117 | extern struct class *rtc_class; | 122 | extern struct class *rtc_class; |
| 118 | 123 | ||
| @@ -151,7 +156,19 @@ struct rtc_class_ops { | |||
| 151 | }; | 156 | }; |
| 152 | 157 | ||
| 153 | #define RTC_DEVICE_NAME_SIZE 20 | 158 | #define RTC_DEVICE_NAME_SIZE 20 |
| 154 | struct rtc_task; | 159 | typedef struct rtc_task { |
| 160 | void (*func)(void *private_data); | ||
| 161 | void *private_data; | ||
| 162 | } rtc_task_t; | ||
| 163 | |||
| 164 | |||
| 165 | struct rtc_timer { | ||
| 166 | struct rtc_task task; | ||
| 167 | struct timerqueue_node node; | ||
| 168 | ktime_t period; | ||
| 169 | int enabled; | ||
| 170 | }; | ||
| 171 | |||
| 155 | 172 | ||
| 156 | /* flags */ | 173 | /* flags */ |
| 157 | #define RTC_DEV_BUSY 0 | 174 | #define RTC_DEV_BUSY 0 |
| @@ -179,16 +196,13 @@ struct rtc_device | |||
| 179 | spinlock_t irq_task_lock; | 196 | spinlock_t irq_task_lock; |
| 180 | int irq_freq; | 197 | int irq_freq; |
| 181 | int max_user_freq; | 198 | int max_user_freq; |
| 182 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | 199 | |
| 183 | struct work_struct uie_task; | 200 | struct timerqueue_head timerqueue; |
| 184 | struct timer_list uie_timer; | 201 | struct rtc_timer aie_timer; |
| 185 | /* Those fields are protected by rtc->irq_lock */ | 202 | struct rtc_timer uie_rtctimer; |
| 186 | unsigned int oldsecs; | 203 | struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */ |
| 187 | unsigned int uie_irq_active:1; | 204 | int pie_enabled; |
| 188 | unsigned int stop_uie_polling:1; | 205 | struct work_struct irqwork; |
| 189 | unsigned int uie_task_active:1; | ||
| 190 | unsigned int uie_timer_active:1; | ||
| 191 | #endif | ||
| 192 | }; | 206 | }; |
| 193 | #define to_rtc_device(d) container_of(d, struct rtc_device, dev) | 207 | #define to_rtc_device(d) container_of(d, struct rtc_device, dev) |
| 194 | 208 | ||
| @@ -221,18 +235,21 @@ extern int rtc_irq_set_freq(struct rtc_device *rtc, | |||
| 221 | struct rtc_task *task, int freq); | 235 | struct rtc_task *task, int freq); |
| 222 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); | 236 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); |
| 223 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); | 237 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); |
| 224 | extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, | ||
| 225 | unsigned int enabled); | ||
| 226 | 238 | ||
| 227 | typedef struct rtc_task { | 239 | void rtc_aie_update_irq(void *private); |
| 228 | void (*func)(void *private_data); | 240 | void rtc_uie_update_irq(void *private); |
| 229 | void *private_data; | 241 | enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer); |
| 230 | } rtc_task_t; | ||
| 231 | 242 | ||
| 232 | int rtc_register(rtc_task_t *task); | 243 | int rtc_register(rtc_task_t *task); |
| 233 | int rtc_unregister(rtc_task_t *task); | 244 | int rtc_unregister(rtc_task_t *task); |
| 234 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); | 245 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); |
| 235 | 246 | ||
| 247 | void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data); | ||
| 248 | int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer, | ||
| 249 | ktime_t expires, ktime_t period); | ||
| 250 | int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer* timer); | ||
| 251 | void rtc_timer_do_work(struct work_struct *work); | ||
| 252 | |||
| 236 | static inline bool is_leap_year(unsigned int year) | 253 | static inline bool is_leap_year(unsigned int year) |
| 237 | { | 254 | { |
| 238 | return (!(year % 4) && (year % 100)) || !(year % 400); | 255 | return (!(year % 4) && (year % 100)) || !(year % 400); |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index dbce22faa66..fbe58b7e63e 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 341acbbc434..d747f948b34 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 */ |
| @@ -70,7 +71,6 @@ struct sched_param { | |||
| 70 | #include <linux/smp.h> | 71 | #include <linux/smp.h> |
| 71 | #include <linux/sem.h> | 72 | #include <linux/sem.h> |
| 72 | #include <linux/signal.h> | 73 | #include <linux/signal.h> |
| 73 | #include <linux/path.h> | ||
| 74 | #include <linux/compiler.h> | 74 | #include <linux/compiler.h> |
| 75 | #include <linux/completion.h> | 75 | #include <linux/completion.h> |
| 76 | #include <linux/pid.h> | 76 | #include <linux/pid.h> |
| @@ -88,7 +88,6 @@ struct sched_param { | |||
| 88 | #include <linux/timer.h> | 88 | #include <linux/timer.h> |
| 89 | #include <linux/hrtimer.h> | 89 | #include <linux/hrtimer.h> |
| 90 | #include <linux/task_io_accounting.h> | 90 | #include <linux/task_io_accounting.h> |
| 91 | #include <linux/kobject.h> | ||
| 92 | #include <linux/latencytop.h> | 91 | #include <linux/latencytop.h> |
| 93 | #include <linux/cred.h> | 92 | #include <linux/cred.h> |
| 94 | 93 | ||
| @@ -435,6 +434,7 @@ extern int get_dumpable(struct mm_struct *mm); | |||
| 435 | #endif | 434 | #endif |
| 436 | /* leave room for more dump flags */ | 435 | /* leave room for more dump flags */ |
| 437 | #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 */ | ||
| 438 | 438 | ||
| 439 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | 439 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) |
| 440 | 440 | ||
| @@ -635,6 +635,8 @@ struct signal_struct { | |||
| 635 | 635 | ||
| 636 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 636 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
| 637 | 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. */ | ||
| 638 | 640 | ||
| 639 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 641 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
| 640 | * credential calculations | 642 | * credential calculations |
| @@ -685,7 +687,7 @@ struct user_struct { | |||
| 685 | atomic_t fanotify_listeners; | 687 | atomic_t fanotify_listeners; |
| 686 | #endif | 688 | #endif |
| 687 | #ifdef CONFIG_EPOLL | 689 | #ifdef CONFIG_EPOLL |
| 688 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 690 | atomic_long_t epoll_watches; /* The number of file descriptors currently watched */ |
| 689 | #endif | 691 | #endif |
| 690 | #ifdef CONFIG_POSIX_MQUEUE | 692 | #ifdef CONFIG_POSIX_MQUEUE |
| 691 | /* protected by mq_lock */ | 693 | /* protected by mq_lock */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 1ac42475ea0..c642bb8b8f5 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1058,8 +1058,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1058 | * @cred points to the credentials to provide the context against which to | 1058 | * @cred points to the credentials to provide the context against which to |
| 1059 | * evaluate the security data on the key. | 1059 | * evaluate the security data on the key. |
| 1060 | * @perm describes the combination of permissions required of this key. | 1060 | * @perm describes the combination of permissions required of this key. |
| 1061 | * Return 1 if permission granted, 0 if permission denied and -ve it the | 1061 | * Return 0 if permission is granted, -ve error otherwise. |
| 1062 | * normal permissions model should be effected. | ||
| 1063 | * @key_getsecurity: | 1062 | * @key_getsecurity: |
| 1064 | * Get a textual representation of the security context attached to a key | 1063 | * Get a textual representation of the security context attached to a key |
| 1065 | * for the purposes of honouring KEYCTL_GETSECURITY. This function | 1064 | * for the purposes of honouring KEYCTL_GETSECURITY. This function |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a23fa29d4eb..758c5b0c6fd 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 baed2122c5a..1630d9cae22 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/slab_def.h b/include/linux/slab_def.h index 791a502f690..83203ae9390 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -138,11 +138,12 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | |||
| 138 | void *__kmalloc(size_t size, gfp_t flags); | 138 | void *__kmalloc(size_t size, gfp_t flags); |
| 139 | 139 | ||
| 140 | #ifdef CONFIG_TRACING | 140 | #ifdef CONFIG_TRACING |
| 141 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); | 141 | extern void *kmem_cache_alloc_trace(size_t size, |
| 142 | struct kmem_cache *cachep, gfp_t flags); | ||
| 142 | extern size_t slab_buffer_size(struct kmem_cache *cachep); | 143 | extern size_t slab_buffer_size(struct kmem_cache *cachep); |
| 143 | #else | 144 | #else |
| 144 | static __always_inline void * | 145 | static __always_inline void * |
| 145 | kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags) | 146 | kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) |
| 146 | { | 147 | { |
| 147 | return kmem_cache_alloc(cachep, flags); | 148 | return kmem_cache_alloc(cachep, flags); |
| 148 | } | 149 | } |
| @@ -179,10 +180,7 @@ found: | |||
| 179 | #endif | 180 | #endif |
| 180 | cachep = malloc_sizes[i].cs_cachep; | 181 | cachep = malloc_sizes[i].cs_cachep; |
| 181 | 182 | ||
| 182 | ret = kmem_cache_alloc_notrace(cachep, flags); | 183 | ret = kmem_cache_alloc_trace(size, cachep, flags); |
| 183 | |||
| 184 | trace_kmalloc(_THIS_IP_, ret, | ||
| 185 | size, slab_buffer_size(cachep), flags); | ||
| 186 | 184 | ||
| 187 | return ret; | 185 | return ret; |
| 188 | } | 186 | } |
| @@ -194,14 +192,16 @@ extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | |||
| 194 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 192 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 195 | 193 | ||
| 196 | #ifdef CONFIG_TRACING | 194 | #ifdef CONFIG_TRACING |
| 197 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, | 195 | extern void *kmem_cache_alloc_node_trace(size_t size, |
| 198 | gfp_t flags, | 196 | struct kmem_cache *cachep, |
| 199 | int nodeid); | 197 | gfp_t flags, |
| 198 | int nodeid); | ||
| 200 | #else | 199 | #else |
| 201 | static __always_inline void * | 200 | static __always_inline void * |
| 202 | kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, | 201 | kmem_cache_alloc_node_trace(size_t size, |
| 203 | gfp_t flags, | 202 | struct kmem_cache *cachep, |
| 204 | int nodeid) | 203 | gfp_t flags, |
| 204 | int nodeid) | ||
| 205 | { | 205 | { |
| 206 | return kmem_cache_alloc_node(cachep, flags, nodeid); | 206 | return kmem_cache_alloc_node(cachep, flags, nodeid); |
| 207 | } | 207 | } |
| @@ -210,7 +210,6 @@ kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, | |||
| 210 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 210 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 211 | { | 211 | { |
| 212 | struct kmem_cache *cachep; | 212 | struct kmem_cache *cachep; |
| 213 | void *ret; | ||
| 214 | 213 | ||
| 215 | if (__builtin_constant_p(size)) { | 214 | if (__builtin_constant_p(size)) { |
| 216 | int i = 0; | 215 | int i = 0; |
| @@ -234,13 +233,7 @@ found: | |||
| 234 | #endif | 233 | #endif |
| 235 | cachep = malloc_sizes[i].cs_cachep; | 234 | cachep = malloc_sizes[i].cs_cachep; |
| 236 | 235 | ||
| 237 | ret = kmem_cache_alloc_node_notrace(cachep, flags, node); | 236 | return kmem_cache_alloc_node_trace(size, cachep, flags, node); |
| 238 | |||
| 239 | trace_kmalloc_node(_THIS_IP_, ret, | ||
| 240 | size, slab_buffer_size(cachep), | ||
| 241 | flags, node); | ||
| 242 | |||
| 243 | return ret; | ||
| 244 | } | 237 | } |
| 245 | return __kmalloc_node(size, flags, node); | 238 | return __kmalloc_node(size, flags, node); |
| 246 | } | 239 | } |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index e4f5ed180b9..8b6e8ae5d5c 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -10,9 +10,8 @@ | |||
| 10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
| 11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
| 12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
| 13 | #include <linux/kmemleak.h> | ||
| 14 | 13 | ||
| 15 | #include <trace/events/kmem.h> | 14 | #include <linux/kmemleak.h> |
| 16 | 15 | ||
| 17 | enum stat_item { | 16 | enum stat_item { |
| 18 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 17 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
| @@ -216,31 +215,40 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) | |||
| 216 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 215 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
| 217 | void *__kmalloc(size_t size, gfp_t flags); | 216 | void *__kmalloc(size_t size, gfp_t flags); |
| 218 | 217 | ||
| 218 | static __always_inline void * | ||
| 219 | kmalloc_order(size_t size, gfp_t flags, unsigned int order) | ||
| 220 | { | ||
| 221 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); | ||
| 222 | kmemleak_alloc(ret, size, 1, flags); | ||
| 223 | return ret; | ||
| 224 | } | ||
| 225 | |||
| 219 | #ifdef CONFIG_TRACING | 226 | #ifdef CONFIG_TRACING |
| 220 | extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); | 227 | extern void * |
| 228 | kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); | ||
| 229 | extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order); | ||
| 221 | #else | 230 | #else |
| 222 | static __always_inline void * | 231 | static __always_inline void * |
| 223 | kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags) | 232 | kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size) |
| 224 | { | 233 | { |
| 225 | return kmem_cache_alloc(s, gfpflags); | 234 | return kmem_cache_alloc(s, gfpflags); |
| 226 | } | 235 | } |
| 236 | |||
| 237 | static __always_inline void * | ||
| 238 | kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) | ||
| 239 | { | ||
| 240 | return kmalloc_order(size, flags, order); | ||
| 241 | } | ||
| 227 | #endif | 242 | #endif |
| 228 | 243 | ||
| 229 | static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | 244 | static __always_inline void *kmalloc_large(size_t size, gfp_t flags) |
| 230 | { | 245 | { |
| 231 | unsigned int order = get_order(size); | 246 | unsigned int order = get_order(size); |
| 232 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); | 247 | return kmalloc_order_trace(size, flags, order); |
| 233 | |||
| 234 | kmemleak_alloc(ret, size, 1, flags); | ||
| 235 | trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); | ||
| 236 | |||
| 237 | return ret; | ||
| 238 | } | 248 | } |
| 239 | 249 | ||
| 240 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 250 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
| 241 | { | 251 | { |
| 242 | void *ret; | ||
| 243 | |||
| 244 | if (__builtin_constant_p(size)) { | 252 | if (__builtin_constant_p(size)) { |
| 245 | if (size > SLUB_MAX_SIZE) | 253 | if (size > SLUB_MAX_SIZE) |
| 246 | return kmalloc_large(size, flags); | 254 | return kmalloc_large(size, flags); |
| @@ -251,11 +259,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) | |||
| 251 | if (!s) | 259 | if (!s) |
| 252 | return ZERO_SIZE_PTR; | 260 | return ZERO_SIZE_PTR; |
| 253 | 261 | ||
| 254 | ret = kmem_cache_alloc_notrace(s, flags); | 262 | return kmem_cache_alloc_trace(s, flags, size); |
| 255 | |||
| 256 | trace_kmalloc(_THIS_IP_, ret, size, s->size, flags); | ||
| 257 | |||
| 258 | return ret; | ||
| 259 | } | 263 | } |
| 260 | } | 264 | } |
| 261 | return __kmalloc(size, flags); | 265 | return __kmalloc(size, flags); |
| @@ -266,14 +270,14 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node); | |||
| 266 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 270 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 267 | 271 | ||
| 268 | #ifdef CONFIG_TRACING | 272 | #ifdef CONFIG_TRACING |
| 269 | extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, | 273 | extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s, |
| 270 | gfp_t gfpflags, | 274 | gfp_t gfpflags, |
| 271 | int node); | 275 | int node, size_t size); |
| 272 | #else | 276 | #else |
| 273 | static __always_inline void * | 277 | static __always_inline void * |
| 274 | kmem_cache_alloc_node_notrace(struct kmem_cache *s, | 278 | kmem_cache_alloc_node_trace(struct kmem_cache *s, |
| 275 | gfp_t gfpflags, | 279 | gfp_t gfpflags, |
| 276 | int node) | 280 | int node, size_t size) |
| 277 | { | 281 | { |
| 278 | return kmem_cache_alloc_node(s, gfpflags, node); | 282 | return kmem_cache_alloc_node(s, gfpflags, node); |
| 279 | } | 283 | } |
| @@ -281,8 +285,6 @@ kmem_cache_alloc_node_notrace(struct kmem_cache *s, | |||
| 281 | 285 | ||
| 282 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 286 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 283 | { | 287 | { |
| 284 | void *ret; | ||
| 285 | |||
| 286 | if (__builtin_constant_p(size) && | 288 | if (__builtin_constant_p(size) && |
| 287 | size <= SLUB_MAX_SIZE && !(flags & SLUB_DMA)) { | 289 | size <= SLUB_MAX_SIZE && !(flags & SLUB_DMA)) { |
| 288 | struct kmem_cache *s = kmalloc_slab(size); | 290 | struct kmem_cache *s = kmalloc_slab(size); |
| @@ -290,12 +292,7 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 290 | if (!s) | 292 | if (!s) |
| 291 | return ZERO_SIZE_PTR; | 293 | return ZERO_SIZE_PTR; |
| 292 | 294 | ||
| 293 | ret = kmem_cache_alloc_node_notrace(s, flags, node); | 295 | return kmem_cache_alloc_node_trace(s, flags, node, size); |
| 294 | |||
| 295 | trace_kmalloc_node(_THIS_IP_, ret, | ||
| 296 | size, s->size, flags, node); | ||
| 297 | |||
| 298 | return ret; | ||
| 299 | } | 296 | } |
| 300 | return __kmalloc_node(size, flags, node); | 297 | return __kmalloc_node(size, flags, node); |
| 301 | } | 298 | } |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 5f65f14c4f4..edbb1d07ddf 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/sonypi.h b/include/linux/sonypi.h index 4f95c1aac2f..0e6dc389194 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
| @@ -112,6 +112,7 @@ | |||
| 112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 | 112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 |
| 113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 | 113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 |
| 114 | #define SONYPI_EVENT_MEDIA_PRESSED 72 | 114 | #define SONYPI_EVENT_MEDIA_PRESSED 72 |
| 115 | #define SONYPI_EVENT_VENDOR_PRESSED 73 | ||
| 115 | 116 | ||
| 116 | /* get/set brightness */ | 117 | /* get/set brightness */ |
| 117 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) | 118 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index b2024757edd..8521067ed4f 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -110,9 +110,9 @@ struct rpc_credops { | |||
| 110 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 110 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
| 111 | int (*crrefresh)(struct rpc_task *); | 111 | int (*crrefresh)(struct rpc_task *); |
| 112 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 112 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
| 113 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, | 113 | int (*crwrap_req)(struct rpc_task *, kxdreproc_t, |
| 114 | void *, __be32 *, void *); | 114 | void *, __be32 *, void *); |
| 115 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, | 115 | int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t, |
| 116 | void *, __be32 *, void *); | 116 | void *, __be32 *, void *); |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| @@ -139,8 +139,8 @@ struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred * | |||
| 139 | void put_rpccred(struct rpc_cred *); | 139 | void put_rpccred(struct rpc_cred *); |
| 140 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 140 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
| 141 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); | 141 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
| 142 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); | 142 | int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj); |
| 143 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); | 143 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj); |
| 144 | int rpcauth_refreshcred(struct rpc_task *); | 144 | int rpcauth_refreshcred(struct rpc_task *); |
| 145 | void rpcauth_invalcred(struct rpc_task *); | 145 | void rpcauth_invalcred(struct rpc_task *); |
| 146 | int rpcauth_uptodatecred(struct rpc_task *); | 146 | int rpcauth_uptodatecred(struct rpc_task *); |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 7c91260c44a..c50b458b8a3 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -43,10 +43,18 @@ int bc_send(struct rpc_rqst *req); | |||
| 43 | */ | 43 | */ |
| 44 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | 44 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) |
| 45 | { | 45 | { |
| 46 | if (rqstp->rq_server->bc_xprt) | 46 | if (rqstp->rq_server->sv_bc_xprt) |
| 47 | return 1; | 47 | return 1; |
| 48 | return 0; | 48 | return 0; |
| 49 | } | 49 | } |
| 50 | static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp) | ||
| 51 | { | ||
| 52 | if (svc_is_backchannel(rqstp)) | ||
| 53 | return (struct nfs4_sessionid *) | ||
| 54 | rqstp->rq_server->sv_bc_xprt->xpt_bc_sid; | ||
| 55 | return NULL; | ||
| 56 | } | ||
| 57 | |||
| 50 | #else /* CONFIG_NFS_V4_1 */ | 58 | #else /* CONFIG_NFS_V4_1 */ |
| 51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | 59 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, |
| 52 | unsigned int min_reqs) | 60 | unsigned int min_reqs) |
| @@ -59,6 +67,11 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
| 59 | return 0; | 67 | return 0; |
| 60 | } | 68 | } |
| 61 | 69 | ||
| 70 | static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp) | ||
| 71 | { | ||
| 72 | return NULL; | ||
| 73 | } | ||
| 74 | |||
| 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | 75 | static inline void xprt_free_bc_request(struct rpc_rqst *req) |
| 63 | { | 76 | { |
| 64 | } | 77 | } |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6950c981882..7898ea13de7 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #ifndef _LINUX_SUNRPC_CACHE_H_ | 13 | #ifndef _LINUX_SUNRPC_CACHE_H_ |
| 14 | #define _LINUX_SUNRPC_CACHE_H_ | 14 | #define _LINUX_SUNRPC_CACHE_H_ |
| 15 | 15 | ||
| 16 | #include <linux/kref.h> | ||
| 16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 17 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
| 18 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> |
| @@ -255,10 +256,13 @@ static inline time_t get_expiry(char **bpp) | |||
| 255 | return rv - boot.tv_sec; | 256 | return rv - boot.tv_sec; |
| 256 | } | 257 | } |
| 257 | 258 | ||
| 259 | #ifdef CONFIG_NFSD_DEPRECATED | ||
| 258 | static inline void sunrpc_invalidate(struct cache_head *h, | 260 | static inline void sunrpc_invalidate(struct cache_head *h, |
| 259 | struct cache_detail *detail) | 261 | struct cache_detail *detail) |
| 260 | { | 262 | { |
| 261 | h->expiry_time = seconds_since_boot() - 1; | 263 | h->expiry_time = seconds_since_boot() - 1; |
| 262 | detail->nextcheck = seconds_since_boot(); | 264 | detail->nextcheck = seconds_since_boot(); |
| 263 | } | 265 | } |
| 266 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
| 267 | |||
| 264 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ | 268 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index a5a55f284b7..ef9476a36ff 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -89,8 +89,8 @@ struct rpc_version { | |||
| 89 | */ | 89 | */ |
| 90 | struct rpc_procinfo { | 90 | struct rpc_procinfo { |
| 91 | u32 p_proc; /* RPC procedure number */ | 91 | u32 p_proc; /* RPC procedure number */ |
| 92 | kxdrproc_t p_encode; /* XDR encode function */ | 92 | kxdreproc_t p_encode; /* XDR encode function */ |
| 93 | kxdrproc_t p_decode; /* XDR decode function */ | 93 | kxdrdproc_t p_decode; /* XDR decode function */ |
| 94 | unsigned int p_arglen; /* argument hdr length (u32) */ | 94 | unsigned int p_arglen; /* argument hdr length (u32) */ |
| 95 | unsigned int p_replen; /* reply hdr length (u32) */ | 95 | unsigned int p_replen; /* reply hdr length (u32) */ |
| 96 | unsigned int p_count; /* call count */ | 96 | unsigned int p_count; /* call count */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 5a3085b9b39..ea29330b78b 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -99,7 +99,7 @@ struct svc_serv { | |||
| 99 | spinlock_t sv_cb_lock; /* protects the svc_cb_list */ | 99 | spinlock_t sv_cb_lock; /* protects the svc_cb_list */ |
| 100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | 100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no |
| 101 | * entries in the svc_cb_list */ | 101 | * entries in the svc_cb_list */ |
| 102 | struct svc_xprt *bc_xprt; | 102 | struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ |
| 103 | #endif /* CONFIG_NFS_V4_1 */ | 103 | #endif /* CONFIG_NFS_V4_1 */ |
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| @@ -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 aea0d438e3c..059877b4d85 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 */ |
| @@ -78,8 +77,10 @@ struct svc_xprt { | |||
| 78 | size_t xpt_remotelen; /* length of address */ | 77 | size_t xpt_remotelen; /* length of address */ |
| 79 | struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ | 78 | struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ |
| 80 | struct list_head xpt_users; /* callbacks on free */ | 79 | struct list_head xpt_users; /* callbacks on free */ |
| 80 | void *xpt_bc_sid; /* back channel session ID */ | ||
| 81 | 81 | ||
| 82 | struct net *xpt_net; | 82 | struct net *xpt_net; |
| 83 | struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */ | ||
| 83 | }; | 84 | }; |
| 84 | 85 | ||
| 85 | 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 1b353a76c30..04dba23c59f 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/xdr.h b/include/linux/sunrpc/xdr.h index 498ab93a81e..fc84b7a19ca 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -33,8 +33,8 @@ struct xdr_netobj { | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | /* | 35 | /* |
| 36 | * This is the generic XDR function. rqstp is either a rpc_rqst (client | 36 | * This is the legacy generic XDR function. rqstp is either a rpc_rqst |
| 37 | * side) or svc_rqst pointer (server side). | 37 | * (client side) or svc_rqst pointer (server side). |
| 38 | * Encode functions always assume there's enough room in the buffer. | 38 | * Encode functions always assume there's enough room in the buffer. |
| 39 | */ | 39 | */ |
| 40 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); | 40 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); |
| @@ -201,14 +201,22 @@ struct xdr_stream { | |||
| 201 | 201 | ||
| 202 | __be32 *end; /* end of available buffer space */ | 202 | __be32 *end; /* end of available buffer space */ |
| 203 | struct kvec *iov; /* pointer to the current kvec */ | 203 | struct kvec *iov; /* pointer to the current kvec */ |
| 204 | struct kvec scratch; /* Scratch buffer */ | ||
| 205 | struct page **page_ptr; /* pointer to the current page */ | ||
| 204 | }; | 206 | }; |
| 205 | 207 | ||
| 208 | /* | ||
| 209 | * These are the xdr_stream style generic XDR encode and decode functions. | ||
| 210 | */ | ||
| 211 | typedef void (*kxdreproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj); | ||
| 212 | typedef int (*kxdrdproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj); | ||
| 213 | |||
| 206 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 214 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 207 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 215 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
| 208 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 216 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
| 209 | unsigned int base, unsigned int len); | 217 | unsigned int base, unsigned int len); |
| 210 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 218 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 211 | extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes); | 219 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); |
| 212 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 220 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
| 213 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 221 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
| 214 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 222 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 89d10d279a2..bef0f535f74 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 26697514c5e..5a89e361287 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); |
| @@ -292,7 +275,7 @@ extern int unregister_pm_notifier(struct notifier_block *nb); | |||
| 292 | /* drivers/base/power/wakeup.c */ | 275 | /* drivers/base/power/wakeup.c */ |
| 293 | extern bool events_check_enabled; | 276 | extern bool events_check_enabled; |
| 294 | 277 | ||
| 295 | extern bool pm_check_wakeup_events(void); | 278 | extern bool pm_wakeup_pending(void); |
| 296 | extern bool pm_get_wakeup_count(unsigned int *count); | 279 | extern bool pm_get_wakeup_count(unsigned int *count); |
| 297 | extern bool pm_save_wakeup_count(unsigned int count); | 280 | extern bool pm_save_wakeup_count(unsigned int count); |
| 298 | #else /* !CONFIG_PM_SLEEP */ | 281 | #else /* !CONFIG_PM_SLEEP */ |
| @@ -309,7 +292,7 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
| 309 | 292 | ||
| 310 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 293 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
| 311 | 294 | ||
| 312 | static inline bool pm_check_wakeup_events(void) { return true; } | 295 | static inline bool pm_wakeup_pending(void) { return false; } |
| 313 | #endif /* !CONFIG_PM_SLEEP */ | 296 | #endif /* !CONFIG_PM_SLEEP */ |
| 314 | 297 | ||
| 315 | extern struct mutex pm_mutex; | 298 | extern struct mutex pm_mutex; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index eba53e71d2c..4d559325d91 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 1de8b9eb841..8651556dbd5 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 9f15ac7ab92..1e6d3b59238 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 32d852f8cbe..d23999f9499 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 6a7c4edf0e1..772dedbc3a2 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/tpm.h b/include/linux/tpm.h index ac5d1c1285d..fdc718abf83 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
| 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
| 34 | extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); | ||
| 34 | #else | 35 | #else |
| 35 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | 36 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { |
| 36 | return -ENODEV; | 37 | return -ENODEV; |
| @@ -38,5 +39,8 @@ static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | |||
| 38 | static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { | 39 | static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { |
| 39 | return -ENODEV; | 40 | return -ENODEV; |
| 40 | } | 41 | } |
| 42 | static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) { | ||
| 43 | return -ENODEV; | ||
| 44 | } | ||
| 41 | #endif | 45 | #endif |
| 42 | #endif | 46 | #endif |
diff --git a/include/linux/tpm_command.h b/include/linux/tpm_command.h new file mode 100644 index 00000000000..727512e249b --- /dev/null +++ b/include/linux/tpm_command.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #ifndef __LINUX_TPM_COMMAND_H__ | ||
| 2 | #define __LINUX_TPM_COMMAND_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * TPM Command constants from specifications at | ||
| 6 | * http://www.trustedcomputinggroup.org | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* Command TAGS */ | ||
| 10 | #define TPM_TAG_RQU_COMMAND 193 | ||
| 11 | #define TPM_TAG_RQU_AUTH1_COMMAND 194 | ||
| 12 | #define TPM_TAG_RQU_AUTH2_COMMAND 195 | ||
| 13 | #define TPM_TAG_RSP_COMMAND 196 | ||
| 14 | #define TPM_TAG_RSP_AUTH1_COMMAND 197 | ||
| 15 | #define TPM_TAG_RSP_AUTH2_COMMAND 198 | ||
| 16 | |||
| 17 | /* Command Ordinals */ | ||
| 18 | #define TPM_ORD_GETRANDOM 70 | ||
| 19 | #define TPM_ORD_OSAP 11 | ||
| 20 | #define TPM_ORD_OIAP 10 | ||
| 21 | #define TPM_ORD_SEAL 23 | ||
| 22 | #define TPM_ORD_UNSEAL 24 | ||
| 23 | |||
| 24 | /* Other constants */ | ||
| 25 | #define SRKHANDLE 0x40000000 | ||
| 26 | #define TPM_NONCE_SIZE 20 | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index d3e4f87e95c..c6814616653 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -32,7 +32,7 @@ struct tracepoint { | |||
| 32 | int state; /* State. */ | 32 | int state; /* State. */ |
| 33 | void (*regfunc)(void); | 33 | void (*regfunc)(void); |
| 34 | void (*unregfunc)(void); | 34 | void (*unregfunc)(void); |
| 35 | struct tracepoint_func *funcs; | 35 | struct tracepoint_func __rcu *funcs; |
| 36 | } __attribute__((aligned(32))); /* | 36 | } __attribute__((aligned(32))); /* |
| 37 | * Aligned on 32 bytes because it is | 37 | * Aligned on 32 bytes because it is |
| 38 | * globally visible and gcc happily | 38 | * globally visible and gcc happily |
| @@ -326,7 +326,7 @@ do_trace: \ | |||
| 326 | * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | 326 | * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
| 327 | * __entry->next_pid = next->pid; | 327 | * __entry->next_pid = next->pid; |
| 328 | * __entry->next_prio = next->prio; | 328 | * __entry->next_prio = next->prio; |
| 329 | * ) | 329 | * ), |
| 330 | * | 330 | * |
| 331 | * * | 331 | * * |
| 332 | * * Formatted output of a trace record via TP_printk(). | 332 | * * Formatted output of a trace record via TP_printk(). |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 526d66f066a..ff7dc08696a 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 fa261a0da28..8da8c4e87da 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 c9a6abd972a..c0d817de4df 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 8178156711f..faf467944ba 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/vga_switcheroo.h b/include/linux/vga_switcheroo.h index ae9ab13b963..4b9a7f596f9 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h | |||
| @@ -33,6 +33,7 @@ struct vga_switcheroo_handler { | |||
| 33 | void vga_switcheroo_unregister_client(struct pci_dev *dev); | 33 | void vga_switcheroo_unregister_client(struct pci_dev *dev); |
| 34 | int vga_switcheroo_register_client(struct pci_dev *dev, | 34 | int vga_switcheroo_register_client(struct pci_dev *dev, |
| 35 | void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state), | 35 | void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state), |
| 36 | void (*reprobe)(struct pci_dev *dev), | ||
| 36 | bool (*can_switch)(struct pci_dev *dev)); | 37 | bool (*can_switch)(struct pci_dev *dev)); |
| 37 | 38 | ||
| 38 | void vga_switcheroo_client_fb_set(struct pci_dev *dev, | 39 | void vga_switcheroo_client_fb_set(struct pci_dev *dev, |
| @@ -48,6 +49,7 @@ int vga_switcheroo_process_delayed_switch(void); | |||
| 48 | static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} | 49 | static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} |
| 49 | static inline int vga_switcheroo_register_client(struct pci_dev *dev, | 50 | static inline int vga_switcheroo_register_client(struct pci_dev *dev, |
| 50 | void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state), | 51 | void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state), |
| 52 | void (*reprobe)(struct pci_dev *dev), | ||
| 51 | bool (*can_switch)(struct pci_dev *dev)) { return 0; } | 53 | bool (*can_switch)(struct pci_dev *dev)) { return 0; } |
| 52 | static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {} | 54 | static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {} |
| 53 | static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; } | 55 | static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; } |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 0093dd7c1d6..800617b4ddd 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -109,7 +109,10 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
| 109 | unsigned int fbit) | 109 | unsigned int fbit) |
| 110 | { | 110 | { |
| 111 | /* Did you forget to fix assumptions on max features? */ | 111 | /* Did you forget to fix assumptions on max features? */ |
| 112 | MAYBE_BUILD_BUG_ON(fbit >= 32); | 112 | if (__builtin_constant_p(fbit)) |
| 113 | BUILD_BUG_ON(fbit >= 32); | ||
| 114 | else | ||
| 115 | BUG_ON(fbit >= 32); | ||
| 113 | 116 | ||
| 114 | if (fbit < VIRTIO_TRANSPORT_F_START) | 117 | if (fbit < VIRTIO_TRANSPORT_F_START) |
| 115 | virtio_check_driver_offered_feature(vdev, fbit); | 118 | virtio_check_driver_offered_feature(vdev, fbit); |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 44b54f619ac..4ed6fcd6b72 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 eaaea37b3b7..833e676d6d9 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/xattr.h b/include/linux/xattr.h index f1e5bde4b35..e6131ef98d8 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
| @@ -40,9 +40,13 @@ | |||
| 40 | #define XATTR_SMACK_SUFFIX "SMACK64" | 40 | #define XATTR_SMACK_SUFFIX "SMACK64" |
| 41 | #define XATTR_SMACK_IPIN "SMACK64IPIN" | 41 | #define XATTR_SMACK_IPIN "SMACK64IPIN" |
| 42 | #define XATTR_SMACK_IPOUT "SMACK64IPOUT" | 42 | #define XATTR_SMACK_IPOUT "SMACK64IPOUT" |
| 43 | #define XATTR_SMACK_EXEC "SMACK64EXEC" | ||
| 44 | #define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE" | ||
| 43 | #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX | 45 | #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX |
| 44 | #define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN | 46 | #define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN |
| 45 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT | 47 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT |
| 48 | #define XATTR_NAME_SMACKEXEC XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC | ||
| 49 | #define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE | ||
| 46 | 50 | ||
| 47 | #define XATTR_CAPS_SUFFIX "capability" | 51 | #define XATTR_CAPS_SUFFIX "capability" |
| 48 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 52 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
diff --git a/include/linux/xz.h b/include/linux/xz.h new file mode 100644 index 00000000000..64cffa6ddfc --- /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 c59cc029c74..b586495bcd5 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/media/mt9v011.h b/include/media/mt9v011.h new file mode 100644 index 00000000000..ea29fc74cd0 --- /dev/null +++ b/include/media/mt9v011.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* mt9v011 sensor | ||
| 2 | * | ||
| 3 | * Copyright (C) 2011 Hans Verkuil <hverkuil@xs4all.nl> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __MT9V011_H__ | ||
| 11 | #define __MT9V011_H__ | ||
| 12 | |||
| 13 | struct mt9v011_platform_data { | ||
| 14 | unsigned xtal; /* Hz */ | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index a23c1fc685a..2963263f31e 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
| @@ -183,6 +183,9 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev) | |||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | 185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ |
| 186 | #define US_TO_NS(usec) ((usec) * 1000) | ||
| 187 | #define MS_TO_US(msec) ((msec) * 1000) | ||
| 188 | #define MS_TO_NS(msec) ((msec) * 1000 * 1000) | ||
| 186 | 189 | ||
| 187 | void ir_raw_event_handle(struct rc_dev *dev); | 190 | void ir_raw_event_handle(struct rc_dev *dev); |
| 188 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); | 191 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index ac7ce00f39c..79827143d5a 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
| @@ -115,7 +115,7 @@ struct saa7146_dev | |||
| 115 | 115 | ||
| 116 | /* different device locks */ | 116 | /* different device locks */ |
| 117 | spinlock_t slock; | 117 | spinlock_t slock; |
| 118 | struct mutex lock; | 118 | struct mutex v4l2_lock; |
| 119 | 119 | ||
| 120 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ | 120 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ |
| 121 | u32 revision; /* chip revision; needed for bug-workarounds*/ | 121 | u32 revision; /* chip revision; needed for bug-workarounds*/ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 2d65b35cdab..a659319e858 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -138,21 +138,10 @@ struct v4l2_subdev_ops; | |||
| 138 | 138 | ||
| 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
| 140 | The client_type argument is the name of the chip that's on the adapter. */ | 140 | The client_type argument is the name of the chip that's on the adapter. */ |
| 141 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 141 | struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, |
| 142 | struct i2c_adapter *adapter, const char *client_type, | 142 | struct i2c_adapter *adapter, const char *client_type, |
| 143 | int irq, void *platform_data, | ||
| 144 | u8 addr, const unsigned short *probe_addrs); | 143 | u8 addr, const unsigned short *probe_addrs); |
| 145 | 144 | ||
| 146 | /* Load an i2c module and return an initialized v4l2_subdev struct. | ||
| 147 | The client_type argument is the name of the chip that's on the adapter. */ | ||
| 148 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, | ||
| 149 | struct i2c_adapter *adapter, const char *client_type, | ||
| 150 | u8 addr, const unsigned short *probe_addrs) | ||
| 151 | { | ||
| 152 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL, | ||
| 153 | addr, probe_addrs); | ||
| 154 | } | ||
| 155 | |||
| 156 | struct i2c_board_info; | 145 | struct i2c_board_info; |
| 157 | 146 | ||
| 158 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 147 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index d69ab4aae03..97d063837b6 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
| 25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| 26 | #include <linux/videodev2.h> | ||
| 26 | 27 | ||
| 27 | /* forward references */ | 28 | /* forward references */ |
| 28 | struct v4l2_ctrl_handler; | 29 | struct v4l2_ctrl_handler; |
| @@ -53,8 +54,10 @@ struct v4l2_ctrl_ops { | |||
| 53 | * @handler: The handler that owns the control. | 54 | * @handler: The handler that owns the control. |
| 54 | * @cluster: Point to start of cluster array. | 55 | * @cluster: Point to start of cluster array. |
| 55 | * @ncontrols: Number of controls in cluster array. | 56 | * @ncontrols: Number of controls in cluster array. |
| 56 | * @has_new: Internal flag: set when there is a valid new value. | ||
| 57 | * @done: Internal flag: set for each processed control. | 57 | * @done: Internal flag: set for each processed control. |
| 58 | * @is_new: Set when the user specified a new value for this control. It | ||
| 59 | * is also set when called from v4l2_ctrl_handler_setup. Drivers | ||
| 60 | * should never set this flag. | ||
| 58 | * @is_private: If set, then this control is private to its handler and it | 61 | * @is_private: If set, then this control is private to its handler and it |
| 59 | * will not be added to any other handlers. Drivers can set | 62 | * will not be added to any other handlers. Drivers can set |
| 60 | * this flag. | 63 | * this flag. |
| @@ -97,9 +100,9 @@ struct v4l2_ctrl { | |||
| 97 | struct v4l2_ctrl_handler *handler; | 100 | struct v4l2_ctrl_handler *handler; |
| 98 | struct v4l2_ctrl **cluster; | 101 | struct v4l2_ctrl **cluster; |
| 99 | unsigned ncontrols; | 102 | unsigned ncontrols; |
| 100 | unsigned int has_new:1; | ||
| 101 | unsigned int done:1; | 103 | unsigned int done:1; |
| 102 | 104 | ||
| 105 | unsigned int is_new:1; | ||
| 103 | unsigned int is_private:1; | 106 | unsigned int is_private:1; |
| 104 | unsigned int is_volatile:1; | 107 | unsigned int is_volatile:1; |
| 105 | 108 | ||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index b0316a7cf08..daf1e57d9b2 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
| @@ -106,10 +106,7 @@ struct v4l2_subdev_io_pin_config { | |||
| 106 | u8 strength; /* Pin drive strength */ | 106 | u8 strength; /* Pin drive strength */ |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* | 109 | /* |
| 110 | functions after the v4l2_subdev was registered. It is used to pass | ||
| 111 | platform data to the subdev which can be used during initialization. | ||
| 112 | |||
| 113 | s_io_pin_config: configure one or more chip I/O pins for chips that | 110 | s_io_pin_config: configure one or more chip I/O pins for chips that |
| 114 | multiplex different internal signal pads out to IO pins. This function | 111 | multiplex different internal signal pads out to IO pins. This function |
| 115 | takes a pointer to an array of 'n' pin configuration entries, one for | 112 | takes a pointer to an array of 'n' pin configuration entries, one for |
| @@ -141,7 +138,6 @@ struct v4l2_subdev_io_pin_config { | |||
| 141 | struct v4l2_subdev_core_ops { | 138 | struct v4l2_subdev_core_ops { |
| 142 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 139 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
| 143 | int (*log_status)(struct v4l2_subdev *sd); | 140 | int (*log_status)(struct v4l2_subdev *sd); |
| 144 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); | ||
| 145 | int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, | 141 | int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, |
| 146 | struct v4l2_subdev_io_pin_config *pincfg); | 142 | struct v4l2_subdev_io_pin_config *pincfg); |
| 147 | int (*init)(struct v4l2_subdev *sd, u32 val); | 143 | int (*init)(struct v4l2_subdev *sd, u32 val); |
| @@ -415,6 +411,21 @@ struct v4l2_subdev_ops { | |||
| 415 | const struct v4l2_subdev_sensor_ops *sensor; | 411 | const struct v4l2_subdev_sensor_ops *sensor; |
| 416 | }; | 412 | }; |
| 417 | 413 | ||
| 414 | /* | ||
| 415 | * Internal ops. Never call this from drivers, only the v4l2 framework can call | ||
| 416 | * these ops. | ||
| 417 | * | ||
| 418 | * registered: called when this subdev is registered. When called the v4l2_dev | ||
| 419 | * field is set to the correct v4l2_device. | ||
| 420 | * | ||
| 421 | * unregistered: called when this subdev is unregistered. When called the | ||
| 422 | * v4l2_dev field is still set to the correct v4l2_device. | ||
| 423 | */ | ||
| 424 | struct v4l2_subdev_internal_ops { | ||
| 425 | int (*registered)(struct v4l2_subdev *sd); | ||
| 426 | void (*unregistered)(struct v4l2_subdev *sd); | ||
| 427 | }; | ||
| 428 | |||
| 418 | #define V4L2_SUBDEV_NAME_SIZE 32 | 429 | #define V4L2_SUBDEV_NAME_SIZE 32 |
| 419 | 430 | ||
| 420 | /* Set this flag if this subdev is a i2c device. */ | 431 | /* Set this flag if this subdev is a i2c device. */ |
| @@ -431,6 +442,8 @@ struct v4l2_subdev { | |||
| 431 | u32 flags; | 442 | u32 flags; |
| 432 | struct v4l2_device *v4l2_dev; | 443 | struct v4l2_device *v4l2_dev; |
| 433 | const struct v4l2_subdev_ops *ops; | 444 | const struct v4l2_subdev_ops *ops; |
| 445 | /* Never call these internal ops from within a driver! */ | ||
| 446 | const struct v4l2_subdev_internal_ops *internal_ops; | ||
| 434 | /* The control handler of this subdev. May be NULL. */ | 447 | /* The control handler of this subdev. May be NULL. */ |
| 435 | struct v4l2_ctrl_handler *ctrl_handler; | 448 | struct v4l2_ctrl_handler *ctrl_handler; |
| 436 | /* name must be unique */ | 449 | /* name must be unique */ |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 92eedc09151..e73ebdae323 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
| @@ -100,8 +100,8 @@ typedef __s32 sctp_assoc_t; | |||
| 100 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ | 100 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
| 101 | /* 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 */ |
| 102 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ | 102 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
| 103 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ | 103 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */ |
| 104 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ | 104 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ |
| 105 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ | 105 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
| 106 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ | 106 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
| 107 | 107 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e04c4888d1f..55cd0a0bc97 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 8e9b222251c..8a143ca7987 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 1651fef1883..648d2335803 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 49400459b47..b602f475cdb 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 00000000000..422c97d43df --- /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 a1803ecea34..5d6074faa27 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 112374dc0c5..7715e6f00d3 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 d98a78dff2d..0909a384347 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 a81798ab73e..8f764204a85 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 dfd9b76b185..e731f8d7193 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 e7b68024800..1bafe95dcf4 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 8fd3b41b763..8031769ac48 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 5c3bce83f28..74921f20a1d 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 00000000000..7fe74608b43 --- /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 00000000000..07fdfb6b9a9 --- /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 00000000000..40e6e740527 --- /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 00000000000..52b18a5752c --- /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 00000000000..a26fb7586a0 --- /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 00000000000..c2f8d0e3a03 --- /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 00000000000..f3ac12b019c --- /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 00000000000..6c8248bc2c6 --- /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 00000000000..77e18729c4c --- /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 00000000000..66f44e56eb8 --- /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/define_trace.h b/include/trace/define_trace.h index b0b4eb24d59..da39b22636f 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
| @@ -21,6 +21,16 @@ | |||
| 21 | #undef CREATE_TRACE_POINTS | 21 | #undef CREATE_TRACE_POINTS |
| 22 | 22 | ||
| 23 | #include <linux/stringify.h> | 23 | #include <linux/stringify.h> |
| 24 | /* | ||
| 25 | * module.h includes tracepoints, and because ftrace.h | ||
| 26 | * pulls in module.h: | ||
| 27 | * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h -> | ||
| 28 | * linux/ftrace.h -> linux/module.h | ||
| 29 | * we must include module.h here before we play with any of | ||
| 30 | * the TRACE_EVENT() macros, otherwise the tracepoints included | ||
| 31 | * by module.h may break the build. | ||
| 32 | */ | ||
| 33 | #include <linux/module.h> | ||
| 24 | 34 | ||
| 25 | #undef TRACE_EVENT | 35 | #undef TRACE_EVENT |
| 26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | 36 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ |
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h new file mode 100644 index 00000000000..186e84db4b5 --- /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 d8ce278515c..aba421d68f6 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 00000000000..388bcdd26d4 --- /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 6dd3a51ab1c..46e3cd8e197 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 c7bb2f0482f..c6bae36547e 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 00000000000..37502a7404b --- /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/skb.h b/include/trace/events/skb.h index 75ce9d500d8..f10293c41b1 100644 --- a/include/trace/events/skb.h +++ b/include/trace/events/skb.h | |||
| @@ -25,9 +25,7 @@ TRACE_EVENT(kfree_skb, | |||
| 25 | 25 | ||
| 26 | TP_fast_assign( | 26 | TP_fast_assign( |
| 27 | __entry->skbaddr = skb; | 27 | __entry->skbaddr = skb; |
| 28 | if (skb) { | 28 | __entry->protocol = ntohs(skb->protocol); |
| 29 | __entry->protocol = ntohs(skb->protocol); | ||
| 30 | } | ||
| 31 | __entry->location = location; | 29 | __entry->location = location; |
| 32 | ), | 30 | ), |
| 33 | 31 | ||
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index c255fcc587b..ea422aaa23e 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 89a2b2db437..4e249b927ea 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 00000000000..eb23f4188f5 --- /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 9a731706a01..b1fab6b5b3e 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 43e2d7d3397..7a1d15ff19b 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); |
