diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-01 15:04:39 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-01 15:04:39 -0500 |
commit | 6fae9c25134baffbeeb20031479e7ff6f6d8eec0 (patch) | |
tree | c9ab89992ce5293a43cd455a81dc8a5926a28a5e /include | |
parent | c186794dbb466b45cf40f942f2d09d6d5b4b0e42 (diff) | |
parent | f5412be599602124d2bdd49947b231dd77c0bf99 (diff) |
Merge commit 'v2.6.38-rc6' into for-2.6.39/core
Conflicts:
block/cfq-iosched.c
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
477 files changed, 12283 insertions, 4434 deletions
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 17714beb868e..5b6c391efc8e 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 9cf736ea4691..fc1575fd4596 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index bc4a6deb73b0..ef1cef77d32b 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index a091cabca4b1..de39915f6b7f 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 359ef11725a6..78ca429929f7 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -148,9 +148,7 @@ struct acpi_device_flags { | |||
148 | u32 suprise_removal_ok:1; | 148 | u32 suprise_removal_ok:1; |
149 | u32 power_manageable:1; | 149 | u32 power_manageable:1; |
150 | u32 performance_manageable:1; | 150 | u32 performance_manageable:1; |
151 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ | 151 | u32 reserved:24; |
152 | u32 force_power_state:1; | ||
153 | u32 reserved:22; | ||
154 | }; | 152 | }; |
155 | 153 | ||
156 | /* File System */ | 154 | /* File System */ |
@@ -242,20 +240,14 @@ struct acpi_device_perf { | |||
242 | struct acpi_device_wakeup_flags { | 240 | struct acpi_device_wakeup_flags { |
243 | u8 valid:1; /* Can successfully enable wakeup? */ | 241 | u8 valid:1; /* Can successfully enable wakeup? */ |
244 | u8 run_wake:1; /* Run-Wake GPE devices */ | 242 | u8 run_wake:1; /* Run-Wake GPE devices */ |
245 | u8 always_enabled:1; /* Run-wake devices that are always enabled */ | ||
246 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ | 243 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ |
247 | }; | 244 | }; |
248 | 245 | ||
249 | struct acpi_device_wakeup_state { | ||
250 | u8 enabled:1; | ||
251 | }; | ||
252 | |||
253 | struct acpi_device_wakeup { | 246 | struct acpi_device_wakeup { |
254 | acpi_handle gpe_device; | 247 | acpi_handle gpe_device; |
255 | u64 gpe_number; | 248 | u64 gpe_number; |
256 | u64 sleep_state; | 249 | u64 sleep_state; |
257 | struct acpi_handle_list resources; | 250 | struct acpi_handle_list resources; |
258 | struct acpi_device_wakeup_state state; | ||
259 | struct acpi_device_wakeup_flags flags; | 251 | struct acpi_device_wakeup_flags flags; |
260 | int prepare_count; | 252 | int prepare_count; |
261 | int run_wake_count; | 253 | int run_wake_count; |
@@ -328,8 +320,8 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); | |||
328 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 320 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
329 | unsigned long long *sta); | 321 | unsigned long long *sta); |
330 | int acpi_bus_get_status(struct acpi_device *device); | 322 | int acpi_bus_get_status(struct acpi_device *device); |
331 | int acpi_bus_get_power(acpi_handle handle, int *state); | ||
332 | int acpi_bus_set_power(acpi_handle handle, int state); | 323 | int acpi_bus_set_power(acpi_handle handle, int state); |
324 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | ||
333 | bool acpi_bus_power_manageable(acpi_handle handle); | 325 | bool acpi_bus_power_manageable(acpi_handle handle); |
334 | bool acpi_bus_can_wakeup(acpi_handle handle); | 326 | bool acpi_bus_can_wakeup(acpi_handle handle); |
335 | #ifdef CONFIG_ACPI_PROC_EVENT | 327 | #ifdef CONFIG_ACPI_PROC_EVENT |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 65b3f5888f42..a3252a5ead66 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -8,7 +8,7 @@ | |||
8 | *****************************************************************************/ | 8 | *****************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Copyright (C) 2000 - 2010, Intel Corp. | 11 | * Copyright (C) 2000 - 2011, Intel Corp. |
12 | * All rights reserved. | 12 | * All rights reserved. |
13 | * | 13 | * |
14 | * Redistribution and use in source and binary forms, with or without | 14 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 53b7cfd924a3..e46ec95a8ada 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -6,7 +6,7 @@ | |||
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * Copyright (C) 2000 - 2010, Intel Corp. | 9 | * Copyright (C) 2000 - 2011, Intel Corp. |
10 | * All rights reserved. | 10 | * All rights reserved. |
11 | * | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without |
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20101013 | 50 | #define ACPI_CA_VERSION 0x20110112 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
@@ -229,6 +229,10 @@ acpi_status | |||
229 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); | 229 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); |
230 | 230 | ||
231 | acpi_status | 231 | acpi_status |
232 | acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, | ||
233 | void *context); | ||
234 | |||
235 | acpi_status | ||
232 | acpi_install_fixed_event_handler(u32 acpi_event, | 236 | acpi_install_fixed_event_handler(u32 acpi_event, |
233 | acpi_event_handler handler, void *context); | 237 | acpi_event_handler handler, void *context); |
234 | 238 | ||
@@ -258,11 +262,11 @@ acpi_remove_address_space_handler(acpi_handle device, | |||
258 | acpi_status | 262 | acpi_status |
259 | acpi_install_gpe_handler(acpi_handle gpe_device, | 263 | acpi_install_gpe_handler(acpi_handle gpe_device, |
260 | u32 gpe_number, | 264 | u32 gpe_number, |
261 | u32 type, acpi_event_handler address, void *context); | 265 | u32 type, acpi_gpe_handler address, void *context); |
262 | 266 | ||
263 | acpi_status | 267 | acpi_status |
264 | acpi_remove_gpe_handler(acpi_handle gpe_device, | 268 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
265 | u32 gpe_number, acpi_event_handler address); | 269 | u32 gpe_number, acpi_gpe_handler address); |
266 | 270 | ||
267 | #ifdef ACPI_FUTURE_USAGE | 271 | #ifdef ACPI_FUTURE_USAGE |
268 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); | 272 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); |
@@ -292,11 +296,13 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); | |||
292 | 296 | ||
293 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); | 297 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); |
294 | 298 | ||
295 | acpi_status acpi_gpe_can_wake(acpi_handle gpe_device, u32 gpe_number); | ||
296 | |||
297 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); | 299 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); |
298 | 300 | ||
299 | acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action); | 301 | acpi_status |
302 | acpi_setup_gpe_for_wake(acpi_handle parent_device, | ||
303 | acpi_handle gpe_device, u32 gpe_number); | ||
304 | |||
305 | acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); | ||
300 | 306 | ||
301 | acpi_status | 307 | acpi_status |
302 | acpi_get_gpe_status(acpi_handle gpe_device, | 308 | acpi_get_gpe_status(acpi_handle gpe_device, |
@@ -315,7 +321,7 @@ acpi_install_gpe_block(acpi_handle gpe_device, | |||
315 | 321 | ||
316 | acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); | 322 | acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); |
317 | 323 | ||
318 | acpi_status acpi_update_gpes(void); | 324 | acpi_status acpi_update_all_gpes(void); |
319 | 325 | ||
320 | /* | 326 | /* |
321 | * Resource interfaces | 327 | * Resource interfaces |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index e5526354ba5e..0a66cc45dd6b 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index ad2001683ba7..7e42bfee0e29 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index c637b75b9f3f..7504bc99b29b 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -119,7 +119,7 @@ struct acpi_whea_header { | |||
119 | struct acpi_table_bert { | 119 | struct acpi_table_bert { |
120 | struct acpi_table_header header; /* Common ACPI table header */ | 120 | struct acpi_table_header header; /* Common ACPI table header */ |
121 | u32 region_length; /* Length of the boot error region */ | 121 | u32 region_length; /* Length of the boot error region */ |
122 | u64 address; /* Physical addresss of the error region */ | 122 | u64 address; /* Physical address of the error region */ |
123 | }; | 123 | }; |
124 | 124 | ||
125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ | 125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index d4136b28011f..0fc15dfb2e22 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 2b134b691e34..64f838beaabf 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -656,33 +656,34 @@ typedef u32 acpi_event_status; | |||
656 | #define ACPI_GPE_MAX 0xFF | 656 | #define ACPI_GPE_MAX 0xFF |
657 | #define ACPI_NUM_GPE 256 | 657 | #define ACPI_NUM_GPE 256 |
658 | 658 | ||
659 | /* Actions for acpi_gpe_wakeup, acpi_hw_low_set_gpe */ | 659 | /* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */ |
660 | 660 | ||
661 | #define ACPI_GPE_ENABLE 0 | 661 | #define ACPI_GPE_ENABLE 0 |
662 | #define ACPI_GPE_DISABLE 1 | 662 | #define ACPI_GPE_DISABLE 1 |
663 | #define ACPI_GPE_COND_ENABLE 2 | 663 | #define ACPI_GPE_CONDITIONAL_ENABLE 2 |
664 | 664 | ||
665 | /* | 665 | /* |
666 | * GPE info flags - Per GPE | 666 | * GPE info flags - Per GPE |
667 | * +-------+---+-+-+ | 667 | * +-------+-+-+---+ |
668 | * | 7:4 |3:2|1|0| | 668 | * | 7:4 |3|2|1:0| |
669 | * +-------+---+-+-+ | 669 | * +-------+-+-+---+ |
670 | * | | | | | 670 | * | | | | |
671 | * | | | +--- Interrupt type: edge or level triggered | 671 | * | | | +-- Type of dispatch:to method, handler, notify, or none |
672 | * | | +----- GPE can wake the system | 672 | * | | +----- Interrupt type: edge or level triggered |
673 | * | +-------- Type of dispatch:to method, handler, or none | 673 | * | +------- Is a Wake GPE |
674 | * +-------------- <Reserved> | 674 | * +------------ <Reserved> |
675 | */ | 675 | */ |
676 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 | 676 | #define ACPI_GPE_DISPATCH_NONE (u8) 0x00 |
677 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 | 677 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x01 |
678 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | 678 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x02 |
679 | #define ACPI_GPE_DISPATCH_NOTIFY (u8) 0x03 | ||
680 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x03 | ||
679 | 681 | ||
680 | #define ACPI_GPE_CAN_WAKE (u8) 0x02 | 682 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x04 |
683 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | ||
684 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x04 | ||
681 | 685 | ||
682 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x0C | 686 | #define ACPI_GPE_CAN_WAKE (u8) 0x08 |
683 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x04 | ||
684 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x08 | ||
685 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 | ||
686 | 687 | ||
687 | /* | 688 | /* |
688 | * Flags for GPE and Lock interfaces | 689 | * Flags for GPE and Lock interfaces |
@@ -894,9 +895,20 @@ typedef void | |||
894 | /* | 895 | /* |
895 | * Various handlers and callback procedures | 896 | * Various handlers and callback procedures |
896 | */ | 897 | */ |
898 | typedef | ||
899 | void (*ACPI_GBL_EVENT_HANDLER) (u32 event_type, | ||
900 | acpi_handle device, | ||
901 | u32 event_number, void *context); | ||
902 | |||
903 | #define ACPI_EVENT_TYPE_GPE 0 | ||
904 | #define ACPI_EVENT_TYPE_FIXED 1 | ||
905 | |||
897 | typedef u32(*acpi_event_handler) (void *context); | 906 | typedef u32(*acpi_event_handler) (void *context); |
898 | 907 | ||
899 | typedef | 908 | typedef |
909 | u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context); | ||
910 | |||
911 | typedef | ||
900 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); | 912 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); |
901 | 913 | ||
902 | typedef | 914 | typedef |
@@ -951,6 +963,10 @@ u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); | |||
951 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 | 963 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 |
952 | #define ACPI_INTERRUPT_HANDLED 0x01 | 964 | #define ACPI_INTERRUPT_HANDLED 0x01 |
953 | 965 | ||
966 | /* GPE handler return values */ | ||
967 | |||
968 | #define ACPI_REENABLE_GPE 0x80 | ||
969 | |||
954 | /* Length of 32-bit EISAID values when converted back to a string */ | 970 | /* Length of 32-bit EISAID values when converted back to a string */ |
955 | 971 | ||
956 | #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ | 972 | #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ |
diff --git a/include/acpi/apei.h b/include/acpi/apei.h index b3365025ff8d..c4dbb132d902 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h | |||
@@ -19,6 +19,12 @@ | |||
19 | extern int hest_disable; | 19 | extern int hest_disable; |
20 | extern int erst_disable; | 20 | extern int erst_disable; |
21 | 21 | ||
22 | #ifdef CONFIG_ACPI_APEI | ||
23 | void __init acpi_hest_init(void); | ||
24 | #else | ||
25 | static inline void acpi_hest_init(void) { return; } | ||
26 | #endif | ||
27 | |||
22 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); | 28 | typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); |
23 | int apei_hest_parse(apei_hest_func_t func, void *data); | 29 | int apei_hest_parse(apei_hest_func_t func, void *data); |
24 | 30 | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index a3e334ab1119..5af3ed52ef98 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 5dcb9537343c..e228893591a9 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 572189e37133..5d2a5e9544d9 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2010, Intel Corp. | 8 | * Copyright (C) 2000 - 2011, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 1b62102fbb67..55192ac0cede 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -324,6 +324,12 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | |||
324 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 324 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
325 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, | 325 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, |
326 | int state, bool force); | 326 | int state, bool force); |
327 | /* | ||
328 | * Reevaluate whether the T-state is invalid after one cpu is | ||
329 | * onlined/offlined. In such case the flags.throttling will be updated. | ||
330 | */ | ||
331 | extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr, | ||
332 | unsigned long action); | ||
327 | extern const struct file_operations acpi_processor_throttling_fops; | 333 | extern const struct file_operations acpi_processor_throttling_fops; |
328 | extern void acpi_processor_throttling_init(void); | 334 | extern void acpi_processor_throttling_init(void); |
329 | /* in processor_idle.c */ | 335 | /* in processor_idle.c */ |
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 3577ca11a0be..4644c9a7f724 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/ioctls.h b/include/asm-generic/ioctls.h index a3216655d657..3f3f2d189fb8 100644 --- a/include/asm-generic/ioctls.h +++ b/include/asm-generic/ioctls.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #endif | 67 | #endif |
68 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 68 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
69 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ | 69 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ |
70 | #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
70 | #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ | 71 | #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ |
71 | #define TCSETX 0x5433 | 72 | #define TCSETX 0x5433 |
72 | #define TCSETXF 0x5434 | 73 | #define TCSETXF 0x5434 |
diff --git a/include/asm-generic/irq_regs.h b/include/asm-generic/irq_regs.h index 5ae1d07d4a12..6bf9355fa7eb 100644 --- a/include/asm-generic/irq_regs.h +++ b/include/asm-generic/irq_regs.h | |||
@@ -22,15 +22,15 @@ DECLARE_PER_CPU(struct pt_regs *, __irq_regs); | |||
22 | 22 | ||
23 | static inline struct pt_regs *get_irq_regs(void) | 23 | static inline struct pt_regs *get_irq_regs(void) |
24 | { | 24 | { |
25 | return __get_cpu_var(__irq_regs); | 25 | return __this_cpu_read(__irq_regs); |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) | 28 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) |
29 | { | 29 | { |
30 | struct pt_regs *old_regs, **pp_regs = &__get_cpu_var(__irq_regs); | 30 | struct pt_regs *old_regs; |
31 | 31 | ||
32 | old_regs = *pp_regs; | 32 | old_regs = __this_cpu_read(__irq_regs); |
33 | *pp_regs = new_regs; | 33 | __this_cpu_write(__irq_regs, new_regs); |
34 | return old_regs; | 34 | return old_regs; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 3da9e2742fa0..787abbb6d867 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
@@ -45,6 +45,9 @@ | |||
45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | 45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ |
46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | 46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ |
47 | 47 | ||
48 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
49 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
50 | |||
48 | /* compatibility flags */ | 51 | /* compatibility flags */ |
49 | #define MAP_FILE 0 | 52 | #define MAP_FILE 0 |
50 | 53 | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 6f3c6ae4fe03..31b6188df221 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -5,67 +5,100 @@ | |||
5 | #ifdef CONFIG_MMU | 5 | #ifdef CONFIG_MMU |
6 | 6 | ||
7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
8 | /* | 8 | extern int ptep_set_access_flags(struct vm_area_struct *vma, |
9 | * Largely same as above, but only sets the access flags (dirty, | 9 | unsigned long address, pte_t *ptep, |
10 | * accessed, and writable). Furthermore, we know it always gets set | 10 | pte_t entry, int dirty); |
11 | * to a "more permissive" setting, which allows most architectures | 11 | #endif |
12 | * to optimize this. We return whether the PTE actually changed, which | 12 | |
13 | * in turn instructs the caller to do things like update__mmu_cache. | 13 | #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS |
14 | * This used to be done in the caller, but sparc needs minor faults to | 14 | extern int pmdp_set_access_flags(struct vm_area_struct *vma, |
15 | * force that call on sun4c so we changed this macro slightly | 15 | unsigned long address, pmd_t *pmdp, |
16 | */ | 16 | pmd_t entry, int dirty); |
17 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | ||
18 | ({ \ | ||
19 | int __changed = !pte_same(*(__ptep), __entry); \ | ||
20 | if (__changed) { \ | ||
21 | set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ | ||
22 | flush_tlb_page(__vma, __address); \ | ||
23 | } \ | ||
24 | __changed; \ | ||
25 | }) | ||
26 | #endif | 17 | #endif |
27 | 18 | ||
28 | #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 19 | #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
29 | #define ptep_test_and_clear_young(__vma, __address, __ptep) \ | 20 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, |
30 | ({ \ | 21 | unsigned long address, |
31 | pte_t __pte = *(__ptep); \ | 22 | pte_t *ptep) |
32 | int r = 1; \ | 23 | { |
33 | if (!pte_young(__pte)) \ | 24 | pte_t pte = *ptep; |
34 | r = 0; \ | 25 | int r = 1; |
35 | else \ | 26 | if (!pte_young(pte)) |
36 | set_pte_at((__vma)->vm_mm, (__address), \ | 27 | r = 0; |
37 | (__ptep), pte_mkold(__pte)); \ | 28 | else |
38 | r; \ | 29 | set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte)); |
39 | }) | 30 | return r; |
31 | } | ||
32 | #endif | ||
33 | |||
34 | #ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG | ||
35 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
36 | static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, | ||
37 | unsigned long address, | ||
38 | pmd_t *pmdp) | ||
39 | { | ||
40 | pmd_t pmd = *pmdp; | ||
41 | int r = 1; | ||
42 | if (!pmd_young(pmd)) | ||
43 | r = 0; | ||
44 | else | ||
45 | set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); | ||
46 | return r; | ||
47 | } | ||
48 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
49 | static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, | ||
50 | unsigned long address, | ||
51 | pmd_t *pmdp) | ||
52 | { | ||
53 | BUG(); | ||
54 | return 0; | ||
55 | } | ||
56 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
40 | #endif | 57 | #endif |
41 | 58 | ||
42 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | 59 | #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |
43 | #define ptep_clear_flush_young(__vma, __address, __ptep) \ | 60 | int ptep_clear_flush_young(struct vm_area_struct *vma, |
44 | ({ \ | 61 | unsigned long address, pte_t *ptep); |
45 | int __young; \ | 62 | #endif |
46 | __young = ptep_test_and_clear_young(__vma, __address, __ptep); \ | 63 | |
47 | if (__young) \ | 64 | #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH |
48 | flush_tlb_page(__vma, __address); \ | 65 | int pmdp_clear_flush_young(struct vm_area_struct *vma, |
49 | __young; \ | 66 | unsigned long address, pmd_t *pmdp); |
50 | }) | ||
51 | #endif | 67 | #endif |
52 | 68 | ||
53 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR | 69 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR |
54 | #define ptep_get_and_clear(__mm, __address, __ptep) \ | 70 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, |
55 | ({ \ | 71 | unsigned long address, |
56 | pte_t __pte = *(__ptep); \ | 72 | pte_t *ptep) |
57 | pte_clear((__mm), (__address), (__ptep)); \ | 73 | { |
58 | __pte; \ | 74 | pte_t pte = *ptep; |
75 | pte_clear(mm, address, ptep); | ||
76 | return pte; | ||
77 | } | ||
78 | #endif | ||
79 | |||
80 | #ifndef __HAVE_ARCH_PMDP_GET_AND_CLEAR | ||
81 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
82 | static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, | ||
83 | unsigned long address, | ||
84 | pmd_t *pmdp) | ||
85 | { | ||
86 | pmd_t pmd = *pmdp; | ||
87 | pmd_clear(mm, address, pmdp); | ||
88 | return pmd; | ||
59 | }) | 89 | }) |
90 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
60 | #endif | 91 | #endif |
61 | 92 | ||
62 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL | 93 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL |
63 | #define ptep_get_and_clear_full(__mm, __address, __ptep, __full) \ | 94 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, |
64 | ({ \ | 95 | unsigned long address, pte_t *ptep, |
65 | pte_t __pte; \ | 96 | int full) |
66 | __pte = ptep_get_and_clear((__mm), (__address), (__ptep)); \ | 97 | { |
67 | __pte; \ | 98 | pte_t pte; |
68 | }) | 99 | pte = ptep_get_and_clear(mm, address, ptep); |
100 | return pte; | ||
101 | } | ||
69 | #endif | 102 | #endif |
70 | 103 | ||
71 | /* | 104 | /* |
@@ -74,20 +107,25 @@ | |||
74 | * not present, or in the process of an address space destruction. | 107 | * not present, or in the process of an address space destruction. |
75 | */ | 108 | */ |
76 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL | 109 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL |
77 | #define pte_clear_not_present_full(__mm, __address, __ptep, __full) \ | 110 | static inline void pte_clear_not_present_full(struct mm_struct *mm, |
78 | do { \ | 111 | unsigned long address, |
79 | pte_clear((__mm), (__address), (__ptep)); \ | 112 | pte_t *ptep, |
80 | } while (0) | 113 | int full) |
114 | { | ||
115 | pte_clear(mm, address, ptep); | ||
116 | } | ||
81 | #endif | 117 | #endif |
82 | 118 | ||
83 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH | 119 | #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH |
84 | #define ptep_clear_flush(__vma, __address, __ptep) \ | 120 | extern pte_t ptep_clear_flush(struct vm_area_struct *vma, |
85 | ({ \ | 121 | unsigned long address, |
86 | pte_t __pte; \ | 122 | pte_t *ptep); |
87 | __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep); \ | 123 | #endif |
88 | flush_tlb_page(__vma, __address); \ | 124 | |
89 | __pte; \ | 125 | #ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH |
90 | }) | 126 | extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma, |
127 | unsigned long address, | ||
128 | pmd_t *pmdp); | ||
91 | #endif | 129 | #endif |
92 | 130 | ||
93 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT | 131 | #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT |
@@ -99,8 +137,49 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
99 | } | 137 | } |
100 | #endif | 138 | #endif |
101 | 139 | ||
140 | #ifndef __HAVE_ARCH_PMDP_SET_WRPROTECT | ||
141 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
142 | static inline void pmdp_set_wrprotect(struct mm_struct *mm, | ||
143 | unsigned long address, pmd_t *pmdp) | ||
144 | { | ||
145 | pmd_t old_pmd = *pmdp; | ||
146 | set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd)); | ||
147 | } | ||
148 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
149 | static inline void pmdp_set_wrprotect(struct mm_struct *mm, | ||
150 | unsigned long address, pmd_t *pmdp) | ||
151 | { | ||
152 | BUG(); | ||
153 | } | ||
154 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
155 | #endif | ||
156 | |||
157 | #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH | ||
158 | extern pmd_t pmdp_splitting_flush(struct vm_area_struct *vma, | ||
159 | unsigned long address, | ||
160 | pmd_t *pmdp); | ||
161 | #endif | ||
162 | |||
102 | #ifndef __HAVE_ARCH_PTE_SAME | 163 | #ifndef __HAVE_ARCH_PTE_SAME |
103 | #define pte_same(A,B) (pte_val(A) == pte_val(B)) | 164 | static inline int pte_same(pte_t pte_a, pte_t pte_b) |
165 | { | ||
166 | return pte_val(pte_a) == pte_val(pte_b); | ||
167 | } | ||
168 | #endif | ||
169 | |||
170 | #ifndef __HAVE_ARCH_PMD_SAME | ||
171 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
172 | static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | ||
173 | { | ||
174 | return pmd_val(pmd_a) == pmd_val(pmd_b); | ||
175 | } | ||
176 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
177 | static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | ||
178 | { | ||
179 | BUG(); | ||
180 | return 0; | ||
181 | } | ||
182 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
104 | #endif | 183 | #endif |
105 | 184 | ||
106 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY | 185 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY |
@@ -348,6 +427,24 @@ extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, | |||
348 | unsigned long size); | 427 | unsigned long size); |
349 | #endif | 428 | #endif |
350 | 429 | ||
430 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE | ||
431 | static inline int pmd_trans_huge(pmd_t pmd) | ||
432 | { | ||
433 | return 0; | ||
434 | } | ||
435 | static inline int pmd_trans_splitting(pmd_t pmd) | ||
436 | { | ||
437 | return 0; | ||
438 | } | ||
439 | #ifndef __HAVE_ARCH_PMD_WRITE | ||
440 | static inline int pmd_write(pmd_t pmd) | ||
441 | { | ||
442 | BUG(); | ||
443 | return 0; | ||
444 | } | ||
445 | #endif /* __HAVE_ARCH_PMD_WRITE */ | ||
446 | #endif | ||
447 | |||
351 | #endif /* !__ASSEMBLY__ */ | 448 | #endif /* !__ASSEMBLY__ */ |
352 | 449 | ||
353 | #endif /* _ASM_GENERIC_PGTABLE_H */ | 450 | #endif /* _ASM_GENERIC_PGTABLE_H */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd69d79208de..fe77e3395b40 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 |
@@ -123,7 +124,8 @@ | |||
123 | #endif | 124 | #endif |
124 | 125 | ||
125 | #ifdef CONFIG_EVENT_TRACING | 126 | #ifdef CONFIG_EVENT_TRACING |
126 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 127 | #define FTRACE_EVENTS() . = ALIGN(8); \ |
128 | VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | ||
127 | *(_ftrace_events) \ | 129 | *(_ftrace_events) \ |
128 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; | 130 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; |
129 | #else | 131 | #else |
@@ -139,13 +141,21 @@ | |||
139 | #endif | 141 | #endif |
140 | 142 | ||
141 | #ifdef CONFIG_FTRACE_SYSCALLS | 143 | #ifdef CONFIG_FTRACE_SYSCALLS |
142 | #define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | 144 | #define TRACE_SYSCALLS() . = ALIGN(8); \ |
145 | VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | ||
143 | *(__syscalls_metadata) \ | 146 | *(__syscalls_metadata) \ |
144 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; | 147 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; |
145 | #else | 148 | #else |
146 | #define TRACE_SYSCALLS() | 149 | #define TRACE_SYSCALLS() |
147 | #endif | 150 | #endif |
148 | 151 | ||
152 | |||
153 | #define KERNEL_DTB() \ | ||
154 | STRUCT_ALIGN(); \ | ||
155 | VMLINUX_SYMBOL(__dtb_start) = .; \ | ||
156 | *(.dtb.init.rodata) \ | ||
157 | VMLINUX_SYMBOL(__dtb_end) = .; | ||
158 | |||
149 | /* .data section */ | 159 | /* .data section */ |
150 | #define DATA_DATA \ | 160 | #define DATA_DATA \ |
151 | *(.data) \ | 161 | *(.data) \ |
@@ -157,10 +167,8 @@ | |||
157 | CPU_KEEP(exit.data) \ | 167 | CPU_KEEP(exit.data) \ |
158 | MEM_KEEP(init.data) \ | 168 | MEM_KEEP(init.data) \ |
159 | MEM_KEEP(exit.data) \ | 169 | MEM_KEEP(exit.data) \ |
160 | . = ALIGN(32); \ | 170 | STRUCT_ALIGN(); \ |
161 | VMLINUX_SYMBOL(__start___tracepoints) = .; \ | ||
162 | *(__tracepoints) \ | 171 | *(__tracepoints) \ |
163 | VMLINUX_SYMBOL(__stop___tracepoints) = .; \ | ||
164 | /* implement dynamic printk debug */ \ | 172 | /* implement dynamic printk debug */ \ |
165 | . = ALIGN(8); \ | 173 | . = ALIGN(8); \ |
166 | VMLINUX_SYMBOL(__start___verbose) = .; \ | 174 | VMLINUX_SYMBOL(__start___verbose) = .; \ |
@@ -168,13 +176,7 @@ | |||
168 | VMLINUX_SYMBOL(__stop___verbose) = .; \ | 176 | VMLINUX_SYMBOL(__stop___verbose) = .; \ |
169 | LIKELY_PROFILE() \ | 177 | LIKELY_PROFILE() \ |
170 | BRANCH_PROFILE() \ | 178 | BRANCH_PROFILE() \ |
171 | TRACE_PRINTKS() \ | 179 | TRACE_PRINTKS() |
172 | \ | ||
173 | STRUCT_ALIGN(); \ | ||
174 | FTRACE_EVENTS() \ | ||
175 | \ | ||
176 | STRUCT_ALIGN(); \ | ||
177 | TRACE_SYSCALLS() | ||
178 | 180 | ||
179 | /* | 181 | /* |
180 | * Data section helpers | 182 | * Data section helpers |
@@ -192,7 +194,8 @@ | |||
192 | 194 | ||
193 | #define READ_MOSTLY_DATA(align) \ | 195 | #define READ_MOSTLY_DATA(align) \ |
194 | . = ALIGN(align); \ | 196 | . = ALIGN(align); \ |
195 | *(.data..read_mostly) | 197 | *(.data..read_mostly) \ |
198 | . = ALIGN(align); | ||
196 | 199 | ||
197 | #define CACHELINE_ALIGNED_DATA(align) \ | 200 | #define CACHELINE_ALIGNED_DATA(align) \ |
198 | . = ALIGN(align); \ | 201 | . = ALIGN(align); \ |
@@ -211,6 +214,10 @@ | |||
211 | VMLINUX_SYMBOL(__start_rodata) = .; \ | 214 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
212 | *(.rodata) *(.rodata.*) \ | 215 | *(.rodata) *(.rodata.*) \ |
213 | *(__vermagic) /* Kernel version magic */ \ | 216 | *(__vermagic) /* Kernel version magic */ \ |
217 | . = ALIGN(8); \ | ||
218 | VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ | ||
219 | *(__tracepoints_ptrs) /* Tracepoints: pointer array */\ | ||
220 | VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ | ||
214 | *(__markers_strings) /* Markers: strings */ \ | 221 | *(__markers_strings) /* Markers: strings */ \ |
215 | *(__tracepoints_strings)/* Tracepoints: strings */ \ | 222 | *(__tracepoints_strings)/* Tracepoints: strings */ \ |
216 | } \ | 223 | } \ |
@@ -355,6 +362,13 @@ | |||
355 | VMLINUX_SYMBOL(__start___param) = .; \ | 362 | VMLINUX_SYMBOL(__start___param) = .; \ |
356 | *(__param) \ | 363 | *(__param) \ |
357 | VMLINUX_SYMBOL(__stop___param) = .; \ | 364 | VMLINUX_SYMBOL(__stop___param) = .; \ |
365 | } \ | ||
366 | \ | ||
367 | /* Built-in module versions. */ \ | ||
368 | __modver : AT(ADDR(__modver) - LOAD_OFFSET) { \ | ||
369 | VMLINUX_SYMBOL(__start___modver) = .; \ | ||
370 | *(__modver) \ | ||
371 | VMLINUX_SYMBOL(__stop___modver) = .; \ | ||
358 | . = ALIGN((align)); \ | 372 | . = ALIGN((align)); \ |
359 | VMLINUX_SYMBOL(__end_rodata) = .; \ | 373 | VMLINUX_SYMBOL(__end_rodata) = .; \ |
360 | } \ | 374 | } \ |
@@ -466,9 +480,12 @@ | |||
466 | KERNEL_CTORS() \ | 480 | KERNEL_CTORS() \ |
467 | *(.init.rodata) \ | 481 | *(.init.rodata) \ |
468 | MCOUNT_REC() \ | 482 | MCOUNT_REC() \ |
483 | FTRACE_EVENTS() \ | ||
484 | TRACE_SYSCALLS() \ | ||
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 000000000000..c5813c87de06 --- /dev/null +++ b/include/crypto/if_alg.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * if_alg: User-space algorithm interface | ||
3 | * | ||
4 | * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_IF_ALG_H | ||
14 | #define _CRYPTO_IF_ALG_H | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/completion.h> | ||
18 | #include <linux/if_alg.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <net/sock.h> | ||
21 | |||
22 | #define ALG_MAX_PAGES 16 | ||
23 | |||
24 | struct crypto_async_request; | ||
25 | |||
26 | struct alg_sock { | ||
27 | /* struct sock must be the first member of struct alg_sock */ | ||
28 | struct sock sk; | ||
29 | |||
30 | struct sock *parent; | ||
31 | |||
32 | const struct af_alg_type *type; | ||
33 | void *private; | ||
34 | }; | ||
35 | |||
36 | struct af_alg_completion { | ||
37 | struct completion completion; | ||
38 | int err; | ||
39 | }; | ||
40 | |||
41 | struct af_alg_control { | ||
42 | struct af_alg_iv *iv; | ||
43 | int op; | ||
44 | }; | ||
45 | |||
46 | struct af_alg_type { | ||
47 | void *(*bind)(const char *name, u32 type, u32 mask); | ||
48 | void (*release)(void *private); | ||
49 | int (*setkey)(void *private, const u8 *key, unsigned int keylen); | ||
50 | int (*accept)(void *private, struct sock *sk); | ||
51 | |||
52 | struct proto_ops *ops; | ||
53 | struct module *owner; | ||
54 | char name[14]; | ||
55 | }; | ||
56 | |||
57 | struct af_alg_sgl { | ||
58 | struct scatterlist sg[ALG_MAX_PAGES]; | ||
59 | struct page *pages[ALG_MAX_PAGES]; | ||
60 | }; | ||
61 | |||
62 | int af_alg_register_type(const struct af_alg_type *type); | ||
63 | int af_alg_unregister_type(const struct af_alg_type *type); | ||
64 | |||
65 | int af_alg_release(struct socket *sock); | ||
66 | int af_alg_accept(struct sock *sk, struct socket *newsock); | ||
67 | |||
68 | int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len, | ||
69 | int write); | ||
70 | void af_alg_free_sg(struct af_alg_sgl *sgl); | ||
71 | |||
72 | int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con); | ||
73 | |||
74 | int af_alg_wait_for_completion(int err, struct af_alg_completion *completion); | ||
75 | void af_alg_complete(struct crypto_async_request *req, int err); | ||
76 | |||
77 | static inline struct alg_sock *alg_sk(struct sock *sk) | ||
78 | { | ||
79 | return (struct alg_sock *)sk; | ||
80 | } | ||
81 | |||
82 | static inline void af_alg_release_parent(struct sock *sk) | ||
83 | { | ||
84 | sock_put(alg_sk(sk)->parent); | ||
85 | } | ||
86 | |||
87 | static inline void af_alg_init_completion(struct af_alg_completion *completion) | ||
88 | { | ||
89 | init_completion(&completion->completion); | ||
90 | } | ||
91 | |||
92 | #endif /* _CRYPTO_IF_ALG_H */ | ||
diff --git a/include/crypto/padlock.h b/include/crypto/padlock.h new file mode 100644 index 000000000000..d2cfa2ef49e8 --- /dev/null +++ b/include/crypto/padlock.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Driver for VIA PadLock | ||
3 | * | ||
4 | * Copyright (c) 2004 Michal Ludvig <michal@logix.cz> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_PADLOCK_H | ||
14 | #define _CRYPTO_PADLOCK_H | ||
15 | |||
16 | #define PADLOCK_ALIGNMENT 16 | ||
17 | |||
18 | #define PFX KBUILD_MODNAME ": " | ||
19 | |||
20 | #define PADLOCK_CRA_PRIORITY 300 | ||
21 | #define PADLOCK_COMPOSITE_PRIORITY 400 | ||
22 | |||
23 | #ifdef CONFIG_64BIT | ||
24 | #define STACK_ALIGN 16 | ||
25 | #else | ||
26 | #define STACK_ALIGN 4 | ||
27 | #endif | ||
28 | |||
29 | #endif /* _CRYPTO_PADLOCK_H */ | ||
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 833d208c25d6..4fd95a323beb 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -68,6 +68,21 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | |||
68 | return (++sg)->length ? sg : (void *)sg_page(sg); | 68 | return (++sg)->length ? sg : (void *)sg_page(sg); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | ||
72 | struct scatterlist *sg, | ||
73 | int chain, int num) | ||
74 | { | ||
75 | if (chain) { | ||
76 | head->length += sg->length; | ||
77 | sg = scatterwalk_sg_next(sg); | ||
78 | } | ||
79 | |||
80 | if (sg) | ||
81 | scatterwalk_sg_chain(head, num, sg); | ||
82 | else | ||
83 | sg_mark_end(head); | ||
84 | } | ||
85 | |||
71 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, | 86 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, |
72 | struct scatter_walk *walk_out) | 87 | struct scatter_walk *walk_out) |
73 | { | 88 | { |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 274eaaa15c36..fe29aadb129d 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); |
1287 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1368 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, |
1369 | struct timeval *vblanktime); | ||
1370 | extern bool 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 029aa688e787..801be59f4f15 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -275,6 +275,7 @@ struct drm_pending_vblank_event; | |||
275 | 275 | ||
276 | /** | 276 | /** |
277 | * drm_crtc_funcs - control CRTCs for a given device | 277 | * drm_crtc_funcs - control CRTCs for a given device |
278 | * @reset: reset CRTC after state has been invalidate (e.g. resume) | ||
278 | * @dpms: control display power levels | 279 | * @dpms: control display power levels |
279 | * @save: save CRTC state | 280 | * @save: save CRTC state |
280 | * @resore: restore CRTC state | 281 | * @resore: restore CRTC state |
@@ -302,6 +303,8 @@ struct drm_crtc_funcs { | |||
302 | void (*save)(struct drm_crtc *crtc); /* suspend? */ | 303 | void (*save)(struct drm_crtc *crtc); /* suspend? */ |
303 | /* Restore CRTC state */ | 304 | /* Restore CRTC state */ |
304 | void (*restore)(struct drm_crtc *crtc); /* resume? */ | 305 | void (*restore)(struct drm_crtc *crtc); /* resume? */ |
306 | /* Reset CRTC state */ | ||
307 | void (*reset)(struct drm_crtc *crtc); | ||
305 | 308 | ||
306 | /* cursor controls */ | 309 | /* cursor controls */ |
307 | int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, | 310 | int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, |
@@ -351,8 +354,14 @@ struct drm_crtc { | |||
351 | 354 | ||
352 | bool enabled; | 355 | bool enabled; |
353 | 356 | ||
357 | /* Requested mode from modesetting. */ | ||
354 | struct drm_display_mode mode; | 358 | struct drm_display_mode mode; |
355 | 359 | ||
360 | /* Programmed mode in hw, after adjustments for encoders, | ||
361 | * crtc, panel scaling etc. Needed for timestamping etc. | ||
362 | */ | ||
363 | struct drm_display_mode hwmode; | ||
364 | |||
356 | int x, y; | 365 | int x, y; |
357 | const struct drm_crtc_funcs *funcs; | 366 | const struct drm_crtc_funcs *funcs; |
358 | 367 | ||
@@ -360,6 +369,9 @@ struct drm_crtc { | |||
360 | uint32_t gamma_size; | 369 | uint32_t gamma_size; |
361 | uint16_t *gamma_store; | 370 | uint16_t *gamma_store; |
362 | 371 | ||
372 | /* Constants needed for precise vblank and swap timestamping. */ | ||
373 | s64 framedur_ns, linedur_ns, pixeldur_ns; | ||
374 | |||
363 | /* if you are using the helper */ | 375 | /* if you are using the helper */ |
364 | void *helper_private; | 376 | void *helper_private; |
365 | }; | 377 | }; |
@@ -370,6 +382,7 @@ struct drm_crtc { | |||
370 | * @dpms: set power state (see drm_crtc_funcs above) | 382 | * @dpms: set power state (see drm_crtc_funcs above) |
371 | * @save: save connector state | 383 | * @save: save connector state |
372 | * @restore: restore connector state | 384 | * @restore: restore connector state |
385 | * @reset: reset connector after state has been invalidate (e.g. resume) | ||
373 | * @mode_valid: is this mode valid on the given connector? | 386 | * @mode_valid: is this mode valid on the given connector? |
374 | * @mode_fixup: try to fixup proposed mode for this connector | 387 | * @mode_fixup: try to fixup proposed mode for this connector |
375 | * @mode_set: set this mode | 388 | * @mode_set: set this mode |
@@ -387,6 +400,7 @@ struct drm_connector_funcs { | |||
387 | void (*dpms)(struct drm_connector *connector, int mode); | 400 | void (*dpms)(struct drm_connector *connector, int mode); |
388 | void (*save)(struct drm_connector *connector); | 401 | void (*save)(struct drm_connector *connector); |
389 | void (*restore)(struct drm_connector *connector); | 402 | void (*restore)(struct drm_connector *connector); |
403 | void (*reset)(struct drm_connector *connector); | ||
390 | 404 | ||
391 | /* Check to see if anything is attached to the connector. | 405 | /* Check to see if anything is attached to the connector. |
392 | * @force is set to false whilst polling, true when checking the | 406 | * @force is set to false whilst polling, true when checking the |
@@ -404,6 +418,7 @@ struct drm_connector_funcs { | |||
404 | }; | 418 | }; |
405 | 419 | ||
406 | struct drm_encoder_funcs { | 420 | struct drm_encoder_funcs { |
421 | void (*reset)(struct drm_encoder *encoder); | ||
407 | void (*destroy)(struct drm_encoder *encoder); | 422 | void (*destroy)(struct drm_encoder *encoder); |
408 | }; | 423 | }; |
409 | 424 | ||
@@ -647,6 +662,7 @@ extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, | |||
647 | struct drm_display_mode *mode); | 662 | struct drm_display_mode *mode); |
648 | extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); | 663 | extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); |
649 | extern void drm_mode_config_init(struct drm_device *dev); | 664 | extern void drm_mode_config_init(struct drm_device *dev); |
665 | extern void drm_mode_config_reset(struct drm_device *dev); | ||
650 | extern void drm_mode_config_cleanup(struct drm_device *dev); | 666 | extern void drm_mode_config_cleanup(struct drm_device *dev); |
651 | extern void drm_mode_set_name(struct drm_display_mode *mode); | 667 | extern void drm_mode_set_name(struct drm_display_mode *mode); |
652 | extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); | 668 | extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); |
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index bf01531193d5..e39177778601 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 883c1d439899..5ff1194dc2ea 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -28,7 +28,6 @@ | |||
28 | {0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ | 28 | {0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ |
29 | {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP}, \ | 29 | {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP}, \ |
30 | {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ | 30 | {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ |
31 | {0x1002, 0x4243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ | ||
32 | {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 31 | {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
33 | {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 32 | {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
34 | {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 33 | {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
@@ -142,6 +141,42 @@ | |||
142 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 141 | {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}, \ | 142 | {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}, \ | 143 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
144 | {0x1002, 0x6720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
145 | {0x1002, 0x6721, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
146 | {0x1002, 0x6722, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
147 | {0x1002, 0x6723, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
148 | {0x1002, 0x6724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
149 | {0x1002, 0x6725, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
150 | {0x1002, 0x6726, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
151 | {0x1002, 0x6727, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
152 | {0x1002, 0x6728, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
153 | {0x1002, 0x6729, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
154 | {0x1002, 0x6738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
155 | {0x1002, 0x6739, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BARTS|RADEON_NEW_MEMMAP}, \ | ||
156 | {0x1002, 0x6740, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
157 | {0x1002, 0x6741, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
158 | {0x1002, 0x6742, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
159 | {0x1002, 0x6743, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
160 | {0x1002, 0x6744, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
161 | {0x1002, 0x6745, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
162 | {0x1002, 0x6746, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
163 | {0x1002, 0x6747, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
164 | {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
165 | {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
166 | {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
167 | {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
168 | {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ | ||
169 | {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
170 | {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
171 | {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
172 | {0x1002, 0x6763, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
173 | {0x1002, 0x6764, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
174 | {0x1002, 0x6765, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
175 | {0x1002, 0x6766, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
176 | {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
177 | {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
178 | {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ | ||
179 | {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}, \ | 180 | {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}, \ | 181 | {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}, \ | 182 | {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
@@ -419,6 +454,10 @@ | |||
419 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 454 | {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}, \ | 455 | {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}, \ | 456 | {0x1002, 0x9715, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
457 | {0x1002, 0x9802, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
458 | {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
459 | {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
460 | {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
422 | {0, 0, 0} | 461 | {0, 0, 0} |
423 | 462 | ||
424 | #define r128_PCI_IDS \ | 463 | #define r128_PCI_IDS \ |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index a2776e2807a4..0039f1f97ad8 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 d3c81946f613..9e343c0998b4 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 bc5590b1a1ac..e2cfe80f6fca 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 10f8b53bdd40..e5c607a02d57 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
@@ -906,6 +906,8 @@ 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 */ | ||
910 | #define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */ | ||
909 | 911 | ||
910 | struct drm_radeon_info { | 912 | struct drm_radeon_info { |
911 | uint32_t request; | 913 | uint32_t request; |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index beafc156a535..50852aad260a 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 8e0c848326b6..1da8af6ac884 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 cd2c475da9ea..26cc7f9ffa41 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 000000000000..95855017a32b --- /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 000000000000..56f82e5c9975 --- /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 97319a8fc1e0..b0ada6f37dd6 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -1,5 +1,6 @@ | |||
1 | header-y += byteorder/ | 1 | header-y += byteorder/ |
2 | header-y += can/ | 2 | header-y += can/ |
3 | header-y += caif/ | ||
3 | header-y += dvb/ | 4 | header-y += dvb/ |
4 | header-y += hdlc/ | 5 | header-y += hdlc/ |
5 | header-y += isdn/ | 6 | header-y += isdn/ |
@@ -20,15 +21,18 @@ header-y += wimax/ | |||
20 | objhdr-y += version.h | 21 | objhdr-y += version.h |
21 | 22 | ||
22 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | 23 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
23 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 24 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ |
25 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) | ||
24 | header-y += a.out.h | 26 | header-y += a.out.h |
25 | endif | 27 | endif |
26 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | 28 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
27 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 29 | $(srctree)/include/asm-$(SRCARCH)/kvm.h \ |
30 | $(INSTALL_HDR_PATH)/include/asm-*/kvm.h),) | ||
28 | header-y += kvm.h | 31 | header-y += kvm.h |
29 | endif | 32 | endif |
30 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | 33 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ |
31 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | 34 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h \ |
35 | $(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),) | ||
32 | header-y += kvm_para.h | 36 | header-y += kvm_para.h |
33 | endif | 37 | endif |
34 | 38 | ||
@@ -155,6 +159,7 @@ header-y += icmpv6.h | |||
155 | header-y += if.h | 159 | header-y += if.h |
156 | header-y += if_addr.h | 160 | header-y += if_addr.h |
157 | header-y += if_addrlabel.h | 161 | header-y += if_addrlabel.h |
162 | header-y += if_alg.h | ||
158 | header-y += if_arcnet.h | 163 | header-y += if_arcnet.h |
159 | header-y += if_arp.h | 164 | header-y += if_arp.h |
160 | header-y += if_bonding.h | 165 | header-y += if_bonding.h |
@@ -367,7 +372,6 @@ header-y += utime.h | |||
367 | header-y += utsname.h | 372 | header-y += utsname.h |
368 | header-y += veth.h | 373 | header-y += veth.h |
369 | header-y += vhost.h | 374 | header-y += vhost.h |
370 | header-y += videodev.h | ||
371 | header-y += videodev2.h | 375 | header-y += videodev2.h |
372 | header-y += virtio_9p.h | 376 | header-y += virtio_9p.h |
373 | header-y += virtio_balloon.h | 377 | header-y += virtio_balloon.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 67c91b4418b0..a2e910e01293 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -306,9 +306,6 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
306 | u32 *mask, u32 req); | 306 | u32 *mask, u32 req); |
307 | extern void acpi_early_init(void); | 307 | extern void acpi_early_init(void); |
308 | 308 | ||
309 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
310 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
311 | |||
312 | #else /* !CONFIG_ACPI */ | 309 | #else /* !CONFIG_ACPI */ |
313 | 310 | ||
314 | #define acpi_disabled 1 | 311 | #define acpi_disabled 1 |
@@ -352,4 +349,14 @@ static inline int acpi_table_parse(char *id, | |||
352 | return -1; | 349 | return -1; |
353 | } | 350 | } |
354 | #endif /* !CONFIG_ACPI */ | 351 | #endif /* !CONFIG_ACPI */ |
352 | |||
353 | #ifdef CONFIG_ACPI_SLEEP | ||
354 | int suspend_nvs_register(unsigned long start, unsigned long size); | ||
355 | #else | ||
356 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
357 | { | ||
358 | return 0; | ||
359 | } | ||
360 | #endif | ||
361 | |||
355 | #endif /*_LINUX_ACPI_H*/ | 362 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h new file mode 100644 index 000000000000..7180013a4a3a --- /dev/null +++ b/include/linux/acpi_io.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _ACPI_IO_H_ | ||
2 | #define _ACPI_IO_H_ | ||
3 | |||
4 | #include <linux/io.h> | ||
5 | #include <acpi/acpi.h> | ||
6 | |||
7 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | ||
8 | acpi_size size) | ||
9 | { | ||
10 | return ioremap_cache(phys, size); | ||
11 | } | ||
12 | |||
13 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
14 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
15 | |||
16 | #endif | ||
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 09ea4a1e9505..eaf6cd75a1b1 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/bus.h b/include/linux/amba/bus.h index c6454cca0447..9e7f259346e1 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
21 | #include <linux/regulator/consumer.h> | ||
21 | 22 | ||
22 | #define AMBA_NR_IRQS 2 | 23 | #define AMBA_NR_IRQS 2 |
23 | #define AMBA_CID 0xb105f00d | 24 | #define AMBA_CID 0xb105f00d |
@@ -28,6 +29,7 @@ struct amba_device { | |||
28 | struct device dev; | 29 | struct device dev; |
29 | struct resource res; | 30 | struct resource res; |
30 | struct clk *pclk; | 31 | struct clk *pclk; |
32 | struct regulator *vcore; | ||
31 | u64 dma_mask; | 33 | u64 dma_mask; |
32 | unsigned int periphid; | 34 | unsigned int periphid; |
33 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
@@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *); | |||
71 | #define amba_pclk_disable(d) \ | 73 | #define amba_pclk_disable(d) \ |
72 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 74 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
73 | 75 | ||
76 | #define amba_vcore_enable(d) \ | ||
77 | (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore)) | ||
78 | |||
79 | #define amba_vcore_disable(d) \ | ||
80 | do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0) | ||
81 | |||
74 | /* Some drivers don't use the struct amba_device */ | 82 | /* Some drivers don't use the struct amba_device */ |
75 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) | 83 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
76 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) | 84 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 521a0f8974ac..3111385b8ca7 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -12,7 +12,6 @@ | |||
12 | * | 12 | * |
13 | * Please credit ARM.com | 13 | * Please credit ARM.com |
14 | * Documentation: ARM DDI 0196D | 14 | * Documentation: ARM DDI 0196D |
15 | * | ||
16 | */ | 15 | */ |
17 | 16 | ||
18 | #ifndef AMBA_PL08X_H | 17 | #ifndef AMBA_PL08X_H |
@@ -22,6 +21,15 @@ | |||
22 | #include <linux/dmaengine.h> | 21 | #include <linux/dmaengine.h> |
23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
24 | 23 | ||
24 | struct pl08x_lli; | ||
25 | struct pl08x_driver_data; | ||
26 | |||
27 | /* Bitmasks for selecting AHB ports for DMA transfers */ | ||
28 | enum { | ||
29 | PL08X_AHB1 = (1 << 0), | ||
30 | PL08X_AHB2 = (1 << 1) | ||
31 | }; | ||
32 | |||
25 | /** | 33 | /** |
26 | * struct pl08x_channel_data - data structure to pass info between | 34 | * struct pl08x_channel_data - data structure to pass info between |
27 | * platform and PL08x driver regarding channel configuration | 35 | * platform and PL08x driver regarding channel configuration |
@@ -46,8 +54,10 @@ | |||
46 | * @circular_buffer: whether the buffer passed in is circular and | 54 | * @circular_buffer: whether the buffer passed in is circular and |
47 | * shall simply be looped round round (like a record baby round | 55 | * shall simply be looped round round (like a record baby round |
48 | * round round round) | 56 | * round round round) |
49 | * @single: the device connected to this channel will request single | 57 | * @single: the device connected to this channel will request single DMA |
50 | * DMA transfers, not bursts. (Bursts are default.) | 58 | * transfers, not bursts. (Bursts are default.) |
59 | * @periph_buses: the device connected to this channel is accessible via | ||
60 | * these buses (use PL08X_AHB1 | PL08X_AHB2). | ||
51 | */ | 61 | */ |
52 | struct pl08x_channel_data { | 62 | struct pl08x_channel_data { |
53 | char *bus_id; | 63 | char *bus_id; |
@@ -55,10 +65,10 @@ struct pl08x_channel_data { | |||
55 | int max_signal; | 65 | int max_signal; |
56 | u32 muxval; | 66 | u32 muxval; |
57 | u32 cctl; | 67 | u32 cctl; |
58 | u32 ccfg; | ||
59 | dma_addr_t addr; | 68 | dma_addr_t addr; |
60 | bool circular_buffer; | 69 | bool circular_buffer; |
61 | bool single; | 70 | bool single; |
71 | u8 periph_buses; | ||
62 | }; | 72 | }; |
63 | 73 | ||
64 | /** | 74 | /** |
@@ -67,24 +77,23 @@ struct pl08x_channel_data { | |||
67 | * @addr: current address | 77 | * @addr: current address |
68 | * @maxwidth: the maximum width of a transfer on this bus | 78 | * @maxwidth: the maximum width of a transfer on this bus |
69 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 | 79 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 |
70 | * @fill_bytes: bytes required to fill to the next bus memory | 80 | * @fill_bytes: bytes required to fill to the next bus memory boundary |
71 | * boundary | ||
72 | */ | 81 | */ |
73 | struct pl08x_bus_data { | 82 | struct pl08x_bus_data { |
74 | dma_addr_t addr; | 83 | dma_addr_t addr; |
75 | u8 maxwidth; | 84 | u8 maxwidth; |
76 | u8 buswidth; | 85 | u8 buswidth; |
77 | u32 fill_bytes; | 86 | size_t fill_bytes; |
78 | }; | 87 | }; |
79 | 88 | ||
80 | /** | 89 | /** |
81 | * struct pl08x_phy_chan - holder for the physical channels | 90 | * struct pl08x_phy_chan - holder for the physical channels |
82 | * @id: physical index to this channel | 91 | * @id: physical index to this channel |
83 | * @lock: a lock to use when altering an instance of this struct | 92 | * @lock: a lock to use when altering an instance of this struct |
84 | * @signal: the physical signal (aka channel) serving this | 93 | * @signal: the physical signal (aka channel) serving this physical channel |
85 | * physical channel right now | 94 | * right now |
86 | * @serving: the virtual channel currently being served by this | 95 | * @serving: the virtual channel currently being served by this physical |
87 | * physical channel | 96 | * channel |
88 | */ | 97 | */ |
89 | struct pl08x_phy_chan { | 98 | struct pl08x_phy_chan { |
90 | unsigned int id; | 99 | unsigned int id; |
@@ -92,11 +101,6 @@ struct pl08x_phy_chan { | |||
92 | spinlock_t lock; | 101 | spinlock_t lock; |
93 | int signal; | 102 | int signal; |
94 | struct pl08x_dma_chan *serving; | 103 | struct pl08x_dma_chan *serving; |
95 | u32 csrc; | ||
96 | u32 cdst; | ||
97 | u32 clli; | ||
98 | u32 cctl; | ||
99 | u32 ccfg; | ||
100 | }; | 104 | }; |
101 | 105 | ||
102 | /** | 106 | /** |
@@ -108,26 +112,23 @@ struct pl08x_txd { | |||
108 | struct dma_async_tx_descriptor tx; | 112 | struct dma_async_tx_descriptor tx; |
109 | struct list_head node; | 113 | struct list_head node; |
110 | enum dma_data_direction direction; | 114 | enum dma_data_direction direction; |
111 | struct pl08x_bus_data srcbus; | 115 | dma_addr_t src_addr; |
112 | struct pl08x_bus_data dstbus; | 116 | dma_addr_t dst_addr; |
113 | int len; | 117 | size_t len; |
114 | dma_addr_t llis_bus; | 118 | dma_addr_t llis_bus; |
115 | void *llis_va; | 119 | struct pl08x_lli *llis_va; |
116 | struct pl08x_channel_data *cd; | 120 | /* Default cctl value for LLIs */ |
117 | bool active; | 121 | u32 cctl; |
118 | /* | 122 | /* |
119 | * Settings to be put into the physical channel when we | 123 | * Settings to be put into the physical channel when we |
120 | * trigger this txd | 124 | * trigger this txd. Other registers are in llis_va[0]. |
121 | */ | 125 | */ |
122 | u32 csrc; | 126 | u32 ccfg; |
123 | u32 cdst; | ||
124 | u32 clli; | ||
125 | u32 cctl; | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | /** | 129 | /** |
129 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual | 130 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel |
130 | * channel states | 131 | * states |
131 | * @PL08X_CHAN_IDLE: the channel is idle | 132 | * @PL08X_CHAN_IDLE: the channel is idle |
132 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | 133 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport |
133 | * channel and is running a transfer on it | 134 | * channel and is running a transfer on it |
@@ -147,6 +148,8 @@ enum pl08x_dma_chan_state { | |||
147 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel | 148 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel |
148 | * @chan: wrappped abstract channel | 149 | * @chan: wrappped abstract channel |
149 | * @phychan: the physical channel utilized by this channel, if there is one | 150 | * @phychan: the physical channel utilized by this channel, if there is one |
151 | * @phychan_hold: if non-zero, hold on to the physical channel even if we | ||
152 | * have no pending entries | ||
150 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc | 153 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc |
151 | * @name: name of channel | 154 | * @name: name of channel |
152 | * @cd: channel platform data | 155 | * @cd: channel platform data |
@@ -154,53 +157,49 @@ enum pl08x_dma_chan_state { | |||
154 | * @runtime_direction: current direction of this channel according to | 157 | * @runtime_direction: current direction of this channel according to |
155 | * runtime config | 158 | * runtime config |
156 | * @lc: last completed transaction on this channel | 159 | * @lc: last completed transaction on this channel |
157 | * @desc_list: queued transactions pending on this channel | 160 | * @pend_list: queued transactions pending on this channel |
158 | * @at: active transaction on this channel | 161 | * @at: active transaction on this channel |
159 | * @lockflags: sometimes we let a lock last between two function calls, | ||
160 | * especially prep/submit, and then we need to store the IRQ flags | ||
161 | * in the channel state, here | ||
162 | * @lock: a lock for this channel data | 162 | * @lock: a lock for this channel data |
163 | * @host: a pointer to the host (internal use) | 163 | * @host: a pointer to the host (internal use) |
164 | * @state: whether the channel is idle, paused, running etc | 164 | * @state: whether the channel is idle, paused, running etc |
165 | * @slave: whether this channel is a device (slave) or for memcpy | 165 | * @slave: whether this channel is a device (slave) or for memcpy |
166 | * @waiting: a TX descriptor on this channel which is waiting for | 166 | * @waiting: a TX descriptor on this channel which is waiting for a physical |
167 | * a physical channel to become available | 167 | * channel to become available |
168 | */ | 168 | */ |
169 | struct pl08x_dma_chan { | 169 | struct pl08x_dma_chan { |
170 | struct dma_chan chan; | 170 | struct dma_chan chan; |
171 | struct pl08x_phy_chan *phychan; | 171 | struct pl08x_phy_chan *phychan; |
172 | int phychan_hold; | ||
172 | struct tasklet_struct tasklet; | 173 | struct tasklet_struct tasklet; |
173 | char *name; | 174 | char *name; |
174 | struct pl08x_channel_data *cd; | 175 | struct pl08x_channel_data *cd; |
175 | dma_addr_t runtime_addr; | 176 | dma_addr_t runtime_addr; |
176 | enum dma_data_direction runtime_direction; | 177 | enum dma_data_direction runtime_direction; |
177 | atomic_t last_issued; | ||
178 | dma_cookie_t lc; | 178 | dma_cookie_t lc; |
179 | struct list_head desc_list; | 179 | struct list_head pend_list; |
180 | struct pl08x_txd *at; | 180 | struct pl08x_txd *at; |
181 | unsigned long lockflags; | ||
182 | spinlock_t lock; | 181 | spinlock_t lock; |
183 | void *host; | 182 | struct pl08x_driver_data *host; |
184 | enum pl08x_dma_chan_state state; | 183 | enum pl08x_dma_chan_state state; |
185 | bool slave; | 184 | bool slave; |
186 | struct pl08x_txd *waiting; | 185 | struct pl08x_txd *waiting; |
187 | }; | 186 | }; |
188 | 187 | ||
189 | /** | 188 | /** |
190 | * struct pl08x_platform_data - the platform configuration for the | 189 | * struct pl08x_platform_data - the platform configuration for the PL08x |
191 | * PL08x PrimeCells. | 190 | * PrimeCells. |
192 | * @slave_channels: the channels defined for the different devices on the | 191 | * @slave_channels: the channels defined for the different devices on the |
193 | * platform, all inclusive, including multiplexed channels. The available | 192 | * platform, all inclusive, including multiplexed channels. The available |
194 | * physical channels will be multiplexed around these signals as they | 193 | * physical channels will be multiplexed around these signals as they are |
195 | * are requested, just enumerate all possible channels. | 194 | * requested, just enumerate all possible channels. |
196 | * @get_signal: request a physical signal to be used for a DMA | 195 | * @get_signal: request a physical signal to be used for a DMA transfer |
197 | * transfer immediately: if there is some multiplexing or similar blocking | 196 | * immediately: if there is some multiplexing or similar blocking the use |
198 | * the use of the channel the transfer can be denied by returning | 197 | * of the channel the transfer can be denied by returning less than zero, |
199 | * less than zero, else it returns the allocated signal number | 198 | * else it returns the allocated signal number |
200 | * @put_signal: indicate to the platform that this physical signal is not | 199 | * @put_signal: indicate to the platform that this physical signal is not |
201 | * running any DMA transfer and multiplexing can be recycled | 200 | * running any DMA transfer and multiplexing can be recycled |
202 | * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the | 201 | * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 |
203 | * LLI addresses are on 0/1 Master 1/2. | 202 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 |
204 | */ | 203 | */ |
205 | struct pl08x_platform_data { | 204 | struct pl08x_platform_data { |
206 | struct pl08x_channel_data *slave_channels; | 205 | struct pl08x_channel_data *slave_channels; |
@@ -208,6 +207,8 @@ struct pl08x_platform_data { | |||
208 | struct pl08x_channel_data memcpy_channel; | 207 | struct pl08x_channel_data memcpy_channel; |
209 | int (*get_signal)(struct pl08x_dma_chan *); | 208 | int (*get_signal)(struct pl08x_dma_chan *); |
210 | void (*put_signal)(struct pl08x_dma_chan *); | 209 | void (*put_signal)(struct pl08x_dma_chan *); |
210 | u8 lli_buses; | ||
211 | u8 mem_buses; | ||
211 | }; | 212 | }; |
212 | 213 | ||
213 | #ifdef CONFIG_AMBA_PL08X | 214 | #ifdef CONFIG_AMBA_PL08X |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 6021588ba0a8..5479fdc849e9 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -113,6 +113,21 @@ | |||
113 | #define UART01x_LCRH_PEN 0x02 | 113 | #define UART01x_LCRH_PEN 0x02 |
114 | #define UART01x_LCRH_BRK 0x01 | 114 | #define UART01x_LCRH_BRK 0x01 |
115 | 115 | ||
116 | #define ST_UART011_DMAWM_RX_1 (0 << 3) | ||
117 | #define ST_UART011_DMAWM_RX_2 (1 << 3) | ||
118 | #define ST_UART011_DMAWM_RX_4 (2 << 3) | ||
119 | #define ST_UART011_DMAWM_RX_8 (3 << 3) | ||
120 | #define ST_UART011_DMAWM_RX_16 (4 << 3) | ||
121 | #define ST_UART011_DMAWM_RX_32 (5 << 3) | ||
122 | #define ST_UART011_DMAWM_RX_48 (6 << 3) | ||
123 | #define ST_UART011_DMAWM_TX_1 0 | ||
124 | #define ST_UART011_DMAWM_TX_2 1 | ||
125 | #define ST_UART011_DMAWM_TX_4 2 | ||
126 | #define ST_UART011_DMAWM_TX_8 3 | ||
127 | #define ST_UART011_DMAWM_TX_16 4 | ||
128 | #define ST_UART011_DMAWM_TX_32 5 | ||
129 | #define ST_UART011_DMAWM_TX_48 6 | ||
130 | |||
116 | #define UART010_IIR_RTIS 0x08 | 131 | #define UART010_IIR_RTIS 0x08 |
117 | #define UART010_IIR_TIS 0x04 | 132 | #define UART010_IIR_TIS 0x04 |
118 | #define UART010_IIR_RIS 0x02 | 133 | #define UART010_IIR_RIS 0x02 |
@@ -180,6 +195,13 @@ struct amba_device; /* in uncompress this is included but amba/bus.h is not */ | |||
180 | struct amba_pl010_data { | 195 | struct amba_pl010_data { |
181 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); | 196 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); |
182 | }; | 197 | }; |
198 | |||
199 | struct dma_chan; | ||
200 | struct amba_pl011_data { | ||
201 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
202 | void *dma_rx_param; | ||
203 | void *dma_tx_param; | ||
204 | }; | ||
183 | #endif | 205 | #endif |
184 | 206 | ||
185 | #endif | 207 | #endif |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 8b5c0620abf9..359df0487690 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 8b49ac48a5b7..e02982fa2953 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #define AUTOFS_MIN_PROTO_VERSION 3 | 24 | #define AUTOFS_MIN_PROTO_VERSION 3 |
25 | #define AUTOFS_MAX_PROTO_VERSION 5 | 25 | #define AUTOFS_MAX_PROTO_VERSION 5 |
26 | 26 | ||
27 | #define AUTOFS_PROTO_SUBVERSION 1 | 27 | #define AUTOFS_PROTO_SUBVERSION 2 |
28 | 28 | ||
29 | /* Mask for expire behaviour */ | 29 | /* Mask for expire behaviour */ |
30 | #define AUTOFS_EXP_IMMEDIATE 1 | 30 | #define AUTOFS_EXP_IMMEDIATE 1 |
diff --git a/include/linux/average.h b/include/linux/average.h new file mode 100644 index 000000000000..c6028fd742c1 --- /dev/null +++ b/include/linux/average.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _LINUX_AVERAGE_H | ||
2 | #define _LINUX_AVERAGE_H | ||
3 | |||
4 | /* Exponentially weighted moving average (EWMA) */ | ||
5 | |||
6 | /* For more documentation see lib/average.c */ | ||
7 | |||
8 | struct ewma { | ||
9 | unsigned long internal; | ||
10 | unsigned long factor; | ||
11 | unsigned long weight; | ||
12 | }; | ||
13 | |||
14 | extern void ewma_init(struct ewma *avg, unsigned long factor, | ||
15 | unsigned long weight); | ||
16 | |||
17 | extern struct ewma *ewma_add(struct ewma *avg, unsigned long val); | ||
18 | |||
19 | /** | ||
20 | * ewma_read() - Get average value | ||
21 | * @avg: Average structure | ||
22 | * | ||
23 | * Returns the average value held in @avg. | ||
24 | */ | ||
25 | static inline unsigned long ewma_read(const struct ewma *avg) | ||
26 | { | ||
27 | return avg->internal >> avg->factor; | ||
28 | } | ||
29 | |||
30 | #endif /* _LINUX_AVERAGE_H */ | ||
diff --git a/include/linux/bfin_mac.h b/include/linux/bfin_mac.h index 904dec7d03a1..a69554ef8476 100644 --- a/include/linux/bfin_mac.h +++ b/include/linux/bfin_mac.h | |||
@@ -24,6 +24,7 @@ struct bfin_mii_bus_platform_data { | |||
24 | const unsigned short *mac_peripherals; | 24 | const unsigned short *mac_peripherals; |
25 | int phy_mode; | 25 | int phy_mode; |
26 | unsigned int phy_mask; | 26 | unsigned int phy_mask; |
27 | unsigned short vlan1_mask, vlan2_mask; | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | #endif | 30 | #endif |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 64a7114a9394..c3d6512eded1 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -25,7 +25,7 @@ struct pt_regs; | |||
25 | /* | 25 | /* |
26 | * This structure is used to hold the arguments that are used when loading binaries. | 26 | * This structure is used to hold the arguments that are used when loading binaries. |
27 | */ | 27 | */ |
28 | struct linux_binprm{ | 28 | struct linux_binprm { |
29 | char buf[BINPRM_BUF_SIZE]; | 29 | char buf[BINPRM_BUF_SIZE]; |
30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
31 | struct vm_area_struct *vma; | 31 | struct vm_area_struct *vma; |
@@ -93,7 +93,6 @@ struct linux_binfmt { | |||
93 | int (*load_shlib)(struct file *); | 93 | int (*load_shlib)(struct file *); |
94 | int (*core_dump)(struct coredump_params *cprm); | 94 | int (*core_dump)(struct coredump_params *cprm); |
95 | unsigned long min_coredump; /* minimal dump size */ | 95 | unsigned long min_coredump; /* minimal dump size */ |
96 | int hasvdso; | ||
97 | }; | 96 | }; |
98 | 97 | ||
99 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); | 98 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); |
@@ -113,7 +112,7 @@ extern void unregister_binfmt(struct linux_binfmt *); | |||
113 | 112 | ||
114 | extern int prepare_binprm(struct linux_binprm *); | 113 | extern int prepare_binprm(struct linux_binprm *); |
115 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 114 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
116 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 115 | extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); |
117 | extern int flush_old_exec(struct linux_binprm * bprm); | 116 | extern int flush_old_exec(struct linux_binprm * bprm); |
118 | extern void setup_new_exec(struct linux_binprm * bprm); | 117 | extern void setup_new_exec(struct linux_binprm * bprm); |
119 | 118 | ||
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h index 7113a32a86ea..e612575a2596 100644 --- a/include/linux/bit_spinlock.h +++ b/include/linux/bit_spinlock.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef __LINUX_BIT_SPINLOCK_H | 1 | #ifndef __LINUX_BIT_SPINLOCK_H |
2 | #define __LINUX_BIT_SPINLOCK_H | 2 | #define __LINUX_BIT_SPINLOCK_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | ||
5 | #include <linux/preempt.h> | ||
6 | #include <asm/atomic.h> | ||
7 | |||
4 | /* | 8 | /* |
5 | * bit-based spin_lock() | 9 | * bit-based spin_lock() |
6 | * | 10 | * |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 827cc95711ef..2184c6b97aeb 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -109,6 +109,17 @@ static inline __u8 ror8(__u8 word, unsigned int shift) | |||
109 | return (word >> shift) | (word << (8 - shift)); | 109 | return (word >> shift) | (word << (8 - shift)); |
110 | } | 110 | } |
111 | 111 | ||
112 | /** | ||
113 | * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit | ||
114 | * @value: value to sign extend | ||
115 | * @index: 0 based bit index (0<=index<32) to sign bit | ||
116 | */ | ||
117 | static inline __s32 sign_extend32(__u32 value, int index) | ||
118 | { | ||
119 | __u8 shift = 31 - index; | ||
120 | return (__s32)(value << shift) >> shift; | ||
121 | } | ||
122 | |||
112 | static inline unsigned fls_long(unsigned long l) | 123 | static inline unsigned fls_long(unsigned long l) |
113 | { | 124 | { |
114 | if (sizeof(l) == 4) | 125 | if (sizeof(l) == 4) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 12bb426949e9..e3ee74fc5903 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -121,6 +121,7 @@ struct request { | |||
121 | }; | 121 | }; |
122 | 122 | ||
123 | struct gendisk *rq_disk; | 123 | struct gendisk *rq_disk; |
124 | struct hd_struct *part; | ||
124 | unsigned long start_time; | 125 | unsigned long start_time; |
125 | #ifdef CONFIG_BLK_CGROUP | 126 | #ifdef CONFIG_BLK_CGROUP |
126 | unsigned long long start_time_ns; | 127 | unsigned long long start_time_ns; |
@@ -653,7 +654,6 @@ static inline void rq_flush_dcache_pages(struct request *rq) | |||
653 | 654 | ||
654 | extern int blk_register_queue(struct gendisk *disk); | 655 | extern int blk_register_queue(struct gendisk *disk); |
655 | extern void blk_unregister_queue(struct gendisk *disk); | 656 | extern void blk_unregister_queue(struct gendisk *disk); |
656 | extern void register_disk(struct gendisk *dev); | ||
657 | extern void generic_make_request(struct bio *bio); | 657 | extern void generic_make_request(struct bio *bio); |
658 | extern void blk_rq_init(struct request_queue *q, struct request *rq); | 658 | extern void blk_rq_init(struct request_queue *q, struct request *rq); |
659 | extern void blk_put_request(struct request *); | 659 | extern void blk_put_request(struct request *); |
@@ -1263,6 +1263,9 @@ struct block_device_operations { | |||
1263 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1263 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1264 | int (*direct_access) (struct block_device *, sector_t, | 1264 | int (*direct_access) (struct block_device *, sector_t, |
1265 | void **, unsigned long *); | 1265 | void **, unsigned long *); |
1266 | unsigned int (*check_events) (struct gendisk *disk, | ||
1267 | unsigned int clearing); | ||
1268 | /* ->media_changed() is DEPRECATED, use ->check_events() instead */ | ||
1266 | int (*media_changed) (struct gendisk *); | 1269 | int (*media_changed) (struct gendisk *); |
1267 | void (*unlock_native_capacity) (struct gendisk *); | 1270 | void (*unlock_native_capacity) (struct gendisk *); |
1268 | int (*revalidate_disk) (struct gendisk *); | 1271 | int (*revalidate_disk) (struct gendisk *); |
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild new file mode 100644 index 000000000000..a9cf250689dc --- /dev/null +++ b/include/linux/caif/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += caif_socket.h | ||
2 | header-y += if_caif.h | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 90012b9ddbf3..fb16a3699b99 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 f389e319a454..fb4591977b03 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -28,8 +28,6 @@ int cdev_add(struct cdev *, dev_t, unsigned); | |||
28 | 28 | ||
29 | void cdev_del(struct cdev *); | 29 | void cdev_del(struct cdev *); |
30 | 30 | ||
31 | int cdev_index(struct inode *inode); | ||
32 | |||
33 | void cd_forget(struct inode *); | 31 | void cd_forget(struct inode *); |
34 | 32 | ||
35 | extern struct backing_dev_info directly_mappable_cdev_bdi; | 33 | extern struct backing_dev_info directly_mappable_cdev_bdi; |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 78e904796622..35eae4b67503 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -946,6 +946,8 @@ struct cdrom_device_info { | |||
946 | /* device-related storage */ | 946 | /* device-related storage */ |
947 | unsigned int options : 30; /* options flags */ | 947 | unsigned int options : 30; /* options flags */ |
948 | unsigned mc_flags : 2; /* media change buffer flags */ | 948 | unsigned mc_flags : 2; /* media change buffer flags */ |
949 | unsigned int vfs_events; /* cached events for vfs path */ | ||
950 | unsigned int ioctl_events; /* cached events for ioctl path */ | ||
949 | int use_count; /* number of times device opened */ | 951 | int use_count; /* number of times device opened */ |
950 | char name[20]; /* name of the device type */ | 952 | char name[20]; /* name of the device type */ |
951 | /* per-device flags */ | 953 | /* per-device flags */ |
@@ -965,6 +967,8 @@ struct cdrom_device_ops { | |||
965 | int (*open) (struct cdrom_device_info *, int); | 967 | int (*open) (struct cdrom_device_info *, int); |
966 | void (*release) (struct cdrom_device_info *); | 968 | void (*release) (struct cdrom_device_info *); |
967 | int (*drive_status) (struct cdrom_device_info *, int); | 969 | int (*drive_status) (struct cdrom_device_info *, int); |
970 | unsigned int (*check_events) (struct cdrom_device_info *cdi, | ||
971 | unsigned int clearing, int slot); | ||
968 | int (*media_changed) (struct cdrom_device_info *, int); | 972 | int (*media_changed) (struct cdrom_device_info *, int); |
969 | int (*tray_move) (struct cdrom_device_info *, int); | 973 | int (*tray_move) (struct cdrom_device_info *, int); |
970 | int (*lock_door) (struct cdrom_device_info *, int); | 974 | int (*lock_door) (struct cdrom_device_info *, int); |
@@ -993,6 +997,8 @@ extern int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, | |||
993 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); | 997 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); |
994 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, | 998 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, |
995 | fmode_t mode, unsigned int cmd, unsigned long arg); | 999 | fmode_t mode, unsigned int cmd, unsigned long arg); |
1000 | extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi, | ||
1001 | unsigned int clearing); | ||
996 | extern int cdrom_media_changed(struct cdrom_device_info *); | 1002 | extern int cdrom_media_changed(struct cdrom_device_info *); |
997 | 1003 | ||
998 | extern int register_cdrom(struct cdrom_device_info *cdi); | 1004 | extern int register_cdrom(struct cdrom_device_info *cdi); |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index c3c74aef289d..09dcc0c2ffd5 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -43,6 +43,10 @@ | |||
43 | #define CEPH_FEATURE_NOSRCADDR (1<<1) | 43 | #define CEPH_FEATURE_NOSRCADDR (1<<1) |
44 | #define CEPH_FEATURE_MONCLOCKCHECK (1<<2) | 44 | #define CEPH_FEATURE_MONCLOCKCHECK (1<<2) |
45 | #define CEPH_FEATURE_FLOCK (1<<3) | 45 | #define CEPH_FEATURE_FLOCK (1<<3) |
46 | #define CEPH_FEATURE_SUBSCRIBE2 (1<<4) | ||
47 | #define CEPH_FEATURE_MONNAMES (1<<5) | ||
48 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) | ||
49 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) | ||
46 | 50 | ||
47 | 51 | ||
48 | /* | 52 | /* |
@@ -55,10 +59,10 @@ struct ceph_file_layout { | |||
55 | __le32 fl_stripe_count; /* over this many objects */ | 59 | __le32 fl_stripe_count; /* over this many objects */ |
56 | __le32 fl_object_size; /* until objects are this big, then move to | 60 | __le32 fl_object_size; /* until objects are this big, then move to |
57 | new objects */ | 61 | new objects */ |
58 | __le32 fl_cas_hash; /* 0 = none; 1 = sha256 */ | 62 | __le32 fl_cas_hash; /* UNUSED. 0 = none; 1 = sha256 */ |
59 | 63 | ||
60 | /* pg -> disk layout */ | 64 | /* pg -> disk layout */ |
61 | __le32 fl_object_stripe_unit; /* for per-object parity, if any */ | 65 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ |
62 | 66 | ||
63 | /* object -> pg layout */ | 67 | /* object -> pg layout */ |
64 | __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ | 68 | __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ |
@@ -69,6 +73,12 @@ struct ceph_file_layout { | |||
69 | 73 | ||
70 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); | 74 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); |
71 | 75 | ||
76 | struct ceph_dir_layout { | ||
77 | __u8 dl_dir_hash; /* see ceph_hash.h for ids */ | ||
78 | __u8 dl_unused1; | ||
79 | __u16 dl_unused2; | ||
80 | __u32 dl_unused3; | ||
81 | } __attribute__ ((packed)); | ||
72 | 82 | ||
73 | /* crypto algorithms */ | 83 | /* crypto algorithms */ |
74 | #define CEPH_CRYPTO_NONE 0x0 | 84 | #define CEPH_CRYPTO_NONE 0x0 |
@@ -457,7 +467,7 @@ struct ceph_mds_reply_inode { | |||
457 | struct ceph_timespec rctime; | 467 | struct ceph_timespec rctime; |
458 | struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */ | 468 | struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */ |
459 | } __attribute__ ((packed)); | 469 | } __attribute__ ((packed)); |
460 | /* followed by frag array, then symlink string, then xattr blob */ | 470 | /* followed by frag array, symlink string, dir layout, xattr blob */ |
461 | 471 | ||
462 | /* reply_lease follows dname, and reply_inode */ | 472 | /* reply_lease follows dname, and reply_inode */ |
463 | struct ceph_mds_reply_lease { | 473 | struct ceph_mds_reply_lease { |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index a108b425fee2..c3011beac30d 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -110,17 +110,12 @@ struct ceph_msg_pos { | |||
110 | 110 | ||
111 | /* | 111 | /* |
112 | * ceph_connection state bit flags | 112 | * ceph_connection state bit flags |
113 | * | ||
114 | * QUEUED and BUSY are used together to ensure that only a single | ||
115 | * thread is currently opening, reading or writing data to the socket. | ||
116 | */ | 113 | */ |
117 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ | 114 | #define LOSSYTX 0 /* we can close channel or drop messages on errors */ |
118 | #define CONNECTING 1 | 115 | #define CONNECTING 1 |
119 | #define NEGOTIATING 2 | 116 | #define NEGOTIATING 2 |
120 | #define KEEPALIVE_PENDING 3 | 117 | #define KEEPALIVE_PENDING 3 |
121 | #define WRITE_PENDING 4 /* we have data ready to send */ | 118 | #define WRITE_PENDING 4 /* we have data ready to send */ |
122 | #define QUEUED 5 /* there is work queued on this connection */ | ||
123 | #define BUSY 6 /* work is being done */ | ||
124 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep | 119 | #define STANDBY 8 /* no outgoing messages, socket closed. we keep |
125 | * the ceph_connection around to maintain shared | 120 | * the ceph_connection around to maintain shared |
126 | * state with the peer. */ | 121 | * state with the peer. */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed4ba111bc8d..ce104e33cd22 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -564,7 +564,7 @@ struct cgroup_iter { | |||
564 | /* | 564 | /* |
565 | * To iterate across the tasks in a cgroup: | 565 | * To iterate across the tasks in a cgroup: |
566 | * | 566 | * |
567 | * 1) call cgroup_iter_start to intialize an iterator | 567 | * 1) call cgroup_iter_start to initialize an iterator |
568 | * | 568 | * |
569 | * 2) call cgroup_iter_next() to retrieve member tasks until it | 569 | * 2) call cgroup_iter_next() to retrieve member tasks until it |
570 | * returns NULL or until you want to end the iteration | 570 | * returns NULL or until you want to end the iteration |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h new file mode 100644 index 000000000000..457bcb0a310a --- /dev/null +++ b/include/linux/clkdev.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * include/linux/clkdev.h | ||
3 | * | ||
4 | * Copyright (C) 2008 Russell King. | ||
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 | * Helper for the clk API to assist looking up a struct clk. | ||
11 | */ | ||
12 | #ifndef __CLKDEV_H | ||
13 | #define __CLKDEV_H | ||
14 | |||
15 | #include <asm/clkdev.h> | ||
16 | |||
17 | struct clk; | ||
18 | struct device; | ||
19 | |||
20 | struct clk_lookup { | ||
21 | struct list_head node; | ||
22 | const char *dev_id; | ||
23 | const char *con_id; | ||
24 | struct clk *clk; | ||
25 | }; | ||
26 | |||
27 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | ||
28 | const char *dev_fmt, ...); | ||
29 | |||
30 | void clkdev_add(struct clk_lookup *cl); | ||
31 | void clkdev_drop(struct clk_lookup *cl); | ||
32 | |||
33 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
34 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h deleted file mode 100644 index c910b5eb1ceb..000000000000 --- a/include/linux/coda_cache.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* Coda filesystem -- Linux Minicache | ||
2 | * | ||
3 | * Copyright (C) 1989 - 1997 Carnegie Mellon University | ||
4 | * | ||
5 | * Carnegie Mellon University encourages users of this software to | ||
6 | * contribute improvements to the Coda project. Contact Peter Braam | ||
7 | * <coda@cs.cmu.edu> | ||
8 | */ | ||
9 | |||
10 | #ifndef _CFSNC_HEADER_ | ||
11 | #define _CFSNC_HEADER_ | ||
12 | |||
13 | /* credential cache */ | ||
14 | void coda_cache_enter(struct inode *inode, int mask); | ||
15 | void coda_cache_clear_inode(struct inode *); | ||
16 | void coda_cache_clear_all(struct super_block *sb); | ||
17 | int coda_cache_check(struct inode *inode, int mask); | ||
18 | |||
19 | /* for downcalls and attributes and lookups */ | ||
20 | void coda_flag_inode_children(struct inode *inode, int flag); | ||
21 | |||
22 | #endif /* _CFSNC_HEADER_ */ | ||
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h deleted file mode 100644 index e35071b1de0e..000000000000 --- a/include/linux/coda_fs_i.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * coda_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1998 Carnegie Mellon University | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_CODA_FS_I | ||
9 | #define _LINUX_CODA_FS_I | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/list.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/coda.h> | ||
15 | |||
16 | /* | ||
17 | * coda fs inode data | ||
18 | * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and | ||
19 | * c_cached_perm. | ||
20 | * vfs_inode is set only when the inode is created and never changes. | ||
21 | * c_fid is set when the inode is created and should be considered immutable. | ||
22 | */ | ||
23 | struct coda_inode_info { | ||
24 | struct CodaFid c_fid; /* Coda identifier */ | ||
25 | u_short c_flags; /* flags (see below) */ | ||
26 | unsigned int c_mapcount; /* nr of times this inode is mapped */ | ||
27 | unsigned int c_cached_epoch; /* epoch for cached permissions */ | ||
28 | vuid_t c_uid; /* fsuid for cached permissions */ | ||
29 | unsigned int c_cached_perm; /* cached access permissions */ | ||
30 | spinlock_t c_lock; | ||
31 | struct inode vfs_inode; | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * coda fs file private data | ||
36 | */ | ||
37 | #define CODA_MAGIC 0xC0DAC0DA | ||
38 | struct coda_file_info { | ||
39 | int cfi_magic; /* magic number */ | ||
40 | struct file *cfi_container; /* container file for this cnode */ | ||
41 | unsigned int cfi_mapcount; /* nr of times this file is mapped */ | ||
42 | }; | ||
43 | |||
44 | #define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data)) | ||
45 | |||
46 | /* flags */ | ||
47 | #define C_VATTR 0x1 /* Validity of vattr in inode */ | ||
48 | #define C_FLUSH 0x2 /* used after a flush */ | ||
49 | #define C_DYING 0x4 /* from venus (which died) */ | ||
50 | #define C_PURGE 0x8 | ||
51 | |||
52 | int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *); | ||
53 | struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr); | ||
54 | int coda_cnode_makectl(struct inode **inode, struct super_block *sb); | ||
55 | struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb); | ||
56 | void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *); | ||
57 | |||
58 | #endif | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h deleted file mode 100644 index 2e914d0771b9..000000000000 --- a/include/linux/coda_linux.h +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * Coda File System, Linux Kernel module | ||
3 | * | ||
4 | * Original version, adapted from cfs_mach.c, (C) Carnegie Mellon University | ||
5 | * Linux modifications (C) 1996, Peter J. Braam | ||
6 | * Rewritten for Linux 2.1 (C) 1997 Carnegie Mellon University | ||
7 | * | ||
8 | * Carnegie Mellon University encourages users of this software to | ||
9 | * contribute improvements to the Coda project. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_CODA_FS | ||
13 | #define _LINUX_CODA_FS | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/param.h> | ||
17 | #include <linux/mm.h> | ||
18 | #include <linux/vmalloc.h> | ||
19 | #include <linux/slab.h> | ||
20 | #include <linux/wait.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/fs.h> | ||
23 | #include <linux/coda_fs_i.h> | ||
24 | |||
25 | /* operations */ | ||
26 | extern const struct inode_operations coda_dir_inode_operations; | ||
27 | extern const struct inode_operations coda_file_inode_operations; | ||
28 | extern const struct inode_operations coda_ioctl_inode_operations; | ||
29 | |||
30 | extern const struct address_space_operations coda_file_aops; | ||
31 | extern const struct address_space_operations coda_symlink_aops; | ||
32 | |||
33 | extern const struct file_operations coda_dir_operations; | ||
34 | extern const struct file_operations coda_file_operations; | ||
35 | extern const struct file_operations coda_ioctl_operations; | ||
36 | |||
37 | /* operations shared over more than one file */ | ||
38 | int coda_open(struct inode *i, struct file *f); | ||
39 | int coda_release(struct inode *i, struct file *f); | ||
40 | int coda_permission(struct inode *inode, int mask); | ||
41 | int coda_revalidate_inode(struct dentry *); | ||
42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | ||
43 | int coda_setattr(struct dentry *, struct iattr *); | ||
44 | |||
45 | /* this file: heloers */ | ||
46 | char *coda_f2s(struct CodaFid *f); | ||
47 | int coda_isroot(struct inode *i); | ||
48 | int coda_iscontrol(const char *name, size_t length); | ||
49 | |||
50 | void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); | ||
51 | void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); | ||
52 | unsigned short coda_flags_to_cflags(unsigned short); | ||
53 | |||
54 | /* sysctl.h */ | ||
55 | void coda_sysctl_init(void); | ||
56 | void coda_sysctl_clean(void); | ||
57 | |||
58 | #define CODA_ALLOC(ptr, cast, size) do { \ | ||
59 | if (size < PAGE_SIZE) \ | ||
60 | ptr = kmalloc((unsigned long) size, GFP_KERNEL); \ | ||
61 | else \ | ||
62 | ptr = (cast)vmalloc((unsigned long) size); \ | ||
63 | if (!ptr) \ | ||
64 | printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ | ||
65 | else memset( ptr, 0, size ); \ | ||
66 | } while (0) | ||
67 | |||
68 | |||
69 | #define CODA_FREE(ptr,size) \ | ||
70 | do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0) | ||
71 | |||
72 | /* inode to cnode access functions */ | ||
73 | |||
74 | static inline struct coda_inode_info *ITOC(struct inode *inode) | ||
75 | { | ||
76 | return list_entry(inode, struct coda_inode_info, vfs_inode); | ||
77 | } | ||
78 | |||
79 | static __inline__ struct CodaFid *coda_i2f(struct inode *inode) | ||
80 | { | ||
81 | return &(ITOC(inode)->c_fid); | ||
82 | } | ||
83 | |||
84 | static __inline__ char *coda_i2s(struct inode *inode) | ||
85 | { | ||
86 | return coda_f2s(&(ITOC(inode)->c_fid)); | ||
87 | } | ||
88 | |||
89 | /* this will not zap the inode away */ | ||
90 | static __inline__ void coda_flag_inode(struct inode *inode, int flag) | ||
91 | { | ||
92 | struct coda_inode_info *cii = ITOC(inode); | ||
93 | |||
94 | spin_lock(&cii->c_lock); | ||
95 | cii->c_flags |= flag; | ||
96 | spin_unlock(&cii->c_lock); | ||
97 | } | ||
98 | |||
99 | #endif | ||
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 5ac51552d908..dfa2ed4c0d26 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -11,6 +11,9 @@ | |||
11 | /* The full zone was compacted */ | 11 | /* The full zone was compacted */ |
12 | #define COMPACT_COMPLETE 3 | 12 | #define COMPACT_COMPLETE 3 |
13 | 13 | ||
14 | #define COMPACT_MODE_DIRECT_RECLAIM 0 | ||
15 | #define COMPACT_MODE_KSWAPD 1 | ||
16 | |||
14 | #ifdef CONFIG_COMPACTION | 17 | #ifdef CONFIG_COMPACTION |
15 | extern int sysctl_compact_memory; | 18 | extern int sysctl_compact_memory; |
16 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 19 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
@@ -21,7 +24,12 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
21 | 24 | ||
22 | extern int fragmentation_index(struct zone *zone, unsigned int order); | 25 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 26 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
24 | int order, gfp_t gfp_mask, nodemask_t *mask); | 27 | int order, gfp_t gfp_mask, nodemask_t *mask, |
28 | bool sync); | ||
29 | extern unsigned long compaction_suitable(struct zone *zone, int order); | ||
30 | extern unsigned long compact_zone_order(struct zone *zone, int order, | ||
31 | gfp_t gfp_mask, bool sync, | ||
32 | int compact_mode); | ||
25 | 33 | ||
26 | /* Do not skip compaction more than 64 times */ | 34 | /* Do not skip compaction more than 64 times */ |
27 | #define COMPACT_MAX_DEFER_SHIFT 6 | 35 | #define COMPACT_MAX_DEFER_SHIFT 6 |
@@ -54,7 +62,20 @@ static inline bool compaction_deferred(struct zone *zone) | |||
54 | 62 | ||
55 | #else | 63 | #else |
56 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 64 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, |
57 | int order, gfp_t gfp_mask, nodemask_t *nodemask) | 65 | int order, gfp_t gfp_mask, nodemask_t *nodemask, |
66 | bool sync) | ||
67 | { | ||
68 | return COMPACT_CONTINUE; | ||
69 | } | ||
70 | |||
71 | static inline unsigned long compaction_suitable(struct zone *zone, int order) | ||
72 | { | ||
73 | return COMPACT_SKIPPED; | ||
74 | } | ||
75 | |||
76 | static inline unsigned long compact_zone_order(struct zone *zone, int order, | ||
77 | gfp_t gfp_mask, bool sync, | ||
78 | int compact_mode) | ||
58 | { | 79 | { |
59 | return COMPACT_CONTINUE; | 80 | return COMPACT_CONTINUE; |
60 | } | 81 | } |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 36d57f74cd01..51494e6b5548 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -81,10 +81,10 @@ extern int wait_for_completion_interruptible(struct completion *x); | |||
81 | extern int wait_for_completion_killable(struct completion *x); | 81 | extern int wait_for_completion_killable(struct completion *x); |
82 | extern unsigned long wait_for_completion_timeout(struct completion *x, | 82 | extern unsigned long wait_for_completion_timeout(struct completion *x, |
83 | unsigned long timeout); | 83 | unsigned long timeout); |
84 | extern unsigned long wait_for_completion_interruptible_timeout( | 84 | extern long wait_for_completion_interruptible_timeout( |
85 | struct completion *x, unsigned long timeout); | 85 | struct completion *x, unsigned long timeout); |
86 | extern unsigned long wait_for_completion_killable_timeout( | 86 | extern long wait_for_completion_killable_timeout( |
87 | struct completion *x, unsigned long timeout); | 87 | struct completion *x, unsigned long timeout); |
88 | extern bool try_wait_for_completion(struct completion *x); | 88 | extern bool try_wait_for_completion(struct completion *x); |
89 | extern bool completion_done(struct completion *x); | 89 | extern bool completion_done(struct completion *x); |
90 | 90 | ||
diff --git a/include/linux/console.h b/include/linux/console.h index 95cf6f08a59d..7453cfd593c8 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -126,6 +126,12 @@ struct console { | |||
126 | struct console *next; | 126 | struct console *next; |
127 | }; | 127 | }; |
128 | 128 | ||
129 | /* | ||
130 | * for_each_console() allows you to iterate on each console | ||
131 | */ | ||
132 | #define for_each_console(con) \ | ||
133 | for (con = console_drivers; con != NULL; con = con->next) | ||
134 | |||
129 | extern int console_set_on_cmdline; | 135 | extern int console_set_on_cmdline; |
130 | 136 | ||
131 | extern int add_preferred_console(char *name, int idx, char *options); | 137 | extern int add_preferred_console(char *name, int idx, char *options); |
@@ -133,9 +139,9 @@ extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_n | |||
133 | extern void register_console(struct console *); | 139 | extern void register_console(struct console *); |
134 | extern int unregister_console(struct console *); | 140 | extern int unregister_console(struct console *); |
135 | extern struct console *console_drivers; | 141 | extern struct console *console_drivers; |
136 | extern void acquire_console_sem(void); | 142 | extern void console_lock(void); |
137 | extern int try_acquire_console_sem(void); | 143 | extern int console_trylock(void); |
138 | extern void release_console_sem(void); | 144 | extern void console_unlock(void); |
139 | extern void console_conditional_schedule(void); | 145 | extern void console_conditional_schedule(void); |
140 | extern void console_unblank(void); | 146 | extern void console_unblank(void); |
141 | extern struct tty_driver *console_device(int *); | 147 | extern struct tty_driver *console_device(int *); |
@@ -145,7 +151,7 @@ extern int is_console_locked(void); | |||
145 | extern int braille_register_console(struct console *, int index, | 151 | extern int braille_register_console(struct console *, int index, |
146 | char *console_options, char *braille_options); | 152 | char *console_options, char *braille_options); |
147 | extern int braille_unregister_console(struct console *); | 153 | extern int braille_unregister_console(struct console *); |
148 | 154 | extern void console_sysfs_notify(void); | |
149 | extern int console_suspend_enabled; | 155 | extern int console_suspend_enabled; |
150 | 156 | ||
151 | /* Suspend and resume console messages over PM events */ | 157 | /* Suspend and resume console messages over PM events */ |
diff --git a/include/linux/cper.h b/include/linux/cper.h index bf972f81e2a7..3104aaff5dd0 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -39,10 +39,12 @@ | |||
39 | * Severity difinition for error_severity in struct cper_record_header | 39 | * Severity difinition for error_severity in struct cper_record_header |
40 | * and section_severity in struct cper_section_descriptor | 40 | * and section_severity in struct cper_section_descriptor |
41 | */ | 41 | */ |
42 | #define CPER_SEV_RECOVERABLE 0x0 | 42 | enum { |
43 | #define CPER_SEV_FATAL 0x1 | 43 | CPER_SEV_RECOVERABLE, |
44 | #define CPER_SEV_CORRECTED 0x2 | 44 | CPER_SEV_FATAL, |
45 | #define CPER_SEV_INFORMATIONAL 0x3 | 45 | CPER_SEV_CORRECTED, |
46 | CPER_SEV_INFORMATIONAL, | ||
47 | }; | ||
46 | 48 | ||
47 | /* | 49 | /* |
48 | * Validation bits difinition for validation_bits in struct | 50 | * Validation bits difinition for validation_bits in struct |
@@ -201,6 +203,47 @@ | |||
201 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ | 203 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ |
202 | 0xDF, 0xAA, 0x84, 0xEC) | 204 | 0xDF, 0xAA, 0x84, 0xEC) |
203 | 205 | ||
206 | #define CPER_PROC_VALID_TYPE 0x0001 | ||
207 | #define CPER_PROC_VALID_ISA 0x0002 | ||
208 | #define CPER_PROC_VALID_ERROR_TYPE 0x0004 | ||
209 | #define CPER_PROC_VALID_OPERATION 0x0008 | ||
210 | #define CPER_PROC_VALID_FLAGS 0x0010 | ||
211 | #define CPER_PROC_VALID_LEVEL 0x0020 | ||
212 | #define CPER_PROC_VALID_VERSION 0x0040 | ||
213 | #define CPER_PROC_VALID_BRAND_INFO 0x0080 | ||
214 | #define CPER_PROC_VALID_ID 0x0100 | ||
215 | #define CPER_PROC_VALID_TARGET_ADDRESS 0x0200 | ||
216 | #define CPER_PROC_VALID_REQUESTOR_ID 0x0400 | ||
217 | #define CPER_PROC_VALID_RESPONDER_ID 0x0800 | ||
218 | #define CPER_PROC_VALID_IP 0x1000 | ||
219 | |||
220 | #define CPER_MEM_VALID_ERROR_STATUS 0x0001 | ||
221 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002 | ||
222 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004 | ||
223 | #define CPER_MEM_VALID_NODE 0x0008 | ||
224 | #define CPER_MEM_VALID_CARD 0x0010 | ||
225 | #define CPER_MEM_VALID_MODULE 0x0020 | ||
226 | #define CPER_MEM_VALID_BANK 0x0040 | ||
227 | #define CPER_MEM_VALID_DEVICE 0x0080 | ||
228 | #define CPER_MEM_VALID_ROW 0x0100 | ||
229 | #define CPER_MEM_VALID_COLUMN 0x0200 | ||
230 | #define CPER_MEM_VALID_BIT_POSITION 0x0400 | ||
231 | #define CPER_MEM_VALID_REQUESTOR_ID 0x0800 | ||
232 | #define CPER_MEM_VALID_RESPONDER_ID 0x1000 | ||
233 | #define CPER_MEM_VALID_TARGET_ID 0x2000 | ||
234 | #define CPER_MEM_VALID_ERROR_TYPE 0x4000 | ||
235 | |||
236 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 | ||
237 | #define CPER_PCIE_VALID_VERSION 0x0002 | ||
238 | #define CPER_PCIE_VALID_COMMAND_STATUS 0x0004 | ||
239 | #define CPER_PCIE_VALID_DEVICE_ID 0x0008 | ||
240 | #define CPER_PCIE_VALID_SERIAL_NUMBER 0x0010 | ||
241 | #define CPER_PCIE_VALID_BRIDGE_CONTROL_STATUS 0x0020 | ||
242 | #define CPER_PCIE_VALID_CAPABILITY 0x0040 | ||
243 | #define CPER_PCIE_VALID_AER_INFO 0x0080 | ||
244 | |||
245 | #define CPER_PCIE_SLOT_SHIFT 3 | ||
246 | |||
204 | /* | 247 | /* |
205 | * All tables and structs must be byte-packed to match CPER | 248 | * All tables and structs must be byte-packed to match CPER |
206 | * specification, since the tables are provided by the system BIOS | 249 | * specification, since the tables are provided by the system BIOS |
@@ -306,6 +349,41 @@ struct cper_sec_mem_err { | |||
306 | __u8 error_type; | 349 | __u8 error_type; |
307 | }; | 350 | }; |
308 | 351 | ||
352 | struct cper_sec_pcie { | ||
353 | __u64 validation_bits; | ||
354 | __u32 port_type; | ||
355 | struct { | ||
356 | __u8 minor; | ||
357 | __u8 major; | ||
358 | __u8 reserved[2]; | ||
359 | } version; | ||
360 | __u16 command; | ||
361 | __u16 status; | ||
362 | __u32 reserved; | ||
363 | struct { | ||
364 | __u16 vendor_id; | ||
365 | __u16 device_id; | ||
366 | __u8 class_code[3]; | ||
367 | __u8 function; | ||
368 | __u8 device; | ||
369 | __u16 segment; | ||
370 | __u8 bus; | ||
371 | __u8 secondary_bus; | ||
372 | __u16 slot; | ||
373 | __u8 reserved; | ||
374 | } device_id; | ||
375 | struct { | ||
376 | __u32 lower; | ||
377 | __u32 upper; | ||
378 | } serial_number; | ||
379 | struct { | ||
380 | __u16 secondary_status; | ||
381 | __u16 control; | ||
382 | } bridge; | ||
383 | __u8 capability[60]; | ||
384 | __u8 aer_info[96]; | ||
385 | }; | ||
386 | |||
309 | /* Reset to default packing */ | 387 | /* Reset to default packing */ |
310 | #pragma pack() | 388 | #pragma pack() |
311 | 389 | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 1be416bbbb82..36719ead50e8 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -47,13 +47,7 @@ struct cpuidle_state { | |||
47 | 47 | ||
48 | /* Idle State Flags */ | 48 | /* Idle State Flags */ |
49 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | 49 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ |
50 | #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ | ||
51 | #define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */ | ||
52 | #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ | ||
53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ | ||
54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ | ||
55 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ | 50 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ |
56 | #define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */ | ||
57 | 51 | ||
58 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 52 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
59 | 53 | ||
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index 6fc2bed368b8..0e7bf272ec2f 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
@@ -84,9 +84,11 @@ struct cramfs_super { | |||
84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ | 84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ |
85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) | 85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) |
86 | 86 | ||
87 | #ifdef __KERNEL__ | ||
87 | /* Uncompression interfaces to the underlying zlib */ | 88 | /* Uncompression interfaces to the underlying zlib */ |
88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); | 89 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); |
89 | int cramfs_uncompress_init(void); | 90 | int cramfs_uncompress_init(void); |
90 | void cramfs_uncompress_exit(void); | 91 | void cramfs_uncompress_exit(void); |
92 | #endif /* __KERNEL__ */ | ||
91 | 93 | ||
92 | #endif | 94 | #endif |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 0026f267da20..088cd4ace4ef 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -20,7 +20,14 @@ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | |||
20 | #define vmcore_elf_check_arch_cross(x) 0 | 20 | #define vmcore_elf_check_arch_cross(x) 0 |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | 23 | /* |
24 | * Architecture code can redefine this if there are any special checks | ||
25 | * needed for 64-bit ELF vmcores. In case of 32-bit only architecture, | ||
26 | * this can be set to zero. | ||
27 | */ | ||
28 | #ifndef vmcore_elf64_check_arch | ||
29 | #define vmcore_elf64_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | ||
30 | #endif | ||
24 | 31 | ||
25 | /* | 32 | /* |
26 | * is_kdump_kernel() checks whether this kernel is booting after a panic of | 33 | * is_kdump_kernel() checks whether this kernel is booting after a panic of |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h index d5a1d4810b80..6fe2114f8ad2 100644 --- a/include/linux/cs5535.h +++ b/include/linux/cs5535.h | |||
@@ -103,14 +103,20 @@ static inline int cs5535_has_vsa2(void) | |||
103 | #define GPIO_POSITIVE_EDGE_STS 0x48 | 103 | #define GPIO_POSITIVE_EDGE_STS 0x48 |
104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C | 104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C |
105 | 105 | ||
106 | #define GPIO_FLTR7_AMOUNT 0xD8 | ||
107 | |||
106 | #define GPIO_MAP_X 0xE0 | 108 | #define GPIO_MAP_X 0xE0 |
107 | #define GPIO_MAP_Y 0xE4 | 109 | #define GPIO_MAP_Y 0xE4 |
108 | #define GPIO_MAP_Z 0xE8 | 110 | #define GPIO_MAP_Z 0xE8 |
109 | #define GPIO_MAP_W 0xEC | 111 | #define GPIO_MAP_W 0xEC |
110 | 112 | ||
113 | #define GPIO_FE7_SEL 0xF7 | ||
114 | |||
111 | void cs5535_gpio_set(unsigned offset, unsigned int reg); | 115 | void cs5535_gpio_set(unsigned offset, unsigned int reg); |
112 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); | 116 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); |
113 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); | 117 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); |
118 | int cs5535_gpio_set_irq(unsigned group, unsigned irq); | ||
119 | void cs5535_gpio_setup_event(unsigned offset, int pair, int pme); | ||
114 | 120 | ||
115 | /* MFGPTs */ | 121 | /* MFGPTs */ |
116 | 122 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6a4aea30aa09..f958c19e3ca5 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <asm/atomic.h> | 4 | #include <asm/atomic.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/rculist.h> | 6 | #include <linux/rculist.h> |
7 | #include <linux/rculist_bl.h> | ||
7 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
9 | #include <linux/seqlock.h> | ||
8 | #include <linux/cache.h> | 10 | #include <linux/cache.h> |
9 | #include <linux/rcupdate.h> | 11 | #include <linux/rcupdate.h> |
10 | 12 | ||
@@ -45,6 +47,27 @@ struct dentry_stat_t { | |||
45 | }; | 47 | }; |
46 | extern struct dentry_stat_t dentry_stat; | 48 | extern struct dentry_stat_t dentry_stat; |
47 | 49 | ||
50 | /* | ||
51 | * Compare 2 name strings, return 0 if they match, otherwise non-zero. | ||
52 | * The strings are both count bytes long, and count is non-zero. | ||
53 | */ | ||
54 | static inline int dentry_cmp(const unsigned char *cs, size_t scount, | ||
55 | const unsigned char *ct, size_t tcount) | ||
56 | { | ||
57 | int ret; | ||
58 | if (scount != tcount) | ||
59 | return 1; | ||
60 | do { | ||
61 | ret = (*cs != *ct); | ||
62 | if (ret) | ||
63 | break; | ||
64 | cs++; | ||
65 | ct++; | ||
66 | tcount--; | ||
67 | } while (tcount); | ||
68 | return ret; | ||
69 | } | ||
70 | |||
48 | /* Name hashing routines. Initial hash value */ | 71 | /* Name hashing routines. Initial hash value */ |
49 | /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */ | 72 | /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */ |
50 | #define init_name_hash() 0 | 73 | #define init_name_hash() 0 |
@@ -81,25 +104,33 @@ full_name_hash(const unsigned char *name, unsigned int len) | |||
81 | * large memory footprint increase). | 104 | * large memory footprint increase). |
82 | */ | 105 | */ |
83 | #ifdef CONFIG_64BIT | 106 | #ifdef CONFIG_64BIT |
84 | #define DNAME_INLINE_LEN_MIN 32 /* 192 bytes */ | 107 | # define DNAME_INLINE_LEN 32 /* 192 bytes */ |
85 | #else | 108 | #else |
86 | #define DNAME_INLINE_LEN_MIN 40 /* 128 bytes */ | 109 | # ifdef CONFIG_SMP |
110 | # define DNAME_INLINE_LEN 36 /* 128 bytes */ | ||
111 | # else | ||
112 | # define DNAME_INLINE_LEN 40 /* 128 bytes */ | ||
113 | # endif | ||
87 | #endif | 114 | #endif |
88 | 115 | ||
89 | struct dentry { | 116 | struct dentry { |
90 | atomic_t d_count; | 117 | /* RCU lookup touched fields */ |
91 | unsigned int d_flags; /* protected by d_lock */ | 118 | unsigned int d_flags; /* protected by d_lock */ |
92 | spinlock_t d_lock; /* per dentry lock */ | 119 | seqcount_t d_seq; /* per dentry seqlock */ |
93 | int d_mounted; | 120 | struct hlist_bl_node d_hash; /* lookup hash list */ |
94 | struct inode *d_inode; /* Where the name belongs to - NULL is | ||
95 | * negative */ | ||
96 | /* | ||
97 | * The next three fields are touched by __d_lookup. Place them here | ||
98 | * so they all fit in a cache line. | ||
99 | */ | ||
100 | struct hlist_node d_hash; /* lookup hash list */ | ||
101 | struct dentry *d_parent; /* parent directory */ | 121 | struct dentry *d_parent; /* parent directory */ |
102 | struct qstr d_name; | 122 | struct qstr d_name; |
123 | struct inode *d_inode; /* Where the name belongs to - NULL is | ||
124 | * negative */ | ||
125 | unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ | ||
126 | |||
127 | /* Ref lookup also touches following */ | ||
128 | unsigned int d_count; /* protected by d_lock */ | ||
129 | spinlock_t d_lock; /* per dentry lock */ | ||
130 | const struct dentry_operations *d_op; | ||
131 | struct super_block *d_sb; /* The root of the dentry tree */ | ||
132 | unsigned long d_time; /* used by d_revalidate */ | ||
133 | void *d_fsdata; /* fs-specific data */ | ||
103 | 134 | ||
104 | struct list_head d_lru; /* LRU list */ | 135 | struct list_head d_lru; /* LRU list */ |
105 | /* | 136 | /* |
@@ -111,12 +142,6 @@ struct dentry { | |||
111 | } d_u; | 142 | } d_u; |
112 | struct list_head d_subdirs; /* our children */ | 143 | struct list_head d_subdirs; /* our children */ |
113 | struct list_head d_alias; /* inode alias list */ | 144 | struct list_head d_alias; /* inode alias list */ |
114 | unsigned long d_time; /* used by d_revalidate */ | ||
115 | const struct dentry_operations *d_op; | ||
116 | struct super_block *d_sb; /* The root of the dentry tree */ | ||
117 | void *d_fsdata; /* fs-specific data */ | ||
118 | |||
119 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | ||
120 | }; | 145 | }; |
121 | 146 | ||
122 | /* | 147 | /* |
@@ -133,96 +158,68 @@ enum dentry_d_lock_class | |||
133 | 158 | ||
134 | struct dentry_operations { | 159 | struct dentry_operations { |
135 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 160 | int (*d_revalidate)(struct dentry *, struct nameidata *); |
136 | int (*d_hash) (struct dentry *, struct qstr *); | 161 | int (*d_hash)(const struct dentry *, const struct inode *, |
137 | int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); | 162 | struct qstr *); |
138 | int (*d_delete)(struct dentry *); | 163 | int (*d_compare)(const struct dentry *, const struct inode *, |
164 | const struct dentry *, const struct inode *, | ||
165 | unsigned int, const char *, const struct qstr *); | ||
166 | int (*d_delete)(const struct dentry *); | ||
139 | void (*d_release)(struct dentry *); | 167 | void (*d_release)(struct dentry *); |
140 | void (*d_iput)(struct dentry *, struct inode *); | 168 | void (*d_iput)(struct dentry *, struct inode *); |
141 | char *(*d_dname)(struct dentry *, char *, int); | 169 | char *(*d_dname)(struct dentry *, char *, int); |
142 | }; | 170 | struct vfsmount *(*d_automount)(struct path *); |
143 | 171 | int (*d_manage)(struct dentry *, bool, bool); | |
144 | /* the dentry parameter passed to d_hash and d_compare is the parent | 172 | } ____cacheline_aligned; |
145 | * directory of the entries to be compared. It is used in case these | ||
146 | * functions need any directory specific information for determining | ||
147 | * equivalency classes. Using the dentry itself might not work, as it | ||
148 | * might be a negative dentry which has no information associated with | ||
149 | * it */ | ||
150 | 173 | ||
151 | /* | 174 | /* |
152 | locking rules: | 175 | * Locking rules for dentry_operations callbacks are to be found in |
153 | big lock dcache_lock d_lock may block | 176 | * Documentation/filesystems/Locking. Keep it updated! |
154 | d_revalidate: no no no yes | 177 | * |
155 | d_hash no no no yes | 178 | * FUrther descriptions are found in Documentation/filesystems/vfs.txt. |
156 | d_compare: no yes yes no | 179 | * Keep it updated too! |
157 | d_delete: no yes no no | ||
158 | d_release: no no no yes | ||
159 | d_iput: no no no yes | ||
160 | */ | 180 | */ |
161 | 181 | ||
162 | /* d_flags entries */ | 182 | /* d_flags entries */ |
163 | #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ | 183 | #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ |
164 | #define DCACHE_NFSFS_RENAMED 0x0002 /* this dentry has been "silly | 184 | #define DCACHE_NFSFS_RENAMED 0x0002 |
165 | * renamed" and has to be | 185 | /* this dentry has been "silly renamed" and has to be deleted on the last |
166 | * deleted on the last dput() | 186 | * dput() */ |
167 | */ | 187 | |
168 | #define DCACHE_DISCONNECTED 0x0004 | 188 | #define DCACHE_DISCONNECTED 0x0004 |
169 | /* This dentry is possibly not currently connected to the dcache tree, | 189 | /* This dentry is possibly not currently connected to the dcache tree, in |
170 | * in which case its parent will either be itself, or will have this | 190 | * which case its parent will either be itself, or will have this flag as |
171 | * flag as well. nfsd will not use a dentry with this bit set, but will | 191 | * well. nfsd will not use a dentry with this bit set, but will first |
172 | * first endeavour to clear the bit either by discovering that it is | 192 | * endeavour to clear the bit either by discovering that it is connected, |
173 | * connected, or by performing lookup operations. Any filesystem which | 193 | * or by performing lookup operations. Any filesystem which supports |
174 | * supports nfsd_operations MUST have a lookup function which, if it finds | 194 | * nfsd_operations MUST have a lookup function which, if it finds a |
175 | * a directory inode with a DCACHE_DISCONNECTED dentry, will d_move | 195 | * directory inode with a DCACHE_DISCONNECTED dentry, will d_move that |
176 | * that dentry into place and return that dentry rather than the passed one, | 196 | * dentry into place and return that dentry rather than the passed one, |
177 | * typically using d_splice_alias. | 197 | * typically using d_splice_alias. */ |
178 | */ | ||
179 | 198 | ||
180 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ | 199 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ |
181 | #define DCACHE_UNHASHED 0x0010 | 200 | #define DCACHE_UNHASHED 0x0010 |
182 | 201 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 | |
183 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched by inotify */ | 202 | /* Parent inode is watched by inotify */ |
184 | 203 | ||
185 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ | 204 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ |
186 | 205 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 | |
187 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ | 206 | /* Parent inode is watched by some fsnotify listener */ |
188 | 207 | ||
189 | #define DCACHE_CANT_MOUNT 0x0100 | 208 | #define DCACHE_CANT_MOUNT 0x0100 |
209 | #define DCACHE_GENOCIDE 0x0200 | ||
190 | 210 | ||
191 | extern spinlock_t dcache_lock; | 211 | #define DCACHE_OP_HASH 0x1000 |
192 | extern seqlock_t rename_lock; | 212 | #define DCACHE_OP_COMPARE 0x2000 |
193 | 213 | #define DCACHE_OP_REVALIDATE 0x4000 | |
194 | /** | 214 | #define DCACHE_OP_DELETE 0x8000 |
195 | * d_drop - drop a dentry | ||
196 | * @dentry: dentry to drop | ||
197 | * | ||
198 | * d_drop() unhashes the entry from the parent dentry hashes, so that it won't | ||
199 | * be found through a VFS lookup any more. Note that this is different from | ||
200 | * deleting the dentry - d_delete will try to mark the dentry negative if | ||
201 | * possible, giving a successful _negative_ lookup, while d_drop will | ||
202 | * just make the cache lookup fail. | ||
203 | * | ||
204 | * d_drop() is used mainly for stuff that wants to invalidate a dentry for some | ||
205 | * reason (NFS timeouts or autofs deletes). | ||
206 | * | ||
207 | * __d_drop requires dentry->d_lock. | ||
208 | */ | ||
209 | 215 | ||
210 | static inline void __d_drop(struct dentry *dentry) | 216 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ |
211 | { | 217 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ |
212 | if (!(dentry->d_flags & DCACHE_UNHASHED)) { | 218 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ |
213 | dentry->d_flags |= DCACHE_UNHASHED; | 219 | #define DCACHE_MANAGED_DENTRY \ |
214 | hlist_del_rcu(&dentry->d_hash); | 220 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
215 | } | ||
216 | } | ||
217 | 221 | ||
218 | static inline void d_drop(struct dentry *dentry) | 222 | extern seqlock_t rename_lock; |
219 | { | ||
220 | spin_lock(&dcache_lock); | ||
221 | spin_lock(&dentry->d_lock); | ||
222 | __d_drop(dentry); | ||
223 | spin_unlock(&dentry->d_lock); | ||
224 | spin_unlock(&dcache_lock); | ||
225 | } | ||
226 | 223 | ||
227 | static inline int dname_external(struct dentry *dentry) | 224 | static inline int dname_external(struct dentry *dentry) |
228 | { | 225 | { |
@@ -235,10 +232,14 @@ static inline int dname_external(struct dentry *dentry) | |||
235 | extern void d_instantiate(struct dentry *, struct inode *); | 232 | extern void d_instantiate(struct dentry *, struct inode *); |
236 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 233 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
237 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | 234 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); |
235 | extern void __d_drop(struct dentry *dentry); | ||
236 | extern void d_drop(struct dentry *dentry); | ||
238 | extern void d_delete(struct dentry *); | 237 | extern void d_delete(struct dentry *); |
238 | extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op); | ||
239 | 239 | ||
240 | /* allocate/de-allocate */ | 240 | /* allocate/de-allocate */ |
241 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | 241 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); |
242 | extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); | ||
242 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 243 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
243 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); | 244 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); |
244 | extern struct dentry * d_obtain_alias(struct inode *); | 245 | extern struct dentry * d_obtain_alias(struct inode *); |
@@ -296,14 +297,40 @@ static inline struct dentry *d_add_unique(struct dentry *entry, struct inode *in | |||
296 | return res; | 297 | return res; |
297 | } | 298 | } |
298 | 299 | ||
300 | extern void dentry_update_name_case(struct dentry *, struct qstr *); | ||
301 | |||
299 | /* used for rename() and baskets */ | 302 | /* used for rename() and baskets */ |
300 | extern void d_move(struct dentry *, struct dentry *); | 303 | extern void d_move(struct dentry *, struct dentry *); |
301 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); | 304 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); |
302 | 305 | ||
303 | /* appendix may either be NULL or be used for transname suffixes */ | 306 | /* appendix may either be NULL or be used for transname suffixes */ |
304 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); | 307 | extern struct dentry *d_lookup(struct dentry *, struct qstr *); |
305 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); | 308 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); |
306 | extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); | 309 | extern struct dentry *__d_lookup(struct dentry *, struct qstr *); |
310 | extern struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | ||
311 | unsigned *seq, struct inode **inode); | ||
312 | |||
313 | /** | ||
314 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok | ||
315 | * @dentry: dentry to take a ref on | ||
316 | * @seq: seqcount to verify against | ||
317 | * Returns: 0 on failure, else 1. | ||
318 | * | ||
319 | * __d_rcu_to_refcount operates on a dentry,seq pair that was returned | ||
320 | * by __d_lookup_rcu, to get a reference on an rcu-walk dentry. | ||
321 | */ | ||
322 | static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq) | ||
323 | { | ||
324 | int ret = 0; | ||
325 | |||
326 | assert_spin_locked(&dentry->d_lock); | ||
327 | if (!read_seqcount_retry(&dentry->d_seq, seq)) { | ||
328 | ret = 1; | ||
329 | dentry->d_count++; | ||
330 | } | ||
331 | |||
332 | return ret; | ||
333 | } | ||
307 | 334 | ||
308 | /* validate "insecure" dentry pointer */ | 335 | /* validate "insecure" dentry pointer */ |
309 | extern int d_validate(struct dentry *, struct dentry *); | 336 | extern int d_validate(struct dentry *, struct dentry *); |
@@ -316,34 +343,37 @@ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); | |||
316 | extern char *__d_path(const struct path *path, struct path *root, char *, int); | 343 | extern char *__d_path(const struct path *path, struct path *root, char *, int); |
317 | extern char *d_path(const struct path *, char *, int); | 344 | extern char *d_path(const struct path *, char *, int); |
318 | extern char *d_path_with_unreachable(const struct path *, char *, int); | 345 | extern char *d_path_with_unreachable(const struct path *, char *, int); |
319 | extern char *__dentry_path(struct dentry *, char *, int); | 346 | extern char *dentry_path_raw(struct dentry *, char *, int); |
320 | extern char *dentry_path(struct dentry *, char *, int); | 347 | extern char *dentry_path(struct dentry *, char *, int); |
321 | 348 | ||
322 | /* Allocation counts.. */ | 349 | /* Allocation counts.. */ |
323 | 350 | ||
324 | /** | 351 | /** |
325 | * dget, dget_locked - get a reference to a dentry | 352 | * dget, dget_dlock - get a reference to a dentry |
326 | * @dentry: dentry to get a reference to | 353 | * @dentry: dentry to get a reference to |
327 | * | 354 | * |
328 | * Given a dentry or %NULL pointer increment the reference count | 355 | * Given a dentry or %NULL pointer increment the reference count |
329 | * if appropriate and return the dentry. A dentry will not be | 356 | * if appropriate and return the dentry. A dentry will not be |
330 | * destroyed when it has references. dget() should never be | 357 | * destroyed when it has references. |
331 | * called for dentries with zero reference counter. For these cases | ||
332 | * (preferably none, functions in dcache.c are sufficient for normal | ||
333 | * needs and they take necessary precautions) you should hold dcache_lock | ||
334 | * and call dget_locked() instead of dget(). | ||
335 | */ | 358 | */ |
336 | 359 | static inline struct dentry *dget_dlock(struct dentry *dentry) | |
360 | { | ||
361 | if (dentry) | ||
362 | dentry->d_count++; | ||
363 | return dentry; | ||
364 | } | ||
365 | |||
337 | static inline struct dentry *dget(struct dentry *dentry) | 366 | static inline struct dentry *dget(struct dentry *dentry) |
338 | { | 367 | { |
339 | if (dentry) { | 368 | if (dentry) { |
340 | BUG_ON(!atomic_read(&dentry->d_count)); | 369 | spin_lock(&dentry->d_lock); |
341 | atomic_inc(&dentry->d_count); | 370 | dget_dlock(dentry); |
371 | spin_unlock(&dentry->d_lock); | ||
342 | } | 372 | } |
343 | return dentry; | 373 | return dentry; |
344 | } | 374 | } |
345 | 375 | ||
346 | extern struct dentry * dget_locked(struct dentry *); | 376 | extern struct dentry *dget_parent(struct dentry *dentry); |
347 | 377 | ||
348 | /** | 378 | /** |
349 | * d_unhashed - is dentry hashed | 379 | * d_unhashed - is dentry hashed |
@@ -374,21 +404,16 @@ static inline void dont_mount(struct dentry *dentry) | |||
374 | spin_unlock(&dentry->d_lock); | 404 | spin_unlock(&dentry->d_lock); |
375 | } | 405 | } |
376 | 406 | ||
377 | static inline struct dentry *dget_parent(struct dentry *dentry) | 407 | extern void dput(struct dentry *); |
378 | { | ||
379 | struct dentry *ret; | ||
380 | 408 | ||
381 | spin_lock(&dentry->d_lock); | 409 | static inline bool d_managed(struct dentry *dentry) |
382 | ret = dget(dentry->d_parent); | 410 | { |
383 | spin_unlock(&dentry->d_lock); | 411 | return dentry->d_flags & DCACHE_MANAGED_DENTRY; |
384 | return ret; | ||
385 | } | 412 | } |
386 | 413 | ||
387 | extern void dput(struct dentry *); | 414 | static inline bool d_mountpoint(struct dentry *dentry) |
388 | |||
389 | static inline int d_mountpoint(struct dentry *dentry) | ||
390 | { | 415 | { |
391 | return dentry->d_mounted; | 416 | return dentry->d_flags & DCACHE_MOUNTED; |
392 | } | 417 | } |
393 | 418 | ||
394 | extern struct vfsmount *lookup_mnt(struct path *); | 419 | extern struct vfsmount *lookup_mnt(struct path *); |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 8723491f7dfd..68cd248f6d3e 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
@@ -22,6 +22,89 @@ | |||
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | 24 | ||
25 | /* IEEE 802.1Qaz std supported values */ | ||
26 | #define IEEE_8021QAZ_MAX_TCS 8 | ||
27 | |||
28 | /* This structure contains the IEEE 802.1Qaz ETS managed object | ||
29 | * | ||
30 | * @willing: willing bit in ETS configuratin TLV | ||
31 | * @ets_cap: indicates supported capacity of ets feature | ||
32 | * @cbs: credit based shaper ets algorithm supported | ||
33 | * @tc_tx_bw: tc tx bandwidth indexed by traffic class | ||
34 | * @tc_rx_bw: tc rx bandwidth indexed by traffic class | ||
35 | * @tc_tsa: TSA Assignment table, indexed by traffic class | ||
36 | * @prio_tc: priority assignment table mapping 8021Qp to traffic class | ||
37 | * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV | ||
38 | * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV | ||
39 | * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV | ||
40 | * | ||
41 | * Recommended values are used to set fields in the ETS recommendation TLV | ||
42 | * with hardware offloaded LLDP. | ||
43 | * | ||
44 | * ---- | ||
45 | * TSA Assignment 8 bit identifiers | ||
46 | * 0 strict priority | ||
47 | * 1 credit-based shaper | ||
48 | * 2 enhanced transmission selection | ||
49 | * 3-254 reserved | ||
50 | * 255 vendor specific | ||
51 | */ | ||
52 | struct ieee_ets { | ||
53 | __u8 willing; | ||
54 | __u8 ets_cap; | ||
55 | __u8 cbs; | ||
56 | __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
57 | __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
58 | __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
59 | __u8 prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
60 | __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS]; | ||
61 | __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
62 | __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
63 | }; | ||
64 | |||
65 | /* This structure contains the IEEE 802.1Qaz PFC managed object | ||
66 | * | ||
67 | * @pfc_cap: Indicates the number of traffic classes on the local device | ||
68 | * that may simultaneously have PFC enabled. | ||
69 | * @pfc_en: bitmap indicating pfc enabled traffic classes | ||
70 | * @mbc: enable macsec bypass capability | ||
71 | * @delay: the allowance made for a round-trip propagation delay of the | ||
72 | * link in bits. | ||
73 | * @requests: count of the sent pfc frames | ||
74 | * @indications: count of the received pfc frames | ||
75 | */ | ||
76 | struct ieee_pfc { | ||
77 | __u8 pfc_cap; | ||
78 | __u8 pfc_en; | ||
79 | __u8 mbc; | ||
80 | __u16 delay; | ||
81 | __u64 requests[IEEE_8021QAZ_MAX_TCS]; | ||
82 | __u64 indications[IEEE_8021QAZ_MAX_TCS]; | ||
83 | }; | ||
84 | |||
85 | /* This structure contains the IEEE 802.1Qaz APP managed object. This | ||
86 | * object is also used for the CEE std as well. There is no difference | ||
87 | * between the objects. | ||
88 | * | ||
89 | * @selector: protocol identifier type | ||
90 | * @protocol: protocol of type indicated | ||
91 | * @priority: 3-bit unsigned integer indicating priority | ||
92 | * | ||
93 | * ---- | ||
94 | * Selector field values | ||
95 | * 0 Reserved | ||
96 | * 1 Ethertype | ||
97 | * 2 Well known port number over TCP or SCTP | ||
98 | * 3 Well known port number over UDP or DCCP | ||
99 | * 4 Well known port number over TCP, SCTP, UDP, or DCCP | ||
100 | * 5-7 Reserved | ||
101 | */ | ||
102 | struct dcb_app { | ||
103 | __u8 selector; | ||
104 | __u32 protocol; | ||
105 | __u8 priority; | ||
106 | }; | ||
107 | |||
25 | struct dcbmsg { | 108 | struct dcbmsg { |
26 | __u8 dcb_family; | 109 | __u8 dcb_family; |
27 | __u8 cmd; | 110 | __u8 cmd; |
@@ -50,6 +133,12 @@ struct dcbmsg { | |||
50 | * @DCB_CMD_SBCN: get backward congestion notification configration. | 133 | * @DCB_CMD_SBCN: get backward congestion notification configration. |
51 | * @DCB_CMD_GAPP: get application protocol configuration | 134 | * @DCB_CMD_GAPP: get application protocol configuration |
52 | * @DCB_CMD_SAPP: set application protocol configuration | 135 | * @DCB_CMD_SAPP: set application protocol configuration |
136 | * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration | ||
137 | * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration | ||
138 | * @DCB_CMD_GDCBX: get DCBX engine configuration | ||
139 | * @DCB_CMD_SDCBX: set DCBX engine configuration | ||
140 | * @DCB_CMD_GFEATCFG: get DCBX features flags | ||
141 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags | ||
53 | */ | 142 | */ |
54 | enum dcbnl_commands { | 143 | enum dcbnl_commands { |
55 | DCB_CMD_UNDEFINED, | 144 | DCB_CMD_UNDEFINED, |
@@ -83,6 +172,15 @@ enum dcbnl_commands { | |||
83 | DCB_CMD_GAPP, | 172 | DCB_CMD_GAPP, |
84 | DCB_CMD_SAPP, | 173 | DCB_CMD_SAPP, |
85 | 174 | ||
175 | DCB_CMD_IEEE_SET, | ||
176 | DCB_CMD_IEEE_GET, | ||
177 | |||
178 | DCB_CMD_GDCBX, | ||
179 | DCB_CMD_SDCBX, | ||
180 | |||
181 | DCB_CMD_GFEATCFG, | ||
182 | DCB_CMD_SFEATCFG, | ||
183 | |||
86 | __DCB_CMD_ENUM_MAX, | 184 | __DCB_CMD_ENUM_MAX, |
87 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | 185 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, |
88 | }; | 186 | }; |
@@ -102,6 +200,9 @@ enum dcbnl_commands { | |||
102 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) | 200 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) |
103 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) | 201 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) |
104 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) | 202 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) |
203 | * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED) | ||
204 | * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8) | ||
205 | * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED) | ||
105 | */ | 206 | */ |
106 | enum dcbnl_attrs { | 207 | enum dcbnl_attrs { |
107 | DCB_ATTR_UNDEFINED, | 208 | DCB_ATTR_UNDEFINED, |
@@ -119,10 +220,32 @@ enum dcbnl_attrs { | |||
119 | DCB_ATTR_BCN, | 220 | DCB_ATTR_BCN, |
120 | DCB_ATTR_APP, | 221 | DCB_ATTR_APP, |
121 | 222 | ||
223 | /* IEEE std attributes */ | ||
224 | DCB_ATTR_IEEE, | ||
225 | |||
226 | DCB_ATTR_DCBX, | ||
227 | DCB_ATTR_FEATCFG, | ||
228 | |||
122 | __DCB_ATTR_ENUM_MAX, | 229 | __DCB_ATTR_ENUM_MAX, |
123 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | 230 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, |
124 | }; | 231 | }; |
125 | 232 | ||
233 | enum ieee_attrs { | ||
234 | DCB_ATTR_IEEE_UNSPEC, | ||
235 | DCB_ATTR_IEEE_ETS, | ||
236 | DCB_ATTR_IEEE_PFC, | ||
237 | DCB_ATTR_IEEE_APP_TABLE, | ||
238 | __DCB_ATTR_IEEE_MAX | ||
239 | }; | ||
240 | #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) | ||
241 | |||
242 | enum ieee_attrs_app { | ||
243 | DCB_ATTR_IEEE_APP_UNSPEC, | ||
244 | DCB_ATTR_IEEE_APP, | ||
245 | __DCB_ATTR_IEEE_APP_MAX | ||
246 | }; | ||
247 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) | ||
248 | |||
126 | /** | 249 | /** |
127 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | 250 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs |
128 | * | 251 | * |
@@ -262,6 +385,8 @@ enum dcbnl_tc_attrs { | |||
262 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority | 385 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority |
263 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion | 386 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion |
264 | * Notification | 387 | * Notification |
388 | * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine | ||
389 | * | ||
265 | */ | 390 | */ |
266 | enum dcbnl_cap_attrs { | 391 | enum dcbnl_cap_attrs { |
267 | DCB_CAP_ATTR_UNDEFINED, | 392 | DCB_CAP_ATTR_UNDEFINED, |
@@ -273,12 +398,45 @@ enum dcbnl_cap_attrs { | |||
273 | DCB_CAP_ATTR_PFC_TCS, | 398 | DCB_CAP_ATTR_PFC_TCS, |
274 | DCB_CAP_ATTR_GSP, | 399 | DCB_CAP_ATTR_GSP, |
275 | DCB_CAP_ATTR_BCN, | 400 | DCB_CAP_ATTR_BCN, |
401 | DCB_CAP_ATTR_DCBX, | ||
276 | 402 | ||
277 | __DCB_CAP_ATTR_ENUM_MAX, | 403 | __DCB_CAP_ATTR_ENUM_MAX, |
278 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, | 404 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, |
279 | }; | 405 | }; |
280 | 406 | ||
281 | /** | 407 | /** |
408 | * DCBX capability flags | ||
409 | * | ||
410 | * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent. | ||
411 | * 'set' routines are used to configure the device with | ||
412 | * the negotiated parameters | ||
413 | * | ||
414 | * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but | ||
415 | * by another entity | ||
416 | * 'get' routines are used to retrieve the | ||
417 | * negotiated parameters | ||
418 | * 'set' routines can be used to set the initial | ||
419 | * negotiation configuration | ||
420 | * | ||
421 | * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine | ||
422 | * supports the CEE protocol flavor | ||
423 | * | ||
424 | * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine | ||
425 | * supports the IEEE protocol flavor | ||
426 | * | ||
427 | * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine | ||
428 | * supports static configuration (i.e no actual | ||
429 | * negotiation is performed negotiated parameters equal | ||
430 | * the initial configuration) | ||
431 | * | ||
432 | */ | ||
433 | #define DCB_CAP_DCBX_HOST 0x01 | ||
434 | #define DCB_CAP_DCBX_LLD_MANAGED 0x02 | ||
435 | #define DCB_CAP_DCBX_VER_CEE 0x04 | ||
436 | #define DCB_CAP_DCBX_VER_IEEE 0x08 | ||
437 | #define DCB_CAP_DCBX_STATIC 0x10 | ||
438 | |||
439 | /** | ||
282 | * enum dcbnl_numtcs_attrs - number of traffic classes | 440 | * enum dcbnl_numtcs_attrs - number of traffic classes |
283 | * | 441 | * |
284 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors | 442 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors |
@@ -355,4 +513,30 @@ enum dcbnl_app_attrs { | |||
355 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | 513 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, |
356 | }; | 514 | }; |
357 | 515 | ||
516 | /** | ||
517 | * enum dcbnl_featcfg_attrs - features conifiguration flags | ||
518 | * | ||
519 | * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
520 | * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes | ||
521 | * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups | ||
522 | * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority | ||
523 | * flow control | ||
524 | * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV | ||
525 | * | ||
526 | */ | ||
527 | #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */ | ||
528 | #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */ | ||
529 | #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */ | ||
530 | #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */ | ||
531 | enum dcbnl_featcfg_attrs { | ||
532 | DCB_FEATCFG_ATTR_UNDEFINED, | ||
533 | DCB_FEATCFG_ATTR_ALL, | ||
534 | DCB_FEATCFG_ATTR_PG, | ||
535 | DCB_FEATCFG_ATTR_PFC, | ||
536 | DCB_FEATCFG_ATTR_APP, | ||
537 | |||
538 | __DCB_FEATCFG_ATTR_ENUM_MAX, | ||
539 | DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1, | ||
540 | }; | ||
541 | |||
358 | #endif /* __LINUX_DCBNL_H__ */ | 542 | #endif /* __LINUX_DCBNL_H__ */ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 749f01ccd26e..010e2d87ed75 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -197,6 +197,21 @@ enum dccp_feature_numbers { | |||
197 | DCCPF_MAX_CCID_SPECIFIC = 255, | 197 | DCCPF_MAX_CCID_SPECIFIC = 255, |
198 | }; | 198 | }; |
199 | 199 | ||
200 | /* DCCP socket control message types for cmsg */ | ||
201 | enum dccp_cmsg_type { | ||
202 | DCCP_SCM_PRIORITY = 1, | ||
203 | DCCP_SCM_QPOLICY_MAX = 0xFFFF, | ||
204 | /* ^-- Up to here reserved exclusively for qpolicy parameters */ | ||
205 | DCCP_SCM_MAX | ||
206 | }; | ||
207 | |||
208 | /* DCCP priorities for outgoing/queued packets */ | ||
209 | enum dccp_packet_dequeueing_policy { | ||
210 | DCCPQ_POLICY_SIMPLE, | ||
211 | DCCPQ_POLICY_PRIO, | ||
212 | DCCPQ_POLICY_MAX | ||
213 | }; | ||
214 | |||
200 | /* DCCP socket options */ | 215 | /* DCCP socket options */ |
201 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ | 216 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ |
202 | #define DCCP_SOCKOPT_SERVICE 2 | 217 | #define DCCP_SOCKOPT_SERVICE 2 |
@@ -210,6 +225,8 @@ enum dccp_feature_numbers { | |||
210 | #define DCCP_SOCKOPT_CCID 13 | 225 | #define DCCP_SOCKOPT_CCID 13 |
211 | #define DCCP_SOCKOPT_TX_CCID 14 | 226 | #define DCCP_SOCKOPT_TX_CCID 14 |
212 | #define DCCP_SOCKOPT_RX_CCID 15 | 227 | #define DCCP_SOCKOPT_RX_CCID 15 |
228 | #define DCCP_SOCKOPT_QPOLICY_ID 16 | ||
229 | #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17 | ||
213 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 230 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
214 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 231 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
215 | 232 | ||
@@ -458,10 +475,13 @@ struct dccp_ackvec; | |||
458 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) | 475 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) |
459 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) | 476 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) |
460 | * @dccps_options_received - parsed set of retrieved options | 477 | * @dccps_options_received - parsed set of retrieved options |
478 | * @dccps_qpolicy - TX dequeueing policy, one of %dccp_packet_dequeueing_policy | ||
479 | * @dccps_tx_qlen - maximum length of the TX queue | ||
461 | * @dccps_role - role of this sock, one of %dccp_role | 480 | * @dccps_role - role of this sock, one of %dccp_role |
462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking | 481 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking |
463 | * @dccps_hc_tx_insert_options - sender wants to add options when sending | 482 | * @dccps_hc_tx_insert_options - sender wants to add options when sending |
464 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) | 483 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) |
484 | * @dccps_sync_scheduled - flag which signals "send out-of-band message soon" | ||
465 | * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets | 485 | * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets |
466 | * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) | 486 | * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) |
467 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | 487 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) |
@@ -499,10 +519,13 @@ struct dccp_sock { | |||
499 | struct ccid *dccps_hc_rx_ccid; | 519 | struct ccid *dccps_hc_rx_ccid; |
500 | struct ccid *dccps_hc_tx_ccid; | 520 | struct ccid *dccps_hc_tx_ccid; |
501 | struct dccp_options_received dccps_options_received; | 521 | struct dccp_options_received dccps_options_received; |
522 | __u8 dccps_qpolicy; | ||
523 | __u32 dccps_tx_qlen; | ||
502 | enum dccp_role dccps_role:2; | 524 | enum dccp_role dccps_role:2; |
503 | __u8 dccps_hc_rx_insert_options:1; | 525 | __u8 dccps_hc_rx_insert_options:1; |
504 | __u8 dccps_hc_tx_insert_options:1; | 526 | __u8 dccps_hc_tx_insert_options:1; |
505 | __u8 dccps_server_timewait:1; | 527 | __u8 dccps_server_timewait:1; |
528 | __u8 dccps_sync_scheduled:1; | ||
506 | struct tasklet_struct dccps_xmitlet; | 529 | struct tasklet_struct dccps_xmitlet; |
507 | struct timer_list dccps_xmit_timer; | 530 | struct timer_list dccps_xmit_timer; |
508 | }; | 531 | }; |
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h index 24c806f12a6c..5ac3bdd5cee6 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 f9b06ccc3e5c..8c0aef1ba5f5 100644 --- a/include/linux/decompress/inflate.h +++ b/include/linux/decompress/inflate.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef INFLATE_H | 1 | #ifndef INFLATE_H |
2 | #define INFLATE_H | 2 | #define INFLATE_H |
3 | 3 | ||
4 | /* Other housekeeping constants */ | ||
5 | #define INBUFSIZ 4096 | ||
6 | |||
7 | int gunzip(unsigned char *inbuf, int len, | 4 | int gunzip(unsigned char *inbuf, int len, |
8 | int(*fill)(void*, unsigned int), | 5 | int(*fill)(void*, unsigned int), |
9 | int(*flush)(void*, unsigned int), | 6 | int(*flush)(void*, unsigned int), |
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index ad5ec1d0475e..4cb72b920c74 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
@@ -61,8 +61,6 @@ static void free(void *where) | |||
61 | #define large_malloc(a) malloc(a) | 61 | #define large_malloc(a) malloc(a) |
62 | #define large_free(a) free(a) | 62 | #define large_free(a) free(a) |
63 | 63 | ||
64 | #define set_error_fn(x) | ||
65 | |||
66 | #define INIT | 64 | #define INIT |
67 | 65 | ||
68 | #else /* STATIC */ | 66 | #else /* STATIC */ |
@@ -72,6 +70,7 @@ static void free(void *where) | |||
72 | #include <linux/kernel.h> | 70 | #include <linux/kernel.h> |
73 | #include <linux/fs.h> | 71 | #include <linux/fs.h> |
74 | #include <linux/string.h> | 72 | #include <linux/string.h> |
73 | #include <linux/slab.h> | ||
75 | #include <linux/vmalloc.h> | 74 | #include <linux/vmalloc.h> |
76 | 75 | ||
77 | /* Use defines rather than static inline in order to avoid spurious | 76 | /* Use defines rather than static inline in order to avoid spurious |
@@ -84,9 +83,6 @@ static void free(void *where) | |||
84 | #define large_malloc(a) vmalloc(a) | 83 | #define large_malloc(a) vmalloc(a) |
85 | #define large_free(a) vfree(a) | 84 | #define large_free(a) vfree(a) |
86 | 85 | ||
87 | static void(*error)(char *m); | ||
88 | #define set_error_fn(x) error = x; | ||
89 | |||
90 | #define INIT __init | 86 | #define INIT __init |
91 | #define STATIC | 87 | #define STATIC |
92 | 88 | ||
diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h new file mode 100644 index 000000000000..41728fc6c8a1 --- /dev/null +++ b/include/linux/decompress/unxz.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd | ||
3 | * | ||
4 | * Author: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * | ||
6 | * This file has been put into the public domain. | ||
7 | * You can do whatever you want with this file. | ||
8 | */ | ||
9 | |||
10 | #ifndef DECOMPRESS_UNXZ_H | ||
11 | #define DECOMPRESS_UNXZ_H | ||
12 | |||
13 | int unxz(unsigned char *in, int in_size, | ||
14 | int (*fill)(void *dest, unsigned int size), | ||
15 | int (*flush)(void *src, unsigned int size), | ||
16 | unsigned char *out, int *in_used, | ||
17 | void (*error)(char *x)); | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 2970022faa63..272496d1fae4 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -193,6 +193,13 @@ struct dm_target { | |||
193 | char *error; | 193 | char *error; |
194 | }; | 194 | }; |
195 | 195 | ||
196 | /* Each target can link one of these into the table */ | ||
197 | struct dm_target_callbacks { | ||
198 | struct list_head list; | ||
199 | int (*congested_fn) (struct dm_target_callbacks *, int); | ||
200 | void (*unplug_fn)(struct dm_target_callbacks *); | ||
201 | }; | ||
202 | |||
196 | int dm_register_target(struct target_type *t); | 203 | int dm_register_target(struct target_type *t); |
197 | void dm_unregister_target(struct target_type *t); | 204 | void dm_unregister_target(struct target_type *t); |
198 | 205 | ||
@@ -269,6 +276,11 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
269 | sector_t start, sector_t len, char *params); | 276 | sector_t start, sector_t len, char *params); |
270 | 277 | ||
271 | /* | 278 | /* |
279 | * Target_ctr should call this if it needs to add any callbacks. | ||
280 | */ | ||
281 | void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb); | ||
282 | |||
283 | /* | ||
272 | * Finally call this to make the table ready for use. | 284 | * Finally call this to make the table ready for use. |
273 | */ | 285 | */ |
274 | int dm_table_complete(struct dm_table *t); | 286 | int dm_table_complete(struct dm_table *t); |
diff --git a/include/linux/device.h b/include/linux/device.h index dd4895313468..1bf5cf0b4513 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 49eab360d5d4..78bbf47bbb96 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -44,7 +44,7 @@ | |||
44 | * Remove a device, destroy any tables. | 44 | * Remove a device, destroy any tables. |
45 | * | 45 | * |
46 | * DM_DEV_RENAME: | 46 | * DM_DEV_RENAME: |
47 | * Rename a device. | 47 | * Rename a device or set its uuid if none was previously supplied. |
48 | * | 48 | * |
49 | * DM_SUSPEND: | 49 | * DM_SUSPEND: |
50 | * This performs both suspend and resume, depending which flag is | 50 | * This performs both suspend and resume, depending which flag is |
@@ -267,9 +267,9 @@ enum { | |||
267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
268 | 268 | ||
269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
270 | #define DM_VERSION_MINOR 18 | 270 | #define DM_VERSION_MINOR 19 |
271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 1 |
272 | #define DM_VERSION_EXTRA "-ioctl (2010-06-29)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2011-01-07)" |
273 | 273 | ||
274 | /* Status bits */ | 274 | /* Status bits */ |
275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -322,4 +322,10 @@ enum { | |||
322 | */ | 322 | */ |
323 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */ | 323 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */ |
324 | 324 | ||
325 | /* | ||
326 | * If set, rename changes the uuid not the name. Only permitted | ||
327 | * if no uuid was previously supplied: an existing uuid cannot be changed. | ||
328 | */ | ||
329 | #define DM_UUID_FLAG (1 << 14) /* In */ | ||
330 | |||
325 | #endif /* _LINUX_DM_IOCTL_H */ | 331 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h index 0c3c3a2110c4..eeace7d3ff15 100644 --- a/include/linux/dm-log-userspace.h +++ b/include/linux/dm-log-userspace.h | |||
@@ -370,6 +370,16 @@ | |||
370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ | 370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ |
371 | (DM_ULOG_REQUEST_MASK & (request_type)) | 371 | (DM_ULOG_REQUEST_MASK & (request_type)) |
372 | 372 | ||
373 | /* | ||
374 | * DM_ULOG_REQUEST_VERSION is incremented when there is a | ||
375 | * change to the way information is passed between kernel | ||
376 | * and userspace. This could be a structure change of | ||
377 | * dm_ulog_request or a change in the way requests are | ||
378 | * issued/handled. Changes are outlined here: | ||
379 | * version 1: Initial implementation | ||
380 | */ | ||
381 | #define DM_ULOG_REQUEST_VERSION 1 | ||
382 | |||
373 | struct dm_ulog_request { | 383 | struct dm_ulog_request { |
374 | /* | 384 | /* |
375 | * The local unique identifier (luid) and the universally unique | 385 | * The local unique identifier (luid) and the universally unique |
@@ -383,8 +393,9 @@ struct dm_ulog_request { | |||
383 | */ | 393 | */ |
384 | uint64_t luid; | 394 | uint64_t luid; |
385 | char uuid[DM_UUID_LEN]; | 395 | char uuid[DM_UUID_LEN]; |
386 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ | 396 | char padding[3]; /* Padding because DM_UUID_LEN = 129 */ |
387 | 397 | ||
398 | uint32_t version; /* See DM_ULOG_REQUEST_VERSION */ | ||
388 | int32_t error; /* Used to report back processing errors */ | 399 | int32_t error; /* Used to report back processing errors */ |
389 | 400 | ||
390 | uint32_t seq; /* Sequence number for request */ | 401 | uint32_t seq; /* Sequence number for request */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 8cd00ad98d37..9bebd7f16ef1 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -532,7 +532,7 @@ static inline int dmaengine_resume(struct dma_chan *chan) | |||
532 | return dmaengine_device_control(chan, DMA_RESUME, 0); | 532 | return dmaengine_device_control(chan, DMA_RESUME, 0); |
533 | } | 533 | } |
534 | 534 | ||
535 | static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc) | 535 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) |
536 | { | 536 | { |
537 | return desc->tx_submit(desc); | 537 | return desc->tx_submit(desc); |
538 | } | 538 | } |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a90b3892074a..1c70028f81f9 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/elevator.h b/include/linux/elevator.h index 86120c916fcc..39b68edb388d 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -196,15 +196,9 @@ enum { | |||
196 | /* | 196 | /* |
197 | * io context count accounting | 197 | * io context count accounting |
198 | */ | 198 | */ |
199 | #define elv_ioc_count_mod(name, __val) \ | 199 | #define elv_ioc_count_mod(name, __val) this_cpu_add(name, __val) |
200 | do { \ | 200 | #define elv_ioc_count_inc(name) this_cpu_inc(name) |
201 | preempt_disable(); \ | 201 | #define elv_ioc_count_dec(name) this_cpu_dec(name) |
202 | __get_cpu_var(name) += (__val); \ | ||
203 | preempt_enable(); \ | ||
204 | } while (0) | ||
205 | |||
206 | #define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1) | ||
207 | #define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1) | ||
208 | 202 | ||
209 | #define elv_ioc_count_read(name) \ | 203 | #define elv_ioc_count_read(name) \ |
210 | ({ \ | 204 | ({ \ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index f16a01081e15..ab68f785fd19 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -48,8 +48,10 @@ extern int eth_validate_addr(struct net_device *dev); | |||
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count); | 51 | extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, |
52 | unsigned int rxqs); | ||
52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 53 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
54 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | ||
53 | 55 | ||
54 | /** | 56 | /** |
55 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. | 57 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |
@@ -97,6 +99,17 @@ static inline int is_broadcast_ether_addr(const u8 *addr) | |||
97 | } | 99 | } |
98 | 100 | ||
99 | /** | 101 | /** |
102 | * is_unicast_ether_addr - Determine if the Ethernet address is unicast | ||
103 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
104 | * | ||
105 | * Return true if the address is a unicast address. | ||
106 | */ | ||
107 | static inline int is_unicast_ether_addr(const u8 *addr) | ||
108 | { | ||
109 | return !is_multicast_ether_addr(addr); | ||
110 | } | ||
111 | |||
112 | /** | ||
100 | * is_valid_ether_addr - Determine if the given Ethernet address is valid | 113 | * is_valid_ether_addr - Determine if the given Ethernet address is valid |
101 | * @addr: Pointer to a six-byte array containing the Ethernet address | 114 | * @addr: Pointer to a six-byte array containing the Ethernet address |
102 | * | 115 | * |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6628a507fd3b..1908929204a9 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -691,7 +691,9 @@ struct ethtool_ops { | |||
691 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ | 691 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ |
692 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ | 692 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ |
693 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ | 693 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ |
694 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ | 694 | /* Get link status for host, i.e. whether the interface *and* the |
695 | * physical port (if there is one) are up (ethtool_value). */ | ||
696 | #define ETHTOOL_GLINK 0x0000000a | ||
695 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ | 697 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ |
696 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ | 698 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ |
697 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ | 699 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 6ce1bca01724..65990ef612f5 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 3c155107d61f..73e0b628e058 100644 --- a/include/linux/falloc.h +++ b/include/linux/falloc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _FALLOC_H_ | 2 | #define _FALLOC_H_ |
3 | 3 | ||
4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ | 4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ |
5 | #define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */ | ||
5 | 6 | ||
6 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
7 | 8 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index d1631d37e9e0..68ba85a00c06 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1092,6 +1092,8 @@ extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); | |||
1092 | extern const unsigned char *fb_firmware_edid(struct device *device); | 1092 | extern const unsigned char *fb_firmware_edid(struct device *device); |
1093 | extern void fb_edid_to_monspecs(unsigned char *edid, | 1093 | extern void fb_edid_to_monspecs(unsigned char *edid, |
1094 | struct fb_monspecs *specs); | 1094 | struct fb_monspecs *specs); |
1095 | extern void fb_edid_add_monspecs(unsigned char *edid, | ||
1096 | struct fb_monspecs *specs); | ||
1095 | extern void fb_destroy_modedb(struct fb_videomode *modedb); | 1097 | extern void fb_destroy_modedb(struct fb_videomode *modedb); |
1096 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 1098 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
1097 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | 1099 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); |
@@ -1150,6 +1152,7 @@ struct fb_videomode { | |||
1150 | 1152 | ||
1151 | extern const char *fb_mode_option; | 1153 | extern const char *fb_mode_option; |
1152 | extern const struct fb_videomode vesa_modes[]; | 1154 | extern const struct fb_videomode vesa_modes[]; |
1155 | extern const struct fb_videomode cea_modes[64]; | ||
1153 | 1156 | ||
1154 | struct fb_modelist { | 1157 | struct fb_modelist { |
1155 | struct list_head list; | 1158 | struct list_head list; |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index afc00af3229b..a562fa5fb4e3 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of | 45 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of |
46 | unlinking file. */ | 46 | unlinking file. */ |
47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ | 47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ |
48 | #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */ | ||
48 | 49 | ||
49 | #ifdef __KERNEL__ | 50 | #ifdef __KERNEL__ |
50 | 51 | ||
diff --git a/include/linux/fec.h b/include/linux/fec.h index 5d3523d8dd0c..bcff455d1d53 100644 --- a/include/linux/fec.h +++ b/include/linux/fec.h | |||
@@ -3,6 +3,8 @@ | |||
3 | * Copyright (c) 2009 Orex Computed Radiography | 3 | * Copyright (c) 2009 Orex Computed Radiography |
4 | * Baruch Siach <baruch@tkos.co.il> | 4 | * Baruch Siach <baruch@tkos.co.il> |
5 | * | 5 | * |
6 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
7 | * | ||
6 | * Header file for the FEC platform data | 8 | * Header file for the FEC platform data |
7 | * | 9 | * |
8 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
@@ -16,6 +18,7 @@ | |||
16 | 18 | ||
17 | struct fec_platform_data { | 19 | struct fec_platform_data { |
18 | phy_interface_t phy; | 20 | phy_interface_t phy; |
21 | unsigned char mac[ETH_ALEN]; | ||
19 | }; | 22 | }; |
20 | 23 | ||
21 | #endif | 24 | #endif |
diff --git a/include/linux/file.h b/include/linux/file.h index b1e12970f617..e85baebf6279 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -23,7 +23,7 @@ extern struct file *alloc_file(struct path *, fmode_t mode, | |||
23 | 23 | ||
24 | static inline void fput_light(struct file *file, int fput_needed) | 24 | static inline void fput_light(struct file *file, int fput_needed) |
25 | { | 25 | { |
26 | if (unlikely(fput_needed)) | 26 | if (fput_needed) |
27 | fput(file); | 27 | fput(file); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/include/linux/filter.h b/include/linux/filter.h index 69b43dbea6c6..45266b75409a 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -91,54 +91,6 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
91 | #define BPF_TAX 0x00 | 91 | #define BPF_TAX 0x00 |
92 | #define BPF_TXA 0x80 | 92 | #define BPF_TXA 0x80 |
93 | 93 | ||
94 | enum { | ||
95 | BPF_S_RET_K = 0, | ||
96 | BPF_S_RET_A, | ||
97 | BPF_S_ALU_ADD_K, | ||
98 | BPF_S_ALU_ADD_X, | ||
99 | BPF_S_ALU_SUB_K, | ||
100 | BPF_S_ALU_SUB_X, | ||
101 | BPF_S_ALU_MUL_K, | ||
102 | BPF_S_ALU_MUL_X, | ||
103 | BPF_S_ALU_DIV_X, | ||
104 | BPF_S_ALU_AND_K, | ||
105 | BPF_S_ALU_AND_X, | ||
106 | BPF_S_ALU_OR_K, | ||
107 | BPF_S_ALU_OR_X, | ||
108 | BPF_S_ALU_LSH_K, | ||
109 | BPF_S_ALU_LSH_X, | ||
110 | BPF_S_ALU_RSH_K, | ||
111 | BPF_S_ALU_RSH_X, | ||
112 | BPF_S_ALU_NEG, | ||
113 | BPF_S_LD_W_ABS, | ||
114 | BPF_S_LD_H_ABS, | ||
115 | BPF_S_LD_B_ABS, | ||
116 | BPF_S_LD_W_LEN, | ||
117 | BPF_S_LD_W_IND, | ||
118 | BPF_S_LD_H_IND, | ||
119 | BPF_S_LD_B_IND, | ||
120 | BPF_S_LD_IMM, | ||
121 | BPF_S_LDX_W_LEN, | ||
122 | BPF_S_LDX_B_MSH, | ||
123 | BPF_S_LDX_IMM, | ||
124 | BPF_S_MISC_TAX, | ||
125 | BPF_S_MISC_TXA, | ||
126 | BPF_S_ALU_DIV_K, | ||
127 | BPF_S_LD_MEM, | ||
128 | BPF_S_LDX_MEM, | ||
129 | BPF_S_ST, | ||
130 | BPF_S_STX, | ||
131 | BPF_S_JMP_JA, | ||
132 | BPF_S_JMP_JEQ_K, | ||
133 | BPF_S_JMP_JEQ_X, | ||
134 | BPF_S_JMP_JGE_K, | ||
135 | BPF_S_JMP_JGE_X, | ||
136 | BPF_S_JMP_JGT_K, | ||
137 | BPF_S_JMP_JGT_X, | ||
138 | BPF_S_JMP_JSET_K, | ||
139 | BPF_S_JMP_JSET_X, | ||
140 | }; | ||
141 | |||
142 | #ifndef BPF_MAXINSNS | 94 | #ifndef BPF_MAXINSNS |
143 | #define BPF_MAXINSNS 4096 | 95 | #define BPF_MAXINSNS 4096 |
144 | #endif | 96 | #endif |
@@ -172,7 +124,9 @@ enum { | |||
172 | #define SKF_AD_MARK 20 | 124 | #define SKF_AD_MARK 20 |
173 | #define SKF_AD_QUEUE 24 | 125 | #define SKF_AD_QUEUE 24 |
174 | #define SKF_AD_HATYPE 28 | 126 | #define SKF_AD_HATYPE 28 |
175 | #define SKF_AD_MAX 32 | 127 | #define SKF_AD_RXHASH 32 |
128 | #define SKF_AD_CPU 36 | ||
129 | #define SKF_AD_MAX 40 | ||
176 | #define SKF_NET_OFF (-0x100000) | 130 | #define SKF_NET_OFF (-0x100000) |
177 | #define SKF_LL_OFF (-0x200000) | 131 | #define SKF_LL_OFF (-0x200000) |
178 | 132 | ||
@@ -194,8 +148,8 @@ struct sk_buff; | |||
194 | struct sock; | 148 | struct sock; |
195 | 149 | ||
196 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); | 150 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
197 | extern unsigned int sk_run_filter(struct sk_buff *skb, | 151 | extern unsigned int sk_run_filter(const struct sk_buff *skb, |
198 | struct sock_filter *filter, int flen); | 152 | const struct sock_filter *filter); |
199 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 153 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
200 | extern int sk_detach_filter(struct sock *sk); | 154 | extern int sk_detach_filter(struct sock *sk); |
201 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 155 | extern int sk_chk_filter(struct sock_filter *filter, int flen); |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 68c642d8843d..59ea406be7f6 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -273,7 +273,7 @@ struct fw_cdev_event_iso_interrupt { | |||
273 | * @closure: See &fw_cdev_event_common; | 273 | * @closure: See &fw_cdev_event_common; |
274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | 274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl |
275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL | 275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL |
276 | * @completed: Offset into the receive buffer; data before this offest is valid | 276 | * @completed: Offset into the receive buffer; data before this offset is valid |
277 | * | 277 | * |
278 | * This event is sent in multichannel contexts (context type | 278 | * This event is sent in multichannel contexts (context type |
279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer | 279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 1cd637ef62d2..9a3f5f9383f6 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 c6dcc1dfe781..43fe52fcef0f 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 631b77f2ac70..70e4efabe0fb 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/freezer.h b/include/linux/freezer.h index da7e52b099f3..1effc8b56b4e 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -109,7 +109,7 @@ static inline void freezer_count(void) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * Check if the task should be counted as freezeable by the freezer | 112 | * Check if the task should be counted as freezable by the freezer |
113 | */ | 113 | */ |
114 | static inline int freezer_should_skip(struct task_struct *p) | 114 | static inline int freezer_should_skip(struct task_struct *p) |
115 | { | 115 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 090f0eacde29..bd3215940c37 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> |
@@ -392,6 +393,7 @@ struct inodes_stat_t { | |||
392 | #include <linux/capability.h> | 393 | #include <linux/capability.h> |
393 | #include <linux/semaphore.h> | 394 | #include <linux/semaphore.h> |
394 | #include <linux/fiemap.h> | 395 | #include <linux/fiemap.h> |
396 | #include <linux/rculist_bl.h> | ||
395 | 397 | ||
396 | #include <asm/atomic.h> | 398 | #include <asm/atomic.h> |
397 | #include <asm/byteorder.h> | 399 | #include <asm/byteorder.h> |
@@ -401,6 +403,7 @@ struct hd_geometry; | |||
401 | struct iovec; | 403 | struct iovec; |
402 | struct nameidata; | 404 | struct nameidata; |
403 | struct kiocb; | 405 | struct kiocb; |
406 | struct kobject; | ||
404 | struct pipe_inode_info; | 407 | struct pipe_inode_info; |
405 | struct poll_table_struct; | 408 | struct poll_table_struct; |
406 | struct kstatfs; | 409 | struct kstatfs; |
@@ -663,8 +666,9 @@ struct block_device { | |||
663 | void * bd_claiming; | 666 | void * bd_claiming; |
664 | void * bd_holder; | 667 | void * bd_holder; |
665 | int bd_holders; | 668 | int bd_holders; |
669 | bool bd_write_holder; | ||
666 | #ifdef CONFIG_SYSFS | 670 | #ifdef CONFIG_SYSFS |
667 | struct list_head bd_holder_list; | 671 | struct list_head bd_holder_disks; |
668 | #endif | 672 | #endif |
669 | struct block_device * bd_contains; | 673 | struct block_device * bd_contains; |
670 | unsigned bd_block_size; | 674 | unsigned bd_block_size; |
@@ -733,16 +737,31 @@ struct posix_acl; | |||
733 | #define ACL_NOT_CACHED ((void *)(-1)) | 737 | #define ACL_NOT_CACHED ((void *)(-1)) |
734 | 738 | ||
735 | struct inode { | 739 | struct inode { |
740 | /* RCU path lookup touches following: */ | ||
741 | umode_t i_mode; | ||
742 | uid_t i_uid; | ||
743 | gid_t i_gid; | ||
744 | const struct inode_operations *i_op; | ||
745 | struct super_block *i_sb; | ||
746 | |||
747 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
748 | unsigned int i_flags; | ||
749 | struct mutex i_mutex; | ||
750 | |||
751 | unsigned long i_state; | ||
752 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
753 | |||
736 | struct hlist_node i_hash; | 754 | struct hlist_node i_hash; |
737 | struct list_head i_wb_list; /* backing dev IO list */ | 755 | struct list_head i_wb_list; /* backing dev IO list */ |
738 | struct list_head i_lru; /* inode LRU list */ | 756 | struct list_head i_lru; /* inode LRU list */ |
739 | struct list_head i_sb_list; | 757 | struct list_head i_sb_list; |
740 | struct list_head i_dentry; | 758 | union { |
759 | struct list_head i_dentry; | ||
760 | struct rcu_head i_rcu; | ||
761 | }; | ||
741 | unsigned long i_ino; | 762 | unsigned long i_ino; |
742 | atomic_t i_count; | 763 | atomic_t i_count; |
743 | unsigned int i_nlink; | 764 | unsigned int i_nlink; |
744 | uid_t i_uid; | ||
745 | gid_t i_gid; | ||
746 | dev_t i_rdev; | 765 | dev_t i_rdev; |
747 | unsigned int i_blkbits; | 766 | unsigned int i_blkbits; |
748 | u64 i_version; | 767 | u64 i_version; |
@@ -755,13 +774,8 @@ struct inode { | |||
755 | struct timespec i_ctime; | 774 | struct timespec i_ctime; |
756 | blkcnt_t i_blocks; | 775 | blkcnt_t i_blocks; |
757 | unsigned short i_bytes; | 776 | unsigned short i_bytes; |
758 | umode_t i_mode; | ||
759 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
760 | struct mutex i_mutex; | ||
761 | struct rw_semaphore i_alloc_sem; | 777 | struct rw_semaphore i_alloc_sem; |
762 | const struct inode_operations *i_op; | ||
763 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 778 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
764 | struct super_block *i_sb; | ||
765 | struct file_lock *i_flock; | 779 | struct file_lock *i_flock; |
766 | struct address_space *i_mapping; | 780 | struct address_space *i_mapping; |
767 | struct address_space i_data; | 781 | struct address_space i_data; |
@@ -782,11 +796,6 @@ struct inode { | |||
782 | struct hlist_head i_fsnotify_marks; | 796 | struct hlist_head i_fsnotify_marks; |
783 | #endif | 797 | #endif |
784 | 798 | ||
785 | unsigned long i_state; | ||
786 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
787 | |||
788 | unsigned int i_flags; | ||
789 | |||
790 | #ifdef CONFIG_IMA | 799 | #ifdef CONFIG_IMA |
791 | /* protected by i_lock */ | 800 | /* protected by i_lock */ |
792 | unsigned int i_readcount; /* struct files open RO */ | 801 | unsigned int i_readcount; /* struct files open RO */ |
@@ -1059,7 +1068,6 @@ struct lock_manager_operations { | |||
1059 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1068 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
1060 | void (*fl_release_private)(struct file_lock *); | 1069 | void (*fl_release_private)(struct file_lock *); |
1061 | void (*fl_break)(struct file_lock *); | 1070 | void (*fl_break)(struct file_lock *); |
1062 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | ||
1063 | int (*fl_change)(struct file_lock **, int); | 1071 | int (*fl_change)(struct file_lock **, int); |
1064 | }; | 1072 | }; |
1065 | 1073 | ||
@@ -1372,13 +1380,13 @@ struct super_block { | |||
1372 | const struct xattr_handler **s_xattr; | 1380 | const struct xattr_handler **s_xattr; |
1373 | 1381 | ||
1374 | struct list_head s_inodes; /* all inodes */ | 1382 | struct list_head s_inodes; /* all inodes */ |
1375 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1383 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ |
1376 | #ifdef CONFIG_SMP | 1384 | #ifdef CONFIG_SMP |
1377 | struct list_head __percpu *s_files; | 1385 | struct list_head __percpu *s_files; |
1378 | #else | 1386 | #else |
1379 | struct list_head s_files; | 1387 | struct list_head s_files; |
1380 | #endif | 1388 | #endif |
1381 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1389 | /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ |
1382 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1390 | struct list_head s_dentry_lru; /* unused dentry lru */ |
1383 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1391 | int s_nr_dentry_unused; /* # of dentry on lru */ |
1384 | 1392 | ||
@@ -1417,6 +1425,7 @@ struct super_block { | |||
1417 | * generic_show_options() | 1425 | * generic_show_options() |
1418 | */ | 1426 | */ |
1419 | char __rcu *s_options; | 1427 | char __rcu *s_options; |
1428 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ | ||
1420 | }; | 1429 | }; |
1421 | 1430 | ||
1422 | extern struct timespec current_fs_time(struct super_block *sb); | 1431 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1474,8 +1483,8 @@ struct fiemap_extent_info { | |||
1474 | unsigned int fi_flags; /* Flags as passed from user */ | 1483 | unsigned int fi_flags; /* Flags as passed from user */ |
1475 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | 1484 | unsigned int fi_extents_mapped; /* Number of mapped extents */ |
1476 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | 1485 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ |
1477 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | 1486 | struct fiemap_extent __user *fi_extents_start; /* Start of |
1478 | * array */ | 1487 | fiemap_extent array */ |
1479 | }; | 1488 | }; |
1480 | 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, |
1481 | u64 phys, u64 len, u32 flags); | 1490 | u64 phys, u64 len, u32 flags); |
@@ -1543,11 +1552,22 @@ struct file_operations { | |||
1543 | 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); |
1544 | 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); |
1545 | 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); | ||
1546 | }; | 1557 | }; |
1547 | 1558 | ||
1559 | #define IPERM_FLAG_RCU 0x0001 | ||
1560 | |||
1548 | struct inode_operations { | 1561 | struct inode_operations { |
1549 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
1550 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1562 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
1563 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
1564 | int (*permission) (struct inode *, int, unsigned int); | ||
1565 | int (*check_acl)(struct inode *, int, unsigned int); | ||
1566 | |||
1567 | int (*readlink) (struct dentry *, char __user *,int); | ||
1568 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
1569 | |||
1570 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
1551 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 1571 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
1552 | int (*unlink) (struct inode *,struct dentry *); | 1572 | int (*unlink) (struct inode *,struct dentry *); |
1553 | int (*symlink) (struct inode *,struct dentry *,const char *); | 1573 | int (*symlink) (struct inode *,struct dentry *,const char *); |
@@ -1556,12 +1576,7 @@ struct inode_operations { | |||
1556 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | 1576 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); |
1557 | int (*rename) (struct inode *, struct dentry *, | 1577 | int (*rename) (struct inode *, struct dentry *, |
1558 | struct inode *, struct dentry *); | 1578 | struct inode *, struct dentry *); |
1559 | int (*readlink) (struct dentry *, char __user *,int); | ||
1560 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
1561 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
1562 | void (*truncate) (struct inode *); | 1579 | void (*truncate) (struct inode *); |
1563 | int (*permission) (struct inode *, int); | ||
1564 | int (*check_acl)(struct inode *, int); | ||
1565 | int (*setattr) (struct dentry *, struct iattr *); | 1580 | int (*setattr) (struct dentry *, struct iattr *); |
1566 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1581 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
1567 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1582 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
@@ -1569,11 +1584,9 @@ struct inode_operations { | |||
1569 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1584 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1570 | int (*removexattr) (struct dentry *, const char *); | 1585 | int (*removexattr) (struct dentry *, const char *); |
1571 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1586 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1572 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | ||
1573 | loff_t len); | ||
1574 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1587 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1575 | u64 len); | 1588 | u64 len); |
1576 | }; | 1589 | } ____cacheline_aligned; |
1577 | 1590 | ||
1578 | struct seq_file; | 1591 | struct seq_file; |
1579 | 1592 | ||
@@ -1824,7 +1837,9 @@ struct super_block *sget(struct file_system_type *type, | |||
1824 | int (*set)(struct super_block *,void *), | 1837 | int (*set)(struct super_block *,void *), |
1825 | void *data); | 1838 | void *data); |
1826 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, | 1839 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
1827 | const struct super_operations *ops, unsigned long); | 1840 | const struct super_operations *ops, |
1841 | const struct dentry_operations *dops, | ||
1842 | unsigned long); | ||
1828 | 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); |
1829 | 1844 | ||
1830 | static inline void sb_mark_dirty(struct super_block *sb) | 1845 | static inline void sb_mark_dirty(struct super_block *sb) |
@@ -2006,7 +2021,6 @@ extern struct block_device *bdgrab(struct block_device *bdev); | |||
2006 | extern void bd_set_size(struct block_device *, loff_t size); | 2021 | extern void bd_set_size(struct block_device *, loff_t size); |
2007 | extern void bd_forget(struct inode *inode); | 2022 | extern void bd_forget(struct inode *inode); |
2008 | extern void bdput(struct block_device *); | 2023 | extern void bdput(struct block_device *); |
2009 | extern struct block_device *open_by_devnum(dev_t, fmode_t); | ||
2010 | extern void invalidate_bdev(struct block_device *); | 2024 | extern void invalidate_bdev(struct block_device *); |
2011 | extern int sync_blockdev(struct block_device *bdev); | 2025 | extern int sync_blockdev(struct block_device *bdev); |
2012 | extern struct super_block *freeze_bdev(struct block_device *); | 2026 | extern struct super_block *freeze_bdev(struct block_device *); |
@@ -2037,16 +2051,26 @@ extern const struct file_operations def_fifo_fops; | |||
2037 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 2051 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
2038 | 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); |
2039 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 2053 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
2040 | extern int blkdev_get(struct block_device *, fmode_t); | 2054 | extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder); |
2041 | extern int blkdev_put(struct block_device *, fmode_t); | 2055 | extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, |
2042 | extern int bd_claim(struct block_device *, void *); | 2056 | void *holder); |
2043 | 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); | ||
2044 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
2045 | 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); |
2046 | 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); | ||
2047 | #else | 2064 | #else |
2048 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 2065 | static inline int bd_link_disk_holder(struct block_device *bdev, |
2049 | #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 | } | ||
2050 | #endif | 2074 | #endif |
2051 | #endif | 2075 | #endif |
2052 | 2076 | ||
@@ -2082,8 +2106,6 @@ static inline void unregister_chrdev(unsigned int major, const char *name) | |||
2082 | extern const char *__bdevname(dev_t, char *buffer); | 2106 | extern const char *__bdevname(dev_t, char *buffer); |
2083 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 2107 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
2084 | extern struct block_device *lookup_bdev(const char *); | 2108 | extern struct block_device *lookup_bdev(const char *); |
2085 | extern struct block_device *open_bdev_exclusive(const char *, fmode_t, void *); | ||
2086 | extern void close_bdev_exclusive(struct block_device *, fmode_t); | ||
2087 | extern void blkdev_show(struct seq_file *,off_t); | 2109 | extern void blkdev_show(struct seq_file *,off_t); |
2088 | 2110 | ||
2089 | #else | 2111 | #else |
@@ -2158,8 +2180,8 @@ extern sector_t bmap(struct inode *, sector_t); | |||
2158 | #endif | 2180 | #endif |
2159 | extern int notify_change(struct dentry *, struct iattr *); | 2181 | extern int notify_change(struct dentry *, struct iattr *); |
2160 | extern int inode_permission(struct inode *, int); | 2182 | extern int inode_permission(struct inode *, int); |
2161 | extern int generic_permission(struct inode *, int, | 2183 | extern int generic_permission(struct inode *, int, unsigned int, |
2162 | int (*check_acl)(struct inode *, int)); | 2184 | int (*check_acl)(struct inode *, int, unsigned int)); |
2163 | 2185 | ||
2164 | static inline bool execute_ok(struct inode *inode) | 2186 | static inline bool execute_ok(struct inode *inode) |
2165 | { | 2187 | { |
@@ -2230,6 +2252,7 @@ extern void iget_failed(struct inode *); | |||
2230 | extern void end_writeback(struct inode *); | 2252 | extern void end_writeback(struct inode *); |
2231 | extern void __destroy_inode(struct inode *); | 2253 | extern void __destroy_inode(struct inode *); |
2232 | extern struct inode *new_inode(struct super_block *); | 2254 | extern struct inode *new_inode(struct super_block *); |
2255 | extern void free_inode_nonrcu(struct inode *inode); | ||
2233 | extern int should_remove_suid(struct dentry *); | 2256 | extern int should_remove_suid(struct dentry *); |
2234 | extern int file_remove_suid(struct file *); | 2257 | extern int file_remove_suid(struct file *); |
2235 | 2258 | ||
@@ -2446,6 +2469,10 @@ static inline ino_t parent_ino(struct dentry *dentry) | |||
2446 | { | 2469 | { |
2447 | ino_t res; | 2470 | ino_t res; |
2448 | 2471 | ||
2472 | /* | ||
2473 | * Don't strictly need d_lock here? If the parent ino could change | ||
2474 | * then surely we'd have a deeper race in the caller? | ||
2475 | */ | ||
2449 | spin_lock(&dentry->d_lock); | 2476 | spin_lock(&dentry->d_lock); |
2450 | res = dentry->d_parent->d_inode->i_ino; | 2477 | res = dentry->d_parent->d_inode->i_ino; |
2451 | spin_unlock(&dentry->d_lock); | 2478 | spin_unlock(&dentry->d_lock); |
@@ -2528,9 +2555,12 @@ int proc_nr_inodes(struct ctl_table *table, int write, | |||
2528 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2555 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2529 | int __init get_filesystem_list(char *buf); | 2556 | int __init get_filesystem_list(char *buf); |
2530 | 2557 | ||
2558 | #define __FMODE_EXEC ((__force int) FMODE_EXEC) | ||
2559 | #define __FMODE_NONOTIFY ((__force int) FMODE_NONOTIFY) | ||
2560 | |||
2531 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2561 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
2532 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ | 2562 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2533 | (flag & FMODE_NONOTIFY))) | 2563 | (flag & __FMODE_NONOTIFY))) |
2534 | 2564 | ||
2535 | #endif /* __KERNEL__ */ | 2565 | #endif /* __KERNEL__ */ |
2536 | #endif /* _LINUX_FS_H */ | 2566 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index a42b5bf02f8b..003dc0fd7347 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -2,10 +2,13 @@ | |||
2 | #define _LINUX_FS_STRUCT_H | 2 | #define _LINUX_FS_STRUCT_H |
3 | 3 | ||
4 | #include <linux/path.h> | 4 | #include <linux/path.h> |
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/seqlock.h> | ||
5 | 7 | ||
6 | struct fs_struct { | 8 | struct fs_struct { |
7 | int users; | 9 | int users; |
8 | spinlock_t lock; | 10 | spinlock_t lock; |
11 | seqcount_t seq; | ||
9 | int umask; | 12 | int umask; |
10 | int in_exec; | 13 | int in_exec; |
11 | struct path root, pwd; | 14 | struct path root, pwd; |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index b10bcdeaef76..2a53f10712b3 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | /* | 18 | /* |
19 | * fsnotify_d_instantiate - instantiate a dentry for inode | 19 | * fsnotify_d_instantiate - instantiate a dentry for inode |
20 | * Called with dcache_lock held. | ||
21 | */ | 20 | */ |
22 | static inline void fsnotify_d_instantiate(struct dentry *dentry, | 21 | static inline void fsnotify_d_instantiate(struct dentry *dentry, |
23 | struct inode *inode) | 22 | struct inode *inode) |
@@ -62,7 +61,6 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
62 | 61 | ||
63 | /* | 62 | /* |
64 | * fsnotify_d_move - dentry has been moved | 63 | * fsnotify_d_move - dentry has been moved |
65 | * Called with dcache_lock and dentry->d_lock held. | ||
66 | */ | 64 | */ |
67 | static inline void fsnotify_d_move(struct dentry *dentry) | 65 | static inline void fsnotify_d_move(struct dentry *dentry) |
68 | { | 66 | { |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 7380763595d3..69ad89b50489 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -329,9 +329,15 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
329 | { | 329 | { |
330 | struct dentry *parent; | 330 | struct dentry *parent; |
331 | 331 | ||
332 | assert_spin_locked(&dcache_lock); | ||
333 | assert_spin_locked(&dentry->d_lock); | 332 | assert_spin_locked(&dentry->d_lock); |
334 | 333 | ||
334 | /* | ||
335 | * Serialisation of setting PARENT_WATCHED on the dentries is provided | ||
336 | * by d_lock. If inotify_inode_watched changes after we have taken | ||
337 | * d_lock, the following __fsnotify_update_child_dentry_flags call will | ||
338 | * find our entry, so it will spin until we complete here, and update | ||
339 | * us with the new state. | ||
340 | */ | ||
335 | parent = dentry->d_parent; | 341 | parent = dentry->d_parent; |
336 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) | 342 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) |
337 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; | 343 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; |
@@ -341,15 +347,12 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
341 | 347 | ||
342 | /* | 348 | /* |
343 | * fsnotify_d_instantiate - instantiate a dentry for inode | 349 | * fsnotify_d_instantiate - instantiate a dentry for inode |
344 | * Called with dcache_lock held. | ||
345 | */ | 350 | */ |
346 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) | 351 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) |
347 | { | 352 | { |
348 | if (!inode) | 353 | if (!inode) |
349 | return; | 354 | return; |
350 | 355 | ||
351 | assert_spin_locked(&dcache_lock); | ||
352 | |||
353 | spin_lock(&dentry->d_lock); | 356 | spin_lock(&dentry->d_lock); |
354 | __fsnotify_update_dcache_flags(dentry); | 357 | __fsnotify_update_dcache_flags(dentry); |
355 | spin_unlock(&dentry->d_lock); | 358 | spin_unlock(&dentry->d_lock); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 8beabb958f61..47e3997f7b5c 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -154,12 +154,14 @@ enum { | |||
154 | TRACE_EVENT_FL_ENABLED_BIT, | 154 | TRACE_EVENT_FL_ENABLED_BIT, |
155 | TRACE_EVENT_FL_FILTERED_BIT, | 155 | TRACE_EVENT_FL_FILTERED_BIT, |
156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
157 | TRACE_EVENT_FL_CAP_ANY_BIT, | ||
157 | }; | 158 | }; |
158 | 159 | ||
159 | enum { | 160 | enum { |
160 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | 161 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), |
161 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 162 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
162 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 163 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
164 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | ||
163 | }; | 165 | }; |
164 | 166 | ||
165 | struct ftrace_event_call { | 167 | struct ftrace_event_call { |
@@ -196,6 +198,14 @@ struct ftrace_event_call { | |||
196 | #endif | 198 | #endif |
197 | }; | 199 | }; |
198 | 200 | ||
201 | #define __TRACE_EVENT_FLAGS(name, value) \ | ||
202 | static int __init trace_init_flags_##name(void) \ | ||
203 | { \ | ||
204 | event_##name.flags = value; \ | ||
205 | return 0; \ | ||
206 | } \ | ||
207 | early_initcall(trace_init_flags_##name); | ||
208 | |||
199 | #define PERF_MAX_TRACE_SIZE 2048 | 209 | #define PERF_MAX_TRACE_SIZE 2048 |
200 | 210 | ||
201 | #define MAX_FILTER_PRED 32 | 211 | #define MAX_FILTER_PRED 32 |
@@ -215,6 +225,10 @@ enum { | |||
215 | FILTER_PTR_STRING, | 225 | FILTER_PTR_STRING, |
216 | }; | 226 | }; |
217 | 227 | ||
228 | #define EVENT_STORAGE_SIZE 128 | ||
229 | extern struct mutex event_storage_mutex; | ||
230 | extern char event_storage[EVENT_STORAGE_SIZE]; | ||
231 | |||
218 | extern int trace_event_raw_init(struct ftrace_event_call *call); | 232 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
219 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 233 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
220 | const char *name, int offset, int size, | 234 | const char *name, int offset, int size, |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index c3c578e09833..d464de53db43 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/generic_acl.h b/include/linux/generic_acl.h index 574bea4013b6..0437e377b555 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
@@ -10,6 +10,6 @@ extern const struct xattr_handler generic_acl_default_handler; | |||
10 | 10 | ||
11 | int generic_acl_init(struct inode *, struct inode *); | 11 | int generic_acl_init(struct inode *, struct inode *); |
12 | int generic_acl_chmod(struct inode *); | 12 | int generic_acl_chmod(struct inode *); |
13 | int generic_check_acl(struct inode *inode, int mask); | 13 | int generic_check_acl(struct inode *inode, int mask, unsigned int flags); |
14 | 14 | ||
15 | #endif /* LINUX_GENERIC_ACL_H */ | 15 | #endif /* LINUX_GENERIC_ACL_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 7a7b9c1644e4..c0d5f6945c1e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -115,6 +115,7 @@ struct hd_struct { | |||
115 | #else | 115 | #else |
116 | struct disk_stats dkstats; | 116 | struct disk_stats dkstats; |
117 | #endif | 117 | #endif |
118 | atomic_t ref; | ||
118 | struct rcu_head rcu_head; | 119 | struct rcu_head rcu_head; |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -127,6 +128,11 @@ struct hd_struct { | |||
127 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
128 | #define GENHD_FL_NATIVE_CAPACITY 128 | 129 | #define GENHD_FL_NATIVE_CAPACITY 128 |
129 | 130 | ||
131 | enum { | ||
132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | ||
133 | DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */ | ||
134 | }; | ||
135 | |||
130 | #define BLK_SCSI_MAX_CMDS (256) | 136 | #define BLK_SCSI_MAX_CMDS (256) |
131 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 137 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
132 | 138 | ||
@@ -143,6 +149,8 @@ struct disk_part_tbl { | |||
143 | struct hd_struct __rcu *part[]; | 149 | struct hd_struct __rcu *part[]; |
144 | }; | 150 | }; |
145 | 151 | ||
152 | struct disk_events; | ||
153 | |||
146 | struct gendisk { | 154 | struct gendisk { |
147 | /* major, first_minor and minors are input parameters only, | 155 | /* major, first_minor and minors are input parameters only, |
148 | * don't use directly. Use disk_devt() and disk_max_parts(). | 156 | * don't use directly. Use disk_devt() and disk_max_parts(). |
@@ -154,6 +162,10 @@ struct gendisk { | |||
154 | 162 | ||
155 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 163 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
156 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 164 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
165 | |||
166 | unsigned int events; /* supported events */ | ||
167 | unsigned int async_events; /* async events, subset of all */ | ||
168 | |||
157 | /* Array of pointers to partitions indexed by partno. | 169 | /* Array of pointers to partitions indexed by partno. |
158 | * Protected with matching bdev lock but stat and other | 170 | * Protected with matching bdev lock but stat and other |
159 | * non-critical accesses use RCU. Always access through | 171 | * non-critical accesses use RCU. Always access through |
@@ -171,9 +183,8 @@ struct gendisk { | |||
171 | struct kobject *slave_dir; | 183 | struct kobject *slave_dir; |
172 | 184 | ||
173 | struct timer_rand_state *random; | 185 | struct timer_rand_state *random; |
174 | |||
175 | atomic_t sync_io; /* RAID */ | 186 | atomic_t sync_io; /* RAID */ |
176 | struct work_struct async_notify; | 187 | struct disk_events *ev; |
177 | #ifdef CONFIG_BLK_DEV_INTEGRITY | 188 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
178 | struct blk_integrity *integrity; | 189 | struct blk_integrity *integrity; |
179 | #endif | 190 | #endif |
@@ -395,7 +406,6 @@ extern void part_round_stats(int cpu, struct hd_struct *part); | |||
395 | /* block/genhd.c */ | 406 | /* block/genhd.c */ |
396 | extern void add_disk(struct gendisk *disk); | 407 | extern void add_disk(struct gendisk *disk); |
397 | extern void del_gendisk(struct gendisk *gp); | 408 | extern void del_gendisk(struct gendisk *gp); |
398 | extern void unlink_gendisk(struct gendisk *gp); | ||
399 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); | 409 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); |
400 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); | 410 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); |
401 | 411 | ||
@@ -407,6 +417,11 @@ static inline int get_disk_ro(struct gendisk *disk) | |||
407 | return disk->part0.policy; | 417 | return disk->part0.policy; |
408 | } | 418 | } |
409 | 419 | ||
420 | extern void disk_block_events(struct gendisk *disk); | ||
421 | extern void disk_unblock_events(struct gendisk *disk); | ||
422 | extern void disk_check_events(struct gendisk *disk); | ||
423 | extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); | ||
424 | |||
410 | /* drivers/char/random.c */ | 425 | /* drivers/char/random.c */ |
411 | extern void add_disk_randomness(struct gendisk *disk); | 426 | extern void add_disk_randomness(struct gendisk *disk); |
412 | extern void rand_initialize_disk(struct gendisk *disk); | 427 | extern void rand_initialize_disk(struct gendisk *disk); |
@@ -583,6 +598,7 @@ extern struct hd_struct * __must_check add_partition(struct gendisk *disk, | |||
583 | sector_t len, int flags, | 598 | sector_t len, int flags, |
584 | struct partition_meta_info | 599 | struct partition_meta_info |
585 | *info); | 600 | *info); |
601 | extern void __delete_partition(struct hd_struct *); | ||
586 | extern void delete_partition(struct gendisk *, int); | 602 | extern void delete_partition(struct gendisk *, int); |
587 | extern void printk_all_partitions(void); | 603 | extern void printk_all_partitions(void); |
588 | 604 | ||
@@ -611,6 +627,29 @@ extern ssize_t part_fail_store(struct device *dev, | |||
611 | const char *buf, size_t count); | 627 | const char *buf, size_t count); |
612 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ | 628 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ |
613 | 629 | ||
630 | static inline void hd_ref_init(struct hd_struct *part) | ||
631 | { | ||
632 | atomic_set(&part->ref, 1); | ||
633 | smp_mb(); | ||
634 | } | ||
635 | |||
636 | static inline void hd_struct_get(struct hd_struct *part) | ||
637 | { | ||
638 | atomic_inc(&part->ref); | ||
639 | smp_mb__after_atomic_inc(); | ||
640 | } | ||
641 | |||
642 | static inline int hd_struct_try_get(struct hd_struct *part) | ||
643 | { | ||
644 | return atomic_inc_not_zero(&part->ref); | ||
645 | } | ||
646 | |||
647 | static inline void hd_struct_put(struct hd_struct *part) | ||
648 | { | ||
649 | if (atomic_dec_and_test(&part->ref)) | ||
650 | __delete_partition(part); | ||
651 | } | ||
652 | |||
614 | #else /* CONFIG_BLOCK */ | 653 | #else /* CONFIG_BLOCK */ |
615 | 654 | ||
616 | static inline void printk_all_partitions(void) { } | 655 | static inline void printk_all_partitions(void) { } |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index f54adfcbec9c..0b84c61607e8 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 000000000000..4a333bb0bd0d --- /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 e41f7dd1ae67..32720baf70f1 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | 14 | ||
15 | struct device; | 15 | struct device; |
16 | struct gpio; | ||
16 | struct gpio_chip; | 17 | struct gpio_chip; |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -34,6 +35,17 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
34 | return -ENOSYS; | 35 | return -ENOSYS; |
35 | } | 36 | } |
36 | 37 | ||
38 | static inline int gpio_request_one(unsigned gpio, | ||
39 | unsigned long flags, const char *label) | ||
40 | { | ||
41 | return -ENOSYS; | ||
42 | } | ||
43 | |||
44 | static inline int gpio_request_array(struct gpio *array, size_t num) | ||
45 | { | ||
46 | return -ENOSYS; | ||
47 | } | ||
48 | |||
37 | static inline void gpio_free(unsigned gpio) | 49 | static inline void gpio_free(unsigned gpio) |
38 | { | 50 | { |
39 | might_sleep(); | 51 | might_sleep(); |
@@ -42,6 +54,14 @@ static inline void gpio_free(unsigned gpio) | |||
42 | WARN_ON(1); | 54 | WARN_ON(1); |
43 | } | 55 | } |
44 | 56 | ||
57 | static inline void gpio_free_array(struct gpio *array, size_t num) | ||
58 | { | ||
59 | might_sleep(); | ||
60 | |||
61 | /* GPIO can never have been requested */ | ||
62 | WARN_ON(1); | ||
63 | } | ||
64 | |||
45 | static inline int gpio_direction_input(unsigned gpio) | 65 | static inline int gpio_direction_input(unsigned gpio) |
46 | { | 66 | { |
47 | return -ENOSYS; | 67 | return -ENOSYS; |
diff --git a/include/linux/hid.h b/include/linux/hid.h index bb0f56f5c01e..d91c25e253c8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -402,7 +402,7 @@ struct hid_field { | |||
402 | __u16 dpad; /* dpad input code */ | 402 | __u16 dpad; /* dpad input code */ |
403 | }; | 403 | }; |
404 | 404 | ||
405 | #define HID_MAX_FIELDS 64 | 405 | #define HID_MAX_FIELDS 128 |
406 | 406 | ||
407 | struct hid_report { | 407 | struct hid_report { |
408 | struct list_head list; | 408 | struct list_head list; |
@@ -593,6 +593,7 @@ struct hid_usage_id { | |||
593 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 593 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
594 | * @input_mapping: invoked on input registering before mapping an usage | 594 | * @input_mapping: invoked on input registering before mapping an usage |
595 | * @input_mapped: invoked on input registering after mapping an usage | 595 | * @input_mapped: invoked on input registering after mapping an usage |
596 | * @feature_mapping: invoked on feature registering | ||
596 | * @suspend: invoked on suspend (NULL means nop) | 597 | * @suspend: invoked on suspend (NULL means nop) |
597 | * @resume: invoked on resume if device was not reset (NULL means nop) | 598 | * @resume: invoked on resume if device was not reset (NULL means nop) |
598 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 599 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
@@ -636,6 +637,9 @@ struct hid_driver { | |||
636 | int (*input_mapped)(struct hid_device *hdev, | 637 | int (*input_mapped)(struct hid_device *hdev, |
637 | struct hid_input *hidinput, struct hid_field *field, | 638 | struct hid_input *hidinput, struct hid_field *field, |
638 | struct hid_usage *usage, unsigned long **bit, int *max); | 639 | struct hid_usage *usage, unsigned long **bit, int *max); |
640 | void (*feature_mapping)(struct hid_device *hdev, | ||
641 | struct hid_input *hidinput, struct hid_field *field, | ||
642 | struct hid_usage *usage); | ||
639 | #ifdef CONFIG_PM | 643 | #ifdef CONFIG_PM |
640 | int (*suspend)(struct hid_device *hdev, pm_message_t message); | 644 | int (*suspend)(struct hid_device *hdev, pm_message_t message); |
641 | int (*resume)(struct hid_device *hdev); | 645 | int (*resume)(struct hid_device *hdev); |
@@ -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/highmem.h b/include/linux/highmem.h index b676c585574e..3a93f73a8acc 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -81,7 +81,8 @@ DECLARE_PER_CPU(int, __kmap_atomic_idx); | |||
81 | 81 | ||
82 | static inline int kmap_atomic_idx_push(void) | 82 | static inline int kmap_atomic_idx_push(void) |
83 | { | 83 | { |
84 | int idx = __get_cpu_var(__kmap_atomic_idx)++; | 84 | int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1; |
85 | |||
85 | #ifdef CONFIG_DEBUG_HIGHMEM | 86 | #ifdef CONFIG_DEBUG_HIGHMEM |
86 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); | 87 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); |
87 | BUG_ON(idx > KM_TYPE_NR); | 88 | BUG_ON(idx > KM_TYPE_NR); |
@@ -91,16 +92,18 @@ static inline int kmap_atomic_idx_push(void) | |||
91 | 92 | ||
92 | static inline int kmap_atomic_idx(void) | 93 | static inline int kmap_atomic_idx(void) |
93 | { | 94 | { |
94 | return __get_cpu_var(__kmap_atomic_idx) - 1; | 95 | return __this_cpu_read(__kmap_atomic_idx) - 1; |
95 | } | 96 | } |
96 | 97 | ||
97 | static inline int kmap_atomic_idx_pop(void) | 98 | static inline void kmap_atomic_idx_pop(void) |
98 | { | 99 | { |
99 | int idx = --__get_cpu_var(__kmap_atomic_idx); | ||
100 | #ifdef CONFIG_DEBUG_HIGHMEM | 100 | #ifdef CONFIG_DEBUG_HIGHMEM |
101 | int idx = __this_cpu_dec_return(__kmap_atomic_idx); | ||
102 | |||
101 | BUG_ON(idx < 0); | 103 | BUG_ON(idx < 0); |
104 | #else | ||
105 | __this_cpu_dec(__kmap_atomic_idx); | ||
102 | #endif | 106 | #endif |
103 | return idx; | ||
104 | } | 107 | } |
105 | 108 | ||
106 | #endif | 109 | #endif |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index fd0c1b857d3d..f376ddc64c4d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | 25 | #include <linux/timerqueue.h> | |
26 | 26 | ||
27 | struct hrtimer_clock_base; | 27 | struct hrtimer_clock_base; |
28 | struct hrtimer_cpu_base; | 28 | struct hrtimer_cpu_base; |
@@ -79,8 +79,8 @@ enum hrtimer_restart { | |||
79 | 79 | ||
80 | /** | 80 | /** |
81 | * struct hrtimer - the basic hrtimer structure | 81 | * struct hrtimer - the basic hrtimer structure |
82 | * @node: red black tree node for time ordered insertion | 82 | * @node: timerqueue node, which also manages node.expires, |
83 | * @_expires: the absolute expiry time in the hrtimers internal | 83 | * the absolute expiry time in the hrtimers internal |
84 | * representation. The time is related to the clock on | 84 | * representation. The time is related to the clock on |
85 | * which the timer is based. Is setup by adding | 85 | * which the timer is based. Is setup by adding |
86 | * slack to the _softexpires value. For non range timers | 86 | * slack to the _softexpires value. For non range timers |
@@ -101,8 +101,7 @@ enum hrtimer_restart { | |||
101 | * The hrtimer structure must be initialized by hrtimer_init() | 101 | * The hrtimer structure must be initialized by hrtimer_init() |
102 | */ | 102 | */ |
103 | struct hrtimer { | 103 | struct hrtimer { |
104 | struct rb_node node; | 104 | struct timerqueue_node node; |
105 | ktime_t _expires; | ||
106 | ktime_t _softexpires; | 105 | ktime_t _softexpires; |
107 | enum hrtimer_restart (*function)(struct hrtimer *); | 106 | enum hrtimer_restart (*function)(struct hrtimer *); |
108 | struct hrtimer_clock_base *base; | 107 | struct hrtimer_clock_base *base; |
@@ -132,7 +131,6 @@ struct hrtimer_sleeper { | |||
132 | * @index: clock type index for per_cpu support when moving a | 131 | * @index: clock type index for per_cpu support when moving a |
133 | * timer to a base on another cpu. | 132 | * timer to a base on another cpu. |
134 | * @active: red black tree root node for the active timers | 133 | * @active: red black tree root node for the active timers |
135 | * @first: pointer to the timer node which expires first | ||
136 | * @resolution: the resolution of the clock, in nanoseconds | 134 | * @resolution: the resolution of the clock, in nanoseconds |
137 | * @get_time: function to retrieve the current time of the clock | 135 | * @get_time: function to retrieve the current time of the clock |
138 | * @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 |
@@ -141,8 +139,7 @@ struct hrtimer_sleeper { | |||
141 | struct hrtimer_clock_base { | 139 | struct hrtimer_clock_base { |
142 | struct hrtimer_cpu_base *cpu_base; | 140 | struct hrtimer_cpu_base *cpu_base; |
143 | clockid_t index; | 141 | clockid_t index; |
144 | struct rb_root active; | 142 | struct timerqueue_head active; |
145 | struct rb_node *first; | ||
146 | ktime_t resolution; | 143 | ktime_t resolution; |
147 | ktime_t (*get_time)(void); | 144 | ktime_t (*get_time)(void); |
148 | ktime_t softirq_time; | 145 | ktime_t softirq_time; |
@@ -158,7 +155,6 @@ struct hrtimer_clock_base { | |||
158 | * @lock: lock protecting the base and associated clock bases | 155 | * @lock: lock protecting the base and associated clock bases |
159 | * and timers | 156 | * and timers |
160 | * @clock_base: array of clock bases for this cpu | 157 | * @clock_base: array of clock bases for this cpu |
161 | * @curr_timer: the timer which is executing a callback right now | ||
162 | * @expires_next: absolute time of the next event which was scheduled | 158 | * @expires_next: absolute time of the next event which was scheduled |
163 | * via clock_set_next_event() | 159 | * via clock_set_next_event() |
164 | * @hres_active: State of high resolution mode | 160 | * @hres_active: State of high resolution mode |
@@ -184,43 +180,43 @@ struct hrtimer_cpu_base { | |||
184 | 180 | ||
185 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 181 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
186 | { | 182 | { |
187 | timer->_expires = time; | 183 | timer->node.expires = time; |
188 | timer->_softexpires = time; | 184 | timer->_softexpires = time; |
189 | } | 185 | } |
190 | 186 | ||
191 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) | 187 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) |
192 | { | 188 | { |
193 | timer->_softexpires = time; | 189 | timer->_softexpires = time; |
194 | timer->_expires = ktime_add_safe(time, delta); | 190 | timer->node.expires = ktime_add_safe(time, delta); |
195 | } | 191 | } |
196 | 192 | ||
197 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) | 193 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) |
198 | { | 194 | { |
199 | timer->_softexpires = time; | 195 | timer->_softexpires = time; |
200 | timer->_expires = ktime_add_safe(time, ns_to_ktime(delta)); | 196 | timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); |
201 | } | 197 | } |
202 | 198 | ||
203 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) | 199 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) |
204 | { | 200 | { |
205 | timer->_expires.tv64 = tv64; | 201 | timer->node.expires.tv64 = tv64; |
206 | timer->_softexpires.tv64 = tv64; | 202 | timer->_softexpires.tv64 = tv64; |
207 | } | 203 | } |
208 | 204 | ||
209 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) | 205 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) |
210 | { | 206 | { |
211 | timer->_expires = ktime_add_safe(timer->_expires, time); | 207 | timer->node.expires = ktime_add_safe(timer->node.expires, time); |
212 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); | 208 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); |
213 | } | 209 | } |
214 | 210 | ||
215 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) | 211 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) |
216 | { | 212 | { |
217 | timer->_expires = ktime_add_ns(timer->_expires, ns); | 213 | timer->node.expires = ktime_add_ns(timer->node.expires, ns); |
218 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); | 214 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); |
219 | } | 215 | } |
220 | 216 | ||
221 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) | 217 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) |
222 | { | 218 | { |
223 | return timer->_expires; | 219 | return timer->node.expires; |
224 | } | 220 | } |
225 | 221 | ||
226 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | 222 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) |
@@ -230,7 +226,7 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | |||
230 | 226 | ||
231 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) | 227 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) |
232 | { | 228 | { |
233 | return timer->_expires.tv64; | 229 | return timer->node.expires.tv64; |
234 | } | 230 | } |
235 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | 231 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) |
236 | { | 232 | { |
@@ -239,12 +235,12 @@ static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | |||
239 | 235 | ||
240 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) | 236 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) |
241 | { | 237 | { |
242 | return ktime_to_ns(timer->_expires); | 238 | return ktime_to_ns(timer->node.expires); |
243 | } | 239 | } |
244 | 240 | ||
245 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) | 241 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) |
246 | { | 242 | { |
247 | return ktime_sub(timer->_expires, timer->base->get_time()); | 243 | return ktime_sub(timer->node.expires, timer->base->get_time()); |
248 | } | 244 | } |
249 | 245 | ||
250 | #ifdef CONFIG_HIGH_RES_TIMERS | 246 | #ifdef CONFIG_HIGH_RES_TIMERS |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h new file mode 100644 index 000000000000..df29c8fde36b --- /dev/null +++ b/include/linux/huge_mm.h | |||
@@ -0,0 +1,180 @@ | |||
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 | !is_vma_temporary_stack(__vma)) | ||
62 | #define transparent_hugepage_defrag(__vma) \ | ||
63 | ((transparent_hugepage_flags & \ | ||
64 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_FLAG)) || \ | ||
65 | (transparent_hugepage_flags & \ | ||
66 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ | ||
67 | (__vma)->vm_flags & VM_HUGEPAGE)) | ||
68 | #ifdef CONFIG_DEBUG_VM | ||
69 | #define transparent_hugepage_debug_cow() \ | ||
70 | (transparent_hugepage_flags & \ | ||
71 | (1<<TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG)) | ||
72 | #else /* CONFIG_DEBUG_VM */ | ||
73 | #define transparent_hugepage_debug_cow() 0 | ||
74 | #endif /* CONFIG_DEBUG_VM */ | ||
75 | |||
76 | extern unsigned long transparent_hugepage_flags; | ||
77 | extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, | ||
78 | pmd_t *dst_pmd, pmd_t *src_pmd, | ||
79 | struct vm_area_struct *vma, | ||
80 | unsigned long addr, unsigned long end); | ||
81 | extern int handle_pte_fault(struct mm_struct *mm, | ||
82 | struct vm_area_struct *vma, unsigned long address, | ||
83 | pte_t *pte, pmd_t *pmd, unsigned int flags); | ||
84 | extern int split_huge_page(struct page *page); | ||
85 | extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); | ||
86 | #define split_huge_page_pmd(__mm, __pmd) \ | ||
87 | do { \ | ||
88 | pmd_t *____pmd = (__pmd); \ | ||
89 | if (unlikely(pmd_trans_huge(*____pmd))) \ | ||
90 | __split_huge_page_pmd(__mm, ____pmd); \ | ||
91 | } while (0) | ||
92 | #define wait_split_huge_page(__anon_vma, __pmd) \ | ||
93 | do { \ | ||
94 | pmd_t *____pmd = (__pmd); \ | ||
95 | spin_unlock_wait(&(__anon_vma)->root->lock); \ | ||
96 | /* \ | ||
97 | * spin_unlock_wait() is just a loop in C and so the \ | ||
98 | * CPU can reorder anything around it. \ | ||
99 | */ \ | ||
100 | smp_mb(); \ | ||
101 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | ||
102 | pmd_trans_huge(*____pmd)); \ | ||
103 | } while (0) | ||
104 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ||
105 | #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) | ||
106 | #if HPAGE_PMD_ORDER > MAX_ORDER | ||
107 | #error "hugepages can't be allocated by the buddy allocator" | ||
108 | #endif | ||
109 | extern int hugepage_madvise(struct vm_area_struct *vma, | ||
110 | unsigned long *vm_flags, int advice); | ||
111 | extern void __vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
112 | unsigned long start, | ||
113 | unsigned long end, | ||
114 | long adjust_next); | ||
115 | static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
116 | unsigned long start, | ||
117 | unsigned long end, | ||
118 | long adjust_next) | ||
119 | { | ||
120 | if (!vma->anon_vma || vma->vm_ops || vma->vm_file) | ||
121 | return; | ||
122 | __vma_adjust_trans_huge(vma, start, end, adjust_next); | ||
123 | } | ||
124 | static inline int hpage_nr_pages(struct page *page) | ||
125 | { | ||
126 | if (unlikely(PageTransHuge(page))) | ||
127 | return HPAGE_PMD_NR; | ||
128 | return 1; | ||
129 | } | ||
130 | static inline struct page *compound_trans_head(struct page *page) | ||
131 | { | ||
132 | if (PageTail(page)) { | ||
133 | struct page *head; | ||
134 | head = page->first_page; | ||
135 | smp_rmb(); | ||
136 | /* | ||
137 | * head may be a dangling pointer. | ||
138 | * __split_huge_page_refcount clears PageTail before | ||
139 | * overwriting first_page, so if PageTail is still | ||
140 | * there it means the head pointer isn't dangling. | ||
141 | */ | ||
142 | if (PageTail(page)) | ||
143 | return head; | ||
144 | } | ||
145 | return page; | ||
146 | } | ||
147 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
148 | #define HPAGE_PMD_SHIFT ({ BUG(); 0; }) | ||
149 | #define HPAGE_PMD_MASK ({ BUG(); 0; }) | ||
150 | #define HPAGE_PMD_SIZE ({ BUG(); 0; }) | ||
151 | |||
152 | #define hpage_nr_pages(x) 1 | ||
153 | |||
154 | #define transparent_hugepage_enabled(__vma) 0 | ||
155 | |||
156 | #define transparent_hugepage_flags 0UL | ||
157 | static inline int split_huge_page(struct page *page) | ||
158 | { | ||
159 | return 0; | ||
160 | } | ||
161 | #define split_huge_page_pmd(__mm, __pmd) \ | ||
162 | do { } while (0) | ||
163 | #define wait_split_huge_page(__anon_vma, __pmd) \ | ||
164 | do { } while (0) | ||
165 | #define compound_trans_head(page) compound_head(page) | ||
166 | static inline int hugepage_madvise(struct vm_area_struct *vma, | ||
167 | unsigned long *vm_flags, int advice) | ||
168 | { | ||
169 | BUG(); | ||
170 | return 0; | ||
171 | } | ||
172 | static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, | ||
173 | unsigned long start, | ||
174 | unsigned long end, | ||
175 | long adjust_next) | ||
176 | { | ||
177 | } | ||
178 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
179 | |||
180 | #endif /* _LINUX_HUGE_MM_H */ | ||
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index 78ebf507ce56..7472449cbb74 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -1,9 +1,14 @@ | |||
1 | #ifndef __I2C_OMAP_H__ | 1 | #ifndef __I2C_OMAP_H__ |
2 | #define __I2C_OMAP_H__ | 2 | #define __I2C_OMAP_H__ |
3 | 3 | ||
4 | #include <linux/platform_device.h> | ||
5 | |||
4 | struct omap_i2c_bus_platform_data { | 6 | struct omap_i2c_bus_platform_data { |
5 | u32 clkrate; | 7 | u32 clkrate; |
6 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | 8 | void (*set_mpu_wkup_lat)(struct device *dev, long set); |
9 | int (*device_enable) (struct platform_device *pdev); | ||
10 | int (*device_shutdown) (struct platform_device *pdev); | ||
11 | int (*device_idle) (struct platform_device *pdev); | ||
7 | }; | 12 | }; |
8 | 13 | ||
9 | #endif | 14 | #endif |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 56cfe23ffb39..903576df88dc 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 000000000000..736bb87ac0fc --- /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/i2c/twl.h b/include/linux/i2c/twl.h index c760991b354a..61b9609e55f2 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -593,6 +593,13 @@ enum twl4030_usb_mode { | |||
593 | 593 | ||
594 | struct twl4030_usb_data { | 594 | struct twl4030_usb_data { |
595 | enum twl4030_usb_mode usb_mode; | 595 | enum twl4030_usb_mode usb_mode; |
596 | |||
597 | int (*phy_init)(struct device *dev); | ||
598 | int (*phy_exit)(struct device *dev); | ||
599 | /* Power on/off the PHY */ | ||
600 | int (*phy_power)(struct device *dev, int iD, int on); | ||
601 | /* enable/disable phy clocks */ | ||
602 | int (*phy_set_clock)(struct device *dev, int on); | ||
596 | }; | 603 | }; |
597 | 604 | ||
598 | struct twl4030_ins { | 605 | struct twl4030_ins { |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index ed5a03cbe184..294169e31364 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -122,6 +122,7 @@ | |||
122 | 122 | ||
123 | /* U-APSD queue for WMM IEs sent by AP */ | 123 | /* U-APSD queue for WMM IEs sent by AP */ |
124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | 124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) |
125 | #define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f | ||
125 | 126 | ||
126 | /* U-APSD queues for WMM IEs sent by STA */ | 127 | /* U-APSD queues for WMM IEs sent by STA */ |
127 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) | 128 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) |
@@ -535,7 +536,6 @@ struct ieee80211s_hdr { | |||
535 | __le32 seqnum; | 536 | __le32 seqnum; |
536 | u8 eaddr1[6]; | 537 | u8 eaddr1[6]; |
537 | u8 eaddr2[6]; | 538 | u8 eaddr2[6]; |
538 | u8 eaddr3[6]; | ||
539 | } __attribute__ ((packed)); | 539 | } __attribute__ ((packed)); |
540 | 540 | ||
541 | /* Mesh flags */ | 541 | /* Mesh flags */ |
@@ -959,7 +959,7 @@ struct ieee80211_ht_info { | |||
959 | /* block-ack parameters */ | 959 | /* block-ack parameters */ |
960 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 | 960 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
961 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C | 961 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C |
962 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 | 962 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 |
963 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 | 963 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 |
964 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 | 964 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 |
965 | 965 | ||
@@ -1223,6 +1223,9 @@ enum ieee80211_eid { | |||
1223 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, | 1223 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, |
1224 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, | 1224 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, |
1225 | WLAN_EID_MULTIPLE_BSSID = 71, | 1225 | WLAN_EID_MULTIPLE_BSSID = 71, |
1226 | WLAN_EID_BSS_COEX_2040 = 72, | ||
1227 | WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, | ||
1228 | WLAN_EID_EXT_CAPABILITY = 127, | ||
1226 | 1229 | ||
1227 | WLAN_EID_MOBILITY_DOMAIN = 54, | 1230 | WLAN_EID_MOBILITY_DOMAIN = 54, |
1228 | WLAN_EID_FAST_BSS_TRANSITION = 55, | 1231 | WLAN_EID_FAST_BSS_TRANSITION = 55, |
@@ -1287,6 +1290,31 @@ enum ieee80211_key_len { | |||
1287 | WLAN_KEY_LEN_AES_CMAC = 16, | 1290 | WLAN_KEY_LEN_AES_CMAC = 16, |
1288 | }; | 1291 | }; |
1289 | 1292 | ||
1293 | /** | ||
1294 | * enum - mesh path selection protocol identifier | ||
1295 | * | ||
1296 | * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol | ||
1297 | * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will | ||
1298 | * be specified in a vendor specific information element | ||
1299 | */ | ||
1300 | enum { | ||
1301 | IEEE80211_PATH_PROTOCOL_HWMP = 0, | ||
1302 | IEEE80211_PATH_PROTOCOL_VENDOR = 255, | ||
1303 | }; | ||
1304 | |||
1305 | /** | ||
1306 | * enum - mesh path selection metric identifier | ||
1307 | * | ||
1308 | * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric | ||
1309 | * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be | ||
1310 | * specified in a vendor specific information element | ||
1311 | */ | ||
1312 | enum { | ||
1313 | IEEE80211_PATH_METRIC_AIRTIME = 0, | ||
1314 | IEEE80211_PATH_METRIC_VENDOR = 255, | ||
1315 | }; | ||
1316 | |||
1317 | |||
1290 | /* | 1318 | /* |
1291 | * IEEE 802.11-2007 7.3.2.9 Country information element | 1319 | * IEEE 802.11-2007 7.3.2.9 Country information element |
1292 | * | 1320 | * |
diff --git a/include/linux/if_alg.h b/include/linux/if_alg.h new file mode 100644 index 000000000000..0f9acce5b1ff --- /dev/null +++ b/include/linux/if_alg.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * if_alg: User-space algorithm interface | ||
3 | * | ||
4 | * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _LINUX_IF_ALG_H | ||
14 | #define _LINUX_IF_ALG_H | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct sockaddr_alg { | ||
19 | __u16 salg_family; | ||
20 | __u8 salg_type[14]; | ||
21 | __u32 salg_feat; | ||
22 | __u32 salg_mask; | ||
23 | __u8 salg_name[64]; | ||
24 | }; | ||
25 | |||
26 | struct af_alg_iv { | ||
27 | __u32 ivlen; | ||
28 | __u8 iv[0]; | ||
29 | }; | ||
30 | |||
31 | /* Socket options */ | ||
32 | #define ALG_SET_KEY 1 | ||
33 | #define ALG_SET_IV 2 | ||
34 | #define ALG_SET_OP 3 | ||
35 | |||
36 | /* Operations */ | ||
37 | #define ALG_OP_DECRYPT 0 | ||
38 | #define ALG_OP_ENCRYPT 1 | ||
39 | |||
40 | #endif /* _LINUX_IF_ALG_H */ | ||
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 0d241a5c4909..dd3f20139640 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -102,7 +102,9 @@ struct __fdb_entry { | |||
102 | #include <linux/netdevice.h> | 102 | #include <linux/netdevice.h> |
103 | 103 | ||
104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); | 104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); |
105 | extern int (*br_should_route_hook)(struct sk_buff *skb); | 105 | |
106 | typedef int br_should_route_hook_t(struct sk_buff *skb); | ||
107 | extern br_should_route_hook_t __rcu *br_should_route_hook; | ||
106 | 108 | ||
107 | #endif | 109 | #endif |
108 | 110 | ||
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index f9c3df03db0f..be69043d2896 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ | 72 | #define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ |
73 | #define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ | 73 | #define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ |
74 | #define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ | 74 | #define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ |
75 | #define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */ | ||
75 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport | 76 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport |
76 | * over Ethernet | 77 | * over Ethernet |
77 | */ | 78 | */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 2fc66dd783ee..6485d2a89bec 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -80,6 +80,24 @@ struct rtnl_link_ifmap { | |||
80 | __u8 port; | 80 | __u8 port; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | /* | ||
84 | * IFLA_AF_SPEC | ||
85 | * Contains nested attributes for address family specific attributes. | ||
86 | * Each address family may create a attribute with the address family | ||
87 | * number as type and create its own attribute structure in it. | ||
88 | * | ||
89 | * Example: | ||
90 | * [IFLA_AF_SPEC] = { | ||
91 | * [AF_INET] = { | ||
92 | * [IFLA_INET_CONF] = ..., | ||
93 | * }, | ||
94 | * [AF_INET6] = { | ||
95 | * [IFLA_INET6_FLAGS] = ..., | ||
96 | * [IFLA_INET6_CONF] = ..., | ||
97 | * } | ||
98 | * } | ||
99 | */ | ||
100 | |||
83 | enum { | 101 | enum { |
84 | IFLA_UNSPEC, | 102 | IFLA_UNSPEC, |
85 | IFLA_ADDRESS, | 103 | IFLA_ADDRESS, |
@@ -116,6 +134,7 @@ enum { | |||
116 | IFLA_STATS64, | 134 | IFLA_STATS64, |
117 | IFLA_VF_PORTS, | 135 | IFLA_VF_PORTS, |
118 | IFLA_PORT_SELF, | 136 | IFLA_PORT_SELF, |
137 | IFLA_AF_SPEC, | ||
119 | __IFLA_MAX | 138 | __IFLA_MAX |
120 | }; | 139 | }; |
121 | 140 | ||
@@ -128,6 +147,14 @@ enum { | |||
128 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) | 147 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) |
129 | #endif | 148 | #endif |
130 | 149 | ||
150 | enum { | ||
151 | IFLA_INET_UNSPEC, | ||
152 | IFLA_INET_CONF, | ||
153 | __IFLA_INET_MAX, | ||
154 | }; | ||
155 | |||
156 | #define IFLA_INET_MAX (__IFLA_INET_MAX - 1) | ||
157 | |||
131 | /* ifi_flags. | 158 | /* ifi_flags. |
132 | 159 | ||
133 | IFF_* flags. | 160 | IFF_* flags. |
@@ -232,6 +259,7 @@ enum macvlan_mode { | |||
232 | MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ | 259 | MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ |
233 | MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ | 260 | MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ |
234 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | 261 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ |
262 | MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */ | ||
235 | }; | 263 | }; |
236 | 264 | ||
237 | /* SR-IOV virtual function management section */ | 265 | /* SR-IOV virtual function management section */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 8a2fd66a8b5f..e28b2e4959d4 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -25,19 +25,25 @@ struct macvlan_port; | |||
25 | struct macvtap_queue; | 25 | struct macvtap_queue; |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * struct macvlan_rx_stats - MACVLAN percpu rx stats | 28 | * struct macvlan_pcpu_stats - MACVLAN percpu stats |
29 | * @rx_packets: number of received packets | 29 | * @rx_packets: number of received packets |
30 | * @rx_bytes: number of received bytes | 30 | * @rx_bytes: number of received bytes |
31 | * @rx_multicast: number of received multicast packets | 31 | * @rx_multicast: number of received multicast packets |
32 | * @tx_packets: number of transmitted packets | ||
33 | * @tx_bytes: number of transmitted bytes | ||
32 | * @syncp: synchronization point for 64bit counters | 34 | * @syncp: synchronization point for 64bit counters |
33 | * @rx_errors: number of errors | 35 | * @rx_errors: number of rx errors |
36 | * @tx_dropped: number of tx dropped packets | ||
34 | */ | 37 | */ |
35 | struct macvlan_rx_stats { | 38 | struct macvlan_pcpu_stats { |
36 | u64 rx_packets; | 39 | u64 rx_packets; |
37 | u64 rx_bytes; | 40 | u64 rx_bytes; |
38 | u64 rx_multicast; | 41 | u64 rx_multicast; |
42 | u64 tx_packets; | ||
43 | u64 tx_bytes; | ||
39 | struct u64_stats_sync syncp; | 44 | struct u64_stats_sync syncp; |
40 | unsigned long rx_errors; | 45 | u32 rx_errors; |
46 | u32 tx_dropped; | ||
41 | }; | 47 | }; |
42 | 48 | ||
43 | /* | 49 | /* |
@@ -52,7 +58,7 @@ struct macvlan_dev { | |||
52 | struct hlist_node hlist; | 58 | struct hlist_node hlist; |
53 | struct macvlan_port *port; | 59 | struct macvlan_port *port; |
54 | struct net_device *lowerdev; | 60 | struct net_device *lowerdev; |
55 | struct macvlan_rx_stats __percpu *rx_stats; | 61 | struct macvlan_pcpu_stats __percpu *pcpu_stats; |
56 | enum macvlan_mode mode; | 62 | enum macvlan_mode mode; |
57 | int (*receive)(struct sk_buff *skb); | 63 | int (*receive)(struct sk_buff *skb); |
58 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | 64 | int (*forward)(struct net_device *dev, struct sk_buff *skb); |
@@ -64,18 +70,18 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
64 | unsigned int len, bool success, | 70 | unsigned int len, bool success, |
65 | bool multicast) | 71 | bool multicast) |
66 | { | 72 | { |
67 | struct macvlan_rx_stats *rx_stats; | ||
68 | |||
69 | rx_stats = this_cpu_ptr(vlan->rx_stats); | ||
70 | if (likely(success)) { | 73 | if (likely(success)) { |
71 | u64_stats_update_begin(&rx_stats->syncp); | 74 | struct macvlan_pcpu_stats *pcpu_stats; |
72 | rx_stats->rx_packets++;; | 75 | |
73 | rx_stats->rx_bytes += len; | 76 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
77 | u64_stats_update_begin(&pcpu_stats->syncp); | ||
78 | pcpu_stats->rx_packets++; | ||
79 | pcpu_stats->rx_bytes += len; | ||
74 | if (multicast) | 80 | if (multicast) |
75 | rx_stats->rx_multicast++; | 81 | pcpu_stats->rx_multicast++; |
76 | u64_stats_update_end(&rx_stats->syncp); | 82 | u64_stats_update_end(&pcpu_stats->syncp); |
77 | } else { | 83 | } else { |
78 | rx_stats->rx_errors++; | 84 | this_cpu_inc(vlan->pcpu_stats->rx_errors); |
79 | } | 85 | } |
80 | } | 86 | } |
81 | 87 | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 93fc2449af10..74cfcff0148b 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -85,9 +85,9 @@ struct igmpv3_query { | |||
85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ | 85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ |
86 | #define IGMP_PIM 0x14 /* PIM routing */ | 86 | #define IGMP_PIM 0x14 /* PIM routing */ |
87 | #define IGMP_TRACE 0x15 | 87 | #define IGMP_TRACE 0x15 |
88 | #define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x11 */ | 88 | #define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */ |
89 | #define IGMP_HOST_LEAVE_MESSAGE 0x17 | 89 | #define IGMP_HOST_LEAVE_MESSAGE 0x17 |
90 | #define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */ | 90 | #define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */ |
91 | 91 | ||
92 | #define IGMP_MTRACE_RESP 0x1e | 92 | #define IGMP_MTRACE_RESP 0x1e |
93 | #define IGMP_MTRACE 0x1f | 93 | #define IGMP_MTRACE 0x1f |
@@ -167,10 +167,10 @@ struct ip_sf_socklist { | |||
167 | */ | 167 | */ |
168 | 168 | ||
169 | struct ip_mc_socklist { | 169 | struct ip_mc_socklist { |
170 | struct ip_mc_socklist *next; | 170 | struct ip_mc_socklist __rcu *next_rcu; |
171 | struct ip_mreqn multi; | 171 | struct ip_mreqn multi; |
172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
173 | struct ip_sf_socklist *sflist; | 173 | struct ip_sf_socklist __rcu *sflist; |
174 | struct rcu_head rcu; | 174 | struct rcu_head rcu; |
175 | }; | 175 | }; |
176 | 176 | ||
@@ -186,11 +186,14 @@ struct ip_sf_list { | |||
186 | struct ip_mc_list { | 186 | struct ip_mc_list { |
187 | struct in_device *interface; | 187 | struct in_device *interface; |
188 | __be32 multiaddr; | 188 | __be32 multiaddr; |
189 | unsigned int sfmode; | ||
189 | struct ip_sf_list *sources; | 190 | struct ip_sf_list *sources; |
190 | struct ip_sf_list *tomb; | 191 | struct ip_sf_list *tomb; |
191 | unsigned int sfmode; | ||
192 | unsigned long sfcount[2]; | 192 | unsigned long sfcount[2]; |
193 | struct ip_mc_list *next; | 193 | union { |
194 | struct ip_mc_list *next; | ||
195 | struct ip_mc_list __rcu *next_rcu; | ||
196 | }; | ||
194 | struct timer_list timer; | 197 | struct timer_list timer; |
195 | int users; | 198 | int users; |
196 | atomic_t refcnt; | 199 | atomic_t refcnt; |
@@ -201,6 +204,7 @@ struct ip_mc_list { | |||
201 | char loaded; | 204 | char loaded; |
202 | unsigned char gsquery; /* check source marks? */ | 205 | unsigned char gsquery; /* check source marks? */ |
203 | unsigned char crcount; | 206 | unsigned char crcount; |
207 | struct rcu_head rcu; | ||
204 | }; | 208 | }; |
205 | 209 | ||
206 | /* V3 exponential field decoding */ | 210 | /* V3 exponential field decoding */ |
@@ -234,7 +238,7 @@ extern void ip_mc_unmap(struct in_device *); | |||
234 | extern void ip_mc_remap(struct in_device *); | 238 | extern void ip_mc_remap(struct in_device *); |
235 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); | 239 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
236 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); | 240 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
237 | extern void ip_mc_rejoin_group(struct ip_mc_list *im); | 241 | extern void ip_mc_rejoin_groups(struct in_device *in_dev); |
238 | 242 | ||
239 | #endif | 243 | #endif |
240 | #endif | 244 | #endif |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index ccd5b07d678d..ae8fdc54e0c0 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -41,10 +41,12 @@ enum | |||
41 | __IPV4_DEVCONF_MAX | 41 | __IPV4_DEVCONF_MAX |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) | ||
45 | |||
44 | struct ipv4_devconf { | 46 | struct ipv4_devconf { |
45 | void *sysctl; | 47 | void *sysctl; |
46 | int data[__IPV4_DEVCONF_MAX - 1]; | 48 | int data[IPV4_DEVCONF_MAX]; |
47 | DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); | 49 | DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); |
48 | }; | 50 | }; |
49 | 51 | ||
50 | struct in_device { | 52 | struct in_device { |
@@ -52,9 +54,8 @@ struct in_device { | |||
52 | atomic_t refcnt; | 54 | atomic_t refcnt; |
53 | int dead; | 55 | int dead; |
54 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 56 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
55 | rwlock_t mc_list_lock; | 57 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ |
56 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ | 58 | int mc_count; /* Number of installed mcasts */ |
57 | int mc_count; /* Number of installed mcasts */ | ||
58 | spinlock_t mc_tomb_lock; | 59 | spinlock_t mc_tomb_lock; |
59 | struct ip_mc_list *mc_tomb; | 60 | struct ip_mc_list *mc_tomb; |
60 | unsigned long mr_v1_seen; | 61 | unsigned long mr_v1_seen; |
@@ -91,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, | |||
91 | 92 | ||
92 | static inline void ipv4_devconf_setall(struct in_device *in_dev) | 93 | static inline void ipv4_devconf_setall(struct in_device *in_dev) |
93 | { | 94 | { |
94 | bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); | 95 | bitmap_fill(in_dev->cnf.state, IPV4_DEVCONF_MAX); |
95 | } | 96 | } |
96 | 97 | ||
97 | #define IN_DEV_CONF_GET(in_dev, attr) \ | 98 | #define IN_DEV_CONF_GET(in_dev, attr) \ |
@@ -221,7 +222,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev) | |||
221 | 222 | ||
222 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) | 223 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) |
223 | { | 224 | { |
224 | return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held()); | 225 | return rtnl_dereference(dev->ip_ptr); |
225 | } | 226 | } |
226 | 227 | ||
227 | extern void in_dev_finish_destroy(struct in_device *idev); | 228 | extern void in_dev_finish_destroy(struct in_device *idev); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 1f8c06ce0fa6..caa151fbebb7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -12,6 +12,13 @@ | |||
12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
13 | #include <net/net_namespace.h> | 13 | #include <net/net_namespace.h> |
14 | 14 | ||
15 | #ifdef CONFIG_SMP | ||
16 | # define INIT_PUSHABLE_TASKS(tsk) \ | ||
17 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), | ||
18 | #else | ||
19 | # define INIT_PUSHABLE_TASKS(tsk) | ||
20 | #endif | ||
21 | |||
15 | extern struct files_struct init_files; | 22 | extern struct files_struct init_files; |
16 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
17 | 24 | ||
@@ -83,6 +90,12 @@ extern struct group_info init_groups; | |||
83 | */ | 90 | */ |
84 | # define CAP_INIT_BSET CAP_FULL_SET | 91 | # define CAP_INIT_BSET CAP_FULL_SET |
85 | 92 | ||
93 | #ifdef CONFIG_RCU_BOOST | ||
94 | #define INIT_TASK_RCU_BOOST() \ | ||
95 | .rcu_boost_mutex = NULL, | ||
96 | #else | ||
97 | #define INIT_TASK_RCU_BOOST() | ||
98 | #endif | ||
86 | #ifdef CONFIG_TREE_PREEMPT_RCU | 99 | #ifdef CONFIG_TREE_PREEMPT_RCU |
87 | #define INIT_TASK_RCU_TREE_PREEMPT() \ | 100 | #define INIT_TASK_RCU_TREE_PREEMPT() \ |
88 | .rcu_blocked_node = NULL, | 101 | .rcu_blocked_node = NULL, |
@@ -94,7 +107,8 @@ extern struct group_info init_groups; | |||
94 | .rcu_read_lock_nesting = 0, \ | 107 | .rcu_read_lock_nesting = 0, \ |
95 | .rcu_read_unlock_special = 0, \ | 108 | .rcu_read_unlock_special = 0, \ |
96 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ | 109 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ |
97 | INIT_TASK_RCU_TREE_PREEMPT() | 110 | INIT_TASK_RCU_TREE_PREEMPT() \ |
111 | INIT_TASK_RCU_BOOST() | ||
98 | #else | 112 | #else |
99 | #define INIT_TASK_RCU_PREEMPT(tsk) | 113 | #define INIT_TASK_RCU_PREEMPT(tsk) |
100 | #endif | 114 | #endif |
@@ -137,7 +151,7 @@ extern struct cred init_cred; | |||
137 | .nr_cpus_allowed = NR_CPUS, \ | 151 | .nr_cpus_allowed = NR_CPUS, \ |
138 | }, \ | 152 | }, \ |
139 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ | 153 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ |
140 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \ | 154 | INIT_PUSHABLE_TASKS(tsk) \ |
141 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ | 155 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ |
142 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ | 156 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ |
143 | .real_parent = &tsk, \ | 157 | .real_parent = &tsk, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 9777668883be..e428382ca28a 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -112,6 +112,7 @@ struct input_keymap_entry { | |||
112 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ | 112 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ |
113 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 113 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
114 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ | 114 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ |
115 | #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */ | ||
115 | 116 | ||
116 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ | 117 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ |
117 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ | 118 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ |
@@ -129,6 +130,18 @@ struct input_keymap_entry { | |||
129 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ | 130 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ |
130 | 131 | ||
131 | /* | 132 | /* |
133 | * Device properties and quirks | ||
134 | */ | ||
135 | |||
136 | #define INPUT_PROP_POINTER 0x00 /* needs a pointer */ | ||
137 | #define INPUT_PROP_DIRECT 0x01 /* direct input devices */ | ||
138 | #define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ | ||
139 | #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ | ||
140 | |||
141 | #define INPUT_PROP_MAX 0x1f | ||
142 | #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) | ||
143 | |||
144 | /* | ||
132 | * Event types | 145 | * Event types |
133 | */ | 146 | */ |
134 | 147 | ||
@@ -590,6 +603,8 @@ struct input_keymap_entry { | |||
590 | #define KEY_FRAMEFORWARD 0x1b5 | 603 | #define KEY_FRAMEFORWARD 0x1b5 |
591 | #define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ | 604 | #define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ |
592 | #define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ | 605 | #define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ |
606 | #define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ | ||
607 | #define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ | ||
593 | 608 | ||
594 | #define KEY_DEL_EOL 0x1c0 | 609 | #define KEY_DEL_EOL 0x1c0 |
595 | #define KEY_DEL_EOS 0x1c1 | 610 | #define KEY_DEL_EOS 0x1c1 |
@@ -758,11 +773,12 @@ struct input_keymap_entry { | |||
758 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 773 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
759 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 774 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
760 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 775 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
776 | #define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ | ||
761 | 777 | ||
762 | #ifdef __KERNEL__ | 778 | #ifdef __KERNEL__ |
763 | /* Implementation details, userspace should not care about these */ | 779 | /* Implementation details, userspace should not care about these */ |
764 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | 780 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
765 | #define ABS_MT_LAST ABS_MT_PRESSURE | 781 | #define ABS_MT_LAST ABS_MT_DISTANCE |
766 | #endif | 782 | #endif |
767 | 783 | ||
768 | #define ABS_MAX 0x3f | 784 | #define ABS_MAX 0x3f |
@@ -786,6 +802,7 @@ struct input_keymap_entry { | |||
786 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ | 802 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ |
787 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | 803 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ |
788 | #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 */ | ||
789 | #define SW_MAX 0x0f | 806 | #define SW_MAX 0x0f |
790 | #define SW_CNT (SW_MAX+1) | 807 | #define SW_CNT (SW_MAX+1) |
791 | 808 | ||
@@ -873,6 +890,7 @@ struct input_keymap_entry { | |||
873 | */ | 890 | */ |
874 | #define MT_TOOL_FINGER 0 | 891 | #define MT_TOOL_FINGER 0 |
875 | #define MT_TOOL_PEN 1 | 892 | #define MT_TOOL_PEN 1 |
893 | #define MT_TOOL_MAX 1 | ||
876 | 894 | ||
877 | /* | 895 | /* |
878 | * Values describing the status of a force-feedback effect | 896 | * Values describing the status of a force-feedback effect |
@@ -1108,19 +1126,12 @@ struct ff_effect { | |||
1108 | #include <linux/mod_devicetable.h> | 1126 | #include <linux/mod_devicetable.h> |
1109 | 1127 | ||
1110 | /** | 1128 | /** |
1111 | * struct input_mt_slot - represents the state of an input MT slot | ||
1112 | * @abs: holds current values of ABS_MT axes for this slot | ||
1113 | */ | ||
1114 | struct input_mt_slot { | ||
1115 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
1116 | }; | ||
1117 | |||
1118 | /** | ||
1119 | * struct input_dev - represents an input device | 1129 | * struct input_dev - represents an input device |
1120 | * @name: name of the device | 1130 | * @name: name of the device |
1121 | * @phys: physical path to the device in the system hierarchy | 1131 | * @phys: physical path to the device in the system hierarchy |
1122 | * @uniq: unique identification code for the device (if device has it) | 1132 | * @uniq: unique identification code for the device (if device has it) |
1123 | * @id: id of the device (struct input_id) | 1133 | * @id: id of the device (struct input_id) |
1134 | * @propbit: bitmap of device properties and quirks | ||
1124 | * @evbit: bitmap of types of events supported by the device (EV_KEY, | 1135 | * @evbit: bitmap of types of events supported by the device (EV_KEY, |
1125 | * EV_REL, etc.) | 1136 | * EV_REL, etc.) |
1126 | * @keybit: bitmap of keys/buttons this device has | 1137 | * @keybit: bitmap of keys/buttons this device has |
@@ -1155,6 +1166,7 @@ struct input_mt_slot { | |||
1155 | * of tracked contacts | 1166 | * of tracked contacts |
1156 | * @mtsize: number of MT slots the device uses | 1167 | * @mtsize: number of MT slots the device uses |
1157 | * @slot: MT slot currently being transmitted | 1168 | * @slot: MT slot currently being transmitted |
1169 | * @trkid: stores MT tracking ID for the current contact | ||
1158 | * @absinfo: array of &struct input_absinfo elements holding information | 1170 | * @absinfo: array of &struct input_absinfo elements holding information |
1159 | * about absolute axes (current value, min, max, flat, fuzz, | 1171 | * about absolute axes (current value, min, max, flat, fuzz, |
1160 | * resolution) | 1172 | * resolution) |
@@ -1203,6 +1215,8 @@ struct input_dev { | |||
1203 | const char *uniq; | 1215 | const char *uniq; |
1204 | struct input_id id; | 1216 | struct input_id id; |
1205 | 1217 | ||
1218 | unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; | ||
1219 | |||
1206 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; | 1220 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1207 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; | 1221 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1208 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; | 1222 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
@@ -1239,6 +1253,7 @@ struct input_dev { | |||
1239 | struct input_mt_slot *mt; | 1253 | struct input_mt_slot *mt; |
1240 | int mtsize; | 1254 | int mtsize; |
1241 | int slot; | 1255 | int slot; |
1256 | int trkid; | ||
1242 | 1257 | ||
1243 | struct input_absinfo *absinfo; | 1258 | struct input_absinfo *absinfo; |
1244 | 1259 | ||
@@ -1488,11 +1503,6 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
1488 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1503 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
1489 | } | 1504 | } |
1490 | 1505 | ||
1491 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
1492 | { | ||
1493 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
1494 | } | ||
1495 | |||
1496 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1506 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
1497 | 1507 | ||
1498 | /** | 1508 | /** |
@@ -1605,8 +1615,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
1605 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1615 | int input_ff_create_memless(struct input_dev *dev, void *data, |
1606 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1616 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
1607 | 1617 | ||
1608 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
1609 | void input_mt_destroy_slots(struct input_dev *dev); | ||
1610 | |||
1611 | #endif | 1618 | #endif |
1612 | #endif | 1619 | #endif |
diff --git a/include/linux/input/as5011.h b/include/linux/input/as5011.h new file mode 100644 index 000000000000..1affd0ddfa9d --- /dev/null +++ b/include/linux/input/as5011.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _AS5011_H | ||
2 | #define _AS5011_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | struct as5011_platform_data { | ||
13 | unsigned int button_gpio; | ||
14 | unsigned int axis_irq; /* irq number */ | ||
15 | unsigned long axis_irqflags; | ||
16 | char xp, xn; /* threshold for x axis */ | ||
17 | char yp, yn; /* threshold for y axis */ | ||
18 | }; | ||
19 | |||
20 | #endif /* _AS5011_H */ | ||
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h index e470d387dd49..05e03284b92a 100644 --- a/include/linux/input/bu21013.h +++ b/include/linux/input/bu21013.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * @cs_en: pointer to the cs enable function | 12 | * @cs_en: pointer to the cs enable function |
13 | * @cs_dis: pointer to the cs disable function | 13 | * @cs_dis: pointer to the cs disable function |
14 | * @irq_read_val: pointer to read the pen irq value function | 14 | * @irq_read_val: pointer to read the pen irq value function |
15 | * @x_max_res: xmax resolution | ||
16 | * @y_max_res: ymax resolution | ||
17 | * @touch_x_max: touch x max | 15 | * @touch_x_max: touch x max |
18 | * @touch_y_max: touch y max | 16 | * @touch_y_max: touch y max |
19 | * @cs_pin: chip select pin | 17 | * @cs_pin: chip select pin |
@@ -29,8 +27,6 @@ struct bu21013_platform_device { | |||
29 | int (*cs_en)(int reset_pin); | 27 | int (*cs_en)(int reset_pin); |
30 | int (*cs_dis)(int reset_pin); | 28 | int (*cs_dis)(int reset_pin); |
31 | int (*irq_read_val)(void); | 29 | int (*irq_read_val)(void); |
32 | int x_max_res; | ||
33 | int y_max_res; | ||
34 | int touch_x_max; | 30 | int touch_x_max; |
35 | int touch_y_max; | 31 | int touch_y_max; |
36 | unsigned int cs_pin; | 32 | unsigned int cs_pin; |
diff --git a/include/linux/input/cma3000.h b/include/linux/input/cma3000.h new file mode 100644 index 000000000000..cbbaac27d311 --- /dev/null +++ b/include/linux/input/cma3000.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * VTI CMA3000_Dxx Accelerometer driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * Author: Hemanth V <hemanthv@ti.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 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef _LINUX_CMA3000_H | ||
21 | #define _LINUX_CMA3000_H | ||
22 | |||
23 | #define CMAMODE_DEFAULT 0 | ||
24 | #define CMAMODE_MEAS100 1 | ||
25 | #define CMAMODE_MEAS400 2 | ||
26 | #define CMAMODE_MEAS40 3 | ||
27 | #define CMAMODE_MOTDET 4 | ||
28 | #define CMAMODE_FF100 5 | ||
29 | #define CMAMODE_FF400 6 | ||
30 | #define CMAMODE_POFF 7 | ||
31 | |||
32 | #define CMARANGE_2G 2000 | ||
33 | #define CMARANGE_8G 8000 | ||
34 | |||
35 | /** | ||
36 | * struct cma3000_i2c_platform_data - CMA3000 Platform data | ||
37 | * @fuzz_x: Noise on X Axis | ||
38 | * @fuzz_y: Noise on Y Axis | ||
39 | * @fuzz_z: Noise on Z Axis | ||
40 | * @g_range: G range in milli g i.e 2000 or 8000 | ||
41 | * @mode: Operating mode | ||
42 | * @mdthr: Motion detect threshold value | ||
43 | * @mdfftmr: Motion detect and free fall time value | ||
44 | * @ffthr: Free fall threshold value | ||
45 | */ | ||
46 | |||
47 | struct cma3000_platform_data { | ||
48 | int fuzz_x; | ||
49 | int fuzz_y; | ||
50 | int fuzz_z; | ||
51 | int g_range; | ||
52 | uint8_t mode; | ||
53 | uint8_t mdthr; | ||
54 | uint8_t mdfftmr; | ||
55 | uint8_t ffthr; | ||
56 | unsigned long irqflags; | ||
57 | }; | ||
58 | |||
59 | #endif | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 80352ad6581a..fe7c4b9ae270 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
@@ -4,12 +4,12 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/input.h> | 5 | #include <linux/input.h> |
6 | 6 | ||
7 | #define MATRIX_MAX_ROWS 16 | 7 | #define MATRIX_MAX_ROWS 32 |
8 | #define MATRIX_MAX_COLS 16 | 8 | #define MATRIX_MAX_COLS 32 |
9 | 9 | ||
10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ | 10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ |
11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ | 11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ |
12 | (val & 0xffff)) | 12 | ((val) & 0xffff)) |
13 | 13 | ||
14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) | 14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) |
15 | #define KEY_COL(k) (((k) >> 16) & 0xff) | 15 | #define KEY_COL(k) (((k) >> 16) & 0xff) |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h new file mode 100644 index 000000000000..b3ac06a4435d --- /dev/null +++ b/include/linux/input/mt.h | |||
@@ -0,0 +1,57 @@ | |||
1 | #ifndef _INPUT_MT_H | ||
2 | #define _INPUT_MT_H | ||
3 | |||
4 | /* | ||
5 | * Input Multitouch Library | ||
6 | * | ||
7 | * Copyright (c) 2010 Henrik Rydberg | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published by | ||
11 | * the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/input.h> | ||
15 | |||
16 | #define TRKID_MAX 0xffff | ||
17 | |||
18 | /** | ||
19 | * struct input_mt_slot - represents the state of an input MT slot | ||
20 | * @abs: holds current values of ABS_MT axes for this slot | ||
21 | */ | ||
22 | struct input_mt_slot { | ||
23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
24 | }; | ||
25 | |||
26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | ||
27 | unsigned code, int value) | ||
28 | { | ||
29 | slot->abs[code - ABS_MT_FIRST] = value; | ||
30 | } | ||
31 | |||
32 | static inline int input_mt_get_value(const struct input_mt_slot *slot, | ||
33 | unsigned code) | ||
34 | { | ||
35 | return slot->abs[code - ABS_MT_FIRST]; | ||
36 | } | ||
37 | |||
38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | ||
39 | void input_mt_destroy_slots(struct input_dev *dev); | ||
40 | |||
41 | static inline int input_mt_new_trkid(struct input_dev *dev) | ||
42 | { | ||
43 | return dev->trkid++ & TRKID_MAX; | ||
44 | } | ||
45 | |||
46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
47 | { | ||
48 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
49 | } | ||
50 | |||
51 | void input_mt_report_slot_state(struct input_dev *dev, | ||
52 | unsigned int tool_type, bool active); | ||
53 | |||
54 | void input_mt_report_finger_count(struct input_dev *dev, int count); | ||
55 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); | ||
56 | |||
57 | #endif | ||
diff --git a/include/linux/intel-gtt.h b/include/linux/intel-gtt.h deleted file mode 100644 index 1d19ab2afa39..000000000000 --- 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/interrupt.h b/include/linux/interrupt.h index 79d0c4f6d071..55e0d4253e49 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -114,15 +114,15 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
114 | struct irqaction { | 114 | struct irqaction { |
115 | irq_handler_t handler; | 115 | irq_handler_t handler; |
116 | unsigned long flags; | 116 | unsigned long flags; |
117 | const char *name; | ||
118 | void *dev_id; | 117 | void *dev_id; |
119 | struct irqaction *next; | 118 | struct irqaction *next; |
120 | int irq; | 119 | int irq; |
121 | struct proc_dir_entry *dir; | ||
122 | irq_handler_t thread_fn; | 120 | irq_handler_t thread_fn; |
123 | struct task_struct *thread; | 121 | struct task_struct *thread; |
124 | unsigned long thread_flags; | 122 | unsigned long thread_flags; |
125 | }; | 123 | const char *name; |
124 | struct proc_dir_entry *dir; | ||
125 | } ____cacheline_internodealigned_in_smp; | ||
126 | 126 | ||
127 | extern irqreturn_t no_action(int cpl, void *dev_id); | 127 | extern irqreturn_t no_action(int cpl, void *dev_id); |
128 | 128 | ||
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 65aae34759de..045f2f275cd0 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -454,6 +454,44 @@ unsigned int ipmi_addr_length(int addr_type); | |||
454 | /* Validate that the given IPMI address is valid. */ | 454 | /* Validate that the given IPMI address is valid. */ |
455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); | 455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); |
456 | 456 | ||
457 | /* | ||
458 | * How did the IPMI driver find out about the device? | ||
459 | */ | ||
460 | enum ipmi_addr_src { | ||
461 | SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS, | ||
462 | SI_PCI, SI_DEVICETREE, SI_DEFAULT | ||
463 | }; | ||
464 | |||
465 | union ipmi_smi_info_union { | ||
466 | /* | ||
467 | * the acpi_info element is defined for the SI_ACPI | ||
468 | * address type | ||
469 | */ | ||
470 | struct { | ||
471 | void *acpi_handle; | ||
472 | } acpi_info; | ||
473 | }; | ||
474 | |||
475 | struct ipmi_smi_info { | ||
476 | enum ipmi_addr_src addr_src; | ||
477 | |||
478 | /* | ||
479 | * Base device for the interface. Don't forget to put this when | ||
480 | * you are done. | ||
481 | */ | ||
482 | struct device *dev; | ||
483 | |||
484 | /* | ||
485 | * The addr_info provides more detailed info for some IPMI | ||
486 | * devices, depending on the addr_src. Currently only SI_ACPI | ||
487 | * info is provided. | ||
488 | */ | ||
489 | union ipmi_smi_info_union addr_info; | ||
490 | }; | ||
491 | |||
492 | /* This is to get the private info of ipmi_smi_t */ | ||
493 | extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data); | ||
494 | |||
457 | #endif /* __KERNEL__ */ | 495 | #endif /* __KERNEL__ */ |
458 | 496 | ||
459 | 497 | ||
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 4b48318ac542..906590aa6907 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
42 | #include <linux/ipmi.h> | ||
42 | 43 | ||
43 | /* This files describes the interface for IPMI system management interface | 44 | /* This files describes the interface for IPMI system management interface |
44 | drivers to bind into the IPMI message handler. */ | 45 | drivers to bind into the IPMI message handler. */ |
@@ -86,6 +87,13 @@ struct ipmi_smi_handlers { | |||
86 | int (*start_processing)(void *send_info, | 87 | int (*start_processing)(void *send_info, |
87 | ipmi_smi_t new_intf); | 88 | ipmi_smi_t new_intf); |
88 | 89 | ||
90 | /* | ||
91 | * Get the detailed private info of the low level interface and store | ||
92 | * it into the structure of ipmi_smi_data. For example: the | ||
93 | * ACPI device handle will be returned for the pnp_acpi IPMI device. | ||
94 | */ | ||
95 | int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data); | ||
96 | |||
89 | /* Called to enqueue an SMI message to be sent. This | 97 | /* Called to enqueue an SMI message to be sent. This |
90 | operation is not allowed to fail. If an error occurs, it | 98 | operation is not allowed to fail. If an error occurs, it |
91 | should report back the error in a received message. It may | 99 | should report back the error in a received message. It may |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 8e429d0e0405..0c997767429a 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -364,7 +364,7 @@ struct ipv6_pinfo { | |||
364 | 364 | ||
365 | __u32 dst_cookie; | 365 | __u32 dst_cookie; |
366 | 366 | ||
367 | struct ipv6_mc_socklist *ipv6_mc_list; | 367 | struct ipv6_mc_socklist __rcu *ipv6_mc_list; |
368 | struct ipv6_ac_socklist *ipv6_ac_list; | 368 | struct ipv6_ac_socklist *ipv6_ac_list; |
369 | struct ipv6_fl_socklist *ipv6_fl_list; | 369 | struct ipv6_fl_socklist *ipv6_fl_list; |
370 | 370 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index abde2527c699..80fcb53057bc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -74,7 +74,8 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, | |||
74 | 74 | ||
75 | #define IRQF_MODIFY_MASK \ | 75 | #define IRQF_MODIFY_MASK \ |
76 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ | 76 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ |
77 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL) | 77 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ |
78 | IRQ_PER_CPU) | ||
78 | 79 | ||
79 | #ifdef CONFIG_IRQ_PER_CPU | 80 | #ifdef CONFIG_IRQ_PER_CPU |
80 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 81 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 979c68cc7458..c1a95b7b58de 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 2ae86aa21fce..27e79c27ba08 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/jhash.h b/include/linux/jhash.h index ced1159fa4f2..47cb09edec1a 100644 --- a/include/linux/jhash.h +++ b/include/linux/jhash.h | |||
@@ -3,129 +3,156 @@ | |||
3 | 3 | ||
4 | /* jhash.h: Jenkins hash support. | 4 | /* jhash.h: Jenkins hash support. |
5 | * | 5 | * |
6 | * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net) | 6 | * Copyright (C) 2006. Bob Jenkins (bob_jenkins@burtleburtle.net) |
7 | * | 7 | * |
8 | * http://burtleburtle.net/bob/hash/ | 8 | * http://burtleburtle.net/bob/hash/ |
9 | * | 9 | * |
10 | * These are the credits from Bob's sources: | 10 | * These are the credits from Bob's sources: |
11 | * | 11 | * |
12 | * lookup2.c, by Bob Jenkins, December 1996, Public Domain. | 12 | * lookup3.c, by Bob Jenkins, May 2006, Public Domain. |
13 | * hash(), hash2(), hash3, and mix() are externally useful functions. | ||
14 | * Routines to test the hash are included if SELF_TEST is defined. | ||
15 | * You can use this free for any purpose. It has no warranty. | ||
16 | * | 13 | * |
17 | * Copyright (C) 2003 David S. Miller (davem@redhat.com) | 14 | * These are functions for producing 32-bit hashes for hash table lookup. |
15 | * hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() | ||
16 | * are externally useful functions. Routines to test the hash are included | ||
17 | * if SELF_TEST is defined. You can use this free for any purpose. It's in | ||
18 | * the public domain. It has no warranty. | ||
19 | * | ||
20 | * Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu) | ||
18 | * | 21 | * |
19 | * I've modified Bob's hash to be useful in the Linux kernel, and | 22 | * I've modified Bob's hash to be useful in the Linux kernel, and |
20 | * any bugs present are surely my fault. -DaveM | 23 | * any bugs present are my fault. |
24 | * Jozsef | ||
21 | */ | 25 | */ |
26 | #include <linux/bitops.h> | ||
27 | #include <linux/unaligned/packed_struct.h> | ||
28 | |||
29 | /* Best hash sizes are of power of two */ | ||
30 | #define jhash_size(n) ((u32)1<<(n)) | ||
31 | /* Mask the hash value, i.e (value & jhash_mask(n)) instead of (value % n) */ | ||
32 | #define jhash_mask(n) (jhash_size(n)-1) | ||
33 | |||
34 | /* __jhash_mix -- mix 3 32-bit values reversibly. */ | ||
35 | #define __jhash_mix(a, b, c) \ | ||
36 | { \ | ||
37 | a -= c; a ^= rol32(c, 4); c += b; \ | ||
38 | b -= a; b ^= rol32(a, 6); a += c; \ | ||
39 | c -= b; c ^= rol32(b, 8); b += a; \ | ||
40 | a -= c; a ^= rol32(c, 16); c += b; \ | ||
41 | b -= a; b ^= rol32(a, 19); a += c; \ | ||
42 | c -= b; c ^= rol32(b, 4); b += a; \ | ||
43 | } | ||
22 | 44 | ||
23 | /* NOTE: Arguments are modified. */ | 45 | /* __jhash_final - final mixing of 3 32-bit values (a,b,c) into c */ |
24 | #define __jhash_mix(a, b, c) \ | 46 | #define __jhash_final(a, b, c) \ |
25 | { \ | 47 | { \ |
26 | a -= b; a -= c; a ^= (c>>13); \ | 48 | c ^= b; c -= rol32(b, 14); \ |
27 | b -= c; b -= a; b ^= (a<<8); \ | 49 | a ^= c; a -= rol32(c, 11); \ |
28 | c -= a; c -= b; c ^= (b>>13); \ | 50 | b ^= a; b -= rol32(a, 25); \ |
29 | a -= b; a -= c; a ^= (c>>12); \ | 51 | c ^= b; c -= rol32(b, 16); \ |
30 | b -= c; b -= a; b ^= (a<<16); \ | 52 | a ^= c; a -= rol32(c, 4); \ |
31 | c -= a; c -= b; c ^= (b>>5); \ | 53 | b ^= a; b -= rol32(a, 14); \ |
32 | a -= b; a -= c; a ^= (c>>3); \ | 54 | c ^= b; c -= rol32(b, 24); \ |
33 | b -= c; b -= a; b ^= (a<<10); \ | ||
34 | c -= a; c -= b; c ^= (b>>15); \ | ||
35 | } | 55 | } |
36 | 56 | ||
37 | /* The golden ration: an arbitrary value */ | 57 | /* An arbitrary initial parameter */ |
38 | #define JHASH_GOLDEN_RATIO 0x9e3779b9 | 58 | #define JHASH_INITVAL 0xdeadbeef |
39 | 59 | ||
40 | /* The most generic version, hashes an arbitrary sequence | 60 | /* jhash - hash an arbitrary key |
41 | * of bytes. No alignment or length assumptions are made about | 61 | * @k: sequence of bytes as key |
42 | * the input key. | 62 | * @length: the length of the key |
63 | * @initval: the previous hash, or an arbitray value | ||
64 | * | ||
65 | * The generic version, hashes an arbitrary sequence of bytes. | ||
66 | * No alignment or length assumptions are made about the input key. | ||
67 | * | ||
68 | * Returns the hash value of the key. The result depends on endianness. | ||
43 | */ | 69 | */ |
44 | static inline u32 jhash(const void *key, u32 length, u32 initval) | 70 | static inline u32 jhash(const void *key, u32 length, u32 initval) |
45 | { | 71 | { |
46 | u32 a, b, c, len; | 72 | u32 a, b, c; |
47 | const u8 *k = key; | 73 | const u8 *k = key; |
48 | 74 | ||
49 | len = length; | 75 | /* Set up the internal state */ |
50 | a = b = JHASH_GOLDEN_RATIO; | 76 | a = b = c = JHASH_INITVAL + length + initval; |
51 | c = initval; | ||
52 | |||
53 | while (len >= 12) { | ||
54 | a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24)); | ||
55 | b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24)); | ||
56 | c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24)); | ||
57 | |||
58 | __jhash_mix(a,b,c); | ||
59 | 77 | ||
78 | /* All but the last block: affect some 32 bits of (a,b,c) */ | ||
79 | while (length > 12) { | ||
80 | a += __get_unaligned_cpu32(k); | ||
81 | b += __get_unaligned_cpu32(k + 4); | ||
82 | c += __get_unaligned_cpu32(k + 8); | ||
83 | __jhash_mix(a, b, c); | ||
84 | length -= 12; | ||
60 | k += 12; | 85 | k += 12; |
61 | len -= 12; | ||
62 | } | 86 | } |
63 | 87 | /* Last block: affect all 32 bits of (c) */ | |
64 | c += length; | 88 | /* All the case statements fall through */ |
65 | switch (len) { | 89 | switch (length) { |
66 | case 11: c += ((u32)k[10]<<24); | 90 | case 12: c += (u32)k[11]<<24; |
67 | case 10: c += ((u32)k[9]<<16); | 91 | case 11: c += (u32)k[10]<<16; |
68 | case 9 : c += ((u32)k[8]<<8); | 92 | case 10: c += (u32)k[9]<<8; |
69 | case 8 : b += ((u32)k[7]<<24); | 93 | case 9: c += k[8]; |
70 | case 7 : b += ((u32)k[6]<<16); | 94 | case 8: b += (u32)k[7]<<24; |
71 | case 6 : b += ((u32)k[5]<<8); | 95 | case 7: b += (u32)k[6]<<16; |
72 | case 5 : b += k[4]; | 96 | case 6: b += (u32)k[5]<<8; |
73 | case 4 : a += ((u32)k[3]<<24); | 97 | case 5: b += k[4]; |
74 | case 3 : a += ((u32)k[2]<<16); | 98 | case 4: a += (u32)k[3]<<24; |
75 | case 2 : a += ((u32)k[1]<<8); | 99 | case 3: a += (u32)k[2]<<16; |
76 | case 1 : a += k[0]; | 100 | case 2: a += (u32)k[1]<<8; |
77 | }; | 101 | case 1: a += k[0]; |
78 | 102 | __jhash_final(a, b, c); | |
79 | __jhash_mix(a,b,c); | 103 | case 0: /* Nothing left to add */ |
104 | break; | ||
105 | } | ||
80 | 106 | ||
81 | return c; | 107 | return c; |
82 | } | 108 | } |
83 | 109 | ||
84 | /* A special optimized version that handles 1 or more of u32s. | 110 | /* jhash2 - hash an array of u32's |
85 | * The length parameter here is the number of u32s in the key. | 111 | * @k: the key which must be an array of u32's |
112 | * @length: the number of u32's in the key | ||
113 | * @initval: the previous hash, or an arbitray value | ||
114 | * | ||
115 | * Returns the hash value of the key. | ||
86 | */ | 116 | */ |
87 | static inline u32 jhash2(const u32 *k, u32 length, u32 initval) | 117 | static inline u32 jhash2(const u32 *k, u32 length, u32 initval) |
88 | { | 118 | { |
89 | u32 a, b, c, len; | 119 | u32 a, b, c; |
90 | 120 | ||
91 | a = b = JHASH_GOLDEN_RATIO; | 121 | /* Set up the internal state */ |
92 | c = initval; | 122 | a = b = c = JHASH_INITVAL + (length<<2) + initval; |
93 | len = length; | ||
94 | 123 | ||
95 | while (len >= 3) { | 124 | /* Handle most of the key */ |
125 | while (length > 3) { | ||
96 | a += k[0]; | 126 | a += k[0]; |
97 | b += k[1]; | 127 | b += k[1]; |
98 | c += k[2]; | 128 | c += k[2]; |
99 | __jhash_mix(a, b, c); | 129 | __jhash_mix(a, b, c); |
100 | k += 3; len -= 3; | 130 | length -= 3; |
131 | k += 3; | ||
101 | } | 132 | } |
102 | 133 | ||
103 | c += length * 4; | 134 | /* Handle the last 3 u32's: all the case statements fall through */ |
104 | 135 | switch (length) { | |
105 | switch (len) { | 136 | case 3: c += k[2]; |
106 | case 2 : b += k[1]; | 137 | case 2: b += k[1]; |
107 | case 1 : a += k[0]; | 138 | case 1: a += k[0]; |
108 | }; | 139 | __jhash_final(a, b, c); |
109 | 140 | case 0: /* Nothing left to add */ | |
110 | __jhash_mix(a,b,c); | 141 | break; |
142 | } | ||
111 | 143 | ||
112 | return c; | 144 | return c; |
113 | } | 145 | } |
114 | 146 | ||
115 | 147 | ||
116 | /* A special ultra-optimized versions that knows they are hashing exactly | 148 | /* jhash_3words - hash exactly 3, 2 or 1 word(s) */ |
117 | * 3, 2 or 1 word(s). | ||
118 | * | ||
119 | * NOTE: In particular the "c += length; __jhash_mix(a,b,c);" normally | ||
120 | * done at the end is not done here. | ||
121 | */ | ||
122 | static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) | 149 | static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) |
123 | { | 150 | { |
124 | a += JHASH_GOLDEN_RATIO; | 151 | a += JHASH_INITVAL; |
125 | b += JHASH_GOLDEN_RATIO; | 152 | b += JHASH_INITVAL; |
126 | c += initval; | 153 | c += initval; |
127 | 154 | ||
128 | __jhash_mix(a, b, c); | 155 | __jhash_final(a, b, c); |
129 | 156 | ||
130 | return c; | 157 | return c; |
131 | } | 158 | } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b6de9a6f7018..2fe6e84894a4 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 | * @condition: 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 ad54c846911b..0cce2db580c3 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -46,16 +46,14 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
46 | extern unsigned long long nr_context_switches(void); | 46 | extern unsigned long long nr_context_switches(void); |
47 | 47 | ||
48 | #ifndef CONFIG_GENERIC_HARDIRQS | 48 | #ifndef CONFIG_GENERIC_HARDIRQS |
49 | #define kstat_irqs_this_cpu(irq) \ | ||
50 | (kstat_this_cpu.irqs[irq]) | ||
51 | 49 | ||
52 | struct irq_desc; | 50 | struct irq_desc; |
53 | 51 | ||
54 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | 52 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, |
55 | struct irq_desc *desc) | 53 | struct irq_desc *desc) |
56 | { | 54 | { |
57 | kstat_this_cpu.irqs[irq]++; | 55 | __this_cpu_inc(kstat.irqs[irq]); |
58 | kstat_this_cpu.irqs_sum++; | 56 | __this_cpu_inc(kstat.irqs_sum); |
59 | } | 57 | } |
60 | 58 | ||
61 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
@@ -65,17 +63,18 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | |||
65 | #else | 63 | #else |
66 | #include <linux/irq.h> | 64 | #include <linux/irq.h> |
67 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 65 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
68 | #define kstat_irqs_this_cpu(DESC) \ | 66 | |
69 | ((DESC)->kstat_irqs[smp_processor_id()]) | 67 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ |
70 | #define kstat_incr_irqs_this_cpu(irqno, DESC) do {\ | 68 | do { \ |
71 | ((DESC)->kstat_irqs[smp_processor_id()]++);\ | 69 | __this_cpu_inc(*(DESC)->kstat_irqs); \ |
72 | kstat_this_cpu.irqs_sum++; } while (0) | 70 | __this_cpu_inc(kstat.irqs_sum); \ |
71 | } while (0) | ||
73 | 72 | ||
74 | #endif | 73 | #endif |
75 | 74 | ||
76 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | 75 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) |
77 | { | 76 | { |
78 | kstat_this_cpu.softirqs[irq]++; | 77 | __this_cpu_inc(kstat.softirqs[irq]); |
79 | } | 78 | } |
80 | 79 | ||
81 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | 80 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) |
diff --git a/include/linux/khugepaged.h b/include/linux/khugepaged.h new file mode 100644 index 000000000000..6b394f0b5148 --- /dev/null +++ b/include/linux/khugepaged.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef _LINUX_KHUGEPAGED_H | ||
2 | #define _LINUX_KHUGEPAGED_H | ||
3 | |||
4 | #include <linux/sched.h> /* MMF_VM_HUGEPAGE */ | ||
5 | |||
6 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
7 | extern int __khugepaged_enter(struct mm_struct *mm); | ||
8 | extern void __khugepaged_exit(struct mm_struct *mm); | ||
9 | extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma); | ||
10 | |||
11 | #define khugepaged_enabled() \ | ||
12 | (transparent_hugepage_flags & \ | ||
13 | ((1<<TRANSPARENT_HUGEPAGE_FLAG) | \ | ||
14 | (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG))) | ||
15 | #define khugepaged_always() \ | ||
16 | (transparent_hugepage_flags & \ | ||
17 | (1<<TRANSPARENT_HUGEPAGE_FLAG)) | ||
18 | #define khugepaged_req_madv() \ | ||
19 | (transparent_hugepage_flags & \ | ||
20 | (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)) | ||
21 | #define khugepaged_defrag() \ | ||
22 | (transparent_hugepage_flags & \ | ||
23 | (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)) | ||
24 | |||
25 | static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
26 | { | ||
27 | if (test_bit(MMF_VM_HUGEPAGE, &oldmm->flags)) | ||
28 | return __khugepaged_enter(mm); | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | static inline void khugepaged_exit(struct mm_struct *mm) | ||
33 | { | ||
34 | if (test_bit(MMF_VM_HUGEPAGE, &mm->flags)) | ||
35 | __khugepaged_exit(mm); | ||
36 | } | ||
37 | |||
38 | static inline int khugepaged_enter(struct vm_area_struct *vma) | ||
39 | { | ||
40 | if (!test_bit(MMF_VM_HUGEPAGE, &vma->vm_mm->flags)) | ||
41 | if ((khugepaged_always() || | ||
42 | (khugepaged_req_madv() && | ||
43 | vma->vm_flags & VM_HUGEPAGE)) && | ||
44 | !(vma->vm_flags & VM_NOHUGEPAGE)) | ||
45 | if (__khugepaged_enter(vma->vm_mm)) | ||
46 | return -ENOMEM; | ||
47 | return 0; | ||
48 | } | ||
49 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
50 | static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | static inline void khugepaged_exit(struct mm_struct *mm) | ||
55 | { | ||
56 | } | ||
57 | static inline int khugepaged_enter(struct vm_area_struct *vma) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | static inline int khugepaged_enter_vma_merge(struct vm_area_struct *vma) | ||
62 | { | ||
63 | return 0; | ||
64 | } | ||
65 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
66 | |||
67 | #endif /* _LINUX_KHUGEPAGED_H */ | ||
diff --git a/include/linux/klist.h b/include/linux/klist.h index e91a4e59b771..a370ce57cf1d 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -22,7 +22,7 @@ struct klist { | |||
22 | struct list_head k_list; | 22 | struct list_head k_list; |
23 | void (*get)(struct klist_node *); | 23 | void (*get)(struct klist_node *); |
24 | void (*put)(struct klist_node *); | 24 | void (*put)(struct klist_node *); |
25 | } __attribute__ ((aligned (4))); | 25 | } __attribute__ ((aligned (sizeof(void *)))); |
26 | 26 | ||
27 | #define KLIST_INIT(_name, _get, _put) \ | 27 | #define KLIST_INIT(_name, _get, _put) \ |
28 | { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \ | 28 | { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \ |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index 08d7dc4ddf40..39f8453239f7 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 24b44145a886..2a0d7d651dc3 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -18,6 +18,10 @@ enum kmsg_dump_reason { | |||
18 | KMSG_DUMP_OOPS, | 18 | KMSG_DUMP_OOPS, |
19 | KMSG_DUMP_PANIC, | 19 | KMSG_DUMP_PANIC, |
20 | KMSG_DUMP_KEXEC, | 20 | KMSG_DUMP_KEXEC, |
21 | KMSG_DUMP_RESTART, | ||
22 | KMSG_DUMP_HALT, | ||
23 | KMSG_DUMP_POWEROFF, | ||
24 | KMSG_DUMP_EMERG, | ||
21 | }; | 25 | }; |
22 | 26 | ||
23 | /** | 27 | /** |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e7d1b2e0070d..dd7c12e875bc 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -275,7 +275,9 @@ extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); | |||
275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); | 275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); |
276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); | 276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); |
277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); | 277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); |
278 | extern int arch_optimize_kprobe(struct optimized_kprobe *op); | 278 | extern void arch_optimize_kprobes(struct list_head *oplist); |
279 | extern void arch_unoptimize_kprobes(struct list_head *oplist, | ||
280 | struct list_head *done_list); | ||
279 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); | 281 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); |
280 | extern kprobe_opcode_t *get_optinsn_slot(void); | 282 | extern kprobe_opcode_t *get_optinsn_slot(void); |
281 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); | 283 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); |
@@ -303,12 +305,12 @@ struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); | |||
303 | /* kprobe_running() will just return the current_kprobe on this CPU */ | 305 | /* kprobe_running() will just return the current_kprobe on this CPU */ |
304 | static inline struct kprobe *kprobe_running(void) | 306 | static inline struct kprobe *kprobe_running(void) |
305 | { | 307 | { |
306 | return (__get_cpu_var(current_kprobe)); | 308 | return (__this_cpu_read(current_kprobe)); |
307 | } | 309 | } |
308 | 310 | ||
309 | static inline void reset_current_kprobe(void) | 311 | static inline void reset_current_kprobe(void) |
310 | { | 312 | { |
311 | __get_cpu_var(current_kprobe) = NULL; | 313 | __this_cpu_write(current_kprobe, NULL); |
312 | } | 314 | } |
313 | 315 | ||
314 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) | 316 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) |
diff --git a/include/linux/kref.h b/include/linux/kref.h index 6cc38fc07ab7..d4a62ab2ee5e 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 919ae53adc5c..ea2dc1a2e13d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -540,6 +540,7 @@ struct kvm_ppc_pvinfo { | |||
540 | #endif | 540 | #endif |
541 | #define KVM_CAP_PPC_GET_PVINFO 57 | 541 | #define KVM_CAP_PPC_GET_PVINFO 57 |
542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 | 542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 |
543 | #define KVM_CAP_ASYNC_PF 59 | ||
543 | 544 | ||
544 | #ifdef KVM_CAP_IRQ_ROUTING | 545 | #ifdef KVM_CAP_IRQ_ROUTING |
545 | 546 | ||
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a0557422715e..b5021db21858 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
18 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
19 | #include <linux/slab.h> | ||
20 | #include <linux/rcupdate.h> | ||
19 | #include <asm/signal.h> | 21 | #include <asm/signal.h> |
20 | 22 | ||
21 | #include <linux/kvm.h> | 23 | #include <linux/kvm.h> |
@@ -40,6 +42,7 @@ | |||
40 | #define KVM_REQ_KICK 9 | 42 | #define KVM_REQ_KICK 9 |
41 | #define KVM_REQ_DEACTIVATE_FPU 10 | 43 | #define KVM_REQ_DEACTIVATE_FPU 10 |
42 | #define KVM_REQ_EVENT 11 | 44 | #define KVM_REQ_EVENT 11 |
45 | #define KVM_REQ_APF_HALT 12 | ||
43 | 46 | ||
44 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 47 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
45 | 48 | ||
@@ -74,6 +77,27 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | |||
74 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 77 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
75 | struct kvm_io_device *dev); | 78 | struct kvm_io_device *dev); |
76 | 79 | ||
80 | #ifdef CONFIG_KVM_ASYNC_PF | ||
81 | struct kvm_async_pf { | ||
82 | struct work_struct work; | ||
83 | struct list_head link; | ||
84 | struct list_head queue; | ||
85 | struct kvm_vcpu *vcpu; | ||
86 | struct mm_struct *mm; | ||
87 | gva_t gva; | ||
88 | unsigned long addr; | ||
89 | struct kvm_arch_async_pf arch; | ||
90 | struct page *page; | ||
91 | bool done; | ||
92 | }; | ||
93 | |||
94 | void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); | ||
95 | void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu); | ||
96 | int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, | ||
97 | struct kvm_arch_async_pf *arch); | ||
98 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | ||
99 | #endif | ||
100 | |||
77 | struct kvm_vcpu { | 101 | struct kvm_vcpu { |
78 | struct kvm *kvm; | 102 | struct kvm *kvm; |
79 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 103 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
@@ -104,6 +128,15 @@ struct kvm_vcpu { | |||
104 | gpa_t mmio_phys_addr; | 128 | gpa_t mmio_phys_addr; |
105 | #endif | 129 | #endif |
106 | 130 | ||
131 | #ifdef CONFIG_KVM_ASYNC_PF | ||
132 | struct { | ||
133 | u32 queued; | ||
134 | struct list_head queue; | ||
135 | struct list_head done; | ||
136 | spinlock_t lock; | ||
137 | } async_pf; | ||
138 | #endif | ||
139 | |||
107 | struct kvm_vcpu_arch arch; | 140 | struct kvm_vcpu_arch arch; |
108 | }; | 141 | }; |
109 | 142 | ||
@@ -113,16 +146,19 @@ struct kvm_vcpu { | |||
113 | */ | 146 | */ |
114 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | 147 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) |
115 | 148 | ||
149 | struct kvm_lpage_info { | ||
150 | unsigned long rmap_pde; | ||
151 | int write_count; | ||
152 | }; | ||
153 | |||
116 | struct kvm_memory_slot { | 154 | struct kvm_memory_slot { |
117 | gfn_t base_gfn; | 155 | gfn_t base_gfn; |
118 | unsigned long npages; | 156 | unsigned long npages; |
119 | unsigned long flags; | 157 | unsigned long flags; |
120 | unsigned long *rmap; | 158 | unsigned long *rmap; |
121 | unsigned long *dirty_bitmap; | 159 | unsigned long *dirty_bitmap; |
122 | struct { | 160 | unsigned long *dirty_bitmap_head; |
123 | unsigned long rmap_pde; | 161 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
124 | int write_count; | ||
125 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; | ||
126 | unsigned long userspace_addr; | 162 | unsigned long userspace_addr; |
127 | int user_alloc; | 163 | int user_alloc; |
128 | int id; | 164 | int id; |
@@ -169,6 +205,7 @@ struct kvm_irq_routing_table {}; | |||
169 | 205 | ||
170 | struct kvm_memslots { | 206 | struct kvm_memslots { |
171 | int nmemslots; | 207 | int nmemslots; |
208 | u64 generation; | ||
172 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 209 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
173 | KVM_PRIVATE_MEM_SLOTS]; | 210 | KVM_PRIVATE_MEM_SLOTS]; |
174 | }; | 211 | }; |
@@ -206,6 +243,10 @@ struct kvm { | |||
206 | 243 | ||
207 | struct mutex irq_lock; | 244 | struct mutex irq_lock; |
208 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 245 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
246 | /* | ||
247 | * Update side is protected by irq_lock and, | ||
248 | * if configured, irqfds.lock. | ||
249 | */ | ||
209 | struct kvm_irq_routing_table __rcu *irq_routing; | 250 | struct kvm_irq_routing_table __rcu *irq_routing; |
210 | struct hlist_head mask_notifier_list; | 251 | struct hlist_head mask_notifier_list; |
211 | struct hlist_head irq_ack_notifier_list; | 252 | struct hlist_head irq_ack_notifier_list; |
@@ -216,6 +257,7 @@ struct kvm { | |||
216 | unsigned long mmu_notifier_seq; | 257 | unsigned long mmu_notifier_seq; |
217 | long mmu_notifier_count; | 258 | long mmu_notifier_count; |
218 | #endif | 259 | #endif |
260 | long tlbs_dirty; | ||
219 | }; | 261 | }; |
220 | 262 | ||
221 | /* The guest did something we don't support. */ | 263 | /* The guest did something we don't support. */ |
@@ -302,7 +344,11 @@ void kvm_set_page_accessed(struct page *page); | |||
302 | 344 | ||
303 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); | 345 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); |
304 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); | 346 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); |
347 | pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async, | ||
348 | bool write_fault, bool *writable); | ||
305 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); | 349 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); |
350 | pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | ||
351 | bool *writable); | ||
306 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 352 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
307 | struct kvm_memory_slot *slot, gfn_t gfn); | 353 | struct kvm_memory_slot *slot, gfn_t gfn); |
308 | int memslot_id(struct kvm *kvm, gfn_t gfn); | 354 | int memslot_id(struct kvm *kvm, gfn_t gfn); |
@@ -321,18 +367,25 @@ int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, | |||
321 | int offset, int len); | 367 | int offset, int len); |
322 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | 368 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, |
323 | unsigned long len); | 369 | unsigned long len); |
370 | int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
371 | void *data, unsigned long len); | ||
372 | int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
373 | gpa_t gpa); | ||
324 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); | 374 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); |
325 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); | 375 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); |
326 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | 376 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); |
327 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | 377 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); |
328 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); | 378 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); |
329 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 379 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
380 | void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | ||
381 | gfn_t gfn); | ||
330 | 382 | ||
331 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 383 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
332 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 384 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
333 | void kvm_resched(struct kvm_vcpu *vcpu); | 385 | void kvm_resched(struct kvm_vcpu *vcpu); |
334 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 386 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
335 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 387 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
388 | |||
336 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 389 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
337 | void kvm_reload_remote_mmus(struct kvm *kvm); | 390 | void kvm_reload_remote_mmus(struct kvm *kvm); |
338 | 391 | ||
@@ -398,7 +451,19 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | |||
398 | 451 | ||
399 | void kvm_free_physmem(struct kvm *kvm); | 452 | void kvm_free_physmem(struct kvm *kvm); |
400 | 453 | ||
401 | struct kvm *kvm_arch_create_vm(void); | 454 | #ifndef __KVM_HAVE_ARCH_VM_ALLOC |
455 | static inline struct kvm *kvm_arch_alloc_vm(void) | ||
456 | { | ||
457 | return kzalloc(sizeof(struct kvm), GFP_KERNEL); | ||
458 | } | ||
459 | |||
460 | static inline void kvm_arch_free_vm(struct kvm *kvm) | ||
461 | { | ||
462 | kfree(kvm); | ||
463 | } | ||
464 | #endif | ||
465 | |||
466 | int kvm_arch_init_vm(struct kvm *kvm); | ||
402 | void kvm_arch_destroy_vm(struct kvm *kvm); | 467 | void kvm_arch_destroy_vm(struct kvm *kvm); |
403 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 468 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
404 | void kvm_arch_sync_events(struct kvm *kvm); | 469 | void kvm_arch_sync_events(struct kvm *kvm); |
@@ -414,16 +479,8 @@ struct kvm_irq_ack_notifier { | |||
414 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | 479 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); |
415 | }; | 480 | }; |
416 | 481 | ||
417 | #define KVM_ASSIGNED_MSIX_PENDING 0x1 | ||
418 | struct kvm_guest_msix_entry { | ||
419 | u32 vector; | ||
420 | u16 entry; | ||
421 | u16 flags; | ||
422 | }; | ||
423 | |||
424 | struct kvm_assigned_dev_kernel { | 482 | struct kvm_assigned_dev_kernel { |
425 | struct kvm_irq_ack_notifier ack_notifier; | 483 | struct kvm_irq_ack_notifier ack_notifier; |
426 | struct work_struct interrupt_work; | ||
427 | struct list_head list; | 484 | struct list_head list; |
428 | int assigned_dev_id; | 485 | int assigned_dev_id; |
429 | int host_segnr; | 486 | int host_segnr; |
@@ -434,13 +491,14 @@ struct kvm_assigned_dev_kernel { | |||
434 | bool host_irq_disabled; | 491 | bool host_irq_disabled; |
435 | struct msix_entry *host_msix_entries; | 492 | struct msix_entry *host_msix_entries; |
436 | int guest_irq; | 493 | int guest_irq; |
437 | struct kvm_guest_msix_entry *guest_msix_entries; | 494 | struct msix_entry *guest_msix_entries; |
438 | unsigned long irq_requested_type; | 495 | unsigned long irq_requested_type; |
439 | int irq_source_id; | 496 | int irq_source_id; |
440 | int flags; | 497 | int flags; |
441 | struct pci_dev *dev; | 498 | struct pci_dev *dev; |
442 | struct kvm *kvm; | 499 | struct kvm *kvm; |
443 | spinlock_t assigned_dev_lock; | 500 | spinlock_t intx_lock; |
501 | char irq_name[32]; | ||
444 | }; | 502 | }; |
445 | 503 | ||
446 | struct kvm_irq_mask_notifier { | 504 | struct kvm_irq_mask_notifier { |
@@ -462,6 +520,8 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | |||
462 | unsigned long *deliver_bitmask); | 520 | unsigned long *deliver_bitmask); |
463 | #endif | 521 | #endif |
464 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 522 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
523 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | ||
524 | int irq_source_id, int level); | ||
465 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 525 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
466 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 526 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
467 | struct kvm_irq_ack_notifier *kian); | 527 | struct kvm_irq_ack_notifier *kian); |
@@ -603,17 +663,28 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {} | |||
603 | void kvm_eventfd_init(struct kvm *kvm); | 663 | void kvm_eventfd_init(struct kvm *kvm); |
604 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); | 664 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); |
605 | void kvm_irqfd_release(struct kvm *kvm); | 665 | void kvm_irqfd_release(struct kvm *kvm); |
666 | void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); | ||
606 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | 667 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); |
607 | 668 | ||
608 | #else | 669 | #else |
609 | 670 | ||
610 | static inline void kvm_eventfd_init(struct kvm *kvm) {} | 671 | static inline void kvm_eventfd_init(struct kvm *kvm) {} |
672 | |||
611 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) | 673 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) |
612 | { | 674 | { |
613 | return -EINVAL; | 675 | return -EINVAL; |
614 | } | 676 | } |
615 | 677 | ||
616 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | 678 | static inline void kvm_irqfd_release(struct kvm *kvm) {} |
679 | |||
680 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | ||
681 | static inline void kvm_irq_routing_update(struct kvm *kvm, | ||
682 | struct kvm_irq_routing_table *irq_rt) | ||
683 | { | ||
684 | rcu_assign_pointer(kvm->irq_routing, irq_rt); | ||
685 | } | ||
686 | #endif | ||
687 | |||
617 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 688 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) |
618 | { | 689 | { |
619 | return -ENOSYS; | 690 | return -ENOSYS; |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 7ac0d4eee430..fa7cc7244cbd 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
@@ -67,4 +67,11 @@ struct kvm_lapic_irq { | |||
67 | u32 dest_id; | 67 | u32 dest_id; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct gfn_to_hva_cache { | ||
71 | u64 generation; | ||
72 | gpa_t gpa; | ||
73 | unsigned long hva; | ||
74 | struct kvm_memory_slot *memslot; | ||
75 | }; | ||
76 | |||
70 | #endif /* __KVM_TYPES_H__ */ | 77 | #endif /* __KVM_TYPES_H__ */ |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h index 38368d785f08..fd548d2a8775 100644 --- a/include/linux/leds-lp5521.h +++ b/include/linux/leds-lp5521.h | |||
@@ -42,6 +42,7 @@ struct lp5521_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5521_H */ | 48 | #endif /* __LINUX_LP5521_H */ |
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h index 796747637b80..2694289babd0 100644 --- a/include/linux/leds-lp5523.h +++ b/include/linux/leds-lp5523.h | |||
@@ -42,6 +42,7 @@ struct lp5523_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5523_H */ | 48 | #endif /* __LINUX_LP5523_H */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index d947b1231662..c9c5d7ad1a2b 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.h b/include/linux/list.h index 9a5f8a71810c..3a54266a1e85 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -96,6 +96,11 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) | |||
96 | * in an undefined state. | 96 | * in an undefined state. |
97 | */ | 97 | */ |
98 | #ifndef CONFIG_DEBUG_LIST | 98 | #ifndef CONFIG_DEBUG_LIST |
99 | static inline void __list_del_entry(struct list_head *entry) | ||
100 | { | ||
101 | __list_del(entry->prev, entry->next); | ||
102 | } | ||
103 | |||
99 | static inline void list_del(struct list_head *entry) | 104 | static inline void list_del(struct list_head *entry) |
100 | { | 105 | { |
101 | __list_del(entry->prev, entry->next); | 106 | __list_del(entry->prev, entry->next); |
@@ -103,6 +108,7 @@ static inline void list_del(struct list_head *entry) | |||
103 | entry->prev = LIST_POISON2; | 108 | entry->prev = LIST_POISON2; |
104 | } | 109 | } |
105 | #else | 110 | #else |
111 | extern void __list_del_entry(struct list_head *entry); | ||
106 | extern void list_del(struct list_head *entry); | 112 | extern void list_del(struct list_head *entry); |
107 | #endif | 113 | #endif |
108 | 114 | ||
@@ -135,7 +141,7 @@ static inline void list_replace_init(struct list_head *old, | |||
135 | */ | 141 | */ |
136 | static inline void list_del_init(struct list_head *entry) | 142 | static inline void list_del_init(struct list_head *entry) |
137 | { | 143 | { |
138 | __list_del(entry->prev, entry->next); | 144 | __list_del_entry(entry); |
139 | INIT_LIST_HEAD(entry); | 145 | INIT_LIST_HEAD(entry); |
140 | } | 146 | } |
141 | 147 | ||
@@ -146,7 +152,7 @@ static inline void list_del_init(struct list_head *entry) | |||
146 | */ | 152 | */ |
147 | static inline void list_move(struct list_head *list, struct list_head *head) | 153 | static inline void list_move(struct list_head *list, struct list_head *head) |
148 | { | 154 | { |
149 | __list_del(list->prev, list->next); | 155 | __list_del_entry(list); |
150 | list_add(list, head); | 156 | list_add(list, head); |
151 | } | 157 | } |
152 | 158 | ||
@@ -158,7 +164,7 @@ static inline void list_move(struct list_head *list, struct list_head *head) | |||
158 | static inline void list_move_tail(struct list_head *list, | 164 | static inline void list_move_tail(struct list_head *list, |
159 | struct list_head *head) | 165 | struct list_head *head) |
160 | { | 166 | { |
161 | __list_del(list->prev, list->next); | 167 | __list_del_entry(list); |
162 | list_add_tail(list, head); | 168 | list_add_tail(list, head); |
163 | } | 169 | } |
164 | 170 | ||
diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h new file mode 100644 index 000000000000..5bad17d1acde --- /dev/null +++ b/include/linux/list_bl.h | |||
@@ -0,0 +1,145 @@ | |||
1 | #ifndef _LINUX_LIST_BL_H | ||
2 | #define _LINUX_LIST_BL_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | |||
6 | /* | ||
7 | * Special version of lists, where head of the list has a lock in the lowest | ||
8 | * bit. This is useful for scalable hash tables without increasing memory | ||
9 | * footprint overhead. | ||
10 | * | ||
11 | * For modification operations, the 0 bit of hlist_bl_head->first | ||
12 | * pointer must be set. | ||
13 | * | ||
14 | * With some small modifications, this can easily be adapted to store several | ||
15 | * arbitrary bits (not just a single lock bit), if the need arises to store | ||
16 | * some fast and compact auxiliary data. | ||
17 | */ | ||
18 | |||
19 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
20 | #define LIST_BL_LOCKMASK 1UL | ||
21 | #else | ||
22 | #define LIST_BL_LOCKMASK 0UL | ||
23 | #endif | ||
24 | |||
25 | #ifdef CONFIG_DEBUG_LIST | ||
26 | #define LIST_BL_BUG_ON(x) BUG_ON(x) | ||
27 | #else | ||
28 | #define LIST_BL_BUG_ON(x) | ||
29 | #endif | ||
30 | |||
31 | |||
32 | struct hlist_bl_head { | ||
33 | struct hlist_bl_node *first; | ||
34 | }; | ||
35 | |||
36 | struct hlist_bl_node { | ||
37 | struct hlist_bl_node *next, **pprev; | ||
38 | }; | ||
39 | #define INIT_HLIST_BL_HEAD(ptr) \ | ||
40 | ((ptr)->first = NULL) | ||
41 | |||
42 | static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) | ||
43 | { | ||
44 | h->next = NULL; | ||
45 | h->pprev = NULL; | ||
46 | } | ||
47 | |||
48 | #define hlist_bl_entry(ptr, type, member) container_of(ptr,type,member) | ||
49 | |||
50 | static inline int hlist_bl_unhashed(const struct hlist_bl_node *h) | ||
51 | { | ||
52 | return !h->pprev; | ||
53 | } | ||
54 | |||
55 | static inline struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h) | ||
56 | { | ||
57 | return (struct hlist_bl_node *) | ||
58 | ((unsigned long)h->first & ~LIST_BL_LOCKMASK); | ||
59 | } | ||
60 | |||
61 | static inline void hlist_bl_set_first(struct hlist_bl_head *h, | ||
62 | struct hlist_bl_node *n) | ||
63 | { | ||
64 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
65 | LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != | ||
66 | LIST_BL_LOCKMASK); | ||
67 | h->first = (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK); | ||
68 | } | ||
69 | |||
70 | static inline int hlist_bl_empty(const struct hlist_bl_head *h) | ||
71 | { | ||
72 | return !((unsigned long)h->first & ~LIST_BL_LOCKMASK); | ||
73 | } | ||
74 | |||
75 | static inline void hlist_bl_add_head(struct hlist_bl_node *n, | ||
76 | struct hlist_bl_head *h) | ||
77 | { | ||
78 | struct hlist_bl_node *first = hlist_bl_first(h); | ||
79 | |||
80 | n->next = first; | ||
81 | if (first) | ||
82 | first->pprev = &n->next; | ||
83 | n->pprev = &h->first; | ||
84 | hlist_bl_set_first(h, n); | ||
85 | } | ||
86 | |||
87 | static inline void __hlist_bl_del(struct hlist_bl_node *n) | ||
88 | { | ||
89 | struct hlist_bl_node *next = n->next; | ||
90 | struct hlist_bl_node **pprev = n->pprev; | ||
91 | |||
92 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
93 | |||
94 | /* pprev may be `first`, so be careful not to lose the lock bit */ | ||
95 | *pprev = (struct hlist_bl_node *) | ||
96 | ((unsigned long)next | | ||
97 | ((unsigned long)*pprev & LIST_BL_LOCKMASK)); | ||
98 | if (next) | ||
99 | next->pprev = pprev; | ||
100 | } | ||
101 | |||
102 | static inline void hlist_bl_del(struct hlist_bl_node *n) | ||
103 | { | ||
104 | __hlist_bl_del(n); | ||
105 | n->next = LIST_POISON1; | ||
106 | n->pprev = LIST_POISON2; | ||
107 | } | ||
108 | |||
109 | static inline void hlist_bl_del_init(struct hlist_bl_node *n) | ||
110 | { | ||
111 | if (!hlist_bl_unhashed(n)) { | ||
112 | __hlist_bl_del(n); | ||
113 | INIT_HLIST_BL_NODE(n); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * hlist_bl_for_each_entry - iterate over list of given type | ||
119 | * @tpos: the type * to use as a loop cursor. | ||
120 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
121 | * @head: the head for your list. | ||
122 | * @member: the name of the hlist_node within the struct. | ||
123 | * | ||
124 | */ | ||
125 | #define hlist_bl_for_each_entry(tpos, pos, head, member) \ | ||
126 | for (pos = hlist_bl_first(head); \ | ||
127 | pos && \ | ||
128 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1;}); \ | ||
129 | pos = pos->next) | ||
130 | |||
131 | /** | ||
132 | * hlist_bl_for_each_entry_safe - iterate over list of given type safe against removal of list entry | ||
133 | * @tpos: the type * to use as a loop cursor. | ||
134 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
135 | * @n: another &struct hlist_node to use as temporary storage | ||
136 | * @head: the head for your list. | ||
137 | * @member: the name of the hlist_node within the struct. | ||
138 | */ | ||
139 | #define hlist_bl_for_each_entry_safe(tpos, pos, n, head, member) \ | ||
140 | for (pos = hlist_bl_first(head); \ | ||
141 | pos && ({ n = pos->next; 1; }) && \ | ||
142 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1;}); \ | ||
143 | pos = n) | ||
144 | |||
145 | #endif | ||
diff --git a/include/linux/lockd/debug.h b/include/linux/lockd/debug.h index 34b2b7f33c3b..257d3779f2ab 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 2dee05e5119a..ff9abff55aa0 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 71c09b26c759..4aef1dda6406 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 ff690d05f129..62730ea2b56e 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define TMPFS_MAGIC 0x01021994 | 16 | #define TMPFS_MAGIC 0x01021994 |
17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | 17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ |
18 | #define SQUASHFS_MAGIC 0x73717368 | 18 | #define SQUASHFS_MAGIC 0x73717368 |
19 | #define ECRYPTFS_SUPER_MAGIC 0xf15f | ||
19 | #define EFS_SUPER_MAGIC 0x414A53 | 20 | #define EFS_SUPER_MAGIC 0x414A53 |
20 | #define EXT2_SUPER_MAGIC 0xEF53 | 21 | #define EXT2_SUPER_MAGIC 0xEF53 |
21 | #define EXT3_SUPER_MAGIC 0xEF53 | 22 | #define EXT3_SUPER_MAGIC 0xEF53 |
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index 54cbbac1e71d..5525d370701d 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/mdio.h b/include/linux/mdio.h index c779b49a1fda..b1494aced217 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ | 55 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ |
56 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ | 56 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ |
57 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ | 57 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ |
58 | #define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ | ||
58 | 59 | ||
59 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ | 60 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ |
60 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ | 61 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ |
@@ -235,6 +236,10 @@ | |||
235 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ | 236 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ |
236 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ | 237 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ |
237 | 238 | ||
239 | /* AN EEE Advertisement register. */ | ||
240 | #define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ | ||
241 | #define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ | ||
242 | |||
238 | /* LASI RX_ALARM control/status registers. */ | 243 | /* LASI RX_ALARM control/status registers. */ |
239 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ | 244 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ |
240 | #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ | 245 | #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 159a0762aeaf..f512e189be5a 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -25,6 +25,11 @@ struct page_cgroup; | |||
25 | struct page; | 25 | struct page; |
26 | struct mm_struct; | 26 | struct mm_struct; |
27 | 27 | ||
28 | /* Stats that can be updated by kernel. */ | ||
29 | enum mem_cgroup_page_stat_item { | ||
30 | MEMCG_NR_FILE_MAPPED, /* # of pages charged as file rss */ | ||
31 | }; | ||
32 | |||
28 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 33 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
29 | struct list_head *dst, | 34 | struct list_head *dst, |
30 | unsigned long *scanned, int order, | 35 | unsigned long *scanned, int order, |
@@ -93,7 +98,7 @@ extern int | |||
93 | mem_cgroup_prepare_migration(struct page *page, | 98 | mem_cgroup_prepare_migration(struct page *page, |
94 | struct page *newpage, struct mem_cgroup **ptr); | 99 | struct page *newpage, struct mem_cgroup **ptr); |
95 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 100 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, |
96 | struct page *oldpage, struct page *newpage); | 101 | struct page *oldpage, struct page *newpage, bool migration_ok); |
97 | 102 | ||
98 | /* | 103 | /* |
99 | * For memory reclaim. | 104 | * For memory reclaim. |
@@ -121,11 +126,30 @@ static inline bool mem_cgroup_disabled(void) | |||
121 | return false; | 126 | return false; |
122 | } | 127 | } |
123 | 128 | ||
124 | void mem_cgroup_update_file_mapped(struct page *page, int val); | 129 | void mem_cgroup_update_page_stat(struct page *page, |
130 | enum mem_cgroup_page_stat_item idx, | ||
131 | int val); | ||
132 | |||
133 | static inline void mem_cgroup_inc_page_stat(struct page *page, | ||
134 | enum mem_cgroup_page_stat_item idx) | ||
135 | { | ||
136 | mem_cgroup_update_page_stat(page, idx, 1); | ||
137 | } | ||
138 | |||
139 | static inline void mem_cgroup_dec_page_stat(struct page *page, | ||
140 | enum mem_cgroup_page_stat_item idx) | ||
141 | { | ||
142 | mem_cgroup_update_page_stat(page, idx, -1); | ||
143 | } | ||
144 | |||
125 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 145 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
126 | gfp_t gfp_mask); | 146 | gfp_t gfp_mask); |
127 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 147 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); |
128 | 148 | ||
149 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
150 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | ||
151 | #endif | ||
152 | |||
129 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 153 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
130 | struct mem_cgroup; | 154 | struct mem_cgroup; |
131 | 155 | ||
@@ -231,8 +255,7 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage, | |||
231 | } | 255 | } |
232 | 256 | ||
233 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, | 257 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, |
234 | struct page *oldpage, | 258 | struct page *oldpage, struct page *newpage, bool migration_ok) |
235 | struct page *newpage) | ||
236 | { | 259 | { |
237 | } | 260 | } |
238 | 261 | ||
@@ -293,8 +316,13 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
293 | { | 316 | { |
294 | } | 317 | } |
295 | 318 | ||
296 | static inline void mem_cgroup_update_file_mapped(struct page *page, | 319 | static inline void mem_cgroup_inc_page_stat(struct page *page, |
297 | int val) | 320 | enum mem_cgroup_page_stat_item idx) |
321 | { | ||
322 | } | ||
323 | |||
324 | static inline void mem_cgroup_dec_page_stat(struct page *page, | ||
325 | enum mem_cgroup_page_stat_item idx) | ||
298 | { | 326 | { |
299 | } | 327 | } |
300 | 328 | ||
@@ -311,6 +339,11 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | |||
311 | return 0; | 339 | return 0; |
312 | } | 340 | } |
313 | 341 | ||
342 | static inline void mem_cgroup_split_huge_fixup(struct page *head, | ||
343 | struct page *tail) | ||
344 | { | ||
345 | } | ||
346 | |||
314 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 347 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
315 | 348 | ||
316 | #endif /* _LINUX_MEMCONTROL_H */ | 349 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 31c237a00c48..8122018d3000 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -13,12 +13,16 @@ struct mem_section; | |||
13 | #ifdef CONFIG_MEMORY_HOTPLUG | 13 | #ifdef CONFIG_MEMORY_HOTPLUG |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Types for free bootmem. | 16 | * Types for free bootmem stored in page->lru.next. These have to be in |
17 | * The normal smallest mapcount is -1. Here is smaller value than it. | 17 | * some random range in unsigned long space for debugging purposes. |
18 | */ | 18 | */ |
19 | #define SECTION_INFO (-1 - 1) | 19 | enum { |
20 | #define MIX_SECTION_INFO (-1 - 2) | 20 | MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 12, |
21 | #define NODE_INFO (-1 - 3) | 21 | SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE, |
22 | MIX_SECTION_INFO, | ||
23 | NODE_INFO, | ||
24 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, | ||
25 | }; | ||
22 | 26 | ||
23 | /* | 27 | /* |
24 | * pgdat resizing functions | 28 | * pgdat resizing functions |
@@ -161,6 +165,12 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
161 | extern void put_page_bootmem(struct page *page); | 165 | extern void put_page_bootmem(struct page *page); |
162 | #endif | 166 | #endif |
163 | 167 | ||
168 | /* | ||
169 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | ||
170 | * notifier will be called under this. 2) offline/online/add/remove memory | ||
171 | * will not run simultaneously. | ||
172 | */ | ||
173 | |||
164 | void lock_memory_hotplug(void); | 174 | void lock_memory_hotplug(void); |
165 | void unlock_memory_hotplug(void); | 175 | void unlock_memory_hotplug(void); |
166 | 176 | ||
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index d63b6050b183..37f56b7c4c15 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -74,32 +74,37 @@ | |||
74 | #define AB8500_INT_ACC_DETECT_21DB_F 37 | 74 | #define AB8500_INT_ACC_DETECT_21DB_F 37 |
75 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | 75 | #define AB8500_INT_ACC_DETECT_21DB_R 38 |
76 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | 76 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 |
77 | #define AB8500_INT_BTEMP_LOW 72 | 77 | #define AB8500_INT_ADP_SOURCE_ERROR 72 |
78 | #define AB8500_INT_BTEMP_LOW_MEDIUM 73 | 78 | #define AB8500_INT_ADP_SINK_ERROR 73 |
79 | #define AB8500_INT_BTEMP_MEDIUM_HIGH 74 | 79 | #define AB8500_INT_ADP_PROBE_PLUG 74 |
80 | #define AB8500_INT_BTEMP_HIGH 75 | 80 | #define AB8500_INT_ADP_PROBE_UNPLUG 75 |
81 | #define AB8500_INT_USB_CHARGER_NOT_OK 81 | 81 | #define AB8500_INT_ADP_SENSE_OFF 76 |
82 | #define AB8500_INT_ID_WAKEUP_R 82 | 82 | #define AB8500_INT_USB_PHY_POWER_ERR 78 |
83 | #define AB8500_INT_ID_DET_R1R 84 | 83 | #define AB8500_INT_USB_LINK_STATUS 79 |
84 | #define AB8500_INT_ID_DET_R2R 85 | 84 | #define AB8500_INT_BTEMP_LOW 80 |
85 | #define AB8500_INT_ID_DET_R3R 86 | 85 | #define AB8500_INT_BTEMP_LOW_MEDIUM 81 |
86 | #define AB8500_INT_ID_DET_R4R 87 | 86 | #define AB8500_INT_BTEMP_MEDIUM_HIGH 82 |
87 | #define AB8500_INT_ID_WAKEUP_F 88 | 87 | #define AB8500_INT_BTEMP_HIGH 83 |
88 | #define AB8500_INT_ID_DET_R1F 90 | 88 | #define AB8500_INT_USB_CHARGER_NOT_OK 89 |
89 | #define AB8500_INT_ID_DET_R2F 91 | 89 | #define AB8500_INT_ID_WAKEUP_R 90 |
90 | #define AB8500_INT_ID_DET_R3F 92 | 90 | #define AB8500_INT_ID_DET_R1R 92 |
91 | #define AB8500_INT_ID_DET_R4F 93 | 91 | #define AB8500_INT_ID_DET_R2R 93 |
92 | #define AB8500_INT_USB_CHG_DET_DONE 94 | 92 | #define AB8500_INT_ID_DET_R3R 94 |
93 | #define AB8500_INT_USB_CH_TH_PROT_F 96 | 93 | #define AB8500_INT_ID_DET_R4R 95 |
94 | #define AB8500_INT_USB_CH_TH_PROP_R 97 | 94 | #define AB8500_INT_ID_WAKEUP_F 96 |
95 | #define AB8500_INT_MAIN_CH_TH_PROP_F 98 | 95 | #define AB8500_INT_ID_DET_R1F 98 |
96 | #define AB8500_INT_MAIN_CH_TH_PROT_R 99 | 96 | #define AB8500_INT_ID_DET_R2F 99 |
97 | #define AB8500_INT_USB_CHARGER_NOT_OKF 103 | 97 | #define AB8500_INT_ID_DET_R3F 100 |
98 | #define AB8500_INT_ID_DET_R4F 101 | ||
99 | #define AB8500_INT_USB_CHG_DET_DONE 102 | ||
100 | #define AB8500_INT_USB_CH_TH_PROT_F 104 | ||
101 | #define AB8500_INT_USB_CH_TH_PROT_R 105 | ||
102 | #define AB8500_INT_MAIN_CH_TH_PROT_F 106 | ||
103 | #define AB8500_INT_MAIN_CH_TH_PROT_R 107 | ||
104 | #define AB8500_INT_USB_CHARGER_NOT_OKF 111 | ||
98 | 105 | ||
99 | #define AB8500_NR_IRQS 104 | 106 | #define AB8500_NR_IRQS 112 |
100 | #define AB8500_NUM_IRQ_REGS 13 | 107 | #define AB8500_NUM_IRQ_REGS 14 |
101 | |||
102 | #define AB8500_NUM_REGULATORS 15 | ||
103 | 108 | ||
104 | /** | 109 | /** |
105 | * struct ab8500 - ab8500 internal structure | 110 | * struct ab8500 - ab8500 internal structure |
@@ -145,7 +150,8 @@ struct regulator_init_data; | |||
145 | struct ab8500_platform_data { | 150 | struct ab8500_platform_data { |
146 | int irq_base; | 151 | int irq_base; |
147 | void (*init) (struct ab8500 *); | 152 | void (*init) (struct ab8500 *); |
148 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; | 153 | int num_regulator; |
154 | struct regulator_init_data *regulator; | ||
149 | }; | 155 | }; |
150 | 156 | ||
151 | extern int __devinit ab8500_init(struct ab8500 *ab8500); | 157 | extern int __devinit ab8500_init(struct ab8500 *ab8500); |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cb93d80aa642..835996e167e1 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -39,7 +39,7 @@ struct mfd_cell { | |||
39 | size_t data_size; | 39 | size_t data_size; |
40 | 40 | ||
41 | /* | 41 | /* |
42 | * This resources can be specified relatievly to the parent device. | 42 | * This resources can be specified relatively to the parent device. |
43 | * For accessing device you should use resources from device | 43 | * For accessing device you should use resources from device |
44 | */ | 44 | */ |
45 | int num_resources; | 45 | int num_resources; |
@@ -47,6 +47,12 @@ struct mfd_cell { | |||
47 | 47 | ||
48 | /* don't check for resource conflicts */ | 48 | /* don't check for resource conflicts */ |
49 | bool ignore_resource_conflicts; | 49 | bool ignore_resource_conflicts; |
50 | |||
51 | /* | ||
52 | * Disable runtime PM callbacks for this subdevice - see | ||
53 | * pm_runtime_no_callbacks(). | ||
54 | */ | ||
55 | bool pm_runtime_no_callbacks; | ||
50 | }; | 56 | }; |
51 | 57 | ||
52 | extern int mfd_add_devices(struct device *parent, int id, | 58 | extern int mfd_add_devices(struct device *parent, int id, |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 7363dea6bbcd..effa5d3b96ae 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
@@ -159,10 +159,12 @@ struct max8998_dev { | |||
159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; | 159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; |
160 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; | 160 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; |
161 | int type; | 161 | int type; |
162 | bool wakeup; | ||
162 | }; | 163 | }; |
163 | 164 | ||
164 | int max8998_irq_init(struct max8998_dev *max8998); | 165 | int max8998_irq_init(struct max8998_dev *max8998); |
165 | void max8998_irq_exit(struct max8998_dev *max8998); | 166 | void max8998_irq_exit(struct max8998_dev *max8998); |
167 | int max8998_irq_resume(struct max8998_dev *max8998); | ||
166 | 168 | ||
167 | extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); | 169 | extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); |
168 | extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count, | 170 | extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count, |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index f8c9f884aff2..61daa167b576 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -70,24 +70,43 @@ struct max8998_regulator_data { | |||
70 | * @num_regulators: number of regultors used | 70 | * @num_regulators: number of regultors used |
71 | * @irq_base: base IRQ number for max8998, required for IRQs | 71 | * @irq_base: base IRQ number for max8998, required for IRQs |
72 | * @ono: power onoff IRQ number for max8998 | 72 | * @ono: power onoff IRQ number for max8998 |
73 | * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1 | 73 | * @buck_voltage_lock: Do NOT change the values of the following six |
74 | * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2 | 74 | * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot |
75 | * @buck2_max_voltage: BUCK2 maximum alowed voltage | 75 | * be other than the preset values. |
76 | * @buck1_voltage1: BUCK1 DVS mode 1 voltage register | ||
77 | * @buck1_voltage2: BUCK1 DVS mode 2 voltage register | ||
78 | * @buck1_voltage3: BUCK1 DVS mode 3 voltage register | ||
79 | * @buck1_voltage4: BUCK1 DVS mode 4 voltage register | ||
80 | * @buck2_voltage1: BUCK2 DVS mode 1 voltage register | ||
81 | * @buck2_voltage2: BUCK2 DVS mode 2 voltage register | ||
76 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage | 82 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage |
77 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage | 83 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage |
84 | * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 | ||
78 | * @buck2_set3: BUCK2 gpio pin to set output voltage | 85 | * @buck2_set3: BUCK2 gpio pin to set output voltage |
86 | * @buck2_default_idx: Default for BUCK2 gpio pin. | ||
87 | * @wakeup: Allow to wake up from suspend | ||
88 | * @rtc_delay: LP3974 RTC chip bug that requires delay after a register | ||
89 | * write before reading it. | ||
79 | */ | 90 | */ |
80 | struct max8998_platform_data { | 91 | struct max8998_platform_data { |
81 | struct max8998_regulator_data *regulators; | 92 | struct max8998_regulator_data *regulators; |
82 | int num_regulators; | 93 | int num_regulators; |
83 | int irq_base; | 94 | int irq_base; |
84 | int ono; | 95 | int ono; |
85 | int buck1_max_voltage1; | 96 | bool buck_voltage_lock; |
86 | int buck1_max_voltage2; | 97 | int buck1_voltage1; |
87 | int buck2_max_voltage; | 98 | int buck1_voltage2; |
99 | int buck1_voltage3; | ||
100 | int buck1_voltage4; | ||
101 | int buck2_voltage1; | ||
102 | int buck2_voltage2; | ||
88 | int buck1_set1; | 103 | int buck1_set1; |
89 | int buck1_set2; | 104 | int buck1_set2; |
105 | int buck1_default_idx; | ||
90 | int buck2_set3; | 106 | int buck2_set3; |
107 | int buck2_default_idx; | ||
108 | bool wakeup; | ||
109 | bool rtc_delay; | ||
91 | }; | 110 | }; |
92 | 111 | ||
93 | #endif /* __LINUX_MFD_MAX8998_H */ | 112 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index b4c741e352c2..7d0f3d6a0002 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
2 | * Copyright 2009-2010 Pengutronix | 3 | * Copyright 2009-2010 Pengutronix |
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | 4 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
4 | * | 5 | * |
@@ -122,39 +123,39 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
122 | unsigned int channel, unsigned int *sample); | 123 | unsigned int channel, unsigned int *sample); |
123 | 124 | ||
124 | 125 | ||
125 | #define MC13783_SW_SW1A 0 | 126 | #define MC13783_REG_SW1A 0 |
126 | #define MC13783_SW_SW1B 1 | 127 | #define MC13783_REG_SW1B 1 |
127 | #define MC13783_SW_SW2A 2 | 128 | #define MC13783_REG_SW2A 2 |
128 | #define MC13783_SW_SW2B 3 | 129 | #define MC13783_REG_SW2B 3 |
129 | #define MC13783_SW_SW3 4 | 130 | #define MC13783_REG_SW3 4 |
130 | #define MC13783_SW_PLL 5 | 131 | #define MC13783_REG_PLL 5 |
131 | #define MC13783_REGU_VAUDIO 6 | 132 | #define MC13783_REG_VAUDIO 6 |
132 | #define MC13783_REGU_VIOHI 7 | 133 | #define MC13783_REG_VIOHI 7 |
133 | #define MC13783_REGU_VIOLO 8 | 134 | #define MC13783_REG_VIOLO 8 |
134 | #define MC13783_REGU_VDIG 9 | 135 | #define MC13783_REG_VDIG 9 |
135 | #define MC13783_REGU_VGEN 10 | 136 | #define MC13783_REG_VGEN 10 |
136 | #define MC13783_REGU_VRFDIG 11 | 137 | #define MC13783_REG_VRFDIG 11 |
137 | #define MC13783_REGU_VRFREF 12 | 138 | #define MC13783_REG_VRFREF 12 |
138 | #define MC13783_REGU_VRFCP 13 | 139 | #define MC13783_REG_VRFCP 13 |
139 | #define MC13783_REGU_VSIM 14 | 140 | #define MC13783_REG_VSIM 14 |
140 | #define MC13783_REGU_VESIM 15 | 141 | #define MC13783_REG_VESIM 15 |
141 | #define MC13783_REGU_VCAM 16 | 142 | #define MC13783_REG_VCAM 16 |
142 | #define MC13783_REGU_VRFBG 17 | 143 | #define MC13783_REG_VRFBG 17 |
143 | #define MC13783_REGU_VVIB 18 | 144 | #define MC13783_REG_VVIB 18 |
144 | #define MC13783_REGU_VRF1 19 | 145 | #define MC13783_REG_VRF1 19 |
145 | #define MC13783_REGU_VRF2 20 | 146 | #define MC13783_REG_VRF2 20 |
146 | #define MC13783_REGU_VMMC1 21 | 147 | #define MC13783_REG_VMMC1 21 |
147 | #define MC13783_REGU_VMMC2 22 | 148 | #define MC13783_REG_VMMC2 22 |
148 | #define MC13783_REGU_GPO1 23 | 149 | #define MC13783_REG_GPO1 23 |
149 | #define MC13783_REGU_GPO2 24 | 150 | #define MC13783_REG_GPO2 24 |
150 | #define MC13783_REGU_GPO3 25 | 151 | #define MC13783_REG_GPO3 25 |
151 | #define MC13783_REGU_GPO4 26 | 152 | #define MC13783_REG_GPO4 26 |
152 | #define MC13783_REGU_V1 27 | 153 | #define MC13783_REG_V1 27 |
153 | #define MC13783_REGU_V2 28 | 154 | #define MC13783_REG_V2 28 |
154 | #define MC13783_REGU_V3 29 | 155 | #define MC13783_REG_V3 29 |
155 | #define MC13783_REGU_V4 30 | 156 | #define MC13783_REG_V4 30 |
156 | #define MC13783_REGU_PWGT1SPI 31 | 157 | #define MC13783_REG_PWGT1SPI 31 |
157 | #define MC13783_REGU_PWGT2SPI 32 | 158 | #define MC13783_REG_PWGT2SPI 32 |
158 | 159 | ||
159 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE | 160 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE |
160 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE | 161 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE |
diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h new file mode 100644 index 000000000000..a00f2bec178c --- /dev/null +++ b/include/linux/mfd/mc13892.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_MFD_MC13892_H | ||
10 | #define __LINUX_MFD_MC13892_H | ||
11 | |||
12 | #include <linux/mfd/mc13xxx.h> | ||
13 | |||
14 | #define MC13892_SW1 0 | ||
15 | #define MC13892_SW2 1 | ||
16 | #define MC13892_SW3 2 | ||
17 | #define MC13892_SW4 3 | ||
18 | #define MC13892_SWBST 4 | ||
19 | #define MC13892_VIOHI 5 | ||
20 | #define MC13892_VPLL 6 | ||
21 | #define MC13892_VDIG 7 | ||
22 | #define MC13892_VSD 8 | ||
23 | #define MC13892_VUSB2 9 | ||
24 | #define MC13892_VVIDEO 10 | ||
25 | #define MC13892_VAUDIO 11 | ||
26 | #define MC13892_VCAM 12 | ||
27 | #define MC13892_VGEN1 13 | ||
28 | #define MC13892_VGEN2 14 | ||
29 | #define MC13892_VGEN3 15 | ||
30 | #define MC13892_VUSB 16 | ||
31 | #define MC13892_GPO1 17 | ||
32 | #define MC13892_GPO2 18 | ||
33 | #define MC13892_GPO3 19 | ||
34 | #define MC13892_GPO4 20 | ||
35 | #define MC13892_PWGT1SPI 21 | ||
36 | #define MC13892_PWGT2SPI 22 | ||
37 | #define MC13892_VCOINCELL 23 | ||
38 | |||
39 | #endif | ||
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h deleted file mode 100644 index eff3094ca84e..000000000000 --- a/include/linux/mfd/tc35892.h +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC35892_H | ||
8 | #define __LINUX_MFD_TC35892_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | #define TC35892_RSTCTRL_IRQRST (1 << 4) | ||
13 | #define TC35892_RSTCTRL_TIMRST (1 << 3) | ||
14 | #define TC35892_RSTCTRL_ROTRST (1 << 2) | ||
15 | #define TC35892_RSTCTRL_KBDRST (1 << 1) | ||
16 | #define TC35892_RSTCTRL_GPIRST (1 << 0) | ||
17 | |||
18 | #define TC35892_IRQST 0x91 | ||
19 | |||
20 | #define TC35892_MANFCODE_MAGIC 0x03 | ||
21 | #define TC35892_MANFCODE 0x80 | ||
22 | #define TC35892_VERSION 0x81 | ||
23 | #define TC35892_IOCFG 0xA7 | ||
24 | |||
25 | #define TC35892_CLKMODE 0x88 | ||
26 | #define TC35892_CLKCFG 0x89 | ||
27 | #define TC35892_CLKEN 0x8A | ||
28 | |||
29 | #define TC35892_RSTCTRL 0x82 | ||
30 | #define TC35892_EXTRSTN 0x83 | ||
31 | #define TC35892_RSTINTCLR 0x84 | ||
32 | |||
33 | #define TC35892_GPIOIS0 0xC9 | ||
34 | #define TC35892_GPIOIS1 0xCA | ||
35 | #define TC35892_GPIOIS2 0xCB | ||
36 | #define TC35892_GPIOIBE0 0xCC | ||
37 | #define TC35892_GPIOIBE1 0xCD | ||
38 | #define TC35892_GPIOIBE2 0xCE | ||
39 | #define TC35892_GPIOIEV0 0xCF | ||
40 | #define TC35892_GPIOIEV1 0xD0 | ||
41 | #define TC35892_GPIOIEV2 0xD1 | ||
42 | #define TC35892_GPIOIE0 0xD2 | ||
43 | #define TC35892_GPIOIE1 0xD3 | ||
44 | #define TC35892_GPIOIE2 0xD4 | ||
45 | #define TC35892_GPIORIS0 0xD6 | ||
46 | #define TC35892_GPIORIS1 0xD7 | ||
47 | #define TC35892_GPIORIS2 0xD8 | ||
48 | #define TC35892_GPIOMIS0 0xD9 | ||
49 | #define TC35892_GPIOMIS1 0xDA | ||
50 | #define TC35892_GPIOMIS2 0xDB | ||
51 | #define TC35892_GPIOIC0 0xDC | ||
52 | #define TC35892_GPIOIC1 0xDD | ||
53 | #define TC35892_GPIOIC2 0xDE | ||
54 | |||
55 | #define TC35892_GPIODATA0 0xC0 | ||
56 | #define TC35892_GPIOMASK0 0xc1 | ||
57 | #define TC35892_GPIODATA1 0xC2 | ||
58 | #define TC35892_GPIOMASK1 0xc3 | ||
59 | #define TC35892_GPIODATA2 0xC4 | ||
60 | #define TC35892_GPIOMASK2 0xC5 | ||
61 | |||
62 | #define TC35892_GPIODIR0 0xC6 | ||
63 | #define TC35892_GPIODIR1 0xC7 | ||
64 | #define TC35892_GPIODIR2 0xC8 | ||
65 | |||
66 | #define TC35892_GPIOSYNC0 0xE6 | ||
67 | #define TC35892_GPIOSYNC1 0xE7 | ||
68 | #define TC35892_GPIOSYNC2 0xE8 | ||
69 | |||
70 | #define TC35892_GPIOWAKE0 0xE9 | ||
71 | #define TC35892_GPIOWAKE1 0xEA | ||
72 | #define TC35892_GPIOWAKE2 0xEB | ||
73 | |||
74 | #define TC35892_GPIOODM0 0xE0 | ||
75 | #define TC35892_GPIOODE0 0xE1 | ||
76 | #define TC35892_GPIOODM1 0xE2 | ||
77 | #define TC35892_GPIOODE1 0xE3 | ||
78 | #define TC35892_GPIOODM2 0xE4 | ||
79 | #define TC35892_GPIOODE2 0xE5 | ||
80 | |||
81 | #define TC35892_INT_GPIIRQ 0 | ||
82 | #define TC35892_INT_TI0IRQ 1 | ||
83 | #define TC35892_INT_TI1IRQ 2 | ||
84 | #define TC35892_INT_TI2IRQ 3 | ||
85 | #define TC35892_INT_ROTIRQ 5 | ||
86 | #define TC35892_INT_KBDIRQ 6 | ||
87 | #define TC35892_INT_PORIRQ 7 | ||
88 | |||
89 | #define TC35892_NR_INTERNAL_IRQS 8 | ||
90 | #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) | ||
91 | |||
92 | struct tc35892 { | ||
93 | struct mutex lock; | ||
94 | struct device *dev; | ||
95 | struct i2c_client *i2c; | ||
96 | |||
97 | int irq_base; | ||
98 | int num_gpio; | ||
99 | struct tc35892_platform_data *pdata; | ||
100 | }; | ||
101 | |||
102 | extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data); | ||
103 | extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg); | ||
104 | extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length, | ||
105 | u8 *values); | ||
106 | extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length, | ||
107 | const u8 *values); | ||
108 | extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val); | ||
109 | |||
110 | /** | ||
111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data | ||
112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of | ||
113 | * %TC35892_NR_GPIOS GPIOs will be allocated. | ||
114 | * @setup: callback for board-specific initialization | ||
115 | * @remove: callback for board-specific teardown | ||
116 | */ | ||
117 | struct tc35892_gpio_platform_data { | ||
118 | int gpio_base; | ||
119 | void (*setup)(struct tc35892 *tc35892, unsigned gpio_base); | ||
120 | void (*remove)(struct tc35892 *tc35892, unsigned gpio_base); | ||
121 | }; | ||
122 | |||
123 | /** | ||
124 | * struct tc35892_platform_data - TC35892 platform data | ||
125 | * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used. | ||
126 | * @gpio: GPIO-specific platform data | ||
127 | */ | ||
128 | struct tc35892_platform_data { | ||
129 | int irq_base; | ||
130 | struct tc35892_gpio_platform_data *gpio; | ||
131 | }; | ||
132 | |||
133 | #define TC35892_NR_GPIOS 24 | ||
134 | #define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS) | ||
135 | |||
136 | #endif | ||
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h new file mode 100644 index 000000000000..16c76e124f9c --- /dev/null +++ b/include/linux/mfd/tc3589x.h | |||
@@ -0,0 +1,195 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC3589x_H | ||
8 | #define __LINUX_MFD_TC3589x_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | enum tx3589x_block { | ||
13 | TC3589x_BLOCK_GPIO = 1 << 0, | ||
14 | TC3589x_BLOCK_KEYPAD = 1 << 1, | ||
15 | }; | ||
16 | |||
17 | #define TC3589x_RSTCTRL_IRQRST (1 << 4) | ||
18 | #define TC3589x_RSTCTRL_TIMRST (1 << 3) | ||
19 | #define TC3589x_RSTCTRL_ROTRST (1 << 2) | ||
20 | #define TC3589x_RSTCTRL_KBDRST (1 << 1) | ||
21 | #define TC3589x_RSTCTRL_GPIRST (1 << 0) | ||
22 | |||
23 | /* Keyboard Configuration Registers */ | ||
24 | #define TC3589x_KBDSETTLE_REG 0x01 | ||
25 | #define TC3589x_KBDBOUNCE 0x02 | ||
26 | #define TC3589x_KBDSIZE 0x03 | ||
27 | #define TC3589x_KBCFG_LSB 0x04 | ||
28 | #define TC3589x_KBCFG_MSB 0x05 | ||
29 | #define TC3589x_KBDIC 0x08 | ||
30 | #define TC3589x_KBDMSK 0x09 | ||
31 | #define TC3589x_EVTCODE_FIFO 0x10 | ||
32 | #define TC3589x_KBDMFS 0x8F | ||
33 | |||
34 | #define TC3589x_IRQST 0x91 | ||
35 | |||
36 | #define TC3589x_MANFCODE_MAGIC 0x03 | ||
37 | #define TC3589x_MANFCODE 0x80 | ||
38 | #define TC3589x_VERSION 0x81 | ||
39 | #define TC3589x_IOCFG 0xA7 | ||
40 | |||
41 | #define TC3589x_CLKMODE 0x88 | ||
42 | #define TC3589x_CLKCFG 0x89 | ||
43 | #define TC3589x_CLKEN 0x8A | ||
44 | |||
45 | #define TC3589x_RSTCTRL 0x82 | ||
46 | #define TC3589x_EXTRSTN 0x83 | ||
47 | #define TC3589x_RSTINTCLR 0x84 | ||
48 | |||
49 | /* Pull up/down configuration registers */ | ||
50 | #define TC3589x_IOCFG 0xA7 | ||
51 | #define TC3589x_IOPULLCFG0_LSB 0xAA | ||
52 | #define TC3589x_IOPULLCFG0_MSB 0xAB | ||
53 | #define TC3589x_IOPULLCFG1_LSB 0xAC | ||
54 | #define TC3589x_IOPULLCFG1_MSB 0xAD | ||
55 | #define TC3589x_IOPULLCFG2_LSB 0xAE | ||
56 | |||
57 | #define TC3589x_GPIOIS0 0xC9 | ||
58 | #define TC3589x_GPIOIS1 0xCA | ||
59 | #define TC3589x_GPIOIS2 0xCB | ||
60 | #define TC3589x_GPIOIBE0 0xCC | ||
61 | #define TC3589x_GPIOIBE1 0xCD | ||
62 | #define TC3589x_GPIOIBE2 0xCE | ||
63 | #define TC3589x_GPIOIEV0 0xCF | ||
64 | #define TC3589x_GPIOIEV1 0xD0 | ||
65 | #define TC3589x_GPIOIEV2 0xD1 | ||
66 | #define TC3589x_GPIOIE0 0xD2 | ||
67 | #define TC3589x_GPIOIE1 0xD3 | ||
68 | #define TC3589x_GPIOIE2 0xD4 | ||
69 | #define TC3589x_GPIORIS0 0xD6 | ||
70 | #define TC3589x_GPIORIS1 0xD7 | ||
71 | #define TC3589x_GPIORIS2 0xD8 | ||
72 | #define TC3589x_GPIOMIS0 0xD9 | ||
73 | #define TC3589x_GPIOMIS1 0xDA | ||
74 | #define TC3589x_GPIOMIS2 0xDB | ||
75 | #define TC3589x_GPIOIC0 0xDC | ||
76 | #define TC3589x_GPIOIC1 0xDD | ||
77 | #define TC3589x_GPIOIC2 0xDE | ||
78 | |||
79 | #define TC3589x_GPIODATA0 0xC0 | ||
80 | #define TC3589x_GPIOMASK0 0xc1 | ||
81 | #define TC3589x_GPIODATA1 0xC2 | ||
82 | #define TC3589x_GPIOMASK1 0xc3 | ||
83 | #define TC3589x_GPIODATA2 0xC4 | ||
84 | #define TC3589x_GPIOMASK2 0xC5 | ||
85 | |||
86 | #define TC3589x_GPIODIR0 0xC6 | ||
87 | #define TC3589x_GPIODIR1 0xC7 | ||
88 | #define TC3589x_GPIODIR2 0xC8 | ||
89 | |||
90 | #define TC3589x_GPIOSYNC0 0xE6 | ||
91 | #define TC3589x_GPIOSYNC1 0xE7 | ||
92 | #define TC3589x_GPIOSYNC2 0xE8 | ||
93 | |||
94 | #define TC3589x_GPIOWAKE0 0xE9 | ||
95 | #define TC3589x_GPIOWAKE1 0xEA | ||
96 | #define TC3589x_GPIOWAKE2 0xEB | ||
97 | |||
98 | #define TC3589x_GPIOODM0 0xE0 | ||
99 | #define TC3589x_GPIOODE0 0xE1 | ||
100 | #define TC3589x_GPIOODM1 0xE2 | ||
101 | #define TC3589x_GPIOODE1 0xE3 | ||
102 | #define TC3589x_GPIOODM2 0xE4 | ||
103 | #define TC3589x_GPIOODE2 0xE5 | ||
104 | |||
105 | #define TC3589x_INT_GPIIRQ 0 | ||
106 | #define TC3589x_INT_TI0IRQ 1 | ||
107 | #define TC3589x_INT_TI1IRQ 2 | ||
108 | #define TC3589x_INT_TI2IRQ 3 | ||
109 | #define TC3589x_INT_ROTIRQ 5 | ||
110 | #define TC3589x_INT_KBDIRQ 6 | ||
111 | #define TC3589x_INT_PORIRQ 7 | ||
112 | |||
113 | #define TC3589x_NR_INTERNAL_IRQS 8 | ||
114 | #define TC3589x_INT_GPIO(x) (TC3589x_NR_INTERNAL_IRQS + (x)) | ||
115 | |||
116 | struct tc3589x { | ||
117 | struct mutex lock; | ||
118 | struct device *dev; | ||
119 | struct i2c_client *i2c; | ||
120 | |||
121 | int irq_base; | ||
122 | int num_gpio; | ||
123 | struct tc3589x_platform_data *pdata; | ||
124 | }; | ||
125 | |||
126 | extern int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data); | ||
127 | extern int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg); | ||
128 | extern int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
129 | u8 *values); | ||
130 | extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
131 | const u8 *values); | ||
132 | extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val); | ||
133 | |||
134 | /* | ||
135 | * Keypad related platform specific constants | ||
136 | * These values may be modified for fine tuning | ||
137 | */ | ||
138 | #define TC_KPD_ROWS 0x8 | ||
139 | #define TC_KPD_COLUMNS 0x8 | ||
140 | #define TC_KPD_DEBOUNCE_PERIOD 0xA3 | ||
141 | #define TC_KPD_SETTLE_TIME 0xA3 | ||
142 | |||
143 | /** | ||
144 | * struct tc35893_platform_data - data structure for platform specific data | ||
145 | * @keymap_data: matrix scan code table for keycodes | ||
146 | * @krow: mask for available rows, value is 0xFF | ||
147 | * @kcol: mask for available columns, value is 0xFF | ||
148 | * @debounce_period: platform specific debounce time | ||
149 | * @settle_time: platform specific settle down time | ||
150 | * @irqtype: type of interrupt, falling or rising edge | ||
151 | * @enable_wakeup: specifies if keypad event can wake up system from sleep | ||
152 | * @no_autorepeat: flag for auto repetition | ||
153 | */ | ||
154 | struct tc3589x_keypad_platform_data { | ||
155 | const struct matrix_keymap_data *keymap_data; | ||
156 | u8 krow; | ||
157 | u8 kcol; | ||
158 | u8 debounce_period; | ||
159 | u8 settle_time; | ||
160 | unsigned long irqtype; | ||
161 | bool enable_wakeup; | ||
162 | bool no_autorepeat; | ||
163 | }; | ||
164 | |||
165 | /** | ||
166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | ||
167 | * @gpio_base: first gpio number assigned to TC3589x. A maximum of | ||
168 | * %TC3589x_NR_GPIOS GPIOs will be allocated. | ||
169 | * @setup: callback for board-specific initialization | ||
170 | * @remove: callback for board-specific teardown | ||
171 | */ | ||
172 | struct tc3589x_gpio_platform_data { | ||
173 | int gpio_base; | ||
174 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
175 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
176 | }; | ||
177 | |||
178 | /** | ||
179 | * struct tc3589x_platform_data - TC3589x platform data | ||
180 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | ||
181 | * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used. | ||
182 | * @gpio: GPIO-specific platform data | ||
183 | * @keypad: keypad-specific platform data | ||
184 | */ | ||
185 | struct tc3589x_platform_data { | ||
186 | unsigned int block; | ||
187 | int irq_base; | ||
188 | struct tc3589x_gpio_platform_data *gpio; | ||
189 | const struct tc3589x_keypad_platform_data *keypad; | ||
190 | }; | ||
191 | |||
192 | #define TC3589x_NR_GPIOS 24 | ||
193 | #define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS) | ||
194 | |||
195 | #endif | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 085f041197dc..8e70310ee945 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/wl1273-core.h b/include/linux/mfd/wl1273-core.h new file mode 100644 index 000000000000..9787293eae5f --- /dev/null +++ b/include/linux/mfd/wl1273-core.h | |||
@@ -0,0 +1,288 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wl1273-core.h | ||
3 | * | ||
4 | * Some definitions for the wl1273 radio receiver/transmitter chip. | ||
5 | * | ||
6 | * Copyright (C) 2010 Nokia Corporation | ||
7 | * Author: Matti J. Aaltonen <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, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * 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., 51 Franklin St, Fifth Floor, Boston, MA | ||
21 | * 02110-1301 USA | ||
22 | */ | ||
23 | |||
24 | #ifndef WL1273_CORE_H | ||
25 | #define WL1273_CORE_H | ||
26 | |||
27 | #include <linux/i2c.h> | ||
28 | #include <linux/mfd/core.h> | ||
29 | |||
30 | #define WL1273_FM_DRIVER_NAME "wl1273-fm" | ||
31 | #define RX71_FM_I2C_ADDR 0x22 | ||
32 | |||
33 | #define WL1273_STEREO_GET 0 | ||
34 | #define WL1273_RSSI_LVL_GET 1 | ||
35 | #define WL1273_IF_COUNT_GET 2 | ||
36 | #define WL1273_FLAG_GET 3 | ||
37 | #define WL1273_RDS_SYNC_GET 4 | ||
38 | #define WL1273_RDS_DATA_GET 5 | ||
39 | #define WL1273_FREQ_SET 10 | ||
40 | #define WL1273_AF_FREQ_SET 11 | ||
41 | #define WL1273_MOST_MODE_SET 12 | ||
42 | #define WL1273_MOST_BLEND_SET 13 | ||
43 | #define WL1273_DEMPH_MODE_SET 14 | ||
44 | #define WL1273_SEARCH_LVL_SET 15 | ||
45 | #define WL1273_BAND_SET 16 | ||
46 | #define WL1273_MUTE_STATUS_SET 17 | ||
47 | #define WL1273_RDS_PAUSE_LVL_SET 18 | ||
48 | #define WL1273_RDS_PAUSE_DUR_SET 19 | ||
49 | #define WL1273_RDS_MEM_SET 20 | ||
50 | #define WL1273_RDS_BLK_B_SET 21 | ||
51 | #define WL1273_RDS_MSK_B_SET 22 | ||
52 | #define WL1273_RDS_PI_MASK_SET 23 | ||
53 | #define WL1273_RDS_PI_SET 24 | ||
54 | #define WL1273_RDS_SYSTEM_SET 25 | ||
55 | #define WL1273_INT_MASK_SET 26 | ||
56 | #define WL1273_SEARCH_DIR_SET 27 | ||
57 | #define WL1273_VOLUME_SET 28 | ||
58 | #define WL1273_AUDIO_ENABLE 29 | ||
59 | #define WL1273_PCM_MODE_SET 30 | ||
60 | #define WL1273_I2S_MODE_CONFIG_SET 31 | ||
61 | #define WL1273_POWER_SET 32 | ||
62 | #define WL1273_INTX_CONFIG_SET 33 | ||
63 | #define WL1273_PULL_EN_SET 34 | ||
64 | #define WL1273_HILO_SET 35 | ||
65 | #define WL1273_SWITCH2FREF 36 | ||
66 | #define WL1273_FREQ_DRIFT_REPORT 37 | ||
67 | |||
68 | #define WL1273_PCE_GET 40 | ||
69 | #define WL1273_FIRM_VER_GET 41 | ||
70 | #define WL1273_ASIC_VER_GET 42 | ||
71 | #define WL1273_ASIC_ID_GET 43 | ||
72 | #define WL1273_MAN_ID_GET 44 | ||
73 | #define WL1273_TUNER_MODE_SET 45 | ||
74 | #define WL1273_STOP_SEARCH 46 | ||
75 | #define WL1273_RDS_CNTRL_SET 47 | ||
76 | |||
77 | #define WL1273_WRITE_HARDWARE_REG 100 | ||
78 | #define WL1273_CODE_DOWNLOAD 101 | ||
79 | #define WL1273_RESET 102 | ||
80 | |||
81 | #define WL1273_FM_POWER_MODE 254 | ||
82 | #define WL1273_FM_INTERRUPT 255 | ||
83 | |||
84 | /* Transmitter API */ | ||
85 | |||
86 | #define WL1273_CHANL_SET 55 | ||
87 | #define WL1273_SCAN_SPACING_SET 56 | ||
88 | #define WL1273_REF_SET 57 | ||
89 | #define WL1273_POWER_ENB_SET 90 | ||
90 | #define WL1273_POWER_ATT_SET 58 | ||
91 | #define WL1273_POWER_LEV_SET 59 | ||
92 | #define WL1273_AUDIO_DEV_SET 60 | ||
93 | #define WL1273_PILOT_DEV_SET 61 | ||
94 | #define WL1273_RDS_DEV_SET 62 | ||
95 | #define WL1273_PUPD_SET 91 | ||
96 | #define WL1273_AUDIO_IO_SET 63 | ||
97 | #define WL1273_PREMPH_SET 64 | ||
98 | #define WL1273_MONO_SET 66 | ||
99 | #define WL1273_MUTE 92 | ||
100 | #define WL1273_MPX_LMT_ENABLE 67 | ||
101 | #define WL1273_PI_SET 93 | ||
102 | #define WL1273_ECC_SET 69 | ||
103 | #define WL1273_PTY 70 | ||
104 | #define WL1273_AF 71 | ||
105 | #define WL1273_DISPLAY_MODE 74 | ||
106 | #define WL1273_RDS_REP_SET 77 | ||
107 | #define WL1273_RDS_CONFIG_DATA_SET 98 | ||
108 | #define WL1273_RDS_DATA_SET 99 | ||
109 | #define WL1273_RDS_DATA_ENB 94 | ||
110 | #define WL1273_TA_SET 78 | ||
111 | #define WL1273_TP_SET 79 | ||
112 | #define WL1273_DI_SET 80 | ||
113 | #define WL1273_MS_SET 81 | ||
114 | #define WL1273_PS_SCROLL_SPEED 82 | ||
115 | #define WL1273_TX_AUDIO_LEVEL_TEST 96 | ||
116 | #define WL1273_TX_AUDIO_LEVEL_TEST_THRESHOLD 73 | ||
117 | #define WL1273_TX_AUDIO_INPUT_LEVEL_RANGE_SET 54 | ||
118 | #define WL1273_RX_ANTENNA_SELECT 87 | ||
119 | #define WL1273_I2C_DEV_ADDR_SET 86 | ||
120 | #define WL1273_REF_ERR_CALIB_PARAM_SET 88 | ||
121 | #define WL1273_REF_ERR_CALIB_PERIODICITY_SET 89 | ||
122 | #define WL1273_SOC_INT_TRIGGER 52 | ||
123 | #define WL1273_SOC_AUDIO_PATH_SET 83 | ||
124 | #define WL1273_SOC_PCMI_OVERRIDE 84 | ||
125 | #define WL1273_SOC_I2S_OVERRIDE 85 | ||
126 | #define WL1273_RSSI_BLOCK_SCAN_FREQ_SET 95 | ||
127 | #define WL1273_RSSI_BLOCK_SCAN_START 97 | ||
128 | #define WL1273_RSSI_BLOCK_SCAN_DATA_GET 5 | ||
129 | #define WL1273_READ_FMANT_TUNE_VALUE 104 | ||
130 | |||
131 | #define WL1273_RDS_OFF 0 | ||
132 | #define WL1273_RDS_ON 1 | ||
133 | #define WL1273_RDS_RESET 2 | ||
134 | |||
135 | #define WL1273_AUDIO_DIGITAL 0 | ||
136 | #define WL1273_AUDIO_ANALOG 1 | ||
137 | |||
138 | #define WL1273_MODE_RX BIT(0) | ||
139 | #define WL1273_MODE_TX BIT(1) | ||
140 | #define WL1273_MODE_OFF BIT(2) | ||
141 | #define WL1273_MODE_SUSPENDED BIT(3) | ||
142 | |||
143 | #define WL1273_RADIO_CHILD BIT(0) | ||
144 | #define WL1273_CODEC_CHILD BIT(1) | ||
145 | |||
146 | #define WL1273_RX_MONO 1 | ||
147 | #define WL1273_RX_STEREO 0 | ||
148 | #define WL1273_TX_MONO 0 | ||
149 | #define WL1273_TX_STEREO 1 | ||
150 | |||
151 | #define WL1273_MAX_VOLUME 0xffff | ||
152 | #define WL1273_DEFAULT_VOLUME 0x78b8 | ||
153 | |||
154 | /* I2S protocol, left channel first, data width 16 bits */ | ||
155 | #define WL1273_PCM_DEF_MODE 0x00 | ||
156 | |||
157 | /* Rx */ | ||
158 | #define WL1273_AUDIO_ENABLE_I2S BIT(0) | ||
159 | #define WL1273_AUDIO_ENABLE_ANALOG BIT(1) | ||
160 | |||
161 | /* Tx */ | ||
162 | #define WL1273_AUDIO_IO_SET_ANALOG 0 | ||
163 | #define WL1273_AUDIO_IO_SET_I2S 1 | ||
164 | |||
165 | #define WL1273_PUPD_SET_OFF 0x00 | ||
166 | #define WL1273_PUPD_SET_ON 0x01 | ||
167 | #define WL1273_PUPD_SET_RETENTION 0x10 | ||
168 | |||
169 | /* I2S mode */ | ||
170 | #define WL1273_IS2_WIDTH_32 0x0 | ||
171 | #define WL1273_IS2_WIDTH_40 0x1 | ||
172 | #define WL1273_IS2_WIDTH_22_23 0x2 | ||
173 | #define WL1273_IS2_WIDTH_23_22 0x3 | ||
174 | #define WL1273_IS2_WIDTH_48 0x4 | ||
175 | #define WL1273_IS2_WIDTH_50 0x5 | ||
176 | #define WL1273_IS2_WIDTH_60 0x6 | ||
177 | #define WL1273_IS2_WIDTH_64 0x7 | ||
178 | #define WL1273_IS2_WIDTH_80 0x8 | ||
179 | #define WL1273_IS2_WIDTH_96 0x9 | ||
180 | #define WL1273_IS2_WIDTH_128 0xa | ||
181 | #define WL1273_IS2_WIDTH 0xf | ||
182 | |||
183 | #define WL1273_IS2_FORMAT_STD (0x0 << 4) | ||
184 | #define WL1273_IS2_FORMAT_LEFT (0x1 << 4) | ||
185 | #define WL1273_IS2_FORMAT_RIGHT (0x2 << 4) | ||
186 | #define WL1273_IS2_FORMAT_USER (0x3 << 4) | ||
187 | |||
188 | #define WL1273_IS2_MASTER (0x0 << 6) | ||
189 | #define WL1273_IS2_SLAVEW (0x1 << 6) | ||
190 | |||
191 | #define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7) | ||
192 | #define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7) | ||
193 | |||
194 | #define WL1273_IS2_SDOWS_RR (0x0 << 8) | ||
195 | #define WL1273_IS2_SDOWS_RF (0x1 << 8) | ||
196 | #define WL1273_IS2_SDOWS_FR (0x2 << 8) | ||
197 | #define WL1273_IS2_SDOWS_FF (0x3 << 8) | ||
198 | |||
199 | #define WL1273_IS2_TRI_OPT (0x0 << 10) | ||
200 | #define WL1273_IS2_TRI_ALWAYS (0x1 << 10) | ||
201 | |||
202 | #define WL1273_IS2_RATE_48K (0x0 << 12) | ||
203 | #define WL1273_IS2_RATE_44_1K (0x1 << 12) | ||
204 | #define WL1273_IS2_RATE_32K (0x2 << 12) | ||
205 | #define WL1273_IS2_RATE_22_05K (0x4 << 12) | ||
206 | #define WL1273_IS2_RATE_16K (0x5 << 12) | ||
207 | #define WL1273_IS2_RATE_12K (0x8 << 12) | ||
208 | #define WL1273_IS2_RATE_11_025 (0x9 << 12) | ||
209 | #define WL1273_IS2_RATE_8K (0xa << 12) | ||
210 | #define WL1273_IS2_RATE (0xf << 12) | ||
211 | |||
212 | #define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \ | ||
213 | WL1273_IS2_FORMAT_STD | \ | ||
214 | WL1273_IS2_MASTER | \ | ||
215 | WL1273_IS2_TRI_AFTER_SENDING | \ | ||
216 | WL1273_IS2_SDOWS_RR | \ | ||
217 | WL1273_IS2_TRI_OPT | \ | ||
218 | WL1273_IS2_RATE_48K) | ||
219 | |||
220 | #define SCHAR_MIN (-128) | ||
221 | #define SCHAR_MAX 127 | ||
222 | |||
223 | #define WL1273_FR_EVENT BIT(0) | ||
224 | #define WL1273_BL_EVENT BIT(1) | ||
225 | #define WL1273_RDS_EVENT BIT(2) | ||
226 | #define WL1273_BBLK_EVENT BIT(3) | ||
227 | #define WL1273_LSYNC_EVENT BIT(4) | ||
228 | #define WL1273_LEV_EVENT BIT(5) | ||
229 | #define WL1273_IFFR_EVENT BIT(6) | ||
230 | #define WL1273_PI_EVENT BIT(7) | ||
231 | #define WL1273_PD_EVENT BIT(8) | ||
232 | #define WL1273_STIC_EVENT BIT(9) | ||
233 | #define WL1273_MAL_EVENT BIT(10) | ||
234 | #define WL1273_POW_ENB_EVENT BIT(11) | ||
235 | #define WL1273_SCAN_OVER_EVENT BIT(12) | ||
236 | #define WL1273_ERROR_EVENT BIT(13) | ||
237 | |||
238 | #define TUNER_MODE_STOP_SEARCH 0 | ||
239 | #define TUNER_MODE_PRESET 1 | ||
240 | #define TUNER_MODE_AUTO_SEEK 2 | ||
241 | #define TUNER_MODE_AF 3 | ||
242 | #define TUNER_MODE_AUTO_SEEK_PI 4 | ||
243 | #define TUNER_MODE_AUTO_SEEK_BULK 5 | ||
244 | |||
245 | #define RDS_BLOCK_SIZE 3 | ||
246 | |||
247 | struct wl1273_fm_platform_data { | ||
248 | int (*request_resources) (struct i2c_client *client); | ||
249 | void (*free_resources) (void); | ||
250 | void (*enable) (void); | ||
251 | void (*disable) (void); | ||
252 | |||
253 | u8 forbidden_modes; | ||
254 | unsigned int children; | ||
255 | }; | ||
256 | |||
257 | #define WL1273_FM_CORE_CELLS 2 | ||
258 | |||
259 | #define WL1273_BAND_OTHER 0 | ||
260 | #define WL1273_BAND_JAPAN 1 | ||
261 | |||
262 | #define WL1273_BAND_JAPAN_LOW 76000 | ||
263 | #define WL1273_BAND_JAPAN_HIGH 90000 | ||
264 | #define WL1273_BAND_OTHER_LOW 87500 | ||
265 | #define WL1273_BAND_OTHER_HIGH 108000 | ||
266 | |||
267 | #define WL1273_BAND_TX_LOW 76000 | ||
268 | #define WL1273_BAND_TX_HIGH 108000 | ||
269 | |||
270 | struct wl1273_core { | ||
271 | struct mfd_cell cells[WL1273_FM_CORE_CELLS]; | ||
272 | struct wl1273_fm_platform_data *pdata; | ||
273 | |||
274 | unsigned int mode; | ||
275 | unsigned int i2s_mode; | ||
276 | unsigned int volume; | ||
277 | unsigned int audio_mode; | ||
278 | unsigned int channel_number; | ||
279 | struct mutex lock; /* for serializing fm radio operations */ | ||
280 | |||
281 | struct i2c_client *client; | ||
282 | |||
283 | int (*write)(struct wl1273_core *core, u8, u16); | ||
284 | int (*set_audio)(struct wl1273_core *core, unsigned int); | ||
285 | int (*set_volume)(struct wl1273_core *core, unsigned int); | ||
286 | }; | ||
287 | |||
288 | #endif /* ifndef WL1273_CORE_H */ | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index a1239c48b41a..903280d21866 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -245,6 +245,7 @@ enum wm831x_parent { | |||
245 | WM8320 = 0x8320, | 245 | WM8320 = 0x8320, |
246 | WM8321 = 0x8321, | 246 | WM8321 = 0x8321, |
247 | WM8325 = 0x8325, | 247 | WM8325 = 0x8325, |
248 | WM8326 = 0x8326, | ||
248 | }; | 249 | }; |
249 | 250 | ||
250 | struct wm831x { | 251 | struct wm831x { |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index de79baee4925..3fd36845ca45 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -17,6 +17,11 @@ | |||
17 | 17 | ||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | 19 | ||
20 | enum wm8994_type { | ||
21 | WM8994 = 0, | ||
22 | WM8958 = 1, | ||
23 | }; | ||
24 | |||
20 | struct regulator_dev; | 25 | struct regulator_dev; |
21 | struct regulator_bulk_data; | 26 | struct regulator_bulk_data; |
22 | 27 | ||
@@ -48,6 +53,8 @@ struct wm8994 { | |||
48 | struct mutex io_lock; | 53 | struct mutex io_lock; |
49 | struct mutex irq_lock; | 54 | struct mutex irq_lock; |
50 | 55 | ||
56 | enum wm8994_type type; | ||
57 | |||
51 | struct device *dev; | 58 | struct device *dev; |
52 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | 59 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, |
53 | int bytes, void *dest); | 60 | int bytes, void *dest); |
@@ -68,6 +75,7 @@ struct wm8994 { | |||
68 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; | 75 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; |
69 | 76 | ||
70 | struct regulator_dev *dbvdd; | 77 | struct regulator_dev *dbvdd; |
78 | int num_supplies; | ||
71 | struct regulator_bulk_data *supplies; | 79 | struct regulator_bulk_data *supplies; |
72 | }; | 80 | }; |
73 | 81 | ||
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index add8a1b8bcf0..9eab263658be 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -30,6 +30,8 @@ struct wm8994_ldo_pdata { | |||
30 | 30 | ||
31 | #define WM8994_DRC_REGS 5 | 31 | #define WM8994_DRC_REGS 5 |
32 | #define WM8994_EQ_REGS 20 | 32 | #define WM8994_EQ_REGS 20 |
33 | #define WM8958_MBC_CUTOFF_REGS 20 | ||
34 | #define WM8958_MBC_COEFF_REGS 48 | ||
33 | 35 | ||
34 | /** | 36 | /** |
35 | * DRC configurations are specified with a label and a set of register | 37 | * DRC configurations are specified with a label and a set of register |
@@ -59,6 +61,18 @@ struct wm8994_retune_mobile_cfg { | |||
59 | u16 regs[WM8994_EQ_REGS]; | 61 | u16 regs[WM8994_EQ_REGS]; |
60 | }; | 62 | }; |
61 | 63 | ||
64 | /** | ||
65 | * Multiband compressor configurations are specified with a label and | ||
66 | * two sets of values to write. Configurations are expected to be | ||
67 | * generated using the multiband compressor configuration panel in | ||
68 | * WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
69 | */ | ||
70 | struct wm8958_mbc_cfg { | ||
71 | const char *name; | ||
72 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; | ||
73 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; | ||
74 | }; | ||
75 | |||
62 | struct wm8994_pdata { | 76 | struct wm8994_pdata { |
63 | int gpio_base; | 77 | int gpio_base; |
64 | 78 | ||
@@ -78,6 +92,9 @@ struct wm8994_pdata { | |||
78 | int num_retune_mobile_cfgs; | 92 | int num_retune_mobile_cfgs; |
79 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; | 93 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; |
80 | 94 | ||
95 | int num_mbc_cfgs; | ||
96 | struct wm8958_mbc_cfg *mbc_cfgs; | ||
97 | |||
81 | /* LINEOUT can be differential or single ended */ | 98 | /* LINEOUT can be differential or single ended */ |
82 | unsigned int lineout1_diff:1; | 99 | unsigned int lineout1_diff:1; |
83 | unsigned int lineout2_diff:1; | 100 | unsigned int lineout2_diff:1; |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index 967f62f54159..be072faec6f0 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -64,12 +64,16 @@ | |||
64 | #define WM8994_LDO_1 0x3B | 64 | #define WM8994_LDO_1 0x3B |
65 | #define WM8994_LDO_2 0x3C | 65 | #define WM8994_LDO_2 0x3C |
66 | #define WM8994_CHARGE_PUMP_1 0x4C | 66 | #define WM8994_CHARGE_PUMP_1 0x4C |
67 | #define WM8958_CHARGE_PUMP_2 0x4D | ||
67 | #define WM8994_CLASS_W_1 0x51 | 68 | #define WM8994_CLASS_W_1 0x51 |
68 | #define WM8994_DC_SERVO_1 0x54 | 69 | #define WM8994_DC_SERVO_1 0x54 |
69 | #define WM8994_DC_SERVO_2 0x55 | 70 | #define WM8994_DC_SERVO_2 0x55 |
70 | #define WM8994_DC_SERVO_4 0x57 | 71 | #define WM8994_DC_SERVO_4 0x57 |
71 | #define WM8994_DC_SERVO_READBACK 0x58 | 72 | #define WM8994_DC_SERVO_READBACK 0x58 |
72 | #define WM8994_ANALOGUE_HP_1 0x60 | 73 | #define WM8994_ANALOGUE_HP_1 0x60 |
74 | #define WM8958_MIC_DETECT_1 0xD0 | ||
75 | #define WM8958_MIC_DETECT_2 0xD1 | ||
76 | #define WM8958_MIC_DETECT_3 0xD2 | ||
73 | #define WM8994_CHIP_REVISION 0x100 | 77 | #define WM8994_CHIP_REVISION 0x100 |
74 | #define WM8994_CONTROL_INTERFACE 0x101 | 78 | #define WM8994_CONTROL_INTERFACE 0x101 |
75 | #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 | 79 | #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 |
@@ -109,6 +113,10 @@ | |||
109 | #define WM8994_AIF2DAC_LRCLK 0x315 | 113 | #define WM8994_AIF2DAC_LRCLK 0x315 |
110 | #define WM8994_AIF2DAC_DATA 0x316 | 114 | #define WM8994_AIF2DAC_DATA 0x316 |
111 | #define WM8994_AIF2ADC_DATA 0x317 | 115 | #define WM8994_AIF2ADC_DATA 0x317 |
116 | #define WM8958_AIF3_CONTROL_1 0x320 | ||
117 | #define WM8958_AIF3_CONTROL_2 0x321 | ||
118 | #define WM8958_AIF3DAC_DATA 0x322 | ||
119 | #define WM8958_AIF3ADC_DATA 0x323 | ||
112 | #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 | 120 | #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 |
113 | #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 | 121 | #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 |
114 | #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 | 122 | #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 |
@@ -242,6 +250,83 @@ | |||
242 | #define WM8994_INTERRUPT_STATUS_2_MASK 0x739 | 250 | #define WM8994_INTERRUPT_STATUS_2_MASK 0x739 |
243 | #define WM8994_INTERRUPT_CONTROL 0x740 | 251 | #define WM8994_INTERRUPT_CONTROL 0x740 |
244 | #define WM8994_IRQ_DEBOUNCE 0x748 | 252 | #define WM8994_IRQ_DEBOUNCE 0x748 |
253 | #define WM8958_DSP2_PROGRAM 0x900 | ||
254 | #define WM8958_DSP2_CONFIG 0x901 | ||
255 | #define WM8958_DSP2_MAGICNUM 0xA00 | ||
256 | #define WM8958_DSP2_RELEASEYEAR 0xA01 | ||
257 | #define WM8958_DSP2_RELEASEMONTHDAY 0xA02 | ||
258 | #define WM8958_DSP2_RELEASETIME 0xA03 | ||
259 | #define WM8958_DSP2_VERMAJMIN 0xA04 | ||
260 | #define WM8958_DSP2_VERBUILD 0xA05 | ||
261 | #define WM8958_DSP2_EXECCONTROL 0xA0D | ||
262 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200 | ||
263 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201 | ||
264 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202 | ||
265 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_2 0x2203 | ||
266 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_1 0x2204 | ||
267 | #define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_2 0x2205 | ||
268 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_1 0x2206 | ||
269 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_2 0x2207 | ||
270 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_1 0x2208 | ||
271 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_2 0x2209 | ||
272 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_1 0x220A | ||
273 | #define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_2 0x220B | ||
274 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_1 0x220C | ||
275 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_2 0x220D | ||
276 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_1 0x220E | ||
277 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_2 0x220F | ||
278 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_1 0x2210 | ||
279 | #define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_2 0x2211 | ||
280 | #define WM8958_MBC_BAND_1_LOWER_CUTOFF_1 0x2212 | ||
281 | #define WM8958_MBC_BAND_1_LOWER_CUTOFF_2 0x2213 | ||
282 | #define WM8958_MBC_BAND_1_K_1 0x2400 | ||
283 | #define WM8958_MBC_BAND_1_K_2 0x2401 | ||
284 | #define WM8958_MBC_BAND_1_N1_1 0x2402 | ||
285 | #define WM8958_MBC_BAND_1_N1_2 0x2403 | ||
286 | #define WM8958_MBC_BAND_1_N2_1 0x2404 | ||
287 | #define WM8958_MBC_BAND_1_N2_2 0x2405 | ||
288 | #define WM8958_MBC_BAND_1_N3_1 0x2406 | ||
289 | #define WM8958_MBC_BAND_1_N3_2 0x2407 | ||
290 | #define WM8958_MBC_BAND_1_N4_1 0x2408 | ||
291 | #define WM8958_MBC_BAND_1_N4_2 0x2409 | ||
292 | #define WM8958_MBC_BAND_1_N5_1 0x240A | ||
293 | #define WM8958_MBC_BAND_1_N5_2 0x240B | ||
294 | #define WM8958_MBC_BAND_1_X1_1 0x240C | ||
295 | #define WM8958_MBC_BAND_1_X1_2 0x240D | ||
296 | #define WM8958_MBC_BAND_1_X2_1 0x240E | ||
297 | #define WM8958_MBC_BAND_1_X2_2 0x240F | ||
298 | #define WM8958_MBC_BAND_1_X3_1 0x2410 | ||
299 | #define WM8958_MBC_BAND_1_X3_2 0x2411 | ||
300 | #define WM8958_MBC_BAND_1_ATTACK_1 0x2412 | ||
301 | #define WM8958_MBC_BAND_1_ATTACK_2 0x2413 | ||
302 | #define WM8958_MBC_BAND_1_DECAY_1 0x2414 | ||
303 | #define WM8958_MBC_BAND_1_DECAY_2 0x2415 | ||
304 | #define WM8958_MBC_BAND_2_K_1 0x2416 | ||
305 | #define WM8958_MBC_BAND_2_K_2 0x2417 | ||
306 | #define WM8958_MBC_BAND_2_N1_1 0x2418 | ||
307 | #define WM8958_MBC_BAND_2_N1_2 0x2419 | ||
308 | #define WM8958_MBC_BAND_2_N2_1 0x241A | ||
309 | #define WM8958_MBC_BAND_2_N2_2 0x241B | ||
310 | #define WM8958_MBC_BAND_2_N3_1 0x241C | ||
311 | #define WM8958_MBC_BAND_2_N3_2 0x241D | ||
312 | #define WM8958_MBC_BAND_2_N4_1 0x241E | ||
313 | #define WM8958_MBC_BAND_2_N4_2 0x241F | ||
314 | #define WM8958_MBC_BAND_2_N5_1 0x2420 | ||
315 | #define WM8958_MBC_BAND_2_N5_2 0x2421 | ||
316 | #define WM8958_MBC_BAND_2_X1_1 0x2422 | ||
317 | #define WM8958_MBC_BAND_2_X1_2 0x2423 | ||
318 | #define WM8958_MBC_BAND_2_X2_1 0x2424 | ||
319 | #define WM8958_MBC_BAND_2_X2_2 0x2425 | ||
320 | #define WM8958_MBC_BAND_2_X3_1 0x2426 | ||
321 | #define WM8958_MBC_BAND_2_X3_2 0x2427 | ||
322 | #define WM8958_MBC_BAND_2_ATTACK_1 0x2428 | ||
323 | #define WM8958_MBC_BAND_2_ATTACK_2 0x2429 | ||
324 | #define WM8958_MBC_BAND_2_DECAY_1 0x242A | ||
325 | #define WM8958_MBC_BAND_2_DECAY_2 0x242B | ||
326 | #define WM8958_MBC_B2_PG2_1 0x242C | ||
327 | #define WM8958_MBC_B2_PG2_2 0x242D | ||
328 | #define WM8958_MBC_B1_PG2_1 0x242E | ||
329 | #define WM8958_MBC_B1_PG2_2 0x242F | ||
245 | #define WM8994_WRITE_SEQUENCER_0 0x3000 | 330 | #define WM8994_WRITE_SEQUENCER_0 0x3000 |
246 | #define WM8994_WRITE_SEQUENCER_1 0x3001 | 331 | #define WM8994_WRITE_SEQUENCER_1 0x3001 |
247 | #define WM8994_WRITE_SEQUENCER_2 0x3002 | 332 | #define WM8994_WRITE_SEQUENCER_2 0x3002 |
@@ -992,6 +1077,12 @@ | |||
992 | /* | 1077 | /* |
993 | * R6 (0x06) - Power Management (6) | 1078 | * R6 (0x06) - Power Management (6) |
994 | */ | 1079 | */ |
1080 | #define WM8958_AIF3ADC_SRC_MASK 0x0600 /* AIF3ADC_SRC - [10:9] */ | ||
1081 | #define WM8958_AIF3ADC_SRC_SHIFT 9 /* AIF3ADC_SRC - [10:9] */ | ||
1082 | #define WM8958_AIF3ADC_SRC_WIDTH 2 /* AIF3ADC_SRC - [10:9] */ | ||
1083 | #define WM8958_AIF2DAC_SRC_MASK 0x0180 /* AIF2DAC_SRC - [8:7] */ | ||
1084 | #define WM8958_AIF2DAC_SRC_SHIFT 7 /* AIF2DAC_SRC - [8:7] */ | ||
1085 | #define WM8958_AIF2DAC_SRC_WIDTH 2 /* AIF2DAC_SRC - [8:7] */ | ||
995 | #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ | 1086 | #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ |
996 | #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ | 1087 | #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ |
997 | #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ | 1088 | #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ |
@@ -1836,6 +1927,14 @@ | |||
1836 | #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ | 1927 | #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ |
1837 | 1928 | ||
1838 | /* | 1929 | /* |
1930 | * R77 (0x4D) - Charge Pump (2) | ||
1931 | */ | ||
1932 | #define WM8958_CP_DISCH 0x8000 /* CP_DISCH */ | ||
1933 | #define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */ | ||
1934 | #define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */ | ||
1935 | #define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */ | ||
1936 | |||
1937 | /* | ||
1839 | * R81 (0x51) - Class W (1) | 1938 | * R81 (0x51) - Class W (1) |
1840 | */ | 1939 | */ |
1841 | #define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ | 1940 | #define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ |
@@ -1952,6 +2051,46 @@ | |||
1952 | #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ | 2051 | #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ |
1953 | 2052 | ||
1954 | /* | 2053 | /* |
2054 | * R208 (0xD0) - Mic Detect 1 | ||
2055 | */ | ||
2056 | #define WM8958_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2057 | #define WM8958_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2058 | #define WM8958_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */ | ||
2059 | #define WM8958_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */ | ||
2060 | #define WM8958_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */ | ||
2061 | #define WM8958_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */ | ||
2062 | #define WM8958_MICD_DBTIME 0x0002 /* MICD_DBTIME */ | ||
2063 | #define WM8958_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */ | ||
2064 | #define WM8958_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */ | ||
2065 | #define WM8958_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */ | ||
2066 | #define WM8958_MICD_ENA 0x0001 /* MICD_ENA */ | ||
2067 | #define WM8958_MICD_ENA_MASK 0x0001 /* MICD_ENA */ | ||
2068 | #define WM8958_MICD_ENA_SHIFT 0 /* MICD_ENA */ | ||
2069 | #define WM8958_MICD_ENA_WIDTH 1 /* MICD_ENA */ | ||
2070 | |||
2071 | /* | ||
2072 | * R209 (0xD1) - Mic Detect 2 | ||
2073 | */ | ||
2074 | #define WM8958_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */ | ||
2075 | #define WM8958_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */ | ||
2076 | #define WM8958_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */ | ||
2077 | |||
2078 | /* | ||
2079 | * R210 (0xD2) - Mic Detect 3 | ||
2080 | */ | ||
2081 | #define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | ||
2082 | #define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | ||
2083 | #define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | ||
2084 | #define WM8958_MICD_VALID 0x0002 /* MICD_VALID */ | ||
2085 | #define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */ | ||
2086 | #define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */ | ||
2087 | #define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */ | ||
2088 | #define WM8958_MICD_STS 0x0001 /* MICD_STS */ | ||
2089 | #define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */ | ||
2090 | #define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */ | ||
2091 | #define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */ | ||
2092 | |||
2093 | /* | ||
1955 | * R256 (0x100) - Chip Revision | 2094 | * R256 (0x100) - Chip Revision |
1956 | */ | 2095 | */ |
1957 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ | 2096 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ |
@@ -2069,6 +2208,14 @@ | |||
2069 | /* | 2208 | /* |
2070 | * R520 (0x208) - Clocking (1) | 2209 | * R520 (0x208) - Clocking (1) |
2071 | */ | 2210 | */ |
2211 | #define WM8958_DSP2CLK_ENA 0x4000 /* DSP2CLK_ENA */ | ||
2212 | #define WM8958_DSP2CLK_ENA_MASK 0x4000 /* DSP2CLK_ENA */ | ||
2213 | #define WM8958_DSP2CLK_ENA_SHIFT 14 /* DSP2CLK_ENA */ | ||
2214 | #define WM8958_DSP2CLK_ENA_WIDTH 1 /* DSP2CLK_ENA */ | ||
2215 | #define WM8958_DSP2CLK_SRC 0x1000 /* DSP2CLK_SRC */ | ||
2216 | #define WM8958_DSP2CLK_SRC_MASK 0x1000 /* DSP2CLK_SRC */ | ||
2217 | #define WM8958_DSP2CLK_SRC_SHIFT 12 /* DSP2CLK_SRC */ | ||
2218 | #define WM8958_DSP2CLK_SRC_WIDTH 1 /* DSP2CLK_SRC */ | ||
2072 | #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ | 2219 | #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ |
2073 | #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ | 2220 | #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ |
2074 | #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ | 2221 | #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ |
@@ -2553,6 +2700,63 @@ | |||
2553 | #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ | 2700 | #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ |
2554 | 2701 | ||
2555 | /* | 2702 | /* |
2703 | * R800 (0x320) - AIF3 Control (1) | ||
2704 | */ | ||
2705 | #define WM8958_AIF3_LRCLK_INV 0x0080 /* AIF3_LRCLK_INV */ | ||
2706 | #define WM8958_AIF3_LRCLK_INV_MASK 0x0080 /* AIF3_LRCLK_INV */ | ||
2707 | #define WM8958_AIF3_LRCLK_INV_SHIFT 7 /* AIF3_LRCLK_INV */ | ||
2708 | #define WM8958_AIF3_LRCLK_INV_WIDTH 1 /* AIF3_LRCLK_INV */ | ||
2709 | #define WM8958_AIF3_WL_MASK 0x0060 /* AIF3_WL - [6:5] */ | ||
2710 | #define WM8958_AIF3_WL_SHIFT 5 /* AIF3_WL - [6:5] */ | ||
2711 | #define WM8958_AIF3_WL_WIDTH 2 /* AIF3_WL - [6:5] */ | ||
2712 | #define WM8958_AIF3_FMT_MASK 0x0018 /* AIF3_FMT - [4:3] */ | ||
2713 | #define WM8958_AIF3_FMT_SHIFT 3 /* AIF3_FMT - [4:3] */ | ||
2714 | #define WM8958_AIF3_FMT_WIDTH 2 /* AIF3_FMT - [4:3] */ | ||
2715 | |||
2716 | /* | ||
2717 | * R801 (0x321) - AIF3 Control (2) | ||
2718 | */ | ||
2719 | #define WM8958_AIF3DAC_BOOST_MASK 0x0C00 /* AIF3DAC_BOOST - [11:10] */ | ||
2720 | #define WM8958_AIF3DAC_BOOST_SHIFT 10 /* AIF3DAC_BOOST - [11:10] */ | ||
2721 | #define WM8958_AIF3DAC_BOOST_WIDTH 2 /* AIF3DAC_BOOST - [11:10] */ | ||
2722 | #define WM8958_AIF3DAC_COMP 0x0010 /* AIF3DAC_COMP */ | ||
2723 | #define WM8958_AIF3DAC_COMP_MASK 0x0010 /* AIF3DAC_COMP */ | ||
2724 | #define WM8958_AIF3DAC_COMP_SHIFT 4 /* AIF3DAC_COMP */ | ||
2725 | #define WM8958_AIF3DAC_COMP_WIDTH 1 /* AIF3DAC_COMP */ | ||
2726 | #define WM8958_AIF3DAC_COMPMODE 0x0008 /* AIF3DAC_COMPMODE */ | ||
2727 | #define WM8958_AIF3DAC_COMPMODE_MASK 0x0008 /* AIF3DAC_COMPMODE */ | ||
2728 | #define WM8958_AIF3DAC_COMPMODE_SHIFT 3 /* AIF3DAC_COMPMODE */ | ||
2729 | #define WM8958_AIF3DAC_COMPMODE_WIDTH 1 /* AIF3DAC_COMPMODE */ | ||
2730 | #define WM8958_AIF3ADC_COMP 0x0004 /* AIF3ADC_COMP */ | ||
2731 | #define WM8958_AIF3ADC_COMP_MASK 0x0004 /* AIF3ADC_COMP */ | ||
2732 | #define WM8958_AIF3ADC_COMP_SHIFT 2 /* AIF3ADC_COMP */ | ||
2733 | #define WM8958_AIF3ADC_COMP_WIDTH 1 /* AIF3ADC_COMP */ | ||
2734 | #define WM8958_AIF3ADC_COMPMODE 0x0002 /* AIF3ADC_COMPMODE */ | ||
2735 | #define WM8958_AIF3ADC_COMPMODE_MASK 0x0002 /* AIF3ADC_COMPMODE */ | ||
2736 | #define WM8958_AIF3ADC_COMPMODE_SHIFT 1 /* AIF3ADC_COMPMODE */ | ||
2737 | #define WM8958_AIF3ADC_COMPMODE_WIDTH 1 /* AIF3ADC_COMPMODE */ | ||
2738 | #define WM8958_AIF3_LOOPBACK 0x0001 /* AIF3_LOOPBACK */ | ||
2739 | #define WM8958_AIF3_LOOPBACK_MASK 0x0001 /* AIF3_LOOPBACK */ | ||
2740 | #define WM8958_AIF3_LOOPBACK_SHIFT 0 /* AIF3_LOOPBACK */ | ||
2741 | #define WM8958_AIF3_LOOPBACK_WIDTH 1 /* AIF3_LOOPBACK */ | ||
2742 | |||
2743 | /* | ||
2744 | * R802 (0x322) - AIF3DAC Data | ||
2745 | */ | ||
2746 | #define WM8958_AIF3DAC_DAT_INV 0x0001 /* AIF3DAC_DAT_INV */ | ||
2747 | #define WM8958_AIF3DAC_DAT_INV_MASK 0x0001 /* AIF3DAC_DAT_INV */ | ||
2748 | #define WM8958_AIF3DAC_DAT_INV_SHIFT 0 /* AIF3DAC_DAT_INV */ | ||
2749 | #define WM8958_AIF3DAC_DAT_INV_WIDTH 1 /* AIF3DAC_DAT_INV */ | ||
2750 | |||
2751 | /* | ||
2752 | * R803 (0x323) - AIF3ADC Data | ||
2753 | */ | ||
2754 | #define WM8958_AIF3ADC_DAT_INV 0x0001 /* AIF3ADC_DAT_INV */ | ||
2755 | #define WM8958_AIF3ADC_DAT_INV_MASK 0x0001 /* AIF3ADC_DAT_INV */ | ||
2756 | #define WM8958_AIF3ADC_DAT_INV_SHIFT 0 /* AIF3ADC_DAT_INV */ | ||
2757 | #define WM8958_AIF3ADC_DAT_INV_WIDTH 1 /* AIF3ADC_DAT_INV */ | ||
2758 | |||
2759 | /* | ||
2556 | * R1024 (0x400) - AIF1 ADC1 Left Volume | 2760 | * R1024 (0x400) - AIF1 ADC1 Left Volume |
2557 | */ | 2761 | */ |
2558 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ | 2762 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ |
@@ -4289,4 +4493,102 @@ | |||
4289 | #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ | 4493 | #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ |
4290 | #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ | 4494 | #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ |
4291 | 4495 | ||
4496 | /* | ||
4497 | * R2304 (0x900) - DSP2_Program | ||
4498 | */ | ||
4499 | #define WM8958_DSP2_ENA 0x0001 /* DSP2_ENA */ | ||
4500 | #define WM8958_DSP2_ENA_MASK 0x0001 /* DSP2_ENA */ | ||
4501 | #define WM8958_DSP2_ENA_SHIFT 0 /* DSP2_ENA */ | ||
4502 | #define WM8958_DSP2_ENA_WIDTH 1 /* DSP2_ENA */ | ||
4503 | |||
4504 | /* | ||
4505 | * R2305 (0x901) - DSP2_Config | ||
4506 | */ | ||
4507 | #define WM8958_MBC_SEL_MASK 0x0030 /* MBC_SEL - [5:4] */ | ||
4508 | #define WM8958_MBC_SEL_SHIFT 4 /* MBC_SEL - [5:4] */ | ||
4509 | #define WM8958_MBC_SEL_WIDTH 2 /* MBC_SEL - [5:4] */ | ||
4510 | #define WM8958_MBC_ENA 0x0001 /* MBC_ENA */ | ||
4511 | #define WM8958_MBC_ENA_MASK 0x0001 /* MBC_ENA */ | ||
4512 | #define WM8958_MBC_ENA_SHIFT 0 /* MBC_ENA */ | ||
4513 | #define WM8958_MBC_ENA_WIDTH 1 /* MBC_ENA */ | ||
4514 | |||
4515 | /* | ||
4516 | * R2560 (0xA00) - DSP2_MagicNum | ||
4517 | */ | ||
4518 | #define WM8958_DSP2_MAGIC_NUM_MASK 0xFFFF /* DSP2_MAGIC_NUM - [15:0] */ | ||
4519 | #define WM8958_DSP2_MAGIC_NUM_SHIFT 0 /* DSP2_MAGIC_NUM - [15:0] */ | ||
4520 | #define WM8958_DSP2_MAGIC_NUM_WIDTH 16 /* DSP2_MAGIC_NUM - [15:0] */ | ||
4521 | |||
4522 | /* | ||
4523 | * R2561 (0xA01) - DSP2_ReleaseYear | ||
4524 | */ | ||
4525 | #define WM8958_DSP2_RELEASE_YEAR_MASK 0xFFFF /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4526 | #define WM8958_DSP2_RELEASE_YEAR_SHIFT 0 /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4527 | #define WM8958_DSP2_RELEASE_YEAR_WIDTH 16 /* DSP2_RELEASE_YEAR - [15:0] */ | ||
4528 | |||
4529 | /* | ||
4530 | * R2562 (0xA02) - DSP2_ReleaseMonthDay | ||
4531 | */ | ||
4532 | #define WM8958_DSP2_RELEASE_MONTH_MASK 0xFF00 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4533 | #define WM8958_DSP2_RELEASE_MONTH_SHIFT 8 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4534 | #define WM8958_DSP2_RELEASE_MONTH_WIDTH 8 /* DSP2_RELEASE_MONTH - [15:8] */ | ||
4535 | #define WM8958_DSP2_RELEASE_DAY_MASK 0x00FF /* DSP2_RELEASE_DAY - [7:0] */ | ||
4536 | #define WM8958_DSP2_RELEASE_DAY_SHIFT 0 /* DSP2_RELEASE_DAY - [7:0] */ | ||
4537 | #define WM8958_DSP2_RELEASE_DAY_WIDTH 8 /* DSP2_RELEASE_DAY - [7:0] */ | ||
4538 | |||
4539 | /* | ||
4540 | * R2563 (0xA03) - DSP2_ReleaseTime | ||
4541 | */ | ||
4542 | #define WM8958_DSP2_RELEASE_HOURS_MASK 0xFF00 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4543 | #define WM8958_DSP2_RELEASE_HOURS_SHIFT 8 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4544 | #define WM8958_DSP2_RELEASE_HOURS_WIDTH 8 /* DSP2_RELEASE_HOURS - [15:8] */ | ||
4545 | #define WM8958_DSP2_RELEASE_MINS_MASK 0x00FF /* DSP2_RELEASE_MINS - [7:0] */ | ||
4546 | #define WM8958_DSP2_RELEASE_MINS_SHIFT 0 /* DSP2_RELEASE_MINS - [7:0] */ | ||
4547 | #define WM8958_DSP2_RELEASE_MINS_WIDTH 8 /* DSP2_RELEASE_MINS - [7:0] */ | ||
4548 | |||
4549 | /* | ||
4550 | * R2564 (0xA04) - DSP2_VerMajMin | ||
4551 | */ | ||
4552 | #define WM8958_DSP2_MAJOR_VER_MASK 0xFF00 /* DSP2_MAJOR_VER - [15:8] */ | ||
4553 | #define WM8958_DSP2_MAJOR_VER_SHIFT 8 /* DSP2_MAJOR_VER - [15:8] */ | ||
4554 | #define WM8958_DSP2_MAJOR_VER_WIDTH 8 /* DSP2_MAJOR_VER - [15:8] */ | ||
4555 | #define WM8958_DSP2_MINOR_VER_MASK 0x00FF /* DSP2_MINOR_VER - [7:0] */ | ||
4556 | #define WM8958_DSP2_MINOR_VER_SHIFT 0 /* DSP2_MINOR_VER - [7:0] */ | ||
4557 | #define WM8958_DSP2_MINOR_VER_WIDTH 8 /* DSP2_MINOR_VER - [7:0] */ | ||
4558 | |||
4559 | /* | ||
4560 | * R2565 (0xA05) - DSP2_VerBuild | ||
4561 | */ | ||
4562 | #define WM8958_DSP2_BUILD_VER_MASK 0xFFFF /* DSP2_BUILD_VER - [15:0] */ | ||
4563 | #define WM8958_DSP2_BUILD_VER_SHIFT 0 /* DSP2_BUILD_VER - [15:0] */ | ||
4564 | #define WM8958_DSP2_BUILD_VER_WIDTH 16 /* DSP2_BUILD_VER - [15:0] */ | ||
4565 | |||
4566 | /* | ||
4567 | * R2573 (0xA0D) - DSP2_ExecControl | ||
4568 | */ | ||
4569 | #define WM8958_DSP2_STOPC 0x0020 /* DSP2_STOPC */ | ||
4570 | #define WM8958_DSP2_STOPC_MASK 0x0020 /* DSP2_STOPC */ | ||
4571 | #define WM8958_DSP2_STOPC_SHIFT 5 /* DSP2_STOPC */ | ||
4572 | #define WM8958_DSP2_STOPC_WIDTH 1 /* DSP2_STOPC */ | ||
4573 | #define WM8958_DSP2_STOPS 0x0010 /* DSP2_STOPS */ | ||
4574 | #define WM8958_DSP2_STOPS_MASK 0x0010 /* DSP2_STOPS */ | ||
4575 | #define WM8958_DSP2_STOPS_SHIFT 4 /* DSP2_STOPS */ | ||
4576 | #define WM8958_DSP2_STOPS_WIDTH 1 /* DSP2_STOPS */ | ||
4577 | #define WM8958_DSP2_STOPI 0x0008 /* DSP2_STOPI */ | ||
4578 | #define WM8958_DSP2_STOPI_MASK 0x0008 /* DSP2_STOPI */ | ||
4579 | #define WM8958_DSP2_STOPI_SHIFT 3 /* DSP2_STOPI */ | ||
4580 | #define WM8958_DSP2_STOPI_WIDTH 1 /* DSP2_STOPI */ | ||
4581 | #define WM8958_DSP2_STOP 0x0004 /* DSP2_STOP */ | ||
4582 | #define WM8958_DSP2_STOP_MASK 0x0004 /* DSP2_STOP */ | ||
4583 | #define WM8958_DSP2_STOP_SHIFT 2 /* DSP2_STOP */ | ||
4584 | #define WM8958_DSP2_STOP_WIDTH 1 /* DSP2_STOP */ | ||
4585 | #define WM8958_DSP2_RUNR 0x0002 /* DSP2_RUNR */ | ||
4586 | #define WM8958_DSP2_RUNR_MASK 0x0002 /* DSP2_RUNR */ | ||
4587 | #define WM8958_DSP2_RUNR_SHIFT 1 /* DSP2_RUNR */ | ||
4588 | #define WM8958_DSP2_RUNR_WIDTH 1 /* DSP2_RUNR */ | ||
4589 | #define WM8958_DSP2_RUN 0x0001 /* DSP2_RUN */ | ||
4590 | #define WM8958_DSP2_RUN_MASK 0x0001 /* DSP2_RUN */ | ||
4591 | #define WM8958_DSP2_RUN_SHIFT 0 /* DSP2_RUN */ | ||
4592 | #define WM8958_DSP2_RUN_WIDTH 1 /* DSP2_RUN */ | ||
4593 | |||
4292 | #endif | 4594 | #endif |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 085527fb8261..e39aeecfe9a2 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -13,9 +13,11 @@ extern void putback_lru_pages(struct list_head *l); | |||
13 | extern int migrate_page(struct address_space *, | 13 | extern int migrate_page(struct address_space *, |
14 | struct page *, struct page *); | 14 | struct page *, struct page *); |
15 | extern int migrate_pages(struct list_head *l, new_page_t x, | 15 | extern int migrate_pages(struct list_head *l, new_page_t x, |
16 | unsigned long private, int offlining); | 16 | unsigned long private, bool offlining, |
17 | bool sync); | ||
17 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, | 18 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, |
18 | unsigned long private, int offlining); | 19 | unsigned long private, bool offlining, |
20 | bool sync); | ||
19 | 21 | ||
20 | extern int fail_migrate_page(struct address_space *, | 22 | extern int fail_migrate_page(struct address_space *, |
21 | struct page *, struct page *); | 23 | struct page *, struct page *); |
@@ -33,9 +35,11 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
33 | 35 | ||
34 | static inline void putback_lru_pages(struct list_head *l) {} | 36 | static inline void putback_lru_pages(struct list_head *l) {} |
35 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 37 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
36 | unsigned long private, int offlining) { return -ENOSYS; } | 38 | unsigned long private, bool offlining, |
39 | bool sync) { return -ENOSYS; } | ||
37 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, | 40 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, |
38 | unsigned long private, int offlining) { return -ENOSYS; } | 41 | unsigned long private, bool offlining, |
42 | bool sync) { return -ENOSYS; } | ||
39 | 43 | ||
40 | static inline int migrate_prep(void) { return -ENOSYS; } | 44 | static inline int migrate_prep(void) { return -ENOSYS; } |
41 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 45 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index a7b15bc7648e..049214642036 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -144,6 +144,11 @@ enum { | |||
144 | MLX4_STAT_RATE_OFFSET = 5 | 144 | MLX4_STAT_RATE_OFFSET = 5 |
145 | }; | 145 | }; |
146 | 146 | ||
147 | enum mlx4_protocol { | ||
148 | MLX4_PROTOCOL_IB, | ||
149 | MLX4_PROTOCOL_EN, | ||
150 | }; | ||
151 | |||
147 | enum { | 152 | enum { |
148 | MLX4_MTT_FLAG_PRESENT = 1 | 153 | MLX4_MTT_FLAG_PRESENT = 1 |
149 | }; | 154 | }; |
@@ -500,8 +505,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); | |||
500 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); | 505 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); |
501 | 506 | ||
502 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | 507 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
503 | int block_mcast_loopback); | 508 | int block_mcast_loopback, enum mlx4_protocol protocol); |
504 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | 509 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
510 | enum mlx4_protocol protocol); | ||
505 | 511 | ||
506 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); | 512 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); |
507 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); | 513 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index f407cd4bfb34..e1eebf78caba 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define MLX4_DRIVER_H | 34 | #define MLX4_DRIVER_H |
35 | 35 | ||
36 | #include <linux/device.h> | 36 | #include <linux/device.h> |
37 | #include <linux/mlx4/device.h> | ||
37 | 38 | ||
38 | struct mlx4_dev; | 39 | struct mlx4_dev; |
39 | 40 | ||
@@ -44,11 +45,6 @@ enum mlx4_dev_event { | |||
44 | MLX4_DEV_EVENT_PORT_REINIT, | 45 | MLX4_DEV_EVENT_PORT_REINIT, |
45 | }; | 46 | }; |
46 | 47 | ||
47 | enum mlx4_protocol { | ||
48 | MLX4_PROTOCOL_IB, | ||
49 | MLX4_PROTOCOL_EN, | ||
50 | }; | ||
51 | |||
52 | struct mlx4_interface { | 48 | struct mlx4_interface { |
53 | void * (*add) (struct mlx4_dev *dev); | 49 | void * (*add) (struct mlx4_dev *dev); |
54 | void (*remove)(struct mlx4_dev *dev, void *context); | 50 | void (*remove)(struct mlx4_dev *dev, void *context); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 721f451c3029..f6385fc17ad4 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 8835b877b8db..8f7d24712dc1 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef LINUX_MM_INLINE_H | 1 | #ifndef LINUX_MM_INLINE_H |
2 | #define LINUX_MM_INLINE_H | 2 | #define LINUX_MM_INLINE_H |
3 | 3 | ||
4 | #include <linux/huge_mm.h> | ||
5 | |||
4 | /** | 6 | /** |
5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? | 7 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
6 | * @page: the page to test | 8 | * @page: the page to test |
@@ -20,18 +22,25 @@ static inline int page_is_file_cache(struct page *page) | |||
20 | } | 22 | } |
21 | 23 | ||
22 | static inline void | 24 | static inline void |
23 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 25 | __add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l, |
26 | struct list_head *head) | ||
24 | { | 27 | { |
25 | list_add(&page->lru, &zone->lru[l].list); | 28 | list_add(&page->lru, head); |
26 | __inc_zone_state(zone, NR_LRU_BASE + l); | 29 | __mod_zone_page_state(zone, NR_LRU_BASE + l, hpage_nr_pages(page)); |
27 | mem_cgroup_add_lru_list(page, l); | 30 | mem_cgroup_add_lru_list(page, l); |
28 | } | 31 | } |
29 | 32 | ||
30 | static inline void | 33 | static inline void |
34 | add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) | ||
35 | { | ||
36 | __add_page_to_lru_list(zone, page, l, &zone->lru[l].list); | ||
37 | } | ||
38 | |||
39 | static inline void | ||
31 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | 40 | del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) |
32 | { | 41 | { |
33 | list_del(&page->lru); | 42 | list_del(&page->lru); |
34 | __dec_zone_state(zone, NR_LRU_BASE + l); | 43 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
35 | mem_cgroup_del_lru_list(page, l); | 44 | mem_cgroup_del_lru_list(page, l); |
36 | } | 45 | } |
37 | 46 | ||
@@ -66,7 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
66 | l += LRU_ACTIVE; | 75 | l += LRU_ACTIVE; |
67 | } | 76 | } |
68 | } | 77 | } |
69 | __dec_zone_state(zone, NR_LRU_BASE + l); | 78 | __mod_zone_page_state(zone, NR_LRU_BASE + l, -hpage_nr_pages(page)); |
70 | mem_cgroup_del_lru_list(page, l); | 79 | mem_cgroup_del_lru_list(page, l); |
71 | } | 80 | } |
72 | 81 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bb7288a782fd..26bc4e2cd275 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -310,6 +310,9 @@ struct mm_struct { | |||
310 | #ifdef CONFIG_MMU_NOTIFIER | 310 | #ifdef CONFIG_MMU_NOTIFIER |
311 | struct mmu_notifier_mm *mmu_notifier_mm; | 311 | struct mmu_notifier_mm *mmu_notifier_mm; |
312 | #endif | 312 | #endif |
313 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
314 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | ||
315 | #endif | ||
313 | /* How many tasks sharing this mm are OOM_DISABLE */ | 316 | /* How many tasks sharing this mm are OOM_DISABLE */ |
314 | atomic_t oom_disable_count; | 317 | atomic_t oom_disable_count; |
315 | }; | 318 | }; |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h new file mode 100644 index 000000000000..16b0261763ed --- /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 30f6fad99a58..bcb793ec7374 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 956fbd877692..612301f85d14 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 1fdc673f2396..83bd9f76709a 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 5c99da1078aa..38d393092812 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -14,8 +14,9 @@ | |||
14 | #ifndef __SH_MMCIF_H__ | 14 | #ifndef __SH_MMCIF_H__ |
15 | #define __SH_MMCIF_H__ | 15 | #define __SH_MMCIF_H__ |
16 | 16 | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/sh_dma.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * MMCIF : CE_CLK_CTRL [19:16] | 22 | * MMCIF : CE_CLK_CTRL [19:16] |
@@ -31,13 +32,19 @@ | |||
31 | * 1111 : Peripheral clock (sup_pclk set '1') | 32 | * 1111 : Peripheral clock (sup_pclk set '1') |
32 | */ | 33 | */ |
33 | 34 | ||
35 | struct sh_mmcif_dma { | ||
36 | struct sh_dmae_slave chan_priv_tx; | ||
37 | struct sh_dmae_slave chan_priv_rx; | ||
38 | }; | ||
39 | |||
34 | struct sh_mmcif_plat_data { | 40 | struct sh_mmcif_plat_data { |
35 | void (*set_pwr)(struct platform_device *pdev, int state); | 41 | void (*set_pwr)(struct platform_device *pdev, int state); |
36 | void (*down_pwr)(struct platform_device *pdev); | 42 | void (*down_pwr)(struct platform_device *pdev); |
37 | int (*get_cd)(struct platform_device *pdef); | 43 | int (*get_cd)(struct platform_device *pdef); |
38 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 44 | struct sh_mmcif_dma *dma; |
39 | unsigned long caps; | 45 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
40 | u32 ocr; | 46 | unsigned long caps; |
47 | u32 ocr; | ||
41 | }; | 48 | }; |
42 | 49 | ||
43 | #define MMCIF_CE_CMD_SET 0x00000000 | 50 | #define MMCIF_CE_CMD_SET 0x00000000 |
@@ -59,18 +66,47 @@ struct sh_mmcif_plat_data { | |||
59 | #define MMCIF_CE_HOST_STS2 0x0000004C | 66 | #define MMCIF_CE_HOST_STS2 0x0000004C |
60 | #define MMCIF_CE_VERSION 0x0000007C | 67 | #define MMCIF_CE_VERSION 0x0000007C |
61 | 68 | ||
69 | /* CE_BUF_ACC */ | ||
70 | #define BUF_ACC_DMAWEN (1 << 25) | ||
71 | #define BUF_ACC_DMAREN (1 << 24) | ||
72 | #define BUF_ACC_BUSW_32 (0 << 17) | ||
73 | #define BUF_ACC_BUSW_16 (1 << 17) | ||
74 | #define BUF_ACC_ATYP (1 << 16) | ||
75 | |||
76 | /* CE_CLK_CTRL */ | ||
77 | #define CLK_ENABLE (1 << 24) /* 1: output mmc clock */ | ||
78 | #define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) | ||
79 | #define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) | ||
80 | #define CLKDIV_4 (1<<16) /* mmc clock frequency. | ||
81 | * n: bus clock/(2^(n+1)) */ | ||
82 | #define CLKDIV_256 (7<<16) /* mmc clock frequency. (see above) */ | ||
83 | #define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */ | ||
84 | #define SRBSYTO_29 ((1 << 11) | (1 << 10) | \ | ||
85 | (1 << 9) | (1 << 8)) /* resp busy timeout */ | ||
86 | #define SRWDTO_29 ((1 << 7) | (1 << 6) | \ | ||
87 | (1 << 5) | (1 << 4)) /* read/write timeout */ | ||
88 | #define SCCSTO_29 ((1 << 3) | (1 << 2) | \ | ||
89 | (1 << 1) | (1 << 0)) /* ccs timeout */ | ||
90 | |||
91 | /* CE_VERSION */ | ||
92 | #define SOFT_RST_ON (1 << 31) | ||
93 | #define SOFT_RST_OFF 0 | ||
94 | |||
62 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) | 95 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) |
63 | { | 96 | { |
64 | return readl(addr + reg); | 97 | return __raw_readl(addr + reg); |
65 | } | 98 | } |
66 | 99 | ||
67 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | 100 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) |
68 | { | 101 | { |
69 | writel(val, addr + reg); | 102 | __raw_writel(val, addr + reg); |
70 | } | 103 | } |
71 | 104 | ||
72 | #define SH_MMCIF_BBS 512 /* boot block size */ | 105 | #define SH_MMCIF_BBS 512 /* boot block size */ |
73 | 106 | ||
107 | enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT, | ||
108 | MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE }; | ||
109 | |||
74 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 110 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
75 | unsigned long cmd, unsigned long arg) | 111 | unsigned long cmd, unsigned long arg) |
76 | { | 112 | { |
@@ -133,6 +169,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
133 | unsigned long k; | 169 | unsigned long k; |
134 | int ret = 0; | 170 | int ret = 0; |
135 | 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 | |||
136 | /* CMD16 - Set the block size */ | 183 | /* CMD16 - Set the block size */ |
137 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); | 184 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); |
138 | 185 | ||
@@ -145,21 +192,20 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
145 | 192 | ||
146 | static inline void sh_mmcif_boot_init(void __iomem *base) | 193 | static inline void sh_mmcif_boot_init(void __iomem *base) |
147 | { | 194 | { |
148 | unsigned long tmp; | ||
149 | |||
150 | /* reset */ | 195 | /* reset */ |
151 | tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION); | 196 | sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_ON); |
152 | sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | 0x80000000); | 197 | sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_OFF); |
153 | sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & ~0x80000000); | ||
154 | 198 | ||
155 | /* byte swap */ | 199 | /* byte swap */ |
156 | sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, 0x00010000); | 200 | sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, BUF_ACC_ATYP); |
157 | 201 | ||
158 | /* Set block size in MMCIF hardware */ | 202 | /* Set block size in MMCIF hardware */ |
159 | sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); | 203 | sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); |
160 | 204 | ||
161 | /* Enable the clock, set it to Bus clock/256 (about 325Khz)*/ | 205 | /* Enable the clock, set it to Bus clock/256 (about 325Khz). */ |
162 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01072fff); | 206 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, |
207 | CLK_ENABLE | CLKDIV_256 | SRSPTO_256 | | ||
208 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
163 | 209 | ||
164 | /* CMD0 */ | 210 | /* CMD0 */ |
165 | sh_mmcif_boot_cmd(base, 0x00000040, 0); | 211 | sh_mmcif_boot_cmd(base, 0x00000040, 0); |
@@ -177,25 +223,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base) | |||
177 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 223 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
178 | } | 224 | } |
179 | 225 | ||
180 | static inline void sh_mmcif_boot_slurp(void __iomem *base, | ||
181 | unsigned char *buf, | ||
182 | unsigned long no_bytes) | ||
183 | { | ||
184 | unsigned long tmp; | ||
185 | |||
186 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | ||
187 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff); | ||
188 | |||
189 | /* CMD9 - Get CSD */ | ||
190 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | ||
191 | |||
192 | /* CMD7 - Select the card */ | ||
193 | sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); | ||
194 | |||
195 | tmp = no_bytes / SH_MMCIF_BBS; | ||
196 | tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0; | ||
197 | |||
198 | sh_mmcif_boot_do_read(base, 512, tmp, buf); | ||
199 | } | ||
200 | |||
201 | #endif /* __SH_MMCIF_H__ */ | 226 | #endif /* __SH_MMCIF_H__ */ |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 43dcfbdc39de..cc2e7dfea9d7 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -62,6 +62,16 @@ struct mmu_notifier_ops { | |||
62 | unsigned long address); | 62 | unsigned long address); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * test_young is called to check the young/accessed bitflag in | ||
66 | * the secondary pte. This is used to know if the page is | ||
67 | * frequently used without actually clearing the flag or tearing | ||
68 | * down the secondary mapping on the page. | ||
69 | */ | ||
70 | int (*test_young)(struct mmu_notifier *mn, | ||
71 | struct mm_struct *mm, | ||
72 | unsigned long address); | ||
73 | |||
74 | /* | ||
65 | * change_pte is called in cases that pte mapping to page is changed: | 75 | * change_pte is called in cases that pte mapping to page is changed: |
66 | * for example, when ksm remaps pte to point to a new shared page. | 76 | * for example, when ksm remaps pte to point to a new shared page. |
67 | */ | 77 | */ |
@@ -163,6 +173,8 @@ extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | |||
163 | extern void __mmu_notifier_release(struct mm_struct *mm); | 173 | extern void __mmu_notifier_release(struct mm_struct *mm); |
164 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | 174 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, |
165 | unsigned long address); | 175 | unsigned long address); |
176 | extern int __mmu_notifier_test_young(struct mm_struct *mm, | ||
177 | unsigned long address); | ||
166 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, | 178 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, |
167 | unsigned long address, pte_t pte); | 179 | unsigned long address, pte_t pte); |
168 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | 180 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, |
@@ -186,6 +198,14 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
186 | return 0; | 198 | return 0; |
187 | } | 199 | } |
188 | 200 | ||
201 | static inline int mmu_notifier_test_young(struct mm_struct *mm, | ||
202 | unsigned long address) | ||
203 | { | ||
204 | if (mm_has_notifiers(mm)) | ||
205 | return __mmu_notifier_test_young(mm, address); | ||
206 | return 0; | ||
207 | } | ||
208 | |||
189 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | 209 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, |
190 | unsigned long address, pte_t pte) | 210 | unsigned long address, pte_t pte) |
191 | { | 211 | { |
@@ -243,6 +263,32 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
243 | __pte; \ | 263 | __pte; \ |
244 | }) | 264 | }) |
245 | 265 | ||
266 | #define pmdp_clear_flush_notify(__vma, __address, __pmdp) \ | ||
267 | ({ \ | ||
268 | pmd_t __pmd; \ | ||
269 | struct vm_area_struct *___vma = __vma; \ | ||
270 | unsigned long ___address = __address; \ | ||
271 | VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \ | ||
272 | mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \ | ||
273 | (__address)+HPAGE_PMD_SIZE);\ | ||
274 | __pmd = pmdp_clear_flush(___vma, ___address, __pmdp); \ | ||
275 | mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \ | ||
276 | (__address)+HPAGE_PMD_SIZE); \ | ||
277 | __pmd; \ | ||
278 | }) | ||
279 | |||
280 | #define pmdp_splitting_flush_notify(__vma, __address, __pmdp) \ | ||
281 | ({ \ | ||
282 | struct vm_area_struct *___vma = __vma; \ | ||
283 | unsigned long ___address = __address; \ | ||
284 | VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \ | ||
285 | mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \ | ||
286 | (__address)+HPAGE_PMD_SIZE);\ | ||
287 | pmdp_splitting_flush(___vma, ___address, __pmdp); \ | ||
288 | mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \ | ||
289 | (__address)+HPAGE_PMD_SIZE); \ | ||
290 | }) | ||
291 | |||
246 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ | 292 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ |
247 | ({ \ | 293 | ({ \ |
248 | int __young; \ | 294 | int __young; \ |
@@ -254,6 +300,17 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
254 | __young; \ | 300 | __young; \ |
255 | }) | 301 | }) |
256 | 302 | ||
303 | #define pmdp_clear_flush_young_notify(__vma, __address, __pmdp) \ | ||
304 | ({ \ | ||
305 | int __young; \ | ||
306 | struct vm_area_struct *___vma = __vma; \ | ||
307 | unsigned long ___address = __address; \ | ||
308 | __young = pmdp_clear_flush_young(___vma, ___address, __pmdp); \ | ||
309 | __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \ | ||
310 | ___address); \ | ||
311 | __young; \ | ||
312 | }) | ||
313 | |||
257 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ | 314 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ |
258 | ({ \ | 315 | ({ \ |
259 | struct mm_struct *___mm = __mm; \ | 316 | struct mm_struct *___mm = __mm; \ |
@@ -276,6 +333,12 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
276 | return 0; | 333 | return 0; |
277 | } | 334 | } |
278 | 335 | ||
336 | static inline int mmu_notifier_test_young(struct mm_struct *mm, | ||
337 | unsigned long address) | ||
338 | { | ||
339 | return 0; | ||
340 | } | ||
341 | |||
279 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | 342 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, |
280 | unsigned long address, pte_t pte) | 343 | unsigned long address, pte_t pte) |
281 | { | 344 | { |
@@ -305,7 +368,10 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
305 | } | 368 | } |
306 | 369 | ||
307 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | 370 | #define ptep_clear_flush_young_notify ptep_clear_flush_young |
371 | #define pmdp_clear_flush_young_notify pmdp_clear_flush_young | ||
308 | #define ptep_clear_flush_notify ptep_clear_flush | 372 | #define ptep_clear_flush_notify ptep_clear_flush |
373 | #define pmdp_clear_flush_notify pmdp_clear_flush | ||
374 | #define pmdp_splitting_flush_notify pmdp_splitting_flush | ||
309 | #define set_pte_at_notify set_pte_at | 375 | #define set_pte_at_notify set_pte_at |
310 | 376 | ||
311 | #endif /* CONFIG_MMU_NOTIFIER */ | 377 | #endif /* CONFIG_MMU_NOTIFIER */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 39c24ebe9cfd..02ecb0189b1d 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -114,6 +114,7 @@ enum zone_stat_item { | |||
114 | NUMA_LOCAL, /* allocation from local node */ | 114 | NUMA_LOCAL, /* allocation from local node */ |
115 | NUMA_OTHER, /* allocation from other node */ | 115 | NUMA_OTHER, /* allocation from other node */ |
116 | #endif | 116 | #endif |
117 | NR_ANON_TRANSPARENT_HUGEPAGES, | ||
117 | NR_VM_ZONE_STAT_ITEMS }; | 118 | NR_VM_ZONE_STAT_ITEMS }; |
118 | 119 | ||
119 | /* | 120 | /* |
@@ -458,12 +459,6 @@ static inline int zone_is_oom_locked(const struct zone *zone) | |||
458 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | 459 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); |
459 | } | 460 | } |
460 | 461 | ||
461 | #ifdef CONFIG_SMP | ||
462 | unsigned long zone_nr_free_pages(struct zone *zone); | ||
463 | #else | ||
464 | #define zone_nr_free_pages(zone) zone_page_state(zone, NR_FREE_PAGES) | ||
465 | #endif /* CONFIG_SMP */ | ||
466 | |||
467 | /* | 462 | /* |
468 | * The "priority" of VM scanning is how much of the queues we will scan in one | 463 | * The "priority" of VM scanning is how much of the queues we will scan in one |
469 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the | 464 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the |
@@ -645,6 +640,7 @@ typedef struct pglist_data { | |||
645 | wait_queue_head_t kswapd_wait; | 640 | wait_queue_head_t kswapd_wait; |
646 | struct task_struct *kswapd; | 641 | struct task_struct *kswapd; |
647 | int kswapd_max_order; | 642 | int kswapd_max_order; |
643 | enum zone_type classzone_idx; | ||
648 | } pg_data_t; | 644 | } pg_data_t; |
649 | 645 | ||
650 | #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) | 646 | #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) |
@@ -660,8 +656,10 @@ typedef struct pglist_data { | |||
660 | 656 | ||
661 | extern struct mutex zonelists_mutex; | 657 | extern struct mutex zonelists_mutex; |
662 | void build_all_zonelists(void *data); | 658 | void build_all_zonelists(void *data); |
663 | void wakeup_kswapd(struct zone *zone, int order); | 659 | void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx); |
664 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 660 | bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
661 | int classzone_idx, int alloc_flags); | ||
662 | bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark, | ||
665 | int classzone_idx, int alloc_flags); | 663 | int classzone_idx, int alloc_flags); |
666 | enum memmap_context { | 664 | enum memmap_context { |
667 | MEMMAP_EARLY, | 665 | MEMMAP_EARLY, |
diff --git a/include/linux/module.h b/include/linux/module.h index 7575bbbdf2a2..5de42043dff0 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 | } __attribute__ ((__aligned__(sizeof(void *)))); | ||
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 |
@@ -308,6 +335,9 @@ struct module | |||
308 | /* The size of the executable code in each section. */ | 335 | /* The size of the executable code in each section. */ |
309 | unsigned int init_text_size, core_text_size; | 336 | unsigned int init_text_size, core_text_size; |
310 | 337 | ||
338 | /* Size of RO sections of the module (text+rodata) */ | ||
339 | unsigned int init_ro_size, core_ro_size; | ||
340 | |||
311 | /* Arch-specific module values */ | 341 | /* Arch-specific module values */ |
312 | struct mod_arch_specific arch; | 342 | struct mod_arch_specific arch; |
313 | 343 | ||
@@ -347,7 +377,7 @@ struct module | |||
347 | keeping pointers to this stuff */ | 377 | keeping pointers to this stuff */ |
348 | char *args; | 378 | char *args; |
349 | #ifdef CONFIG_TRACEPOINTS | 379 | #ifdef CONFIG_TRACEPOINTS |
350 | struct tracepoint *tracepoints; | 380 | struct tracepoint * const *tracepoints_ptrs; |
351 | unsigned int num_tracepoints; | 381 | unsigned int num_tracepoints; |
352 | #endif | 382 | #endif |
353 | #ifdef HAVE_JUMP_LABEL | 383 | #ifdef HAVE_JUMP_LABEL |
@@ -359,7 +389,7 @@ struct module | |||
359 | unsigned int num_trace_bprintk_fmt; | 389 | unsigned int num_trace_bprintk_fmt; |
360 | #endif | 390 | #endif |
361 | #ifdef CONFIG_EVENT_TRACING | 391 | #ifdef CONFIG_EVENT_TRACING |
362 | struct ftrace_event_call *trace_events; | 392 | struct ftrace_event_call **trace_events; |
363 | unsigned int num_trace_events; | 393 | unsigned int num_trace_events; |
364 | #endif | 394 | #endif |
365 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 395 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
@@ -672,7 +702,6 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter) | |||
672 | { | 702 | { |
673 | return 0; | 703 | return 0; |
674 | } | 704 | } |
675 | |||
676 | #endif /* CONFIG_MODULES */ | 705 | #endif /* CONFIG_MODULES */ |
677 | 706 | ||
678 | #ifdef CONFIG_SYSFS | 707 | #ifdef CONFIG_SYSFS |
@@ -687,6 +716,13 @@ extern int module_sysfs_initialized; | |||
687 | 716 | ||
688 | #define __MODULE_STRING(x) __stringify(x) | 717 | #define __MODULE_STRING(x) __stringify(x) |
689 | 718 | ||
719 | #ifdef CONFIG_DEBUG_SET_MODULE_RONX | ||
720 | extern void set_all_modules_text_rw(void); | ||
721 | extern void set_all_modules_text_ro(void); | ||
722 | #else | ||
723 | static inline void set_all_modules_text_rw(void) { } | ||
724 | static inline void set_all_modules_text_ro(void) { } | ||
725 | #endif | ||
690 | 726 | ||
691 | #ifdef CONFIG_GENERIC_BUG | 727 | #ifdef CONFIG_GENERIC_BUG |
692 | void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | 728 | void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 112adf8bd47d..07b41951e3fa 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 5e7a59408dd4..604f122a2326 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/seqlock.h> | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | 18 | ||
18 | struct super_block; | 19 | struct super_block; |
@@ -46,12 +47,24 @@ struct mnt_namespace; | |||
46 | 47 | ||
47 | #define MNT_INTERNAL 0x4000 | 48 | #define MNT_INTERNAL 0x4000 |
48 | 49 | ||
50 | struct mnt_pcp { | ||
51 | int mnt_count; | ||
52 | int mnt_writers; | ||
53 | }; | ||
54 | |||
49 | struct vfsmount { | 55 | struct vfsmount { |
50 | struct list_head mnt_hash; | 56 | struct list_head mnt_hash; |
51 | struct vfsmount *mnt_parent; /* fs we are mounted on */ | 57 | struct vfsmount *mnt_parent; /* fs we are mounted on */ |
52 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ | 58 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ |
53 | struct dentry *mnt_root; /* root of the mounted tree */ | 59 | struct dentry *mnt_root; /* root of the mounted tree */ |
54 | struct super_block *mnt_sb; /* pointer to superblock */ | 60 | struct super_block *mnt_sb; /* pointer to superblock */ |
61 | #ifdef CONFIG_SMP | ||
62 | struct mnt_pcp __percpu *mnt_pcp; | ||
63 | atomic_t mnt_longterm; /* how many of the refs are longterm */ | ||
64 | #else | ||
65 | int mnt_count; | ||
66 | int mnt_writers; | ||
67 | #endif | ||
55 | struct list_head mnt_mounts; /* list of children, anchored here */ | 68 | struct list_head mnt_mounts; /* list of children, anchored here */ |
56 | struct list_head mnt_child; /* and going through their mnt_child */ | 69 | struct list_head mnt_child; /* and going through their mnt_child */ |
57 | int mnt_flags; | 70 | int mnt_flags; |
@@ -70,57 +83,23 @@ struct vfsmount { | |||
70 | struct mnt_namespace *mnt_ns; /* containing namespace */ | 83 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
71 | int mnt_id; /* mount identifier */ | 84 | int mnt_id; /* mount identifier */ |
72 | int mnt_group_id; /* peer group identifier */ | 85 | int mnt_group_id; /* peer group identifier */ |
73 | /* | ||
74 | * We put mnt_count & mnt_expiry_mark at the end of struct vfsmount | ||
75 | * to let these frequently modified fields in a separate cache line | ||
76 | * (so that reads of mnt_flags wont ping-pong on SMP machines) | ||
77 | */ | ||
78 | atomic_t mnt_count; | ||
79 | int mnt_expiry_mark; /* true if marked for expiry */ | 86 | int mnt_expiry_mark; /* true if marked for expiry */ |
80 | int mnt_pinned; | 87 | int mnt_pinned; |
81 | int mnt_ghosts; | 88 | int mnt_ghosts; |
82 | #ifdef CONFIG_SMP | ||
83 | int __percpu *mnt_writers; | ||
84 | #else | ||
85 | int mnt_writers; | ||
86 | #endif | ||
87 | }; | 89 | }; |
88 | 90 | ||
89 | static inline int *get_mnt_writers_ptr(struct vfsmount *mnt) | ||
90 | { | ||
91 | #ifdef CONFIG_SMP | ||
92 | return mnt->mnt_writers; | ||
93 | #else | ||
94 | return &mnt->mnt_writers; | ||
95 | #endif | ||
96 | } | ||
97 | |||
98 | static inline struct vfsmount *mntget(struct vfsmount *mnt) | ||
99 | { | ||
100 | if (mnt) | ||
101 | atomic_inc(&mnt->mnt_count); | ||
102 | return mnt; | ||
103 | } | ||
104 | |||
105 | struct file; /* forward dec */ | 91 | struct file; /* forward dec */ |
106 | 92 | ||
107 | extern int mnt_want_write(struct vfsmount *mnt); | 93 | extern int mnt_want_write(struct vfsmount *mnt); |
108 | extern int mnt_want_write_file(struct file *file); | 94 | extern int mnt_want_write_file(struct file *file); |
109 | extern int mnt_clone_write(struct vfsmount *mnt); | 95 | extern int mnt_clone_write(struct vfsmount *mnt); |
110 | extern void mnt_drop_write(struct vfsmount *mnt); | 96 | extern void mnt_drop_write(struct vfsmount *mnt); |
111 | extern void mntput_no_expire(struct vfsmount *mnt); | 97 | extern void mntput(struct vfsmount *mnt); |
98 | extern struct vfsmount *mntget(struct vfsmount *mnt); | ||
112 | extern void mnt_pin(struct vfsmount *mnt); | 99 | extern void mnt_pin(struct vfsmount *mnt); |
113 | extern void mnt_unpin(struct vfsmount *mnt); | 100 | extern void mnt_unpin(struct vfsmount *mnt); |
114 | extern int __mnt_is_readonly(struct vfsmount *mnt); | 101 | extern int __mnt_is_readonly(struct vfsmount *mnt); |
115 | 102 | ||
116 | static inline void mntput(struct vfsmount *mnt) | ||
117 | { | ||
118 | if (mnt) { | ||
119 | mnt->mnt_expiry_mark = 0; | ||
120 | mntput_no_expire(mnt); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, | 103 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, |
125 | const char *name, void *data); | 104 | const char *name, void *data); |
126 | 105 | ||
@@ -129,12 +108,7 @@ extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, | |||
129 | int flags, const char *name, | 108 | int flags, const char *name, |
130 | void *data); | 109 | void *data); |
131 | 110 | ||
132 | struct nameidata; | 111 | extern void mnt_set_expiry(struct vfsmount *mnt, struct list_head *expiry_list); |
133 | |||
134 | struct path; | ||
135 | extern int do_add_mount(struct vfsmount *newmnt, struct path *path, | ||
136 | int mnt_flags, struct list_head *fslist); | ||
137 | |||
138 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 112 | extern void mark_mounts_for_expiry(struct list_head *mounts); |
139 | 113 | ||
140 | extern dev_t name_to_dev_t(char *name); | 114 | extern dev_t name_to_dev_t(char *name); |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 0fa7a3a874c8..b21d567692b2 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -150,6 +150,7 @@ static inline int ip_mroute_opt(int opt) | |||
150 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); | 150 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); |
151 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 151 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
152 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 152 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
153 | extern int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | ||
153 | extern int ip_mr_init(void); | 154 | extern int ip_mr_init(void); |
154 | #else | 155 | #else |
155 | static inline | 156 | static inline |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 6091ab77f388..9d2deb200f54 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -136,6 +136,7 @@ extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int | |||
136 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 136 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
137 | extern int ip6_mr_input(struct sk_buff *skb); | 137 | extern int ip6_mr_input(struct sk_buff *skb); |
138 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | 138 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); |
139 | extern int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | ||
139 | extern int ip6_mr_init(void); | 140 | extern int ip6_mr_init(void); |
140 | extern void ip6_mr_cleanup(void); | 141 | extern void ip6_mr_cleanup(void); |
141 | #else | 142 | #else |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 4dd0c2cd7659..a9baee6864af 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -527,8 +527,7 @@ struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t s | |||
527 | struct cfi_fixup { | 527 | struct cfi_fixup { |
528 | uint16_t mfr; | 528 | uint16_t mfr; |
529 | uint16_t id; | 529 | uint16_t id; |
530 | void (*fixup)(struct mtd_info *mtd, void* param); | 530 | void (*fixup)(struct mtd_info *mtd); |
531 | void* param; | ||
532 | }; | 531 | }; |
533 | 532 | ||
534 | #define CFI_MFR_ANY 0xFFFF | 533 | #define CFI_MFR_ANY 0xFFFF |
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h index 5d2556700ec2..6987995ad3cf 100644 --- a/include/linux/mtd/fsmc.h +++ b/include/linux/mtd/fsmc.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #ifndef __MTD_FSMC_H | 16 | #ifndef __MTD_FSMC_H |
17 | #define __MTD_FSMC_H | 17 | #define __MTD_FSMC_H |
18 | 18 | ||
19 | #include <linux/io.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
21 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -27,7 +28,7 @@ | |||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * The placement of the Command Latch Enable (CLE) and | 30 | * The placement of the Command Latch Enable (CLE) and |
30 | * Address Latch Enable (ALE) is twised around in the | 31 | * Address Latch Enable (ALE) is twisted around in the |
31 | * SPEAR310 implementation. | 32 | * SPEAR310 implementation. |
32 | */ | 33 | */ |
33 | #if defined(CONFIG_MACH_SPEAR310) | 34 | #if defined(CONFIG_MACH_SPEAR310) |
@@ -62,7 +63,7 @@ struct fsmc_nor_bank_regs { | |||
62 | 63 | ||
63 | /* ctrl_tim register definitions */ | 64 | /* ctrl_tim register definitions */ |
64 | 65 | ||
65 | struct fsms_nand_bank_regs { | 66 | struct fsmc_nand_bank_regs { |
66 | uint32_t pc; | 67 | uint32_t pc; |
67 | uint32_t sts; | 68 | uint32_t sts; |
68 | uint32_t comm; | 69 | uint32_t comm; |
@@ -78,7 +79,7 @@ struct fsms_nand_bank_regs { | |||
78 | struct fsmc_regs { | 79 | struct fsmc_regs { |
79 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; | 80 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; |
80 | uint8_t reserved_1[0x40 - 0x20]; | 81 | uint8_t reserved_1[0x40 - 0x20]; |
81 | struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; | 82 | struct fsmc_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; |
82 | uint8_t reserved_2[0xfe0 - 0xc0]; | 83 | uint8_t reserved_2[0xfe0 - 0xc0]; |
83 | uint32_t peripid0; /* 0xfe0 */ | 84 | uint32_t peripid0; /* 0xfe0 */ |
84 | uint32_t peripid1; /* 0xfe4 */ | 85 | uint32_t peripid1; /* 0xfe4 */ |
@@ -114,25 +115,6 @@ struct fsmc_regs { | |||
114 | #define FSMC_THOLD_4 (4 << 16) | 115 | #define FSMC_THOLD_4 (4 << 16) |
115 | #define FSMC_THIZ_1 (1 << 24) | 116 | #define FSMC_THIZ_1 (1 << 24) |
116 | 117 | ||
117 | /* peripid2 register definitions */ | ||
118 | #define FSMC_REVISION_MSK (0xf) | ||
119 | #define FSMC_REVISION_SHFT (0x4) | ||
120 | |||
121 | #define FSMC_VER1 1 | ||
122 | #define FSMC_VER2 2 | ||
123 | #define FSMC_VER3 3 | ||
124 | #define FSMC_VER4 4 | ||
125 | #define FSMC_VER5 5 | ||
126 | #define FSMC_VER6 6 | ||
127 | #define FSMC_VER7 7 | ||
128 | #define FSMC_VER8 8 | ||
129 | |||
130 | static inline uint32_t get_fsmc_version(struct fsmc_regs *regs) | ||
131 | { | ||
132 | return (readl(®s->peripid2) >> FSMC_REVISION_SHFT) & | ||
133 | FSMC_REVISION_MSK; | ||
134 | } | ||
135 | |||
136 | /* | 118 | /* |
137 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 | 119 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 |
138 | * and it has to be read consecutively and immediately after the 512 | 120 | * and it has to be read consecutively and immediately after the 512 |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index fe8d77ebec13..9d5306bad117 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -144,6 +144,17 @@ struct mtd_info { | |||
144 | */ | 144 | */ |
145 | uint32_t writesize; | 145 | uint32_t writesize; |
146 | 146 | ||
147 | /* | ||
148 | * Size of the write buffer used by the MTD. MTD devices having a write | ||
149 | * buffer can write multiple writesize chunks at a time. E.g. while | ||
150 | * writing 4 * writesize bytes to a device with 2 * writesize bytes | ||
151 | * buffer the MTD driver can (but doesn't have to) do 2 writesize | ||
152 | * operations, but not 4. Currently, all NANDs have writebufsize | ||
153 | * equivalent to writesize (NAND page size). Some NOR flashes do have | ||
154 | * writebufsize greater than writesize. | ||
155 | */ | ||
156 | uint32_t writebufsize; | ||
157 | |||
147 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) | 158 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) |
148 | uint32_t oobavail; // Available OOB bytes per block | 159 | uint32_t oobavail; // Available OOB bytes per block |
149 | 160 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 63e17d01fde9..1f489b247a29 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -448,6 +448,8 @@ struct nand_buffers { | |||
448 | * See the defines for further explanation. | 448 | * See the defines for further explanation. |
449 | * @badblockpos: [INTERN] position of the bad block marker in the oob | 449 | * @badblockpos: [INTERN] position of the bad block marker in the oob |
450 | * area. | 450 | * area. |
451 | * @badblockbits: [INTERN] number of bits to left-shift the bad block | ||
452 | * number | ||
451 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 453 | * @cellinfo: [INTERN] MLC/multichip data from chip ident |
452 | * @numchips: [INTERN] number of physical chips | 454 | * @numchips: [INTERN] number of physical chips |
453 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 455 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 0c8815bfae1c..ae418e41d8f5 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -118,6 +118,8 @@ struct onenand_chip { | |||
118 | int (*chip_probe)(struct mtd_info *mtd); | 118 | int (*chip_probe)(struct mtd_info *mtd); |
119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
120 | int (*scan_bbt)(struct mtd_info *mtd); | 120 | int (*scan_bbt)(struct mtd_info *mtd); |
121 | int (*enable)(struct mtd_info *mtd); | ||
122 | int (*disable)(struct mtd_info *mtd); | ||
121 | 123 | ||
122 | struct completion complete; | 124 | struct completion complete; |
123 | int irq; | 125 | int irq; |
@@ -137,6 +139,14 @@ struct onenand_chip { | |||
137 | void *bbm; | 139 | void *bbm; |
138 | 140 | ||
139 | void *priv; | 141 | void *priv; |
142 | |||
143 | /* | ||
144 | * Shows that the current operation is composed | ||
145 | * of sequence of commands. For example, cache program. | ||
146 | * Such command status OnGo bit is checked at the end of | ||
147 | * sequence. | ||
148 | */ | ||
149 | unsigned int ongoing; | ||
140 | }; | 150 | }; |
141 | 151 | ||
142 | /* | 152 | /* |
@@ -171,6 +181,9 @@ struct onenand_chip { | |||
171 | #define ONENAND_IS_2PLANE(this) (0) | 181 | #define ONENAND_IS_2PLANE(this) (0) |
172 | #endif | 182 | #endif |
173 | 183 | ||
184 | #define ONENAND_IS_CACHE_PROGRAM(this) \ | ||
185 | (this->options & ONENAND_HAS_CACHE_PROGRAM) | ||
186 | |||
174 | /* Check byte access in OneNAND */ | 187 | /* Check byte access in OneNAND */ |
175 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 188 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
176 | 189 | ||
@@ -181,6 +194,7 @@ struct onenand_chip { | |||
181 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 194 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
182 | #define ONENAND_HAS_2PLANE (0x0004) | 195 | #define ONENAND_HAS_2PLANE (0x0004) |
183 | #define ONENAND_HAS_4KB_PAGE (0x0008) | 196 | #define ONENAND_HAS_4KB_PAGE (0x0008) |
197 | #define ONENAND_HAS_CACHE_PROGRAM (0x0010) | ||
184 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | 198 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) |
185 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 199 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
186 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 200 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 2b54316591d2..4a0a8ba90a72 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -89,7 +89,7 @@ static inline int mtd_has_cmdlinepart(void) { return 1; } | |||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | 89 | static inline int mtd_has_cmdlinepart(void) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | int mtd_is_master(struct mtd_info *mtd); | 92 | int mtd_is_partition(struct mtd_info *mtd); |
93 | int mtd_add_partition(struct mtd_info *master, char *name, | 93 | int mtd_add_partition(struct mtd_info *master, char *name, |
94 | long long offset, long long length); | 94 | long long offset, long long length); |
95 | int mtd_del_partition(struct mtd_info *master, int partno); | 95 | int mtd_del_partition(struct mtd_info *master, int partno); |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f363bc8fdc74..94b48bd40dd7 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -160,4 +160,8 @@ extern int mutex_trylock(struct mutex *lock); | |||
160 | extern void mutex_unlock(struct mutex *lock); | 160 | extern void mutex_unlock(struct mutex *lock); |
161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
162 | 162 | ||
163 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX | ||
164 | #define arch_mutex_cpu_relax() cpu_relax() | ||
165 | #endif | ||
166 | |||
163 | #endif | 167 | #endif |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 05b441d93642..f276d4fa01fc 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -19,7 +19,10 @@ struct nameidata { | |||
19 | struct path path; | 19 | struct path path; |
20 | struct qstr last; | 20 | struct qstr last; |
21 | struct path root; | 21 | struct path root; |
22 | struct file *file; | ||
23 | struct inode *inode; /* path.dentry.d_inode */ | ||
22 | unsigned int flags; | 24 | unsigned int flags; |
25 | unsigned seq; | ||
23 | int last_type; | 26 | int last_type; |
24 | unsigned depth; | 27 | unsigned depth; |
25 | char *saved_names[MAX_NESTED_LINKS + 1]; | 28 | char *saved_names[MAX_NESTED_LINKS + 1]; |
@@ -41,14 +44,17 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
41 | * - require a directory | 44 | * - require a directory |
42 | * - ending slashes ok even for nonexistent files | 45 | * - ending slashes ok even for nonexistent files |
43 | * - internal "there are more path components" flag | 46 | * - internal "there are more path components" flag |
44 | * - locked when lookup done with dcache_lock held | ||
45 | * - dentry cache is untrusted; force a real lookup | 47 | * - dentry cache is untrusted; force a real lookup |
48 | * - suppress terminal automount | ||
46 | */ | 49 | */ |
47 | #define LOOKUP_FOLLOW 1 | 50 | #define LOOKUP_FOLLOW 0x0001 |
48 | #define LOOKUP_DIRECTORY 2 | 51 | #define LOOKUP_DIRECTORY 0x0002 |
49 | #define LOOKUP_CONTINUE 4 | 52 | #define LOOKUP_CONTINUE 0x0004 |
50 | #define LOOKUP_PARENT 16 | 53 | |
51 | #define LOOKUP_REVAL 64 | 54 | #define LOOKUP_PARENT 0x0010 |
55 | #define LOOKUP_REVAL 0x0020 | ||
56 | #define LOOKUP_RCU 0x0040 | ||
57 | #define LOOKUP_NO_AUTOMOUNT 0x0080 | ||
52 | /* | 58 | /* |
53 | * Intent data | 59 | * Intent data |
54 | */ | 60 | */ |
@@ -75,7 +81,8 @@ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry | |||
75 | 81 | ||
76 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 82 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
77 | 83 | ||
78 | extern int follow_down(struct path *); | 84 | extern int follow_down_one(struct path *); |
85 | extern int follow_down(struct path *, bool); | ||
79 | extern int follow_up(struct path *); | 86 | extern int follow_up(struct path *); |
80 | 87 | ||
81 | 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 ef663061d5ac..e13eefef0653 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -143,104 +143,4 @@ struct ncp_nls_ioctl | |||
143 | #define NCP_MAXPATHLEN 255 | 143 | #define NCP_MAXPATHLEN 255 |
144 | #define NCP_MAXNAMELEN 14 | 144 | #define NCP_MAXNAMELEN 14 |
145 | 145 | ||
146 | #ifdef __KERNEL__ | ||
147 | |||
148 | #include <linux/ncp_fs_i.h> | ||
149 | #include <linux/ncp_fs_sb.h> | ||
150 | |||
151 | /* define because it is easy to change PRINTK to {*}PRINTK */ | ||
152 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) | ||
153 | |||
154 | #undef NCPFS_PARANOIA | ||
155 | #ifdef NCPFS_PARANOIA | ||
156 | #define PPRINTK(format, args...) PRINTK(format , ## args) | ||
157 | #else | ||
158 | #define PPRINTK(format, args...) | ||
159 | #endif | ||
160 | |||
161 | #ifndef DEBUG_NCP | ||
162 | #define DEBUG_NCP 0 | ||
163 | #endif | ||
164 | #if DEBUG_NCP > 0 | ||
165 | #define DPRINTK(format, args...) PRINTK(format , ## args) | ||
166 | #else | ||
167 | #define DPRINTK(format, args...) | ||
168 | #endif | ||
169 | #if DEBUG_NCP > 1 | ||
170 | #define DDPRINTK(format, args...) PRINTK(format , ## args) | ||
171 | #else | ||
172 | #define DDPRINTK(format, args...) | ||
173 | #endif | ||
174 | |||
175 | #define NCP_MAX_RPC_TIMEOUT (6*HZ) | ||
176 | |||
177 | |||
178 | struct ncp_entry_info { | ||
179 | struct nw_info_struct i; | ||
180 | ino_t ino; | ||
181 | int opened; | ||
182 | int access; | ||
183 | unsigned int volume; | ||
184 | __u8 file_handle[6]; | ||
185 | }; | ||
186 | |||
187 | static inline struct ncp_server *NCP_SBP(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(struct inode *inode) | ||
194 | { | ||
195 | return container_of(inode, struct ncp_inode_info, vfs_inode); | ||
196 | } | ||
197 | |||
198 | /* linux/fs/ncpfs/inode.c */ | ||
199 | int ncp_notify_change(struct dentry *, struct iattr *); | ||
200 | struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *); | ||
201 | void ncp_update_inode(struct inode *, struct ncp_entry_info *); | ||
202 | void ncp_update_inode2(struct inode *, struct ncp_entry_info *); | ||
203 | |||
204 | /* linux/fs/ncpfs/dir.c */ | ||
205 | extern const struct inode_operations ncp_dir_inode_operations; | ||
206 | extern const struct file_operations ncp_dir_operations; | ||
207 | extern const struct dentry_operations ncp_root_dentry_operations; | ||
208 | int ncp_conn_logged_in(struct super_block *); | ||
209 | int ncp_date_dos2unix(__le16 time, __le16 date); | ||
210 | void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | ||
211 | |||
212 | /* linux/fs/ncpfs/ioctl.c */ | ||
213 | long ncp_ioctl(struct file *, unsigned int, unsigned long); | ||
214 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
215 | |||
216 | /* linux/fs/ncpfs/sock.c */ | ||
217 | int ncp_request2(struct ncp_server *server, int function, | ||
218 | void* reply, int max_reply_size); | ||
219 | static inline int ncp_request(struct ncp_server *server, int function) { | ||
220 | return ncp_request2(server, function, server->packet, server->packet_size); | ||
221 | } | ||
222 | int ncp_connect(struct ncp_server *server); | ||
223 | int ncp_disconnect(struct ncp_server *server); | ||
224 | void ncp_lock_server(struct ncp_server *server); | ||
225 | void ncp_unlock_server(struct ncp_server *server); | ||
226 | |||
227 | /* linux/fs/ncpfs/symlink.c */ | ||
228 | #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) | ||
229 | extern const struct address_space_operations ncp_symlink_aops; | ||
230 | int ncp_symlink(struct inode*, struct dentry*, const char*); | ||
231 | #endif | ||
232 | |||
233 | /* linux/fs/ncpfs/file.c */ | ||
234 | extern const struct inode_operations ncp_file_inode_operations; | ||
235 | extern const struct file_operations ncp_file_operations; | ||
236 | int ncp_make_open(struct inode *, int); | ||
237 | |||
238 | /* linux/fs/ncpfs/mmap.c */ | ||
239 | int ncp_mmap(struct file *, struct vm_area_struct *); | ||
240 | |||
241 | /* linux/fs/ncpfs/ncplib_kernel.c */ | ||
242 | int ncp_make_closed(struct inode *); | ||
243 | |||
244 | #endif /* __KERNEL__ */ | ||
245 | |||
246 | #endif /* _LINUX_NCP_FS_H */ | 146 | #endif /* _LINUX_NCP_FS_H */ |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h deleted file mode 100644 index 4b0bec477846..000000000000 --- a/include/linux/ncp_fs_i.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1995 Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_NCP_FS_I | ||
9 | #define _LINUX_NCP_FS_I | ||
10 | |||
11 | /* | ||
12 | * This is the ncpfs part of the inode structure. This must contain | ||
13 | * all the information we need to work with an inode after creation. | ||
14 | */ | ||
15 | struct ncp_inode_info { | ||
16 | __le32 dirEntNum; | ||
17 | __le32 DosDirNum; | ||
18 | __u8 volNumber; | ||
19 | __le32 nwattr; | ||
20 | struct mutex open_mutex; | ||
21 | atomic_t opened; | ||
22 | int access; | ||
23 | int flags; | ||
24 | #define NCPI_KLUDGE_SYMLINK 0x0001 | ||
25 | __u8 file_handle[6]; | ||
26 | struct inode vfs_inode; | ||
27 | }; | ||
28 | |||
29 | #endif /* _LINUX_NCP_FS_I */ | ||
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h deleted file mode 100644 index d64b0e894336..000000000000 --- a/include/linux/ncp_fs_sb.h +++ /dev/null | |||
@@ -1,164 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996 by Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _NCP_FS_SB | ||
9 | #define _NCP_FS_SB | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/ncp_mount.h> | ||
13 | #include <linux/net.h> | ||
14 | #include <linux/mutex.h> | ||
15 | #include <linux/backing-dev.h> | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <linux/workqueue.h> | ||
20 | |||
21 | #define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */ | ||
22 | |||
23 | struct sock; | ||
24 | |||
25 | struct ncp_server { | ||
26 | |||
27 | struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of | ||
28 | interest for us later, so we store | ||
29 | it completely. */ | ||
30 | |||
31 | __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2]; | ||
32 | |||
33 | struct file *ncp_filp; /* File pointer to ncp socket */ | ||
34 | struct socket *ncp_sock;/* ncp socket */ | ||
35 | struct file *info_filp; | ||
36 | struct socket *info_sock; | ||
37 | |||
38 | u8 sequence; | ||
39 | u8 task; | ||
40 | u16 connection; /* Remote connection number */ | ||
41 | |||
42 | u8 completion; /* Status message from server */ | ||
43 | u8 conn_status; /* Bit 4 = 1 ==> Server going down, no | ||
44 | requests allowed anymore. | ||
45 | Bit 0 = 1 ==> Server is down. */ | ||
46 | |||
47 | int buffer_size; /* Negotiated bufsize */ | ||
48 | |||
49 | int reply_size; /* Size of last reply */ | ||
50 | |||
51 | int packet_size; | ||
52 | unsigned char *packet; /* Here we prepare requests and | ||
53 | receive replies */ | ||
54 | unsigned char *txbuf; /* Storage for current request */ | ||
55 | unsigned char *rxbuf; /* Storage for reply to current request */ | ||
56 | |||
57 | int lock; /* To prevent mismatch in protocols. */ | ||
58 | struct mutex mutex; | ||
59 | |||
60 | int current_size; /* for packet preparation */ | ||
61 | int has_subfunction; | ||
62 | int ncp_reply_size; | ||
63 | |||
64 | int root_setuped; | ||
65 | struct mutex root_setup_lock; | ||
66 | |||
67 | /* info for packet signing */ | ||
68 | int sign_wanted; /* 1=Server needs signed packets */ | ||
69 | int sign_active; /* 0=don't do signing, 1=do */ | ||
70 | char sign_root[8]; /* generated from password and encr. key */ | ||
71 | char sign_last[16]; | ||
72 | |||
73 | /* Authentication info: NDS or BINDERY, username */ | ||
74 | struct { | ||
75 | int auth_type; | ||
76 | size_t object_name_len; | ||
77 | void* object_name; | ||
78 | int object_type; | ||
79 | } auth; | ||
80 | /* Password info */ | ||
81 | struct { | ||
82 | size_t len; | ||
83 | void* data; | ||
84 | } priv; | ||
85 | struct rw_semaphore auth_rwsem; | ||
86 | |||
87 | /* nls info: codepage for volume and charset for I/O */ | ||
88 | struct nls_table *nls_vol; | ||
89 | struct nls_table *nls_io; | ||
90 | |||
91 | /* maximum age in jiffies */ | ||
92 | atomic_t dentry_ttl; | ||
93 | |||
94 | /* miscellaneous */ | ||
95 | unsigned int flags; | ||
96 | |||
97 | spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */ | ||
98 | |||
99 | void (*data_ready)(struct sock* sk, int len); | ||
100 | void (*error_report)(struct sock* sk); | ||
101 | void (*write_space)(struct sock* sk); /* STREAM mode only */ | ||
102 | struct { | ||
103 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | ||
104 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | ||
105 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ | ||
106 | |||
107 | unsigned int state; /* STREAM only: receiver state */ | ||
108 | struct { | ||
109 | __u32 magic __packed; | ||
110 | __u32 len __packed; | ||
111 | __u16 type __packed; | ||
112 | __u16 p1 __packed; | ||
113 | __u16 p2 __packed; | ||
114 | __u16 p3 __packed; | ||
115 | __u16 type2 __packed; | ||
116 | } buf; /* STREAM only: temporary buffer */ | ||
117 | unsigned char* ptr; /* STREAM only: pointer to data */ | ||
118 | size_t len; /* STREAM only: length of data to receive */ | ||
119 | } rcv; | ||
120 | struct { | ||
121 | struct list_head requests; /* STREAM only: queued requests */ | ||
122 | struct work_struct tq; /* STREAM only: transmitter ready */ | ||
123 | struct ncp_request_reply* creq; /* STREAM only: currently transmitted entry */ | ||
124 | } tx; | ||
125 | struct timer_list timeout_tm; /* DGRAM only: timeout timer */ | ||
126 | struct work_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */ | ||
127 | int timeout_last; /* DGRAM only: current timeout length */ | ||
128 | int timeout_retries; /* DGRAM only: retries left */ | ||
129 | struct { | ||
130 | size_t len; | ||
131 | __u8 data[128]; | ||
132 | } unexpected_packet; | ||
133 | struct backing_dev_info bdi; | ||
134 | }; | ||
135 | |||
136 | extern void ncp_tcp_rcv_proc(struct work_struct *work); | ||
137 | extern void ncp_tcp_tx_proc(struct work_struct *work); | ||
138 | extern void ncpdgram_rcv_proc(struct work_struct *work); | ||
139 | extern void ncpdgram_timeout_proc(struct work_struct *work); | ||
140 | extern void ncpdgram_timeout_call(unsigned long server); | ||
141 | extern void ncp_tcp_data_ready(struct sock* sk, int len); | ||
142 | extern void ncp_tcp_write_space(struct sock* sk); | ||
143 | extern void ncp_tcp_error_report(struct sock* sk); | ||
144 | |||
145 | #define NCP_FLAG_UTF8 1 | ||
146 | |||
147 | #define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag)) | ||
148 | #define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag)) | ||
149 | #define NCP_IS_FLAG(server, flag) ((server)->flags & (flag)) | ||
150 | |||
151 | static inline int ncp_conn_valid(struct ncp_server *server) | ||
152 | { | ||
153 | return ((server->conn_status & 0x11) == 0); | ||
154 | } | ||
155 | |||
156 | static inline void ncp_invalidate_conn(struct ncp_server *server) | ||
157 | { | ||
158 | server->conn_status |= 0x01; | ||
159 | } | ||
160 | |||
161 | #endif /* __KERNEL__ */ | ||
162 | |||
163 | #endif | ||
164 | |||
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h index a2b549eb1eca..dfcbea2d889f 100644 --- a/include/linux/ncp_mount.h +++ b/include/linux/ncp_mount.h | |||
@@ -68,26 +68,4 @@ struct ncp_mount_data_v4 { | |||
68 | 68 | ||
69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ | 69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ |
70 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct ncp_mount_data_kernel { | ||
74 | unsigned long flags; /* NCP_MOUNT_* flags */ | ||
75 | unsigned int int_flags; /* internal flags */ | ||
76 | #define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001 | ||
77 | __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */ | ||
78 | struct pid *wdog_pid; /* Who cares for our watchdog packets? */ | ||
79 | unsigned int ncp_fd; /* The socket to the ncp port */ | ||
80 | unsigned int time_out; /* How long should I wait after | ||
81 | sending a NCP request? */ | ||
82 | unsigned int retry_count; /* And how often should I retry? */ | ||
83 | unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; | ||
84 | __kernel_uid32_t uid; | ||
85 | __kernel_gid32_t gid; | ||
86 | __kernel_mode_t file_mode; | ||
87 | __kernel_mode_t dir_mode; | ||
88 | int info_fd; | ||
89 | }; | ||
90 | |||
91 | #endif /* __KERNEL__ */ | ||
92 | |||
93 | #endif | 71 | #endif |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d8fd2c23a1b9..d971346b0340 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -493,6 +493,8 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
493 | enum netdev_queue_state_t { | 493 | enum netdev_queue_state_t { |
494 | __QUEUE_STATE_XOFF, | 494 | __QUEUE_STATE_XOFF, |
495 | __QUEUE_STATE_FROZEN, | 495 | __QUEUE_STATE_FROZEN, |
496 | #define QUEUE_STATE_XOFF_OR_FROZEN ((1 << __QUEUE_STATE_XOFF) | \ | ||
497 | (1 << __QUEUE_STATE_FROZEN)) | ||
496 | }; | 498 | }; |
497 | 499 | ||
498 | struct netdev_queue { | 500 | struct netdev_queue { |
@@ -503,6 +505,12 @@ struct netdev_queue { | |||
503 | struct Qdisc *qdisc; | 505 | struct Qdisc *qdisc; |
504 | unsigned long state; | 506 | unsigned long state; |
505 | struct Qdisc *qdisc_sleeping; | 507 | struct Qdisc *qdisc_sleeping; |
508 | #ifdef CONFIG_RPS | ||
509 | struct kobject kobj; | ||
510 | #endif | ||
511 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
512 | int numa_node; | ||
513 | #endif | ||
506 | /* | 514 | /* |
507 | * write mostly part | 515 | * write mostly part |
508 | */ | 516 | */ |
@@ -512,11 +520,24 @@ struct netdev_queue { | |||
512 | * please use this field instead of dev->trans_start | 520 | * please use this field instead of dev->trans_start |
513 | */ | 521 | */ |
514 | unsigned long trans_start; | 522 | unsigned long trans_start; |
515 | u64 tx_bytes; | ||
516 | u64 tx_packets; | ||
517 | u64 tx_dropped; | ||
518 | } ____cacheline_aligned_in_smp; | 523 | } ____cacheline_aligned_in_smp; |
519 | 524 | ||
525 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) | ||
526 | { | ||
527 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
528 | return q->numa_node; | ||
529 | #else | ||
530 | return NUMA_NO_NODE; | ||
531 | #endif | ||
532 | } | ||
533 | |||
534 | static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node) | ||
535 | { | ||
536 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
537 | q->numa_node = node; | ||
538 | #endif | ||
539 | } | ||
540 | |||
520 | #ifdef CONFIG_RPS | 541 | #ifdef CONFIG_RPS |
521 | /* | 542 | /* |
522 | * This structure holds an RPS map which can be of variable length. The | 543 | * This structure holds an RPS map which can be of variable length. The |
@@ -592,11 +613,36 @@ struct netdev_rx_queue { | |||
592 | struct rps_map __rcu *rps_map; | 613 | struct rps_map __rcu *rps_map; |
593 | struct rps_dev_flow_table __rcu *rps_flow_table; | 614 | struct rps_dev_flow_table __rcu *rps_flow_table; |
594 | struct kobject kobj; | 615 | struct kobject kobj; |
595 | struct netdev_rx_queue *first; | 616 | struct net_device *dev; |
596 | atomic_t count; | ||
597 | } ____cacheline_aligned_in_smp; | 617 | } ____cacheline_aligned_in_smp; |
598 | #endif /* CONFIG_RPS */ | 618 | #endif /* CONFIG_RPS */ |
599 | 619 | ||
620 | #ifdef CONFIG_XPS | ||
621 | /* | ||
622 | * This structure holds an XPS map which can be of variable length. The | ||
623 | * map is an array of queues. | ||
624 | */ | ||
625 | struct xps_map { | ||
626 | unsigned int len; | ||
627 | unsigned int alloc_len; | ||
628 | struct rcu_head rcu; | ||
629 | u16 queues[0]; | ||
630 | }; | ||
631 | #define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + (_num * sizeof(u16))) | ||
632 | #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \ | ||
633 | / sizeof(u16)) | ||
634 | |||
635 | /* | ||
636 | * This structure holds all XPS maps for device. Maps are indexed by CPU. | ||
637 | */ | ||
638 | struct xps_dev_maps { | ||
639 | struct rcu_head rcu; | ||
640 | struct xps_map __rcu *cpu_map[0]; | ||
641 | }; | ||
642 | #define XPS_DEV_MAPS_SIZE (sizeof(struct xps_dev_maps) + \ | ||
643 | (nr_cpu_ids * sizeof(struct xps_map *))) | ||
644 | #endif /* CONFIG_XPS */ | ||
645 | |||
600 | /* | 646 | /* |
601 | * This structure defines the management hooks for network devices. | 647 | * This structure defines the management hooks for network devices. |
602 | * The following hooks can be defined; unless noted otherwise, they are | 648 | * The following hooks can be defined; unless noted otherwise, they are |
@@ -683,7 +729,7 @@ struct netdev_rx_queue { | |||
683 | * neither operation. | 729 | * neither operation. |
684 | * | 730 | * |
685 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); | 731 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); |
686 | * If device support VLAN receive accleration | 732 | * If device support VLAN receive acceleration |
687 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called | 733 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called |
688 | * when vlan groups for the device changes. Note: grp is NULL | 734 | * when vlan groups for the device changes. Note: grp is NULL |
689 | * if no vlan's groups are being used. | 735 | * if no vlan's groups are being used. |
@@ -951,7 +997,7 @@ struct net_device { | |||
951 | #endif | 997 | #endif |
952 | void *atalk_ptr; /* AppleTalk link */ | 998 | void *atalk_ptr; /* AppleTalk link */ |
953 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ | 999 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ |
954 | void *dn_ptr; /* DECnet specific data */ | 1000 | struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ |
955 | struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ | 1001 | struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ |
956 | void *ec_ptr; /* Econet specific data */ | 1002 | void *ec_ptr; /* Econet specific data */ |
957 | void *ax25_ptr; /* AX.25 specific data */ | 1003 | void *ax25_ptr; /* AX.25 specific data */ |
@@ -995,8 +1041,8 @@ struct net_device { | |||
995 | unsigned int real_num_rx_queues; | 1041 | unsigned int real_num_rx_queues; |
996 | #endif | 1042 | #endif |
997 | 1043 | ||
998 | rx_handler_func_t *rx_handler; | 1044 | rx_handler_func_t __rcu *rx_handler; |
999 | void *rx_handler_data; | 1045 | void __rcu *rx_handler_data; |
1000 | 1046 | ||
1001 | struct netdev_queue __rcu *ingress_queue; | 1047 | struct netdev_queue __rcu *ingress_queue; |
1002 | 1048 | ||
@@ -1017,6 +1063,10 @@ struct net_device { | |||
1017 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 1063 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
1018 | spinlock_t tx_global_lock; | 1064 | spinlock_t tx_global_lock; |
1019 | 1065 | ||
1066 | #ifdef CONFIG_XPS | ||
1067 | struct xps_dev_maps __rcu *xps_maps; | ||
1068 | #endif | ||
1069 | |||
1020 | /* These may be needed for future network-power-down code. */ | 1070 | /* These may be needed for future network-power-down code. */ |
1021 | 1071 | ||
1022 | /* | 1072 | /* |
@@ -1307,7 +1357,8 @@ static inline struct net_device *first_net_device(struct net *net) | |||
1307 | 1357 | ||
1308 | extern int netdev_boot_setup_check(struct net_device *dev); | 1358 | extern int netdev_boot_setup_check(struct net_device *dev); |
1309 | extern unsigned long netdev_boot_base(const char *prefix, int unit); | 1359 | extern unsigned long netdev_boot_base(const char *prefix, int unit); |
1310 | extern struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *hwaddr); | 1360 | extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, |
1361 | const char *hwaddr); | ||
1311 | extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); | 1362 | extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); |
1312 | extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); | 1363 | extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); |
1313 | extern void dev_add_pack(struct packet_type *pt); | 1364 | extern void dev_add_pack(struct packet_type *pt); |
@@ -1600,9 +1651,9 @@ static inline int netif_queue_stopped(const struct net_device *dev) | |||
1600 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); | 1651 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); |
1601 | } | 1652 | } |
1602 | 1653 | ||
1603 | static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) | 1654 | static inline int netif_tx_queue_frozen_or_stopped(const struct netdev_queue *dev_queue) |
1604 | { | 1655 | { |
1605 | return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); | 1656 | return dev_queue->state & QUEUE_STATE_XOFF_OR_FROZEN; |
1606 | } | 1657 | } |
1607 | 1658 | ||
1608 | /** | 1659 | /** |
@@ -1693,6 +1744,16 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
1693 | __netif_schedule(txq->qdisc); | 1744 | __netif_schedule(txq->qdisc); |
1694 | } | 1745 | } |
1695 | 1746 | ||
1747 | /* | ||
1748 | * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used | ||
1749 | * as a distribution range limit for the returned value. | ||
1750 | */ | ||
1751 | static inline u16 skb_tx_hash(const struct net_device *dev, | ||
1752 | const struct sk_buff *skb) | ||
1753 | { | ||
1754 | return __skb_tx_hash(dev, skb, dev->real_num_tx_queues); | ||
1755 | } | ||
1756 | |||
1696 | /** | 1757 | /** |
1697 | * netif_is_multiqueue - test if device has multiple transmit queues | 1758 | * netif_is_multiqueue - test if device has multiple transmit queues |
1698 | * @dev: network device | 1759 | * @dev: network device |
@@ -2127,11 +2188,15 @@ static inline void netif_addr_unlock_bh(struct net_device *dev) | |||
2127 | extern void ether_setup(struct net_device *dev); | 2188 | extern void ether_setup(struct net_device *dev); |
2128 | 2189 | ||
2129 | /* Support for loadable net-drivers */ | 2190 | /* Support for loadable net-drivers */ |
2130 | extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | 2191 | extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, |
2131 | void (*setup)(struct net_device *), | 2192 | void (*setup)(struct net_device *), |
2132 | unsigned int queue_count); | 2193 | unsigned int txqs, unsigned int rxqs); |
2133 | #define alloc_netdev(sizeof_priv, name, setup) \ | 2194 | #define alloc_netdev(sizeof_priv, name, setup) \ |
2134 | alloc_netdev_mq(sizeof_priv, name, setup, 1) | 2195 | alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) |
2196 | |||
2197 | #define alloc_netdev_mq(sizeof_priv, name, setup, count) \ | ||
2198 | alloc_netdev_mqs(sizeof_priv, name, setup, count, count) | ||
2199 | |||
2135 | extern int register_netdev(struct net_device *dev); | 2200 | extern int register_netdev(struct net_device *dev); |
2136 | extern void unregister_netdev(struct net_device *dev); | 2201 | extern void unregister_netdev(struct net_device *dev); |
2137 | 2202 | ||
@@ -2197,8 +2262,6 @@ extern void dev_load(struct net *net, const char *name); | |||
2197 | extern void dev_mcast_init(void); | 2262 | extern void dev_mcast_init(void); |
2198 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | 2263 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, |
2199 | struct rtnl_link_stats64 *storage); | 2264 | struct rtnl_link_stats64 *storage); |
2200 | extern void dev_txq_stats_fold(const struct net_device *dev, | ||
2201 | struct rtnl_link_stats64 *stats); | ||
2202 | 2265 | ||
2203 | extern int netdev_max_backlog; | 2266 | extern int netdev_max_backlog; |
2204 | extern int netdev_tstamp_prequeue; | 2267 | extern int netdev_tstamp_prequeue; |
@@ -2239,6 +2302,8 @@ unsigned long netdev_fix_features(unsigned long features, const char *name); | |||
2239 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2302 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2240 | struct net_device *dev); | 2303 | struct net_device *dev); |
2241 | 2304 | ||
2305 | int netif_skb_features(struct sk_buff *skb); | ||
2306 | |||
2242 | static inline int net_gso_ok(int features, int gso_type) | 2307 | static inline int net_gso_ok(int features, int gso_type) |
2243 | { | 2308 | { |
2244 | int feature = gso_type << NETIF_F_GSO_SHIFT; | 2309 | int feature = gso_type << NETIF_F_GSO_SHIFT; |
@@ -2251,19 +2316,10 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features) | |||
2251 | (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); | 2316 | (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); |
2252 | } | 2317 | } |
2253 | 2318 | ||
2254 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 2319 | static inline int netif_needs_gso(struct sk_buff *skb, int features) |
2255 | { | 2320 | { |
2256 | if (skb_is_gso(skb)) { | 2321 | return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || |
2257 | int features = dev->features; | 2322 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
2258 | |||
2259 | if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci) | ||
2260 | features &= dev->vlan_features; | ||
2261 | |||
2262 | return (!skb_gso_ok(skb, features) || | ||
2263 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | ||
2264 | } | ||
2265 | |||
2266 | return 0; | ||
2267 | } | 2323 | } |
2268 | 2324 | ||
2269 | static inline void netif_set_gso_max_size(struct net_device *dev, | 2325 | static inline void netif_set_gso_max_size(struct net_device *dev, |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 03317c8d4077..1893837b3966 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) | 34 | #define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) |
35 | 35 | ||
36 | #define NF_DROP_ERR(x) (((-x) << NF_VERDICT_BITS) | NF_DROP) | ||
37 | |||
36 | /* only for userspace compatibility */ | 38 | /* only for userspace compatibility */ |
37 | #ifndef __KERNEL__ | 39 | #ifndef __KERNEL__ |
38 | /* Generic cache responses from hook functions. | 40 | /* Generic cache responses from hook functions. |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 742bec051440..6712e713b299 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -472,7 +472,7 @@ extern void xt_free_table_info(struct xt_table_info *info); | |||
472 | * necessary for reading the counters. | 472 | * necessary for reading the counters. |
473 | */ | 473 | */ |
474 | struct xt_info_lock { | 474 | struct xt_info_lock { |
475 | spinlock_t lock; | 475 | seqlock_t lock; |
476 | unsigned char readers; | 476 | unsigned char readers; |
477 | }; | 477 | }; |
478 | DECLARE_PER_CPU(struct xt_info_lock, xt_info_locks); | 478 | DECLARE_PER_CPU(struct xt_info_lock, xt_info_locks); |
@@ -497,7 +497,7 @@ static inline void xt_info_rdlock_bh(void) | |||
497 | local_bh_disable(); | 497 | local_bh_disable(); |
498 | lock = &__get_cpu_var(xt_info_locks); | 498 | lock = &__get_cpu_var(xt_info_locks); |
499 | if (likely(!lock->readers++)) | 499 | if (likely(!lock->readers++)) |
500 | spin_lock(&lock->lock); | 500 | write_seqlock(&lock->lock); |
501 | } | 501 | } |
502 | 502 | ||
503 | static inline void xt_info_rdunlock_bh(void) | 503 | static inline void xt_info_rdunlock_bh(void) |
@@ -505,7 +505,7 @@ static inline void xt_info_rdunlock_bh(void) | |||
505 | struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks); | 505 | struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks); |
506 | 506 | ||
507 | if (likely(!--lock->readers)) | 507 | if (likely(!--lock->readers)) |
508 | spin_unlock(&lock->lock); | 508 | write_sequnlock(&lock->lock); |
509 | local_bh_enable(); | 509 | local_bh_enable(); |
510 | } | 510 | } |
511 | 511 | ||
@@ -516,12 +516,12 @@ static inline void xt_info_rdunlock_bh(void) | |||
516 | */ | 516 | */ |
517 | static inline void xt_info_wrlock(unsigned int cpu) | 517 | static inline void xt_info_wrlock(unsigned int cpu) |
518 | { | 518 | { |
519 | spin_lock(&per_cpu(xt_info_locks, cpu).lock); | 519 | write_seqlock(&per_cpu(xt_info_locks, cpu).lock); |
520 | } | 520 | } |
521 | 521 | ||
522 | static inline void xt_info_wrunlock(unsigned int cpu) | 522 | static inline void xt_info_wrunlock(unsigned int cpu) |
523 | { | 523 | { |
524 | spin_unlock(&per_cpu(xt_info_locks, cpu).lock); | 524 | write_sequnlock(&per_cpu(xt_info_locks, cpu).lock); |
525 | } | 525 | } |
526 | 526 | ||
527 | /* | 527 | /* |
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h new file mode 100644 index 000000000000..7ab8521f2347 --- /dev/null +++ b/include/linux/nfc/pn544.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #define PN544_DRIVER_NAME "pn544" | ||
29 | #define PN544_MAXWINDOW_SIZE 7 | ||
30 | #define PN544_WINDOW_SIZE 4 | ||
31 | #define PN544_RETRIES 10 | ||
32 | #define PN544_MAX_I2C_TRANSFER 0x0400 | ||
33 | #define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */ | ||
34 | |||
35 | /* ioctl */ | ||
36 | #define PN544_CHAR_BASE 'P' | ||
37 | #define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype) | ||
38 | #define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype) | ||
39 | #define PN544_GET_FW_MODE PN544_IOW(1, unsigned int) | ||
40 | #define PN544_SET_FW_MODE PN544_IOW(2, unsigned int) | ||
41 | #define PN544_GET_DEBUG PN544_IOW(3, unsigned int) | ||
42 | #define PN544_SET_DEBUG PN544_IOW(4, unsigned int) | ||
43 | |||
44 | /* Timing restrictions (ms) */ | ||
45 | #define PN544_RESETVEN_TIME 30 /* 7 */ | ||
46 | #define PN544_PVDDVEN_TIME 0 | ||
47 | #define PN544_VBATVEN_TIME 0 | ||
48 | #define PN544_GPIO4VEN_TIME 0 | ||
49 | #define PN544_WAKEUP_ACK 5 | ||
50 | #define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1) | ||
51 | #define PN544_INACTIVITY_TIME 1000 | ||
52 | #define PN544_INTERFRAME_DELAY 200 /* us */ | ||
53 | #define PN544_BAUDRATE_CHANGE 150 /* us */ | ||
54 | |||
55 | /* Debug bits */ | ||
56 | #define PN544_DEBUG_BUF 0x01 | ||
57 | #define PN544_DEBUG_READ 0x02 | ||
58 | #define PN544_DEBUG_WRITE 0x04 | ||
59 | #define PN544_DEBUG_IRQ 0x08 | ||
60 | #define PN544_DEBUG_CALLS 0x10 | ||
61 | #define PN544_DEBUG_MODE 0x20 | ||
62 | |||
63 | /* Normal (HCI) mode */ | ||
64 | #define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */ | ||
65 | #define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */ | ||
66 | #define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2) | ||
67 | #define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2) | ||
68 | |||
69 | struct pn544_llc_packet { | ||
70 | unsigned char length; /* of rest of packet */ | ||
71 | unsigned char header; | ||
72 | unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */ | ||
73 | }; | ||
74 | |||
75 | /* Firmware upgrade mode */ | ||
76 | #define PN544_FW_HEADER_SIZE 3 | ||
77 | /* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */ | ||
78 | #define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE) | ||
79 | |||
80 | struct pn544_fw_packet { | ||
81 | unsigned char command; /* status in answer */ | ||
82 | unsigned char length[2]; /* big-endian order (msf) */ | ||
83 | unsigned char data[PN544_MAX_FW_DATA]; | ||
84 | }; | ||
85 | |||
86 | #ifdef __KERNEL__ | ||
87 | /* board config */ | ||
88 | struct pn544_nfc_platform_data { | ||
89 | int (*request_resources) (struct i2c_client *client); | ||
90 | void (*free_resources) (void); | ||
91 | void (*enable) (int fw); | ||
92 | int (*test) (void); | ||
93 | void (*disable) (void); | ||
94 | }; | ||
95 | #endif /* __KERNEL__ */ | ||
96 | |||
97 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h index ac33806ec7f9..6ccfe3b641e1 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 4925b22219d2..134716e5e350 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -65,6 +65,9 @@ | |||
65 | 65 | ||
66 | #define NFS4_CDFC4_FORE 0x1 | 66 | #define NFS4_CDFC4_FORE 0x1 |
67 | #define NFS4_CDFC4_BACK 0x2 | 67 | #define NFS4_CDFC4_BACK 0x2 |
68 | #define NFS4_CDFC4_BOTH 0x3 | ||
69 | #define NFS4_CDFC4_FORE_OR_BOTH 0x3 | ||
70 | #define NFS4_CDFC4_BACK_OR_BOTH 0x7 | ||
68 | 71 | ||
69 | #define NFS4_SET_TO_SERVER_TIME 0 | 72 | #define NFS4_SET_TO_SERVER_TIME 0 |
70 | #define NFS4_SET_TO_CLIENT_TIME 1 | 73 | #define NFS4_SET_TO_CLIENT_TIME 1 |
@@ -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 c9c05a78e9bb..000000000000 --- a/include/linux/nfs4_acl.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfs4_acl.c | ||
3 | * | ||
4 | * Common NFSv4 ACL handling definitions. | ||
5 | * | ||
6 | * Copyright (c) 2002 The Regents of the University of Michigan. | ||
7 | * All rights reserved. | ||
8 | * | ||
9 | * Marius Aamodt Eriksen <marius@umich.edu> | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * | ||
15 | * 1. Redistributions of source code must retain the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer. | ||
17 | * 2. Redistributions in binary form must reproduce the above copyright | ||
18 | * notice, this list of conditions and the following disclaimer in the | ||
19 | * documentation and/or other materials provided with the distribution. | ||
20 | * 3. Neither the name of the University nor the names of its | ||
21 | * contributors may be used to endorse or promote products derived | ||
22 | * from this software without specific prior written permission. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef LINUX_NFS4_ACL_H | ||
38 | #define LINUX_NFS4_ACL_H | ||
39 | |||
40 | #include <linux/posix_acl.h> | ||
41 | |||
42 | /* Maximum ACL we'll accept from client; chosen (somewhat arbitrarily) to | ||
43 | * fit in a page: */ | ||
44 | #define NFS4_ACL_MAX 170 | ||
45 | |||
46 | struct nfs4_acl *nfs4_acl_new(int); | ||
47 | int nfs4_acl_get_whotype(char *, u32); | ||
48 | int nfs4_acl_write_who(int who, char *p); | ||
49 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, | ||
50 | uid_t who, u32 mask); | ||
51 | |||
52 | #define NFS4_ACL_TYPE_DEFAULT 0x01 | ||
53 | #define NFS4_ACL_DIR 0x02 | ||
54 | #define NFS4_ACL_OWNER 0x04 | ||
55 | |||
56 | struct nfs4_acl *nfs4_acl_posix_to_nfsv4(struct posix_acl *, | ||
57 | struct posix_acl *, unsigned int flags); | ||
58 | int nfs4_acl_nfsv4_to_posix(struct nfs4_acl *, struct posix_acl **, | ||
59 | struct posix_acl **, unsigned int flags); | ||
60 | |||
61 | #endif /* LINUX_NFS4_ACL_H */ | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 29d504d5d1c3..6023efa9f5d9 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -215,7 +215,6 @@ struct nfs_inode { | |||
215 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ | 215 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ |
216 | #define NFS_INO_STALE (1) /* possible stale inode */ | 216 | #define NFS_INO_STALE (1) /* possible stale inode */ |
217 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ | 217 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ |
218 | #define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */ | ||
219 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ | 218 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ |
220 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ | 219 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ |
221 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ | 220 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ |
@@ -351,7 +350,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | |||
351 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | 350 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); |
352 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); | 351 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); |
353 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 352 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
354 | extern int nfs_permission(struct inode *, int); | 353 | extern int nfs_permission(struct inode *, int, unsigned int); |
355 | extern int nfs_open(struct inode *, struct file *); | 354 | extern int nfs_open(struct inode *, struct file *); |
356 | extern int nfs_release(struct inode *, struct file *); | 355 | extern int nfs_release(struct inode *, struct file *); |
357 | extern int nfs_attribute_timeout(struct inode *inode); | 356 | extern int nfs_attribute_timeout(struct inode *inode); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 452d96436d26..b197563913bf 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 80f07198a31a..b0068579bec2 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/nfsacl.h b/include/linux/nfsacl.h index f321b578edeb..fabcb1e5c460 100644 --- a/include/linux/nfsacl.h +++ b/include/linux/nfsacl.h | |||
@@ -51,10 +51,10 @@ nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default) | |||
51 | return w; | 51 | return w; |
52 | } | 52 | } |
53 | 53 | ||
54 | extern unsigned int | 54 | extern int |
55 | nfsacl_encode(struct xdr_buf *buf, unsigned int base, struct inode *inode, | 55 | nfsacl_encode(struct xdr_buf *buf, unsigned int base, struct inode *inode, |
56 | struct posix_acl *acl, int encode_entries, int typeflag); | 56 | struct posix_acl *acl, int encode_entries, int typeflag); |
57 | extern unsigned int | 57 | extern int |
58 | nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt, | 58 | nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt, |
59 | struct posix_acl **pacl); | 59 | struct posix_acl **pacl); |
60 | 60 | ||
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 8ae78a61eea4..bd316159278c 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define NFSEXP_NOHIDE 0x0200 | 35 | #define NFSEXP_NOHIDE 0x0200 |
36 | #define NFSEXP_NOSUBTREECHECK 0x0400 | 36 | #define NFSEXP_NOSUBTREECHECK 0x0400 |
37 | #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */ | 37 | #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */ |
38 | #define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */ | 38 | #define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect; no longer supported */ |
39 | #define NFSEXP_FSID 0x2000 | 39 | #define NFSEXP_FSID 0x2000 |
40 | #define NFSEXP_CROSSMOUNT 0x4000 | 40 | #define NFSEXP_CROSSMOUNT 0x4000 |
41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
diff --git a/include/linux/nfsd_idmap.h b/include/linux/nfsd_idmap.h deleted file mode 100644 index d4a2ac18bd4c..000000000000 --- a/include/linux/nfsd_idmap.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd_idmap.h | ||
3 | * | ||
4 | * Mapping of UID to name and vice versa. | ||
5 | * | ||
6 | * Copyright (c) 2002, 2003 The Regents of the University of | ||
7 | * Michigan. All rights reserved. | ||
8 | > * | ||
9 | * Marius Aamodt Eriksen <marius@umich.edu> | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * | ||
15 | * 1. Redistributions of source code must retain the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer. | ||
17 | * 2. Redistributions in binary form must reproduce the above copyright | ||
18 | * notice, this list of conditions and the following disclaimer in the | ||
19 | * documentation and/or other materials provided with the distribution. | ||
20 | * 3. Neither the name of the University nor the names of its | ||
21 | * contributors may be used to endorse or promote products derived | ||
22 | * from this software without specific prior written permission. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef LINUX_NFSD_IDMAP_H | ||
38 | #define LINUX_NFSD_IDMAP_H | ||
39 | |||
40 | #include <linux/in.h> | ||
41 | #include <linux/sunrpc/svc.h> | ||
42 | |||
43 | /* XXX from linux/nfs_idmap.h */ | ||
44 | #define IDMAP_NAMESZ 128 | ||
45 | |||
46 | #ifdef CONFIG_NFSD_V4 | ||
47 | int nfsd_idmap_init(void); | ||
48 | void nfsd_idmap_shutdown(void); | ||
49 | #else | ||
50 | static inline int nfsd_idmap_init(void) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | static inline void nfsd_idmap_shutdown(void) | ||
55 | { | ||
56 | } | ||
57 | #endif | ||
58 | |||
59 | int nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, __u32 *); | ||
60 | int nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, __u32 *); | ||
61 | int nfsd_map_uid_to_name(struct svc_rqst *, __u32, char *); | ||
62 | int nfsd_map_gid_to_name(struct svc_rqst *, __u32, char *); | ||
63 | |||
64 | #endif /* LINUX_NFSD_IDMAP_H */ | ||
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 0edb2566c14c..821ffb954f14 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -148,6 +148,10 @@ | |||
148 | * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to | 148 | * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to |
149 | * destination %NL80211_ATTR_MAC on the interface identified by | 149 | * destination %NL80211_ATTR_MAC on the interface identified by |
150 | * %NL80211_ATTR_IFINDEX. | 150 | * %NL80211_ATTR_IFINDEX. |
151 | * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by | ||
152 | * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. | ||
153 | * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by | ||
154 | * %NL80211_ATTR_MAC. | ||
151 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the | 155 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the |
152 | * the interface identified by %NL80211_ATTR_IFINDEX. | 156 | * the interface identified by %NL80211_ATTR_IFINDEX. |
153 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC | 157 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC |
@@ -172,10 +176,10 @@ | |||
172 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will | 176 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will |
173 | * store this as a valid request and then query userspace for it. | 177 | * store this as a valid request and then query userspace for it. |
174 | * | 178 | * |
175 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | 179 | * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the |
176 | * interface identified by %NL80211_ATTR_IFINDEX | 180 | * interface identified by %NL80211_ATTR_IFINDEX |
177 | * | 181 | * |
178 | * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the | 182 | * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the |
179 | * interface identified by %NL80211_ATTR_IFINDEX | 183 | * interface identified by %NL80211_ATTR_IFINDEX |
180 | * | 184 | * |
181 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The | 185 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The |
@@ -358,11 +362,16 @@ | |||
358 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 362 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
359 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 363 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and |
360 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 364 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on |
361 | * which channel the frame is to be transmitted or was received. This | 365 | * which channel the frame is to be transmitted or was received. If this |
362 | * channel has to be the current channel (remain-on-channel or the | 366 | * channel is not the current channel (remain-on-channel or the |
363 | * operational channel). When called, this operation returns a cookie | 367 | * operational channel) the device will switch to the given channel and |
364 | * (%NL80211_ATTR_COOKIE) that will be included with the TX status event | 368 | * transmit the frame, optionally waiting for a response for the time |
365 | * pertaining to the TX request. | 369 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
370 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | ||
371 | * TX status event pertaining to the TX request. | ||
372 | * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this | ||
373 | * command may be used with the corresponding cookie to cancel the wait | ||
374 | * time if it is known that it is no longer necessary. | ||
366 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. | 375 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. |
367 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame | 376 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame |
368 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies | 377 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies |
@@ -389,6 +398,18 @@ | |||
389 | * | 398 | * |
390 | * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. | 399 | * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. |
391 | * | 400 | * |
401 | * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial | ||
402 | * mesh config parameters may be given. | ||
403 | * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the | ||
404 | * network is determined by the network interface. | ||
405 | * | ||
406 | * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame | ||
407 | * notification. This event is used to indicate that an unprotected | ||
408 | * deauthentication frame was dropped when MFP is in use. | ||
409 | * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame | ||
410 | * notification. This event is used to indicate that an unprotected | ||
411 | * disassociation frame was dropped when MFP is in use. | ||
412 | * | ||
392 | * @NL80211_CMD_MAX: highest used command number | 413 | * @NL80211_CMD_MAX: highest used command number |
393 | * @__NL80211_CMD_AFTER_LAST: internal use | 414 | * @__NL80211_CMD_AFTER_LAST: internal use |
394 | */ | 415 | */ |
@@ -431,8 +452,8 @@ enum nl80211_commands { | |||
431 | NL80211_CMD_SET_REG, | 452 | NL80211_CMD_SET_REG, |
432 | NL80211_CMD_REQ_SET_REG, | 453 | NL80211_CMD_REQ_SET_REG, |
433 | 454 | ||
434 | NL80211_CMD_GET_MESH_PARAMS, | 455 | NL80211_CMD_GET_MESH_CONFIG, |
435 | NL80211_CMD_SET_MESH_PARAMS, | 456 | NL80211_CMD_SET_MESH_CONFIG, |
436 | 457 | ||
437 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, | 458 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, |
438 | 459 | ||
@@ -493,6 +514,14 @@ enum nl80211_commands { | |||
493 | NL80211_CMD_SET_CHANNEL, | 514 | NL80211_CMD_SET_CHANNEL, |
494 | NL80211_CMD_SET_WDS_PEER, | 515 | NL80211_CMD_SET_WDS_PEER, |
495 | 516 | ||
517 | NL80211_CMD_FRAME_WAIT_CANCEL, | ||
518 | |||
519 | NL80211_CMD_JOIN_MESH, | ||
520 | NL80211_CMD_LEAVE_MESH, | ||
521 | |||
522 | NL80211_CMD_UNPROT_DEAUTHENTICATE, | ||
523 | NL80211_CMD_UNPROT_DISASSOCIATE, | ||
524 | |||
496 | /* add new commands above here */ | 525 | /* add new commands above here */ |
497 | 526 | ||
498 | /* used to define NL80211_CMD_MAX below */ | 527 | /* used to define NL80211_CMD_MAX below */ |
@@ -513,6 +542,10 @@ enum nl80211_commands { | |||
513 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE | 542 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE |
514 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT | 543 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT |
515 | 544 | ||
545 | /* source-level API compatibility */ | ||
546 | #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG | ||
547 | #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG | ||
548 | |||
516 | /** | 549 | /** |
517 | * enum nl80211_attrs - nl80211 netlink attributes | 550 | * enum nl80211_attrs - nl80211 netlink attributes |
518 | * | 551 | * |
@@ -583,7 +616,7 @@ enum nl80211_commands { | |||
583 | * consisting of a nested array. | 616 | * consisting of a nested array. |
584 | * | 617 | * |
585 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). | 618 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). |
586 | * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. | 619 | * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. |
587 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. | 620 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. |
588 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path | 621 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path |
589 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at | 622 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at |
@@ -758,6 +791,9 @@ enum nl80211_commands { | |||
758 | * cache, a wiphy attribute. | 791 | * cache, a wiphy attribute. |
759 | * | 792 | * |
760 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. | 793 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. |
794 | * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that | ||
795 | * specifies the maximum duration that can be requested with the | ||
796 | * remain-on-channel operation, in milliseconds, u32. | ||
761 | * | 797 | * |
762 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. | 798 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. |
763 | * | 799 | * |
@@ -804,6 +840,53 @@ enum nl80211_commands { | |||
804 | * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly | 840 | * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly |
805 | * means support for per-station GTKs. | 841 | * means support for per-station GTKs. |
806 | * | 842 | * |
843 | * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. | ||
844 | * This can be used to mask out antennas which are not attached or should | ||
845 | * not be used for transmitting. If an antenna is not selected in this | ||
846 | * bitmap the hardware is not allowed to transmit on this antenna. | ||
847 | * | ||
848 | * Each bit represents one antenna, starting with antenna 1 at the first | ||
849 | * bit. Depending on which antennas are selected in the bitmap, 802.11n | ||
850 | * drivers can derive which chainmasks to use (if all antennas belonging to | ||
851 | * a particular chain are disabled this chain should be disabled) and if | ||
852 | * a chain has diversity antennas wether diversity should be used or not. | ||
853 | * HT capabilities (STBC, TX Beamforming, Antenna selection) can be | ||
854 | * derived from the available chains after applying the antenna mask. | ||
855 | * Non-802.11n drivers can derive wether to use diversity or not. | ||
856 | * Drivers may reject configurations or RX/TX mask combinations they cannot | ||
857 | * support by returning -EINVAL. | ||
858 | * | ||
859 | * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. | ||
860 | * This can be used to mask out antennas which are not attached or should | ||
861 | * not be used for receiving. If an antenna is not selected in this bitmap | ||
862 | * the hardware should not be configured to receive on this antenna. | ||
863 | * For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. | ||
864 | * | ||
865 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available | ||
866 | * for configuration as TX antennas via the above parameters. | ||
867 | * | ||
868 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available | ||
869 | * for configuration as RX antennas via the above parameters. | ||
870 | * | ||
871 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS | ||
872 | * | ||
873 | * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be | ||
874 | * transmitted on another channel when the channel given doesn't match | ||
875 | * the current channel. If the current channel doesn't match and this | ||
876 | * flag isn't set, the frame will be rejected. This is also used as an | ||
877 | * nl80211 capability flag. | ||
878 | * | ||
879 | * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) | ||
880 | * | ||
881 | * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags | ||
882 | * attributes, specifying what a key should be set as default as. | ||
883 | * See &enum nl80211_key_default_types. | ||
884 | * | ||
885 | * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be | ||
886 | * changed once the mesh is active. | ||
887 | * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute | ||
888 | * containing attributes from &enum nl80211_meshconf_params. | ||
889 | * | ||
807 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 890 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
808 | * @__NL80211_ATTR_AFTER_LAST: internal use | 891 | * @__NL80211_ATTR_AFTER_LAST: internal use |
809 | */ | 892 | */ |
@@ -858,7 +941,7 @@ enum nl80211_attrs { | |||
858 | NL80211_ATTR_REG_ALPHA2, | 941 | NL80211_ATTR_REG_ALPHA2, |
859 | NL80211_ATTR_REG_RULES, | 942 | NL80211_ATTR_REG_RULES, |
860 | 943 | ||
861 | NL80211_ATTR_MESH_PARAMS, | 944 | NL80211_ATTR_MESH_CONFIG, |
862 | 945 | ||
863 | NL80211_ATTR_BSS_BASIC_RATES, | 946 | NL80211_ATTR_BSS_BASIC_RATES, |
864 | 947 | ||
@@ -973,6 +1056,24 @@ enum nl80211_attrs { | |||
973 | 1056 | ||
974 | NL80211_ATTR_SUPPORT_IBSS_RSN, | 1057 | NL80211_ATTR_SUPPORT_IBSS_RSN, |
975 | 1058 | ||
1059 | NL80211_ATTR_WIPHY_ANTENNA_TX, | ||
1060 | NL80211_ATTR_WIPHY_ANTENNA_RX, | ||
1061 | |||
1062 | NL80211_ATTR_MCAST_RATE, | ||
1063 | |||
1064 | NL80211_ATTR_OFFCHANNEL_TX_OK, | ||
1065 | |||
1066 | NL80211_ATTR_BSS_HT_OPMODE, | ||
1067 | |||
1068 | NL80211_ATTR_KEY_DEFAULT_TYPES, | ||
1069 | |||
1070 | NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, | ||
1071 | |||
1072 | NL80211_ATTR_MESH_SETUP, | ||
1073 | |||
1074 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, | ||
1075 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, | ||
1076 | |||
976 | /* add attributes here, update the policy in nl80211.c */ | 1077 | /* add attributes here, update the policy in nl80211.c */ |
977 | 1078 | ||
978 | __NL80211_ATTR_AFTER_LAST, | 1079 | __NL80211_ATTR_AFTER_LAST, |
@@ -981,6 +1082,7 @@ enum nl80211_attrs { | |||
981 | 1082 | ||
982 | /* source-level API compatibility */ | 1083 | /* source-level API compatibility */ |
983 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | 1084 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION |
1085 | #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG | ||
984 | 1086 | ||
985 | /* | 1087 | /* |
986 | * Allow user space programs to use #ifdef on new attributes by defining them | 1088 | * Allow user space programs to use #ifdef on new attributes by defining them |
@@ -1129,8 +1231,6 @@ enum nl80211_rate_info { | |||
1129 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) | 1231 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) |
1130 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) | 1232 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) |
1131 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 1233 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
1132 | * @__NL80211_STA_INFO_AFTER_LAST: internal | ||
1133 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | ||
1134 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | 1234 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) |
1135 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | 1235 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute |
1136 | * containing info as possible, see &enum nl80211_sta_info_txrate. | 1236 | * containing info as possible, see &enum nl80211_sta_info_txrate. |
@@ -1139,6 +1239,12 @@ enum nl80211_rate_info { | |||
1139 | * station) | 1239 | * station) |
1140 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | 1240 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) |
1141 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | 1241 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) |
1242 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) | ||
1243 | * @NL80211_STA_INFO_LLID: the station's mesh LLID | ||
1244 | * @NL80211_STA_INFO_PLID: the station's mesh PLID | ||
1245 | * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station | ||
1246 | * @__NL80211_STA_INFO_AFTER_LAST: internal | ||
1247 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | ||
1142 | */ | 1248 | */ |
1143 | enum nl80211_sta_info { | 1249 | enum nl80211_sta_info { |
1144 | __NL80211_STA_INFO_INVALID, | 1250 | __NL80211_STA_INFO_INVALID, |
@@ -1154,6 +1260,7 @@ enum nl80211_sta_info { | |||
1154 | NL80211_STA_INFO_TX_PACKETS, | 1260 | NL80211_STA_INFO_TX_PACKETS, |
1155 | NL80211_STA_INFO_TX_RETRIES, | 1261 | NL80211_STA_INFO_TX_RETRIES, |
1156 | NL80211_STA_INFO_TX_FAILED, | 1262 | NL80211_STA_INFO_TX_FAILED, |
1263 | NL80211_STA_INFO_SIGNAL_AVG, | ||
1157 | 1264 | ||
1158 | /* keep last */ | 1265 | /* keep last */ |
1159 | __NL80211_STA_INFO_AFTER_LAST, | 1266 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -1307,7 +1414,11 @@ enum nl80211_bitrate_attr { | |||
1307 | * wireless core it thinks its knows the regulatory domain we should be in. | 1414 | * wireless core it thinks its knows the regulatory domain we should be in. |
1308 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an | 1415 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an |
1309 | * 802.11 country information element with regulatory information it | 1416 | * 802.11 country information element with regulatory information it |
1310 | * thinks we should consider. | 1417 | * thinks we should consider. cfg80211 only processes the country |
1418 | * code from the IE, and relies on the regulatory domain information | ||
1419 | * structure pased by userspace (CRDA) from our wireless-regdb. | ||
1420 | * If a channel is enabled but the country code indicates it should | ||
1421 | * be disabled we disable the channel and re-enable it upon disassociation. | ||
1311 | */ | 1422 | */ |
1312 | enum nl80211_reg_initiator { | 1423 | enum nl80211_reg_initiator { |
1313 | NL80211_REGDOM_SET_BY_CORE, | 1424 | NL80211_REGDOM_SET_BY_CORE, |
@@ -1476,7 +1587,8 @@ enum nl80211_mntr_flags { | |||
1476 | /** | 1587 | /** |
1477 | * enum nl80211_meshconf_params - mesh configuration parameters | 1588 | * enum nl80211_meshconf_params - mesh configuration parameters |
1478 | * | 1589 | * |
1479 | * Mesh configuration parameters | 1590 | * Mesh configuration parameters. These can be changed while the mesh is |
1591 | * active. | ||
1480 | * | 1592 | * |
1481 | * @__NL80211_MESHCONF_INVALID: internal use | 1593 | * @__NL80211_MESHCONF_INVALID: internal use |
1482 | * | 1594 | * |
@@ -1523,7 +1635,10 @@ enum nl80211_mntr_flags { | |||
1523 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | 1635 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) |
1524 | * that it takes for an HWMP information element to propagate across the mesh | 1636 | * that it takes for an HWMP information element to propagate across the mesh |
1525 | * | 1637 | * |
1526 | * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not | 1638 | * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not |
1639 | * | ||
1640 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a | ||
1641 | * source mesh point for path selection elements. | ||
1527 | * | 1642 | * |
1528 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | 1643 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute |
1529 | * | 1644 | * |
@@ -1545,6 +1660,7 @@ enum nl80211_meshconf_params { | |||
1545 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, | 1660 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, |
1546 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | 1661 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, |
1547 | NL80211_MESHCONF_HWMP_ROOTMODE, | 1662 | NL80211_MESHCONF_HWMP_ROOTMODE, |
1663 | NL80211_MESHCONF_ELEMENT_TTL, | ||
1548 | 1664 | ||
1549 | /* keep last */ | 1665 | /* keep last */ |
1550 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 1666 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
@@ -1552,6 +1668,40 @@ enum nl80211_meshconf_params { | |||
1552 | }; | 1668 | }; |
1553 | 1669 | ||
1554 | /** | 1670 | /** |
1671 | * enum nl80211_mesh_setup_params - mesh setup parameters | ||
1672 | * | ||
1673 | * Mesh setup parameters. These are used to start/join a mesh and cannot be | ||
1674 | * changed while the mesh is active. | ||
1675 | * | ||
1676 | * @__NL80211_MESH_SETUP_INVALID: Internal use | ||
1677 | * | ||
1678 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a | ||
1679 | * vendor specific path selection algorithm or disable it to use the default | ||
1680 | * HWMP. | ||
1681 | * | ||
1682 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a | ||
1683 | * vendor specific path metric or disable it to use the default Airtime | ||
1684 | * metric. | ||
1685 | * | ||
1686 | * @NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE: A vendor specific information | ||
1687 | * element that vendors will use to identify the path selection methods and | ||
1688 | * metrics in use. | ||
1689 | * | ||
1690 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number | ||
1691 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use | ||
1692 | */ | ||
1693 | enum nl80211_mesh_setup_params { | ||
1694 | __NL80211_MESH_SETUP_INVALID, | ||
1695 | NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, | ||
1696 | NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, | ||
1697 | NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE, | ||
1698 | |||
1699 | /* keep last */ | ||
1700 | __NL80211_MESH_SETUP_ATTR_AFTER_LAST, | ||
1701 | NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1 | ||
1702 | }; | ||
1703 | |||
1704 | /** | ||
1555 | * enum nl80211_txq_attr - TX queue parameter attributes | 1705 | * enum nl80211_txq_attr - TX queue parameter attributes |
1556 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved | 1706 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved |
1557 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) | 1707 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) |
@@ -1709,6 +1859,23 @@ enum nl80211_wpa_versions { | |||
1709 | }; | 1859 | }; |
1710 | 1860 | ||
1711 | /** | 1861 | /** |
1862 | * enum nl80211_key_default_types - key default types | ||
1863 | * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid | ||
1864 | * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default | ||
1865 | * unicast key | ||
1866 | * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default | ||
1867 | * multicast key | ||
1868 | * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types | ||
1869 | */ | ||
1870 | enum nl80211_key_default_types { | ||
1871 | __NL80211_KEY_DEFAULT_TYPE_INVALID, | ||
1872 | NL80211_KEY_DEFAULT_TYPE_UNICAST, | ||
1873 | NL80211_KEY_DEFAULT_TYPE_MULTICAST, | ||
1874 | |||
1875 | NUM_NL80211_KEY_DEFAULT_TYPES | ||
1876 | }; | ||
1877 | |||
1878 | /** | ||
1712 | * enum nl80211_key_attributes - key attributes | 1879 | * enum nl80211_key_attributes - key attributes |
1713 | * @__NL80211_KEY_INVALID: invalid | 1880 | * @__NL80211_KEY_INVALID: invalid |
1714 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of | 1881 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of |
@@ -1724,6 +1891,9 @@ enum nl80211_wpa_versions { | |||
1724 | * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not | 1891 | * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not |
1725 | * specified the default depends on whether a MAC address was | 1892 | * specified the default depends on whether a MAC address was |
1726 | * given with the command using the key or not (u32) | 1893 | * given with the command using the key or not (u32) |
1894 | * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags | ||
1895 | * attributes, specifying what a key should be set as default as. | ||
1896 | * See &enum nl80211_key_default_types. | ||
1727 | * @__NL80211_KEY_AFTER_LAST: internal | 1897 | * @__NL80211_KEY_AFTER_LAST: internal |
1728 | * @NL80211_KEY_MAX: highest key attribute | 1898 | * @NL80211_KEY_MAX: highest key attribute |
1729 | */ | 1899 | */ |
@@ -1736,6 +1906,7 @@ enum nl80211_key_attributes { | |||
1736 | NL80211_KEY_DEFAULT, | 1906 | NL80211_KEY_DEFAULT, |
1737 | NL80211_KEY_DEFAULT_MGMT, | 1907 | NL80211_KEY_DEFAULT_MGMT, |
1738 | NL80211_KEY_TYPE, | 1908 | NL80211_KEY_TYPE, |
1909 | NL80211_KEY_DEFAULT_TYPES, | ||
1739 | 1910 | ||
1740 | /* keep last */ | 1911 | /* keep last */ |
1741 | __NL80211_KEY_AFTER_LAST, | 1912 | __NL80211_KEY_AFTER_LAST, |
@@ -1786,6 +1957,8 @@ enum nl80211_ps_state { | |||
1786 | * the minimum amount the RSSI level must change after an event before a | 1957 | * the minimum amount the RSSI level must change after an event before a |
1787 | * new event may be issued (to reduce effects of RSSI oscillation). | 1958 | * new event may be issued (to reduce effects of RSSI oscillation). |
1788 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event | 1959 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event |
1960 | * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many | ||
1961 | * consecutive packets were not acknowledged by the peer | ||
1789 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal | 1962 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal |
1790 | * @NL80211_ATTR_CQM_MAX: highest key attribute | 1963 | * @NL80211_ATTR_CQM_MAX: highest key attribute |
1791 | */ | 1964 | */ |
@@ -1794,6 +1967,7 @@ enum nl80211_attr_cqm { | |||
1794 | NL80211_ATTR_CQM_RSSI_THOLD, | 1967 | NL80211_ATTR_CQM_RSSI_THOLD, |
1795 | NL80211_ATTR_CQM_RSSI_HYST, | 1968 | NL80211_ATTR_CQM_RSSI_HYST, |
1796 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, | 1969 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, |
1970 | NL80211_ATTR_CQM_PKT_LOSS_EVENT, | ||
1797 | 1971 | ||
1798 | /* keep last */ | 1972 | /* keep last */ |
1799 | __NL80211_ATTR_CQM_AFTER_LAST, | 1973 | __NL80211_ATTR_CQM_AFTER_LAST, |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 06aab5eee134..c536f8545f74 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -14,22 +14,14 @@ | |||
14 | * may be used to reset the timeout - for code which intentionally | 14 | * may be used to reset the timeout - for code which intentionally |
15 | * disables interrupts for a long time. This call is stateless. | 15 | * disables interrupts for a long time. This call is stateless. |
16 | */ | 16 | */ |
17 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #if defined(ARCH_HAS_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) |
18 | #include <asm/nmi.h> | 18 | #include <asm/nmi.h> |
19 | extern void touch_nmi_watchdog(void); | 19 | extern void touch_nmi_watchdog(void); |
20 | extern void acpi_nmi_disable(void); | ||
21 | extern void acpi_nmi_enable(void); | ||
22 | #else | 20 | #else |
23 | #ifndef CONFIG_HARDLOCKUP_DETECTOR | ||
24 | static inline void touch_nmi_watchdog(void) | 21 | static inline void touch_nmi_watchdog(void) |
25 | { | 22 | { |
26 | touch_softlockup_watchdog(); | 23 | touch_softlockup_watchdog(); |
27 | } | 24 | } |
28 | #else | ||
29 | extern void touch_nmi_watchdog(void); | ||
30 | #endif | ||
31 | static inline void acpi_nmi_disable(void) { } | ||
32 | static inline void acpi_nmi_enable(void) { } | ||
33 | #endif | 25 | #endif |
34 | 26 | ||
35 | /* | 27 | /* |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 8aea06f0564c..2feda6ee6140 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 7bbf5b328438..c84d900fbbb3 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 000000000000..e913081fb52a --- /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/oprofile.h b/include/linux/oprofile.h index 32fb81212fd1..1ca64113efe8 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/errno.h> | ||
20 | #include <linux/printk.h> | ||
19 | #include <asm/atomic.h> | 21 | #include <asm/atomic.h> |
20 | 22 | ||
21 | /* Each escaped entry is prefixed by ESCAPE_CODE | 23 | /* Each escaped entry is prefixed by ESCAPE_CODE |
@@ -186,10 +188,17 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val); | |||
186 | int oprofile_add_data64(struct op_entry *entry, u64 val); | 188 | int oprofile_add_data64(struct op_entry *entry, u64 val); |
187 | int oprofile_write_commit(struct op_entry *entry); | 189 | int oprofile_write_commit(struct op_entry *entry); |
188 | 190 | ||
189 | #ifdef CONFIG_PERF_EVENTS | 191 | #ifdef CONFIG_HW_PERF_EVENTS |
190 | int __init oprofile_perf_init(struct oprofile_operations *ops); | 192 | int __init oprofile_perf_init(struct oprofile_operations *ops); |
191 | void oprofile_perf_exit(void); | 193 | void oprofile_perf_exit(void); |
192 | char *op_name_from_perf_id(void); | 194 | char *op_name_from_perf_id(void); |
193 | #endif /* CONFIG_PERF_EVENTS */ | 195 | #else |
196 | static inline int __init oprofile_perf_init(struct oprofile_operations *ops) | ||
197 | { | ||
198 | pr_info("oprofile: hardware counters not available\n"); | ||
199 | return -ENODEV; | ||
200 | } | ||
201 | static inline void oprofile_perf_exit(void) { } | ||
202 | #endif /* CONFIG_HW_PERF_EVENTS */ | ||
194 | 203 | ||
195 | #endif /* OPROFILE_H */ | 204 | #endif /* OPROFILE_H */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5f38c460367e..0db8037e2725 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -48,9 +48,6 @@ | |||
48 | * struct page (these bits with information) are always mapped into kernel | 48 | * struct page (these bits with information) are always mapped into kernel |
49 | * address space... | 49 | * address space... |
50 | * | 50 | * |
51 | * PG_buddy is set to indicate that the page is free and in the buddy system | ||
52 | * (see mm/page_alloc.c). | ||
53 | * | ||
54 | * PG_hwpoison indicates that a page got corrupted in hardware and contains | 51 | * PG_hwpoison indicates that a page got corrupted in hardware and contains |
55 | * data with incorrect ECC bits that triggered a machine check. Accessing is | 52 | * data with incorrect ECC bits that triggered a machine check. Accessing is |
56 | * not safe since it may cause another machine check. Don't touch! | 53 | * not safe since it may cause another machine check. Don't touch! |
@@ -96,7 +93,6 @@ enum pageflags { | |||
96 | PG_swapcache, /* Swap page: swp_entry_t in private */ | 93 | PG_swapcache, /* Swap page: swp_entry_t in private */ |
97 | PG_mappedtodisk, /* Has blocks allocated on-disk */ | 94 | PG_mappedtodisk, /* Has blocks allocated on-disk */ |
98 | PG_reclaim, /* To be reclaimed asap */ | 95 | PG_reclaim, /* To be reclaimed asap */ |
99 | PG_buddy, /* Page is free, on buddy lists */ | ||
100 | PG_swapbacked, /* Page is backed by RAM/swap */ | 96 | PG_swapbacked, /* Page is backed by RAM/swap */ |
101 | PG_unevictable, /* Page is "unevictable" */ | 97 | PG_unevictable, /* Page is "unevictable" */ |
102 | #ifdef CONFIG_MMU | 98 | #ifdef CONFIG_MMU |
@@ -108,6 +104,9 @@ enum pageflags { | |||
108 | #ifdef CONFIG_MEMORY_FAILURE | 104 | #ifdef CONFIG_MEMORY_FAILURE |
109 | PG_hwpoison, /* hardware poisoned page. Don't touch */ | 105 | PG_hwpoison, /* hardware poisoned page. Don't touch */ |
110 | #endif | 106 | #endif |
107 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
108 | PG_compound_lock, | ||
109 | #endif | ||
111 | __NR_PAGEFLAGS, | 110 | __NR_PAGEFLAGS, |
112 | 111 | ||
113 | /* Filesystems */ | 112 | /* Filesystems */ |
@@ -198,7 +197,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; } | |||
198 | struct page; /* forward declaration */ | 197 | struct page; /* forward declaration */ |
199 | 198 | ||
200 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 199 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
201 | PAGEFLAG(Error, error) | 200 | PAGEFLAG(Error, error) TESTCLEARFLAG(Error, error) |
202 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | 201 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) |
203 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 202 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) |
204 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 203 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |
@@ -230,7 +229,6 @@ PAGEFLAG(OwnerPriv1, owner_priv_1) TESTCLEARFLAG(OwnerPriv1, owner_priv_1) | |||
230 | * risky: they bypass page accounting. | 229 | * risky: they bypass page accounting. |
231 | */ | 230 | */ |
232 | TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback) | 231 | TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback) |
233 | __PAGEFLAG(Buddy, buddy) | ||
234 | PAGEFLAG(MappedToDisk, mappedtodisk) | 232 | PAGEFLAG(MappedToDisk, mappedtodisk) |
235 | 233 | ||
236 | /* PG_readahead is only used for file reads; PG_reclaim is only for writes */ | 234 | /* PG_readahead is only used for file reads; PG_reclaim is only for writes */ |
@@ -344,7 +342,7 @@ static inline void set_page_writeback(struct page *page) | |||
344 | * tests can be used in performance sensitive paths. PageCompound is | 342 | * tests can be used in performance sensitive paths. PageCompound is |
345 | * generally not used in hot code paths. | 343 | * generally not used in hot code paths. |
346 | */ | 344 | */ |
347 | __PAGEFLAG(Head, head) | 345 | __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) |
348 | __PAGEFLAG(Tail, tail) | 346 | __PAGEFLAG(Tail, tail) |
349 | 347 | ||
350 | static inline int PageCompound(struct page *page) | 348 | static inline int PageCompound(struct page *page) |
@@ -352,6 +350,13 @@ static inline int PageCompound(struct page *page) | |||
352 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); | 350 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); |
353 | 351 | ||
354 | } | 352 | } |
353 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
354 | static inline void ClearPageCompound(struct page *page) | ||
355 | { | ||
356 | BUG_ON(!PageHead(page)); | ||
357 | ClearPageHead(page); | ||
358 | } | ||
359 | #endif | ||
355 | #else | 360 | #else |
356 | /* | 361 | /* |
357 | * Reduce page flag use as much as possible by overlapping | 362 | * Reduce page flag use as much as possible by overlapping |
@@ -389,14 +394,61 @@ static inline void __ClearPageTail(struct page *page) | |||
389 | page->flags &= ~PG_head_tail_mask; | 394 | page->flags &= ~PG_head_tail_mask; |
390 | } | 395 | } |
391 | 396 | ||
397 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
398 | static inline void ClearPageCompound(struct page *page) | ||
399 | { | ||
400 | BUG_ON((page->flags & PG_head_tail_mask) != (1 << PG_compound)); | ||
401 | clear_bit(PG_compound, &page->flags); | ||
402 | } | ||
403 | #endif | ||
404 | |||
392 | #endif /* !PAGEFLAGS_EXTENDED */ | 405 | #endif /* !PAGEFLAGS_EXTENDED */ |
393 | 406 | ||
407 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
408 | /* | ||
409 | * PageHuge() only returns true for hugetlbfs pages, but not for | ||
410 | * normal or transparent huge pages. | ||
411 | * | ||
412 | * PageTransHuge() returns true for both transparent huge and | ||
413 | * hugetlbfs pages, but not normal pages. PageTransHuge() can only be | ||
414 | * called only in the core VM paths where hugetlbfs pages can't exist. | ||
415 | */ | ||
416 | static inline int PageTransHuge(struct page *page) | ||
417 | { | ||
418 | VM_BUG_ON(PageTail(page)); | ||
419 | return PageHead(page); | ||
420 | } | ||
421 | |||
422 | static inline int PageTransCompound(struct page *page) | ||
423 | { | ||
424 | return PageCompound(page); | ||
425 | } | ||
426 | |||
427 | #else | ||
428 | |||
429 | static inline int PageTransHuge(struct page *page) | ||
430 | { | ||
431 | return 0; | ||
432 | } | ||
433 | |||
434 | static inline int PageTransCompound(struct page *page) | ||
435 | { | ||
436 | return 0; | ||
437 | } | ||
438 | #endif | ||
439 | |||
394 | #ifdef CONFIG_MMU | 440 | #ifdef CONFIG_MMU |
395 | #define __PG_MLOCKED (1 << PG_mlocked) | 441 | #define __PG_MLOCKED (1 << PG_mlocked) |
396 | #else | 442 | #else |
397 | #define __PG_MLOCKED 0 | 443 | #define __PG_MLOCKED 0 |
398 | #endif | 444 | #endif |
399 | 445 | ||
446 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
447 | #define __PG_COMPOUND_LOCK (1 << PG_compound_lock) | ||
448 | #else | ||
449 | #define __PG_COMPOUND_LOCK 0 | ||
450 | #endif | ||
451 | |||
400 | /* | 452 | /* |
401 | * Flags checked when a page is freed. Pages being freed should not have | 453 | * Flags checked when a page is freed. Pages being freed should not have |
402 | * these flags set. It they are, there is a problem. | 454 | * these flags set. It they are, there is a problem. |
@@ -404,9 +456,10 @@ static inline void __ClearPageTail(struct page *page) | |||
404 | #define PAGE_FLAGS_CHECK_AT_FREE \ | 456 | #define PAGE_FLAGS_CHECK_AT_FREE \ |
405 | (1 << PG_lru | 1 << PG_locked | \ | 457 | (1 << PG_lru | 1 << PG_locked | \ |
406 | 1 << PG_private | 1 << PG_private_2 | \ | 458 | 1 << PG_private | 1 << PG_private_2 | \ |
407 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 459 | 1 << PG_writeback | 1 << PG_reserved | \ |
408 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 460 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
409 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON) | 461 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON | \ |
462 | __PG_COMPOUND_LOCK) | ||
410 | 463 | ||
411 | /* | 464 | /* |
412 | * Flags checked when a page is prepped for return by the page allocator. | 465 | * Flags checked when a page is prepped for return by the page allocator. |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index b02195dfc1b0..6d6cb7a57bb3 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -35,12 +35,15 @@ struct page_cgroup *lookup_page_cgroup(struct page *page); | |||
35 | 35 | ||
36 | enum { | 36 | enum { |
37 | /* flags for mem_cgroup */ | 37 | /* flags for mem_cgroup */ |
38 | PCG_LOCK, /* page cgroup is locked */ | 38 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ |
39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | ||
42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
43 | PCG_MIGRATION, /* under page migration */ | 41 | PCG_MIGRATION, /* under page migration */ |
42 | /* flags for mem_cgroup and file and I/O status */ | ||
43 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | ||
44 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
45 | /* No lock in page_cgroup */ | ||
46 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
44 | }; | 47 | }; |
45 | 48 | ||
46 | #define TESTPCGFLAG(uname, lname) \ | 49 | #define TESTPCGFLAG(uname, lname) \ |
@@ -94,6 +97,10 @@ static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc) | |||
94 | 97 | ||
95 | static inline void lock_page_cgroup(struct page_cgroup *pc) | 98 | static inline void lock_page_cgroup(struct page_cgroup *pc) |
96 | { | 99 | { |
100 | /* | ||
101 | * Don't take this lock in IRQ context. | ||
102 | * This lock is for pc->mem_cgroup, USED, CACHE, MIGRATION | ||
103 | */ | ||
97 | bit_spin_lock(PCG_LOCK, &pc->flags); | 104 | bit_spin_lock(PCG_LOCK, &pc->flags); |
98 | } | 105 | } |
99 | 106 | ||
@@ -107,6 +114,24 @@ static inline int page_is_cgroup_locked(struct page_cgroup *pc) | |||
107 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); | 114 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); |
108 | } | 115 | } |
109 | 116 | ||
117 | static inline void move_lock_page_cgroup(struct page_cgroup *pc, | ||
118 | unsigned long *flags) | ||
119 | { | ||
120 | /* | ||
121 | * We know updates to pc->flags of page cache's stats are from both of | ||
122 | * usual context or IRQ context. Disable IRQ to avoid deadlock. | ||
123 | */ | ||
124 | local_irq_save(*flags); | ||
125 | bit_spin_lock(PCG_MOVE_LOCK, &pc->flags); | ||
126 | } | ||
127 | |||
128 | static inline void move_unlock_page_cgroup(struct page_cgroup *pc, | ||
129 | unsigned long *flags) | ||
130 | { | ||
131 | bit_spin_unlock(PCG_MOVE_LOCK, &pc->flags); | ||
132 | local_irq_restore(*flags); | ||
133 | } | ||
134 | |||
110 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 135 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
111 | struct page_cgroup; | 136 | struct page_cgroup; |
112 | 137 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 2d1ffe3cf1ee..9c66e994540f 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -48,7 +48,7 @@ static inline void mapping_clear_unevictable(struct address_space *mapping) | |||
48 | 48 | ||
49 | static inline int mapping_unevictable(struct address_space *mapping) | 49 | static inline int mapping_unevictable(struct address_space *mapping) |
50 | { | 50 | { |
51 | if (likely(mapping)) | 51 | if (mapping) |
52 | return test_bit(AS_UNEVICTABLE, &mapping->flags); | 52 | return test_bit(AS_UNEVICTABLE, &mapping->flags); |
53 | return !!mapping; | 53 | return !!mapping; |
54 | } | 54 | } |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index c8b6473c5f42..44623500f419 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -35,9 +35,12 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
35 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 35 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
36 | pbus->number); | 36 | pbus->number); |
37 | } | 37 | } |
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_ACPI_APEI | ||
41 | extern bool aer_acpi_firmware_first(void); | ||
38 | #else | 42 | #else |
39 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 43 | static inline bool aer_acpi_firmware_first(void) { return false; } |
40 | { return NULL; } | ||
41 | #endif | 44 | #endif |
42 | 45 | ||
43 | #endif /* _PCI_ACPI_H_ */ | 46 | #endif /* _PCI_ACPI_H_ */ |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 91ba0b338b47..ce6810512c66 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | |||
27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
30 | extern void pcie_clear_aspm(void); | ||
30 | extern void pcie_no_aspm(void); | 31 | extern void pcie_no_aspm(void); |
31 | #else | 32 | #else |
32 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 33 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
@@ -41,7 +42,9 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) | |||
41 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 42 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
42 | { | 43 | { |
43 | } | 44 | } |
44 | 45 | static inline void pcie_clear_aspm(void) | |
46 | { | ||
47 | } | ||
45 | static inline void pcie_no_aspm(void) | 48 | static inline void pcie_no_aspm(void) |
46 | { | 49 | { |
47 | } | 50 | } |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7454408c41b6..559d02897075 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -806,7 +806,7 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | |||
806 | 806 | ||
807 | /* Power management related routines */ | 807 | /* Power management related routines */ |
808 | int pci_save_state(struct pci_dev *dev); | 808 | int pci_save_state(struct pci_dev *dev); |
809 | int pci_restore_state(struct pci_dev *dev); | 809 | void pci_restore_state(struct pci_dev *dev); |
810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
@@ -820,7 +820,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev); | |||
820 | int pci_back_from_sleep(struct pci_dev *dev); | 820 | int pci_back_from_sleep(struct pci_dev *dev); |
821 | bool pci_dev_run_wake(struct pci_dev *dev); | 821 | bool pci_dev_run_wake(struct pci_dev *dev); |
822 | bool pci_check_pme_status(struct pci_dev *dev); | 822 | bool pci_check_pme_status(struct pci_dev *dev); |
823 | void pci_wakeup_event(struct pci_dev *dev); | ||
824 | void pci_pme_wakeup_bus(struct pci_bus *bus); | 823 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
825 | 824 | ||
826 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 825 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
@@ -994,6 +993,14 @@ extern void pci_restore_msi_state(struct pci_dev *dev); | |||
994 | extern int pci_msi_enabled(void); | 993 | extern int pci_msi_enabled(void); |
995 | #endif | 994 | #endif |
996 | 995 | ||
996 | #ifdef CONFIG_PCIEPORTBUS | ||
997 | extern bool pcie_ports_disabled; | ||
998 | extern bool pcie_ports_auto; | ||
999 | #else | ||
1000 | #define pcie_ports_disabled true | ||
1001 | #define pcie_ports_auto false | ||
1002 | #endif | ||
1003 | |||
997 | #ifndef CONFIG_PCIEASPM | 1004 | #ifndef CONFIG_PCIEASPM |
998 | static inline int pcie_aspm_enabled(void) | 1005 | static inline int pcie_aspm_enabled(void) |
999 | { | 1006 | { |
@@ -1003,6 +1010,14 @@ static inline int pcie_aspm_enabled(void) | |||
1003 | extern int pcie_aspm_enabled(void); | 1010 | extern int pcie_aspm_enabled(void); |
1004 | #endif | 1011 | #endif |
1005 | 1012 | ||
1013 | #ifdef CONFIG_PCIEAER | ||
1014 | void pci_no_aer(void); | ||
1015 | bool pci_aer_available(void); | ||
1016 | #else | ||
1017 | static inline void pci_no_aer(void) { } | ||
1018 | static inline bool pci_aer_available(void) { return false; } | ||
1019 | #endif | ||
1020 | |||
1006 | #ifndef CONFIG_PCIE_ECRC | 1021 | #ifndef CONFIG_PCIE_ECRC |
1007 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | 1022 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) |
1008 | { | 1023 | { |
@@ -1168,10 +1183,8 @@ static inline int pci_save_state(struct pci_dev *dev) | |||
1168 | return 0; | 1183 | return 0; |
1169 | } | 1184 | } |
1170 | 1185 | ||
1171 | static inline int pci_restore_state(struct pci_dev *dev) | 1186 | static inline void pci_restore_state(struct pci_dev *dev) |
1172 | { | 1187 | { } |
1173 | return 0; | ||
1174 | } | ||
1175 | 1188 | ||
1176 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1189 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
1177 | { | 1190 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index cb845c16ad7d..3adb06ebf841 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 af83076c31a6..5b7e6b1ba54f 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -309,6 +309,14 @@ | |||
309 | #define PCI_MSIX_PBA 8 | 309 | #define PCI_MSIX_PBA 8 |
310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
311 | 311 | ||
312 | /* MSI-X entry's format */ | ||
313 | #define PCI_MSIX_ENTRY_SIZE 16 | ||
314 | #define PCI_MSIX_ENTRY_LOWER_ADDR 0 | ||
315 | #define PCI_MSIX_ENTRY_UPPER_ADDR 4 | ||
316 | #define PCI_MSIX_ENTRY_DATA 8 | ||
317 | #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 | ||
318 | #define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 | ||
319 | |||
312 | /* CompactPCI Hotswap Register */ | 320 | /* CompactPCI Hotswap Register */ |
313 | 321 | ||
314 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ | 322 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ |
@@ -496,6 +504,8 @@ | |||
496 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ | 504 | #define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ |
497 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ | 505 | #define PCI_EXP_RTCAP 30 /* Root Capabilities */ |
498 | #define PCI_EXP_RTSTA 32 /* Root Status */ | 506 | #define PCI_EXP_RTSTA 32 /* Root Status */ |
507 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ | ||
508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | ||
499 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
500 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
501 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 5095b834a6fb..27c3c6fcfad3 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -240,6 +240,21 @@ extern void __bad_size_call_parameter(void); | |||
240 | pscr_ret__; \ | 240 | pscr_ret__; \ |
241 | }) | 241 | }) |
242 | 242 | ||
243 | #define __pcpu_size_call_return2(stem, variable, ...) \ | ||
244 | ({ \ | ||
245 | typeof(variable) pscr2_ret__; \ | ||
246 | __verify_pcpu_ptr(&(variable)); \ | ||
247 | switch(sizeof(variable)) { \ | ||
248 | case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ | ||
249 | case 2: pscr2_ret__ = stem##2(variable, __VA_ARGS__); break; \ | ||
250 | case 4: pscr2_ret__ = stem##4(variable, __VA_ARGS__); break; \ | ||
251 | case 8: pscr2_ret__ = stem##8(variable, __VA_ARGS__); break; \ | ||
252 | default: \ | ||
253 | __bad_size_call_parameter(); break; \ | ||
254 | } \ | ||
255 | pscr2_ret__; \ | ||
256 | }) | ||
257 | |||
243 | #define __pcpu_size_call(stem, variable, ...) \ | 258 | #define __pcpu_size_call(stem, variable, ...) \ |
244 | do { \ | 259 | do { \ |
245 | __verify_pcpu_ptr(&(variable)); \ | 260 | __verify_pcpu_ptr(&(variable)); \ |
@@ -402,6 +417,89 @@ do { \ | |||
402 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | 417 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) |
403 | #endif | 418 | #endif |
404 | 419 | ||
420 | #define _this_cpu_generic_add_return(pcp, val) \ | ||
421 | ({ \ | ||
422 | typeof(pcp) ret__; \ | ||
423 | preempt_disable(); \ | ||
424 | __this_cpu_add(pcp, val); \ | ||
425 | ret__ = __this_cpu_read(pcp); \ | ||
426 | preempt_enable(); \ | ||
427 | ret__; \ | ||
428 | }) | ||
429 | |||
430 | #ifndef this_cpu_add_return | ||
431 | # ifndef this_cpu_add_return_1 | ||
432 | # define this_cpu_add_return_1(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
433 | # endif | ||
434 | # ifndef this_cpu_add_return_2 | ||
435 | # define this_cpu_add_return_2(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
436 | # endif | ||
437 | # ifndef this_cpu_add_return_4 | ||
438 | # define this_cpu_add_return_4(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
439 | # endif | ||
440 | # ifndef this_cpu_add_return_8 | ||
441 | # define this_cpu_add_return_8(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
442 | # endif | ||
443 | # define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
444 | #endif | ||
445 | |||
446 | #define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) | ||
447 | #define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
448 | #define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
449 | |||
450 | #define _this_cpu_generic_xchg(pcp, nval) \ | ||
451 | ({ typeof(pcp) ret__; \ | ||
452 | preempt_disable(); \ | ||
453 | ret__ = __this_cpu_read(pcp); \ | ||
454 | __this_cpu_write(pcp, nval); \ | ||
455 | preempt_enable(); \ | ||
456 | ret__; \ | ||
457 | }) | ||
458 | |||
459 | #ifndef this_cpu_xchg | ||
460 | # ifndef this_cpu_xchg_1 | ||
461 | # define this_cpu_xchg_1(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
462 | # endif | ||
463 | # ifndef this_cpu_xchg_2 | ||
464 | # define this_cpu_xchg_2(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
465 | # endif | ||
466 | # ifndef this_cpu_xchg_4 | ||
467 | # define this_cpu_xchg_4(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
468 | # endif | ||
469 | # ifndef this_cpu_xchg_8 | ||
470 | # define this_cpu_xchg_8(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
471 | # endif | ||
472 | # define this_cpu_xchg(pcp, nval) \ | ||
473 | __pcpu_size_call_return2(this_cpu_xchg_, (pcp), nval) | ||
474 | #endif | ||
475 | |||
476 | #define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
477 | ({ typeof(pcp) ret__; \ | ||
478 | preempt_disable(); \ | ||
479 | ret__ = __this_cpu_read(pcp); \ | ||
480 | if (ret__ == (oval)) \ | ||
481 | __this_cpu_write(pcp, nval); \ | ||
482 | preempt_enable(); \ | ||
483 | ret__; \ | ||
484 | }) | ||
485 | |||
486 | #ifndef this_cpu_cmpxchg | ||
487 | # ifndef this_cpu_cmpxchg_1 | ||
488 | # define this_cpu_cmpxchg_1(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
489 | # endif | ||
490 | # ifndef this_cpu_cmpxchg_2 | ||
491 | # define this_cpu_cmpxchg_2(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
492 | # endif | ||
493 | # ifndef this_cpu_cmpxchg_4 | ||
494 | # define this_cpu_cmpxchg_4(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
495 | # endif | ||
496 | # ifndef this_cpu_cmpxchg_8 | ||
497 | # define this_cpu_cmpxchg_8(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
498 | # endif | ||
499 | # define this_cpu_cmpxchg(pcp, oval, nval) \ | ||
500 | __pcpu_size_call_return2(this_cpu_cmpxchg_, pcp, oval, nval) | ||
501 | #endif | ||
502 | |||
405 | /* | 503 | /* |
406 | * Generic percpu operations that do not require preemption handling. | 504 | * Generic percpu operations that do not require preemption handling. |
407 | * Either we do not care about races or the caller has the | 505 | * Either we do not care about races or the caller has the |
@@ -529,11 +627,87 @@ do { \ | |||
529 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) | 627 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) |
530 | #endif | 628 | #endif |
531 | 629 | ||
630 | #define __this_cpu_generic_add_return(pcp, val) \ | ||
631 | ({ \ | ||
632 | __this_cpu_add(pcp, val); \ | ||
633 | __this_cpu_read(pcp); \ | ||
634 | }) | ||
635 | |||
636 | #ifndef __this_cpu_add_return | ||
637 | # ifndef __this_cpu_add_return_1 | ||
638 | # define __this_cpu_add_return_1(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
639 | # endif | ||
640 | # ifndef __this_cpu_add_return_2 | ||
641 | # define __this_cpu_add_return_2(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
642 | # endif | ||
643 | # ifndef __this_cpu_add_return_4 | ||
644 | # define __this_cpu_add_return_4(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
645 | # endif | ||
646 | # ifndef __this_cpu_add_return_8 | ||
647 | # define __this_cpu_add_return_8(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
648 | # endif | ||
649 | # define __this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
650 | #endif | ||
651 | |||
652 | #define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) | ||
653 | #define __this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
654 | #define __this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
655 | |||
656 | #define __this_cpu_generic_xchg(pcp, nval) \ | ||
657 | ({ typeof(pcp) ret__; \ | ||
658 | ret__ = __this_cpu_read(pcp); \ | ||
659 | __this_cpu_write(pcp, nval); \ | ||
660 | ret__; \ | ||
661 | }) | ||
662 | |||
663 | #ifndef __this_cpu_xchg | ||
664 | # ifndef __this_cpu_xchg_1 | ||
665 | # define __this_cpu_xchg_1(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
666 | # endif | ||
667 | # ifndef __this_cpu_xchg_2 | ||
668 | # define __this_cpu_xchg_2(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
669 | # endif | ||
670 | # ifndef __this_cpu_xchg_4 | ||
671 | # define __this_cpu_xchg_4(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
672 | # endif | ||
673 | # ifndef __this_cpu_xchg_8 | ||
674 | # define __this_cpu_xchg_8(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
675 | # endif | ||
676 | # define __this_cpu_xchg(pcp, nval) \ | ||
677 | __pcpu_size_call_return2(__this_cpu_xchg_, (pcp), nval) | ||
678 | #endif | ||
679 | |||
680 | #define __this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
681 | ({ \ | ||
682 | typeof(pcp) ret__; \ | ||
683 | ret__ = __this_cpu_read(pcp); \ | ||
684 | if (ret__ == (oval)) \ | ||
685 | __this_cpu_write(pcp, nval); \ | ||
686 | ret__; \ | ||
687 | }) | ||
688 | |||
689 | #ifndef __this_cpu_cmpxchg | ||
690 | # ifndef __this_cpu_cmpxchg_1 | ||
691 | # define __this_cpu_cmpxchg_1(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
692 | # endif | ||
693 | # ifndef __this_cpu_cmpxchg_2 | ||
694 | # define __this_cpu_cmpxchg_2(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
695 | # endif | ||
696 | # ifndef __this_cpu_cmpxchg_4 | ||
697 | # define __this_cpu_cmpxchg_4(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
698 | # endif | ||
699 | # ifndef __this_cpu_cmpxchg_8 | ||
700 | # define __this_cpu_cmpxchg_8(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
701 | # endif | ||
702 | # define __this_cpu_cmpxchg(pcp, oval, nval) \ | ||
703 | __pcpu_size_call_return2(__this_cpu_cmpxchg_, pcp, oval, nval) | ||
704 | #endif | ||
705 | |||
532 | /* | 706 | /* |
533 | * IRQ safe versions of the per cpu RMW operations. Note that these operations | 707 | * IRQ safe versions of the per cpu RMW operations. Note that these operations |
534 | * are *not* safe against modification of the same variable from another | 708 | * are *not* safe against modification of the same variable from another |
535 | * processors (which one gets when using regular atomic operations) | 709 | * processors (which one gets when using regular atomic operations) |
536 | . They are guaranteed to be atomic vs. local interrupts and | 710 | * They are guaranteed to be atomic vs. local interrupts and |
537 | * preemption only. | 711 | * preemption only. |
538 | */ | 712 | */ |
539 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ | 713 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ |
@@ -620,4 +794,33 @@ do { \ | |||
620 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) | 794 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) |
621 | #endif | 795 | #endif |
622 | 796 | ||
797 | #define irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
798 | ({ \ | ||
799 | typeof(pcp) ret__; \ | ||
800 | unsigned long flags; \ | ||
801 | local_irq_save(flags); \ | ||
802 | ret__ = __this_cpu_read(pcp); \ | ||
803 | if (ret__ == (oval)) \ | ||
804 | __this_cpu_write(pcp, nval); \ | ||
805 | local_irq_restore(flags); \ | ||
806 | ret__; \ | ||
807 | }) | ||
808 | |||
809 | #ifndef irqsafe_cpu_cmpxchg | ||
810 | # ifndef irqsafe_cpu_cmpxchg_1 | ||
811 | # define irqsafe_cpu_cmpxchg_1(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
812 | # endif | ||
813 | # ifndef irqsafe_cpu_cmpxchg_2 | ||
814 | # define irqsafe_cpu_cmpxchg_2(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
815 | # endif | ||
816 | # ifndef irqsafe_cpu_cmpxchg_4 | ||
817 | # define irqsafe_cpu_cmpxchg_4(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
818 | # endif | ||
819 | # ifndef irqsafe_cpu_cmpxchg_8 | ||
820 | # define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
821 | # endif | ||
822 | # define irqsafe_cpu_cmpxchg(pcp, oval, nval) \ | ||
823 | __pcpu_size_call_return2(irqsafe_cpu_cmpxchg_, (pcp), oval, nval) | ||
824 | #endif | ||
825 | |||
623 | #endif /* __LINUX_PERCPU_H */ | 826 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 4f1279e105ee..dda5b0a3ff60 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -215,8 +215,9 @@ struct perf_event_attr { | |||
215 | */ | 215 | */ |
216 | precise_ip : 2, /* skid constraint */ | 216 | precise_ip : 2, /* skid constraint */ |
217 | mmap_data : 1, /* non-exec mmap data */ | 217 | mmap_data : 1, /* non-exec mmap data */ |
218 | sample_id_all : 1, /* sample_type all events */ | ||
218 | 219 | ||
219 | __reserved_1 : 46; | 220 | __reserved_1 : 45; |
220 | 221 | ||
221 | union { | 222 | union { |
222 | __u32 wakeup_events; /* wakeup every n events */ | 223 | __u32 wakeup_events; /* wakeup every n events */ |
@@ -327,6 +328,15 @@ struct perf_event_header { | |||
327 | enum perf_event_type { | 328 | enum perf_event_type { |
328 | 329 | ||
329 | /* | 330 | /* |
331 | * If perf_event_attr.sample_id_all is set then all event types will | ||
332 | * have the sample_type selected fields related to where/when | ||
333 | * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID) | ||
334 | * described in PERF_RECORD_SAMPLE below, it will be stashed just after | ||
335 | * the perf_event_header and the fields already present for the existing | ||
336 | * fields, i.e. at the end of the payload. That way a newer perf.data | ||
337 | * file will be supported by older perf tools, with these new optional | ||
338 | * fields being ignored. | ||
339 | * | ||
330 | * The MMAP events record the PROT_EXEC mappings so that we can | 340 | * The MMAP events record the PROT_EXEC mappings so that we can |
331 | * correlate userspace IPs to code. They have the following structure: | 341 | * correlate userspace IPs to code. They have the following structure: |
332 | * | 342 | * |
@@ -578,6 +588,10 @@ struct perf_event; | |||
578 | struct pmu { | 588 | struct pmu { |
579 | struct list_head entry; | 589 | struct list_head entry; |
580 | 590 | ||
591 | struct device *dev; | ||
592 | char *name; | ||
593 | int type; | ||
594 | |||
581 | int * __percpu pmu_disable_count; | 595 | int * __percpu pmu_disable_count; |
582 | struct perf_cpu_context * __percpu pmu_cpu_context; | 596 | struct perf_cpu_context * __percpu pmu_cpu_context; |
583 | int task_ctx_nr; | 597 | int task_ctx_nr; |
@@ -758,6 +772,9 @@ struct perf_event { | |||
758 | u64 shadow_ctx_time; | 772 | u64 shadow_ctx_time; |
759 | 773 | ||
760 | struct perf_event_attr attr; | 774 | struct perf_event_attr attr; |
775 | u16 header_size; | ||
776 | u16 id_header_size; | ||
777 | u16 read_size; | ||
761 | struct hw_perf_event hw; | 778 | struct hw_perf_event hw; |
762 | 779 | ||
763 | struct perf_event_context *ctx; | 780 | struct perf_event_context *ctx; |
@@ -903,7 +920,7 @@ struct perf_output_handle { | |||
903 | 920 | ||
904 | #ifdef CONFIG_PERF_EVENTS | 921 | #ifdef CONFIG_PERF_EVENTS |
905 | 922 | ||
906 | extern int perf_pmu_register(struct pmu *pmu); | 923 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); |
907 | extern void perf_pmu_unregister(struct pmu *pmu); | 924 | extern void perf_pmu_unregister(struct pmu *pmu); |
908 | 925 | ||
909 | extern int perf_num_counters(void); | 926 | extern int perf_num_counters(void); |
@@ -970,6 +987,11 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
970 | struct perf_sample_data *data, | 987 | struct perf_sample_data *data, |
971 | struct pt_regs *regs); | 988 | struct pt_regs *regs); |
972 | 989 | ||
990 | static inline bool is_sampling_event(struct perf_event *event) | ||
991 | { | ||
992 | return event->attr.sample_period != 0; | ||
993 | } | ||
994 | |||
973 | /* | 995 | /* |
974 | * Return 1 for a software event, 0 for a hardware event | 996 | * Return 1 for a software event, 0 for a hardware event |
975 | */ | 997 | */ |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index bb27d7ec2fb9..77257c92155a 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 40f3f45702ba..dd9c7ab38270 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 d19f1cca7f74..d34f067e2a7f 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 56e76af78102..1a2ccd6f3823 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -57,7 +57,7 @@ struct poll_table_entry { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * Structures and helpers for sys_poll/sys_poll | 60 | * Structures and helpers for select/poll syscall |
61 | */ | 61 | */ |
62 | struct poll_wqueues { | 62 | struct poll_wqueues { |
63 | poll_table pt; | 63 | poll_table pt; |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 67608161df6b..54211c1cd926 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -71,6 +71,7 @@ posix_acl_release(struct posix_acl *acl) | |||
71 | 71 | ||
72 | /* posix_acl.c */ | 72 | /* posix_acl.c */ |
73 | 73 | ||
74 | extern void posix_acl_init(struct posix_acl *, int); | ||
74 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); | 75 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); |
75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); | 76 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); |
76 | extern int posix_acl_valid(const struct posix_acl *); | 77 | extern int posix_acl_valid(const struct posix_acl *); |
@@ -108,6 +109,25 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | |||
108 | return acl; | 109 | return acl; |
109 | } | 110 | } |
110 | 111 | ||
112 | static inline int negative_cached_acl(struct inode *inode, int type) | ||
113 | { | ||
114 | struct posix_acl **p, *acl; | ||
115 | switch (type) { | ||
116 | case ACL_TYPE_ACCESS: | ||
117 | p = &inode->i_acl; | ||
118 | break; | ||
119 | case ACL_TYPE_DEFAULT: | ||
120 | p = &inode->i_default_acl; | ||
121 | break; | ||
122 | default: | ||
123 | BUG(); | ||
124 | } | ||
125 | acl = ACCESS_ONCE(*p); | ||
126 | if (acl) | ||
127 | return 0; | ||
128 | return 1; | ||
129 | } | ||
130 | |||
111 | static inline void set_cached_acl(struct inode *inode, | 131 | static inline void set_cached_acl(struct inode *inode, |
112 | int type, | 132 | int type, |
113 | struct posix_acl *acl) | 133 | struct posix_acl *acl) |
diff --git a/include/linux/power/gpio-charger.h b/include/linux/power/gpio-charger.h new file mode 100644 index 000000000000..de1dfe09a03d --- /dev/null +++ b/include/linux/power/gpio-charger.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | * | ||
9 | * You should have received a copy of the GNU General Public License along | ||
10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_POWER_GPIO_CHARGER_H__ | ||
16 | #define __LINUX_POWER_GPIO_CHARGER_H__ | ||
17 | |||
18 | #include <linux/power_supply.h> | ||
19 | #include <linux/types.h> | ||
20 | |||
21 | /** | ||
22 | * struct gpio_charger_platform_data - platform_data for gpio_charger devices | ||
23 | * @name: Name for the chargers power_supply device | ||
24 | * @type: Type of the charger | ||
25 | * @gpio: GPIO which is used to indicate the chargers status | ||
26 | * @gpio_active_low: Should be set to 1 if the GPIO is active low otherwise 0 | ||
27 | * @supplied_to: Array of battery names to which this chargers supplies power | ||
28 | * @num_supplicants: Number of entries in the supplied_to array | ||
29 | */ | ||
30 | struct gpio_charger_platform_data { | ||
31 | const char *name; | ||
32 | enum power_supply_type type; | ||
33 | |||
34 | int gpio; | ||
35 | int gpio_active_low; | ||
36 | |||
37 | char **supplied_to; | ||
38 | size_t num_supplicants; | ||
39 | }; | ||
40 | |||
41 | #endif | ||
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h new file mode 100644 index 000000000000..7995deb8bfc1 --- /dev/null +++ b/include/linux/power/max17042_battery.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Fuel gauge driver for Maxim 17042 / 8966 / 8997 | ||
3 | * Note that Maxim 8966 and 8997 are mfd and this is its subdevice. | ||
4 | * | ||
5 | * Copyright (C) 2011 Samsung Electronics | ||
6 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __MAX17042_BATTERY_H_ | ||
24 | #define __MAX17042_BATTERY_H_ | ||
25 | |||
26 | struct max17042_platform_data { | ||
27 | bool enable_current_sense; | ||
28 | }; | ||
29 | |||
30 | #endif /* __MAX17042_BATTERY_H_ */ | ||
diff --git a/include/linux/pps.h b/include/linux/pps.h index 0194ab06177b..a9bb1d93451a 100644 --- a/include/linux/pps.h +++ b/include/linux/pps.h | |||
@@ -114,11 +114,18 @@ struct pps_fdata { | |||
114 | struct pps_ktime timeout; | 114 | struct pps_ktime timeout; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | struct pps_bind_args { | ||
118 | int tsformat; /* format of time stamps */ | ||
119 | int edge; /* selected event type */ | ||
120 | int consumer; /* selected kernel consumer */ | ||
121 | }; | ||
122 | |||
117 | #include <linux/ioctl.h> | 123 | #include <linux/ioctl.h> |
118 | 124 | ||
119 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) | 125 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) |
120 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) | 126 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) |
121 | #define PPS_GETCAP _IOR('p', 0xa3, int *) | 127 | #define PPS_GETCAP _IOR('p', 0xa3, int *) |
122 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) | 128 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) |
129 | #define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *) | ||
123 | 130 | ||
124 | #endif /* _PPS_H_ */ | 131 | #endif /* _PPS_H_ */ |
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index e0a193f830ef..94048547f29a 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -18,6 +18,9 @@ | |||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef LINUX_PPS_KERNEL_H | ||
22 | #define LINUX_PPS_KERNEL_H | ||
23 | |||
21 | #include <linux/pps.h> | 24 | #include <linux/pps.h> |
22 | 25 | ||
23 | #include <linux/cdev.h> | 26 | #include <linux/cdev.h> |
@@ -28,18 +31,28 @@ | |||
28 | * Global defines | 31 | * Global defines |
29 | */ | 32 | */ |
30 | 33 | ||
34 | struct pps_device; | ||
35 | |||
31 | /* The specific PPS source info */ | 36 | /* The specific PPS source info */ |
32 | struct pps_source_info { | 37 | struct pps_source_info { |
33 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ | 38 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ |
34 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ | 39 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ |
35 | int mode; /* PPS's allowed mode */ | 40 | int mode; /* PPS's allowed mode */ |
36 | 41 | ||
37 | void (*echo)(int source, int event, void *data); /* PPS echo function */ | 42 | void (*echo)(struct pps_device *pps, |
43 | int event, void *data); /* PPS echo function */ | ||
38 | 44 | ||
39 | struct module *owner; | 45 | struct module *owner; |
40 | struct device *dev; | 46 | struct device *dev; |
41 | }; | 47 | }; |
42 | 48 | ||
49 | struct pps_event_time { | ||
50 | #ifdef CONFIG_NTP_PPS | ||
51 | struct timespec ts_raw; | ||
52 | #endif /* CONFIG_NTP_PPS */ | ||
53 | struct timespec ts_real; | ||
54 | }; | ||
55 | |||
43 | /* The main struct */ | 56 | /* The main struct */ |
44 | struct pps_device { | 57 | struct pps_device { |
45 | struct pps_source_info info; /* PSS source info */ | 58 | struct pps_source_info info; /* PSS source info */ |
@@ -52,38 +65,56 @@ struct pps_device { | |||
52 | struct pps_ktime clear_tu; | 65 | struct pps_ktime clear_tu; |
53 | int current_mode; /* PPS mode at event time */ | 66 | int current_mode; /* PPS mode at event time */ |
54 | 67 | ||
55 | int go; /* PPS event is arrived? */ | 68 | unsigned int last_ev; /* last PPS event id */ |
56 | wait_queue_head_t queue; /* PPS event queue */ | 69 | wait_queue_head_t queue; /* PPS event queue */ |
57 | 70 | ||
58 | unsigned int id; /* PPS source unique ID */ | 71 | unsigned int id; /* PPS source unique ID */ |
59 | struct cdev cdev; | 72 | struct cdev cdev; |
60 | struct device *dev; | 73 | struct device *dev; |
61 | int devno; | ||
62 | struct fasync_struct *async_queue; /* fasync method */ | 74 | struct fasync_struct *async_queue; /* fasync method */ |
63 | spinlock_t lock; | 75 | spinlock_t lock; |
64 | |||
65 | atomic_t usage; /* usage count */ | ||
66 | }; | 76 | }; |
67 | 77 | ||
68 | /* | 78 | /* |
69 | * Global variables | 79 | * Global variables |
70 | */ | 80 | */ |
71 | 81 | ||
72 | extern spinlock_t pps_idr_lock; | ||
73 | extern struct idr pps_idr; | ||
74 | extern struct timespec pps_irq_ts[]; | ||
75 | |||
76 | extern struct device_attribute pps_attrs[]; | 82 | extern struct device_attribute pps_attrs[]; |
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Exported functions | 85 | * Exported functions |
80 | */ | 86 | */ |
81 | 87 | ||
82 | struct pps_device *pps_get_source(int source); | 88 | extern struct pps_device *pps_register_source( |
83 | extern void pps_put_source(struct pps_device *pps); | 89 | struct pps_source_info *info, int default_params); |
84 | extern int pps_register_source(struct pps_source_info *info, | 90 | extern void pps_unregister_source(struct pps_device *pps); |
85 | int default_params); | ||
86 | extern void pps_unregister_source(int source); | ||
87 | extern int pps_register_cdev(struct pps_device *pps); | 91 | extern int pps_register_cdev(struct pps_device *pps); |
88 | extern void pps_unregister_cdev(struct pps_device *pps); | 92 | extern void pps_unregister_cdev(struct pps_device *pps); |
89 | extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); | 93 | extern void pps_event(struct pps_device *pps, |
94 | struct pps_event_time *ts, int event, void *data); | ||
95 | |||
96 | static inline void timespec_to_pps_ktime(struct pps_ktime *kt, | ||
97 | struct timespec ts) | ||
98 | { | ||
99 | kt->sec = ts.tv_sec; | ||
100 | kt->nsec = ts.tv_nsec; | ||
101 | } | ||
102 | |||
103 | #ifdef CONFIG_NTP_PPS | ||
104 | |||
105 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
106 | { | ||
107 | getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real); | ||
108 | } | ||
109 | |||
110 | #else /* CONFIG_NTP_PPS */ | ||
111 | |||
112 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
113 | { | ||
114 | getnstimeofday(&ts->ts_real); | ||
115 | } | ||
116 | |||
117 | #endif /* CONFIG_NTP_PPS */ | ||
118 | |||
119 | #endif /* LINUX_PPS_KERNEL_H */ | ||
120 | |||
diff --git a/include/linux/printk.h b/include/linux/printk.h index b772ca5fbdf0..ee048e77e1ae 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -4,14 +4,14 @@ | |||
4 | extern const char linux_banner[]; | 4 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 5 | extern const char linux_proc_banner[]; |
6 | 6 | ||
7 | #define KERN_EMERG "<0>" /* system is unusable */ | 7 | #define KERN_EMERG "<0>" /* system is unusable */ |
8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
9 | #define KERN_CRIT "<2>" /* critical conditions */ | 9 | #define KERN_CRIT "<2>" /* critical conditions */ |
10 | #define KERN_ERR "<3>" /* error conditions */ | 10 | #define KERN_ERR "<3>" /* error conditions */ |
11 | #define KERN_WARNING "<4>" /* warning conditions */ | 11 | #define KERN_WARNING "<4>" /* warning conditions */ |
12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | 12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ |
13 | #define KERN_INFO "<6>" /* informational */ | 13 | #define KERN_INFO "<6>" /* informational */ |
14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | 14 | #define KERN_DEBUG "<7>" /* debug-level messages */ |
15 | 15 | ||
16 | /* Use the default kernel loglevel */ | 16 | /* Use the default kernel loglevel */ |
17 | #define KERN_DEFAULT "<d>" | 17 | #define KERN_DEFAULT "<d>" |
@@ -20,7 +20,7 @@ extern const char linux_proc_banner[]; | |||
20 | * line that had no enclosing \n). Only to be used by core/arch code | 20 | * line that had no enclosing \n). Only to be used by core/arch code |
21 | * during early bootup (a continued line is not SMP-safe otherwise). | 21 | * during early bootup (a continued line is not SMP-safe otherwise). |
22 | */ | 22 | */ |
23 | #define KERN_CONT "<c>" | 23 | #define KERN_CONT "<c>" |
24 | 24 | ||
25 | extern int console_printk[]; | 25 | extern int console_printk[]; |
26 | 26 | ||
@@ -29,6 +29,17 @@ extern int console_printk[]; | |||
29 | #define minimum_console_loglevel (console_printk[2]) | 29 | #define minimum_console_loglevel (console_printk[2]) |
30 | #define default_console_loglevel (console_printk[3]) | 30 | #define default_console_loglevel (console_printk[3]) |
31 | 31 | ||
32 | static inline void console_silent(void) | ||
33 | { | ||
34 | console_loglevel = 0; | ||
35 | } | ||
36 | |||
37 | static inline void console_verbose(void) | ||
38 | { | ||
39 | if (console_loglevel) | ||
40 | console_loglevel = 15; | ||
41 | } | ||
42 | |||
32 | struct va_format { | 43 | struct va_format { |
33 | const char *fmt; | 44 | const char *fmt; |
34 | va_list *va; | 45 | va_list *va; |
@@ -65,11 +76,27 @@ struct va_format { | |||
65 | */ | 76 | */ |
66 | #define HW_ERR "[Hardware Error]: " | 77 | #define HW_ERR "[Hardware Error]: " |
67 | 78 | ||
79 | /* | ||
80 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
81 | * gcc's format and side-effect checking. | ||
82 | */ | ||
83 | static inline __attribute__ ((format (printf, 1, 2))) | ||
84 | int no_printk(const char *fmt, ...) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | extern asmlinkage __attribute__ ((format (printf, 1, 2))) | ||
90 | void early_printk(const char *fmt, ...); | ||
91 | |||
92 | extern int printk_needs_cpu(int cpu); | ||
93 | extern void printk_tick(void); | ||
94 | |||
68 | #ifdef CONFIG_PRINTK | 95 | #ifdef CONFIG_PRINTK |
69 | asmlinkage int vprintk(const char *fmt, va_list args) | 96 | asmlinkage __attribute__ ((format (printf, 1, 0))) |
70 | __attribute__ ((format (printf, 1, 0))); | 97 | int vprintk(const char *fmt, va_list args); |
71 | asmlinkage int printk(const char * fmt, ...) | 98 | asmlinkage __attribute__ ((format (printf, 1, 2))) __cold |
72 | __attribute__ ((format (printf, 1, 2))) __cold; | 99 | int printk(const char *fmt, ...); |
73 | 100 | ||
74 | /* | 101 | /* |
75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | 102 | * Please don't use printk_ratelimit(), because it shares ratelimiting state |
@@ -83,99 +110,56 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
83 | 110 | ||
84 | extern int printk_delay_msec; | 111 | extern int printk_delay_msec; |
85 | extern int dmesg_restrict; | 112 | extern int dmesg_restrict; |
86 | 113 | extern int kptr_restrict; | |
87 | /* | ||
88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
89 | */ | ||
90 | #define printk_once(x...) ({ \ | ||
91 | static bool __print_once; \ | ||
92 | \ | ||
93 | if (!__print_once) { \ | ||
94 | __print_once = true; \ | ||
95 | printk(x); \ | ||
96 | } \ | ||
97 | }) | ||
98 | 114 | ||
99 | void log_buf_kexec_setup(void); | 115 | void log_buf_kexec_setup(void); |
100 | #else | 116 | #else |
101 | static inline int vprintk(const char *s, va_list args) | 117 | static inline __attribute__ ((format (printf, 1, 0))) |
102 | __attribute__ ((format (printf, 1, 0))); | 118 | int vprintk(const char *s, va_list args) |
103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
104 | static inline int printk(const char *s, ...) | ||
105 | __attribute__ ((format (printf, 1, 2))); | ||
106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
107 | static inline int printk_ratelimit(void) { return 0; } | ||
108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
109 | unsigned int interval_msec) \ | ||
110 | { return false; } | ||
111 | |||
112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
113 | #define printk_once(x...) printk(x) | ||
114 | |||
115 | static inline void log_buf_kexec_setup(void) | ||
116 | { | 119 | { |
120 | return 0; | ||
117 | } | 121 | } |
118 | #endif | 122 | static inline __attribute__ ((format (printf, 1, 2))) __cold |
119 | 123 | int printk(const char *s, ...) | |
120 | /* | ||
121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
122 | * gcc's format and side-effect checking. | ||
123 | */ | ||
124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
125 | int no_printk(const char *s, ...) { return 0; } | ||
126 | |||
127 | extern int printk_needs_cpu(int cpu); | ||
128 | extern void printk_tick(void); | ||
129 | |||
130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
131 | early_printk(const char *fmt, ...); | ||
132 | |||
133 | static inline void console_silent(void) | ||
134 | { | 124 | { |
135 | console_loglevel = 0; | 125 | return 0; |
126 | } | ||
127 | static inline int printk_ratelimit(void) | ||
128 | { | ||
129 | return 0; | ||
130 | } | ||
131 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
132 | unsigned int interval_msec) | ||
133 | { | ||
134 | return false; | ||
136 | } | 135 | } |
137 | 136 | ||
138 | static inline void console_verbose(void) | 137 | static inline void log_buf_kexec_setup(void) |
139 | { | 138 | { |
140 | if (console_loglevel) | ||
141 | console_loglevel = 15; | ||
142 | } | 139 | } |
140 | #endif | ||
143 | 141 | ||
144 | extern void dump_stack(void) __cold; | 142 | extern void dump_stack(void) __cold; |
145 | 143 | ||
146 | enum { | ||
147 | DUMP_PREFIX_NONE, | ||
148 | DUMP_PREFIX_ADDRESS, | ||
149 | DUMP_PREFIX_OFFSET | ||
150 | }; | ||
151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
152 | int rowsize, int groupsize, | ||
153 | char *linebuf, size_t linebuflen, bool ascii); | ||
154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
155 | int prefix_type, int rowsize, int groupsize, | ||
156 | const void *buf, size_t len, bool ascii); | ||
157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
158 | const void *buf, size_t len); | ||
159 | |||
160 | #ifndef pr_fmt | 144 | #ifndef pr_fmt |
161 | #define pr_fmt(fmt) fmt | 145 | #define pr_fmt(fmt) fmt |
162 | #endif | 146 | #endif |
163 | 147 | ||
164 | #define pr_emerg(fmt, ...) \ | 148 | #define pr_emerg(fmt, ...) \ |
165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 149 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
166 | #define pr_alert(fmt, ...) \ | 150 | #define pr_alert(fmt, ...) \ |
167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 151 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
168 | #define pr_crit(fmt, ...) \ | 152 | #define pr_crit(fmt, ...) \ |
169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 153 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
170 | #define pr_err(fmt, ...) \ | 154 | #define pr_err(fmt, ...) \ |
171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 155 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
172 | #define pr_warning(fmt, ...) \ | 156 | #define pr_warning(fmt, ...) \ |
173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 157 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
174 | #define pr_warn pr_warning | 158 | #define pr_warn pr_warning |
175 | #define pr_notice(fmt, ...) \ | 159 | #define pr_notice(fmt, ...) \ |
176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 160 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
177 | #define pr_info(fmt, ...) \ | 161 | #define pr_info(fmt, ...) \ |
178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 162 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
179 | #define pr_cont(fmt, ...) \ | 163 | #define pr_cont(fmt, ...) \ |
180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | 164 | printk(KERN_CONT fmt, ##__VA_ARGS__) |
181 | 165 | ||
@@ -185,7 +169,7 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 169 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #else | 170 | #else |
187 | #define pr_devel(fmt, ...) \ | 171 | #define pr_devel(fmt, ...) \ |
188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 172 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
189 | #endif | 173 | #endif |
190 | 174 | ||
191 | /* If you are writing a driver, please use dev_dbg instead */ | 175 | /* If you are writing a driver, please use dev_dbg instead */ |
@@ -198,7 +182,51 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | 182 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
199 | #else | 183 | #else |
200 | #define pr_debug(fmt, ...) \ | 184 | #define pr_debug(fmt, ...) \ |
201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 185 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #endif | ||
187 | |||
188 | /* | ||
189 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
190 | */ | ||
191 | |||
192 | #ifdef CONFIG_PRINTK | ||
193 | #define printk_once(fmt, ...) \ | ||
194 | ({ \ | ||
195 | static bool __print_once; \ | ||
196 | \ | ||
197 | if (!__print_once) { \ | ||
198 | __print_once = true; \ | ||
199 | printk(fmt, ##__VA_ARGS__); \ | ||
200 | } \ | ||
201 | }) | ||
202 | #else | ||
203 | #define printk_once(fmt, ...) \ | ||
204 | no_printk(fmt, ##__VA_ARGS__) | ||
205 | #endif | ||
206 | |||
207 | #define pr_emerg_once(fmt, ...) \ | ||
208 | printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
209 | #define pr_alert_once(fmt, ...) \ | ||
210 | printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
211 | #define pr_crit_once(fmt, ...) \ | ||
212 | printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
213 | #define pr_err_once(fmt, ...) \ | ||
214 | printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
215 | #define pr_warn_once(fmt, ...) \ | ||
216 | printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
217 | #define pr_notice_once(fmt, ...) \ | ||
218 | printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
219 | #define pr_info_once(fmt, ...) \ | ||
220 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
221 | #define pr_cont_once(fmt, ...) \ | ||
222 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) | ||
223 | /* If you are writing a driver, please use dev_dbg instead */ | ||
224 | #if defined(DEBUG) | ||
225 | #define pr_debug_once(fmt, ...) \ | ||
226 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
227 | #else | ||
228 | #define pr_debug_once(fmt, ...) \ | ||
229 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
202 | #endif | 230 | #endif |
203 | 231 | ||
204 | /* | 232 | /* |
@@ -206,7 +234,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
206 | * no local ratelimit_state used in the !PRINTK case | 234 | * no local ratelimit_state used in the !PRINTK case |
207 | */ | 235 | */ |
208 | #ifdef CONFIG_PRINTK | 236 | #ifdef CONFIG_PRINTK |
209 | #define printk_ratelimited(fmt, ...) ({ \ | 237 | #define printk_ratelimited(fmt, ...) \ |
238 | ({ \ | ||
210 | static DEFINE_RATELIMIT_STATE(_rs, \ | 239 | static DEFINE_RATELIMIT_STATE(_rs, \ |
211 | DEFAULT_RATELIMIT_INTERVAL, \ | 240 | DEFAULT_RATELIMIT_INTERVAL, \ |
212 | DEFAULT_RATELIMIT_BURST); \ | 241 | DEFAULT_RATELIMIT_BURST); \ |
@@ -215,34 +244,59 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
215 | printk(fmt, ##__VA_ARGS__); \ | 244 | printk(fmt, ##__VA_ARGS__); \ |
216 | }) | 245 | }) |
217 | #else | 246 | #else |
218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | 247 | #define printk_ratelimited(fmt, ...) \ |
219 | #define printk_ratelimited printk | 248 | no_printk(fmt, ##__VA_ARGS__) |
220 | #endif | 249 | #endif |
221 | 250 | ||
222 | #define pr_emerg_ratelimited(fmt, ...) \ | 251 | #define pr_emerg_ratelimited(fmt, ...) \ |
223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 252 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
224 | #define pr_alert_ratelimited(fmt, ...) \ | 253 | #define pr_alert_ratelimited(fmt, ...) \ |
225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 254 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
226 | #define pr_crit_ratelimited(fmt, ...) \ | 255 | #define pr_crit_ratelimited(fmt, ...) \ |
227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 256 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
228 | #define pr_err_ratelimited(fmt, ...) \ | 257 | #define pr_err_ratelimited(fmt, ...) \ |
229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 258 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
230 | #define pr_warning_ratelimited(fmt, ...) \ | 259 | #define pr_warn_ratelimited(fmt, ...) \ |
231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 260 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
232 | #define pr_warn_ratelimited pr_warning_ratelimited | 261 | #define pr_notice_ratelimited(fmt, ...) \ |
233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 262 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
235 | #define pr_info_ratelimited(fmt, ...) \ | 263 | #define pr_info_ratelimited(fmt, ...) \ |
236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 264 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
237 | /* no pr_cont_ratelimited, don't do that... */ | 265 | /* no pr_cont_ratelimited, don't do that... */ |
238 | /* If you are writing a driver, please use dev_dbg instead */ | 266 | /* If you are writing a driver, please use dev_dbg instead */ |
239 | #if defined(DEBUG) | 267 | #if defined(DEBUG) |
240 | #define pr_debug_ratelimited(fmt, ...) \ | 268 | #define pr_debug_ratelimited(fmt, ...) \ |
241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 269 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
242 | #else | 270 | #else |
243 | #define pr_debug_ratelimited(fmt, ...) \ | 271 | #define pr_debug_ratelimited(fmt, ...) \ |
244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | 272 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
245 | ##__VA_ARGS__); 0; }) | 273 | #endif |
274 | |||
275 | enum { | ||
276 | DUMP_PREFIX_NONE, | ||
277 | DUMP_PREFIX_ADDRESS, | ||
278 | DUMP_PREFIX_OFFSET | ||
279 | }; | ||
280 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
281 | int rowsize, int groupsize, | ||
282 | char *linebuf, size_t linebuflen, bool ascii); | ||
283 | #ifdef CONFIG_PRINTK | ||
284 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
285 | int prefix_type, int rowsize, int groupsize, | ||
286 | const void *buf, size_t len, bool ascii); | ||
287 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
288 | const void *buf, size_t len); | ||
289 | #else | ||
290 | static inline void print_hex_dump(const char *level, const char *prefix_str, | ||
291 | int prefix_type, int rowsize, int groupsize, | ||
292 | const void *buf, size_t len, bool ascii) | ||
293 | { | ||
294 | } | ||
295 | static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
296 | const void *buf, size_t len) | ||
297 | { | ||
298 | } | ||
299 | |||
246 | #endif | 300 | #endif |
247 | 301 | ||
248 | #endif | 302 | #endif |
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h new file mode 100644 index 000000000000..2f691e4e6222 --- /dev/null +++ b/include/linux/pxa2xx_ssp.h | |||
@@ -0,0 +1,209 @@ | |||
1 | /* | ||
2 | * pxa2xx_ssp.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | ||
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 | * This driver supports the following PXA CPU/SSP ports:- | ||
11 | * | ||
12 | * PXA250 SSP | ||
13 | * PXA255 SSP, NSSP | ||
14 | * PXA26x SSP, NSSP, ASSP | ||
15 | * PXA27x SSP1, SSP2, SSP3 | ||
16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_SSP_H | ||
20 | #define __LINUX_SSP_H | ||
21 | |||
22 | #include <linux/list.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | /* | ||
26 | * SSP Serial Port Registers | ||
27 | * PXA250, PXA255, PXA26x and PXA27x SSP controllers are all slightly different. | ||
28 | * PXA255, PXA26x and PXA27x have extra ports, registers and bits. | ||
29 | */ | ||
30 | |||
31 | #define SSCR0 (0x00) /* SSP Control Register 0 */ | ||
32 | #define SSCR1 (0x04) /* SSP Control Register 1 */ | ||
33 | #define SSSR (0x08) /* SSP Status Register */ | ||
34 | #define SSITR (0x0C) /* SSP Interrupt Test Register */ | ||
35 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ | ||
36 | |||
37 | #define SSTO (0x28) /* SSP Time Out Register */ | ||
38 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ | ||
39 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ | ||
40 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | ||
41 | #define SSTSS (0x38) /* SSP Timeslot Status */ | ||
42 | #define SSACD (0x3C) /* SSP Audio Clock Divider */ | ||
43 | #define SSACDD (0x40) /* SSP Audio Clock Dither Divider */ | ||
44 | |||
45 | /* Common PXA2xx bits first */ | ||
46 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ | ||
47 | #define SSCR0_DataSize(x) ((x) - 1) /* Data Size Select [4..16] */ | ||
48 | #define SSCR0_FRF (0x00000030) /* FRame Format (mask) */ | ||
49 | #define SSCR0_Motorola (0x0 << 4) /* Motorola's Serial Peripheral Interface (SPI) */ | ||
50 | #define SSCR0_TI (0x1 << 4) /* Texas Instruments' Synchronous Serial Protocol (SSP) */ | ||
51 | #define SSCR0_National (0x2 << 4) /* National Microwire */ | ||
52 | #define SSCR0_ECS (1 << 6) /* External clock select */ | ||
53 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ | ||
54 | #define SSCR0_SCR(x) ((x) << 8) /* Serial Clock Rate (mask) */ | ||
55 | |||
56 | /* PXA27x, PXA3xx */ | ||
57 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ | ||
58 | #define SSCR0_NCS (1 << 21) /* Network clock select */ | ||
59 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ | ||
60 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ | ||
61 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ | ||
62 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ | ||
63 | #define SSCR0_FPCKE (1 << 29) /* FIFO packing enable */ | ||
64 | #define SSCR0_ACS (1 << 30) /* Audio clock select */ | ||
65 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ | ||
66 | |||
67 | |||
68 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ | ||
69 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ | ||
70 | #define SSCR1_LBM (1 << 2) /* Loop-Back Mode */ | ||
71 | #define SSCR1_SPO (1 << 3) /* Motorola SPI SSPSCLK polarity setting */ | ||
72 | #define SSCR1_SPH (1 << 4) /* Motorola SPI SSPSCLK phase setting */ | ||
73 | #define SSCR1_MWDS (1 << 5) /* Microwire Transmit Data Size */ | ||
74 | |||
75 | #define SSSR_ALT_FRM_MASK 3 /* Masks the SFRM signal number */ | ||
76 | #define SSSR_TNF (1 << 2) /* Transmit FIFO Not Full */ | ||
77 | #define SSSR_RNE (1 << 3) /* Receive FIFO Not Empty */ | ||
78 | #define SSSR_BSY (1 << 4) /* SSP Busy */ | ||
79 | #define SSSR_TFS (1 << 5) /* Transmit FIFO Service Request */ | ||
80 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ | ||
81 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ | ||
82 | |||
83 | #ifdef CONFIG_ARCH_PXA | ||
84 | #define RX_THRESH_DFLT 8 | ||
85 | #define TX_THRESH_DFLT 8 | ||
86 | |||
87 | #define SSSR_TFL_MASK (0xf << 8) /* Transmit FIFO Level mask */ | ||
88 | #define SSSR_RFL_MASK (0xf << 12) /* Receive FIFO Level mask */ | ||
89 | |||
90 | #define SSCR1_TFT (0x000003c0) /* Transmit FIFO Threshold (mask) */ | ||
91 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..16] */ | ||
92 | #define SSCR1_RFT (0x00003c00) /* Receive FIFO Threshold (mask) */ | ||
93 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..16] */ | ||
94 | |||
95 | #else | ||
96 | |||
97 | #define RX_THRESH_DFLT 2 | ||
98 | #define TX_THRESH_DFLT 2 | ||
99 | |||
100 | #define SSSR_TFL_MASK (0x3 << 8) /* Transmit FIFO Level mask */ | ||
101 | #define SSSR_RFL_MASK (0x3 << 12) /* Receive FIFO Level mask */ | ||
102 | |||
103 | #define SSCR1_TFT (0x000000c0) /* Transmit FIFO Threshold (mask) */ | ||
104 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..4] */ | ||
105 | #define SSCR1_RFT (0x00000c00) /* Receive FIFO Threshold (mask) */ | ||
106 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..4] */ | ||
107 | #endif | ||
108 | |||
109 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ | ||
110 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ | ||
111 | #define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */ | ||
112 | #define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */ | ||
113 | #define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */ | ||
114 | #define SSCR1_EBCEI (1 << 29) /* Enable Bit Count Error interrupt */ | ||
115 | #define SSCR1_SCFR (1 << 28) /* Slave Clock free Running */ | ||
116 | #define SSCR1_ECRA (1 << 27) /* Enable Clock Request A */ | ||
117 | #define SSCR1_ECRB (1 << 26) /* Enable Clock request B */ | ||
118 | #define SSCR1_SCLKDIR (1 << 25) /* Serial Bit Rate Clock Direction */ | ||
119 | #define SSCR1_SFRMDIR (1 << 24) /* Frame Direction */ | ||
120 | #define SSCR1_RWOT (1 << 23) /* Receive Without Transmit */ | ||
121 | #define SSCR1_TRAIL (1 << 22) /* Trailing Byte */ | ||
122 | #define SSCR1_TSRE (1 << 21) /* Transmit Service Request Enable */ | ||
123 | #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */ | ||
124 | #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */ | ||
125 | #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */ | ||
126 | #define SSCR1_IFS (1 << 16) /* Invert Frame Signal */ | ||
127 | #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */ | ||
128 | #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */ | ||
129 | |||
130 | #define SSSR_BCE (1 << 23) /* Bit Count Error */ | ||
131 | #define SSSR_CSS (1 << 22) /* Clock Synchronisation Status */ | ||
132 | #define SSSR_TUR (1 << 21) /* Transmit FIFO Under Run */ | ||
133 | #define SSSR_EOC (1 << 20) /* End Of Chain */ | ||
134 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | ||
135 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | ||
136 | |||
137 | |||
138 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ | ||
139 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
140 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
141 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
142 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
143 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
144 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
145 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
146 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
147 | |||
148 | /* PXA3xx */ | ||
149 | #define SSPSP_EDMYSTRT(x) ((x) << 26) /* Extended Dummy Start */ | ||
150 | #define SSPSP_EDMYSTOP(x) ((x) << 28) /* Extended Dummy Stop */ | ||
151 | #define SSPSP_TIMING_MASK (0x7f8001f0) | ||
152 | |||
153 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | ||
154 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | ||
155 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | ||
156 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ | ||
157 | |||
158 | enum pxa_ssp_type { | ||
159 | SSP_UNDEFINED = 0, | ||
160 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
161 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
162 | PXA27x_SSP, | ||
163 | PXA168_SSP, | ||
164 | CE4100_SSP, | ||
165 | }; | ||
166 | |||
167 | struct ssp_device { | ||
168 | struct platform_device *pdev; | ||
169 | struct list_head node; | ||
170 | |||
171 | struct clk *clk; | ||
172 | void __iomem *mmio_base; | ||
173 | unsigned long phys_base; | ||
174 | |||
175 | const char *label; | ||
176 | int port_id; | ||
177 | int type; | ||
178 | int use_count; | ||
179 | int irq; | ||
180 | int drcmr_rx; | ||
181 | int drcmr_tx; | ||
182 | }; | ||
183 | |||
184 | /** | ||
185 | * pxa_ssp_write_reg - Write to a SSP register | ||
186 | * | ||
187 | * @dev: SSP device to access | ||
188 | * @reg: Register to write to | ||
189 | * @val: Value to be written. | ||
190 | */ | ||
191 | static inline void pxa_ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | ||
192 | { | ||
193 | __raw_writel(val, dev->mmio_base + reg); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * pxa_ssp_read_reg - Read from a SSP register | ||
198 | * | ||
199 | * @dev: SSP device to access | ||
200 | * @reg: Register to read from | ||
201 | */ | ||
202 | static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) | ||
203 | { | ||
204 | return __raw_readl(dev->mmio_base + reg); | ||
205 | } | ||
206 | |||
207 | struct ssp_device *pxa_ssp_request(int port, const char *label); | ||
208 | void pxa_ssp_free(struct ssp_device *); | ||
209 | #endif | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index 94c1f03b50eb..9a85412e0db6 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 d1a9193960f1..eb354f6f26b3 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 ab2baa5c4884..23241c2fecce 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -146,6 +146,22 @@ static inline void *radix_tree_deref_slot(void **pslot) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * radix_tree_deref_slot_protected - dereference a slot without RCU lock but with tree lock held | ||
150 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot | ||
151 | * Returns: item that was stored in that slot with any direct pointer flag | ||
152 | * removed. | ||
153 | * | ||
154 | * Similar to radix_tree_deref_slot but only used during migration when a pages | ||
155 | * mapping is being moved. The caller does not hold the RCU read lock but it | ||
156 | * must hold the tree lock to prevent parallel updates. | ||
157 | */ | ||
158 | static inline void *radix_tree_deref_slot_protected(void **pslot, | ||
159 | spinlock_t *treelock) | ||
160 | { | ||
161 | return rcu_dereference_protected(*pslot, lockdep_is_held(treelock)); | ||
162 | } | ||
163 | |||
164 | /** | ||
149 | * radix_tree_deref_retry - check radix_tree_deref_slot | 165 | * radix_tree_deref_retry - check radix_tree_deref_slot |
150 | * @arg: pointer returned by radix_tree_deref_slot | 166 | * @arg: pointer returned by radix_tree_deref_slot |
151 | * Returns: 0 if retry is not required, otherwise retry is required | 167 | * Returns: 0 if retry is not required, otherwise retry is required |
diff --git a/include/linux/rar_register.h b/include/linux/rar_register.h index ffa805780f85..5c6118189363 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.h b/include/linux/rculist.h index f31ef61f1c65..2dea94fc4402 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -241,11 +241,6 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
241 | #define list_first_entry_rcu(ptr, type, member) \ | 241 | #define list_first_entry_rcu(ptr, type, member) \ |
242 | list_entry_rcu((ptr)->next, type, member) | 242 | list_entry_rcu((ptr)->next, type, member) |
243 | 243 | ||
244 | #define __list_for_each_rcu(pos, head) \ | ||
245 | for (pos = rcu_dereference_raw(list_next_rcu(head)); \ | ||
246 | pos != (head); \ | ||
247 | pos = rcu_dereference_raw(list_next_rcu((pos))) | ||
248 | |||
249 | /** | 244 | /** |
250 | * list_for_each_entry_rcu - iterate over rcu list of given type | 245 | * list_for_each_entry_rcu - iterate over rcu list of given type |
251 | * @pos: the type * to use as a loop cursor. | 246 | * @pos: the type * to use as a loop cursor. |
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h new file mode 100644 index 000000000000..cf1244fbf3b6 --- /dev/null +++ b/include/linux/rculist_bl.h | |||
@@ -0,0 +1,128 @@ | |||
1 | #ifndef _LINUX_RCULIST_BL_H | ||
2 | #define _LINUX_RCULIST_BL_H | ||
3 | |||
4 | /* | ||
5 | * RCU-protected bl list version. See include/linux/list_bl.h. | ||
6 | */ | ||
7 | #include <linux/list_bl.h> | ||
8 | #include <linux/rcupdate.h> | ||
9 | |||
10 | static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h, | ||
11 | struct hlist_bl_node *n) | ||
12 | { | ||
13 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
14 | LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != | ||
15 | LIST_BL_LOCKMASK); | ||
16 | rcu_assign_pointer(h->first, | ||
17 | (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK)); | ||
18 | } | ||
19 | |||
20 | static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h) | ||
21 | { | ||
22 | return (struct hlist_bl_node *) | ||
23 | ((unsigned long)rcu_dereference(h->first) & ~LIST_BL_LOCKMASK); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * hlist_bl_del_init_rcu - deletes entry from hash list with re-initialization | ||
28 | * @n: the element to delete from the hash list. | ||
29 | * | ||
30 | * Note: hlist_bl_unhashed() on the node returns true after this. It is | ||
31 | * useful for RCU based read lockfree traversal if the writer side | ||
32 | * must know if the list entry is still hashed or already unhashed. | ||
33 | * | ||
34 | * In particular, it means that we can not poison the forward pointers | ||
35 | * that may still be used for walking the hash list and we can only | ||
36 | * zero the pprev pointer so list_unhashed() will return true after | ||
37 | * this. | ||
38 | * | ||
39 | * The caller must take whatever precautions are necessary (such as | ||
40 | * holding appropriate locks) to avoid racing with another | ||
41 | * list-mutation primitive, such as hlist_bl_add_head_rcu() or | ||
42 | * hlist_bl_del_rcu(), running on this same list. However, it is | ||
43 | * perfectly legal to run concurrently with the _rcu list-traversal | ||
44 | * primitives, such as hlist_bl_for_each_entry_rcu(). | ||
45 | */ | ||
46 | static inline void hlist_bl_del_init_rcu(struct hlist_bl_node *n) | ||
47 | { | ||
48 | if (!hlist_bl_unhashed(n)) { | ||
49 | __hlist_bl_del(n); | ||
50 | n->pprev = NULL; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * hlist_bl_del_rcu - deletes entry from hash list without re-initialization | ||
56 | * @n: the element to delete from the hash list. | ||
57 | * | ||
58 | * Note: hlist_bl_unhashed() on entry does not return true after this, | ||
59 | * the entry is in an undefined state. It is useful for RCU based | ||
60 | * lockfree traversal. | ||
61 | * | ||
62 | * In particular, it means that we can not poison the forward | ||
63 | * pointers that may still be used for walking the hash list. | ||
64 | * | ||
65 | * The caller must take whatever precautions are necessary | ||
66 | * (such as holding appropriate locks) to avoid racing | ||
67 | * with another list-mutation primitive, such as hlist_bl_add_head_rcu() | ||
68 | * or hlist_bl_del_rcu(), running on this same list. | ||
69 | * However, it is perfectly legal to run concurrently with | ||
70 | * the _rcu list-traversal primitives, such as | ||
71 | * hlist_bl_for_each_entry(). | ||
72 | */ | ||
73 | static inline void hlist_bl_del_rcu(struct hlist_bl_node *n) | ||
74 | { | ||
75 | __hlist_bl_del(n); | ||
76 | n->pprev = LIST_POISON2; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * hlist_bl_add_head_rcu | ||
81 | * @n: the element to add to the hash list. | ||
82 | * @h: the list to add to. | ||
83 | * | ||
84 | * Description: | ||
85 | * Adds the specified element to the specified hlist_bl, | ||
86 | * while permitting racing traversals. | ||
87 | * | ||
88 | * The caller must take whatever precautions are necessary | ||
89 | * (such as holding appropriate locks) to avoid racing | ||
90 | * with another list-mutation primitive, such as hlist_bl_add_head_rcu() | ||
91 | * or hlist_bl_del_rcu(), running on this same list. | ||
92 | * However, it is perfectly legal to run concurrently with | ||
93 | * the _rcu list-traversal primitives, such as | ||
94 | * hlist_bl_for_each_entry_rcu(), used to prevent memory-consistency | ||
95 | * problems on Alpha CPUs. Regardless of the type of CPU, the | ||
96 | * list-traversal primitive must be guarded by rcu_read_lock(). | ||
97 | */ | ||
98 | static inline void hlist_bl_add_head_rcu(struct hlist_bl_node *n, | ||
99 | struct hlist_bl_head *h) | ||
100 | { | ||
101 | struct hlist_bl_node *first; | ||
102 | |||
103 | /* don't need hlist_bl_first_rcu because we're under lock */ | ||
104 | first = hlist_bl_first(h); | ||
105 | |||
106 | n->next = first; | ||
107 | if (first) | ||
108 | first->pprev = &n->next; | ||
109 | n->pprev = &h->first; | ||
110 | |||
111 | /* need _rcu because we can have concurrent lock free readers */ | ||
112 | hlist_bl_set_first_rcu(h, n); | ||
113 | } | ||
114 | /** | ||
115 | * hlist_bl_for_each_entry_rcu - iterate over rcu list of given type | ||
116 | * @tpos: the type * to use as a loop cursor. | ||
117 | * @pos: the &struct hlist_bl_node to use as a loop cursor. | ||
118 | * @head: the head for your list. | ||
119 | * @member: the name of the hlist_bl_node within the struct. | ||
120 | * | ||
121 | */ | ||
122 | #define hlist_bl_for_each_entry_rcu(tpos, pos, head, member) \ | ||
123 | for (pos = hlist_bl_first_rcu(head); \ | ||
124 | pos && \ | ||
125 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1; }); \ | ||
126 | pos = rcu_dereference_raw(pos->next)) | ||
127 | |||
128 | #endif | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 03cda7bed985..af5614856285 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -47,6 +47,8 @@ | |||
47 | extern int rcutorture_runnable; /* for sysctl */ | 47 | extern int rcutorture_runnable; /* for sysctl */ |
48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
49 | 49 | ||
50 | #define UINT_CMP_GE(a, b) (UINT_MAX / 2 >= (a) - (b)) | ||
51 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) | ||
50 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) | 52 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) |
51 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) | 53 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) |
52 | 54 | ||
@@ -66,7 +68,6 @@ extern void call_rcu_sched(struct rcu_head *head, | |||
66 | extern void synchronize_sched(void); | 68 | extern void synchronize_sched(void); |
67 | extern void rcu_barrier_bh(void); | 69 | extern void rcu_barrier_bh(void); |
68 | extern void rcu_barrier_sched(void); | 70 | extern void rcu_barrier_sched(void); |
69 | extern void synchronize_sched_expedited(void); | ||
70 | extern int sched_expedited_torture_stats(char *page); | 71 | extern int sched_expedited_torture_stats(char *page); |
71 | 72 | ||
72 | static inline void __rcu_read_lock_bh(void) | 73 | static inline void __rcu_read_lock_bh(void) |
@@ -118,7 +119,6 @@ static inline int rcu_preempt_depth(void) | |||
118 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 119 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
119 | 120 | ||
120 | /* Internal to kernel */ | 121 | /* Internal to kernel */ |
121 | extern void rcu_init(void); | ||
122 | extern void rcu_sched_qs(int cpu); | 122 | extern void rcu_sched_qs(int cpu); |
123 | extern void rcu_bh_qs(int cpu); | 123 | extern void rcu_bh_qs(int cpu); |
124 | extern void rcu_check_callbacks(int cpu, int user); | 124 | extern void rcu_check_callbacks(int cpu, int user); |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 13877cb93a60..30ebd7c8d874 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -27,7 +27,9 @@ | |||
27 | 27 | ||
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | 29 | ||
30 | #define rcu_init_sched() do { } while (0) | 30 | static inline void rcu_init(void) |
31 | { | ||
32 | } | ||
31 | 33 | ||
32 | #ifdef CONFIG_TINY_RCU | 34 | #ifdef CONFIG_TINY_RCU |
33 | 35 | ||
@@ -58,6 +60,11 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
58 | synchronize_sched(); | 60 | synchronize_sched(); |
59 | } | 61 | } |
60 | 62 | ||
63 | static inline void synchronize_sched_expedited(void) | ||
64 | { | ||
65 | synchronize_sched(); | ||
66 | } | ||
67 | |||
61 | #ifdef CONFIG_TINY_RCU | 68 | #ifdef CONFIG_TINY_RCU |
62 | 69 | ||
63 | static inline void rcu_preempt_note_context_switch(void) | 70 | static inline void rcu_preempt_note_context_switch(void) |
@@ -125,16 +132,12 @@ static inline void rcu_cpu_stall_reset(void) | |||
125 | } | 132 | } |
126 | 133 | ||
127 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 134 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
128 | |||
129 | extern int rcu_scheduler_active __read_mostly; | 135 | extern int rcu_scheduler_active __read_mostly; |
130 | extern void rcu_scheduler_starting(void); | 136 | extern void rcu_scheduler_starting(void); |
131 | |||
132 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 137 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
133 | |||
134 | static inline void rcu_scheduler_starting(void) | 138 | static inline void rcu_scheduler_starting(void) |
135 | { | 139 | { |
136 | } | 140 | } |
137 | |||
138 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 141 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
139 | 142 | ||
140 | #endif /* __LINUX_RCUTINY_H */ | 143 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 95518e628794..3a933482734a 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | extern void rcu_init(void); | ||
33 | extern void rcu_note_context_switch(int cpu); | 34 | extern void rcu_note_context_switch(int cpu); |
34 | extern int rcu_needs_cpu(int cpu); | 35 | extern int rcu_needs_cpu(int cpu); |
35 | extern void rcu_cpu_stall_reset(void); | 36 | extern void rcu_cpu_stall_reset(void); |
@@ -47,6 +48,7 @@ static inline void exit_rcu(void) | |||
47 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ |
48 | 49 | ||
49 | extern void synchronize_rcu_bh(void); | 50 | extern void synchronize_rcu_bh(void); |
51 | extern void synchronize_sched_expedited(void); | ||
50 | extern void synchronize_rcu_expedited(void); | 52 | extern void synchronize_rcu_expedited(void); |
51 | 53 | ||
52 | static inline void synchronize_rcu_bh_expedited(void) | 54 | static inline void synchronize_rcu_bh_expedited(void) |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index f509877c2ed4..6a210f1511fc 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
@@ -11,15 +11,17 @@ | |||
11 | #define __LINUX_MFD_AB8500_REGULATOR_H | 11 | #define __LINUX_MFD_AB8500_REGULATOR_H |
12 | 12 | ||
13 | /* AB8500 regulators */ | 13 | /* AB8500 regulators */ |
14 | #define AB8500_LDO_AUX1 0 | 14 | enum ab8500_regulator_id { |
15 | #define AB8500_LDO_AUX2 1 | 15 | AB8500_LDO_AUX1, |
16 | #define AB8500_LDO_AUX3 2 | 16 | AB8500_LDO_AUX2, |
17 | #define AB8500_LDO_INTCORE 3 | 17 | AB8500_LDO_AUX3, |
18 | #define AB8500_LDO_TVOUT 4 | 18 | AB8500_LDO_INTCORE, |
19 | #define AB8500_LDO_AUDIO 5 | 19 | AB8500_LDO_TVOUT, |
20 | #define AB8500_LDO_ANAMIC1 6 | 20 | AB8500_LDO_AUDIO, |
21 | #define AB8500_LDO_ANAMIC2 7 | 21 | AB8500_LDO_ANAMIC1, |
22 | #define AB8500_LDO_DMIC 8 | 22 | AB8500_LDO_ANAMIC2, |
23 | #define AB8500_LDO_ANA 9 | 23 | AB8500_LDO_DMIC, |
24 | 24 | AB8500_LDO_ANA, | |
25 | AB8500_NUM_REGULATORS, | ||
26 | }; | ||
25 | #endif | 27 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index ebd747265294..7954f6bd7edb 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -154,6 +154,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | |||
154 | int min_uV, int max_uV); | 154 | int min_uV, int max_uV); |
155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
156 | int regulator_get_voltage(struct regulator *regulator); | 156 | int regulator_get_voltage(struct regulator *regulator); |
157 | int regulator_sync_voltage(struct regulator *regulator); | ||
157 | int regulator_set_current_limit(struct regulator *regulator, | 158 | int regulator_set_current_limit(struct regulator *regulator, |
158 | int min_uA, int max_uA); | 159 | int min_uA, int max_uA); |
159 | int regulator_get_current_limit(struct regulator *regulator); | 160 | int regulator_get_current_limit(struct regulator *regulator); |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 592cd7c642c2..b8ed16a33c47 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -42,7 +42,11 @@ enum regulator_status { | |||
42 | * | 42 | * |
43 | * @set_voltage: Set the voltage for the regulator within the range specified. | 43 | * @set_voltage: Set the voltage for the regulator within the range specified. |
44 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
45 | * @set_voltage_sel: Set the voltage for the regulator using the specified | ||
46 | * selector. | ||
45 | * @get_voltage: Return the currently configured voltage for the regulator. | 47 | * @get_voltage: Return the currently configured voltage for the regulator. |
48 | * @get_voltage_sel: Return the currently configured voltage selector for the | ||
49 | * regulator. | ||
46 | * @list_voltage: Return one of the supported voltages, in microvolts; zero | 50 | * @list_voltage: Return one of the supported voltages, in microvolts; zero |
47 | * if the selector indicates a voltage that is unusable on this system; | 51 | * if the selector indicates a voltage that is unusable on this system; |
48 | * or negative errno. Selectors range from zero to one less than | 52 | * or negative errno. Selectors range from zero to one less than |
@@ -79,8 +83,11 @@ struct regulator_ops { | |||
79 | int (*list_voltage) (struct regulator_dev *, unsigned selector); | 83 | int (*list_voltage) (struct regulator_dev *, unsigned selector); |
80 | 84 | ||
81 | /* get/set regulator voltage */ | 85 | /* get/set regulator voltage */ |
82 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); | 86 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV, |
87 | unsigned *selector); | ||
88 | int (*set_voltage_sel) (struct regulator_dev *, unsigned selector); | ||
83 | int (*get_voltage) (struct regulator_dev *); | 89 | int (*get_voltage) (struct regulator_dev *); |
90 | int (*get_voltage_sel) (struct regulator_dev *); | ||
84 | 91 | ||
85 | /* get/set regulator current */ | 92 | /* get/set regulator current */ |
86 | int (*set_current_limit) (struct regulator_dev *, | 93 | int (*set_current_limit) (struct regulator_dev *, |
@@ -168,9 +175,9 @@ struct regulator_desc { | |||
168 | */ | 175 | */ |
169 | struct regulator_dev { | 176 | struct regulator_dev { |
170 | struct regulator_desc *desc; | 177 | struct regulator_desc *desc; |
171 | int use_count; | ||
172 | int open_count; | ||
173 | int exclusive; | 178 | int exclusive; |
179 | u32 use_count; | ||
180 | u32 open_count; | ||
174 | 181 | ||
175 | /* lists we belong to */ | 182 | /* lists we belong to */ |
176 | struct list_head list; /* list of all regulators */ | 183 | struct list_head list; /* list of all regulators */ |
@@ -188,10 +195,14 @@ struct regulator_dev { | |||
188 | struct regulator_dev *supply; /* for tree */ | 195 | struct regulator_dev *supply; /* for tree */ |
189 | 196 | ||
190 | void *reg_data; /* regulator_dev data */ | 197 | void *reg_data; /* regulator_dev data */ |
198 | |||
199 | #ifdef CONFIG_DEBUG_FS | ||
200 | struct dentry *debugfs; | ||
201 | #endif | ||
191 | }; | 202 | }; |
192 | 203 | ||
193 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 204 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
194 | struct device *dev, struct regulator_init_data *init_data, | 205 | struct device *dev, const struct regulator_init_data *init_data, |
195 | void *driver_data); | 206 | void *driver_data); |
196 | void regulator_unregister(struct regulator_dev *rdev); | 207 | void regulator_unregister(struct regulator_dev *rdev); |
197 | 208 | ||
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index b2cf2089769b..3b94c91f20a6 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -41,7 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags); | |||
41 | int reiserfs_lookup_privroot(struct super_block *sb); | 41 | int reiserfs_lookup_privroot(struct super_block *sb); |
42 | int reiserfs_delete_xattrs(struct inode *inode); | 42 | int reiserfs_delete_xattrs(struct inode *inode); |
43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); | 43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
44 | int reiserfs_permission(struct inode *inode, int mask); | 44 | int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); |
45 | 45 | ||
46 | #ifdef CONFIG_REISERFS_FS_XATTR | 46 | #ifdef CONFIG_REISERFS_FS_XATTR |
47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) | 47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index fcb9884df618..a5930cb66145 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -182,6 +182,26 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt) | |||
182 | return ret; | 182 | return ret; |
183 | } | 183 | } |
184 | 184 | ||
185 | /** | ||
186 | * res_counter_check_margin - check if the counter allows charging | ||
187 | * @cnt: the resource counter to check | ||
188 | * @bytes: the number of bytes to check the remaining space against | ||
189 | * | ||
190 | * Returns a boolean value on whether the counter can be charged | ||
191 | * @bytes or whether this would exceed the limit. | ||
192 | */ | ||
193 | static inline bool res_counter_check_margin(struct res_counter *cnt, | ||
194 | unsigned long bytes) | ||
195 | { | ||
196 | bool ret; | ||
197 | unsigned long flags; | ||
198 | |||
199 | spin_lock_irqsave(&cnt->lock, flags); | ||
200 | ret = cnt->limit - cnt->usage >= bytes; | ||
201 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
202 | return ret; | ||
203 | } | ||
204 | |||
185 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | 205 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) |
186 | { | 206 | { |
187 | bool ret; | 207 | bool ret; |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 08c32e4f261a..c6c608482cba 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -354,37 +354,6 @@ static inline bool rfkill_blocked(struct rfkill *rfkill) | |||
354 | } | 354 | } |
355 | #endif /* RFKILL || RFKILL_MODULE */ | 355 | #endif /* RFKILL || RFKILL_MODULE */ |
356 | 356 | ||
357 | |||
358 | #ifdef CONFIG_RFKILL_LEDS | ||
359 | /** | ||
360 | * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED. | ||
361 | * This function might return a NULL pointer if registering of the | ||
362 | * LED trigger failed. Use this as "default_trigger" for the LED. | ||
363 | */ | ||
364 | const char *rfkill_get_led_trigger_name(struct rfkill *rfkill); | ||
365 | |||
366 | /** | ||
367 | * rfkill_set_led_trigger_name -- set the LED trigger name | ||
368 | * @rfkill: rfkill struct | ||
369 | * @name: LED trigger name | ||
370 | * | ||
371 | * This function sets the LED trigger name of the radio LED | ||
372 | * trigger that rfkill creates. It is optional, but if called | ||
373 | * must be called before rfkill_register() to be effective. | ||
374 | */ | ||
375 | void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); | ||
376 | #else | ||
377 | static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) | ||
378 | { | ||
379 | return NULL; | ||
380 | } | ||
381 | |||
382 | static inline void | ||
383 | rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) | ||
384 | { | ||
385 | } | ||
386 | #endif | ||
387 | |||
388 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
389 | 358 | ||
390 | #endif /* RFKILL_H */ | 359 | #endif /* RFKILL_H */ |
diff --git a/include/linux/rio.h b/include/linux/rio.h index 0bed941f9b13..ff681ebba585 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -66,14 +66,62 @@ | |||
66 | 66 | ||
67 | #define RIO_PW_MSG_SIZE 64 | 67 | #define RIO_PW_MSG_SIZE 64 |
68 | 68 | ||
69 | /* | ||
70 | * A component tag value (stored in the component tag CSR) is used as device's | ||
71 | * unique identifier assigned during enumeration. Besides being used for | ||
72 | * identifying switches (which do not have device ID register), it also is used | ||
73 | * by error management notification and therefore has to be assigned | ||
74 | * to endpoints as well. | ||
75 | */ | ||
76 | #define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */ | ||
77 | #define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ | ||
78 | |||
69 | extern struct bus_type rio_bus_type; | 79 | extern struct bus_type rio_bus_type; |
70 | extern struct device rio_bus; | 80 | extern struct device rio_bus; |
71 | extern struct list_head rio_devices; /* list of all devices */ | 81 | extern struct list_head rio_devices; /* list of all devices */ |
72 | 82 | ||
73 | struct rio_mport; | 83 | struct rio_mport; |
84 | struct rio_dev; | ||
74 | union rio_pw_msg; | 85 | union rio_pw_msg; |
75 | 86 | ||
76 | /** | 87 | /** |
88 | * struct rio_switch - RIO switch info | ||
89 | * @node: Node in global list of switches | ||
90 | * @switchid: Switch ID that is unique across a network | ||
91 | * @route_table: Copy of switch routing table | ||
92 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
93 | * @add_entry: Callback for switch-specific route add function | ||
94 | * @get_entry: Callback for switch-specific route get function | ||
95 | * @clr_table: Callback for switch-specific clear route table function | ||
96 | * @set_domain: Callback for switch-specific domain setting function | ||
97 | * @get_domain: Callback for switch-specific domain get function | ||
98 | * @em_init: Callback for switch-specific error management init function | ||
99 | * @em_handle: Callback for switch-specific error management handler function | ||
100 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
101 | * @nextdev: Array of per-port pointers to the next attached device | ||
102 | */ | ||
103 | struct rio_switch { | ||
104 | struct list_head node; | ||
105 | u16 switchid; | ||
106 | u8 *route_table; | ||
107 | u32 port_ok; | ||
108 | int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
109 | u16 table, u16 route_destid, u8 route_port); | ||
110 | int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
111 | u16 table, u16 route_destid, u8 *route_port); | ||
112 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
113 | u16 table); | ||
114 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
115 | u8 sw_domain); | ||
116 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
117 | u8 *sw_domain); | ||
118 | int (*em_init) (struct rio_dev *dev); | ||
119 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
120 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
121 | struct rio_dev *nextdev[0]; | ||
122 | }; | ||
123 | |||
124 | /** | ||
77 | * struct rio_dev - RIO device info | 125 | * struct rio_dev - RIO device info |
78 | * @global_list: Node in list of all RIO devices | 126 | * @global_list: Node in list of all RIO devices |
79 | * @net_list: Node in list of RIO devices in a network | 127 | * @net_list: Node in list of RIO devices in a network |
@@ -93,13 +141,14 @@ union rio_pw_msg; | |||
93 | * @phys_efptr: RIO device extended features pointer | 141 | * @phys_efptr: RIO device extended features pointer |
94 | * @em_efptr: RIO Error Management features pointer | 142 | * @em_efptr: RIO Error Management features pointer |
95 | * @dma_mask: Mask of bits of RIO address this device implements | 143 | * @dma_mask: Mask of bits of RIO address this device implements |
96 | * @rswitch: Pointer to &struct rio_switch if valid for this device | ||
97 | * @driver: Driver claiming this device | 144 | * @driver: Driver claiming this device |
98 | * @dev: Device model device | 145 | * @dev: Device model device |
99 | * @riores: RIO resources this device owns | 146 | * @riores: RIO resources this device owns |
100 | * @pwcback: port-write callback function for this device | 147 | * @pwcback: port-write callback function for this device |
101 | * @destid: Network destination ID | 148 | * @destid: Network destination ID (or associated destid for switch) |
149 | * @hopcount: Hopcount to this device | ||
102 | * @prev: Previous RIO device connected to the current one | 150 | * @prev: Previous RIO device connected to the current one |
151 | * @rswitch: struct rio_switch (if valid for this device) | ||
103 | */ | 152 | */ |
104 | struct rio_dev { | 153 | struct rio_dev { |
105 | struct list_head global_list; /* node in list of all RIO devices */ | 154 | struct list_head global_list; /* node in list of all RIO devices */ |
@@ -120,18 +169,20 @@ struct rio_dev { | |||
120 | u32 phys_efptr; | 169 | u32 phys_efptr; |
121 | u32 em_efptr; | 170 | u32 em_efptr; |
122 | u64 dma_mask; | 171 | u64 dma_mask; |
123 | struct rio_switch *rswitch; /* RIO switch info */ | ||
124 | struct rio_driver *driver; /* RIO driver claiming this device */ | 172 | struct rio_driver *driver; /* RIO driver claiming this device */ |
125 | struct device dev; /* LDM device structure */ | 173 | struct device dev; /* LDM device structure */ |
126 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | 174 | struct resource riores[RIO_MAX_DEV_RESOURCES]; |
127 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); | 175 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); |
128 | u16 destid; | 176 | u16 destid; |
177 | u8 hopcount; | ||
129 | struct rio_dev *prev; | 178 | struct rio_dev *prev; |
179 | struct rio_switch rswitch[0]; /* RIO switch info */ | ||
130 | }; | 180 | }; |
131 | 181 | ||
132 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) | 182 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) |
133 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) | 183 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) |
134 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) | 184 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) |
185 | #define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0]) | ||
135 | 186 | ||
136 | /** | 187 | /** |
137 | * struct rio_msg - RIO message event | 188 | * struct rio_msg - RIO message event |
@@ -224,49 +275,6 @@ struct rio_net { | |||
224 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ | 275 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ |
225 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ | 276 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ |
226 | 277 | ||
227 | /** | ||
228 | * struct rio_switch - RIO switch info | ||
229 | * @node: Node in global list of switches | ||
230 | * @rdev: Associated RIO device structure | ||
231 | * @switchid: Switch ID that is unique across a network | ||
232 | * @hopcount: Hopcount to this switch | ||
233 | * @destid: Associated destid in the path | ||
234 | * @route_table: Copy of switch routing table | ||
235 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
236 | * @add_entry: Callback for switch-specific route add function | ||
237 | * @get_entry: Callback for switch-specific route get function | ||
238 | * @clr_table: Callback for switch-specific clear route table function | ||
239 | * @set_domain: Callback for switch-specific domain setting function | ||
240 | * @get_domain: Callback for switch-specific domain get function | ||
241 | * @em_init: Callback for switch-specific error management initialization function | ||
242 | * @em_handle: Callback for switch-specific error management handler function | ||
243 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
244 | * @nextdev: Array of per-port pointers to the next attached device | ||
245 | */ | ||
246 | struct rio_switch { | ||
247 | struct list_head node; | ||
248 | struct rio_dev *rdev; | ||
249 | u16 switchid; | ||
250 | u16 hopcount; | ||
251 | u16 destid; | ||
252 | u8 *route_table; | ||
253 | u32 port_ok; | ||
254 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
255 | u16 table, u16 route_destid, u8 route_port); | ||
256 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
257 | u16 table, u16 route_destid, u8 * route_port); | ||
258 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
259 | u16 table); | ||
260 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
261 | u8 sw_domain); | ||
262 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
263 | u8 *sw_domain); | ||
264 | int (*em_init) (struct rio_dev *dev); | ||
265 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
266 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
267 | struct rio_dev *nextdev[0]; | ||
268 | }; | ||
269 | |||
270 | /* Low-level architecture-dependent routines */ | 278 | /* Low-level architecture-dependent routines */ |
271 | 279 | ||
272 | /** | 280 | /** |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index edc55da717b3..e09e565c4bce 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -150,16 +150,8 @@ static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset, | |||
150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | 150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, |
151 | u32 * data) | 151 | u32 * data) |
152 | { | 152 | { |
153 | u8 hopcount = 0xff; | 153 | return rio_mport_read_config_32(rdev->net->hport, rdev->destid, |
154 | u16 destid = rdev->destid; | 154 | rdev->hopcount, offset, data); |
155 | |||
156 | if (rdev->rswitch) { | ||
157 | destid = rdev->rswitch->destid; | ||
158 | hopcount = rdev->rswitch->hopcount; | ||
159 | } | ||
160 | |||
161 | return rio_mport_read_config_32(rdev->net->hport, destid, hopcount, | ||
162 | offset, data); | ||
163 | }; | 155 | }; |
164 | 156 | ||
165 | /** | 157 | /** |
@@ -174,16 +166,8 @@ static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | |||
174 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | 166 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, |
175 | u32 data) | 167 | u32 data) |
176 | { | 168 | { |
177 | u8 hopcount = 0xff; | 169 | return rio_mport_write_config_32(rdev->net->hport, rdev->destid, |
178 | u16 destid = rdev->destid; | 170 | rdev->hopcount, offset, data); |
179 | |||
180 | if (rdev->rswitch) { | ||
181 | destid = rdev->rswitch->destid; | ||
182 | hopcount = rdev->rswitch->hopcount; | ||
183 | } | ||
184 | |||
185 | return rio_mport_write_config_32(rdev->net->hport, destid, hopcount, | ||
186 | offset, data); | ||
187 | }; | 171 | }; |
188 | 172 | ||
189 | /** | 173 | /** |
@@ -198,16 +182,8 @@ static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | |||
198 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | 182 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, |
199 | u16 * data) | 183 | u16 * data) |
200 | { | 184 | { |
201 | u8 hopcount = 0xff; | 185 | return rio_mport_read_config_16(rdev->net->hport, rdev->destid, |
202 | u16 destid = rdev->destid; | 186 | rdev->hopcount, offset, data); |
203 | |||
204 | if (rdev->rswitch) { | ||
205 | destid = rdev->rswitch->destid; | ||
206 | hopcount = rdev->rswitch->hopcount; | ||
207 | } | ||
208 | |||
209 | return rio_mport_read_config_16(rdev->net->hport, destid, hopcount, | ||
210 | offset, data); | ||
211 | }; | 187 | }; |
212 | 188 | ||
213 | /** | 189 | /** |
@@ -222,16 +198,8 @@ static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | |||
222 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | 198 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, |
223 | u16 data) | 199 | u16 data) |
224 | { | 200 | { |
225 | u8 hopcount = 0xff; | 201 | return rio_mport_write_config_16(rdev->net->hport, rdev->destid, |
226 | u16 destid = rdev->destid; | 202 | rdev->hopcount, offset, data); |
227 | |||
228 | if (rdev->rswitch) { | ||
229 | destid = rdev->rswitch->destid; | ||
230 | hopcount = rdev->rswitch->hopcount; | ||
231 | } | ||
232 | |||
233 | return rio_mport_write_config_16(rdev->net->hport, destid, hopcount, | ||
234 | offset, data); | ||
235 | }; | 203 | }; |
236 | 204 | ||
237 | /** | 205 | /** |
@@ -245,16 +213,8 @@ static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | |||
245 | */ | 213 | */ |
246 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | 214 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) |
247 | { | 215 | { |
248 | u8 hopcount = 0xff; | 216 | return rio_mport_read_config_8(rdev->net->hport, rdev->destid, |
249 | u16 destid = rdev->destid; | 217 | rdev->hopcount, offset, data); |
250 | |||
251 | if (rdev->rswitch) { | ||
252 | destid = rdev->rswitch->destid; | ||
253 | hopcount = rdev->rswitch->hopcount; | ||
254 | } | ||
255 | |||
256 | return rio_mport_read_config_8(rdev->net->hport, destid, hopcount, | ||
257 | offset, data); | ||
258 | }; | 218 | }; |
259 | 219 | ||
260 | /** | 220 | /** |
@@ -268,16 +228,8 @@ static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | |||
268 | */ | 228 | */ |
269 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) | 229 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) |
270 | { | 230 | { |
271 | u8 hopcount = 0xff; | 231 | return rio_mport_write_config_8(rdev->net->hport, rdev->destid, |
272 | u16 destid = rdev->destid; | 232 | rdev->hopcount, offset, data); |
273 | |||
274 | if (rdev->rswitch) { | ||
275 | destid = rdev->rswitch->destid; | ||
276 | hopcount = rdev->rswitch->hopcount; | ||
277 | } | ||
278 | |||
279 | return rio_mport_write_config_8(rdev->net->hport, destid, hopcount, | ||
280 | offset, data); | ||
281 | }; | 233 | }; |
282 | 234 | ||
283 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, | 235 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index ee7b6ada188f..7410d3365e2a 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -36,5 +36,7 @@ | |||
36 | #define RIO_DID_IDTCPS10Q 0x035e | 36 | #define RIO_DID_IDTCPS10Q 0x035e |
37 | #define RIO_DID_IDTCPS1848 0x0374 | 37 | #define RIO_DID_IDTCPS1848 0x0374 |
38 | #define RIO_DID_IDTCPS1616 0x0379 | 38 | #define RIO_DID_IDTCPS1616 0x0379 |
39 | #define RIO_DID_IDTVPS1616 0x0377 | ||
40 | #define RIO_DID_IDTSPS1616 0x0378 | ||
39 | 41 | ||
40 | #endif /* LINUX_RIO_IDS_H */ | 42 | #endif /* LINUX_RIO_IDS_H */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bb83c0da2071..e9fd04ca1e51 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -198,6 +198,8 @@ enum ttu_flags { | |||
198 | }; | 198 | }; |
199 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 199 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
200 | 200 | ||
201 | bool is_vma_temporary_stack(struct vm_area_struct *vma); | ||
202 | |||
201 | int try_to_unmap(struct page *, enum ttu_flags flags); | 203 | int try_to_unmap(struct page *, enum ttu_flags flags); |
202 | int try_to_unmap_one(struct page *, struct vm_area_struct *, | 204 | int try_to_unmap_one(struct page *, struct vm_area_struct *, |
203 | unsigned long address, enum ttu_flags flags); | 205 | unsigned long address, enum ttu_flags flags); |
diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h index c490fbc43fe2..5f57f93b284f 100644 --- a/include/linux/romfs_fs.h +++ b/include/linux/romfs_fs.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __LINUX_ROMFS_FS_H | 1 | #ifndef __LINUX_ROMFS_FS_H |
2 | #define __LINUX_ROMFS_FS_H | 2 | #define __LINUX_ROMFS_FS_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/fs.h> | ||
6 | |||
4 | /* The basic structures of the romfs filesystem */ | 7 | /* The basic structures of the romfs filesystem */ |
5 | 8 | ||
6 | #define ROMBSIZE BLOCK_SIZE | 9 | #define ROMBSIZE BLOCK_SIZE |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 14dbc83ded20..89c3e5182991 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,6 +196,15 @@ 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; |
199 | |||
200 | struct timerqueue_head timerqueue; | ||
201 | struct rtc_timer aie_timer; | ||
202 | struct rtc_timer uie_rtctimer; | ||
203 | struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */ | ||
204 | int pie_enabled; | ||
205 | struct work_struct irqwork; | ||
206 | |||
207 | |||
182 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | 208 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL |
183 | struct work_struct uie_task; | 209 | struct work_struct uie_task; |
184 | struct timer_list uie_timer; | 210 | struct timer_list uie_timer; |
@@ -224,15 +250,21 @@ 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, | 250 | extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, |
225 | unsigned int enabled); | 251 | unsigned int enabled); |
226 | 252 | ||
227 | typedef struct rtc_task { | 253 | void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode); |
228 | void (*func)(void *private_data); | 254 | void rtc_aie_update_irq(void *private); |
229 | void *private_data; | 255 | void rtc_uie_update_irq(void *private); |
230 | } rtc_task_t; | 256 | enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer); |
231 | 257 | ||
232 | int rtc_register(rtc_task_t *task); | 258 | int rtc_register(rtc_task_t *task); |
233 | int rtc_unregister(rtc_task_t *task); | 259 | int rtc_unregister(rtc_task_t *task); |
234 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); | 260 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); |
235 | 261 | ||
262 | void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data); | ||
263 | int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer, | ||
264 | ktime_t expires, ktime_t period); | ||
265 | int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer* timer); | ||
266 | void rtc_timer_do_work(struct work_struct *work); | ||
267 | |||
236 | static inline bool is_leap_year(unsigned int year) | 268 | static inline bool is_leap_year(unsigned int year) |
237 | { | 269 | { |
238 | return (!(year % 4) && (year % 100)) || !(year % 400); | 270 | return (!(year % 4) && (year % 100)) || !(year % 400); |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index dbce22faa660..fbe58b7e63eb 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h | |||
@@ -14,6 +14,7 @@ struct s3c_adc_bat_pdata { | |||
14 | void (*disable_charger)(void); | 14 | void (*disable_charger)(void); |
15 | 15 | ||
16 | int gpio_charge_finished; | 16 | int gpio_charge_finished; |
17 | int gpio_inverted; | ||
17 | 18 | ||
18 | const struct s3c_adc_bat_thresh *lut_noac; | 19 | const struct s3c_adc_bat_thresh *lut_noac; |
19 | unsigned int lut_noac_cnt; | 20 | unsigned int lut_noac_cnt; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 223874538b33..777d8a5ed06b 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 | ||
@@ -316,6 +315,7 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write, | |||
316 | size_t *lenp, loff_t *ppos); | 315 | size_t *lenp, loff_t *ppos); |
317 | extern unsigned int softlockup_panic; | 316 | extern unsigned int softlockup_panic; |
318 | extern int softlockup_thresh; | 317 | extern int softlockup_thresh; |
318 | void lockup_detector_init(void); | ||
319 | #else | 319 | #else |
320 | static inline void touch_softlockup_watchdog(void) | 320 | static inline void touch_softlockup_watchdog(void) |
321 | { | 321 | { |
@@ -326,6 +326,9 @@ static inline void touch_softlockup_watchdog_sync(void) | |||
326 | static inline void touch_all_softlockup_watchdogs(void) | 326 | static inline void touch_all_softlockup_watchdogs(void) |
327 | { | 327 | { |
328 | } | 328 | } |
329 | static inline void lockup_detector_init(void) | ||
330 | { | ||
331 | } | ||
329 | #endif | 332 | #endif |
330 | 333 | ||
331 | #ifdef CONFIG_DETECT_HUNG_TASK | 334 | #ifdef CONFIG_DETECT_HUNG_TASK |
@@ -431,6 +434,7 @@ extern int get_dumpable(struct mm_struct *mm); | |||
431 | #endif | 434 | #endif |
432 | /* leave room for more dump flags */ | 435 | /* leave room for more dump flags */ |
433 | #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 */ | ||
434 | 438 | ||
435 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | 439 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) |
436 | 440 | ||
@@ -509,6 +513,8 @@ struct thread_group_cputimer { | |||
509 | spinlock_t lock; | 513 | spinlock_t lock; |
510 | }; | 514 | }; |
511 | 515 | ||
516 | struct autogroup; | ||
517 | |||
512 | /* | 518 | /* |
513 | * NOTE! "signal_struct" does not have it's own | 519 | * NOTE! "signal_struct" does not have it's own |
514 | * locking, because a shared signal_struct always | 520 | * locking, because a shared signal_struct always |
@@ -576,6 +582,9 @@ struct signal_struct { | |||
576 | 582 | ||
577 | struct tty_struct *tty; /* NULL if no tty */ | 583 | struct tty_struct *tty; /* NULL if no tty */ |
578 | 584 | ||
585 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
586 | struct autogroup *autogroup; | ||
587 | #endif | ||
579 | /* | 588 | /* |
580 | * Cumulative resource counters for dead threads in the group, | 589 | * Cumulative resource counters for dead threads in the group, |
581 | * and for reaped dead child processes forked by this group. | 590 | * and for reaped dead child processes forked by this group. |
@@ -626,6 +635,8 @@ struct signal_struct { | |||
626 | 635 | ||
627 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 636 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
628 | 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. */ | ||
629 | 640 | ||
630 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 641 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
631 | * credential calculations | 642 | * credential calculations |
@@ -676,7 +687,7 @@ struct user_struct { | |||
676 | atomic_t fanotify_listeners; | 687 | atomic_t fanotify_listeners; |
677 | #endif | 688 | #endif |
678 | #ifdef CONFIG_EPOLL | 689 | #ifdef CONFIG_EPOLL |
679 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 690 | atomic_long_t epoll_watches; /* The number of file descriptors currently watched */ |
680 | #endif | 691 | #endif |
681 | #ifdef CONFIG_POSIX_MQUEUE | 692 | #ifdef CONFIG_POSIX_MQUEUE |
682 | /* protected by mq_lock */ | 693 | /* protected by mq_lock */ |
@@ -1229,13 +1240,18 @@ struct task_struct { | |||
1229 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1240 | #ifdef CONFIG_TREE_PREEMPT_RCU |
1230 | struct rcu_node *rcu_blocked_node; | 1241 | struct rcu_node *rcu_blocked_node; |
1231 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 1242 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
1243 | #ifdef CONFIG_RCU_BOOST | ||
1244 | struct rt_mutex *rcu_boost_mutex; | ||
1245 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
1232 | 1246 | ||
1233 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 1247 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
1234 | struct sched_info sched_info; | 1248 | struct sched_info sched_info; |
1235 | #endif | 1249 | #endif |
1236 | 1250 | ||
1237 | struct list_head tasks; | 1251 | struct list_head tasks; |
1252 | #ifdef CONFIG_SMP | ||
1238 | struct plist_node pushable_tasks; | 1253 | struct plist_node pushable_tasks; |
1254 | #endif | ||
1239 | 1255 | ||
1240 | struct mm_struct *mm, *active_mm; | 1256 | struct mm_struct *mm, *active_mm; |
1241 | #if defined(SPLIT_RSS_COUNTING) | 1257 | #if defined(SPLIT_RSS_COUNTING) |
@@ -1728,7 +1744,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1728 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | 1744 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ |
1729 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1745 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
1730 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1746 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
1731 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ | 1747 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ |
1732 | #define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */ | 1748 | #define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */ |
1733 | 1749 | ||
1734 | /* | 1750 | /* |
@@ -1759,7 +1775,8 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1759 | #ifdef CONFIG_PREEMPT_RCU | 1775 | #ifdef CONFIG_PREEMPT_RCU |
1760 | 1776 | ||
1761 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | 1777 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ |
1762 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ | 1778 | #define RCU_READ_UNLOCK_BOOSTED (1 << 1) /* boosted while in RCU read-side. */ |
1779 | #define RCU_READ_UNLOCK_NEED_QS (1 << 2) /* RCU core needs CPU response. */ | ||
1763 | 1780 | ||
1764 | static inline void rcu_copy_process(struct task_struct *p) | 1781 | static inline void rcu_copy_process(struct task_struct *p) |
1765 | { | 1782 | { |
@@ -1767,7 +1784,10 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
1767 | p->rcu_read_unlock_special = 0; | 1784 | p->rcu_read_unlock_special = 0; |
1768 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1785 | #ifdef CONFIG_TREE_PREEMPT_RCU |
1769 | p->rcu_blocked_node = NULL; | 1786 | p->rcu_blocked_node = NULL; |
1770 | #endif | 1787 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
1788 | #ifdef CONFIG_RCU_BOOST | ||
1789 | p->rcu_boost_mutex = NULL; | ||
1790 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
1771 | INIT_LIST_HEAD(&p->rcu_node_entry); | 1791 | INIT_LIST_HEAD(&p->rcu_node_entry); |
1772 | } | 1792 | } |
1773 | 1793 | ||
@@ -1872,14 +1892,11 @@ extern void sched_clock_idle_sleep_event(void); | |||
1872 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1892 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1873 | 1893 | ||
1874 | #ifdef CONFIG_HOTPLUG_CPU | 1894 | #ifdef CONFIG_HOTPLUG_CPU |
1875 | extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p); | ||
1876 | extern void idle_task_exit(void); | 1895 | extern void idle_task_exit(void); |
1877 | #else | 1896 | #else |
1878 | static inline void idle_task_exit(void) {} | 1897 | static inline void idle_task_exit(void) {} |
1879 | #endif | 1898 | #endif |
1880 | 1899 | ||
1881 | extern void sched_idle_next(void); | ||
1882 | |||
1883 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 1900 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |
1884 | extern void wake_up_idle_cpu(int cpu); | 1901 | extern void wake_up_idle_cpu(int cpu); |
1885 | #else | 1902 | #else |
@@ -1889,8 +1906,6 @@ static inline void wake_up_idle_cpu(int cpu) { } | |||
1889 | extern unsigned int sysctl_sched_latency; | 1906 | extern unsigned int sysctl_sched_latency; |
1890 | extern unsigned int sysctl_sched_min_granularity; | 1907 | extern unsigned int sysctl_sched_min_granularity; |
1891 | extern unsigned int sysctl_sched_wakeup_granularity; | 1908 | extern unsigned int sysctl_sched_wakeup_granularity; |
1892 | extern unsigned int sysctl_sched_shares_ratelimit; | ||
1893 | extern unsigned int sysctl_sched_shares_thresh; | ||
1894 | extern unsigned int sysctl_sched_child_runs_first; | 1909 | extern unsigned int sysctl_sched_child_runs_first; |
1895 | 1910 | ||
1896 | enum sched_tunable_scaling { | 1911 | enum sched_tunable_scaling { |
@@ -1906,6 +1921,7 @@ extern unsigned int sysctl_sched_migration_cost; | |||
1906 | extern unsigned int sysctl_sched_nr_migrate; | 1921 | extern unsigned int sysctl_sched_nr_migrate; |
1907 | extern unsigned int sysctl_sched_time_avg; | 1922 | extern unsigned int sysctl_sched_time_avg; |
1908 | extern unsigned int sysctl_timer_migration; | 1923 | extern unsigned int sysctl_timer_migration; |
1924 | extern unsigned int sysctl_sched_shares_window; | ||
1909 | 1925 | ||
1910 | int sched_proc_update_handler(struct ctl_table *table, int write, | 1926 | int sched_proc_update_handler(struct ctl_table *table, int write, |
1911 | void __user *buffer, size_t *length, | 1927 | void __user *buffer, size_t *length, |
@@ -1931,6 +1947,24 @@ int sched_rt_handler(struct ctl_table *table, int write, | |||
1931 | 1947 | ||
1932 | extern unsigned int sysctl_sched_compat_yield; | 1948 | extern unsigned int sysctl_sched_compat_yield; |
1933 | 1949 | ||
1950 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
1951 | extern unsigned int sysctl_sched_autogroup_enabled; | ||
1952 | |||
1953 | extern void sched_autogroup_create_attach(struct task_struct *p); | ||
1954 | extern void sched_autogroup_detach(struct task_struct *p); | ||
1955 | extern void sched_autogroup_fork(struct signal_struct *sig); | ||
1956 | extern void sched_autogroup_exit(struct signal_struct *sig); | ||
1957 | #ifdef CONFIG_PROC_FS | ||
1958 | extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m); | ||
1959 | extern int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice); | ||
1960 | #endif | ||
1961 | #else | ||
1962 | static inline void sched_autogroup_create_attach(struct task_struct *p) { } | ||
1963 | static inline void sched_autogroup_detach(struct task_struct *p) { } | ||
1964 | static inline void sched_autogroup_fork(struct signal_struct *sig) { } | ||
1965 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } | ||
1966 | #endif | ||
1967 | |||
1934 | #ifdef CONFIG_RT_MUTEXES | 1968 | #ifdef CONFIG_RT_MUTEXES |
1935 | extern int rt_mutex_getprio(struct task_struct *p); | 1969 | extern int rt_mutex_getprio(struct task_struct *p); |
1936 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 1970 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
@@ -1949,9 +1983,10 @@ extern int task_nice(const struct task_struct *p); | |||
1949 | extern int can_nice(const struct task_struct *p, const int nice); | 1983 | extern int can_nice(const struct task_struct *p, const int nice); |
1950 | extern int task_curr(const struct task_struct *p); | 1984 | extern int task_curr(const struct task_struct *p); |
1951 | extern int idle_cpu(int cpu); | 1985 | extern int idle_cpu(int cpu); |
1952 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); | 1986 | extern int sched_setscheduler(struct task_struct *, int, |
1987 | const struct sched_param *); | ||
1953 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 1988 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
1954 | struct sched_param *); | 1989 | const struct sched_param *); |
1955 | extern struct task_struct *idle_task(int cpu); | 1990 | extern struct task_struct *idle_task(int cpu); |
1956 | extern struct task_struct *curr_task(int cpu); | 1991 | extern struct task_struct *curr_task(int cpu); |
1957 | extern void set_curr_task(int cpu, struct task_struct *p); | 1992 | extern void set_curr_task(int cpu, struct task_struct *p); |
@@ -2478,7 +2513,7 @@ extern void normalize_rt_tasks(void); | |||
2478 | 2513 | ||
2479 | #ifdef CONFIG_CGROUP_SCHED | 2514 | #ifdef CONFIG_CGROUP_SCHED |
2480 | 2515 | ||
2481 | extern struct task_group init_task_group; | 2516 | extern struct task_group root_task_group; |
2482 | 2517 | ||
2483 | extern struct task_group *sched_create_group(struct task_group *parent); | 2518 | extern struct task_group *sched_create_group(struct task_group *parent); |
2484 | extern void sched_destroy_group(struct task_group *tg); | 2519 | extern void sched_destroy_group(struct task_group *tg); |
diff --git a/include/linux/security.h b/include/linux/security.h index fd4d55fb8845..b2b7f9749f5e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -457,7 +457,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
457 | * called when the actual read/write operations are performed. | 457 | * called when the actual read/write operations are performed. |
458 | * @inode contains the inode structure to check. | 458 | * @inode contains the inode structure to check. |
459 | * @mask contains the permission mask. | 459 | * @mask contains the permission mask. |
460 | * @nd contains the nameidata (may be NULL). | ||
461 | * Return 0 if permission is granted. | 460 | * Return 0 if permission is granted. |
462 | * @inode_setattr: | 461 | * @inode_setattr: |
463 | * Check permission before setting file attributes. Note that the kernel | 462 | * Check permission before setting file attributes. Note that the kernel |
@@ -796,8 +795,9 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
796 | * @unix_stream_connect: | 795 | * @unix_stream_connect: |
797 | * Check permissions before establishing a Unix domain stream connection | 796 | * Check permissions before establishing a Unix domain stream connection |
798 | * between @sock and @other. | 797 | * between @sock and @other. |
799 | * @sock contains the socket structure. | 798 | * @sock contains the sock structure. |
800 | * @other contains the peer socket structure. | 799 | * @other contains the peer sock structure. |
800 | * @newsk contains the new sock structure. | ||
801 | * Return 0 if permission is granted. | 801 | * Return 0 if permission is granted. |
802 | * @unix_may_send: | 802 | * @unix_may_send: |
803 | * Check permissions before connecting or sending datagrams from @sock to | 803 | * Check permissions before connecting or sending datagrams from @sock to |
@@ -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 |
@@ -1568,8 +1567,7 @@ struct security_operations { | |||
1568 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); | 1567 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); |
1569 | 1568 | ||
1570 | #ifdef CONFIG_SECURITY_NETWORK | 1569 | #ifdef CONFIG_SECURITY_NETWORK |
1571 | int (*unix_stream_connect) (struct socket *sock, | 1570 | int (*unix_stream_connect) (struct sock *sock, struct sock *other, struct sock *newsk); |
1572 | struct socket *other, struct sock *newsk); | ||
1573 | int (*unix_may_send) (struct socket *sock, struct socket *other); | 1571 | int (*unix_may_send) (struct socket *sock, struct socket *other); |
1574 | 1572 | ||
1575 | int (*socket_create) (int family, int type, int protocol, int kern); | 1573 | int (*socket_create) (int family, int type, int protocol, int kern); |
@@ -1664,7 +1662,7 @@ int security_capset(struct cred *new, const struct cred *old, | |||
1664 | const kernel_cap_t *effective, | 1662 | const kernel_cap_t *effective, |
1665 | const kernel_cap_t *inheritable, | 1663 | const kernel_cap_t *inheritable, |
1666 | const kernel_cap_t *permitted); | 1664 | const kernel_cap_t *permitted); |
1667 | int security_capable(int cap); | 1665 | int security_capable(const struct cred *cred, int cap); |
1668 | int security_real_capable(struct task_struct *tsk, int cap); | 1666 | int security_real_capable(struct task_struct *tsk, int cap); |
1669 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); | 1667 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); |
1670 | int security_sysctl(struct ctl_table *table, int op); | 1668 | int security_sysctl(struct ctl_table *table, int op); |
@@ -1713,6 +1711,7 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1713 | int security_inode_readlink(struct dentry *dentry); | 1711 | int security_inode_readlink(struct dentry *dentry); |
1714 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | 1712 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); |
1715 | int security_inode_permission(struct inode *inode, int mask); | 1713 | int security_inode_permission(struct inode *inode, int mask); |
1714 | int security_inode_exec_permission(struct inode *inode, unsigned int flags); | ||
1716 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1715 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
1717 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1716 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
1718 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 1717 | int security_inode_setxattr(struct dentry *dentry, const char *name, |
@@ -1857,9 +1856,9 @@ static inline int security_capset(struct cred *new, | |||
1857 | return cap_capset(new, old, effective, inheritable, permitted); | 1856 | return cap_capset(new, old, effective, inheritable, permitted); |
1858 | } | 1857 | } |
1859 | 1858 | ||
1860 | static inline int security_capable(int cap) | 1859 | static inline int security_capable(const struct cred *cred, int cap) |
1861 | { | 1860 | { |
1862 | return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT); | 1861 | return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT); |
1863 | } | 1862 | } |
1864 | 1863 | ||
1865 | static inline int security_real_capable(struct task_struct *tsk, int cap) | 1864 | static inline int security_real_capable(struct task_struct *tsk, int cap) |
@@ -2102,6 +2101,12 @@ static inline int security_inode_permission(struct inode *inode, int mask) | |||
2102 | return 0; | 2101 | return 0; |
2103 | } | 2102 | } |
2104 | 2103 | ||
2104 | static inline int security_inode_exec_permission(struct inode *inode, | ||
2105 | unsigned int flags) | ||
2106 | { | ||
2107 | return 0; | ||
2108 | } | ||
2109 | |||
2105 | static inline int security_inode_setattr(struct dentry *dentry, | 2110 | static inline int security_inode_setattr(struct dentry *dentry, |
2106 | struct iattr *attr) | 2111 | struct iattr *attr) |
2107 | { | 2112 | { |
@@ -2525,8 +2530,7 @@ static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 | |||
2525 | 2530 | ||
2526 | #ifdef CONFIG_SECURITY_NETWORK | 2531 | #ifdef CONFIG_SECURITY_NETWORK |
2527 | 2532 | ||
2528 | int security_unix_stream_connect(struct socket *sock, struct socket *other, | 2533 | int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk); |
2529 | struct sock *newsk); | ||
2530 | int security_unix_may_send(struct socket *sock, struct socket *other); | 2534 | int security_unix_may_send(struct socket *sock, struct socket *other); |
2531 | int security_socket_create(int family, int type, int protocol, int kern); | 2535 | int security_socket_create(int family, int type, int protocol, int kern); |
2532 | int security_socket_post_create(struct socket *sock, int family, | 2536 | int security_socket_post_create(struct socket *sock, int family, |
@@ -2567,8 +2571,8 @@ void security_tun_dev_post_create(struct sock *sk); | |||
2567 | int security_tun_dev_attach(struct sock *sk); | 2571 | int security_tun_dev_attach(struct sock *sk); |
2568 | 2572 | ||
2569 | #else /* CONFIG_SECURITY_NETWORK */ | 2573 | #else /* CONFIG_SECURITY_NETWORK */ |
2570 | static inline int security_unix_stream_connect(struct socket *sock, | 2574 | static inline int security_unix_stream_connect(struct sock *sock, |
2571 | struct socket *other, | 2575 | struct sock *other, |
2572 | struct sock *newsk) | 2576 | struct sock *newsk) |
2573 | { | 2577 | { |
2574 | return 0; | 2578 | return 0; |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 632205ccc25d..e98cd2e57194 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -107,7 +107,7 @@ static __always_inline int read_seqretry(const seqlock_t *sl, unsigned start) | |||
107 | { | 107 | { |
108 | smp_rmb(); | 108 | smp_rmb(); |
109 | 109 | ||
110 | return (sl->sequence != start); | 110 | return unlikely(sl->sequence != start); |
111 | } | 111 | } |
112 | 112 | ||
113 | 113 | ||
@@ -125,14 +125,25 @@ typedef struct seqcount { | |||
125 | #define SEQCNT_ZERO { 0 } | 125 | #define SEQCNT_ZERO { 0 } |
126 | #define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0) | 126 | #define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0) |
127 | 127 | ||
128 | /* Start of read using pointer to a sequence counter only. */ | 128 | /** |
129 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | 129 | * __read_seqcount_begin - begin a seq-read critical section (without barrier) |
130 | * @s: pointer to seqcount_t | ||
131 | * Returns: count to be passed to read_seqcount_retry | ||
132 | * | ||
133 | * __read_seqcount_begin is like read_seqcount_begin, but has no smp_rmb() | ||
134 | * barrier. Callers should ensure that smp_rmb() or equivalent ordering is | ||
135 | * provided before actually loading any of the variables that are to be | ||
136 | * protected in this critical section. | ||
137 | * | ||
138 | * Use carefully, only in critical code, and comment how the barrier is | ||
139 | * provided. | ||
140 | */ | ||
141 | static inline unsigned __read_seqcount_begin(const seqcount_t *s) | ||
130 | { | 142 | { |
131 | unsigned ret; | 143 | unsigned ret; |
132 | 144 | ||
133 | repeat: | 145 | repeat: |
134 | ret = s->sequence; | 146 | ret = s->sequence; |
135 | smp_rmb(); | ||
136 | if (unlikely(ret & 1)) { | 147 | if (unlikely(ret & 1)) { |
137 | cpu_relax(); | 148 | cpu_relax(); |
138 | goto repeat; | 149 | goto repeat; |
@@ -140,14 +151,56 @@ repeat: | |||
140 | return ret; | 151 | return ret; |
141 | } | 152 | } |
142 | 153 | ||
143 | /* | 154 | /** |
144 | * Test if reader processed invalid data because sequence number has changed. | 155 | * read_seqcount_begin - begin a seq-read critical section |
156 | * @s: pointer to seqcount_t | ||
157 | * Returns: count to be passed to read_seqcount_retry | ||
158 | * | ||
159 | * read_seqcount_begin opens a read critical section of the given seqcount. | ||
160 | * Validity of the critical section is tested by checking read_seqcount_retry | ||
161 | * function. | ||
162 | */ | ||
163 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | ||
164 | { | ||
165 | unsigned ret = __read_seqcount_begin(s); | ||
166 | smp_rmb(); | ||
167 | return ret; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * __read_seqcount_retry - end a seq-read critical section (without barrier) | ||
172 | * @s: pointer to seqcount_t | ||
173 | * @start: count, from read_seqcount_begin | ||
174 | * Returns: 1 if retry is required, else 0 | ||
175 | * | ||
176 | * __read_seqcount_retry is like read_seqcount_retry, but has no smp_rmb() | ||
177 | * barrier. Callers should ensure that smp_rmb() or equivalent ordering is | ||
178 | * provided before actually loading any of the variables that are to be | ||
179 | * protected in this critical section. | ||
180 | * | ||
181 | * Use carefully, only in critical code, and comment how the barrier is | ||
182 | * provided. | ||
183 | */ | ||
184 | static inline int __read_seqcount_retry(const seqcount_t *s, unsigned start) | ||
185 | { | ||
186 | return unlikely(s->sequence != start); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * read_seqcount_retry - end a seq-read critical section | ||
191 | * @s: pointer to seqcount_t | ||
192 | * @start: count, from read_seqcount_begin | ||
193 | * Returns: 1 if retry is required, else 0 | ||
194 | * | ||
195 | * read_seqcount_retry closes a read critical section of the given seqcount. | ||
196 | * If the critical section was invalid, it must be ignored (and typically | ||
197 | * retried). | ||
145 | */ | 198 | */ |
146 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | 199 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) |
147 | { | 200 | { |
148 | smp_rmb(); | 201 | smp_rmb(); |
149 | 202 | ||
150 | return s->sequence != start; | 203 | return __read_seqcount_retry(s, start); |
151 | } | 204 | } |
152 | 205 | ||
153 | 206 | ||
@@ -167,6 +220,19 @@ static inline void write_seqcount_end(seqcount_t *s) | |||
167 | s->sequence++; | 220 | s->sequence++; |
168 | } | 221 | } |
169 | 222 | ||
223 | /** | ||
224 | * write_seqcount_barrier - invalidate in-progress read-side seq operations | ||
225 | * @s: pointer to seqcount_t | ||
226 | * | ||
227 | * After write_seqcount_barrier, no read-side seq operations will complete | ||
228 | * successfully and see data older than this. | ||
229 | */ | ||
230 | static inline void write_seqcount_barrier(seqcount_t *s) | ||
231 | { | ||
232 | smp_wmb(); | ||
233 | s->sequence+=2; | ||
234 | } | ||
235 | |||
170 | /* | 236 | /* |
171 | * Possible sw/hw IRQ protected versions of the interfaces. | 237 | * Possible sw/hw IRQ protected versions of the interfaces. |
172 | */ | 238 | */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 212eb4c67797..758c5b0c6fd3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -95,7 +95,7 @@ | |||
95 | /* PPC CPM type number */ | 95 | /* PPC CPM type number */ |
96 | #define PORT_CPM 58 | 96 | #define PORT_CPM 58 |
97 | 97 | ||
98 | /* MPC52xx type numbers */ | 98 | /* MPC52xx (and MPC512x) type numbers */ |
99 | #define PORT_MPC52xx 59 | 99 | #define PORT_MPC52xx 59 |
100 | 100 | ||
101 | /* IBM icom */ | 101 | /* IBM icom */ |
@@ -199,6 +199,9 @@ | |||
199 | /* TI OMAP-UART */ | 199 | /* TI OMAP-UART */ |
200 | #define PORT_OMAP 96 | 200 | #define PORT_OMAP 96 |
201 | 201 | ||
202 | /* VIA VT8500 SoC */ | ||
203 | #define PORT_VT8500 97 | ||
204 | |||
202 | #ifdef __KERNEL__ | 205 | #ifdef __KERNEL__ |
203 | 206 | ||
204 | #include <linux/compiler.h> | 207 | #include <linux/compiler.h> |
@@ -209,6 +212,7 @@ | |||
209 | #include <linux/tty.h> | 212 | #include <linux/tty.h> |
210 | #include <linux/mutex.h> | 213 | #include <linux/mutex.h> |
211 | #include <linux/sysrq.h> | 214 | #include <linux/sysrq.h> |
215 | #include <linux/pps_kernel.h> | ||
212 | 216 | ||
213 | struct uart_port; | 217 | struct uart_port; |
214 | struct serial_struct; | 218 | struct serial_struct; |
@@ -311,6 +315,7 @@ struct uart_port { | |||
311 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | 315 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ |
312 | #define UPIO_DWAPB (6) /* DesignWare APB UART */ | 316 | #define UPIO_DWAPB (6) /* DesignWare APB UART */ |
313 | #define UPIO_RM9000 (7) /* RM9000 type IO */ | 317 | #define UPIO_RM9000 (7) /* RM9000 type IO */ |
318 | #define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */ | ||
314 | 319 | ||
315 | unsigned int read_status_mask; /* driver specific */ | 320 | unsigned int read_status_mask; /* driver specific */ |
316 | unsigned int ignore_status_mask; /* driver specific */ | 321 | unsigned int ignore_status_mask; /* driver specific */ |
@@ -361,6 +366,7 @@ struct uart_port { | |||
361 | struct device *dev; /* parent device */ | 366 | struct device *dev; /* parent device */ |
362 | unsigned char hub6; /* this should be in the 8250 driver */ | 367 | unsigned char hub6; /* this should be in the 8250 driver */ |
363 | unsigned char suspended; | 368 | unsigned char suspended; |
369 | unsigned char irq_wake; | ||
364 | unsigned char unused[2]; | 370 | unsigned char unused[2]; |
365 | void *private_data; /* generic platform data pointer */ | 371 | void *private_data; /* generic platform data pointer */ |
366 | }; | 372 | }; |
@@ -523,10 +529,10 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
523 | struct uart_state *state = uport->state; | 529 | struct uart_state *state = uport->state; |
524 | struct tty_port *port = &state->port; | 530 | struct tty_port *port = &state->port; |
525 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | 531 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); |
526 | struct timespec ts; | 532 | struct pps_event_time ts; |
527 | 533 | ||
528 | if (ld && ld->ops->dcd_change) | 534 | if (ld && ld->ops->dcd_change) |
529 | getnstimeofday(&ts); | 535 | pps_get_ts(&ts); |
530 | 536 | ||
531 | uport->icount.dcd++; | 537 | uport->icount.dcd++; |
532 | #ifdef CONFIG_HARD_PPS | 538 | #ifdef CONFIG_HARD_PPS |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index c7a0ce11cd47..3ecb71a9e505 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -99,6 +99,13 @@ | |||
99 | #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ | 99 | #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ |
100 | #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ | 100 | #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ |
101 | 101 | ||
102 | /* | ||
103 | * Access to some registers depends on register access / configuration | ||
104 | * mode. | ||
105 | */ | ||
106 | #define UART_LCR_CONF_MODE_A UART_LCR_DLAB /* Configutation mode A */ | ||
107 | #define UART_LCR_CONF_MODE_B 0xBF /* Configutation mode B */ | ||
108 | |||
102 | #define UART_MCR 4 /* Out: Modem Control Register */ | 109 | #define UART_MCR 4 /* Out: Modem Control Register */ |
103 | #define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */ | 110 | #define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */ |
104 | #define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */ | 111 | #define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */ |
@@ -341,5 +348,17 @@ | |||
341 | #define UART_OMAP_SYSS 0x16 /* System status register */ | 348 | #define UART_OMAP_SYSS 0x16 /* System status register */ |
342 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | 349 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ |
343 | 350 | ||
351 | /* | ||
352 | * These are the definitions for the MDR1 register | ||
353 | */ | ||
354 | #define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode */ | ||
355 | #define UART_OMAP_MDR1_SIR_MODE 0x01 /* SIR mode */ | ||
356 | #define UART_OMAP_MDR1_16X_ABAUD_MODE 0x02 /* UART 16x auto-baud */ | ||
357 | #define UART_OMAP_MDR1_13X_MODE 0x03 /* UART 13x mode */ | ||
358 | #define UART_OMAP_MDR1_MIR_MODE 0x04 /* MIR mode */ | ||
359 | #define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */ | ||
360 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ | ||
361 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ | ||
362 | |||
344 | #endif /* _LINUX_SERIAL_REG_H */ | 363 | #endif /* _LINUX_SERIAL_REG_H */ |
345 | 364 | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index baed2122c5a6..1630d9cae22a 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -8,6 +8,23 @@ | |||
8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | enum { | ||
12 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | ||
13 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | ||
14 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | ||
15 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | ||
16 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | ||
17 | }; | ||
18 | |||
19 | #define SCSCR_TIE (1 << 7) | ||
20 | #define SCSCR_RIE (1 << 6) | ||
21 | #define SCSCR_TE (1 << 5) | ||
22 | #define SCSCR_RE (1 << 4) | ||
23 | #define SCSCR_REIE (1 << 3) /* not supported by all parts */ | ||
24 | #define SCSCR_TOIE (1 << 2) /* not supported by all parts */ | ||
25 | #define SCSCR_CKE1 (1 << 1) | ||
26 | #define SCSCR_CKE0 (1 << 0) | ||
27 | |||
11 | /* Offsets into the sci_port->irqs array */ | 28 | /* Offsets into the sci_port->irqs array */ |
12 | enum { | 29 | enum { |
13 | SCIx_ERI_IRQ, | 30 | SCIx_ERI_IRQ, |
@@ -29,7 +46,12 @@ struct plat_sci_port { | |||
29 | unsigned int type; /* SCI / SCIF / IRDA */ | 46 | unsigned int type; /* SCI / SCIF / IRDA */ |
30 | upf_t flags; /* UPF_* flags */ | 47 | upf_t flags; /* UPF_* flags */ |
31 | char *clk; /* clock string */ | 48 | char *clk; /* clock string */ |
49 | |||
50 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | ||
51 | unsigned int scscr; /* SCSCR initialization */ | ||
52 | |||
32 | struct device *dma_dev; | 53 | struct device *dma_dev; |
54 | |||
33 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 55 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
34 | unsigned int dma_slave_tx; | 56 | unsigned int dma_slave_tx; |
35 | unsigned int dma_slave_rx; | 57 | unsigned int dma_slave_rx; |
diff --git a/include/linux/sfi.h b/include/linux/sfi.h index 7f770c638e99..fe817918b30e 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h | |||
@@ -77,6 +77,8 @@ | |||
77 | #define SFI_OEM_ID_SIZE 6 | 77 | #define SFI_OEM_ID_SIZE 6 |
78 | #define SFI_OEM_TABLE_ID_SIZE 8 | 78 | #define SFI_OEM_TABLE_ID_SIZE 8 |
79 | 79 | ||
80 | #define SFI_NAME_LEN 16 | ||
81 | |||
80 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 | 82 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 |
81 | #define SFI_SYST_SEARCH_END 0x000FFFFF | 83 | #define SFI_SYST_SEARCH_END 0x000FFFFF |
82 | 84 | ||
@@ -156,13 +158,13 @@ struct sfi_device_table_entry { | |||
156 | u16 addr; | 158 | u16 addr; |
157 | u8 irq; | 159 | u8 irq; |
158 | u32 max_freq; | 160 | u32 max_freq; |
159 | char name[16]; | 161 | char name[SFI_NAME_LEN]; |
160 | } __packed; | 162 | } __packed; |
161 | 163 | ||
162 | struct sfi_gpio_table_entry { | 164 | struct sfi_gpio_table_entry { |
163 | char controller_name[16]; | 165 | char controller_name[SFI_NAME_LEN]; |
164 | u16 pin_no; | 166 | u16 pin_no; |
165 | char pin_name[16]; | 167 | char pin_name[SFI_NAME_LEN]; |
166 | } __packed; | 168 | } __packed; |
167 | 169 | ||
168 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | 170 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e6ba898de61c..bf221d65d9ad 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -255,6 +255,11 @@ typedef unsigned int sk_buff_data_t; | |||
255 | typedef unsigned char *sk_buff_data_t; | 255 | typedef unsigned char *sk_buff_data_t; |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ | ||
259 | defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
260 | #define NET_SKBUFF_NF_DEFRAG_NEEDED 1 | ||
261 | #endif | ||
262 | |||
258 | /** | 263 | /** |
259 | * struct sk_buff - socket buffer | 264 | * struct sk_buff - socket buffer |
260 | * @next: Next buffer in list | 265 | * @next: Next buffer in list |
@@ -362,6 +367,8 @@ struct sk_buff { | |||
362 | void (*destructor)(struct sk_buff *skb); | 367 | void (*destructor)(struct sk_buff *skb); |
363 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 368 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
364 | struct nf_conntrack *nfct; | 369 | struct nf_conntrack *nfct; |
370 | #endif | ||
371 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
365 | struct sk_buff *nfct_reasm; | 372 | struct sk_buff *nfct_reasm; |
366 | #endif | 373 | #endif |
367 | #ifdef CONFIG_BRIDGE_NETFILTER | 374 | #ifdef CONFIG_BRIDGE_NETFILTER |
@@ -386,9 +393,10 @@ struct sk_buff { | |||
386 | #else | 393 | #else |
387 | __u8 deliver_no_wcard:1; | 394 | __u8 deliver_no_wcard:1; |
388 | #endif | 395 | #endif |
396 | __u8 ooo_okay:1; | ||
389 | kmemcheck_bitfield_end(flags2); | 397 | kmemcheck_bitfield_end(flags2); |
390 | 398 | ||
391 | /* 0/14 bit hole */ | 399 | /* 0/13 bit hole */ |
392 | 400 | ||
393 | #ifdef CONFIG_NET_DMA | 401 | #ifdef CONFIG_NET_DMA |
394 | dma_cookie_t dma_cookie; | 402 | dma_cookie_t dma_cookie; |
@@ -1354,6 +1362,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1354 | } | 1362 | } |
1355 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | 1363 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ |
1356 | 1364 | ||
1365 | static inline int skb_checksum_start_offset(const struct sk_buff *skb) | ||
1366 | { | ||
1367 | return skb->csum_start - skb_headroom(skb); | ||
1368 | } | ||
1369 | |||
1357 | static inline int skb_transport_offset(const struct sk_buff *skb) | 1370 | static inline int skb_transport_offset(const struct sk_buff *skb) |
1358 | { | 1371 | { |
1359 | return skb_transport_header(skb) - skb->data; | 1372 | return skb_transport_header(skb) - skb->data; |
@@ -2051,6 +2064,8 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
2051 | if (nfct) | 2064 | if (nfct) |
2052 | atomic_inc(&nfct->use); | 2065 | atomic_inc(&nfct->use); |
2053 | } | 2066 | } |
2067 | #endif | ||
2068 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2054 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | 2069 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) |
2055 | { | 2070 | { |
2056 | if (skb) | 2071 | if (skb) |
@@ -2079,6 +2094,8 @@ static inline void nf_reset(struct sk_buff *skb) | |||
2079 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2094 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2080 | nf_conntrack_put(skb->nfct); | 2095 | nf_conntrack_put(skb->nfct); |
2081 | skb->nfct = NULL; | 2096 | skb->nfct = NULL; |
2097 | #endif | ||
2098 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2082 | nf_conntrack_put_reasm(skb->nfct_reasm); | 2099 | nf_conntrack_put_reasm(skb->nfct_reasm); |
2083 | skb->nfct_reasm = NULL; | 2100 | skb->nfct_reasm = NULL; |
2084 | #endif | 2101 | #endif |
@@ -2095,6 +2112,8 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2095 | dst->nfct = src->nfct; | 2112 | dst->nfct = src->nfct; |
2096 | nf_conntrack_get(src->nfct); | 2113 | nf_conntrack_get(src->nfct); |
2097 | dst->nfctinfo = src->nfctinfo; | 2114 | dst->nfctinfo = src->nfctinfo; |
2115 | #endif | ||
2116 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2098 | dst->nfct_reasm = src->nfct_reasm; | 2117 | dst->nfct_reasm = src->nfct_reasm; |
2099 | nf_conntrack_get_reasm(src->nfct_reasm); | 2118 | nf_conntrack_get_reasm(src->nfct_reasm); |
2100 | #endif | 2119 | #endif |
@@ -2108,6 +2127,8 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2108 | { | 2127 | { |
2109 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2128 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2110 | nf_conntrack_put(dst->nfct); | 2129 | nf_conntrack_put(dst->nfct); |
2130 | #endif | ||
2131 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2111 | nf_conntrack_put_reasm(dst->nfct_reasm); | 2132 | nf_conntrack_put_reasm(dst->nfct_reasm); |
2112 | #endif | 2133 | #endif |
2113 | #ifdef CONFIG_BRIDGE_NETFILTER | 2134 | #ifdef CONFIG_BRIDGE_NETFILTER |
@@ -2164,8 +2185,9 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) | |||
2164 | return skb->queue_mapping != 0; | 2185 | return skb->queue_mapping != 0; |
2165 | } | 2186 | } |
2166 | 2187 | ||
2167 | extern u16 skb_tx_hash(const struct net_device *dev, | 2188 | extern u16 __skb_tx_hash(const struct net_device *dev, |
2168 | const struct sk_buff *skb); | 2189 | const struct sk_buff *skb, |
2190 | unsigned int num_tx_queues); | ||
2169 | 2191 | ||
2170 | #ifdef CONFIG_XFRM | 2192 | #ifdef CONFIG_XFRM |
2171 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | 2193 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 59260e21bdf5..fa9086647eb7 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -106,8 +106,6 @@ int kmem_cache_shrink(struct kmem_cache *); | |||
106 | void kmem_cache_free(struct kmem_cache *, void *); | 106 | void kmem_cache_free(struct kmem_cache *, void *); |
107 | unsigned int kmem_cache_size(struct kmem_cache *); | 107 | unsigned int kmem_cache_size(struct kmem_cache *); |
108 | const char *kmem_cache_name(struct kmem_cache *); | 108 | const char *kmem_cache_name(struct kmem_cache *); |
109 | int kern_ptr_validate(const void *ptr, unsigned long size); | ||
110 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | ||
111 | 109 | ||
112 | /* | 110 | /* |
113 | * Please use this macro to create slab caches. Simply specify the | 111 | * Please use this macro to create slab caches. Simply specify the |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 791a502f6906..83203ae9390b 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 e4f5ed180b9b..8b6e8ae5d5ca 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 86b652fabf6e..edbb1d07ddf4 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -30,12 +30,10 @@ struct cred; | |||
30 | #define __sockaddr_check_size(size) \ | 30 | #define __sockaddr_check_size(size) \ |
31 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) | 31 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) |
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef CONFIG_PROC_FS |
34 | # ifdef CONFIG_PROC_FS | ||
35 | struct seq_file; | 34 | struct seq_file; |
36 | extern void socket_seq_show(struct seq_file *seq); | 35 | extern void socket_seq_show(struct seq_file *seq); |
37 | # endif | 36 | #endif |
38 | #endif /* __KERNEL__ */ | ||
39 | 37 | ||
40 | typedef unsigned short sa_family_t; | 38 | typedef unsigned short sa_family_t; |
41 | 39 | ||
@@ -193,7 +191,8 @@ struct ucred { | |||
193 | #define AF_PHONET 35 /* Phonet sockets */ | 191 | #define AF_PHONET 35 /* Phonet sockets */ |
194 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ | 192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
195 | #define AF_CAIF 37 /* CAIF sockets */ | 193 | #define AF_CAIF 37 /* CAIF sockets */ |
196 | #define AF_MAX 38 /* For now.. */ | 194 | #define AF_ALG 38 /* Algorithm sockets */ |
195 | #define AF_MAX 39 /* For now.. */ | ||
197 | 196 | ||
198 | /* Protocol families, same as address families. */ | 197 | /* Protocol families, same as address families. */ |
199 | #define PF_UNSPEC AF_UNSPEC | 198 | #define PF_UNSPEC AF_UNSPEC |
@@ -234,6 +233,7 @@ struct ucred { | |||
234 | #define PF_PHONET AF_PHONET | 233 | #define PF_PHONET AF_PHONET |
235 | #define PF_IEEE802154 AF_IEEE802154 | 234 | #define PF_IEEE802154 AF_IEEE802154 |
236 | #define PF_CAIF AF_CAIF | 235 | #define PF_CAIF AF_CAIF |
236 | #define PF_ALG AF_ALG | ||
237 | #define PF_MAX AF_MAX | 237 | #define PF_MAX AF_MAX |
238 | 238 | ||
239 | /* Maximum queue length specifiable by listen. */ | 239 | /* Maximum queue length specifiable by listen. */ |
@@ -307,11 +307,11 @@ struct ucred { | |||
307 | #define SOL_RDS 276 | 307 | #define SOL_RDS 276 |
308 | #define SOL_IUCV 277 | 308 | #define SOL_IUCV 277 |
309 | #define SOL_CAIF 278 | 309 | #define SOL_CAIF 278 |
310 | #define SOL_ALG 279 | ||
310 | 311 | ||
311 | /* IPX options */ | 312 | /* IPX options */ |
312 | #define IPX_TYPE 1 | 313 | #define IPX_TYPE 1 |
313 | 314 | ||
314 | #ifdef __KERNEL__ | ||
315 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); | 315 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); |
316 | 316 | ||
317 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 317 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
@@ -333,6 +333,5 @@ struct timespec; | |||
333 | 333 | ||
334 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | 334 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, |
335 | unsigned int flags, struct timespec *timeout); | 335 | unsigned int flags, struct timespec *timeout); |
336 | #endif | ||
337 | #endif /* not kernel and not glibc */ | 336 | #endif /* not kernel and not glibc */ |
338 | #endif /* _LINUX_SOCKET_H */ | 337 | #endif /* _LINUX_SOCKET_H */ |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 4f95c1aac2fd..0e6dc3891942 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/spi/dw_spi.h b/include/linux/spi/dw_spi.h index c91302f3a257..6cd10f6ad472 100644 --- a/include/linux/spi/dw_spi.h +++ b/include/linux/spi/dw_spi.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifndef DW_SPI_HEADER_H | 1 | #ifndef DW_SPI_HEADER_H |
2 | #define DW_SPI_HEADER_H | 2 | #define DW_SPI_HEADER_H |
3 | |||
3 | #include <linux/io.h> | 4 | #include <linux/io.h> |
4 | 5 | ||
5 | /* Bit fields in CTRLR0 */ | 6 | /* Bit fields in CTRLR0 */ |
@@ -82,6 +83,13 @@ struct dw_spi_reg { | |||
82 | though only low 16 bits matters */ | 83 | though only low 16 bits matters */ |
83 | } __packed; | 84 | } __packed; |
84 | 85 | ||
86 | struct dw_spi; | ||
87 | struct dw_spi_dma_ops { | ||
88 | int (*dma_init)(struct dw_spi *dws); | ||
89 | void (*dma_exit)(struct dw_spi *dws); | ||
90 | int (*dma_transfer)(struct dw_spi *dws, int cs_change); | ||
91 | }; | ||
92 | |||
85 | struct dw_spi { | 93 | struct dw_spi { |
86 | struct spi_master *master; | 94 | struct spi_master *master; |
87 | struct spi_device *cur_dev; | 95 | struct spi_device *cur_dev; |
@@ -136,13 +144,15 @@ struct dw_spi { | |||
136 | /* Dma info */ | 144 | /* Dma info */ |
137 | int dma_inited; | 145 | int dma_inited; |
138 | struct dma_chan *txchan; | 146 | struct dma_chan *txchan; |
147 | struct scatterlist tx_sgl; | ||
139 | struct dma_chan *rxchan; | 148 | struct dma_chan *rxchan; |
140 | int txdma_done; | 149 | struct scatterlist rx_sgl; |
141 | int rxdma_done; | 150 | int dma_chan_done; |
142 | u64 tx_param; | ||
143 | u64 rx_param; | ||
144 | struct device *dma_dev; | 151 | struct device *dma_dev; |
145 | dma_addr_t dma_addr; | 152 | dma_addr_t dma_addr; /* phy address of the Data register */ |
153 | struct dw_spi_dma_ops *dma_ops; | ||
154 | void *dma_priv; /* platform relate info */ | ||
155 | struct pci_dev *dmac; | ||
146 | 156 | ||
147 | /* Bus interface info */ | 157 | /* Bus interface info */ |
148 | void *priv; | 158 | void *priv; |
@@ -216,4 +226,8 @@ extern int dw_spi_add_host(struct dw_spi *dws); | |||
216 | extern void dw_spi_remove_host(struct dw_spi *dws); | 226 | extern void dw_spi_remove_host(struct dw_spi *dws); |
217 | extern int dw_spi_suspend_host(struct dw_spi *dws); | 227 | extern int dw_spi_suspend_host(struct dw_spi *dws); |
218 | extern int dw_spi_resume_host(struct dw_spi *dws); | 228 | extern int dw_spi_resume_host(struct dw_spi *dws); |
229 | extern void dw_spi_xfer_done(struct dw_spi *dws); | ||
230 | |||
231 | /* platform related setup */ | ||
232 | extern int dw_spi_mid_init(struct dw_spi *dws); /* Intel MID platforms */ | ||
219 | #endif /* DW_SPI_HEADER_H */ | 233 | #endif /* DW_SPI_HEADER_H */ |
diff --git a/include/linux/spi/ifx_modem.h b/include/linux/spi/ifx_modem.h new file mode 100644 index 000000000000..a68f3b19d112 --- /dev/null +++ b/include/linux/spi/ifx_modem.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef LINUX_IFX_MODEM_H | ||
2 | #define LINUX_IFX_MODEM_H | ||
3 | |||
4 | struct ifx_modem_platform_data { | ||
5 | unsigned short rst_out; /* modem reset out */ | ||
6 | unsigned short pwr_on; /* power on */ | ||
7 | unsigned short rst_pmu; /* reset modem */ | ||
8 | unsigned short tx_pwr; /* modem power threshold */ | ||
9 | unsigned short srdy; /* SRDY */ | ||
10 | unsigned short mrdy; /* MRDY */ | ||
11 | unsigned short is_6160; /* Modem type */ | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h new file mode 100644 index 000000000000..d3e1075f7b60 --- /dev/null +++ b/include/linux/spi/pxa2xx_spi.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | #ifndef __linux_pxa2xx_spi_h | ||
19 | #define __linux_pxa2xx_spi_h | ||
20 | |||
21 | #include <linux/pxa2xx_ssp.h> | ||
22 | |||
23 | #define PXA2XX_CS_ASSERT (0x01) | ||
24 | #define PXA2XX_CS_DEASSERT (0x02) | ||
25 | |||
26 | /* device.platform_data for SSP controller devices */ | ||
27 | struct pxa2xx_spi_master { | ||
28 | u32 clock_enable; | ||
29 | u16 num_chipselect; | ||
30 | u8 enable_dma; | ||
31 | }; | ||
32 | |||
33 | /* spi_board_info.controller_data for SPI slave devices, | ||
34 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
35 | */ | ||
36 | struct pxa2xx_spi_chip { | ||
37 | u8 tx_threshold; | ||
38 | u8 rx_threshold; | ||
39 | u8 dma_burst_size; | ||
40 | u32 timeout; | ||
41 | u8 enable_loopback; | ||
42 | int gpio_cs; | ||
43 | void (*cs_control)(u32 command); | ||
44 | }; | ||
45 | |||
46 | #ifdef CONFIG_ARCH_PXA | ||
47 | |||
48 | #include <linux/clk.h> | ||
49 | #include <mach/dma.h> | ||
50 | |||
51 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | ||
52 | |||
53 | #else | ||
54 | /* | ||
55 | * This is the implemtation for CE4100 on x86. ARM defines them in mach/ or | ||
56 | * plat/ include path. | ||
57 | * The CE4100 does not provide DMA support. This bits are here to let the driver | ||
58 | * compile and will never be used. Maybe we get DMA support at a later point in | ||
59 | * time. | ||
60 | */ | ||
61 | |||
62 | #define DCSR(n) (n) | ||
63 | #define DSADR(n) (n) | ||
64 | #define DTADR(n) (n) | ||
65 | #define DCMD(n) (n) | ||
66 | #define DRCMR(n) (n) | ||
67 | |||
68 | #define DCSR_RUN (1 << 31) /* Run Bit */ | ||
69 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch */ | ||
70 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable */ | ||
71 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
72 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
73 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt */ | ||
74 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt */ | ||
75 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt */ | ||
76 | |||
77 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable */ | ||
78 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
79 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
80 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
81 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
82 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
83 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
84 | |||
85 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid */ | ||
86 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number */ | ||
87 | |||
88 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor */ | ||
89 | #define DDADR_STOP (1 << 0) /* Stop */ | ||
90 | |||
91 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
92 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
93 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
94 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
95 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
96 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
97 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
98 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
99 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
100 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
101 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
102 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
103 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
104 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
105 | |||
106 | /* | ||
107 | * Descriptor structure for PXA's DMA engine | ||
108 | * Note: this structure must always be aligned to a 16-byte boundary. | ||
109 | */ | ||
110 | |||
111 | typedef enum { | ||
112 | DMA_PRIO_HIGH = 0, | ||
113 | DMA_PRIO_MEDIUM = 1, | ||
114 | DMA_PRIO_LOW = 2 | ||
115 | } pxa_dma_prio; | ||
116 | |||
117 | /* | ||
118 | * DMA registration | ||
119 | */ | ||
120 | |||
121 | static inline int pxa_request_dma(char *name, | ||
122 | pxa_dma_prio prio, | ||
123 | void (*irq_handler)(int, void *), | ||
124 | void *data) | ||
125 | { | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | static inline void pxa_free_dma(int dma_ch) | ||
130 | { | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * The CE4100 does not have the clk framework implemented and SPI clock can | ||
135 | * not be switched on/off or the divider changed. | ||
136 | */ | ||
137 | static inline void clk_disable(struct clk *clk) | ||
138 | { | ||
139 | } | ||
140 | |||
141 | static inline int clk_enable(struct clk *clk) | ||
142 | { | ||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | static inline unsigned long clk_get_rate(struct clk *clk) | ||
147 | { | ||
148 | return 3686400; | ||
149 | } | ||
150 | |||
151 | #endif | ||
152 | #endif | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 623b704fdc42..9659eff52ca2 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -55,6 +55,10 @@ struct ssb_sprom { | |||
55 | u8 tri5gl; /* 5.2GHz TX isolation */ | 55 | u8 tri5gl; /* 5.2GHz TX isolation */ |
56 | u8 tri5g; /* 5.3GHz TX isolation */ | 56 | u8 tri5g; /* 5.3GHz TX isolation */ |
57 | u8 tri5gh; /* 5.8GHz TX isolation */ | 57 | u8 tri5gh; /* 5.8GHz TX isolation */ |
58 | u8 txpid2g[4]; /* 2GHz TX power index */ | ||
59 | u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ | ||
60 | u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ | ||
61 | u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */ | ||
58 | u8 rxpo2g; /* 2GHz RX power offset */ | 62 | u8 rxpo2g; /* 2GHz RX power offset */ |
59 | u8 rxpo5g; /* 5GHz RX power offset */ | 63 | u8 rxpo5g; /* 5GHz RX power offset */ |
60 | u8 rssisav2g; /* 2GHz RSSI params */ | 64 | u8 rssisav2g; /* 2GHz RSSI params */ |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 11daf9c140e7..489f7b6d61c5 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -299,6 +299,46 @@ | |||
299 | #define SSB_SPROM4_AGAIN2_SHIFT 0 | 299 | #define SSB_SPROM4_AGAIN2_SHIFT 0 |
300 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ | 300 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ |
301 | #define SSB_SPROM4_AGAIN3_SHIFT 8 | 301 | #define SSB_SPROM4_AGAIN3_SHIFT 8 |
302 | #define SSB_SPROM4_TXPID2G01 0x0062 /* TX Power Index 2GHz */ | ||
303 | #define SSB_SPROM4_TXPID2G0 0x00FF | ||
304 | #define SSB_SPROM4_TXPID2G0_SHIFT 0 | ||
305 | #define SSB_SPROM4_TXPID2G1 0xFF00 | ||
306 | #define SSB_SPROM4_TXPID2G1_SHIFT 8 | ||
307 | #define SSB_SPROM4_TXPID2G23 0x0064 /* TX Power Index 2GHz */ | ||
308 | #define SSB_SPROM4_TXPID2G2 0x00FF | ||
309 | #define SSB_SPROM4_TXPID2G2_SHIFT 0 | ||
310 | #define SSB_SPROM4_TXPID2G3 0xFF00 | ||
311 | #define SSB_SPROM4_TXPID2G3_SHIFT 8 | ||
312 | #define SSB_SPROM4_TXPID5G01 0x0066 /* TX Power Index 5GHz middle subband */ | ||
313 | #define SSB_SPROM4_TXPID5G0 0x00FF | ||
314 | #define SSB_SPROM4_TXPID5G0_SHIFT 0 | ||
315 | #define SSB_SPROM4_TXPID5G1 0xFF00 | ||
316 | #define SSB_SPROM4_TXPID5G1_SHIFT 8 | ||
317 | #define SSB_SPROM4_TXPID5G23 0x0068 /* TX Power Index 5GHz middle subband */ | ||
318 | #define SSB_SPROM4_TXPID5G2 0x00FF | ||
319 | #define SSB_SPROM4_TXPID5G2_SHIFT 0 | ||
320 | #define SSB_SPROM4_TXPID5G3 0xFF00 | ||
321 | #define SSB_SPROM4_TXPID5G3_SHIFT 8 | ||
322 | #define SSB_SPROM4_TXPID5GL01 0x006A /* TX Power Index 5GHz low subband */ | ||
323 | #define SSB_SPROM4_TXPID5GL0 0x00FF | ||
324 | #define SSB_SPROM4_TXPID5GL0_SHIFT 0 | ||
325 | #define SSB_SPROM4_TXPID5GL1 0xFF00 | ||
326 | #define SSB_SPROM4_TXPID5GL1_SHIFT 8 | ||
327 | #define SSB_SPROM4_TXPID5GL23 0x006C /* TX Power Index 5GHz low subband */ | ||
328 | #define SSB_SPROM4_TXPID5GL2 0x00FF | ||
329 | #define SSB_SPROM4_TXPID5GL2_SHIFT 0 | ||
330 | #define SSB_SPROM4_TXPID5GL3 0xFF00 | ||
331 | #define SSB_SPROM4_TXPID5GL3_SHIFT 8 | ||
332 | #define SSB_SPROM4_TXPID5GH01 0x006E /* TX Power Index 5GHz high subband */ | ||
333 | #define SSB_SPROM4_TXPID5GH0 0x00FF | ||
334 | #define SSB_SPROM4_TXPID5GH0_SHIFT 0 | ||
335 | #define SSB_SPROM4_TXPID5GH1 0xFF00 | ||
336 | #define SSB_SPROM4_TXPID5GH1_SHIFT 8 | ||
337 | #define SSB_SPROM4_TXPID5GH23 0x0070 /* TX Power Index 5GHz high subband */ | ||
338 | #define SSB_SPROM4_TXPID5GH2 0x00FF | ||
339 | #define SSB_SPROM4_TXPID5GH2_SHIFT 0 | ||
340 | #define SSB_SPROM4_TXPID5GH3 0xFF00 | ||
341 | #define SSB_SPROM4_TXPID5GH3_SHIFT 8 | ||
302 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ | 342 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ |
303 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 343 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ |
304 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 344 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 51efbef38fb0..25310f1d7f37 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
3 | 3 | ||
4 | struct task_struct; | 4 | struct task_struct; |
5 | struct pt_regs; | ||
5 | 6 | ||
6 | #ifdef CONFIG_STACKTRACE | 7 | #ifdef CONFIG_STACKTRACE |
7 | struct task_struct; | 8 | struct task_struct; |
@@ -13,7 +14,8 @@ struct stack_trace { | |||
13 | }; | 14 | }; |
14 | 15 | ||
15 | extern void save_stack_trace(struct stack_trace *trace); | 16 | extern void save_stack_trace(struct stack_trace *trace); |
16 | extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp); | 17 | extern void save_stack_trace_regs(struct stack_trace *trace, |
18 | struct pt_regs *regs); | ||
17 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 19 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
18 | struct stack_trace *trace); | 20 | struct stack_trace *trace); |
19 | 21 | ||
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index d66c61774d95..e10352915698 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -40,9 +40,9 @@ struct plat_stmmacenet_data { | |||
40 | int pmt; | 40 | int pmt; |
41 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 41 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
42 | void (*bus_setup)(void __iomem *ioaddr); | 42 | void (*bus_setup)(void __iomem *ioaddr); |
43 | #ifdef CONFIG_STM_DRIVERS | 43 | int (*init)(struct platform_device *pdev); |
44 | struct stm_pad_config *pad_config; | 44 | void (*exit)(struct platform_device *pdev); |
45 | #endif | 45 | void *custom_cfg; |
46 | void *bsp_priv; | 46 | void *bsp_priv; |
47 | }; | 47 | }; |
48 | 48 | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index b2024757edd5..8521067ed4f7 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 7c91260c44a9..082884295f80 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -43,7 +43,7 @@ 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 | } |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6950c981882d..7898ea13de70 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 a5a55f284b7d..ef9476a36ff7 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 5a3085b9b394..ea29330b78bd 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 aea0d438e3c7..7ad9751a0d87 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 */ |
@@ -80,6 +79,7 @@ struct svc_xprt { | |||
80 | struct list_head xpt_users; /* callbacks on free */ | 79 | struct list_head xpt_users; /* callbacks on free */ |
81 | 80 | ||
82 | struct net *xpt_net; | 81 | struct net *xpt_net; |
82 | struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */ | ||
83 | }; | 83 | }; |
84 | 84 | ||
85 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 85 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 1b353a76c304..04dba23c59f2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -28,7 +28,6 @@ struct svc_sock { | |||
28 | /* private TCP part */ | 28 | /* private TCP part */ |
29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
31 | struct rpc_xprt *sk_bc_xprt; /* NFSv4.1 backchannel xprt */ | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | /* | 33 | /* |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 498ab93a81e4..fc84b7a19ca3 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 89d10d279a20..bef0f535f746 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -321,6 +321,7 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | |||
321 | #define XPRT_CLOSING (6) | 321 | #define XPRT_CLOSING (6) |
322 | #define XPRT_CONNECTION_ABORT (7) | 322 | #define XPRT_CONNECTION_ABORT (7) |
323 | #define XPRT_CONNECTION_CLOSE (8) | 323 | #define XPRT_CONNECTION_CLOSE (8) |
324 | #define XPRT_INITIALIZED (9) | ||
324 | 325 | ||
325 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 326 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
326 | { | 327 | { |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 26697514c5ec..5a89e3612875 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -122,7 +122,7 @@ struct platform_suspend_ops { | |||
122 | * suspend_set_ops - set platform dependent suspend operations | 122 | * suspend_set_ops - set platform dependent suspend operations |
123 | * @ops: The new suspend operations to set. | 123 | * @ops: The new suspend operations to set. |
124 | */ | 124 | */ |
125 | extern void suspend_set_ops(struct platform_suspend_ops *ops); | 125 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
126 | extern int suspend_valid_only_mem(suspend_state_t state); | 126 | extern int suspend_valid_only_mem(suspend_state_t state); |
127 | 127 | ||
128 | /** | 128 | /** |
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state); | |||
147 | #else /* !CONFIG_SUSPEND */ | 147 | #else /* !CONFIG_SUSPEND */ |
148 | #define suspend_valid_only_mem NULL | 148 | #define suspend_valid_only_mem NULL |
149 | 149 | ||
150 | static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} | 150 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
152 | #endif /* !CONFIG_SUSPEND */ | 152 | #endif /* !CONFIG_SUSPEND */ |
153 | 153 | ||
@@ -245,7 +245,7 @@ extern void swsusp_set_page_free(struct page *); | |||
245 | extern void swsusp_unset_page_free(struct page *); | 245 | extern void swsusp_unset_page_free(struct page *); |
246 | extern unsigned long get_safe_page(gfp_t gfp_mask); | 246 | extern unsigned long get_safe_page(gfp_t gfp_mask); |
247 | 247 | ||
248 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 248 | extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); |
249 | extern int hibernate(void); | 249 | extern int hibernate(void); |
250 | extern bool system_entering_hibernation(void); | 250 | extern bool system_entering_hibernation(void); |
251 | #else /* CONFIG_HIBERNATION */ | 251 | #else /* CONFIG_HIBERNATION */ |
@@ -253,28 +253,11 @@ static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | |||
253 | static inline void swsusp_set_page_free(struct page *p) {} | 253 | static inline void swsusp_set_page_free(struct page *p) {} |
254 | static inline void swsusp_unset_page_free(struct page *p) {} | 254 | static inline void swsusp_unset_page_free(struct page *p) {} |
255 | 255 | ||
256 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 256 | static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {} |
257 | static inline int hibernate(void) { return -ENOSYS; } | 257 | static inline int hibernate(void) { return -ENOSYS; } |
258 | static inline bool system_entering_hibernation(void) { return false; } | 258 | static inline bool system_entering_hibernation(void) { return false; } |
259 | #endif /* CONFIG_HIBERNATION */ | 259 | #endif /* CONFIG_HIBERNATION */ |
260 | 260 | ||
261 | #ifdef CONFIG_SUSPEND_NVS | ||
262 | extern int suspend_nvs_register(unsigned long start, unsigned long size); | ||
263 | extern int suspend_nvs_alloc(void); | ||
264 | extern void suspend_nvs_free(void); | ||
265 | extern void suspend_nvs_save(void); | ||
266 | extern void suspend_nvs_restore(void); | ||
267 | #else /* CONFIG_SUSPEND_NVS */ | ||
268 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
269 | { | ||
270 | return 0; | ||
271 | } | ||
272 | static inline int suspend_nvs_alloc(void) { return 0; } | ||
273 | static inline void suspend_nvs_free(void) {} | ||
274 | static inline void suspend_nvs_save(void) {} | ||
275 | static inline void suspend_nvs_restore(void) {} | ||
276 | #endif /* CONFIG_SUSPEND_NVS */ | ||
277 | |||
278 | #ifdef CONFIG_PM_SLEEP | 261 | #ifdef CONFIG_PM_SLEEP |
279 | void save_processor_state(void); | 262 | void save_processor_state(void); |
280 | void restore_processor_state(void); | 263 | void restore_processor_state(void); |
@@ -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 eba53e71d2cc..4d559325d919 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -208,6 +208,8 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
208 | /* linux/mm/swap.c */ | 208 | /* linux/mm/swap.c */ |
209 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 209 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
210 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 210 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
211 | extern void lru_add_page_tail(struct zone* zone, | ||
212 | struct page *page, struct page *page_tail); | ||
211 | extern void activate_page(struct page *); | 213 | extern void activate_page(struct page *); |
212 | extern void mark_page_accessed(struct page *); | 214 | extern void mark_page_accessed(struct page *); |
213 | extern void lru_add_drain(void); | 215 | extern void lru_add_drain(void); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index cacc27a0e285..98664db1be47 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -125,41 +125,37 @@ extern struct trace_event_functions enter_syscall_print_funcs; | |||
125 | extern struct trace_event_functions exit_syscall_print_funcs; | 125 | extern struct trace_event_functions exit_syscall_print_funcs; |
126 | 126 | ||
127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
128 | static struct syscall_metadata \ | 128 | static struct syscall_metadata __syscall_meta_##sname; \ |
129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
130 | static struct ftrace_event_call \ | ||
131 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
132 | static struct ftrace_event_call __used \ | 129 | static struct ftrace_event_call __used \ |
133 | __attribute__((__aligned__(4))) \ | ||
134 | __attribute__((section("_ftrace_events"))) \ | ||
135 | event_enter_##sname = { \ | 130 | event_enter_##sname = { \ |
136 | .name = "sys_enter"#sname, \ | 131 | .name = "sys_enter"#sname, \ |
137 | .class = &event_class_syscall_enter, \ | 132 | .class = &event_class_syscall_enter, \ |
138 | .event.funcs = &enter_syscall_print_funcs, \ | 133 | .event.funcs = &enter_syscall_print_funcs, \ |
139 | .data = (void *)&__syscall_meta_##sname,\ | 134 | .data = (void *)&__syscall_meta_##sname,\ |
140 | } | 135 | }; \ |
136 | static struct ftrace_event_call __used \ | ||
137 | __attribute__((section("_ftrace_events"))) \ | ||
138 | *__event_enter_##sname = &event_enter_##sname; \ | ||
139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
141 | 140 | ||
142 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
143 | static struct syscall_metadata \ | 142 | static struct syscall_metadata __syscall_meta_##sname; \ |
144 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
145 | static struct ftrace_event_call \ | ||
146 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
147 | static struct ftrace_event_call __used \ | 143 | static struct ftrace_event_call __used \ |
148 | __attribute__((__aligned__(4))) \ | ||
149 | __attribute__((section("_ftrace_events"))) \ | ||
150 | event_exit_##sname = { \ | 144 | event_exit_##sname = { \ |
151 | .name = "sys_exit"#sname, \ | 145 | .name = "sys_exit"#sname, \ |
152 | .class = &event_class_syscall_exit, \ | 146 | .class = &event_class_syscall_exit, \ |
153 | .event.funcs = &exit_syscall_print_funcs, \ | 147 | .event.funcs = &exit_syscall_print_funcs, \ |
154 | .data = (void *)&__syscall_meta_##sname,\ | 148 | .data = (void *)&__syscall_meta_##sname,\ |
155 | } | 149 | }; \ |
150 | static struct ftrace_event_call __used \ | ||
151 | __attribute__((section("_ftrace_events"))) \ | ||
152 | *__event_exit_##sname = &event_exit_##sname; \ | ||
153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
156 | 154 | ||
157 | #define SYSCALL_METADATA(sname, nb) \ | 155 | #define SYSCALL_METADATA(sname, nb) \ |
158 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
159 | SYSCALL_TRACE_EXIT_EVENT(sname); \ | 157 | SYSCALL_TRACE_EXIT_EVENT(sname); \ |
160 | static struct syscall_metadata __used \ | 158 | static struct syscall_metadata __used \ |
161 | __attribute__((__aligned__(4))) \ | ||
162 | __attribute__((section("__syscalls_metadata"))) \ | ||
163 | __syscall_meta_##sname = { \ | 159 | __syscall_meta_##sname = { \ |
164 | .name = "sys"#sname, \ | 160 | .name = "sys"#sname, \ |
165 | .nb_args = nb, \ | 161 | .nb_args = nb, \ |
@@ -168,14 +164,15 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
168 | .enter_event = &event_enter_##sname, \ | 164 | .enter_event = &event_enter_##sname, \ |
169 | .exit_event = &event_exit_##sname, \ | 165 | .exit_event = &event_exit_##sname, \ |
170 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ | 166 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ |
171 | }; | 167 | }; \ |
168 | static struct syscall_metadata __used \ | ||
169 | __attribute__((section("__syscalls_metadata"))) \ | ||
170 | *__p_syscall_meta_##sname = &__syscall_meta_##sname; | ||
172 | 171 | ||
173 | #define SYSCALL_DEFINE0(sname) \ | 172 | #define SYSCALL_DEFINE0(sname) \ |
174 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ | 173 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ |
175 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ | 174 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ |
176 | static struct syscall_metadata __used \ | 175 | static struct syscall_metadata __used \ |
177 | __attribute__((__aligned__(4))) \ | ||
178 | __attribute__((section("__syscalls_metadata"))) \ | ||
179 | __syscall_meta__##sname = { \ | 176 | __syscall_meta__##sname = { \ |
180 | .name = "sys_"#sname, \ | 177 | .name = "sys_"#sname, \ |
181 | .nb_args = 0, \ | 178 | .nb_args = 0, \ |
@@ -183,6 +180,9 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
183 | .exit_event = &event_exit__##sname, \ | 180 | .exit_event = &event_exit__##sname, \ |
184 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ | 181 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ |
185 | }; \ | 182 | }; \ |
183 | static struct syscall_metadata __used \ | ||
184 | __attribute__((section("__syscalls_metadata"))) \ | ||
185 | *__p_syscall_meta_##sname = &__syscall_meta__##sname; \ | ||
186 | asmlinkage long sys_##sname(void) | 186 | asmlinkage long sys_##sname(void) |
187 | #else | 187 | #else |
188 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | 188 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 387fa7d05c98..7faf933cced7 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | 19 | ||
20 | /* Enable/disable SYSRQ support by default (0==no, 1==yes). */ | ||
21 | #define SYSRQ_DEFAULT_ENABLE 1 | ||
22 | |||
20 | /* Possible values of bitmask for enabling sysrq functions */ | 23 | /* Possible values of bitmask for enabling sysrq functions */ |
21 | /* 0x0001 is reserved for enable everything */ | 24 | /* 0x0001 is reserved for enable everything */ |
22 | #define SYSRQ_ENABLE_LOG 0x0002 | 25 | #define SYSRQ_ENABLE_LOG 0x0002 |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1de8b9eb841b..8651556dbd52 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -77,7 +77,7 @@ struct thermal_cooling_device { | |||
77 | char type[THERMAL_NAME_LENGTH]; | 77 | char type[THERMAL_NAME_LENGTH]; |
78 | struct device device; | 78 | struct device device; |
79 | void *devdata; | 79 | void *devdata; |
80 | struct thermal_cooling_device_ops *ops; | 80 | const struct thermal_cooling_device_ops *ops; |
81 | struct list_head node; | 81 | struct list_head node; |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -114,7 +114,7 @@ struct thermal_zone_device { | |||
114 | int last_temperature; | 114 | int last_temperature; |
115 | bool passive; | 115 | bool passive; |
116 | unsigned int forced_passive; | 116 | unsigned int forced_passive; |
117 | struct thermal_zone_device_ops *ops; | 117 | const struct thermal_zone_device_ops *ops; |
118 | struct list_head cooling_devices; | 118 | struct list_head cooling_devices; |
119 | struct idr idr; | 119 | struct idr idr; |
120 | struct mutex lock; /* protect cooling devices list */ | 120 | struct mutex lock; /* protect cooling devices list */ |
@@ -127,13 +127,41 @@ struct thermal_zone_device { | |||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | 127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ |
128 | #endif | 128 | #endif |
129 | }; | 129 | }; |
130 | /* Adding event notification support elements */ | ||
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
132 | #define THERMAL_GENL_VERSION 0x01 | ||
133 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
134 | |||
135 | enum events { | ||
136 | THERMAL_AUX0, | ||
137 | THERMAL_AUX1, | ||
138 | THERMAL_CRITICAL, | ||
139 | THERMAL_DEV_FAULT, | ||
140 | }; | ||
141 | |||
142 | struct thermal_genl_event { | ||
143 | u32 orig; | ||
144 | enum events event; | ||
145 | }; | ||
146 | /* attributes of thermal_genl_family */ | ||
147 | enum { | ||
148 | THERMAL_GENL_ATTR_UNSPEC, | ||
149 | THERMAL_GENL_ATTR_EVENT, | ||
150 | __THERMAL_GENL_ATTR_MAX, | ||
151 | }; | ||
152 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
153 | |||
154 | /* commands supported by the thermal_genl_family */ | ||
155 | enum { | ||
156 | THERMAL_GENL_CMD_UNSPEC, | ||
157 | THERMAL_GENL_CMD_EVENT, | ||
158 | __THERMAL_GENL_CMD_MAX, | ||
159 | }; | ||
160 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
130 | 161 | ||
131 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | 162 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, |
132 | struct | 163 | const struct thermal_zone_device_ops *, int tc1, int tc2, |
133 | thermal_zone_device_ops | 164 | int passive_freq, int polling_freq); |
134 | *, int tc1, int tc2, | ||
135 | int passive_freq, | ||
136 | int polling_freq); | ||
137 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 165 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
138 | 166 | ||
139 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 167 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
@@ -142,9 +170,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | |||
142 | struct thermal_cooling_device *); | 170 | struct thermal_cooling_device *); |
143 | void thermal_zone_device_update(struct thermal_zone_device *); | 171 | void thermal_zone_device_update(struct thermal_zone_device *); |
144 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
145 | struct | 173 | const struct thermal_cooling_device_ops *); |
146 | thermal_cooling_device_ops | ||
147 | *); | ||
148 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
175 | extern int generate_netlink_event(u32 orig, enum events event); | ||
149 | 176 | ||
150 | #endif /* __THERMAL_H__ */ | 177 | #endif /* __THERMAL_H__ */ |
diff --git a/include/linux/time.h b/include/linux/time.h index 9f15ac7ab92a..1e6d3b59238d 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -158,6 +158,8 @@ extern unsigned int alarm_setitimer(unsigned int seconds); | |||
158 | extern int do_getitimer(int which, struct itimerval *value); | 158 | extern int do_getitimer(int which, struct itimerval *value); |
159 | extern void getnstimeofday(struct timespec *tv); | 159 | extern void getnstimeofday(struct timespec *tv); |
160 | extern void getrawmonotonic(struct timespec *ts); | 160 | extern void getrawmonotonic(struct timespec *ts); |
161 | extern void getnstime_raw_and_real(struct timespec *ts_raw, | ||
162 | struct timespec *ts_real); | ||
161 | extern void getboottime(struct timespec *ts); | 163 | extern void getboottime(struct timespec *ts); |
162 | extern void monotonic_to_bootbased(struct timespec *ts); | 164 | extern void monotonic_to_bootbased(struct timespec *ts); |
163 | 165 | ||
diff --git a/include/linux/timer.h b/include/linux/timer.h index 38cf093ef62c..6abd9138beda 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -24,9 +24,9 @@ struct timer_list { | |||
24 | int slack; | 24 | int slack; |
25 | 25 | ||
26 | #ifdef CONFIG_TIMER_STATS | 26 | #ifdef CONFIG_TIMER_STATS |
27 | int start_pid; | ||
27 | void *start_site; | 28 | void *start_site; |
28 | char start_comm[16]; | 29 | char start_comm[16]; |
29 | int start_pid; | ||
30 | #endif | 30 | #endif |
31 | #ifdef CONFIG_LOCKDEP | 31 | #ifdef CONFIG_LOCKDEP |
32 | struct lockdep_map lockdep_map; | 32 | struct lockdep_map lockdep_map; |
@@ -48,12 +48,38 @@ extern struct tvec_base boot_tvec_bases; | |||
48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) | 48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* | ||
52 | * Note that all tvec_bases are 2 byte aligned and lower bit of | ||
53 | * base in timer_list is guaranteed to be zero. Use the LSB to | ||
54 | * indicate whether the timer is deferrable. | ||
55 | * | ||
56 | * A deferrable timer will work normally when the system is busy, but | ||
57 | * will not cause a CPU to come out of idle just to service it; instead, | ||
58 | * the timer will be serviced when the CPU eventually wakes up with a | ||
59 | * subsequent non-deferrable timer. | ||
60 | */ | ||
61 | #define TBASE_DEFERRABLE_FLAG (0x1) | ||
62 | |||
51 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ | 63 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ |
52 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 64 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ |
53 | .function = (_function), \ | 65 | .function = (_function), \ |
54 | .expires = (_expires), \ | 66 | .expires = (_expires), \ |
55 | .data = (_data), \ | 67 | .data = (_data), \ |
56 | .base = &boot_tvec_bases, \ | 68 | .base = &boot_tvec_bases, \ |
69 | .slack = -1, \ | ||
70 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | ||
71 | __FILE__ ":" __stringify(__LINE__)) \ | ||
72 | } | ||
73 | |||
74 | #define TBASE_MAKE_DEFERRED(ptr) ((struct tvec_base *) \ | ||
75 | ((unsigned char *)(ptr) + TBASE_DEFERRABLE_FLAG)) | ||
76 | |||
77 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) {\ | ||
78 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | ||
79 | .function = (_function), \ | ||
80 | .expires = (_expires), \ | ||
81 | .data = (_data), \ | ||
82 | .base = TBASE_MAKE_DEFERRED(&boot_tvec_bases), \ | ||
57 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 83 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
58 | __FILE__ ":" __stringify(__LINE__)) \ | 84 | __FILE__ ":" __stringify(__LINE__)) \ |
59 | } | 85 | } |
@@ -248,11 +274,11 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | |||
248 | 274 | ||
249 | extern void add_timer(struct timer_list *timer); | 275 | extern void add_timer(struct timer_list *timer); |
250 | 276 | ||
277 | extern int try_to_del_timer_sync(struct timer_list *timer); | ||
278 | |||
251 | #ifdef CONFIG_SMP | 279 | #ifdef CONFIG_SMP |
252 | extern int try_to_del_timer_sync(struct timer_list *timer); | ||
253 | extern int del_timer_sync(struct timer_list *timer); | 280 | extern int del_timer_sync(struct timer_list *timer); |
254 | #else | 281 | #else |
255 | # define try_to_del_timer_sync(t) del_timer(t) | ||
256 | # define del_timer_sync(t) del_timer(t) | 282 | # define del_timer_sync(t) del_timer(t) |
257 | #endif | 283 | #endif |
258 | 284 | ||
diff --git a/include/linux/timerqueue.h b/include/linux/timerqueue.h new file mode 100644 index 000000000000..d24aabaca474 --- /dev/null +++ b/include/linux/timerqueue.h | |||
@@ -0,0 +1,50 @@ | |||
1 | #ifndef _LINUX_TIMERQUEUE_H | ||
2 | #define _LINUX_TIMERQUEUE_H | ||
3 | |||
4 | #include <linux/rbtree.h> | ||
5 | #include <linux/ktime.h> | ||
6 | |||
7 | |||
8 | struct timerqueue_node { | ||
9 | struct rb_node node; | ||
10 | ktime_t expires; | ||
11 | }; | ||
12 | |||
13 | struct timerqueue_head { | ||
14 | struct rb_root head; | ||
15 | struct timerqueue_node *next; | ||
16 | }; | ||
17 | |||
18 | |||
19 | extern void timerqueue_add(struct timerqueue_head *head, | ||
20 | struct timerqueue_node *node); | ||
21 | extern void timerqueue_del(struct timerqueue_head *head, | ||
22 | struct timerqueue_node *node); | ||
23 | extern struct timerqueue_node *timerqueue_iterate_next( | ||
24 | struct timerqueue_node *node); | ||
25 | |||
26 | /** | ||
27 | * timerqueue_getnext - Returns the timer with the earlies expiration time | ||
28 | * | ||
29 | * @head: head of timerqueue | ||
30 | * | ||
31 | * Returns a pointer to the timer node that has the | ||
32 | * earliest expiration time. | ||
33 | */ | ||
34 | static inline | ||
35 | struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) | ||
36 | { | ||
37 | return head->next; | ||
38 | } | ||
39 | |||
40 | static inline void timerqueue_init(struct timerqueue_node *node) | ||
41 | { | ||
42 | RB_CLEAR_NODE(&node->node); | ||
43 | } | ||
44 | |||
45 | static inline void timerqueue_init_head(struct timerqueue_head *head) | ||
46 | { | ||
47 | head->head = RB_ROOT; | ||
48 | head->next = NULL; | ||
49 | } | ||
50 | #endif /* _LINUX_TIMERQUEUE_H */ | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index 32d852f8cbe4..d23999f9499d 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -268,6 +268,7 @@ extern u64 tick_length; | |||
268 | extern void second_overflow(void); | 268 | extern void second_overflow(void); |
269 | extern void update_ntp_one_tick(void); | 269 | extern void update_ntp_one_tick(void); |
270 | extern int do_adjtimex(struct timex *); | 270 | extern int do_adjtimex(struct timex *); |
271 | extern void hardpps(const struct timespec *, const struct timespec *); | ||
271 | 272 | ||
272 | int read_current_timer(unsigned long *timer_val); | 273 | int read_current_timer(unsigned long *timer_val); |
273 | 274 | ||
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index d10614b29d59..1eefa3f6d1f4 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/tipc.h: Include file for TIPC socket interface | 2 | * include/linux/tipc.h: Include file for TIPC socket interface |
3 | * | 3 | * |
4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
5 | * Copyright (c) 2005, Wind River Systems | 5 | * Copyright (c) 2005, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
@@ -42,7 +42,7 @@ | |||
42 | /* | 42 | /* |
43 | * TIPC addressing primitives | 43 | * TIPC addressing primitives |
44 | */ | 44 | */ |
45 | 45 | ||
46 | struct tipc_portid { | 46 | struct tipc_portid { |
47 | __u32 ref; | 47 | __u32 ref; |
48 | __u32 node; | 48 | __u32 node; |
@@ -89,7 +89,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
89 | #define TIPC_TOP_SRV 1 /* topology service name type */ | 89 | #define TIPC_TOP_SRV 1 /* topology service name type */ |
90 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ | 90 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * Publication scopes when binding port names and port name sequences | 93 | * Publication scopes when binding port names and port name sequences |
94 | */ | 94 | */ |
95 | 95 | ||
@@ -112,7 +112,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
112 | #define TIPC_HIGH_IMPORTANCE 2 | 112 | #define TIPC_HIGH_IMPORTANCE 2 |
113 | #define TIPC_CRITICAL_IMPORTANCE 3 | 113 | #define TIPC_CRITICAL_IMPORTANCE 3 |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Msg rejection/connection shutdown reasons | 116 | * Msg rejection/connection shutdown reasons |
117 | */ | 117 | */ |
118 | 118 | ||
@@ -127,9 +127,9 @@ static inline unsigned int tipc_node(__u32 addr) | |||
127 | * TIPC topology subscription service definitions | 127 | * TIPC topology subscription service definitions |
128 | */ | 128 | */ |
129 | 129 | ||
130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ | 130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ |
131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ | 131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ |
132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ | 132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ |
133 | #if 0 | 133 | #if 0 |
134 | /* The following filter options are not currently implemented */ | 134 | /* The following filter options are not currently implemented */ |
135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ | 135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ |
@@ -137,12 +137,12 @@ static inline unsigned int tipc_node(__u32 addr) | |||
137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ | 137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ | 140 | #define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */ |
141 | 141 | ||
142 | struct tipc_subscr { | 142 | struct tipc_subscr { |
143 | struct tipc_name_seq seq; /* name sequence of interest */ | 143 | struct tipc_name_seq seq; /* name sequence of interest */ |
144 | __u32 timeout; /* subscription duration (in ms) */ | 144 | __u32 timeout; /* subscription duration (in ms) */ |
145 | __u32 filter; /* bitmask of filter options */ | 145 | __u32 filter; /* bitmask of filter options */ |
146 | char usr_handle[8]; /* available for subscriber use */ | 146 | char usr_handle[8]; /* available for subscriber use */ |
147 | }; | 147 | }; |
148 | 148 | ||
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 9cde86c32412..7d42460a5e3c 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/tipc_config.h: Include file for TIPC configuration interface | 2 | * include/linux/tipc_config.h: Include file for TIPC configuration interface |
3 | * | 3 | * |
4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
5 | * Copyright (c) 2005-2007, Wind River Systems | 5 | * Copyright (c) 2005-2007, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
@@ -54,19 +54,19 @@ | |||
54 | * which specify parameters or results for the operation. | 54 | * which specify parameters or results for the operation. |
55 | * | 55 | * |
56 | * For many operations, the request and reply messages have a fixed number | 56 | * For many operations, the request and reply messages have a fixed number |
57 | * of TLVs (usually zero or one); however, some reply messages may return | 57 | * of TLVs (usually zero or one); however, some reply messages may return |
58 | * a variable number of TLVs. A failed request is denoted by the presence | 58 | * a variable number of TLVs. A failed request is denoted by the presence |
59 | * of an "error string" TLV in the reply message instead of the TLV(s) the | 59 | * of an "error string" TLV in the reply message instead of the TLV(s) the |
60 | * reply should contain if the request succeeds. | 60 | * reply should contain if the request succeeds. |
61 | */ | 61 | */ |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Public commands: | 64 | * Public commands: |
65 | * May be issued by any process. | 65 | * May be issued by any process. |
66 | * Accepted by own node, or by remote node only if remote management enabled. | 66 | * Accepted by own node, or by remote node only if remote management enabled. |
67 | */ | 67 | */ |
68 | 68 | ||
69 | #define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */ | 69 | #define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */ |
70 | #define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */ | 70 | #define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */ |
71 | #define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */ | 71 | #define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */ |
72 | #define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */ | 72 | #define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */ |
@@ -83,21 +83,21 @@ | |||
83 | #define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */ | 83 | #define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */ |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * Protected commands: | 87 | * Protected commands: |
88 | * May only be issued by "network administration capable" process. | 88 | * May only be issued by "network administration capable" process. |
89 | * Accepted by own node, or by remote node only if remote management enabled | 89 | * Accepted by own node, or by remote node only if remote management enabled |
90 | * and this node is zone manager. | 90 | * and this node is zone manager. |
91 | */ | 91 | */ |
92 | 92 | ||
93 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ | 93 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ |
94 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ | 94 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ |
95 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ | 95 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ |
96 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ | 96 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ |
97 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* tx none, rx unsigned */ | 97 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */ |
98 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */ | 98 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */ |
99 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */ | 99 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */ |
100 | #define TIPC_CMD_GET_MAX_SLAVES 0x400A /* tx none, rx unsigned */ | 100 | #define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */ |
101 | #define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */ | 101 | #define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */ |
102 | 102 | ||
103 | #define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */ | 103 | #define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */ |
@@ -116,10 +116,10 @@ | |||
116 | #define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */ | 116 | #define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */ |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | /* | 119 | /* |
120 | * Private commands: | 120 | * Private commands: |
121 | * May only be issued by "network administration capable" process. | 121 | * May only be issued by "network administration capable" process. |
122 | * Accepted by own node only; cannot be used on a remote node. | 122 | * Accepted by own node only; cannot be used on a remote node. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ | 125 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ |
@@ -130,10 +130,10 @@ | |||
130 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ | 130 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ |
131 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ | 131 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ |
132 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ | 132 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ |
133 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* tx unsigned, rx none */ | 133 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */ |
134 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */ | 134 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */ |
135 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */ | 135 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */ |
136 | #define TIPC_CMD_SET_MAX_SLAVES 0x800A /* tx unsigned, rx none */ | 136 | #define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */ |
137 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ | 137 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ |
138 | 138 | ||
139 | /* | 139 | /* |
@@ -156,20 +156,20 @@ | |||
156 | #define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */ | 156 | #define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */ |
157 | 157 | ||
158 | #define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */ | 158 | #define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */ |
159 | #define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */ | 159 | #define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */ |
160 | #define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */ | 160 | #define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */ |
161 | #define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */ | 161 | #define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */ |
162 | #define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */ | 162 | #define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */ |
163 | #define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */ | 163 | #define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */ |
164 | #define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */ | 164 | #define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */ |
165 | #define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */ | 165 | #define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */ |
166 | #define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */ | 166 | #define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */ |
167 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ | 167 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ |
168 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ | 168 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * Maximum sizes of TIPC bearer-related names (including terminating NUL) | 171 | * Maximum sizes of TIPC bearer-related names (including terminating NUL) |
172 | */ | 172 | */ |
173 | 173 | ||
174 | #define TIPC_MAX_MEDIA_NAME 16 /* format = media */ | 174 | #define TIPC_MAX_MEDIA_NAME 16 /* format = media */ |
175 | #define TIPC_MAX_IF_NAME 16 /* format = interface */ | 175 | #define TIPC_MAX_IF_NAME 16 /* format = interface */ |
@@ -234,7 +234,7 @@ struct tipc_name_table_query { | |||
234 | }; | 234 | }; |
235 | 235 | ||
236 | /* | 236 | /* |
237 | * The error string TLV is a null-terminated string describing the cause | 237 | * The error string TLV is a null-terminated string describing the cause |
238 | * of the request failure. To simplify error processing (and to save space) | 238 | * of the request failure. To simplify error processing (and to save space) |
239 | * the first character of the string can be a special error code character | 239 | * the first character of the string can be a special error code character |
240 | * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason. | 240 | * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason. |
@@ -254,16 +254,11 @@ struct tipc_link_create { | |||
254 | struct tipc_media_addr peer_addr; | 254 | struct tipc_media_addr peer_addr; |
255 | char bearer_name[TIPC_MAX_BEARER_NAME]; | 255 | char bearer_name[TIPC_MAX_BEARER_NAME]; |
256 | }; | 256 | }; |
257 | |||
258 | struct tipc_route_info { | ||
259 | __u32 dest; | ||
260 | __u32 router; | ||
261 | }; | ||
262 | #endif | 257 | #endif |
263 | 258 | ||
264 | /* | 259 | /* |
265 | * A TLV consists of a descriptor, followed by the TLV value. | 260 | * A TLV consists of a descriptor, followed by the TLV value. |
266 | * TLV descriptor fields are stored in network byte order; | 261 | * TLV descriptor fields are stored in network byte order; |
267 | * TLV values must also be stored in network byte order (where applicable). | 262 | * TLV values must also be stored in network byte order (where applicable). |
268 | * TLV descriptors must be aligned to addresses which are multiple of 4, | 263 | * TLV descriptors must be aligned to addresses which are multiple of 4, |
269 | * so up to 3 bytes of padding may exist at the end of the TLV value area. | 264 | * so up to 3 bytes of padding may exist at the end of the TLV value area. |
@@ -299,7 +294,7 @@ static inline int TLV_OK(const void *tlv, __u16 space) | |||
299 | 294 | ||
300 | static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) | 295 | static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) |
301 | { | 296 | { |
302 | return TLV_OK(tlv, space) && | 297 | return TLV_OK(tlv, space) && |
303 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); | 298 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); |
304 | } | 299 | } |
305 | 300 | ||
@@ -318,7 +313,7 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) | |||
318 | } | 313 | } |
319 | 314 | ||
320 | /* | 315 | /* |
321 | * A TLV list descriptor simplifies processing of messages | 316 | * A TLV list descriptor simplifies processing of messages |
322 | * containing multiple TLVs. | 317 | * containing multiple TLVs. |
323 | */ | 318 | */ |
324 | 319 | ||
@@ -327,15 +322,15 @@ struct tlv_list_desc { | |||
327 | __u32 tlv_space; /* # bytes from curr TLV to list end */ | 322 | __u32 tlv_space; /* # bytes from curr TLV to list end */ |
328 | }; | 323 | }; |
329 | 324 | ||
330 | static inline void TLV_LIST_INIT(struct tlv_list_desc *list, | 325 | static inline void TLV_LIST_INIT(struct tlv_list_desc *list, |
331 | void *data, __u32 space) | 326 | void *data, __u32 space) |
332 | { | 327 | { |
333 | list->tlv_ptr = (struct tlv_desc *)data; | 328 | list->tlv_ptr = (struct tlv_desc *)data; |
334 | list->tlv_space = space; | 329 | list->tlv_space = space; |
335 | } | 330 | } |
336 | 331 | ||
337 | static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list) | 332 | static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list) |
338 | { | 333 | { |
339 | return (list->tlv_space == 0); | 334 | return (list->tlv_space == 0); |
340 | } | 335 | } |
341 | 336 | ||
@@ -353,7 +348,7 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list) | |||
353 | { | 348 | { |
354 | __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len)); | 349 | __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len)); |
355 | 350 | ||
356 | list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space); | 351 | list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space); |
357 | list->tlv_space -= tlv_space; | 352 | list->tlv_space -= tlv_space; |
358 | } | 353 | } |
359 | 354 | ||
@@ -377,15 +372,14 @@ struct tipc_genlmsghdr { | |||
377 | #define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr)) | 372 | #define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr)) |
378 | 373 | ||
379 | /* | 374 | /* |
380 | * Configuration messages exchanged via TIPC sockets use the TIPC configuration | 375 | * Configuration messages exchanged via TIPC sockets use the TIPC configuration |
381 | * message header, which is defined below. This structure is analogous | 376 | * message header, which is defined below. This structure is analogous |
382 | * to the Netlink message header, but fields are stored in network byte order | 377 | * to the Netlink message header, but fields are stored in network byte order |
383 | * and no padding is permitted between the header and the message data | 378 | * and no padding is permitted between the header and the message data |
384 | * that follows. | 379 | * that follows. |
385 | */ | 380 | */ |
386 | 381 | ||
387 | struct tipc_cfg_msg_hdr | 382 | struct tipc_cfg_msg_hdr { |
388 | { | ||
389 | __be32 tcm_len; /* Message length (including header) */ | 383 | __be32 tcm_len; /* Message length (including header) */ |
390 | __be16 tcm_type; /* Command type */ | 384 | __be16 tcm_type; /* Command type */ |
391 | __be16 tcm_flags; /* Additional flags */ | 385 | __be16 tcm_flags; /* Additional flags */ |
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h index 6a7c4edf0e13..772dedbc3a22 100644 --- a/include/linux/toshiba.h +++ b/include/linux/toshiba.h | |||
@@ -33,6 +33,8 @@ typedef struct { | |||
33 | unsigned int edi __attribute__ ((packed)); | 33 | unsigned int edi __attribute__ ((packed)); |
34 | } SMMRegisters; | 34 | } SMMRegisters; |
35 | 35 | ||
36 | #ifdef __KERNEL__ | ||
36 | int tosh_smm(SMMRegisters *regs); | 37 | int tosh_smm(SMMRegisters *regs); |
38 | #endif /* __KERNEL__ */ | ||
37 | 39 | ||
38 | #endif | 40 | #endif |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index ac5d1c1285d9..fdc718abf83b 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 000000000000..727512e249b5 --- /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 a4a90b6726ce..97c84a58efb8 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -32,13 +32,8 @@ 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 | }; |
37 | * Aligned on 32 bytes because it is | ||
38 | * globally visible and gcc happily | ||
39 | * align these on the structure size. | ||
40 | * Keep in sync with vmlinux.lds.h. | ||
41 | */ | ||
42 | 37 | ||
43 | /* | 38 | /* |
44 | * Connect a probe to a tracepoint. | 39 | * Connect a probe to a tracepoint. |
@@ -61,15 +56,15 @@ extern void tracepoint_probe_update_all(void); | |||
61 | 56 | ||
62 | struct tracepoint_iter { | 57 | struct tracepoint_iter { |
63 | struct module *module; | 58 | struct module *module; |
64 | struct tracepoint *tracepoint; | 59 | struct tracepoint * const *tracepoint; |
65 | }; | 60 | }; |
66 | 61 | ||
67 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); | 62 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); |
68 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); | 63 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); |
69 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); | 64 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); |
70 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); | 65 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); |
71 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, | 66 | extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, |
72 | struct tracepoint *begin, struct tracepoint *end); | 67 | struct tracepoint * const *begin, struct tracepoint * const *end); |
73 | 68 | ||
74 | /* | 69 | /* |
75 | * tracepoint_synchronize_unregister must be called between the last tracepoint | 70 | * tracepoint_synchronize_unregister must be called between the last tracepoint |
@@ -84,11 +79,13 @@ static inline void tracepoint_synchronize_unregister(void) | |||
84 | #define PARAMS(args...) args | 79 | #define PARAMS(args...) args |
85 | 80 | ||
86 | #ifdef CONFIG_TRACEPOINTS | 81 | #ifdef CONFIG_TRACEPOINTS |
87 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | 82 | extern |
88 | struct tracepoint *end); | 83 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
84 | struct tracepoint * const *end); | ||
89 | #else | 85 | #else |
90 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | 86 | static inline |
91 | struct tracepoint *end) | 87 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
88 | struct tracepoint * const *end) | ||
92 | { } | 89 | { } |
93 | #endif /* CONFIG_TRACEPOINTS */ | 90 | #endif /* CONFIG_TRACEPOINTS */ |
94 | 91 | ||
@@ -106,6 +103,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
106 | 103 | ||
107 | #define TP_PROTO(args...) args | 104 | #define TP_PROTO(args...) args |
108 | #define TP_ARGS(args...) args | 105 | #define TP_ARGS(args...) args |
106 | #define TP_CONDITION(args...) args | ||
109 | 107 | ||
110 | #ifdef CONFIG_TRACEPOINTS | 108 | #ifdef CONFIG_TRACEPOINTS |
111 | 109 | ||
@@ -119,12 +117,14 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
119 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just | 117 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just |
120 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". | 118 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". |
121 | */ | 119 | */ |
122 | #define __DO_TRACE(tp, proto, args) \ | 120 | #define __DO_TRACE(tp, proto, args, cond) \ |
123 | do { \ | 121 | do { \ |
124 | struct tracepoint_func *it_func_ptr; \ | 122 | struct tracepoint_func *it_func_ptr; \ |
125 | void *it_func; \ | 123 | void *it_func; \ |
126 | void *__data; \ | 124 | void *__data; \ |
127 | \ | 125 | \ |
126 | if (!(cond)) \ | ||
127 | return; \ | ||
128 | rcu_read_lock_sched_notrace(); \ | 128 | rcu_read_lock_sched_notrace(); \ |
129 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ | 129 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
130 | if (it_func_ptr) { \ | 130 | if (it_func_ptr) { \ |
@@ -142,7 +142,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
142 | * not add unwanted padding between the beginning of the section and the | 142 | * not add unwanted padding between the beginning of the section and the |
143 | * structure. Force alignment to the same alignment as the section start. | 143 | * structure. Force alignment to the same alignment as the section start. |
144 | */ | 144 | */ |
145 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 145 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
146 | extern struct tracepoint __tracepoint_##name; \ | 146 | extern struct tracepoint __tracepoint_##name; \ |
147 | static inline void trace_##name(proto) \ | 147 | static inline void trace_##name(proto) \ |
148 | { \ | 148 | { \ |
@@ -151,7 +151,8 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
151 | do_trace: \ | 151 | do_trace: \ |
152 | __DO_TRACE(&__tracepoint_##name, \ | 152 | __DO_TRACE(&__tracepoint_##name, \ |
153 | TP_PROTO(data_proto), \ | 153 | TP_PROTO(data_proto), \ |
154 | TP_ARGS(data_args)); \ | 154 | TP_ARGS(data_args), \ |
155 | TP_CONDITION(cond)); \ | ||
155 | } \ | 156 | } \ |
156 | static inline int \ | 157 | static inline int \ |
157 | register_trace_##name(void (*probe)(data_proto), void *data) \ | 158 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
@@ -170,12 +171,20 @@ do_trace: \ | |||
170 | { \ | 171 | { \ |
171 | } | 172 | } |
172 | 173 | ||
174 | /* | ||
175 | * We have no guarantee that gcc and the linker won't up-align the tracepoint | ||
176 | * structures, so we create an array of pointers that will be used for iteration | ||
177 | * on the tracepoints. | ||
178 | */ | ||
173 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | 179 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
174 | static const char __tpstrtab_##name[] \ | 180 | static const char __tpstrtab_##name[] \ |
175 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 181 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
176 | struct tracepoint __tracepoint_##name \ | 182 | struct tracepoint __tracepoint_##name \ |
177 | __attribute__((section("__tracepoints"), aligned(32))) = \ | 183 | __attribute__((section("__tracepoints"))) = \ |
178 | { __tpstrtab_##name, 0, reg, unreg, NULL } | 184 | { __tpstrtab_##name, 0, reg, unreg, NULL }; \ |
185 | static struct tracepoint * const __tracepoint_ptr_##name __used \ | ||
186 | __attribute__((section("__tracepoints_ptrs"))) = \ | ||
187 | &__tracepoint_##name; | ||
179 | 188 | ||
180 | #define DEFINE_TRACE(name) \ | 189 | #define DEFINE_TRACE(name) \ |
181 | DEFINE_TRACE_FN(name, NULL, NULL); | 190 | DEFINE_TRACE_FN(name, NULL, NULL); |
@@ -186,7 +195,7 @@ do_trace: \ | |||
186 | EXPORT_SYMBOL(__tracepoint_##name) | 195 | EXPORT_SYMBOL(__tracepoint_##name) |
187 | 196 | ||
188 | #else /* !CONFIG_TRACEPOINTS */ | 197 | #else /* !CONFIG_TRACEPOINTS */ |
189 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 198 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
190 | static inline void trace_##name(proto) \ | 199 | static inline void trace_##name(proto) \ |
191 | { } \ | 200 | { } \ |
192 | static inline int \ | 201 | static inline int \ |
@@ -227,13 +236,20 @@ do_trace: \ | |||
227 | * "void *__data, proto" as the callback prototype. | 236 | * "void *__data, proto" as the callback prototype. |
228 | */ | 237 | */ |
229 | #define DECLARE_TRACE_NOARGS(name) \ | 238 | #define DECLARE_TRACE_NOARGS(name) \ |
230 | __DECLARE_TRACE(name, void, , void *__data, __data) | 239 | __DECLARE_TRACE(name, void, , 1, void *__data, __data) |
231 | 240 | ||
232 | #define DECLARE_TRACE(name, proto, args) \ | 241 | #define DECLARE_TRACE(name, proto, args) \ |
233 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ | 242 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \ |
234 | PARAMS(void *__data, proto), \ | 243 | PARAMS(void *__data, proto), \ |
235 | PARAMS(__data, args)) | 244 | PARAMS(__data, args)) |
236 | 245 | ||
246 | #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \ | ||
247 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \ | ||
248 | PARAMS(void *__data, proto), \ | ||
249 | PARAMS(__data, args)) | ||
250 | |||
251 | #define TRACE_EVENT_FLAGS(event, flag) | ||
252 | |||
237 | #endif /* DECLARE_TRACE */ | 253 | #endif /* DECLARE_TRACE */ |
238 | 254 | ||
239 | #ifndef TRACE_EVENT | 255 | #ifndef TRACE_EVENT |
@@ -315,7 +331,7 @@ do_trace: \ | |||
315 | * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | 331 | * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
316 | * __entry->next_pid = next->pid; | 332 | * __entry->next_pid = next->pid; |
317 | * __entry->next_prio = next->prio; | 333 | * __entry->next_prio = next->prio; |
318 | * ) | 334 | * ), |
319 | * | 335 | * |
320 | * * | 336 | * * |
321 | * * Formatted output of a trace record via TP_printk(). | 337 | * * Formatted output of a trace record via TP_printk(). |
@@ -347,11 +363,21 @@ do_trace: \ | |||
347 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 363 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
348 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 364 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
349 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 365 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
366 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ | ||
367 | args, cond) \ | ||
368 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
369 | PARAMS(args), PARAMS(cond)) | ||
350 | 370 | ||
351 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 371 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
352 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 372 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
353 | #define TRACE_EVENT_FN(name, proto, args, struct, \ | 373 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
354 | assign, print, reg, unreg) \ | 374 | assign, print, reg, unreg) \ |
355 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 375 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
376 | #define TRACE_EVENT_CONDITION(name, proto, args, cond, \ | ||
377 | struct, assign, print) \ | ||
378 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
379 | PARAMS(args), PARAMS(cond)) | ||
380 | |||
381 | #define TRACE_EVENT_FLAGS(event, flag) | ||
356 | 382 | ||
357 | #endif /* ifdef TRACE_EVENT (see note above) */ | 383 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index db2d227694da..c3d43eb4150c 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -102,7 +102,7 @@ | |||
102 | * unsigned int cmd, unsigned long arg); | 102 | * unsigned int cmd, unsigned long arg); |
103 | * | 103 | * |
104 | * This routine allows the tty driver to implement | 104 | * This routine allows the tty driver to implement |
105 | * device-specific ioctl's. If the ioctl number passed in cmd | 105 | * device-specific ioctls. If the ioctl number passed in cmd |
106 | * is not recognized by the driver, it should return ENOIOCTLCMD. | 106 | * is not recognized by the driver, it should return ENOIOCTLCMD. |
107 | * | 107 | * |
108 | * Optional | 108 | * Optional |
@@ -167,12 +167,12 @@ | |||
167 | * | 167 | * |
168 | * void (*hangup)(struct tty_struct *tty); | 168 | * void (*hangup)(struct tty_struct *tty); |
169 | * | 169 | * |
170 | * This routine notifies the tty driver that it should hangup the | 170 | * This routine notifies the tty driver that it should hang up the |
171 | * tty device. | 171 | * tty device. |
172 | * | 172 | * |
173 | * Optional: | 173 | * Optional: |
174 | * | 174 | * |
175 | * int (*break_ctl)(struct tty_stuct *tty, int state); | 175 | * int (*break_ctl)(struct tty_struct *tty, int state); |
176 | * | 176 | * |
177 | * This optional routine requests the tty driver to turn on or | 177 | * This optional routine requests the tty driver to turn on or |
178 | * off BREAK status on the RS-232 port. If state is -1, | 178 | * off BREAK status on the RS-232 port. If state is -1, |
@@ -235,6 +235,7 @@ | |||
235 | #include <linux/fs.h> | 235 | #include <linux/fs.h> |
236 | #include <linux/list.h> | 236 | #include <linux/list.h> |
237 | #include <linux/cdev.h> | 237 | #include <linux/cdev.h> |
238 | #include <linux/termios.h> | ||
238 | 239 | ||
239 | struct tty_struct; | 240 | struct tty_struct; |
240 | struct tty_driver; | 241 | struct tty_driver; |
@@ -357,7 +358,7 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
357 | * overruns, either.) | 358 | * overruns, either.) |
358 | * | 359 | * |
359 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need | 360 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need |
360 | * to be registered with a call to tty_register_driver() when the | 361 | * to be registered with a call to tty_register_device() when the |
361 | * device is found in the system and unregistered with a call to | 362 | * device is found in the system and unregistered with a call to |
362 | * tty_unregister_device() so the devices will be show up | 363 | * tty_unregister_device() so the devices will be show up |
363 | * properly in sysfs. If not set, driver->num entries will be | 364 | * properly in sysfs. If not set, driver->num entries will be |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 526d66f066a3..ff7dc08696a8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -101,14 +101,15 @@ | |||
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, | 103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, |
104 | * struct timespec *ts) | 104 | * struct pps_event_time *ts) |
105 | * | 105 | * |
106 | * Tells the discipline that the DCD pin has changed its status and | 106 | * Tells the discipline that the DCD pin has changed its status and |
107 | * the relative timestamp. Pointer ts can be NULL. | 107 | * the relative timestamp. Pointer ts cannot be NULL. |
108 | */ | 108 | */ |
109 | 109 | ||
110 | #include <linux/fs.h> | 110 | #include <linux/fs.h> |
111 | #include <linux/wait.h> | 111 | #include <linux/wait.h> |
112 | #include <linux/pps_kernel.h> | ||
112 | 113 | ||
113 | struct tty_ldisc_ops { | 114 | struct tty_ldisc_ops { |
114 | int magic; | 115 | int magic; |
@@ -143,7 +144,7 @@ struct tty_ldisc_ops { | |||
143 | char *fp, int count); | 144 | char *fp, int count); |
144 | void (*write_wakeup)(struct tty_struct *); | 145 | void (*write_wakeup)(struct tty_struct *); |
145 | void (*dcd_change)(struct tty_struct *, unsigned int, | 146 | void (*dcd_change)(struct tty_struct *, unsigned int, |
146 | struct timespec *); | 147 | struct pps_event_time *); |
147 | 148 | ||
148 | struct module *owner; | 149 | struct module *owner; |
149 | 150 | ||
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index fa261a0da280..8da8c4e87da3 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h | |||
@@ -67,21 +67,21 @@ struct u64_stats_sync { | |||
67 | #endif | 67 | #endif |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static void inline u64_stats_update_begin(struct u64_stats_sync *syncp) | 70 | static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) |
71 | { | 71 | { |
72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
73 | write_seqcount_begin(&syncp->seq); | 73 | write_seqcount_begin(&syncp->seq); |
74 | #endif | 74 | #endif |
75 | } | 75 | } |
76 | 76 | ||
77 | static void inline u64_stats_update_end(struct u64_stats_sync *syncp) | 77 | static inline void u64_stats_update_end(struct u64_stats_sync *syncp) |
78 | { | 78 | { |
79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
80 | write_seqcount_end(&syncp->seq); | 80 | write_seqcount_end(&syncp->seq); |
81 | #endif | 81 | #endif |
82 | } | 82 | } |
83 | 83 | ||
84 | static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp) | 84 | static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp) |
85 | { | 85 | { |
86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
87 | return read_seqcount_begin(&syncp->seq); | 87 | return read_seqcount_begin(&syncp->seq); |
@@ -93,7 +93,7 @@ static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *sy | |||
93 | #endif | 93 | #endif |
94 | } | 94 | } |
95 | 95 | ||
96 | static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | 96 | static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, |
97 | unsigned int start) | 97 | unsigned int start) |
98 | { | 98 | { |
99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
@@ -112,7 +112,7 @@ static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | |||
112 | * - UP 32bit must disable BH. | 112 | * - UP 32bit must disable BH. |
113 | * - 64bit have no problem atomically reading u64 values, irq safe. | 113 | * - 64bit have no problem atomically reading u64 values, irq safe. |
114 | */ | 114 | */ |
115 | static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) | 115 | static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) |
116 | { | 116 | { |
117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
118 | return read_seqcount_begin(&syncp->seq); | 118 | return read_seqcount_begin(&syncp->seq); |
@@ -124,7 +124,7 @@ static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync | |||
124 | #endif | 124 | #endif |
125 | } | 125 | } |
126 | 126 | ||
127 | static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, | 127 | static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, |
128 | unsigned int start) | 128 | unsigned int start) |
129 | { | 129 | { |
130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 05f7fed2b173..d28c726ede4f 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -104,6 +104,7 @@ struct uinput_ff_erase { | |||
104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) | 104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) |
105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) | 105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) |
106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) | 106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) |
107 | #define UI_SET_PROPBIT _IOW(UINPUT_IOCTL_BASE, 110, int) | ||
107 | 108 | ||
108 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) | 109 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) |
109 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) | 110 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) |
diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h index c9a6abd972a1..c0d817de4df2 100644 --- a/include/linux/unaligned/packed_struct.h +++ b/include/linux/unaligned/packed_struct.h | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | 5 | ||
6 | struct __una_u16 { u16 x; } __attribute__((packed)); | 6 | struct __una_u16 { u16 x; } __packed; |
7 | struct __una_u32 { u32 x; } __attribute__((packed)); | 7 | struct __una_u32 { u32 x; } __packed; |
8 | struct __una_u64 { u64 x; } __attribute__((packed)); | 8 | struct __una_u64 { u64 x; } __packed; |
9 | 9 | ||
10 | static inline u16 __get_unaligned_cpu16(const void *p) | 10 | static inline u16 __get_unaligned_cpu16(const void *p) |
11 | { | 11 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a28eb2592577..bd69b65f3356 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/completion.h> /* for struct completion */ | 20 | #include <linux/completion.h> /* for struct completion */ |
21 | #include <linux/sched.h> /* for current && schedule_timeout */ | 21 | #include <linux/sched.h> /* for current && schedule_timeout */ |
22 | #include <linux/mutex.h> /* for struct mutex */ | 22 | #include <linux/mutex.h> /* for struct mutex */ |
23 | #include <linux/pm_runtime.h> /* for runtime PM */ | ||
23 | 24 | ||
24 | struct usb_device; | 25 | struct usb_device; |
25 | struct usb_driver; | 26 | struct usb_driver; |
@@ -411,8 +412,6 @@ struct usb_tt; | |||
411 | * @quirks: quirks of the whole device | 412 | * @quirks: quirks of the whole device |
412 | * @urbnum: number of URBs submitted for the whole device | 413 | * @urbnum: number of URBs submitted for the whole device |
413 | * @active_duration: total time device is not suspended | 414 | * @active_duration: total time device is not suspended |
414 | * @last_busy: time of last use | ||
415 | * @autosuspend_delay: in jiffies | ||
416 | * @connect_time: time device was first connected | 415 | * @connect_time: time device was first connected |
417 | * @do_remote_wakeup: remote wakeup should be enabled | 416 | * @do_remote_wakeup: remote wakeup should be enabled |
418 | * @reset_resume: needs reset instead of resume | 417 | * @reset_resume: needs reset instead of resume |
@@ -485,8 +484,6 @@ struct usb_device { | |||
485 | unsigned long active_duration; | 484 | unsigned long active_duration; |
486 | 485 | ||
487 | #ifdef CONFIG_PM | 486 | #ifdef CONFIG_PM |
488 | unsigned long last_busy; | ||
489 | int autosuspend_delay; | ||
490 | unsigned long connect_time; | 487 | unsigned long connect_time; |
491 | 488 | ||
492 | unsigned do_remote_wakeup:1; | 489 | unsigned do_remote_wakeup:1; |
@@ -531,7 +528,7 @@ extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf); | |||
531 | 528 | ||
532 | static inline void usb_mark_last_busy(struct usb_device *udev) | 529 | static inline void usb_mark_last_busy(struct usb_device *udev) |
533 | { | 530 | { |
534 | udev->last_busy = jiffies; | 531 | pm_runtime_mark_last_busy(&udev->dev); |
535 | } | 532 | } |
536 | 533 | ||
537 | #else | 534 | #else |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index 5e86dc771da4..81a927930bfd 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -89,7 +89,7 @@ struct usb_cdc_acm_descriptor { | |||
89 | 89 | ||
90 | #define USB_CDC_COMM_FEATURE 0x01 | 90 | #define USB_CDC_COMM_FEATURE 0x01 |
91 | #define USB_CDC_CAP_LINE 0x02 | 91 | #define USB_CDC_CAP_LINE 0x02 |
92 | #define USB_CDC_CAP_BRK 0x04 | 92 | #define USB_CDC_CAP_BRK 0x04 |
93 | #define USB_CDC_CAP_NOTIFY 0x08 | 93 | #define USB_CDC_CAP_NOTIFY 0x08 |
94 | 94 | ||
95 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ | 95 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ |
@@ -271,6 +271,11 @@ struct usb_cdc_notification { | |||
271 | __le16 wLength; | 271 | __le16 wLength; |
272 | } __attribute__ ((packed)); | 272 | } __attribute__ ((packed)); |
273 | 273 | ||
274 | struct usb_cdc_speed_change { | ||
275 | __le32 DLBitRRate; /* contains the downlink bit rate (IN pipe) */ | ||
276 | __le32 ULBitRate; /* contains the uplink bit rate (OUT pipe) */ | ||
277 | } __attribute__ ((packed)); | ||
278 | |||
274 | /*-------------------------------------------------------------------------*/ | 279 | /*-------------------------------------------------------------------------*/ |
275 | 280 | ||
276 | /* | 281 | /* |
@@ -292,7 +297,7 @@ struct usb_cdc_ncm_ntb_parameters { | |||
292 | __le16 wNdpOutDivisor; | 297 | __le16 wNdpOutDivisor; |
293 | __le16 wNdpOutPayloadRemainder; | 298 | __le16 wNdpOutPayloadRemainder; |
294 | __le16 wNdpOutAlignment; | 299 | __le16 wNdpOutAlignment; |
295 | __le16 wPadding2; | 300 | __le16 wNtbOutMaxDatagrams; |
296 | } __attribute__ ((packed)); | 301 | } __attribute__ ((packed)); |
297 | 302 | ||
298 | /* | 303 | /* |
@@ -307,7 +312,7 @@ struct usb_cdc_ncm_nth16 { | |||
307 | __le16 wHeaderLength; | 312 | __le16 wHeaderLength; |
308 | __le16 wSequence; | 313 | __le16 wSequence; |
309 | __le16 wBlockLength; | 314 | __le16 wBlockLength; |
310 | __le16 wFpIndex; | 315 | __le16 wNdpIndex; |
311 | } __attribute__ ((packed)); | 316 | } __attribute__ ((packed)); |
312 | 317 | ||
313 | struct usb_cdc_ncm_nth32 { | 318 | struct usb_cdc_ncm_nth32 { |
@@ -315,7 +320,7 @@ struct usb_cdc_ncm_nth32 { | |||
315 | __le16 wHeaderLength; | 320 | __le16 wHeaderLength; |
316 | __le16 wSequence; | 321 | __le16 wSequence; |
317 | __le32 dwBlockLength; | 322 | __le32 dwBlockLength; |
318 | __le32 dwFpIndex; | 323 | __le32 dwNdpIndex; |
319 | } __attribute__ ((packed)); | 324 | } __attribute__ ((packed)); |
320 | 325 | ||
321 | /* | 326 | /* |
@@ -337,7 +342,7 @@ struct usb_cdc_ncm_dpe16 { | |||
337 | struct usb_cdc_ncm_ndp16 { | 342 | struct usb_cdc_ncm_ndp16 { |
338 | __le32 dwSignature; | 343 | __le32 dwSignature; |
339 | __le16 wLength; | 344 | __le16 wLength; |
340 | __le16 wNextFpIndex; | 345 | __le16 wNextNdpIndex; |
341 | struct usb_cdc_ncm_dpe16 dpe16[0]; | 346 | struct usb_cdc_ncm_dpe16 dpe16[0]; |
342 | } __attribute__ ((packed)); | 347 | } __attribute__ ((packed)); |
343 | 348 | ||
@@ -375,6 +380,7 @@ struct usb_cdc_ncm_ndp32 { | |||
375 | #define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2) | 380 | #define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2) |
376 | #define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3) | 381 | #define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3) |
377 | #define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4) | 382 | #define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4) |
383 | #define USB_CDC_NCM_NCAP_NTB_INPUT_SIZE (1 << 5) | ||
378 | 384 | ||
379 | /* CDC NCM subclass Table 6-3: NTB Parameter Structure */ | 385 | /* CDC NCM subclass Table 6-3: NTB Parameter Structure */ |
380 | #define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0) | 386 | #define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0) |
@@ -392,6 +398,13 @@ struct usb_cdc_ncm_ndp32 { | |||
392 | #define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048 | 398 | #define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048 |
393 | #define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048 | 399 | #define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048 |
394 | 400 | ||
401 | /* NTB Input Size Structure */ | ||
402 | struct usb_cdc_ncm_ndp_input_size { | ||
403 | __le32 dwNtbInMaxSize; | ||
404 | __le16 wNtbInMaxDatagrams; | ||
405 | __le16 wReserved; | ||
406 | } __attribute__ ((packed)); | ||
407 | |||
395 | /* CDC NCM subclass 6.2.11 SetCrcMode */ | 408 | /* CDC NCM subclass 6.2.11 SetCrcMode */ |
396 | #define USB_CDC_NCM_CRC_NOT_APPENDED 0x00 | 409 | #define USB_CDC_NCM_CRC_NOT_APPENDED 0x00 |
397 | #define USB_CDC_NCM_CRC_APPENDED 0x01 | 410 | #define USB_CDC_NCM_CRC_APPENDED 0x01 |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index 119194c85d10..10ec0699bea4 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -28,6 +28,13 @@ | |||
28 | #define HUB_STOP_TT 11 | 28 | #define HUB_STOP_TT 11 |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Hub class additional requests defined by USB 3.0 spec | ||
32 | * See USB 3.0 spec Table 10-6 | ||
33 | */ | ||
34 | #define HUB_SET_DEPTH 12 | ||
35 | #define HUB_GET_PORT_ERR_COUNT 13 | ||
36 | |||
37 | /* | ||
31 | * Hub Class feature numbers | 38 | * Hub Class feature numbers |
32 | * See USB 2.0 spec Table 11-17 | 39 | * See USB 2.0 spec Table 11-17 |
33 | */ | 40 | */ |
@@ -56,6 +63,20 @@ | |||
56 | #define USB_PORT_FEAT_C_PORT_L1 23 | 63 | #define USB_PORT_FEAT_C_PORT_L1 23 |
57 | 64 | ||
58 | /* | 65 | /* |
66 | * Port feature selectors added by USB 3.0 spec. | ||
67 | * See USB 3.0 spec Table 10-7 | ||
68 | */ | ||
69 | #define USB_PORT_FEAT_LINK_STATE 5 | ||
70 | #define USB_PORT_FEAT_U1_TIMEOUT 23 | ||
71 | #define USB_PORT_FEAT_U2_TIMEOUT 24 | ||
72 | #define USB_PORT_FEAT_C_LINK_STATE 25 | ||
73 | #define USB_PORT_FEAT_C_CONFIG_ERR 26 | ||
74 | #define USB_PORT_FEAT_REMOTE_WAKE_MASK 27 | ||
75 | #define USB_PORT_FEAT_BH_PORT_RESET 28 | ||
76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 | ||
77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 | ||
78 | |||
79 | /* | ||
59 | * Hub Status and Hub Change results | 80 | * Hub Status and Hub Change results |
60 | * See USB 2.0 spec Table 11-19 and Table 11-20 | 81 | * See USB 2.0 spec Table 11-19 and Table 11-20 |
61 | */ | 82 | */ |
@@ -84,6 +105,32 @@ struct usb_port_status { | |||
84 | #define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ | 105 | #define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ |
85 | 106 | ||
86 | /* | 107 | /* |
108 | * Additions to wPortStatus bit field from USB 3.0 | ||
109 | * See USB 3.0 spec Table 10-10 | ||
110 | */ | ||
111 | #define USB_PORT_STAT_LINK_STATE 0x01e0 | ||
112 | #define USB_SS_PORT_STAT_POWER 0x0200 | ||
113 | #define USB_PORT_STAT_SPEED_5GBPS 0x0000 | ||
114 | /* Valid only if port is enabled */ | ||
115 | |||
116 | /* | ||
117 | * Definitions for PORT_LINK_STATE values | ||
118 | * (bits 5-8) in wPortStatus | ||
119 | */ | ||
120 | #define USB_SS_PORT_LS_U0 0x0000 | ||
121 | #define USB_SS_PORT_LS_U1 0x0020 | ||
122 | #define USB_SS_PORT_LS_U2 0x0040 | ||
123 | #define USB_SS_PORT_LS_U3 0x0060 | ||
124 | #define USB_SS_PORT_LS_SS_DISABLED 0x0080 | ||
125 | #define USB_SS_PORT_LS_RX_DETECT 0x00a0 | ||
126 | #define USB_SS_PORT_LS_SS_INACTIVE 0x00c0 | ||
127 | #define USB_SS_PORT_LS_POLLING 0x00e0 | ||
128 | #define USB_SS_PORT_LS_RECOVERY 0x0100 | ||
129 | #define USB_SS_PORT_LS_HOT_RESET 0x0120 | ||
130 | #define USB_SS_PORT_LS_COMP_MOD 0x0140 | ||
131 | #define USB_SS_PORT_LS_LOOPBACK 0x0160 | ||
132 | |||
133 | /* | ||
87 | * wPortChange bit field | 134 | * wPortChange bit field |
88 | * See USB 2.0 spec Table 11-22 | 135 | * See USB 2.0 spec Table 11-22 |
89 | * Bits 0 to 4 shown, bits 5 to 15 are reserved | 136 | * Bits 0 to 4 shown, bits 5 to 15 are reserved |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index f917bbbc8901..ab461948b579 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -124,6 +124,16 @@ | |||
124 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ | 124 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * Test Mode Selectors | ||
128 | * See USB 2.0 spec Table 9-7 | ||
129 | */ | ||
130 | #define TEST_J 1 | ||
131 | #define TEST_K 2 | ||
132 | #define TEST_SE0_NAK 3 | ||
133 | #define TEST_PACKET 4 | ||
134 | #define TEST_FORCE_EN 5 | ||
135 | |||
136 | /* | ||
127 | * New Feature Selectors as added by USB 3.0 | 137 | * New Feature Selectors as added by USB 3.0 |
128 | * See USB 3.0 spec Table 9-6 | 138 | * See USB 3.0 spec Table 9-6 |
129 | */ | 139 | */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0b6e751ea0b1..a854fe89484e 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -112,6 +112,7 @@ struct usb_hcd { | |||
112 | /* Flags that get set only during HCD registration or removal. */ | 112 | /* Flags that get set only during HCD registration or removal. */ |
113 | unsigned rh_registered:1;/* is root hub registered? */ | 113 | unsigned rh_registered:1;/* is root hub registered? */ |
114 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 114 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
115 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ | ||
115 | 116 | ||
116 | /* The next flag is a stopgap, to be removed when all the HCDs | 117 | /* The next flag is a stopgap, to be removed when all the HCDs |
117 | * support the new root-hub polling mechanism. */ | 118 | * support the new root-hub polling mechanism. */ |
@@ -471,6 +472,10 @@ extern void usb_ep0_reinit(struct usb_device *); | |||
471 | 472 | ||
472 | /*-------------------------------------------------------------------------*/ | 473 | /*-------------------------------------------------------------------------*/ |
473 | 474 | ||
475 | /* class requests from USB 3.0 hub spec, table 10-5 */ | ||
476 | #define SetHubDepth (0x3000 | HUB_SET_DEPTH) | ||
477 | #define GetPortErrorCount (0x8000 | HUB_GET_PORT_ERR_COUNT) | ||
478 | |||
474 | /* | 479 | /* |
475 | * Generic bandwidth allocation constants/support | 480 | * Generic bandwidth allocation constants/support |
476 | */ | 481 | */ |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h new file mode 100644 index 000000000000..3675e03b1539 --- /dev/null +++ b/include/linux/usb/msm_hsusb.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/hsusb.h | ||
2 | * | ||
3 | * Copyright (C) 2008 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_MSM_HSUSB_H | ||
19 | #define __ASM_ARCH_MSM_HSUSB_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/usb/otg.h> | ||
23 | |||
24 | /** | ||
25 | * Supported USB modes | ||
26 | * | ||
27 | * USB_PERIPHERAL Only peripheral mode is supported. | ||
28 | * USB_HOST Only host mode is supported. | ||
29 | * USB_OTG OTG mode is supported. | ||
30 | * | ||
31 | */ | ||
32 | enum usb_mode_type { | ||
33 | USB_NONE = 0, | ||
34 | USB_PERIPHERAL, | ||
35 | USB_HOST, | ||
36 | USB_OTG, | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * OTG control | ||
41 | * | ||
42 | * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host | ||
43 | * only configuration. | ||
44 | * OTG_PHY_CONTROL Id/VBUS notifications comes form USB PHY. | ||
45 | * OTG_PMIC_CONTROL Id/VBUS notifications comes from PMIC hardware. | ||
46 | * OTG_USER_CONTROL Id/VBUS notifcations comes from User via sysfs. | ||
47 | * | ||
48 | */ | ||
49 | enum otg_control_type { | ||
50 | OTG_NO_CONTROL = 0, | ||
51 | OTG_PHY_CONTROL, | ||
52 | OTG_PMIC_CONTROL, | ||
53 | OTG_USER_CONTROL, | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct msm_otg_platform_data - platform device data | ||
58 | * for msm72k_otg driver. | ||
59 | * @phy_init_seq: PHY configuration sequence. val, reg pairs | ||
60 | * terminated by -1. | ||
61 | * @vbus_power: VBUS power on/off routine. | ||
62 | * @power_budget: VBUS power budget in mA (0 will be treated as 500mA). | ||
63 | * @mode: Supported mode (OTG/peripheral/host). | ||
64 | * @otg_control: OTG switch controlled by user/Id pin | ||
65 | * @default_mode: Default operational mode. Applicable only if | ||
66 | * OTG switch is controller by user. | ||
67 | * | ||
68 | */ | ||
69 | struct msm_otg_platform_data { | ||
70 | int *phy_init_seq; | ||
71 | void (*vbus_power)(bool on); | ||
72 | unsigned power_budget; | ||
73 | enum usb_mode_type mode; | ||
74 | enum otg_control_type otg_control; | ||
75 | enum usb_mode_type default_mode; | ||
76 | void (*setup_gpio)(enum usb_otg_state state); | ||
77 | }; | ||
78 | |||
79 | /** | ||
80 | * struct msm_otg: OTG driver data. Shared by HCD and DCD. | ||
81 | * @otg: USB OTG Transceiver structure. | ||
82 | * @pdata: otg device platform data. | ||
83 | * @irq: IRQ number assigned for HSUSB controller. | ||
84 | * @clk: clock struct of usb_hs_clk. | ||
85 | * @pclk: clock struct of usb_hs_pclk. | ||
86 | * @phy_reset_clk: clock struct of usb_phy_clk. | ||
87 | * @core_clk: clock struct of usb_hs_core_clk. | ||
88 | * @regs: ioremapped register base address. | ||
89 | * @inputs: OTG state machine inputs(Id, SessValid etc). | ||
90 | * @sm_work: OTG state machine work. | ||
91 | * @in_lpm: indicates low power mode (LPM) state. | ||
92 | * @async_int: Async interrupt arrived. | ||
93 | * | ||
94 | */ | ||
95 | struct msm_otg { | ||
96 | struct otg_transceiver otg; | ||
97 | struct msm_otg_platform_data *pdata; | ||
98 | int irq; | ||
99 | struct clk *clk; | ||
100 | struct clk *pclk; | ||
101 | struct clk *phy_reset_clk; | ||
102 | struct clk *core_clk; | ||
103 | void __iomem *regs; | ||
104 | #define ID 0 | ||
105 | #define B_SESS_VLD 1 | ||
106 | unsigned long inputs; | ||
107 | struct work_struct sm_work; | ||
108 | atomic_t in_lpm; | ||
109 | int async_int; | ||
110 | }; | ||
111 | |||
112 | #endif | ||
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h new file mode 100644 index 000000000000..7d1babbff071 --- /dev/null +++ b/include/linux/usb/msm_hsusb_hw.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Google, Inc. | ||
3 | * Author: Brian Swetland <swetland@google.com> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__ | ||
17 | #define __LINUX_USB_GADGET_MSM72K_UDC_H__ | ||
18 | |||
19 | #define USB_AHBBURST (MSM_USB_BASE + 0x0090) | ||
20 | #define USB_AHBMODE (MSM_USB_BASE + 0x0098) | ||
21 | #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ | ||
22 | |||
23 | #define USB_USBCMD (MSM_USB_BASE + 0x0140) | ||
24 | #define USB_PORTSC (MSM_USB_BASE + 0x0184) | ||
25 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) | ||
26 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) | ||
27 | |||
28 | #define USBCMD_RESET 2 | ||
29 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) | ||
30 | |||
31 | #define PORTSC_PHCD (1 << 23) /* phy suspend mode */ | ||
32 | #define PORTSC_PTS_MASK (3 << 30) | ||
33 | #define PORTSC_PTS_ULPI (3 << 30) | ||
34 | |||
35 | #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170) | ||
36 | #define ULPI_RUN (1 << 30) | ||
37 | #define ULPI_WRITE (1 << 29) | ||
38 | #define ULPI_READ (0 << 29) | ||
39 | #define ULPI_ADDR(n) (((n) & 255) << 16) | ||
40 | #define ULPI_DATA(n) ((n) & 255) | ||
41 | #define ULPI_DATA_READ(n) (((n) >> 8) & 255) | ||
42 | |||
43 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ | ||
44 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ | ||
45 | |||
46 | /* OTG definitions */ | ||
47 | #define OTGSC_INTSTS_MASK (0x7f << 16) | ||
48 | #define OTGSC_ID (1 << 8) | ||
49 | #define OTGSC_BSV (1 << 11) | ||
50 | #define OTGSC_IDIS (1 << 16) | ||
51 | #define OTGSC_BSVIS (1 << 19) | ||
52 | #define OTGSC_IDIE (1 << 24) | ||
53 | #define OTGSC_BSVIE (1 << 27) | ||
54 | |||
55 | #endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */ | ||
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 2387f9fc8138..eb505250940a 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. | 3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. |
4 | * | 4 | * |
5 | * Board initialization should put one of these into dev->platform_data, | 5 | * Board initialization should put one of these into dev->platform_data, |
6 | * probably on some platform_device named "musb_hdrc". It encapsulates | 6 | * probably on some platform_device named "musb-hdrc". It encapsulates |
7 | * key configuration differences between boards. | 7 | * key configuration differences between boards. |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -120,14 +120,14 @@ struct musb_hdrc_platform_data { | |||
120 | /* Power the device on or off */ | 120 | /* Power the device on or off */ |
121 | int (*set_power)(int state); | 121 | int (*set_power)(int state); |
122 | 122 | ||
123 | /* Turn device clock on or off */ | ||
124 | int (*set_clock)(struct clk *clock, int is_on); | ||
125 | |||
126 | /* MUSB configuration-specific details */ | 123 | /* MUSB configuration-specific details */ |
127 | struct musb_hdrc_config *config; | 124 | struct musb_hdrc_config *config; |
128 | 125 | ||
129 | /* Architecture specific board data */ | 126 | /* Architecture specific board data */ |
130 | void *board_data; | 127 | void *board_data; |
128 | |||
129 | /* Platform specific struct musb_ops pointer */ | ||
130 | const void *platform_ops; | ||
131 | }; | 131 | }; |
132 | 132 | ||
133 | 133 | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 0a5b3711e502..a1a1e7a73ec9 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -116,7 +116,7 @@ struct otg_transceiver { | |||
116 | /* for board-specific init logic */ | 116 | /* for board-specific init logic */ |
117 | extern int otg_set_transceiver(struct otg_transceiver *); | 117 | extern int otg_set_transceiver(struct otg_transceiver *); |
118 | 118 | ||
119 | #if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) | 119 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
120 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 120 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
121 | extern void usb_nop_xceiv_register(void); | 121 | extern void usb_nop_xceiv_register(void); |
122 | extern void usb_nop_xceiv_unregister(void); | 122 | extern void usb_nop_xceiv_unregister(void); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 16d682f4f7c3..c9049139a7a5 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -347,6 +347,9 @@ extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, | |||
347 | extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, | 347 | extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, |
348 | unsigned int ch); | 348 | unsigned int ch); |
349 | extern int usb_serial_handle_break(struct usb_serial_port *port); | 349 | extern int usb_serial_handle_break(struct usb_serial_port *port); |
350 | extern void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, | ||
351 | struct tty_struct *tty, | ||
352 | unsigned int status); | ||
350 | 353 | ||
351 | 354 | ||
352 | extern int usb_serial_bus_register(struct usb_serial_driver *device); | 355 | extern int usb_serial_bus_register(struct usb_serial_driver *device); |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 7ae27a473818..44842c8d38c0 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -97,6 +97,12 @@ struct driver_info { | |||
97 | 97 | ||
98 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ | 98 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ |
99 | 99 | ||
100 | /* | ||
101 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. | ||
102 | * Affects statistic (counters) and short packet handling. | ||
103 | */ | ||
104 | #define FLAG_MULTI_PACKET 0x1000 | ||
105 | |||
100 | /* init device ... can sleep, or cause probe() failure */ | 106 | /* init device ... can sleep, or cause probe() failure */ |
101 | int (*bind)(struct usbnet *, struct usb_interface *); | 107 | int (*bind)(struct usbnet *, struct usb_interface *); |
102 | 108 | ||
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 8178156711f9..faf467944baf 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/err.h> | 7 | #include <linux/err.h> |
8 | 8 | ||
9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) | 9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) |
10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) | 10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) |
11 | 11 | ||
12 | struct user_namespace { | 12 | struct user_namespace { |
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index ae9ab13b963d..4b9a7f596f92 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/via-core.h b/include/linux/via-core.h index 38bffd8ccca5..9c21cdf3e3b3 100644 --- a/include/linux/via-core.h +++ b/include/linux/via-core.h | |||
@@ -60,6 +60,21 @@ struct via_port_cfg { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Allow subdevs to register suspend/resume hooks. | ||
64 | */ | ||
65 | #ifdef CONFIG_PM | ||
66 | struct viafb_pm_hooks { | ||
67 | struct list_head list; | ||
68 | int (*suspend)(void *private); | ||
69 | int (*resume)(void *private); | ||
70 | void *private; | ||
71 | }; | ||
72 | |||
73 | void viafb_pm_register(struct viafb_pm_hooks *hooks); | ||
74 | void viafb_pm_unregister(struct viafb_pm_hooks *hooks); | ||
75 | #endif /* CONFIG_PM */ | ||
76 | |||
77 | /* | ||
63 | * This is the global viafb "device" containing stuff needed by | 78 | * This is the global viafb "device" containing stuff needed by |
64 | * all subdevs. | 79 | * all subdevs. |
65 | */ | 80 | */ |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h deleted file mode 100644 index b19eab140977..000000000000 --- a/include/linux/videodev.h +++ /dev/null | |||
@@ -1,340 +0,0 @@ | |||
1 | /* | ||
2 | * Video for Linux version 1 - OBSOLETE | ||
3 | * | ||
4 | * Header file for v4l1 drivers and applications, for | ||
5 | * Linux kernels 2.2.x or 2.4.x. | ||
6 | * | ||
7 | * Provides header for legacy drivers and applications | ||
8 | * | ||
9 | * See http://linuxtv.org for more info | ||
10 | * | ||
11 | */ | ||
12 | #ifndef __LINUX_VIDEODEV_H | ||
13 | #define __LINUX_VIDEODEV_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/ioctl.h> | ||
17 | #include <linux/videodev2.h> | ||
18 | |||
19 | #if defined(__MIN_V4L1) && defined (__KERNEL__) | ||
20 | |||
21 | /* | ||
22 | * Used by those V4L2 core functions that need a minimum V4L1 support, | ||
23 | * in order to allow V4L1 Compatibilty code compilation. | ||
24 | */ | ||
25 | |||
26 | struct video_mbuf | ||
27 | { | ||
28 | int size; /* Total memory to map */ | ||
29 | int frames; /* Frames */ | ||
30 | int offsets[VIDEO_MAX_FRAME]; | ||
31 | }; | ||
32 | |||
33 | #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ | ||
34 | |||
35 | #else | ||
36 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) | ||
37 | |||
38 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
39 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
40 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
41 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
42 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
43 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
44 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
45 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
46 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
47 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
48 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
49 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
50 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
51 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
52 | |||
53 | struct video_capability | ||
54 | { | ||
55 | char name[32]; | ||
56 | int type; | ||
57 | int channels; /* Num channels */ | ||
58 | int audios; /* Num audio devices */ | ||
59 | int maxwidth; /* Supported width */ | ||
60 | int maxheight; /* And height */ | ||
61 | int minwidth; /* Supported width */ | ||
62 | int minheight; /* And height */ | ||
63 | }; | ||
64 | |||
65 | |||
66 | struct video_channel | ||
67 | { | ||
68 | int channel; | ||
69 | char name[32]; | ||
70 | int tuners; | ||
71 | __u32 flags; | ||
72 | #define VIDEO_VC_TUNER 1 /* Channel has a tuner */ | ||
73 | #define VIDEO_VC_AUDIO 2 /* Channel has audio */ | ||
74 | __u16 type; | ||
75 | #define VIDEO_TYPE_TV 1 | ||
76 | #define VIDEO_TYPE_CAMERA 2 | ||
77 | __u16 norm; /* Norm set by channel */ | ||
78 | }; | ||
79 | |||
80 | struct video_tuner | ||
81 | { | ||
82 | int tuner; | ||
83 | char name[32]; | ||
84 | unsigned long rangelow, rangehigh; /* Tuner range */ | ||
85 | __u32 flags; | ||
86 | #define VIDEO_TUNER_PAL 1 | ||
87 | #define VIDEO_TUNER_NTSC 2 | ||
88 | #define VIDEO_TUNER_SECAM 4 | ||
89 | #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ | ||
90 | #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ | ||
91 | #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ | ||
92 | #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ | ||
93 | #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ | ||
94 | __u16 mode; /* PAL/NTSC/SECAM/OTHER */ | ||
95 | #define VIDEO_MODE_PAL 0 | ||
96 | #define VIDEO_MODE_NTSC 1 | ||
97 | #define VIDEO_MODE_SECAM 2 | ||
98 | #define VIDEO_MODE_AUTO 3 | ||
99 | __u16 signal; /* Signal strength 16bit scale */ | ||
100 | }; | ||
101 | |||
102 | struct video_picture | ||
103 | { | ||
104 | __u16 brightness; | ||
105 | __u16 hue; | ||
106 | __u16 colour; | ||
107 | __u16 contrast; | ||
108 | __u16 whiteness; /* Black and white only */ | ||
109 | __u16 depth; /* Capture depth */ | ||
110 | __u16 palette; /* Palette in use */ | ||
111 | #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ | ||
112 | #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ | ||
113 | #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ | ||
114 | #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ | ||
115 | #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ | ||
116 | #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ | ||
117 | #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ | ||
118 | #define VIDEO_PALETTE_YUYV 8 | ||
119 | #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ | ||
120 | #define VIDEO_PALETTE_YUV420 10 | ||
121 | #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ | ||
122 | #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ | ||
123 | #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ | ||
124 | #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ | ||
125 | #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ | ||
126 | #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ | ||
127 | #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ | ||
128 | #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ | ||
129 | }; | ||
130 | |||
131 | struct video_audio | ||
132 | { | ||
133 | int audio; /* Audio channel */ | ||
134 | __u16 volume; /* If settable */ | ||
135 | __u16 bass, treble; | ||
136 | __u32 flags; | ||
137 | #define VIDEO_AUDIO_MUTE 1 | ||
138 | #define VIDEO_AUDIO_MUTABLE 2 | ||
139 | #define VIDEO_AUDIO_VOLUME 4 | ||
140 | #define VIDEO_AUDIO_BASS 8 | ||
141 | #define VIDEO_AUDIO_TREBLE 16 | ||
142 | #define VIDEO_AUDIO_BALANCE 32 | ||
143 | char name[16]; | ||
144 | #define VIDEO_SOUND_MONO 1 | ||
145 | #define VIDEO_SOUND_STEREO 2 | ||
146 | #define VIDEO_SOUND_LANG1 4 | ||
147 | #define VIDEO_SOUND_LANG2 8 | ||
148 | __u16 mode; | ||
149 | __u16 balance; /* Stereo balance */ | ||
150 | __u16 step; /* Step actual volume uses */ | ||
151 | }; | ||
152 | |||
153 | struct video_clip | ||
154 | { | ||
155 | __s32 x,y; | ||
156 | __s32 width, height; | ||
157 | struct video_clip *next; /* For user use/driver use only */ | ||
158 | }; | ||
159 | |||
160 | struct video_window | ||
161 | { | ||
162 | __u32 x,y; /* Position of window */ | ||
163 | __u32 width,height; /* Its size */ | ||
164 | __u32 chromakey; | ||
165 | __u32 flags; | ||
166 | struct video_clip __user *clips; /* Set only */ | ||
167 | int clipcount; | ||
168 | #define VIDEO_WINDOW_INTERLACE 1 | ||
169 | #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ | ||
170 | #define VIDEO_CLIP_BITMAP -1 | ||
171 | /* bitmap is 1024x625, a '1' bit represents a clipped pixel */ | ||
172 | #define VIDEO_CLIPMAP_SIZE (128 * 625) | ||
173 | }; | ||
174 | |||
175 | struct video_capture | ||
176 | { | ||
177 | __u32 x,y; /* Offsets into image */ | ||
178 | __u32 width, height; /* Area to capture */ | ||
179 | __u16 decimation; /* Decimation divider */ | ||
180 | __u16 flags; /* Flags for capture */ | ||
181 | #define VIDEO_CAPTURE_ODD 0 /* Temporal */ | ||
182 | #define VIDEO_CAPTURE_EVEN 1 | ||
183 | }; | ||
184 | |||
185 | struct video_buffer | ||
186 | { | ||
187 | void *base; | ||
188 | int height,width; | ||
189 | int depth; | ||
190 | int bytesperline; | ||
191 | }; | ||
192 | |||
193 | struct video_mmap | ||
194 | { | ||
195 | unsigned int frame; /* Frame (0 - n) for double buffer */ | ||
196 | int height,width; | ||
197 | unsigned int format; /* should be VIDEO_PALETTE_* */ | ||
198 | }; | ||
199 | |||
200 | struct video_key | ||
201 | { | ||
202 | __u8 key[8]; | ||
203 | __u32 flags; | ||
204 | }; | ||
205 | |||
206 | struct video_mbuf | ||
207 | { | ||
208 | int size; /* Total memory to map */ | ||
209 | int frames; /* Frames */ | ||
210 | int offsets[VIDEO_MAX_FRAME]; | ||
211 | }; | ||
212 | |||
213 | #define VIDEO_NO_UNIT (-1) | ||
214 | |||
215 | struct video_unit | ||
216 | { | ||
217 | int video; /* Video minor */ | ||
218 | int vbi; /* VBI minor */ | ||
219 | int radio; /* Radio minor */ | ||
220 | int audio; /* Audio minor */ | ||
221 | int teletext; /* Teletext minor */ | ||
222 | }; | ||
223 | |||
224 | struct vbi_format { | ||
225 | __u32 sampling_rate; /* in Hz */ | ||
226 | __u32 samples_per_line; | ||
227 | __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ | ||
228 | __s32 start[2]; /* starting line for each frame */ | ||
229 | __u32 count[2]; /* count of lines for each frame */ | ||
230 | __u32 flags; | ||
231 | #define VBI_UNSYNC 1 /* can distingues between top/bottom field */ | ||
232 | #define VBI_INTERLACED 2 /* lines are interlaced */ | ||
233 | }; | ||
234 | |||
235 | /* video_info is biased towards hardware mpeg encode/decode */ | ||
236 | /* but it could apply generically to any hardware compressor/decompressor */ | ||
237 | struct video_info | ||
238 | { | ||
239 | __u32 frame_count; /* frames output since decode/encode began */ | ||
240 | __u32 h_size; /* current unscaled horizontal size */ | ||
241 | __u32 v_size; /* current unscaled veritcal size */ | ||
242 | __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ | ||
243 | __u32 picture_type; /* current picture type */ | ||
244 | __u32 temporal_reference; /* current temporal reference */ | ||
245 | __u8 user_data[256]; /* user data last found in compressed stream */ | ||
246 | /* user_data[0] contains user data flags, user_data[1] has count */ | ||
247 | }; | ||
248 | |||
249 | /* generic structure for setting playback modes */ | ||
250 | struct video_play_mode | ||
251 | { | ||
252 | int mode; | ||
253 | int p1; | ||
254 | int p2; | ||
255 | }; | ||
256 | |||
257 | /* for loading microcode / fpga programming */ | ||
258 | struct video_code | ||
259 | { | ||
260 | char loadwhat[16]; /* name or tag of file being passed */ | ||
261 | int datasize; | ||
262 | __u8 *data; | ||
263 | }; | ||
264 | |||
265 | #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ | ||
266 | #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ | ||
267 | #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ | ||
268 | #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ | ||
269 | #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ | ||
270 | #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ | ||
271 | #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ | ||
272 | #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ | ||
273 | #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ | ||
274 | #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ | ||
275 | #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ | ||
276 | #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ | ||
277 | #define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ | ||
278 | #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ | ||
279 | #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ | ||
280 | #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ | ||
281 | #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ | ||
282 | #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ | ||
283 | #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ | ||
284 | #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ | ||
285 | #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ | ||
286 | #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ | ||
287 | #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ | ||
288 | #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ | ||
289 | #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ | ||
290 | #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ | ||
291 | #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ | ||
292 | #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ | ||
293 | #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ | ||
294 | |||
295 | |||
296 | #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ | ||
297 | |||
298 | /* VIDIOCSWRITEMODE */ | ||
299 | #define VID_WRITE_MPEG_AUD 0 | ||
300 | #define VID_WRITE_MPEG_VID 1 | ||
301 | #define VID_WRITE_OSD 2 | ||
302 | #define VID_WRITE_TTX 3 | ||
303 | #define VID_WRITE_CC 4 | ||
304 | #define VID_WRITE_MJPEG 5 | ||
305 | |||
306 | /* VIDIOCSPLAYMODE */ | ||
307 | #define VID_PLAY_VID_OUT_MODE 0 | ||
308 | /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ | ||
309 | #define VID_PLAY_GENLOCK 1 | ||
310 | /* p1: 0 = OFF, 1 = ON */ | ||
311 | /* p2: GENLOCK FINE DELAY value */ | ||
312 | #define VID_PLAY_NORMAL 2 | ||
313 | #define VID_PLAY_PAUSE 3 | ||
314 | #define VID_PLAY_SINGLE_FRAME 4 | ||
315 | #define VID_PLAY_FAST_FORWARD 5 | ||
316 | #define VID_PLAY_SLOW_MOTION 6 | ||
317 | #define VID_PLAY_IMMEDIATE_NORMAL 7 | ||
318 | #define VID_PLAY_SWITCH_CHANNELS 8 | ||
319 | #define VID_PLAY_FREEZE_FRAME 9 | ||
320 | #define VID_PLAY_STILL_MODE 10 | ||
321 | #define VID_PLAY_MASTER_MODE 11 | ||
322 | /* p1: see below */ | ||
323 | #define VID_PLAY_MASTER_NONE 1 | ||
324 | #define VID_PLAY_MASTER_VIDEO 2 | ||
325 | #define VID_PLAY_MASTER_AUDIO 3 | ||
326 | #define VID_PLAY_ACTIVE_SCANLINES 12 | ||
327 | /* p1 = first active; p2 = last active */ | ||
328 | #define VID_PLAY_RESET 13 | ||
329 | #define VID_PLAY_END_MARK 14 | ||
330 | |||
331 | #endif /* CONFIG_VIDEO_V4L1_COMPAT */ | ||
332 | #endif /* __MIN_V4L1 */ | ||
333 | |||
334 | #endif /* __LINUX_VIDEODEV_H */ | ||
335 | |||
336 | /* | ||
337 | * Local variables: | ||
338 | * c-basic-offset: 8 | ||
339 | * End: | ||
340 | */ | ||
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 0093dd7c1d6f..800617b4ddd5 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/virtio_console.h b/include/linux/virtio_console.h index a85064db8f94..e4d333543a33 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -7,7 +7,8 @@ | |||
7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
8 | * anyone can use the definitions to implement compatible drivers/servers. | 8 | * anyone can use the definitions to implement compatible drivers/servers. |
9 | * | 9 | * |
10 | * Copyright (C) Red Hat, Inc., 2009, 2010 | 10 | * Copyright (C) Red Hat, Inc., 2009, 2010, 2011 |
11 | * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011 | ||
11 | */ | 12 | */ |
12 | 13 | ||
13 | /* Feature bits */ | 14 | /* Feature bits */ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 44b54f619ac6..4ed6fcd6b726 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -59,8 +59,9 @@ extern void *vmalloc_exec(unsigned long size); | |||
59 | extern void *vmalloc_32(unsigned long size); | 59 | extern void *vmalloc_32(unsigned long size); |
60 | extern void *vmalloc_32_user(unsigned long size); | 60 | extern void *vmalloc_32_user(unsigned long size); |
61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
62 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 62 | extern void *__vmalloc_node_range(unsigned long size, unsigned long align, |
63 | pgprot_t prot); | 63 | unsigned long start, unsigned long end, gfp_t gfp_mask, |
64 | pgprot_t prot, int node, void *caller); | ||
64 | extern void vfree(const void *addr); | 65 | extern void vfree(const void *addr); |
65 | 66 | ||
66 | extern void *vmap(struct page **pages, unsigned int count, | 67 | extern void *vmap(struct page **pages, unsigned int count, |
@@ -90,9 +91,6 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size, | |||
90 | unsigned long flags, | 91 | unsigned long flags, |
91 | unsigned long start, unsigned long end, | 92 | unsigned long start, unsigned long end, |
92 | void *caller); | 93 | void *caller); |
93 | extern struct vm_struct *get_vm_area_node(unsigned long size, | ||
94 | unsigned long flags, int node, | ||
95 | gfp_t gfp_mask); | ||
96 | extern struct vm_struct *remove_vm_area(const void *addr); | 94 | extern struct vm_struct *remove_vm_area(const void *addr); |
97 | 95 | ||
98 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 96 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
@@ -120,7 +118,7 @@ extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | |||
120 | #ifdef CONFIG_SMP | 118 | #ifdef CONFIG_SMP |
121 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | 119 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, |
122 | const size_t *sizes, int nr_vms, | 120 | const size_t *sizes, int nr_vms, |
123 | size_t align, gfp_t gfp_mask); | 121 | size_t align); |
124 | 122 | ||
125 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); | 123 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); |
126 | #endif | 124 | #endif |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index eaaea37b3b75..833e676d6d92 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -254,6 +254,11 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
254 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 254 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
255 | 255 | ||
256 | void refresh_cpu_vm_stats(int); | 256 | void refresh_cpu_vm_stats(int); |
257 | |||
258 | int calculate_pressure_threshold(struct zone *zone); | ||
259 | int calculate_normal_threshold(struct zone *zone); | ||
260 | void set_pgdat_percpu_threshold(pg_data_t *pgdat, | ||
261 | int (*calculate_pressure)(struct zone *)); | ||
257 | #else /* CONFIG_SMP */ | 262 | #else /* CONFIG_SMP */ |
258 | 263 | ||
259 | /* | 264 | /* |
@@ -298,6 +303,8 @@ static inline void __dec_zone_page_state(struct page *page, | |||
298 | #define dec_zone_page_state __dec_zone_page_state | 303 | #define dec_zone_page_state __dec_zone_page_state |
299 | #define mod_zone_page_state __mod_zone_page_state | 304 | #define mod_zone_page_state __mod_zone_page_state |
300 | 305 | ||
306 | #define set_pgdat_percpu_threshold(pgdat, callback) { } | ||
307 | |||
301 | static inline void refresh_cpu_vm_stats(int cpu) { } | 308 | static inline void refresh_cpu_vm_stats(int cpu) { } |
302 | #endif | 309 | #endif |
303 | 310 | ||
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h index 4f902e1908aa..bebb8efea0a6 100644 --- a/include/linux/wl12xx.h +++ b/include/linux/wl12xx.h | |||
@@ -24,6 +24,14 @@ | |||
24 | #ifndef _LINUX_WL12XX_H | 24 | #ifndef _LINUX_WL12XX_H |
25 | #define _LINUX_WL12XX_H | 25 | #define _LINUX_WL12XX_H |
26 | 26 | ||
27 | /* The board reference clock values */ | ||
28 | enum { | ||
29 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ | ||
30 | WL12XX_REFCLOCK_26 = 1, /* 26 MHz */ | ||
31 | WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */ | ||
32 | WL12XX_REFCLOCK_54 = 3, /* 54 MHz */ | ||
33 | }; | ||
34 | |||
27 | struct wl12xx_platform_data { | 35 | struct wl12xx_platform_data { |
28 | void (*set_power)(bool enable); | 36 | void (*set_power)(bool enable); |
29 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ | 37 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 0c0771f06bfa..f7998a3bf020 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -127,12 +127,20 @@ struct execute_work { | |||
127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | 127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ |
128 | } | 128 | } |
129 | 129 | ||
130 | #define __DEFERRED_WORK_INITIALIZER(n, f) { \ | ||
131 | .work = __WORK_INITIALIZER((n).work, (f)), \ | ||
132 | .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \ | ||
133 | } | ||
134 | |||
130 | #define DECLARE_WORK(n, f) \ | 135 | #define DECLARE_WORK(n, f) \ |
131 | struct work_struct n = __WORK_INITIALIZER(n, f) | 136 | struct work_struct n = __WORK_INITIALIZER(n, f) |
132 | 137 | ||
133 | #define DECLARE_DELAYED_WORK(n, f) \ | 138 | #define DECLARE_DELAYED_WORK(n, f) \ |
134 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) | 139 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) |
135 | 140 | ||
141 | #define DECLARE_DEFERRED_WORK(n, f) \ | ||
142 | struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f) | ||
143 | |||
136 | /* | 144 | /* |
137 | * initialize a work item's function pointer | 145 | * initialize a work item's function pointer |
138 | */ | 146 | */ |
@@ -242,7 +250,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
242 | enum { | 250 | enum { |
243 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ | 251 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ |
244 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 252 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
245 | WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ | 253 | WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ |
246 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ | 254 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ |
247 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 255 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
248 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
@@ -310,7 +318,7 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, | |||
310 | /** | 318 | /** |
311 | * alloc_ordered_workqueue - allocate an ordered workqueue | 319 | * alloc_ordered_workqueue - allocate an ordered workqueue |
312 | * @name: name of the workqueue | 320 | * @name: name of the workqueue |
313 | * @flags: WQ_* flags (only WQ_FREEZEABLE and WQ_MEM_RECLAIM are meaningful) | 321 | * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful) |
314 | * | 322 | * |
315 | * Allocate an ordered workqueue. An ordered workqueue executes at | 323 | * Allocate an ordered workqueue. An ordered workqueue executes at |
316 | * most one work item at any given time in the queued order. They are | 324 | * most one work item at any given time in the queued order. They are |
@@ -327,8 +335,8 @@ alloc_ordered_workqueue(const char *name, unsigned int flags) | |||
327 | 335 | ||
328 | #define create_workqueue(name) \ | 336 | #define create_workqueue(name) \ |
329 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 337 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
330 | #define create_freezeable_workqueue(name) \ | 338 | #define create_freezable_workqueue(name) \ |
331 | alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 339 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
332 | #define create_singlethread_workqueue(name) \ | 340 | #define create_singlethread_workqueue(name) \ |
333 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 341 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
334 | 342 | ||
@@ -401,7 +409,7 @@ static inline bool __cancel_delayed_work(struct delayed_work *work) | |||
401 | } | 409 | } |
402 | 410 | ||
403 | /* Obsolete. use cancel_delayed_work_sync() */ | 411 | /* Obsolete. use cancel_delayed_work_sync() */ |
404 | static inline | 412 | static inline __deprecated |
405 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 413 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
406 | struct delayed_work *work) | 414 | struct delayed_work *work) |
407 | { | 415 | { |
@@ -409,7 +417,7 @@ void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | |||
409 | } | 417 | } |
410 | 418 | ||
411 | /* Obsolete. use cancel_delayed_work_sync() */ | 419 | /* Obsolete. use cancel_delayed_work_sync() */ |
412 | static inline | 420 | static inline __deprecated |
413 | void cancel_rearming_delayed_work(struct delayed_work *work) | 421 | void cancel_rearming_delayed_work(struct delayed_work *work) |
414 | { | 422 | { |
415 | cancel_delayed_work_sync(work); | 423 | cancel_delayed_work_sync(work); |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index f1e5bde4b35a..e6131ef98d8f 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/xfrm.h b/include/linux/xfrm.h index b971e3848493..930fdd2de79c 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -283,6 +283,7 @@ enum xfrm_attr_type_t { | |||
283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ |
284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ | 284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ |
285 | XFRMA_MARK, /* struct xfrm_mark */ | 285 | XFRMA_MARK, /* struct xfrm_mark */ |
286 | XFRMA_TFCPAD, /* __u32 */ | ||
286 | __XFRMA_MAX | 287 | __XFRMA_MAX |
287 | 288 | ||
288 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 289 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
diff --git a/include/linux/xz.h b/include/linux/xz.h new file mode 100644 index 000000000000..64cffa6ddfce --- /dev/null +++ b/include/linux/xz.h | |||
@@ -0,0 +1,264 @@ | |||
1 | /* | ||
2 | * XZ decompressor | ||
3 | * | ||
4 | * Authors: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * Igor Pavlov <http://7-zip.org/> | ||
6 | * | ||
7 | * This file has been put into the public domain. | ||
8 | * You can do whatever you want with this file. | ||
9 | */ | ||
10 | |||
11 | #ifndef XZ_H | ||
12 | #define XZ_H | ||
13 | |||
14 | #ifdef __KERNEL__ | ||
15 | # include <linux/stddef.h> | ||
16 | # include <linux/types.h> | ||
17 | #else | ||
18 | # include <stddef.h> | ||
19 | # include <stdint.h> | ||
20 | #endif | ||
21 | |||
22 | /* In Linux, this is used to make extern functions static when needed. */ | ||
23 | #ifndef XZ_EXTERN | ||
24 | # define XZ_EXTERN extern | ||
25 | #endif | ||
26 | |||
27 | /** | ||
28 | * enum xz_mode - Operation mode | ||
29 | * | ||
30 | * @XZ_SINGLE: Single-call mode. This uses less RAM than | ||
31 | * than multi-call modes, because the LZMA2 | ||
32 | * dictionary doesn't need to be allocated as | ||
33 | * part of the decoder state. All required data | ||
34 | * structures are allocated at initialization, | ||
35 | * so xz_dec_run() cannot return XZ_MEM_ERROR. | ||
36 | * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2 | ||
37 | * dictionary buffer. All data structures are | ||
38 | * allocated at initialization, so xz_dec_run() | ||
39 | * cannot return XZ_MEM_ERROR. | ||
40 | * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is | ||
41 | * allocated once the required size has been | ||
42 | * parsed from the stream headers. If the | ||
43 | * allocation fails, xz_dec_run() will return | ||
44 | * XZ_MEM_ERROR. | ||
45 | * | ||
46 | * It is possible to enable support only for a subset of the above | ||
47 | * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, | ||
48 | * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled | ||
49 | * with support for all operation modes, but the preboot code may | ||
50 | * be built with fewer features to minimize code size. | ||
51 | */ | ||
52 | enum xz_mode { | ||
53 | XZ_SINGLE, | ||
54 | XZ_PREALLOC, | ||
55 | XZ_DYNALLOC | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * enum xz_ret - Return codes | ||
60 | * @XZ_OK: Everything is OK so far. More input or more | ||
61 | * output space is required to continue. This | ||
62 | * return code is possible only in multi-call mode | ||
63 | * (XZ_PREALLOC or XZ_DYNALLOC). | ||
64 | * @XZ_STREAM_END: Operation finished successfully. | ||
65 | * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding | ||
66 | * is still possible in multi-call mode by simply | ||
67 | * calling xz_dec_run() again. | ||
68 | * Note that this return value is used only if | ||
69 | * XZ_DEC_ANY_CHECK was defined at build time, | ||
70 | * which is not used in the kernel. Unsupported | ||
71 | * check types return XZ_OPTIONS_ERROR if | ||
72 | * XZ_DEC_ANY_CHECK was not defined at build time. | ||
73 | * @XZ_MEM_ERROR: Allocating memory failed. This return code is | ||
74 | * possible only if the decoder was initialized | ||
75 | * with XZ_DYNALLOC. The amount of memory that was | ||
76 | * tried to be allocated was no more than the | ||
77 | * dict_max argument given to xz_dec_init(). | ||
78 | * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than | ||
79 | * allowed by the dict_max argument given to | ||
80 | * xz_dec_init(). This return value is possible | ||
81 | * only in multi-call mode (XZ_PREALLOC or | ||
82 | * XZ_DYNALLOC); the single-call mode (XZ_SINGLE) | ||
83 | * ignores the dict_max argument. | ||
84 | * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic | ||
85 | * bytes). | ||
86 | * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested | ||
87 | * compression options. In the decoder this means | ||
88 | * that the header CRC32 matches, but the header | ||
89 | * itself specifies something that we don't support. | ||
90 | * @XZ_DATA_ERROR: Compressed data is corrupt. | ||
91 | * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly | ||
92 | * different between multi-call and single-call | ||
93 | * mode; more information below. | ||
94 | * | ||
95 | * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls | ||
96 | * to XZ code cannot consume any input and cannot produce any new output. | ||
97 | * This happens when there is no new input available, or the output buffer | ||
98 | * is full while at least one output byte is still pending. Assuming your | ||
99 | * code is not buggy, you can get this error only when decoding a compressed | ||
100 | * stream that is truncated or otherwise corrupt. | ||
101 | * | ||
102 | * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer | ||
103 | * is too small or the compressed input is corrupt in a way that makes the | ||
104 | * decoder produce more output than the caller expected. When it is | ||
105 | * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR | ||
106 | * is used instead of XZ_BUF_ERROR. | ||
107 | */ | ||
108 | enum xz_ret { | ||
109 | XZ_OK, | ||
110 | XZ_STREAM_END, | ||
111 | XZ_UNSUPPORTED_CHECK, | ||
112 | XZ_MEM_ERROR, | ||
113 | XZ_MEMLIMIT_ERROR, | ||
114 | XZ_FORMAT_ERROR, | ||
115 | XZ_OPTIONS_ERROR, | ||
116 | XZ_DATA_ERROR, | ||
117 | XZ_BUF_ERROR | ||
118 | }; | ||
119 | |||
120 | /** | ||
121 | * struct xz_buf - Passing input and output buffers to XZ code | ||
122 | * @in: Beginning of the input buffer. This may be NULL if and only | ||
123 | * if in_pos is equal to in_size. | ||
124 | * @in_pos: Current position in the input buffer. This must not exceed | ||
125 | * in_size. | ||
126 | * @in_size: Size of the input buffer | ||
127 | * @out: Beginning of the output buffer. This may be NULL if and only | ||
128 | * if out_pos is equal to out_size. | ||
129 | * @out_pos: Current position in the output buffer. This must not exceed | ||
130 | * out_size. | ||
131 | * @out_size: Size of the output buffer | ||
132 | * | ||
133 | * Only the contents of the output buffer from out[out_pos] onward, and | ||
134 | * the variables in_pos and out_pos are modified by the XZ code. | ||
135 | */ | ||
136 | struct xz_buf { | ||
137 | const uint8_t *in; | ||
138 | size_t in_pos; | ||
139 | size_t in_size; | ||
140 | |||
141 | uint8_t *out; | ||
142 | size_t out_pos; | ||
143 | size_t out_size; | ||
144 | }; | ||
145 | |||
146 | /** | ||
147 | * struct xz_dec - Opaque type to hold the XZ decoder state | ||
148 | */ | ||
149 | struct xz_dec; | ||
150 | |||
151 | /** | ||
152 | * xz_dec_init() - Allocate and initialize a XZ decoder state | ||
153 | * @mode: Operation mode | ||
154 | * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for | ||
155 | * multi-call decoding. This is ignored in single-call mode | ||
156 | * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes | ||
157 | * or 2^n + 2^(n-1) bytes (the latter sizes are less common | ||
158 | * in practice), so other values for dict_max don't make sense. | ||
159 | * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB, | ||
160 | * 512 KiB, and 1 MiB are probably the only reasonable values, | ||
161 | * except for kernel and initramfs images where a bigger | ||
162 | * dictionary can be fine and useful. | ||
163 | * | ||
164 | * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at | ||
165 | * once. The caller must provide enough output space or the decoding will | ||
166 | * fail. The output space is used as the dictionary buffer, which is why | ||
167 | * there is no need to allocate the dictionary as part of the decoder's | ||
168 | * internal state. | ||
169 | * | ||
170 | * Because the output buffer is used as the workspace, streams encoded using | ||
171 | * a big dictionary are not a problem in single-call mode. It is enough that | ||
172 | * the output buffer is big enough to hold the actual uncompressed data; it | ||
173 | * can be smaller than the dictionary size stored in the stream headers. | ||
174 | * | ||
175 | * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes | ||
176 | * of memory is preallocated for the LZMA2 dictionary. This way there is no | ||
177 | * risk that xz_dec_run() could run out of memory, since xz_dec_run() will | ||
178 | * never allocate any memory. Instead, if the preallocated dictionary is too | ||
179 | * small for decoding the given input stream, xz_dec_run() will return | ||
180 | * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be | ||
181 | * decoded to avoid allocating excessive amount of memory for the dictionary. | ||
182 | * | ||
183 | * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC): | ||
184 | * dict_max specifies the maximum allowed dictionary size that xz_dec_run() | ||
185 | * may allocate once it has parsed the dictionary size from the stream | ||
186 | * headers. This way excessive allocations can be avoided while still | ||
187 | * limiting the maximum memory usage to a sane value to prevent running the | ||
188 | * system out of memory when decompressing streams from untrusted sources. | ||
189 | * | ||
190 | * On success, xz_dec_init() returns a pointer to struct xz_dec, which is | ||
191 | * ready to be used with xz_dec_run(). If memory allocation fails, | ||
192 | * xz_dec_init() returns NULL. | ||
193 | */ | ||
194 | XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max); | ||
195 | |||
196 | /** | ||
197 | * xz_dec_run() - Run the XZ decoder | ||
198 | * @s: Decoder state allocated using xz_dec_init() | ||
199 | * @b: Input and output buffers | ||
200 | * | ||
201 | * The possible return values depend on build options and operation mode. | ||
202 | * See enum xz_ret for details. | ||
203 | * | ||
204 | * Note that if an error occurs in single-call mode (return value is not | ||
205 | * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the | ||
206 | * contents of the output buffer from b->out[b->out_pos] onward are | ||
207 | * undefined. This is true even after XZ_BUF_ERROR, because with some filter | ||
208 | * chains, there may be a second pass over the output buffer, and this pass | ||
209 | * cannot be properly done if the output buffer is truncated. Thus, you | ||
210 | * cannot give the single-call decoder a too small buffer and then expect to | ||
211 | * get that amount valid data from the beginning of the stream. You must use | ||
212 | * the multi-call decoder if you don't want to uncompress the whole stream. | ||
213 | */ | ||
214 | XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b); | ||
215 | |||
216 | /** | ||
217 | * xz_dec_reset() - Reset an already allocated decoder state | ||
218 | * @s: Decoder state allocated using xz_dec_init() | ||
219 | * | ||
220 | * This function can be used to reset the multi-call decoder state without | ||
221 | * freeing and reallocating memory with xz_dec_end() and xz_dec_init(). | ||
222 | * | ||
223 | * In single-call mode, xz_dec_reset() is always called in the beginning of | ||
224 | * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in | ||
225 | * multi-call mode. | ||
226 | */ | ||
227 | XZ_EXTERN void xz_dec_reset(struct xz_dec *s); | ||
228 | |||
229 | /** | ||
230 | * xz_dec_end() - Free the memory allocated for the decoder state | ||
231 | * @s: Decoder state allocated using xz_dec_init(). If s is NULL, | ||
232 | * this function does nothing. | ||
233 | */ | ||
234 | XZ_EXTERN void xz_dec_end(struct xz_dec *s); | ||
235 | |||
236 | /* | ||
237 | * Standalone build (userspace build or in-kernel build for boot time use) | ||
238 | * needs a CRC32 implementation. For normal in-kernel use, kernel's own | ||
239 | * CRC32 module is used instead, and users of this module don't need to | ||
240 | * care about the functions below. | ||
241 | */ | ||
242 | #ifndef XZ_INTERNAL_CRC32 | ||
243 | # ifdef __KERNEL__ | ||
244 | # define XZ_INTERNAL_CRC32 0 | ||
245 | # else | ||
246 | # define XZ_INTERNAL_CRC32 1 | ||
247 | # endif | ||
248 | #endif | ||
249 | |||
250 | #if XZ_INTERNAL_CRC32 | ||
251 | /* | ||
252 | * This must be called before any other xz_* function to initialize | ||
253 | * the CRC32 lookup table. | ||
254 | */ | ||
255 | XZ_EXTERN void xz_crc32_init(void); | ||
256 | |||
257 | /* | ||
258 | * Update CRC32 value using the polynomial from IEEE-802.3. To start a new | ||
259 | * calculation, the third argument must be zero. To continue the calculation, | ||
260 | * the previously returned value is passed as the third argument. | ||
261 | */ | ||
262 | XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc); | ||
263 | #endif | ||
264 | #endif | ||
diff --git a/include/media/bt819.h b/include/media/bt819.h index 38f666bde77a..8025f4bc2bb6 100644 --- a/include/media/bt819.h +++ b/include/media/bt819.h | |||
@@ -26,7 +26,10 @@ | |||
26 | /* v4l2_device notifications. */ | 26 | /* v4l2_device notifications. */ |
27 | 27 | ||
28 | /* Needed to reset the FIFO buffer when changing the input | 28 | /* Needed to reset the FIFO buffer when changing the input |
29 | or the video standard. */ | 29 | or the video standard. |
30 | |||
31 | Note: these ioctls that internal to the kernel and are never called | ||
32 | from userspace. */ | ||
30 | #define BT819_FIFO_RESET_LOW _IO('b', 0) | 33 | #define BT819_FIFO_RESET_LOW _IO('b', 0) |
31 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) | 34 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) |
32 | 35 | ||
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 8d08ebfe20b7..9635eebaab09 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -95,7 +95,7 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, | |||
95 | const struct cx2341x_mpeg_params *new); | 95 | const struct cx2341x_mpeg_params *new); |
96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, | 96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, |
97 | struct v4l2_queryctrl *qctrl); | 97 | struct v4l2_queryctrl *qctrl); |
98 | const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); | 98 | const char * const *cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); |
99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, | 99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, |
100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); | 100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); |
101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); | 101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); |
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index c59cc029c74a..b586495bcd53 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
@@ -44,7 +44,7 @@ struct vpss_pg_frame_size { | |||
44 | short pplen; | 44 | short pplen; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* Used for enable/diable VPSS Clock */ | 47 | /* Used for enable/disable VPSS Clock */ |
48 | enum vpss_clock_sel { | 48 | enum vpss_clock_sel { |
49 | /* DM355/DM365 */ | 49 | /* DM355/DM365 */ |
50 | VPSS_CCDC_CLOCK, | 50 | VPSS_CCDC_CLOCK, |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h deleted file mode 100644 index 528050e39ad9..000000000000 --- a/include/media/ir-common.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * some common structs and functions to handle infrared remotes via | ||
4 | * input layer ... | ||
5 | * | ||
6 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | ||
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 _IR_COMMON | ||
24 | #define _IR_COMMON | ||
25 | |||
26 | #include <linux/input.h> | ||
27 | #include <linux/workqueue.h> | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <media/ir-core.h> | ||
30 | |||
31 | #define RC5_START(x) (((x)>>12)&3) | ||
32 | #define RC5_TOGGLE(x) (((x)>>11)&1) | ||
33 | #define RC5_ADDR(x) (((x)>>6)&31) | ||
34 | #define RC5_INSTR(x) ((x)&63) | ||
35 | |||
36 | struct ir_input_state { | ||
37 | /* configuration */ | ||
38 | u64 ir_type; | ||
39 | |||
40 | /* key info */ | ||
41 | u32 ir_key; /* ir scancode */ | ||
42 | u32 keycode; /* linux key code */ | ||
43 | int keypressed; /* current state */ | ||
44 | }; | ||
45 | |||
46 | /* this was saa7134_ir and bttv_ir, moved here for | ||
47 | * rc5 decoding. */ | ||
48 | struct card_ir { | ||
49 | struct input_dev *dev; | ||
50 | struct ir_input_state ir; | ||
51 | char name[32]; | ||
52 | char phys[32]; | ||
53 | int users; | ||
54 | |||
55 | u32 running:1; | ||
56 | struct ir_dev_props props; | ||
57 | |||
58 | /* Usual gpio signalling */ | ||
59 | |||
60 | u32 mask_keycode; | ||
61 | u32 mask_keydown; | ||
62 | u32 mask_keyup; | ||
63 | u32 polling; | ||
64 | u32 last_gpio; | ||
65 | int shift_by; | ||
66 | int start; // What should RC5_START() be | ||
67 | int addr; // What RC5_ADDR() should be. | ||
68 | int rc5_key_timeout; | ||
69 | int rc5_remote_gap; | ||
70 | struct work_struct work; | ||
71 | struct timer_list timer; | ||
72 | |||
73 | /* RC5 gpio */ | ||
74 | u32 rc5_gpio; | ||
75 | struct timer_list timer_end; /* timer_end for code completion */ | ||
76 | struct timer_list timer_keyup; /* timer_end for key release */ | ||
77 | u32 last_rc5; /* last good rc5 code */ | ||
78 | u32 last_bit; /* last raw bit seen */ | ||
79 | u32 code; /* raw code under construction */ | ||
80 | struct timeval base_time; /* time of last seen code */ | ||
81 | int active; /* building raw code */ | ||
82 | |||
83 | /* NEC decoding */ | ||
84 | u32 nec_gpio; | ||
85 | struct tasklet_struct tlet; | ||
86 | |||
87 | /* IR core raw decoding */ | ||
88 | u32 raw_decode; | ||
89 | }; | ||
90 | |||
91 | /* Routines from ir-functions.c */ | ||
92 | |||
93 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
94 | const u64 ir_type); | ||
95 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | ||
96 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | ||
97 | u32 ir_key); | ||
98 | u32 ir_extract_bits(u32 data, u32 mask); | ||
99 | int ir_dump_samples(u32 *samples, int count); | ||
100 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | ||
101 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | ||
102 | u32 ir_rc5_decode(unsigned int code); | ||
103 | |||
104 | void ir_rc5_timer_end(unsigned long data); | ||
105 | void ir_rc5_timer_keyup(unsigned long data); | ||
106 | |||
107 | #endif | ||
diff --git a/include/media/ir-core.h b/include/media/ir-core.h deleted file mode 100644 index 6dc37fae6606..000000000000 --- a/include/media/ir-core.h +++ /dev/null | |||
@@ -1,214 +0,0 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.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 as published by | ||
8 | * the Free Software Foundation version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _IR_CORE | ||
17 | #define _IR_CORE | ||
18 | |||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/kfifo.h> | ||
21 | #include <linux/time.h> | ||
22 | #include <linux/timer.h> | ||
23 | #include <media/rc-map.h> | ||
24 | |||
25 | extern int ir_core_debug; | ||
26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | ||
27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
28 | |||
29 | enum rc_driver_type { | ||
30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct ir_dev_props - Allow caller drivers to set special properties | ||
36 | * @driver_type: specifies if the driver or hardware have already a decoder, | ||
37 | * or if it needs to use the IR raw event decoders to produce a scancode | ||
38 | * @allowed_protos: bitmask with the supported IR_TYPE_* protocols | ||
39 | * @scanmask: some hardware decoders are not capable of providing the full | ||
40 | * scancode to the application. As this is a hardware limit, we can't do | ||
41 | * anything with it. Yet, as the same keycode table can be used with other | ||
42 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
43 | * leave this field in blank | ||
44 | * @timeout: optional time after which device stops sending data | ||
45 | * @min_timeout: minimum timeout supported by device | ||
46 | * @max_timeout: maximum timeout supported by device | ||
47 | * @rx_resolution : resolution (in ns) of input sampler | ||
48 | * @tx_resolution: resolution (in ns) of output sampler | ||
49 | * @priv: driver-specific data, to be used on the callbacks | ||
50 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
51 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
52 | * is opened. | ||
53 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
54 | * is opened. | ||
55 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
56 | * @s_tx_carrier: set transmit carrier frequency | ||
57 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
58 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
59 | * @tx_ir: transmit IR | ||
60 | * @s_idle: optional: enable/disable hardware idle mode, upon which, | ||
61 | device doesn't interrupt host until it sees IR pulses | ||
62 | * @s_learning_mode: enable wide band receiver used for learning | ||
63 | * @s_carrier_report: enable carrier reports | ||
64 | */ | ||
65 | struct ir_dev_props { | ||
66 | enum rc_driver_type driver_type; | ||
67 | unsigned long allowed_protos; | ||
68 | u32 scanmask; | ||
69 | |||
70 | u32 timeout; | ||
71 | u32 min_timeout; | ||
72 | u32 max_timeout; | ||
73 | |||
74 | u32 rx_resolution; | ||
75 | u32 tx_resolution; | ||
76 | |||
77 | void *priv; | ||
78 | int (*change_protocol)(void *priv, u64 ir_type); | ||
79 | int (*open)(void *priv); | ||
80 | void (*close)(void *priv); | ||
81 | int (*s_tx_mask)(void *priv, u32 mask); | ||
82 | int (*s_tx_carrier)(void *priv, u32 carrier); | ||
83 | int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); | ||
84 | int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); | ||
85 | int (*tx_ir)(void *priv, int *txbuf, u32 n); | ||
86 | void (*s_idle)(void *priv, bool enable); | ||
87 | int (*s_learning_mode)(void *priv, int enable); | ||
88 | int (*s_carrier_report) (void *priv, int enable); | ||
89 | }; | ||
90 | |||
91 | struct ir_input_dev { | ||
92 | struct device dev; /* device */ | ||
93 | char *driver_name; /* Name of the driver module */ | ||
94 | struct ir_scancode_table rc_tab; /* scan/key table */ | ||
95 | unsigned long devno; /* device number */ | ||
96 | struct ir_dev_props *props; /* Device properties */ | ||
97 | struct ir_raw_event_ctrl *raw; /* for raw pulse/space events */ | ||
98 | struct input_dev *input_dev; /* the input device associated with this device */ | ||
99 | bool idle; | ||
100 | |||
101 | /* key info - needed by IR keycode handlers */ | ||
102 | spinlock_t keylock; /* protects the below members */ | ||
103 | bool keypressed; /* current state */ | ||
104 | unsigned long keyup_jiffies; /* when should the current keypress be released? */ | ||
105 | struct timer_list timer_keyup; /* timer for releasing a keypress */ | ||
106 | u32 last_keycode; /* keycode of last command */ | ||
107 | u32 last_scancode; /* scancode of last command */ | ||
108 | u8 last_toggle; /* toggle of last command */ | ||
109 | }; | ||
110 | |||
111 | enum raw_event_type { | ||
112 | IR_SPACE = (1 << 0), | ||
113 | IR_PULSE = (1 << 1), | ||
114 | IR_START_EVENT = (1 << 2), | ||
115 | IR_STOP_EVENT = (1 << 3), | ||
116 | }; | ||
117 | |||
118 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | ||
119 | |||
120 | /* From ir-keytable.c */ | ||
121 | int __ir_input_register(struct input_dev *dev, | ||
122 | const struct ir_scancode_table *ir_codes, | ||
123 | struct ir_dev_props *props, | ||
124 | const char *driver_name); | ||
125 | |||
126 | static inline int ir_input_register(struct input_dev *dev, | ||
127 | const char *map_name, | ||
128 | struct ir_dev_props *props, | ||
129 | const char *driver_name) { | ||
130 | struct ir_scancode_table *ir_codes; | ||
131 | struct ir_input_dev *ir_dev; | ||
132 | int rc; | ||
133 | |||
134 | if (!map_name) | ||
135 | return -EINVAL; | ||
136 | |||
137 | ir_codes = get_rc_map(map_name); | ||
138 | if (!ir_codes) { | ||
139 | ir_codes = get_rc_map(RC_MAP_EMPTY); | ||
140 | |||
141 | if (!ir_codes) | ||
142 | return -EINVAL; | ||
143 | } | ||
144 | |||
145 | rc = __ir_input_register(dev, ir_codes, props, driver_name); | ||
146 | if (rc < 0) | ||
147 | return -EINVAL; | ||
148 | |||
149 | ir_dev = input_get_drvdata(dev); | ||
150 | |||
151 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
152 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
153 | ir_codes->ir_type); | ||
154 | |||
155 | return rc; | ||
156 | } | ||
157 | |||
158 | void ir_input_unregister(struct input_dev *input_dev); | ||
159 | |||
160 | void ir_repeat(struct input_dev *dev); | ||
161 | void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); | ||
162 | void ir_keyup(struct ir_input_dev *ir); | ||
163 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); | ||
164 | |||
165 | /* From ir-raw-event.c */ | ||
166 | |||
167 | struct ir_raw_event { | ||
168 | union { | ||
169 | u32 duration; | ||
170 | |||
171 | struct { | ||
172 | u32 carrier; | ||
173 | u8 duty_cycle; | ||
174 | }; | ||
175 | }; | ||
176 | |||
177 | unsigned pulse:1; | ||
178 | unsigned reset:1; | ||
179 | unsigned timeout:1; | ||
180 | unsigned carrier_report:1; | ||
181 | }; | ||
182 | |||
183 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
184 | struct ir_raw_event event = { \ | ||
185 | { .duration = 0 } , \ | ||
186 | .pulse = 0, \ | ||
187 | .reset = 0, \ | ||
188 | .timeout = 0, \ | ||
189 | .carrier_report = 0 } | ||
190 | |||
191 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
192 | { | ||
193 | memset(ev, 0, sizeof(*ev)); | ||
194 | } | ||
195 | |||
196 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | ||
197 | |||
198 | void ir_raw_event_handle(struct input_dev *input_dev); | ||
199 | int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); | ||
200 | int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); | ||
201 | int ir_raw_event_store_with_filter(struct input_dev *input_dev, | ||
202 | struct ir_raw_event *ev); | ||
203 | void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle); | ||
204 | |||
205 | static inline void ir_raw_event_reset(struct input_dev *input_dev) | ||
206 | { | ||
207 | DEFINE_IR_RAW_EVENT(ev); | ||
208 | ev.reset = true; | ||
209 | |||
210 | ir_raw_event_store(input_dev, &ev); | ||
211 | ir_raw_event_handle(input_dev); | ||
212 | } | ||
213 | |||
214 | #endif /* _IR_CORE */ | ||
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 557c676ab7dc..768aa77925cd 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _IR_I2C | 1 | #ifndef _IR_I2C |
2 | #define _IR_I2C | 2 | #define _IR_I2C |
3 | 3 | ||
4 | #include <media/ir-common.h> | 4 | #include <media/rc-core.h> |
5 | 5 | ||
6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ | 6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ |
7 | 7 | ||
@@ -9,11 +9,9 @@ struct IR_i2c; | |||
9 | 9 | ||
10 | struct IR_i2c { | 10 | struct IR_i2c { |
11 | char *ir_codes; | 11 | char *ir_codes; |
12 | |||
13 | struct i2c_client *c; | 12 | struct i2c_client *c; |
14 | struct input_dev *input; | 13 | struct rc_dev *rc; |
15 | struct ir_input_state ir; | 14 | |
16 | u64 ir_type; | ||
17 | /* Used to avoid fast repeating */ | 15 | /* Used to avoid fast repeating */ |
18 | unsigned char old; | 16 | unsigned char old; |
19 | 17 | ||
@@ -39,13 +37,16 @@ enum ir_kbd_get_key_fn { | |||
39 | struct IR_i2c_init_data { | 37 | struct IR_i2c_init_data { |
40 | char *ir_codes; | 38 | char *ir_codes; |
41 | const char *name; | 39 | const char *name; |
42 | u64 type; /* IR_TYPE_RC5, etc */ | 40 | u64 type; /* RC_TYPE_RC5, etc */ |
43 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ | 41 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ |
42 | |||
44 | /* | 43 | /* |
45 | * Specify either a function pointer or a value indicating one of | 44 | * Specify either a function pointer or a value indicating one of |
46 | * ir_kbd_i2c's internal get_key functions | 45 | * ir_kbd_i2c's internal get_key functions |
47 | */ | 46 | */ |
48 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 47 | int (*get_key)(struct IR_i2c*, u32*, u32*); |
49 | enum ir_kbd_get_key_fn internal_get_key_func; | 48 | enum ir_kbd_get_key_fn internal_get_key_func; |
49 | |||
50 | struct rc_dev *rc_dev; | ||
50 | }; | 51 | }; |
51 | #endif | 52 | #endif |
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 54780a560d0e..630e702c9511 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h | |||
@@ -217,9 +217,9 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file); | |||
217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); | 217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); |
218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); | 218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); |
219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
220 | ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, | 220 | ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length, |
221 | loff_t *ppos); | 221 | loff_t *ppos); |
222 | ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, | 222 | ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, |
223 | loff_t *ppos); | 223 | size_t length, loff_t *ppos); |
224 | 224 | ||
225 | #endif | 225 | #endif |
diff --git a/include/media/mt9v011.h b/include/media/mt9v011.h new file mode 100644 index 000000000000..ea29fc74cd06 --- /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/ovcamchip.h b/include/media/ovcamchip.h deleted file mode 100644 index 05b9569ef1c8..000000000000 --- a/include/media/ovcamchip.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* OmniVision* camera chip driver API | ||
2 | * | ||
3 | * Copyright (c) 1999-2004 Mark McClelland | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied. | ||
9 | * | ||
10 | * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver | ||
11 | * is not sponsored or developed by them. | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_OVCAMCHIP_H | ||
15 | #define __LINUX_OVCAMCHIP_H | ||
16 | |||
17 | #include <linux/videodev.h> | ||
18 | #include <media/v4l2-common.h> | ||
19 | |||
20 | /* --------------------------------- */ | ||
21 | /* ENUMERATIONS */ | ||
22 | /* --------------------------------- */ | ||
23 | |||
24 | /* Controls */ | ||
25 | enum { | ||
26 | OVCAMCHIP_CID_CONT, /* Contrast */ | ||
27 | OVCAMCHIP_CID_BRIGHT, /* Brightness */ | ||
28 | OVCAMCHIP_CID_SAT, /* Saturation */ | ||
29 | OVCAMCHIP_CID_HUE, /* Hue */ | ||
30 | OVCAMCHIP_CID_EXP, /* Exposure */ | ||
31 | OVCAMCHIP_CID_FREQ, /* Light frequency */ | ||
32 | OVCAMCHIP_CID_BANDFILT, /* Banding filter */ | ||
33 | OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */ | ||
34 | OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */ | ||
35 | OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */ | ||
36 | OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */ | ||
37 | }; | ||
38 | |||
39 | /* Chip types */ | ||
40 | #define NUM_CC_TYPES 9 | ||
41 | enum { | ||
42 | CC_UNKNOWN, | ||
43 | CC_OV76BE, | ||
44 | CC_OV7610, | ||
45 | CC_OV7620, | ||
46 | CC_OV7620AE, | ||
47 | CC_OV6620, | ||
48 | CC_OV6630, | ||
49 | CC_OV6630AE, | ||
50 | CC_OV6630AF, | ||
51 | }; | ||
52 | |||
53 | /* --------------------------------- */ | ||
54 | /* I2C ADDRESSES */ | ||
55 | /* --------------------------------- */ | ||
56 | |||
57 | #define OV7xx0_SID (0x42 >> 1) | ||
58 | #define OV6xx0_SID (0xC0 >> 1) | ||
59 | |||
60 | /* --------------------------------- */ | ||
61 | /* API */ | ||
62 | /* --------------------------------- */ | ||
63 | |||
64 | struct ovcamchip_control { | ||
65 | __u32 id; | ||
66 | __s32 value; | ||
67 | }; | ||
68 | |||
69 | struct ovcamchip_window { | ||
70 | int x; | ||
71 | int y; | ||
72 | int width; | ||
73 | int height; | ||
74 | int format; | ||
75 | int quarter; /* Scale width and height down 2x */ | ||
76 | |||
77 | /* This stuff will be removed eventually */ | ||
78 | int clockdiv; /* Clock divisor setting */ | ||
79 | }; | ||
80 | |||
81 | /* Commands */ | ||
82 | #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int) | ||
83 | #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int) | ||
84 | /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */ | ||
85 | #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control) | ||
86 | #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control) | ||
87 | #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window) | ||
88 | #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f) | ||
89 | |||
90 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h new file mode 100644 index 000000000000..2963263f31e2 --- /dev/null +++ b/include/media/rc-core.h | |||
@@ -0,0 +1,223 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.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 as published by | ||
8 | * the Free Software Foundation version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _RC_CORE | ||
17 | #define _RC_CORE | ||
18 | |||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/kfifo.h> | ||
21 | #include <linux/time.h> | ||
22 | #include <linux/timer.h> | ||
23 | #include <media/rc-map.h> | ||
24 | |||
25 | extern int rc_core_debug; | ||
26 | #define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ | ||
27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
28 | |||
29 | enum rc_driver_type { | ||
30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct rc_dev - represents a remote control device | ||
36 | * @dev: driver model's view of this device | ||
37 | * @input_name: name of the input child device | ||
38 | * @input_phys: physical path to the input child device | ||
39 | * @input_id: id of the input child device (struct input_id) | ||
40 | * @driver_name: name of the hardware driver which registered this device | ||
41 | * @map_name: name of the default keymap | ||
42 | * @rc_map: current scan/key table | ||
43 | * @devno: unique remote control device number | ||
44 | * @raw: additional data for raw pulse/space devices | ||
45 | * @input_dev: the input child device used to communicate events to userspace | ||
46 | * @driver_type: specifies if protocol decoding is done in hardware or software | ||
47 | * @idle: used to keep track of RX state | ||
48 | * @allowed_protos: bitmask with the supported RC_TYPE_* protocols | ||
49 | * @scanmask: some hardware decoders are not capable of providing the full | ||
50 | * scancode to the application. As this is a hardware limit, we can't do | ||
51 | * anything with it. Yet, as the same keycode table can be used with other | ||
52 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
53 | * leave this field in blank | ||
54 | * @priv: driver-specific data | ||
55 | * @keylock: protects the remaining members of the struct | ||
56 | * @keypressed: whether a key is currently pressed | ||
57 | * @keyup_jiffies: time (in jiffies) when the current keypress should be released | ||
58 | * @timer_keyup: timer for releasing a keypress | ||
59 | * @last_keycode: keycode of last keypress | ||
60 | * @last_scancode: scancode of last keypress | ||
61 | * @last_toggle: toggle value of last command | ||
62 | * @timeout: optional time after which device stops sending data | ||
63 | * @min_timeout: minimum timeout supported by device | ||
64 | * @max_timeout: maximum timeout supported by device | ||
65 | * @rx_resolution : resolution (in ns) of input sampler | ||
66 | * @tx_resolution: resolution (in ns) of output sampler | ||
67 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
68 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
69 | * is opened. | ||
70 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
71 | * is opened. | ||
72 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
73 | * @s_tx_carrier: set transmit carrier frequency | ||
74 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
75 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
76 | * @tx_ir: transmit IR | ||
77 | * @s_idle: enable/disable hardware idle mode, upon which, | ||
78 | * device doesn't interrupt host until it sees IR pulses | ||
79 | * @s_learning_mode: enable wide band receiver used for learning | ||
80 | * @s_carrier_report: enable carrier reports | ||
81 | */ | ||
82 | struct rc_dev { | ||
83 | struct device dev; | ||
84 | const char *input_name; | ||
85 | const char *input_phys; | ||
86 | struct input_id input_id; | ||
87 | char *driver_name; | ||
88 | const char *map_name; | ||
89 | struct rc_map rc_map; | ||
90 | unsigned long devno; | ||
91 | struct ir_raw_event_ctrl *raw; | ||
92 | struct input_dev *input_dev; | ||
93 | enum rc_driver_type driver_type; | ||
94 | bool idle; | ||
95 | u64 allowed_protos; | ||
96 | u32 scanmask; | ||
97 | void *priv; | ||
98 | spinlock_t keylock; | ||
99 | bool keypressed; | ||
100 | unsigned long keyup_jiffies; | ||
101 | struct timer_list timer_keyup; | ||
102 | u32 last_keycode; | ||
103 | u32 last_scancode; | ||
104 | u8 last_toggle; | ||
105 | u32 timeout; | ||
106 | u32 min_timeout; | ||
107 | u32 max_timeout; | ||
108 | u32 rx_resolution; | ||
109 | u32 tx_resolution; | ||
110 | int (*change_protocol)(struct rc_dev *dev, u64 rc_type); | ||
111 | int (*open)(struct rc_dev *dev); | ||
112 | void (*close)(struct rc_dev *dev); | ||
113 | int (*s_tx_mask)(struct rc_dev *dev, u32 mask); | ||
114 | int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); | ||
115 | int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); | ||
116 | int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); | ||
117 | int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); | ||
118 | void (*s_idle)(struct rc_dev *dev, bool enable); | ||
119 | int (*s_learning_mode)(struct rc_dev *dev, int enable); | ||
120 | int (*s_carrier_report) (struct rc_dev *dev, int enable); | ||
121 | }; | ||
122 | |||
123 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) | ||
124 | |||
125 | /* | ||
126 | * From rc-main.c | ||
127 | * Those functions can be used on any type of Remote Controller. They | ||
128 | * basically creates an input_dev and properly reports the device as a | ||
129 | * Remote Controller, at sys/class/rc. | ||
130 | */ | ||
131 | |||
132 | struct rc_dev *rc_allocate_device(void); | ||
133 | void rc_free_device(struct rc_dev *dev); | ||
134 | int rc_register_device(struct rc_dev *dev); | ||
135 | void rc_unregister_device(struct rc_dev *dev); | ||
136 | |||
137 | void rc_repeat(struct rc_dev *dev); | ||
138 | void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); | ||
139 | void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); | ||
140 | void rc_keyup(struct rc_dev *dev); | ||
141 | u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode); | ||
142 | |||
143 | /* | ||
144 | * From rc-raw.c | ||
145 | * The Raw interface is specific to InfraRed. It may be a good idea to | ||
146 | * split it later into a separate header. | ||
147 | */ | ||
148 | |||
149 | enum raw_event_type { | ||
150 | IR_SPACE = (1 << 0), | ||
151 | IR_PULSE = (1 << 1), | ||
152 | IR_START_EVENT = (1 << 2), | ||
153 | IR_STOP_EVENT = (1 << 3), | ||
154 | }; | ||
155 | |||
156 | struct ir_raw_event { | ||
157 | union { | ||
158 | u32 duration; | ||
159 | |||
160 | struct { | ||
161 | u32 carrier; | ||
162 | u8 duty_cycle; | ||
163 | }; | ||
164 | }; | ||
165 | |||
166 | unsigned pulse:1; | ||
167 | unsigned reset:1; | ||
168 | unsigned timeout:1; | ||
169 | unsigned carrier_report:1; | ||
170 | }; | ||
171 | |||
172 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
173 | struct ir_raw_event event = { \ | ||
174 | { .duration = 0 } , \ | ||
175 | .pulse = 0, \ | ||
176 | .reset = 0, \ | ||
177 | .timeout = 0, \ | ||
178 | .carrier_report = 0 } | ||
179 | |||
180 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
181 | { | ||
182 | memset(ev, 0, sizeof(*ev)); | ||
183 | } | ||
184 | |||
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) | ||
189 | |||
190 | void ir_raw_event_handle(struct rc_dev *dev); | ||
191 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); | ||
192 | int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type); | ||
193 | int ir_raw_event_store_with_filter(struct rc_dev *dev, | ||
194 | struct ir_raw_event *ev); | ||
195 | void ir_raw_event_set_idle(struct rc_dev *dev, bool idle); | ||
196 | |||
197 | static inline void ir_raw_event_reset(struct rc_dev *dev) | ||
198 | { | ||
199 | DEFINE_IR_RAW_EVENT(ev); | ||
200 | ev.reset = true; | ||
201 | |||
202 | ir_raw_event_store(dev, &ev); | ||
203 | ir_raw_event_handle(dev); | ||
204 | } | ||
205 | |||
206 | /* extract mask bits out of data and pack them into the result */ | ||
207 | static inline u32 ir_extract_bits(u32 data, u32 mask) | ||
208 | { | ||
209 | u32 vbit = 1, value = 0; | ||
210 | |||
211 | do { | ||
212 | if (mask & 1) { | ||
213 | if (data & 1) | ||
214 | value |= vbit; | ||
215 | vbit <<= 1; | ||
216 | } | ||
217 | data >>= 1; | ||
218 | } while (mask >>= 1); | ||
219 | |||
220 | return value; | ||
221 | } | ||
222 | |||
223 | #endif /* _RC_CORE */ | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e0f17edf38ed..ee9e2f747c76 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -11,45 +11,45 @@ | |||
11 | 11 | ||
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | 13 | ||
14 | #define IR_TYPE_UNKNOWN 0 | 14 | #define RC_TYPE_UNKNOWN 0 |
15 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | 15 | #define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ |
16 | #define IR_TYPE_NEC (1 << 1) | 16 | #define RC_TYPE_NEC (1 << 1) |
17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | 17 | #define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ |
18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ |
19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
20 | #define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ | 20 | #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ |
21 | #define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | 21 | #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ |
22 | #define IR_TYPE_OTHER (1u << 31) | 22 | #define RC_TYPE_OTHER (1u << 31) |
23 | 23 | ||
24 | #define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ | 24 | #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ |
25 | IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ | 25 | RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ |
26 | IR_TYPE_RC5_SZ | IR_TYPE_OTHER) | 26 | RC_TYPE_RC5_SZ | RC_TYPE_OTHER) |
27 | 27 | ||
28 | struct ir_scancode { | 28 | struct rc_map_table { |
29 | u32 scancode; | 29 | u32 scancode; |
30 | u32 keycode; | 30 | u32 keycode; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct ir_scancode_table { | 33 | struct rc_map { |
34 | struct ir_scancode *scan; | 34 | struct rc_map_table *scan; |
35 | unsigned int size; /* Max number of entries */ | 35 | unsigned int size; /* Max number of entries */ |
36 | unsigned int len; /* Used number of entries */ | 36 | unsigned int len; /* Used number of entries */ |
37 | unsigned int alloc; /* Size of *scan in bytes */ | 37 | unsigned int alloc; /* Size of *scan in bytes */ |
38 | u64 ir_type; | 38 | u64 rc_type; |
39 | const char *name; | 39 | const char *name; |
40 | spinlock_t lock; | 40 | spinlock_t lock; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | struct rc_keymap { | 43 | struct rc_map_list { |
44 | struct list_head list; | 44 | struct list_head list; |
45 | struct ir_scancode_table map; | 45 | struct rc_map map; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* Routines from rc-map.c */ | 48 | /* Routines from rc-map.c */ |
49 | 49 | ||
50 | int ir_register_map(struct rc_keymap *map); | 50 | int rc_map_register(struct rc_map_list *map); |
51 | void ir_unregister_map(struct rc_keymap *map); | 51 | void rc_map_unregister(struct rc_map_list *map); |
52 | struct ir_scancode_table *get_rc_map(const char *name); | 52 | struct rc_map *rc_map_get(const char *name); |
53 | void rc_map_init(void); | 53 | void rc_map_init(void); |
54 | 54 | ||
55 | /* Names of the several keytables defined in-kernel */ | 55 | /* Names of the several keytables defined in-kernel */ |
@@ -119,6 +119,7 @@ void rc_map_init(void); | |||
119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" | 119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" |
120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" | 120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" |
121 | #define RC_MAP_PIXELVIEW "rc-pixelview" | 121 | #define RC_MAP_PIXELVIEW "rc-pixelview" |
122 | #define RC_MAP_PIXELVIEW_002T "rc-pixelview-002t" | ||
122 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" | 123 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" |
123 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" | 124 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" |
124 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" | 125 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" |
@@ -137,6 +138,7 @@ void rc_map_init(void); | |||
137 | #define RC_MAP_TREKSTOR "rc-trekstor" | 138 | #define RC_MAP_TREKSTOR "rc-trekstor" |
138 | #define RC_MAP_TT_1500 "rc-tt-1500" | 139 | #define RC_MAP_TT_1500 "rc-tt-1500" |
139 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" | 140 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" |
141 | #define RC_MAP_VIDEOMATE_M1F "rc-videomate-m1f" | ||
140 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | 142 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" |
141 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 143 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
142 | #define RC_MAP_WINFAST "rc-winfast" | 144 | #define RC_MAP_WINFAST "rc-winfast" |
diff --git a/include/media/rds.h b/include/media/saa6588.h index a89426667618..2c3c4420a4eb 100644 --- a/include/media/rds.h +++ b/include/media/saa6588.h | |||
@@ -4,9 +4,6 @@ | |||
4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants | 4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants |
5 | to use the saa6588 module. | 5 | to use the saa6588 module. |
6 | 6 | ||
7 | Instead of having a separate rds.h, I'd prefer to include | ||
8 | this stuff in one of the already existing files like tuner.h | ||
9 | |||
10 | (c) 2005 by Hans J. Koch | 7 | (c) 2005 by Hans J. Koch |
11 | 8 | ||
12 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
@@ -25,10 +22,10 @@ | |||
25 | 22 | ||
26 | */ | 23 | */ |
27 | 24 | ||
28 | #ifndef _RDS_H | 25 | #ifndef _SAA6588_H |
29 | #define _RDS_H | 26 | #define _SAA6588_H |
30 | 27 | ||
31 | struct rds_command { | 28 | struct saa6588_command { |
32 | unsigned int block_count; | 29 | unsigned int block_count; |
33 | int result; | 30 | int result; |
34 | unsigned char __user *buffer; | 31 | unsigned char __user *buffer; |
@@ -36,9 +33,10 @@ struct rds_command { | |||
36 | poll_table *event_list; | 33 | poll_table *event_list; |
37 | }; | 34 | }; |
38 | 35 | ||
39 | #define RDS_CMD_OPEN _IOW('R',1,int) | 36 | /* These ioctls are internal to the kernel */ |
40 | #define RDS_CMD_CLOSE _IOW('R',2,int) | 37 | #define SAA6588_CMD_OPEN _IOW('R', 1, int) |
41 | #define RDS_CMD_READ _IOR('R',3,int) | 38 | #define SAA6588_CMD_CLOSE _IOW('R', 2, int) |
42 | #define RDS_CMD_POLL _IOR('R',4,int) | 39 | #define SAA6588_CMD_READ _IOR('R', 3, int) |
40 | #define SAA6588_CMD_POLL _IOR('R', 4, int) | ||
43 | 41 | ||
44 | #endif | 42 | #endif |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index ac7ce00f39cf..79827143d5ac 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/si4713.h b/include/media/si4713.h index 99850a54ed09..ed7353e8a982 100644 --- a/include/media/si4713.h +++ b/include/media/si4713.h | |||
@@ -23,8 +23,7 @@ | |||
23 | * Platform dependent definition | 23 | * Platform dependent definition |
24 | */ | 24 | */ |
25 | struct si4713_platform_data { | 25 | struct si4713_platform_data { |
26 | /* Set power state, zero is off, non-zero is on. */ | 26 | int gpio_reset; /* < 0 if not used */ |
27 | int (*set_power)(int power); | ||
28 | }; | 27 | }; |
29 | 28 | ||
30 | /* | 29 | /* |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 86e3631764ef..9386db829fb7 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -97,6 +97,7 @@ struct soc_camera_host_ops { | |||
97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) | 97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) |
98 | 98 | ||
99 | struct i2c_board_info; | 99 | struct i2c_board_info; |
100 | struct regulator_bulk_data; | ||
100 | 101 | ||
101 | struct soc_camera_link { | 102 | struct soc_camera_link { |
102 | /* Camera bus id, used to match a camera and a bus */ | 103 | /* Camera bus id, used to match a camera and a bus */ |
@@ -108,6 +109,10 @@ struct soc_camera_link { | |||
108 | const char *module_name; | 109 | const char *module_name; |
109 | void *priv; | 110 | void *priv; |
110 | 111 | ||
112 | /* Optional regulators that have to be managed on power on/off events */ | ||
113 | struct regulator_bulk_data *regulators; | ||
114 | int num_regulators; | ||
115 | |||
111 | /* | 116 | /* |
112 | * For non-I2C devices platform platform has to provide methods to | 117 | * For non-I2C devices platform platform has to provide methods to |
113 | * add a device to the system and to remove | 118 | * add a device to the system and to remove |
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h index fcd32a3696ba..a59a84854dc1 100644 --- a/include/media/timb_radio.h +++ b/include/media/timb_radio.h | |||
@@ -24,7 +24,6 @@ | |||
24 | struct timb_radio_platform_data { | 24 | struct timb_radio_platform_data { |
25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ | 25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ |
26 | struct { | 26 | struct { |
27 | const char *module_name; | ||
28 | struct i2c_board_info *info; | 27 | struct i2c_board_info *info; |
29 | } tuner; | 28 | } tuner; |
30 | struct { | 29 | struct { |
diff --git a/include/media/timb_video.h b/include/media/timb_video.h new file mode 100644 index 000000000000..70ae43970a49 --- /dev/null +++ b/include/media/timb_video.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * timb_video.h Platform struct for the Timberdale video driver | ||
3 | * Copyright (c) 2009-2010 Intel Corporation | ||
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 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _TIMB_VIDEO_ | ||
20 | #define _TIMB_VIDEO_ 1 | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | struct timb_video_platform_data { | ||
25 | int dma_channel; | ||
26 | int i2c_adapter; /* The I2C adapter where the encoder is attached */ | ||
27 | struct { | ||
28 | const char *module_name; | ||
29 | struct i2c_board_info *info; | ||
30 | } encoder; | ||
31 | }; | ||
32 | |||
33 | #endif | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 51e89f2267b8..44fe44ec9ea7 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -74,6 +74,7 @@ enum { | |||
74 | V4L2_IDENT_SOI968 = 256, | 74 | V4L2_IDENT_SOI968 = 256, |
75 | V4L2_IDENT_OV9640 = 257, | 75 | V4L2_IDENT_OV9640 = 257, |
76 | V4L2_IDENT_OV6650 = 258, | 76 | V4L2_IDENT_OV6650 = 258, |
77 | V4L2_IDENT_OV2640 = 259, | ||
77 | 78 | ||
78 | /* module saa7146: reserved range 300-309 */ | 79 | /* module saa7146: reserved range 300-309 */ |
79 | V4L2_IDENT_SAA7146 = 300, | 80 | V4L2_IDENT_SAA7146 = 300, |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 239125af3ea3..a659319e8582 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -98,12 +98,12 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); | |||
98 | /* Control helper functions */ | 98 | /* Control helper functions */ |
99 | 99 | ||
100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, | 100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, |
101 | const char **menu_items); | 101 | const char * const *menu_items); |
102 | const char *v4l2_ctrl_get_name(u32 id); | 102 | const char *v4l2_ctrl_get_name(u32 id); |
103 | const char **v4l2_ctrl_get_menu(u32 id); | 103 | const char * const *v4l2_ctrl_get_menu(u32 id); |
104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); | 104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); |
105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, | 105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, |
106 | struct v4l2_queryctrl *qctrl, const char **menu_items); | 106 | struct v4l2_queryctrl *qctrl, const char * const *menu_items); |
107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) | 107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) |
108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); | 108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); |
109 | 109 | ||
@@ -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 9b7bea928a88..97d063837b61 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 | ||
@@ -112,7 +115,7 @@ struct v4l2_ctrl { | |||
112 | u32 step; | 115 | u32 step; |
113 | u32 menu_skip_mask; | 116 | u32 menu_skip_mask; |
114 | }; | 117 | }; |
115 | const char **qmenu; | 118 | const char * const *qmenu; |
116 | unsigned long flags; | 119 | unsigned long flags; |
117 | union { | 120 | union { |
118 | s32 val; | 121 | s32 val; |
@@ -202,7 +205,7 @@ struct v4l2_ctrl_config { | |||
202 | s32 def; | 205 | s32 def; |
203 | u32 flags; | 206 | u32 flags; |
204 | u32 menu_skip_mask; | 207 | u32 menu_skip_mask; |
205 | const char **qmenu; | 208 | const char * const *qmenu; |
206 | unsigned int is_private:1; | 209 | unsigned int is_private:1; |
207 | unsigned int is_volatile:1; | 210 | unsigned int is_volatile:1; |
208 | }; | 211 | }; |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 06daa6e8e051..67df37542c68 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -14,12 +14,7 @@ | |||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
16 | #include <linux/compiler.h> /* need __user */ | 16 | #include <linux/compiler.h> /* need __user */ |
17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
18 | #define __MIN_V4L1 | ||
19 | #include <linux/videodev.h> | ||
20 | #else | ||
21 | #include <linux/videodev2.h> | 17 | #include <linux/videodev2.h> |
22 | #endif | ||
23 | 18 | ||
24 | struct v4l2_fh; | 19 | struct v4l2_fh; |
25 | 20 | ||
@@ -113,10 +108,6 @@ struct v4l2_ioctl_ops { | |||
113 | 108 | ||
114 | 109 | ||
115 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); | 110 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
116 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
117 | /* buffer type is struct vidio_mbuf * */ | ||
118 | int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); | ||
119 | #endif | ||
120 | int (*vidioc_g_fbuf) (struct file *file, void *fh, | 111 | int (*vidioc_g_fbuf) (struct file *file, void *fh, |
121 | struct v4l2_framebuffer *a); | 112 | struct v4l2_framebuffer *a); |
122 | int (*vidioc_s_fbuf) (struct file *file, void *fh, | 113 | int (*vidioc_s_fbuf) (struct file *file, void *fh, |
@@ -300,22 +291,15 @@ extern void v4l_printk_ioctl(unsigned int cmd); | |||
300 | extern const char *v4l2_field_names[]; | 291 | extern const char *v4l2_field_names[]; |
301 | extern const char *v4l2_type_names[]; | 292 | extern const char *v4l2_type_names[]; |
302 | 293 | ||
303 | /* Compatibility layer interface -- v4l1-compat module */ | ||
304 | typedef long (*v4l2_kioctl)(struct file *file, | ||
305 | unsigned int cmd, void *arg); | ||
306 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
307 | long v4l_compat_translate_ioctl(struct file *file, | ||
308 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | ||
309 | #else | ||
310 | #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) | ||
311 | #endif | ||
312 | |||
313 | #ifdef CONFIG_COMPAT | 294 | #ifdef CONFIG_COMPAT |
314 | /* 32 Bits compatibility layer for 64 bits processors */ | 295 | /* 32 Bits compatibility layer for 64 bits processors */ |
315 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, | 296 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
316 | unsigned long arg); | 297 | unsigned long arg); |
317 | #endif | 298 | #endif |
318 | 299 | ||
300 | typedef long (*v4l2_kioctl)(struct file *file, | ||
301 | unsigned int cmd, void *arg); | ||
302 | |||
319 | /* Include support for obsoleted stuff */ | 303 | /* Include support for obsoleted stuff */ |
320 | extern long video_usercopy(struct file *file, unsigned int cmd, | 304 | extern long video_usercopy(struct file *file, unsigned int cmd, |
321 | unsigned long arg, v4l2_kioctl func); | 305 | unsigned long arg, v4l2_kioctl func); |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index b0316a7cf08d..daf1e57d9b26 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/media/videobuf-core.h b/include/media/videobuf-core.h index 1d3835fc26be..90ed895e217d 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -17,10 +17,6 @@ | |||
17 | #define _VIDEOBUF_CORE_H | 17 | #define _VIDEOBUF_CORE_H |
18 | 18 | ||
19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
21 | #define __MIN_V4L1 | ||
22 | #include <linux/videodev.h> | ||
23 | #endif | ||
24 | #include <linux/videodev2.h> | 20 | #include <linux/videodev2.h> |
25 | 21 | ||
26 | #define UNSET (-1U) | 22 | #define UNSET (-1U) |
@@ -212,10 +208,6 @@ int videobuf_qbuf(struct videobuf_queue *q, | |||
212 | struct v4l2_buffer *b); | 208 | struct v4l2_buffer *b); |
213 | int videobuf_dqbuf(struct videobuf_queue *q, | 209 | int videobuf_dqbuf(struct videobuf_queue *q, |
214 | struct v4l2_buffer *b, int nonblocking); | 210 | struct v4l2_buffer *b, int nonblocking); |
215 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
216 | int videobuf_cgmbuf(struct videobuf_queue *q, | ||
217 | struct video_mbuf *mbuf, int count); | ||
218 | #endif | ||
219 | int videobuf_streamon(struct videobuf_queue *q); | 211 | int videobuf_streamon(struct videobuf_queue *q); |
220 | int videobuf_streamoff(struct videobuf_queue *q); | 212 | int videobuf_streamoff(struct videobuf_queue *q); |
221 | 213 | ||
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index a9441249306c..23710aa6a181 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ADDRCONF_H | 1 | #ifndef _ADDRCONF_H |
2 | #define _ADDRCONF_H | 2 | #define _ADDRCONF_H |
3 | 3 | ||
4 | #define RETRANS_TIMER HZ | ||
5 | |||
6 | #define MAX_RTR_SOLICITATIONS 3 | 4 | #define MAX_RTR_SOLICITATIONS 3 |
7 | #define RTR_SOLICITATION_INTERVAL (4*HZ) | 5 | #define RTR_SOLICITATION_INTERVAL (4*HZ) |
8 | 6 | ||
diff --git a/include/net/ah.h b/include/net/ah.h index f0129f79a31a..ca95b98969dd 100644 --- a/include/net/ah.h +++ b/include/net/ah.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/skbuff.h> | 4 | #include <linux/skbuff.h> |
5 | 5 | ||
6 | /* This is the maximum truncated ICV length that we know of. */ | 6 | /* This is the maximum truncated ICV length that we know of. */ |
7 | #define MAX_AH_AUTH_LEN 12 | 7 | #define MAX_AH_AUTH_LEN 64 |
8 | 8 | ||
9 | struct crypto_ahash; | 9 | struct crypto_ahash; |
10 | 10 | ||
diff --git a/include/net/arp.h b/include/net/arp.h index f4cf6ce66586..91f0568a04ef 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -25,5 +25,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
25 | const unsigned char *src_hw, | 25 | const unsigned char *src_hw, |
26 | const unsigned char *target_hw); | 26 | const unsigned char *target_hw); |
27 | extern void arp_xmit(struct sk_buff *skb); | 27 | extern void arp_xmit(struct sk_buff *skb); |
28 | int arp_invalidate(struct net_device *dev, __be32 ip); | ||
28 | 29 | ||
29 | #endif /* _ARP_H */ | 30 | #endif /* _ARP_H */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index d81ea7997701..0c5e72503b77 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -144,6 +144,7 @@ struct bt_skb_cb { | |||
144 | __u8 tx_seq; | 144 | __u8 tx_seq; |
145 | __u8 retries; | 145 | __u8 retries; |
146 | __u8 sar; | 146 | __u8 sar; |
147 | unsigned short channel; | ||
147 | }; | 148 | }; |
148 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 149 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
149 | 150 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index e30e00834340..29a7a8ca0438 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,13 +12,13 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
@@ -489,7 +489,7 @@ struct hci_rp_read_local_name { | |||
489 | 489 | ||
490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 | 490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 |
491 | 491 | ||
492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a | 492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a |
493 | #define SCAN_DISABLED 0x00 | 493 | #define SCAN_DISABLED 0x00 |
494 | #define SCAN_INQUIRY 0x01 | 494 | #define SCAN_INQUIRY 0x01 |
495 | #define SCAN_PAGE 0x02 | 495 | #define SCAN_PAGE 0x02 |
@@ -874,7 +874,7 @@ struct hci_ev_si_security { | |||
874 | 874 | ||
875 | struct hci_command_hdr { | 875 | struct hci_command_hdr { |
876 | __le16 opcode; /* OCF & OGF */ | 876 | __le16 opcode; /* OCF & OGF */ |
877 | __u8 plen; | 877 | __u8 plen; |
878 | } __packed; | 878 | } __packed; |
879 | 879 | ||
880 | struct hci_event_hdr { | 880 | struct hci_event_hdr { |
@@ -934,9 +934,13 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
934 | struct sockaddr_hci { | 934 | struct sockaddr_hci { |
935 | sa_family_t hci_family; | 935 | sa_family_t hci_family; |
936 | unsigned short hci_dev; | 936 | unsigned short hci_dev; |
937 | unsigned short hci_channel; | ||
937 | }; | 938 | }; |
938 | #define HCI_DEV_NONE 0xffff | 939 | #define HCI_DEV_NONE 0xffff |
939 | 940 | ||
941 | #define HCI_CHANNEL_RAW 0 | ||
942 | #define HCI_CHANNEL_CONTROL 1 | ||
943 | |||
940 | struct hci_filter { | 944 | struct hci_filter { |
941 | unsigned long type_mask; | 945 | unsigned long type_mask; |
942 | unsigned long event_mask[2]; | 946 | unsigned long event_mask[2]; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ebec8c9a929d..d2cf88407690 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -44,15 +44,15 @@ struct inquiry_data { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct inquiry_entry { | 46 | struct inquiry_entry { |
47 | struct inquiry_entry *next; | 47 | struct inquiry_entry *next; |
48 | __u32 timestamp; | 48 | __u32 timestamp; |
49 | struct inquiry_data data; | 49 | struct inquiry_data data; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | struct inquiry_cache { | 52 | struct inquiry_cache { |
53 | spinlock_t lock; | 53 | spinlock_t lock; |
54 | __u32 timestamp; | 54 | __u32 timestamp; |
55 | struct inquiry_entry *list; | 55 | struct inquiry_entry *list; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct hci_conn_hash { | 58 | struct hci_conn_hash { |
@@ -129,6 +129,7 @@ struct hci_dev { | |||
129 | wait_queue_head_t req_wait_q; | 129 | wait_queue_head_t req_wait_q; |
130 | __u32 req_status; | 130 | __u32 req_status; |
131 | __u32 req_result; | 131 | __u32 req_result; |
132 | __u16 req_last_cmd; | ||
132 | 133 | ||
133 | struct inquiry_cache inq_cache; | 134 | struct inquiry_cache inq_cache; |
134 | struct hci_conn_hash conn_hash; | 135 | struct hci_conn_hash conn_hash; |
@@ -141,7 +142,7 @@ struct hci_dev { | |||
141 | void *driver_data; | 142 | void *driver_data; |
142 | void *core_data; | 143 | void *core_data; |
143 | 144 | ||
144 | atomic_t promisc; | 145 | atomic_t promisc; |
145 | 146 | ||
146 | struct dentry *debugfs; | 147 | struct dentry *debugfs; |
147 | 148 | ||
@@ -150,7 +151,7 @@ struct hci_dev { | |||
150 | 151 | ||
151 | struct rfkill *rfkill; | 152 | struct rfkill *rfkill; |
152 | 153 | ||
153 | struct module *owner; | 154 | struct module *owner; |
154 | 155 | ||
155 | int (*open)(struct hci_dev *hdev); | 156 | int (*open)(struct hci_dev *hdev); |
156 | int (*close)(struct hci_dev *hdev); | 157 | int (*close)(struct hci_dev *hdev); |
@@ -183,6 +184,7 @@ struct hci_conn { | |||
183 | __u32 link_mode; | 184 | __u32 link_mode; |
184 | __u8 auth_type; | 185 | __u8 auth_type; |
185 | __u8 sec_level; | 186 | __u8 sec_level; |
187 | __u8 pending_sec_level; | ||
186 | __u8 power_save; | 188 | __u8 power_save; |
187 | __u16 disc_timeout; | 189 | __u16 disc_timeout; |
188 | unsigned long pend; | 190 | unsigned long pend; |
@@ -215,8 +217,8 @@ extern rwlock_t hci_dev_list_lock; | |||
215 | extern rwlock_t hci_cb_list_lock; | 217 | extern rwlock_t hci_cb_list_lock; |
216 | 218 | ||
217 | /* ----- Inquiry cache ----- */ | 219 | /* ----- Inquiry cache ----- */ |
218 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) // 30 seconds | 220 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ |
219 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) // 60 seconds | 221 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */ |
220 | 222 | ||
221 | #define inquiry_cache_lock(c) spin_lock(&c->lock) | 223 | #define inquiry_cache_lock(c) spin_lock(&c->lock) |
222 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) | 224 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) |
@@ -660,6 +662,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data); | |||
660 | /* ----- HCI Sockets ----- */ | 662 | /* ----- HCI Sockets ----- */ |
661 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); | 663 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); |
662 | 664 | ||
665 | /* Management interface */ | ||
666 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | ||
667 | int mgmt_index_added(u16 index); | ||
668 | int mgmt_index_removed(u16 index); | ||
669 | |||
663 | /* HCI info for socket */ | 670 | /* HCI info for socket */ |
664 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 671 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
665 | 672 | ||
@@ -668,6 +675,7 @@ struct hci_pinfo { | |||
668 | struct hci_dev *hdev; | 675 | struct hci_dev *hdev; |
669 | struct hci_filter filter; | 676 | struct hci_filter filter; |
670 | __u32 cmsg_mask; | 677 | __u32 cmsg_mask; |
678 | unsigned short channel; | ||
671 | }; | 679 | }; |
672 | 680 | ||
673 | /* HCI security filter */ | 681 | /* HCI security filter */ |
@@ -687,6 +695,6 @@ struct hci_sec_filter { | |||
687 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | 695 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
688 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | 696 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
689 | 697 | ||
690 | void hci_req_complete(struct hci_dev *hdev, int result); | 698 | void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result); |
691 | 699 | ||
692 | #endif /* __HCI_CORE_H */ | 700 | #endif /* __HCI_CORE_H */ |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index c819c8bf9b68..7ad25ca60ec0 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> | 4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> |
@@ -14,13 +14,13 @@ | |||
14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
21 | 21 | ||
22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
24 | SOFTWARE IS DISCLAIMED. | 24 | SOFTWARE IS DISCLAIMED. |
25 | */ | 25 | */ |
26 | 26 | ||
@@ -417,11 +417,11 @@ static inline int l2cap_tx_window_full(struct sock *sk) | |||
417 | return sub == pi->remote_tx_win; | 417 | return sub == pi->remote_tx_win; |
418 | } | 418 | } |
419 | 419 | ||
420 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 | 420 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) |
421 | #define __get_reqseq(ctrl) ((ctrl) & L2CAP_CTRL_REQSEQ) >> 8 | 421 | #define __get_reqseq(ctrl) (((ctrl) & L2CAP_CTRL_REQSEQ) >> 8) |
422 | #define __is_iframe(ctrl) !((ctrl) & L2CAP_CTRL_FRAME_TYPE) | 422 | #define __is_iframe(ctrl) (!((ctrl) & L2CAP_CTRL_FRAME_TYPE)) |
423 | #define __is_sframe(ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE | 423 | #define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) |
424 | #define __is_sar_start(ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START | 424 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) |
425 | 425 | ||
426 | void l2cap_load(void); | 426 | void l2cap_load(void); |
427 | 427 | ||
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h new file mode 100644 index 000000000000..ca29c1367ffd --- /dev/null +++ b/include/net/bluetooth/mgmt.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | BlueZ - Bluetooth protocol stack for Linux | ||
3 | |||
4 | Copyright (C) 2010 Nokia Corporation | ||
5 | |||
6 | This program is free software; you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License version 2 as | ||
8 | published by the Free Software Foundation; | ||
9 | |||
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | |||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
21 | SOFTWARE IS DISCLAIMED. | ||
22 | */ | ||
23 | |||
24 | struct mgmt_hdr { | ||
25 | __le16 opcode; | ||
26 | __le16 len; | ||
27 | } __packed; | ||
28 | #define MGMT_HDR_SIZE 4 | ||
29 | |||
30 | #define MGMT_OP_READ_VERSION 0x0001 | ||
31 | struct mgmt_rp_read_version { | ||
32 | __u8 version; | ||
33 | __le16 revision; | ||
34 | } __packed; | ||
35 | |||
36 | #define MGMT_OP_READ_INDEX_LIST 0x0003 | ||
37 | struct mgmt_rp_read_index_list { | ||
38 | __le16 num_controllers; | ||
39 | __le16 index[0]; | ||
40 | } __packed; | ||
41 | |||
42 | #define MGMT_OP_READ_INFO 0x0004 | ||
43 | struct mgmt_cp_read_info { | ||
44 | __le16 index; | ||
45 | } __packed; | ||
46 | struct mgmt_rp_read_info { | ||
47 | __le16 index; | ||
48 | __u8 type; | ||
49 | __u8 powered; | ||
50 | __u8 discoverable; | ||
51 | __u8 pairable; | ||
52 | __u8 sec_mode; | ||
53 | bdaddr_t bdaddr; | ||
54 | __u8 dev_class[3]; | ||
55 | __u8 features[8]; | ||
56 | __u16 manufacturer; | ||
57 | __u8 hci_ver; | ||
58 | __u16 hci_rev; | ||
59 | } __packed; | ||
60 | |||
61 | #define MGMT_EV_CMD_COMPLETE 0x0001 | ||
62 | struct mgmt_ev_cmd_complete { | ||
63 | __le16 opcode; | ||
64 | __u8 data[0]; | ||
65 | } __packed; | ||
66 | |||
67 | #define MGMT_EV_CMD_STATUS 0x0002 | ||
68 | struct mgmt_ev_cmd_status { | ||
69 | __u8 status; | ||
70 | __le16 opcode; | ||
71 | } __packed; | ||
72 | |||
73 | #define MGMT_EV_CONTROLLER_ERROR 0x0003 | ||
74 | struct mgmt_ev_controller_error { | ||
75 | __le16 index; | ||
76 | __u8 error_code; | ||
77 | } __packed; | ||
78 | |||
79 | #define MGMT_EV_INDEX_ADDED 0x0004 | ||
80 | struct mgmt_ev_index_added { | ||
81 | __le16 index; | ||
82 | } __packed; | ||
83 | |||
84 | #define MGMT_EV_INDEX_REMOVED 0x0005 | ||
85 | struct mgmt_ev_index_removed { | ||
86 | __le16 index; | ||
87 | } __packed; | ||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 71047bc0af84..6eac4a760c3b 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ). | 2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ) |
3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> | 3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> |
4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> | 4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> |
5 | 5 | ||
@@ -11,13 +11,13 @@ | |||
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
18 | 18 | ||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
21 | SOFTWARE IS DISCLAIMED. | 21 | SOFTWARE IS DISCLAIMED. |
22 | */ | 22 | */ |
23 | 23 | ||
@@ -105,7 +105,7 @@ | |||
105 | struct rfcomm_hdr { | 105 | struct rfcomm_hdr { |
106 | u8 addr; | 106 | u8 addr; |
107 | u8 ctrl; | 107 | u8 ctrl; |
108 | u8 len; // Actual size can be 2 bytes | 108 | u8 len; /* Actual size can be 2 bytes */ |
109 | } __packed; | 109 | } __packed; |
110 | 110 | ||
111 | struct rfcomm_cmd { | 111 | struct rfcomm_cmd { |
@@ -228,7 +228,7 @@ struct rfcomm_dlc { | |||
228 | /* ---- RFCOMM SEND RPN ---- */ | 228 | /* ---- RFCOMM SEND RPN ---- */ |
229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, | 229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, |
230 | u8 bit_rate, u8 data_bits, u8 stop_bits, | 230 | u8 bit_rate, u8 data_bits, u8 stop_bits, |
231 | u8 parity, u8 flow_ctrl_settings, | 231 | u8 parity, u8 flow_ctrl_settings, |
232 | u8 xon_char, u8 xoff_char, u16 param_mask); | 232 | u8 xon_char, u8 xoff_char, u16 param_mask); |
233 | 233 | ||
234 | /* ---- RFCOMM DLCs (channels) ---- */ | 234 | /* ---- RFCOMM DLCs (channels) ---- */ |
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index e28a2a771471..1e35c43657c8 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,13 +12,13 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
@@ -55,11 +55,11 @@ struct sco_conninfo { | |||
55 | struct sco_conn { | 55 | struct sco_conn { |
56 | struct hci_conn *hcon; | 56 | struct hci_conn *hcon; |
57 | 57 | ||
58 | bdaddr_t *dst; | 58 | bdaddr_t *dst; |
59 | bdaddr_t *src; | 59 | bdaddr_t *src; |
60 | 60 | ||
61 | spinlock_t lock; | 61 | spinlock_t lock; |
62 | struct sock *sk; | 62 | struct sock *sk; |
63 | 63 | ||
64 | unsigned int mtu; | 64 | unsigned int mtu; |
65 | }; | 65 | }; |
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index 9402543fc20d..e54f6396fa4c 100644 --- a/include/net/caif/cfctrl.h +++ b/include/net/caif/cfctrl.h | |||
@@ -51,7 +51,7 @@ struct cfctrl_rsp { | |||
51 | void (*restart_rsp)(void); | 51 | void (*restart_rsp)(void); |
52 | void (*radioset_rsp)(void); | 52 | void (*radioset_rsp)(void); |
53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, | 53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, |
54 | struct cflayer *client_layer);; | 54 | struct cflayer *client_layer); |
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* Link Setup Parameters for CAIF-Links. */ | 57 | /* Link Setup Parameters for CAIF-Links. */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 97b8b7c9b63c..1322695beb52 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -258,13 +258,9 @@ struct ieee80211_supported_band { | |||
258 | 258 | ||
259 | /** | 259 | /** |
260 | * struct vif_params - describes virtual interface parameters | 260 | * struct vif_params - describes virtual interface parameters |
261 | * @mesh_id: mesh ID to use | ||
262 | * @mesh_id_len: length of the mesh ID | ||
263 | * @use_4addr: use 4-address frames | 261 | * @use_4addr: use 4-address frames |
264 | */ | 262 | */ |
265 | struct vif_params { | 263 | struct vif_params { |
266 | u8 *mesh_id; | ||
267 | int mesh_id_len; | ||
268 | int use_4addr; | 264 | int use_4addr; |
269 | }; | 265 | }; |
270 | 266 | ||
@@ -424,6 +420,7 @@ struct station_parameters { | |||
424 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | 420 | * @STATION_INFO_TX_RETRIES: @tx_retries filled |
425 | * @STATION_INFO_TX_FAILED: @tx_failed filled | 421 | * @STATION_INFO_TX_FAILED: @tx_failed filled |
426 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | 422 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled |
423 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled | ||
427 | */ | 424 | */ |
428 | enum station_info_flags { | 425 | enum station_info_flags { |
429 | STATION_INFO_INACTIVE_TIME = 1<<0, | 426 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -439,6 +436,7 @@ enum station_info_flags { | |||
439 | STATION_INFO_TX_RETRIES = 1<<10, | 436 | STATION_INFO_TX_RETRIES = 1<<10, |
440 | STATION_INFO_TX_FAILED = 1<<11, | 437 | STATION_INFO_TX_FAILED = 1<<11, |
441 | STATION_INFO_RX_DROP_MISC = 1<<12, | 438 | STATION_INFO_RX_DROP_MISC = 1<<12, |
439 | STATION_INFO_SIGNAL_AVG = 1<<13, | ||
442 | }; | 440 | }; |
443 | 441 | ||
444 | /** | 442 | /** |
@@ -485,6 +483,7 @@ struct rate_info { | |||
485 | * @plid: mesh peer link id | 483 | * @plid: mesh peer link id |
486 | * @plink_state: mesh peer link state | 484 | * @plink_state: mesh peer link state |
487 | * @signal: signal strength of last received packet in dBm | 485 | * @signal: signal strength of last received packet in dBm |
486 | * @signal_avg: signal strength average in dBm | ||
488 | * @txrate: current unicast bitrate to this station | 487 | * @txrate: current unicast bitrate to this station |
489 | * @rx_packets: packets received from this station | 488 | * @rx_packets: packets received from this station |
490 | * @tx_packets: packets transmitted to this station | 489 | * @tx_packets: packets transmitted to this station |
@@ -505,6 +504,7 @@ struct station_info { | |||
505 | u16 plid; | 504 | u16 plid; |
506 | u8 plink_state; | 505 | u8 plink_state; |
507 | s8 signal; | 506 | s8 signal; |
507 | s8 signal_avg; | ||
508 | struct rate_info txrate; | 508 | struct rate_info txrate; |
509 | u32 rx_packets; | 509 | u32 rx_packets; |
510 | u32 tx_packets; | 510 | u32 tx_packets; |
@@ -605,6 +605,8 @@ struct mpath_info { | |||
605 | * (or NULL for no change) | 605 | * (or NULL for no change) |
606 | * @basic_rates_len: number of basic rates | 606 | * @basic_rates_len: number of basic rates |
607 | * @ap_isolate: do not forward packets between connected stations | 607 | * @ap_isolate: do not forward packets between connected stations |
608 | * @ht_opmode: HT Operation mode | ||
609 | * (u16 = opmode, -1 = do not change) | ||
608 | */ | 610 | */ |
609 | struct bss_parameters { | 611 | struct bss_parameters { |
610 | int use_cts_prot; | 612 | int use_cts_prot; |
@@ -613,8 +615,14 @@ struct bss_parameters { | |||
613 | u8 *basic_rates; | 615 | u8 *basic_rates; |
614 | u8 basic_rates_len; | 616 | u8 basic_rates_len; |
615 | int ap_isolate; | 617 | int ap_isolate; |
618 | int ht_opmode; | ||
616 | }; | 619 | }; |
617 | 620 | ||
621 | /* | ||
622 | * struct mesh_config - 802.11s mesh configuration | ||
623 | * | ||
624 | * These parameters can be changed while the mesh is active. | ||
625 | */ | ||
618 | struct mesh_config { | 626 | struct mesh_config { |
619 | /* Timeouts in ms */ | 627 | /* Timeouts in ms */ |
620 | /* Mesh plink management parameters */ | 628 | /* Mesh plink management parameters */ |
@@ -624,6 +632,8 @@ struct mesh_config { | |||
624 | u16 dot11MeshMaxPeerLinks; | 632 | u16 dot11MeshMaxPeerLinks; |
625 | u8 dot11MeshMaxRetries; | 633 | u8 dot11MeshMaxRetries; |
626 | u8 dot11MeshTTL; | 634 | u8 dot11MeshTTL; |
635 | /* ttl used in path selection information elements */ | ||
636 | u8 element_ttl; | ||
627 | bool auto_open_plinks; | 637 | bool auto_open_plinks; |
628 | /* HWMP parameters */ | 638 | /* HWMP parameters */ |
629 | u8 dot11MeshHWMPmaxPREQretries; | 639 | u8 dot11MeshHWMPmaxPREQretries; |
@@ -636,6 +646,26 @@ struct mesh_config { | |||
636 | }; | 646 | }; |
637 | 647 | ||
638 | /** | 648 | /** |
649 | * struct mesh_setup - 802.11s mesh setup configuration | ||
650 | * @mesh_id: the mesh ID | ||
651 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | ||
652 | * @path_sel_proto: which path selection protocol to use | ||
653 | * @path_metric: which metric to use | ||
654 | * @vendor_ie: vendor information elements (optional) | ||
655 | * @vendor_ie_len: length of vendor information elements | ||
656 | * | ||
657 | * These parameters are fixed when the mesh is created. | ||
658 | */ | ||
659 | struct mesh_setup { | ||
660 | const u8 *mesh_id; | ||
661 | u8 mesh_id_len; | ||
662 | u8 path_sel_proto; | ||
663 | u8 path_metric; | ||
664 | const u8 *vendor_ie; | ||
665 | u8 vendor_ie_len; | ||
666 | }; | ||
667 | |||
668 | /** | ||
639 | * struct ieee80211_txq_params - TX queue parameters | 669 | * struct ieee80211_txq_params - TX queue parameters |
640 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) | 670 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) |
641 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled | 671 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled |
@@ -923,6 +953,7 @@ struct cfg80211_disassoc_request { | |||
923 | * @privacy: this is a protected network, keys will be configured | 953 | * @privacy: this is a protected network, keys will be configured |
924 | * after joining | 954 | * after joining |
925 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | 955 | * @basic_rates: bitmap of basic rates to use when creating the IBSS |
956 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
926 | */ | 957 | */ |
927 | struct cfg80211_ibss_params { | 958 | struct cfg80211_ibss_params { |
928 | u8 *ssid; | 959 | u8 *ssid; |
@@ -934,6 +965,7 @@ struct cfg80211_ibss_params { | |||
934 | u32 basic_rates; | 965 | u32 basic_rates; |
935 | bool channel_fixed; | 966 | bool channel_fixed; |
936 | bool privacy; | 967 | bool privacy; |
968 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
937 | }; | 969 | }; |
938 | 970 | ||
939 | /** | 971 | /** |
@@ -1029,7 +1061,8 @@ struct cfg80211_pmksa { | |||
1029 | * | 1061 | * |
1030 | * @add_virtual_intf: create a new virtual interface with the given name, | 1062 | * @add_virtual_intf: create a new virtual interface with the given name, |
1031 | * must set the struct wireless_dev's iftype. Beware: You must create | 1063 | * must set the struct wireless_dev's iftype. Beware: You must create |
1032 | * the new netdev in the wiphy's network namespace! | 1064 | * the new netdev in the wiphy's network namespace! Returns the netdev, |
1065 | * or an ERR_PTR. | ||
1033 | * | 1066 | * |
1034 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 1067 | * @del_virtual_intf: remove the virtual interface determined by ifindex. |
1035 | * | 1068 | * |
@@ -1070,10 +1103,12 @@ struct cfg80211_pmksa { | |||
1070 | * @change_mpath: change a given mesh path | 1103 | * @change_mpath: change a given mesh path |
1071 | * @get_mpath: get a mesh path for the given parameters | 1104 | * @get_mpath: get a mesh path for the given parameters |
1072 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | 1105 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx |
1106 | * @join_mesh: join the mesh network with the specified parameters | ||
1107 | * @leave_mesh: leave the current mesh network | ||
1073 | * | 1108 | * |
1074 | * @get_mesh_params: Put the current mesh parameters into *params | 1109 | * @get_mesh_config: Get the current mesh configuration |
1075 | * | 1110 | * |
1076 | * @set_mesh_params: Set mesh parameters. | 1111 | * @update_mesh_config: Update mesh parameters on a running mesh. |
1077 | * The mask is a bitfield which tells us which parameters to | 1112 | * The mask is a bitfield which tells us which parameters to |
1078 | * set, and which to leave alone. | 1113 | * set, and which to leave alone. |
1079 | * | 1114 | * |
@@ -1132,7 +1167,9 @@ struct cfg80211_pmksa { | |||
1132 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1167 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
1133 | * This allows the operation to be terminated prior to timeout based on | 1168 | * This allows the operation to be terminated prior to timeout based on |
1134 | * the duration value. | 1169 | * the duration value. |
1135 | * @mgmt_tx: Transmit a management frame | 1170 | * @mgmt_tx: Transmit a management frame. |
1171 | * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management | ||
1172 | * frame on another channel | ||
1136 | * | 1173 | * |
1137 | * @testmode_cmd: run a test mode command | 1174 | * @testmode_cmd: run a test mode command |
1138 | * | 1175 | * |
@@ -1150,14 +1187,23 @@ struct cfg80211_pmksa { | |||
1150 | * @mgmt_frame_register: Notify driver that a management frame type was | 1187 | * @mgmt_frame_register: Notify driver that a management frame type was |
1151 | * registered. Note that this callback may not sleep, and cannot run | 1188 | * registered. Note that this callback may not sleep, and cannot run |
1152 | * concurrently with itself. | 1189 | * concurrently with itself. |
1190 | * | ||
1191 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
1192 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
1193 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
1194 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
1195 | * | ||
1196 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
1153 | */ | 1197 | */ |
1154 | struct cfg80211_ops { | 1198 | struct cfg80211_ops { |
1155 | int (*suspend)(struct wiphy *wiphy); | 1199 | int (*suspend)(struct wiphy *wiphy); |
1156 | int (*resume)(struct wiphy *wiphy); | 1200 | int (*resume)(struct wiphy *wiphy); |
1157 | 1201 | ||
1158 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 1202 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
1159 | enum nl80211_iftype type, u32 *flags, | 1203 | char *name, |
1160 | struct vif_params *params); | 1204 | enum nl80211_iftype type, |
1205 | u32 *flags, | ||
1206 | struct vif_params *params); | ||
1161 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); | 1207 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); |
1162 | int (*change_virtual_intf)(struct wiphy *wiphy, | 1208 | int (*change_virtual_intf)(struct wiphy *wiphy, |
1163 | struct net_device *dev, | 1209 | struct net_device *dev, |
@@ -1175,7 +1221,7 @@ struct cfg80211_ops { | |||
1175 | u8 key_index, bool pairwise, const u8 *mac_addr); | 1221 | u8 key_index, bool pairwise, const u8 *mac_addr); |
1176 | int (*set_default_key)(struct wiphy *wiphy, | 1222 | int (*set_default_key)(struct wiphy *wiphy, |
1177 | struct net_device *netdev, | 1223 | struct net_device *netdev, |
1178 | u8 key_index); | 1224 | u8 key_index, bool unicast, bool multicast); |
1179 | int (*set_default_mgmt_key)(struct wiphy *wiphy, | 1225 | int (*set_default_mgmt_key)(struct wiphy *wiphy, |
1180 | struct net_device *netdev, | 1226 | struct net_device *netdev, |
1181 | u8 key_index); | 1227 | u8 key_index); |
@@ -1210,12 +1256,17 @@ struct cfg80211_ops { | |||
1210 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 1256 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
1211 | int idx, u8 *dst, u8 *next_hop, | 1257 | int idx, u8 *dst, u8 *next_hop, |
1212 | struct mpath_info *pinfo); | 1258 | struct mpath_info *pinfo); |
1213 | int (*get_mesh_params)(struct wiphy *wiphy, | 1259 | int (*get_mesh_config)(struct wiphy *wiphy, |
1214 | struct net_device *dev, | 1260 | struct net_device *dev, |
1215 | struct mesh_config *conf); | 1261 | struct mesh_config *conf); |
1216 | int (*set_mesh_params)(struct wiphy *wiphy, | 1262 | int (*update_mesh_config)(struct wiphy *wiphy, |
1217 | struct net_device *dev, | 1263 | struct net_device *dev, u32 mask, |
1218 | const struct mesh_config *nconf, u32 mask); | 1264 | const struct mesh_config *nconf); |
1265 | int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev, | ||
1266 | const struct mesh_config *conf, | ||
1267 | const struct mesh_setup *setup); | ||
1268 | int (*leave_mesh)(struct wiphy *wiphy, struct net_device *dev); | ||
1269 | |||
1219 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, | 1270 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
1220 | struct bss_parameters *params); | 1271 | struct bss_parameters *params); |
1221 | 1272 | ||
@@ -1289,10 +1340,13 @@ struct cfg80211_ops { | |||
1289 | u64 cookie); | 1340 | u64 cookie); |
1290 | 1341 | ||
1291 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1342 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
1292 | struct ieee80211_channel *chan, | 1343 | struct ieee80211_channel *chan, bool offchan, |
1293 | enum nl80211_channel_type channel_type, | 1344 | enum nl80211_channel_type channel_type, |
1294 | bool channel_type_valid, | 1345 | bool channel_type_valid, unsigned int wait, |
1295 | const u8 *buf, size_t len, u64 *cookie); | 1346 | const u8 *buf, size_t len, u64 *cookie); |
1347 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | ||
1348 | struct net_device *dev, | ||
1349 | u64 cookie); | ||
1296 | 1350 | ||
1297 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1351 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1298 | bool enabled, int timeout); | 1352 | bool enabled, int timeout); |
@@ -1304,6 +1358,9 @@ struct cfg80211_ops { | |||
1304 | void (*mgmt_frame_register)(struct wiphy *wiphy, | 1358 | void (*mgmt_frame_register)(struct wiphy *wiphy, |
1305 | struct net_device *dev, | 1359 | struct net_device *dev, |
1306 | u16 frame_type, bool reg); | 1360 | u16 frame_type, bool reg); |
1361 | |||
1362 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | ||
1363 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); | ||
1307 | }; | 1364 | }; |
1308 | 1365 | ||
1309 | /* | 1366 | /* |
@@ -1321,13 +1378,14 @@ struct cfg80211_ops { | |||
1321 | * initiator is %REGDOM_SET_BY_CORE). | 1378 | * initiator is %REGDOM_SET_BY_CORE). |
1322 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will | 1379 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will |
1323 | * ignore regulatory domain settings until it gets its own regulatory | 1380 | * ignore regulatory domain settings until it gets its own regulatory |
1324 | * domain via its regulatory_hint(). After its gets its own regulatory | 1381 | * domain via its regulatory_hint() unless the regulatory hint is |
1325 | * domain it will only allow further regulatory domain settings to | 1382 | * from a country IE. After its gets its own regulatory domain it will |
1326 | * further enhance compliance. For example if channel 13 and 14 are | 1383 | * only allow further regulatory domain settings to further enhance |
1327 | * disabled by this regulatory domain no user regulatory domain can | 1384 | * compliance. For example if channel 13 and 14 are disabled by this |
1328 | * enable these channels at a later time. This can be used for devices | 1385 | * regulatory domain no user regulatory domain can enable these channels |
1329 | * which do not have calibration information gauranteed for frequencies | 1386 | * at a later time. This can be used for devices which do not have |
1330 | * or settings outside of its regulatory domain. | 1387 | * calibration information guaranteed for frequencies or settings |
1388 | * outside of its regulatory domain. | ||
1331 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure | 1389 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
1332 | * that passive scan flags and beaconing flags may not be lifted by | 1390 | * that passive scan flags and beaconing flags may not be lifted by |
1333 | * cfg80211 due to regulatory beacon hints. For more information on beacon | 1391 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
@@ -1345,6 +1403,8 @@ struct cfg80211_ops { | |||
1345 | * control port protocol ethertype. The device also honours the | 1403 | * control port protocol ethertype. The device also honours the |
1346 | * control_port_no_encrypt flag. | 1404 | * control_port_no_encrypt flag. |
1347 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | 1405 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. |
1406 | * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate | ||
1407 | * unicast and multicast TX keys. | ||
1348 | */ | 1408 | */ |
1349 | enum wiphy_flags { | 1409 | enum wiphy_flags { |
1350 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1410 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
@@ -1356,6 +1416,7 @@ enum wiphy_flags { | |||
1356 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1416 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
1357 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | 1417 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), |
1358 | WIPHY_FLAG_IBSS_RSN = BIT(8), | 1418 | WIPHY_FLAG_IBSS_RSN = BIT(8), |
1419 | WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9), | ||
1359 | }; | 1420 | }; |
1360 | 1421 | ||
1361 | struct mac_address { | 1422 | struct mac_address { |
@@ -1368,7 +1429,9 @@ struct ieee80211_txrx_stypes { | |||
1368 | 1429 | ||
1369 | /** | 1430 | /** |
1370 | * struct wiphy - wireless hardware description | 1431 | * struct wiphy - wireless hardware description |
1371 | * @reg_notifier: the driver's regulatory notification callback | 1432 | * @reg_notifier: the driver's regulatory notification callback, |
1433 | * note that if your driver uses wiphy_apply_custom_regulatory() | ||
1434 | * the reg_notifier's request can be passed as NULL | ||
1372 | * @regd: the driver's regulatory domain, if one was requested via | 1435 | * @regd: the driver's regulatory domain, if one was requested via |
1373 | * the regulatory_hint() API. This can be used by the driver | 1436 | * the regulatory_hint() API. This can be used by the driver |
1374 | * on the reg_notifier() if it chooses to ignore future | 1437 | * on the reg_notifier() if it chooses to ignore future |
@@ -1420,6 +1483,17 @@ struct ieee80211_txrx_stypes { | |||
1420 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | 1483 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or |
1421 | * transmitted through nl80211, points to an array indexed by interface | 1484 | * transmitted through nl80211, points to an array indexed by interface |
1422 | * type | 1485 | * type |
1486 | * | ||
1487 | * @available_antennas_tx: bitmap of antennas which are available to be | ||
1488 | * configured as TX antennas. Antenna configuration commands will be | ||
1489 | * rejected unless this or @available_antennas_rx is set. | ||
1490 | * | ||
1491 | * @available_antennas_rx: bitmap of antennas which are available to be | ||
1492 | * configured as RX antennas. Antenna configuration commands will be | ||
1493 | * rejected unless this or @available_antennas_tx is set. | ||
1494 | * | ||
1495 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation | ||
1496 | * may request, if implemented. | ||
1423 | */ | 1497 | */ |
1424 | struct wiphy { | 1498 | struct wiphy { |
1425 | /* assign these fields before you register the wiphy */ | 1499 | /* assign these fields before you register the wiphy */ |
@@ -1457,8 +1531,13 @@ struct wiphy { | |||
1457 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 1531 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
1458 | u32 hw_version; | 1532 | u32 hw_version; |
1459 | 1533 | ||
1534 | u16 max_remain_on_channel_duration; | ||
1535 | |||
1460 | u8 max_num_pmkids; | 1536 | u8 max_num_pmkids; |
1461 | 1537 | ||
1538 | u32 available_antennas_tx; | ||
1539 | u32 available_antennas_rx; | ||
1540 | |||
1462 | /* If multiple wiphys are registered and you're handed e.g. | 1541 | /* If multiple wiphys are registered and you're handed e.g. |
1463 | * a regular netdev with assigned ieee80211_ptr, you won't | 1542 | * a regular netdev with assigned ieee80211_ptr, you won't |
1464 | * know whether it points to a wiphy your driver has registered | 1543 | * know whether it points to a wiphy your driver has registered |
@@ -1624,6 +1703,8 @@ struct cfg80211_cached_keys; | |||
1624 | * @bssid: (private) Used by the internal configuration code | 1703 | * @bssid: (private) Used by the internal configuration code |
1625 | * @ssid: (private) Used by the internal configuration code | 1704 | * @ssid: (private) Used by the internal configuration code |
1626 | * @ssid_len: (private) Used by the internal configuration code | 1705 | * @ssid_len: (private) Used by the internal configuration code |
1706 | * @mesh_id_len: (private) Used by the internal configuration code | ||
1707 | * @mesh_id_up_len: (private) Used by the internal configuration code | ||
1627 | * @wext: (private) Used by the internal wireless extensions compat code | 1708 | * @wext: (private) Used by the internal wireless extensions compat code |
1628 | * @use_4addr: indicates 4addr mode is used on this interface, must be | 1709 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
1629 | * set by driver (if supported) on add_interface BEFORE registering the | 1710 | * set by driver (if supported) on add_interface BEFORE registering the |
@@ -1653,7 +1734,7 @@ struct wireless_dev { | |||
1653 | 1734 | ||
1654 | /* currently used for IBSS and SME - might be rearranged later */ | 1735 | /* currently used for IBSS and SME - might be rearranged later */ |
1655 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1736 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
1656 | u8 ssid_len; | 1737 | u8 ssid_len, mesh_id_len, mesh_id_up_len; |
1657 | enum { | 1738 | enum { |
1658 | CFG80211_SME_IDLE, | 1739 | CFG80211_SME_IDLE, |
1659 | CFG80211_SME_CONNECTING, | 1740 | CFG80211_SME_CONNECTING, |
@@ -2297,6 +2378,32 @@ void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, | |||
2297 | size_t len); | 2378 | size_t len); |
2298 | 2379 | ||
2299 | /** | 2380 | /** |
2381 | * cfg80211_send_unprot_deauth - notification of unprotected deauthentication | ||
2382 | * @dev: network device | ||
2383 | * @buf: deauthentication frame (header + body) | ||
2384 | * @len: length of the frame data | ||
2385 | * | ||
2386 | * This function is called whenever a received Deauthentication frame has been | ||
2387 | * dropped in station mode because of MFP being used but the Deauthentication | ||
2388 | * frame was not protected. This function may sleep. | ||
2389 | */ | ||
2390 | void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, | ||
2391 | size_t len); | ||
2392 | |||
2393 | /** | ||
2394 | * cfg80211_send_unprot_disassoc - notification of unprotected disassociation | ||
2395 | * @dev: network device | ||
2396 | * @buf: disassociation frame (header + body) | ||
2397 | * @len: length of the frame data | ||
2398 | * | ||
2399 | * This function is called whenever a received Disassociation frame has been | ||
2400 | * dropped in station mode because of MFP being used but the Disassociation | ||
2401 | * frame was not protected. This function may sleep. | ||
2402 | */ | ||
2403 | void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, | ||
2404 | size_t len); | ||
2405 | |||
2406 | /** | ||
2300 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 2407 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
2301 | * @dev: network device | 2408 | * @dev: network device |
2302 | * @addr: The source MAC address of the frame | 2409 | * @addr: The source MAC address of the frame |
@@ -2595,6 +2702,18 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2595 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2702 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
2596 | gfp_t gfp); | 2703 | gfp_t gfp); |
2597 | 2704 | ||
2705 | /** | ||
2706 | * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer | ||
2707 | * @dev: network device | ||
2708 | * @peer: peer's MAC address | ||
2709 | * @num_packets: how many packets were lost -- should be a fixed threshold | ||
2710 | * but probably no less than maybe 50, or maybe a throughput dependent | ||
2711 | * threshold (to account for temporary interference) | ||
2712 | * @gfp: context flags | ||
2713 | */ | ||
2714 | void cfg80211_cqm_pktloss_notify(struct net_device *dev, | ||
2715 | const u8 *peer, u32 num_packets, gfp_t gfp); | ||
2716 | |||
2598 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 2717 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
2599 | 2718 | ||
2600 | /* wiphy_printk helpers, similar to dev_printk */ | 2719 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h new file mode 100644 index 000000000000..bc1e7ef40171 --- /dev/null +++ b/include/net/dcbevent.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Author: John Fastabend <john.r.fastabend@intel.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef _DCB_EVENT_H | ||
21 | #define _DCB_EVENT_H | ||
22 | |||
23 | enum dcbevent_notif_type { | ||
24 | DCB_APP_EVENT = 1, | ||
25 | }; | ||
26 | |||
27 | extern int register_dcbevent_notifier(struct notifier_block *nb); | ||
28 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); | ||
29 | extern int call_dcbevent_notifiers(unsigned long val, void *v); | ||
30 | |||
31 | #endif | ||
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index b36ac7e0914d..a8e7852b10ab 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
@@ -20,11 +20,31 @@ | |||
20 | #ifndef __NET_DCBNL_H__ | 20 | #ifndef __NET_DCBNL_H__ |
21 | #define __NET_DCBNL_H__ | 21 | #define __NET_DCBNL_H__ |
22 | 22 | ||
23 | #include <linux/dcbnl.h> | ||
24 | |||
25 | struct dcb_app_type { | ||
26 | char name[IFNAMSIZ]; | ||
27 | struct dcb_app app; | ||
28 | struct list_head list; | ||
29 | }; | ||
30 | |||
31 | u8 dcb_setapp(struct net_device *, struct dcb_app *); | ||
32 | u8 dcb_getapp(struct net_device *, struct dcb_app *); | ||
33 | |||
23 | /* | 34 | /* |
24 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through | 35 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through |
25 | * the netdevice struct. | 36 | * the netdevice struct. |
26 | */ | 37 | */ |
27 | struct dcbnl_rtnl_ops { | 38 | struct dcbnl_rtnl_ops { |
39 | /* IEEE 802.1Qaz std */ | ||
40 | int (*ieee_getets) (struct net_device *, struct ieee_ets *); | ||
41 | int (*ieee_setets) (struct net_device *, struct ieee_ets *); | ||
42 | int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); | ||
43 | int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); | ||
44 | int (*ieee_getapp) (struct net_device *, struct dcb_app *); | ||
45 | int (*ieee_setapp) (struct net_device *, struct dcb_app *); | ||
46 | |||
47 | /* CEE std */ | ||
28 | u8 (*getstate)(struct net_device *); | 48 | u8 (*getstate)(struct net_device *); |
29 | u8 (*setstate)(struct net_device *, u8); | 49 | u8 (*setstate)(struct net_device *, u8); |
30 | void (*getpermhwaddr)(struct net_device *, u8 *); | 50 | void (*getpermhwaddr)(struct net_device *, u8 *); |
@@ -50,6 +70,14 @@ struct dcbnl_rtnl_ops { | |||
50 | void (*setbcnrp)(struct net_device *, int, u8); | 70 | void (*setbcnrp)(struct net_device *, int, u8); |
51 | u8 (*setapp)(struct net_device *, u8, u16, u8); | 71 | u8 (*setapp)(struct net_device *, u8, u16, u8); |
52 | u8 (*getapp)(struct net_device *, u8, u16); | 72 | u8 (*getapp)(struct net_device *, u8, u16); |
73 | u8 (*getfeatcfg)(struct net_device *, int, u8 *); | ||
74 | u8 (*setfeatcfg)(struct net_device *, int, u8); | ||
75 | |||
76 | /* DCBX configuration */ | ||
77 | u8 (*getdcbx)(struct net_device *); | ||
78 | u8 (*setdcbx)(struct net_device *, u8); | ||
79 | |||
80 | |||
53 | }; | 81 | }; |
54 | 82 | ||
55 | #endif /* __NET_DCBNL_H__ */ | 83 | #endif /* __NET_DCBNL_H__ */ |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 0916bbf3bdff..b9e32db03f20 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -5,13 +5,14 @@ | |||
5 | struct dn_dev; | 5 | struct dn_dev; |
6 | 6 | ||
7 | struct dn_ifaddr { | 7 | struct dn_ifaddr { |
8 | struct dn_ifaddr *ifa_next; | 8 | struct dn_ifaddr __rcu *ifa_next; |
9 | struct dn_dev *ifa_dev; | 9 | struct dn_dev *ifa_dev; |
10 | __le16 ifa_local; | 10 | __le16 ifa_local; |
11 | __le16 ifa_address; | 11 | __le16 ifa_address; |
12 | __u8 ifa_flags; | 12 | __u8 ifa_flags; |
13 | __u8 ifa_scope; | 13 | __u8 ifa_scope; |
14 | char ifa_label[IFNAMSIZ]; | 14 | char ifa_label[IFNAMSIZ]; |
15 | struct rcu_head rcu; | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | #define DN_DEV_S_RU 0 /* Run - working normally */ | 18 | #define DN_DEV_S_RU 0 /* Run - working normally */ |
@@ -83,7 +84,7 @@ struct dn_dev_parms { | |||
83 | 84 | ||
84 | 85 | ||
85 | struct dn_dev { | 86 | struct dn_dev { |
86 | struct dn_ifaddr *ifa_list; | 87 | struct dn_ifaddr __rcu *ifa_list; |
87 | struct net_device *dev; | 88 | struct net_device *dev; |
88 | struct dn_dev_parms parms; | 89 | struct dn_dev_parms parms; |
89 | char use_long; | 90 | char use_long; |
@@ -171,19 +172,27 @@ extern int unregister_dnaddr_notifier(struct notifier_block *nb); | |||
171 | 172 | ||
172 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) | 173 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) |
173 | { | 174 | { |
174 | struct dn_dev *dn_db = dev->dn_ptr; | 175 | struct dn_dev *dn_db; |
175 | struct dn_ifaddr *ifa; | 176 | struct dn_ifaddr *ifa; |
177 | int res = 0; | ||
176 | 178 | ||
179 | rcu_read_lock(); | ||
180 | dn_db = rcu_dereference(dev->dn_ptr); | ||
177 | if (dn_db == NULL) { | 181 | if (dn_db == NULL) { |
178 | printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n"); | 182 | printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n"); |
179 | return 0; | 183 | goto out; |
180 | } | 184 | } |
181 | 185 | ||
182 | for(ifa = dn_db->ifa_list; ifa; ifa = ifa->ifa_next) | 186 | for (ifa = rcu_dereference(dn_db->ifa_list); |
183 | if ((addr ^ ifa->ifa_local) == 0) | 187 | ifa != NULL; |
184 | return 1; | 188 | ifa = rcu_dereference(ifa->ifa_next)) |
185 | 189 | if ((addr ^ ifa->ifa_local) == 0) { | |
186 | return 0; | 190 | res = 1; |
191 | break; | ||
192 | } | ||
193 | out: | ||
194 | rcu_read_unlock(); | ||
195 | return res; | ||
187 | } | 196 | } |
188 | 197 | ||
189 | #endif /* _NET_DN_DEV_H */ | 198 | #endif /* _NET_DN_DEV_H */ |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index ccadab3aa3f6..9b185df265fb 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
@@ -80,6 +80,16 @@ struct dn_route { | |||
80 | unsigned rt_type; | 80 | unsigned rt_type; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static inline bool dn_is_input_route(struct dn_route *rt) | ||
84 | { | ||
85 | return rt->fl.iif != 0; | ||
86 | } | ||
87 | |||
88 | static inline bool dn_is_output_route(struct dn_route *rt) | ||
89 | { | ||
90 | return rt->fl.iif == 0; | ||
91 | } | ||
92 | |||
83 | extern void dn_route_init(void); | 93 | extern void dn_route_init(void); |
84 | extern void dn_route_cleanup(void); | 94 | extern void dn_route_cleanup(void); |
85 | 95 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index ffe9cb719c0e..93b0310317be 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -70,7 +70,7 @@ struct dst_entry { | |||
70 | 70 | ||
71 | struct dst_ops *ops; | 71 | struct dst_ops *ops; |
72 | 72 | ||
73 | u32 metrics[RTAX_MAX]; | 73 | u32 _metrics[RTAX_MAX]; |
74 | 74 | ||
75 | #ifdef CONFIG_NET_CLS_ROUTE | 75 | #ifdef CONFIG_NET_CLS_ROUTE |
76 | __u32 tclassid; | 76 | __u32 tclassid; |
@@ -94,19 +94,59 @@ struct dst_entry { | |||
94 | int __use; | 94 | int __use; |
95 | unsigned long lastuse; | 95 | unsigned long lastuse; |
96 | union { | 96 | union { |
97 | struct dst_entry *next; | 97 | struct dst_entry *next; |
98 | struct rtable __rcu *rt_next; | 98 | struct rtable __rcu *rt_next; |
99 | struct rt6_info *rt6_next; | 99 | struct rt6_info *rt6_next; |
100 | struct dn_route *dn_next; | 100 | struct dn_route __rcu *dn_next; |
101 | }; | 101 | }; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | #ifdef __KERNEL__ | 104 | #ifdef __KERNEL__ |
105 | 105 | ||
106 | static inline u32 | 106 | static inline u32 |
107 | dst_metric(const struct dst_entry *dst, int metric) | 107 | dst_metric_raw(const struct dst_entry *dst, const int metric) |
108 | { | 108 | { |
109 | return dst->metrics[metric-1]; | 109 | return dst->_metrics[metric-1]; |
110 | } | ||
111 | |||
112 | static inline u32 | ||
113 | dst_metric(const struct dst_entry *dst, const int metric) | ||
114 | { | ||
115 | WARN_ON_ONCE(metric == RTAX_HOPLIMIT || | ||
116 | metric == RTAX_ADVMSS || | ||
117 | metric == RTAX_MTU); | ||
118 | return dst_metric_raw(dst, metric); | ||
119 | } | ||
120 | |||
121 | static inline u32 | ||
122 | dst_metric_advmss(const struct dst_entry *dst) | ||
123 | { | ||
124 | u32 advmss = dst_metric_raw(dst, RTAX_ADVMSS); | ||
125 | |||
126 | if (!advmss) | ||
127 | advmss = dst->ops->default_advmss(dst); | ||
128 | |||
129 | return advmss; | ||
130 | } | ||
131 | |||
132 | static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val) | ||
133 | { | ||
134 | dst->_metrics[metric-1] = val; | ||
135 | } | ||
136 | |||
137 | static inline void dst_import_metrics(struct dst_entry *dst, const u32 *src_metrics) | ||
138 | { | ||
139 | memcpy(dst->_metrics, src_metrics, RTAX_MAX * sizeof(u32)); | ||
140 | } | ||
141 | |||
142 | static inline void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src) | ||
143 | { | ||
144 | dst_import_metrics(dest, src->_metrics); | ||
145 | } | ||
146 | |||
147 | static inline u32 *dst_metrics_ptr(struct dst_entry *dst) | ||
148 | { | ||
149 | return dst->_metrics; | ||
110 | } | 150 | } |
111 | 151 | ||
112 | static inline u32 | 152 | static inline u32 |
@@ -117,11 +157,11 @@ dst_feature(const struct dst_entry *dst, u32 feature) | |||
117 | 157 | ||
118 | static inline u32 dst_mtu(const struct dst_entry *dst) | 158 | static inline u32 dst_mtu(const struct dst_entry *dst) |
119 | { | 159 | { |
120 | u32 mtu = dst_metric(dst, RTAX_MTU); | 160 | u32 mtu = dst_metric_raw(dst, RTAX_MTU); |
121 | /* | 161 | |
122 | * Alexey put it here, so ask him about it :) | 162 | if (!mtu) |
123 | */ | 163 | mtu = dst->ops->default_mtu(dst); |
124 | barrier(); | 164 | |
125 | return mtu; | 165 | return mtu; |
126 | } | 166 | } |
127 | 167 | ||
@@ -134,7 +174,7 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr | |||
134 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | 174 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, |
135 | unsigned long rtt) | 175 | unsigned long rtt) |
136 | { | 176 | { |
137 | dst->metrics[metric-1] = jiffies_to_msecs(rtt); | 177 | dst_metric_set(dst, metric, jiffies_to_msecs(rtt)); |
138 | } | 178 | } |
139 | 179 | ||
140 | static inline u32 | 180 | static inline u32 |
@@ -147,7 +187,7 @@ dst_allfrag(const struct dst_entry *dst) | |||
147 | } | 187 | } |
148 | 188 | ||
149 | static inline int | 189 | static inline int |
150 | dst_metric_locked(struct dst_entry *dst, int metric) | 190 | dst_metric_locked(const struct dst_entry *dst, int metric) |
151 | { | 191 | { |
152 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | 192 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
153 | } | 193 | } |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 51665b3461b8..21a320b8708e 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
@@ -16,6 +16,8 @@ struct dst_ops { | |||
16 | 16 | ||
17 | int (*gc)(struct dst_ops *ops); | 17 | int (*gc)(struct dst_ops *ops); |
18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); |
19 | unsigned int (*default_advmss)(const struct dst_entry *); | ||
20 | unsigned int (*default_mtu)(const struct dst_entry *); | ||
19 | void (*destroy)(struct dst_entry *); | 21 | void (*destroy)(struct dst_entry *); |
20 | void (*ifdown)(struct dst_entry *, | 22 | void (*ifdown)(struct dst_entry *, |
21 | struct net_device *dev, int how); | 23 | struct net_device *dev, int how); |
diff --git a/include/net/flow.h b/include/net/flow.h index bb08692a20b0..240b7f356c71 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -66,6 +66,7 @@ struct flowi { | |||
66 | } dnports; | 66 | } dnports; |
67 | 67 | ||
68 | __be32 spi; | 68 | __be32 spi; |
69 | __be32 gre_key; | ||
69 | 70 | ||
70 | struct { | 71 | struct { |
71 | __u8 type; | 72 | __u8 type; |
@@ -77,6 +78,7 @@ struct flowi { | |||
77 | #define fl_icmp_code uli_u.icmpt.code | 78 | #define fl_icmp_code uli_u.icmpt.code |
78 | #define fl_ipsec_spi uli_u.spi | 79 | #define fl_ipsec_spi uli_u.spi |
79 | #define fl_mh_type uli_u.mht.type | 80 | #define fl_mh_type uli_u.mht.type |
81 | #define fl_gre_key uli_u.gre_key | ||
80 | __u32 secid; /* used by xfrm; see secid.txt */ | 82 | __u32 secid; /* used by xfrm; see secid.txt */ |
81 | } __attribute__((__aligned__(BITS_PER_LONG/8))); | 83 | } __attribute__((__aligned__(BITS_PER_LONG/8))); |
82 | 84 | ||
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 8a64b811a39a..b4c7c1cbcf40 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -195,7 +195,8 @@ static inline int genlmsg_end(struct sk_buff *skb, void *hdr) | |||
195 | */ | 195 | */ |
196 | static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | 196 | static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) |
197 | { | 197 | { |
198 | nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); | 198 | if (hdr) |
199 | nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); | ||
199 | } | 200 | } |
200 | 201 | ||
201 | /** | 202 | /** |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index f95ff8d9aa47..04977eefb0ee 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -89,10 +89,11 @@ struct ip6_sf_socklist { | |||
89 | struct ipv6_mc_socklist { | 89 | struct ipv6_mc_socklist { |
90 | struct in6_addr addr; | 90 | struct in6_addr addr; |
91 | int ifindex; | 91 | int ifindex; |
92 | struct ipv6_mc_socklist *next; | 92 | struct ipv6_mc_socklist __rcu *next; |
93 | rwlock_t sflock; | 93 | rwlock_t sflock; |
94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
95 | struct ip6_sf_socklist *sflist; | 95 | struct ip6_sf_socklist *sflist; |
96 | struct rcu_head rcu; | ||
96 | }; | 97 | }; |
97 | 98 | ||
98 | struct ip6_sf_list { | 99 | struct ip6_sf_list { |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index aae08f686633..ff013505236b 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
@@ -25,6 +25,9 @@ struct sockaddr; | |||
25 | extern int inet6_csk_bind_conflict(const struct sock *sk, | 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, |
26 | const struct inet_bind_bucket *tb); | 26 | const struct inet_bind_bucket *tb); |
27 | 27 | ||
28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | ||
29 | const struct request_sock *req); | ||
30 | |||
28 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 31 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, |
29 | struct request_sock ***prevp, | 32 | struct request_sock ***prevp, |
30 | const __be16 rport, | 33 | const __be16 rport, |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index e4f494b42e06..6ac4e3b5007f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -43,7 +43,7 @@ struct inet_connection_sock_af_ops { | |||
43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
44 | struct request_sock *req, | 44 | struct request_sock *req, |
45 | struct dst_entry *dst); | 45 | struct dst_entry *dst); |
46 | int (*remember_stamp)(struct sock *sk); | 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); |
47 | u16 net_header_len; | 47 | u16 net_header_len; |
48 | u16 sockaddr_len; | 48 | u16 sockaddr_len; |
49 | int (*setsockopt)(struct sock *sk, int level, int optname, | 49 | int (*setsockopt)(struct sock *sk, int level, int optname, |
@@ -132,7 +132,6 @@ struct inet_connection_sock { | |||
132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ | 132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ |
133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ | 133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ |
134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ | 134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ |
135 | #define ICSK_TIME_KEEPOPEN 4 /* Keepalive timer */ | ||
136 | 135 | ||
137 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) | 136 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) |
138 | { | 137 | { |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 1989cfd7405f..8181498fa96c 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -116,8 +116,9 @@ struct inet_sock { | |||
116 | struct ipv6_pinfo *pinet6; | 116 | struct ipv6_pinfo *pinet6; |
117 | #endif | 117 | #endif |
118 | /* Socket demultiplex comparisons on incoming packets. */ | 118 | /* Socket demultiplex comparisons on incoming packets. */ |
119 | __be32 inet_daddr; | 119 | #define inet_daddr sk.__sk_common.skc_daddr |
120 | __be32 inet_rcv_saddr; | 120 | #define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr |
121 | |||
121 | __be16 inet_dport; | 122 | __be16 inet_dport; |
122 | __u16 inet_num; | 123 | __u16 inet_num; |
123 | __be32 inet_saddr; | 124 | __be32 inet_saddr; |
@@ -141,7 +142,7 @@ struct inet_sock { | |||
141 | nodefrag:1; | 142 | nodefrag:1; |
142 | int mc_index; | 143 | int mc_index; |
143 | __be32 mc_addr; | 144 | __be32 mc_addr; |
144 | struct ip_mc_socklist *mc_list; | 145 | struct ip_mc_socklist __rcu *mc_list; |
145 | struct { | 146 | struct { |
146 | unsigned int flags; | 147 | unsigned int flags; |
147 | unsigned int fragsize; | 148 | unsigned int fragsize; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index a066fdd50da6..17404b5388a7 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -88,12 +88,6 @@ extern void inet_twdr_hangman(unsigned long data); | |||
88 | extern void inet_twdr_twkill_work(struct work_struct *work); | 88 | extern void inet_twdr_twkill_work(struct work_struct *work); |
89 | extern void inet_twdr_twcal_tick(unsigned long data); | 89 | extern void inet_twdr_twcal_tick(unsigned long data); |
90 | 90 | ||
91 | #if (BITS_PER_LONG == 64) | ||
92 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 8 | ||
93 | #else | ||
94 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 4 | ||
95 | #endif | ||
96 | |||
97 | struct inet_bind_bucket; | 91 | struct inet_bind_bucket; |
98 | 92 | ||
99 | /* | 93 | /* |
@@ -117,15 +111,15 @@ struct inet_timewait_sock { | |||
117 | #define tw_hash __tw_common.skc_hash | 111 | #define tw_hash __tw_common.skc_hash |
118 | #define tw_prot __tw_common.skc_prot | 112 | #define tw_prot __tw_common.skc_prot |
119 | #define tw_net __tw_common.skc_net | 113 | #define tw_net __tw_common.skc_net |
114 | #define tw_daddr __tw_common.skc_daddr | ||
115 | #define tw_rcv_saddr __tw_common.skc_rcv_saddr | ||
120 | int tw_timeout; | 116 | int tw_timeout; |
121 | volatile unsigned char tw_substate; | 117 | volatile unsigned char tw_substate; |
122 | /* 3 bits hole, try to pack */ | ||
123 | unsigned char tw_rcv_wscale; | 118 | unsigned char tw_rcv_wscale; |
119 | |||
124 | /* Socket demultiplex comparisons on incoming packets. */ | 120 | /* Socket demultiplex comparisons on incoming packets. */ |
125 | /* these five are in inet_sock */ | 121 | /* these three are in inet_sock */ |
126 | __be16 tw_sport; | 122 | __be16 tw_sport; |
127 | __be32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES))); | ||
128 | __be32 tw_rcv_saddr; | ||
129 | __be16 tw_dport; | 123 | __be16 tw_dport; |
130 | __u16 tw_num; | 124 | __u16 tw_num; |
131 | kmemcheck_bitfield_begin(flags); | 125 | kmemcheck_bitfield_begin(flags); |
@@ -191,10 +185,10 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
191 | return (struct inet_timewait_sock *)sk; | 185 | return (struct inet_timewait_sock *)sk; |
192 | } | 186 | } |
193 | 187 | ||
194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 188 | static inline __be32 sk_rcv_saddr(const struct sock *sk) |
195 | { | 189 | { |
196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 190 | /* both inet_sk() and inet_twsk() store rcv_saddr in skc_rcv_saddr */ |
197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 191 | return sk->__sk_common.skc_rcv_saddr; |
198 | } | 192 | } |
199 | 193 | ||
200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 194 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index fe239bfe5f7f..599d96e74114 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -11,12 +11,21 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/jiffies.h> | 12 | #include <linux/jiffies.h> |
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <net/ipv6.h> | ||
14 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
15 | 16 | ||
17 | struct inetpeer_addr { | ||
18 | union { | ||
19 | __be32 a4; | ||
20 | __be32 a6[4]; | ||
21 | }; | ||
22 | __u16 family; | ||
23 | }; | ||
24 | |||
16 | struct inet_peer { | 25 | struct inet_peer { |
17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 26 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
18 | struct inet_peer __rcu *avl_left, *avl_right; | 27 | struct inet_peer __rcu *avl_left, *avl_right; |
19 | __be32 v4daddr; /* peer's address */ | 28 | struct inetpeer_addr daddr; |
20 | __u32 avl_height; | 29 | __u32 avl_height; |
21 | struct list_head unused; | 30 | struct list_head unused; |
22 | __u32 dtime; /* the time of last use of not | 31 | __u32 dtime; /* the time of last use of not |
@@ -26,7 +35,6 @@ struct inet_peer { | |||
26 | * Once inet_peer is queued for deletion (refcnt == -1), following fields | 35 | * Once inet_peer is queued for deletion (refcnt == -1), following fields |
27 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp | 36 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp |
28 | * We can share memory with rcu_head to keep inet_peer small | 37 | * We can share memory with rcu_head to keep inet_peer small |
29 | * (less then 64 bytes) | ||
30 | */ | 38 | */ |
31 | union { | 39 | union { |
32 | struct { | 40 | struct { |
@@ -42,7 +50,25 @@ struct inet_peer { | |||
42 | void inet_initpeers(void) __init; | 50 | void inet_initpeers(void) __init; |
43 | 51 | ||
44 | /* can be called with or without local BH being disabled */ | 52 | /* can be called with or without local BH being disabled */ |
45 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | 53 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); |
54 | |||
55 | static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | ||
56 | { | ||
57 | struct inetpeer_addr daddr; | ||
58 | |||
59 | daddr.a4 = v4daddr; | ||
60 | daddr.family = AF_INET; | ||
61 | return inet_getpeer(&daddr, create); | ||
62 | } | ||
63 | |||
64 | static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) | ||
65 | { | ||
66 | struct inetpeer_addr daddr; | ||
67 | |||
68 | ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr); | ||
69 | daddr.family = AF_INET6; | ||
70 | return inet_getpeer(&daddr, create); | ||
71 | } | ||
46 | 72 | ||
47 | /* can be called from BH context or outside */ | 73 | /* can be called from BH context or outside */ |
48 | extern void inet_putpeer(struct inet_peer *p); | 74 | extern void inet_putpeer(struct inet_peer *p); |
diff --git a/include/net/ip.h b/include/net/ip.h index 86e2b182a0c0..67fac78a186b 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -201,7 +201,6 @@ static inline int inet_is_reserved_local_port(int port) | |||
201 | return test_bit(port, sysctl_local_reserved_ports); | 201 | return test_bit(port, sysctl_local_reserved_ports); |
202 | } | 202 | } |
203 | 203 | ||
204 | extern int sysctl_ip_default_ttl; | ||
205 | extern int sysctl_ip_nonlocal_bind; | 204 | extern int sysctl_ip_nonlocal_bind; |
206 | 205 | ||
207 | extern struct ctl_path net_core_path[]; | 206 | extern struct ctl_path net_core_path[]; |
@@ -428,15 +427,6 @@ extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |||
428 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 427 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
429 | u32 info); | 428 | u32 info); |
430 | 429 | ||
431 | /* sysctl helpers - any sysctl which holds a value that ends up being | ||
432 | * fed into the routing cache should use these handlers. | ||
433 | */ | ||
434 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | ||
435 | void __user *buffer, | ||
436 | size_t *lenp, loff_t *ppos); | ||
437 | int ipv4_doint_and_flush_strategy(ctl_table *table, | ||
438 | void __user *oldval, size_t __user *oldlenp, | ||
439 | void __user *newval, size_t newlen); | ||
440 | #ifdef CONFIG_PROC_FS | 430 | #ifdef CONFIG_PROC_FS |
441 | extern int ip_misc_proc_init(void); | 431 | extern int ip_misc_proc_init(void); |
442 | #endif | 432 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 062a823d311c..708ff7cb8806 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <net/dst.h> | 21 | #include <net/dst.h> |
22 | #include <net/flow.h> | 22 | #include <net/flow.h> |
23 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
24 | #include <net/inetpeer.h> | ||
24 | 25 | ||
25 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 26 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
26 | #define FIB6_TABLE_HASHSZ 256 | 27 | #define FIB6_TABLE_HASHSZ 256 |
@@ -109,6 +110,7 @@ struct rt6_info { | |||
109 | u32 rt6i_metric; | 110 | u32 rt6i_metric; |
110 | 111 | ||
111 | struct inet6_dev *rt6i_idev; | 112 | struct inet6_dev *rt6i_idev; |
113 | struct inet_peer *rt6i_peer; | ||
112 | 114 | ||
113 | #ifdef CONFIG_XFRM | 115 | #ifdef CONFIG_XFRM |
114 | u32 rt6i_flow_cache_genid; | 116 | u32 rt6i_flow_cache_genid; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 2ab926860cd8..8552f0a2e854 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #define IP6_RT_PRIO_USER 1024 | 4 | #define IP6_RT_PRIO_USER 1024 |
5 | #define IP6_RT_PRIO_ADDRCONF 256 | 5 | #define IP6_RT_PRIO_ADDRCONF 256 |
6 | #define IP6_RT_PRIO_KERN 512 | ||
7 | 6 | ||
8 | struct route_info { | 7 | struct route_info { |
9 | __u8 type; | 8 | __u8 type; |
@@ -56,6 +55,18 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
56 | return (flags >> 3) & 7; | 55 | return (flags >> 3) & 7; |
57 | } | 56 | } |
58 | 57 | ||
58 | extern void rt6_bind_peer(struct rt6_info *rt, | ||
59 | int create); | ||
60 | |||
61 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
62 | { | ||
63 | if (rt->rt6i_peer) | ||
64 | return rt->rt6i_peer; | ||
65 | |||
66 | rt6_bind_peer(rt, 0); | ||
67 | return rt->rt6i_peer; | ||
68 | } | ||
69 | |||
59 | extern void ip6_route_input(struct sk_buff *skb); | 70 | extern void ip6_route_input(struct sk_buff *skb); |
60 | 71 | ||
61 | extern struct dst_entry * ip6_route_output(struct net *net, | 72 | extern struct dst_entry * ip6_route_output(struct net *net, |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 365359b24177..62c0ce2d1dc8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -97,6 +97,20 @@ enum ieee80211_max_queues { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 | ||
101 | * @IEEE80211_AC_VO: voice | ||
102 | * @IEEE80211_AC_VI: video | ||
103 | * @IEEE80211_AC_BE: best effort | ||
104 | * @IEEE80211_AC_BK: background | ||
105 | */ | ||
106 | enum ieee80211_ac_numbers { | ||
107 | IEEE80211_AC_VO = 0, | ||
108 | IEEE80211_AC_VI = 1, | ||
109 | IEEE80211_AC_BE = 2, | ||
110 | IEEE80211_AC_BK = 3, | ||
111 | }; | ||
112 | |||
113 | /** | ||
100 | * struct ieee80211_tx_queue_params - transmit queue configuration | 114 | * struct ieee80211_tx_queue_params - transmit queue configuration |
101 | * | 115 | * |
102 | * The information provided in this structure is required for QoS | 116 | * The information provided in this structure is required for QoS |
@@ -205,6 +219,7 @@ enum ieee80211_bss_change { | |||
205 | * @basic_rates: bitmap of basic rates, each bit stands for an | 219 | * @basic_rates: bitmap of basic rates, each bit stands for an |
206 | * index into the rate table configured by the driver in | 220 | * index into the rate table configured by the driver in |
207 | * the current band. | 221 | * the current band. |
222 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
208 | * @bssid: The BSSID for this BSS | 223 | * @bssid: The BSSID for this BSS |
209 | * @enable_beacon: whether beaconing should be enabled or not | 224 | * @enable_beacon: whether beaconing should be enabled or not |
210 | * @channel_type: Channel type for this BSS -- the hardware might be | 225 | * @channel_type: Channel type for this BSS -- the hardware might be |
@@ -244,6 +259,7 @@ struct ieee80211_bss_conf { | |||
244 | u16 assoc_capability; | 259 | u16 assoc_capability; |
245 | u64 timestamp; | 260 | u64 timestamp; |
246 | u32 basic_rates; | 261 | u32 basic_rates; |
262 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
247 | u16 ht_operation_mode; | 263 | u16 ht_operation_mode; |
248 | s32 cqm_rssi_thold; | 264 | s32 cqm_rssi_thold; |
249 | u32 cqm_rssi_hyst; | 265 | u32 cqm_rssi_hyst; |
@@ -321,6 +337,10 @@ struct ieee80211_bss_conf { | |||
321 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | 337 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame |
322 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | 338 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this |
323 | * frame and selects the maximum number of streams that it can use. | 339 | * frame and selects the maximum number of streams that it can use. |
340 | * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on | ||
341 | * the off-channel channel when a remain-on-channel offload is done | ||
342 | * in hardware -- normal packets still flow and are expected to be | ||
343 | * handled properly by the device. | ||
324 | * | 344 | * |
325 | * Note: If you have to add new flags to the enumeration, then don't | 345 | * Note: If you have to add new flags to the enumeration, then don't |
326 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 346 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
@@ -349,6 +369,7 @@ enum mac80211_tx_control_flags { | |||
349 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 369 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
350 | IEEE80211_TX_CTL_LDPC = BIT(22), | 370 | IEEE80211_TX_CTL_LDPC = BIT(22), |
351 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 371 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
372 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | ||
352 | }; | 373 | }; |
353 | 374 | ||
354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 375 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
@@ -1652,6 +1673,11 @@ enum ieee80211_ampdu_mlme_action { | |||
1652 | * and IV16) for the given key from hardware. | 1673 | * and IV16) for the given key from hardware. |
1653 | * The callback must be atomic. | 1674 | * The callback must be atomic. |
1654 | * | 1675 | * |
1676 | * @set_frag_threshold: Configuration of fragmentation threshold. Assign this | ||
1677 | * if the device does fragmentation by itself; if this callback is | ||
1678 | * implemented then the stack will not do fragmentation. | ||
1679 | * The callback can sleep. | ||
1680 | * | ||
1655 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1681 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
1656 | * The callback can sleep. | 1682 | * The callback can sleep. |
1657 | * | 1683 | * |
@@ -1724,6 +1750,23 @@ enum ieee80211_ampdu_mlme_action { | |||
1724 | * completion of the channel switch. | 1750 | * completion of the channel switch. |
1725 | * | 1751 | * |
1726 | * @napi_poll: Poll Rx queue for incoming data frames. | 1752 | * @napi_poll: Poll Rx queue for incoming data frames. |
1753 | * | ||
1754 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
1755 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
1756 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
1757 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
1758 | * | ||
1759 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
1760 | * | ||
1761 | * @remain_on_channel: Starts an off-channel period on the given channel, must | ||
1762 | * call back to ieee80211_ready_on_channel() when on that channel. Note | ||
1763 | * that normal channel traffic is not stopped as this is intended for hw | ||
1764 | * offload. Frames to transmit on the off-channel channel are transmitted | ||
1765 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the | ||
1766 | * duration (which will always be non-zero) expires, the driver must call | ||
1767 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | ||
1768 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | ||
1769 | * aborted before it expires. This callback may sleep. | ||
1727 | */ | 1770 | */ |
1728 | struct ieee80211_ops { | 1771 | struct ieee80211_ops { |
1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1772 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1765,6 +1808,7 @@ struct ieee80211_ops { | |||
1765 | struct ieee80211_low_level_stats *stats); | 1808 | struct ieee80211_low_level_stats *stats); |
1766 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1809 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
1767 | u32 *iv32, u16 *iv16); | 1810 | u32 *iv32, u16 *iv16); |
1811 | int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); | ||
1768 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1812 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
1769 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1813 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1770 | struct ieee80211_sta *sta); | 1814 | struct ieee80211_sta *sta); |
@@ -1793,6 +1837,14 @@ struct ieee80211_ops { | |||
1793 | void (*channel_switch)(struct ieee80211_hw *hw, | 1837 | void (*channel_switch)(struct ieee80211_hw *hw, |
1794 | struct ieee80211_channel_switch *ch_switch); | 1838 | struct ieee80211_channel_switch *ch_switch); |
1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | 1839 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); |
1840 | int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); | ||
1841 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | ||
1842 | |||
1843 | int (*remain_on_channel)(struct ieee80211_hw *hw, | ||
1844 | struct ieee80211_channel *chan, | ||
1845 | enum nl80211_channel_type channel_type, | ||
1846 | int duration); | ||
1847 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | ||
1796 | }; | 1848 | }; |
1797 | 1849 | ||
1798 | /** | 1850 | /** |
@@ -1821,11 +1873,39 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1821 | */ | 1873 | */ |
1822 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 1874 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
1823 | 1875 | ||
1876 | /** | ||
1877 | * struct ieee80211_tpt_blink - throughput blink description | ||
1878 | * @throughput: throughput in Kbit/sec | ||
1879 | * @blink_time: blink time in milliseconds | ||
1880 | * (full cycle, ie. one off + one on period) | ||
1881 | */ | ||
1882 | struct ieee80211_tpt_blink { | ||
1883 | int throughput; | ||
1884 | int blink_time; | ||
1885 | }; | ||
1886 | |||
1887 | /** | ||
1888 | * enum ieee80211_tpt_led_trigger_flags - throughput trigger flags | ||
1889 | * @IEEE80211_TPT_LEDTRIG_FL_RADIO: enable blinking with radio | ||
1890 | * @IEEE80211_TPT_LEDTRIG_FL_WORK: enable blinking when working | ||
1891 | * @IEEE80211_TPT_LEDTRIG_FL_CONNECTED: enable blinking when at least one | ||
1892 | * interface is connected in some way, including being an AP | ||
1893 | */ | ||
1894 | enum ieee80211_tpt_led_trigger_flags { | ||
1895 | IEEE80211_TPT_LEDTRIG_FL_RADIO = BIT(0), | ||
1896 | IEEE80211_TPT_LEDTRIG_FL_WORK = BIT(1), | ||
1897 | IEEE80211_TPT_LEDTRIG_FL_CONNECTED = BIT(2), | ||
1898 | }; | ||
1899 | |||
1824 | #ifdef CONFIG_MAC80211_LEDS | 1900 | #ifdef CONFIG_MAC80211_LEDS |
1825 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); | 1901 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); |
1826 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); | 1902 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); |
1827 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); | 1903 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); |
1828 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); | 1904 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); |
1905 | extern char *__ieee80211_create_tpt_led_trigger( | ||
1906 | struct ieee80211_hw *hw, unsigned int flags, | ||
1907 | const struct ieee80211_tpt_blink *blink_table, | ||
1908 | unsigned int blink_table_len); | ||
1829 | #endif | 1909 | #endif |
1830 | /** | 1910 | /** |
1831 | * ieee80211_get_tx_led_name - get name of TX LED | 1911 | * ieee80211_get_tx_led_name - get name of TX LED |
@@ -1904,6 +1984,30 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
1904 | } | 1984 | } |
1905 | 1985 | ||
1906 | /** | 1986 | /** |
1987 | * ieee80211_create_tpt_led_trigger - create throughput LED trigger | ||
1988 | * @hw: the hardware to create the trigger for | ||
1989 | * @flags: trigger flags, see &enum ieee80211_tpt_led_trigger_flags | ||
1990 | * @blink_table: the blink table -- needs to be ordered by throughput | ||
1991 | * @blink_table_len: size of the blink table | ||
1992 | * | ||
1993 | * This function returns %NULL (in case of error, or if no LED | ||
1994 | * triggers are configured) or the name of the new trigger. | ||
1995 | * This function must be called before ieee80211_register_hw(). | ||
1996 | */ | ||
1997 | static inline char * | ||
1998 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, | ||
1999 | const struct ieee80211_tpt_blink *blink_table, | ||
2000 | unsigned int blink_table_len) | ||
2001 | { | ||
2002 | #ifdef CONFIG_MAC80211_LEDS | ||
2003 | return __ieee80211_create_tpt_led_trigger(hw, flags, blink_table, | ||
2004 | blink_table_len); | ||
2005 | #else | ||
2006 | return NULL; | ||
2007 | #endif | ||
2008 | } | ||
2009 | |||
2010 | /** | ||
1907 | * ieee80211_unregister_hw - Unregister a hardware device | 2011 | * ieee80211_unregister_hw - Unregister a hardware device |
1908 | * | 2012 | * |
1909 | * This function instructs mac80211 to free allocated resources | 2013 | * This function instructs mac80211 to free allocated resources |
@@ -2404,6 +2508,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2404 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2508 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
2405 | * @sta: the station for which to start a BA session | 2509 | * @sta: the station for which to start a BA session |
2406 | * @tid: the TID to BA on. | 2510 | * @tid: the TID to BA on. |
2511 | * @timeout: session timeout value (in TUs) | ||
2407 | * | 2512 | * |
2408 | * Return: success if addBA request was sent, failure otherwise | 2513 | * Return: success if addBA request was sent, failure otherwise |
2409 | * | 2514 | * |
@@ -2411,7 +2516,8 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2411 | * the need to start aggregation on a certain RA/TID, the session level | 2516 | * the need to start aggregation on a certain RA/TID, the session level |
2412 | * will be managed by the mac80211. | 2517 | * will be managed by the mac80211. |
2413 | */ | 2518 | */ |
2414 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2519 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
2520 | u16 timeout); | ||
2415 | 2521 | ||
2416 | /** | 2522 | /** |
2417 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2523 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
@@ -2521,6 +2627,21 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2521 | struct ieee80211_sta *pubsta, bool block); | 2627 | struct ieee80211_sta *pubsta, bool block); |
2522 | 2628 | ||
2523 | /** | 2629 | /** |
2630 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | ||
2631 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
2632 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2633 | * | ||
2634 | * Creates a Probe Request template which can, for example, be uploaded to | ||
2635 | * hardware. The template is filled with bssid, ssid and supported rate | ||
2636 | * information. This function must only be called from within the | ||
2637 | * .bss_info_changed callback function and only in managed mode. The function | ||
2638 | * is only useful when the interface is associated, otherwise it will return | ||
2639 | * NULL. | ||
2640 | */ | ||
2641 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | ||
2642 | struct ieee80211_vif *vif); | ||
2643 | |||
2644 | /** | ||
2524 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2645 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2525 | * | 2646 | * |
2526 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2647 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
@@ -2629,6 +2750,18 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, | |||
2629 | */ | 2750 | */ |
2630 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | 2751 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); |
2631 | 2752 | ||
2753 | /** | ||
2754 | * ieee80211_ready_on_channel - notification of remain-on-channel start | ||
2755 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2756 | */ | ||
2757 | void ieee80211_ready_on_channel(struct ieee80211_hw *hw); | ||
2758 | |||
2759 | /** | ||
2760 | * ieee80211_remain_on_channel_expired - remain_on_channel duration expired | ||
2761 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2762 | */ | ||
2763 | void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); | ||
2764 | |||
2632 | /* Rate control API */ | 2765 | /* Rate control API */ |
2633 | 2766 | ||
2634 | /** | 2767 | /** |
@@ -2660,7 +2793,7 @@ enum rate_control_changed { | |||
2660 | * @rate_idx_mask: user-requested rate mask (not MCS for now) | 2793 | * @rate_idx_mask: user-requested rate mask (not MCS for now) |
2661 | * @skb: the skb that will be transmitted, the control information in it needs | 2794 | * @skb: the skb that will be transmitted, the control information in it needs |
2662 | * to be filled in | 2795 | * to be filled in |
2663 | * @ap: whether this frame is sent out in AP mode | 2796 | * @bss: whether this frame is sent out in AP or IBSS mode |
2664 | */ | 2797 | */ |
2665 | struct ieee80211_tx_rate_control { | 2798 | struct ieee80211_tx_rate_control { |
2666 | struct ieee80211_hw *hw; | 2799 | struct ieee80211_hw *hw; |
@@ -2671,7 +2804,7 @@ struct ieee80211_tx_rate_control { | |||
2671 | bool rts, short_preamble; | 2804 | bool rts, short_preamble; |
2672 | u8 max_rate_idx; | 2805 | u8 max_rate_idx; |
2673 | u32 rate_idx_mask; | 2806 | u32 rate_idx_mask; |
2674 | bool ap; | 2807 | bool bss; |
2675 | }; | 2808 | }; |
2676 | 2809 | ||
2677 | struct rate_control_ops { | 2810 | struct rate_control_ops { |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 895997bc2ead..e0e594f8e9d9 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -42,9 +42,6 @@ enum { | |||
42 | #define ND_REACHABLE_TIME (30*HZ) | 42 | #define ND_REACHABLE_TIME (30*HZ) |
43 | #define ND_RETRANS_TIMER HZ | 43 | #define ND_RETRANS_TIMER HZ |
44 | 44 | ||
45 | #define ND_MIN_RANDOM_FACTOR (1/2) | ||
46 | #define ND_MAX_RANDOM_FACTOR (3/2) | ||
47 | |||
48 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
49 | 46 | ||
50 | #include <linux/compiler.h> | 47 | #include <linux/compiler.h> |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6beb1ffc2b7f..4014b623880c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -96,16 +96,16 @@ struct neighbour { | |||
96 | struct neigh_parms *parms; | 96 | struct neigh_parms *parms; |
97 | unsigned long confirmed; | 97 | unsigned long confirmed; |
98 | unsigned long updated; | 98 | unsigned long updated; |
99 | __u8 flags; | 99 | rwlock_t lock; |
100 | __u8 nud_state; | ||
101 | __u8 type; | ||
102 | __u8 dead; | ||
103 | atomic_t refcnt; | 100 | atomic_t refcnt; |
104 | struct sk_buff_head arp_queue; | 101 | struct sk_buff_head arp_queue; |
105 | struct timer_list timer; | 102 | struct timer_list timer; |
106 | unsigned long used; | 103 | unsigned long used; |
107 | atomic_t probes; | 104 | atomic_t probes; |
108 | rwlock_t lock; | 105 | __u8 flags; |
106 | __u8 nud_state; | ||
107 | __u8 type; | ||
108 | __u8 dead; | ||
109 | seqlock_t ha_lock; | 109 | seqlock_t ha_lock; |
110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; | 110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; |
111 | struct hh_cache *hh; | 111 | struct hh_cache *hh; |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index 1ee717eb5b09..a4c993685795 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -7,16 +7,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; | |||
7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; | 7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; |
8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | 8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; |
9 | 9 | ||
10 | extern int nf_ct_frag6_init(void); | ||
11 | extern void nf_ct_frag6_cleanup(void); | ||
12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); | ||
13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | ||
14 | struct net_device *in, | ||
15 | struct net_device *out, | ||
16 | int (*okfn)(struct sk_buff *)); | ||
17 | |||
18 | struct inet_frags_ctl; | ||
19 | |||
20 | #include <linux/sysctl.h> | 10 | #include <linux/sysctl.h> |
21 | extern struct ctl_table nf_ct_ipv6_sysctl_table[]; | 11 | extern struct ctl_table nf_ct_ipv6_sysctl_table[]; |
22 | 12 | ||
diff --git a/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/include/net/netfilter/ipv6/nf_defrag_ipv6.h index 94dd54d76b48..fd79c9a1779d 100644 --- a/include/net/netfilter/ipv6/nf_defrag_ipv6.h +++ b/include/net/netfilter/ipv6/nf_defrag_ipv6.h | |||
@@ -3,4 +3,14 @@ | |||
3 | 3 | ||
4 | extern void nf_defrag_ipv6_enable(void); | 4 | extern void nf_defrag_ipv6_enable(void); |
5 | 5 | ||
6 | extern int nf_ct_frag6_init(void); | ||
7 | extern void nf_ct_frag6_cleanup(void); | ||
8 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); | ||
9 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | ||
10 | struct net_device *in, | ||
11 | struct net_device *out, | ||
12 | int (*okfn)(struct sk_buff *)); | ||
13 | |||
14 | struct inet_frags_ctl; | ||
15 | |||
6 | #endif /* _NF_DEFRAG_IPV6_H */ | 16 | #endif /* _NF_DEFRAG_IPV6_H */ |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index caf17db87dbc..d85cff10e169 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -298,6 +298,8 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct) | |||
298 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 298 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
299 | extern unsigned int nf_conntrack_htable_size; | 299 | extern unsigned int nf_conntrack_htable_size; |
300 | extern unsigned int nf_conntrack_max; | 300 | extern unsigned int nf_conntrack_max; |
301 | extern unsigned int nf_conntrack_hash_rnd; | ||
302 | void init_nf_conntrack_hash_rnd(void); | ||
301 | 303 | ||
302 | #define NF_CT_STAT_INC(net, count) \ | 304 | #define NF_CT_STAT_INC(net, count) \ |
303 | __this_cpu_inc((net)->ct.stat->count) | 305 | __this_cpu_inc((net)->ct.stat->count) |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 96ba5f7dcab6..349cefedc9f3 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -77,9 +77,6 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
77 | if (e == NULL) | 77 | if (e == NULL) |
78 | return; | 78 | return; |
79 | 79 | ||
80 | if (!(e->ctmask & (1 << event))) | ||
81 | return; | ||
82 | |||
83 | set_bit(event, &e->cache); | 80 | set_bit(event, &e->cache); |
84 | } | 81 | } |
85 | 82 | ||
diff --git a/include/net/netlink.h b/include/net/netlink.h index 9801c55de5d6..373f1a900cf4 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -225,13 +225,15 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | |||
225 | u32 pid, unsigned int group, int report, | 225 | u32 pid, unsigned int group, int report, |
226 | gfp_t flags); | 226 | gfp_t flags); |
227 | 227 | ||
228 | extern int nla_validate(struct nlattr *head, int len, int maxtype, | 228 | extern int nla_validate(const struct nlattr *head, |
229 | int len, int maxtype, | ||
229 | const struct nla_policy *policy); | 230 | const struct nla_policy *policy); |
230 | extern int nla_parse(struct nlattr *tb[], int maxtype, | 231 | extern int nla_parse(struct nlattr **tb, int maxtype, |
231 | struct nlattr *head, int len, | 232 | const struct nlattr *head, int len, |
232 | const struct nla_policy *policy); | 233 | const struct nla_policy *policy); |
233 | extern int nla_policy_len(const struct nla_policy *, int); | 234 | extern int nla_policy_len(const struct nla_policy *, int); |
234 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | 235 | extern struct nlattr * nla_find(const struct nlattr *head, |
236 | int len, int attrtype); | ||
235 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 237 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, |
236 | size_t dstsize); | 238 | size_t dstsize); |
237 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); | 239 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); |
@@ -346,7 +348,8 @@ static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) | |||
346 | * Returns the next netlink message in the message stream and | 348 | * Returns the next netlink message in the message stream and |
347 | * decrements remaining by the size of the current message. | 349 | * decrements remaining by the size of the current message. |
348 | */ | 350 | */ |
349 | static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) | 351 | static inline struct nlmsghdr * |
352 | nlmsg_next(const struct nlmsghdr *nlh, int *remaining) | ||
350 | { | 353 | { |
351 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); | 354 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); |
352 | 355 | ||
@@ -398,7 +401,8 @@ static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, | |||
398 | * @maxtype: maximum attribute type to be expected | 401 | * @maxtype: maximum attribute type to be expected |
399 | * @policy: validation policy | 402 | * @policy: validation policy |
400 | */ | 403 | */ |
401 | static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, | 404 | static inline int nlmsg_validate(const struct nlmsghdr *nlh, |
405 | int hdrlen, int maxtype, | ||
402 | const struct nla_policy *policy) | 406 | const struct nla_policy *policy) |
403 | { | 407 | { |
404 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | 408 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) |
@@ -727,7 +731,8 @@ static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining) | |||
727 | * | 731 | * |
728 | * Returns the first attribute which matches the specified type. | 732 | * Returns the first attribute which matches the specified type. |
729 | */ | 733 | */ |
730 | static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) | 734 | static inline struct nlattr * |
735 | nla_find_nested(const struct nlattr *nla, int attrtype) | ||
731 | { | 736 | { |
732 | return nla_find(nla_data(nla), nla_len(nla), attrtype); | 737 | return nla_find(nla_data(nla), nla_len(nla), attrtype); |
733 | } | 738 | } |
@@ -1032,7 +1037,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |||
1032 | * | 1037 | * |
1033 | * Returns 0 on success or a negative error code. | 1038 | * Returns 0 on success or a negative error code. |
1034 | */ | 1039 | */ |
1035 | static inline int nla_validate_nested(struct nlattr *start, int maxtype, | 1040 | static inline int nla_validate_nested(const struct nlattr *start, int maxtype, |
1036 | const struct nla_policy *policy) | 1041 | const struct nla_policy *policy) |
1037 | { | 1042 | { |
1038 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); | 1043 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 81a31c0db3e7..3419bf5cd154 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -30,7 +30,7 @@ struct net_generic { | |||
30 | void *ptr[0]; | 30 | void *ptr[0]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static inline void *net_generic(struct net *net, int id) | 33 | static inline void *net_generic(const struct net *net, int id) |
34 | { | 34 | { |
35 | struct net_generic *ng; | 35 | struct net_generic *ng; |
36 | void *ptr; | 36 | void *ptr; |
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h index d5df797f9540..5395e09187df 100644 --- a/include/net/phonet/phonet.h +++ b/include/net/phonet/phonet.h | |||
@@ -107,8 +107,8 @@ struct phonet_protocol { | |||
107 | int sock_type; | 107 | int sock_type; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | int phonet_proto_register(int protocol, struct phonet_protocol *pp); | 110 | int phonet_proto_register(unsigned int protocol, struct phonet_protocol *pp); |
111 | void phonet_proto_unregister(int protocol, struct phonet_protocol *pp); | 111 | void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp); |
112 | 112 | ||
113 | int phonet_sysctl_init(void); | 113 | int phonet_sysctl_init(void); |
114 | void phonet_sysctl_exit(void); | 114 | void phonet_sysctl_exit(void); |
diff --git a/include/net/red.h b/include/net/red.h index 995108e54d9f..3319f16b3beb 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -97,7 +97,6 @@ struct red_stats { | |||
97 | u32 forced_mark; /* Forced marks, qavg > max_thresh */ | 97 | u32 forced_mark; /* Forced marks, qavg > max_thresh */ |
98 | u32 pdrop; /* Drops due to queue limits */ | 98 | u32 pdrop; /* Drops due to queue limits */ |
99 | u32 other; /* Drops due to drop() calls */ | 99 | u32 other; /* Drops due to drop() calls */ |
100 | u32 backlog; | ||
101 | }; | 100 | }; |
102 | 101 | ||
103 | struct red_parms { | 102 | struct red_parms { |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 9e103a4e91ee..356d6e3dc20a 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -43,6 +43,12 @@ enum environment_cap { | |||
43 | * @intersect: indicates whether the wireless core should intersect | 43 | * @intersect: indicates whether the wireless core should intersect |
44 | * the requested regulatory domain with the presently set regulatory | 44 | * the requested regulatory domain with the presently set regulatory |
45 | * domain. | 45 | * domain. |
46 | * @processed: indicates whether or not this requests has already been | ||
47 | * processed. When the last request is processed it means that the | ||
48 | * currently regulatory domain set on cfg80211 is updated from | ||
49 | * CRDA and can be used by other regulatory requests. When a | ||
50 | * the last request is not yet processed we must yield until it | ||
51 | * is processed before processing any new requests. | ||
46 | * @country_ie_checksum: checksum of the last processed and accepted | 52 | * @country_ie_checksum: checksum of the last processed and accepted |
47 | * country IE | 53 | * country IE |
48 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | 54 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
@@ -54,6 +60,7 @@ struct regulatory_request { | |||
54 | enum nl80211_reg_initiator initiator; | 60 | enum nl80211_reg_initiator initiator; |
55 | char alpha2[2]; | 61 | char alpha2[2]; |
56 | bool intersect; | 62 | bool intersect; |
63 | bool processed; | ||
57 | enum environment_cap country_ie_env; | 64 | enum environment_cap country_ie_env; |
58 | struct list_head list; | 65 | struct list_head list; |
59 | }; | 66 | }; |
diff --git a/include/net/route.h b/include/net/route.h index 7e5e73bfa4de..93e10c453f6b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -55,8 +55,6 @@ struct rtable { | |||
55 | /* Cache lookup keys */ | 55 | /* Cache lookup keys */ |
56 | struct flowi fl; | 56 | struct flowi fl; |
57 | 57 | ||
58 | struct in_device *idev; | ||
59 | |||
60 | int rt_genid; | 58 | int rt_genid; |
61 | unsigned rt_flags; | 59 | unsigned rt_flags; |
62 | __u16 rt_type; | 60 | __u16 rt_type; |
@@ -73,6 +71,16 @@ struct rtable { | |||
73 | struct inet_peer *peer; /* long-living peer info */ | 71 | struct inet_peer *peer; /* long-living peer info */ |
74 | }; | 72 | }; |
75 | 73 | ||
74 | static inline bool rt_is_input_route(struct rtable *rt) | ||
75 | { | ||
76 | return rt->fl.iif != 0; | ||
77 | } | ||
78 | |||
79 | static inline bool rt_is_output_route(struct rtable *rt) | ||
80 | { | ||
81 | return rt->fl.iif == 0; | ||
82 | } | ||
83 | |||
76 | struct ip_rt_acct { | 84 | struct ip_rt_acct { |
77 | __u32 o_bytes; | 85 | __u32 o_bytes; |
78 | __u32 o_packets; | 86 | __u32 o_packets; |
@@ -106,7 +114,7 @@ extern int ip_rt_init(void); | |||
106 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
107 | __be32 src, struct net_device *dev); | 115 | __be32 src, struct net_device *dev); |
108 | extern void rt_cache_flush(struct net *net, int how); | 116 | extern void rt_cache_flush(struct net *net, int how); |
109 | extern void rt_cache_flush_batch(void); | 117 | extern void rt_cache_flush_batch(struct net *net); |
110 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
111 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
112 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
@@ -161,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
161 | { | 169 | { |
162 | struct flowi fl = { .oif = oif, | 170 | struct flowi fl = { .oif = oif, |
163 | .mark = sk->sk_mark, | 171 | .mark = sk->sk_mark, |
164 | .nl_u = { .ip4_u = { .daddr = dst, | 172 | .fl4_dst = dst, |
165 | .saddr = src, | 173 | .fl4_src = src, |
166 | .tos = tos } }, | 174 | .fl4_tos = tos, |
167 | .proto = protocol, | 175 | .proto = protocol, |
168 | .uli_u = { .ports = | 176 | .fl_ip_sport = sport, |
169 | { .sport = sport, | 177 | .fl_ip_dport = dport }; |
170 | .dport = dport } } }; | ||
171 | |||
172 | int err; | 178 | int err; |
173 | struct net *net = sock_net(sk); | 179 | struct net *net = sock_net(sk); |
174 | 180 | ||
@@ -225,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
225 | return skb_rtable(skb)->rt_iif; | 231 | return skb_rtable(skb)->rt_iif; |
226 | } | 232 | } |
227 | 233 | ||
234 | extern int sysctl_ip_default_ttl; | ||
235 | |||
236 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | ||
237 | { | ||
238 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
239 | |||
240 | if (hoplimit == 0) | ||
241 | hoplimit = sysctl_ip_default_ttl; | ||
242 | return hoplimit; | ||
243 | } | ||
244 | |||
228 | #endif /* _ROUTE_H */ | 245 | #endif /* _ROUTE_H */ |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index e013c68bfb00..4093ca78cf60 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -83,6 +83,41 @@ extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | |||
83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
85 | 85 | ||
86 | /** | ||
87 | * struct rtnl_af_ops - rtnetlink address family operations | ||
88 | * | ||
89 | * @list: Used internally | ||
90 | * @family: Address family | ||
91 | * @fill_link_af: Function to fill IFLA_AF_SPEC with address family | ||
92 | * specific netlink attributes. | ||
93 | * @get_link_af_size: Function to calculate size of address family specific | ||
94 | * netlink attributes exlusive the container attribute. | ||
95 | * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr | ||
96 | * for invalid configuration settings. | ||
97 | * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify | ||
98 | * net_device accordingly. | ||
99 | */ | ||
100 | struct rtnl_af_ops { | ||
101 | struct list_head list; | ||
102 | int family; | ||
103 | |||
104 | int (*fill_link_af)(struct sk_buff *skb, | ||
105 | const struct net_device *dev); | ||
106 | size_t (*get_link_af_size)(const struct net_device *dev); | ||
107 | |||
108 | int (*validate_link_af)(const struct net_device *dev, | ||
109 | const struct nlattr *attr); | ||
110 | int (*set_link_af)(struct net_device *dev, | ||
111 | const struct nlattr *attr); | ||
112 | }; | ||
113 | |||
114 | extern int __rtnl_af_register(struct rtnl_af_ops *ops); | ||
115 | extern void __rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
116 | |||
117 | extern int rtnl_af_register(struct rtnl_af_ops *ops); | ||
118 | extern void rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
119 | |||
120 | |||
86 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | 121 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
87 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, | 122 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, |
88 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | 123 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 79f34e2b752f..160a407c1963 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -207,7 +207,7 @@ static inline int qdisc_qlen(struct Qdisc *q) | |||
207 | return q->q.qlen; | 207 | return q->q.qlen; |
208 | } | 208 | } |
209 | 209 | ||
210 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) | 210 | static inline struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb) |
211 | { | 211 | { |
212 | return (struct qdisc_skb_cb *)skb->cb; | 212 | return (struct qdisc_skb_cb *)skb->cb; |
213 | } | 213 | } |
@@ -321,6 +321,7 @@ extern void dev_init_scheduler(struct net_device *dev); | |||
321 | extern void dev_shutdown(struct net_device *dev); | 321 | extern void dev_shutdown(struct net_device *dev); |
322 | extern void dev_activate(struct net_device *dev); | 322 | extern void dev_activate(struct net_device *dev); |
323 | extern void dev_deactivate(struct net_device *dev); | 323 | extern void dev_deactivate(struct net_device *dev); |
324 | extern void dev_deactivate_many(struct list_head *head); | ||
324 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | 325 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, |
325 | struct Qdisc *qdisc); | 326 | struct Qdisc *qdisc); |
326 | extern void qdisc_reset(struct Qdisc *qdisc); | 327 | extern void qdisc_reset(struct Qdisc *qdisc); |
@@ -393,7 +394,7 @@ static inline bool qdisc_tx_is_noop(const struct net_device *dev) | |||
393 | return true; | 394 | return true; |
394 | } | 395 | } |
395 | 396 | ||
396 | static inline unsigned int qdisc_pkt_len(struct sk_buff *skb) | 397 | static inline unsigned int qdisc_pkt_len(const struct sk_buff *skb) |
397 | { | 398 | { |
398 | return qdisc_skb_cb(skb)->pkt_len; | 399 | return qdisc_skb_cb(skb)->pkt_len; |
399 | } | 400 | } |
@@ -425,10 +426,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) | |||
425 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; | 426 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; |
426 | } | 427 | } |
427 | 428 | ||
428 | static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len) | 429 | |
430 | static inline void bstats_update(struct gnet_stats_basic_packed *bstats, | ||
431 | const struct sk_buff *skb) | ||
432 | { | ||
433 | bstats->bytes += qdisc_pkt_len(skb); | ||
434 | bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1; | ||
435 | } | ||
436 | |||
437 | static inline void qdisc_bstats_update(struct Qdisc *sch, | ||
438 | const struct sk_buff *skb) | ||
429 | { | 439 | { |
430 | sch->bstats.bytes += len; | 440 | bstats_update(&sch->bstats, skb); |
431 | sch->bstats.packets++; | ||
432 | } | 441 | } |
433 | 442 | ||
434 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 443 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
@@ -436,7 +445,6 @@ static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | |||
436 | { | 445 | { |
437 | __skb_queue_tail(list, skb); | 446 | __skb_queue_tail(list, skb); |
438 | sch->qstats.backlog += qdisc_pkt_len(skb); | 447 | sch->qstats.backlog += qdisc_pkt_len(skb); |
439 | __qdisc_update_bstats(sch, qdisc_pkt_len(skb)); | ||
440 | 448 | ||
441 | return NET_XMIT_SUCCESS; | 449 | return NET_XMIT_SUCCESS; |
442 | } | 450 | } |
@@ -451,8 +459,10 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch, | |||
451 | { | 459 | { |
452 | struct sk_buff *skb = __skb_dequeue(list); | 460 | struct sk_buff *skb = __skb_dequeue(list); |
453 | 461 | ||
454 | if (likely(skb != NULL)) | 462 | if (likely(skb != NULL)) { |
455 | sch->qstats.backlog -= qdisc_pkt_len(skb); | 463 | sch->qstats.backlog -= qdisc_pkt_len(skb); |
464 | qdisc_bstats_update(sch, skb); | ||
465 | } | ||
456 | 466 | ||
457 | return skb; | 467 | return skb; |
458 | } | 468 | } |
@@ -465,10 +475,11 @@ static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch) | |||
465 | static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch, | 475 | static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch, |
466 | struct sk_buff_head *list) | 476 | struct sk_buff_head *list) |
467 | { | 477 | { |
468 | struct sk_buff *skb = __qdisc_dequeue_head(sch, list); | 478 | struct sk_buff *skb = __skb_dequeue(list); |
469 | 479 | ||
470 | if (likely(skb != NULL)) { | 480 | if (likely(skb != NULL)) { |
471 | unsigned int len = qdisc_pkt_len(skb); | 481 | unsigned int len = qdisc_pkt_len(skb); |
482 | sch->qstats.backlog -= len; | ||
472 | kfree_skb(skb); | 483 | kfree_skb(skb); |
473 | return len; | 484 | return len; |
474 | } | 485 | } |
diff --git a/include/net/scm.h b/include/net/scm.h index 31656506d967..745460fa2f02 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -10,11 +10,12 @@ | |||
10 | /* Well, we should have at least one descriptor open | 10 | /* Well, we should have at least one descriptor open |
11 | * to accept passed FDs 8) | 11 | * to accept passed FDs 8) |
12 | */ | 12 | */ |
13 | #define SCM_MAX_FD 255 | 13 | #define SCM_MAX_FD 253 |
14 | 14 | ||
15 | struct scm_fp_list { | 15 | struct scm_fp_list { |
16 | struct list_head list; | 16 | struct list_head list; |
17 | int count; | 17 | short count; |
18 | short max; | ||
18 | struct file *fp[SCM_MAX_FD]; | 19 | struct file *fp[SCM_MAX_FD]; |
19 | }; | 20 | }; |
20 | 21 | ||
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 2c55a7ea20af..c01dc99def07 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -111,9 +111,6 @@ typedef enum { | |||
111 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
112 | } sctp_verb_t; | 112 | } sctp_verb_t; |
113 | 113 | ||
114 | #define SCTP_CMD_MAX (SCTP_CMD_LAST - 1) | ||
115 | #define SCTP_CMD_NUM_VERBS (SCTP_CMD_MAX + 1) | ||
116 | |||
117 | /* How many commands can you put in an sctp_cmd_seq_t? | 114 | /* How many commands can you put in an sctp_cmd_seq_t? |
118 | * This is a rather arbitrary number, ideally derived from a careful | 115 | * This is a rather arbitrary number, ideally derived from a careful |
119 | * analysis of the state functions, but in reality just taken from | 116 | * analysis of the state functions, but in reality just taken from |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 63908840eef0..c70d8ccc55cb 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -61,7 +61,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; | |||
61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. | 61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. |
62 | */ | 62 | */ |
63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE | 63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE |
64 | #define SCTP_CID_MAX SCTP_CID_ASCONF_ACK | ||
65 | 64 | ||
66 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) | 65 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) |
67 | 66 | ||
@@ -86,9 +85,6 @@ typedef enum { | |||
86 | 85 | ||
87 | } sctp_event_t; | 86 | } sctp_event_t; |
88 | 87 | ||
89 | #define SCTP_EVENT_T_MAX SCTP_EVENT_T_PRIMITIVE | ||
90 | #define SCTP_EVENT_T_NUM (SCTP_EVENT_T_MAX + 1) | ||
91 | |||
92 | /* As a convenience for the state machine, we append SCTP_EVENT_* and | 88 | /* As a convenience for the state machine, we append SCTP_EVENT_* and |
93 | * SCTP_ULP_* to the list of possible chunks. | 89 | * SCTP_ULP_* to the list of possible chunks. |
94 | */ | 90 | */ |
@@ -162,9 +158,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) | |||
162 | - (unsigned long)(c->chunk_hdr)\ | 158 | - (unsigned long)(c->chunk_hdr)\ |
163 | - sizeof(sctp_data_chunk_t))) | 159 | - sizeof(sctp_data_chunk_t))) |
164 | 160 | ||
165 | #define SCTP_MAX_ERROR_CAUSE SCTP_ERROR_NONEXIST_IP | ||
166 | #define SCTP_NUM_ERROR_CAUSE 10 | ||
167 | |||
168 | /* Internal error codes */ | 161 | /* Internal error codes */ |
169 | typedef enum { | 162 | typedef enum { |
170 | 163 | ||
@@ -266,7 +259,6 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 }; | |||
266 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG | 259 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG |
267 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL | 260 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL |
268 | #define SCTP_TSN_MAP_SIZE 4096 | 261 | #define SCTP_TSN_MAP_SIZE 4096 |
269 | #define SCTP_TSN_MAX_GAP 65535 | ||
270 | 262 | ||
271 | /* We will not record more than this many duplicate TSNs between two | 263 | /* We will not record more than this many duplicate TSNs between two |
272 | * SACKs. The minimum PMTU is 576. Remove all the headers and there | 264 | * SACKs. The minimum PMTU is 576. Remove all the headers and there |
@@ -301,9 +293,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
301 | 293 | ||
302 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ | 294 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ |
303 | 295 | ||
304 | #define SCTP_DEF_MAX_INIT 6 | ||
305 | #define SCTP_DEF_MAX_SEND 10 | ||
306 | |||
307 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ | 296 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ |
308 | 297 | ||
309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 298 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
@@ -317,9 +306,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
317 | */ | 306 | */ |
318 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ | 307 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ |
319 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ | 308 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ |
320 | #define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* How many seconds the current | ||
321 | * secret will live? | ||
322 | */ | ||
323 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ | 309 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ |
324 | 310 | ||
325 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ | 311 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 69fef4fb79c0..cc9185ca8fd1 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -261,8 +261,6 @@ extern struct sctp_globals { | |||
261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) | 261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) |
262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) | 262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) |
263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) | 263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) |
264 | #define sctp_port_rover (sctp_globals.port_rover) | ||
265 | #define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) | ||
266 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 264 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
267 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | 265 | #define sctp_local_addr_list (sctp_globals.local_addr_list) |
268 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) | 266 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 2b2769c5ca9f..e73ebdae323d 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -78,6 +78,7 @@ typedef __s32 sctp_assoc_t; | |||
78 | #define SCTP_GET_PEER_ADDR_INFO 15 | 78 | #define SCTP_GET_PEER_ADDR_INFO 15 |
79 | #define SCTP_DELAYED_ACK_TIME 16 | 79 | #define SCTP_DELAYED_ACK_TIME 16 |
80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME | 80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME |
81 | #define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME | ||
81 | #define SCTP_CONTEXT 17 | 82 | #define SCTP_CONTEXT 17 |
82 | #define SCTP_FRAGMENT_INTERLEAVE 18 | 83 | #define SCTP_FRAGMENT_INTERLEAVE 18 |
83 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ | 84 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ |
@@ -99,8 +100,8 @@ typedef __s32 sctp_assoc_t; | |||
99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ | 100 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
100 | /* Options 104-106 are deprecated and removed. Do not use this space */ | 101 | /* Options 104-106 are deprecated and removed. Do not use this space */ |
101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ | 102 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ | 103 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */ |
103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ | 104 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ |
104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ | 105 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ | 106 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
106 | 107 | ||
diff --git a/include/net/snmp.h b/include/net/snmp.h index a0e61806d480..762e2abce889 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -60,9 +60,7 @@ struct ipstats_mib { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* ICMP */ | 62 | /* ICMP */ |
63 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX | 63 | #define ICMP_MIB_MAX __ICMP_MIB_MAX |
64 | #define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1) | ||
65 | |||
66 | struct icmp_mib { | 64 | struct icmp_mib { |
67 | unsigned long mibs[ICMP_MIB_MAX]; | 65 | unsigned long mibs[ICMP_MIB_MAX]; |
68 | }; | 66 | }; |
diff --git a/include/net/sock.h b/include/net/sock.h index 7d3f7ce239b5..bc1cf7d88ccb 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/rculist_nulls.h> | 57 | #include <linux/rculist_nulls.h> |
58 | #include <linux/poll.h> | 58 | #include <linux/poll.h> |
59 | 59 | ||
60 | #include <asm/atomic.h> | 60 | #include <linux/atomic.h> |
61 | #include <net/dst.h> | 61 | #include <net/dst.h> |
62 | #include <net/checksum.h> | 62 | #include <net/checksum.h> |
63 | 63 | ||
@@ -105,10 +105,8 @@ struct net; | |||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * struct sock_common - minimal network layer representation of sockets | 107 | * struct sock_common - minimal network layer representation of sockets |
108 | * @skc_node: main hash linkage for various protocol lookup tables | 108 | * @skc_daddr: Foreign IPv4 addr |
109 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | 109 | * @skc_rcv_saddr: Bound local IPv4 addr |
110 | * @skc_refcnt: reference count | ||
111 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
112 | * @skc_hash: hash value used with various protocol lookup tables | 110 | * @skc_hash: hash value used with various protocol lookup tables |
113 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables | 111 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables |
114 | * @skc_family: network address family | 112 | * @skc_family: network address family |
@@ -119,20 +117,20 @@ struct net; | |||
119 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | 117 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol |
120 | * @skc_prot: protocol handlers inside a network family | 118 | * @skc_prot: protocol handlers inside a network family |
121 | * @skc_net: reference to the network namespace of this socket | 119 | * @skc_net: reference to the network namespace of this socket |
120 | * @skc_node: main hash linkage for various protocol lookup tables | ||
121 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | ||
122 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
123 | * @skc_refcnt: reference count | ||
122 | * | 124 | * |
123 | * This is the minimal network layer representation of sockets, the header | 125 | * This is the minimal network layer representation of sockets, the header |
124 | * for struct sock and struct inet_timewait_sock. | 126 | * for struct sock and struct inet_timewait_sock. |
125 | */ | 127 | */ |
126 | struct sock_common { | 128 | struct sock_common { |
127 | /* | 129 | /* skc_daddr and skc_rcv_saddr must be grouped : |
128 | * first fields are not copied in sock_copy() | 130 | * cf INET_MATCH() and INET_TW_MATCH() |
129 | */ | 131 | */ |
130 | union { | 132 | __be32 skc_daddr; |
131 | struct hlist_node skc_node; | 133 | __be32 skc_rcv_saddr; |
132 | struct hlist_nulls_node skc_nulls_node; | ||
133 | }; | ||
134 | atomic_t skc_refcnt; | ||
135 | int skc_tx_queue_mapping; | ||
136 | 134 | ||
137 | union { | 135 | union { |
138 | unsigned int skc_hash; | 136 | unsigned int skc_hash; |
@@ -150,6 +148,22 @@ struct sock_common { | |||
150 | #ifdef CONFIG_NET_NS | 148 | #ifdef CONFIG_NET_NS |
151 | struct net *skc_net; | 149 | struct net *skc_net; |
152 | #endif | 150 | #endif |
151 | /* | ||
152 | * fields between dontcopy_begin/dontcopy_end | ||
153 | * are not copied in sock_copy() | ||
154 | */ | ||
155 | /* private: */ | ||
156 | int skc_dontcopy_begin[0]; | ||
157 | /* public: */ | ||
158 | union { | ||
159 | struct hlist_node skc_node; | ||
160 | struct hlist_nulls_node skc_nulls_node; | ||
161 | }; | ||
162 | int skc_tx_queue_mapping; | ||
163 | atomic_t skc_refcnt; | ||
164 | /* private: */ | ||
165 | int skc_dontcopy_end[0]; | ||
166 | /* public: */ | ||
153 | }; | 167 | }; |
154 | 168 | ||
155 | /** | 169 | /** |
@@ -232,7 +246,8 @@ struct sock { | |||
232 | #define sk_refcnt __sk_common.skc_refcnt | 246 | #define sk_refcnt __sk_common.skc_refcnt |
233 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping | 247 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping |
234 | 248 | ||
235 | #define sk_copy_start __sk_common.skc_hash | 249 | #define sk_dontcopy_begin __sk_common.skc_dontcopy_begin |
250 | #define sk_dontcopy_end __sk_common.skc_dontcopy_end | ||
236 | #define sk_hash __sk_common.skc_hash | 251 | #define sk_hash __sk_common.skc_hash |
237 | #define sk_family __sk_common.skc_family | 252 | #define sk_family __sk_common.skc_family |
238 | #define sk_state __sk_common.skc_state | 253 | #define sk_state __sk_common.skc_state |
@@ -241,59 +256,67 @@ struct sock { | |||
241 | #define sk_bind_node __sk_common.skc_bind_node | 256 | #define sk_bind_node __sk_common.skc_bind_node |
242 | #define sk_prot __sk_common.skc_prot | 257 | #define sk_prot __sk_common.skc_prot |
243 | #define sk_net __sk_common.skc_net | 258 | #define sk_net __sk_common.skc_net |
244 | kmemcheck_bitfield_begin(flags); | ||
245 | unsigned int sk_shutdown : 2, | ||
246 | sk_no_check : 2, | ||
247 | sk_userlocks : 4, | ||
248 | sk_protocol : 8, | ||
249 | sk_type : 16; | ||
250 | kmemcheck_bitfield_end(flags); | ||
251 | int sk_rcvbuf; | ||
252 | socket_lock_t sk_lock; | 259 | socket_lock_t sk_lock; |
260 | struct sk_buff_head sk_receive_queue; | ||
253 | /* | 261 | /* |
254 | * The backlog queue is special, it is always used with | 262 | * The backlog queue is special, it is always used with |
255 | * the per-socket spinlock held and requires low latency | 263 | * the per-socket spinlock held and requires low latency |
256 | * access. Therefore we special case it's implementation. | 264 | * access. Therefore we special case it's implementation. |
265 | * Note : rmem_alloc is in this structure to fill a hole | ||
266 | * on 64bit arches, not because its logically part of | ||
267 | * backlog. | ||
257 | */ | 268 | */ |
258 | struct { | 269 | struct { |
259 | struct sk_buff *head; | 270 | atomic_t rmem_alloc; |
260 | struct sk_buff *tail; | 271 | int len; |
261 | int len; | 272 | struct sk_buff *head; |
273 | struct sk_buff *tail; | ||
262 | } sk_backlog; | 274 | } sk_backlog; |
275 | #define sk_rmem_alloc sk_backlog.rmem_alloc | ||
276 | int sk_forward_alloc; | ||
277 | #ifdef CONFIG_RPS | ||
278 | __u32 sk_rxhash; | ||
279 | #endif | ||
280 | atomic_t sk_drops; | ||
281 | int sk_rcvbuf; | ||
282 | |||
283 | struct sk_filter __rcu *sk_filter; | ||
263 | struct socket_wq *sk_wq; | 284 | struct socket_wq *sk_wq; |
264 | struct dst_entry *sk_dst_cache; | 285 | |
286 | #ifdef CONFIG_NET_DMA | ||
287 | struct sk_buff_head sk_async_wait_queue; | ||
288 | #endif | ||
289 | |||
265 | #ifdef CONFIG_XFRM | 290 | #ifdef CONFIG_XFRM |
266 | struct xfrm_policy *sk_policy[2]; | 291 | struct xfrm_policy *sk_policy[2]; |
267 | #endif | 292 | #endif |
293 | unsigned long sk_flags; | ||
294 | struct dst_entry *sk_dst_cache; | ||
268 | spinlock_t sk_dst_lock; | 295 | spinlock_t sk_dst_lock; |
269 | atomic_t sk_rmem_alloc; | ||
270 | atomic_t sk_wmem_alloc; | 296 | atomic_t sk_wmem_alloc; |
271 | atomic_t sk_omem_alloc; | 297 | atomic_t sk_omem_alloc; |
272 | int sk_sndbuf; | 298 | int sk_sndbuf; |
273 | struct sk_buff_head sk_receive_queue; | ||
274 | struct sk_buff_head sk_write_queue; | 299 | struct sk_buff_head sk_write_queue; |
275 | #ifdef CONFIG_NET_DMA | 300 | kmemcheck_bitfield_begin(flags); |
276 | struct sk_buff_head sk_async_wait_queue; | 301 | unsigned int sk_shutdown : 2, |
277 | #endif | 302 | sk_no_check : 2, |
303 | sk_userlocks : 4, | ||
304 | sk_protocol : 8, | ||
305 | sk_type : 16; | ||
306 | kmemcheck_bitfield_end(flags); | ||
278 | int sk_wmem_queued; | 307 | int sk_wmem_queued; |
279 | int sk_forward_alloc; | ||
280 | gfp_t sk_allocation; | 308 | gfp_t sk_allocation; |
281 | int sk_route_caps; | 309 | int sk_route_caps; |
282 | int sk_route_nocaps; | 310 | int sk_route_nocaps; |
283 | int sk_gso_type; | 311 | int sk_gso_type; |
284 | unsigned int sk_gso_max_size; | 312 | unsigned int sk_gso_max_size; |
285 | int sk_rcvlowat; | 313 | int sk_rcvlowat; |
286 | #ifdef CONFIG_RPS | ||
287 | __u32 sk_rxhash; | ||
288 | #endif | ||
289 | unsigned long sk_flags; | ||
290 | unsigned long sk_lingertime; | 314 | unsigned long sk_lingertime; |
291 | struct sk_buff_head sk_error_queue; | 315 | struct sk_buff_head sk_error_queue; |
292 | struct proto *sk_prot_creator; | 316 | struct proto *sk_prot_creator; |
293 | rwlock_t sk_callback_lock; | 317 | rwlock_t sk_callback_lock; |
294 | int sk_err, | 318 | int sk_err, |
295 | sk_err_soft; | 319 | sk_err_soft; |
296 | atomic_t sk_drops; | ||
297 | unsigned short sk_ack_backlog; | 320 | unsigned short sk_ack_backlog; |
298 | unsigned short sk_max_ack_backlog; | 321 | unsigned short sk_max_ack_backlog; |
299 | __u32 sk_priority; | 322 | __u32 sk_priority; |
@@ -301,7 +324,6 @@ struct sock { | |||
301 | const struct cred *sk_peer_cred; | 324 | const struct cred *sk_peer_cred; |
302 | long sk_rcvtimeo; | 325 | long sk_rcvtimeo; |
303 | long sk_sndtimeo; | 326 | long sk_sndtimeo; |
304 | struct sk_filter __rcu *sk_filter; | ||
305 | void *sk_protinfo; | 327 | void *sk_protinfo; |
306 | struct timer_list sk_timer; | 328 | struct timer_list sk_timer; |
307 | ktime_t sk_stamp; | 329 | ktime_t sk_stamp; |
@@ -509,9 +531,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk, | |||
509 | #define sk_nulls_for_each_from(__sk, node) \ | 531 | #define sk_nulls_for_each_from(__sk, node) \ |
510 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ | 532 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ |
511 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) | 533 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) |
512 | #define sk_for_each_continue(__sk, node) \ | ||
513 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ | ||
514 | hlist_for_each_entry_continue(__sk, node, sk_node) | ||
515 | #define sk_for_each_safe(__sk, node, tmp, list) \ | 534 | #define sk_for_each_safe(__sk, node, tmp, list) \ |
516 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) | 535 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) |
517 | #define sk_for_each_bound(__sk, node, list) \ | 536 | #define sk_for_each_bound(__sk, node, list) \ |
@@ -734,6 +753,8 @@ struct proto { | |||
734 | int level, | 753 | int level, |
735 | int optname, char __user *optval, | 754 | int optname, char __user *optval, |
736 | int __user *option); | 755 | int __user *option); |
756 | int (*compat_ioctl)(struct sock *sk, | ||
757 | unsigned int cmd, unsigned long arg); | ||
737 | #endif | 758 | #endif |
738 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 759 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
739 | struct msghdr *msg, size_t len); | 760 | struct msghdr *msg, size_t len); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e36c874c7fb1..38509f047382 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
60 | */ | 60 | */ |
61 | #define MAX_TCP_WINDOW 32767U | 61 | #define MAX_TCP_WINDOW 32767U |
62 | 62 | ||
63 | /* Offer an initial receive window of 10 mss. */ | ||
64 | #define TCP_DEFAULT_INIT_RCVWND 10 | ||
65 | |||
63 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 66 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
64 | #define TCP_MIN_MSS 88U | 67 | #define TCP_MIN_MSS 88U |
65 | 68 | ||
@@ -100,12 +103,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
100 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a | 103 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a |
101 | * connection: ~180sec is RFC minimum */ | 104 | * connection: ~180sec is RFC minimum */ |
102 | 105 | ||
103 | |||
104 | #define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned | ||
105 | * socket. 7 is ~50sec-16min. | ||
106 | */ | ||
107 | |||
108 | |||
109 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | 106 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT |
110 | * state, about 60 seconds */ | 107 | * state, about 60 seconds */ |
111 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN | 108 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN |
@@ -312,7 +309,8 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
312 | 309 | ||
313 | extern int tcp_v4_rcv(struct sk_buff *skb); | 310 | extern int tcp_v4_rcv(struct sk_buff *skb); |
314 | 311 | ||
315 | extern int tcp_v4_remember_stamp(struct sock *sk); | 312 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); |
313 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
316 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 314 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
317 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 315 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
318 | size_t size); | 316 | size_t size); |
@@ -1043,7 +1041,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | |||
1043 | return 1; | 1041 | return 1; |
1044 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1042 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
1045 | return 1; | 1043 | return 1; |
1046 | 1044 | /* | |
1045 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | ||
1046 | * then following tcp messages have valid values. Ignore 0 value, | ||
1047 | * or else 'negative' tsval might forbid us to accept their packets. | ||
1048 | */ | ||
1049 | if (!rx_opt->ts_recent) | ||
1050 | return 1; | ||
1047 | return 0; | 1051 | return 0; |
1048 | } | 1052 | } |
1049 | 1053 | ||
@@ -1157,8 +1161,6 @@ struct tcp_md5sig_pool { | |||
1157 | union tcp_md5sum_block md5_blk; | 1161 | union tcp_md5sum_block md5_blk; |
1158 | }; | 1162 | }; |
1159 | 1163 | ||
1160 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | ||
1161 | |||
1162 | /* - functions */ | 1164 | /* - functions */ |
1163 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1165 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
1164 | struct sock *sk, struct request_sock *req, | 1166 | struct sock *sk, struct request_sock *req, |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 97c3b14da55d..053b3cf2c66a 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -21,6 +21,7 @@ struct timewait_sock_ops { | |||
21 | int (*twsk_unique)(struct sock *sk, | 21 | int (*twsk_unique)(struct sock *sk, |
22 | struct sock *sktw, void *twp); | 22 | struct sock *sktw, void *twp); |
23 | void (*twsk_destructor)(struct sock *sk); | 23 | void (*twsk_destructor)(struct sock *sk); |
24 | void *(*twsk_getpeer)(struct sock *sk); | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 27 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
@@ -39,4 +40,11 @@ static inline void twsk_destructor(struct sock *sk) | |||
39 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 40 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
40 | } | 41 | } |
41 | 42 | ||
43 | static inline void *twsk_getpeer(struct sock *sk) | ||
44 | { | ||
45 | if (sk->sk_prot->twsk_prot->twsk_getpeer) | ||
46 | return sk->sk_prot->twsk_prot->twsk_getpeer(sk); | ||
47 | return NULL; | ||
48 | } | ||
49 | |||
42 | #endif /* _TIMEWAIT_SOCK_H */ | 50 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h deleted file mode 100644 index 1e0645e1eed2..000000000000 --- a/include/net/tipc/tipc.h +++ /dev/null | |||
@@ -1,186 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc.h: Main include file for TIPC users | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005,2010 Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE 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 BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_H_ | ||
38 | #define _NET_TIPC_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | |||
45 | /* | ||
46 | * Native API | ||
47 | */ | ||
48 | |||
49 | /* | ||
50 | * TIPC operating mode routines | ||
51 | */ | ||
52 | |||
53 | #define TIPC_NOT_RUNNING 0 | ||
54 | #define TIPC_NODE_MODE 1 | ||
55 | #define TIPC_NET_MODE 2 | ||
56 | |||
57 | typedef void (*tipc_mode_event)(void *usr_handle, int mode, u32 addr); | ||
58 | |||
59 | int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle); | ||
60 | |||
61 | void tipc_detach(unsigned int userref); | ||
62 | |||
63 | /* | ||
64 | * TIPC port manipulation routines | ||
65 | */ | ||
66 | |||
67 | typedef void (*tipc_msg_err_event) (void *usr_handle, | ||
68 | u32 portref, | ||
69 | struct sk_buff **buf, | ||
70 | unsigned char const *data, | ||
71 | unsigned int size, | ||
72 | int reason, | ||
73 | struct tipc_portid const *attmpt_destid); | ||
74 | |||
75 | typedef void (*tipc_named_msg_err_event) (void *usr_handle, | ||
76 | u32 portref, | ||
77 | struct sk_buff **buf, | ||
78 | unsigned char const *data, | ||
79 | unsigned int size, | ||
80 | int reason, | ||
81 | struct tipc_name_seq const *attmpt_dest); | ||
82 | |||
83 | typedef void (*tipc_conn_shutdown_event) (void *usr_handle, | ||
84 | u32 portref, | ||
85 | struct sk_buff **buf, | ||
86 | unsigned char const *data, | ||
87 | unsigned int size, | ||
88 | int reason); | ||
89 | |||
90 | typedef void (*tipc_msg_event) (void *usr_handle, | ||
91 | u32 portref, | ||
92 | struct sk_buff **buf, | ||
93 | unsigned char const *data, | ||
94 | unsigned int size, | ||
95 | unsigned int importance, | ||
96 | struct tipc_portid const *origin); | ||
97 | |||
98 | typedef void (*tipc_named_msg_event) (void *usr_handle, | ||
99 | u32 portref, | ||
100 | struct sk_buff **buf, | ||
101 | unsigned char const *data, | ||
102 | unsigned int size, | ||
103 | unsigned int importance, | ||
104 | struct tipc_portid const *orig, | ||
105 | struct tipc_name_seq const *dest); | ||
106 | |||
107 | typedef void (*tipc_conn_msg_event) (void *usr_handle, | ||
108 | u32 portref, | ||
109 | struct sk_buff **buf, | ||
110 | unsigned char const *data, | ||
111 | unsigned int size); | ||
112 | |||
113 | typedef void (*tipc_continue_event) (void *usr_handle, | ||
114 | u32 portref); | ||
115 | |||
116 | int tipc_createport(unsigned int tipc_user, | ||
117 | void *usr_handle, | ||
118 | unsigned int importance, | ||
119 | tipc_msg_err_event error_cb, | ||
120 | tipc_named_msg_err_event named_error_cb, | ||
121 | tipc_conn_shutdown_event conn_error_cb, | ||
122 | tipc_msg_event message_cb, | ||
123 | tipc_named_msg_event named_message_cb, | ||
124 | tipc_conn_msg_event conn_message_cb, | ||
125 | tipc_continue_event continue_event_cb, | ||
126 | u32 *portref); | ||
127 | |||
128 | int tipc_deleteport(u32 portref); | ||
129 | |||
130 | int tipc_ownidentity(u32 portref, struct tipc_portid *port); | ||
131 | |||
132 | int tipc_portimportance(u32 portref, unsigned int *importance); | ||
133 | int tipc_set_portimportance(u32 portref, unsigned int importance); | ||
134 | |||
135 | int tipc_portunreliable(u32 portref, unsigned int *isunreliable); | ||
136 | int tipc_set_portunreliable(u32 portref, unsigned int isunreliable); | ||
137 | |||
138 | int tipc_portunreturnable(u32 portref, unsigned int *isunreturnable); | ||
139 | int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable); | ||
140 | |||
141 | int tipc_publish(u32 portref, unsigned int scope, | ||
142 | struct tipc_name_seq const *name_seq); | ||
143 | int tipc_withdraw(u32 portref, unsigned int scope, | ||
144 | struct tipc_name_seq const *name_seq); | ||
145 | |||
146 | int tipc_connect2port(u32 portref, struct tipc_portid const *port); | ||
147 | |||
148 | int tipc_disconnect(u32 portref); | ||
149 | |||
150 | int tipc_shutdown(u32 ref); | ||
151 | |||
152 | /* | ||
153 | * TIPC messaging routines | ||
154 | */ | ||
155 | |||
156 | #define TIPC_PORT_IMPORTANCE 100 /* send using current port setting */ | ||
157 | |||
158 | |||
159 | int tipc_send(u32 portref, | ||
160 | unsigned int num_sect, | ||
161 | struct iovec const *msg_sect); | ||
162 | |||
163 | int tipc_send2name(u32 portref, | ||
164 | struct tipc_name const *name, | ||
165 | u32 domain, | ||
166 | unsigned int num_sect, | ||
167 | struct iovec const *msg_sect); | ||
168 | |||
169 | int tipc_send2port(u32 portref, | ||
170 | struct tipc_portid const *dest, | ||
171 | unsigned int num_sect, | ||
172 | struct iovec const *msg_sect); | ||
173 | |||
174 | int tipc_send_buf2port(u32 portref, | ||
175 | struct tipc_portid const *dest, | ||
176 | struct sk_buff *buf, | ||
177 | unsigned int dsz); | ||
178 | |||
179 | int tipc_multicast(u32 portref, | ||
180 | struct tipc_name_seq const *seq, | ||
181 | u32 domain, /* currently unused */ | ||
182 | unsigned int section_count, | ||
183 | struct iovec const *msg); | ||
184 | #endif | ||
185 | |||
186 | #endif | ||
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h deleted file mode 100644 index ee2f304e4919..000000000000 --- a/include/net/tipc/tipc_bearer.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_bearer.h: Include file for privileged access to TIPC bearers | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE 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 BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_BEARER_H_ | ||
38 | #define _NET_TIPC_BEARER_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc_config.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | #include <linux/spinlock.h> | ||
45 | |||
46 | /* | ||
47 | * Identifiers of supported TIPC media types | ||
48 | */ | ||
49 | |||
50 | #define TIPC_MEDIA_TYPE_ETH 1 | ||
51 | |||
52 | /* | ||
53 | * Destination address structure used by TIPC bearers when sending messages | ||
54 | * | ||
55 | * IMPORTANT: The fields of this structure MUST be stored using the specified | ||
56 | * byte order indicated below, as the structure is exchanged between nodes | ||
57 | * as part of a link setup process. | ||
58 | */ | ||
59 | |||
60 | struct tipc_media_addr { | ||
61 | __be32 type; /* bearer type (network byte order) */ | ||
62 | union { | ||
63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ | ||
64 | #if 0 | ||
65 | /* Prototypes for other possible bearer types */ | ||
66 | |||
67 | struct { | ||
68 | __u16 sin_family; | ||
69 | __u16 sin_port; | ||
70 | struct { | ||
71 | __u32 s_addr; | ||
72 | } sin_addr; | ||
73 | char pad[4]; | ||
74 | } addr_in; /* IP-based bearer */ | ||
75 | __u16 sock_descr; /* generic socket bearer */ | ||
76 | #endif | ||
77 | } dev_addr; | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * struct tipc_bearer - TIPC bearer info available to privileged users | ||
82 | * @usr_handle: pointer to additional user-defined information about bearer | ||
83 | * @mtu: max packet size bearer can support | ||
84 | * @blocked: non-zero if bearer is blocked | ||
85 | * @lock: spinlock for controlling access to bearer | ||
86 | * @addr: media-specific address associated with bearer | ||
87 | * @name: bearer name (format = media:interface) | ||
88 | * | ||
89 | * Note: TIPC initializes "name" and "lock" fields; user is responsible for | ||
90 | * initialization all other fields when a bearer is enabled. | ||
91 | */ | ||
92 | |||
93 | struct tipc_bearer { | ||
94 | void *usr_handle; | ||
95 | u32 mtu; | ||
96 | int blocked; | ||
97 | spinlock_t lock; | ||
98 | struct tipc_media_addr addr; | ||
99 | char name[TIPC_MAX_BEARER_NAME]; | ||
100 | }; | ||
101 | |||
102 | /* | ||
103 | * TIPC routines available to supported media types | ||
104 | */ | ||
105 | |||
106 | int tipc_register_media(u32 media_type, | ||
107 | char *media_name, | ||
108 | int (*enable)(struct tipc_bearer *), | ||
109 | void (*disable)(struct tipc_bearer *), | ||
110 | int (*send_msg)(struct sk_buff *, | ||
111 | struct tipc_bearer *, | ||
112 | struct tipc_media_addr *), | ||
113 | char *(*addr2str)(struct tipc_media_addr *a, | ||
114 | char *str_buf, | ||
115 | int str_size), | ||
116 | struct tipc_media_addr *bcast_addr, | ||
117 | const u32 bearer_priority, | ||
118 | const u32 link_tolerance, /* [ms] */ | ||
119 | const u32 send_window_limit); | ||
120 | |||
121 | void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); | ||
122 | |||
123 | int tipc_block_bearer(const char *name); | ||
124 | void tipc_continue(struct tipc_bearer *tb_ptr); | ||
125 | |||
126 | int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority); | ||
127 | int tipc_disable_bearer(const char *name); | ||
128 | |||
129 | /* | ||
130 | * Routines made available to TIPC by supported media types | ||
131 | */ | ||
132 | |||
133 | int tipc_eth_media_start(void); | ||
134 | void tipc_eth_media_stop(void); | ||
135 | |||
136 | #endif | ||
137 | |||
138 | #endif | ||
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h deleted file mode 100644 index ffe50b4e7b93..000000000000 --- a/include/net/tipc/tipc_msg.h +++ /dev/null | |||
@@ -1,207 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_msg.h: Include file for privileged access to TIPC message headers | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE 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 BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_MSG_H_ | ||
38 | #define _NET_TIPC_MSG_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | struct tipc_msg { | ||
43 | __be32 hdr[15]; | ||
44 | }; | ||
45 | |||
46 | |||
47 | /* | ||
48 | TIPC user data message header format, version 2: | ||
49 | |||
50 | |||
51 | 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0 | ||
52 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
53 | w0:|vers | user |hdr sz |n|d|s|-| message size | | ||
54 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
55 | w1:|mstyp| error |rer cnt|lsc|opt p| broadcast ack no | | ||
56 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
57 | w2:| link level ack no | broadcast/link level seq no | | ||
58 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
59 | w3:| previous node | | ||
60 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
61 | w4:| originating port | | ||
62 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
63 | w5:| destination port | | ||
64 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
65 | w6:| originating node | | ||
66 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
67 | w7:| destination node | | ||
68 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
69 | w8:| name type / transport sequence number | | ||
70 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
71 | w9:| name instance/multicast lower bound | | ||
72 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
73 | wA:| multicast upper bound | | ||
74 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
75 | / / | ||
76 | \ options \ | ||
77 | / / | ||
78 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
79 | |||
80 | */ | ||
81 | |||
82 | #define TIPC_CONN_MSG 0 | ||
83 | #define TIPC_MCAST_MSG 1 | ||
84 | #define TIPC_NAMED_MSG 2 | ||
85 | #define TIPC_DIRECT_MSG 3 | ||
86 | |||
87 | |||
88 | static inline u32 msg_word(struct tipc_msg *m, u32 pos) | ||
89 | { | ||
90 | return ntohl(m->hdr[pos]); | ||
91 | } | ||
92 | |||
93 | static inline u32 msg_bits(struct tipc_msg *m, u32 w, u32 pos, u32 mask) | ||
94 | { | ||
95 | return (msg_word(m, w) >> pos) & mask; | ||
96 | } | ||
97 | |||
98 | static inline u32 msg_importance(struct tipc_msg *m) | ||
99 | { | ||
100 | return msg_bits(m, 0, 25, 0xf); | ||
101 | } | ||
102 | |||
103 | static inline u32 msg_hdr_sz(struct tipc_msg *m) | ||
104 | { | ||
105 | return msg_bits(m, 0, 21, 0xf) << 2; | ||
106 | } | ||
107 | |||
108 | static inline int msg_short(struct tipc_msg *m) | ||
109 | { | ||
110 | return msg_hdr_sz(m) == 24; | ||
111 | } | ||
112 | |||
113 | static inline u32 msg_size(struct tipc_msg *m) | ||
114 | { | ||
115 | return msg_bits(m, 0, 0, 0x1ffff); | ||
116 | } | ||
117 | |||
118 | static inline u32 msg_data_sz(struct tipc_msg *m) | ||
119 | { | ||
120 | return msg_size(m) - msg_hdr_sz(m); | ||
121 | } | ||
122 | |||
123 | static inline unchar *msg_data(struct tipc_msg *m) | ||
124 | { | ||
125 | return ((unchar *)m) + msg_hdr_sz(m); | ||
126 | } | ||
127 | |||
128 | static inline u32 msg_type(struct tipc_msg *m) | ||
129 | { | ||
130 | return msg_bits(m, 1, 29, 0x7); | ||
131 | } | ||
132 | |||
133 | static inline u32 msg_named(struct tipc_msg *m) | ||
134 | { | ||
135 | return msg_type(m) == TIPC_NAMED_MSG; | ||
136 | } | ||
137 | |||
138 | static inline u32 msg_mcast(struct tipc_msg *m) | ||
139 | { | ||
140 | return msg_type(m) == TIPC_MCAST_MSG; | ||
141 | } | ||
142 | |||
143 | static inline u32 msg_connected(struct tipc_msg *m) | ||
144 | { | ||
145 | return msg_type(m) == TIPC_CONN_MSG; | ||
146 | } | ||
147 | |||
148 | static inline u32 msg_errcode(struct tipc_msg *m) | ||
149 | { | ||
150 | return msg_bits(m, 1, 25, 0xf); | ||
151 | } | ||
152 | |||
153 | static inline u32 msg_prevnode(struct tipc_msg *m) | ||
154 | { | ||
155 | return msg_word(m, 3); | ||
156 | } | ||
157 | |||
158 | static inline u32 msg_origport(struct tipc_msg *m) | ||
159 | { | ||
160 | return msg_word(m, 4); | ||
161 | } | ||
162 | |||
163 | static inline u32 msg_destport(struct tipc_msg *m) | ||
164 | { | ||
165 | return msg_word(m, 5); | ||
166 | } | ||
167 | |||
168 | static inline u32 msg_mc_netid(struct tipc_msg *m) | ||
169 | { | ||
170 | return msg_word(m, 5); | ||
171 | } | ||
172 | |||
173 | static inline u32 msg_orignode(struct tipc_msg *m) | ||
174 | { | ||
175 | if (likely(msg_short(m))) | ||
176 | return msg_prevnode(m); | ||
177 | return msg_word(m, 6); | ||
178 | } | ||
179 | |||
180 | static inline u32 msg_destnode(struct tipc_msg *m) | ||
181 | { | ||
182 | return msg_word(m, 7); | ||
183 | } | ||
184 | |||
185 | static inline u32 msg_nametype(struct tipc_msg *m) | ||
186 | { | ||
187 | return msg_word(m, 8); | ||
188 | } | ||
189 | |||
190 | static inline u32 msg_nameinst(struct tipc_msg *m) | ||
191 | { | ||
192 | return msg_word(m, 9); | ||
193 | } | ||
194 | |||
195 | static inline u32 msg_namelower(struct tipc_msg *m) | ||
196 | { | ||
197 | return msg_nameinst(m); | ||
198 | } | ||
199 | |||
200 | static inline u32 msg_nameupper(struct tipc_msg *m) | ||
201 | { | ||
202 | return msg_word(m, 10); | ||
203 | } | ||
204 | |||
205 | #endif | ||
206 | |||
207 | #endif | ||
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h deleted file mode 100644 index 1893aaf49426..000000000000 --- a/include/net/tipc/tipc_port.h +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports | ||
3 | * | ||
4 | * Copyright (c) 1994-2007, Ericsson AB | ||
5 | * Copyright (c) 2005-2008, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE 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 BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_PORT_H_ | ||
38 | #define _NET_TIPC_PORT_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | #include <net/tipc/tipc_msg.h> | ||
45 | |||
46 | #define TIPC_FLOW_CONTROL_WIN 512 | ||
47 | |||
48 | /** | ||
49 | * struct tipc_port - native TIPC port info available to privileged users | ||
50 | * @usr_handle: pointer to additional user-defined information about port | ||
51 | * @lock: pointer to spinlock for controlling access to port | ||
52 | * @connected: non-zero if port is currently connected to a peer port | ||
53 | * @conn_type: TIPC type used when connection was established | ||
54 | * @conn_instance: TIPC instance used when connection was established | ||
55 | * @conn_unacked: number of unacknowledged messages received from peer port | ||
56 | * @published: non-zero if port has one or more associated names | ||
57 | * @congested: non-zero if cannot send because of link or port congestion | ||
58 | * @max_pkt: maximum packet size "hint" used when building messages sent by port | ||
59 | * @ref: unique reference to port in TIPC object registry | ||
60 | * @phdr: preformatted message header used when sending messages | ||
61 | */ | ||
62 | |||
63 | struct tipc_port { | ||
64 | void *usr_handle; | ||
65 | spinlock_t *lock; | ||
66 | int connected; | ||
67 | u32 conn_type; | ||
68 | u32 conn_instance; | ||
69 | u32 conn_unacked; | ||
70 | int published; | ||
71 | u32 congested; | ||
72 | u32 max_pkt; | ||
73 | u32 ref; | ||
74 | struct tipc_msg phdr; | ||
75 | }; | ||
76 | |||
77 | |||
78 | struct tipc_port *tipc_createport_raw(void *usr_handle, | ||
79 | u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), | ||
80 | void (*wakeup)(struct tipc_port *), | ||
81 | const u32 importance); | ||
82 | |||
83 | int tipc_reject_msg(struct sk_buff *buf, u32 err); | ||
84 | |||
85 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode); | ||
86 | |||
87 | void tipc_acknowledge(u32 port_ref,u32 ack); | ||
88 | |||
89 | struct tipc_port *tipc_get_port(const u32 ref); | ||
90 | |||
91 | /* | ||
92 | * The following routines require that the port be locked on entry | ||
93 | */ | ||
94 | |||
95 | int tipc_disconnect_port(struct tipc_port *tp_ptr); | ||
96 | |||
97 | |||
98 | #endif | ||
99 | |||
100 | #endif | ||
101 | |||
diff --git a/include/net/x25.h b/include/net/x25.h index 1479cb4a41fc..a06119a05129 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -315,6 +315,8 @@ extern struct list_head x25_route_list; | |||
315 | extern rwlock_t x25_route_list_lock; | 315 | extern rwlock_t x25_route_list_lock; |
316 | extern struct list_head x25_forward_list; | 316 | extern struct list_head x25_forward_list; |
317 | extern rwlock_t x25_forward_list_lock; | 317 | extern rwlock_t x25_forward_list_lock; |
318 | extern struct list_head x25_neigh_list; | ||
319 | extern rwlock_t x25_neigh_list_lock; | ||
318 | 320 | ||
319 | extern int x25_proc_init(void); | 321 | extern int x25_proc_init(void); |
320 | extern void x25_proc_exit(void); | 322 | extern void x25_proc_exit(void); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bcfb6b24b019..b9f385da758e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -143,6 +143,7 @@ struct xfrm_state { | |||
143 | struct xfrm_id id; | 143 | struct xfrm_id id; |
144 | struct xfrm_selector sel; | 144 | struct xfrm_selector sel; |
145 | struct xfrm_mark mark; | 145 | struct xfrm_mark mark; |
146 | u32 tfcpad; | ||
146 | 147 | ||
147 | u32 genid; | 148 | u32 genid; |
148 | 149 | ||
@@ -805,6 +806,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl) | |||
805 | case IPPROTO_MH: | 806 | case IPPROTO_MH: |
806 | port = htons(fl->fl_mh_type); | 807 | port = htons(fl->fl_mh_type); |
807 | break; | 808 | break; |
809 | case IPPROTO_GRE: | ||
810 | port = htons(ntohl(fl->fl_gre_key) >> 16); | ||
811 | break; | ||
808 | default: | 812 | default: |
809 | port = 0; /*XXX*/ | 813 | port = 0; /*XXX*/ |
810 | } | 814 | } |
@@ -826,6 +830,9 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
826 | case IPPROTO_ICMPV6: | 830 | case IPPROTO_ICMPV6: |
827 | port = htons(fl->fl_icmp_code); | 831 | port = htons(fl->fl_icmp_code); |
828 | break; | 832 | break; |
833 | case IPPROTO_GRE: | ||
834 | port = htons(ntohl(fl->fl_gre_key) & 0xffff); | ||
835 | break; | ||
829 | default: | 836 | default: |
830 | port = 0; /*XXX*/ | 837 | port = 0; /*XXX*/ |
831 | } | 838 | } |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e04c4888d1fd..55cd0a0bc977 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -47,10 +47,13 @@ | |||
47 | #include <linux/list.h> | 47 | #include <linux/list.h> |
48 | #include <linux/rwsem.h> | 48 | #include <linux/rwsem.h> |
49 | #include <linux/scatterlist.h> | 49 | #include <linux/scatterlist.h> |
50 | #include <linux/workqueue.h> | ||
50 | 51 | ||
51 | #include <asm/atomic.h> | 52 | #include <asm/atomic.h> |
52 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
53 | 54 | ||
55 | extern struct workqueue_struct *ib_wq; | ||
56 | |||
54 | union ib_gid { | 57 | union ib_gid { |
55 | u8 raw[16]; | 58 | u8 raw[16]; |
56 | struct { | 59 | struct { |
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 8e9b222251c2..8a143ca79878 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
@@ -46,7 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | struct fcp_cmnd { | 47 | struct fcp_cmnd { |
48 | __u8 fc_lun[8]; /* logical unit number */ | 48 | __u8 fc_lun[8]; /* logical unit number */ |
49 | __u8 fc_cmdref; /* commmand reference number */ | 49 | __u8 fc_cmdref; /* command reference number */ |
50 | __u8 fc_pri_ta; /* priority and task attribute */ | 50 | __u8 fc_pri_ta; /* priority and task attribute */ |
51 | __u8 fc_tm_flags; /* task management flags */ | 51 | __u8 fc_tm_flags; /* task management flags */ |
52 | __u8 fc_flags; /* additional len & flags */ | 52 | __u8 fc_flags; /* additional len & flags */ |
@@ -58,7 +58,7 @@ struct fcp_cmnd { | |||
58 | 58 | ||
59 | struct fcp_cmnd32 { | 59 | struct fcp_cmnd32 { |
60 | __u8 fc_lun[8]; /* logical unit number */ | 60 | __u8 fc_lun[8]; /* logical unit number */ |
61 | __u8 fc_cmdref; /* commmand reference number */ | 61 | __u8 fc_cmdref; /* command reference number */ |
62 | __u8 fc_pri_ta; /* priority and task attribute */ | 62 | __u8 fc_pri_ta; /* priority and task attribute */ |
63 | __u8 fc_tm_flags; /* task management flags */ | 63 | __u8 fc_tm_flags; /* task management flags */ |
64 | __u8 fc_flags; /* additional len & flags */ | 64 | __u8 fc_flags; /* additional len & flags */ |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index a8631acd37c3..c3e1cbcc2ad2 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -263,6 +263,7 @@ enum iscsi_err { | |||
263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, |
264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, |
265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, | 265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, |
266 | ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, | ||
266 | }; | 267 | }; |
267 | 268 | ||
268 | /* | 269 | /* |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 5c4c1678f7be..f53c8e31d5fb 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -221,8 +221,8 @@ struct fc_rport_priv { | |||
221 | * @InputRequests: Number of input requests | 221 | * @InputRequests: Number of input requests |
222 | * @OutputRequests: Number of output requests | 222 | * @OutputRequests: Number of output requests |
223 | * @ControlRequests: Number of control requests | 223 | * @ControlRequests: Number of control requests |
224 | * @InputMegabytes: Number of received megabytes | 224 | * @InputBytes: Number of received bytes |
225 | * @OutputMegabytes: Number of transmitted megabytes | 225 | * @OutputBytes: Number of transmitted bytes |
226 | * @VLinkFailureCount: Number of virtual link failures | 226 | * @VLinkFailureCount: Number of virtual link failures |
227 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement | 227 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement |
228 | */ | 228 | */ |
@@ -241,8 +241,8 @@ struct fcoe_dev_stats { | |||
241 | u64 InputRequests; | 241 | u64 InputRequests; |
242 | u64 OutputRequests; | 242 | u64 OutputRequests; |
243 | u64 ControlRequests; | 243 | u64 ControlRequests; |
244 | u64 InputMegabytes; | 244 | u64 InputBytes; |
245 | u64 OutputMegabytes; | 245 | u64 OutputBytes; |
246 | u64 VLinkFailureCount; | 246 | u64 VLinkFailureCount; |
247 | u64 MissDiscAdvCount; | 247 | u64 MissDiscAdvCount; |
248 | }; | 248 | }; |
@@ -263,7 +263,6 @@ struct fc_seq_els_data { | |||
263 | * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) | 263 | * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) |
264 | * @lp: The associated local port | 264 | * @lp: The associated local port |
265 | * @state: The state of the I/O | 265 | * @state: The state of the I/O |
266 | * @tgt_flags: Target's flags | ||
267 | * @ref_cnt: Reference count | 266 | * @ref_cnt: Reference count |
268 | * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the | 267 | * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the |
269 | * host_lock if both are to be held at the same time) | 268 | * host_lock if both are to be held at the same time) |
@@ -298,7 +297,6 @@ struct fc_fcp_pkt { | |||
298 | /* Housekeeping information */ | 297 | /* Housekeeping information */ |
299 | struct fc_lport *lp; | 298 | struct fc_lport *lp; |
300 | u16 state; | 299 | u16 state; |
301 | u16 tgt_flags; | ||
302 | atomic_t ref_cnt; | 300 | atomic_t ref_cnt; |
303 | spinlock_t scsi_pkt_lock; | 301 | spinlock_t scsi_pkt_lock; |
304 | 302 | ||
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 06f1b5a8ed19..feb6a94c90ea 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -92,10 +92,12 @@ enum fip_state { | |||
92 | * @timer_work: &work_struct for doing keep-alives and resets. | 92 | * @timer_work: &work_struct for doing keep-alives and resets. |
93 | * @recv_work: &work_struct for receiving FIP frames. | 93 | * @recv_work: &work_struct for receiving FIP frames. |
94 | * @fip_recv_list: list of received FIP frames. | 94 | * @fip_recv_list: list of received FIP frames. |
95 | * @flogi_req: clone of FLOGI request sent | ||
95 | * @rnd_state: state for pseudo-random number generator. | 96 | * @rnd_state: state for pseudo-random number generator. |
96 | * @port_id: proposed or selected local-port ID. | 97 | * @port_id: proposed or selected local-port ID. |
97 | * @user_mfs: configured maximum FC frame size, including FC header. | 98 | * @user_mfs: configured maximum FC frame size, including FC header. |
98 | * @flogi_oxid: exchange ID of most recent fabric login. | 99 | * @flogi_oxid: exchange ID of most recent fabric login. |
100 | * @flogi_req_send: send of FLOGI requested | ||
99 | * @flogi_count: number of FLOGI attempts in AUTO mode. | 101 | * @flogi_count: number of FLOGI attempts in AUTO mode. |
100 | * @map_dest: use the FC_MAP mode for destination MAC addresses. | 102 | * @map_dest: use the FC_MAP mode for destination MAC addresses. |
101 | * @spma: supports SPMA server-provided MACs mode | 103 | * @spma: supports SPMA server-provided MACs mode |
@@ -106,6 +108,7 @@ enum fip_state { | |||
106 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. | 108 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. |
107 | * @get_src_addr: LLD-supplied function to supply a source MAC address. | 109 | * @get_src_addr: LLD-supplied function to supply a source MAC address. |
108 | * @ctlr_mutex: lock protecting this structure. | 110 | * @ctlr_mutex: lock protecting this structure. |
111 | * @ctlr_lock: spinlock covering flogi_req | ||
109 | * | 112 | * |
110 | * This structure is used by all FCoE drivers. It contains information | 113 | * This structure is used by all FCoE drivers. It contains information |
111 | * needed by all FCoE low-level drivers (LLDs) as well as internal state | 114 | * needed by all FCoE low-level drivers (LLDs) as well as internal state |
@@ -126,12 +129,14 @@ struct fcoe_ctlr { | |||
126 | struct work_struct timer_work; | 129 | struct work_struct timer_work; |
127 | struct work_struct recv_work; | 130 | struct work_struct recv_work; |
128 | struct sk_buff_head fip_recv_list; | 131 | struct sk_buff_head fip_recv_list; |
132 | struct sk_buff *flogi_req; | ||
129 | 133 | ||
130 | struct rnd_state rnd_state; | 134 | struct rnd_state rnd_state; |
131 | u32 port_id; | 135 | u32 port_id; |
132 | 136 | ||
133 | u16 user_mfs; | 137 | u16 user_mfs; |
134 | u16 flogi_oxid; | 138 | u16 flogi_oxid; |
139 | u8 flogi_req_send; | ||
135 | u8 flogi_count; | 140 | u8 flogi_count; |
136 | u8 map_dest; | 141 | u8 map_dest; |
137 | u8 spma; | 142 | u8 spma; |
@@ -143,6 +148,7 @@ struct fcoe_ctlr { | |||
143 | void (*update_mac)(struct fc_lport *, u8 *addr); | 148 | void (*update_mac)(struct fc_lport *, u8 *addr); |
144 | u8 * (*get_src_addr)(struct fc_lport *); | 149 | u8 * (*get_src_addr)(struct fc_lport *); |
145 | struct mutex ctlr_mutex; | 150 | struct mutex ctlr_mutex; |
151 | spinlock_t ctlr_lock; | ||
146 | }; | 152 | }; |
147 | 153 | ||
148 | /** | 154 | /** |
@@ -155,6 +161,7 @@ struct fcoe_ctlr { | |||
155 | * @fcf_mac: Ethernet address of the FCF | 161 | * @fcf_mac: Ethernet address of the FCF |
156 | * @vfid: virtual fabric ID | 162 | * @vfid: virtual fabric ID |
157 | * @pri: selection priority, smaller values are better | 163 | * @pri: selection priority, smaller values are better |
164 | * @flogi_sent: current FLOGI sent to this FCF | ||
158 | * @flags: flags received from advertisement | 165 | * @flags: flags received from advertisement |
159 | * @fka_period: keep-alive period, in jiffies | 166 | * @fka_period: keep-alive period, in jiffies |
160 | * | 167 | * |
@@ -176,6 +183,7 @@ struct fcoe_fcf { | |||
176 | u8 fcf_mac[ETH_ALEN]; | 183 | u8 fcf_mac[ETH_ALEN]; |
177 | 184 | ||
178 | u8 pri; | 185 | u8 pri; |
186 | u8 flogi_sent; | ||
179 | u16 flags; | 187 | u16 flags; |
180 | u32 fka_period; | 188 | u32 fka_period; |
181 | u8 fd_flags:1; | 189 | u8 fd_flags:1; |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index b81d969ddc67..748382b32b52 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -89,6 +89,7 @@ enum { | |||
89 | ISCSI_TASK_RUNNING, | 89 | ISCSI_TASK_RUNNING, |
90 | ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ | 90 | ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ |
91 | ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ | 91 | ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ |
92 | ISCSI_TASK_REQUEUE_SCSIQ, /* qcmd requeueing to scsi-ml */ | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | struct iscsi_r2t_info { | 95 | struct iscsi_r2t_info { |
@@ -341,7 +342,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc); | |||
341 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); | 342 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); |
342 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); | 343 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); |
343 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 344 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
344 | extern int iscsi_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *sc); | 345 | extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc); |
345 | 346 | ||
346 | /* | 347 | /* |
347 | * iSCSI host helpers. | 348 | * iSCSI host helpers. |
@@ -419,6 +420,7 @@ extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t); | |||
419 | extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); | 420 | extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); |
420 | extern void iscsi_requeue_task(struct iscsi_task *task); | 421 | extern void iscsi_requeue_task(struct iscsi_task *task); |
421 | extern void iscsi_put_task(struct iscsi_task *task); | 422 | extern void iscsi_put_task(struct iscsi_task *task); |
423 | extern void __iscsi_put_task(struct iscsi_task *task); | ||
422 | extern void __iscsi_get_task(struct iscsi_task *task); | 424 | extern void __iscsi_get_task(struct iscsi_task *task); |
423 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, | 425 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, |
424 | uint32_t exp_cmdsn, uint32_t max_cmdsn); | 426 | uint32_t exp_cmdsn, uint32_t max_cmdsn); |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 90ce527ecf3d..8f6bb9c7f3eb 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -361,6 +361,8 @@ struct sas_ha_struct { | |||
361 | /* The class calls this to send a task for execution. */ | 361 | /* The class calls this to send a task for execution. */ |
362 | int lldd_max_execute_num; | 362 | int lldd_max_execute_num; |
363 | int lldd_queue_size; | 363 | int lldd_queue_size; |
364 | int strict_wide_ports; /* both sas_addr and attached_sas_addr must match | ||
365 | * their siblings when forming wide ports */ | ||
364 | 366 | ||
365 | /* LLDD calls these to notify the class of an event. */ | 367 | /* LLDD calls these to notify the class of an event. */ |
366 | void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); | 368 | void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 216af8538cc9..b76d4006e36d 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define _SCSI_SCSI_H | 9 | #define _SCSI_SCSI_H |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/scatterlist.h> | ||
12 | 13 | ||
13 | struct scsi_cmnd; | 14 | struct scsi_cmnd; |
14 | 15 | ||
@@ -104,6 +105,7 @@ struct scsi_cmnd; | |||
104 | #define UNMAP 0x42 | 105 | #define UNMAP 0x42 |
105 | #define READ_TOC 0x43 | 106 | #define READ_TOC 0x43 |
106 | #define READ_HEADER 0x44 | 107 | #define READ_HEADER 0x44 |
108 | #define GET_EVENT_STATUS_NOTIFICATION 0x4a | ||
107 | #define LOG_SELECT 0x4c | 109 | #define LOG_SELECT 0x4c |
108 | #define LOG_SENSE 0x4d | 110 | #define LOG_SENSE 0x4d |
109 | #define XDWRITEREAD_10 0x53 | 111 | #define XDWRITEREAD_10 0x53 |
@@ -115,33 +117,61 @@ struct scsi_cmnd; | |||
115 | #define PERSISTENT_RESERVE_OUT 0x5f | 117 | #define PERSISTENT_RESERVE_OUT 0x5f |
116 | #define VARIABLE_LENGTH_CMD 0x7f | 118 | #define VARIABLE_LENGTH_CMD 0x7f |
117 | #define REPORT_LUNS 0xa0 | 119 | #define REPORT_LUNS 0xa0 |
120 | #define SECURITY_PROTOCOL_IN 0xa2 | ||
118 | #define MAINTENANCE_IN 0xa3 | 121 | #define MAINTENANCE_IN 0xa3 |
119 | #define MAINTENANCE_OUT 0xa4 | 122 | #define MAINTENANCE_OUT 0xa4 |
120 | #define MOVE_MEDIUM 0xa5 | 123 | #define MOVE_MEDIUM 0xa5 |
121 | #define EXCHANGE_MEDIUM 0xa6 | 124 | #define EXCHANGE_MEDIUM 0xa6 |
122 | #define READ_12 0xa8 | 125 | #define READ_12 0xa8 |
123 | #define WRITE_12 0xaa | 126 | #define WRITE_12 0xaa |
127 | #define READ_MEDIA_SERIAL_NUMBER 0xab | ||
124 | #define WRITE_VERIFY_12 0xae | 128 | #define WRITE_VERIFY_12 0xae |
125 | #define VERIFY_12 0xaf | 129 | #define VERIFY_12 0xaf |
126 | #define SEARCH_HIGH_12 0xb0 | 130 | #define SEARCH_HIGH_12 0xb0 |
127 | #define SEARCH_EQUAL_12 0xb1 | 131 | #define SEARCH_EQUAL_12 0xb1 |
128 | #define SEARCH_LOW_12 0xb2 | 132 | #define SEARCH_LOW_12 0xb2 |
133 | #define SECURITY_PROTOCOL_OUT 0xb5 | ||
129 | #define READ_ELEMENT_STATUS 0xb8 | 134 | #define READ_ELEMENT_STATUS 0xb8 |
130 | #define SEND_VOLUME_TAG 0xb6 | 135 | #define SEND_VOLUME_TAG 0xb6 |
131 | #define WRITE_LONG_2 0xea | 136 | #define WRITE_LONG_2 0xea |
137 | #define EXTENDED_COPY 0x83 | ||
138 | #define RECEIVE_COPY_RESULTS 0x84 | ||
139 | #define ACCESS_CONTROL_IN 0x86 | ||
140 | #define ACCESS_CONTROL_OUT 0x87 | ||
132 | #define READ_16 0x88 | 141 | #define READ_16 0x88 |
133 | #define WRITE_16 0x8a | 142 | #define WRITE_16 0x8a |
143 | #define READ_ATTRIBUTE 0x8c | ||
144 | #define WRITE_ATTRIBUTE 0x8d | ||
134 | #define VERIFY_16 0x8f | 145 | #define VERIFY_16 0x8f |
135 | #define WRITE_SAME_16 0x93 | 146 | #define WRITE_SAME_16 0x93 |
136 | #define SERVICE_ACTION_IN 0x9e | 147 | #define SERVICE_ACTION_IN 0x9e |
137 | /* values for service action in */ | 148 | /* values for service action in */ |
138 | #define SAI_READ_CAPACITY_16 0x10 | 149 | #define SAI_READ_CAPACITY_16 0x10 |
139 | #define SAI_GET_LBA_STATUS 0x12 | 150 | #define SAI_GET_LBA_STATUS 0x12 |
151 | /* values for VARIABLE_LENGTH_CMD service action codes | ||
152 | * see spc4r17 Section D.3.5, table D.7 and D.8 */ | ||
153 | #define VLC_SA_RECEIVE_CREDENTIAL 0x1800 | ||
140 | /* values for maintenance in */ | 154 | /* values for maintenance in */ |
155 | #define MI_REPORT_IDENTIFYING_INFORMATION 0x05 | ||
141 | #define MI_REPORT_TARGET_PGS 0x0a | 156 | #define MI_REPORT_TARGET_PGS 0x0a |
157 | #define MI_REPORT_ALIASES 0x0b | ||
158 | #define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c | ||
159 | #define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d | ||
160 | #define MI_REPORT_PRIORITY 0x0e | ||
161 | #define MI_REPORT_TIMESTAMP 0x0f | ||
162 | #define MI_MANAGEMENT_PROTOCOL_IN 0x10 | ||
142 | /* values for maintenance out */ | 163 | /* values for maintenance out */ |
164 | #define MO_SET_IDENTIFYING_INFORMATION 0x06 | ||
143 | #define MO_SET_TARGET_PGS 0x0a | 165 | #define MO_SET_TARGET_PGS 0x0a |
166 | #define MO_CHANGE_ALIASES 0x0b | ||
167 | #define MO_SET_PRIORITY 0x0e | ||
168 | #define MO_SET_TIMESTAMP 0x0f | ||
169 | #define MO_MANAGEMENT_PROTOCOL_OUT 0x10 | ||
144 | /* values for variable length command */ | 170 | /* values for variable length command */ |
171 | #define XDREAD_32 0x03 | ||
172 | #define XDWRITE_32 0x04 | ||
173 | #define XPWRITE_32 0x06 | ||
174 | #define XDWRITEREAD_32 0x07 | ||
145 | #define READ_32 0x09 | 175 | #define READ_32 0x09 |
146 | #define VERIFY_32 0x0a | 176 | #define VERIFY_32 0x0a |
147 | #define WRITE_32 0x0b | 177 | #define WRITE_32 0x0b |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 49400459b477..b602f475cdbb 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -477,7 +477,7 @@ struct snd_ac97_template { | |||
477 | 477 | ||
478 | struct snd_ac97 { | 478 | struct snd_ac97 { |
479 | /* -- lowlevel (hardware) driver specific -- */ | 479 | /* -- lowlevel (hardware) driver specific -- */ |
480 | struct snd_ac97_build_ops * build_ops; | 480 | const struct snd_ac97_build_ops *build_ops; |
481 | void *private_data; | 481 | void *private_data; |
482 | void (*private_free) (struct snd_ac97 *ac97); | 482 | void (*private_free) (struct snd_ac97 *ac97); |
483 | /* --- */ | 483 | /* --- */ |
diff --git a/include/sound/alc5623.h b/include/sound/alc5623.h new file mode 100644 index 000000000000..422c97d43df3 --- /dev/null +++ b/include/sound/alc5623.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _INCLUDE_SOUND_ALC5623_H | ||
2 | #define _INCLUDE_SOUND_ALC5623_H | ||
3 | struct alc5623_platform_data { | ||
4 | /* configure : */ | ||
5 | /* Lineout/Speaker Amps Vmid ratio control */ | ||
6 | /* enable/disable adc/dac high pass filters */ | ||
7 | unsigned int add_ctrl; | ||
8 | /* configure : */ | ||
9 | /* output to enable when jack is low */ | ||
10 | /* output to enable when jack is high */ | ||
11 | /* jack detect (gpio/nc/jack detect [12] */ | ||
12 | unsigned int jack_det_ctrl; | ||
13 | }; | ||
14 | #endif | ||
15 | |||
diff --git a/include/sound/asound.h b/include/sound/asound.h index a1803ecea34d..5d6074faa279 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | 259 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ |
260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 260 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 261 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
262 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | ||
262 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | 263 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
263 | 264 | ||
264 | typedef int __bitwise snd_pcm_state_t; | 265 | typedef int __bitwise snd_pcm_state_t; |
@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t; | |||
334 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | 335 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME |
335 | 336 | ||
336 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | 337 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
338 | #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ | ||
339 | #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ | ||
337 | 340 | ||
338 | struct snd_interval { | 341 | struct snd_interval { |
339 | unsigned int min, max; | 342 | unsigned int min, max; |
diff --git a/include/sound/control.h b/include/sound/control.h index 112374dc0c58..7715e6f00d38 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -160,12 +160,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id | |||
160 | } | 160 | } |
161 | 161 | ||
162 | /* | 162 | /* |
163 | * Frequently used control callbacks | 163 | * Frequently used control callbacks/helpers |
164 | */ | 164 | */ |
165 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, | 165 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, |
166 | struct snd_ctl_elem_info *uinfo); | 166 | struct snd_ctl_elem_info *uinfo); |
167 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, | 167 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, |
168 | struct snd_ctl_elem_info *uinfo); | 168 | struct snd_ctl_elem_info *uinfo); |
169 | int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, | ||
170 | unsigned int items, const char *const names[]); | ||
169 | 171 | ||
170 | /* | 172 | /* |
171 | * virtual master control | 173 | * virtual master control |
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h index d98a78dff2db..0909a3843479 100644 --- a/include/sound/hdsp.h +++ b/include/sound/hdsp.h | |||
@@ -28,6 +28,7 @@ enum HDSP_IO_Type { | |||
28 | Multiface, | 28 | Multiface, |
29 | H9652, | 29 | H9652, |
30 | H9632, | 30 | H9632, |
31 | RPM, | ||
31 | Undefined, | 32 | Undefined, |
32 | }; | 33 | }; |
33 | 34 | ||
diff --git a/include/sound/minors.h b/include/sound/minors.h index a81798ab73ed..8f764204a856 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h | |||
@@ -31,8 +31,8 @@ | |||
31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ | 31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ |
32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ | 32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ |
33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ | 33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ |
34 | #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) | 34 | #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */ |
35 | #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) | 35 | #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ |
36 | 36 | ||
37 | #ifndef CONFIG_SND_DYNAMIC_MINORS | 37 | #ifndef CONFIG_SND_DYNAMIC_MINORS |
38 | /* 2 - 3 (reserved) */ | 38 | /* 2 - 3 (reserved) */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index dfd9b76b1853..e731f8d71934 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -297,6 +297,7 @@ struct snd_pcm_runtime { | |||
297 | unsigned int info; | 297 | unsigned int info; |
298 | unsigned int rate_num; | 298 | unsigned int rate_num; |
299 | unsigned int rate_den; | 299 | unsigned int rate_den; |
300 | unsigned int no_period_wakeup: 1; | ||
300 | 301 | ||
301 | /* -- SW params -- */ | 302 | /* -- SW params -- */ |
302 | int tstamp_mode; /* mmap timestamp is updated */ | 303 | int tstamp_mode; /* mmap timestamp is updated */ |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index e7b680248006..1bafe95dcf41 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | 18 | ||
19 | #include <sound/soc.h> | ||
20 | |||
21 | struct snd_pcm_substream; | 19 | struct snd_pcm_substream; |
22 | 20 | ||
23 | /* | 21 | /* |
@@ -205,7 +203,7 @@ struct snd_soc_dai_driver { | |||
205 | int (*resume)(struct snd_soc_dai *dai); | 203 | int (*resume)(struct snd_soc_dai *dai); |
206 | 204 | ||
207 | /* ops */ | 205 | /* ops */ |
208 | struct snd_soc_dai_ops *ops; | 206 | const struct snd_soc_dai_ops *ops; |
209 | 207 | ||
210 | /* DAI capabilities */ | 208 | /* DAI capabilities */ |
211 | struct snd_soc_pcm_stream capture; | 209 | struct snd_soc_pcm_stream capture; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 8fd3b41b763f..8031769ac485 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <sound/control.h> | 18 | #include <sound/control.h> |
19 | #include <sound/soc.h> | ||
20 | 19 | ||
21 | /* widget has no PM register bit */ | 20 | /* widget has no PM register bit */ |
22 | #define SND_SOC_NOPM -1 | 21 | #define SND_SOC_NOPM -1 |
@@ -72,6 +71,10 @@ | |||
72 | wcontrols, wncontrols) \ | 71 | wcontrols, wncontrols) \ |
73 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 72 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
74 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 73 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} |
74 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ | ||
75 | wcontrols, wncontrols) \ | ||
76 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | ||
77 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | ||
75 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ | 78 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ |
76 | wcontrols, wncontrols)\ | 79 | wcontrols, wncontrols)\ |
77 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 80 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
@@ -90,6 +93,9 @@ | |||
90 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
91 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
92 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 95 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} |
96 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | ||
97 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
98 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | ||
93 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 99 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
94 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 100 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ |
95 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 101 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ |
@@ -116,6 +122,11 @@ | |||
116 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 122 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
117 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 123 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ |
118 | .event = wevent, .event_flags = wflags} | 124 | .event = wevent, .event_flags = wflags} |
125 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ | ||
126 | wncontrols, wevent, wflags) \ | ||
127 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | ||
128 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | ||
129 | .event = wevent, .event_flags = wflags} | ||
119 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ | 130 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ |
120 | wncontrols, wevent, wflags) \ | 131 | wncontrols, wevent, wflags) \ |
121 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 132 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
@@ -140,6 +151,11 @@ | |||
140 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
141 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 152 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ |
142 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | ||
155 | wevent, wflags) \ | ||
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | ||
157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | ||
158 | .event = wevent, .event_flags = wflags} | ||
143 | 159 | ||
144 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 160 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
145 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 161 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
@@ -219,13 +235,6 @@ | |||
219 | .info = snd_soc_info_volsw, \ | 235 | .info = snd_soc_info_volsw, \ |
220 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 236 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
221 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 237 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
222 | #define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \ | ||
223 | power) \ | ||
224 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
225 | .info = snd_soc_info_volsw, \ | ||
226 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
227 | .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ | ||
228 | ((max) << 16) | ((invert) << 24) } | ||
229 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 238 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
230 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 239 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
231 | .info = snd_soc_info_volsw, \ | 240 | .info = snd_soc_info_volsw, \ |
@@ -233,15 +242,6 @@ | |||
233 | .tlv.p = (tlv_array), \ | 242 | .tlv.p = (tlv_array), \ |
234 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 243 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
235 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 244 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
236 | #define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \ | ||
237 | power, tlv_array) \ | ||
238 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
239 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
240 | .tlv.p = (tlv_array), \ | ||
241 | .info = snd_soc_info_volsw, \ | ||
242 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
243 | .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ | ||
244 | ((max) << 16) | ((invert) << 24) } | ||
245 | #define SOC_DAPM_ENUM(xname, xenum) \ | 245 | #define SOC_DAPM_ENUM(xname, xenum) \ |
246 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 246 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
247 | .info = snd_soc_info_enum_double, \ | 247 | .info = snd_soc_info_enum_double, \ |
@@ -297,6 +297,7 @@ enum snd_soc_dapm_type; | |||
297 | struct snd_soc_dapm_path; | 297 | struct snd_soc_dapm_path; |
298 | struct snd_soc_dapm_pin; | 298 | struct snd_soc_dapm_pin; |
299 | struct snd_soc_dapm_route; | 299 | struct snd_soc_dapm_route; |
300 | struct snd_soc_dapm_context; | ||
300 | 301 | ||
301 | int dapm_reg_event(struct snd_soc_dapm_widget *w, | 302 | int dapm_reg_event(struct snd_soc_dapm_widget *w, |
302 | struct snd_kcontrol *kcontrol, int event); | 303 | struct snd_kcontrol *kcontrol, int event); |
@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, | |||
324 | struct snd_ctl_elem_value *uncontrol); | 325 | struct snd_ctl_elem_value *uncontrol); |
325 | int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, | 326 | int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, |
326 | struct snd_ctl_elem_value *uncontrol); | 327 | struct snd_ctl_elem_value *uncontrol); |
327 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, | 328 | int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, |
328 | const struct snd_soc_dapm_widget *widget); | 329 | const struct snd_soc_dapm_widget *widget); |
329 | int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | 330 | int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, |
330 | const struct snd_soc_dapm_widget *widget, | 331 | const struct snd_soc_dapm_widget *widget, |
331 | int num); | 332 | int num); |
332 | 333 | ||
333 | /* dapm path setup */ | 334 | /* dapm path setup */ |
334 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 335 | int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); |
335 | void snd_soc_dapm_free(struct snd_soc_codec *codec); | 336 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); |
336 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | 337 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, |
337 | const struct snd_soc_dapm_route *route, int num); | 338 | const struct snd_soc_dapm_route *route, int num); |
338 | 339 | ||
339 | /* dapm events */ | 340 | /* dapm events */ |
@@ -343,27 +344,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); | |||
343 | 344 | ||
344 | /* dapm sys fs - used by the core */ | 345 | /* dapm sys fs - used by the core */ |
345 | int snd_soc_dapm_sys_add(struct device *dev); | 346 | int snd_soc_dapm_sys_add(struct device *dev); |
346 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | 347 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); |
347 | 348 | ||
348 | /* dapm audio pin control and status */ | 349 | /* dapm audio pin control and status */ |
349 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 350 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, |
350 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); | 351 | const char *pin); |
351 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); | 352 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, |
352 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); | 353 | const char *pin); |
353 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 354 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); |
354 | int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, | 355 | int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, |
356 | const char *pin); | ||
357 | int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); | ||
358 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | ||
355 | const char *pin); | 359 | const char *pin); |
356 | int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); | 360 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
361 | const char *pin); | ||
357 | 362 | ||
358 | /* dapm widget types */ | 363 | /* dapm widget types */ |
359 | enum snd_soc_dapm_type { | 364 | enum snd_soc_dapm_type { |
360 | snd_soc_dapm_input = 0, /* input pin */ | 365 | snd_soc_dapm_input = 0, /* input pin */ |
361 | snd_soc_dapm_output, /* output pin */ | 366 | snd_soc_dapm_output, /* output pin */ |
362 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ | 367 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ |
368 | snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */ | ||
363 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ | 369 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ |
364 | snd_soc_dapm_mixer, /* mixes several analog signals together */ | 370 | snd_soc_dapm_mixer, /* mixes several analog signals together */ |
365 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ | 371 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ |
366 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ | 372 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ |
373 | snd_soc_dapm_out_drv, /* output driver */ | ||
367 | snd_soc_dapm_adc, /* analog to digital converter */ | 374 | snd_soc_dapm_adc, /* analog to digital converter */ |
368 | snd_soc_dapm_dac, /* digital to analog converter */ | 375 | snd_soc_dapm_dac, /* digital to analog converter */ |
369 | snd_soc_dapm_micbias, /* microphone bias (power) */ | 376 | snd_soc_dapm_micbias, /* microphone bias (power) */ |
@@ -425,6 +432,7 @@ struct snd_soc_dapm_widget { | |||
425 | char *sname; /* stream name */ | 432 | char *sname; /* stream name */ |
426 | struct snd_soc_codec *codec; | 433 | struct snd_soc_codec *codec; |
427 | struct list_head list; | 434 | struct list_head list; |
435 | struct snd_soc_dapm_context *dapm; | ||
428 | 436 | ||
429 | /* dapm control */ | 437 | /* dapm control */ |
430 | short reg; /* negative reg = no direct dapm */ | 438 | short reg; /* negative reg = no direct dapm */ |
@@ -461,4 +469,35 @@ struct snd_soc_dapm_widget { | |||
461 | struct list_head power_list; | 469 | struct list_head power_list; |
462 | }; | 470 | }; |
463 | 471 | ||
472 | struct snd_soc_dapm_update { | ||
473 | struct snd_soc_dapm_widget *widget; | ||
474 | struct snd_kcontrol *kcontrol; | ||
475 | int reg; | ||
476 | int mask; | ||
477 | int val; | ||
478 | }; | ||
479 | |||
480 | /* DAPM context */ | ||
481 | struct snd_soc_dapm_context { | ||
482 | int n_widgets; /* number of widgets in this context */ | ||
483 | enum snd_soc_bias_level bias_level; | ||
484 | enum snd_soc_bias_level suspend_bias_level; | ||
485 | struct delayed_work delayed_work; | ||
486 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | ||
487 | |||
488 | struct snd_soc_dapm_update *update; | ||
489 | |||
490 | struct device *dev; /* from parent - for debug */ | ||
491 | struct snd_soc_codec *codec; /* parent codec */ | ||
492 | struct snd_soc_card *card; /* parent card */ | ||
493 | |||
494 | /* used during DAPM updates */ | ||
495 | int dev_power; | ||
496 | struct list_head list; | ||
497 | |||
498 | #ifdef CONFIG_DEBUG_FS | ||
499 | struct dentry *debugfs_dapm; | ||
500 | #endif | ||
501 | }; | ||
502 | |||
464 | #endif | 503 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 5c3bce83f28a..74921f20a1d8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -222,10 +222,8 @@ enum snd_soc_bias_level { | |||
222 | 222 | ||
223 | struct snd_jack; | 223 | struct snd_jack; |
224 | struct snd_soc_card; | 224 | struct snd_soc_card; |
225 | struct snd_soc_device; | ||
226 | struct snd_soc_pcm_stream; | 225 | struct snd_soc_pcm_stream; |
227 | struct snd_soc_ops; | 226 | struct snd_soc_ops; |
228 | struct snd_soc_dai_mode; | ||
229 | struct snd_soc_pcm_runtime; | 227 | struct snd_soc_pcm_runtime; |
230 | struct snd_soc_dai; | 228 | struct snd_soc_dai; |
231 | struct snd_soc_dai_driver; | 229 | struct snd_soc_dai_driver; |
@@ -235,9 +233,10 @@ struct snd_soc_platform_driver; | |||
235 | struct snd_soc_codec; | 233 | struct snd_soc_codec; |
236 | struct snd_soc_codec_driver; | 234 | struct snd_soc_codec_driver; |
237 | struct soc_enum; | 235 | struct soc_enum; |
238 | struct snd_soc_ac97_ops; | ||
239 | struct snd_soc_jack; | 236 | struct snd_soc_jack; |
240 | struct snd_soc_jack_pin; | 237 | struct snd_soc_jack_pin; |
238 | struct snd_soc_cache_ops; | ||
239 | #include <sound/soc-dapm.h> | ||
241 | 240 | ||
242 | #ifdef CONFIG_GPIOLIB | 241 | #ifdef CONFIG_GPIOLIB |
243 | struct snd_soc_jack_gpio; | 242 | struct snd_soc_jack_gpio; |
@@ -253,17 +252,30 @@ enum snd_soc_control_type { | |||
253 | SND_SOC_SPI, | 252 | SND_SOC_SPI, |
254 | }; | 253 | }; |
255 | 254 | ||
255 | enum snd_soc_compress_type { | ||
256 | SND_SOC_FLAT_COMPRESSION = 1, | ||
257 | SND_SOC_LZO_COMPRESSION, | ||
258 | SND_SOC_RBTREE_COMPRESSION | ||
259 | }; | ||
260 | |||
256 | int snd_soc_register_platform(struct device *dev, | 261 | int snd_soc_register_platform(struct device *dev, |
257 | struct snd_soc_platform_driver *platform_drv); | 262 | struct snd_soc_platform_driver *platform_drv); |
258 | void snd_soc_unregister_platform(struct device *dev); | 263 | void snd_soc_unregister_platform(struct device *dev); |
259 | int snd_soc_register_codec(struct device *dev, | 264 | int snd_soc_register_codec(struct device *dev, |
260 | struct snd_soc_codec_driver *codec_drv, | 265 | const struct snd_soc_codec_driver *codec_drv, |
261 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 266 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
262 | void snd_soc_unregister_codec(struct device *dev); | 267 | void snd_soc_unregister_codec(struct device *dev); |
263 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | 268 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); |
264 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 269 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
265 | int addr_bits, int data_bits, | 270 | int addr_bits, int data_bits, |
266 | enum snd_soc_control_type control); | 271 | enum snd_soc_control_type control); |
272 | int snd_soc_cache_sync(struct snd_soc_codec *codec); | ||
273 | int snd_soc_cache_init(struct snd_soc_codec *codec); | ||
274 | int snd_soc_cache_exit(struct snd_soc_codec *codec); | ||
275 | int snd_soc_cache_write(struct snd_soc_codec *codec, | ||
276 | unsigned int reg, unsigned int value); | ||
277 | int snd_soc_cache_read(struct snd_soc_codec *codec, | ||
278 | unsigned int reg, unsigned int *value); | ||
267 | 279 | ||
268 | /* Utility functions to get clock rates from various things */ | 280 | /* Utility functions to get clock rates from various things */ |
269 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 281 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -420,23 +432,37 @@ struct snd_soc_ops { | |||
420 | int (*trigger)(struct snd_pcm_substream *, int); | 432 | int (*trigger)(struct snd_pcm_substream *, int); |
421 | }; | 433 | }; |
422 | 434 | ||
435 | /* SoC cache ops */ | ||
436 | struct snd_soc_cache_ops { | ||
437 | const char *name; | ||
438 | enum snd_soc_compress_type id; | ||
439 | int (*init)(struct snd_soc_codec *codec); | ||
440 | int (*exit)(struct snd_soc_codec *codec); | ||
441 | int (*read)(struct snd_soc_codec *codec, unsigned int reg, | ||
442 | unsigned int *value); | ||
443 | int (*write)(struct snd_soc_codec *codec, unsigned int reg, | ||
444 | unsigned int value); | ||
445 | int (*sync)(struct snd_soc_codec *codec); | ||
446 | }; | ||
447 | |||
423 | /* SoC Audio Codec device */ | 448 | /* SoC Audio Codec device */ |
424 | struct snd_soc_codec { | 449 | struct snd_soc_codec { |
425 | const char *name; | 450 | const char *name; |
451 | const char *name_prefix; | ||
426 | int id; | 452 | int id; |
427 | struct device *dev; | 453 | struct device *dev; |
428 | struct snd_soc_codec_driver *driver; | 454 | const struct snd_soc_codec_driver *driver; |
429 | 455 | ||
430 | struct mutex mutex; | 456 | struct mutex mutex; |
431 | struct snd_soc_card *card; | 457 | struct snd_soc_card *card; |
432 | struct list_head list; | 458 | struct list_head list; |
433 | struct list_head card_list; | 459 | struct list_head card_list; |
434 | int num_dai; | 460 | int num_dai; |
461 | enum snd_soc_compress_type compress_type; | ||
435 | 462 | ||
436 | /* runtime */ | 463 | /* runtime */ |
437 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 464 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
438 | unsigned int active; | 465 | unsigned int active; |
439 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | ||
440 | unsigned int cache_only:1; /* Suppress writes to hardware */ | 466 | unsigned int cache_only:1; /* Suppress writes to hardware */ |
441 | unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ | 467 | unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ |
442 | unsigned int suspended:1; /* Codec is in suspend PM state */ | 468 | unsigned int suspended:1; /* Codec is in suspend PM state */ |
@@ -444,25 +470,25 @@ struct snd_soc_codec { | |||
444 | unsigned int ac97_registered:1; /* Codec has been AC97 registered */ | 470 | unsigned int ac97_registered:1; /* Codec has been AC97 registered */ |
445 | unsigned int ac97_created:1; /* Codec has been created by SoC */ | 471 | unsigned int ac97_created:1; /* Codec has been created by SoC */ |
446 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ | 472 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ |
473 | unsigned int cache_init:1; /* codec cache has been initialized */ | ||
447 | 474 | ||
448 | /* codec IO */ | 475 | /* codec IO */ |
449 | void *control_data; /* codec control (i2c/3wire) data */ | 476 | void *control_data; /* codec control (i2c/3wire) data */ |
450 | hw_write_t hw_write; | 477 | hw_write_t hw_write; |
451 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); | 478 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
479 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | ||
480 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | ||
452 | void *reg_cache; | 481 | void *reg_cache; |
482 | const void *reg_def_copy; | ||
483 | const struct snd_soc_cache_ops *cache_ops; | ||
484 | struct mutex cache_rw_mutex; | ||
453 | 485 | ||
454 | /* dapm */ | 486 | /* dapm */ |
455 | u32 pop_time; | 487 | struct snd_soc_dapm_context dapm; |
456 | struct list_head dapm_widgets; | ||
457 | struct list_head dapm_paths; | ||
458 | enum snd_soc_bias_level bias_level; | ||
459 | enum snd_soc_bias_level suspend_bias_level; | ||
460 | struct delayed_work delayed_work; | ||
461 | 488 | ||
462 | #ifdef CONFIG_DEBUG_FS | 489 | #ifdef CONFIG_DEBUG_FS |
463 | struct dentry *debugfs_codec_root; | 490 | struct dentry *debugfs_codec_root; |
464 | struct dentry *debugfs_reg; | 491 | struct dentry *debugfs_reg; |
465 | struct dentry *debugfs_pop_time; | ||
466 | struct dentry *debugfs_dapm; | 492 | struct dentry *debugfs_dapm; |
467 | #endif | 493 | #endif |
468 | }; | 494 | }; |
@@ -488,6 +514,7 @@ struct snd_soc_codec_driver { | |||
488 | short reg_cache_step; | 514 | short reg_cache_step; |
489 | short reg_word_size; | 515 | short reg_word_size; |
490 | const void *reg_cache_default; | 516 | const void *reg_cache_default; |
517 | enum snd_soc_compress_type compress_type; | ||
491 | 518 | ||
492 | /* codec bias level */ | 519 | /* codec bias level */ |
493 | int (*set_bias_level)(struct snd_soc_codec *, | 520 | int (*set_bias_level)(struct snd_soc_codec *, |
@@ -554,6 +581,30 @@ struct snd_soc_dai_link { | |||
554 | struct snd_soc_ops *ops; | 581 | struct snd_soc_ops *ops; |
555 | }; | 582 | }; |
556 | 583 | ||
584 | struct snd_soc_codec_conf { | ||
585 | const char *dev_name; | ||
586 | |||
587 | /* | ||
588 | * optional map of kcontrol, widget and path name prefixes that are | ||
589 | * associated per device | ||
590 | */ | ||
591 | const char *name_prefix; | ||
592 | |||
593 | /* | ||
594 | * set this to the desired compression type if you want to | ||
595 | * override the one supplied in codec->driver->compress_type | ||
596 | */ | ||
597 | enum snd_soc_compress_type compress_type; | ||
598 | }; | ||
599 | |||
600 | struct snd_soc_aux_dev { | ||
601 | const char *name; /* Codec name */ | ||
602 | const char *codec_name; /* for multi-codec */ | ||
603 | |||
604 | /* codec/machine specific init - e.g. add machine controls */ | ||
605 | int (*init)(struct snd_soc_dapm_context *dapm); | ||
606 | }; | ||
607 | |||
557 | /* SoC card */ | 608 | /* SoC card */ |
558 | struct snd_soc_card { | 609 | struct snd_soc_card { |
559 | const char *name; | 610 | const char *name; |
@@ -579,6 +630,8 @@ struct snd_soc_card { | |||
579 | /* callbacks */ | 630 | /* callbacks */ |
580 | int (*set_bias_level)(struct snd_soc_card *, | 631 | int (*set_bias_level)(struct snd_soc_card *, |
581 | enum snd_soc_bias_level level); | 632 | enum snd_soc_bias_level level); |
633 | int (*set_bias_level_post)(struct snd_soc_card *, | ||
634 | enum snd_soc_bias_level level); | ||
582 | 635 | ||
583 | long pmdown_time; | 636 | long pmdown_time; |
584 | 637 | ||
@@ -588,12 +641,35 @@ struct snd_soc_card { | |||
588 | struct snd_soc_pcm_runtime *rtd; | 641 | struct snd_soc_pcm_runtime *rtd; |
589 | int num_rtd; | 642 | int num_rtd; |
590 | 643 | ||
644 | /* optional codec specific configuration */ | ||
645 | struct snd_soc_codec_conf *codec_conf; | ||
646 | int num_configs; | ||
647 | |||
648 | /* | ||
649 | * optional auxiliary devices such as amplifiers or codecs with DAI | ||
650 | * link unused | ||
651 | */ | ||
652 | struct snd_soc_aux_dev *aux_dev; | ||
653 | int num_aux_devs; | ||
654 | struct snd_soc_pcm_runtime *rtd_aux; | ||
655 | int num_aux_rtd; | ||
656 | |||
591 | struct work_struct deferred_resume_work; | 657 | struct work_struct deferred_resume_work; |
592 | 658 | ||
593 | /* lists of probed devices belonging to this card */ | 659 | /* lists of probed devices belonging to this card */ |
594 | struct list_head codec_dev_list; | 660 | struct list_head codec_dev_list; |
595 | struct list_head platform_dev_list; | 661 | struct list_head platform_dev_list; |
596 | struct list_head dai_dev_list; | 662 | struct list_head dai_dev_list; |
663 | |||
664 | struct list_head widgets; | ||
665 | struct list_head paths; | ||
666 | struct list_head dapm_list; | ||
667 | |||
668 | #ifdef CONFIG_DEBUG_FS | ||
669 | struct dentry *debugfs_card_root; | ||
670 | struct dentry *debugfs_pop_time; | ||
671 | #endif | ||
672 | u32 pop_time; | ||
597 | }; | 673 | }; |
598 | 674 | ||
599 | /* SoC machine DAI configuration, glues a codec and cpu DAI together */ | 675 | /* SoC machine DAI configuration, glues a codec and cpu DAI together */ |
@@ -639,17 +715,9 @@ struct soc_enum { | |||
639 | }; | 715 | }; |
640 | 716 | ||
641 | /* codec IO */ | 717 | /* codec IO */ |
642 | static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, | 718 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
643 | unsigned int reg) | 719 | unsigned int snd_soc_write(struct snd_soc_codec *codec, |
644 | { | 720 | unsigned int reg, unsigned int val); |
645 | return codec->driver->read(codec, reg); | ||
646 | } | ||
647 | |||
648 | static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | ||
649 | unsigned int reg, unsigned int val) | ||
650 | { | ||
651 | return codec->driver->write(codec, reg, val); | ||
652 | } | ||
653 | 721 | ||
654 | /* device driver data */ | 722 | /* device driver data */ |
655 | 723 | ||
diff --git a/include/target/configfs_macros.h b/include/target/configfs_macros.h new file mode 100644 index 000000000000..7fe74608b437 --- /dev/null +++ b/include/target/configfs_macros.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
3 | * | ||
4 | * configfs_macros.h - extends macros for configfs | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public | ||
8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public | ||
17 | * License along with this program; if not, write to the | ||
18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
19 | * Boston, MA 021110-1307, USA. | ||
20 | * | ||
21 | * Based on sysfs: | ||
22 | * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel | ||
23 | * | ||
24 | * Based on kobject.h: | ||
25 | * Copyright (c) 2002-2003 Patrick Mochel | ||
26 | * Copyright (c) 2002-2003 Open Source Development Labs | ||
27 | * | ||
28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | ||
29 | * | ||
30 | * Added CONFIGFS_EATTR() macros from original configfs.h macros | ||
31 | * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org> | ||
32 | * | ||
33 | * Please read Documentation/filesystems/configfs.txt before using the | ||
34 | * configfs interface, ESPECIALLY the parts about reference counts and | ||
35 | * item destructors. | ||
36 | */ | ||
37 | |||
38 | #ifndef _CONFIGFS_MACROS_H_ | ||
39 | #define _CONFIGFS_MACROS_H_ | ||
40 | |||
41 | #include <linux/configfs.h> | ||
42 | |||
43 | /* | ||
44 | * Users often need to create attribute structures for their configurable | ||
45 | * attributes, containing a configfs_attribute member and function pointers | ||
46 | * for the show() and store() operations on that attribute. If they don't | ||
47 | * need anything else on the extended attribute structure, they can use | ||
48 | * this macro to define it. The argument _name isends up as | ||
49 | * 'struct _name_attribute, as well as names of to CONFIGFS_ATTR_OPS() below. | ||
50 | * The argument _item is the name of the structure containing the | ||
51 | * struct config_item or struct config_group structure members | ||
52 | */ | ||
53 | #define CONFIGFS_EATTR_STRUCT(_name, _item) \ | ||
54 | struct _name##_attribute { \ | ||
55 | struct configfs_attribute attr; \ | ||
56 | ssize_t (*show)(struct _item *, char *); \ | ||
57 | ssize_t (*store)(struct _item *, const char *, size_t); \ | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * With the extended attribute structure, users can use this macro | ||
62 | * (similar to sysfs' __ATTR) to make defining attributes easier. | ||
63 | * An example: | ||
64 | * #define MYITEM_EATTR(_name, _mode, _show, _store) \ | ||
65 | * struct myitem_attribute childless_attr_##_name = \ | ||
66 | * __CONFIGFS_EATTR(_name, _mode, _show, _store) | ||
67 | */ | ||
68 | #define __CONFIGFS_EATTR(_name, _mode, _show, _store) \ | ||
69 | { \ | ||
70 | .attr = { \ | ||
71 | .ca_name = __stringify(_name), \ | ||
72 | .ca_mode = _mode, \ | ||
73 | .ca_owner = THIS_MODULE, \ | ||
74 | }, \ | ||
75 | .show = _show, \ | ||
76 | .store = _store, \ | ||
77 | } | ||
78 | /* Here is a readonly version, only requiring a show() operation */ | ||
79 | #define __CONFIGFS_EATTR_RO(_name, _show) \ | ||
80 | { \ | ||
81 | .attr = { \ | ||
82 | .ca_name = __stringify(_name), \ | ||
83 | .ca_mode = 0444, \ | ||
84 | .ca_owner = THIS_MODULE, \ | ||
85 | }, \ | ||
86 | .show = _show, \ | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * With these extended attributes, the simple show_attribute() and | ||
91 | * store_attribute() operations need to call the show() and store() of the | ||
92 | * attributes. This is a common pattern, so we provide a macro to define | ||
93 | * them. The argument _name is the name of the attribute defined by | ||
94 | * CONFIGFS_ATTR_STRUCT(). The argument _item is the name of the structure | ||
95 | * containing the struct config_item or struct config_group structure member. | ||
96 | * The argument _item_member is the actual name of the struct config_* struct | ||
97 | * in your _item structure. Meaning my_structure->some_config_group. | ||
98 | * ^^_item^^^^^ ^^_item_member^^^ | ||
99 | * This macro expects the attributes to be named "struct <name>_attribute". | ||
100 | */ | ||
101 | #define CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member) \ | ||
102 | static struct _item *to_##_name(struct config_item *ci) \ | ||
103 | { \ | ||
104 | return (ci) ? container_of(to_config_group(ci), struct _item, \ | ||
105 | _item_member) : NULL; \ | ||
106 | } | ||
107 | |||
108 | #define CONFIGFS_EATTR_OPS_SHOW(_name, _item) \ | ||
109 | static ssize_t _name##_attr_show(struct config_item *item, \ | ||
110 | struct configfs_attribute *attr, \ | ||
111 | char *page) \ | ||
112 | { \ | ||
113 | struct _item *_item = to_##_name(item); \ | ||
114 | struct _name##_attribute * _name##_attr = \ | ||
115 | container_of(attr, struct _name##_attribute, attr); \ | ||
116 | ssize_t ret = 0; \ | ||
117 | \ | ||
118 | if (_name##_attr->show) \ | ||
119 | ret = _name##_attr->show(_item, page); \ | ||
120 | return ret; \ | ||
121 | } | ||
122 | |||
123 | #define CONFIGFS_EATTR_OPS_STORE(_name, _item) \ | ||
124 | static ssize_t _name##_attr_store(struct config_item *item, \ | ||
125 | struct configfs_attribute *attr, \ | ||
126 | const char *page, size_t count) \ | ||
127 | { \ | ||
128 | struct _item *_item = to_##_name(item); \ | ||
129 | struct _name##_attribute * _name##_attr = \ | ||
130 | container_of(attr, struct _name##_attribute, attr); \ | ||
131 | ssize_t ret = -EINVAL; \ | ||
132 | \ | ||
133 | if (_name##_attr->store) \ | ||
134 | ret = _name##_attr->store(_item, page, count); \ | ||
135 | return ret; \ | ||
136 | } | ||
137 | |||
138 | #define CONFIGFS_EATTR_OPS(_name, _item, _item_member) \ | ||
139 | CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \ | ||
140 | CONFIGFS_EATTR_OPS_SHOW(_name, _item); \ | ||
141 | CONFIGFS_EATTR_OPS_STORE(_name, _item); | ||
142 | |||
143 | #define CONFIGFS_EATTR_OPS_RO(_name, _item, _item_member) \ | ||
144 | CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \ | ||
145 | CONFIGFS_EATTR_OPS_SHOW(_name, _item); | ||
146 | |||
147 | #endif /* _CONFIGFS_MACROS_H_ */ | ||
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h new file mode 100644 index 000000000000..0828b6c8610a --- /dev/null +++ b/include/target/target_core_base.h | |||
@@ -0,0 +1,953 @@ | |||
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 | |||
12 | #define TARGET_CORE_MOD_VERSION "v4.0.0-rc6" | ||
13 | #define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) | ||
14 | |||
15 | /* Used by transport_generic_allocate_iovecs() */ | ||
16 | #define TRANSPORT_IOV_DATA_BUFFER 5 | ||
17 | /* Maximum Number of LUNs per Target Portal Group */ | ||
18 | #define TRANSPORT_MAX_LUNS_PER_TPG 256 | ||
19 | /* | ||
20 | * By default we use 32-byte CDBs in TCM Core and subsystem plugin code. | ||
21 | * | ||
22 | * Note that both include/scsi/scsi_cmnd.h:MAX_COMMAND_SIZE and | ||
23 | * include/linux/blkdev.h:BLOCK_MAX_CDB as of v2.6.36-rc4 still use | ||
24 | * 16-byte CDBs by default and require an extra allocation for | ||
25 | * 32-byte CDBs to becasue of legacy issues. | ||
26 | * | ||
27 | * Within TCM Core there are no such legacy limitiations, so we go ahead | ||
28 | * use 32-byte CDBs by default and use include/scsi/scsi.h:scsi_command_size() | ||
29 | * within all TCM Core and subsystem plugin code. | ||
30 | */ | ||
31 | #define TCM_MAX_COMMAND_SIZE 32 | ||
32 | /* | ||
33 | * From include/scsi/scsi_cmnd.h:SCSI_SENSE_BUFFERSIZE, currently | ||
34 | * defined 96, but the real limit is 252 (or 260 including the header) | ||
35 | */ | ||
36 | #define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE | ||
37 | /* Used by transport_send_check_condition_and_sense() */ | ||
38 | #define SPC_SENSE_KEY_OFFSET 2 | ||
39 | #define SPC_ASC_KEY_OFFSET 12 | ||
40 | #define SPC_ASCQ_KEY_OFFSET 13 | ||
41 | #define TRANSPORT_IQN_LEN 224 | ||
42 | /* Used by target_core_store_alua_lu_gp() and target_core_alua_lu_gp_show_attr_members() */ | ||
43 | #define LU_GROUP_NAME_BUF 256 | ||
44 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ | ||
45 | #define TG_PT_GROUP_NAME_BUF 256 | ||
46 | /* Used to parse VPD into struct t10_vpd */ | ||
47 | #define VPD_TMP_BUF_SIZE 128 | ||
48 | /* Used by transport_generic_cmd_sequencer() */ | ||
49 | #define READ_BLOCK_LEN 6 | ||
50 | #define READ_CAP_LEN 8 | ||
51 | #define READ_POSITION_LEN 20 | ||
52 | #define INQUIRY_LEN 36 | ||
53 | /* Used by transport_get_inquiry_vpd_serial() */ | ||
54 | #define INQUIRY_VPD_SERIAL_LEN 254 | ||
55 | /* Used by transport_get_inquiry_vpd_device_ident() */ | ||
56 | #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254 | ||
57 | |||
58 | /* struct se_hba->hba_flags */ | ||
59 | enum hba_flags_table { | ||
60 | HBA_FLAGS_INTERNAL_USE = 0x01, | ||
61 | HBA_FLAGS_PSCSI_MODE = 0x02, | ||
62 | }; | ||
63 | |||
64 | /* struct se_lun->lun_status */ | ||
65 | enum transport_lun_status_table { | ||
66 | TRANSPORT_LUN_STATUS_FREE = 0, | ||
67 | TRANSPORT_LUN_STATUS_ACTIVE = 1, | ||
68 | }; | ||
69 | |||
70 | /* struct se_portal_group->se_tpg_type */ | ||
71 | enum transport_tpg_type_table { | ||
72 | TRANSPORT_TPG_TYPE_NORMAL = 0, | ||
73 | TRANSPORT_TPG_TYPE_DISCOVERY = 1, | ||
74 | }; | ||
75 | |||
76 | /* Used for generate timer flags */ | ||
77 | enum timer_flags_table { | ||
78 | TF_RUNNING = 0x01, | ||
79 | TF_STOP = 0x02, | ||
80 | }; | ||
81 | |||
82 | /* Special transport agnostic struct se_cmd->t_states */ | ||
83 | enum transport_state_table { | ||
84 | TRANSPORT_NO_STATE = 0, | ||
85 | TRANSPORT_NEW_CMD = 1, | ||
86 | TRANSPORT_DEFERRED_CMD = 2, | ||
87 | TRANSPORT_WRITE_PENDING = 3, | ||
88 | TRANSPORT_PROCESS_WRITE = 4, | ||
89 | TRANSPORT_PROCESSING = 5, | ||
90 | TRANSPORT_COMPLETE_OK = 6, | ||
91 | TRANSPORT_COMPLETE_FAILURE = 7, | ||
92 | TRANSPORT_COMPLETE_TIMEOUT = 8, | ||
93 | TRANSPORT_PROCESS_TMR = 9, | ||
94 | TRANSPORT_TMR_COMPLETE = 10, | ||
95 | TRANSPORT_ISTATE_PROCESSING = 11, | ||
96 | TRANSPORT_ISTATE_PROCESSED = 12, | ||
97 | TRANSPORT_KILL = 13, | ||
98 | TRANSPORT_REMOVE = 14, | ||
99 | TRANSPORT_FREE = 15, | ||
100 | TRANSPORT_NEW_CMD_MAP = 16, | ||
101 | }; | ||
102 | |||
103 | /* Used for struct se_cmd->se_cmd_flags */ | ||
104 | enum se_cmd_flags_table { | ||
105 | SCF_SUPPORTED_SAM_OPCODE = 0x00000001, | ||
106 | SCF_TRANSPORT_TASK_SENSE = 0x00000002, | ||
107 | SCF_EMULATED_TASK_SENSE = 0x00000004, | ||
108 | SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, | ||
109 | SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, | ||
110 | SCF_SCSI_CONTROL_NONSG_IO_CDB = 0x00000020, | ||
111 | SCF_SCSI_NON_DATA_CDB = 0x00000040, | ||
112 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, | ||
113 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, | ||
114 | SCF_CMD_PASSTHROUGH_NOALLOC = 0x00000200, | ||
115 | SCF_SE_CMD_FAILED = 0x00000400, | ||
116 | SCF_SE_LUN_CMD = 0x00000800, | ||
117 | SCF_SE_ALLOW_EOO = 0x00001000, | ||
118 | SCF_SE_DISABLE_ONLINE_CHECK = 0x00002000, | ||
119 | SCF_SENT_CHECK_CONDITION = 0x00004000, | ||
120 | SCF_OVERFLOW_BIT = 0x00008000, | ||
121 | SCF_UNDERFLOW_BIT = 0x00010000, | ||
122 | SCF_SENT_DELAYED_TAS = 0x00020000, | ||
123 | SCF_ALUA_NON_OPTIMIZED = 0x00040000, | ||
124 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, | ||
125 | SCF_PASSTHROUGH_SG_TO_MEM = 0x00100000, | ||
126 | SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000, | ||
127 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, | ||
128 | SCF_EMULATE_SYNC_CACHE = 0x00800000, | ||
129 | SCF_EMULATE_CDB_ASYNC = 0x01000000, | ||
130 | SCF_EMULATE_SYNC_UNMAP = 0x02000000 | ||
131 | }; | ||
132 | |||
133 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ | ||
134 | enum transport_lunflags_table { | ||
135 | TRANSPORT_LUNFLAGS_NO_ACCESS = 0x00, | ||
136 | TRANSPORT_LUNFLAGS_INITIATOR_ACCESS = 0x01, | ||
137 | TRANSPORT_LUNFLAGS_READ_ONLY = 0x02, | ||
138 | TRANSPORT_LUNFLAGS_READ_WRITE = 0x04, | ||
139 | }; | ||
140 | |||
141 | /* struct se_device->dev_status */ | ||
142 | enum transport_device_status_table { | ||
143 | TRANSPORT_DEVICE_ACTIVATED = 0x01, | ||
144 | TRANSPORT_DEVICE_DEACTIVATED = 0x02, | ||
145 | TRANSPORT_DEVICE_QUEUE_FULL = 0x04, | ||
146 | TRANSPORT_DEVICE_SHUTDOWN = 0x08, | ||
147 | TRANSPORT_DEVICE_OFFLINE_ACTIVATED = 0x10, | ||
148 | TRANSPORT_DEVICE_OFFLINE_DEACTIVATED = 0x20, | ||
149 | }; | ||
150 | |||
151 | /* | ||
152 | * Used by transport_send_check_condition_and_sense() and se_cmd->scsi_sense_reason | ||
153 | * to signal which ASC/ASCQ sense payload should be built. | ||
154 | */ | ||
155 | enum tcm_sense_reason_table { | ||
156 | TCM_NON_EXISTENT_LUN = 0x01, | ||
157 | TCM_UNSUPPORTED_SCSI_OPCODE = 0x02, | ||
158 | TCM_INCORRECT_AMOUNT_OF_DATA = 0x03, | ||
159 | TCM_UNEXPECTED_UNSOLICITED_DATA = 0x04, | ||
160 | TCM_SERVICE_CRC_ERROR = 0x05, | ||
161 | TCM_SNACK_REJECTED = 0x06, | ||
162 | TCM_SECTOR_COUNT_TOO_MANY = 0x07, | ||
163 | TCM_INVALID_CDB_FIELD = 0x08, | ||
164 | TCM_INVALID_PARAMETER_LIST = 0x09, | ||
165 | TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE = 0x0a, | ||
166 | TCM_UNKNOWN_MODE_PAGE = 0x0b, | ||
167 | TCM_WRITE_PROTECTED = 0x0c, | ||
168 | TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, | ||
169 | TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, | ||
170 | TCM_CHECK_CONDITION_NOT_READY = 0x0f, | ||
171 | }; | ||
172 | |||
173 | struct se_obj { | ||
174 | atomic_t obj_access_count; | ||
175 | } ____cacheline_aligned; | ||
176 | |||
177 | /* | ||
178 | * Used by TCM Core internally to signal if ALUA emulation is enabled or | ||
179 | * disabled, or running in with TCM/pSCSI passthrough mode | ||
180 | */ | ||
181 | typedef enum { | ||
182 | SPC_ALUA_PASSTHROUGH, | ||
183 | SPC2_ALUA_DISABLED, | ||
184 | SPC3_ALUA_EMULATED | ||
185 | } t10_alua_index_t; | ||
186 | |||
187 | /* | ||
188 | * Used by TCM Core internally to signal if SAM Task Attribute emulation | ||
189 | * is enabled or disabled, or running in with TCM/pSCSI passthrough mode | ||
190 | */ | ||
191 | typedef enum { | ||
192 | SAM_TASK_ATTR_PASSTHROUGH, | ||
193 | SAM_TASK_ATTR_UNTAGGED, | ||
194 | SAM_TASK_ATTR_EMULATED | ||
195 | } t10_task_attr_index_t; | ||
196 | |||
197 | /* | ||
198 | * Used for target SCSI statistics | ||
199 | */ | ||
200 | typedef enum { | ||
201 | SCSI_INST_INDEX, | ||
202 | SCSI_DEVICE_INDEX, | ||
203 | SCSI_AUTH_INTR_INDEX, | ||
204 | SCSI_INDEX_TYPE_MAX | ||
205 | } scsi_index_t; | ||
206 | |||
207 | struct scsi_index_table { | ||
208 | spinlock_t lock; | ||
209 | u32 scsi_mib_index[SCSI_INDEX_TYPE_MAX]; | ||
210 | } ____cacheline_aligned; | ||
211 | |||
212 | struct se_cmd; | ||
213 | |||
214 | struct t10_alua { | ||
215 | t10_alua_index_t alua_type; | ||
216 | /* ALUA Target Port Group ID */ | ||
217 | u16 alua_tg_pt_gps_counter; | ||
218 | u32 alua_tg_pt_gps_count; | ||
219 | spinlock_t tg_pt_gps_lock; | ||
220 | struct se_subsystem_dev *t10_sub_dev; | ||
221 | /* Used for default ALUA Target Port Group */ | ||
222 | struct t10_alua_tg_pt_gp *default_tg_pt_gp; | ||
223 | /* Used for default ALUA Target Port Group ConfigFS group */ | ||
224 | struct config_group alua_tg_pt_gps_group; | ||
225 | int (*alua_state_check)(struct se_cmd *, unsigned char *, u8 *); | ||
226 | struct list_head tg_pt_gps_list; | ||
227 | } ____cacheline_aligned; | ||
228 | |||
229 | struct t10_alua_lu_gp { | ||
230 | u16 lu_gp_id; | ||
231 | int lu_gp_valid_id; | ||
232 | u32 lu_gp_members; | ||
233 | atomic_t lu_gp_shutdown; | ||
234 | atomic_t lu_gp_ref_cnt; | ||
235 | spinlock_t lu_gp_lock; | ||
236 | struct config_group lu_gp_group; | ||
237 | struct list_head lu_gp_list; | ||
238 | struct list_head lu_gp_mem_list; | ||
239 | } ____cacheline_aligned; | ||
240 | |||
241 | struct t10_alua_lu_gp_member { | ||
242 | int lu_gp_assoc:1; | ||
243 | atomic_t lu_gp_mem_ref_cnt; | ||
244 | spinlock_t lu_gp_mem_lock; | ||
245 | struct t10_alua_lu_gp *lu_gp; | ||
246 | struct se_device *lu_gp_mem_dev; | ||
247 | struct list_head lu_gp_mem_list; | ||
248 | } ____cacheline_aligned; | ||
249 | |||
250 | struct t10_alua_tg_pt_gp { | ||
251 | u16 tg_pt_gp_id; | ||
252 | int tg_pt_gp_valid_id; | ||
253 | int tg_pt_gp_alua_access_status; | ||
254 | int tg_pt_gp_alua_access_type; | ||
255 | int tg_pt_gp_nonop_delay_msecs; | ||
256 | int tg_pt_gp_trans_delay_msecs; | ||
257 | int tg_pt_gp_pref; | ||
258 | int tg_pt_gp_write_metadata; | ||
259 | /* Used by struct t10_alua_tg_pt_gp->tg_pt_gp_md_buf_len */ | ||
260 | #define ALUA_MD_BUF_LEN 1024 | ||
261 | u32 tg_pt_gp_md_buf_len; | ||
262 | u32 tg_pt_gp_members; | ||
263 | atomic_t tg_pt_gp_alua_access_state; | ||
264 | atomic_t tg_pt_gp_ref_cnt; | ||
265 | spinlock_t tg_pt_gp_lock; | ||
266 | struct mutex tg_pt_gp_md_mutex; | ||
267 | struct se_subsystem_dev *tg_pt_gp_su_dev; | ||
268 | struct config_group tg_pt_gp_group; | ||
269 | struct list_head tg_pt_gp_list; | ||
270 | struct list_head tg_pt_gp_mem_list; | ||
271 | } ____cacheline_aligned; | ||
272 | |||
273 | struct t10_alua_tg_pt_gp_member { | ||
274 | int tg_pt_gp_assoc:1; | ||
275 | atomic_t tg_pt_gp_mem_ref_cnt; | ||
276 | spinlock_t tg_pt_gp_mem_lock; | ||
277 | struct t10_alua_tg_pt_gp *tg_pt_gp; | ||
278 | struct se_port *tg_pt; | ||
279 | struct list_head tg_pt_gp_mem_list; | ||
280 | } ____cacheline_aligned; | ||
281 | |||
282 | struct t10_vpd { | ||
283 | unsigned char device_identifier[INQUIRY_VPD_DEVICE_IDENTIFIER_LEN]; | ||
284 | int protocol_identifier_set; | ||
285 | u32 protocol_identifier; | ||
286 | u32 device_identifier_code_set; | ||
287 | u32 association; | ||
288 | u32 device_identifier_type; | ||
289 | struct list_head vpd_list; | ||
290 | } ____cacheline_aligned; | ||
291 | |||
292 | struct t10_wwn { | ||
293 | unsigned char vendor[8]; | ||
294 | unsigned char model[16]; | ||
295 | unsigned char revision[4]; | ||
296 | unsigned char unit_serial[INQUIRY_VPD_SERIAL_LEN]; | ||
297 | spinlock_t t10_vpd_lock; | ||
298 | struct se_subsystem_dev *t10_sub_dev; | ||
299 | struct config_group t10_wwn_group; | ||
300 | struct list_head t10_vpd_list; | ||
301 | } ____cacheline_aligned; | ||
302 | |||
303 | |||
304 | /* | ||
305 | * Used by TCM Core internally to signal if >= SPC-3 peristent reservations | ||
306 | * emulation is enabled or disabled, or running in with TCM/pSCSI passthrough | ||
307 | * mode | ||
308 | */ | ||
309 | typedef enum { | ||
310 | SPC_PASSTHROUGH, | ||
311 | SPC2_RESERVATIONS, | ||
312 | SPC3_PERSISTENT_RESERVATIONS | ||
313 | } t10_reservations_index_t; | ||
314 | |||
315 | struct t10_pr_registration { | ||
316 | /* Used for fabrics that contain WWN+ISID */ | ||
317 | #define PR_REG_ISID_LEN 16 | ||
318 | /* PR_REG_ISID_LEN + ',i,0x' */ | ||
319 | #define PR_REG_ISID_ID_LEN (PR_REG_ISID_LEN + 5) | ||
320 | char pr_reg_isid[PR_REG_ISID_LEN]; | ||
321 | /* Used during APTPL metadata reading */ | ||
322 | #define PR_APTPL_MAX_IPORT_LEN 256 | ||
323 | unsigned char pr_iport[PR_APTPL_MAX_IPORT_LEN]; | ||
324 | /* Used during APTPL metadata reading */ | ||
325 | #define PR_APTPL_MAX_TPORT_LEN 256 | ||
326 | unsigned char pr_tport[PR_APTPL_MAX_TPORT_LEN]; | ||
327 | /* For writing out live meta data */ | ||
328 | unsigned char *pr_aptpl_buf; | ||
329 | u16 pr_aptpl_rpti; | ||
330 | u16 pr_reg_tpgt; | ||
331 | /* Reservation effects all target ports */ | ||
332 | int pr_reg_all_tg_pt; | ||
333 | /* Activate Persistence across Target Power Loss */ | ||
334 | int pr_reg_aptpl; | ||
335 | int pr_res_holder; | ||
336 | int pr_res_type; | ||
337 | int pr_res_scope; | ||
338 | /* Used for fabric initiator WWPNs using a ISID */ | ||
339 | int isid_present_at_reg:1; | ||
340 | u32 pr_res_mapped_lun; | ||
341 | u32 pr_aptpl_target_lun; | ||
342 | u32 pr_res_generation; | ||
343 | u64 pr_reg_bin_isid; | ||
344 | u64 pr_res_key; | ||
345 | atomic_t pr_res_holders; | ||
346 | struct se_node_acl *pr_reg_nacl; | ||
347 | struct se_dev_entry *pr_reg_deve; | ||
348 | struct se_lun *pr_reg_tg_pt_lun; | ||
349 | struct list_head pr_reg_list; | ||
350 | struct list_head pr_reg_abort_list; | ||
351 | struct list_head pr_reg_aptpl_list; | ||
352 | struct list_head pr_reg_atp_list; | ||
353 | struct list_head pr_reg_atp_mem_list; | ||
354 | } ____cacheline_aligned; | ||
355 | |||
356 | /* | ||
357 | * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS, | ||
358 | * SPC2_RESERVATIONS or SPC_PASSTHROUGH in drivers/target/target_core_pr.c: | ||
359 | * core_setup_reservations() | ||
360 | */ | ||
361 | struct t10_reservation_ops { | ||
362 | int (*t10_reservation_check)(struct se_cmd *, u32 *); | ||
363 | int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32); | ||
364 | int (*t10_pr_register)(struct se_cmd *); | ||
365 | int (*t10_pr_clear)(struct se_cmd *); | ||
366 | }; | ||
367 | |||
368 | struct t10_reservation_template { | ||
369 | /* Reservation effects all target ports */ | ||
370 | int pr_all_tg_pt; | ||
371 | /* Activate Persistence across Target Power Loss enabled | ||
372 | * for SCSI device */ | ||
373 | int pr_aptpl_active; | ||
374 | /* Used by struct t10_reservation_template->pr_aptpl_buf_len */ | ||
375 | #define PR_APTPL_BUF_LEN 8192 | ||
376 | u32 pr_aptpl_buf_len; | ||
377 | u32 pr_generation; | ||
378 | t10_reservations_index_t res_type; | ||
379 | spinlock_t registration_lock; | ||
380 | spinlock_t aptpl_reg_lock; | ||
381 | /* | ||
382 | * This will always be set by one individual I_T Nexus. | ||
383 | * However with all_tg_pt=1, other I_T Nexus from the | ||
384 | * same initiator can access PR reg/res info on a different | ||
385 | * target port. | ||
386 | * | ||
387 | * There is also the 'All Registrants' case, where there is | ||
388 | * a single *pr_res_holder of the reservation, but all | ||
389 | * registrations are considered reservation holders. | ||
390 | */ | ||
391 | struct se_node_acl *pr_res_holder; | ||
392 | struct list_head registration_list; | ||
393 | struct list_head aptpl_reg_list; | ||
394 | struct t10_reservation_ops pr_ops; | ||
395 | } ____cacheline_aligned; | ||
396 | |||
397 | struct se_queue_req { | ||
398 | int state; | ||
399 | void *cmd; | ||
400 | struct list_head qr_list; | ||
401 | } ____cacheline_aligned; | ||
402 | |||
403 | struct se_queue_obj { | ||
404 | atomic_t queue_cnt; | ||
405 | spinlock_t cmd_queue_lock; | ||
406 | struct list_head qobj_list; | ||
407 | wait_queue_head_t thread_wq; | ||
408 | } ____cacheline_aligned; | ||
409 | |||
410 | /* | ||
411 | * Used one per struct se_cmd to hold all extra struct se_task | ||
412 | * metadata. This structure is setup and allocated in | ||
413 | * drivers/target/target_core_transport.c:__transport_alloc_se_cmd() | ||
414 | */ | ||
415 | struct se_transport_task { | ||
416 | unsigned char *t_task_cdb; | ||
417 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; | ||
418 | unsigned long long t_task_lba; | ||
419 | int t_tasks_failed; | ||
420 | int t_tasks_fua; | ||
421 | int t_tasks_bidi:1; | ||
422 | u32 t_task_cdbs; | ||
423 | u32 t_tasks_check; | ||
424 | u32 t_tasks_no; | ||
425 | u32 t_tasks_sectors; | ||
426 | u32 t_tasks_se_num; | ||
427 | u32 t_tasks_se_bidi_num; | ||
428 | u32 t_tasks_sg_chained_no; | ||
429 | atomic_t t_fe_count; | ||
430 | atomic_t t_se_count; | ||
431 | atomic_t t_task_cdbs_left; | ||
432 | atomic_t t_task_cdbs_ex_left; | ||
433 | atomic_t t_task_cdbs_timeout_left; | ||
434 | atomic_t t_task_cdbs_sent; | ||
435 | atomic_t t_transport_aborted; | ||
436 | atomic_t t_transport_active; | ||
437 | atomic_t t_transport_complete; | ||
438 | atomic_t t_transport_queue_active; | ||
439 | atomic_t t_transport_sent; | ||
440 | atomic_t t_transport_stop; | ||
441 | atomic_t t_transport_timeout; | ||
442 | atomic_t transport_dev_active; | ||
443 | atomic_t transport_lun_active; | ||
444 | atomic_t transport_lun_fe_stop; | ||
445 | atomic_t transport_lun_stop; | ||
446 | spinlock_t t_state_lock; | ||
447 | struct completion t_transport_stop_comp; | ||
448 | struct completion transport_lun_fe_stop_comp; | ||
449 | struct completion transport_lun_stop_comp; | ||
450 | struct scatterlist *t_tasks_sg_chained; | ||
451 | struct scatterlist t_tasks_sg_bounce; | ||
452 | void *t_task_buf; | ||
453 | /* | ||
454 | * Used for pre-registered fabric SGL passthrough WRITE and READ | ||
455 | * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop | ||
456 | * and other HW target mode fabric modules. | ||
457 | */ | ||
458 | struct scatterlist *t_task_pt_sgl; | ||
459 | struct list_head *t_mem_list; | ||
460 | /* Used for BIDI READ */ | ||
461 | struct list_head *t_mem_bidi_list; | ||
462 | struct list_head t_task_list; | ||
463 | } ____cacheline_aligned; | ||
464 | |||
465 | struct se_task { | ||
466 | unsigned char task_sense; | ||
467 | struct scatterlist *task_sg; | ||
468 | struct scatterlist *task_sg_bidi; | ||
469 | u8 task_scsi_status; | ||
470 | u8 task_flags; | ||
471 | int task_error_status; | ||
472 | int task_state_flags; | ||
473 | int task_padded_sg:1; | ||
474 | unsigned long long task_lba; | ||
475 | u32 task_no; | ||
476 | u32 task_sectors; | ||
477 | u32 task_size; | ||
478 | u32 task_sg_num; | ||
479 | u32 task_sg_offset; | ||
480 | enum dma_data_direction task_data_direction; | ||
481 | struct se_cmd *task_se_cmd; | ||
482 | struct se_device *se_dev; | ||
483 | struct completion task_stop_comp; | ||
484 | atomic_t task_active; | ||
485 | atomic_t task_execute_queue; | ||
486 | atomic_t task_timeout; | ||
487 | atomic_t task_sent; | ||
488 | atomic_t task_stop; | ||
489 | atomic_t task_state_active; | ||
490 | struct timer_list task_timer; | ||
491 | struct se_device *se_obj_ptr; | ||
492 | struct list_head t_list; | ||
493 | struct list_head t_execute_list; | ||
494 | struct list_head t_state_list; | ||
495 | } ____cacheline_aligned; | ||
496 | |||
497 | #define TASK_CMD(task) ((struct se_cmd *)task->task_se_cmd) | ||
498 | #define TASK_DEV(task) ((struct se_device *)task->se_dev) | ||
499 | |||
500 | struct se_cmd { | ||
501 | /* SAM response code being sent to initiator */ | ||
502 | u8 scsi_status; | ||
503 | u8 scsi_asc; | ||
504 | u8 scsi_ascq; | ||
505 | u8 scsi_sense_reason; | ||
506 | u16 scsi_sense_length; | ||
507 | /* Delay for ALUA Active/NonOptimized state access in milliseconds */ | ||
508 | int alua_nonop_delay; | ||
509 | /* See include/linux/dma-mapping.h */ | ||
510 | enum dma_data_direction data_direction; | ||
511 | /* For SAM Task Attribute */ | ||
512 | int sam_task_attr; | ||
513 | /* Transport protocol dependent state, see transport_state_table */ | ||
514 | enum transport_state_table t_state; | ||
515 | /* Transport protocol dependent state for out of order CmdSNs */ | ||
516 | int deferred_t_state; | ||
517 | /* Transport specific error status */ | ||
518 | int transport_error_status; | ||
519 | /* See se_cmd_flags_table */ | ||
520 | u32 se_cmd_flags; | ||
521 | u32 se_ordered_id; | ||
522 | /* Total size in bytes associated with command */ | ||
523 | u32 data_length; | ||
524 | /* SCSI Presented Data Transfer Length */ | ||
525 | u32 cmd_spdtl; | ||
526 | u32 residual_count; | ||
527 | u32 orig_fe_lun; | ||
528 | /* Persistent Reservation key */ | ||
529 | u64 pr_res_key; | ||
530 | atomic_t transport_sent; | ||
531 | /* Used for sense data */ | ||
532 | void *sense_buffer; | ||
533 | struct list_head se_delayed_list; | ||
534 | struct list_head se_ordered_list; | ||
535 | struct list_head se_lun_list; | ||
536 | struct se_device *se_dev; | ||
537 | struct se_dev_entry *se_deve; | ||
538 | struct se_device *se_obj_ptr; | ||
539 | struct se_device *se_orig_obj_ptr; | ||
540 | struct se_lun *se_lun; | ||
541 | /* Only used for internal passthrough and legacy TCM fabric modules */ | ||
542 | struct se_session *se_sess; | ||
543 | struct se_tmr_req *se_tmr_req; | ||
544 | /* t_task is setup to t_task_backstore in transport_init_se_cmd() */ | ||
545 | struct se_transport_task *t_task; | ||
546 | struct se_transport_task t_task_backstore; | ||
547 | struct target_core_fabric_ops *se_tfo; | ||
548 | int (*transport_emulate_cdb)(struct se_cmd *); | ||
549 | void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); | ||
550 | void (*transport_wait_for_tasks)(struct se_cmd *, int, int); | ||
551 | void (*transport_complete_callback)(struct se_cmd *); | ||
552 | } ____cacheline_aligned; | ||
553 | |||
554 | #define T_TASK(cmd) ((struct se_transport_task *)(cmd->t_task)) | ||
555 | #define CMD_TFO(cmd) ((struct target_core_fabric_ops *)cmd->se_tfo) | ||
556 | |||
557 | struct se_tmr_req { | ||
558 | /* Task Management function to be preformed */ | ||
559 | u8 function; | ||
560 | /* Task Management response to send */ | ||
561 | u8 response; | ||
562 | int call_transport; | ||
563 | /* Reference to ITT that Task Mgmt should be preformed */ | ||
564 | u32 ref_task_tag; | ||
565 | /* 64-bit encoded SAM LUN from $FABRIC_MOD TMR header */ | ||
566 | u64 ref_task_lun; | ||
567 | void *fabric_tmr_ptr; | ||
568 | struct se_cmd *task_cmd; | ||
569 | struct se_cmd *ref_cmd; | ||
570 | struct se_device *tmr_dev; | ||
571 | struct se_lun *tmr_lun; | ||
572 | struct list_head tmr_list; | ||
573 | } ____cacheline_aligned; | ||
574 | |||
575 | struct se_ua { | ||
576 | u8 ua_asc; | ||
577 | u8 ua_ascq; | ||
578 | struct se_node_acl *ua_nacl; | ||
579 | struct list_head ua_dev_list; | ||
580 | struct list_head ua_nacl_list; | ||
581 | } ____cacheline_aligned; | ||
582 | |||
583 | struct se_node_acl { | ||
584 | char initiatorname[TRANSPORT_IQN_LEN]; | ||
585 | /* Used to signal demo mode created ACL, disabled by default */ | ||
586 | int dynamic_node_acl:1; | ||
587 | u32 queue_depth; | ||
588 | u32 acl_index; | ||
589 | u64 num_cmds; | ||
590 | u64 read_bytes; | ||
591 | u64 write_bytes; | ||
592 | spinlock_t stats_lock; | ||
593 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
594 | atomic_t acl_pr_ref_count; | ||
595 | struct se_dev_entry *device_list; | ||
596 | struct se_session *nacl_sess; | ||
597 | struct se_portal_group *se_tpg; | ||
598 | spinlock_t device_list_lock; | ||
599 | spinlock_t nacl_sess_lock; | ||
600 | struct config_group acl_group; | ||
601 | struct config_group acl_attrib_group; | ||
602 | struct config_group acl_auth_group; | ||
603 | struct config_group acl_param_group; | ||
604 | struct config_group *acl_default_groups[4]; | ||
605 | struct list_head acl_list; | ||
606 | struct list_head acl_sess_list; | ||
607 | } ____cacheline_aligned; | ||
608 | |||
609 | struct se_session { | ||
610 | u64 sess_bin_isid; | ||
611 | struct se_node_acl *se_node_acl; | ||
612 | struct se_portal_group *se_tpg; | ||
613 | void *fabric_sess_ptr; | ||
614 | struct list_head sess_list; | ||
615 | struct list_head sess_acl_list; | ||
616 | } ____cacheline_aligned; | ||
617 | |||
618 | #define SE_SESS(cmd) ((struct se_session *)(cmd)->se_sess) | ||
619 | #define SE_NODE_ACL(sess) ((struct se_node_acl *)(sess)->se_node_acl) | ||
620 | |||
621 | struct se_device; | ||
622 | struct se_transform_info; | ||
623 | struct scatterlist; | ||
624 | |||
625 | struct se_lun_acl { | ||
626 | char initiatorname[TRANSPORT_IQN_LEN]; | ||
627 | u32 mapped_lun; | ||
628 | struct se_node_acl *se_lun_nacl; | ||
629 | struct se_lun *se_lun; | ||
630 | struct list_head lacl_list; | ||
631 | struct config_group se_lun_group; | ||
632 | } ____cacheline_aligned; | ||
633 | |||
634 | struct se_dev_entry { | ||
635 | int def_pr_registered:1; | ||
636 | /* See transport_lunflags_table */ | ||
637 | u32 lun_flags; | ||
638 | u32 deve_cmds; | ||
639 | u32 mapped_lun; | ||
640 | u32 average_bytes; | ||
641 | u32 last_byte_count; | ||
642 | u32 total_cmds; | ||
643 | u32 total_bytes; | ||
644 | u64 pr_res_key; | ||
645 | u64 creation_time; | ||
646 | u32 attach_count; | ||
647 | u64 read_bytes; | ||
648 | u64 write_bytes; | ||
649 | atomic_t ua_count; | ||
650 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
651 | atomic_t pr_ref_count; | ||
652 | struct se_lun_acl *se_lun_acl; | ||
653 | spinlock_t ua_lock; | ||
654 | struct se_lun *se_lun; | ||
655 | struct list_head alua_port_list; | ||
656 | struct list_head ua_list; | ||
657 | } ____cacheline_aligned; | ||
658 | |||
659 | struct se_dev_limits { | ||
660 | /* Max supported HW queue depth */ | ||
661 | u32 hw_queue_depth; | ||
662 | /* Max supported virtual queue depth */ | ||
663 | u32 queue_depth; | ||
664 | /* From include/linux/blkdev.h for the other HW/SW limits. */ | ||
665 | struct queue_limits limits; | ||
666 | } ____cacheline_aligned; | ||
667 | |||
668 | struct se_dev_attrib { | ||
669 | int emulate_dpo; | ||
670 | int emulate_fua_write; | ||
671 | int emulate_fua_read; | ||
672 | int emulate_write_cache; | ||
673 | int emulate_ua_intlck_ctrl; | ||
674 | int emulate_tas; | ||
675 | int emulate_tpu; | ||
676 | int emulate_tpws; | ||
677 | int emulate_reservations; | ||
678 | int emulate_alua; | ||
679 | int enforce_pr_isids; | ||
680 | u32 hw_block_size; | ||
681 | u32 block_size; | ||
682 | u32 hw_max_sectors; | ||
683 | u32 max_sectors; | ||
684 | u32 optimal_sectors; | ||
685 | u32 hw_queue_depth; | ||
686 | u32 queue_depth; | ||
687 | u32 task_timeout; | ||
688 | u32 max_unmap_lba_count; | ||
689 | u32 max_unmap_block_desc_count; | ||
690 | u32 unmap_granularity; | ||
691 | u32 unmap_granularity_alignment; | ||
692 | struct se_subsystem_dev *da_sub_dev; | ||
693 | struct config_group da_group; | ||
694 | } ____cacheline_aligned; | ||
695 | |||
696 | struct se_subsystem_dev { | ||
697 | /* Used for struct se_subsystem_dev-->se_dev_alias, must be less than PAGE_SIZE */ | ||
698 | #define SE_DEV_ALIAS_LEN 512 | ||
699 | unsigned char se_dev_alias[SE_DEV_ALIAS_LEN]; | ||
700 | /* Used for struct se_subsystem_dev->se_dev_udev_path[], must be less than PAGE_SIZE */ | ||
701 | #define SE_UDEV_PATH_LEN 512 | ||
702 | unsigned char se_dev_udev_path[SE_UDEV_PATH_LEN]; | ||
703 | u32 su_dev_flags; | ||
704 | struct se_hba *se_dev_hba; | ||
705 | struct se_device *se_dev_ptr; | ||
706 | struct se_dev_attrib se_dev_attrib; | ||
707 | /* T10 Asymmetric Logical Unit Assignment for Target Ports */ | ||
708 | struct t10_alua t10_alua; | ||
709 | /* T10 Inquiry and VPD WWN Information */ | ||
710 | struct t10_wwn t10_wwn; | ||
711 | /* T10 SPC-2 + SPC-3 Reservations */ | ||
712 | struct t10_reservation_template t10_reservation; | ||
713 | spinlock_t se_dev_lock; | ||
714 | void *se_dev_su_ptr; | ||
715 | struct list_head g_se_dev_list; | ||
716 | struct config_group se_dev_group; | ||
717 | /* For T10 Reservations */ | ||
718 | struct config_group se_dev_pr_group; | ||
719 | } ____cacheline_aligned; | ||
720 | |||
721 | #define T10_ALUA(su_dev) (&(su_dev)->t10_alua) | ||
722 | #define T10_RES(su_dev) (&(su_dev)->t10_reservation) | ||
723 | #define T10_PR_OPS(su_dev) (&(su_dev)->t10_reservation.pr_ops) | ||
724 | |||
725 | struct se_device { | ||
726 | /* Set to 1 if thread is NOT sleeping on thread_sem */ | ||
727 | u8 thread_active; | ||
728 | u8 dev_status_timer_flags; | ||
729 | /* RELATIVE TARGET PORT IDENTIFER Counter */ | ||
730 | u16 dev_rpti_counter; | ||
731 | /* Used for SAM Task Attribute ordering */ | ||
732 | u32 dev_cur_ordered_id; | ||
733 | u32 dev_flags; | ||
734 | u32 dev_port_count; | ||
735 | /* See transport_device_status_table */ | ||
736 | u32 dev_status; | ||
737 | u32 dev_tcq_window_closed; | ||
738 | /* Physical device queue depth */ | ||
739 | u32 queue_depth; | ||
740 | /* Used for SPC-2 reservations enforce of ISIDs */ | ||
741 | u64 dev_res_bin_isid; | ||
742 | t10_task_attr_index_t dev_task_attr_type; | ||
743 | /* Pointer to transport specific device structure */ | ||
744 | void *dev_ptr; | ||
745 | u32 dev_index; | ||
746 | u64 creation_time; | ||
747 | u32 num_resets; | ||
748 | u64 num_cmds; | ||
749 | u64 read_bytes; | ||
750 | u64 write_bytes; | ||
751 | spinlock_t stats_lock; | ||
752 | /* Active commands on this virtual SE device */ | ||
753 | atomic_t active_cmds; | ||
754 | atomic_t simple_cmds; | ||
755 | atomic_t depth_left; | ||
756 | atomic_t dev_ordered_id; | ||
757 | atomic_t dev_tur_active; | ||
758 | atomic_t execute_tasks; | ||
759 | atomic_t dev_status_thr_count; | ||
760 | atomic_t dev_hoq_count; | ||
761 | atomic_t dev_ordered_sync; | ||
762 | struct se_obj dev_obj; | ||
763 | struct se_obj dev_access_obj; | ||
764 | struct se_obj dev_export_obj; | ||
765 | struct se_queue_obj *dev_queue_obj; | ||
766 | struct se_queue_obj *dev_status_queue_obj; | ||
767 | spinlock_t delayed_cmd_lock; | ||
768 | spinlock_t ordered_cmd_lock; | ||
769 | spinlock_t execute_task_lock; | ||
770 | spinlock_t state_task_lock; | ||
771 | spinlock_t dev_alua_lock; | ||
772 | spinlock_t dev_reservation_lock; | ||
773 | spinlock_t dev_state_lock; | ||
774 | spinlock_t dev_status_lock; | ||
775 | spinlock_t dev_status_thr_lock; | ||
776 | spinlock_t se_port_lock; | ||
777 | spinlock_t se_tmr_lock; | ||
778 | /* Used for legacy SPC-2 reservationsa */ | ||
779 | struct se_node_acl *dev_reserved_node_acl; | ||
780 | /* Used for ALUA Logical Unit Group membership */ | ||
781 | struct t10_alua_lu_gp_member *dev_alua_lu_gp_mem; | ||
782 | /* Used for SPC-3 Persistent Reservations */ | ||
783 | struct t10_pr_registration *dev_pr_res_holder; | ||
784 | struct list_head dev_sep_list; | ||
785 | struct list_head dev_tmr_list; | ||
786 | struct timer_list dev_status_timer; | ||
787 | /* Pointer to descriptor for processing thread */ | ||
788 | struct task_struct *process_thread; | ||
789 | pid_t process_thread_pid; | ||
790 | struct task_struct *dev_mgmt_thread; | ||
791 | struct list_head delayed_cmd_list; | ||
792 | struct list_head ordered_cmd_list; | ||
793 | struct list_head execute_task_list; | ||
794 | struct list_head state_task_list; | ||
795 | /* Pointer to associated SE HBA */ | ||
796 | struct se_hba *se_hba; | ||
797 | struct se_subsystem_dev *se_sub_dev; | ||
798 | /* Pointer to template of function pointers for transport */ | ||
799 | struct se_subsystem_api *transport; | ||
800 | /* Linked list for struct se_hba struct se_device list */ | ||
801 | struct list_head dev_list; | ||
802 | /* Linked list for struct se_global->g_se_dev_list */ | ||
803 | struct list_head g_se_dev_list; | ||
804 | } ____cacheline_aligned; | ||
805 | |||
806 | #define SE_DEV(cmd) ((struct se_device *)(cmd)->se_lun->lun_se_dev) | ||
807 | #define SU_DEV(dev) ((struct se_subsystem_dev *)(dev)->se_sub_dev) | ||
808 | #define DEV_ATTRIB(dev) (&(dev)->se_sub_dev->se_dev_attrib) | ||
809 | #define DEV_T10_WWN(dev) (&(dev)->se_sub_dev->t10_wwn) | ||
810 | |||
811 | struct se_hba { | ||
812 | u16 hba_tpgt; | ||
813 | u32 hba_id; | ||
814 | /* See hba_flags_table */ | ||
815 | u32 hba_flags; | ||
816 | /* Virtual iSCSI devices attached. */ | ||
817 | u32 dev_count; | ||
818 | u32 hba_index; | ||
819 | atomic_t load_balance_queue; | ||
820 | atomic_t left_queue_depth; | ||
821 | /* Maximum queue depth the HBA can handle. */ | ||
822 | atomic_t max_queue_depth; | ||
823 | /* Pointer to transport specific host structure. */ | ||
824 | void *hba_ptr; | ||
825 | /* Linked list for struct se_device */ | ||
826 | struct list_head hba_dev_list; | ||
827 | struct list_head hba_list; | ||
828 | spinlock_t device_lock; | ||
829 | spinlock_t hba_queue_lock; | ||
830 | struct config_group hba_group; | ||
831 | struct mutex hba_access_mutex; | ||
832 | struct se_subsystem_api *transport; | ||
833 | } ____cacheline_aligned; | ||
834 | |||
835 | #define SE_HBA(d) ((struct se_hba *)(d)->se_hba) | ||
836 | |||
837 | struct se_lun { | ||
838 | /* See transport_lun_status_table */ | ||
839 | enum transport_lun_status_table lun_status; | ||
840 | u32 lun_access; | ||
841 | u32 lun_flags; | ||
842 | u32 unpacked_lun; | ||
843 | atomic_t lun_acl_count; | ||
844 | spinlock_t lun_acl_lock; | ||
845 | spinlock_t lun_cmd_lock; | ||
846 | spinlock_t lun_sep_lock; | ||
847 | struct completion lun_shutdown_comp; | ||
848 | struct list_head lun_cmd_list; | ||
849 | struct list_head lun_acl_list; | ||
850 | struct se_device *lun_se_dev; | ||
851 | struct config_group lun_group; | ||
852 | struct se_port *lun_sep; | ||
853 | } ____cacheline_aligned; | ||
854 | |||
855 | #define SE_LUN(c) ((struct se_lun *)(c)->se_lun) | ||
856 | |||
857 | struct scsi_port_stats { | ||
858 | u64 cmd_pdus; | ||
859 | u64 tx_data_octets; | ||
860 | u64 rx_data_octets; | ||
861 | } ____cacheline_aligned; | ||
862 | |||
863 | struct se_port { | ||
864 | /* RELATIVE TARGET PORT IDENTIFER */ | ||
865 | u16 sep_rtpi; | ||
866 | int sep_tg_pt_secondary_stat; | ||
867 | int sep_tg_pt_secondary_write_md; | ||
868 | u32 sep_index; | ||
869 | struct scsi_port_stats sep_stats; | ||
870 | /* Used for ALUA Target Port Groups membership */ | ||
871 | atomic_t sep_tg_pt_gp_active; | ||
872 | atomic_t sep_tg_pt_secondary_offline; | ||
873 | /* Used for PR ALL_TG_PT=1 */ | ||
874 | atomic_t sep_tg_pt_ref_cnt; | ||
875 | spinlock_t sep_alua_lock; | ||
876 | struct mutex sep_tg_pt_md_mutex; | ||
877 | struct t10_alua_tg_pt_gp_member *sep_alua_tg_pt_gp_mem; | ||
878 | struct se_lun *sep_lun; | ||
879 | struct se_portal_group *sep_tpg; | ||
880 | struct list_head sep_alua_list; | ||
881 | struct list_head sep_list; | ||
882 | } ____cacheline_aligned; | ||
883 | |||
884 | struct se_tpg_np { | ||
885 | struct se_portal_group *tpg_np_parent; | ||
886 | struct config_group tpg_np_group; | ||
887 | } ____cacheline_aligned; | ||
888 | |||
889 | struct se_portal_group { | ||
890 | /* Type of target portal group, see transport_tpg_type_table */ | ||
891 | enum transport_tpg_type_table se_tpg_type; | ||
892 | /* Number of ACLed Initiator Nodes for this TPG */ | ||
893 | u32 num_node_acls; | ||
894 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | ||
895 | atomic_t tpg_pr_ref_count; | ||
896 | /* Spinlock for adding/removing ACLed Nodes */ | ||
897 | spinlock_t acl_node_lock; | ||
898 | /* Spinlock for adding/removing sessions */ | ||
899 | spinlock_t session_lock; | ||
900 | spinlock_t tpg_lun_lock; | ||
901 | /* Pointer to $FABRIC_MOD portal group */ | ||
902 | void *se_tpg_fabric_ptr; | ||
903 | struct list_head se_tpg_list; | ||
904 | /* linked list for initiator ACL list */ | ||
905 | struct list_head acl_node_list; | ||
906 | struct se_lun *tpg_lun_list; | ||
907 | struct se_lun tpg_virt_lun0; | ||
908 | /* List of TCM sessions assoicated wth this TPG */ | ||
909 | struct list_head tpg_sess_list; | ||
910 | /* Pointer to $FABRIC_MOD dependent code */ | ||
911 | struct target_core_fabric_ops *se_tpg_tfo; | ||
912 | struct se_wwn *se_tpg_wwn; | ||
913 | struct config_group tpg_group; | ||
914 | struct config_group *tpg_default_groups[6]; | ||
915 | struct config_group tpg_lun_group; | ||
916 | struct config_group tpg_np_group; | ||
917 | struct config_group tpg_acl_group; | ||
918 | struct config_group tpg_attrib_group; | ||
919 | struct config_group tpg_param_group; | ||
920 | } ____cacheline_aligned; | ||
921 | |||
922 | #define TPG_TFO(se_tpg) ((struct target_core_fabric_ops *)(se_tpg)->se_tpg_tfo) | ||
923 | |||
924 | struct se_wwn { | ||
925 | struct target_fabric_configfs *wwn_tf; | ||
926 | struct config_group wwn_group; | ||
927 | } ____cacheline_aligned; | ||
928 | |||
929 | struct se_global { | ||
930 | u16 alua_lu_gps_counter; | ||
931 | int g_sub_api_initialized; | ||
932 | u32 in_shutdown; | ||
933 | u32 alua_lu_gps_count; | ||
934 | u32 g_hba_id_counter; | ||
935 | struct config_group target_core_hbagroup; | ||
936 | struct config_group alua_group; | ||
937 | struct config_group alua_lu_gps_group; | ||
938 | struct list_head g_lu_gps_list; | ||
939 | struct list_head g_se_tpg_list; | ||
940 | struct list_head g_hba_list; | ||
941 | struct list_head g_se_dev_list; | ||
942 | struct se_hba *g_lun0_hba; | ||
943 | struct se_subsystem_dev *g_lun0_su_dev; | ||
944 | struct se_device *g_lun0_dev; | ||
945 | struct t10_alua_lu_gp *default_lu_gp; | ||
946 | spinlock_t g_device_lock; | ||
947 | spinlock_t hba_lock; | ||
948 | spinlock_t se_tpg_lock; | ||
949 | spinlock_t lu_gps_lock; | ||
950 | spinlock_t plugin_class_lock; | ||
951 | } ____cacheline_aligned; | ||
952 | |||
953 | #endif /* TARGET_CORE_BASE_H */ | ||
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h new file mode 100644 index 000000000000..40e6e740527c --- /dev/null +++ b/include/target/target_core_configfs.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #define TARGET_CORE_CONFIGFS_VERSION TARGET_CORE_MOD_VERSION | ||
2 | |||
3 | #define TARGET_CORE_CONFIG_ROOT "/sys/kernel/config" | ||
4 | |||
5 | #define TARGET_CORE_NAME_MAX_LEN 64 | ||
6 | #define TARGET_FABRIC_NAME_SIZE 32 | ||
7 | |||
8 | extern struct target_fabric_configfs *target_fabric_configfs_init( | ||
9 | struct module *, const char *); | ||
10 | extern void target_fabric_configfs_free(struct target_fabric_configfs *); | ||
11 | extern int target_fabric_configfs_register(struct target_fabric_configfs *); | ||
12 | extern void target_fabric_configfs_deregister(struct target_fabric_configfs *); | ||
13 | |||
14 | struct target_fabric_configfs_template { | ||
15 | struct config_item_type tfc_discovery_cit; | ||
16 | struct config_item_type tfc_wwn_cit; | ||
17 | struct config_item_type tfc_tpg_cit; | ||
18 | struct config_item_type tfc_tpg_base_cit; | ||
19 | struct config_item_type tfc_tpg_lun_cit; | ||
20 | struct config_item_type tfc_tpg_port_cit; | ||
21 | struct config_item_type tfc_tpg_np_cit; | ||
22 | struct config_item_type tfc_tpg_np_base_cit; | ||
23 | struct config_item_type tfc_tpg_attrib_cit; | ||
24 | struct config_item_type tfc_tpg_param_cit; | ||
25 | struct config_item_type tfc_tpg_nacl_cit; | ||
26 | struct config_item_type tfc_tpg_nacl_base_cit; | ||
27 | struct config_item_type tfc_tpg_nacl_attrib_cit; | ||
28 | struct config_item_type tfc_tpg_nacl_auth_cit; | ||
29 | struct config_item_type tfc_tpg_nacl_param_cit; | ||
30 | struct config_item_type tfc_tpg_mappedlun_cit; | ||
31 | }; | ||
32 | |||
33 | struct target_fabric_configfs { | ||
34 | char tf_name[TARGET_FABRIC_NAME_SIZE]; | ||
35 | atomic_t tf_access_cnt; | ||
36 | struct list_head tf_list; | ||
37 | struct config_group tf_group; | ||
38 | struct config_group tf_disc_group; | ||
39 | struct config_group *tf_default_groups[2]; | ||
40 | /* Pointer to fabric's config_item */ | ||
41 | struct config_item *tf_fabric; | ||
42 | /* Passed from fabric modules */ | ||
43 | struct config_item_type *tf_fabric_cit; | ||
44 | /* Pointer to target core subsystem */ | ||
45 | struct configfs_subsystem *tf_subsys; | ||
46 | /* Pointer to fabric's struct module */ | ||
47 | struct module *tf_module; | ||
48 | struct target_core_fabric_ops tf_ops; | ||
49 | struct target_fabric_configfs_template tf_cit_tmpl; | ||
50 | }; | ||
51 | |||
52 | #define TF_CIT_TMPL(tf) (&(tf)->tf_cit_tmpl) | ||
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h new file mode 100644 index 000000000000..52b18a5752c9 --- /dev/null +++ b/include/target/target_core_device.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #ifndef TARGET_CORE_DEVICE_H | ||
2 | #define TARGET_CORE_DEVICE_H | ||
3 | |||
4 | extern int transport_get_lun_for_cmd(struct se_cmd *, unsigned char *, u32); | ||
5 | extern int transport_get_lun_for_tmr(struct se_cmd *, u32); | ||
6 | extern struct se_dev_entry *core_get_se_deve_from_rtpi( | ||
7 | struct se_node_acl *, u16); | ||
8 | extern int core_free_device_list_for_node(struct se_node_acl *, | ||
9 | struct se_portal_group *); | ||
10 | extern void core_dec_lacl_count(struct se_node_acl *, struct se_cmd *); | ||
11 | extern void core_update_device_list_access(u32, u32, struct se_node_acl *); | ||
12 | extern int core_update_device_list_for_node(struct se_lun *, struct se_lun_acl *, u32, | ||
13 | u32, struct se_node_acl *, | ||
14 | struct se_portal_group *, int); | ||
15 | extern void core_clear_lun_from_tpg(struct se_lun *, struct se_portal_group *); | ||
16 | extern int core_dev_export(struct se_device *, struct se_portal_group *, | ||
17 | struct se_lun *); | ||
18 | extern void core_dev_unexport(struct se_device *, struct se_portal_group *, | ||
19 | struct se_lun *); | ||
20 | extern int transport_core_report_lun_response(struct se_cmd *); | ||
21 | extern void se_release_device_for_hba(struct se_device *); | ||
22 | extern void se_release_vpd_for_dev(struct se_device *); | ||
23 | extern void se_clear_dev_ports(struct se_device *); | ||
24 | extern int se_free_virtual_device(struct se_device *, struct se_hba *); | ||
25 | extern int se_dev_check_online(struct se_device *); | ||
26 | extern int se_dev_check_shutdown(struct se_device *); | ||
27 | extern void se_dev_set_default_attribs(struct se_device *, struct se_dev_limits *); | ||
28 | extern int se_dev_set_task_timeout(struct se_device *, u32); | ||
29 | extern int se_dev_set_max_unmap_lba_count(struct se_device *, u32); | ||
30 | extern int se_dev_set_max_unmap_block_desc_count(struct se_device *, u32); | ||
31 | extern int se_dev_set_unmap_granularity(struct se_device *, u32); | ||
32 | extern int se_dev_set_unmap_granularity_alignment(struct se_device *, u32); | ||
33 | extern int se_dev_set_emulate_dpo(struct se_device *, int); | ||
34 | extern int se_dev_set_emulate_fua_write(struct se_device *, int); | ||
35 | extern int se_dev_set_emulate_fua_read(struct se_device *, int); | ||
36 | extern int se_dev_set_emulate_write_cache(struct se_device *, int); | ||
37 | extern int se_dev_set_emulate_ua_intlck_ctrl(struct se_device *, int); | ||
38 | extern int se_dev_set_emulate_tas(struct se_device *, int); | ||
39 | extern int se_dev_set_emulate_tpu(struct se_device *, int); | ||
40 | extern int se_dev_set_emulate_tpws(struct se_device *, int); | ||
41 | extern int se_dev_set_enforce_pr_isids(struct se_device *, int); | ||
42 | extern int se_dev_set_queue_depth(struct se_device *, u32); | ||
43 | extern int se_dev_set_max_sectors(struct se_device *, u32); | ||
44 | extern int se_dev_set_optimal_sectors(struct se_device *, u32); | ||
45 | extern int se_dev_set_block_size(struct se_device *, u32); | ||
46 | extern struct se_lun *core_dev_add_lun(struct se_portal_group *, struct se_hba *, | ||
47 | struct se_device *, u32); | ||
48 | extern int core_dev_del_lun(struct se_portal_group *, u32); | ||
49 | extern struct se_lun *core_get_lun_from_tpg(struct se_portal_group *, u32); | ||
50 | extern struct se_lun_acl *core_dev_init_initiator_node_lun_acl(struct se_portal_group *, | ||
51 | u32, char *, int *); | ||
52 | extern int core_dev_add_initiator_node_lun_acl(struct se_portal_group *, | ||
53 | struct se_lun_acl *, u32, u32); | ||
54 | extern int core_dev_del_initiator_node_lun_acl(struct se_portal_group *, | ||
55 | struct se_lun *, struct se_lun_acl *); | ||
56 | extern void core_dev_free_initiator_node_lun_acl(struct se_portal_group *, | ||
57 | struct se_lun_acl *lacl); | ||
58 | extern int core_dev_setup_virtual_lun0(void); | ||
59 | extern void core_dev_release_virtual_lun0(void); | ||
60 | |||
61 | #endif /* TARGET_CORE_DEVICE_H */ | ||
diff --git a/include/target/target_core_fabric_configfs.h b/include/target/target_core_fabric_configfs.h new file mode 100644 index 000000000000..a26fb7586a09 --- /dev/null +++ b/include/target/target_core_fabric_configfs.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * Used for tfc_wwn_cit attributes | ||
3 | */ | ||
4 | |||
5 | #include <target/configfs_macros.h> | ||
6 | |||
7 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_attrib, se_node_acl); | ||
8 | #define TF_NACL_ATTRIB_ATTR(_fabric, _name, _mode) \ | ||
9 | static struct target_fabric_nacl_attrib_attribute _fabric##_nacl_attrib_##_name = \ | ||
10 | __CONFIGFS_EATTR(_name, _mode, \ | ||
11 | _fabric##_nacl_attrib_show_##_name, \ | ||
12 | _fabric##_nacl_attrib_store_##_name); | ||
13 | |||
14 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_auth, se_node_acl); | ||
15 | #define TF_NACL_AUTH_ATTR(_fabric, _name, _mode) \ | ||
16 | static struct target_fabric_nacl_auth_attribute _fabric##_nacl_auth_##_name = \ | ||
17 | __CONFIGFS_EATTR(_name, _mode, \ | ||
18 | _fabric##_nacl_auth_show_##_name, \ | ||
19 | _fabric##_nacl_auth_store_##_name); | ||
20 | |||
21 | #define TF_NACL_AUTH_ATTR_RO(_fabric, _name) \ | ||
22 | static struct target_fabric_nacl_auth_attribute _fabric##_nacl_auth_##_name = \ | ||
23 | __CONFIGFS_EATTR_RO(_name, \ | ||
24 | _fabric##_nacl_auth_show_##_name); | ||
25 | |||
26 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_param, se_node_acl); | ||
27 | #define TF_NACL_PARAM_ATTR(_fabric, _name, _mode) \ | ||
28 | static struct target_fabric_nacl_param_attribute _fabric##_nacl_param_##_name = \ | ||
29 | __CONFIGFS_EATTR(_name, _mode, \ | ||
30 | _fabric##_nacl_param_show_##_name, \ | ||
31 | _fabric##_nacl_param_store_##_name); | ||
32 | |||
33 | #define TF_NACL_PARAM_ATTR_RO(_fabric, _name) \ | ||
34 | static struct target_fabric_nacl_param_attribute _fabric##_nacl_param_##_name = \ | ||
35 | __CONFIGFS_EATTR_RO(_name, \ | ||
36 | _fabric##_nacl_param_show_##_name); | ||
37 | |||
38 | |||
39 | CONFIGFS_EATTR_STRUCT(target_fabric_nacl_base, se_node_acl); | ||
40 | #define TF_NACL_BASE_ATTR(_fabric, _name, _mode) \ | ||
41 | static struct target_fabric_nacl_base_attribute _fabric##_nacl_##_name = \ | ||
42 | __CONFIGFS_EATTR(_name, _mode, \ | ||
43 | _fabric##_nacl_show_##_name, \ | ||
44 | _fabric##_nacl_store_##_name); | ||
45 | |||
46 | #define TF_NACL_BASE_ATTR_RO(_fabric, _name) \ | ||
47 | static struct target_fabric_nacl_base_attribute _fabric##_nacl_##_name = \ | ||
48 | __CONFIGFS_EATTR_RO(_name, \ | ||
49 | _fabric##_nacl_show_##_name); | ||
50 | |||
51 | CONFIGFS_EATTR_STRUCT(target_fabric_np_base, se_tpg_np); | ||
52 | #define TF_NP_BASE_ATTR(_fabric, _name, _mode) \ | ||
53 | static struct target_fabric_np_base_attribute _fabric##_np_##_name = \ | ||
54 | __CONFIGFS_EATTR(_name, _mode, \ | ||
55 | _fabric##_np_show_##_name, \ | ||
56 | _fabric##_np_store_##_name); | ||
57 | |||
58 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg_attrib, se_portal_group); | ||
59 | #define TF_TPG_ATTRIB_ATTR(_fabric, _name, _mode) \ | ||
60 | static struct target_fabric_tpg_attrib_attribute _fabric##_tpg_attrib_##_name = \ | ||
61 | __CONFIGFS_EATTR(_name, _mode, \ | ||
62 | _fabric##_tpg_attrib_show_##_name, \ | ||
63 | _fabric##_tpg_attrib_store_##_name); | ||
64 | |||
65 | |||
66 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group); | ||
67 | #define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \ | ||
68 | static struct target_fabric_tpg_param_attribute _fabric##_tpg_param_##_name = \ | ||
69 | __CONFIGFS_EATTR(_name, _mode, \ | ||
70 | _fabric##_tpg_param_show_##_name, \ | ||
71 | _fabric##_tpg_param_store_##_name); | ||
72 | |||
73 | |||
74 | CONFIGFS_EATTR_STRUCT(target_fabric_tpg, se_portal_group); | ||
75 | #define TF_TPG_BASE_ATTR(_fabric, _name, _mode) \ | ||
76 | static struct target_fabric_tpg_attribute _fabric##_tpg_##_name = \ | ||
77 | __CONFIGFS_EATTR(_name, _mode, \ | ||
78 | _fabric##_tpg_show_##_name, \ | ||
79 | _fabric##_tpg_store_##_name); | ||
80 | |||
81 | |||
82 | CONFIGFS_EATTR_STRUCT(target_fabric_wwn, target_fabric_configfs); | ||
83 | #define TF_WWN_ATTR(_fabric, _name, _mode) \ | ||
84 | static struct target_fabric_wwn_attribute _fabric##_wwn_##_name = \ | ||
85 | __CONFIGFS_EATTR(_name, _mode, \ | ||
86 | _fabric##_wwn_show_attr_##_name, \ | ||
87 | _fabric##_wwn_store_attr_##_name); | ||
88 | |||
89 | #define TF_WWN_ATTR_RO(_fabric, _name) \ | ||
90 | static struct target_fabric_wwn_attribute _fabric##_wwn_##_name = \ | ||
91 | __CONFIGFS_EATTR_RO(_name, \ | ||
92 | _fabric##_wwn_show_attr_##_name); | ||
93 | |||
94 | CONFIGFS_EATTR_STRUCT(target_fabric_discovery, target_fabric_configfs); | ||
95 | #define TF_DISC_ATTR(_fabric, _name, _mode) \ | ||
96 | static struct target_fabric_discovery_attribute _fabric##_disc_##_name = \ | ||
97 | __CONFIGFS_EATTR(_name, _mode, \ | ||
98 | _fabric##_disc_show_##_name, \ | ||
99 | _fabric##_disc_store_##_name); | ||
100 | |||
101 | #define TF_DISC_ATTR_RO(_fabric, _name) \ | ||
102 | static struct target_fabric_discovery_attribute _fabric##_disc_##_name = \ | ||
103 | __CONFIGFS_EATTR_RO(_name, \ | ||
104 | _fabric##_disc_show_##_name); | ||
105 | |||
106 | extern int target_fabric_setup_cits(struct target_fabric_configfs *); | ||
diff --git a/include/target/target_core_fabric_lib.h b/include/target/target_core_fabric_lib.h new file mode 100644 index 000000000000..c2f8d0e3a03b --- /dev/null +++ b/include/target/target_core_fabric_lib.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef TARGET_CORE_FABRIC_LIB_H | ||
2 | #define TARGET_CORE_FABRIC_LIB_H | ||
3 | |||
4 | extern u8 sas_get_fabric_proto_ident(struct se_portal_group *); | ||
5 | extern u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
6 | struct t10_pr_registration *, int *, unsigned char *); | ||
7 | extern u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
8 | struct t10_pr_registration *, int *); | ||
9 | extern char *sas_parse_pr_out_transport_id(struct se_portal_group *, | ||
10 | const char *, u32 *, char **); | ||
11 | |||
12 | extern u8 fc_get_fabric_proto_ident(struct se_portal_group *); | ||
13 | extern u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
14 | struct t10_pr_registration *, int *, unsigned char *); | ||
15 | extern u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
16 | struct t10_pr_registration *, int *); | ||
17 | extern char *fc_parse_pr_out_transport_id(struct se_portal_group *, | ||
18 | const char *, u32 *, char **); | ||
19 | |||
20 | extern u8 iscsi_get_fabric_proto_ident(struct se_portal_group *); | ||
21 | extern u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, | ||
22 | struct t10_pr_registration *, int *, unsigned char *); | ||
23 | extern u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, | ||
24 | struct t10_pr_registration *, int *); | ||
25 | extern char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, | ||
26 | const char *, u32 *, char **); | ||
27 | |||
28 | #endif /* TARGET_CORE_FABRIC_LIB_H */ | ||
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h new file mode 100644 index 000000000000..f3ac12b019c2 --- /dev/null +++ b/include/target/target_core_fabric_ops.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* Defined in target_core_configfs.h */ | ||
2 | struct target_fabric_configfs; | ||
3 | |||
4 | struct target_core_fabric_ops { | ||
5 | struct configfs_subsystem *tf_subsys; | ||
6 | /* | ||
7 | * Optional to signal struct se_task->task_sg[] padding entries | ||
8 | * for scatterlist chaining using transport_do_task_sg_link(), | ||
9 | * disabled by default | ||
10 | */ | ||
11 | int task_sg_chaining:1; | ||
12 | char *(*get_fabric_name)(void); | ||
13 | u8 (*get_fabric_proto_ident)(struct se_portal_group *); | ||
14 | char *(*tpg_get_wwn)(struct se_portal_group *); | ||
15 | u16 (*tpg_get_tag)(struct se_portal_group *); | ||
16 | u32 (*tpg_get_default_depth)(struct se_portal_group *); | ||
17 | u32 (*tpg_get_pr_transport_id)(struct se_portal_group *, | ||
18 | struct se_node_acl *, | ||
19 | struct t10_pr_registration *, int *, | ||
20 | unsigned char *); | ||
21 | u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group *, | ||
22 | struct se_node_acl *, | ||
23 | struct t10_pr_registration *, int *); | ||
24 | char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *, | ||
25 | const char *, u32 *, char **); | ||
26 | int (*tpg_check_demo_mode)(struct se_portal_group *); | ||
27 | int (*tpg_check_demo_mode_cache)(struct se_portal_group *); | ||
28 | int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); | ||
29 | int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); | ||
30 | struct se_node_acl *(*tpg_alloc_fabric_acl)( | ||
31 | struct se_portal_group *); | ||
32 | void (*tpg_release_fabric_acl)(struct se_portal_group *, | ||
33 | struct se_node_acl *); | ||
34 | u32 (*tpg_get_inst_index)(struct se_portal_group *); | ||
35 | /* | ||
36 | * Optional function pointer for TCM to perform command map | ||
37 | * from TCM processing thread context, for those struct se_cmd | ||
38 | * initally allocated in interrupt context. | ||
39 | */ | ||
40 | int (*new_cmd_map)(struct se_cmd *); | ||
41 | /* | ||
42 | * Optional function pointer for TCM fabric modules that use | ||
43 | * Linux/NET sockets to allocate struct iovec array to struct se_cmd | ||
44 | */ | ||
45 | int (*alloc_cmd_iovecs)(struct se_cmd *); | ||
46 | /* | ||
47 | * Optional to release struct se_cmd and fabric dependent allocated | ||
48 | * I/O descriptor in transport_cmd_check_stop() | ||
49 | */ | ||
50 | void (*check_stop_free)(struct se_cmd *); | ||
51 | void (*release_cmd_to_pool)(struct se_cmd *); | ||
52 | void (*release_cmd_direct)(struct se_cmd *); | ||
53 | /* | ||
54 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. | ||
55 | */ | ||
56 | int (*shutdown_session)(struct se_session *); | ||
57 | void (*close_session)(struct se_session *); | ||
58 | void (*stop_session)(struct se_session *, int, int); | ||
59 | void (*fall_back_to_erl0)(struct se_session *); | ||
60 | int (*sess_logged_in)(struct se_session *); | ||
61 | u32 (*sess_get_index)(struct se_session *); | ||
62 | /* | ||
63 | * Used only for SCSI fabrics that contain multi-value TransportIDs | ||
64 | * (like iSCSI). All other SCSI fabrics should set this to NULL. | ||
65 | */ | ||
66 | u32 (*sess_get_initiator_sid)(struct se_session *, | ||
67 | unsigned char *, u32); | ||
68 | int (*write_pending)(struct se_cmd *); | ||
69 | int (*write_pending_status)(struct se_cmd *); | ||
70 | void (*set_default_node_attributes)(struct se_node_acl *); | ||
71 | u32 (*get_task_tag)(struct se_cmd *); | ||
72 | int (*get_cmd_state)(struct se_cmd *); | ||
73 | void (*new_cmd_failure)(struct se_cmd *); | ||
74 | int (*queue_data_in)(struct se_cmd *); | ||
75 | int (*queue_status)(struct se_cmd *); | ||
76 | int (*queue_tm_rsp)(struct se_cmd *); | ||
77 | u16 (*set_fabric_sense_len)(struct se_cmd *, u32); | ||
78 | u16 (*get_fabric_sense_len)(void); | ||
79 | int (*is_state_remove)(struct se_cmd *); | ||
80 | u64 (*pack_lun)(unsigned int); | ||
81 | /* | ||
82 | * fabric module calls for target_core_fabric_configfs.c | ||
83 | */ | ||
84 | struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *, | ||
85 | struct config_group *, const char *); | ||
86 | void (*fabric_drop_wwn)(struct se_wwn *); | ||
87 | struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *, | ||
88 | struct config_group *, const char *); | ||
89 | void (*fabric_drop_tpg)(struct se_portal_group *); | ||
90 | int (*fabric_post_link)(struct se_portal_group *, | ||
91 | struct se_lun *); | ||
92 | void (*fabric_pre_unlink)(struct se_portal_group *, | ||
93 | struct se_lun *); | ||
94 | struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *, | ||
95 | struct config_group *, const char *); | ||
96 | void (*fabric_drop_np)(struct se_tpg_np *); | ||
97 | struct se_node_acl *(*fabric_make_nodeacl)(struct se_portal_group *, | ||
98 | struct config_group *, const char *); | ||
99 | void (*fabric_drop_nodeacl)(struct se_node_acl *); | ||
100 | }; | ||
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h new file mode 100644 index 000000000000..6c8248bc2c66 --- /dev/null +++ b/include/target/target_core_tmr.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef TARGET_CORE_TMR_H | ||
2 | #define TARGET_CORE_TMR_H | ||
3 | |||
4 | /* task management function values */ | ||
5 | #ifdef ABORT_TASK | ||
6 | #undef ABORT_TASK | ||
7 | #endif /* ABORT_TASK */ | ||
8 | #define ABORT_TASK 1 | ||
9 | #ifdef ABORT_TASK_SET | ||
10 | #undef ABORT_TASK_SET | ||
11 | #endif /* ABORT_TASK_SET */ | ||
12 | #define ABORT_TASK_SET 2 | ||
13 | #ifdef CLEAR_ACA | ||
14 | #undef CLEAR_ACA | ||
15 | #endif /* CLEAR_ACA */ | ||
16 | #define CLEAR_ACA 3 | ||
17 | #ifdef CLEAR_TASK_SET | ||
18 | #undef CLEAR_TASK_SET | ||
19 | #endif /* CLEAR_TASK_SET */ | ||
20 | #define CLEAR_TASK_SET 4 | ||
21 | #define LUN_RESET 5 | ||
22 | #define TARGET_WARM_RESET 6 | ||
23 | #define TARGET_COLD_RESET 7 | ||
24 | #define TASK_REASSIGN 8 | ||
25 | |||
26 | /* task management response values */ | ||
27 | #define TMR_FUNCTION_COMPLETE 0 | ||
28 | #define TMR_TASK_DOES_NOT_EXIST 1 | ||
29 | #define TMR_LUN_DOES_NOT_EXIST 2 | ||
30 | #define TMR_TASK_STILL_ALLEGIANT 3 | ||
31 | #define TMR_TASK_FAILOVER_NOT_SUPPORTED 4 | ||
32 | #define TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED 5 | ||
33 | #define TMR_FUNCTION_AUTHORIZATION_FAILED 6 | ||
34 | #define TMR_FUNCTION_REJECTED 255 | ||
35 | |||
36 | extern struct kmem_cache *se_tmr_req_cache; | ||
37 | |||
38 | extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8); | ||
39 | extern void core_tmr_release_req(struct se_tmr_req *); | ||
40 | extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *, | ||
41 | struct list_head *, struct se_cmd *); | ||
42 | |||
43 | #endif /* TARGET_CORE_TMR_H */ | ||
diff --git a/include/target/target_core_tpg.h b/include/target/target_core_tpg.h new file mode 100644 index 000000000000..77e18729c4c1 --- /dev/null +++ b/include/target/target_core_tpg.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef TARGET_CORE_TPG_H | ||
2 | #define TARGET_CORE_TPG_H | ||
3 | |||
4 | extern struct se_node_acl *__core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, | ||
5 | const char *); | ||
6 | extern struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, | ||
7 | unsigned char *); | ||
8 | extern void core_tpg_add_node_to_devs(struct se_node_acl *, | ||
9 | struct se_portal_group *); | ||
10 | extern struct se_node_acl *core_tpg_check_initiator_node_acl( | ||
11 | struct se_portal_group *, | ||
12 | unsigned char *); | ||
13 | extern void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *); | ||
14 | extern void core_tpg_wait_for_mib_ref(struct se_node_acl *); | ||
15 | extern void core_tpg_clear_object_luns(struct se_portal_group *); | ||
16 | extern struct se_node_acl *core_tpg_add_initiator_node_acl( | ||
17 | struct se_portal_group *, | ||
18 | struct se_node_acl *, | ||
19 | const char *, u32); | ||
20 | extern int core_tpg_del_initiator_node_acl(struct se_portal_group *, | ||
21 | struct se_node_acl *, int); | ||
22 | extern int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *, | ||
23 | unsigned char *, u32, int); | ||
24 | extern int core_tpg_register(struct target_core_fabric_ops *, | ||
25 | struct se_wwn *, | ||
26 | struct se_portal_group *, void *, | ||
27 | int); | ||
28 | extern int core_tpg_deregister(struct se_portal_group *); | ||
29 | extern struct se_lun *core_tpg_pre_addlun(struct se_portal_group *, u32); | ||
30 | extern int core_tpg_post_addlun(struct se_portal_group *, struct se_lun *, u32, | ||
31 | void *); | ||
32 | extern struct se_lun *core_tpg_pre_dellun(struct se_portal_group *, u32, int *); | ||
33 | extern int core_tpg_post_dellun(struct se_portal_group *, struct se_lun *); | ||
34 | |||
35 | #endif /* TARGET_CORE_TPG_H */ | ||
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h new file mode 100644 index 000000000000..246940511579 --- /dev/null +++ b/include/target/target_core_transport.h | |||
@@ -0,0 +1,353 @@ | |||
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 init_scsi_index_table(void); | ||
115 | extern u32 scsi_get_new_index(scsi_index_t); | ||
116 | extern void transport_init_queue_obj(struct se_queue_obj *); | ||
117 | extern int transport_subsystem_check_init(void); | ||
118 | extern int transport_subsystem_register(struct se_subsystem_api *); | ||
119 | extern void transport_subsystem_release(struct se_subsystem_api *); | ||
120 | extern void transport_load_plugins(void); | ||
121 | extern struct se_session *transport_init_session(void); | ||
122 | extern void __transport_register_session(struct se_portal_group *, | ||
123 | struct se_node_acl *, | ||
124 | struct se_session *, void *); | ||
125 | extern void transport_register_session(struct se_portal_group *, | ||
126 | struct se_node_acl *, | ||
127 | struct se_session *, void *); | ||
128 | extern void transport_free_session(struct se_session *); | ||
129 | extern void transport_deregister_session_configfs(struct se_session *); | ||
130 | extern void transport_deregister_session(struct se_session *); | ||
131 | extern void transport_cmd_finish_abort(struct se_cmd *, int); | ||
132 | extern void transport_cmd_finish_abort_tmr(struct se_cmd *); | ||
133 | extern void transport_complete_sync_cache(struct se_cmd *, int); | ||
134 | extern void transport_complete_task(struct se_task *, int); | ||
135 | extern void transport_add_task_to_execute_queue(struct se_task *, | ||
136 | struct se_task *, | ||
137 | struct se_device *); | ||
138 | unsigned char *transport_dump_cmd_direction(struct se_cmd *); | ||
139 | extern void transport_dump_dev_state(struct se_device *, char *, int *); | ||
140 | extern void transport_dump_dev_info(struct se_device *, struct se_lun *, | ||
141 | unsigned long long, char *, int *); | ||
142 | extern void transport_dump_vpd_proto_id(struct t10_vpd *, | ||
143 | unsigned char *, int); | ||
144 | extern void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); | ||
145 | extern int transport_dump_vpd_assoc(struct t10_vpd *, | ||
146 | unsigned char *, int); | ||
147 | extern int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); | ||
148 | extern int transport_dump_vpd_ident_type(struct t10_vpd *, | ||
149 | unsigned char *, int); | ||
150 | extern int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *); | ||
151 | extern int transport_dump_vpd_ident(struct t10_vpd *, | ||
152 | unsigned char *, int); | ||
153 | extern int transport_set_vpd_ident(struct t10_vpd *, unsigned char *); | ||
154 | extern struct se_device *transport_add_device_to_core_hba(struct se_hba *, | ||
155 | struct se_subsystem_api *, | ||
156 | struct se_subsystem_dev *, u32, | ||
157 | void *, struct se_dev_limits *, | ||
158 | const char *, const char *); | ||
159 | extern void transport_device_setup_cmd(struct se_cmd *); | ||
160 | extern void transport_init_se_cmd(struct se_cmd *, | ||
161 | struct target_core_fabric_ops *, | ||
162 | struct se_session *, u32, int, int, | ||
163 | unsigned char *); | ||
164 | extern void transport_free_se_cmd(struct se_cmd *); | ||
165 | extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); | ||
166 | extern int transport_generic_handle_cdb(struct se_cmd *); | ||
167 | extern int transport_generic_handle_cdb_map(struct se_cmd *); | ||
168 | extern int transport_generic_handle_data(struct se_cmd *); | ||
169 | extern void transport_new_cmd_failure(struct se_cmd *); | ||
170 | extern int transport_generic_handle_tmr(struct se_cmd *); | ||
171 | extern void __transport_stop_task_timer(struct se_task *, unsigned long *); | ||
172 | extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]); | ||
173 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, | ||
174 | struct scatterlist *, u32); | ||
175 | extern int transport_clear_lun_from_sessions(struct se_lun *); | ||
176 | extern int transport_check_aborted_status(struct se_cmd *, int); | ||
177 | extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); | ||
178 | extern void transport_send_task_abort(struct se_cmd *); | ||
179 | extern void transport_release_cmd_to_pool(struct se_cmd *); | ||
180 | extern void transport_generic_free_cmd(struct se_cmd *, int, int, int); | ||
181 | extern void transport_generic_wait_for_cmds(struct se_cmd *, int); | ||
182 | extern u32 transport_calc_sg_num(struct se_task *, struct se_mem *, u32); | ||
183 | extern int transport_map_mem_to_sg(struct se_task *, struct list_head *, | ||
184 | void *, struct se_mem *, | ||
185 | struct se_mem **, u32 *, u32 *); | ||
186 | extern void transport_do_task_sg_chain(struct se_cmd *); | ||
187 | extern void transport_generic_process_write(struct se_cmd *); | ||
188 | extern int transport_generic_do_tmr(struct se_cmd *); | ||
189 | /* From target_core_alua.c */ | ||
190 | extern int core_alua_check_nonop_delay(struct se_cmd *); | ||
191 | |||
192 | /* | ||
193 | * Each se_transport_task_t can have N number of possible struct se_task's | ||
194 | * for the storage transport(s) to possibly execute. | ||
195 | * Used primarily for splitting up CDBs that exceed the physical storage | ||
196 | * HBA's maximum sector count per task. | ||
197 | */ | ||
198 | struct se_mem { | ||
199 | struct page *se_page; | ||
200 | u32 se_len; | ||
201 | u32 se_off; | ||
202 | struct list_head se_list; | ||
203 | } ____cacheline_aligned; | ||
204 | |||
205 | /* | ||
206 | * Each type of disk transport supported MUST have a template defined | ||
207 | * within its .h file. | ||
208 | */ | ||
209 | struct se_subsystem_api { | ||
210 | /* | ||
211 | * The Name. :-) | ||
212 | */ | ||
213 | char name[16]; | ||
214 | /* | ||
215 | * Transport Type. | ||
216 | */ | ||
217 | u8 transport_type; | ||
218 | /* | ||
219 | * struct module for struct se_hba references | ||
220 | */ | ||
221 | struct module *owner; | ||
222 | /* | ||
223 | * Used for global se_subsystem_api list_head | ||
224 | */ | ||
225 | struct list_head sub_api_list; | ||
226 | /* | ||
227 | * For SCF_SCSI_NON_DATA_CDB | ||
228 | */ | ||
229 | int (*cdb_none)(struct se_task *); | ||
230 | /* | ||
231 | * For SCF_SCSI_CONTROL_NONSG_IO_CDB | ||
232 | */ | ||
233 | int (*map_task_non_SG)(struct se_task *); | ||
234 | /* | ||
235 | * For SCF_SCSI_DATA_SG_IO_CDB and SCF_SCSI_CONTROL_SG_IO_CDB | ||
236 | */ | ||
237 | int (*map_task_SG)(struct se_task *); | ||
238 | /* | ||
239 | * attach_hba(): | ||
240 | */ | ||
241 | int (*attach_hba)(struct se_hba *, u32); | ||
242 | /* | ||
243 | * detach_hba(): | ||
244 | */ | ||
245 | void (*detach_hba)(struct se_hba *); | ||
246 | /* | ||
247 | * pmode_hba(): Used for TCM/pSCSI subsystem plugin HBA -> | ||
248 | * Linux/SCSI struct Scsi_Host passthrough | ||
249 | */ | ||
250 | int (*pmode_enable_hba)(struct se_hba *, unsigned long); | ||
251 | /* | ||
252 | * allocate_virtdevice(): | ||
253 | */ | ||
254 | void *(*allocate_virtdevice)(struct se_hba *, const char *); | ||
255 | /* | ||
256 | * create_virtdevice(): Only for Virtual HBAs | ||
257 | */ | ||
258 | struct se_device *(*create_virtdevice)(struct se_hba *, | ||
259 | struct se_subsystem_dev *, void *); | ||
260 | /* | ||
261 | * free_device(): | ||
262 | */ | ||
263 | void (*free_device)(void *); | ||
264 | |||
265 | /* | ||
266 | * dpo_emulated(): | ||
267 | */ | ||
268 | int (*dpo_emulated)(struct se_device *); | ||
269 | /* | ||
270 | * fua_write_emulated(): | ||
271 | */ | ||
272 | int (*fua_write_emulated)(struct se_device *); | ||
273 | /* | ||
274 | * fua_read_emulated(): | ||
275 | */ | ||
276 | int (*fua_read_emulated)(struct se_device *); | ||
277 | /* | ||
278 | * write_cache_emulated(): | ||
279 | */ | ||
280 | int (*write_cache_emulated)(struct se_device *); | ||
281 | /* | ||
282 | * transport_complete(): | ||
283 | * | ||
284 | * Use transport_generic_complete() for majority of DAS transport | ||
285 | * drivers. Provided out of convenience. | ||
286 | */ | ||
287 | int (*transport_complete)(struct se_task *task); | ||
288 | struct se_task *(*alloc_task)(struct se_cmd *); | ||
289 | /* | ||
290 | * do_task(): | ||
291 | */ | ||
292 | int (*do_task)(struct se_task *); | ||
293 | /* | ||
294 | * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate | ||
295 | * UNMAP and WRITE_SAME_* w/ UNMAP=1 <-> Linux/Block Discard | ||
296 | */ | ||
297 | int (*do_discard)(struct se_device *, sector_t, u32); | ||
298 | /* | ||
299 | * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate | ||
300 | * SYNCHRONIZE_CACHE_* <-> Linux/Block blkdev_issue_flush() | ||
301 | */ | ||
302 | void (*do_sync_cache)(struct se_task *); | ||
303 | /* | ||
304 | * free_task(): | ||
305 | */ | ||
306 | void (*free_task)(struct se_task *); | ||
307 | /* | ||
308 | * check_configfs_dev_params(): | ||
309 | */ | ||
310 | ssize_t (*check_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *); | ||
311 | /* | ||
312 | * set_configfs_dev_params(): | ||
313 | */ | ||
314 | ssize_t (*set_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, | ||
315 | const char *, ssize_t); | ||
316 | /* | ||
317 | * show_configfs_dev_params(): | ||
318 | */ | ||
319 | ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, | ||
320 | char *); | ||
321 | /* | ||
322 | * get_cdb(): | ||
323 | */ | ||
324 | unsigned char *(*get_cdb)(struct se_task *); | ||
325 | /* | ||
326 | * get_device_rev(): | ||
327 | */ | ||
328 | u32 (*get_device_rev)(struct se_device *); | ||
329 | /* | ||
330 | * get_device_type(): | ||
331 | */ | ||
332 | u32 (*get_device_type)(struct se_device *); | ||
333 | /* | ||
334 | * Get the sector_t from a subsystem backstore.. | ||
335 | */ | ||
336 | sector_t (*get_blocks)(struct se_device *); | ||
337 | /* | ||
338 | * do_se_mem_map(): | ||
339 | */ | ||
340 | int (*do_se_mem_map)(struct se_task *, struct list_head *, void *, | ||
341 | struct se_mem *, struct se_mem **, u32 *, u32 *); | ||
342 | /* | ||
343 | * get_sense_buffer(): | ||
344 | */ | ||
345 | unsigned char *(*get_sense_buffer)(struct se_task *); | ||
346 | } ____cacheline_aligned; | ||
347 | |||
348 | #define TRANSPORT(dev) ((dev)->transport) | ||
349 | #define HBA_TRANSPORT(hba) ((hba)->transport) | ||
350 | |||
351 | extern struct se_global *se_global; | ||
352 | |||
353 | #endif /* TARGET_CORE_TRANSPORT_H */ | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 1dfab5401511..da39b22636f7 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -21,11 +21,30 @@ | |||
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) \ |
27 | DEFINE_TRACE(name) | 37 | DEFINE_TRACE(name) |
28 | 38 | ||
39 | #undef TRACE_EVENT_CONDITION | ||
40 | #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \ | ||
41 | TRACE_EVENT(name, \ | ||
42 | PARAMS(proto), \ | ||
43 | PARAMS(args), \ | ||
44 | PARAMS(tstruct), \ | ||
45 | PARAMS(assign), \ | ||
46 | PARAMS(print)) | ||
47 | |||
29 | #undef TRACE_EVENT_FN | 48 | #undef TRACE_EVENT_FN |
30 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | 49 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ |
31 | assign, print, reg, unreg) \ | 50 | assign, print, reg, unreg) \ |
@@ -39,6 +58,10 @@ | |||
39 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 58 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
40 | DEFINE_TRACE(name) | 59 | DEFINE_TRACE(name) |
41 | 60 | ||
61 | #undef DEFINE_EVENT_CONDITION | ||
62 | #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \ | ||
63 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
64 | |||
42 | #undef DECLARE_TRACE | 65 | #undef DECLARE_TRACE |
43 | #define DECLARE_TRACE(name, proto, args) \ | 66 | #define DECLARE_TRACE(name, proto, args) \ |
44 | DEFINE_TRACE(name) | 67 | DEFINE_TRACE(name) |
@@ -75,9 +98,11 @@ | |||
75 | 98 | ||
76 | #undef TRACE_EVENT | 99 | #undef TRACE_EVENT |
77 | #undef TRACE_EVENT_FN | 100 | #undef TRACE_EVENT_FN |
101 | #undef TRACE_EVENT_CONDITION | ||
78 | #undef DECLARE_EVENT_CLASS | 102 | #undef DECLARE_EVENT_CLASS |
79 | #undef DEFINE_EVENT | 103 | #undef DEFINE_EVENT |
80 | #undef DEFINE_EVENT_PRINT | 104 | #undef DEFINE_EVENT_PRINT |
105 | #undef DEFINE_EVENT_CONDITION | ||
81 | #undef TRACE_HEADER_MULTI_READ | 106 | #undef TRACE_HEADER_MULTI_READ |
82 | #undef DECLARE_TRACE | 107 | #undef DECLARE_TRACE |
83 | 108 | ||
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h new file mode 100644 index 000000000000..186e84db4b54 --- /dev/null +++ b/include/trace/events/asoc.h | |||
@@ -0,0 +1,235 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM asoc | ||
3 | |||
4 | #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_ASOC_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | struct snd_soc_jack; | ||
11 | struct snd_soc_codec; | ||
12 | struct snd_soc_card; | ||
13 | struct snd_soc_dapm_widget; | ||
14 | |||
15 | /* | ||
16 | * Log register events | ||
17 | */ | ||
18 | DECLARE_EVENT_CLASS(snd_soc_reg, | ||
19 | |||
20 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
21 | unsigned int val), | ||
22 | |||
23 | TP_ARGS(codec, reg, val), | ||
24 | |||
25 | TP_STRUCT__entry( | ||
26 | __string( name, codec->name ) | ||
27 | __field( int, id ) | ||
28 | __field( unsigned int, reg ) | ||
29 | __field( unsigned int, val ) | ||
30 | ), | ||
31 | |||
32 | TP_fast_assign( | ||
33 | __assign_str(name, codec->name); | ||
34 | __entry->id = codec->id; | ||
35 | __entry->reg = reg; | ||
36 | __entry->val = val; | ||
37 | ), | ||
38 | |||
39 | TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name), | ||
40 | (int)__entry->id, (unsigned int)__entry->reg, | ||
41 | (unsigned int)__entry->val) | ||
42 | ); | ||
43 | |||
44 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write, | ||
45 | |||
46 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
47 | unsigned int val), | ||
48 | |||
49 | TP_ARGS(codec, reg, val) | ||
50 | |||
51 | ); | ||
52 | |||
53 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | ||
54 | |||
55 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
56 | unsigned int val), | ||
57 | |||
58 | TP_ARGS(codec, reg, val) | ||
59 | |||
60 | ); | ||
61 | |||
62 | DECLARE_EVENT_CLASS(snd_soc_card, | ||
63 | |||
64 | TP_PROTO(struct snd_soc_card *card, int val), | ||
65 | |||
66 | TP_ARGS(card, val), | ||
67 | |||
68 | TP_STRUCT__entry( | ||
69 | __string( name, card->name ) | ||
70 | __field( int, val ) | ||
71 | ), | ||
72 | |||
73 | TP_fast_assign( | ||
74 | __assign_str(name, card->name); | ||
75 | __entry->val = val; | ||
76 | ), | ||
77 | |||
78 | TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) | ||
79 | ); | ||
80 | |||
81 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, | ||
82 | |||
83 | TP_PROTO(struct snd_soc_card *card, int val), | ||
84 | |||
85 | TP_ARGS(card, val) | ||
86 | |||
87 | ); | ||
88 | |||
89 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, | ||
90 | |||
91 | TP_PROTO(struct snd_soc_card *card, int val), | ||
92 | |||
93 | TP_ARGS(card, val) | ||
94 | |||
95 | ); | ||
96 | |||
97 | DECLARE_EVENT_CLASS(snd_soc_dapm_basic, | ||
98 | |||
99 | TP_PROTO(struct snd_soc_card *card), | ||
100 | |||
101 | TP_ARGS(card), | ||
102 | |||
103 | TP_STRUCT__entry( | ||
104 | __string( name, card->name ) | ||
105 | ), | ||
106 | |||
107 | TP_fast_assign( | ||
108 | __assign_str(name, card->name); | ||
109 | ), | ||
110 | |||
111 | TP_printk("card=%s", __get_str(name)) | ||
112 | ); | ||
113 | |||
114 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, | ||
115 | |||
116 | TP_PROTO(struct snd_soc_card *card), | ||
117 | |||
118 | TP_ARGS(card) | ||
119 | |||
120 | ); | ||
121 | |||
122 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, | ||
123 | |||
124 | TP_PROTO(struct snd_soc_card *card), | ||
125 | |||
126 | TP_ARGS(card) | ||
127 | |||
128 | ); | ||
129 | |||
130 | DECLARE_EVENT_CLASS(snd_soc_dapm_widget, | ||
131 | |||
132 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
133 | |||
134 | TP_ARGS(w, val), | ||
135 | |||
136 | TP_STRUCT__entry( | ||
137 | __string( name, w->name ) | ||
138 | __field( int, val ) | ||
139 | ), | ||
140 | |||
141 | TP_fast_assign( | ||
142 | __assign_str(name, w->name); | ||
143 | __entry->val = val; | ||
144 | ), | ||
145 | |||
146 | TP_printk("widget=%s val=%d", __get_str(name), | ||
147 | (int)__entry->val) | ||
148 | ); | ||
149 | |||
150 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, | ||
151 | |||
152 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
153 | |||
154 | TP_ARGS(w, val) | ||
155 | |||
156 | ); | ||
157 | |||
158 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, | ||
159 | |||
160 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
161 | |||
162 | TP_ARGS(w, val) | ||
163 | |||
164 | ); | ||
165 | |||
166 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, | ||
167 | |||
168 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
169 | |||
170 | TP_ARGS(w, val) | ||
171 | |||
172 | ); | ||
173 | |||
174 | TRACE_EVENT(snd_soc_jack_irq, | ||
175 | |||
176 | TP_PROTO(const char *name), | ||
177 | |||
178 | TP_ARGS(name), | ||
179 | |||
180 | TP_STRUCT__entry( | ||
181 | __string( name, name ) | ||
182 | ), | ||
183 | |||
184 | TP_fast_assign( | ||
185 | __assign_str(name, name); | ||
186 | ), | ||
187 | |||
188 | TP_printk("%s", __get_str(name)) | ||
189 | ); | ||
190 | |||
191 | TRACE_EVENT(snd_soc_jack_report, | ||
192 | |||
193 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), | ||
194 | |||
195 | TP_ARGS(jack, mask, val), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __string( name, jack->jack->name ) | ||
199 | __field( int, mask ) | ||
200 | __field( int, val ) | ||
201 | ), | ||
202 | |||
203 | TP_fast_assign( | ||
204 | __assign_str(name, jack->jack->name); | ||
205 | __entry->mask = mask; | ||
206 | __entry->val = val; | ||
207 | ), | ||
208 | |||
209 | TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val, | ||
210 | (int)__entry->mask) | ||
211 | ); | ||
212 | |||
213 | TRACE_EVENT(snd_soc_jack_notify, | ||
214 | |||
215 | TP_PROTO(struct snd_soc_jack *jack, int val), | ||
216 | |||
217 | TP_ARGS(jack, val), | ||
218 | |||
219 | TP_STRUCT__entry( | ||
220 | __string( name, jack->jack->name ) | ||
221 | __field( int, val ) | ||
222 | ), | ||
223 | |||
224 | TP_fast_assign( | ||
225 | __assign_str(name, jack->jack->name); | ||
226 | __entry->val = val; | ||
227 | ), | ||
228 | |||
229 | TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) | ||
230 | ); | ||
231 | |||
232 | #endif /* _TRACE_ASOC_H */ | ||
233 | |||
234 | /* This part must be outside protection */ | ||
235 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d8ce278515c3..aba421d68f6f 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -206,15 +206,16 @@ TRACE_EVENT(block_bio_bounce, | |||
206 | * block_bio_complete - completed all work on the block operation | 206 | * block_bio_complete - completed all work on the block operation |
207 | * @q: queue holding the block operation | 207 | * @q: queue holding the block operation |
208 | * @bio: block operation completed | 208 | * @bio: block operation completed |
209 | * @error: io error value | ||
209 | * | 210 | * |
210 | * This tracepoint indicates there is no further work to do on this | 211 | * This tracepoint indicates there is no further work to do on this |
211 | * block IO operation @bio. | 212 | * block IO operation @bio. |
212 | */ | 213 | */ |
213 | TRACE_EVENT(block_bio_complete, | 214 | TRACE_EVENT(block_bio_complete, |
214 | 215 | ||
215 | TP_PROTO(struct request_queue *q, struct bio *bio), | 216 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), |
216 | 217 | ||
217 | TP_ARGS(q, bio), | 218 | TP_ARGS(q, bio, error), |
218 | 219 | ||
219 | TP_STRUCT__entry( | 220 | TP_STRUCT__entry( |
220 | __field( dev_t, dev ) | 221 | __field( dev_t, dev ) |
@@ -228,6 +229,7 @@ TRACE_EVENT(block_bio_complete, | |||
228 | __entry->dev = bio->bi_bdev->bd_dev; | 229 | __entry->dev = bio->bi_bdev->bd_dev; |
229 | __entry->sector = bio->bi_sector; | 230 | __entry->sector = bio->bi_sector; |
230 | __entry->nr_sector = bio->bi_size >> 9; | 231 | __entry->nr_sector = bio->bi_size >> 9; |
232 | __entry->error = error; | ||
231 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | 233 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
232 | ), | 234 | ), |
233 | 235 | ||
@@ -486,16 +488,16 @@ TRACE_EVENT(block_split, | |||
486 | ); | 488 | ); |
487 | 489 | ||
488 | /** | 490 | /** |
489 | * block_remap - map request for a partition to the raw device | 491 | * block_bio_remap - map request for a logical device to the raw device |
490 | * @q: queue holding the operation | 492 | * @q: queue holding the operation |
491 | * @bio: revised operation | 493 | * @bio: revised operation |
492 | * @dev: device for the operation | 494 | * @dev: device for the operation |
493 | * @from: original sector for the operation | 495 | * @from: original sector for the operation |
494 | * | 496 | * |
495 | * An operation for a partition on a block device has been mapped to the | 497 | * An operation for a logical device has been mapped to the |
496 | * raw block device. | 498 | * raw block device. |
497 | */ | 499 | */ |
498 | TRACE_EVENT(block_remap, | 500 | TRACE_EVENT(block_bio_remap, |
499 | 501 | ||
500 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | 502 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, |
501 | sector_t from), | 503 | sector_t from), |
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h new file mode 100644 index 000000000000..388bcdd26d46 --- /dev/null +++ b/include/trace/events/compaction.h | |||
@@ -0,0 +1,74 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM compaction | ||
3 | |||
4 | #if !defined(_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_COMPACTION_H | ||
6 | |||
7 | #include <linux/types.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | #include "gfpflags.h" | ||
10 | |||
11 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, | ||
12 | |||
13 | TP_PROTO(unsigned long nr_scanned, | ||
14 | unsigned long nr_taken), | ||
15 | |||
16 | TP_ARGS(nr_scanned, nr_taken), | ||
17 | |||
18 | TP_STRUCT__entry( | ||
19 | __field(unsigned long, nr_scanned) | ||
20 | __field(unsigned long, nr_taken) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | __entry->nr_scanned = nr_scanned; | ||
25 | __entry->nr_taken = nr_taken; | ||
26 | ), | ||
27 | |||
28 | TP_printk("nr_scanned=%lu nr_taken=%lu", | ||
29 | __entry->nr_scanned, | ||
30 | __entry->nr_taken) | ||
31 | ); | ||
32 | |||
33 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, | ||
34 | |||
35 | TP_PROTO(unsigned long nr_scanned, | ||
36 | unsigned long nr_taken), | ||
37 | |||
38 | TP_ARGS(nr_scanned, nr_taken) | ||
39 | ); | ||
40 | |||
41 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, | ||
42 | TP_PROTO(unsigned long nr_scanned, | ||
43 | unsigned long nr_taken), | ||
44 | |||
45 | TP_ARGS(nr_scanned, nr_taken) | ||
46 | ); | ||
47 | |||
48 | TRACE_EVENT(mm_compaction_migratepages, | ||
49 | |||
50 | TP_PROTO(unsigned long nr_migrated, | ||
51 | unsigned long nr_failed), | ||
52 | |||
53 | TP_ARGS(nr_migrated, nr_failed), | ||
54 | |||
55 | TP_STRUCT__entry( | ||
56 | __field(unsigned long, nr_migrated) | ||
57 | __field(unsigned long, nr_failed) | ||
58 | ), | ||
59 | |||
60 | TP_fast_assign( | ||
61 | __entry->nr_migrated = nr_migrated; | ||
62 | __entry->nr_failed = nr_failed; | ||
63 | ), | ||
64 | |||
65 | TP_printk("nr_migrated=%lu nr_failed=%lu", | ||
66 | __entry->nr_migrated, | ||
67 | __entry->nr_failed) | ||
68 | ); | ||
69 | |||
70 | |||
71 | #endif /* _TRACE_COMPACTION_H */ | ||
72 | |||
73 | /* This part must be outside protection */ | ||
74 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 6dd3a51ab1cb..46e3cd8e197a 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -6,6 +6,36 @@ | |||
6 | #undef TRACE_SYSTEM | 6 | #undef TRACE_SYSTEM |
7 | #define TRACE_SYSTEM kvm | 7 | #define TRACE_SYSTEM kvm |
8 | 8 | ||
9 | #define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } | ||
10 | |||
11 | #define kvm_trace_exit_reason \ | ||
12 | ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ | ||
13 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ | ||
14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | ||
15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | ||
16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) | ||
17 | |||
18 | TRACE_EVENT(kvm_userspace_exit, | ||
19 | TP_PROTO(__u32 reason, int errno), | ||
20 | TP_ARGS(reason, errno), | ||
21 | |||
22 | TP_STRUCT__entry( | ||
23 | __field( __u32, reason ) | ||
24 | __field( int, errno ) | ||
25 | ), | ||
26 | |||
27 | TP_fast_assign( | ||
28 | __entry->reason = reason; | ||
29 | __entry->errno = errno; | ||
30 | ), | ||
31 | |||
32 | TP_printk("reason %s (%d)", | ||
33 | __entry->errno < 0 ? | ||
34 | (__entry->errno == -EINTR ? "restart" : "error") : | ||
35 | __print_symbolic(__entry->reason, kvm_trace_exit_reason), | ||
36 | __entry->errno < 0 ? -__entry->errno : __entry->reason) | ||
37 | ); | ||
38 | |||
9 | #if defined(__KVM_HAVE_IOAPIC) | 39 | #if defined(__KVM_HAVE_IOAPIC) |
10 | TRACE_EVENT(kvm_set_irq, | 40 | TRACE_EVENT(kvm_set_irq, |
11 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | 41 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
@@ -185,6 +215,97 @@ TRACE_EVENT(kvm_age_page, | |||
185 | __entry->referenced ? "YOUNG" : "OLD") | 215 | __entry->referenced ? "YOUNG" : "OLD") |
186 | ); | 216 | ); |
187 | 217 | ||
218 | #ifdef CONFIG_KVM_ASYNC_PF | ||
219 | DECLARE_EVENT_CLASS(kvm_async_get_page_class, | ||
220 | |||
221 | TP_PROTO(u64 gva, u64 gfn), | ||
222 | |||
223 | TP_ARGS(gva, gfn), | ||
224 | |||
225 | TP_STRUCT__entry( | ||
226 | __field(__u64, gva) | ||
227 | __field(u64, gfn) | ||
228 | ), | ||
229 | |||
230 | TP_fast_assign( | ||
231 | __entry->gva = gva; | ||
232 | __entry->gfn = gfn; | ||
233 | ), | ||
234 | |||
235 | TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn) | ||
236 | ); | ||
237 | |||
238 | DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page, | ||
239 | |||
240 | TP_PROTO(u64 gva, u64 gfn), | ||
241 | |||
242 | TP_ARGS(gva, gfn) | ||
243 | ); | ||
244 | |||
245 | DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault, | ||
246 | |||
247 | TP_PROTO(u64 gva, u64 gfn), | ||
248 | |||
249 | TP_ARGS(gva, gfn) | ||
250 | ); | ||
251 | |||
252 | DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready, | ||
253 | |||
254 | TP_PROTO(u64 token, u64 gva), | ||
255 | |||
256 | TP_ARGS(token, gva), | ||
257 | |||
258 | TP_STRUCT__entry( | ||
259 | __field(__u64, token) | ||
260 | __field(__u64, gva) | ||
261 | ), | ||
262 | |||
263 | TP_fast_assign( | ||
264 | __entry->token = token; | ||
265 | __entry->gva = gva; | ||
266 | ), | ||
267 | |||
268 | TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva) | ||
269 | |||
270 | ); | ||
271 | |||
272 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, | ||
273 | |||
274 | TP_PROTO(u64 token, u64 gva), | ||
275 | |||
276 | TP_ARGS(token, gva) | ||
277 | ); | ||
278 | |||
279 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, | ||
280 | |||
281 | TP_PROTO(u64 token, u64 gva), | ||
282 | |||
283 | TP_ARGS(token, gva) | ||
284 | ); | ||
285 | |||
286 | TRACE_EVENT( | ||
287 | kvm_async_pf_completed, | ||
288 | TP_PROTO(unsigned long address, struct page *page, u64 gva), | ||
289 | TP_ARGS(address, page, gva), | ||
290 | |||
291 | TP_STRUCT__entry( | ||
292 | __field(unsigned long, address) | ||
293 | __field(pfn_t, pfn) | ||
294 | __field(u64, gva) | ||
295 | ), | ||
296 | |||
297 | TP_fast_assign( | ||
298 | __entry->address = address; | ||
299 | __entry->pfn = page ? page_to_pfn(page) : 0; | ||
300 | __entry->gva = gva; | ||
301 | ), | ||
302 | |||
303 | TP_printk("gva %#llx address %#lx pfn %#llx", __entry->gva, | ||
304 | __entry->address, __entry->pfn) | ||
305 | ); | ||
306 | |||
307 | #endif | ||
308 | |||
188 | #endif /* _TRACE_KVM_MAIN_H */ | 309 | #endif /* _TRACE_KVM_MAIN_H */ |
189 | 310 | ||
190 | /* This part must be outside protection */ | 311 | /* This part must be outside protection */ |
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index c7bb2f0482fe..c6bae36547e5 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -1,5 +1,15 @@ | |||
1 | /* | ||
2 | * Because linux/module.h has tracepoints in the header, and ftrace.h | ||
3 | * eventually includes this file, define_trace.h includes linux/module.h | ||
4 | * But we do not want the module.h to override the TRACE_SYSTEM macro | ||
5 | * variable that define_trace.h is processing, so we only set it | ||
6 | * when module events are being processed, which would happen when | ||
7 | * CREATE_TRACE_POINTS is defined. | ||
8 | */ | ||
9 | #ifdef CREATE_TRACE_POINTS | ||
1 | #undef TRACE_SYSTEM | 10 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM module | 11 | #define TRACE_SYSTEM module |
12 | #endif | ||
3 | 13 | ||
4 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) | 14 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define _TRACE_MODULE_H | 15 | #define _TRACE_MODULE_H |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 286784d69b8f..1bcc2a8c00e2 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -7,16 +7,67 @@ | |||
7 | #include <linux/ktime.h> | 7 | #include <linux/ktime.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | #ifndef _TRACE_POWER_ENUM_ | 10 | DECLARE_EVENT_CLASS(cpu, |
11 | #define _TRACE_POWER_ENUM_ | 11 | |
12 | enum { | 12 | TP_PROTO(unsigned int state, unsigned int cpu_id), |
13 | POWER_NONE = 0, | 13 | |
14 | POWER_CSTATE = 1, /* C-State */ | 14 | TP_ARGS(state, cpu_id), |
15 | POWER_PSTATE = 2, /* Fequency change or DVFS */ | 15 | |
16 | POWER_SSTATE = 3, /* Suspend */ | 16 | TP_STRUCT__entry( |
17 | }; | 17 | __field( u32, state ) |
18 | __field( u32, cpu_id ) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->state = state; | ||
23 | __entry->cpu_id = cpu_id; | ||
24 | ), | ||
25 | |||
26 | TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state, | ||
27 | (unsigned long)__entry->cpu_id) | ||
28 | ); | ||
29 | |||
30 | DEFINE_EVENT(cpu, cpu_idle, | ||
31 | |||
32 | TP_PROTO(unsigned int state, unsigned int cpu_id), | ||
33 | |||
34 | TP_ARGS(state, cpu_id) | ||
35 | ); | ||
36 | |||
37 | /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ | ||
38 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING | ||
39 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING | ||
40 | |||
41 | #define PWR_EVENT_EXIT -1 | ||
18 | #endif | 42 | #endif |
19 | 43 | ||
44 | DEFINE_EVENT(cpu, cpu_frequency, | ||
45 | |||
46 | TP_PROTO(unsigned int frequency, unsigned int cpu_id), | ||
47 | |||
48 | TP_ARGS(frequency, cpu_id) | ||
49 | ); | ||
50 | |||
51 | TRACE_EVENT(machine_suspend, | ||
52 | |||
53 | TP_PROTO(unsigned int state), | ||
54 | |||
55 | TP_ARGS(state), | ||
56 | |||
57 | TP_STRUCT__entry( | ||
58 | __field( u32, state ) | ||
59 | ), | ||
60 | |||
61 | TP_fast_assign( | ||
62 | __entry->state = state; | ||
63 | ), | ||
64 | |||
65 | TP_printk("state=%lu", (unsigned long)__entry->state) | ||
66 | ); | ||
67 | |||
68 | /* This code will be removed after deprecation time exceeded (2.6.41) */ | ||
69 | #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED | ||
70 | |||
20 | /* | 71 | /* |
21 | * The power events are used for cpuidle & suspend (power_start, power_end) | 72 | * The power events are used for cpuidle & suspend (power_start, power_end) |
22 | * and for cpufreq (power_frequency) | 73 | * and for cpufreq (power_frequency) |
@@ -75,6 +126,36 @@ TRACE_EVENT(power_end, | |||
75 | 126 | ||
76 | ); | 127 | ); |
77 | 128 | ||
129 | /* Deprecated dummy functions must be protected against multi-declartion */ | ||
130 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
131 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
132 | |||
133 | enum { | ||
134 | POWER_NONE = 0, | ||
135 | POWER_CSTATE = 1, | ||
136 | POWER_PSTATE = 2, | ||
137 | }; | ||
138 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
139 | |||
140 | #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
141 | |||
142 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
143 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
144 | enum { | ||
145 | POWER_NONE = 0, | ||
146 | POWER_CSTATE = 1, | ||
147 | POWER_PSTATE = 2, | ||
148 | }; | ||
149 | |||
150 | /* These dummy declaration have to be ripped out when the deprecated | ||
151 | events get removed */ | ||
152 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | ||
153 | static inline void trace_power_end(u64 cpuid) {}; | ||
154 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | ||
155 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
156 | |||
157 | #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
158 | |||
78 | /* | 159 | /* |
79 | * The clock events are used for clock enable/disable and for | 160 | * The clock events are used for clock enable/disable and for |
80 | * clock rate change | 161 | * clock rate change |
@@ -153,7 +234,6 @@ DEFINE_EVENT(power_domain, power_domain_target, | |||
153 | 234 | ||
154 | TP_ARGS(name, state, cpu_id) | 235 | TP_ARGS(name, state, cpu_id) |
155 | ); | 236 | ); |
156 | |||
157 | #endif /* _TRACE_POWER_H */ | 237 | #endif /* _TRACE_POWER_H */ |
158 | 238 | ||
159 | /* This part must be outside protection */ | 239 | /* This part must be outside protection */ |
diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h new file mode 100644 index 000000000000..37502a7404b7 --- /dev/null +++ b/include/trace/events/regulator.h | |||
@@ -0,0 +1,141 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM regulator | ||
3 | |||
4 | #if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_REGULATOR_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | /* | ||
11 | * Events which just log themselves and the regulator name for enable/disable | ||
12 | * type tracking. | ||
13 | */ | ||
14 | DECLARE_EVENT_CLASS(regulator_basic, | ||
15 | |||
16 | TP_PROTO(const char *name), | ||
17 | |||
18 | TP_ARGS(name), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __string( name, name ) | ||
22 | ), | ||
23 | |||
24 | TP_fast_assign( | ||
25 | __assign_str(name, name); | ||
26 | ), | ||
27 | |||
28 | TP_printk("name=%s", __get_str(name)) | ||
29 | |||
30 | ); | ||
31 | |||
32 | DEFINE_EVENT(regulator_basic, regulator_enable, | ||
33 | |||
34 | TP_PROTO(const char *name), | ||
35 | |||
36 | TP_ARGS(name) | ||
37 | |||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(regulator_basic, regulator_enable_delay, | ||
41 | |||
42 | TP_PROTO(const char *name), | ||
43 | |||
44 | TP_ARGS(name) | ||
45 | |||
46 | ); | ||
47 | |||
48 | DEFINE_EVENT(regulator_basic, regulator_enable_complete, | ||
49 | |||
50 | TP_PROTO(const char *name), | ||
51 | |||
52 | TP_ARGS(name) | ||
53 | |||
54 | ); | ||
55 | |||
56 | DEFINE_EVENT(regulator_basic, regulator_disable, | ||
57 | |||
58 | TP_PROTO(const char *name), | ||
59 | |||
60 | TP_ARGS(name) | ||
61 | |||
62 | ); | ||
63 | |||
64 | DEFINE_EVENT(regulator_basic, regulator_disable_complete, | ||
65 | |||
66 | TP_PROTO(const char *name), | ||
67 | |||
68 | TP_ARGS(name) | ||
69 | |||
70 | ); | ||
71 | |||
72 | /* | ||
73 | * Events that take a range of numerical values, mostly for voltages | ||
74 | * and so on. | ||
75 | */ | ||
76 | DECLARE_EVENT_CLASS(regulator_range, | ||
77 | |||
78 | TP_PROTO(const char *name, int min, int max), | ||
79 | |||
80 | TP_ARGS(name, min, max), | ||
81 | |||
82 | TP_STRUCT__entry( | ||
83 | __string( name, name ) | ||
84 | __field( int, min ) | ||
85 | __field( int, max ) | ||
86 | ), | ||
87 | |||
88 | TP_fast_assign( | ||
89 | __assign_str(name, name); | ||
90 | __entry->min = min; | ||
91 | __entry->max = max; | ||
92 | ), | ||
93 | |||
94 | TP_printk("name=%s (%d-%d)", __get_str(name), | ||
95 | (int)__entry->min, (int)__entry->max) | ||
96 | ); | ||
97 | |||
98 | DEFINE_EVENT(regulator_range, regulator_set_voltage, | ||
99 | |||
100 | TP_PROTO(const char *name, int min, int max), | ||
101 | |||
102 | TP_ARGS(name, min, max) | ||
103 | |||
104 | ); | ||
105 | |||
106 | |||
107 | /* | ||
108 | * Events that take a single value, mostly for readback and refcounts. | ||
109 | */ | ||
110 | DECLARE_EVENT_CLASS(regulator_value, | ||
111 | |||
112 | TP_PROTO(const char *name, unsigned int val), | ||
113 | |||
114 | TP_ARGS(name, val), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __string( name, name ) | ||
118 | __field( unsigned int, val ) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | __assign_str(name, name); | ||
123 | __entry->val = val; | ||
124 | ), | ||
125 | |||
126 | TP_printk("name=%s, val=%u", __get_str(name), | ||
127 | (int)__entry->val) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(regulator_value, regulator_set_voltage_complete, | ||
131 | |||
132 | TP_PROTO(const char *name, unsigned int value), | ||
133 | |||
134 | TP_ARGS(name, value) | ||
135 | |||
136 | ); | ||
137 | |||
138 | #endif /* _TRACE_POWER_H */ | ||
139 | |||
140 | /* This part must be outside protection */ | ||
141 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h index 75ce9d500d8e..f10293c41b1e 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/syscalls.h b/include/trace/events/syscalls.h index fb726ac7caee..5a4c04a75b3d 100644 --- a/include/trace/events/syscalls.h +++ b/include/trace/events/syscalls.h | |||
@@ -40,6 +40,8 @@ TRACE_EVENT_FN(sys_enter, | |||
40 | syscall_regfunc, syscall_unregfunc | 40 | syscall_regfunc, syscall_unregfunc |
41 | ); | 41 | ); |
42 | 42 | ||
43 | TRACE_EVENT_FLAGS(sys_enter, TRACE_EVENT_FL_CAP_ANY) | ||
44 | |||
43 | TRACE_EVENT_FN(sys_exit, | 45 | TRACE_EVENT_FN(sys_exit, |
44 | 46 | ||
45 | TP_PROTO(struct pt_regs *regs, long ret), | 47 | TP_PROTO(struct pt_regs *regs, long ret), |
@@ -62,6 +64,8 @@ TRACE_EVENT_FN(sys_exit, | |||
62 | syscall_regfunc, syscall_unregfunc | 64 | syscall_regfunc, syscall_unregfunc |
63 | ); | 65 | ); |
64 | 66 | ||
67 | TRACE_EVENT_FLAGS(sys_exit, TRACE_EVENT_FL_CAP_ANY) | ||
68 | |||
65 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ | 69 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ |
66 | 70 | ||
67 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ | 71 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ |
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index c255fcc587bf..ea422aaa23e1 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -25,13 +25,13 @@ | |||
25 | 25 | ||
26 | #define trace_reclaim_flags(page, sync) ( \ | 26 | #define trace_reclaim_flags(page, sync) ( \ |
27 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | 27 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ |
28 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ | 28 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ |
29 | ) | 29 | ) |
30 | 30 | ||
31 | #define trace_shrink_flags(file, sync) ( \ | 31 | #define trace_shrink_flags(file, sync) ( \ |
32 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_MIXED : \ | 32 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_MIXED : \ |
33 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \ | 33 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \ |
34 | (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ | 34 | (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ |
35 | ) | 35 | ) |
36 | 36 | ||
37 | TRACE_EVENT(mm_vmscan_kswapd_sleep, | 37 | TRACE_EVENT(mm_vmscan_kswapd_sleep, |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 89a2b2db4375..4e249b927eaa 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -81,6 +81,7 @@ DEFINE_EVENT(writeback_class, name, \ | |||
81 | TP_ARGS(bdi)) | 81 | TP_ARGS(bdi)) |
82 | 82 | ||
83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); | 83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); |
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_background); | ||
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); | 85 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); |
85 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); | 86 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); |
86 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | 87 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index a9377c0083ad..3e68366d485a 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -82,6 +82,10 @@ | |||
82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ | 82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ |
83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ | 83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ |
84 | 84 | ||
85 | #undef TRACE_EVENT_FLAGS | ||
86 | #define TRACE_EVENT_FLAGS(name, value) \ | ||
87 | __TRACE_EVENT_FLAGS(name, value) | ||
88 | |||
85 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 89 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
86 | 90 | ||
87 | 91 | ||
@@ -129,6 +133,9 @@ | |||
129 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 133 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
130 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 134 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
131 | 135 | ||
136 | #undef TRACE_EVENT_FLAGS | ||
137 | #define TRACE_EVENT_FLAGS(event, flag) | ||
138 | |||
132 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 139 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
133 | 140 | ||
134 | /* | 141 | /* |
@@ -289,13 +296,19 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | |||
289 | 296 | ||
290 | #undef __array | 297 | #undef __array |
291 | #define __array(type, item, len) \ | 298 | #define __array(type, item, len) \ |
292 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 299 | do { \ |
293 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 300 | mutex_lock(&event_storage_mutex); \ |
301 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | ||
302 | snprintf(event_storage, sizeof(event_storage), \ | ||
303 | "%s[%d]", #type, len); \ | ||
304 | ret = trace_define_field(event_call, event_storage, #item, \ | ||
294 | offsetof(typeof(field), item), \ | 305 | offsetof(typeof(field), item), \ |
295 | sizeof(field.item), \ | 306 | sizeof(field.item), \ |
296 | is_signed_type(type), FILTER_OTHER); \ | 307 | is_signed_type(type), FILTER_OTHER); \ |
297 | if (ret) \ | 308 | mutex_unlock(&event_storage_mutex); \ |
298 | return ret; | 309 | if (ret) \ |
310 | return ret; \ | ||
311 | } while (0); | ||
299 | 312 | ||
300 | #undef __dynamic_array | 313 | #undef __dynamic_array |
301 | #define __dynamic_array(type, item, len) \ | 314 | #define __dynamic_array(type, item, len) \ |
@@ -433,14 +446,16 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
433 | * .reg = ftrace_event_reg, | 446 | * .reg = ftrace_event_reg, |
434 | * }; | 447 | * }; |
435 | * | 448 | * |
436 | * static struct ftrace_event_call __used | 449 | * static struct ftrace_event_call event_<call> = { |
437 | * __attribute__((__aligned__(4))) | ||
438 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
439 | * .name = "<call>", | 450 | * .name = "<call>", |
440 | * .class = event_class_<template>, | 451 | * .class = event_class_<template>, |
441 | * .event = &ftrace_event_type_<call>, | 452 | * .event = &ftrace_event_type_<call>, |
442 | * .print_fmt = print_fmt_<call>, | 453 | * .print_fmt = print_fmt_<call>, |
443 | * }; | 454 | * }; |
455 | * // its only safe to use pointers when doing linker tricks to | ||
456 | * // create an array. | ||
457 | * static struct ftrace_event_call __used | ||
458 | * __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>; | ||
444 | * | 459 | * |
445 | */ | 460 | */ |
446 | 461 | ||
@@ -566,28 +581,28 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
566 | #undef DEFINE_EVENT | 581 | #undef DEFINE_EVENT |
567 | #define DEFINE_EVENT(template, call, proto, args) \ | 582 | #define DEFINE_EVENT(template, call, proto, args) \ |
568 | \ | 583 | \ |
569 | static struct ftrace_event_call __used \ | 584 | static struct ftrace_event_call __used event_##call = { \ |
570 | __attribute__((__aligned__(4))) \ | ||
571 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
572 | .name = #call, \ | 585 | .name = #call, \ |
573 | .class = &event_class_##template, \ | 586 | .class = &event_class_##template, \ |
574 | .event.funcs = &ftrace_event_type_funcs_##template, \ | 587 | .event.funcs = &ftrace_event_type_funcs_##template, \ |
575 | .print_fmt = print_fmt_##template, \ | 588 | .print_fmt = print_fmt_##template, \ |
576 | }; | 589 | }; \ |
590 | static struct ftrace_event_call __used \ | ||
591 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
577 | 592 | ||
578 | #undef DEFINE_EVENT_PRINT | 593 | #undef DEFINE_EVENT_PRINT |
579 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 594 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
580 | \ | 595 | \ |
581 | static const char print_fmt_##call[] = print; \ | 596 | static const char print_fmt_##call[] = print; \ |
582 | \ | 597 | \ |
583 | static struct ftrace_event_call __used \ | 598 | static struct ftrace_event_call __used event_##call = { \ |
584 | __attribute__((__aligned__(4))) \ | ||
585 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
586 | .name = #call, \ | 599 | .name = #call, \ |
587 | .class = &event_class_##template, \ | 600 | .class = &event_class_##template, \ |
588 | .event.funcs = &ftrace_event_type_funcs_##call, \ | 601 | .event.funcs = &ftrace_event_type_funcs_##call, \ |
589 | .print_fmt = print_fmt_##call, \ | 602 | .print_fmt = print_fmt_##call, \ |
590 | } | 603 | }; \ |
604 | static struct ftrace_event_call __used \ | ||
605 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
591 | 606 | ||
592 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 607 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
593 | 608 | ||
diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h index f0736cff2ca3..55f534491a3d 100644 --- a/include/video/s1d13xxxfb.h +++ b/include/video/s1d13xxxfb.h | |||
@@ -136,12 +136,6 @@ | |||
136 | #define S1DREG_DELAYOFF 0xFFFE | 136 | #define S1DREG_DELAYOFF 0xFFFE |
137 | #define S1DREG_DELAYON 0xFFFF | 137 | #define S1DREG_DELAYON 0xFFFF |
138 | 138 | ||
139 | #define BBLT_FIFO_EMPTY 0x00 | ||
140 | #define BBLT_FIFO_NOT_EMPTY 0x40 | ||
141 | #define BBLT_FIFO_NOT_FULL 0x30 | ||
142 | #define BBLT_FIFO_HALF_FULL 0x20 | ||
143 | #define BBLT_FIFO_FULL 0x10 | ||
144 | |||
145 | #define BBLT_SOLID_FILL 0x0c | 139 | #define BBLT_SOLID_FILL 0x0c |
146 | 140 | ||
147 | 141 | ||
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h index 18bca08f9f59..6cb95c977de9 100644 --- a/include/video/sh_mipi_dsi.h +++ b/include/video/sh_mipi_dsi.h | |||
@@ -27,9 +27,15 @@ enum sh_mipi_dsi_data_fmt { | |||
27 | 27 | ||
28 | struct sh_mobile_lcdc_chan_cfg; | 28 | struct sh_mobile_lcdc_chan_cfg; |
29 | 29 | ||
30 | #define SH_MIPI_DSI_HSABM (1 << 0) | ||
31 | #define SH_MIPI_DSI_HSPBM (1 << 1) | ||
32 | |||
30 | struct sh_mipi_dsi_info { | 33 | struct sh_mipi_dsi_info { |
31 | enum sh_mipi_dsi_data_fmt data_format; | 34 | enum sh_mipi_dsi_data_fmt data_format; |
32 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | 35 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; |
36 | unsigned long flags; | ||
37 | u32 clksrc; | ||
38 | unsigned int vsynw_offset; | ||
33 | }; | 39 | }; |
34 | 40 | ||
35 | #endif | 41 | #endif |
diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h index 1e1aa54ab2e4..b56932927d0a 100644 --- a/include/video/sh_mobile_hdmi.h +++ b/include/video/sh_mobile_hdmi.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | struct sh_mobile_lcdc_chan_cfg; | 14 | struct sh_mobile_lcdc_chan_cfg; |
15 | struct device; | 15 | struct device; |
16 | struct clk; | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * flags format | 19 | * flags format |
@@ -33,6 +34,8 @@ struct sh_mobile_hdmi_info { | |||
33 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | 34 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; |
34 | struct device *lcd_dev; | 35 | struct device *lcd_dev; |
35 | unsigned int flags; | 36 | unsigned int flags; |
37 | long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq, | ||
38 | unsigned long *parent_freq); | ||
36 | }; | 39 | }; |
37 | 40 | ||
38 | #endif | 41 | #endif |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h new file mode 100644 index 000000000000..69d485a4a026 --- /dev/null +++ b/include/video/udlfb.h | |||
@@ -0,0 +1,95 @@ | |||
1 | #ifndef UDLFB_H | ||
2 | #define UDLFB_H | ||
3 | |||
4 | /* | ||
5 | * TODO: Propose standard fb.h ioctl for reporting damage, | ||
6 | * using _IOWR() and one of the existing area structs from fb.h | ||
7 | * Consider these ioctls deprecated, but they're still used by the | ||
8 | * DisplayLink X server as yet - need both to be modified in tandem | ||
9 | * when new ioctl(s) are ready. | ||
10 | */ | ||
11 | #define DLFB_IOCTL_RETURN_EDID 0xAD | ||
12 | #define DLFB_IOCTL_REPORT_DAMAGE 0xAA | ||
13 | struct dloarea { | ||
14 | int x, y; | ||
15 | int w, h; | ||
16 | int x2, y2; | ||
17 | }; | ||
18 | |||
19 | struct urb_node { | ||
20 | struct list_head entry; | ||
21 | struct dlfb_data *dev; | ||
22 | struct delayed_work release_urb_work; | ||
23 | struct urb *urb; | ||
24 | }; | ||
25 | |||
26 | struct urb_list { | ||
27 | struct list_head list; | ||
28 | spinlock_t lock; | ||
29 | struct semaphore limit_sem; | ||
30 | int available; | ||
31 | int count; | ||
32 | size_t size; | ||
33 | }; | ||
34 | |||
35 | struct dlfb_data { | ||
36 | struct usb_device *udev; | ||
37 | struct device *gdev; /* &udev->dev */ | ||
38 | struct fb_info *info; | ||
39 | struct urb_list urbs; | ||
40 | struct kref kref; | ||
41 | char *backing_buffer; | ||
42 | int fb_count; | ||
43 | bool virtualized; /* true when physical usb device not present */ | ||
44 | struct delayed_work free_framebuffer_work; | ||
45 | atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ | ||
46 | atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ | ||
47 | char *edid; /* null until we read edid from hw or get from sysfs */ | ||
48 | size_t edid_size; | ||
49 | int sku_pixel_limit; | ||
50 | int base16; | ||
51 | int base8; | ||
52 | u32 pseudo_palette[256]; | ||
53 | /* blit-only rendering path metrics, exposed through sysfs */ | ||
54 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | ||
55 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | ||
56 | atomic_t bytes_sent; /* to usb, after compression including overhead */ | ||
57 | atomic_t cpu_kcycles_used; /* transpired during pixel processing */ | ||
58 | }; | ||
59 | |||
60 | #define NR_USB_REQUEST_I2C_SUB_IO 0x02 | ||
61 | #define NR_USB_REQUEST_CHANNEL 0x12 | ||
62 | |||
63 | /* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */ | ||
64 | #define BULK_SIZE 512 | ||
65 | #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) | ||
66 | #define WRITES_IN_FLIGHT (4) | ||
67 | |||
68 | #define MAX_VENDOR_DESCRIPTOR_SIZE 256 | ||
69 | |||
70 | #define GET_URB_TIMEOUT HZ | ||
71 | #define FREE_URB_TIMEOUT (HZ*2) | ||
72 | |||
73 | #define BPP 2 | ||
74 | #define MAX_CMD_PIXELS 255 | ||
75 | |||
76 | #define RLX_HEADER_BYTES 7 | ||
77 | #define MIN_RLX_PIX_BYTES 4 | ||
78 | #define MIN_RLX_CMD_BYTES (RLX_HEADER_BYTES + MIN_RLX_PIX_BYTES) | ||
79 | |||
80 | #define RLE_HEADER_BYTES 6 | ||
81 | #define MIN_RLE_PIX_BYTES 3 | ||
82 | #define MIN_RLE_CMD_BYTES (RLE_HEADER_BYTES + MIN_RLE_PIX_BYTES) | ||
83 | |||
84 | #define RAW_HEADER_BYTES 6 | ||
85 | #define MIN_RAW_PIX_BYTES 2 | ||
86 | #define MIN_RAW_CMD_BYTES (RAW_HEADER_BYTES + MIN_RAW_PIX_BYTES) | ||
87 | |||
88 | #define DL_DEFIO_WRITE_DELAY 5 /* fb_deferred_io.delay in jiffies */ | ||
89 | #define DL_DEFIO_WRITE_DISABLE (HZ*60) /* "disable" with long delay */ | ||
90 | |||
91 | /* remove these once align.h patch is taken into kernel */ | ||
92 | #define DL_ALIGN_UP(x, a) ALIGN(x, a) | ||
93 | #define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a) | ||
94 | |||
95 | #endif | ||
diff --git a/include/xen/gntdev.h b/include/xen/gntdev.h new file mode 100644 index 000000000000..eb23f4188f5a --- /dev/null +++ b/include/xen/gntdev.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /****************************************************************************** | ||
2 | * gntdev.h | ||
3 | * | ||
4 | * Interface to /dev/xen/gntdev. | ||
5 | * | ||
6 | * Copyright (c) 2007, D G Murray | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation; or, when distributed | ||
11 | * separately from the Linux kernel or incorporated into other | ||
12 | * software packages, subject to the following license: | ||
13 | * | ||
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
15 | * of this source file (the "Software"), to deal in the Software without | ||
16 | * restriction, including without limitation the rights to use, copy, modify, | ||
17 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
18 | * and to permit persons to whom the Software is furnished to do so, subject to | ||
19 | * the following conditions: | ||
20 | * | ||
21 | * The above copyright notice and this permission notice shall be included in | ||
22 | * all copies or substantial portions of the Software. | ||
23 | * | ||
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
30 | * IN THE SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef __LINUX_PUBLIC_GNTDEV_H__ | ||
34 | #define __LINUX_PUBLIC_GNTDEV_H__ | ||
35 | |||
36 | struct ioctl_gntdev_grant_ref { | ||
37 | /* The domain ID of the grant to be mapped. */ | ||
38 | uint32_t domid; | ||
39 | /* The grant reference of the grant to be mapped. */ | ||
40 | uint32_t ref; | ||
41 | }; | ||
42 | |||
43 | /* | ||
44 | * Inserts the grant references into the mapping table of an instance | ||
45 | * of gntdev. N.B. This does not perform the mapping, which is deferred | ||
46 | * until mmap() is called with @index as the offset. | ||
47 | */ | ||
48 | #define IOCTL_GNTDEV_MAP_GRANT_REF \ | ||
49 | _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref)) | ||
50 | struct ioctl_gntdev_map_grant_ref { | ||
51 | /* IN parameters */ | ||
52 | /* The number of grants to be mapped. */ | ||
53 | uint32_t count; | ||
54 | uint32_t pad; | ||
55 | /* OUT parameters */ | ||
56 | /* The offset to be used on a subsequent call to mmap(). */ | ||
57 | uint64_t index; | ||
58 | /* Variable IN parameter. */ | ||
59 | /* Array of grant references, of size @count. */ | ||
60 | struct ioctl_gntdev_grant_ref refs[1]; | ||
61 | }; | ||
62 | |||
63 | /* | ||
64 | * Removes the grant references from the mapping table of an instance of | ||
65 | * of gntdev. N.B. munmap() must be called on the relevant virtual address(es) | ||
66 | * before this ioctl is called, or an error will result. | ||
67 | */ | ||
68 | #define IOCTL_GNTDEV_UNMAP_GRANT_REF \ | ||
69 | _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref)) | ||
70 | struct ioctl_gntdev_unmap_grant_ref { | ||
71 | /* IN parameters */ | ||
72 | /* The offset was returned by the corresponding map operation. */ | ||
73 | uint64_t index; | ||
74 | /* The number of pages to be unmapped. */ | ||
75 | uint32_t count; | ||
76 | uint32_t pad; | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * Returns the offset in the driver's address space that corresponds | ||
81 | * to @vaddr. This can be used to perform a munmap(), followed by an | ||
82 | * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by | ||
83 | * the caller. The number of pages that were allocated at the same time as | ||
84 | * @vaddr is returned in @count. | ||
85 | * | ||
86 | * N.B. Where more than one page has been mapped into a contiguous range, the | ||
87 | * supplied @vaddr must correspond to the start of the range; otherwise | ||
88 | * an error will result. It is only possible to munmap() the entire | ||
89 | * contiguously-allocated range at once, and not any subrange thereof. | ||
90 | */ | ||
91 | #define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \ | ||
92 | _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr)) | ||
93 | struct ioctl_gntdev_get_offset_for_vaddr { | ||
94 | /* IN parameters */ | ||
95 | /* The virtual address of the first mapped page in a range. */ | ||
96 | uint64_t vaddr; | ||
97 | /* OUT parameters */ | ||
98 | /* The offset that was used in the initial mmap() operation. */ | ||
99 | uint64_t offset; | ||
100 | /* The number of pages mapped in the VM area that begins at @vaddr. */ | ||
101 | uint32_t count; | ||
102 | uint32_t pad; | ||
103 | }; | ||
104 | |||
105 | /* | ||
106 | * Sets the maximum number of grants that may mapped at once by this gntdev | ||
107 | * instance. | ||
108 | * | ||
109 | * N.B. This must be called before any other ioctl is performed on the device. | ||
110 | */ | ||
111 | #define IOCTL_GNTDEV_SET_MAX_GRANTS \ | ||
112 | _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants)) | ||
113 | struct ioctl_gntdev_set_max_grants { | ||
114 | /* IN parameter */ | ||
115 | /* The maximum number of grants that may be mapped at once. */ | ||
116 | uint32_t count; | ||
117 | }; | ||
118 | |||
119 | #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ | ||
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 9a731706a016..b1fab6b5b3ef 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -37,10 +37,16 @@ | |||
37 | #ifndef __ASM_GNTTAB_H__ | 37 | #ifndef __ASM_GNTTAB_H__ |
38 | #define __ASM_GNTTAB_H__ | 38 | #define __ASM_GNTTAB_H__ |
39 | 39 | ||
40 | #include <asm/xen/hypervisor.h> | 40 | #include <asm/page.h> |
41 | |||
42 | #include <xen/interface/xen.h> | ||
41 | #include <xen/interface/grant_table.h> | 43 | #include <xen/interface/grant_table.h> |
44 | |||
45 | #include <asm/xen/hypervisor.h> | ||
42 | #include <asm/xen/grant_table.h> | 46 | #include <asm/xen/grant_table.h> |
43 | 47 | ||
48 | #include <xen/features.h> | ||
49 | |||
44 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ | 50 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ |
45 | #define NR_GRANT_FRAMES 4 | 51 | #define NR_GRANT_FRAMES 4 |
46 | 52 | ||
@@ -107,6 +113,37 @@ void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid, | |||
107 | void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid, | 113 | void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid, |
108 | unsigned long pfn); | 114 | unsigned long pfn); |
109 | 115 | ||
116 | static inline void | ||
117 | gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr, | ||
118 | uint32_t flags, grant_ref_t ref, domid_t domid) | ||
119 | { | ||
120 | if (flags & GNTMAP_contains_pte) | ||
121 | map->host_addr = addr; | ||
122 | else if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
123 | map->host_addr = __pa(addr); | ||
124 | else | ||
125 | map->host_addr = addr; | ||
126 | |||
127 | map->flags = flags; | ||
128 | map->ref = ref; | ||
129 | map->dom = domid; | ||
130 | } | ||
131 | |||
132 | static inline void | ||
133 | gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, phys_addr_t addr, | ||
134 | uint32_t flags, grant_handle_t handle) | ||
135 | { | ||
136 | if (flags & GNTMAP_contains_pte) | ||
137 | unmap->host_addr = addr; | ||
138 | else if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
139 | unmap->host_addr = __pa(addr); | ||
140 | else | ||
141 | unmap->host_addr = addr; | ||
142 | |||
143 | unmap->handle = handle; | ||
144 | unmap->dev_bus_addr = 0; | ||
145 | } | ||
146 | |||
110 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | 147 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, |
111 | unsigned long max_nr_gframes, | 148 | unsigned long max_nr_gframes, |
112 | struct grant_entry **__shared); | 149 | struct grant_entry **__shared); |
@@ -118,4 +155,9 @@ unsigned int gnttab_max_grant_frames(void); | |||
118 | 155 | ||
119 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 156 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
120 | 157 | ||
158 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | ||
159 | struct page **pages, unsigned int count); | ||
160 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | ||
161 | struct page **pages, unsigned int count); | ||
162 | |||
121 | #endif /* __ASM_GNTTAB_H__ */ | 163 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 43e2d7d33976..7a1d15ff19b7 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -94,7 +94,7 @@ struct xenbus_driver { | |||
94 | int (*remove)(struct xenbus_device *dev); | 94 | int (*remove)(struct xenbus_device *dev); |
95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); | 95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); |
96 | int (*resume)(struct xenbus_device *dev); | 96 | int (*resume)(struct xenbus_device *dev); |
97 | int (*uevent)(struct xenbus_device *, char **, int, char *, int); | 97 | int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *); |
98 | struct device_driver driver; | 98 | struct device_driver driver; |
99 | int (*read_otherend_details)(struct xenbus_device *dev); | 99 | int (*read_otherend_details)(struct xenbus_device *dev); |
100 | int (*is_ready)(struct xenbus_device *dev); | 100 | int (*is_ready)(struct xenbus_device *dev); |