diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-02-26 06:24:50 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-02-26 06:24:50 -0500 |
commit | e9e4e44309f866b115d08ab4a54834008c50a8a4 (patch) | |
tree | ae9f91e682a4d6592ef263f30a4a0b1a862b7987 /include | |
parent | 8a26ce4e544659256349551283414df504889a59 (diff) | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
Merge tag 'v4.0-rc1' into perf/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
513 files changed, 12816 insertions, 4486 deletions
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h index d5ec6c87810f..6b040f4ddfab 100644 --- a/include/acpi/acbuffer.h +++ b/include/acpi/acbuffer.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/acconfig.h b/include/acpi/acconfig.h index 5a0a3e5daf85..03aacfb3e98b 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/acexcep.h b/include/acpi/acexcep.h index 8b06e4c1dd5d..11c3a011dcbf 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 7461327e14e4..273de709495c 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 1baae6edda89..a8f344363e77 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 |
@@ -240,7 +240,7 @@ | |||
240 | /* | 240 | /* |
241 | * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, | 241 | * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, |
242 | * define it now. This is the case where there the compiler does not support | 242 | * define it now. This is the case where there the compiler does not support |
243 | * a __FUNCTION__ macro or equivalent. | 243 | * a __func__ macro or equivalent. |
244 | */ | 244 | */ |
245 | #ifndef ACPI_GET_FUNCTION_NAME | 245 | #ifndef ACPI_GET_FUNCTION_NAME |
246 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name | 246 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name |
@@ -249,12 +249,12 @@ | |||
249 | * The Name parameter should be the procedure name as a quoted string. | 249 | * The Name parameter should be the procedure name as a quoted string. |
250 | * The function name is also used by the function exit macros below. | 250 | * The function name is also used by the function exit macros below. |
251 | * Note: (const char) is used to be compatible with the debug interfaces | 251 | * Note: (const char) is used to be compatible with the debug interfaces |
252 | * and macros such as __FUNCTION__. | 252 | * and macros such as __func__. |
253 | */ | 253 | */ |
254 | #define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name; | 254 | #define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name; |
255 | 255 | ||
256 | #else | 256 | #else |
257 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ | 257 | /* Compiler supports __func__ (or equivalent) -- Ignore this macro */ |
258 | 258 | ||
259 | #define ACPI_FUNCTION_NAME(name) | 259 | #define ACPI_FUNCTION_NAME(name) |
260 | #endif /* ACPI_GET_FUNCTION_NAME */ | 260 | #endif /* ACPI_GET_FUNCTION_NAME */ |
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index a08e55a263c9..b0bb30ebb807 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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_lpat.h b/include/acpi/acpi_lpat.h new file mode 100644 index 000000000000..da37e12d23e2 --- /dev/null +++ b/include/acpi/acpi_lpat.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * acpi_lpat.h - LPAT table processing functions | ||
3 | * | ||
4 | * Copyright (C) 2015 Intel Corporation. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License version | ||
8 | * 2 as published by the Free Software Foundation. | ||
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 ACPI_LPAT_H | ||
17 | #define ACPI_LPAT_H | ||
18 | |||
19 | struct acpi_lpat { | ||
20 | int temp; | ||
21 | int raw; | ||
22 | }; | ||
23 | |||
24 | struct acpi_lpat_conversion_table { | ||
25 | struct acpi_lpat *lpat; | ||
26 | int lpat_count; | ||
27 | }; | ||
28 | |||
29 | #ifdef CONFIG_ACPI | ||
30 | |||
31 | int acpi_lpat_raw_to_temp(struct acpi_lpat_conversion_table *lpat_table, | ||
32 | int raw); | ||
33 | int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table, | ||
34 | int temp); | ||
35 | struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle | ||
36 | handle); | ||
37 | void acpi_lpat_free_conversion_table(struct acpi_lpat_conversion_table | ||
38 | *lpat_table); | ||
39 | |||
40 | #else | ||
41 | static int acpi_lpat_raw_to_temp(struct acpi_lpat_conversion_table *lpat_table, | ||
42 | int raw) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | static int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table, | ||
48 | int temp) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table( | ||
54 | acpi_handle handle) | ||
55 | { | ||
56 | return NULL; | ||
57 | } | ||
58 | |||
59 | static void acpi_lpat_free_conversion_table(struct acpi_lpat_conversion_table | ||
60 | *lpat_table) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | #endif | ||
65 | #endif | ||
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 03b3e6d405ff..0bc78df66d4b 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -7,7 +7,7 @@ | |||
7 | *****************************************************************************/ | 7 | *****************************************************************************/ |
8 | 8 | ||
9 | /* | 9 | /* |
10 | * Copyright (C) 2000 - 2014, Intel Corp. | 10 | * Copyright (C) 2000 - 2015, Intel Corp. |
11 | * All rights reserved. | 11 | * All rights reserved. |
12 | * | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | 13 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 5ba78464c1b1..d56f5d722138 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 |
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20141107 | 49 | #define ACPI_CA_VERSION 0x20150204 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -569,6 +569,14 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
569 | address, | 569 | address, |
570 | void *context)) | 570 | void *context)) |
571 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 571 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
572 | acpi_install_gpe_raw_handler(acpi_handle | ||
573 | gpe_device, | ||
574 | u32 gpe_number, | ||
575 | u32 type, | ||
576 | acpi_gpe_handler | ||
577 | address, | ||
578 | void *context)) | ||
579 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
572 | acpi_remove_gpe_handler(acpi_handle gpe_device, | 580 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
573 | u32 gpe_number, | 581 | u32 gpe_number, |
574 | acpi_gpe_handler | 582 | acpi_gpe_handler |
@@ -891,12 +899,6 @@ ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) | |||
891 | ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); | 899 | ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); |
892 | 900 | ||
893 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | 901 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
894 | acpi_get_id(acpi_handle object, | ||
895 | acpi_owner_id * out_type)) | ||
896 | |||
897 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id)) | ||
898 | |||
899 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
900 | acpi_get_table_with_size(acpi_string signature, | 902 | acpi_get_table_with_size(acpi_string signature, |
901 | u32 instance, | 903 | u32 instance, |
902 | struct acpi_table_header | 904 | struct acpi_table_header |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index eb760ca0b2e0..ebe242638591 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 |
@@ -305,43 +305,51 @@ struct acpi_resource_source { | |||
305 | u8 max_address_fixed; \ | 305 | u8 max_address_fixed; \ |
306 | union acpi_resource_attribute info; | 306 | union acpi_resource_attribute info; |
307 | 307 | ||
308 | struct acpi_resource_address { | 308 | struct acpi_address16_attribute { |
309 | ACPI_RESOURCE_ADDRESS_COMMON}; | 309 | u16 granularity; |
310 | |||
311 | struct acpi_resource_address16 { | ||
312 | ACPI_RESOURCE_ADDRESS_COMMON u16 granularity; | ||
313 | u16 minimum; | 310 | u16 minimum; |
314 | u16 maximum; | 311 | u16 maximum; |
315 | u16 translation_offset; | 312 | u16 translation_offset; |
316 | u16 address_length; | 313 | u16 address_length; |
317 | struct acpi_resource_source resource_source; | ||
318 | }; | 314 | }; |
319 | 315 | ||
320 | struct acpi_resource_address32 { | 316 | struct acpi_address32_attribute { |
321 | ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; | 317 | u32 granularity; |
322 | u32 minimum; | 318 | u32 minimum; |
323 | u32 maximum; | 319 | u32 maximum; |
324 | u32 translation_offset; | 320 | u32 translation_offset; |
325 | u32 address_length; | 321 | u32 address_length; |
326 | struct acpi_resource_source resource_source; | ||
327 | }; | 322 | }; |
328 | 323 | ||
329 | struct acpi_resource_address64 { | 324 | struct acpi_address64_attribute { |
330 | ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; | 325 | u64 granularity; |
331 | u64 minimum; | 326 | u64 minimum; |
332 | u64 maximum; | 327 | u64 maximum; |
333 | u64 translation_offset; | 328 | u64 translation_offset; |
334 | u64 address_length; | 329 | u64 address_length; |
330 | }; | ||
331 | |||
332 | struct acpi_resource_address { | ||
333 | ACPI_RESOURCE_ADDRESS_COMMON}; | ||
334 | |||
335 | struct acpi_resource_address16 { | ||
336 | ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address; | ||
337 | struct acpi_resource_source resource_source; | ||
338 | }; | ||
339 | |||
340 | struct acpi_resource_address32 { | ||
341 | ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address; | ||
342 | struct acpi_resource_source resource_source; | ||
343 | }; | ||
344 | |||
345 | struct acpi_resource_address64 { | ||
346 | ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address; | ||
335 | struct acpi_resource_source resource_source; | 347 | struct acpi_resource_source resource_source; |
336 | }; | 348 | }; |
337 | 349 | ||
338 | struct acpi_resource_extended_address64 { | 350 | struct acpi_resource_extended_address64 { |
339 | ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID; | 351 | ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID; |
340 | u64 granularity; | 352 | struct acpi_address64_attribute address; |
341 | u64 minimum; | ||
342 | u64 maximum; | ||
343 | u64 translation_offset; | ||
344 | u64 address_length; | ||
345 | u64 type_specific; | 353 | u64 type_specific; |
346 | }; | 354 | }; |
347 | 355 | ||
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index bee19d8170c5..d4081fef1095 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 29e79370641d..b80b0e6dabc5 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/actbl2.h b/include/acpi/actbl2.h index ecff62405f17..f06d75e5fa54 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/actbl3.h b/include/acpi/actbl3.h index 5480cb2236bf..440ca8104b43 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 bbef17368e49..b034f1068dfe 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 |
@@ -744,7 +744,7 @@ typedef u32 acpi_event_status; | |||
744 | /* | 744 | /* |
745 | * GPE info flags - Per GPE | 745 | * GPE info flags - Per GPE |
746 | * +-------+-+-+---+ | 746 | * +-------+-+-+---+ |
747 | * | 7:4 |3|2|1:0| | 747 | * | 7:5 |4|3|2:0| |
748 | * +-------+-+-+---+ | 748 | * +-------+-+-+---+ |
749 | * | | | | | 749 | * | | | | |
750 | * | | | +-- Type of dispatch:to method, handler, notify, or none | 750 | * | | | +-- Type of dispatch:to method, handler, notify, or none |
@@ -756,13 +756,15 @@ typedef u32 acpi_event_status; | |||
756 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x01 | 756 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x01 |
757 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x02 | 757 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x02 |
758 | #define ACPI_GPE_DISPATCH_NOTIFY (u8) 0x03 | 758 | #define ACPI_GPE_DISPATCH_NOTIFY (u8) 0x03 |
759 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x03 | 759 | #define ACPI_GPE_DISPATCH_RAW_HANDLER (u8) 0x04 |
760 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x07 | ||
761 | #define ACPI_GPE_DISPATCH_TYPE(flags) ((u8) ((flags) & ACPI_GPE_DISPATCH_MASK)) | ||
760 | 762 | ||
761 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x04 | 763 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x08 |
762 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | 764 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 |
763 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x04 | 765 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x08 |
764 | 766 | ||
765 | #define ACPI_GPE_CAN_WAKE (u8) 0x08 | 767 | #define ACPI_GPE_CAN_WAKE (u8) 0x10 |
766 | 768 | ||
767 | /* | 769 | /* |
768 | * Flags for GPE and Lock interfaces | 770 | * Flags for GPE and Lock interfaces |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 5f8cc1fa3278..ad74dc51d5b7 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/acenvex.h b/include/acpi/platform/acenvex.h index 2b612384c994..71e5ec5b07a3 100644 --- a/include/acpi/platform/acenvex.h +++ b/include/acpi/platform/acenvex.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 384875da3713..f54de0a63558 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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 1ba7c190c2cc..74ba46c8157a 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 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/aclinuxex.h b/include/acpi/platform/aclinuxex.h index 568d4b886712..acedc3f026de 100644 --- a/include/acpi/platform/aclinuxex.h +++ b/include/acpi/platform/aclinuxex.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2014, Intel Corp. | 8 | * Copyright (C) 2000 - 2015, 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/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 77ff547730af..5bdab6bffd23 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #define __ARCH_HAS_4LEVEL_HACK | 4 | #define __ARCH_HAS_4LEVEL_HACK |
5 | #define __PAGETABLE_PUD_FOLDED | 5 | #define __PAGETABLE_PUD_FOLDED |
6 | 6 | ||
7 | #define PUD_SHIFT PGDIR_SHIFT | ||
7 | #define PUD_SIZE PGDIR_SIZE | 8 | #define PUD_SIZE PGDIR_SIZE |
8 | #define PUD_MASK PGDIR_MASK | 9 | #define PUD_MASK PGDIR_MASK |
9 | #define PTRS_PER_PUD 1 | 10 | #define PTRS_PER_PUD 1 |
diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h index ce37349860fe..7389c87116a0 100644 --- a/include/asm-generic/pci_iomap.h +++ b/include/asm-generic/pci_iomap.h | |||
@@ -15,6 +15,9 @@ struct pci_dev; | |||
15 | #ifdef CONFIG_PCI | 15 | #ifdef CONFIG_PCI |
16 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 16 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
17 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | 17 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); |
18 | extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, | ||
19 | unsigned long offset, | ||
20 | unsigned long maxlen); | ||
18 | /* Create a virtual mapping cookie for a port on a given PCI device. | 21 | /* Create a virtual mapping cookie for a port on a given PCI device. |
19 | * Do not call this directly, it exists to make it easier for architectures | 22 | * Do not call this directly, it exists to make it easier for architectures |
20 | * to override */ | 23 | * to override */ |
@@ -30,6 +33,13 @@ static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned lon | |||
30 | { | 33 | { |
31 | return NULL; | 34 | return NULL; |
32 | } | 35 | } |
36 | |||
37 | static inline void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, | ||
38 | unsigned long offset, | ||
39 | unsigned long maxlen) | ||
40 | { | ||
41 | return NULL; | ||
42 | } | ||
33 | #endif | 43 | #endif |
34 | 44 | ||
35 | #endif /* __ASM_GENERIC_IO_H */ | 45 | #endif /* __ASM_GENERIC_IO_H */ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 177d5973b132..4d46085c1b90 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -244,10 +244,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
244 | # define pte_accessible(mm, pte) ((void)(pte), 1) | 244 | # define pte_accessible(mm, pte) ((void)(pte), 1) |
245 | #endif | 245 | #endif |
246 | 246 | ||
247 | #ifndef pte_present_nonuma | ||
248 | #define pte_present_nonuma(pte) pte_present(pte) | ||
249 | #endif | ||
250 | |||
251 | #ifndef flush_tlb_fix_spurious_fault | 247 | #ifndef flush_tlb_fix_spurious_fault |
252 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) | 248 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) |
253 | #endif | 249 | #endif |
@@ -474,21 +470,6 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t pte) | |||
474 | { | 470 | { |
475 | return pte; | 471 | return pte; |
476 | } | 472 | } |
477 | |||
478 | static inline pte_t pte_file_clear_soft_dirty(pte_t pte) | ||
479 | { | ||
480 | return pte; | ||
481 | } | ||
482 | |||
483 | static inline pte_t pte_file_mksoft_dirty(pte_t pte) | ||
484 | { | ||
485 | return pte; | ||
486 | } | ||
487 | |||
488 | static inline int pte_file_soft_dirty(pte_t pte) | ||
489 | { | ||
490 | return 0; | ||
491 | } | ||
492 | #endif | 473 | #endif |
493 | 474 | ||
494 | #ifndef __HAVE_PFNMAP_TRACKING | 475 | #ifndef __HAVE_PFNMAP_TRACKING |
@@ -688,155 +669,24 @@ static inline int pmd_trans_unstable(pmd_t *pmd) | |||
688 | #endif | 669 | #endif |
689 | } | 670 | } |
690 | 671 | ||
691 | #ifdef CONFIG_NUMA_BALANCING | 672 | #ifndef CONFIG_NUMA_BALANCING |
692 | /* | ||
693 | * _PAGE_NUMA distinguishes between an unmapped page table entry, an entry that | ||
694 | * is protected for PROT_NONE and a NUMA hinting fault entry. If the | ||
695 | * architecture defines __PAGE_PROTNONE then it should take that into account | ||
696 | * but those that do not can rely on the fact that the NUMA hinting scanner | ||
697 | * skips inaccessible VMAs. | ||
698 | * | ||
699 | * pte/pmd_present() returns true if pte/pmd_numa returns true. Page | ||
700 | * fault triggers on those regions if pte/pmd_numa returns true | ||
701 | * (because _PAGE_PRESENT is not set). | ||
702 | */ | ||
703 | #ifndef pte_numa | ||
704 | static inline int pte_numa(pte_t pte) | ||
705 | { | ||
706 | return ptenuma_flags(pte) == _PAGE_NUMA; | ||
707 | } | ||
708 | #endif | ||
709 | |||
710 | #ifndef pmd_numa | ||
711 | static inline int pmd_numa(pmd_t pmd) | ||
712 | { | ||
713 | return pmdnuma_flags(pmd) == _PAGE_NUMA; | ||
714 | } | ||
715 | #endif | ||
716 | |||
717 | /* | 673 | /* |
718 | * pte/pmd_mknuma sets the _PAGE_ACCESSED bitflag automatically | 674 | * Technically a PTE can be PROTNONE even when not doing NUMA balancing but |
719 | * because they're called by the NUMA hinting minor page fault. If we | 675 | * the only case the kernel cares is for NUMA balancing and is only ever set |
720 | * wouldn't set the _PAGE_ACCESSED bitflag here, the TLB miss handler | 676 | * when the VMA is accessible. For PROT_NONE VMAs, the PTEs are not marked |
721 | * would be forced to set it later while filling the TLB after we | 677 | * _PAGE_PROTNONE so by by default, implement the helper as "always no". It |
722 | * return to userland. That would trigger a second write to memory | 678 | * is the responsibility of the caller to distinguish between PROT_NONE |
723 | * that we optimize away by setting _PAGE_ACCESSED here. | 679 | * protections and NUMA hinting fault protections. |
724 | */ | 680 | */ |
725 | #ifndef pte_mknonnuma | 681 | static inline int pte_protnone(pte_t pte) |
726 | static inline pte_t pte_mknonnuma(pte_t pte) | ||
727 | { | ||
728 | pteval_t val = pte_val(pte); | ||
729 | |||
730 | val &= ~_PAGE_NUMA; | ||
731 | val |= (_PAGE_PRESENT|_PAGE_ACCESSED); | ||
732 | return __pte(val); | ||
733 | } | ||
734 | #endif | ||
735 | |||
736 | #ifndef pmd_mknonnuma | ||
737 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | ||
738 | { | ||
739 | pmdval_t val = pmd_val(pmd); | ||
740 | |||
741 | val &= ~_PAGE_NUMA; | ||
742 | val |= (_PAGE_PRESENT|_PAGE_ACCESSED); | ||
743 | |||
744 | return __pmd(val); | ||
745 | } | ||
746 | #endif | ||
747 | |||
748 | #ifndef pte_mknuma | ||
749 | static inline pte_t pte_mknuma(pte_t pte) | ||
750 | { | ||
751 | pteval_t val = pte_val(pte); | ||
752 | |||
753 | VM_BUG_ON(!(val & _PAGE_PRESENT)); | ||
754 | |||
755 | val &= ~_PAGE_PRESENT; | ||
756 | val |= _PAGE_NUMA; | ||
757 | |||
758 | return __pte(val); | ||
759 | } | ||
760 | #endif | ||
761 | |||
762 | #ifndef ptep_set_numa | ||
763 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
764 | pte_t *ptep) | ||
765 | { | ||
766 | pte_t ptent = *ptep; | ||
767 | |||
768 | ptent = pte_mknuma(ptent); | ||
769 | set_pte_at(mm, addr, ptep, ptent); | ||
770 | return; | ||
771 | } | ||
772 | #endif | ||
773 | |||
774 | #ifndef pmd_mknuma | ||
775 | static inline pmd_t pmd_mknuma(pmd_t pmd) | ||
776 | { | ||
777 | pmdval_t val = pmd_val(pmd); | ||
778 | |||
779 | val &= ~_PAGE_PRESENT; | ||
780 | val |= _PAGE_NUMA; | ||
781 | |||
782 | return __pmd(val); | ||
783 | } | ||
784 | #endif | ||
785 | |||
786 | #ifndef pmdp_set_numa | ||
787 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
788 | pmd_t *pmdp) | ||
789 | { | ||
790 | pmd_t pmd = *pmdp; | ||
791 | |||
792 | pmd = pmd_mknuma(pmd); | ||
793 | set_pmd_at(mm, addr, pmdp, pmd); | ||
794 | return; | ||
795 | } | ||
796 | #endif | ||
797 | #else | ||
798 | static inline int pmd_numa(pmd_t pmd) | ||
799 | { | 682 | { |
800 | return 0; | 683 | return 0; |
801 | } | 684 | } |
802 | 685 | ||
803 | static inline int pte_numa(pte_t pte) | 686 | static inline int pmd_protnone(pmd_t pmd) |
804 | { | 687 | { |
805 | return 0; | 688 | return 0; |
806 | } | 689 | } |
807 | |||
808 | static inline pte_t pte_mknonnuma(pte_t pte) | ||
809 | { | ||
810 | return pte; | ||
811 | } | ||
812 | |||
813 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | ||
814 | { | ||
815 | return pmd; | ||
816 | } | ||
817 | |||
818 | static inline pte_t pte_mknuma(pte_t pte) | ||
819 | { | ||
820 | return pte; | ||
821 | } | ||
822 | |||
823 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
824 | pte_t *ptep) | ||
825 | { | ||
826 | return; | ||
827 | } | ||
828 | |||
829 | |||
830 | static inline pmd_t pmd_mknuma(pmd_t pmd) | ||
831 | { | ||
832 | return pmd; | ||
833 | } | ||
834 | |||
835 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
836 | pmd_t *pmdp) | ||
837 | { | ||
838 | return ; | ||
839 | } | ||
840 | #endif /* CONFIG_NUMA_BALANCING */ | 690 | #endif /* CONFIG_NUMA_BALANCING */ |
841 | 691 | ||
842 | #endif /* CONFIG_MMU */ | 692 | #endif /* CONFIG_MMU */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bee5d683074d..ac78910d7416 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -478,6 +478,7 @@ | |||
478 | #define KERNEL_CTORS() . = ALIGN(8); \ | 478 | #define KERNEL_CTORS() . = ALIGN(8); \ |
479 | VMLINUX_SYMBOL(__ctors_start) = .; \ | 479 | VMLINUX_SYMBOL(__ctors_start) = .; \ |
480 | *(.ctors) \ | 480 | *(.ctors) \ |
481 | *(SORT(.init_array.*)) \ | ||
481 | *(.init_array) \ | 482 | *(.init_array) \ |
482 | VMLINUX_SYMBOL(__ctors_end) = .; | 483 | VMLINUX_SYMBOL(__ctors_end) = .; |
483 | #else | 484 | #else |
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h index 6d26b40cbf5d..9916d0e4eff5 100644 --- a/include/clocksource/arm_arch_timer.h +++ b/include/clocksource/arm_arch_timer.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #ifndef __CLKSOURCE_ARM_ARCH_TIMER_H | 16 | #ifndef __CLKSOURCE_ARM_ARCH_TIMER_H |
17 | #define __CLKSOURCE_ARM_ARCH_TIMER_H | 17 | #define __CLKSOURCE_ARM_ARCH_TIMER_H |
18 | 18 | ||
19 | #include <linux/clocksource.h> | 19 | #include <linux/timecounter.h> |
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | 21 | ||
22 | #define ARCH_TIMER_CTRL_ENABLE (1 << 0) | 22 | #define ARCH_TIMER_CTRL_ENABLE (1 << 0) |
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h index cd62bf4289e9..178525e5f430 100644 --- a/include/crypto/if_alg.h +++ b/include/crypto/if_alg.h | |||
@@ -50,6 +50,7 @@ struct af_alg_type { | |||
50 | void (*release)(void *private); | 50 | void (*release)(void *private); |
51 | int (*setkey)(void *private, const u8 *key, unsigned int keylen); | 51 | int (*setkey)(void *private, const u8 *key, unsigned int keylen); |
52 | int (*accept)(void *private, struct sock *sk); | 52 | int (*accept)(void *private, struct sock *sk); |
53 | int (*setauthsize)(void *private, unsigned int authsize); | ||
53 | 54 | ||
54 | struct proto_ops *ops; | 55 | struct proto_ops *ops; |
55 | struct module *owner; | 56 | struct module *owner; |
@@ -67,8 +68,7 @@ int af_alg_unregister_type(const struct af_alg_type *type); | |||
67 | int af_alg_release(struct socket *sock); | 68 | int af_alg_release(struct socket *sock); |
68 | int af_alg_accept(struct sock *sk, struct socket *newsock); | 69 | int af_alg_accept(struct sock *sk, struct socket *newsock); |
69 | 70 | ||
70 | int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len, | 71 | int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len); |
71 | int write); | ||
72 | void af_alg_free_sg(struct af_alg_sgl *sgl); | 72 | void af_alg_free_sg(struct af_alg_sgl *sgl); |
73 | 73 | ||
74 | int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con); | 74 | int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con); |
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 7ef512f8631c..20e4226a2e14 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -33,21 +33,13 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
33 | sg1[num - 1].page_link |= 0x01; | 33 | sg1[num - 1].page_link |= 0x01; |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | ||
37 | { | ||
38 | if (sg_is_last(sg)) | ||
39 | return NULL; | ||
40 | |||
41 | return (++sg)->length ? sg : sg_chain_ptr(sg); | ||
42 | } | ||
43 | |||
44 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | 36 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, |
45 | struct scatterlist *sg, | 37 | struct scatterlist *sg, |
46 | int chain, int num) | 38 | int chain, int num) |
47 | { | 39 | { |
48 | if (chain) { | 40 | if (chain) { |
49 | head->length += sg->length; | 41 | head->length += sg->length; |
50 | sg = scatterwalk_sg_next(sg); | 42 | sg = sg_next(sg); |
51 | } | 43 | } |
52 | 44 | ||
53 | if (sg) | 45 | if (sg) |
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h new file mode 100644 index 000000000000..5a4f49005169 --- /dev/null +++ b/include/drm/bridge/dw_hdmi.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Freescale Semiconductor, Inc. | ||
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 | |||
10 | #ifndef __DW_HDMI__ | ||
11 | #define __DW_HDMI__ | ||
12 | |||
13 | #include <drm/drmP.h> | ||
14 | |||
15 | enum { | ||
16 | DW_HDMI_RES_8, | ||
17 | DW_HDMI_RES_10, | ||
18 | DW_HDMI_RES_12, | ||
19 | DW_HDMI_RES_MAX, | ||
20 | }; | ||
21 | |||
22 | enum dw_hdmi_devtype { | ||
23 | IMX6Q_HDMI, | ||
24 | IMX6DL_HDMI, | ||
25 | RK3288_HDMI, | ||
26 | }; | ||
27 | |||
28 | struct dw_hdmi_mpll_config { | ||
29 | unsigned long mpixelclock; | ||
30 | struct { | ||
31 | u16 cpce; | ||
32 | u16 gmp; | ||
33 | } res[DW_HDMI_RES_MAX]; | ||
34 | }; | ||
35 | |||
36 | struct dw_hdmi_curr_ctrl { | ||
37 | unsigned long mpixelclock; | ||
38 | u16 curr[DW_HDMI_RES_MAX]; | ||
39 | }; | ||
40 | |||
41 | struct dw_hdmi_sym_term { | ||
42 | unsigned long mpixelclock; | ||
43 | u16 sym_ctr; /*clock symbol and transmitter control*/ | ||
44 | u16 term; /*transmission termination value*/ | ||
45 | }; | ||
46 | |||
47 | struct dw_hdmi_plat_data { | ||
48 | enum dw_hdmi_devtype dev_type; | ||
49 | const struct dw_hdmi_mpll_config *mpll_cfg; | ||
50 | const struct dw_hdmi_curr_ctrl *cur_ctr; | ||
51 | const struct dw_hdmi_sym_term *sym_term; | ||
52 | enum drm_mode_status (*mode_valid)(struct drm_connector *connector, | ||
53 | struct drm_display_mode *mode); | ||
54 | }; | ||
55 | |||
56 | void dw_hdmi_unbind(struct device *dev, struct device *master, void *data); | ||
57 | int dw_hdmi_bind(struct device *dev, struct device *master, | ||
58 | void *data, struct drm_encoder *encoder, | ||
59 | struct resource *iores, int irq, | ||
60 | const struct dw_hdmi_plat_data *plat_data); | ||
61 | #endif /* __IMX_HDMI_H__ */ | ||
diff --git a/include/drm/bridge/ptn3460.h b/include/drm/bridge/ptn3460.h index ff62344fec6c..b11f8e17e72f 100644 --- a/include/drm/bridge/ptn3460.h +++ b/include/drm/bridge/ptn3460.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _DRM_BRIDGE_PTN3460_H_ | 15 | #define _DRM_BRIDGE_PTN3460_H_ |
16 | 16 | ||
17 | struct drm_device; | 17 | struct drm_device; |
18 | struct drm_bridge; | ||
18 | struct drm_encoder; | 19 | struct drm_encoder; |
19 | struct i2c_client; | 20 | struct i2c_client; |
20 | struct device_node; | 21 | struct device_node; |
@@ -23,6 +24,9 @@ struct device_node; | |||
23 | 24 | ||
24 | int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, | 25 | int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, |
25 | struct i2c_client *client, struct device_node *node); | 26 | struct i2c_client *client, struct device_node *node); |
27 | |||
28 | void ptn3460_destroy(struct drm_bridge *bridge); | ||
29 | |||
26 | #else | 30 | #else |
27 | 31 | ||
28 | static inline int ptn3460_init(struct drm_device *dev, | 32 | static inline int ptn3460_init(struct drm_device *dev, |
@@ -32,6 +36,10 @@ static inline int ptn3460_init(struct drm_device *dev, | |||
32 | return 0; | 36 | return 0; |
33 | } | 37 | } |
34 | 38 | ||
39 | static inline void ptn3460_destroy(struct drm_bridge *bridge) | ||
40 | { | ||
41 | } | ||
42 | |||
35 | #endif | 43 | #endif |
36 | 44 | ||
37 | #endif | 45 | #endif |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index e1b2e8b98af7..e928625a9da0 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -143,6 +143,7 @@ void drm_err(const char *format, ...); | |||
143 | #define DRIVER_MODESET 0x2000 | 143 | #define DRIVER_MODESET 0x2000 |
144 | #define DRIVER_PRIME 0x4000 | 144 | #define DRIVER_PRIME 0x4000 |
145 | #define DRIVER_RENDER 0x8000 | 145 | #define DRIVER_RENDER 0x8000 |
146 | #define DRIVER_ATOMIC 0x10000 | ||
146 | 147 | ||
147 | /***********************************************************************/ | 148 | /***********************************************************************/ |
148 | /** \name Macros to make printk easier */ | 149 | /** \name Macros to make printk easier */ |
@@ -283,6 +284,8 @@ struct drm_file { | |||
283 | * in the plane list | 284 | * in the plane list |
284 | */ | 285 | */ |
285 | unsigned universal_planes:1; | 286 | unsigned universal_planes:1; |
287 | /* true if client understands atomic properties */ | ||
288 | unsigned atomic:1; | ||
286 | 289 | ||
287 | struct pid *pid; | 290 | struct pid *pid; |
288 | kuid_t uid; | 291 | kuid_t uid; |
@@ -744,8 +747,6 @@ struct drm_device { | |||
744 | 747 | ||
745 | /** \name Context support */ | 748 | /** \name Context support */ |
746 | /*@{ */ | 749 | /*@{ */ |
747 | bool irq_enabled; /**< True if irq handler is enabled */ | ||
748 | int irq; | ||
749 | 750 | ||
750 | __volatile__ long context_flag; /**< Context swapping flag */ | 751 | __volatile__ long context_flag; /**< Context swapping flag */ |
751 | int last_context; /**< Last current context */ | 752 | int last_context; /**< Last current context */ |
@@ -753,6 +754,8 @@ struct drm_device { | |||
753 | 754 | ||
754 | /** \name VBLANK IRQ support */ | 755 | /** \name VBLANK IRQ support */ |
755 | /*@{ */ | 756 | /*@{ */ |
757 | bool irq_enabled; | ||
758 | int irq; | ||
756 | 759 | ||
757 | /* | 760 | /* |
758 | * At load time, disabling the vblank interrupt won't be allowed since | 761 | * At load time, disabling the vblank interrupt won't be allowed since |
@@ -954,6 +957,7 @@ extern void drm_master_put(struct drm_master **master); | |||
954 | extern void drm_put_dev(struct drm_device *dev); | 957 | extern void drm_put_dev(struct drm_device *dev); |
955 | extern void drm_unplug_dev(struct drm_device *dev); | 958 | extern void drm_unplug_dev(struct drm_device *dev); |
956 | extern unsigned int drm_debug; | 959 | extern unsigned int drm_debug; |
960 | extern bool drm_atomic; | ||
957 | 961 | ||
958 | /* Debugfs support */ | 962 | /* Debugfs support */ |
959 | #if defined(CONFIG_DEBUG_FS) | 963 | #if defined(CONFIG_DEBUG_FS) |
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index ad2229574dd9..51168a8b723a 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h | |||
@@ -38,16 +38,25 @@ void drm_atomic_state_free(struct drm_atomic_state *state); | |||
38 | struct drm_crtc_state * __must_check | 38 | struct drm_crtc_state * __must_check |
39 | drm_atomic_get_crtc_state(struct drm_atomic_state *state, | 39 | drm_atomic_get_crtc_state(struct drm_atomic_state *state, |
40 | struct drm_crtc *crtc); | 40 | struct drm_crtc *crtc); |
41 | int drm_atomic_crtc_set_property(struct drm_crtc *crtc, | ||
42 | struct drm_crtc_state *state, struct drm_property *property, | ||
43 | uint64_t val); | ||
41 | struct drm_plane_state * __must_check | 44 | struct drm_plane_state * __must_check |
42 | drm_atomic_get_plane_state(struct drm_atomic_state *state, | 45 | drm_atomic_get_plane_state(struct drm_atomic_state *state, |
43 | struct drm_plane *plane); | 46 | struct drm_plane *plane); |
47 | int drm_atomic_plane_set_property(struct drm_plane *plane, | ||
48 | struct drm_plane_state *state, struct drm_property *property, | ||
49 | uint64_t val); | ||
44 | struct drm_connector_state * __must_check | 50 | struct drm_connector_state * __must_check |
45 | drm_atomic_get_connector_state(struct drm_atomic_state *state, | 51 | drm_atomic_get_connector_state(struct drm_atomic_state *state, |
46 | struct drm_connector *connector); | 52 | struct drm_connector *connector); |
53 | int drm_atomic_connector_set_property(struct drm_connector *connector, | ||
54 | struct drm_connector_state *state, struct drm_property *property, | ||
55 | uint64_t val); | ||
47 | 56 | ||
48 | int __must_check | 57 | int __must_check |
49 | drm_atomic_set_crtc_for_plane(struct drm_atomic_state *state, | 58 | drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, |
50 | struct drm_plane *plane, struct drm_crtc *crtc); | 59 | struct drm_crtc *crtc); |
51 | void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state, | 60 | void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state, |
52 | struct drm_framebuffer *fb); | 61 | struct drm_framebuffer *fb); |
53 | int __must_check | 62 | int __must_check |
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index f956b413311e..8039d54a7441 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h | |||
@@ -30,6 +30,10 @@ | |||
30 | 30 | ||
31 | #include <drm/drm_crtc.h> | 31 | #include <drm/drm_crtc.h> |
32 | 32 | ||
33 | int drm_atomic_helper_check_modeset(struct drm_device *dev, | ||
34 | struct drm_atomic_state *state); | ||
35 | int drm_atomic_helper_check_planes(struct drm_device *dev, | ||
36 | struct drm_atomic_state *state); | ||
33 | int drm_atomic_helper_check(struct drm_device *dev, | 37 | int drm_atomic_helper_check(struct drm_device *dev, |
34 | struct drm_atomic_state *state); | 38 | struct drm_atomic_state *state); |
35 | int drm_atomic_helper_commit(struct drm_device *dev, | 39 | int drm_atomic_helper_commit(struct drm_device *dev, |
@@ -78,6 +82,8 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, | |||
78 | struct drm_framebuffer *fb, | 82 | struct drm_framebuffer *fb, |
79 | struct drm_pending_vblank_event *event, | 83 | struct drm_pending_vblank_event *event, |
80 | uint32_t flags); | 84 | uint32_t flags); |
85 | void drm_atomic_helper_connector_dpms(struct drm_connector *connector, | ||
86 | int mode); | ||
81 | 87 | ||
82 | /* default implementations for state handling */ | 88 | /* default implementations for state handling */ |
83 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); | 89 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); |
@@ -123,4 +129,41 @@ void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, | |||
123 | #define drm_atomic_crtc_state_for_each_plane(plane, crtc_state) \ | 129 | #define drm_atomic_crtc_state_for_each_plane(plane, crtc_state) \ |
124 | drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask) | 130 | drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask) |
125 | 131 | ||
132 | /* | ||
133 | * drm_atomic_plane_disabling - check whether a plane is being disabled | ||
134 | * @plane: plane object | ||
135 | * @old_state: previous atomic state | ||
136 | * | ||
137 | * Checks the atomic state of a plane to determine whether it's being disabled | ||
138 | * or not. This also WARNs if it detects an invalid state (both CRTC and FB | ||
139 | * need to either both be NULL or both be non-NULL). | ||
140 | * | ||
141 | * RETURNS: | ||
142 | * True if the plane is being disabled, false otherwise. | ||
143 | */ | ||
144 | static inline bool | ||
145 | drm_atomic_plane_disabling(struct drm_plane *plane, | ||
146 | struct drm_plane_state *old_state) | ||
147 | { | ||
148 | /* | ||
149 | * When disabling a plane, CRTC and FB should always be NULL together. | ||
150 | * Anything else should be considered a bug in the atomic core, so we | ||
151 | * gently warn about it. | ||
152 | */ | ||
153 | WARN_ON((plane->state->crtc == NULL && plane->state->fb != NULL) || | ||
154 | (plane->state->crtc != NULL && plane->state->fb == NULL)); | ||
155 | |||
156 | /* | ||
157 | * When using the transitional helpers, old_state may be NULL. If so, | ||
158 | * we know nothing about the current state and have to assume that it | ||
159 | * might be enabled. | ||
160 | * | ||
161 | * When using the atomic helpers, old_state won't be NULL. Therefore | ||
162 | * this check assumes that either the driver will have reconstructed | ||
163 | * the correct state in ->reset() or that the driver will have taken | ||
164 | * appropriate measures to disable all planes. | ||
165 | */ | ||
166 | return (!old_state || old_state->crtc) && !plane->state->crtc; | ||
167 | } | ||
168 | |||
126 | #endif /* DRM_ATOMIC_HELPER_H_ */ | 169 | #endif /* DRM_ATOMIC_HELPER_H_ */ |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index b86329813ad3..920e21a8f3fd 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | #include <linux/fb.h> | 32 | #include <linux/fb.h> |
33 | #include <linux/hdmi.h> | 33 | #include <linux/hdmi.h> |
34 | #include <linux/media-bus-format.h> | ||
34 | #include <uapi/drm/drm_mode.h> | 35 | #include <uapi/drm/drm_mode.h> |
35 | #include <uapi/drm/drm_fourcc.h> | 36 | #include <uapi/drm/drm_fourcc.h> |
36 | #include <drm/drm_modeset_lock.h> | 37 | #include <drm/drm_modeset_lock.h> |
@@ -63,8 +64,16 @@ struct drm_mode_object { | |||
63 | 64 | ||
64 | #define DRM_OBJECT_MAX_PROPERTY 24 | 65 | #define DRM_OBJECT_MAX_PROPERTY 24 |
65 | struct drm_object_properties { | 66 | struct drm_object_properties { |
66 | int count; | 67 | int count, atomic_count; |
67 | uint32_t ids[DRM_OBJECT_MAX_PROPERTY]; | 68 | /* NOTE: if we ever start dynamically destroying properties (ie. |
69 | * not at drm_mode_config_cleanup() time), then we'd have to do | ||
70 | * a better job of detaching property from mode objects to avoid | ||
71 | * dangling property pointers: | ||
72 | */ | ||
73 | struct drm_property *properties[DRM_OBJECT_MAX_PROPERTY]; | ||
74 | /* do not read/write values directly, but use drm_object_property_get_value() | ||
75 | * and drm_object_property_set_value(): | ||
76 | */ | ||
68 | uint64_t values[DRM_OBJECT_MAX_PROPERTY]; | 77 | uint64_t values[DRM_OBJECT_MAX_PROPERTY]; |
69 | }; | 78 | }; |
70 | 79 | ||
@@ -131,6 +140,9 @@ struct drm_display_info { | |||
131 | enum subpixel_order subpixel_order; | 140 | enum subpixel_order subpixel_order; |
132 | u32 color_formats; | 141 | u32 color_formats; |
133 | 142 | ||
143 | const u32 *bus_formats; | ||
144 | unsigned int num_bus_formats; | ||
145 | |||
134 | /* Mask of supported hdmi deep color modes */ | 146 | /* Mask of supported hdmi deep color modes */ |
135 | u8 edid_hdmi_dc_modes; | 147 | u8 edid_hdmi_dc_modes; |
136 | 148 | ||
@@ -237,8 +249,11 @@ struct drm_atomic_state; | |||
237 | 249 | ||
238 | /** | 250 | /** |
239 | * struct drm_crtc_state - mutable CRTC state | 251 | * struct drm_crtc_state - mutable CRTC state |
252 | * @crtc: backpointer to the CRTC | ||
240 | * @enable: whether the CRTC should be enabled, gates all other state | 253 | * @enable: whether the CRTC should be enabled, gates all other state |
254 | * @active: whether the CRTC is actively displaying (used for DPMS) | ||
241 | * @mode_changed: for use by helpers and drivers when computing state updates | 255 | * @mode_changed: for use by helpers and drivers when computing state updates |
256 | * @active_changed: for use by helpers and drivers when computing state updates | ||
242 | * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes | 257 | * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes |
243 | * @last_vblank_count: for helpers and drivers to capture the vblank of the | 258 | * @last_vblank_count: for helpers and drivers to capture the vblank of the |
244 | * update to ensure framebuffer cleanup isn't done too early | 259 | * update to ensure framebuffer cleanup isn't done too early |
@@ -248,13 +263,23 @@ struct drm_atomic_state; | |||
248 | * @event: optional pointer to a DRM event to signal upon completion of the | 263 | * @event: optional pointer to a DRM event to signal upon completion of the |
249 | * state update | 264 | * state update |
250 | * @state: backpointer to global drm_atomic_state | 265 | * @state: backpointer to global drm_atomic_state |
266 | * | ||
267 | * Note that the distinction between @enable and @active is rather subtile: | ||
268 | * Flipping @active while @enable is set without changing anything else may | ||
269 | * never return in a failure from the ->atomic_check callback. Userspace assumes | ||
270 | * that a DPMS On will always succeed. In other words: @enable controls resource | ||
271 | * assignment, @active controls the actual hardware state. | ||
251 | */ | 272 | */ |
252 | struct drm_crtc_state { | 273 | struct drm_crtc_state { |
274 | struct drm_crtc *crtc; | ||
275 | |||
253 | bool enable; | 276 | bool enable; |
277 | bool active; | ||
254 | 278 | ||
255 | /* computed state bits used by helpers and drivers */ | 279 | /* computed state bits used by helpers and drivers */ |
256 | bool planes_changed : 1; | 280 | bool planes_changed : 1; |
257 | bool mode_changed : 1; | 281 | bool mode_changed : 1; |
282 | bool active_changed : 1; | ||
258 | 283 | ||
259 | /* attached planes bitmask: | 284 | /* attached planes bitmask: |
260 | * WARNING: transitional helpers do not maintain plane_mask so | 285 | * WARNING: transitional helpers do not maintain plane_mask so |
@@ -292,6 +317,9 @@ struct drm_crtc_state { | |||
292 | * @atomic_duplicate_state: duplicate the atomic state for this CRTC | 317 | * @atomic_duplicate_state: duplicate the atomic state for this CRTC |
293 | * @atomic_destroy_state: destroy an atomic state for this CRTC | 318 | * @atomic_destroy_state: destroy an atomic state for this CRTC |
294 | * @atomic_set_property: set a property on an atomic state for this CRTC | 319 | * @atomic_set_property: set a property on an atomic state for this CRTC |
320 | * (do not call directly, use drm_atomic_crtc_set_property()) | ||
321 | * @atomic_get_property: get a property on an atomic state for this CRTC | ||
322 | * (do not call directly, use drm_atomic_crtc_get_property()) | ||
295 | * | 323 | * |
296 | * The drm_crtc_funcs structure is the central CRTC management structure | 324 | * The drm_crtc_funcs structure is the central CRTC management structure |
297 | * in the DRM. Each CRTC controls one or more connectors (note that the name | 325 | * in the DRM. Each CRTC controls one or more connectors (note that the name |
@@ -351,6 +379,10 @@ struct drm_crtc_funcs { | |||
351 | struct drm_crtc_state *state, | 379 | struct drm_crtc_state *state, |
352 | struct drm_property *property, | 380 | struct drm_property *property, |
353 | uint64_t val); | 381 | uint64_t val); |
382 | int (*atomic_get_property)(struct drm_crtc *crtc, | ||
383 | const struct drm_crtc_state *state, | ||
384 | struct drm_property *property, | ||
385 | uint64_t *val); | ||
354 | }; | 386 | }; |
355 | 387 | ||
356 | /** | 388 | /** |
@@ -449,11 +481,14 @@ struct drm_crtc { | |||
449 | 481 | ||
450 | /** | 482 | /** |
451 | * struct drm_connector_state - mutable connector state | 483 | * struct drm_connector_state - mutable connector state |
484 | * @connector: backpointer to the connector | ||
452 | * @crtc: CRTC to connect connector to, NULL if disabled | 485 | * @crtc: CRTC to connect connector to, NULL if disabled |
453 | * @best_encoder: can be used by helpers and drivers to select the encoder | 486 | * @best_encoder: can be used by helpers and drivers to select the encoder |
454 | * @state: backpointer to global drm_atomic_state | 487 | * @state: backpointer to global drm_atomic_state |
455 | */ | 488 | */ |
456 | struct drm_connector_state { | 489 | struct drm_connector_state { |
490 | struct drm_connector *connector; | ||
491 | |||
457 | struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_connector() */ | 492 | struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_connector() */ |
458 | 493 | ||
459 | struct drm_encoder *best_encoder; | 494 | struct drm_encoder *best_encoder; |
@@ -463,7 +498,7 @@ struct drm_connector_state { | |||
463 | 498 | ||
464 | /** | 499 | /** |
465 | * struct drm_connector_funcs - control connectors on a given device | 500 | * struct drm_connector_funcs - control connectors on a given device |
466 | * @dpms: set power state (see drm_crtc_funcs above) | 501 | * @dpms: set power state |
467 | * @save: save connector state | 502 | * @save: save connector state |
468 | * @restore: restore connector state | 503 | * @restore: restore connector state |
469 | * @reset: reset connector after state has been invalidated (e.g. resume) | 504 | * @reset: reset connector after state has been invalidated (e.g. resume) |
@@ -475,6 +510,9 @@ struct drm_connector_state { | |||
475 | * @atomic_duplicate_state: duplicate the atomic state for this connector | 510 | * @atomic_duplicate_state: duplicate the atomic state for this connector |
476 | * @atomic_destroy_state: destroy an atomic state for this connector | 511 | * @atomic_destroy_state: destroy an atomic state for this connector |
477 | * @atomic_set_property: set a property on an atomic state for this connector | 512 | * @atomic_set_property: set a property on an atomic state for this connector |
513 | * (do not call directly, use drm_atomic_connector_set_property()) | ||
514 | * @atomic_get_property: get a property on an atomic state for this connector | ||
515 | * (do not call directly, use drm_atomic_connector_get_property()) | ||
478 | * | 516 | * |
479 | * Each CRTC may have one or more connectors attached to it. The functions | 517 | * Each CRTC may have one or more connectors attached to it. The functions |
480 | * below allow the core DRM code to control connectors, enumerate available modes, | 518 | * below allow the core DRM code to control connectors, enumerate available modes, |
@@ -508,6 +546,10 @@ struct drm_connector_funcs { | |||
508 | struct drm_connector_state *state, | 546 | struct drm_connector_state *state, |
509 | struct drm_property *property, | 547 | struct drm_property *property, |
510 | uint64_t val); | 548 | uint64_t val); |
549 | int (*atomic_get_property)(struct drm_connector *connector, | ||
550 | const struct drm_connector_state *state, | ||
551 | struct drm_property *property, | ||
552 | uint64_t *val); | ||
511 | }; | 553 | }; |
512 | 554 | ||
513 | /** | 555 | /** |
@@ -693,6 +735,7 @@ struct drm_connector { | |||
693 | 735 | ||
694 | /** | 736 | /** |
695 | * struct drm_plane_state - mutable plane state | 737 | * struct drm_plane_state - mutable plane state |
738 | * @plane: backpointer to the plane | ||
696 | * @crtc: currently bound CRTC, NULL if disabled | 739 | * @crtc: currently bound CRTC, NULL if disabled |
697 | * @fb: currently bound framebuffer | 740 | * @fb: currently bound framebuffer |
698 | * @fence: optional fence to wait for before scanning out @fb | 741 | * @fence: optional fence to wait for before scanning out @fb |
@@ -709,6 +752,8 @@ struct drm_connector { | |||
709 | * @state: backpointer to global drm_atomic_state | 752 | * @state: backpointer to global drm_atomic_state |
710 | */ | 753 | */ |
711 | struct drm_plane_state { | 754 | struct drm_plane_state { |
755 | struct drm_plane *plane; | ||
756 | |||
712 | struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_plane() */ | 757 | struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_plane() */ |
713 | struct drm_framebuffer *fb; /* do not write directly, use drm_atomic_set_fb_for_plane() */ | 758 | struct drm_framebuffer *fb; /* do not write directly, use drm_atomic_set_fb_for_plane() */ |
714 | struct fence *fence; | 759 | struct fence *fence; |
@@ -721,6 +766,9 @@ struct drm_plane_state { | |||
721 | uint32_t src_x, src_y; | 766 | uint32_t src_x, src_y; |
722 | uint32_t src_h, src_w; | 767 | uint32_t src_h, src_w; |
723 | 768 | ||
769 | /* Plane rotation */ | ||
770 | unsigned int rotation; | ||
771 | |||
724 | struct drm_atomic_state *state; | 772 | struct drm_atomic_state *state; |
725 | }; | 773 | }; |
726 | 774 | ||
@@ -735,6 +783,9 @@ struct drm_plane_state { | |||
735 | * @atomic_duplicate_state: duplicate the atomic state for this plane | 783 | * @atomic_duplicate_state: duplicate the atomic state for this plane |
736 | * @atomic_destroy_state: destroy an atomic state for this plane | 784 | * @atomic_destroy_state: destroy an atomic state for this plane |
737 | * @atomic_set_property: set a property on an atomic state for this plane | 785 | * @atomic_set_property: set a property on an atomic state for this plane |
786 | * (do not call directly, use drm_atomic_plane_set_property()) | ||
787 | * @atomic_get_property: get a property on an atomic state for this plane | ||
788 | * (do not call directly, use drm_atomic_plane_get_property()) | ||
738 | */ | 789 | */ |
739 | struct drm_plane_funcs { | 790 | struct drm_plane_funcs { |
740 | int (*update_plane)(struct drm_plane *plane, | 791 | int (*update_plane)(struct drm_plane *plane, |
@@ -758,6 +809,10 @@ struct drm_plane_funcs { | |||
758 | struct drm_plane_state *state, | 809 | struct drm_plane_state *state, |
759 | struct drm_property *property, | 810 | struct drm_property *property, |
760 | uint64_t val); | 811 | uint64_t val); |
812 | int (*atomic_get_property)(struct drm_plane *plane, | ||
813 | const struct drm_plane_state *state, | ||
814 | struct drm_property *property, | ||
815 | uint64_t *val); | ||
761 | }; | 816 | }; |
762 | 817 | ||
763 | enum drm_plane_type { | 818 | enum drm_plane_type { |
@@ -813,15 +868,16 @@ struct drm_plane { | |||
813 | 868 | ||
814 | /** | 869 | /** |
815 | * struct drm_bridge_funcs - drm_bridge control functions | 870 | * struct drm_bridge_funcs - drm_bridge control functions |
871 | * @attach: Called during drm_bridge_attach | ||
816 | * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge | 872 | * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge |
817 | * @disable: Called right before encoder prepare, disables the bridge | 873 | * @disable: Called right before encoder prepare, disables the bridge |
818 | * @post_disable: Called right after encoder prepare, for lockstepped disable | 874 | * @post_disable: Called right after encoder prepare, for lockstepped disable |
819 | * @mode_set: Set this mode to the bridge | 875 | * @mode_set: Set this mode to the bridge |
820 | * @pre_enable: Called right before encoder commit, for lockstepped commit | 876 | * @pre_enable: Called right before encoder commit, for lockstepped commit |
821 | * @enable: Called right after encoder commit, enables the bridge | 877 | * @enable: Called right after encoder commit, enables the bridge |
822 | * @destroy: make object go away | ||
823 | */ | 878 | */ |
824 | struct drm_bridge_funcs { | 879 | struct drm_bridge_funcs { |
880 | int (*attach)(struct drm_bridge *bridge); | ||
825 | bool (*mode_fixup)(struct drm_bridge *bridge, | 881 | bool (*mode_fixup)(struct drm_bridge *bridge, |
826 | const struct drm_display_mode *mode, | 882 | const struct drm_display_mode *mode, |
827 | struct drm_display_mode *adjusted_mode); | 883 | struct drm_display_mode *adjusted_mode); |
@@ -832,22 +888,24 @@ struct drm_bridge_funcs { | |||
832 | struct drm_display_mode *adjusted_mode); | 888 | struct drm_display_mode *adjusted_mode); |
833 | void (*pre_enable)(struct drm_bridge *bridge); | 889 | void (*pre_enable)(struct drm_bridge *bridge); |
834 | void (*enable)(struct drm_bridge *bridge); | 890 | void (*enable)(struct drm_bridge *bridge); |
835 | void (*destroy)(struct drm_bridge *bridge); | ||
836 | }; | 891 | }; |
837 | 892 | ||
838 | /** | 893 | /** |
839 | * struct drm_bridge - central DRM bridge control structure | 894 | * struct drm_bridge - central DRM bridge control structure |
840 | * @dev: DRM device this bridge belongs to | 895 | * @dev: DRM device this bridge belongs to |
841 | * @head: list management | 896 | * @of_node: device node pointer to the bridge |
897 | * @list: to keep track of all added bridges | ||
842 | * @base: base mode object | 898 | * @base: base mode object |
843 | * @funcs: control functions | 899 | * @funcs: control functions |
844 | * @driver_private: pointer to the bridge driver's internal context | 900 | * @driver_private: pointer to the bridge driver's internal context |
845 | */ | 901 | */ |
846 | struct drm_bridge { | 902 | struct drm_bridge { |
847 | struct drm_device *dev; | 903 | struct drm_device *dev; |
848 | struct list_head head; | 904 | struct drm_encoder *encoder; |
849 | 905 | #ifdef CONFIG_OF | |
850 | struct drm_mode_object base; | 906 | struct device_node *of_node; |
907 | #endif | ||
908 | struct list_head list; | ||
851 | 909 | ||
852 | const struct drm_bridge_funcs *funcs; | 910 | const struct drm_bridge_funcs *funcs; |
853 | void *driver_private; | 911 | void *driver_private; |
@@ -856,7 +914,8 @@ struct drm_bridge { | |||
856 | /** | 914 | /** |
857 | * struct struct drm_atomic_state - the global state object for atomic updates | 915 | * struct struct drm_atomic_state - the global state object for atomic updates |
858 | * @dev: parent DRM device | 916 | * @dev: parent DRM device |
859 | * @flags: state flags like async update | 917 | * @allow_modeset: allow full modeset |
918 | * @legacy_cursor_update: hint to enforce legacy cursor ioctl semantics | ||
860 | * @planes: pointer to array of plane pointers | 919 | * @planes: pointer to array of plane pointers |
861 | * @plane_states: pointer to array of plane states pointers | 920 | * @plane_states: pointer to array of plane states pointers |
862 | * @crtcs: pointer to array of CRTC pointers | 921 | * @crtcs: pointer to array of CRTC pointers |
@@ -868,7 +927,8 @@ struct drm_bridge { | |||
868 | */ | 927 | */ |
869 | struct drm_atomic_state { | 928 | struct drm_atomic_state { |
870 | struct drm_device *dev; | 929 | struct drm_device *dev; |
871 | uint32_t flags; | 930 | bool allow_modeset : 1; |
931 | bool legacy_cursor_update : 1; | ||
872 | struct drm_plane **planes; | 932 | struct drm_plane **planes; |
873 | struct drm_plane_state **plane_states; | 933 | struct drm_plane_state **plane_states; |
874 | struct drm_crtc **crtcs; | 934 | struct drm_crtc **crtcs; |
@@ -950,7 +1010,6 @@ struct drm_mode_group { | |||
950 | uint32_t num_crtcs; | 1010 | uint32_t num_crtcs; |
951 | uint32_t num_encoders; | 1011 | uint32_t num_encoders; |
952 | uint32_t num_connectors; | 1012 | uint32_t num_connectors; |
953 | uint32_t num_bridges; | ||
954 | 1013 | ||
955 | /* list of object IDs for this group */ | 1014 | /* list of object IDs for this group */ |
956 | uint32_t *id_list; | 1015 | uint32_t *id_list; |
@@ -969,8 +1028,6 @@ struct drm_mode_group { | |||
969 | * @fb_list: list of framebuffers available | 1028 | * @fb_list: list of framebuffers available |
970 | * @num_connector: number of connectors on this device | 1029 | * @num_connector: number of connectors on this device |
971 | * @connector_list: list of connector objects | 1030 | * @connector_list: list of connector objects |
972 | * @num_bridge: number of bridges on this device | ||
973 | * @bridge_list: list of bridge objects | ||
974 | * @num_encoder: number of encoders on this device | 1031 | * @num_encoder: number of encoders on this device |
975 | * @encoder_list: list of encoder objects | 1032 | * @encoder_list: list of encoder objects |
976 | * @num_overlay_plane: number of overlay planes on this device | 1033 | * @num_overlay_plane: number of overlay planes on this device |
@@ -1015,8 +1072,6 @@ struct drm_mode_config { | |||
1015 | 1072 | ||
1016 | int num_connector; | 1073 | int num_connector; |
1017 | struct list_head connector_list; | 1074 | struct list_head connector_list; |
1018 | int num_bridge; | ||
1019 | struct list_head bridge_list; | ||
1020 | int num_encoder; | 1075 | int num_encoder; |
1021 | struct list_head encoder_list; | 1076 | struct list_head encoder_list; |
1022 | 1077 | ||
@@ -1043,6 +1098,7 @@ struct drm_mode_config { | |||
1043 | /* output poll support */ | 1098 | /* output poll support */ |
1044 | bool poll_enabled; | 1099 | bool poll_enabled; |
1045 | bool poll_running; | 1100 | bool poll_running; |
1101 | bool delayed_event; | ||
1046 | struct delayed_work output_poll_work; | 1102 | struct delayed_work output_poll_work; |
1047 | 1103 | ||
1048 | /* pointers to standard properties */ | 1104 | /* pointers to standard properties */ |
@@ -1053,6 +1109,17 @@ struct drm_mode_config { | |||
1053 | struct drm_property *tile_property; | 1109 | struct drm_property *tile_property; |
1054 | struct drm_property *plane_type_property; | 1110 | struct drm_property *plane_type_property; |
1055 | struct drm_property *rotation_property; | 1111 | struct drm_property *rotation_property; |
1112 | struct drm_property *prop_src_x; | ||
1113 | struct drm_property *prop_src_y; | ||
1114 | struct drm_property *prop_src_w; | ||
1115 | struct drm_property *prop_src_h; | ||
1116 | struct drm_property *prop_crtc_x; | ||
1117 | struct drm_property *prop_crtc_y; | ||
1118 | struct drm_property *prop_crtc_w; | ||
1119 | struct drm_property *prop_crtc_h; | ||
1120 | struct drm_property *prop_fb_id; | ||
1121 | struct drm_property *prop_crtc_id; | ||
1122 | struct drm_property *prop_active; | ||
1056 | 1123 | ||
1057 | /* DVI-I properties */ | 1124 | /* DVI-I properties */ |
1058 | struct drm_property *dvi_i_subconnector_property; | 1125 | struct drm_property *dvi_i_subconnector_property; |
@@ -1153,9 +1220,10 @@ extern unsigned int drm_connector_index(struct drm_connector *connector); | |||
1153 | /* helper to unplug all connectors from sysfs for device */ | 1220 | /* helper to unplug all connectors from sysfs for device */ |
1154 | extern void drm_connector_unplug_all(struct drm_device *dev); | 1221 | extern void drm_connector_unplug_all(struct drm_device *dev); |
1155 | 1222 | ||
1156 | extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge, | 1223 | extern int drm_bridge_add(struct drm_bridge *bridge); |
1157 | const struct drm_bridge_funcs *funcs); | 1224 | extern void drm_bridge_remove(struct drm_bridge *bridge); |
1158 | extern void drm_bridge_cleanup(struct drm_bridge *bridge); | 1225 | extern struct drm_bridge *of_drm_find_bridge(struct device_node *np); |
1226 | extern int drm_bridge_attach(struct drm_device *dev, struct drm_bridge *bridge); | ||
1159 | 1227 | ||
1160 | extern int drm_encoder_init(struct drm_device *dev, | 1228 | extern int drm_encoder_init(struct drm_device *dev, |
1161 | struct drm_encoder *encoder, | 1229 | struct drm_encoder *encoder, |
@@ -1191,6 +1259,8 @@ extern int drm_plane_init(struct drm_device *dev, | |||
1191 | extern void drm_plane_cleanup(struct drm_plane *plane); | 1259 | extern void drm_plane_cleanup(struct drm_plane *plane); |
1192 | extern unsigned int drm_plane_index(struct drm_plane *plane); | 1260 | extern unsigned int drm_plane_index(struct drm_plane *plane); |
1193 | extern void drm_plane_force_disable(struct drm_plane *plane); | 1261 | extern void drm_plane_force_disable(struct drm_plane *plane); |
1262 | extern void drm_crtc_get_hv_timing(const struct drm_display_mode *mode, | ||
1263 | int *hdisplay, int *vdisplay); | ||
1194 | extern int drm_crtc_check_viewport(const struct drm_crtc *crtc, | 1264 | extern int drm_crtc_check_viewport(const struct drm_crtc *crtc, |
1195 | int x, int y, | 1265 | int x, int y, |
1196 | const struct drm_display_mode *mode, | 1266 | const struct drm_display_mode *mode, |
@@ -1224,6 +1294,10 @@ int drm_mode_connector_set_tile_property(struct drm_connector *connector); | |||
1224 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, | 1294 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, |
1225 | const struct edid *edid); | 1295 | const struct edid *edid); |
1226 | 1296 | ||
1297 | extern int drm_display_info_set_bus_formats(struct drm_display_info *info, | ||
1298 | const u32 *formats, | ||
1299 | unsigned int num_formats); | ||
1300 | |||
1227 | static inline bool drm_property_type_is(struct drm_property *property, | 1301 | static inline bool drm_property_type_is(struct drm_property *property, |
1228 | uint32_t type) | 1302 | uint32_t type) |
1229 | { | 1303 | { |
@@ -1279,6 +1353,8 @@ struct drm_property *drm_property_create_signed_range(struct drm_device *dev, | |||
1279 | int64_t min, int64_t max); | 1353 | int64_t min, int64_t max); |
1280 | struct drm_property *drm_property_create_object(struct drm_device *dev, | 1354 | struct drm_property *drm_property_create_object(struct drm_device *dev, |
1281 | int flags, const char *name, uint32_t type); | 1355 | int flags, const char *name, uint32_t type); |
1356 | struct drm_property *drm_property_create_bool(struct drm_device *dev, int flags, | ||
1357 | const char *name); | ||
1282 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); | 1358 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); |
1283 | extern int drm_property_add_enum(struct drm_property *property, int index, | 1359 | extern int drm_property_add_enum(struct drm_property *property, int index, |
1284 | uint64_t value, const char *name); | 1360 | uint64_t value, const char *name); |
@@ -1290,6 +1366,10 @@ extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); | |||
1290 | extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev); | 1366 | extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev); |
1291 | extern int drm_mode_create_dirty_info_property(struct drm_device *dev); | 1367 | extern int drm_mode_create_dirty_info_property(struct drm_device *dev); |
1292 | extern int drm_mode_create_suggested_offset_properties(struct drm_device *dev); | 1368 | extern int drm_mode_create_suggested_offset_properties(struct drm_device *dev); |
1369 | extern bool drm_property_change_valid_get(struct drm_property *property, | ||
1370 | uint64_t value, struct drm_mode_object **ref); | ||
1371 | extern void drm_property_change_valid_put(struct drm_property *property, | ||
1372 | struct drm_mode_object *ref); | ||
1293 | 1373 | ||
1294 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, | 1374 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, |
1295 | struct drm_encoder *encoder); | 1375 | struct drm_encoder *encoder); |
@@ -1381,6 +1461,8 @@ extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, | |||
1381 | extern int drm_mode_plane_set_obj_prop(struct drm_plane *plane, | 1461 | extern int drm_mode_plane_set_obj_prop(struct drm_plane *plane, |
1382 | struct drm_property *property, | 1462 | struct drm_property *property, |
1383 | uint64_t value); | 1463 | uint64_t value); |
1464 | extern int drm_mode_atomic_ioctl(struct drm_device *dev, | ||
1465 | void *data, struct drm_file *file_priv); | ||
1384 | 1466 | ||
1385 | extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, | 1467 | extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, |
1386 | int *bpp); | 1468 | int *bpp); |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 7adbb65ea8ae..c250a22b39ab 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -39,17 +39,38 @@ | |||
39 | 39 | ||
40 | #include <linux/fb.h> | 40 | #include <linux/fb.h> |
41 | 41 | ||
42 | #include <drm/drm_crtc.h> | ||
43 | |||
42 | enum mode_set_atomic { | 44 | enum mode_set_atomic { |
43 | LEAVE_ATOMIC_MODE_SET, | 45 | LEAVE_ATOMIC_MODE_SET, |
44 | ENTER_ATOMIC_MODE_SET, | 46 | ENTER_ATOMIC_MODE_SET, |
45 | }; | 47 | }; |
46 | 48 | ||
47 | /** | 49 | /** |
48 | * drm_crtc_helper_funcs - helper operations for CRTCs | 50 | * struct drm_crtc_helper_funcs - helper operations for CRTCs |
49 | * @mode_fixup: try to fixup proposed mode for this connector | 51 | * @dpms: set power state |
52 | * @prepare: prepare the CRTC, called before @mode_set | ||
53 | * @commit: commit changes to CRTC, called after @mode_set | ||
54 | * @mode_fixup: try to fixup proposed mode for this CRTC | ||
50 | * @mode_set: set this mode | 55 | * @mode_set: set this mode |
56 | * @mode_set_nofb: set mode only (no scanout buffer attached) | ||
57 | * @mode_set_base: update the scanout buffer | ||
58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) | ||
59 | * @load_lut: load color palette | ||
60 | * @disable: disable CRTC when no longer in use | ||
61 | * @enable: enable CRTC | ||
62 | * @atomic_check: check for validity of an atomic state | ||
63 | * @atomic_begin: begin atomic update | ||
64 | * @atomic_flush: flush atomic update | ||
51 | * | 65 | * |
52 | * The helper operations are called by the mid-layer CRTC helper. | 66 | * The helper operations are called by the mid-layer CRTC helper. |
67 | * | ||
68 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
69 | * deprecated. Used @enable and @disable instead exclusively. | ||
70 | * | ||
71 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
72 | * and the other hooks: @disable also needs to release any resources acquired in | ||
73 | * @mode_set (like shared PLLs). | ||
53 | */ | 74 | */ |
54 | struct drm_crtc_helper_funcs { | 75 | struct drm_crtc_helper_funcs { |
55 | /* | 76 | /* |
@@ -80,8 +101,8 @@ struct drm_crtc_helper_funcs { | |||
80 | /* reload the current crtc LUT */ | 101 | /* reload the current crtc LUT */ |
81 | void (*load_lut)(struct drm_crtc *crtc); | 102 | void (*load_lut)(struct drm_crtc *crtc); |
82 | 103 | ||
83 | /* disable crtc when not in use - more explicit than dpms off */ | ||
84 | void (*disable)(struct drm_crtc *crtc); | 104 | void (*disable)(struct drm_crtc *crtc); |
105 | void (*enable)(struct drm_crtc *crtc); | ||
85 | 106 | ||
86 | /* atomic helpers */ | 107 | /* atomic helpers */ |
87 | int (*atomic_check)(struct drm_crtc *crtc, | 108 | int (*atomic_check)(struct drm_crtc *crtc, |
@@ -91,11 +112,28 @@ struct drm_crtc_helper_funcs { | |||
91 | }; | 112 | }; |
92 | 113 | ||
93 | /** | 114 | /** |
94 | * drm_encoder_helper_funcs - helper operations for encoders | 115 | * struct drm_encoder_helper_funcs - helper operations for encoders |
116 | * @dpms: set power state | ||
117 | * @save: save connector state | ||
118 | * @restore: restore connector state | ||
95 | * @mode_fixup: try to fixup proposed mode for this connector | 119 | * @mode_fixup: try to fixup proposed mode for this connector |
120 | * @prepare: part of the disable sequence, called before the CRTC modeset | ||
121 | * @commit: called after the CRTC modeset | ||
96 | * @mode_set: set this mode | 122 | * @mode_set: set this mode |
123 | * @get_crtc: return CRTC that the encoder is currently attached to | ||
124 | * @detect: connection status detection | ||
125 | * @disable: disable encoder when not in use (overrides DPMS off) | ||
126 | * @enable: enable encoder | ||
127 | * @atomic_check: check for validity of an atomic update | ||
97 | * | 128 | * |
98 | * The helper operations are called by the mid-layer CRTC helper. | 129 | * The helper operations are called by the mid-layer CRTC helper. |
130 | * | ||
131 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
132 | * deprecated. Used @enable and @disable instead exclusively. | ||
133 | * | ||
134 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
135 | * and the other hooks: @disable also needs to release any resources acquired in | ||
136 | * @mode_set (like shared PLLs). | ||
99 | */ | 137 | */ |
100 | struct drm_encoder_helper_funcs { | 138 | struct drm_encoder_helper_funcs { |
101 | void (*dpms)(struct drm_encoder *encoder, int mode); | 139 | void (*dpms)(struct drm_encoder *encoder, int mode); |
@@ -114,14 +152,21 @@ struct drm_encoder_helper_funcs { | |||
114 | /* detect for DAC style encoders */ | 152 | /* detect for DAC style encoders */ |
115 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, | 153 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, |
116 | struct drm_connector *connector); | 154 | struct drm_connector *connector); |
117 | /* disable encoder when not in use - more explicit than dpms off */ | ||
118 | void (*disable)(struct drm_encoder *encoder); | 155 | void (*disable)(struct drm_encoder *encoder); |
156 | |||
157 | void (*enable)(struct drm_encoder *encoder); | ||
158 | |||
159 | /* atomic helpers */ | ||
160 | int (*atomic_check)(struct drm_encoder *encoder, | ||
161 | struct drm_crtc_state *crtc_state, | ||
162 | struct drm_connector_state *conn_state); | ||
119 | }; | 163 | }; |
120 | 164 | ||
121 | /** | 165 | /** |
122 | * drm_connector_helper_funcs - helper operations for connectors | 166 | * struct drm_connector_helper_funcs - helper operations for connectors |
123 | * @get_modes: get mode list for this connector | 167 | * @get_modes: get mode list for this connector |
124 | * @mode_valid (optional): is this mode valid on the given connector? | 168 | * @mode_valid: is this mode valid on the given connector? (optional) |
169 | * @best_encoder: return the preferred encoder for this connector | ||
125 | * | 170 | * |
126 | * The helper operations are called by the mid-layer CRTC helper. | 171 | * The helper operations are called by the mid-layer CRTC helper. |
127 | */ | 172 | */ |
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 11f8c84f98ce..7e25030a6aa2 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -586,6 +586,7 @@ struct drm_dp_link { | |||
586 | 586 | ||
587 | int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link); | 587 | int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link); |
588 | int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link); | 588 | int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link); |
589 | int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link); | ||
589 | int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link); | 590 | int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link); |
590 | 591 | ||
591 | int drm_dp_aux_register(struct drm_dp_aux *aux); | 592 | int drm_dp_aux_register(struct drm_dp_aux *aux); |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index b597068103aa..21b944c456f6 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -125,7 +125,7 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | |||
125 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); | 125 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); |
126 | 126 | ||
127 | int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); | 127 | int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); |
128 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); | 128 | int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); |
129 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); | 129 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); |
130 | int drm_fb_helper_debug_enter(struct fb_info *info); | 130 | int drm_fb_helper_debug_enter(struct fb_info *info); |
131 | int drm_fb_helper_debug_leave(struct fb_info *info); | 131 | int drm_fb_helper_debug_leave(struct fb_info *info); |
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index 91d0582f924e..d92f6dd1fb11 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h | |||
@@ -90,6 +90,9 @@ enum drm_mode_status { | |||
90 | 90 | ||
91 | #define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */ | 91 | #define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */ |
92 | #define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */ | 92 | #define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */ |
93 | #define CRTC_NO_DBLSCAN (1 << 2) /* don't adjust doublescan */ | ||
94 | #define CRTC_NO_VSCAN (1 << 3) /* don't adjust doublescan */ | ||
95 | #define CRTC_STEREO_DOUBLE_ONLY (CRTC_NO_DBLSCAN | CRTC_NO_VSCAN) | ||
93 | 96 | ||
94 | #define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF | 97 | #define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF |
95 | 98 | ||
@@ -197,6 +200,8 @@ struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev, | |||
197 | int GTF_K, int GTF_2J); | 200 | int GTF_K, int GTF_2J); |
198 | void drm_display_mode_from_videomode(const struct videomode *vm, | 201 | void drm_display_mode_from_videomode(const struct videomode *vm, |
199 | struct drm_display_mode *dmode); | 202 | struct drm_display_mode *dmode); |
203 | void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, | ||
204 | struct videomode *vm); | ||
200 | int of_get_drm_display_mode(struct device_node *np, | 205 | int of_get_drm_display_mode(struct device_node *np, |
201 | struct drm_display_mode *dmode, | 206 | struct drm_display_mode *dmode, |
202 | int index); | 207 | int index); |
@@ -217,9 +222,9 @@ bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, | |||
217 | const struct drm_display_mode *mode2); | 222 | const struct drm_display_mode *mode2); |
218 | 223 | ||
219 | /* for use by the crtc helper probe functions */ | 224 | /* for use by the crtc helper probe functions */ |
220 | void drm_mode_validate_size(struct drm_device *dev, | 225 | enum drm_mode_status drm_mode_validate_basic(const struct drm_display_mode *mode); |
221 | struct list_head *mode_list, | 226 | enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *mode, |
222 | int maxX, int maxY); | 227 | int maxX, int maxY); |
223 | void drm_mode_prune_invalid(struct drm_device *dev, | 228 | void drm_mode_prune_invalid(struct drm_device *dev, |
224 | struct list_head *mode_list, bool verbose); | 229 | struct list_head *mode_list, bool verbose); |
225 | void drm_mode_sort(struct list_head *mode_list); | 230 | void drm_mode_sort(struct list_head *mode_list); |
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index a185392cafeb..31c11d36fae6 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h | |||
@@ -52,7 +52,8 @@ extern int drm_crtc_init(struct drm_device *dev, | |||
52 | * @prepare_fb: prepare a framebuffer for use by the plane | 52 | * @prepare_fb: prepare a framebuffer for use by the plane |
53 | * @cleanup_fb: cleanup a framebuffer when it's no longer used by the plane | 53 | * @cleanup_fb: cleanup a framebuffer when it's no longer used by the plane |
54 | * @atomic_check: check that a given atomic state is valid and can be applied | 54 | * @atomic_check: check that a given atomic state is valid and can be applied |
55 | * @atomic_update: apply an atomic state to the plane | 55 | * @atomic_update: apply an atomic state to the plane (mandatory) |
56 | * @atomic_disable: disable the plane | ||
56 | * | 57 | * |
57 | * The helper operations are called by the mid-layer CRTC helper. | 58 | * The helper operations are called by the mid-layer CRTC helper. |
58 | */ | 59 | */ |
@@ -66,6 +67,8 @@ struct drm_plane_helper_funcs { | |||
66 | struct drm_plane_state *state); | 67 | struct drm_plane_state *state); |
67 | void (*atomic_update)(struct drm_plane *plane, | 68 | void (*atomic_update)(struct drm_plane *plane, |
68 | struct drm_plane_state *old_state); | 69 | struct drm_plane_state *old_state); |
70 | void (*atomic_disable)(struct drm_plane *plane, | ||
71 | struct drm_plane_state *old_state); | ||
69 | }; | 72 | }; |
70 | 73 | ||
71 | static inline void drm_plane_helper_add(struct drm_plane *plane, | 74 | static inline void drm_plane_helper_add(struct drm_plane *plane, |
diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h new file mode 100644 index 000000000000..3e2f22e5bf3c --- /dev/null +++ b/include/drm/i915_component.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright © 2014 Intel Corporation | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice (including the next | ||
12 | * paragraph) shall be included in all copies or substantial portions of the | ||
13 | * Software. | ||
14 | * | ||
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
21 | * IN THE SOFTWARE. | ||
22 | */ | ||
23 | |||
24 | #ifndef _I915_COMPONENT_H_ | ||
25 | #define _I915_COMPONENT_H_ | ||
26 | |||
27 | struct i915_audio_component { | ||
28 | struct device *dev; | ||
29 | |||
30 | const struct i915_audio_component_ops { | ||
31 | struct module *owner; | ||
32 | void (*get_power)(struct device *); | ||
33 | void (*put_power)(struct device *); | ||
34 | int (*get_cdclk_freq)(struct device *); | ||
35 | } *ops; | ||
36 | }; | ||
37 | |||
38 | #endif /* _I915_COMPONENT_H_ */ | ||
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h deleted file mode 100644 index baa6f11b1837..000000000000 --- a/include/drm/i915_powerwell.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /************************************************************************** | ||
2 | * | ||
3 | * Copyright 2013 Intel Inc. | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the | ||
8 | * "Software"), to deal in the Software without restriction, including | ||
9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
11 | * permit persons to whom the Software is furnished to do so, subject to | ||
12 | * the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice (including the | ||
15 | * next paragraph) shall be included in all copies or substantial portions | ||
16 | * of the Software. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
25 | * | ||
26 | * | ||
27 | **************************************************************************/ | ||
28 | |||
29 | #ifndef _I915_POWERWELL_H_ | ||
30 | #define _I915_POWERWELL_H_ | ||
31 | |||
32 | /* For use by hda_i915 driver */ | ||
33 | extern int i915_request_power_well(void); | ||
34 | extern int i915_release_power_well(void); | ||
35 | extern int i915_get_cdclk_freq(void); | ||
36 | |||
37 | #endif /* _I915_POWERWELL_H_ */ | ||
diff --git a/include/dt-bindings/clock/alphascale,asm9260.h b/include/dt-bindings/clock/alphascale,asm9260.h new file mode 100644 index 000000000000..04e8db27daf0 --- /dev/null +++ b/include/dt-bindings/clock/alphascale,asm9260.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Oleksij Rempel <linux@rempel-privat.de> | ||
3 | * | ||
4 | * This software is licensed under the terms of the GNU General Public | ||
5 | * License version 2, as published by the Free Software Foundation, and | ||
6 | * may be copied, distributed, and modified under those terms. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _DT_BINDINGS_CLK_ASM9260_H | ||
15 | #define _DT_BINDINGS_CLK_ASM9260_H | ||
16 | |||
17 | /* ahb gate */ | ||
18 | #define CLKID_AHB_ROM 0 | ||
19 | #define CLKID_AHB_RAM 1 | ||
20 | #define CLKID_AHB_GPIO 2 | ||
21 | #define CLKID_AHB_MAC 3 | ||
22 | #define CLKID_AHB_EMI 4 | ||
23 | #define CLKID_AHB_USB0 5 | ||
24 | #define CLKID_AHB_USB1 6 | ||
25 | #define CLKID_AHB_DMA0 7 | ||
26 | #define CLKID_AHB_DMA1 8 | ||
27 | #define CLKID_AHB_UART0 9 | ||
28 | #define CLKID_AHB_UART1 10 | ||
29 | #define CLKID_AHB_UART2 11 | ||
30 | #define CLKID_AHB_UART3 12 | ||
31 | #define CLKID_AHB_UART4 13 | ||
32 | #define CLKID_AHB_UART5 14 | ||
33 | #define CLKID_AHB_UART6 15 | ||
34 | #define CLKID_AHB_UART7 16 | ||
35 | #define CLKID_AHB_UART8 17 | ||
36 | #define CLKID_AHB_UART9 18 | ||
37 | #define CLKID_AHB_I2S0 19 | ||
38 | #define CLKID_AHB_I2C0 20 | ||
39 | #define CLKID_AHB_I2C1 21 | ||
40 | #define CLKID_AHB_SSP0 22 | ||
41 | #define CLKID_AHB_IOCONFIG 23 | ||
42 | #define CLKID_AHB_WDT 24 | ||
43 | #define CLKID_AHB_CAN0 25 | ||
44 | #define CLKID_AHB_CAN1 26 | ||
45 | #define CLKID_AHB_MPWM 27 | ||
46 | #define CLKID_AHB_SPI0 28 | ||
47 | #define CLKID_AHB_SPI1 29 | ||
48 | #define CLKID_AHB_QEI 30 | ||
49 | #define CLKID_AHB_QUADSPI0 31 | ||
50 | #define CLKID_AHB_CAMIF 32 | ||
51 | #define CLKID_AHB_LCDIF 33 | ||
52 | #define CLKID_AHB_TIMER0 34 | ||
53 | #define CLKID_AHB_TIMER1 35 | ||
54 | #define CLKID_AHB_TIMER2 36 | ||
55 | #define CLKID_AHB_TIMER3 37 | ||
56 | #define CLKID_AHB_IRQ 38 | ||
57 | #define CLKID_AHB_RTC 39 | ||
58 | #define CLKID_AHB_NAND 40 | ||
59 | #define CLKID_AHB_ADC0 41 | ||
60 | #define CLKID_AHB_LED 42 | ||
61 | #define CLKID_AHB_DAC0 43 | ||
62 | #define CLKID_AHB_LCD 44 | ||
63 | #define CLKID_AHB_I2S1 45 | ||
64 | #define CLKID_AHB_MAC1 46 | ||
65 | |||
66 | /* devider */ | ||
67 | #define CLKID_SYS_CPU 47 | ||
68 | #define CLKID_SYS_AHB 48 | ||
69 | #define CLKID_SYS_I2S0M 49 | ||
70 | #define CLKID_SYS_I2S0S 50 | ||
71 | #define CLKID_SYS_I2S1M 51 | ||
72 | #define CLKID_SYS_I2S1S 52 | ||
73 | #define CLKID_SYS_UART0 53 | ||
74 | #define CLKID_SYS_UART1 54 | ||
75 | #define CLKID_SYS_UART2 55 | ||
76 | #define CLKID_SYS_UART3 56 | ||
77 | #define CLKID_SYS_UART4 56 | ||
78 | #define CLKID_SYS_UART5 57 | ||
79 | #define CLKID_SYS_UART6 58 | ||
80 | #define CLKID_SYS_UART7 59 | ||
81 | #define CLKID_SYS_UART8 60 | ||
82 | #define CLKID_SYS_UART9 61 | ||
83 | #define CLKID_SYS_SPI0 62 | ||
84 | #define CLKID_SYS_SPI1 63 | ||
85 | #define CLKID_SYS_QUADSPI 64 | ||
86 | #define CLKID_SYS_SSP0 65 | ||
87 | #define CLKID_SYS_NAND 66 | ||
88 | #define CLKID_SYS_TRACE 67 | ||
89 | #define CLKID_SYS_CAMM 68 | ||
90 | #define CLKID_SYS_WDT 69 | ||
91 | #define CLKID_SYS_CLKOUT 70 | ||
92 | #define CLKID_SYS_MAC 71 | ||
93 | #define CLKID_SYS_LCD 72 | ||
94 | #define CLKID_SYS_ADCANA 73 | ||
95 | |||
96 | #define MAX_CLKS 74 | ||
97 | #endif | ||
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h index 34fe28c622d0..c4b1676ea674 100644 --- a/include/dt-bindings/clock/exynos4.h +++ b/include/dt-bindings/clock/exynos4.h | |||
@@ -262,8 +262,13 @@ | |||
262 | #define CLK_DIV_MCUISP1 453 /* Exynos4x12 only */ | 262 | #define CLK_DIV_MCUISP1 453 /* Exynos4x12 only */ |
263 | #define CLK_DIV_ACLK200 454 /* Exynos4x12 only */ | 263 | #define CLK_DIV_ACLK200 454 /* Exynos4x12 only */ |
264 | #define CLK_DIV_ACLK400_MCUISP 455 /* Exynos4x12 only */ | 264 | #define CLK_DIV_ACLK400_MCUISP 455 /* Exynos4x12 only */ |
265 | #define CLK_DIV_ACP 456 | ||
266 | #define CLK_DIV_DMC 457 | ||
267 | #define CLK_DIV_C2C 458 /* Exynos4x12 only */ | ||
268 | #define CLK_DIV_GDL 459 | ||
269 | #define CLK_DIV_GDR 460 | ||
265 | 270 | ||
266 | /* must be greater than maximal clock id */ | 271 | /* must be greater than maximal clock id */ |
267 | #define CLK_NR_CLKS 456 | 272 | #define CLK_NR_CLKS 461 |
268 | 273 | ||
269 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */ | 274 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */ |
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h index 8dc0913f1775..99da0d117a7d 100644 --- a/include/dt-bindings/clock/exynos5420.h +++ b/include/dt-bindings/clock/exynos5420.h | |||
@@ -204,6 +204,12 @@ | |||
204 | #define CLK_MOUT_MAUDIO0 643 | 204 | #define CLK_MOUT_MAUDIO0 643 |
205 | #define CLK_MOUT_USER_ACLK333 644 | 205 | #define CLK_MOUT_USER_ACLK333 644 |
206 | #define CLK_MOUT_SW_ACLK333 645 | 206 | #define CLK_MOUT_SW_ACLK333 645 |
207 | #define CLK_MOUT_USER_ACLK200_DISP1 646 | ||
208 | #define CLK_MOUT_SW_ACLK200 647 | ||
209 | #define CLK_MOUT_USER_ACLK300_DISP1 648 | ||
210 | #define CLK_MOUT_SW_ACLK300 649 | ||
211 | #define CLK_MOUT_USER_ACLK400_DISP1 650 | ||
212 | #define CLK_MOUT_SW_ACLK400 651 | ||
207 | 213 | ||
208 | /* divider clocks */ | 214 | /* divider clocks */ |
209 | #define CLK_DOUT_PIXEL 768 | 215 | #define CLK_DOUT_PIXEL 768 |
diff --git a/include/dt-bindings/clock/exynos7-clk.h b/include/dt-bindings/clock/exynos7-clk.h index 8e4681b07ae7..e33c75a3c09d 100644 --- a/include/dt-bindings/clock/exynos7-clk.h +++ b/include/dt-bindings/clock/exynos7-clk.h | |||
@@ -17,7 +17,11 @@ | |||
17 | #define DOUT_SCLK_CC_PLL 4 | 17 | #define DOUT_SCLK_CC_PLL 4 |
18 | #define DOUT_SCLK_MFC_PLL 5 | 18 | #define DOUT_SCLK_MFC_PLL 5 |
19 | #define DOUT_ACLK_CCORE_133 6 | 19 | #define DOUT_ACLK_CCORE_133 6 |
20 | #define TOPC_NR_CLK 7 | 20 | #define DOUT_ACLK_MSCL_532 7 |
21 | #define ACLK_MSCL_532 8 | ||
22 | #define DOUT_SCLK_AUD_PLL 9 | ||
23 | #define FOUT_AUD_PLL 10 | ||
24 | #define TOPC_NR_CLK 11 | ||
21 | 25 | ||
22 | /* TOP0 */ | 26 | /* TOP0 */ |
23 | #define DOUT_ACLK_PERIC1 1 | 27 | #define DOUT_ACLK_PERIC1 1 |
@@ -26,7 +30,15 @@ | |||
26 | #define CLK_SCLK_UART1 4 | 30 | #define CLK_SCLK_UART1 4 |
27 | #define CLK_SCLK_UART2 5 | 31 | #define CLK_SCLK_UART2 5 |
28 | #define CLK_SCLK_UART3 6 | 32 | #define CLK_SCLK_UART3 6 |
29 | #define TOP0_NR_CLK 7 | 33 | #define CLK_SCLK_SPI0 7 |
34 | #define CLK_SCLK_SPI1 8 | ||
35 | #define CLK_SCLK_SPI2 9 | ||
36 | #define CLK_SCLK_SPI3 10 | ||
37 | #define CLK_SCLK_SPI4 11 | ||
38 | #define CLK_SCLK_SPDIF 12 | ||
39 | #define CLK_SCLK_PCM1 13 | ||
40 | #define CLK_SCLK_I2S1 14 | ||
41 | #define TOP0_NR_CLK 15 | ||
30 | 42 | ||
31 | /* TOP1 */ | 43 | /* TOP1 */ |
32 | #define DOUT_ACLK_FSYS1_200 1 | 44 | #define DOUT_ACLK_FSYS1_200 1 |
@@ -70,7 +82,23 @@ | |||
70 | #define PCLK_HSI2C6 9 | 82 | #define PCLK_HSI2C6 9 |
71 | #define PCLK_HSI2C7 10 | 83 | #define PCLK_HSI2C7 10 |
72 | #define PCLK_HSI2C8 11 | 84 | #define PCLK_HSI2C8 11 |
73 | #define PERIC1_NR_CLK 12 | 85 | #define PCLK_SPI0 12 |
86 | #define PCLK_SPI1 13 | ||
87 | #define PCLK_SPI2 14 | ||
88 | #define PCLK_SPI3 15 | ||
89 | #define PCLK_SPI4 16 | ||
90 | #define SCLK_SPI0 17 | ||
91 | #define SCLK_SPI1 18 | ||
92 | #define SCLK_SPI2 19 | ||
93 | #define SCLK_SPI3 20 | ||
94 | #define SCLK_SPI4 21 | ||
95 | #define PCLK_I2S1 22 | ||
96 | #define PCLK_PCM1 23 | ||
97 | #define PCLK_SPDIF 24 | ||
98 | #define SCLK_I2S1 25 | ||
99 | #define SCLK_PCM1 26 | ||
100 | #define SCLK_SPDIF 27 | ||
101 | #define PERIC1_NR_CLK 28 | ||
74 | 102 | ||
75 | /* PERIS */ | 103 | /* PERIS */ |
76 | #define PCLK_CHIPID 1 | 104 | #define PCLK_CHIPID 1 |
@@ -82,11 +110,63 @@ | |||
82 | 110 | ||
83 | /* FSYS0 */ | 111 | /* FSYS0 */ |
84 | #define ACLK_MMC2 1 | 112 | #define ACLK_MMC2 1 |
85 | #define FSYS0_NR_CLK 2 | 113 | #define ACLK_AXIUS_USBDRD30X_FSYS0X 2 |
114 | #define ACLK_USBDRD300 3 | ||
115 | #define SCLK_USBDRD300_SUSPENDCLK 4 | ||
116 | #define SCLK_USBDRD300_REFCLK 5 | ||
117 | #define PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER 6 | ||
118 | #define PHYCLK_USBDRD300_UDRD30_PHYCLK_USER 7 | ||
119 | #define OSCCLK_PHY_CLKOUT_USB30_PHY 8 | ||
120 | #define ACLK_PDMA0 9 | ||
121 | #define ACLK_PDMA1 10 | ||
122 | #define FSYS0_NR_CLK 11 | ||
86 | 123 | ||
87 | /* FSYS1 */ | 124 | /* FSYS1 */ |
88 | #define ACLK_MMC1 1 | 125 | #define ACLK_MMC1 1 |
89 | #define ACLK_MMC0 2 | 126 | #define ACLK_MMC0 2 |
90 | #define FSYS1_NR_CLK 3 | 127 | #define FSYS1_NR_CLK 3 |
91 | 128 | ||
129 | /* MSCL */ | ||
130 | #define USERMUX_ACLK_MSCL_532 1 | ||
131 | #define DOUT_PCLK_MSCL 2 | ||
132 | #define ACLK_MSCL_0 3 | ||
133 | #define ACLK_MSCL_1 4 | ||
134 | #define ACLK_JPEG 5 | ||
135 | #define ACLK_G2D 6 | ||
136 | #define ACLK_LH_ASYNC_SI_MSCL_0 7 | ||
137 | #define ACLK_LH_ASYNC_SI_MSCL_1 8 | ||
138 | #define ACLK_AXI2ACEL_BRIDGE 9 | ||
139 | #define ACLK_XIU_MSCLX_0 10 | ||
140 | #define ACLK_XIU_MSCLX_1 11 | ||
141 | #define ACLK_QE_MSCL_0 12 | ||
142 | #define ACLK_QE_MSCL_1 13 | ||
143 | #define ACLK_QE_JPEG 14 | ||
144 | #define ACLK_QE_G2D 15 | ||
145 | #define ACLK_PPMU_MSCL_0 16 | ||
146 | #define ACLK_PPMU_MSCL_1 17 | ||
147 | #define ACLK_MSCLNP_133 18 | ||
148 | #define ACLK_AHB2APB_MSCL0P 19 | ||
149 | #define ACLK_AHB2APB_MSCL1P 20 | ||
150 | |||
151 | #define PCLK_MSCL_0 21 | ||
152 | #define PCLK_MSCL_1 22 | ||
153 | #define PCLK_JPEG 23 | ||
154 | #define PCLK_G2D 24 | ||
155 | #define PCLK_QE_MSCL_0 25 | ||
156 | #define PCLK_QE_MSCL_1 26 | ||
157 | #define PCLK_QE_JPEG 27 | ||
158 | #define PCLK_QE_G2D 28 | ||
159 | #define PCLK_PPMU_MSCL_0 29 | ||
160 | #define PCLK_PPMU_MSCL_1 30 | ||
161 | #define PCLK_AXI2ACEL_BRIDGE 31 | ||
162 | #define PCLK_PMU_MSCL 32 | ||
163 | #define MSCL_NR_CLK 33 | ||
164 | |||
165 | /* AUD */ | ||
166 | #define SCLK_I2S 1 | ||
167 | #define SCLK_PCM 2 | ||
168 | #define PCLK_I2S 3 | ||
169 | #define PCLK_PCM 4 | ||
170 | #define ACLK_ADMA 5 | ||
171 | #define AUD_NR_CLK 6 | ||
92 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS7_H */ | 172 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS7_H */ |
diff --git a/include/dt-bindings/clock/qcom,gcc-ipq806x.h b/include/dt-bindings/clock/qcom,gcc-ipq806x.h index b857cadb0bd4..04fb29ae30e6 100644 --- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h +++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h | |||
@@ -238,7 +238,6 @@ | |||
238 | #define PLL0_VOTE 221 | 238 | #define PLL0_VOTE 221 |
239 | #define PLL3 222 | 239 | #define PLL3 222 |
240 | #define PLL3_VOTE 223 | 240 | #define PLL3_VOTE 223 |
241 | #define PLL4 224 | ||
242 | #define PLL4_VOTE 225 | 241 | #define PLL4_VOTE 225 |
243 | #define PLL8 226 | 242 | #define PLL8 226 |
244 | #define PLL8_VOTE 227 | 243 | #define PLL8_VOTE 227 |
diff --git a/include/dt-bindings/clock/qcom,lcc-ipq806x.h b/include/dt-bindings/clock/qcom,lcc-ipq806x.h new file mode 100644 index 000000000000..4e944b85c56d --- /dev/null +++ b/include/dt-bindings/clock/qcom,lcc-ipq806x.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
3 | * | ||
4 | * This software is licensed under the terms of the GNU General Public | ||
5 | * License version 2, as published by the Free Software Foundation, and | ||
6 | * may be copied, distributed, and modified under those terms. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _DT_BINDINGS_CLK_LCC_IPQ806X_H | ||
15 | #define _DT_BINDINGS_CLK_LCC_IPQ806X_H | ||
16 | |||
17 | #define PLL4 0 | ||
18 | #define MI2S_OSR_SRC 1 | ||
19 | #define MI2S_OSR_CLK 2 | ||
20 | #define MI2S_DIV_CLK 3 | ||
21 | #define MI2S_BIT_DIV_CLK 4 | ||
22 | #define MI2S_BIT_CLK 5 | ||
23 | #define PCM_SRC 6 | ||
24 | #define PCM_CLK_OUT 7 | ||
25 | #define PCM_CLK 8 | ||
26 | #define SPDIF_SRC 9 | ||
27 | #define SPDIF_CLK 10 | ||
28 | #define AHBIX_CLK 11 | ||
29 | |||
30 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,lcc-msm8960.h b/include/dt-bindings/clock/qcom,lcc-msm8960.h new file mode 100644 index 000000000000..4fb2aa64d9fe --- /dev/null +++ b/include/dt-bindings/clock/qcom,lcc-msm8960.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
3 | * | ||
4 | * This software is licensed under the terms of the GNU General Public | ||
5 | * License version 2, as published by the Free Software Foundation, and | ||
6 | * may be copied, distributed, and modified under those terms. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _DT_BINDINGS_CLK_LCC_MSM8960_H | ||
15 | #define _DT_BINDINGS_CLK_LCC_MSM8960_H | ||
16 | |||
17 | #define PLL4 0 | ||
18 | #define MI2S_OSR_SRC 1 | ||
19 | #define MI2S_OSR_CLK 2 | ||
20 | #define MI2S_DIV_CLK 3 | ||
21 | #define MI2S_BIT_DIV_CLK 4 | ||
22 | #define MI2S_BIT_CLK 5 | ||
23 | #define PCM_SRC 6 | ||
24 | #define PCM_CLK_OUT 7 | ||
25 | #define PCM_CLK 8 | ||
26 | #define SLIMBUS_SRC 9 | ||
27 | #define AUDIO_SLIMBUS_CLK 10 | ||
28 | #define SPS_SLIMBUS_CLK 11 | ||
29 | #define CODEC_I2S_MIC_OSR_SRC 12 | ||
30 | #define CODEC_I2S_MIC_OSR_CLK 13 | ||
31 | #define CODEC_I2S_MIC_DIV_CLK 14 | ||
32 | #define CODEC_I2S_MIC_BIT_DIV_CLK 15 | ||
33 | #define CODEC_I2S_MIC_BIT_CLK 16 | ||
34 | #define SPARE_I2S_MIC_OSR_SRC 17 | ||
35 | #define SPARE_I2S_MIC_OSR_CLK 18 | ||
36 | #define SPARE_I2S_MIC_DIV_CLK 19 | ||
37 | #define SPARE_I2S_MIC_BIT_DIV_CLK 20 | ||
38 | #define SPARE_I2S_MIC_BIT_CLK 21 | ||
39 | #define CODEC_I2S_SPKR_OSR_SRC 22 | ||
40 | #define CODEC_I2S_SPKR_OSR_CLK 23 | ||
41 | #define CODEC_I2S_SPKR_DIV_CLK 24 | ||
42 | #define CODEC_I2S_SPKR_BIT_DIV_CLK 25 | ||
43 | #define CODEC_I2S_SPKR_BIT_CLK 26 | ||
44 | #define SPARE_I2S_SPKR_OSR_SRC 27 | ||
45 | #define SPARE_I2S_SPKR_OSR_CLK 28 | ||
46 | #define SPARE_I2S_SPKR_DIV_CLK 29 | ||
47 | #define SPARE_I2S_SPKR_BIT_DIV_CLK 30 | ||
48 | #define SPARE_I2S_SPKR_BIT_CLK 31 | ||
49 | |||
50 | #endif | ||
diff --git a/include/dt-bindings/clock/r8a7790-clock.h b/include/dt-bindings/clock/r8a7790-clock.h index c27b3b5133b9..91940271cf83 100644 --- a/include/dt-bindings/clock/r8a7790-clock.h +++ b/include/dt-bindings/clock/r8a7790-clock.h | |||
@@ -97,6 +97,7 @@ | |||
97 | #define R8A7790_CLK_LVDS0 26 | 97 | #define R8A7790_CLK_LVDS0 26 |
98 | 98 | ||
99 | /* MSTP8 */ | 99 | /* MSTP8 */ |
100 | #define R8A7790_CLK_MLB 2 | ||
100 | #define R8A7790_CLK_VIN3 8 | 101 | #define R8A7790_CLK_VIN3 8 |
101 | #define R8A7790_CLK_VIN2 9 | 102 | #define R8A7790_CLK_VIN2 9 |
102 | #define R8A7790_CLK_VIN1 10 | 103 | #define R8A7790_CLK_VIN1 10 |
diff --git a/include/dt-bindings/clock/r8a7791-clock.h b/include/dt-bindings/clock/r8a7791-clock.h index 3ea2bbc0da3f..f096f3f6c16a 100644 --- a/include/dt-bindings/clock/r8a7791-clock.h +++ b/include/dt-bindings/clock/r8a7791-clock.h | |||
@@ -91,6 +91,8 @@ | |||
91 | #define R8A7791_CLK_LVDS0 26 | 91 | #define R8A7791_CLK_LVDS0 26 |
92 | 92 | ||
93 | /* MSTP8 */ | 93 | /* MSTP8 */ |
94 | #define R8A7791_CLK_IPMMU_SGX 0 | ||
95 | #define R8A7791_CLK_MLB 2 | ||
94 | #define R8A7791_CLK_VIN2 9 | 96 | #define R8A7791_CLK_VIN2 9 |
95 | #define R8A7791_CLK_VIN1 10 | 97 | #define R8A7791_CLK_VIN1 10 |
96 | #define R8A7791_CLK_VIN0 11 | 98 | #define R8A7791_CLK_VIN0 11 |
diff --git a/include/dt-bindings/clock/r8a7794-clock.h b/include/dt-bindings/clock/r8a7794-clock.h index aa9c286e60c0..d63323032d6e 100644 --- a/include/dt-bindings/clock/r8a7794-clock.h +++ b/include/dt-bindings/clock/r8a7794-clock.h | |||
@@ -48,15 +48,25 @@ | |||
48 | #define R8A7794_CLK_SCIFB1 7 | 48 | #define R8A7794_CLK_SCIFB1 7 |
49 | #define R8A7794_CLK_MSIOF1 8 | 49 | #define R8A7794_CLK_MSIOF1 8 |
50 | #define R8A7794_CLK_SCIFB2 16 | 50 | #define R8A7794_CLK_SCIFB2 16 |
51 | #define R8A7794_CLK_SYS_DMAC1 18 | ||
52 | #define R8A7794_CLK_SYS_DMAC0 19 | ||
51 | 53 | ||
52 | /* MSTP3 */ | 54 | /* MSTP3 */ |
55 | #define R8A7794_CLK_SDHI2 11 | ||
56 | #define R8A7794_CLK_SDHI1 12 | ||
57 | #define R8A7794_CLK_SDHI0 14 | ||
58 | #define R8A7794_CLK_MMCIF0 15 | ||
53 | #define R8A7794_CLK_CMT1 29 | 59 | #define R8A7794_CLK_CMT1 29 |
60 | #define R8A7794_CLK_USBDMAC0 30 | ||
61 | #define R8A7794_CLK_USBDMAC1 31 | ||
54 | 62 | ||
55 | /* MSTP5 */ | 63 | /* MSTP5 */ |
56 | #define R8A7794_CLK_THERMAL 22 | 64 | #define R8A7794_CLK_THERMAL 22 |
57 | #define R8A7794_CLK_PWM 23 | 65 | #define R8A7794_CLK_PWM 23 |
58 | 66 | ||
59 | /* MSTP7 */ | 67 | /* MSTP7 */ |
68 | #define R8A7794_CLK_EHCI 3 | ||
69 | #define R8A7794_CLK_HSUSB 4 | ||
60 | #define R8A7794_CLK_HSCIF2 13 | 70 | #define R8A7794_CLK_HSCIF2 13 |
61 | #define R8A7794_CLK_SCIF5 14 | 71 | #define R8A7794_CLK_SCIF5 14 |
62 | #define R8A7794_CLK_SCIF4 15 | 72 | #define R8A7794_CLK_SCIF4 15 |
@@ -80,6 +90,13 @@ | |||
80 | #define R8A7794_CLK_GPIO2 10 | 90 | #define R8A7794_CLK_GPIO2 10 |
81 | #define R8A7794_CLK_GPIO1 11 | 91 | #define R8A7794_CLK_GPIO1 11 |
82 | #define R8A7794_CLK_GPIO0 12 | 92 | #define R8A7794_CLK_GPIO0 12 |
93 | #define R8A7794_CLK_QSPI_MOD 17 | ||
94 | #define R8A7794_CLK_I2C5 25 | ||
95 | #define R8A7794_CLK_I2C4 27 | ||
96 | #define R8A7794_CLK_I2C3 28 | ||
97 | #define R8A7794_CLK_I2C2 29 | ||
98 | #define R8A7794_CLK_I2C1 30 | ||
99 | #define R8A7794_CLK_I2C0 31 | ||
83 | 100 | ||
84 | /* MSTP11 */ | 101 | /* MSTP11 */ |
85 | #define R8A7794_CLK_SCIFA3 6 | 102 | #define R8A7794_CLK_SCIFA3 6 |
diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h index f60ce72a2b2c..dea419708d73 100644 --- a/include/dt-bindings/clock/rk3288-cru.h +++ b/include/dt-bindings/clock/rk3288-cru.h | |||
@@ -80,6 +80,12 @@ | |||
80 | #define SCLK_SDIO0_SAMPLE 119 | 80 | #define SCLK_SDIO0_SAMPLE 119 |
81 | #define SCLK_SDIO1_SAMPLE 120 | 81 | #define SCLK_SDIO1_SAMPLE 120 |
82 | #define SCLK_EMMC_SAMPLE 121 | 82 | #define SCLK_EMMC_SAMPLE 121 |
83 | #define SCLK_USBPHY480M_SRC 122 | ||
84 | #define SCLK_PVTM_CORE 123 | ||
85 | #define SCLK_PVTM_GPU 124 | ||
86 | |||
87 | #define SCLK_MAC 151 | ||
88 | #define SCLK_MACREF_OUT 152 | ||
83 | 89 | ||
84 | #define DCLK_VOP0 190 | 90 | #define DCLK_VOP0 190 |
85 | #define DCLK_VOP1 191 | 91 | #define DCLK_VOP1 191 |
@@ -154,6 +160,7 @@ | |||
154 | #define PCLK_PUBL0 365 | 160 | #define PCLK_PUBL0 365 |
155 | #define PCLK_DDRUPCTL1 366 | 161 | #define PCLK_DDRUPCTL1 366 |
156 | #define PCLK_PUBL1 367 | 162 | #define PCLK_PUBL1 367 |
163 | #define PCLK_WDT 368 | ||
157 | 164 | ||
158 | /* hclk gates */ | 165 | /* hclk gates */ |
159 | #define HCLK_GPS 448 | 166 | #define HCLK_GPS 448 |
diff --git a/include/dt-bindings/clock/sh73a0-clock.h b/include/dt-bindings/clock/sh73a0-clock.h new file mode 100644 index 000000000000..1dd3eb2b7d90 --- /dev/null +++ b/include/dt-bindings/clock/sh73a0-clock.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Ulrich Hecht | ||
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 | |||
10 | #ifndef __DT_BINDINGS_CLOCK_SH73A0_H__ | ||
11 | #define __DT_BINDINGS_CLOCK_SH73A0_H__ | ||
12 | |||
13 | /* CPG */ | ||
14 | #define SH73A0_CLK_MAIN 0 | ||
15 | #define SH73A0_CLK_PLL0 1 | ||
16 | #define SH73A0_CLK_PLL1 2 | ||
17 | #define SH73A0_CLK_PLL2 3 | ||
18 | #define SH73A0_CLK_PLL3 4 | ||
19 | #define SH73A0_CLK_DSI0PHY 5 | ||
20 | #define SH73A0_CLK_DSI1PHY 6 | ||
21 | #define SH73A0_CLK_ZG 7 | ||
22 | #define SH73A0_CLK_M3 8 | ||
23 | #define SH73A0_CLK_B 9 | ||
24 | #define SH73A0_CLK_M1 10 | ||
25 | #define SH73A0_CLK_M2 11 | ||
26 | #define SH73A0_CLK_Z 12 | ||
27 | #define SH73A0_CLK_ZX 13 | ||
28 | #define SH73A0_CLK_HP 14 | ||
29 | |||
30 | /* MSTP0 */ | ||
31 | #define SH73A0_CLK_IIC2 1 | ||
32 | |||
33 | /* MSTP1 */ | ||
34 | #define SH73A0_CLK_CEU1 29 | ||
35 | #define SH73A0_CLK_CSI2_RX1 28 | ||
36 | #define SH73A0_CLK_CEU0 27 | ||
37 | #define SH73A0_CLK_CSI2_RX0 26 | ||
38 | #define SH73A0_CLK_TMU0 25 | ||
39 | #define SH73A0_CLK_DSITX0 18 | ||
40 | #define SH73A0_CLK_IIC0 16 | ||
41 | #define SH73A0_CLK_SGX 12 | ||
42 | #define SH73A0_CLK_LCDC0 0 | ||
43 | |||
44 | /* MSTP2 */ | ||
45 | #define SH73A0_CLK_SCIFA7 19 | ||
46 | #define SH73A0_CLK_SY_DMAC 18 | ||
47 | #define SH73A0_CLK_MP_DMAC 17 | ||
48 | #define SH73A0_CLK_SCIFA5 7 | ||
49 | #define SH73A0_CLK_SCIFB 6 | ||
50 | #define SH73A0_CLK_SCIFA0 4 | ||
51 | #define SH73A0_CLK_SCIFA1 3 | ||
52 | #define SH73A0_CLK_SCIFA2 2 | ||
53 | #define SH73A0_CLK_SCIFA3 1 | ||
54 | #define SH73A0_CLK_SCIFA4 0 | ||
55 | |||
56 | /* MSTP3 */ | ||
57 | #define SH73A0_CLK_SCIFA6 31 | ||
58 | #define SH73A0_CLK_CMT1 29 | ||
59 | #define SH73A0_CLK_FSI 28 | ||
60 | #define SH73A0_CLK_IRDA 25 | ||
61 | #define SH73A0_CLK_IIC1 23 | ||
62 | #define SH73A0_CLK_USB 22 | ||
63 | #define SH73A0_CLK_FLCTL 15 | ||
64 | #define SH73A0_CLK_SDHI0 14 | ||
65 | #define SH73A0_CLK_SDHI1 13 | ||
66 | #define SH73A0_CLK_MMCIF0 12 | ||
67 | #define SH73A0_CLK_SDHI2 11 | ||
68 | #define SH73A0_CLK_TPU0 4 | ||
69 | #define SH73A0_CLK_TPU1 3 | ||
70 | #define SH73A0_CLK_TPU2 2 | ||
71 | #define SH73A0_CLK_TPU3 1 | ||
72 | #define SH73A0_CLK_TPU4 0 | ||
73 | |||
74 | /* MSTP4 */ | ||
75 | #define SH73A0_CLK_IIC3 11 | ||
76 | #define SH73A0_CLK_IIC4 10 | ||
77 | #define SH73A0_CLK_KEYSC 3 | ||
78 | |||
79 | #endif | ||
diff --git a/include/dt-bindings/clock/stih418-clks.h b/include/dt-bindings/clock/stih418-clks.h new file mode 100644 index 000000000000..b62aa0b20217 --- /dev/null +++ b/include/dt-bindings/clock/stih418-clks.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * This header provides constants clk index STMicroelectronics | ||
3 | * STiH418 SoC. | ||
4 | */ | ||
5 | #ifndef _DT_BINDINGS_CLK_STIH418 | ||
6 | #define _DT_BINDINGS_CLK_STIH418 | ||
7 | |||
8 | #include "stih410-clks.h" | ||
9 | |||
10 | /* STiH418 introduces new clock outputs compared to STiH410 */ | ||
11 | |||
12 | /* CLOCKGEN C0 */ | ||
13 | #define CLK_PROC_BDISP_0 14 | ||
14 | #define CLK_PROC_BDISP_1 15 | ||
15 | #define CLK_TX_ICN_1 23 | ||
16 | #define CLK_ETH_PHYREF 27 | ||
17 | #define CLK_PP_HEVC 35 | ||
18 | #define CLK_CLUST_HEVC 36 | ||
19 | #define CLK_HWPE_HEVC 37 | ||
20 | #define CLK_FC_HEVC 38 | ||
21 | #define CLK_PROC_MIXER 39 | ||
22 | #define CLK_PROC_SC 40 | ||
23 | #define CLK_AVSP_HEVC 41 | ||
24 | |||
25 | /* CLOCKGEN D2 */ | ||
26 | #undef CLK_PIX_PIP | ||
27 | #undef CLK_PIX_GDP1 | ||
28 | #undef CLK_PIX_GDP2 | ||
29 | #undef CLK_PIX_GDP3 | ||
30 | #undef CLK_PIX_GDP4 | ||
31 | |||
32 | #define CLK_TMDS_HDMI_DIV2 5 | ||
33 | #define CLK_VP9 47 | ||
34 | #endif | ||
diff --git a/include/dt-bindings/clock/tegra124-car-common.h b/include/dt-bindings/clock/tegra124-car-common.h new file mode 100644 index 000000000000..ae2eb17a1658 --- /dev/null +++ b/include/dt-bindings/clock/tegra124-car-common.h | |||
@@ -0,0 +1,345 @@ | |||
1 | /* | ||
2 | * This header provides constants for binding nvidia,tegra124-car or | ||
3 | * nvidia,tegra132-car. | ||
4 | * | ||
5 | * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
6 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
7 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
8 | * this case, those clocks are assigned IDs above 185 in order to highlight | ||
9 | * this issue. Implementations that interpret these clock IDs as bit values | ||
10 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
11 | * explicitly handle these special cases. | ||
12 | * | ||
13 | * The balance of the clocks controlled by the CAR are assigned IDs of 185 and | ||
14 | * above. | ||
15 | */ | ||
16 | |||
17 | #ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_COMMON_H | ||
18 | #define _DT_BINDINGS_CLOCK_TEGRA124_CAR_COMMON_H | ||
19 | |||
20 | /* 0 */ | ||
21 | /* 1 */ | ||
22 | /* 2 */ | ||
23 | #define TEGRA124_CLK_ISPB 3 | ||
24 | #define TEGRA124_CLK_RTC 4 | ||
25 | #define TEGRA124_CLK_TIMER 5 | ||
26 | #define TEGRA124_CLK_UARTA 6 | ||
27 | /* 7 (register bit affects uartb and vfir) */ | ||
28 | /* 8 */ | ||
29 | #define TEGRA124_CLK_SDMMC2 9 | ||
30 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
31 | #define TEGRA124_CLK_I2S1 11 | ||
32 | #define TEGRA124_CLK_I2C1 12 | ||
33 | /* 13 */ | ||
34 | #define TEGRA124_CLK_SDMMC1 14 | ||
35 | #define TEGRA124_CLK_SDMMC4 15 | ||
36 | /* 16 */ | ||
37 | #define TEGRA124_CLK_PWM 17 | ||
38 | #define TEGRA124_CLK_I2S2 18 | ||
39 | /* 20 (register bit affects vi and vi_sensor) */ | ||
40 | /* 21 */ | ||
41 | #define TEGRA124_CLK_USBD 22 | ||
42 | #define TEGRA124_CLK_ISP 23 | ||
43 | /* 26 */ | ||
44 | /* 25 */ | ||
45 | #define TEGRA124_CLK_DISP2 26 | ||
46 | #define TEGRA124_CLK_DISP1 27 | ||
47 | #define TEGRA124_CLK_HOST1X 28 | ||
48 | #define TEGRA124_CLK_VCP 29 | ||
49 | #define TEGRA124_CLK_I2S0 30 | ||
50 | /* 31 */ | ||
51 | |||
52 | #define TEGRA124_CLK_MC 32 | ||
53 | /* 33 */ | ||
54 | #define TEGRA124_CLK_APBDMA 34 | ||
55 | /* 35 */ | ||
56 | #define TEGRA124_CLK_KBC 36 | ||
57 | /* 37 */ | ||
58 | /* 38 */ | ||
59 | /* 39 (register bit affects fuse and fuse_burn) */ | ||
60 | #define TEGRA124_CLK_KFUSE 40 | ||
61 | #define TEGRA124_CLK_SBC1 41 | ||
62 | #define TEGRA124_CLK_NOR 42 | ||
63 | /* 43 */ | ||
64 | #define TEGRA124_CLK_SBC2 44 | ||
65 | /* 45 */ | ||
66 | #define TEGRA124_CLK_SBC3 46 | ||
67 | #define TEGRA124_CLK_I2C5 47 | ||
68 | #define TEGRA124_CLK_DSIA 48 | ||
69 | /* 49 */ | ||
70 | #define TEGRA124_CLK_MIPI 50 | ||
71 | #define TEGRA124_CLK_HDMI 51 | ||
72 | #define TEGRA124_CLK_CSI 52 | ||
73 | /* 53 */ | ||
74 | #define TEGRA124_CLK_I2C2 54 | ||
75 | #define TEGRA124_CLK_UARTC 55 | ||
76 | #define TEGRA124_CLK_MIPI_CAL 56 | ||
77 | #define TEGRA124_CLK_EMC 57 | ||
78 | #define TEGRA124_CLK_USB2 58 | ||
79 | #define TEGRA124_CLK_USB3 59 | ||
80 | /* 60 */ | ||
81 | #define TEGRA124_CLK_VDE 61 | ||
82 | #define TEGRA124_CLK_BSEA 62 | ||
83 | #define TEGRA124_CLK_BSEV 63 | ||
84 | |||
85 | /* 64 */ | ||
86 | #define TEGRA124_CLK_UARTD 65 | ||
87 | /* 66 */ | ||
88 | #define TEGRA124_CLK_I2C3 67 | ||
89 | #define TEGRA124_CLK_SBC4 68 | ||
90 | #define TEGRA124_CLK_SDMMC3 69 | ||
91 | #define TEGRA124_CLK_PCIE 70 | ||
92 | #define TEGRA124_CLK_OWR 71 | ||
93 | #define TEGRA124_CLK_AFI 72 | ||
94 | #define TEGRA124_CLK_CSITE 73 | ||
95 | /* 74 */ | ||
96 | /* 75 */ | ||
97 | #define TEGRA124_CLK_LA 76 | ||
98 | #define TEGRA124_CLK_TRACE 77 | ||
99 | #define TEGRA124_CLK_SOC_THERM 78 | ||
100 | #define TEGRA124_CLK_DTV 79 | ||
101 | /* 80 */ | ||
102 | #define TEGRA124_CLK_I2CSLOW 81 | ||
103 | #define TEGRA124_CLK_DSIB 82 | ||
104 | #define TEGRA124_CLK_TSEC 83 | ||
105 | /* 84 */ | ||
106 | /* 85 */ | ||
107 | /* 86 */ | ||
108 | /* 87 */ | ||
109 | /* 88 */ | ||
110 | #define TEGRA124_CLK_XUSB_HOST 89 | ||
111 | /* 90 */ | ||
112 | #define TEGRA124_CLK_MSENC 91 | ||
113 | #define TEGRA124_CLK_CSUS 92 | ||
114 | /* 93 */ | ||
115 | /* 94 */ | ||
116 | /* 95 (bit affects xusb_dev and xusb_dev_src) */ | ||
117 | |||
118 | /* 96 */ | ||
119 | /* 97 */ | ||
120 | /* 98 */ | ||
121 | #define TEGRA124_CLK_MSELECT 99 | ||
122 | #define TEGRA124_CLK_TSENSOR 100 | ||
123 | #define TEGRA124_CLK_I2S3 101 | ||
124 | #define TEGRA124_CLK_I2S4 102 | ||
125 | #define TEGRA124_CLK_I2C4 103 | ||
126 | #define TEGRA124_CLK_SBC5 104 | ||
127 | #define TEGRA124_CLK_SBC6 105 | ||
128 | #define TEGRA124_CLK_D_AUDIO 106 | ||
129 | #define TEGRA124_CLK_APBIF 107 | ||
130 | #define TEGRA124_CLK_DAM0 108 | ||
131 | #define TEGRA124_CLK_DAM1 109 | ||
132 | #define TEGRA124_CLK_DAM2 110 | ||
133 | #define TEGRA124_CLK_HDA2CODEC_2X 111 | ||
134 | /* 112 */ | ||
135 | #define TEGRA124_CLK_AUDIO0_2X 113 | ||
136 | #define TEGRA124_CLK_AUDIO1_2X 114 | ||
137 | #define TEGRA124_CLK_AUDIO2_2X 115 | ||
138 | #define TEGRA124_CLK_AUDIO3_2X 116 | ||
139 | #define TEGRA124_CLK_AUDIO4_2X 117 | ||
140 | #define TEGRA124_CLK_SPDIF_2X 118 | ||
141 | #define TEGRA124_CLK_ACTMON 119 | ||
142 | #define TEGRA124_CLK_EXTERN1 120 | ||
143 | #define TEGRA124_CLK_EXTERN2 121 | ||
144 | #define TEGRA124_CLK_EXTERN3 122 | ||
145 | #define TEGRA124_CLK_SATA_OOB 123 | ||
146 | #define TEGRA124_CLK_SATA 124 | ||
147 | #define TEGRA124_CLK_HDA 125 | ||
148 | /* 126 */ | ||
149 | #define TEGRA124_CLK_SE 127 | ||
150 | |||
151 | #define TEGRA124_CLK_HDA2HDMI 128 | ||
152 | #define TEGRA124_CLK_SATA_COLD 129 | ||
153 | /* 130 */ | ||
154 | /* 131 */ | ||
155 | /* 132 */ | ||
156 | /* 133 */ | ||
157 | /* 134 */ | ||
158 | /* 135 */ | ||
159 | /* 136 */ | ||
160 | /* 137 */ | ||
161 | /* 138 */ | ||
162 | /* 139 */ | ||
163 | /* 140 */ | ||
164 | /* 141 */ | ||
165 | /* 142 */ | ||
166 | /* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ | ||
167 | /* xusb_host_src and xusb_ss_src) */ | ||
168 | #define TEGRA124_CLK_CILAB 144 | ||
169 | #define TEGRA124_CLK_CILCD 145 | ||
170 | #define TEGRA124_CLK_CILE 146 | ||
171 | #define TEGRA124_CLK_DSIALP 147 | ||
172 | #define TEGRA124_CLK_DSIBLP 148 | ||
173 | #define TEGRA124_CLK_ENTROPY 149 | ||
174 | #define TEGRA124_CLK_DDS 150 | ||
175 | /* 151 */ | ||
176 | #define TEGRA124_CLK_DP2 152 | ||
177 | #define TEGRA124_CLK_AMX 153 | ||
178 | #define TEGRA124_CLK_ADX 154 | ||
179 | /* 155 (bit affects dfll_ref and dfll_soc) */ | ||
180 | #define TEGRA124_CLK_XUSB_SS 156 | ||
181 | /* 157 */ | ||
182 | /* 158 */ | ||
183 | /* 159 */ | ||
184 | |||
185 | /* 160 */ | ||
186 | /* 161 */ | ||
187 | /* 162 */ | ||
188 | /* 163 */ | ||
189 | /* 164 */ | ||
190 | /* 165 */ | ||
191 | #define TEGRA124_CLK_I2C6 166 | ||
192 | /* 167 */ | ||
193 | /* 168 */ | ||
194 | /* 169 */ | ||
195 | /* 170 */ | ||
196 | #define TEGRA124_CLK_VIM2_CLK 171 | ||
197 | /* 172 */ | ||
198 | /* 173 */ | ||
199 | /* 174 */ | ||
200 | /* 175 */ | ||
201 | #define TEGRA124_CLK_HDMI_AUDIO 176 | ||
202 | #define TEGRA124_CLK_CLK72MHZ 177 | ||
203 | #define TEGRA124_CLK_VIC03 178 | ||
204 | /* 179 */ | ||
205 | #define TEGRA124_CLK_ADX1 180 | ||
206 | #define TEGRA124_CLK_DPAUX 181 | ||
207 | #define TEGRA124_CLK_SOR0 182 | ||
208 | /* 183 */ | ||
209 | #define TEGRA124_CLK_GPU 184 | ||
210 | #define TEGRA124_CLK_AMX1 185 | ||
211 | /* 186 */ | ||
212 | /* 187 */ | ||
213 | /* 188 */ | ||
214 | /* 189 */ | ||
215 | /* 190 */ | ||
216 | /* 191 */ | ||
217 | #define TEGRA124_CLK_UARTB 192 | ||
218 | #define TEGRA124_CLK_VFIR 193 | ||
219 | #define TEGRA124_CLK_SPDIF_IN 194 | ||
220 | #define TEGRA124_CLK_SPDIF_OUT 195 | ||
221 | #define TEGRA124_CLK_VI 196 | ||
222 | #define TEGRA124_CLK_VI_SENSOR 197 | ||
223 | #define TEGRA124_CLK_FUSE 198 | ||
224 | #define TEGRA124_CLK_FUSE_BURN 199 | ||
225 | #define TEGRA124_CLK_CLK_32K 200 | ||
226 | #define TEGRA124_CLK_CLK_M 201 | ||
227 | #define TEGRA124_CLK_CLK_M_DIV2 202 | ||
228 | #define TEGRA124_CLK_CLK_M_DIV4 203 | ||
229 | #define TEGRA124_CLK_PLL_REF 204 | ||
230 | #define TEGRA124_CLK_PLL_C 205 | ||
231 | #define TEGRA124_CLK_PLL_C_OUT1 206 | ||
232 | #define TEGRA124_CLK_PLL_C2 207 | ||
233 | #define TEGRA124_CLK_PLL_C3 208 | ||
234 | #define TEGRA124_CLK_PLL_M 209 | ||
235 | #define TEGRA124_CLK_PLL_M_OUT1 210 | ||
236 | #define TEGRA124_CLK_PLL_P 211 | ||
237 | #define TEGRA124_CLK_PLL_P_OUT1 212 | ||
238 | #define TEGRA124_CLK_PLL_P_OUT2 213 | ||
239 | #define TEGRA124_CLK_PLL_P_OUT3 214 | ||
240 | #define TEGRA124_CLK_PLL_P_OUT4 215 | ||
241 | #define TEGRA124_CLK_PLL_A 216 | ||
242 | #define TEGRA124_CLK_PLL_A_OUT0 217 | ||
243 | #define TEGRA124_CLK_PLL_D 218 | ||
244 | #define TEGRA124_CLK_PLL_D_OUT0 219 | ||
245 | #define TEGRA124_CLK_PLL_D2 220 | ||
246 | #define TEGRA124_CLK_PLL_D2_OUT0 221 | ||
247 | #define TEGRA124_CLK_PLL_U 222 | ||
248 | #define TEGRA124_CLK_PLL_U_480M 223 | ||
249 | |||
250 | #define TEGRA124_CLK_PLL_U_60M 224 | ||
251 | #define TEGRA124_CLK_PLL_U_48M 225 | ||
252 | #define TEGRA124_CLK_PLL_U_12M 226 | ||
253 | /* 227 */ | ||
254 | /* 228 */ | ||
255 | #define TEGRA124_CLK_PLL_RE_VCO 229 | ||
256 | #define TEGRA124_CLK_PLL_RE_OUT 230 | ||
257 | #define TEGRA124_CLK_PLL_E 231 | ||
258 | #define TEGRA124_CLK_SPDIF_IN_SYNC 232 | ||
259 | #define TEGRA124_CLK_I2S0_SYNC 233 | ||
260 | #define TEGRA124_CLK_I2S1_SYNC 234 | ||
261 | #define TEGRA124_CLK_I2S2_SYNC 235 | ||
262 | #define TEGRA124_CLK_I2S3_SYNC 236 | ||
263 | #define TEGRA124_CLK_I2S4_SYNC 237 | ||
264 | #define TEGRA124_CLK_VIMCLK_SYNC 238 | ||
265 | #define TEGRA124_CLK_AUDIO0 239 | ||
266 | #define TEGRA124_CLK_AUDIO1 240 | ||
267 | #define TEGRA124_CLK_AUDIO2 241 | ||
268 | #define TEGRA124_CLK_AUDIO3 242 | ||
269 | #define TEGRA124_CLK_AUDIO4 243 | ||
270 | #define TEGRA124_CLK_SPDIF 244 | ||
271 | #define TEGRA124_CLK_CLK_OUT_1 245 | ||
272 | #define TEGRA124_CLK_CLK_OUT_2 246 | ||
273 | #define TEGRA124_CLK_CLK_OUT_3 247 | ||
274 | #define TEGRA124_CLK_BLINK 248 | ||
275 | /* 249 */ | ||
276 | /* 250 */ | ||
277 | /* 251 */ | ||
278 | #define TEGRA124_CLK_XUSB_HOST_SRC 252 | ||
279 | #define TEGRA124_CLK_XUSB_FALCON_SRC 253 | ||
280 | #define TEGRA124_CLK_XUSB_FS_SRC 254 | ||
281 | #define TEGRA124_CLK_XUSB_SS_SRC 255 | ||
282 | |||
283 | #define TEGRA124_CLK_XUSB_DEV_SRC 256 | ||
284 | #define TEGRA124_CLK_XUSB_DEV 257 | ||
285 | #define TEGRA124_CLK_XUSB_HS_SRC 258 | ||
286 | #define TEGRA124_CLK_SCLK 259 | ||
287 | #define TEGRA124_CLK_HCLK 260 | ||
288 | #define TEGRA124_CLK_PCLK 261 | ||
289 | /* 262 */ | ||
290 | /* 263 */ | ||
291 | #define TEGRA124_CLK_DFLL_REF 264 | ||
292 | #define TEGRA124_CLK_DFLL_SOC 265 | ||
293 | #define TEGRA124_CLK_VI_SENSOR2 266 | ||
294 | #define TEGRA124_CLK_PLL_P_OUT5 267 | ||
295 | #define TEGRA124_CLK_CML0 268 | ||
296 | #define TEGRA124_CLK_CML1 269 | ||
297 | #define TEGRA124_CLK_PLL_C4 270 | ||
298 | #define TEGRA124_CLK_PLL_DP 271 | ||
299 | #define TEGRA124_CLK_PLL_E_MUX 272 | ||
300 | #define TEGRA124_CLK_PLLD_DSI 273 | ||
301 | /* 274 */ | ||
302 | /* 275 */ | ||
303 | /* 276 */ | ||
304 | /* 277 */ | ||
305 | /* 278 */ | ||
306 | /* 279 */ | ||
307 | /* 280 */ | ||
308 | /* 281 */ | ||
309 | /* 282 */ | ||
310 | /* 283 */ | ||
311 | /* 284 */ | ||
312 | /* 285 */ | ||
313 | /* 286 */ | ||
314 | /* 287 */ | ||
315 | |||
316 | /* 288 */ | ||
317 | /* 289 */ | ||
318 | /* 290 */ | ||
319 | /* 291 */ | ||
320 | /* 292 */ | ||
321 | /* 293 */ | ||
322 | /* 294 */ | ||
323 | /* 295 */ | ||
324 | /* 296 */ | ||
325 | /* 297 */ | ||
326 | /* 298 */ | ||
327 | /* 299 */ | ||
328 | #define TEGRA124_CLK_AUDIO0_MUX 300 | ||
329 | #define TEGRA124_CLK_AUDIO1_MUX 301 | ||
330 | #define TEGRA124_CLK_AUDIO2_MUX 302 | ||
331 | #define TEGRA124_CLK_AUDIO3_MUX 303 | ||
332 | #define TEGRA124_CLK_AUDIO4_MUX 304 | ||
333 | #define TEGRA124_CLK_SPDIF_MUX 305 | ||
334 | #define TEGRA124_CLK_CLK_OUT_1_MUX 306 | ||
335 | #define TEGRA124_CLK_CLK_OUT_2_MUX 307 | ||
336 | #define TEGRA124_CLK_CLK_OUT_3_MUX 308 | ||
337 | /* 309 */ | ||
338 | /* 310 */ | ||
339 | #define TEGRA124_CLK_SOR0_LVDS 311 | ||
340 | #define TEGRA124_CLK_XUSB_SS_DIV2 312 | ||
341 | |||
342 | #define TEGRA124_CLK_PLL_M_UD 313 | ||
343 | #define TEGRA124_CLK_PLL_C_UD 314 | ||
344 | |||
345 | #endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_COMMON_H */ | ||
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h index af9bc9a3ddbc..2860737f0443 100644 --- a/include/dt-bindings/clock/tegra124-car.h +++ b/include/dt-bindings/clock/tegra124-car.h | |||
@@ -1,346 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * This header provides constants for binding nvidia,tegra124-car. | 2 | * This header provides Tegra124-specific constants for binding |
3 | * | 3 | * nvidia,tegra124-car. |
4 | * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
5 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
6 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
7 | * this case, those clocks are assigned IDs above 185 in order to highlight | ||
8 | * this issue. Implementations that interpret these clock IDs as bit values | ||
9 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
10 | * explicitly handle these special cases. | ||
11 | * | ||
12 | * The balance of the clocks controlled by the CAR are assigned IDs of 185 and | ||
13 | * above. | ||
14 | */ | 4 | */ |
15 | 5 | ||
6 | #include <dt-bindings/clock/tegra124-car-common.h> | ||
7 | |||
16 | #ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H | 8 | #ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H |
17 | #define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H | 9 | #define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H |
18 | 10 | ||
19 | /* 0 */ | 11 | #define TEGRA124_CLK_PLL_X 227 |
20 | /* 1 */ | 12 | #define TEGRA124_CLK_PLL_X_OUT0 228 |
21 | /* 2 */ | ||
22 | #define TEGRA124_CLK_ISPB 3 | ||
23 | #define TEGRA124_CLK_RTC 4 | ||
24 | #define TEGRA124_CLK_TIMER 5 | ||
25 | #define TEGRA124_CLK_UARTA 6 | ||
26 | /* 7 (register bit affects uartb and vfir) */ | ||
27 | /* 8 */ | ||
28 | #define TEGRA124_CLK_SDMMC2 9 | ||
29 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
30 | #define TEGRA124_CLK_I2S1 11 | ||
31 | #define TEGRA124_CLK_I2C1 12 | ||
32 | /* 13 */ | ||
33 | #define TEGRA124_CLK_SDMMC1 14 | ||
34 | #define TEGRA124_CLK_SDMMC4 15 | ||
35 | /* 16 */ | ||
36 | #define TEGRA124_CLK_PWM 17 | ||
37 | #define TEGRA124_CLK_I2S2 18 | ||
38 | /* 20 (register bit affects vi and vi_sensor) */ | ||
39 | /* 21 */ | ||
40 | #define TEGRA124_CLK_USBD 22 | ||
41 | #define TEGRA124_CLK_ISP 23 | ||
42 | /* 26 */ | ||
43 | /* 25 */ | ||
44 | #define TEGRA124_CLK_DISP2 26 | ||
45 | #define TEGRA124_CLK_DISP1 27 | ||
46 | #define TEGRA124_CLK_HOST1X 28 | ||
47 | #define TEGRA124_CLK_VCP 29 | ||
48 | #define TEGRA124_CLK_I2S0 30 | ||
49 | /* 31 */ | ||
50 | |||
51 | #define TEGRA124_CLK_MC 32 | ||
52 | /* 33 */ | ||
53 | #define TEGRA124_CLK_APBDMA 34 | ||
54 | /* 35 */ | ||
55 | #define TEGRA124_CLK_KBC 36 | ||
56 | /* 37 */ | ||
57 | /* 38 */ | ||
58 | /* 39 (register bit affects fuse and fuse_burn) */ | ||
59 | #define TEGRA124_CLK_KFUSE 40 | ||
60 | #define TEGRA124_CLK_SBC1 41 | ||
61 | #define TEGRA124_CLK_NOR 42 | ||
62 | /* 43 */ | ||
63 | #define TEGRA124_CLK_SBC2 44 | ||
64 | /* 45 */ | ||
65 | #define TEGRA124_CLK_SBC3 46 | ||
66 | #define TEGRA124_CLK_I2C5 47 | ||
67 | #define TEGRA124_CLK_DSIA 48 | ||
68 | /* 49 */ | ||
69 | #define TEGRA124_CLK_MIPI 50 | ||
70 | #define TEGRA124_CLK_HDMI 51 | ||
71 | #define TEGRA124_CLK_CSI 52 | ||
72 | /* 53 */ | ||
73 | #define TEGRA124_CLK_I2C2 54 | ||
74 | #define TEGRA124_CLK_UARTC 55 | ||
75 | #define TEGRA124_CLK_MIPI_CAL 56 | ||
76 | #define TEGRA124_CLK_EMC 57 | ||
77 | #define TEGRA124_CLK_USB2 58 | ||
78 | #define TEGRA124_CLK_USB3 59 | ||
79 | /* 60 */ | ||
80 | #define TEGRA124_CLK_VDE 61 | ||
81 | #define TEGRA124_CLK_BSEA 62 | ||
82 | #define TEGRA124_CLK_BSEV 63 | ||
83 | |||
84 | /* 64 */ | ||
85 | #define TEGRA124_CLK_UARTD 65 | ||
86 | /* 66 */ | ||
87 | #define TEGRA124_CLK_I2C3 67 | ||
88 | #define TEGRA124_CLK_SBC4 68 | ||
89 | #define TEGRA124_CLK_SDMMC3 69 | ||
90 | #define TEGRA124_CLK_PCIE 70 | ||
91 | #define TEGRA124_CLK_OWR 71 | ||
92 | #define TEGRA124_CLK_AFI 72 | ||
93 | #define TEGRA124_CLK_CSITE 73 | ||
94 | /* 74 */ | ||
95 | /* 75 */ | ||
96 | #define TEGRA124_CLK_LA 76 | ||
97 | #define TEGRA124_CLK_TRACE 77 | ||
98 | #define TEGRA124_CLK_SOC_THERM 78 | ||
99 | #define TEGRA124_CLK_DTV 79 | ||
100 | /* 80 */ | ||
101 | #define TEGRA124_CLK_I2CSLOW 81 | ||
102 | #define TEGRA124_CLK_DSIB 82 | ||
103 | #define TEGRA124_CLK_TSEC 83 | ||
104 | /* 84 */ | ||
105 | /* 85 */ | ||
106 | /* 86 */ | ||
107 | /* 87 */ | ||
108 | /* 88 */ | ||
109 | #define TEGRA124_CLK_XUSB_HOST 89 | ||
110 | /* 90 */ | ||
111 | #define TEGRA124_CLK_MSENC 91 | ||
112 | #define TEGRA124_CLK_CSUS 92 | ||
113 | /* 93 */ | ||
114 | /* 94 */ | ||
115 | /* 95 (bit affects xusb_dev and xusb_dev_src) */ | ||
116 | |||
117 | /* 96 */ | ||
118 | /* 97 */ | ||
119 | /* 98 */ | ||
120 | #define TEGRA124_CLK_MSELECT 99 | ||
121 | #define TEGRA124_CLK_TSENSOR 100 | ||
122 | #define TEGRA124_CLK_I2S3 101 | ||
123 | #define TEGRA124_CLK_I2S4 102 | ||
124 | #define TEGRA124_CLK_I2C4 103 | ||
125 | #define TEGRA124_CLK_SBC5 104 | ||
126 | #define TEGRA124_CLK_SBC6 105 | ||
127 | #define TEGRA124_CLK_D_AUDIO 106 | ||
128 | #define TEGRA124_CLK_APBIF 107 | ||
129 | #define TEGRA124_CLK_DAM0 108 | ||
130 | #define TEGRA124_CLK_DAM1 109 | ||
131 | #define TEGRA124_CLK_DAM2 110 | ||
132 | #define TEGRA124_CLK_HDA2CODEC_2X 111 | ||
133 | /* 112 */ | ||
134 | #define TEGRA124_CLK_AUDIO0_2X 113 | ||
135 | #define TEGRA124_CLK_AUDIO1_2X 114 | ||
136 | #define TEGRA124_CLK_AUDIO2_2X 115 | ||
137 | #define TEGRA124_CLK_AUDIO3_2X 116 | ||
138 | #define TEGRA124_CLK_AUDIO4_2X 117 | ||
139 | #define TEGRA124_CLK_SPDIF_2X 118 | ||
140 | #define TEGRA124_CLK_ACTMON 119 | ||
141 | #define TEGRA124_CLK_EXTERN1 120 | ||
142 | #define TEGRA124_CLK_EXTERN2 121 | ||
143 | #define TEGRA124_CLK_EXTERN3 122 | ||
144 | #define TEGRA124_CLK_SATA_OOB 123 | ||
145 | #define TEGRA124_CLK_SATA 124 | ||
146 | #define TEGRA124_CLK_HDA 125 | ||
147 | /* 126 */ | ||
148 | #define TEGRA124_CLK_SE 127 | ||
149 | |||
150 | #define TEGRA124_CLK_HDA2HDMI 128 | ||
151 | #define TEGRA124_CLK_SATA_COLD 129 | ||
152 | /* 130 */ | ||
153 | /* 131 */ | ||
154 | /* 132 */ | ||
155 | /* 133 */ | ||
156 | /* 134 */ | ||
157 | /* 135 */ | ||
158 | /* 136 */ | ||
159 | /* 137 */ | ||
160 | /* 138 */ | ||
161 | /* 139 */ | ||
162 | /* 140 */ | ||
163 | /* 141 */ | ||
164 | /* 142 */ | ||
165 | /* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ | ||
166 | /* xusb_host_src and xusb_ss_src) */ | ||
167 | #define TEGRA124_CLK_CILAB 144 | ||
168 | #define TEGRA124_CLK_CILCD 145 | ||
169 | #define TEGRA124_CLK_CILE 146 | ||
170 | #define TEGRA124_CLK_DSIALP 147 | ||
171 | #define TEGRA124_CLK_DSIBLP 148 | ||
172 | #define TEGRA124_CLK_ENTROPY 149 | ||
173 | #define TEGRA124_CLK_DDS 150 | ||
174 | /* 151 */ | ||
175 | #define TEGRA124_CLK_DP2 152 | ||
176 | #define TEGRA124_CLK_AMX 153 | ||
177 | #define TEGRA124_CLK_ADX 154 | ||
178 | /* 155 (bit affects dfll_ref and dfll_soc) */ | ||
179 | #define TEGRA124_CLK_XUSB_SS 156 | ||
180 | /* 157 */ | ||
181 | /* 158 */ | ||
182 | /* 159 */ | ||
183 | |||
184 | /* 160 */ | ||
185 | /* 161 */ | ||
186 | /* 162 */ | ||
187 | /* 163 */ | ||
188 | /* 164 */ | ||
189 | /* 165 */ | ||
190 | #define TEGRA124_CLK_I2C6 166 | ||
191 | /* 167 */ | ||
192 | /* 168 */ | ||
193 | /* 169 */ | ||
194 | /* 170 */ | ||
195 | #define TEGRA124_CLK_VIM2_CLK 171 | ||
196 | /* 172 */ | ||
197 | /* 173 */ | ||
198 | /* 174 */ | ||
199 | /* 175 */ | ||
200 | #define TEGRA124_CLK_HDMI_AUDIO 176 | ||
201 | #define TEGRA124_CLK_CLK72MHZ 177 | ||
202 | #define TEGRA124_CLK_VIC03 178 | ||
203 | /* 179 */ | ||
204 | #define TEGRA124_CLK_ADX1 180 | ||
205 | #define TEGRA124_CLK_DPAUX 181 | ||
206 | #define TEGRA124_CLK_SOR0 182 | ||
207 | /* 183 */ | ||
208 | #define TEGRA124_CLK_GPU 184 | ||
209 | #define TEGRA124_CLK_AMX1 185 | ||
210 | /* 186 */ | ||
211 | /* 187 */ | ||
212 | /* 188 */ | ||
213 | /* 189 */ | ||
214 | /* 190 */ | ||
215 | /* 191 */ | ||
216 | #define TEGRA124_CLK_UARTB 192 | ||
217 | #define TEGRA124_CLK_VFIR 193 | ||
218 | #define TEGRA124_CLK_SPDIF_IN 194 | ||
219 | #define TEGRA124_CLK_SPDIF_OUT 195 | ||
220 | #define TEGRA124_CLK_VI 196 | ||
221 | #define TEGRA124_CLK_VI_SENSOR 197 | ||
222 | #define TEGRA124_CLK_FUSE 198 | ||
223 | #define TEGRA124_CLK_FUSE_BURN 199 | ||
224 | #define TEGRA124_CLK_CLK_32K 200 | ||
225 | #define TEGRA124_CLK_CLK_M 201 | ||
226 | #define TEGRA124_CLK_CLK_M_DIV2 202 | ||
227 | #define TEGRA124_CLK_CLK_M_DIV4 203 | ||
228 | #define TEGRA124_CLK_PLL_REF 204 | ||
229 | #define TEGRA124_CLK_PLL_C 205 | ||
230 | #define TEGRA124_CLK_PLL_C_OUT1 206 | ||
231 | #define TEGRA124_CLK_PLL_C2 207 | ||
232 | #define TEGRA124_CLK_PLL_C3 208 | ||
233 | #define TEGRA124_CLK_PLL_M 209 | ||
234 | #define TEGRA124_CLK_PLL_M_OUT1 210 | ||
235 | #define TEGRA124_CLK_PLL_P 211 | ||
236 | #define TEGRA124_CLK_PLL_P_OUT1 212 | ||
237 | #define TEGRA124_CLK_PLL_P_OUT2 213 | ||
238 | #define TEGRA124_CLK_PLL_P_OUT3 214 | ||
239 | #define TEGRA124_CLK_PLL_P_OUT4 215 | ||
240 | #define TEGRA124_CLK_PLL_A 216 | ||
241 | #define TEGRA124_CLK_PLL_A_OUT0 217 | ||
242 | #define TEGRA124_CLK_PLL_D 218 | ||
243 | #define TEGRA124_CLK_PLL_D_OUT0 219 | ||
244 | #define TEGRA124_CLK_PLL_D2 220 | ||
245 | #define TEGRA124_CLK_PLL_D2_OUT0 221 | ||
246 | #define TEGRA124_CLK_PLL_U 222 | ||
247 | #define TEGRA124_CLK_PLL_U_480M 223 | ||
248 | |||
249 | #define TEGRA124_CLK_PLL_U_60M 224 | ||
250 | #define TEGRA124_CLK_PLL_U_48M 225 | ||
251 | #define TEGRA124_CLK_PLL_U_12M 226 | ||
252 | #define TEGRA124_CLK_PLL_X 227 | ||
253 | #define TEGRA124_CLK_PLL_X_OUT0 228 | ||
254 | #define TEGRA124_CLK_PLL_RE_VCO 229 | ||
255 | #define TEGRA124_CLK_PLL_RE_OUT 230 | ||
256 | #define TEGRA124_CLK_PLL_E 231 | ||
257 | #define TEGRA124_CLK_SPDIF_IN_SYNC 232 | ||
258 | #define TEGRA124_CLK_I2S0_SYNC 233 | ||
259 | #define TEGRA124_CLK_I2S1_SYNC 234 | ||
260 | #define TEGRA124_CLK_I2S2_SYNC 235 | ||
261 | #define TEGRA124_CLK_I2S3_SYNC 236 | ||
262 | #define TEGRA124_CLK_I2S4_SYNC 237 | ||
263 | #define TEGRA124_CLK_VIMCLK_SYNC 238 | ||
264 | #define TEGRA124_CLK_AUDIO0 239 | ||
265 | #define TEGRA124_CLK_AUDIO1 240 | ||
266 | #define TEGRA124_CLK_AUDIO2 241 | ||
267 | #define TEGRA124_CLK_AUDIO3 242 | ||
268 | #define TEGRA124_CLK_AUDIO4 243 | ||
269 | #define TEGRA124_CLK_SPDIF 244 | ||
270 | #define TEGRA124_CLK_CLK_OUT_1 245 | ||
271 | #define TEGRA124_CLK_CLK_OUT_2 246 | ||
272 | #define TEGRA124_CLK_CLK_OUT_3 247 | ||
273 | #define TEGRA124_CLK_BLINK 248 | ||
274 | /* 249 */ | ||
275 | /* 250 */ | ||
276 | /* 251 */ | ||
277 | #define TEGRA124_CLK_XUSB_HOST_SRC 252 | ||
278 | #define TEGRA124_CLK_XUSB_FALCON_SRC 253 | ||
279 | #define TEGRA124_CLK_XUSB_FS_SRC 254 | ||
280 | #define TEGRA124_CLK_XUSB_SS_SRC 255 | ||
281 | |||
282 | #define TEGRA124_CLK_XUSB_DEV_SRC 256 | ||
283 | #define TEGRA124_CLK_XUSB_DEV 257 | ||
284 | #define TEGRA124_CLK_XUSB_HS_SRC 258 | ||
285 | #define TEGRA124_CLK_SCLK 259 | ||
286 | #define TEGRA124_CLK_HCLK 260 | ||
287 | #define TEGRA124_CLK_PCLK 261 | ||
288 | #define TEGRA124_CLK_CCLK_G 262 | ||
289 | #define TEGRA124_CLK_CCLK_LP 263 | ||
290 | #define TEGRA124_CLK_DFLL_REF 264 | ||
291 | #define TEGRA124_CLK_DFLL_SOC 265 | ||
292 | #define TEGRA124_CLK_VI_SENSOR2 266 | ||
293 | #define TEGRA124_CLK_PLL_P_OUT5 267 | ||
294 | #define TEGRA124_CLK_CML0 268 | ||
295 | #define TEGRA124_CLK_CML1 269 | ||
296 | #define TEGRA124_CLK_PLL_C4 270 | ||
297 | #define TEGRA124_CLK_PLL_DP 271 | ||
298 | #define TEGRA124_CLK_PLL_E_MUX 272 | ||
299 | /* 273 */ | ||
300 | /* 274 */ | ||
301 | /* 275 */ | ||
302 | /* 276 */ | ||
303 | /* 277 */ | ||
304 | /* 278 */ | ||
305 | /* 279 */ | ||
306 | /* 280 */ | ||
307 | /* 281 */ | ||
308 | /* 282 */ | ||
309 | /* 283 */ | ||
310 | /* 284 */ | ||
311 | /* 285 */ | ||
312 | /* 286 */ | ||
313 | /* 287 */ | ||
314 | |||
315 | /* 288 */ | ||
316 | /* 289 */ | ||
317 | /* 290 */ | ||
318 | /* 291 */ | ||
319 | /* 292 */ | ||
320 | /* 293 */ | ||
321 | /* 294 */ | ||
322 | /* 295 */ | ||
323 | /* 296 */ | ||
324 | /* 297 */ | ||
325 | /* 298 */ | ||
326 | /* 299 */ | ||
327 | #define TEGRA124_CLK_AUDIO0_MUX 300 | ||
328 | #define TEGRA124_CLK_AUDIO1_MUX 301 | ||
329 | #define TEGRA124_CLK_AUDIO2_MUX 302 | ||
330 | #define TEGRA124_CLK_AUDIO3_MUX 303 | ||
331 | #define TEGRA124_CLK_AUDIO4_MUX 304 | ||
332 | #define TEGRA124_CLK_SPDIF_MUX 305 | ||
333 | #define TEGRA124_CLK_CLK_OUT_1_MUX 306 | ||
334 | #define TEGRA124_CLK_CLK_OUT_2_MUX 307 | ||
335 | #define TEGRA124_CLK_CLK_OUT_3_MUX 308 | ||
336 | #define TEGRA124_CLK_DSIA_MUX 309 | ||
337 | #define TEGRA124_CLK_DSIB_MUX 310 | ||
338 | #define TEGRA124_CLK_SOR0_LVDS 311 | ||
339 | #define TEGRA124_CLK_XUSB_SS_DIV2 312 | ||
340 | 13 | ||
341 | #define TEGRA124_CLK_PLL_M_UD 313 | 14 | #define TEGRA124_CLK_CCLK_G 262 |
342 | #define TEGRA124_CLK_PLL_C_UD 314 | 15 | #define TEGRA124_CLK_CCLK_LP 263 |
343 | 16 | ||
344 | #define TEGRA124_CLK_CLK_MAX 315 | 17 | #define TEGRA124_CLK_CLK_MAX 315 |
345 | 18 | ||
346 | #endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ | 19 | #endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ |
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h index 801c0ac50c47..979d24a6799f 100644 --- a/include/dt-bindings/clock/vf610-clock.h +++ b/include/dt-bindings/clock/vf610-clock.h | |||
@@ -192,6 +192,7 @@ | |||
192 | #define VF610_PLL5_BYPASS 179 | 192 | #define VF610_PLL5_BYPASS 179 |
193 | #define VF610_PLL6_BYPASS 180 | 193 | #define VF610_PLL6_BYPASS 180 |
194 | #define VF610_PLL7_BYPASS 181 | 194 | #define VF610_PLL7_BYPASS 181 |
195 | #define VF610_CLK_END 182 | 195 | #define VF610_CLK_SNVS 182 |
196 | #define VF610_CLK_END 183 | ||
196 | 197 | ||
197 | #endif /* __DT_BINDINGS_CLOCK_VF610_H */ | 198 | #endif /* __DT_BINDINGS_CLOCK_VF610_H */ |
diff --git a/include/dt-bindings/dma/sun4i-a10.h b/include/dt-bindings/dma/sun4i-a10.h new file mode 100644 index 000000000000..8caba9ef7e9d --- /dev/null +++ b/include/dt-bindings/dma/sun4i-a10.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Maxime Ripard | ||
3 | * | ||
4 | * Maxime Ripard <maxime.ripard@free-electrons.com> | ||
5 | * | ||
6 | * This file is dual-licensed: you can use it either under the terms | ||
7 | * of the GPL or the X11 license, at your option. Note that this dual | ||
8 | * licensing only applies to this file, and not this project as a | ||
9 | * whole. | ||
10 | * | ||
11 | * a) This file is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License as | ||
13 | * published by the Free Software Foundation; either version 2 of the | ||
14 | * License, or (at your option) any later version. | ||
15 | * | ||
16 | * This file is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public | ||
22 | * License along with this file; if not, write to the Free | ||
23 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | ||
24 | * MA 02110-1301 USA | ||
25 | * | ||
26 | * Or, alternatively, | ||
27 | * | ||
28 | * b) Permission is hereby granted, free of charge, to any person | ||
29 | * obtaining a copy of this software and associated documentation | ||
30 | * files (the "Software"), to deal in the Software without | ||
31 | * restriction, including without limitation the rights to use, | ||
32 | * copy, modify, merge, publish, distribute, sublicense, and/or | ||
33 | * sell copies of the Software, and to permit persons to whom the | ||
34 | * Software is furnished to do so, subject to the following | ||
35 | * conditions: | ||
36 | * | ||
37 | * The above copyright notice and this permission notice shall be | ||
38 | * included in all copies or substantial portions of the Software. | ||
39 | * | ||
40 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
41 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
42 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
43 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
44 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
45 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
46 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
47 | * OTHER DEALINGS IN THE SOFTWARE. | ||
48 | */ | ||
49 | |||
50 | #ifndef __DT_BINDINGS_DMA_SUN4I_A10_H_ | ||
51 | #define __DT_BINDINGS_DMA_SUN4I_A10_H_ | ||
52 | |||
53 | #define SUN4I_DMA_NORMAL 0 | ||
54 | #define SUN4I_DMA_DEDICATED 1 | ||
55 | |||
56 | #endif /* __DT_BINDINGS_DMA_SUN4I_A10_H_ */ | ||
diff --git a/include/dt-bindings/gpio/meson8-gpio.h b/include/dt-bindings/gpio/meson8-gpio.h new file mode 100644 index 000000000000..fdaeb5cbf5e1 --- /dev/null +++ b/include/dt-bindings/gpio/meson8-gpio.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * GPIO definitions for Amlogic Meson8 SoCs | ||
3 | * | ||
4 | * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * You should have received a copy of the GNU General Public License | ||
11 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
12 | */ | ||
13 | |||
14 | #ifndef _DT_BINDINGS_MESON8_GPIO_H | ||
15 | #define _DT_BINDINGS_MESON8_GPIO_H | ||
16 | |||
17 | /* First GPIO chip */ | ||
18 | #define GPIOX_0 0 | ||
19 | #define GPIOX_1 1 | ||
20 | #define GPIOX_2 2 | ||
21 | #define GPIOX_3 3 | ||
22 | #define GPIOX_4 4 | ||
23 | #define GPIOX_5 5 | ||
24 | #define GPIOX_6 6 | ||
25 | #define GPIOX_7 7 | ||
26 | #define GPIOX_8 8 | ||
27 | #define GPIOX_9 9 | ||
28 | #define GPIOX_10 10 | ||
29 | #define GPIOX_11 11 | ||
30 | #define GPIOX_12 12 | ||
31 | #define GPIOX_13 13 | ||
32 | #define GPIOX_14 14 | ||
33 | #define GPIOX_15 15 | ||
34 | #define GPIOX_16 16 | ||
35 | #define GPIOX_17 17 | ||
36 | #define GPIOX_18 18 | ||
37 | #define GPIOX_19 19 | ||
38 | #define GPIOX_20 20 | ||
39 | #define GPIOX_21 21 | ||
40 | #define GPIOY_0 22 | ||
41 | #define GPIOY_1 23 | ||
42 | #define GPIOY_2 24 | ||
43 | #define GPIOY_3 25 | ||
44 | #define GPIOY_4 26 | ||
45 | #define GPIOY_5 27 | ||
46 | #define GPIOY_6 28 | ||
47 | #define GPIOY_7 29 | ||
48 | #define GPIOY_8 30 | ||
49 | #define GPIOY_9 31 | ||
50 | #define GPIOY_10 32 | ||
51 | #define GPIOY_11 33 | ||
52 | #define GPIOY_12 34 | ||
53 | #define GPIOY_13 35 | ||
54 | #define GPIOY_14 36 | ||
55 | #define GPIOY_15 37 | ||
56 | #define GPIOY_16 38 | ||
57 | #define GPIODV_0 39 | ||
58 | #define GPIODV_1 40 | ||
59 | #define GPIODV_2 41 | ||
60 | #define GPIODV_3 42 | ||
61 | #define GPIODV_4 43 | ||
62 | #define GPIODV_5 44 | ||
63 | #define GPIODV_6 45 | ||
64 | #define GPIODV_7 46 | ||
65 | #define GPIODV_8 47 | ||
66 | #define GPIODV_9 48 | ||
67 | #define GPIODV_10 49 | ||
68 | #define GPIODV_11 50 | ||
69 | #define GPIODV_12 51 | ||
70 | #define GPIODV_13 52 | ||
71 | #define GPIODV_14 53 | ||
72 | #define GPIODV_15 54 | ||
73 | #define GPIODV_16 55 | ||
74 | #define GPIODV_17 56 | ||
75 | #define GPIODV_18 57 | ||
76 | #define GPIODV_19 58 | ||
77 | #define GPIODV_20 59 | ||
78 | #define GPIODV_21 60 | ||
79 | #define GPIODV_22 61 | ||
80 | #define GPIODV_23 62 | ||
81 | #define GPIODV_24 63 | ||
82 | #define GPIODV_25 64 | ||
83 | #define GPIODV_26 65 | ||
84 | #define GPIODV_27 66 | ||
85 | #define GPIODV_28 67 | ||
86 | #define GPIODV_29 68 | ||
87 | #define GPIOH_0 69 | ||
88 | #define GPIOH_1 70 | ||
89 | #define GPIOH_2 71 | ||
90 | #define GPIOH_3 72 | ||
91 | #define GPIOH_4 73 | ||
92 | #define GPIOH_5 74 | ||
93 | #define GPIOH_6 75 | ||
94 | #define GPIOH_7 76 | ||
95 | #define GPIOH_8 77 | ||
96 | #define GPIOH_9 78 | ||
97 | #define GPIOZ_0 79 | ||
98 | #define GPIOZ_1 80 | ||
99 | #define GPIOZ_2 81 | ||
100 | #define GPIOZ_3 82 | ||
101 | #define GPIOZ_4 83 | ||
102 | #define GPIOZ_5 84 | ||
103 | #define GPIOZ_6 85 | ||
104 | #define GPIOZ_7 86 | ||
105 | #define GPIOZ_8 87 | ||
106 | #define GPIOZ_9 88 | ||
107 | #define GPIOZ_10 89 | ||
108 | #define GPIOZ_11 90 | ||
109 | #define GPIOZ_12 91 | ||
110 | #define GPIOZ_13 92 | ||
111 | #define GPIOZ_14 93 | ||
112 | #define CARD_0 94 | ||
113 | #define CARD_1 95 | ||
114 | #define CARD_2 96 | ||
115 | #define CARD_3 97 | ||
116 | #define CARD_4 98 | ||
117 | #define CARD_5 99 | ||
118 | #define CARD_6 100 | ||
119 | #define BOOT_0 101 | ||
120 | #define BOOT_1 102 | ||
121 | #define BOOT_2 103 | ||
122 | #define BOOT_3 104 | ||
123 | #define BOOT_4 105 | ||
124 | #define BOOT_5 106 | ||
125 | #define BOOT_6 107 | ||
126 | #define BOOT_7 108 | ||
127 | #define BOOT_8 109 | ||
128 | #define BOOT_9 110 | ||
129 | #define BOOT_10 111 | ||
130 | #define BOOT_11 112 | ||
131 | #define BOOT_12 113 | ||
132 | #define BOOT_13 114 | ||
133 | #define BOOT_14 115 | ||
134 | #define BOOT_15 116 | ||
135 | #define BOOT_16 117 | ||
136 | #define BOOT_17 118 | ||
137 | #define BOOT_18 119 | ||
138 | |||
139 | /* Second GPIO chip */ | ||
140 | #define GPIOAO_0 0 | ||
141 | #define GPIOAO_1 1 | ||
142 | #define GPIOAO_2 2 | ||
143 | #define GPIOAO_3 3 | ||
144 | #define GPIOAO_4 4 | ||
145 | #define GPIOAO_5 5 | ||
146 | #define GPIOAO_6 6 | ||
147 | #define GPIOAO_7 7 | ||
148 | #define GPIOAO_8 8 | ||
149 | #define GPIOAO_9 9 | ||
150 | #define GPIOAO_10 10 | ||
151 | #define GPIOAO_11 11 | ||
152 | #define GPIOAO_12 12 | ||
153 | #define GPIOAO_13 13 | ||
154 | #define GPIO_BSD_EN 14 | ||
155 | #define GPIO_TEST_N 15 | ||
156 | |||
157 | #endif /* _DT_BINDINGS_MESON8_GPIO_H */ | ||
diff --git a/include/dt-bindings/iio/qcom,spmi-vadc.h b/include/dt-bindings/iio/qcom,spmi-vadc.h new file mode 100644 index 000000000000..42121fa238fa --- /dev/null +++ b/include/dt-bindings/iio/qcom,spmi-vadc.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. | ||
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 version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _DT_BINDINGS_QCOM_SPMI_VADC_H | ||
15 | #define _DT_BINDINGS_QCOM_SPMI_VADC_H | ||
16 | |||
17 | /* Voltage ADC channels */ | ||
18 | #define VADC_USBIN 0x00 | ||
19 | #define VADC_DCIN 0x01 | ||
20 | #define VADC_VCHG_SNS 0x02 | ||
21 | #define VADC_SPARE1_03 0x03 | ||
22 | #define VADC_USB_ID_MV 0x04 | ||
23 | #define VADC_VCOIN 0x05 | ||
24 | #define VADC_VBAT_SNS 0x06 | ||
25 | #define VADC_VSYS 0x07 | ||
26 | #define VADC_DIE_TEMP 0x08 | ||
27 | #define VADC_REF_625MV 0x09 | ||
28 | #define VADC_REF_1250MV 0x0a | ||
29 | #define VADC_CHG_TEMP 0x0b | ||
30 | #define VADC_SPARE1 0x0c | ||
31 | #define VADC_SPARE2 0x0d | ||
32 | #define VADC_GND_REF 0x0e | ||
33 | #define VADC_VDD_VADC 0x0f | ||
34 | |||
35 | #define VADC_P_MUX1_1_1 0x10 | ||
36 | #define VADC_P_MUX2_1_1 0x11 | ||
37 | #define VADC_P_MUX3_1_1 0x12 | ||
38 | #define VADC_P_MUX4_1_1 0x13 | ||
39 | #define VADC_P_MUX5_1_1 0x14 | ||
40 | #define VADC_P_MUX6_1_1 0x15 | ||
41 | #define VADC_P_MUX7_1_1 0x16 | ||
42 | #define VADC_P_MUX8_1_1 0x17 | ||
43 | #define VADC_P_MUX9_1_1 0x18 | ||
44 | #define VADC_P_MUX10_1_1 0x19 | ||
45 | #define VADC_P_MUX11_1_1 0x1a | ||
46 | #define VADC_P_MUX12_1_1 0x1b | ||
47 | #define VADC_P_MUX13_1_1 0x1c | ||
48 | #define VADC_P_MUX14_1_1 0x1d | ||
49 | #define VADC_P_MUX15_1_1 0x1e | ||
50 | #define VADC_P_MUX16_1_1 0x1f | ||
51 | |||
52 | #define VADC_P_MUX1_1_3 0x20 | ||
53 | #define VADC_P_MUX2_1_3 0x21 | ||
54 | #define VADC_P_MUX3_1_3 0x22 | ||
55 | #define VADC_P_MUX4_1_3 0x23 | ||
56 | #define VADC_P_MUX5_1_3 0x24 | ||
57 | #define VADC_P_MUX6_1_3 0x25 | ||
58 | #define VADC_P_MUX7_1_3 0x26 | ||
59 | #define VADC_P_MUX8_1_3 0x27 | ||
60 | #define VADC_P_MUX9_1_3 0x28 | ||
61 | #define VADC_P_MUX10_1_3 0x29 | ||
62 | #define VADC_P_MUX11_1_3 0x2a | ||
63 | #define VADC_P_MUX12_1_3 0x2b | ||
64 | #define VADC_P_MUX13_1_3 0x2c | ||
65 | #define VADC_P_MUX14_1_3 0x2d | ||
66 | #define VADC_P_MUX15_1_3 0x2e | ||
67 | #define VADC_P_MUX16_1_3 0x2f | ||
68 | |||
69 | #define VADC_LR_MUX1_BAT_THERM 0x30 | ||
70 | #define VADC_LR_MUX2_BAT_ID 0x31 | ||
71 | #define VADC_LR_MUX3_XO_THERM 0x32 | ||
72 | #define VADC_LR_MUX4_AMUX_THM1 0x33 | ||
73 | #define VADC_LR_MUX5_AMUX_THM2 0x34 | ||
74 | #define VADC_LR_MUX6_AMUX_THM3 0x35 | ||
75 | #define VADC_LR_MUX7_HW_ID 0x36 | ||
76 | #define VADC_LR_MUX8_AMUX_THM4 0x37 | ||
77 | #define VADC_LR_MUX9_AMUX_THM5 0x38 | ||
78 | #define VADC_LR_MUX10_USB_ID 0x39 | ||
79 | #define VADC_AMUX_PU1 0x3a | ||
80 | #define VADC_AMUX_PU2 0x3b | ||
81 | #define VADC_LR_MUX3_BUF_XO_THERM 0x3c | ||
82 | |||
83 | #define VADC_LR_MUX1_PU1_BAT_THERM 0x70 | ||
84 | #define VADC_LR_MUX2_PU1_BAT_ID 0x71 | ||
85 | #define VADC_LR_MUX3_PU1_XO_THERM 0x72 | ||
86 | #define VADC_LR_MUX4_PU1_AMUX_THM1 0x73 | ||
87 | #define VADC_LR_MUX5_PU1_AMUX_THM2 0x74 | ||
88 | #define VADC_LR_MUX6_PU1_AMUX_THM3 0x75 | ||
89 | #define VADC_LR_MUX7_PU1_AMUX_HW_ID 0x76 | ||
90 | #define VADC_LR_MUX8_PU1_AMUX_THM4 0x77 | ||
91 | #define VADC_LR_MUX9_PU1_AMUX_THM5 0x78 | ||
92 | #define VADC_LR_MUX10_PU1_AMUX_USB_ID 0x79 | ||
93 | #define VADC_LR_MUX3_BUF_PU1_XO_THERM 0x7c | ||
94 | |||
95 | #define VADC_LR_MUX1_PU2_BAT_THERM 0xb0 | ||
96 | #define VADC_LR_MUX2_PU2_BAT_ID 0xb1 | ||
97 | #define VADC_LR_MUX3_PU2_XO_THERM 0xb2 | ||
98 | #define VADC_LR_MUX4_PU2_AMUX_THM1 0xb3 | ||
99 | #define VADC_LR_MUX5_PU2_AMUX_THM2 0xb4 | ||
100 | #define VADC_LR_MUX6_PU2_AMUX_THM3 0xb5 | ||
101 | #define VADC_LR_MUX7_PU2_AMUX_HW_ID 0xb6 | ||
102 | #define VADC_LR_MUX8_PU2_AMUX_THM4 0xb7 | ||
103 | #define VADC_LR_MUX9_PU2_AMUX_THM5 0xb8 | ||
104 | #define VADC_LR_MUX10_PU2_AMUX_USB_ID 0xb9 | ||
105 | #define VADC_LR_MUX3_BUF_PU2_XO_THERM 0xbc | ||
106 | |||
107 | #define VADC_LR_MUX1_PU1_PU2_BAT_THERM 0xf0 | ||
108 | #define VADC_LR_MUX2_PU1_PU2_BAT_ID 0xf1 | ||
109 | #define VADC_LR_MUX3_PU1_PU2_XO_THERM 0xf2 | ||
110 | #define VADC_LR_MUX4_PU1_PU2_AMUX_THM1 0xf3 | ||
111 | #define VADC_LR_MUX5_PU1_PU2_AMUX_THM2 0xf4 | ||
112 | #define VADC_LR_MUX6_PU1_PU2_AMUX_THM3 0xf5 | ||
113 | #define VADC_LR_MUX7_PU1_PU2_AMUX_HW_ID 0xf6 | ||
114 | #define VADC_LR_MUX8_PU1_PU2_AMUX_THM4 0xf7 | ||
115 | #define VADC_LR_MUX9_PU1_PU2_AMUX_THM5 0xf8 | ||
116 | #define VADC_LR_MUX10_PU1_PU2_AMUX_USB_ID 0xf9 | ||
117 | #define VADC_LR_MUX3_BUF_PU1_PU2_XO_THERM 0xfc | ||
118 | |||
119 | #endif /* _DT_BINDINGS_QCOM_SPMI_VADC_H */ | ||
diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h new file mode 100644 index 000000000000..388a6f3d6165 --- /dev/null +++ b/include/dt-bindings/mfd/qcom-rpm.h | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * This header provides constants for the Qualcomm RPM bindings. | ||
3 | */ | ||
4 | |||
5 | #ifndef _DT_BINDINGS_MFD_QCOM_RPM_H | ||
6 | #define _DT_BINDINGS_MFD_QCOM_RPM_H | ||
7 | |||
8 | /* | ||
9 | * Constants use to identify individual resources in the RPM. | ||
10 | */ | ||
11 | #define QCOM_RPM_APPS_FABRIC_ARB 1 | ||
12 | #define QCOM_RPM_APPS_FABRIC_CLK 2 | ||
13 | #define QCOM_RPM_APPS_FABRIC_HALT 3 | ||
14 | #define QCOM_RPM_APPS_FABRIC_IOCTL 4 | ||
15 | #define QCOM_RPM_APPS_FABRIC_MODE 5 | ||
16 | #define QCOM_RPM_APPS_L2_CACHE_CTL 6 | ||
17 | #define QCOM_RPM_CFPB_CLK 7 | ||
18 | #define QCOM_RPM_CXO_BUFFERS 8 | ||
19 | #define QCOM_RPM_CXO_CLK 9 | ||
20 | #define QCOM_RPM_DAYTONA_FABRIC_CLK 10 | ||
21 | #define QCOM_RPM_DDR_DMM 11 | ||
22 | #define QCOM_RPM_EBI1_CLK 12 | ||
23 | #define QCOM_RPM_HDMI_SWITCH 13 | ||
24 | #define QCOM_RPM_MMFPB_CLK 14 | ||
25 | #define QCOM_RPM_MM_FABRIC_ARB 15 | ||
26 | #define QCOM_RPM_MM_FABRIC_CLK 16 | ||
27 | #define QCOM_RPM_MM_FABRIC_HALT 17 | ||
28 | #define QCOM_RPM_MM_FABRIC_IOCTL 18 | ||
29 | #define QCOM_RPM_MM_FABRIC_MODE 19 | ||
30 | #define QCOM_RPM_PLL_4 20 | ||
31 | #define QCOM_RPM_PM8058_LDO0 21 | ||
32 | #define QCOM_RPM_PM8058_LDO1 22 | ||
33 | #define QCOM_RPM_PM8058_LDO2 23 | ||
34 | #define QCOM_RPM_PM8058_LDO3 24 | ||
35 | #define QCOM_RPM_PM8058_LDO4 25 | ||
36 | #define QCOM_RPM_PM8058_LDO5 26 | ||
37 | #define QCOM_RPM_PM8058_LDO6 27 | ||
38 | #define QCOM_RPM_PM8058_LDO7 28 | ||
39 | #define QCOM_RPM_PM8058_LDO8 29 | ||
40 | #define QCOM_RPM_PM8058_LDO9 30 | ||
41 | #define QCOM_RPM_PM8058_LDO10 31 | ||
42 | #define QCOM_RPM_PM8058_LDO11 32 | ||
43 | #define QCOM_RPM_PM8058_LDO12 33 | ||
44 | #define QCOM_RPM_PM8058_LDO13 34 | ||
45 | #define QCOM_RPM_PM8058_LDO14 35 | ||
46 | #define QCOM_RPM_PM8058_LDO15 36 | ||
47 | #define QCOM_RPM_PM8058_LDO16 37 | ||
48 | #define QCOM_RPM_PM8058_LDO17 38 | ||
49 | #define QCOM_RPM_PM8058_LDO18 39 | ||
50 | #define QCOM_RPM_PM8058_LDO19 40 | ||
51 | #define QCOM_RPM_PM8058_LDO20 41 | ||
52 | #define QCOM_RPM_PM8058_LDO21 42 | ||
53 | #define QCOM_RPM_PM8058_LDO22 43 | ||
54 | #define QCOM_RPM_PM8058_LDO23 44 | ||
55 | #define QCOM_RPM_PM8058_LDO24 45 | ||
56 | #define QCOM_RPM_PM8058_LDO25 46 | ||
57 | #define QCOM_RPM_PM8058_LVS0 47 | ||
58 | #define QCOM_RPM_PM8058_LVS1 48 | ||
59 | #define QCOM_RPM_PM8058_NCP 49 | ||
60 | #define QCOM_RPM_PM8058_SMPS0 50 | ||
61 | #define QCOM_RPM_PM8058_SMPS1 51 | ||
62 | #define QCOM_RPM_PM8058_SMPS2 52 | ||
63 | #define QCOM_RPM_PM8058_SMPS3 53 | ||
64 | #define QCOM_RPM_PM8058_SMPS4 54 | ||
65 | #define QCOM_RPM_PM8821_LDO1 55 | ||
66 | #define QCOM_RPM_PM8821_SMPS1 56 | ||
67 | #define QCOM_RPM_PM8821_SMPS2 57 | ||
68 | #define QCOM_RPM_PM8901_LDO0 58 | ||
69 | #define QCOM_RPM_PM8901_LDO1 59 | ||
70 | #define QCOM_RPM_PM8901_LDO2 60 | ||
71 | #define QCOM_RPM_PM8901_LDO3 61 | ||
72 | #define QCOM_RPM_PM8901_LDO4 62 | ||
73 | #define QCOM_RPM_PM8901_LDO5 63 | ||
74 | #define QCOM_RPM_PM8901_LDO6 64 | ||
75 | #define QCOM_RPM_PM8901_LVS0 65 | ||
76 | #define QCOM_RPM_PM8901_LVS1 66 | ||
77 | #define QCOM_RPM_PM8901_LVS2 67 | ||
78 | #define QCOM_RPM_PM8901_LVS3 68 | ||
79 | #define QCOM_RPM_PM8901_MVS 69 | ||
80 | #define QCOM_RPM_PM8901_SMPS0 70 | ||
81 | #define QCOM_RPM_PM8901_SMPS1 71 | ||
82 | #define QCOM_RPM_PM8901_SMPS2 72 | ||
83 | #define QCOM_RPM_PM8901_SMPS3 73 | ||
84 | #define QCOM_RPM_PM8901_SMPS4 74 | ||
85 | #define QCOM_RPM_PM8921_CLK1 75 | ||
86 | #define QCOM_RPM_PM8921_CLK2 76 | ||
87 | #define QCOM_RPM_PM8921_LDO1 77 | ||
88 | #define QCOM_RPM_PM8921_LDO2 78 | ||
89 | #define QCOM_RPM_PM8921_LDO3 79 | ||
90 | #define QCOM_RPM_PM8921_LDO4 80 | ||
91 | #define QCOM_RPM_PM8921_LDO5 81 | ||
92 | #define QCOM_RPM_PM8921_LDO6 82 | ||
93 | #define QCOM_RPM_PM8921_LDO7 83 | ||
94 | #define QCOM_RPM_PM8921_LDO8 84 | ||
95 | #define QCOM_RPM_PM8921_LDO9 85 | ||
96 | #define QCOM_RPM_PM8921_LDO10 86 | ||
97 | #define QCOM_RPM_PM8921_LDO11 87 | ||
98 | #define QCOM_RPM_PM8921_LDO12 88 | ||
99 | #define QCOM_RPM_PM8921_LDO13 89 | ||
100 | #define QCOM_RPM_PM8921_LDO14 90 | ||
101 | #define QCOM_RPM_PM8921_LDO15 91 | ||
102 | #define QCOM_RPM_PM8921_LDO16 92 | ||
103 | #define QCOM_RPM_PM8921_LDO17 93 | ||
104 | #define QCOM_RPM_PM8921_LDO18 94 | ||
105 | #define QCOM_RPM_PM8921_LDO19 95 | ||
106 | #define QCOM_RPM_PM8921_LDO20 96 | ||
107 | #define QCOM_RPM_PM8921_LDO21 97 | ||
108 | #define QCOM_RPM_PM8921_LDO22 98 | ||
109 | #define QCOM_RPM_PM8921_LDO23 99 | ||
110 | #define QCOM_RPM_PM8921_LDO24 100 | ||
111 | #define QCOM_RPM_PM8921_LDO25 101 | ||
112 | #define QCOM_RPM_PM8921_LDO26 102 | ||
113 | #define QCOM_RPM_PM8921_LDO27 103 | ||
114 | #define QCOM_RPM_PM8921_LDO28 104 | ||
115 | #define QCOM_RPM_PM8921_LDO29 105 | ||
116 | #define QCOM_RPM_PM8921_LVS1 106 | ||
117 | #define QCOM_RPM_PM8921_LVS2 107 | ||
118 | #define QCOM_RPM_PM8921_LVS3 108 | ||
119 | #define QCOM_RPM_PM8921_LVS4 109 | ||
120 | #define QCOM_RPM_PM8921_LVS5 110 | ||
121 | #define QCOM_RPM_PM8921_LVS6 111 | ||
122 | #define QCOM_RPM_PM8921_LVS7 112 | ||
123 | #define QCOM_RPM_PM8921_MVS 113 | ||
124 | #define QCOM_RPM_PM8921_NCP 114 | ||
125 | #define QCOM_RPM_PM8921_SMPS1 115 | ||
126 | #define QCOM_RPM_PM8921_SMPS2 116 | ||
127 | #define QCOM_RPM_PM8921_SMPS3 117 | ||
128 | #define QCOM_RPM_PM8921_SMPS4 118 | ||
129 | #define QCOM_RPM_PM8921_SMPS5 119 | ||
130 | #define QCOM_RPM_PM8921_SMPS6 120 | ||
131 | #define QCOM_RPM_PM8921_SMPS7 121 | ||
132 | #define QCOM_RPM_PM8921_SMPS8 122 | ||
133 | #define QCOM_RPM_PXO_CLK 123 | ||
134 | #define QCOM_RPM_QDSS_CLK 124 | ||
135 | #define QCOM_RPM_SFPB_CLK 125 | ||
136 | #define QCOM_RPM_SMI_CLK 126 | ||
137 | #define QCOM_RPM_SYS_FABRIC_ARB 127 | ||
138 | #define QCOM_RPM_SYS_FABRIC_CLK 128 | ||
139 | #define QCOM_RPM_SYS_FABRIC_HALT 129 | ||
140 | #define QCOM_RPM_SYS_FABRIC_IOCTL 130 | ||
141 | #define QCOM_RPM_SYS_FABRIC_MODE 131 | ||
142 | #define QCOM_RPM_USB_OTG_SWITCH 132 | ||
143 | #define QCOM_RPM_VDDMIN_GPIO 133 | ||
144 | |||
145 | /* | ||
146 | * Constants used to select force mode for regulators. | ||
147 | */ | ||
148 | #define QCOM_RPM_FORCE_MODE_NONE 0 | ||
149 | #define QCOM_RPM_FORCE_MODE_LPM 1 | ||
150 | #define QCOM_RPM_FORCE_MODE_HPM 2 | ||
151 | #define QCOM_RPM_FORCE_MODE_AUTO 3 | ||
152 | #define QCOM_RPM_FORCE_MODE_BYPASS 4 | ||
153 | |||
154 | #endif | ||
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index 1c75b8ca5228..13949259705a 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h | |||
@@ -61,6 +61,7 @@ | |||
61 | #define OMAP3430_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25d8) (val) | 61 | #define OMAP3430_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25d8) (val) |
62 | #define OMAP3630_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25a0) (val) | 62 | #define OMAP3630_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25a0) (val) |
63 | #define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val) | 63 | #define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val) |
64 | #define DM816X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) | ||
64 | #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) | 65 | #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) |
65 | #define AM4372_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) | 66 | #define AM4372_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) |
66 | #define DRA7XX_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x3400) (val) | 67 | #define DRA7XX_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x3400) (val) |
diff --git a/include/dt-bindings/pinctrl/sun4i-a10.h b/include/dt-bindings/pinctrl/sun4i-a10.h new file mode 100644 index 000000000000..f7553c143b40 --- /dev/null +++ b/include/dt-bindings/pinctrl/sun4i-a10.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Maxime Ripard | ||
3 | * | ||
4 | * Maxime Ripard <maxime.ripard@free-electrons.com> | ||
5 | * | ||
6 | * This file is dual-licensed: you can use it either under the terms | ||
7 | * of the GPL or the X11 license, at your option. Note that this dual | ||
8 | * licensing only applies to this file, and not this project as a | ||
9 | * whole. | ||
10 | * | ||
11 | * a) This file is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License as | ||
13 | * published by the Free Software Foundation; either version 2 of the | ||
14 | * License, or (at your option) any later version. | ||
15 | * | ||
16 | * This file is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public | ||
22 | * License along with this file; if not, write to the Free | ||
23 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | ||
24 | * MA 02110-1301 USA | ||
25 | * | ||
26 | * Or, alternatively, | ||
27 | * | ||
28 | * b) Permission is hereby granted, free of charge, to any person | ||
29 | * obtaining a copy of this software and associated documentation | ||
30 | * files (the "Software"), to deal in the Software without | ||
31 | * restriction, including without limitation the rights to use, | ||
32 | * copy, modify, merge, publish, distribute, sublicense, and/or | ||
33 | * sell copies of the Software, and to permit persons to whom the | ||
34 | * Software is furnished to do so, subject to the following | ||
35 | * conditions: | ||
36 | * | ||
37 | * The above copyright notice and this permission notice shall be | ||
38 | * included in all copies or substantial portions of the Software. | ||
39 | * | ||
40 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
41 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
42 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
43 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
44 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
45 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
46 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
47 | * OTHER DEALINGS IN THE SOFTWARE. | ||
48 | */ | ||
49 | |||
50 | #ifndef __DT_BINDINGS_PINCTRL_SUN4I_A10_H_ | ||
51 | #define __DT_BINDINGS_PINCTRL_SUN4I_A10_H_ | ||
52 | |||
53 | #define SUN4I_PINCTRL_10_MA 0 | ||
54 | #define SUN4I_PINCTRL_20_MA 1 | ||
55 | #define SUN4I_PINCTRL_30_MA 2 | ||
56 | #define SUN4I_PINCTRL_40_MA 3 | ||
57 | |||
58 | #define SUN4I_PINCTRL_NO_PULL 0 | ||
59 | #define SUN4I_PINCTRL_PULL_UP 1 | ||
60 | #define SUN4I_PINCTRL_PULL_DOWN 2 | ||
61 | |||
62 | #endif /* __DT_BINDINGS_PINCTRL_SUN4I_A10_H_ */ | ||
diff --git a/include/dt-bindings/sound/samsung-i2s.h b/include/dt-bindings/sound/samsung-i2s.h new file mode 100644 index 000000000000..0c69818d530c --- /dev/null +++ b/include/dt-bindings/sound/samsung-i2s.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _DT_BINDINGS_SAMSUNG_I2S_H | ||
2 | #define _DT_BINDINGS_SAMSUNG_I2S_H | ||
3 | |||
4 | #define CLK_I2S_CDCLK 0 | ||
5 | #define CLK_I2S_RCLK_SRC 1 | ||
6 | #define CLK_I2S_RCLK_PSR 2 | ||
7 | |||
8 | #endif /* _DT_BINDINGS_SAMSUNG_I2S_H */ | ||
diff --git a/include/linux/clk/sunxi.h b/include/dt-bindings/thermal/thermal_exynos.h index aed28c4451d9..0646500bca69 100644 --- a/include/linux/clk/sunxi.h +++ b/include/dt-bindings/thermal/thermal_exynos.h | |||
@@ -1,5 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2013 - Hans de Goede <hdegoede@redhat.com> | 2 | * thermal_exynos.h - Samsung EXYNOS TMU device tree definitions |
3 | * | ||
4 | * Copyright (C) 2014 Samsung Electronics | ||
5 | * Lukasz Majewski <l.majewski@samsung.com> | ||
3 | * | 6 | * |
4 | * This program is free software; you can redistribute it and/or modify | 7 | * 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 | 8 | * it under the terms of the GNU General Public License as published by |
@@ -10,13 +13,16 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
16 | * | ||
13 | */ | 17 | */ |
14 | 18 | ||
15 | #ifndef __LINUX_CLK_SUNXI_H_ | 19 | #ifndef _EXYNOS_THERMAL_TMU_DT_H |
16 | #define __LINUX_CLK_SUNXI_H_ | 20 | #define _EXYNOS_THERMAL_TMU_DT_H |
17 | |||
18 | #include <linux/clk.h> | ||
19 | 21 | ||
20 | void clk_sunxi_mmc_phase_control(struct clk *clk, u8 sample, u8 output); | 22 | #define TYPE_ONE_POINT_TRIMMING 0 |
23 | #define TYPE_ONE_POINT_TRIMMING_25 1 | ||
24 | #define TYPE_ONE_POINT_TRIMMING_85 2 | ||
25 | #define TYPE_TWO_POINT_TRIMMING 3 | ||
26 | #define TYPE_NONE 4 | ||
21 | 27 | ||
22 | #endif | 28 | #endif /* _EXYNOS_THERMAL_TMU_DT_H */ |
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index ac4888dc86bc..7c55dd5dd2c9 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
@@ -33,10 +33,11 @@ | |||
33 | #define VGIC_V2_MAX_LRS (1 << 6) | 33 | #define VGIC_V2_MAX_LRS (1 << 6) |
34 | #define VGIC_V3_MAX_LRS 16 | 34 | #define VGIC_V3_MAX_LRS 16 |
35 | #define VGIC_MAX_IRQS 1024 | 35 | #define VGIC_MAX_IRQS 1024 |
36 | #define VGIC_V2_MAX_CPUS 8 | ||
36 | 37 | ||
37 | /* Sanity checks... */ | 38 | /* Sanity checks... */ |
38 | #if (KVM_MAX_VCPUS > 8) | 39 | #if (KVM_MAX_VCPUS > 255) |
39 | #error Invalid number of CPU interfaces | 40 | #error Too many KVM VCPUs, the VGIC only supports up to 255 VCPUs for now |
40 | #endif | 41 | #endif |
41 | 42 | ||
42 | #if (VGIC_NR_IRQS_LEGACY & 31) | 43 | #if (VGIC_NR_IRQS_LEGACY & 31) |
@@ -132,6 +133,18 @@ struct vgic_params { | |||
132 | unsigned int maint_irq; | 133 | unsigned int maint_irq; |
133 | /* Virtual control interface base address */ | 134 | /* Virtual control interface base address */ |
134 | void __iomem *vctrl_base; | 135 | void __iomem *vctrl_base; |
136 | int max_gic_vcpus; | ||
137 | /* Only needed for the legacy KVM_CREATE_IRQCHIP */ | ||
138 | bool can_emulate_gicv2; | ||
139 | }; | ||
140 | |||
141 | struct vgic_vm_ops { | ||
142 | bool (*handle_mmio)(struct kvm_vcpu *, struct kvm_run *, | ||
143 | struct kvm_exit_mmio *); | ||
144 | bool (*queue_sgi)(struct kvm_vcpu *, int irq); | ||
145 | void (*add_sgi_source)(struct kvm_vcpu *, int irq, int source); | ||
146 | int (*init_model)(struct kvm *); | ||
147 | int (*map_resources)(struct kvm *, const struct vgic_params *); | ||
135 | }; | 148 | }; |
136 | 149 | ||
137 | struct vgic_dist { | 150 | struct vgic_dist { |
@@ -140,6 +153,9 @@ struct vgic_dist { | |||
140 | bool in_kernel; | 153 | bool in_kernel; |
141 | bool ready; | 154 | bool ready; |
142 | 155 | ||
156 | /* vGIC model the kernel emulates for the guest (GICv2 or GICv3) */ | ||
157 | u32 vgic_model; | ||
158 | |||
143 | int nr_cpus; | 159 | int nr_cpus; |
144 | int nr_irqs; | 160 | int nr_irqs; |
145 | 161 | ||
@@ -148,7 +164,11 @@ struct vgic_dist { | |||
148 | 164 | ||
149 | /* Distributor and vcpu interface mapping in the guest */ | 165 | /* Distributor and vcpu interface mapping in the guest */ |
150 | phys_addr_t vgic_dist_base; | 166 | phys_addr_t vgic_dist_base; |
151 | phys_addr_t vgic_cpu_base; | 167 | /* GICv2 and GICv3 use different mapped register blocks */ |
168 | union { | ||
169 | phys_addr_t vgic_cpu_base; | ||
170 | phys_addr_t vgic_redist_base; | ||
171 | }; | ||
152 | 172 | ||
153 | /* Distributor enabled */ | 173 | /* Distributor enabled */ |
154 | u32 enabled; | 174 | u32 enabled; |
@@ -210,8 +230,13 @@ struct vgic_dist { | |||
210 | */ | 230 | */ |
211 | struct vgic_bitmap *irq_spi_target; | 231 | struct vgic_bitmap *irq_spi_target; |
212 | 232 | ||
233 | /* Target MPIDR for each IRQ (needed for GICv3 IROUTERn) only */ | ||
234 | u32 *irq_spi_mpidr; | ||
235 | |||
213 | /* Bitmap indicating which CPU has something pending */ | 236 | /* Bitmap indicating which CPU has something pending */ |
214 | unsigned long *irq_pending_on_cpu; | 237 | unsigned long *irq_pending_on_cpu; |
238 | |||
239 | struct vgic_vm_ops vm_ops; | ||
215 | #endif | 240 | #endif |
216 | }; | 241 | }; |
217 | 242 | ||
@@ -229,6 +254,7 @@ struct vgic_v3_cpu_if { | |||
229 | #ifdef CONFIG_ARM_GIC_V3 | 254 | #ifdef CONFIG_ARM_GIC_V3 |
230 | u32 vgic_hcr; | 255 | u32 vgic_hcr; |
231 | u32 vgic_vmcr; | 256 | u32 vgic_vmcr; |
257 | u32 vgic_sre; /* Restored only, change ignored */ | ||
232 | u32 vgic_misr; /* Saved only */ | 258 | u32 vgic_misr; /* Saved only */ |
233 | u32 vgic_eisr; /* Saved only */ | 259 | u32 vgic_eisr; /* Saved only */ |
234 | u32 vgic_elrsr; /* Saved only */ | 260 | u32 vgic_elrsr; /* Saved only */ |
@@ -275,13 +301,15 @@ struct kvm_exit_mmio; | |||
275 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); | 301 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); |
276 | int kvm_vgic_hyp_init(void); | 302 | int kvm_vgic_hyp_init(void); |
277 | int kvm_vgic_map_resources(struct kvm *kvm); | 303 | int kvm_vgic_map_resources(struct kvm *kvm); |
278 | int kvm_vgic_create(struct kvm *kvm); | 304 | int kvm_vgic_get_max_vcpus(void); |
305 | int kvm_vgic_create(struct kvm *kvm, u32 type); | ||
279 | void kvm_vgic_destroy(struct kvm *kvm); | 306 | void kvm_vgic_destroy(struct kvm *kvm); |
280 | void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu); | 307 | void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu); |
281 | void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu); | 308 | void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu); |
282 | void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu); | 309 | void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu); |
283 | int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num, | 310 | int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num, |
284 | bool level); | 311 | bool level); |
312 | void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg); | ||
285 | int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu); | 313 | int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu); |
286 | bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, | 314 | bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, |
287 | struct kvm_exit_mmio *mmio); | 315 | struct kvm_exit_mmio *mmio); |
@@ -327,7 +355,7 @@ static inline int kvm_vgic_map_resources(struct kvm *kvm) | |||
327 | return 0; | 355 | return 0; |
328 | } | 356 | } |
329 | 357 | ||
330 | static inline int kvm_vgic_create(struct kvm *kvm) | 358 | static inline int kvm_vgic_create(struct kvm *kvm, u32 type) |
331 | { | 359 | { |
332 | return 0; | 360 | return 0; |
333 | } | 361 | } |
@@ -379,6 +407,11 @@ static inline bool vgic_ready(struct kvm *kvm) | |||
379 | { | 407 | { |
380 | return true; | 408 | return true; |
381 | } | 409 | } |
410 | |||
411 | static inline int kvm_vgic_get_max_vcpus(void) | ||
412 | { | ||
413 | return KVM_MAX_VCPUS; | ||
414 | } | ||
382 | #endif | 415 | #endif |
383 | 416 | ||
384 | #endif | 417 | #endif |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d459cd17b477..24c7aa8b1d20 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
30 | #include <linux/resource_ext.h> | ||
30 | #include <linux/device.h> | 31 | #include <linux/device.h> |
31 | #include <linux/property.h> | 32 | #include <linux/property.h> |
32 | 33 | ||
@@ -151,6 +152,10 @@ int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu); | |||
151 | int acpi_unmap_cpu(int cpu); | 152 | int acpi_unmap_cpu(int cpu); |
152 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 153 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
153 | 154 | ||
155 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | ||
156 | int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); | ||
157 | #endif | ||
158 | |||
154 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); | 159 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |
155 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); | 160 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); |
156 | int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base); | 161 | int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base); |
@@ -288,22 +293,25 @@ extern int pnpacpi_disabled; | |||
288 | bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res); | 293 | bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res); |
289 | bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res); | 294 | bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res); |
290 | bool acpi_dev_resource_address_space(struct acpi_resource *ares, | 295 | bool acpi_dev_resource_address_space(struct acpi_resource *ares, |
291 | struct resource *res); | 296 | struct resource_win *win); |
292 | bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares, | 297 | bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares, |
293 | struct resource *res); | 298 | struct resource_win *win); |
294 | unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable); | 299 | unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable); |
295 | bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, | 300 | bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, |
296 | struct resource *res); | 301 | struct resource *res); |
297 | 302 | ||
298 | struct resource_list_entry { | ||
299 | struct list_head node; | ||
300 | struct resource res; | ||
301 | }; | ||
302 | |||
303 | void acpi_dev_free_resource_list(struct list_head *list); | 303 | void acpi_dev_free_resource_list(struct list_head *list); |
304 | int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, | 304 | int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, |
305 | int (*preproc)(struct acpi_resource *, void *), | 305 | int (*preproc)(struct acpi_resource *, void *), |
306 | void *preproc_data); | 306 | void *preproc_data); |
307 | int acpi_dev_filter_resource_type(struct acpi_resource *ares, | ||
308 | unsigned long types); | ||
309 | |||
310 | static inline int acpi_dev_filter_resource_type_cb(struct acpi_resource *ares, | ||
311 | void *arg) | ||
312 | { | ||
313 | return acpi_dev_filter_resource_type(ares, (unsigned long)arg); | ||
314 | } | ||
307 | 315 | ||
308 | int acpi_check_resource_conflict(const struct resource *res); | 316 | int acpi_check_resource_conflict(const struct resource *res); |
309 | 317 | ||
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 642d6ae4030c..a270f25ee7c7 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
@@ -21,16 +21,20 @@ struct device; | |||
21 | struct ata_port_info; | 21 | struct ata_port_info; |
22 | struct ahci_host_priv; | 22 | struct ahci_host_priv; |
23 | struct platform_device; | 23 | struct platform_device; |
24 | struct scsi_host_template; | ||
24 | 25 | ||
25 | int ahci_platform_enable_clks(struct ahci_host_priv *hpriv); | 26 | int ahci_platform_enable_clks(struct ahci_host_priv *hpriv); |
26 | void ahci_platform_disable_clks(struct ahci_host_priv *hpriv); | 27 | void ahci_platform_disable_clks(struct ahci_host_priv *hpriv); |
28 | int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv); | ||
29 | void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv); | ||
27 | int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); | 30 | int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); |
28 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); | 31 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); |
29 | struct ahci_host_priv *ahci_platform_get_resources( | 32 | struct ahci_host_priv *ahci_platform_get_resources( |
30 | struct platform_device *pdev); | 33 | struct platform_device *pdev); |
31 | int ahci_platform_init_host(struct platform_device *pdev, | 34 | int ahci_platform_init_host(struct platform_device *pdev, |
32 | struct ahci_host_priv *hpriv, | 35 | struct ahci_host_priv *hpriv, |
33 | const struct ata_port_info *pi_template); | 36 | const struct ata_port_info *pi_template, |
37 | struct scsi_host_template *sht); | ||
34 | 38 | ||
35 | int ahci_platform_suspend_host(struct device *dev); | 39 | int ahci_platform_suspend_host(struct device *dev); |
36 | int ahci_platform_resume_host(struct device *dev); | 40 | int ahci_platform_resume_host(struct device *dev); |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 2afc618b15ce..50fc66868402 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -33,6 +33,7 @@ struct amba_device { | |||
33 | struct clk *pclk; | 33 | struct clk *pclk; |
34 | unsigned int periphid; | 34 | unsigned int periphid; |
35 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
36 | char *driver_override; | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | struct amba_driver { | 39 | struct amba_driver { |
@@ -92,11 +93,15 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int | |||
92 | int amba_request_regions(struct amba_device *, const char *); | 93 | int amba_request_regions(struct amba_device *, const char *); |
93 | void amba_release_regions(struct amba_device *); | 94 | void amba_release_regions(struct amba_device *); |
94 | 95 | ||
95 | #define amba_pclk_enable(d) \ | 96 | static inline int amba_pclk_enable(struct amba_device *dev) |
96 | (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk)) | 97 | { |
98 | return clk_enable(dev->pclk); | ||
99 | } | ||
97 | 100 | ||
98 | #define amba_pclk_disable(d) \ | 101 | static inline void amba_pclk_disable(struct amba_device *dev) |
99 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 102 | { |
103 | clk_disable(dev->pclk); | ||
104 | } | ||
100 | 105 | ||
101 | static inline int amba_pclk_prepare(struct amba_device *dev) | 106 | static inline int amba_pclk_prepare(struct amba_device *dev) |
102 | { | 107 | { |
diff --git a/include/linux/ata.h b/include/linux/ata.h index f2f4d8da97c0..1648026e06b4 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -503,7 +503,7 @@ struct ata_bmdma_prd { | |||
503 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) | 503 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) |
504 | #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) | 504 | #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) |
505 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) | 505 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) |
506 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) | 506 | #define ata_id_removable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) |
507 | #define ata_id_has_atapi_AN(id) \ | 507 | #define ata_id_has_atapi_AN(id) \ |
508 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ | 508 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ |
509 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ | 509 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ |
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h index 5c618a084225..619d9e78e644 100644 --- a/include/linux/ata_platform.h +++ b/include/linux/ata_platform.h | |||
@@ -10,12 +10,15 @@ struct pata_platform_info { | |||
10 | unsigned int ioport_shift; | 10 | unsigned int ioport_shift; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | struct scsi_host_template; | ||
14 | |||
13 | extern int __pata_platform_probe(struct device *dev, | 15 | extern int __pata_platform_probe(struct device *dev, |
14 | struct resource *io_res, | 16 | struct resource *io_res, |
15 | struct resource *ctl_res, | 17 | struct resource *ctl_res, |
16 | struct resource *irq_res, | 18 | struct resource *irq_res, |
17 | unsigned int ioport_shift, | 19 | unsigned int ioport_shift, |
18 | int __pio_mask); | 20 | int __pio_mask, |
21 | struct scsi_host_template *sht); | ||
19 | 22 | ||
20 | /* | 23 | /* |
21 | * Marvell SATA private data | 24 | * Marvell SATA private data |
diff --git a/include/linux/audit.h b/include/linux/audit.h index af84234e1f6e..c2e7e3a83965 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -46,7 +46,6 @@ struct audit_tree; | |||
46 | struct sk_buff; | 46 | struct sk_buff; |
47 | 47 | ||
48 | struct audit_krule { | 48 | struct audit_krule { |
49 | int vers_ops; | ||
50 | u32 pflags; | 49 | u32 pflags; |
51 | u32 flags; | 50 | u32 flags; |
52 | u32 listnr; | 51 | u32 listnr; |
@@ -128,7 +127,6 @@ extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1, | |||
128 | extern void __audit_syscall_exit(int ret_success, long ret_value); | 127 | extern void __audit_syscall_exit(int ret_success, long ret_value); |
129 | extern struct filename *__audit_reusename(const __user char *uptr); | 128 | extern struct filename *__audit_reusename(const __user char *uptr); |
130 | extern void __audit_getname(struct filename *name); | 129 | extern void __audit_getname(struct filename *name); |
131 | extern void audit_putname(struct filename *name); | ||
132 | 130 | ||
133 | #define AUDIT_INODE_PARENT 1 /* dentry represents the parent */ | 131 | #define AUDIT_INODE_PARENT 1 /* dentry represents the parent */ |
134 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ | 132 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ |
@@ -353,8 +351,6 @@ static inline struct filename *audit_reusename(const __user char *name) | |||
353 | } | 351 | } |
354 | static inline void audit_getname(struct filename *name) | 352 | static inline void audit_getname(struct filename *name) |
355 | { } | 353 | { } |
356 | static inline void audit_putname(struct filename *name) | ||
357 | { } | ||
358 | static inline void __audit_inode(struct filename *name, | 354 | static inline void __audit_inode(struct filename *name, |
359 | const struct dentry *dentry, | 355 | const struct dentry *dentry, |
360 | unsigned int flags) | 356 | unsigned int flags) |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 5da6012b7a14..aff923ae8c4b 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -55,6 +55,7 @@ struct bdi_writeback { | |||
55 | struct list_head b_dirty; /* dirty inodes */ | 55 | struct list_head b_dirty; /* dirty inodes */ |
56 | struct list_head b_io; /* parked for writeback */ | 56 | struct list_head b_io; /* parked for writeback */ |
57 | struct list_head b_more_io; /* parked for more writeback */ | 57 | struct list_head b_more_io; /* parked for more writeback */ |
58 | struct list_head b_dirty_time; /* time stamps are dirty */ | ||
58 | spinlock_t list_lock; /* protects the b_* lists */ | 59 | spinlock_t list_lock; /* protects the b_* lists */ |
59 | }; | 60 | }; |
60 | 61 | ||
@@ -106,6 +107,8 @@ struct backing_dev_info { | |||
106 | #endif | 107 | #endif |
107 | }; | 108 | }; |
108 | 109 | ||
110 | struct backing_dev_info *inode_to_bdi(struct inode *inode); | ||
111 | |||
109 | int __must_check bdi_init(struct backing_dev_info *bdi); | 112 | int __must_check bdi_init(struct backing_dev_info *bdi); |
110 | void bdi_destroy(struct backing_dev_info *bdi); | 113 | void bdi_destroy(struct backing_dev_info *bdi); |
111 | 114 | ||
@@ -114,7 +117,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
114 | const char *fmt, ...); | 117 | const char *fmt, ...); |
115 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 118 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
116 | void bdi_unregister(struct backing_dev_info *bdi); | 119 | void bdi_unregister(struct backing_dev_info *bdi); |
117 | int __must_check bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); | 120 | int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); |
118 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, | 121 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, |
119 | enum wb_reason reason); | 122 | enum wb_reason reason); |
120 | void bdi_start_background_writeback(struct backing_dev_info *bdi); | 123 | void bdi_start_background_writeback(struct backing_dev_info *bdi); |
@@ -228,46 +231,17 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
228 | * BDI_CAP_NO_ACCT_DIRTY: Dirty pages shouldn't contribute to accounting | 231 | * BDI_CAP_NO_ACCT_DIRTY: Dirty pages shouldn't contribute to accounting |
229 | * BDI_CAP_NO_WRITEBACK: Don't write pages back | 232 | * BDI_CAP_NO_WRITEBACK: Don't write pages back |
230 | * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages | 233 | * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages |
231 | * | ||
232 | * These flags let !MMU mmap() govern direct device mapping vs immediate | ||
233 | * copying more easily for MAP_PRIVATE, especially for ROM filesystems. | ||
234 | * | ||
235 | * BDI_CAP_MAP_COPY: Copy can be mapped (MAP_PRIVATE) | ||
236 | * BDI_CAP_MAP_DIRECT: Can be mapped directly (MAP_SHARED) | ||
237 | * BDI_CAP_READ_MAP: Can be mapped for reading | ||
238 | * BDI_CAP_WRITE_MAP: Can be mapped for writing | ||
239 | * BDI_CAP_EXEC_MAP: Can be mapped for execution | ||
240 | * | ||
241 | * BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed. | ||
242 | * | ||
243 | * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold. | 234 | * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold. |
244 | */ | 235 | */ |
245 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 | 236 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 |
246 | #define BDI_CAP_NO_WRITEBACK 0x00000002 | 237 | #define BDI_CAP_NO_WRITEBACK 0x00000002 |
247 | #define BDI_CAP_MAP_COPY 0x00000004 | 238 | #define BDI_CAP_NO_ACCT_WB 0x00000004 |
248 | #define BDI_CAP_MAP_DIRECT 0x00000008 | 239 | #define BDI_CAP_STABLE_WRITES 0x00000008 |
249 | #define BDI_CAP_READ_MAP 0x00000010 | 240 | #define BDI_CAP_STRICTLIMIT 0x00000010 |
250 | #define BDI_CAP_WRITE_MAP 0x00000020 | ||
251 | #define BDI_CAP_EXEC_MAP 0x00000040 | ||
252 | #define BDI_CAP_NO_ACCT_WB 0x00000080 | ||
253 | #define BDI_CAP_SWAP_BACKED 0x00000100 | ||
254 | #define BDI_CAP_STABLE_WRITES 0x00000200 | ||
255 | #define BDI_CAP_STRICTLIMIT 0x00000400 | ||
256 | |||
257 | #define BDI_CAP_VMFLAGS \ | ||
258 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) | ||
259 | 241 | ||
260 | #define BDI_CAP_NO_ACCT_AND_WRITEBACK \ | 242 | #define BDI_CAP_NO_ACCT_AND_WRITEBACK \ |
261 | (BDI_CAP_NO_WRITEBACK | BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_ACCT_WB) | 243 | (BDI_CAP_NO_WRITEBACK | BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_ACCT_WB) |
262 | 244 | ||
263 | #if defined(VM_MAYREAD) && \ | ||
264 | (BDI_CAP_READ_MAP != VM_MAYREAD || \ | ||
265 | BDI_CAP_WRITE_MAP != VM_MAYWRITE || \ | ||
266 | BDI_CAP_EXEC_MAP != VM_MAYEXEC) | ||
267 | #error please change backing_dev_info::capabilities flags | ||
268 | #endif | ||
269 | |||
270 | extern struct backing_dev_info default_backing_dev_info; | ||
271 | extern struct backing_dev_info noop_backing_dev_info; | 245 | extern struct backing_dev_info noop_backing_dev_info; |
272 | 246 | ||
273 | int writeback_in_progress(struct backing_dev_info *bdi); | 247 | int writeback_in_progress(struct backing_dev_info *bdi); |
@@ -329,24 +303,14 @@ static inline bool bdi_cap_account_writeback(struct backing_dev_info *bdi) | |||
329 | BDI_CAP_NO_WRITEBACK)); | 303 | BDI_CAP_NO_WRITEBACK)); |
330 | } | 304 | } |
331 | 305 | ||
332 | static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi) | ||
333 | { | ||
334 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; | ||
335 | } | ||
336 | |||
337 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) | 306 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) |
338 | { | 307 | { |
339 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); | 308 | return bdi_cap_writeback_dirty(inode_to_bdi(mapping->host)); |
340 | } | 309 | } |
341 | 310 | ||
342 | static inline bool mapping_cap_account_dirty(struct address_space *mapping) | 311 | static inline bool mapping_cap_account_dirty(struct address_space *mapping) |
343 | { | 312 | { |
344 | return bdi_cap_account_dirty(mapping->backing_dev_info); | 313 | return bdi_cap_account_dirty(inode_to_bdi(mapping->host)); |
345 | } | ||
346 | |||
347 | static inline bool mapping_cap_swap_backed(struct address_space *mapping) | ||
348 | { | ||
349 | return bdi_cap_swap_backed(mapping->backing_dev_info); | ||
350 | } | 314 | } |
351 | 315 | ||
352 | static inline int bdi_sched_wait(void *word) | 316 | static inline int bdi_sched_wait(void *word) |
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h index b708786d4cbf..5582c211f594 100644 --- a/include/linux/bcm47xx_wdt.h +++ b/include/linux/bcm47xx_wdt.h | |||
@@ -16,6 +16,7 @@ struct bcm47xx_wdt { | |||
16 | 16 | ||
17 | struct watchdog_device wdd; | 17 | struct watchdog_device wdd; |
18 | struct notifier_block notifier; | 18 | struct notifier_block notifier; |
19 | struct notifier_block restart_handler; | ||
19 | 20 | ||
20 | struct timer_list soft_timer; | 21 | struct timer_list soft_timer; |
21 | atomic_t soft_ticks; | 22 | atomic_t soft_ticks; |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index eb1c6a47b67f..994739da827f 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -318,6 +318,7 @@ struct bcma_bus { | |||
318 | const struct bcma_host_ops *ops; | 318 | const struct bcma_host_ops *ops; |
319 | 319 | ||
320 | enum bcma_hosttype hosttype; | 320 | enum bcma_hosttype hosttype; |
321 | bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */ | ||
321 | union { | 322 | union { |
322 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ | 323 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ |
323 | struct pci_dev *host_pci; | 324 | struct pci_dev *host_pci; |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index 0333e605ea0d..3f809ae372c4 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
@@ -223,6 +223,7 @@ struct bcma_drv_pci_host { | |||
223 | 223 | ||
224 | struct bcma_drv_pci { | 224 | struct bcma_drv_pci { |
225 | struct bcma_device *core; | 225 | struct bcma_device *core; |
226 | u8 early_setup_done:1; | ||
226 | u8 setup_done:1; | 227 | u8 setup_done:1; |
227 | u8 hostmode:1; | 228 | u8 hostmode:1; |
228 | 229 | ||
@@ -237,6 +238,7 @@ struct bcma_drv_pci { | |||
237 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) | 238 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) |
238 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) | 239 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) |
239 | 240 | ||
241 | extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc); | ||
240 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); | 242 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); |
241 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, | 243 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, |
242 | struct bcma_device *core, bool enable); | 244 | struct bcma_device *core, bool enable); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index e64ae7bf80a1..ebd5c1fcdea4 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -64,6 +64,8 @@ | |||
64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ | 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ |
65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ | 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ |
66 | 66 | ||
67 | #define BCMA_PCIE2_BAR0_WIN2 0x70 | ||
68 | |||
67 | /* SiliconBackplane Address Map. | 69 | /* SiliconBackplane Address Map. |
68 | * All regions may not exist on all chips. | 70 | * All regions may not exist on all chips. |
69 | */ | 71 | */ |
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h index f24d245f8394..1b5fc0c3b1b5 100644 --- a/include/linux/bcma/bcma_soc.h +++ b/include/linux/bcma/bcma_soc.h | |||
@@ -5,8 +5,6 @@ | |||
5 | 5 | ||
6 | struct bcma_soc { | 6 | struct bcma_soc { |
7 | struct bcma_bus bus; | 7 | struct bcma_bus bus; |
8 | struct bcma_device core_cc; | ||
9 | struct bcma_device core_mips; | ||
10 | }; | 8 | }; |
11 | 9 | ||
12 | int __init bcma_host_soc_register(struct bcma_soc *soc); | 10 | int __init bcma_host_soc_register(struct bcma_soc *soc); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index efead0b532c4..da3a127c9958 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -428,13 +428,9 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); | |||
428 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, | 428 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, |
429 | unsigned int, unsigned int); | 429 | unsigned int, unsigned int); |
430 | extern int bio_get_nr_vecs(struct block_device *); | 430 | extern int bio_get_nr_vecs(struct block_device *); |
431 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, | ||
432 | unsigned long, unsigned int, int, gfp_t); | ||
433 | struct sg_iovec; | ||
434 | struct rq_map_data; | 431 | struct rq_map_data; |
435 | extern struct bio *bio_map_user_iov(struct request_queue *, | 432 | extern struct bio *bio_map_user_iov(struct request_queue *, |
436 | struct block_device *, | 433 | const struct iov_iter *, gfp_t); |
437 | const struct sg_iovec *, int, int, gfp_t); | ||
438 | extern void bio_unmap_user(struct bio *); | 434 | extern void bio_unmap_user(struct bio *); |
439 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | 435 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, |
440 | gfp_t); | 436 | gfp_t); |
@@ -462,12 +458,10 @@ static inline void bio_flush_dcache_pages(struct bio *bi) | |||
462 | extern void bio_copy_data(struct bio *dst, struct bio *src); | 458 | extern void bio_copy_data(struct bio *dst, struct bio *src); |
463 | extern int bio_alloc_pages(struct bio *bio, gfp_t gfp); | 459 | extern int bio_alloc_pages(struct bio *bio, gfp_t gfp); |
464 | 460 | ||
465 | extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, | ||
466 | unsigned long, unsigned int, int, gfp_t); | ||
467 | extern struct bio *bio_copy_user_iov(struct request_queue *, | 461 | extern struct bio *bio_copy_user_iov(struct request_queue *, |
468 | struct rq_map_data *, | 462 | struct rq_map_data *, |
469 | const struct sg_iovec *, | 463 | const struct iov_iter *, |
470 | int, int, gfp_t); | 464 | gfp_t); |
471 | extern int bio_uncopy_user(struct bio *); | 465 | extern int bio_uncopy_user(struct bio *); |
472 | void zero_fill_bio(struct bio *bio); | 466 | void zero_fill_bio(struct bio *bio); |
473 | extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *); | 467 | extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *); |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 202e4034fe26..dbfbf4990005 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -52,16 +52,13 @@ | |||
52 | * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit) | 52 | * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit) |
53 | * bitmap_onto(dst, orig, relmap, nbits) *dst = orig relative to relmap | 53 | * bitmap_onto(dst, orig, relmap, nbits) *dst = orig relative to relmap |
54 | * bitmap_fold(dst, orig, sz, nbits) dst bits = orig bits mod sz | 54 | * bitmap_fold(dst, orig, sz, nbits) dst bits = orig bits mod sz |
55 | * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf | ||
56 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf | 55 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf |
57 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 56 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
58 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | ||
59 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf | 57 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf |
60 | * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf | 58 | * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf |
61 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region | 59 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region |
62 | * bitmap_release_region(bitmap, pos, order) Free specified bit region | 60 | * bitmap_release_region(bitmap, pos, order) Free specified bit region |
63 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region | 61 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region |
64 | * bitmap_print_to_pagebuf(list, buf, mask, nbits) Print bitmap src as list/hex | ||
65 | */ | 62 | */ |
66 | 63 | ||
67 | /* | 64 | /* |
@@ -96,10 +93,10 @@ extern int __bitmap_equal(const unsigned long *bitmap1, | |||
96 | const unsigned long *bitmap2, unsigned int nbits); | 93 | const unsigned long *bitmap2, unsigned int nbits); |
97 | extern void __bitmap_complement(unsigned long *dst, const unsigned long *src, | 94 | extern void __bitmap_complement(unsigned long *dst, const unsigned long *src, |
98 | unsigned int nbits); | 95 | unsigned int nbits); |
99 | extern void __bitmap_shift_right(unsigned long *dst, | 96 | extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src, |
100 | const unsigned long *src, int shift, int bits); | 97 | unsigned int shift, unsigned int nbits); |
101 | extern void __bitmap_shift_left(unsigned long *dst, | 98 | extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src, |
102 | const unsigned long *src, int shift, int bits); | 99 | unsigned int shift, unsigned int nbits); |
103 | extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, | 100 | extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, |
104 | const unsigned long *bitmap2, unsigned int nbits); | 101 | const unsigned long *bitmap2, unsigned int nbits); |
105 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | 102 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, |
@@ -147,31 +144,31 @@ bitmap_find_next_zero_area(unsigned long *map, | |||
147 | align_mask, 0); | 144 | align_mask, 0); |
148 | } | 145 | } |
149 | 146 | ||
150 | extern int bitmap_scnprintf(char *buf, unsigned int len, | ||
151 | const unsigned long *src, int nbits); | ||
152 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | 147 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, |
153 | unsigned long *dst, int nbits); | 148 | unsigned long *dst, int nbits); |
154 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, | 149 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, |
155 | unsigned long *dst, int nbits); | 150 | unsigned long *dst, int nbits); |
156 | extern int bitmap_scnlistprintf(char *buf, unsigned int len, | ||
157 | const unsigned long *src, int nbits); | ||
158 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, | 151 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, |
159 | int nmaskbits); | 152 | int nmaskbits); |
160 | extern int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen, | 153 | extern int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen, |
161 | unsigned long *dst, int nbits); | 154 | unsigned long *dst, int nbits); |
162 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, | 155 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, |
163 | const unsigned long *old, const unsigned long *new, int bits); | 156 | const unsigned long *old, const unsigned long *new, unsigned int nbits); |
164 | extern int bitmap_bitremap(int oldbit, | 157 | extern int bitmap_bitremap(int oldbit, |
165 | const unsigned long *old, const unsigned long *new, int bits); | 158 | const unsigned long *old, const unsigned long *new, int bits); |
166 | extern void bitmap_onto(unsigned long *dst, const unsigned long *orig, | 159 | extern void bitmap_onto(unsigned long *dst, const unsigned long *orig, |
167 | const unsigned long *relmap, int bits); | 160 | const unsigned long *relmap, unsigned int bits); |
168 | extern void bitmap_fold(unsigned long *dst, const unsigned long *orig, | 161 | extern void bitmap_fold(unsigned long *dst, const unsigned long *orig, |
169 | int sz, int bits); | 162 | unsigned int sz, unsigned int nbits); |
170 | extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order); | 163 | extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order); |
171 | extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order); | 164 | extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order); |
172 | extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order); | 165 | extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order); |
173 | extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); | 166 | #ifdef __BIG_ENDIAN |
174 | extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits); | 167 | extern void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits); |
168 | #else | ||
169 | #define bitmap_copy_le bitmap_copy | ||
170 | #endif | ||
171 | extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits); | ||
175 | extern int bitmap_print_to_pagebuf(bool list, char *buf, | 172 | extern int bitmap_print_to_pagebuf(bool list, char *buf, |
176 | const unsigned long *maskp, int nmaskbits); | 173 | const unsigned long *maskp, int nmaskbits); |
177 | 174 | ||
@@ -185,33 +182,33 @@ extern int bitmap_print_to_pagebuf(bool list, char *buf, | |||
185 | #define small_const_nbits(nbits) \ | 182 | #define small_const_nbits(nbits) \ |
186 | (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) | 183 | (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) |
187 | 184 | ||
188 | static inline void bitmap_zero(unsigned long *dst, int nbits) | 185 | static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) |
189 | { | 186 | { |
190 | if (small_const_nbits(nbits)) | 187 | if (small_const_nbits(nbits)) |
191 | *dst = 0UL; | 188 | *dst = 0UL; |
192 | else { | 189 | else { |
193 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); | 190 | unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); |
194 | memset(dst, 0, len); | 191 | memset(dst, 0, len); |
195 | } | 192 | } |
196 | } | 193 | } |
197 | 194 | ||
198 | static inline void bitmap_fill(unsigned long *dst, int nbits) | 195 | static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) |
199 | { | 196 | { |
200 | size_t nlongs = BITS_TO_LONGS(nbits); | 197 | unsigned int nlongs = BITS_TO_LONGS(nbits); |
201 | if (!small_const_nbits(nbits)) { | 198 | if (!small_const_nbits(nbits)) { |
202 | int len = (nlongs - 1) * sizeof(unsigned long); | 199 | unsigned int len = (nlongs - 1) * sizeof(unsigned long); |
203 | memset(dst, 0xff, len); | 200 | memset(dst, 0xff, len); |
204 | } | 201 | } |
205 | dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); | 202 | dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); |
206 | } | 203 | } |
207 | 204 | ||
208 | static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, | 205 | static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, |
209 | int nbits) | 206 | unsigned int nbits) |
210 | { | 207 | { |
211 | if (small_const_nbits(nbits)) | 208 | if (small_const_nbits(nbits)) |
212 | *dst = *src; | 209 | *dst = *src; |
213 | else { | 210 | else { |
214 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); | 211 | unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); |
215 | memcpy(dst, src, len); | 212 | memcpy(dst, src, len); |
216 | } | 213 | } |
217 | } | 214 | } |
@@ -309,22 +306,22 @@ static inline int bitmap_weight(const unsigned long *src, unsigned int nbits) | |||
309 | return __bitmap_weight(src, nbits); | 306 | return __bitmap_weight(src, nbits); |
310 | } | 307 | } |
311 | 308 | ||
312 | static inline void bitmap_shift_right(unsigned long *dst, | 309 | static inline void bitmap_shift_right(unsigned long *dst, const unsigned long *src, |
313 | const unsigned long *src, int n, int nbits) | 310 | unsigned int shift, int nbits) |
314 | { | 311 | { |
315 | if (small_const_nbits(nbits)) | 312 | if (small_const_nbits(nbits)) |
316 | *dst = (*src & BITMAP_LAST_WORD_MASK(nbits)) >> n; | 313 | *dst = (*src & BITMAP_LAST_WORD_MASK(nbits)) >> shift; |
317 | else | 314 | else |
318 | __bitmap_shift_right(dst, src, n, nbits); | 315 | __bitmap_shift_right(dst, src, shift, nbits); |
319 | } | 316 | } |
320 | 317 | ||
321 | static inline void bitmap_shift_left(unsigned long *dst, | 318 | static inline void bitmap_shift_left(unsigned long *dst, const unsigned long *src, |
322 | const unsigned long *src, int n, int nbits) | 319 | unsigned int shift, unsigned int nbits) |
323 | { | 320 | { |
324 | if (small_const_nbits(nbits)) | 321 | if (small_const_nbits(nbits)) |
325 | *dst = (*src << n) & BITMAP_LAST_WORD_MASK(nbits); | 322 | *dst = (*src << shift) & BITMAP_LAST_WORD_MASK(nbits); |
326 | else | 323 | else |
327 | __bitmap_shift_left(dst, src, n, nbits); | 324 | __bitmap_shift_left(dst, src, shift, nbits); |
328 | } | 325 | } |
329 | 326 | ||
330 | static inline int bitmap_parse(const char *buf, unsigned int buflen, | 327 | static inline int bitmap_parse(const char *buf, unsigned int buflen, |
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h index 7ffe03f4693d..fb790b8449c1 100644 --- a/include/linux/bitrev.h +++ b/include/linux/bitrev.h | |||
@@ -3,14 +3,83 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | extern u8 const byte_rev_table[256]; | 6 | #ifdef CONFIG_HAVE_ARCH_BITREVERSE |
7 | #include <asm/bitrev.h> | ||
8 | |||
9 | #define __bitrev32 __arch_bitrev32 | ||
10 | #define __bitrev16 __arch_bitrev16 | ||
11 | #define __bitrev8 __arch_bitrev8 | ||
7 | 12 | ||
8 | static inline u8 bitrev8(u8 byte) | 13 | #else |
14 | extern u8 const byte_rev_table[256]; | ||
15 | static inline u8 __bitrev8(u8 byte) | ||
9 | { | 16 | { |
10 | return byte_rev_table[byte]; | 17 | return byte_rev_table[byte]; |
11 | } | 18 | } |
12 | 19 | ||
13 | extern u16 bitrev16(u16 in); | 20 | static inline u16 __bitrev16(u16 x) |
14 | extern u32 bitrev32(u32 in); | 21 | { |
22 | return (__bitrev8(x & 0xff) << 8) | __bitrev8(x >> 8); | ||
23 | } | ||
24 | |||
25 | static inline u32 __bitrev32(u32 x) | ||
26 | { | ||
27 | return (__bitrev16(x & 0xffff) << 16) | __bitrev16(x >> 16); | ||
28 | } | ||
29 | |||
30 | #endif /* CONFIG_HAVE_ARCH_BITREVERSE */ | ||
31 | |||
32 | #define __constant_bitrev32(x) \ | ||
33 | ({ \ | ||
34 | u32 __x = x; \ | ||
35 | __x = (__x >> 16) | (__x << 16); \ | ||
36 | __x = ((__x & (u32)0xFF00FF00UL) >> 8) | ((__x & (u32)0x00FF00FFUL) << 8); \ | ||
37 | __x = ((__x & (u32)0xF0F0F0F0UL) >> 4) | ((__x & (u32)0x0F0F0F0FUL) << 4); \ | ||
38 | __x = ((__x & (u32)0xCCCCCCCCUL) >> 2) | ((__x & (u32)0x33333333UL) << 2); \ | ||
39 | __x = ((__x & (u32)0xAAAAAAAAUL) >> 1) | ((__x & (u32)0x55555555UL) << 1); \ | ||
40 | __x; \ | ||
41 | }) | ||
42 | |||
43 | #define __constant_bitrev16(x) \ | ||
44 | ({ \ | ||
45 | u16 __x = x; \ | ||
46 | __x = (__x >> 8) | (__x << 8); \ | ||
47 | __x = ((__x & (u16)0xF0F0U) >> 4) | ((__x & (u16)0x0F0FU) << 4); \ | ||
48 | __x = ((__x & (u16)0xCCCCU) >> 2) | ((__x & (u16)0x3333U) << 2); \ | ||
49 | __x = ((__x & (u16)0xAAAAU) >> 1) | ((__x & (u16)0x5555U) << 1); \ | ||
50 | __x; \ | ||
51 | }) | ||
52 | |||
53 | #define __constant_bitrev8(x) \ | ||
54 | ({ \ | ||
55 | u8 __x = x; \ | ||
56 | __x = (__x >> 4) | (__x << 4); \ | ||
57 | __x = ((__x & (u8)0xCCU) >> 2) | ((__x & (u8)0x33U) << 2); \ | ||
58 | __x = ((__x & (u8)0xAAU) >> 1) | ((__x & (u8)0x55U) << 1); \ | ||
59 | __x; \ | ||
60 | }) | ||
61 | |||
62 | #define bitrev32(x) \ | ||
63 | ({ \ | ||
64 | u32 __x = x; \ | ||
65 | __builtin_constant_p(__x) ? \ | ||
66 | __constant_bitrev32(__x) : \ | ||
67 | __bitrev32(__x); \ | ||
68 | }) | ||
69 | |||
70 | #define bitrev16(x) \ | ||
71 | ({ \ | ||
72 | u16 __x = x; \ | ||
73 | __builtin_constant_p(__x) ? \ | ||
74 | __constant_bitrev16(__x) : \ | ||
75 | __bitrev16(__x); \ | ||
76 | }) | ||
15 | 77 | ||
78 | #define bitrev8(x) \ | ||
79 | ({ \ | ||
80 | u8 __x = x; \ | ||
81 | __builtin_constant_p(__x) ? \ | ||
82 | __constant_bitrev8(__x) : \ | ||
83 | __bitrev8(__x) ; \ | ||
84 | }) | ||
16 | #endif /* _LINUX_BITREV_H */ | 85 | #endif /* _LINUX_BITREV_H */ |
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 5735e7130d63..7aec86127335 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -146,6 +146,8 @@ enum { | |||
146 | BLK_MQ_F_SG_MERGE = 1 << 2, | 146 | BLK_MQ_F_SG_MERGE = 1 << 2, |
147 | BLK_MQ_F_SYSFS_UP = 1 << 3, | 147 | BLK_MQ_F_SYSFS_UP = 1 << 3, |
148 | BLK_MQ_F_DEFER_ISSUE = 1 << 4, | 148 | BLK_MQ_F_DEFER_ISSUE = 1 << 4, |
149 | BLK_MQ_F_ALLOC_POLICY_START_BIT = 8, | ||
150 | BLK_MQ_F_ALLOC_POLICY_BITS = 1, | ||
149 | 151 | ||
150 | BLK_MQ_S_STOPPED = 0, | 152 | BLK_MQ_S_STOPPED = 0, |
151 | BLK_MQ_S_TAG_ACTIVE = 1, | 153 | BLK_MQ_S_TAG_ACTIVE = 1, |
@@ -154,6 +156,12 @@ enum { | |||
154 | 156 | ||
155 | BLK_MQ_CPU_WORK_BATCH = 8, | 157 | BLK_MQ_CPU_WORK_BATCH = 8, |
156 | }; | 158 | }; |
159 | #define BLK_MQ_FLAG_TO_ALLOC_POLICY(flags) \ | ||
160 | ((flags >> BLK_MQ_F_ALLOC_POLICY_START_BIT) & \ | ||
161 | ((1 << BLK_MQ_F_ALLOC_POLICY_BITS) - 1)) | ||
162 | #define BLK_ALLOC_POLICY_TO_MQ_FLAG(policy) \ | ||
163 | ((policy & ((1 << BLK_MQ_F_ALLOC_POLICY_BITS) - 1)) \ | ||
164 | << BLK_MQ_F_ALLOC_POLICY_START_BIT) | ||
157 | 165 | ||
158 | struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *); | 166 | struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *); |
159 | void blk_mq_finish_init(struct request_queue *q); | 167 | void blk_mq_finish_init(struct request_queue *q); |
@@ -166,7 +174,6 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set); | |||
166 | void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); | 174 | void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); |
167 | 175 | ||
168 | void blk_mq_insert_request(struct request *, bool, bool, bool); | 176 | void blk_mq_insert_request(struct request *, bool, bool, bool); |
169 | void blk_mq_run_queues(struct request_queue *q, bool async); | ||
170 | void blk_mq_free_request(struct request *rq); | 177 | void blk_mq_free_request(struct request *rq); |
171 | void blk_mq_free_hctx_request(struct blk_mq_hw_ctx *, struct request *rq); | 178 | void blk_mq_free_hctx_request(struct blk_mq_hw_ctx *, struct request *rq); |
172 | bool blk_mq_can_queue(struct blk_mq_hw_ctx *); | 179 | bool blk_mq_can_queue(struct blk_mq_hw_ctx *); |
@@ -214,6 +221,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async); | |||
214 | void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs); | 221 | void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs); |
215 | void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn, | 222 | void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn, |
216 | void *priv); | 223 | void *priv); |
224 | void blk_mq_freeze_queue(struct request_queue *q); | ||
217 | void blk_mq_unfreeze_queue(struct request_queue *q); | 225 | void blk_mq_unfreeze_queue(struct request_queue *q); |
218 | void blk_mq_freeze_queue_start(struct request_queue *q); | 226 | void blk_mq_freeze_queue_start(struct request_queue *q); |
219 | 227 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 92f4b4b288dd..7f9a516f24de 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -272,7 +272,11 @@ struct blk_queue_tag { | |||
272 | int max_depth; /* what we will send to device */ | 272 | int max_depth; /* what we will send to device */ |
273 | int real_max_depth; /* what the array can hold */ | 273 | int real_max_depth; /* what the array can hold */ |
274 | atomic_t refcnt; /* map can be shared */ | 274 | atomic_t refcnt; /* map can be shared */ |
275 | int alloc_policy; /* tag allocation policy */ | ||
276 | int next_tag; /* next tag */ | ||
275 | }; | 277 | }; |
278 | #define BLK_TAG_ALLOC_FIFO 0 /* allocate starting from 0 */ | ||
279 | #define BLK_TAG_ALLOC_RR 1 /* allocate starting from last allocated tag */ | ||
276 | 280 | ||
277 | #define BLK_SCSI_MAX_CMDS (256) | 281 | #define BLK_SCSI_MAX_CMDS (256) |
278 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 282 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
@@ -516,6 +520,7 @@ struct request_queue { | |||
516 | (1 << QUEUE_FLAG_ADD_RANDOM)) | 520 | (1 << QUEUE_FLAG_ADD_RANDOM)) |
517 | 521 | ||
518 | #define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 522 | #define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
523 | (1 << QUEUE_FLAG_STACKABLE) | \ | ||
519 | (1 << QUEUE_FLAG_SAME_COMP)) | 524 | (1 << QUEUE_FLAG_SAME_COMP)) |
520 | 525 | ||
521 | static inline void queue_lockdep_assert_held(struct request_queue *q) | 526 | static inline void queue_lockdep_assert_held(struct request_queue *q) |
@@ -850,8 +855,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *, | |||
850 | extern int blk_rq_unmap_user(struct bio *); | 855 | extern int blk_rq_unmap_user(struct bio *); |
851 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); | 856 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); |
852 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, | 857 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, |
853 | struct rq_map_data *, const struct sg_iovec *, | 858 | struct rq_map_data *, const struct iov_iter *, |
854 | int, unsigned int, gfp_t); | 859 | gfp_t); |
855 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, | 860 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, |
856 | struct request *, int); | 861 | struct request *, int); |
857 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 862 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
@@ -1044,8 +1049,6 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); | |||
1044 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 1049 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
1045 | 1050 | ||
1046 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 1051 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
1047 | extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio, | ||
1048 | struct scatterlist *sglist); | ||
1049 | extern void blk_dump_rq_flags(struct request *, char *); | 1052 | extern void blk_dump_rq_flags(struct request *, char *); |
1050 | extern long nr_blockdev_pages(void); | 1053 | extern long nr_blockdev_pages(void); |
1051 | 1054 | ||
@@ -1139,11 +1142,11 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) | |||
1139 | extern int blk_queue_start_tag(struct request_queue *, struct request *); | 1142 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
1140 | extern struct request *blk_queue_find_tag(struct request_queue *, int); | 1143 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
1141 | extern void blk_queue_end_tag(struct request_queue *, struct request *); | 1144 | extern void blk_queue_end_tag(struct request_queue *, struct request *); |
1142 | extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *); | 1145 | extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *, int); |
1143 | extern void blk_queue_free_tags(struct request_queue *); | 1146 | extern void blk_queue_free_tags(struct request_queue *); |
1144 | extern int blk_queue_resize_tags(struct request_queue *, int); | 1147 | extern int blk_queue_resize_tags(struct request_queue *, int); |
1145 | extern void blk_queue_invalidate_tags(struct request_queue *); | 1148 | extern void blk_queue_invalidate_tags(struct request_queue *); |
1146 | extern struct blk_queue_tag *blk_init_tags(int); | 1149 | extern struct blk_queue_tag *blk_init_tags(int, int); |
1147 | extern void blk_free_tags(struct blk_queue_tag *); | 1150 | extern void blk_free_tags(struct blk_queue_tag *); |
1148 | 1151 | ||
1149 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | 1152 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, |
@@ -1162,7 +1165,7 @@ extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, | |||
1162 | extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector, | 1165 | extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector, |
1163 | sector_t nr_sects, gfp_t gfp_mask, struct page *page); | 1166 | sector_t nr_sects, gfp_t gfp_mask, struct page *page); |
1164 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, | 1167 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, |
1165 | sector_t nr_sects, gfp_t gfp_mask); | 1168 | sector_t nr_sects, gfp_t gfp_mask, bool discard); |
1166 | static inline int sb_issue_discard(struct super_block *sb, sector_t block, | 1169 | static inline int sb_issue_discard(struct super_block *sb, sector_t block, |
1167 | sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags) | 1170 | sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags) |
1168 | { | 1171 | { |
@@ -1176,7 +1179,7 @@ static inline int sb_issue_zeroout(struct super_block *sb, sector_t block, | |||
1176 | return blkdev_issue_zeroout(sb->s_bdev, | 1179 | return blkdev_issue_zeroout(sb->s_bdev, |
1177 | block << (sb->s_blocksize_bits - 9), | 1180 | block << (sb->s_blocksize_bits - 9), |
1178 | nr_blocks << (sb->s_blocksize_bits - 9), | 1181 | nr_blocks << (sb->s_blocksize_bits - 9), |
1179 | gfp_mask); | 1182 | gfp_mask, true); |
1180 | } | 1183 | } |
1181 | 1184 | ||
1182 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 1185 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
@@ -1601,8 +1604,8 @@ struct block_device_operations { | |||
1601 | int (*rw_page)(struct block_device *, sector_t, struct page *, int rw); | 1604 | int (*rw_page)(struct block_device *, sector_t, struct page *, int rw); |
1602 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1605 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1603 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1606 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1604 | int (*direct_access) (struct block_device *, sector_t, | 1607 | long (*direct_access)(struct block_device *, sector_t, |
1605 | void **, unsigned long *); | 1608 | void **, unsigned long *pfn, long size); |
1606 | unsigned int (*check_events) (struct gendisk *disk, | 1609 | unsigned int (*check_events) (struct gendisk *disk, |
1607 | unsigned int clearing); | 1610 | unsigned int clearing); |
1608 | /* ->media_changed() is DEPRECATED, use ->check_events() instead */ | 1611 | /* ->media_changed() is DEPRECATED, use ->check_events() instead */ |
@@ -1620,6 +1623,8 @@ extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, | |||
1620 | extern int bdev_read_page(struct block_device *, sector_t, struct page *); | 1623 | extern int bdev_read_page(struct block_device *, sector_t, struct page *); |
1621 | extern int bdev_write_page(struct block_device *, sector_t, struct page *, | 1624 | extern int bdev_write_page(struct block_device *, sector_t, struct page *, |
1622 | struct writeback_control *); | 1625 | struct writeback_control *); |
1626 | extern long bdev_direct_access(struct block_device *, sector_t, void **addr, | ||
1627 | unsigned long *pfn, long size); | ||
1623 | #else /* CONFIG_BLOCK */ | 1628 | #else /* CONFIG_BLOCK */ |
1624 | 1629 | ||
1625 | struct block_device; | 1630 | struct block_device; |
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index fb4591977b03..f8763615a5f2 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -30,6 +30,4 @@ void cdev_del(struct cdev *); | |||
30 | 30 | ||
31 | void cd_forget(struct inode *); | 31 | void cd_forget(struct inode *); |
32 | 32 | ||
33 | extern struct backing_dev_info directly_mappable_cdev_bdi; | ||
34 | |||
35 | #endif | 33 | #endif |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index c0dadaac26e3..31eb03d0c766 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -158,17 +158,6 @@ enum { | |||
158 | }; | 158 | }; |
159 | 159 | ||
160 | 160 | ||
161 | /* pool operations */ | ||
162 | enum { | ||
163 | POOL_OP_CREATE = 0x01, | ||
164 | POOL_OP_DELETE = 0x02, | ||
165 | POOL_OP_AUID_CHANGE = 0x03, | ||
166 | POOL_OP_CREATE_SNAP = 0x11, | ||
167 | POOL_OP_DELETE_SNAP = 0x12, | ||
168 | POOL_OP_CREATE_UNMANAGED_SNAP = 0x21, | ||
169 | POOL_OP_DELETE_UNMANAGED_SNAP = 0x22, | ||
170 | }; | ||
171 | |||
172 | struct ceph_mon_request_header { | 161 | struct ceph_mon_request_header { |
173 | __le64 have_version; | 162 | __le64 have_version; |
174 | __le16 session_mon; | 163 | __le16 session_mon; |
@@ -191,31 +180,6 @@ struct ceph_mon_statfs_reply { | |||
191 | struct ceph_statfs st; | 180 | struct ceph_statfs st; |
192 | } __attribute__ ((packed)); | 181 | } __attribute__ ((packed)); |
193 | 182 | ||
194 | const char *ceph_pool_op_name(int op); | ||
195 | |||
196 | struct ceph_mon_poolop { | ||
197 | struct ceph_mon_request_header monhdr; | ||
198 | struct ceph_fsid fsid; | ||
199 | __le32 pool; | ||
200 | __le32 op; | ||
201 | __le64 auid; | ||
202 | __le64 snapid; | ||
203 | __le32 name_len; | ||
204 | } __attribute__ ((packed)); | ||
205 | |||
206 | struct ceph_mon_poolop_reply { | ||
207 | struct ceph_mon_request_header monhdr; | ||
208 | struct ceph_fsid fsid; | ||
209 | __le32 reply_code; | ||
210 | __le32 epoch; | ||
211 | char has_data; | ||
212 | char data[0]; | ||
213 | } __attribute__ ((packed)); | ||
214 | |||
215 | struct ceph_mon_unmanaged_snap { | ||
216 | __le64 snapid; | ||
217 | } __attribute__ ((packed)); | ||
218 | |||
219 | struct ceph_osd_getmap { | 183 | struct ceph_osd_getmap { |
220 | struct ceph_mon_request_header monhdr; | 184 | struct ceph_mon_request_header monhdr; |
221 | struct ceph_fsid fsid; | 185 | struct ceph_fsid fsid; |
@@ -307,6 +271,7 @@ enum { | |||
307 | CEPH_SESSION_RECALL_STATE, | 271 | CEPH_SESSION_RECALL_STATE, |
308 | CEPH_SESSION_FLUSHMSG, | 272 | CEPH_SESSION_FLUSHMSG, |
309 | CEPH_SESSION_FLUSHMSG_ACK, | 273 | CEPH_SESSION_FLUSHMSG_ACK, |
274 | CEPH_SESSION_FORCE_RO, | ||
310 | }; | 275 | }; |
311 | 276 | ||
312 | extern const char *ceph_session_op_name(int op); | 277 | extern const char *ceph_session_op_name(int op); |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 8b11a79ca1cb..16fff9608848 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -30,8 +30,9 @@ | |||
30 | #define CEPH_OPT_MYIP (1<<2) /* specified my ip */ | 30 | #define CEPH_OPT_MYIP (1<<2) /* specified my ip */ |
31 | #define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ | 31 | #define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ |
32 | #define CEPH_OPT_NOMSGAUTH (1<<4) /* not require cephx message signature */ | 32 | #define CEPH_OPT_NOMSGAUTH (1<<4) /* not require cephx message signature */ |
33 | #define CEPH_OPT_TCP_NODELAY (1<<5) /* TCP_NODELAY on TCP sockets */ | ||
33 | 34 | ||
34 | #define CEPH_OPT_DEFAULT (0) | 35 | #define CEPH_OPT_DEFAULT (CEPH_OPT_TCP_NODELAY) |
35 | 36 | ||
36 | #define ceph_set_opt(client, opt) \ | 37 | #define ceph_set_opt(client, opt) \ |
37 | (client)->options->flags |= CEPH_OPT_##opt; | 38 | (client)->options->flags |= CEPH_OPT_##opt; |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index d9d396c16503..e15499422fdc 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -57,6 +57,7 @@ struct ceph_messenger { | |||
57 | 57 | ||
58 | atomic_t stopping; | 58 | atomic_t stopping; |
59 | bool nocrc; | 59 | bool nocrc; |
60 | bool tcp_nodelay; | ||
60 | 61 | ||
61 | /* | 62 | /* |
62 | * the global_seq counts connections i (attempt to) initiate | 63 | * the global_seq counts connections i (attempt to) initiate |
@@ -264,7 +265,8 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr, | |||
264 | struct ceph_entity_addr *myaddr, | 265 | struct ceph_entity_addr *myaddr, |
265 | u64 supported_features, | 266 | u64 supported_features, |
266 | u64 required_features, | 267 | u64 required_features, |
267 | bool nocrc); | 268 | bool nocrc, |
269 | bool tcp_nodelay); | ||
268 | 270 | ||
269 | extern void ceph_con_init(struct ceph_connection *con, void *private, | 271 | extern void ceph_con_init(struct ceph_connection *con, void *private, |
270 | const struct ceph_connection_operations *ops, | 272 | const struct ceph_connection_operations *ops, |
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h index deb47e45ac7c..81810dc21f06 100644 --- a/include/linux/ceph/mon_client.h +++ b/include/linux/ceph/mon_client.h | |||
@@ -40,7 +40,7 @@ struct ceph_mon_request { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * ceph_mon_generic_request is being used for the statfs, poolop and | 43 | * ceph_mon_generic_request is being used for the statfs and |
44 | * mon_get_version requests which are being done a bit differently | 44 | * mon_get_version requests which are being done a bit differently |
45 | * because we need to get data back to the caller | 45 | * because we need to get data back to the caller |
46 | */ | 46 | */ |
@@ -50,7 +50,6 @@ struct ceph_mon_generic_request { | |||
50 | struct rb_node node; | 50 | struct rb_node node; |
51 | int result; | 51 | int result; |
52 | void *buf; | 52 | void *buf; |
53 | int buf_len; | ||
54 | struct completion completion; | 53 | struct completion completion; |
55 | struct ceph_msg *request; /* original request */ | 54 | struct ceph_msg *request; /* original request */ |
56 | struct ceph_msg *reply; /* and reply */ | 55 | struct ceph_msg *reply; /* and reply */ |
@@ -117,10 +116,4 @@ extern int ceph_monc_open_session(struct ceph_mon_client *monc); | |||
117 | 116 | ||
118 | extern int ceph_monc_validate_auth(struct ceph_mon_client *monc); | 117 | extern int ceph_monc_validate_auth(struct ceph_mon_client *monc); |
119 | 118 | ||
120 | extern int ceph_monc_create_snapid(struct ceph_mon_client *monc, | ||
121 | u32 pool, u64 *snapid); | ||
122 | |||
123 | extern int ceph_monc_delete_snapid(struct ceph_mon_client *monc, | ||
124 | u32 pool, u64 snapid); | ||
125 | |||
126 | #endif | 119 | #endif |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index da0dae0600e6..b9cb94c3102a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -943,6 +943,8 @@ struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry, | |||
943 | 943 | ||
944 | #else /* !CONFIG_CGROUPS */ | 944 | #else /* !CONFIG_CGROUPS */ |
945 | 945 | ||
946 | struct cgroup_subsys_state; | ||
947 | |||
946 | static inline int cgroup_init_early(void) { return 0; } | 948 | static inline int cgroup_init_early(void) { return 0; } |
947 | static inline int cgroup_init(void) { return 0; } | 949 | static inline int cgroup_init(void) { return 0; } |
948 | static inline void cgroup_fork(struct task_struct *p) {} | 950 | static inline void cgroup_fork(struct task_struct *p) {} |
@@ -955,6 +957,8 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
955 | return -EINVAL; | 957 | return -EINVAL; |
956 | } | 958 | } |
957 | 959 | ||
960 | static inline void css_put(struct cgroup_subsys_state *css) {} | ||
961 | |||
958 | /* No cgroups - nothing to do */ | 962 | /* No cgroups - nothing to do */ |
959 | static inline int cgroup_attach_task_all(struct task_struct *from, | 963 | static inline int cgroup_attach_task_all(struct task_struct *from, |
960 | struct task_struct *t) | 964 | struct task_struct *t) |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 98c4f9b12b03..e4a96fb14403 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -15,6 +15,10 @@ SUBSYS(cpu) | |||
15 | SUBSYS(cpuacct) | 15 | SUBSYS(cpuacct) |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | #if IS_ENABLED(CONFIG_BLK_CGROUP) | ||
19 | SUBSYS(blkio) | ||
20 | #endif | ||
21 | |||
18 | #if IS_ENABLED(CONFIG_MEMCG) | 22 | #if IS_ENABLED(CONFIG_MEMCG) |
19 | SUBSYS(memory) | 23 | SUBSYS(memory) |
20 | #endif | 24 | #endif |
@@ -31,10 +35,6 @@ SUBSYS(freezer) | |||
31 | SUBSYS(net_cls) | 35 | SUBSYS(net_cls) |
32 | #endif | 36 | #endif |
33 | 37 | ||
34 | #if IS_ENABLED(CONFIG_BLK_CGROUP) | ||
35 | SUBSYS(blkio) | ||
36 | #endif | ||
37 | |||
38 | #if IS_ENABLED(CONFIG_CGROUP_PERF) | 38 | #if IS_ENABLED(CONFIG_CGROUP_PERF) |
39 | SUBSYS(perf_event) | 39 | SUBSYS(perf_event) |
40 | #endif | 40 | #endif |
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h deleted file mode 100644 index 0ca5f6046920..000000000000 --- a/include/linux/clk-private.h +++ /dev/null | |||
@@ -1,220 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/clk-private.h | ||
3 | * | ||
4 | * Copyright (c) 2010-2011 Jeremy Kerr <jeremy.kerr@canonical.com> | ||
5 | * Copyright (C) 2011-2012 Linaro Ltd <mturquette@linaro.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __LINUX_CLK_PRIVATE_H | ||
12 | #define __LINUX_CLK_PRIVATE_H | ||
13 | |||
14 | #include <linux/clk-provider.h> | ||
15 | #include <linux/kref.h> | ||
16 | #include <linux/list.h> | ||
17 | |||
18 | /* | ||
19 | * WARNING: Do not include clk-private.h from any file that implements struct | ||
20 | * clk_ops. Doing so is a layering violation! | ||
21 | * | ||
22 | * This header exists only to allow for statically initialized clock data. Any | ||
23 | * static clock data must be defined in a separate file from the logic that | ||
24 | * implements the clock operations for that same data. | ||
25 | */ | ||
26 | |||
27 | #ifdef CONFIG_COMMON_CLK | ||
28 | |||
29 | struct module; | ||
30 | |||
31 | struct clk { | ||
32 | const char *name; | ||
33 | const struct clk_ops *ops; | ||
34 | struct clk_hw *hw; | ||
35 | struct module *owner; | ||
36 | struct clk *parent; | ||
37 | const char **parent_names; | ||
38 | struct clk **parents; | ||
39 | u8 num_parents; | ||
40 | u8 new_parent_index; | ||
41 | unsigned long rate; | ||
42 | unsigned long new_rate; | ||
43 | struct clk *new_parent; | ||
44 | struct clk *new_child; | ||
45 | unsigned long flags; | ||
46 | unsigned int enable_count; | ||
47 | unsigned int prepare_count; | ||
48 | unsigned long accuracy; | ||
49 | int phase; | ||
50 | struct hlist_head children; | ||
51 | struct hlist_node child_node; | ||
52 | struct hlist_node debug_node; | ||
53 | unsigned int notifier_count; | ||
54 | #ifdef CONFIG_DEBUG_FS | ||
55 | struct dentry *dentry; | ||
56 | #endif | ||
57 | struct kref ref; | ||
58 | }; | ||
59 | |||
60 | /* | ||
61 | * DOC: Basic clock implementations common to many platforms | ||
62 | * | ||
63 | * Each basic clock hardware type is comprised of a structure describing the | ||
64 | * clock hardware, implementations of the relevant callbacks in struct clk_ops, | ||
65 | * unique flags for that hardware type, a registration function and an | ||
66 | * alternative macro for static initialization | ||
67 | */ | ||
68 | |||
69 | #define DEFINE_CLK(_name, _ops, _flags, _parent_names, \ | ||
70 | _parents) \ | ||
71 | static struct clk _name = { \ | ||
72 | .name = #_name, \ | ||
73 | .ops = &_ops, \ | ||
74 | .hw = &_name##_hw.hw, \ | ||
75 | .parent_names = _parent_names, \ | ||
76 | .num_parents = ARRAY_SIZE(_parent_names), \ | ||
77 | .parents = _parents, \ | ||
78 | .flags = _flags | CLK_IS_BASIC, \ | ||
79 | } | ||
80 | |||
81 | #define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \ | ||
82 | _fixed_rate_flags) \ | ||
83 | static struct clk _name; \ | ||
84 | static const char *_name##_parent_names[] = {}; \ | ||
85 | static struct clk_fixed_rate _name##_hw = { \ | ||
86 | .hw = { \ | ||
87 | .clk = &_name, \ | ||
88 | }, \ | ||
89 | .fixed_rate = _rate, \ | ||
90 | .flags = _fixed_rate_flags, \ | ||
91 | }; \ | ||
92 | DEFINE_CLK(_name, clk_fixed_rate_ops, _flags, \ | ||
93 | _name##_parent_names, NULL); | ||
94 | |||
95 | #define DEFINE_CLK_GATE(_name, _parent_name, _parent_ptr, \ | ||
96 | _flags, _reg, _bit_idx, \ | ||
97 | _gate_flags, _lock) \ | ||
98 | static struct clk _name; \ | ||
99 | static const char *_name##_parent_names[] = { \ | ||
100 | _parent_name, \ | ||
101 | }; \ | ||
102 | static struct clk *_name##_parents[] = { \ | ||
103 | _parent_ptr, \ | ||
104 | }; \ | ||
105 | static struct clk_gate _name##_hw = { \ | ||
106 | .hw = { \ | ||
107 | .clk = &_name, \ | ||
108 | }, \ | ||
109 | .reg = _reg, \ | ||
110 | .bit_idx = _bit_idx, \ | ||
111 | .flags = _gate_flags, \ | ||
112 | .lock = _lock, \ | ||
113 | }; \ | ||
114 | DEFINE_CLK(_name, clk_gate_ops, _flags, \ | ||
115 | _name##_parent_names, _name##_parents); | ||
116 | |||
117 | #define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ | ||
118 | _flags, _reg, _shift, _width, \ | ||
119 | _divider_flags, _table, _lock) \ | ||
120 | static struct clk _name; \ | ||
121 | static const char *_name##_parent_names[] = { \ | ||
122 | _parent_name, \ | ||
123 | }; \ | ||
124 | static struct clk *_name##_parents[] = { \ | ||
125 | _parent_ptr, \ | ||
126 | }; \ | ||
127 | static struct clk_divider _name##_hw = { \ | ||
128 | .hw = { \ | ||
129 | .clk = &_name, \ | ||
130 | }, \ | ||
131 | .reg = _reg, \ | ||
132 | .shift = _shift, \ | ||
133 | .width = _width, \ | ||
134 | .flags = _divider_flags, \ | ||
135 | .table = _table, \ | ||
136 | .lock = _lock, \ | ||
137 | }; \ | ||
138 | DEFINE_CLK(_name, clk_divider_ops, _flags, \ | ||
139 | _name##_parent_names, _name##_parents); | ||
140 | |||
141 | #define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ | ||
142 | _flags, _reg, _shift, _width, \ | ||
143 | _divider_flags, _lock) \ | ||
144 | _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ | ||
145 | _flags, _reg, _shift, _width, \ | ||
146 | _divider_flags, NULL, _lock) | ||
147 | |||
148 | #define DEFINE_CLK_DIVIDER_TABLE(_name, _parent_name, \ | ||
149 | _parent_ptr, _flags, _reg, \ | ||
150 | _shift, _width, _divider_flags, \ | ||
151 | _table, _lock) \ | ||
152 | _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ | ||
153 | _flags, _reg, _shift, _width, \ | ||
154 | _divider_flags, _table, _lock) \ | ||
155 | |||
156 | #define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \ | ||
157 | _reg, _shift, _width, \ | ||
158 | _mux_flags, _lock) \ | ||
159 | static struct clk _name; \ | ||
160 | static struct clk_mux _name##_hw = { \ | ||
161 | .hw = { \ | ||
162 | .clk = &_name, \ | ||
163 | }, \ | ||
164 | .reg = _reg, \ | ||
165 | .shift = _shift, \ | ||
166 | .mask = BIT(_width) - 1, \ | ||
167 | .flags = _mux_flags, \ | ||
168 | .lock = _lock, \ | ||
169 | }; \ | ||
170 | DEFINE_CLK(_name, clk_mux_ops, _flags, _parent_names, \ | ||
171 | _parents); | ||
172 | |||
173 | #define DEFINE_CLK_FIXED_FACTOR(_name, _parent_name, \ | ||
174 | _parent_ptr, _flags, \ | ||
175 | _mult, _div) \ | ||
176 | static struct clk _name; \ | ||
177 | static const char *_name##_parent_names[] = { \ | ||
178 | _parent_name, \ | ||
179 | }; \ | ||
180 | static struct clk *_name##_parents[] = { \ | ||
181 | _parent_ptr, \ | ||
182 | }; \ | ||
183 | static struct clk_fixed_factor _name##_hw = { \ | ||
184 | .hw = { \ | ||
185 | .clk = &_name, \ | ||
186 | }, \ | ||
187 | .mult = _mult, \ | ||
188 | .div = _div, \ | ||
189 | }; \ | ||
190 | DEFINE_CLK(_name, clk_fixed_factor_ops, _flags, \ | ||
191 | _name##_parent_names, _name##_parents); | ||
192 | |||
193 | /** | ||
194 | * __clk_init - initialize the data structures in a struct clk | ||
195 | * @dev: device initializing this clk, placeholder for now | ||
196 | * @clk: clk being initialized | ||
197 | * | ||
198 | * Initializes the lists in struct clk, queries the hardware for the | ||
199 | * parent and rate and sets them both. | ||
200 | * | ||
201 | * Any struct clk passed into __clk_init must have the following members | ||
202 | * populated: | ||
203 | * .name | ||
204 | * .ops | ||
205 | * .hw | ||
206 | * .parent_names | ||
207 | * .num_parents | ||
208 | * .flags | ||
209 | * | ||
210 | * It is not necessary to call clk_register if __clk_init is used directly with | ||
211 | * statically initialized clock data. | ||
212 | * | ||
213 | * Returns 0 on success, otherwise an error code. | ||
214 | */ | ||
215 | int __clk_init(struct device *dev, struct clk *clk); | ||
216 | |||
217 | struct clk *__clk_register(struct device *dev, struct clk_hw *hw); | ||
218 | |||
219 | #endif /* CONFIG_COMMON_CLK */ | ||
220 | #endif /* CLK_PRIVATE_H */ | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index d936409520f8..5591ea71a8d1 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ | 33 | #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ |
34 | 34 | ||
35 | struct clk_hw; | 35 | struct clk_hw; |
36 | struct clk_core; | ||
36 | struct dentry; | 37 | struct dentry; |
37 | 38 | ||
38 | /** | 39 | /** |
@@ -174,9 +175,12 @@ struct clk_ops { | |||
174 | unsigned long parent_rate); | 175 | unsigned long parent_rate); |
175 | long (*round_rate)(struct clk_hw *hw, unsigned long rate, | 176 | long (*round_rate)(struct clk_hw *hw, unsigned long rate, |
176 | unsigned long *parent_rate); | 177 | unsigned long *parent_rate); |
177 | long (*determine_rate)(struct clk_hw *hw, unsigned long rate, | 178 | long (*determine_rate)(struct clk_hw *hw, |
178 | unsigned long *best_parent_rate, | 179 | unsigned long rate, |
179 | struct clk_hw **best_parent_hw); | 180 | unsigned long min_rate, |
181 | unsigned long max_rate, | ||
182 | unsigned long *best_parent_rate, | ||
183 | struct clk_hw **best_parent_hw); | ||
180 | int (*set_parent)(struct clk_hw *hw, u8 index); | 184 | int (*set_parent)(struct clk_hw *hw, u8 index); |
181 | u8 (*get_parent)(struct clk_hw *hw); | 185 | u8 (*get_parent)(struct clk_hw *hw); |
182 | int (*set_rate)(struct clk_hw *hw, unsigned long rate, | 186 | int (*set_rate)(struct clk_hw *hw, unsigned long rate, |
@@ -216,13 +220,17 @@ struct clk_init_data { | |||
216 | * clk_foo and then referenced by the struct clk instance that uses struct | 220 | * clk_foo and then referenced by the struct clk instance that uses struct |
217 | * clk_foo's clk_ops | 221 | * clk_foo's clk_ops |
218 | * | 222 | * |
219 | * @clk: pointer to the struct clk instance that points back to this struct | 223 | * @core: pointer to the struct clk_core instance that points back to this |
220 | * clk_hw instance | 224 | * struct clk_hw instance |
225 | * | ||
226 | * @clk: pointer to the per-user struct clk instance that can be used to call | ||
227 | * into the clk API | ||
221 | * | 228 | * |
222 | * @init: pointer to struct clk_init_data that contains the init data shared | 229 | * @init: pointer to struct clk_init_data that contains the init data shared |
223 | * with the common clock framework. | 230 | * with the common clock framework. |
224 | */ | 231 | */ |
225 | struct clk_hw { | 232 | struct clk_hw { |
233 | struct clk_core *core; | ||
226 | struct clk *clk; | 234 | struct clk *clk; |
227 | const struct clk_init_data *init; | 235 | const struct clk_init_data *init; |
228 | }; | 236 | }; |
@@ -294,6 +302,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name, | |||
294 | const char *parent_name, unsigned long flags, | 302 | const char *parent_name, unsigned long flags, |
295 | void __iomem *reg, u8 bit_idx, | 303 | void __iomem *reg, u8 bit_idx, |
296 | u8 clk_gate_flags, spinlock_t *lock); | 304 | u8 clk_gate_flags, spinlock_t *lock); |
305 | void clk_unregister_gate(struct clk *clk); | ||
297 | 306 | ||
298 | struct clk_div_table { | 307 | struct clk_div_table { |
299 | unsigned int val; | 308 | unsigned int val; |
@@ -352,6 +361,17 @@ struct clk_divider { | |||
352 | #define CLK_DIVIDER_READ_ONLY BIT(5) | 361 | #define CLK_DIVIDER_READ_ONLY BIT(5) |
353 | 362 | ||
354 | extern const struct clk_ops clk_divider_ops; | 363 | extern const struct clk_ops clk_divider_ops; |
364 | |||
365 | unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, | ||
366 | unsigned int val, const struct clk_div_table *table, | ||
367 | unsigned long flags); | ||
368 | long divider_round_rate(struct clk_hw *hw, unsigned long rate, | ||
369 | unsigned long *prate, const struct clk_div_table *table, | ||
370 | u8 width, unsigned long flags); | ||
371 | int divider_get_val(unsigned long rate, unsigned long parent_rate, | ||
372 | const struct clk_div_table *table, u8 width, | ||
373 | unsigned long flags); | ||
374 | |||
355 | struct clk *clk_register_divider(struct device *dev, const char *name, | 375 | struct clk *clk_register_divider(struct device *dev, const char *name, |
356 | const char *parent_name, unsigned long flags, | 376 | const char *parent_name, unsigned long flags, |
357 | void __iomem *reg, u8 shift, u8 width, | 377 | void __iomem *reg, u8 shift, u8 width, |
@@ -361,6 +381,7 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, | |||
361 | void __iomem *reg, u8 shift, u8 width, | 381 | void __iomem *reg, u8 shift, u8 width, |
362 | u8 clk_divider_flags, const struct clk_div_table *table, | 382 | u8 clk_divider_flags, const struct clk_div_table *table, |
363 | spinlock_t *lock); | 383 | spinlock_t *lock); |
384 | void clk_unregister_divider(struct clk *clk); | ||
364 | 385 | ||
365 | /** | 386 | /** |
366 | * struct clk_mux - multiplexer clock | 387 | * struct clk_mux - multiplexer clock |
@@ -382,6 +403,8 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, | |||
382 | * register, and mask of mux bits are in higher 16-bit of this register. | 403 | * register, and mask of mux bits are in higher 16-bit of this register. |
383 | * While setting the mux bits, higher 16-bit should also be updated to | 404 | * While setting the mux bits, higher 16-bit should also be updated to |
384 | * indicate changing mux bits. | 405 | * indicate changing mux bits. |
406 | * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired | ||
407 | * frequency. | ||
385 | */ | 408 | */ |
386 | struct clk_mux { | 409 | struct clk_mux { |
387 | struct clk_hw hw; | 410 | struct clk_hw hw; |
@@ -396,7 +419,8 @@ struct clk_mux { | |||
396 | #define CLK_MUX_INDEX_ONE BIT(0) | 419 | #define CLK_MUX_INDEX_ONE BIT(0) |
397 | #define CLK_MUX_INDEX_BIT BIT(1) | 420 | #define CLK_MUX_INDEX_BIT BIT(1) |
398 | #define CLK_MUX_HIWORD_MASK BIT(2) | 421 | #define CLK_MUX_HIWORD_MASK BIT(2) |
399 | #define CLK_MUX_READ_ONLY BIT(3) /* mux setting cannot be changed */ | 422 | #define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */ |
423 | #define CLK_MUX_ROUND_CLOSEST BIT(4) | ||
400 | 424 | ||
401 | extern const struct clk_ops clk_mux_ops; | 425 | extern const struct clk_ops clk_mux_ops; |
402 | extern const struct clk_ops clk_mux_ro_ops; | 426 | extern const struct clk_ops clk_mux_ro_ops; |
@@ -411,6 +435,8 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name, | |||
411 | void __iomem *reg, u8 shift, u32 mask, | 435 | void __iomem *reg, u8 shift, u32 mask, |
412 | u8 clk_mux_flags, u32 *table, spinlock_t *lock); | 436 | u8 clk_mux_flags, u32 *table, spinlock_t *lock); |
413 | 437 | ||
438 | void clk_unregister_mux(struct clk *clk); | ||
439 | |||
414 | void of_fixed_factor_clk_setup(struct device_node *node); | 440 | void of_fixed_factor_clk_setup(struct device_node *node); |
415 | 441 | ||
416 | /** | 442 | /** |
@@ -550,15 +576,29 @@ bool __clk_is_prepared(struct clk *clk); | |||
550 | bool __clk_is_enabled(struct clk *clk); | 576 | bool __clk_is_enabled(struct clk *clk); |
551 | struct clk *__clk_lookup(const char *name); | 577 | struct clk *__clk_lookup(const char *name); |
552 | long __clk_mux_determine_rate(struct clk_hw *hw, unsigned long rate, | 578 | long __clk_mux_determine_rate(struct clk_hw *hw, unsigned long rate, |
579 | unsigned long min_rate, | ||
580 | unsigned long max_rate, | ||
553 | unsigned long *best_parent_rate, | 581 | unsigned long *best_parent_rate, |
554 | struct clk_hw **best_parent_p); | 582 | struct clk_hw **best_parent_p); |
583 | unsigned long __clk_determine_rate(struct clk_hw *core, | ||
584 | unsigned long rate, | ||
585 | unsigned long min_rate, | ||
586 | unsigned long max_rate); | ||
587 | long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate, | ||
588 | unsigned long min_rate, | ||
589 | unsigned long max_rate, | ||
590 | unsigned long *best_parent_rate, | ||
591 | struct clk_hw **best_parent_p); | ||
592 | |||
593 | static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src) | ||
594 | { | ||
595 | dst->clk = src->clk; | ||
596 | dst->core = src->core; | ||
597 | } | ||
555 | 598 | ||
556 | /* | 599 | /* |
557 | * FIXME clock api without lock protection | 600 | * FIXME clock api without lock protection |
558 | */ | 601 | */ |
559 | int __clk_prepare(struct clk *clk); | ||
560 | void __clk_unprepare(struct clk *clk); | ||
561 | void __clk_reparent(struct clk *clk, struct clk *new_parent); | ||
562 | unsigned long __clk_round_rate(struct clk *clk, unsigned long rate); | 602 | unsigned long __clk_round_rate(struct clk *clk, unsigned long rate); |
563 | 603 | ||
564 | struct of_device_id; | 604 | struct of_device_id; |
diff --git a/include/linux/clk.h b/include/linux/clk.h index c7f258a81761..8381bbfbc308 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -302,6 +302,46 @@ long clk_round_rate(struct clk *clk, unsigned long rate); | |||
302 | int clk_set_rate(struct clk *clk, unsigned long rate); | 302 | int clk_set_rate(struct clk *clk, unsigned long rate); |
303 | 303 | ||
304 | /** | 304 | /** |
305 | * clk_has_parent - check if a clock is a possible parent for another | ||
306 | * @clk: clock source | ||
307 | * @parent: parent clock source | ||
308 | * | ||
309 | * This function can be used in drivers that need to check that a clock can be | ||
310 | * the parent of another without actually changing the parent. | ||
311 | * | ||
312 | * Returns true if @parent is a possible parent for @clk, false otherwise. | ||
313 | */ | ||
314 | bool clk_has_parent(struct clk *clk, struct clk *parent); | ||
315 | |||
316 | /** | ||
317 | * clk_set_rate_range - set a rate range for a clock source | ||
318 | * @clk: clock source | ||
319 | * @min: desired minimum clock rate in Hz, inclusive | ||
320 | * @max: desired maximum clock rate in Hz, inclusive | ||
321 | * | ||
322 | * Returns success (0) or negative errno. | ||
323 | */ | ||
324 | int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max); | ||
325 | |||
326 | /** | ||
327 | * clk_set_min_rate - set a minimum clock rate for a clock source | ||
328 | * @clk: clock source | ||
329 | * @rate: desired minimum clock rate in Hz, inclusive | ||
330 | * | ||
331 | * Returns success (0) or negative errno. | ||
332 | */ | ||
333 | int clk_set_min_rate(struct clk *clk, unsigned long rate); | ||
334 | |||
335 | /** | ||
336 | * clk_set_max_rate - set a maximum clock rate for a clock source | ||
337 | * @clk: clock source | ||
338 | * @rate: desired maximum clock rate in Hz, inclusive | ||
339 | * | ||
340 | * Returns success (0) or negative errno. | ||
341 | */ | ||
342 | int clk_set_max_rate(struct clk *clk, unsigned long rate); | ||
343 | |||
344 | /** | ||
305 | * clk_set_parent - set the parent clock source for this clock | 345 | * clk_set_parent - set the parent clock source for this clock |
306 | * @clk: clock source | 346 | * @clk: clock source |
307 | * @parent: parent clock source | 347 | * @parent: parent clock source |
@@ -374,6 +414,11 @@ static inline long clk_round_rate(struct clk *clk, unsigned long rate) | |||
374 | return 0; | 414 | return 0; |
375 | } | 415 | } |
376 | 416 | ||
417 | static inline bool clk_has_parent(struct clk *clk, struct clk *parent) | ||
418 | { | ||
419 | return true; | ||
420 | } | ||
421 | |||
377 | static inline int clk_set_parent(struct clk *clk, struct clk *parent) | 422 | static inline int clk_set_parent(struct clk *clk, struct clk *parent) |
378 | { | 423 | { |
379 | return 0; | 424 | return 0; |
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 3ca9fca827a2..19c4208f4752 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
@@ -120,6 +120,4 @@ static inline void tegra_cpu_clock_resume(void) | |||
120 | } | 120 | } |
121 | #endif | 121 | #endif |
122 | 122 | ||
123 | void tegra_clocks_apply_init_table(void); | ||
124 | |||
125 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 123 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index 55ef529a0dbf..67844003493d 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #ifndef __LINUX_CLK_TI_H__ | 15 | #ifndef __LINUX_CLK_TI_H__ |
16 | #define __LINUX_CLK_TI_H__ | 16 | #define __LINUX_CLK_TI_H__ |
17 | 17 | ||
18 | #include <linux/clk-provider.h> | ||
18 | #include <linux/clkdev.h> | 19 | #include <linux/clkdev.h> |
19 | 20 | ||
20 | /** | 21 | /** |
@@ -217,6 +218,13 @@ struct ti_dt_clk { | |||
217 | /* Maximum number of clock memmaps */ | 218 | /* Maximum number of clock memmaps */ |
218 | #define CLK_MAX_MEMMAPS 4 | 219 | #define CLK_MAX_MEMMAPS 4 |
219 | 220 | ||
221 | /* Static memmap indices */ | ||
222 | enum { | ||
223 | TI_CLKM_CM = 0, | ||
224 | TI_CLKM_PRM, | ||
225 | TI_CLKM_SCRM, | ||
226 | }; | ||
227 | |||
220 | typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *); | 228 | typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *); |
221 | 229 | ||
222 | /** | 230 | /** |
@@ -263,6 +271,8 @@ int omap3_noncore_dpll_set_rate_and_parent(struct clk_hw *hw, | |||
263 | u8 index); | 271 | u8 index); |
264 | long omap3_noncore_dpll_determine_rate(struct clk_hw *hw, | 272 | long omap3_noncore_dpll_determine_rate(struct clk_hw *hw, |
265 | unsigned long rate, | 273 | unsigned long rate, |
274 | unsigned long min_rate, | ||
275 | unsigned long max_rate, | ||
266 | unsigned long *best_parent_rate, | 276 | unsigned long *best_parent_rate, |
267 | struct clk_hw **best_parent_clk); | 277 | struct clk_hw **best_parent_clk); |
268 | unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, | 278 | unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, |
@@ -272,6 +282,8 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw, | |||
272 | unsigned long *parent_rate); | 282 | unsigned long *parent_rate); |
273 | long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw, | 283 | long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw, |
274 | unsigned long rate, | 284 | unsigned long rate, |
285 | unsigned long min_rate, | ||
286 | unsigned long max_rate, | ||
275 | unsigned long *best_parent_rate, | 287 | unsigned long *best_parent_rate, |
276 | struct clk_hw **best_parent_clk); | 288 | struct clk_hw **best_parent_clk); |
277 | u8 omap2_init_dpll_parent(struct clk_hw *hw); | 289 | u8 omap2_init_dpll_parent(struct clk_hw *hw); |
@@ -348,4 +360,17 @@ extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; | |||
348 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; | 360 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; |
349 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait; | 361 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait; |
350 | 362 | ||
363 | #ifdef CONFIG_ATAGS | ||
364 | int omap3430_clk_legacy_init(void); | ||
365 | int omap3430es1_clk_legacy_init(void); | ||
366 | int omap36xx_clk_legacy_init(void); | ||
367 | int am35xx_clk_legacy_init(void); | ||
368 | #else | ||
369 | static inline int omap3430_clk_legacy_init(void) { return -ENXIO; } | ||
370 | static inline int omap3430es1_clk_legacy_init(void) { return -ENXIO; } | ||
371 | static inline int omap36xx_clk_legacy_init(void) { return -ENXIO; } | ||
372 | static inline int am35xx_clk_legacy_init(void) { return -ENXIO; } | ||
373 | #endif | ||
374 | |||
375 | |||
351 | #endif | 376 | #endif |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index abcafaa20b86..9c78d15d33e4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #include <asm/div64.h> | 18 | #include <asm/div64.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | 20 | ||
21 | /* clocksource cycle base type */ | ||
22 | typedef u64 cycle_t; | ||
23 | struct clocksource; | 21 | struct clocksource; |
24 | struct module; | 22 | struct module; |
25 | 23 | ||
@@ -28,106 +26,6 @@ struct module; | |||
28 | #endif | 26 | #endif |
29 | 27 | ||
30 | /** | 28 | /** |
31 | * struct cyclecounter - hardware abstraction for a free running counter | ||
32 | * Provides completely state-free accessors to the underlying hardware. | ||
33 | * Depending on which hardware it reads, the cycle counter may wrap | ||
34 | * around quickly. Locking rules (if necessary) have to be defined | ||
35 | * by the implementor and user of specific instances of this API. | ||
36 | * | ||
37 | * @read: returns the current cycle value | ||
38 | * @mask: bitmask for two's complement | ||
39 | * subtraction of non 64 bit counters, | ||
40 | * see CLOCKSOURCE_MASK() helper macro | ||
41 | * @mult: cycle to nanosecond multiplier | ||
42 | * @shift: cycle to nanosecond divisor (power of two) | ||
43 | */ | ||
44 | struct cyclecounter { | ||
45 | cycle_t (*read)(const struct cyclecounter *cc); | ||
46 | cycle_t mask; | ||
47 | u32 mult; | ||
48 | u32 shift; | ||
49 | }; | ||
50 | |||
51 | /** | ||
52 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
53 | * Contains the state needed by timecounter_read() to detect | ||
54 | * cycle counter wrap around. Initialize with | ||
55 | * timecounter_init(). Also used to convert cycle counts into the | ||
56 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
57 | * of this code are responsible for initializing the underlying | ||
58 | * cycle counter hardware, locking issues and reading the time | ||
59 | * more often than the cycle counter wraps around. The nanosecond | ||
60 | * counter will only wrap around after ~585 years. | ||
61 | * | ||
62 | * @cc: the cycle counter used by this instance | ||
63 | * @cycle_last: most recent cycle counter value seen by | ||
64 | * timecounter_read() | ||
65 | * @nsec: continuously increasing count | ||
66 | */ | ||
67 | struct timecounter { | ||
68 | const struct cyclecounter *cc; | ||
69 | cycle_t cycle_last; | ||
70 | u64 nsec; | ||
71 | }; | ||
72 | |||
73 | /** | ||
74 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
75 | * @cc: Pointer to cycle counter. | ||
76 | * @cycles: Cycles | ||
77 | * | ||
78 | * XXX - This could use some mult_lxl_ll() asm optimization. Same code | ||
79 | * as in cyc2ns, but with unsigned result. | ||
80 | */ | ||
81 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
82 | cycle_t cycles) | ||
83 | { | ||
84 | u64 ret = (u64)cycles; | ||
85 | ret = (ret * cc->mult) >> cc->shift; | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * timecounter_init - initialize a time counter | ||
91 | * @tc: Pointer to time counter which is to be initialized/reset | ||
92 | * @cc: A cycle counter, ready to be used. | ||
93 | * @start_tstamp: Arbitrary initial time stamp. | ||
94 | * | ||
95 | * After this call the current cycle register (roughly) corresponds to | ||
96 | * the initial time stamp. Every call to timecounter_read() increments | ||
97 | * the time stamp counter by the number of elapsed nanoseconds. | ||
98 | */ | ||
99 | extern void timecounter_init(struct timecounter *tc, | ||
100 | const struct cyclecounter *cc, | ||
101 | u64 start_tstamp); | ||
102 | |||
103 | /** | ||
104 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
105 | * plus the initial time stamp | ||
106 | * @tc: Pointer to time counter. | ||
107 | * | ||
108 | * In other words, keeps track of time since the same epoch as | ||
109 | * the function which generated the initial time stamp. | ||
110 | */ | ||
111 | extern u64 timecounter_read(struct timecounter *tc); | ||
112 | |||
113 | /** | ||
114 | * timecounter_cyc2time - convert a cycle counter to same | ||
115 | * time base as values returned by | ||
116 | * timecounter_read() | ||
117 | * @tc: Pointer to time counter. | ||
118 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
119 | * | ||
120 | * Cycle counts that are converted correctly as long as they | ||
121 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
122 | * with "max cycle count" == cs->mask+1. | ||
123 | * | ||
124 | * This allows conversion of cycle counter values which were generated | ||
125 | * in the past. | ||
126 | */ | ||
127 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
128 | cycle_t cycle_tstamp); | ||
129 | |||
130 | /** | ||
131 | * struct clocksource - hardware abstraction for a free running counter | 29 | * struct clocksource - hardware abstraction for a free running counter |
132 | * Provides mostly state-free accessors to the underlying hardware. | 30 | * Provides mostly state-free accessors to the underlying hardware. |
133 | * This is the structure used for system time. | 31 | * This is the structure used for system time. |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 3238ffa33f68..a014559e4a49 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -12,6 +12,10 @@ | |||
12 | #define COMPACT_PARTIAL 3 | 12 | #define COMPACT_PARTIAL 3 |
13 | /* The full zone was compacted */ | 13 | /* The full zone was compacted */ |
14 | #define COMPACT_COMPLETE 4 | 14 | #define COMPACT_COMPLETE 4 |
15 | /* For more detailed tracepoint output */ | ||
16 | #define COMPACT_NO_SUITABLE_PAGE 5 | ||
17 | #define COMPACT_NOT_SUITABLE_ZONE 6 | ||
18 | /* When adding new state, please change compaction_status_string, too */ | ||
15 | 19 | ||
16 | /* Used to signal whether compaction detected need_sched() or lock contention */ | 20 | /* Used to signal whether compaction detected need_sched() or lock contention */ |
17 | /* No contention detected */ | 21 | /* No contention detected */ |
@@ -21,6 +25,8 @@ | |||
21 | /* Zone lock or lru_lock was contended in async compaction */ | 25 | /* Zone lock or lru_lock was contended in async compaction */ |
22 | #define COMPACT_CONTENDED_LOCK 2 | 26 | #define COMPACT_CONTENDED_LOCK 2 |
23 | 27 | ||
28 | struct alloc_context; /* in mm/internal.h */ | ||
29 | |||
24 | #ifdef CONFIG_COMPACTION | 30 | #ifdef CONFIG_COMPACTION |
25 | extern int sysctl_compact_memory; | 31 | extern int sysctl_compact_memory; |
26 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 32 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
@@ -30,81 +36,25 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
30 | void __user *buffer, size_t *length, loff_t *ppos); | 36 | void __user *buffer, size_t *length, loff_t *ppos); |
31 | 37 | ||
32 | extern int fragmentation_index(struct zone *zone, unsigned int order); | 38 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
33 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 39 | extern unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order, |
34 | int order, gfp_t gfp_mask, nodemask_t *mask, | 40 | int alloc_flags, const struct alloc_context *ac, |
35 | enum migrate_mode mode, int *contended, | 41 | enum migrate_mode mode, int *contended); |
36 | int alloc_flags, int classzone_idx); | ||
37 | extern void compact_pgdat(pg_data_t *pgdat, int order); | 42 | extern void compact_pgdat(pg_data_t *pgdat, int order); |
38 | extern void reset_isolation_suitable(pg_data_t *pgdat); | 43 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
39 | extern unsigned long compaction_suitable(struct zone *zone, int order, | 44 | extern unsigned long compaction_suitable(struct zone *zone, int order, |
40 | int alloc_flags, int classzone_idx); | 45 | int alloc_flags, int classzone_idx); |
41 | 46 | ||
42 | /* Do not skip compaction more than 64 times */ | 47 | extern void defer_compaction(struct zone *zone, int order); |
43 | #define COMPACT_MAX_DEFER_SHIFT 6 | 48 | extern bool compaction_deferred(struct zone *zone, int order); |
44 | 49 | extern void compaction_defer_reset(struct zone *zone, int order, | |
45 | /* | 50 | bool alloc_success); |
46 | * Compaction is deferred when compaction fails to result in a page | 51 | extern bool compaction_restarting(struct zone *zone, int order); |
47 | * allocation success. 1 << compact_defer_limit compactions are skipped up | ||
48 | * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT | ||
49 | */ | ||
50 | static inline void defer_compaction(struct zone *zone, int order) | ||
51 | { | ||
52 | zone->compact_considered = 0; | ||
53 | zone->compact_defer_shift++; | ||
54 | |||
55 | if (order < zone->compact_order_failed) | ||
56 | zone->compact_order_failed = order; | ||
57 | |||
58 | if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT) | ||
59 | zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT; | ||
60 | } | ||
61 | |||
62 | /* Returns true if compaction should be skipped this time */ | ||
63 | static inline bool compaction_deferred(struct zone *zone, int order) | ||
64 | { | ||
65 | unsigned long defer_limit = 1UL << zone->compact_defer_shift; | ||
66 | |||
67 | if (order < zone->compact_order_failed) | ||
68 | return false; | ||
69 | |||
70 | /* Avoid possible overflow */ | ||
71 | if (++zone->compact_considered > defer_limit) | ||
72 | zone->compact_considered = defer_limit; | ||
73 | |||
74 | return zone->compact_considered < defer_limit; | ||
75 | } | ||
76 | |||
77 | /* | ||
78 | * Update defer tracking counters after successful compaction of given order, | ||
79 | * which means an allocation either succeeded (alloc_success == true) or is | ||
80 | * expected to succeed. | ||
81 | */ | ||
82 | static inline void compaction_defer_reset(struct zone *zone, int order, | ||
83 | bool alloc_success) | ||
84 | { | ||
85 | if (alloc_success) { | ||
86 | zone->compact_considered = 0; | ||
87 | zone->compact_defer_shift = 0; | ||
88 | } | ||
89 | if (order >= zone->compact_order_failed) | ||
90 | zone->compact_order_failed = order + 1; | ||
91 | } | ||
92 | |||
93 | /* Returns true if restarting compaction after many failures */ | ||
94 | static inline bool compaction_restarting(struct zone *zone, int order) | ||
95 | { | ||
96 | if (order < zone->compact_order_failed) | ||
97 | return false; | ||
98 | |||
99 | return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT && | ||
100 | zone->compact_considered >= 1UL << zone->compact_defer_shift; | ||
101 | } | ||
102 | 52 | ||
103 | #else | 53 | #else |
104 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 54 | static inline unsigned long try_to_compact_pages(gfp_t gfp_mask, |
105 | int order, gfp_t gfp_mask, nodemask_t *nodemask, | 55 | unsigned int order, int alloc_flags, |
106 | enum migrate_mode mode, int *contended, | 56 | const struct alloc_context *ac, |
107 | int alloc_flags, int classzone_idx) | 57 | enum migrate_mode mode, int *contended) |
108 | { | 58 | { |
109 | return COMPACT_CONTINUE; | 59 | return COMPACT_CONTINUE; |
110 | } | 60 | } |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 7450ca2ac1fc..ab25814690bc 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -689,6 +689,15 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd, | |||
689 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 689 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
690 | compat_stack_t __user *uoss_ptr); | 690 | compat_stack_t __user *uoss_ptr); |
691 | 691 | ||
692 | #ifdef __ARCH_WANT_SYS_SIGPENDING | ||
693 | asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set); | ||
694 | #endif | ||
695 | |||
696 | #ifdef __ARCH_WANT_SYS_SIGPROCMASK | ||
697 | asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *nset, | ||
698 | compat_old_sigset_t __user *oset); | ||
699 | #endif | ||
700 | |||
692 | int compat_restore_altstack(const compat_stack_t __user *uss); | 701 | int compat_restore_altstack(const compat_stack_t __user *uss); |
693 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); | 702 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); |
694 | #define compat_save_altstack_ex(uss, sp) do { \ | 703 | #define compat_save_altstack_ex(uss, sp) do { \ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 02ae99e8e6d3..cdf13ca7cac3 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -66,6 +66,7 @@ | |||
66 | #define __deprecated __attribute__((deprecated)) | 66 | #define __deprecated __attribute__((deprecated)) |
67 | #define __packed __attribute__((packed)) | 67 | #define __packed __attribute__((packed)) |
68 | #define __weak __attribute__((weak)) | 68 | #define __weak __attribute__((weak)) |
69 | #define __alias(symbol) __attribute__((alias(#symbol))) | ||
69 | 70 | ||
70 | /* | 71 | /* |
71 | * it doesn't make sense on ARM (currently the only user of __naked) to trace | 72 | * it doesn't make sense on ARM (currently the only user of __naked) to trace |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index d1a558239b1a..769e19864632 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -85,3 +85,7 @@ | |||
85 | #define __HAVE_BUILTIN_BSWAP16__ | 85 | #define __HAVE_BUILTIN_BSWAP16__ |
86 | #endif | 86 | #endif |
87 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | 87 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
88 | |||
89 | #if GCC_VERSION >= 40902 | ||
90 | #define KASAN_ABI_VERSION 3 | ||
91 | #endif | ||
diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h index c8c565952548..efee493714eb 100644 --- a/include/linux/compiler-gcc5.h +++ b/include/linux/compiler-gcc5.h | |||
@@ -63,3 +63,5 @@ | |||
63 | #define __HAVE_BUILTIN_BSWAP64__ | 63 | #define __HAVE_BUILTIN_BSWAP64__ |
64 | #define __HAVE_BUILTIN_BSWAP16__ | 64 | #define __HAVE_BUILTIN_BSWAP16__ |
65 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | 65 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
66 | |||
67 | #define KASAN_ABI_VERSION 4 | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 33063f872ee3..1b45e4a0519b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -54,7 +54,11 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
54 | #include <linux/compiler-gcc.h> | 54 | #include <linux/compiler-gcc.h> |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #ifdef CC_USING_HOTPATCH | ||
58 | #define notrace __attribute__((hotpatch(0,0))) | ||
59 | #else | ||
57 | #define notrace __attribute__((no_instrument_function)) | 60 | #define notrace __attribute__((no_instrument_function)) |
61 | #endif | ||
58 | 62 | ||
59 | /* Intel compiler defines __GNUC__. So we will overwrite implementations | 63 | /* Intel compiler defines __GNUC__. So we will overwrite implementations |
60 | * coming from above header files here | 64 | * coming from above header files here |
@@ -198,7 +202,7 @@ static __always_inline void data_access_exceeds_word_size(void) | |||
198 | { | 202 | { |
199 | } | 203 | } |
200 | 204 | ||
201 | static __always_inline void __read_once_size(volatile void *p, void *res, int size) | 205 | static __always_inline void __read_once_size(const volatile void *p, void *res, int size) |
202 | { | 206 | { |
203 | switch (size) { | 207 | switch (size) { |
204 | case 1: *(__u8 *)res = *(volatile __u8 *)p; break; | 208 | case 1: *(__u8 *)res = *(volatile __u8 *)p; break; |
@@ -255,10 +259,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s | |||
255 | */ | 259 | */ |
256 | 260 | ||
257 | #define READ_ONCE(x) \ | 261 | #define READ_ONCE(x) \ |
258 | ({ typeof(x) __val; __read_once_size(&x, &__val, sizeof(__val)); __val; }) | 262 | ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) |
259 | 263 | ||
260 | #define WRITE_ONCE(x, val) \ | 264 | #define WRITE_ONCE(x, val) \ |
261 | ({ typeof(x) __val; __val = val; __write_once_size(&x, &__val, sizeof(__val)); __val; }) | 265 | ({ typeof(x) __val = (val); __write_once_size(&(x), &__val, sizeof(__val)); __val; }) |
262 | 266 | ||
263 | #endif /* __KERNEL__ */ | 267 | #endif /* __KERNEL__ */ |
264 | 268 | ||
@@ -385,7 +389,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s | |||
385 | 389 | ||
386 | /* Is this type a native word size -- useful for atomic operations */ | 390 | /* Is this type a native word size -- useful for atomic operations */ |
387 | #ifndef __native_word | 391 | #ifndef __native_word |
388 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | 392 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
389 | #endif | 393 | #endif |
390 | 394 | ||
391 | /* Compile time object size, -1 for unknown */ | 395 | /* Compile time object size, -1 for unknown */ |
@@ -447,12 +451,23 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s | |||
447 | * to make the compiler aware of ordering is to put the two invocations of | 451 | * to make the compiler aware of ordering is to put the two invocations of |
448 | * ACCESS_ONCE() in different C statements. | 452 | * ACCESS_ONCE() in different C statements. |
449 | * | 453 | * |
450 | * This macro does absolutely -nothing- to prevent the CPU from reordering, | 454 | * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE |
451 | * merging, or refetching absolutely anything at any time. Its main intended | 455 | * on a union member will work as long as the size of the member matches the |
452 | * use is to mediate communication between process-level code and irq/NMI | 456 | * size of the union and the size is smaller than word size. |
453 | * handlers, all running on the same CPU. | 457 | * |
458 | * The major use cases of ACCESS_ONCE used to be (1) Mediating communication | ||
459 | * between process-level code and irq/NMI handlers, all running on the same CPU, | ||
460 | * and (2) Ensuring that the compiler does not fold, spindle, or otherwise | ||
461 | * mutilate accesses that either do not require ordering or that interact | ||
462 | * with an explicit memory barrier or atomic instruction that provides the | ||
463 | * required ordering. | ||
464 | * | ||
465 | * If possible use READ_ONCE/ASSIGN_ONCE instead. | ||
454 | */ | 466 | */ |
455 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) | 467 | #define __ACCESS_ONCE(x) ({ \ |
468 | __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \ | ||
469 | (volatile typeof(x) *)&(x); }) | ||
470 | #define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) | ||
456 | 471 | ||
457 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ | 472 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ |
458 | #ifdef CONFIG_KPROBES | 473 | #ifdef CONFIG_KPROBES |
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 5d3c54311f7a..3486b9082adb 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h | |||
@@ -179,15 +179,6 @@ struct coresight_device { | |||
179 | #define sink_ops(csdev) csdev->ops->sink_ops | 179 | #define sink_ops(csdev) csdev->ops->sink_ops |
180 | #define link_ops(csdev) csdev->ops->link_ops | 180 | #define link_ops(csdev) csdev->ops->link_ops |
181 | 181 | ||
182 | #define CORESIGHT_DEBUGFS_ENTRY(__name, __entry_name, \ | ||
183 | __mode, __get, __set, __fmt) \ | ||
184 | DEFINE_SIMPLE_ATTRIBUTE(__name ## _ops, __get, __set, __fmt); \ | ||
185 | static const struct coresight_ops_entry __name ## _entry = { \ | ||
186 | .name = __entry_name, \ | ||
187 | .mode = __mode, \ | ||
188 | .ops = &__name ## _ops \ | ||
189 | } | ||
190 | |||
191 | /** | 182 | /** |
192 | * struct coresight_ops_sink - basic operations for a sink | 183 | * struct coresight_ops_sink - basic operations for a sink |
193 | * Operations available for sinks | 184 | * Operations available for sinks |
@@ -236,13 +227,8 @@ coresight_register(struct coresight_desc *desc); | |||
236 | extern void coresight_unregister(struct coresight_device *csdev); | 227 | extern void coresight_unregister(struct coresight_device *csdev); |
237 | extern int coresight_enable(struct coresight_device *csdev); | 228 | extern int coresight_enable(struct coresight_device *csdev); |
238 | extern void coresight_disable(struct coresight_device *csdev); | 229 | extern void coresight_disable(struct coresight_device *csdev); |
239 | extern int coresight_is_bit_set(u32 val, int position, int value); | ||
240 | extern int coresight_timeout(void __iomem *addr, u32 offset, | 230 | extern int coresight_timeout(void __iomem *addr, u32 offset, |
241 | int position, int value); | 231 | int position, int value); |
242 | #ifdef CONFIG_OF | ||
243 | extern struct coresight_platform_data *of_get_coresight_platform_data( | ||
244 | struct device *dev, struct device_node *node); | ||
245 | #endif | ||
246 | #else | 232 | #else |
247 | static inline struct coresight_device * | 233 | static inline struct coresight_device * |
248 | coresight_register(struct coresight_desc *desc) { return NULL; } | 234 | coresight_register(struct coresight_desc *desc) { return NULL; } |
@@ -250,14 +236,16 @@ static inline void coresight_unregister(struct coresight_device *csdev) {} | |||
250 | static inline int | 236 | static inline int |
251 | coresight_enable(struct coresight_device *csdev) { return -ENOSYS; } | 237 | coresight_enable(struct coresight_device *csdev) { return -ENOSYS; } |
252 | static inline void coresight_disable(struct coresight_device *csdev) {} | 238 | static inline void coresight_disable(struct coresight_device *csdev) {} |
253 | static inline int coresight_is_bit_set(u32 val, int position, int value) | ||
254 | { return 0; } | ||
255 | static inline int coresight_timeout(void __iomem *addr, u32 offset, | 239 | static inline int coresight_timeout(void __iomem *addr, u32 offset, |
256 | int position, int value) { return 1; } | 240 | int position, int value) { return 1; } |
241 | #endif | ||
242 | |||
257 | #ifdef CONFIG_OF | 243 | #ifdef CONFIG_OF |
244 | extern struct coresight_platform_data *of_get_coresight_platform_data( | ||
245 | struct device *dev, struct device_node *node); | ||
246 | #else | ||
258 | static inline struct coresight_platform_data *of_get_coresight_platform_data( | 247 | static inline struct coresight_platform_data *of_get_coresight_platform_data( |
259 | struct device *dev, struct device_node *node) { return NULL; } | 248 | struct device *dev, struct device_node *node) { return NULL; } |
260 | #endif | 249 | #endif |
261 | #endif | ||
262 | 250 | ||
263 | #endif | 251 | #endif |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4d078cebafd2..2ee4888c1f47 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -66,8 +66,6 @@ struct cpufreq_policy { | |||
66 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs | 66 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs |
67 | should set cpufreq */ | 67 | should set cpufreq */ |
68 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 68 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
69 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | ||
70 | * this policy */ | ||
71 | struct clk *clk; | 69 | struct clk *clk; |
72 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 70 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
73 | 71 | ||
@@ -113,6 +111,9 @@ struct cpufreq_policy { | |||
113 | wait_queue_head_t transition_wait; | 111 | wait_queue_head_t transition_wait; |
114 | struct task_struct *transition_task; /* Task which is doing the transition */ | 112 | struct task_struct *transition_task; /* Task which is doing the transition */ |
115 | 113 | ||
114 | /* cpufreq-stats */ | ||
115 | struct cpufreq_stats *stats; | ||
116 | |||
116 | /* For cpufreq driver's internal use */ | 117 | /* For cpufreq driver's internal use */ |
117 | void *driver_data; | 118 | void *driver_data; |
118 | }; | 119 | }; |
@@ -367,9 +368,8 @@ static inline void cpufreq_resume(void) {} | |||
367 | #define CPUFREQ_INCOMPATIBLE (1) | 368 | #define CPUFREQ_INCOMPATIBLE (1) |
368 | #define CPUFREQ_NOTIFY (2) | 369 | #define CPUFREQ_NOTIFY (2) |
369 | #define CPUFREQ_START (3) | 370 | #define CPUFREQ_START (3) |
370 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | 371 | #define CPUFREQ_CREATE_POLICY (4) |
371 | #define CPUFREQ_CREATE_POLICY (5) | 372 | #define CPUFREQ_REMOVE_POLICY (5) |
372 | #define CPUFREQ_REMOVE_POLICY (6) | ||
373 | 373 | ||
374 | #ifdef CONFIG_CPU_FREQ | 374 | #ifdef CONFIG_CPU_FREQ |
375 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 375 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index ab70f3bc44ad..f551a9299ac9 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -50,6 +50,15 @@ struct cpuidle_state { | |||
50 | int index); | 50 | int index); |
51 | 51 | ||
52 | int (*enter_dead) (struct cpuidle_device *dev, int index); | 52 | int (*enter_dead) (struct cpuidle_device *dev, int index); |
53 | |||
54 | /* | ||
55 | * CPUs execute ->enter_freeze with the local tick or entire timekeeping | ||
56 | * suspended, so it must not re-enable interrupts at any point (even | ||
57 | * temporarily) or attempt to change states of clock event devices. | ||
58 | */ | ||
59 | void (*enter_freeze) (struct cpuidle_device *dev, | ||
60 | struct cpuidle_driver *drv, | ||
61 | int index); | ||
53 | }; | 62 | }; |
54 | 63 | ||
55 | /* Idle State Flags */ | 64 | /* Idle State Flags */ |
@@ -141,7 +150,7 @@ extern void cpuidle_resume(void); | |||
141 | extern int cpuidle_enable_device(struct cpuidle_device *dev); | 150 | extern int cpuidle_enable_device(struct cpuidle_device *dev); |
142 | extern void cpuidle_disable_device(struct cpuidle_device *dev); | 151 | extern void cpuidle_disable_device(struct cpuidle_device *dev); |
143 | extern int cpuidle_play_dead(void); | 152 | extern int cpuidle_play_dead(void); |
144 | extern void cpuidle_use_deepest_state(bool enable); | 153 | extern void cpuidle_enter_freeze(void); |
145 | 154 | ||
146 | extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); | 155 | extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); |
147 | #else | 156 | #else |
@@ -174,7 +183,7 @@ static inline int cpuidle_enable_device(struct cpuidle_device *dev) | |||
174 | {return -ENODEV; } | 183 | {return -ENODEV; } |
175 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } | 184 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } |
176 | static inline int cpuidle_play_dead(void) {return -ENODEV; } | 185 | static inline int cpuidle_play_dead(void) {return -ENODEV; } |
177 | static inline void cpuidle_use_deepest_state(bool enable) {} | 186 | static inline void cpuidle_enter_freeze(void) { } |
178 | static inline struct cpuidle_driver *cpuidle_get_cpu_driver( | 187 | static inline struct cpuidle_driver *cpuidle_get_cpu_driver( |
179 | struct cpuidle_device *dev) {return NULL; } | 188 | struct cpuidle_device *dev) {return NULL; } |
180 | #endif | 189 | #endif |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index b950e9d6008b..086549a665e2 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -22,6 +22,14 @@ typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | |||
22 | */ | 22 | */ |
23 | #define cpumask_bits(maskp) ((maskp)->bits) | 23 | #define cpumask_bits(maskp) ((maskp)->bits) |
24 | 24 | ||
25 | /** | ||
26 | * cpumask_pr_args - printf args to output a cpumask | ||
27 | * @maskp: cpumask to be printed | ||
28 | * | ||
29 | * Can be used to provide arguments for '%*pb[l]' when printing a cpumask. | ||
30 | */ | ||
31 | #define cpumask_pr_args(maskp) nr_cpu_ids, cpumask_bits(maskp) | ||
32 | |||
25 | #if NR_CPUS == 1 | 33 | #if NR_CPUS == 1 |
26 | #define nr_cpu_ids 1 | 34 | #define nr_cpu_ids 1 |
27 | #else | 35 | #else |
@@ -539,21 +547,6 @@ static inline void cpumask_copy(struct cpumask *dstp, | |||
539 | #define cpumask_of(cpu) (get_cpu_mask(cpu)) | 547 | #define cpumask_of(cpu) (get_cpu_mask(cpu)) |
540 | 548 | ||
541 | /** | 549 | /** |
542 | * cpumask_scnprintf - print a cpumask into a string as comma-separated hex | ||
543 | * @buf: the buffer to sprintf into | ||
544 | * @len: the length of the buffer | ||
545 | * @srcp: the cpumask to print | ||
546 | * | ||
547 | * If len is zero, returns zero. Otherwise returns the length of the | ||
548 | * (nul-terminated) @buf string. | ||
549 | */ | ||
550 | static inline int cpumask_scnprintf(char *buf, int len, | ||
551 | const struct cpumask *srcp) | ||
552 | { | ||
553 | return bitmap_scnprintf(buf, len, cpumask_bits(srcp), nr_cpumask_bits); | ||
554 | } | ||
555 | |||
556 | /** | ||
557 | * cpumask_parse_user - extract a cpumask from a user string | 550 | * cpumask_parse_user - extract a cpumask from a user string |
558 | * @buf: the buffer to extract from | 551 | * @buf: the buffer to extract from |
559 | * @len: the length of the buffer | 552 | * @len: the length of the buffer |
@@ -564,7 +557,7 @@ static inline int cpumask_scnprintf(char *buf, int len, | |||
564 | static inline int cpumask_parse_user(const char __user *buf, int len, | 557 | static inline int cpumask_parse_user(const char __user *buf, int len, |
565 | struct cpumask *dstp) | 558 | struct cpumask *dstp) |
566 | { | 559 | { |
567 | return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | 560 | return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpu_ids); |
568 | } | 561 | } |
569 | 562 | ||
570 | /** | 563 | /** |
@@ -579,23 +572,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len, | |||
579 | struct cpumask *dstp) | 572 | struct cpumask *dstp) |
580 | { | 573 | { |
581 | return bitmap_parselist_user(buf, len, cpumask_bits(dstp), | 574 | return bitmap_parselist_user(buf, len, cpumask_bits(dstp), |
582 | nr_cpumask_bits); | 575 | nr_cpu_ids); |
583 | } | ||
584 | |||
585 | /** | ||
586 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list | ||
587 | * @buf: the buffer to sprintf into | ||
588 | * @len: the length of the buffer | ||
589 | * @srcp: the cpumask to print | ||
590 | * | ||
591 | * If len is zero, returns zero. Otherwise returns the length of the | ||
592 | * (nul-terminated) @buf string. | ||
593 | */ | ||
594 | static inline int cpulist_scnprintf(char *buf, int len, | ||
595 | const struct cpumask *srcp) | ||
596 | { | ||
597 | return bitmap_scnlistprintf(buf, len, cpumask_bits(srcp), | ||
598 | nr_cpumask_bits); | ||
599 | } | 576 | } |
600 | 577 | ||
601 | /** | 578 | /** |
@@ -610,7 +587,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | |||
610 | char *nl = strchr(buf, '\n'); | 587 | char *nl = strchr(buf, '\n'); |
611 | unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); | 588 | unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); |
612 | 589 | ||
613 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | 590 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpu_ids); |
614 | } | 591 | } |
615 | 592 | ||
616 | /** | 593 | /** |
@@ -622,7 +599,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | |||
622 | */ | 599 | */ |
623 | static inline int cpulist_parse(const char *buf, struct cpumask *dstp) | 600 | static inline int cpulist_parse(const char *buf, struct cpumask *dstp) |
624 | { | 601 | { |
625 | return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits); | 602 | return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpu_ids); |
626 | } | 603 | } |
627 | 604 | ||
628 | /** | 605 | /** |
@@ -817,7 +794,7 @@ static inline ssize_t | |||
817 | cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) | 794 | cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) |
818 | { | 795 | { |
819 | return bitmap_print_to_pagebuf(list, buf, cpumask_bits(mask), | 796 | return bitmap_print_to_pagebuf(list, buf, cpumask_bits(mask), |
820 | nr_cpumask_bits); | 797 | nr_cpu_ids); |
821 | } | 798 | } |
822 | 799 | ||
823 | /* | 800 | /* |
@@ -905,13 +882,13 @@ static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | |||
905 | } | 882 | } |
906 | 883 | ||
907 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | 884 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) |
908 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | 885 | static inline void __cpus_setall(cpumask_t *dstp, unsigned int nbits) |
909 | { | 886 | { |
910 | bitmap_fill(dstp->bits, nbits); | 887 | bitmap_fill(dstp->bits, nbits); |
911 | } | 888 | } |
912 | 889 | ||
913 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | 890 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) |
914 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | 891 | static inline void __cpus_clear(cpumask_t *dstp, unsigned int nbits) |
915 | { | 892 | { |
916 | bitmap_zero(dstp->bits, nbits); | 893 | bitmap_zero(dstp->bits, nbits); |
917 | } | 894 | } |
@@ -927,21 +904,21 @@ static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | |||
927 | 904 | ||
928 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | 905 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) |
929 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | 906 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, |
930 | const cpumask_t *src2p, int nbits) | 907 | const cpumask_t *src2p, unsigned int nbits) |
931 | { | 908 | { |
932 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | 909 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); |
933 | } | 910 | } |
934 | 911 | ||
935 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | 912 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) |
936 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | 913 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, |
937 | const cpumask_t *src2p, int nbits) | 914 | const cpumask_t *src2p, unsigned int nbits) |
938 | { | 915 | { |
939 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | 916 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); |
940 | } | 917 | } |
941 | 918 | ||
942 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | 919 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) |
943 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | 920 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, |
944 | const cpumask_t *src2p, int nbits) | 921 | const cpumask_t *src2p, unsigned int nbits) |
945 | { | 922 | { |
946 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | 923 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); |
947 | } | 924 | } |
@@ -949,40 +926,40 @@ static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | |||
949 | #define cpus_andnot(dst, src1, src2) \ | 926 | #define cpus_andnot(dst, src1, src2) \ |
950 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | 927 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) |
951 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | 928 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, |
952 | const cpumask_t *src2p, int nbits) | 929 | const cpumask_t *src2p, unsigned int nbits) |
953 | { | 930 | { |
954 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | 931 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); |
955 | } | 932 | } |
956 | 933 | ||
957 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | 934 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) |
958 | static inline int __cpus_equal(const cpumask_t *src1p, | 935 | static inline int __cpus_equal(const cpumask_t *src1p, |
959 | const cpumask_t *src2p, int nbits) | 936 | const cpumask_t *src2p, unsigned int nbits) |
960 | { | 937 | { |
961 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | 938 | return bitmap_equal(src1p->bits, src2p->bits, nbits); |
962 | } | 939 | } |
963 | 940 | ||
964 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | 941 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) |
965 | static inline int __cpus_intersects(const cpumask_t *src1p, | 942 | static inline int __cpus_intersects(const cpumask_t *src1p, |
966 | const cpumask_t *src2p, int nbits) | 943 | const cpumask_t *src2p, unsigned int nbits) |
967 | { | 944 | { |
968 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | 945 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); |
969 | } | 946 | } |
970 | 947 | ||
971 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | 948 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) |
972 | static inline int __cpus_subset(const cpumask_t *src1p, | 949 | static inline int __cpus_subset(const cpumask_t *src1p, |
973 | const cpumask_t *src2p, int nbits) | 950 | const cpumask_t *src2p, unsigned int nbits) |
974 | { | 951 | { |
975 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | 952 | return bitmap_subset(src1p->bits, src2p->bits, nbits); |
976 | } | 953 | } |
977 | 954 | ||
978 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | 955 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) |
979 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | 956 | static inline int __cpus_empty(const cpumask_t *srcp, unsigned int nbits) |
980 | { | 957 | { |
981 | return bitmap_empty(srcp->bits, nbits); | 958 | return bitmap_empty(srcp->bits, nbits); |
982 | } | 959 | } |
983 | 960 | ||
984 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | 961 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) |
985 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | 962 | static inline int __cpus_weight(const cpumask_t *srcp, unsigned int nbits) |
986 | { | 963 | { |
987 | return bitmap_weight(srcp->bits, nbits); | 964 | return bitmap_weight(srcp->bits, nbits); |
988 | } | 965 | } |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 9c8776d0ada8..fb5ef16d6a12 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -1147,7 +1147,7 @@ static inline void ablkcipher_request_free(struct ablkcipher_request *req) | |||
1147 | * cipher operation completes. | 1147 | * cipher operation completes. |
1148 | * | 1148 | * |
1149 | * The callback function is registered with the ablkcipher_request handle and | 1149 | * The callback function is registered with the ablkcipher_request handle and |
1150 | * must comply with the following template: | 1150 | * must comply with the following template |
1151 | * | 1151 | * |
1152 | * void callback_function(struct crypto_async_request *req, int error) | 1152 | * void callback_function(struct crypto_async_request *req, int error) |
1153 | */ | 1153 | */ |
@@ -1174,7 +1174,7 @@ static inline void ablkcipher_request_set_callback( | |||
1174 | * | 1174 | * |
1175 | * For encryption, the source is treated as the plaintext and the | 1175 | * For encryption, the source is treated as the plaintext and the |
1176 | * destination is the ciphertext. For a decryption operation, the use is | 1176 | * destination is the ciphertext. For a decryption operation, the use is |
1177 | * reversed: the source is the ciphertext and the destination is the plaintext. | 1177 | * reversed - the source is the ciphertext and the destination is the plaintext. |
1178 | */ | 1178 | */ |
1179 | static inline void ablkcipher_request_set_crypt( | 1179 | static inline void ablkcipher_request_set_crypt( |
1180 | struct ablkcipher_request *req, | 1180 | struct ablkcipher_request *req, |
@@ -1412,6 +1412,9 @@ static inline int crypto_aead_encrypt(struct aead_request *req) | |||
1412 | */ | 1412 | */ |
1413 | static inline int crypto_aead_decrypt(struct aead_request *req) | 1413 | static inline int crypto_aead_decrypt(struct aead_request *req) |
1414 | { | 1414 | { |
1415 | if (req->cryptlen < crypto_aead_authsize(crypto_aead_reqtfm(req))) | ||
1416 | return -EINVAL; | ||
1417 | |||
1415 | return crypto_aead_crt(crypto_aead_reqtfm(req))->decrypt(req); | 1418 | return crypto_aead_crt(crypto_aead_reqtfm(req))->decrypt(req); |
1416 | } | 1419 | } |
1417 | 1420 | ||
@@ -1506,7 +1509,7 @@ static inline void aead_request_free(struct aead_request *req) | |||
1506 | * completes | 1509 | * completes |
1507 | * | 1510 | * |
1508 | * The callback function is registered with the aead_request handle and | 1511 | * The callback function is registered with the aead_request handle and |
1509 | * must comply with the following template: | 1512 | * must comply with the following template |
1510 | * | 1513 | * |
1511 | * void callback_function(struct crypto_async_request *req, int error) | 1514 | * void callback_function(struct crypto_async_request *req, int error) |
1512 | */ | 1515 | */ |
@@ -1533,7 +1536,7 @@ static inline void aead_request_set_callback(struct aead_request *req, | |||
1533 | * | 1536 | * |
1534 | * For encryption, the source is treated as the plaintext and the | 1537 | * For encryption, the source is treated as the plaintext and the |
1535 | * destination is the ciphertext. For a decryption operation, the use is | 1538 | * destination is the ciphertext. For a decryption operation, the use is |
1536 | * reversed: the source is the ciphertext and the destination is the plaintext. | 1539 | * reversed - the source is the ciphertext and the destination is the plaintext. |
1537 | * | 1540 | * |
1538 | * IMPORTANT NOTE AEAD requires an authentication tag (MAC). For decryption, | 1541 | * IMPORTANT NOTE AEAD requires an authentication tag (MAC). For decryption, |
1539 | * the caller must concatenate the ciphertext followed by the | 1542 | * the caller must concatenate the ciphertext followed by the |
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h index 2cd9f1cf9fa3..f4754282c9c2 100644 --- a/include/linux/cryptohash.h +++ b/include/linux/cryptohash.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __CRYPTOHASH_H | 1 | #ifndef __CRYPTOHASH_H |
2 | #define __CRYPTOHASH_H | 2 | #define __CRYPTOHASH_H |
3 | 3 | ||
4 | #include <uapi/linux/types.h> | ||
5 | |||
4 | #define SHA_DIGEST_WORDS 5 | 6 | #define SHA_DIGEST_WORDS 5 |
5 | #define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) | 7 | #define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) |
6 | #define SHA_WORKSPACE_WORDS 16 | 8 | #define SHA_WORKSPACE_WORDS 16 |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 5a813988e6d4..d8358799c594 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -215,13 +215,16 @@ struct dentry_operations { | |||
215 | #define DCACHE_LRU_LIST 0x00080000 | 215 | #define DCACHE_LRU_LIST 0x00080000 |
216 | 216 | ||
217 | #define DCACHE_ENTRY_TYPE 0x00700000 | 217 | #define DCACHE_ENTRY_TYPE 0x00700000 |
218 | #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry */ | 218 | #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry (maybe fallthru to nowhere) */ |
219 | #define DCACHE_DIRECTORY_TYPE 0x00100000 /* Normal directory */ | 219 | #define DCACHE_WHITEOUT_TYPE 0x00100000 /* Whiteout dentry (stop pathwalk) */ |
220 | #define DCACHE_AUTODIR_TYPE 0x00200000 /* Lookupless directory (presumed automount) */ | 220 | #define DCACHE_DIRECTORY_TYPE 0x00200000 /* Normal directory */ |
221 | #define DCACHE_SYMLINK_TYPE 0x00300000 /* Symlink */ | 221 | #define DCACHE_AUTODIR_TYPE 0x00300000 /* Lookupless directory (presumed automount) */ |
222 | #define DCACHE_FILE_TYPE 0x00400000 /* Other file type */ | 222 | #define DCACHE_REGULAR_TYPE 0x00400000 /* Regular file type (or fallthru to such) */ |
223 | #define DCACHE_SPECIAL_TYPE 0x00500000 /* Other file type (or fallthru to such) */ | ||
224 | #define DCACHE_SYMLINK_TYPE 0x00600000 /* Symlink (or fallthru to such) */ | ||
223 | 225 | ||
224 | #define DCACHE_MAY_FREE 0x00800000 | 226 | #define DCACHE_MAY_FREE 0x00800000 |
227 | #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */ | ||
225 | 228 | ||
226 | extern seqlock_t rename_lock; | 229 | extern seqlock_t rename_lock; |
227 | 230 | ||
@@ -319,9 +322,6 @@ static inline unsigned d_count(const struct dentry *dentry) | |||
319 | return dentry->d_lockref.count; | 322 | return dentry->d_lockref.count; |
320 | } | 323 | } |
321 | 324 | ||
322 | /* validate "insecure" dentry pointer */ | ||
323 | extern int d_validate(struct dentry *, struct dentry *); | ||
324 | |||
325 | /* | 325 | /* |
326 | * helper function for dentry_operations.d_dname() members | 326 | * helper function for dentry_operations.d_dname() members |
327 | */ | 327 | */ |
@@ -426,6 +426,16 @@ static inline unsigned __d_entry_type(const struct dentry *dentry) | |||
426 | return dentry->d_flags & DCACHE_ENTRY_TYPE; | 426 | return dentry->d_flags & DCACHE_ENTRY_TYPE; |
427 | } | 427 | } |
428 | 428 | ||
429 | static inline bool d_is_miss(const struct dentry *dentry) | ||
430 | { | ||
431 | return __d_entry_type(dentry) == DCACHE_MISS_TYPE; | ||
432 | } | ||
433 | |||
434 | static inline bool d_is_whiteout(const struct dentry *dentry) | ||
435 | { | ||
436 | return __d_entry_type(dentry) == DCACHE_WHITEOUT_TYPE; | ||
437 | } | ||
438 | |||
429 | static inline bool d_can_lookup(const struct dentry *dentry) | 439 | static inline bool d_can_lookup(const struct dentry *dentry) |
430 | { | 440 | { |
431 | return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; | 441 | return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; |
@@ -446,14 +456,25 @@ static inline bool d_is_symlink(const struct dentry *dentry) | |||
446 | return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE; | 456 | return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE; |
447 | } | 457 | } |
448 | 458 | ||
459 | static inline bool d_is_reg(const struct dentry *dentry) | ||
460 | { | ||
461 | return __d_entry_type(dentry) == DCACHE_REGULAR_TYPE; | ||
462 | } | ||
463 | |||
464 | static inline bool d_is_special(const struct dentry *dentry) | ||
465 | { | ||
466 | return __d_entry_type(dentry) == DCACHE_SPECIAL_TYPE; | ||
467 | } | ||
468 | |||
449 | static inline bool d_is_file(const struct dentry *dentry) | 469 | static inline bool d_is_file(const struct dentry *dentry) |
450 | { | 470 | { |
451 | return __d_entry_type(dentry) == DCACHE_FILE_TYPE; | 471 | return d_is_reg(dentry) || d_is_special(dentry); |
452 | } | 472 | } |
453 | 473 | ||
454 | static inline bool d_is_negative(const struct dentry *dentry) | 474 | static inline bool d_is_negative(const struct dentry *dentry) |
455 | { | 475 | { |
456 | return __d_entry_type(dentry) == DCACHE_MISS_TYPE; | 476 | // TODO: check d_is_whiteout(dentry) also. |
477 | return d_is_miss(dentry); | ||
457 | } | 478 | } |
458 | 479 | ||
459 | static inline bool d_is_positive(const struct dentry *dentry) | 480 | static inline bool d_is_positive(const struct dentry *dentry) |
@@ -461,10 +482,75 @@ static inline bool d_is_positive(const struct dentry *dentry) | |||
461 | return !d_is_negative(dentry); | 482 | return !d_is_negative(dentry); |
462 | } | 483 | } |
463 | 484 | ||
485 | extern void d_set_fallthru(struct dentry *dentry); | ||
486 | |||
487 | static inline bool d_is_fallthru(const struct dentry *dentry) | ||
488 | { | ||
489 | return dentry->d_flags & DCACHE_FALLTHRU; | ||
490 | } | ||
491 | |||
492 | |||
464 | extern int sysctl_vfs_cache_pressure; | 493 | extern int sysctl_vfs_cache_pressure; |
465 | 494 | ||
466 | static inline unsigned long vfs_pressure_ratio(unsigned long val) | 495 | static inline unsigned long vfs_pressure_ratio(unsigned long val) |
467 | { | 496 | { |
468 | return mult_frac(val, sysctl_vfs_cache_pressure, 100); | 497 | return mult_frac(val, sysctl_vfs_cache_pressure, 100); |
469 | } | 498 | } |
499 | |||
500 | /** | ||
501 | * d_inode - Get the actual inode of this dentry | ||
502 | * @dentry: The dentry to query | ||
503 | * | ||
504 | * This is the helper normal filesystems should use to get at their own inodes | ||
505 | * in their own dentries and ignore the layering superimposed upon them. | ||
506 | */ | ||
507 | static inline struct inode *d_inode(const struct dentry *dentry) | ||
508 | { | ||
509 | return dentry->d_inode; | ||
510 | } | ||
511 | |||
512 | /** | ||
513 | * d_inode_rcu - Get the actual inode of this dentry with ACCESS_ONCE() | ||
514 | * @dentry: The dentry to query | ||
515 | * | ||
516 | * This is the helper normal filesystems should use to get at their own inodes | ||
517 | * in their own dentries and ignore the layering superimposed upon them. | ||
518 | */ | ||
519 | static inline struct inode *d_inode_rcu(const struct dentry *dentry) | ||
520 | { | ||
521 | return ACCESS_ONCE(dentry->d_inode); | ||
522 | } | ||
523 | |||
524 | /** | ||
525 | * d_backing_inode - Get upper or lower inode we should be using | ||
526 | * @upper: The upper layer | ||
527 | * | ||
528 | * This is the helper that should be used to get at the inode that will be used | ||
529 | * if this dentry were to be opened as a file. The inode may be on the upper | ||
530 | * dentry or it may be on a lower dentry pinned by the upper. | ||
531 | * | ||
532 | * Normal filesystems should not use this to access their own inodes. | ||
533 | */ | ||
534 | static inline struct inode *d_backing_inode(const struct dentry *upper) | ||
535 | { | ||
536 | struct inode *inode = upper->d_inode; | ||
537 | |||
538 | return inode; | ||
539 | } | ||
540 | |||
541 | /** | ||
542 | * d_backing_dentry - Get upper or lower dentry we should be using | ||
543 | * @upper: The upper layer | ||
544 | * | ||
545 | * This is the helper that should be used to get the dentry of the inode that | ||
546 | * will be used if this dentry were opened as a file. It may be the upper | ||
547 | * dentry or it may be a lower dentry pinned by the upper. | ||
548 | * | ||
549 | * Normal filesystems should not use this to access their own dentries. | ||
550 | */ | ||
551 | static inline struct dentry *d_backing_dentry(struct dentry *upper) | ||
552 | { | ||
553 | return upper; | ||
554 | } | ||
555 | |||
470 | #endif /* __LINUX_DCACHE_H */ | 556 | #endif /* __LINUX_DCACHE_H */ |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index da4c4983adbe..cb25af461054 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -51,11 +51,21 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode, | |||
51 | struct dentry *parent, void *data, | 51 | struct dentry *parent, void *data, |
52 | const struct file_operations *fops); | 52 | const struct file_operations *fops); |
53 | 53 | ||
54 | struct dentry *debugfs_create_file_size(const char *name, umode_t mode, | ||
55 | struct dentry *parent, void *data, | ||
56 | const struct file_operations *fops, | ||
57 | loff_t file_size); | ||
58 | |||
54 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); | 59 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); |
55 | 60 | ||
56 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | 61 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, |
57 | const char *dest); | 62 | const char *dest); |
58 | 63 | ||
64 | struct dentry *debugfs_create_automount(const char *name, | ||
65 | struct dentry *parent, | ||
66 | struct vfsmount *(*f)(void *), | ||
67 | void *data); | ||
68 | |||
59 | void debugfs_remove(struct dentry *dentry); | 69 | void debugfs_remove(struct dentry *dentry); |
60 | void debugfs_remove_recursive(struct dentry *dentry); | 70 | void debugfs_remove_recursive(struct dentry *dentry); |
61 | 71 | ||
@@ -124,6 +134,14 @@ static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, | |||
124 | return ERR_PTR(-ENODEV); | 134 | return ERR_PTR(-ENODEV); |
125 | } | 135 | } |
126 | 136 | ||
137 | static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode, | ||
138 | struct dentry *parent, void *data, | ||
139 | const struct file_operations *fops, | ||
140 | loff_t file_size) | ||
141 | { | ||
142 | return ERR_PTR(-ENODEV); | ||
143 | } | ||
144 | |||
127 | static inline struct dentry *debugfs_create_dir(const char *name, | 145 | static inline struct dentry *debugfs_create_dir(const char *name, |
128 | struct dentry *parent) | 146 | struct dentry *parent) |
129 | { | 147 | { |
diff --git a/include/linux/devfreq-event.h b/include/linux/devfreq-event.h new file mode 100644 index 000000000000..602fbbfcfeed --- /dev/null +++ b/include/linux/devfreq-event.h | |||
@@ -0,0 +1,196 @@ | |||
1 | /* | ||
2 | * devfreq-event: a framework to provide raw data and events of devfreq devices | ||
3 | * | ||
4 | * Copyright (C) 2014 Samsung Electronics | ||
5 | * Author: Chanwoo Choi <cw00.choi@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_DEVFREQ_EVENT_H__ | ||
13 | #define __LINUX_DEVFREQ_EVENT_H__ | ||
14 | |||
15 | #include <linux/device.h> | ||
16 | |||
17 | /** | ||
18 | * struct devfreq_event_dev - the devfreq-event device | ||
19 | * | ||
20 | * @node : Contain the devfreq-event device that have been registered. | ||
21 | * @dev : the device registered by devfreq-event class. dev.parent is | ||
22 | * the device using devfreq-event. | ||
23 | * @lock : a mutex to protect accessing devfreq-event. | ||
24 | * @enable_count: the number of enable function have been called. | ||
25 | * @desc : the description for devfreq-event device. | ||
26 | * | ||
27 | * This structure contains devfreq-event device information. | ||
28 | */ | ||
29 | struct devfreq_event_dev { | ||
30 | struct list_head node; | ||
31 | |||
32 | struct device dev; | ||
33 | struct mutex lock; | ||
34 | u32 enable_count; | ||
35 | |||
36 | const struct devfreq_event_desc *desc; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * struct devfreq_event_data - the devfreq-event data | ||
41 | * | ||
42 | * @load_count : load count of devfreq-event device for the given period. | ||
43 | * @total_count : total count of devfreq-event device for the given period. | ||
44 | * each count may represent a clock cycle, a time unit | ||
45 | * (ns/us/...), or anything the device driver wants. | ||
46 | * Generally, utilization is load_count / total_count. | ||
47 | * | ||
48 | * This structure contains the data of devfreq-event device for polling period. | ||
49 | */ | ||
50 | struct devfreq_event_data { | ||
51 | unsigned long load_count; | ||
52 | unsigned long total_count; | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * struct devfreq_event_ops - the operations of devfreq-event device | ||
57 | * | ||
58 | * @enable : Enable the devfreq-event device. | ||
59 | * @disable : Disable the devfreq-event device. | ||
60 | * @reset : Reset all setting of the devfreq-event device. | ||
61 | * @set_event : Set the specific event type for the devfreq-event device. | ||
62 | * @get_event : Get the result of the devfreq-event devie with specific | ||
63 | * event type. | ||
64 | * | ||
65 | * This structure contains devfreq-event device operations which can be | ||
66 | * implemented by devfreq-event device drivers. | ||
67 | */ | ||
68 | struct devfreq_event_ops { | ||
69 | /* Optional functions */ | ||
70 | int (*enable)(struct devfreq_event_dev *edev); | ||
71 | int (*disable)(struct devfreq_event_dev *edev); | ||
72 | int (*reset)(struct devfreq_event_dev *edev); | ||
73 | |||
74 | /* Mandatory functions */ | ||
75 | int (*set_event)(struct devfreq_event_dev *edev); | ||
76 | int (*get_event)(struct devfreq_event_dev *edev, | ||
77 | struct devfreq_event_data *edata); | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * struct devfreq_event_desc - the descriptor of devfreq-event device | ||
82 | * | ||
83 | * @name : the name of devfreq-event device. | ||
84 | * @driver_data : the private data for devfreq-event driver. | ||
85 | * @ops : the operation to control devfreq-event device. | ||
86 | * | ||
87 | * Each devfreq-event device is described with a this structure. | ||
88 | * This structure contains the various data for devfreq-event device. | ||
89 | */ | ||
90 | struct devfreq_event_desc { | ||
91 | const char *name; | ||
92 | void *driver_data; | ||
93 | |||
94 | struct devfreq_event_ops *ops; | ||
95 | }; | ||
96 | |||
97 | #if defined(CONFIG_PM_DEVFREQ_EVENT) | ||
98 | extern int devfreq_event_enable_edev(struct devfreq_event_dev *edev); | ||
99 | extern int devfreq_event_disable_edev(struct devfreq_event_dev *edev); | ||
100 | extern bool devfreq_event_is_enabled(struct devfreq_event_dev *edev); | ||
101 | extern int devfreq_event_set_event(struct devfreq_event_dev *edev); | ||
102 | extern int devfreq_event_get_event(struct devfreq_event_dev *edev, | ||
103 | struct devfreq_event_data *edata); | ||
104 | extern int devfreq_event_reset_event(struct devfreq_event_dev *edev); | ||
105 | extern struct devfreq_event_dev *devfreq_event_get_edev_by_phandle( | ||
106 | struct device *dev, int index); | ||
107 | extern int devfreq_event_get_edev_count(struct device *dev); | ||
108 | extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | ||
109 | struct devfreq_event_desc *desc); | ||
110 | extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev); | ||
111 | extern struct devfreq_event_dev *devm_devfreq_event_add_edev(struct device *dev, | ||
112 | struct devfreq_event_desc *desc); | ||
113 | extern void devm_devfreq_event_remove_edev(struct device *dev, | ||
114 | struct devfreq_event_dev *edev); | ||
115 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
116 | { | ||
117 | return edev->desc->driver_data; | ||
118 | } | ||
119 | #else | ||
120 | static inline int devfreq_event_enable_edev(struct devfreq_event_dev *edev) | ||
121 | { | ||
122 | return -EINVAL; | ||
123 | } | ||
124 | |||
125 | static inline int devfreq_event_disable_edev(struct devfreq_event_dev *edev) | ||
126 | { | ||
127 | return -EINVAL; | ||
128 | } | ||
129 | |||
130 | static inline bool devfreq_event_is_enabled(struct devfreq_event_dev *edev) | ||
131 | { | ||
132 | return false; | ||
133 | } | ||
134 | |||
135 | static inline int devfreq_event_set_event(struct devfreq_event_dev *edev) | ||
136 | { | ||
137 | return -EINVAL; | ||
138 | } | ||
139 | |||
140 | static inline int devfreq_event_get_event(struct devfreq_event_dev *edev, | ||
141 | struct devfreq_event_data *edata) | ||
142 | { | ||
143 | return -EINVAL; | ||
144 | } | ||
145 | |||
146 | static inline int devfreq_event_reset_event(struct devfreq_event_dev *edev) | ||
147 | { | ||
148 | return -EINVAL; | ||
149 | } | ||
150 | |||
151 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
152 | { | ||
153 | return ERR_PTR(-EINVAL); | ||
154 | } | ||
155 | |||
156 | static inline struct devfreq_event_dev *devfreq_event_get_edev_by_phandle( | ||
157 | struct device *dev, int index) | ||
158 | { | ||
159 | return ERR_PTR(-EINVAL); | ||
160 | } | ||
161 | |||
162 | static inline int devfreq_event_get_edev_count(struct device *dev) | ||
163 | { | ||
164 | return -EINVAL; | ||
165 | } | ||
166 | |||
167 | static inline struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | ||
168 | struct devfreq_event_desc *desc) | ||
169 | { | ||
170 | return ERR_PTR(-EINVAL); | ||
171 | } | ||
172 | |||
173 | static inline int devfreq_event_remove_edev(struct devfreq_event_dev *edev) | ||
174 | { | ||
175 | return -EINVAL; | ||
176 | } | ||
177 | |||
178 | static inline struct devfreq_event_dev *devm_devfreq_event_add_edev( | ||
179 | struct device *dev, | ||
180 | struct devfreq_event_desc *desc) | ||
181 | { | ||
182 | return ERR_PTR(-EINVAL); | ||
183 | } | ||
184 | |||
185 | static inline void devm_devfreq_event_remove_edev(struct device *dev, | ||
186 | struct devfreq_event_dev *edev) | ||
187 | { | ||
188 | } | ||
189 | |||
190 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
191 | { | ||
192 | return NULL; | ||
193 | } | ||
194 | #endif /* CONFIG_PM_DEVFREQ_EVENT */ | ||
195 | |||
196 | #endif /* __LINUX_DEVFREQ_EVENT_H__ */ | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index ca6d2acc5eb7..2646aed1d3fe 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -48,6 +48,11 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); | |||
48 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio); | 48 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio); |
49 | typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, | 49 | typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, |
50 | union map_info *map_context); | 50 | union map_info *map_context); |
51 | typedef int (*dm_clone_and_map_request_fn) (struct dm_target *ti, | ||
52 | struct request *rq, | ||
53 | union map_info *map_context, | ||
54 | struct request **clone); | ||
55 | typedef void (*dm_release_clone_request_fn) (struct request *clone); | ||
51 | 56 | ||
52 | /* | 57 | /* |
53 | * Returns: | 58 | * Returns: |
@@ -143,6 +148,8 @@ struct target_type { | |||
143 | dm_dtr_fn dtr; | 148 | dm_dtr_fn dtr; |
144 | dm_map_fn map; | 149 | dm_map_fn map; |
145 | dm_map_request_fn map_rq; | 150 | dm_map_request_fn map_rq; |
151 | dm_clone_and_map_request_fn clone_and_map_rq; | ||
152 | dm_release_clone_request_fn release_clone_rq; | ||
146 | dm_endio_fn end_io; | 153 | dm_endio_fn end_io; |
147 | dm_request_endio_fn rq_end_io; | 154 | dm_request_endio_fn rq_end_io; |
148 | dm_presuspend_fn presuspend; | 155 | dm_presuspend_fn presuspend; |
@@ -600,9 +607,6 @@ static inline unsigned long to_bytes(sector_t n) | |||
600 | /*----------------------------------------------------------------- | 607 | /*----------------------------------------------------------------- |
601 | * Helper for block layer and dm core operations | 608 | * Helper for block layer and dm core operations |
602 | *---------------------------------------------------------------*/ | 609 | *---------------------------------------------------------------*/ |
603 | void dm_dispatch_request(struct request *rq); | ||
604 | void dm_requeue_unmapped_request(struct request *rq); | ||
605 | void dm_kill_unmapped_request(struct request *rq, int error); | ||
606 | int dm_underlying_device_busy(struct request_queue *q); | 610 | int dm_underlying_device_busy(struct request_queue *q); |
607 | 611 | ||
608 | #endif /* _LINUX_DEVICE_MAPPER_H */ | 612 | #endif /* _LINUX_DEVICE_MAPPER_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index fb506738f7b7..0eb8ee2dc6d1 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -1038,22 +1038,22 @@ extern __printf(3, 4) | |||
1038 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); | 1038 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); |
1039 | 1039 | ||
1040 | extern __printf(3, 4) | 1040 | extern __printf(3, 4) |
1041 | int dev_printk(const char *level, const struct device *dev, | 1041 | void dev_printk(const char *level, const struct device *dev, |
1042 | const char *fmt, ...); | 1042 | const char *fmt, ...); |
1043 | extern __printf(2, 3) | 1043 | extern __printf(2, 3) |
1044 | int dev_emerg(const struct device *dev, const char *fmt, ...); | 1044 | void dev_emerg(const struct device *dev, const char *fmt, ...); |
1045 | extern __printf(2, 3) | 1045 | extern __printf(2, 3) |
1046 | int dev_alert(const struct device *dev, const char *fmt, ...); | 1046 | void dev_alert(const struct device *dev, const char *fmt, ...); |
1047 | extern __printf(2, 3) | 1047 | extern __printf(2, 3) |
1048 | int dev_crit(const struct device *dev, const char *fmt, ...); | 1048 | void dev_crit(const struct device *dev, const char *fmt, ...); |
1049 | extern __printf(2, 3) | 1049 | extern __printf(2, 3) |
1050 | int dev_err(const struct device *dev, const char *fmt, ...); | 1050 | void dev_err(const struct device *dev, const char *fmt, ...); |
1051 | extern __printf(2, 3) | 1051 | extern __printf(2, 3) |
1052 | int dev_warn(const struct device *dev, const char *fmt, ...); | 1052 | void dev_warn(const struct device *dev, const char *fmt, ...); |
1053 | extern __printf(2, 3) | 1053 | extern __printf(2, 3) |
1054 | int dev_notice(const struct device *dev, const char *fmt, ...); | 1054 | void dev_notice(const struct device *dev, const char *fmt, ...); |
1055 | extern __printf(2, 3) | 1055 | extern __printf(2, 3) |
1056 | int _dev_info(const struct device *dev, const char *fmt, ...); | 1056 | void _dev_info(const struct device *dev, const char *fmt, ...); |
1057 | 1057 | ||
1058 | #else | 1058 | #else |
1059 | 1059 | ||
@@ -1065,35 +1065,35 @@ static inline __printf(3, 4) | |||
1065 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) | 1065 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) |
1066 | { return 0; } | 1066 | { return 0; } |
1067 | 1067 | ||
1068 | static inline int __dev_printk(const char *level, const struct device *dev, | 1068 | static inline void __dev_printk(const char *level, const struct device *dev, |
1069 | struct va_format *vaf) | 1069 | struct va_format *vaf) |
1070 | { return 0; } | 1070 | {} |
1071 | static inline __printf(3, 4) | 1071 | static inline __printf(3, 4) |
1072 | int dev_printk(const char *level, const struct device *dev, | 1072 | void dev_printk(const char *level, const struct device *dev, |
1073 | const char *fmt, ...) | 1073 | const char *fmt, ...) |
1074 | { return 0; } | 1074 | {} |
1075 | 1075 | ||
1076 | static inline __printf(2, 3) | 1076 | static inline __printf(2, 3) |
1077 | int dev_emerg(const struct device *dev, const char *fmt, ...) | 1077 | void dev_emerg(const struct device *dev, const char *fmt, ...) |
1078 | { return 0; } | 1078 | {} |
1079 | static inline __printf(2, 3) | 1079 | static inline __printf(2, 3) |
1080 | int dev_crit(const struct device *dev, const char *fmt, ...) | 1080 | void dev_crit(const struct device *dev, const char *fmt, ...) |
1081 | { return 0; } | 1081 | {} |
1082 | static inline __printf(2, 3) | 1082 | static inline __printf(2, 3) |
1083 | int dev_alert(const struct device *dev, const char *fmt, ...) | 1083 | void dev_alert(const struct device *dev, const char *fmt, ...) |
1084 | { return 0; } | 1084 | {} |
1085 | static inline __printf(2, 3) | 1085 | static inline __printf(2, 3) |
1086 | int dev_err(const struct device *dev, const char *fmt, ...) | 1086 | void dev_err(const struct device *dev, const char *fmt, ...) |
1087 | { return 0; } | 1087 | {} |
1088 | static inline __printf(2, 3) | 1088 | static inline __printf(2, 3) |
1089 | int dev_warn(const struct device *dev, const char *fmt, ...) | 1089 | void dev_warn(const struct device *dev, const char *fmt, ...) |
1090 | { return 0; } | 1090 | {} |
1091 | static inline __printf(2, 3) | 1091 | static inline __printf(2, 3) |
1092 | int dev_notice(const struct device *dev, const char *fmt, ...) | 1092 | void dev_notice(const struct device *dev, const char *fmt, ...) |
1093 | { return 0; } | 1093 | {} |
1094 | static inline __printf(2, 3) | 1094 | static inline __printf(2, 3) |
1095 | int _dev_info(const struct device *dev, const char *fmt, ...) | 1095 | void _dev_info(const struct device *dev, const char *fmt, ...) |
1096 | { return 0; } | 1096 | {} |
1097 | 1097 | ||
1098 | #endif | 1098 | #endif |
1099 | 1099 | ||
@@ -1119,7 +1119,6 @@ do { \ | |||
1119 | ({ \ | 1119 | ({ \ |
1120 | if (0) \ | 1120 | if (0) \ |
1121 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | 1121 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ |
1122 | 0; \ | ||
1123 | }) | 1122 | }) |
1124 | #endif | 1123 | #endif |
1125 | 1124 | ||
@@ -1156,7 +1155,7 @@ do { \ | |||
1156 | #define dev_info_once(dev, fmt, ...) \ | 1155 | #define dev_info_once(dev, fmt, ...) \ |
1157 | dev_level_once(dev_info, dev, fmt, ##__VA_ARGS__) | 1156 | dev_level_once(dev_info, dev, fmt, ##__VA_ARGS__) |
1158 | #define dev_dbg_once(dev, fmt, ...) \ | 1157 | #define dev_dbg_once(dev, fmt, ...) \ |
1159 | dev_level_once(dev_info, dev, fmt, ##__VA_ARGS__) | 1158 | dev_level_once(dev_dbg, dev, fmt, ##__VA_ARGS__) |
1160 | 1159 | ||
1161 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ | 1160 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ |
1162 | do { \ | 1161 | do { \ |
@@ -1215,7 +1214,6 @@ do { \ | |||
1215 | ({ \ | 1214 | ({ \ |
1216 | if (0) \ | 1215 | if (0) \ |
1217 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | 1216 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ |
1218 | 0; \ | ||
1219 | }) | 1217 | }) |
1220 | #endif | 1218 | #endif |
1221 | 1219 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 40cd75e21ea2..b6997a0cb528 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -189,25 +189,6 @@ enum dma_ctrl_flags { | |||
189 | }; | 189 | }; |
190 | 190 | ||
191 | /** | 191 | /** |
192 | * enum dma_ctrl_cmd - DMA operations that can optionally be exercised | ||
193 | * on a running channel. | ||
194 | * @DMA_TERMINATE_ALL: terminate all ongoing transfers | ||
195 | * @DMA_PAUSE: pause ongoing transfers | ||
196 | * @DMA_RESUME: resume paused transfer | ||
197 | * @DMA_SLAVE_CONFIG: this command is only implemented by DMA controllers | ||
198 | * that need to runtime reconfigure the slave channels (as opposed to passing | ||
199 | * configuration data in statically from the platform). An additional | ||
200 | * argument of struct dma_slave_config must be passed in with this | ||
201 | * command. | ||
202 | */ | ||
203 | enum dma_ctrl_cmd { | ||
204 | DMA_TERMINATE_ALL, | ||
205 | DMA_PAUSE, | ||
206 | DMA_RESUME, | ||
207 | DMA_SLAVE_CONFIG, | ||
208 | }; | ||
209 | |||
210 | /** | ||
211 | * enum sum_check_bits - bit position of pq_check_flags | 192 | * enum sum_check_bits - bit position of pq_check_flags |
212 | */ | 193 | */ |
213 | enum sum_check_bits { | 194 | enum sum_check_bits { |
@@ -298,6 +279,9 @@ enum dma_slave_buswidth { | |||
298 | DMA_SLAVE_BUSWIDTH_3_BYTES = 3, | 279 | DMA_SLAVE_BUSWIDTH_3_BYTES = 3, |
299 | DMA_SLAVE_BUSWIDTH_4_BYTES = 4, | 280 | DMA_SLAVE_BUSWIDTH_4_BYTES = 4, |
300 | DMA_SLAVE_BUSWIDTH_8_BYTES = 8, | 281 | DMA_SLAVE_BUSWIDTH_8_BYTES = 8, |
282 | DMA_SLAVE_BUSWIDTH_16_BYTES = 16, | ||
283 | DMA_SLAVE_BUSWIDTH_32_BYTES = 32, | ||
284 | DMA_SLAVE_BUSWIDTH_64_BYTES = 64, | ||
301 | }; | 285 | }; |
302 | 286 | ||
303 | /** | 287 | /** |
@@ -336,9 +320,8 @@ enum dma_slave_buswidth { | |||
336 | * This struct is passed in as configuration data to a DMA engine | 320 | * This struct is passed in as configuration data to a DMA engine |
337 | * in order to set up a certain channel for DMA transport at runtime. | 321 | * in order to set up a certain channel for DMA transport at runtime. |
338 | * The DMA device/engine has to provide support for an additional | 322 | * The DMA device/engine has to provide support for an additional |
339 | * command in the channel config interface, DMA_SLAVE_CONFIG | 323 | * callback in the dma_device structure, device_config and this struct |
340 | * and this struct will then be passed in as an argument to the | 324 | * will then be passed in as an argument to the function. |
341 | * DMA engine device_control() function. | ||
342 | * | 325 | * |
343 | * The rationale for adding configuration information to this struct is as | 326 | * The rationale for adding configuration information to this struct is as |
344 | * follows: if it is likely that more than one DMA slave controllers in | 327 | * follows: if it is likely that more than one DMA slave controllers in |
@@ -387,7 +370,7 @@ enum dma_residue_granularity { | |||
387 | /* struct dma_slave_caps - expose capabilities of a slave channel only | 370 | /* struct dma_slave_caps - expose capabilities of a slave channel only |
388 | * | 371 | * |
389 | * @src_addr_widths: bit mask of src addr widths the channel supports | 372 | * @src_addr_widths: bit mask of src addr widths the channel supports |
390 | * @dstn_addr_widths: bit mask of dstn addr widths the channel supports | 373 | * @dst_addr_widths: bit mask of dstn addr widths the channel supports |
391 | * @directions: bit mask of slave direction the channel supported | 374 | * @directions: bit mask of slave direction the channel supported |
392 | * since the enum dma_transfer_direction is not defined as bits for each | 375 | * since the enum dma_transfer_direction is not defined as bits for each |
393 | * type of direction, the dma controller should fill (1 << <TYPE>) and same | 376 | * type of direction, the dma controller should fill (1 << <TYPE>) and same |
@@ -398,7 +381,7 @@ enum dma_residue_granularity { | |||
398 | */ | 381 | */ |
399 | struct dma_slave_caps { | 382 | struct dma_slave_caps { |
400 | u32 src_addr_widths; | 383 | u32 src_addr_widths; |
401 | u32 dstn_addr_widths; | 384 | u32 dst_addr_widths; |
402 | u32 directions; | 385 | u32 directions; |
403 | bool cmd_pause; | 386 | bool cmd_pause; |
404 | bool cmd_terminate; | 387 | bool cmd_terminate; |
@@ -594,6 +577,14 @@ struct dma_tx_state { | |||
594 | * @fill_align: alignment shift for memset operations | 577 | * @fill_align: alignment shift for memset operations |
595 | * @dev_id: unique device ID | 578 | * @dev_id: unique device ID |
596 | * @dev: struct device reference for dma mapping api | 579 | * @dev: struct device reference for dma mapping api |
580 | * @src_addr_widths: bit mask of src addr widths the device supports | ||
581 | * @dst_addr_widths: bit mask of dst addr widths the device supports | ||
582 | * @directions: bit mask of slave direction the device supports since | ||
583 | * the enum dma_transfer_direction is not defined as bits for | ||
584 | * each type of direction, the dma controller should fill (1 << | ||
585 | * <TYPE>) and same should be checked by controller as well | ||
586 | * @residue_granularity: granularity of the transfer residue reported | ||
587 | * by tx_status | ||
597 | * @device_alloc_chan_resources: allocate resources and return the | 588 | * @device_alloc_chan_resources: allocate resources and return the |
598 | * number of allocated descriptors | 589 | * number of allocated descriptors |
599 | * @device_free_chan_resources: release DMA channel's resources | 590 | * @device_free_chan_resources: release DMA channel's resources |
@@ -608,14 +599,19 @@ struct dma_tx_state { | |||
608 | * The function takes a buffer of size buf_len. The callback function will | 599 | * The function takes a buffer of size buf_len. The callback function will |
609 | * be called after period_len bytes have been transferred. | 600 | * be called after period_len bytes have been transferred. |
610 | * @device_prep_interleaved_dma: Transfer expression in a generic way. | 601 | * @device_prep_interleaved_dma: Transfer expression in a generic way. |
611 | * @device_control: manipulate all pending operations on a channel, returns | 602 | * @device_config: Pushes a new configuration to a channel, return 0 or an error |
612 | * zero or error code | 603 | * code |
604 | * @device_pause: Pauses any transfer happening on a channel. Returns | ||
605 | * 0 or an error code | ||
606 | * @device_resume: Resumes any transfer on a channel previously | ||
607 | * paused. Returns 0 or an error code | ||
608 | * @device_terminate_all: Aborts all transfers on a channel. Returns 0 | ||
609 | * or an error code | ||
613 | * @device_tx_status: poll for transaction completion, the optional | 610 | * @device_tx_status: poll for transaction completion, the optional |
614 | * txstate parameter can be supplied with a pointer to get a | 611 | * txstate parameter can be supplied with a pointer to get a |
615 | * struct with auxiliary transfer status information, otherwise the call | 612 | * struct with auxiliary transfer status information, otherwise the call |
616 | * will just return a simple status code | 613 | * will just return a simple status code |
617 | * @device_issue_pending: push pending transactions to hardware | 614 | * @device_issue_pending: push pending transactions to hardware |
618 | * @device_slave_caps: return the slave channel capabilities | ||
619 | */ | 615 | */ |
620 | struct dma_device { | 616 | struct dma_device { |
621 | 617 | ||
@@ -635,14 +631,19 @@ struct dma_device { | |||
635 | int dev_id; | 631 | int dev_id; |
636 | struct device *dev; | 632 | struct device *dev; |
637 | 633 | ||
634 | u32 src_addr_widths; | ||
635 | u32 dst_addr_widths; | ||
636 | u32 directions; | ||
637 | enum dma_residue_granularity residue_granularity; | ||
638 | |||
638 | int (*device_alloc_chan_resources)(struct dma_chan *chan); | 639 | int (*device_alloc_chan_resources)(struct dma_chan *chan); |
639 | void (*device_free_chan_resources)(struct dma_chan *chan); | 640 | void (*device_free_chan_resources)(struct dma_chan *chan); |
640 | 641 | ||
641 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( | 642 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( |
642 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, | 643 | struct dma_chan *chan, dma_addr_t dst, dma_addr_t src, |
643 | size_t len, unsigned long flags); | 644 | size_t len, unsigned long flags); |
644 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( | 645 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( |
645 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, | 646 | struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src, |
646 | unsigned int src_cnt, size_t len, unsigned long flags); | 647 | unsigned int src_cnt, size_t len, unsigned long flags); |
647 | struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)( | 648 | struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)( |
648 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, | 649 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, |
@@ -674,31 +675,26 @@ struct dma_device { | |||
674 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( | 675 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( |
675 | struct dma_chan *chan, struct dma_interleaved_template *xt, | 676 | struct dma_chan *chan, struct dma_interleaved_template *xt, |
676 | unsigned long flags); | 677 | unsigned long flags); |
677 | int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 678 | |
678 | unsigned long arg); | 679 | int (*device_config)(struct dma_chan *chan, |
680 | struct dma_slave_config *config); | ||
681 | int (*device_pause)(struct dma_chan *chan); | ||
682 | int (*device_resume)(struct dma_chan *chan); | ||
683 | int (*device_terminate_all)(struct dma_chan *chan); | ||
679 | 684 | ||
680 | enum dma_status (*device_tx_status)(struct dma_chan *chan, | 685 | enum dma_status (*device_tx_status)(struct dma_chan *chan, |
681 | dma_cookie_t cookie, | 686 | dma_cookie_t cookie, |
682 | struct dma_tx_state *txstate); | 687 | struct dma_tx_state *txstate); |
683 | void (*device_issue_pending)(struct dma_chan *chan); | 688 | void (*device_issue_pending)(struct dma_chan *chan); |
684 | int (*device_slave_caps)(struct dma_chan *chan, struct dma_slave_caps *caps); | ||
685 | }; | 689 | }; |
686 | 690 | ||
687 | static inline int dmaengine_device_control(struct dma_chan *chan, | ||
688 | enum dma_ctrl_cmd cmd, | ||
689 | unsigned long arg) | ||
690 | { | ||
691 | if (chan->device->device_control) | ||
692 | return chan->device->device_control(chan, cmd, arg); | ||
693 | |||
694 | return -ENOSYS; | ||
695 | } | ||
696 | |||
697 | static inline int dmaengine_slave_config(struct dma_chan *chan, | 691 | static inline int dmaengine_slave_config(struct dma_chan *chan, |
698 | struct dma_slave_config *config) | 692 | struct dma_slave_config *config) |
699 | { | 693 | { |
700 | return dmaengine_device_control(chan, DMA_SLAVE_CONFIG, | 694 | if (chan->device->device_config) |
701 | (unsigned long)config); | 695 | return chan->device->device_config(chan, config); |
696 | |||
697 | return -ENOSYS; | ||
702 | } | 698 | } |
703 | 699 | ||
704 | static inline bool is_slave_direction(enum dma_transfer_direction direction) | 700 | static inline bool is_slave_direction(enum dma_transfer_direction direction) |
@@ -765,34 +761,28 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg( | |||
765 | src_sg, src_nents, flags); | 761 | src_sg, src_nents, flags); |
766 | } | 762 | } |
767 | 763 | ||
768 | static inline int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) | ||
769 | { | ||
770 | if (!chan || !caps) | ||
771 | return -EINVAL; | ||
772 | |||
773 | /* check if the channel supports slave transactions */ | ||
774 | if (!test_bit(DMA_SLAVE, chan->device->cap_mask.bits)) | ||
775 | return -ENXIO; | ||
776 | |||
777 | if (chan->device->device_slave_caps) | ||
778 | return chan->device->device_slave_caps(chan, caps); | ||
779 | |||
780 | return -ENXIO; | ||
781 | } | ||
782 | |||
783 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | 764 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |
784 | { | 765 | { |
785 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); | 766 | if (chan->device->device_terminate_all) |
767 | return chan->device->device_terminate_all(chan); | ||
768 | |||
769 | return -ENOSYS; | ||
786 | } | 770 | } |
787 | 771 | ||
788 | static inline int dmaengine_pause(struct dma_chan *chan) | 772 | static inline int dmaengine_pause(struct dma_chan *chan) |
789 | { | 773 | { |
790 | return dmaengine_device_control(chan, DMA_PAUSE, 0); | 774 | if (chan->device->device_pause) |
775 | return chan->device->device_pause(chan); | ||
776 | |||
777 | return -ENOSYS; | ||
791 | } | 778 | } |
792 | 779 | ||
793 | static inline int dmaengine_resume(struct dma_chan *chan) | 780 | static inline int dmaengine_resume(struct dma_chan *chan) |
794 | { | 781 | { |
795 | return dmaengine_device_control(chan, DMA_RESUME, 0); | 782 | if (chan->device->device_resume) |
783 | return chan->device->device_resume(chan); | ||
784 | |||
785 | return -ENOSYS; | ||
796 | } | 786 | } |
797 | 787 | ||
798 | static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan, | 788 | static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan, |
@@ -1059,6 +1049,7 @@ struct dma_chan *dma_request_slave_channel_reason(struct device *dev, | |||
1059 | const char *name); | 1049 | const char *name); |
1060 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); | 1050 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); |
1061 | void dma_release_channel(struct dma_chan *chan); | 1051 | void dma_release_channel(struct dma_chan *chan); |
1052 | int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps); | ||
1062 | #else | 1053 | #else |
1063 | static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) | 1054 | static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) |
1064 | { | 1055 | { |
@@ -1093,6 +1084,11 @@ static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | |||
1093 | static inline void dma_release_channel(struct dma_chan *chan) | 1084 | static inline void dma_release_channel(struct dma_chan *chan) |
1094 | { | 1085 | { |
1095 | } | 1086 | } |
1087 | static inline int dma_get_slave_caps(struct dma_chan *chan, | ||
1088 | struct dma_slave_caps *caps) | ||
1089 | { | ||
1090 | return -ENXIO; | ||
1091 | } | ||
1096 | #endif | 1092 | #endif |
1097 | 1093 | ||
1098 | /* --- DMA device --- */ | 1094 | /* --- DMA device --- */ |
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h index 3713a7232dd8..c0d4d1e2a45c 100644 --- a/include/linux/dqblk_v1.h +++ b/include/linux/dqblk_v1.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #ifndef _LINUX_DQBLK_V1_H | 5 | #ifndef _LINUX_DQBLK_V1_H |
6 | #define _LINUX_DQBLK_V1_H | 6 | #define _LINUX_DQBLK_V1_H |
7 | 7 | ||
8 | /* Root squash turned on */ | ||
9 | #define V1_DQF_RSQUASH 1 | ||
10 | |||
11 | /* Numbers of blocks needed for updates */ | 8 | /* Numbers of blocks needed for updates */ |
12 | #define V1_INIT_ALLOC 1 | 9 | #define V1_INIT_ALLOC 1 |
13 | #define V1_INIT_REWRITE 1 | 10 | #define V1_INIT_REWRITE 1 |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0238d612750e..cf7e431cbc73 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -848,7 +848,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) | |||
848 | } | 848 | } |
849 | 849 | ||
850 | static inline char * | 850 | static inline char * |
851 | efi_guid_unparse(efi_guid_t *guid, char *out) | 851 | efi_guid_to_str(efi_guid_t *guid, char *out) |
852 | { | 852 | { |
853 | sprintf(out, "%pUl", guid->b); | 853 | sprintf(out, "%pUl", guid->b); |
854 | return out; | 854 | return out; |
@@ -875,6 +875,8 @@ static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned lon | |||
875 | #endif | 875 | #endif |
876 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | 876 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); |
877 | extern int efi_config_init(efi_config_table_type_t *arch_tables); | 877 | extern int efi_config_init(efi_config_table_type_t *arch_tables); |
878 | extern int efi_config_parse_tables(void *config_tables, int count, int sz, | ||
879 | efi_config_table_type_t *arch_tables); | ||
878 | extern u64 efi_get_iobase (void); | 880 | extern u64 efi_get_iobase (void); |
879 | extern u32 efi_mem_type (unsigned long phys_addr); | 881 | extern u32 efi_mem_type (unsigned long phys_addr); |
880 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 882 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 9a33c5f7e126..7be22da321f3 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
@@ -79,6 +79,12 @@ struct enclosure_component_callbacks { | |||
79 | int (*set_locate)(struct enclosure_device *, | 79 | int (*set_locate)(struct enclosure_device *, |
80 | struct enclosure_component *, | 80 | struct enclosure_component *, |
81 | enum enclosure_component_setting); | 81 | enum enclosure_component_setting); |
82 | void (*get_power_status)(struct enclosure_device *, | ||
83 | struct enclosure_component *); | ||
84 | int (*set_power_status)(struct enclosure_device *, | ||
85 | struct enclosure_component *, | ||
86 | int); | ||
87 | int (*show_id)(struct enclosure_device *, char *buf); | ||
82 | }; | 88 | }; |
83 | 89 | ||
84 | 90 | ||
@@ -91,7 +97,9 @@ struct enclosure_component { | |||
91 | int fault; | 97 | int fault; |
92 | int active; | 98 | int active; |
93 | int locate; | 99 | int locate; |
100 | int slot; | ||
94 | enum enclosure_status status; | 101 | enum enclosure_status status; |
102 | int power_status; | ||
95 | }; | 103 | }; |
96 | 104 | ||
97 | struct enclosure_device { | 105 | struct enclosure_device { |
@@ -120,8 +128,9 @@ enclosure_register(struct device *, const char *, int, | |||
120 | struct enclosure_component_callbacks *); | 128 | struct enclosure_component_callbacks *); |
121 | void enclosure_unregister(struct enclosure_device *); | 129 | void enclosure_unregister(struct enclosure_device *); |
122 | struct enclosure_component * | 130 | struct enclosure_component * |
123 | enclosure_component_register(struct enclosure_device *, unsigned int, | 131 | enclosure_component_alloc(struct enclosure_device *, unsigned int, |
124 | enum enclosure_component_type, const char *); | 132 | enum enclosure_component_type, const char *); |
133 | int enclosure_component_register(struct enclosure_component *); | ||
125 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 134 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
126 | struct device *dev); | 135 | struct device *dev); |
127 | int enclosure_remove_device(struct enclosure_device *, struct device *); | 136 | int enclosure_remove_device(struct enclosure_device *, struct device *); |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 41c891d05f04..1d869d185a0d 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -52,6 +52,10 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | |||
52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | 53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) |
54 | 54 | ||
55 | struct sk_buff **eth_gro_receive(struct sk_buff **head, | ||
56 | struct sk_buff *skb); | ||
57 | int eth_gro_complete(struct sk_buff *skb, int nhoff); | ||
58 | |||
55 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ | 59 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ |
56 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | 60 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = |
57 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; | 61 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 41b223a59a63..fa05e04c5531 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct dentry; | 6 | struct dentry; |
7 | struct iattr; | ||
7 | struct inode; | 8 | struct inode; |
8 | struct super_block; | 9 | struct super_block; |
9 | struct vfsmount; | 10 | struct vfsmount; |
@@ -180,6 +181,21 @@ struct fid { | |||
180 | * get_name is not (which is possibly inconsistent) | 181 | * get_name is not (which is possibly inconsistent) |
181 | */ | 182 | */ |
182 | 183 | ||
184 | /* types of block ranges for multipage write mappings. */ | ||
185 | #define IOMAP_HOLE 0x01 /* no blocks allocated, need allocation */ | ||
186 | #define IOMAP_DELALLOC 0x02 /* delayed allocation blocks */ | ||
187 | #define IOMAP_MAPPED 0x03 /* blocks allocated @blkno */ | ||
188 | #define IOMAP_UNWRITTEN 0x04 /* blocks allocated @blkno in unwritten state */ | ||
189 | |||
190 | #define IOMAP_NULL_BLOCK -1LL /* blkno is not valid */ | ||
191 | |||
192 | struct iomap { | ||
193 | sector_t blkno; /* first sector of mapping */ | ||
194 | loff_t offset; /* file offset of mapping, bytes */ | ||
195 | u64 length; /* length of mapping, bytes */ | ||
196 | int type; /* type of mapping */ | ||
197 | }; | ||
198 | |||
183 | struct export_operations { | 199 | struct export_operations { |
184 | int (*encode_fh)(struct inode *inode, __u32 *fh, int *max_len, | 200 | int (*encode_fh)(struct inode *inode, __u32 *fh, int *max_len, |
185 | struct inode *parent); | 201 | struct inode *parent); |
@@ -191,6 +207,13 @@ struct export_operations { | |||
191 | struct dentry *child); | 207 | struct dentry *child); |
192 | struct dentry * (*get_parent)(struct dentry *child); | 208 | struct dentry * (*get_parent)(struct dentry *child); |
193 | int (*commit_metadata)(struct inode *inode); | 209 | int (*commit_metadata)(struct inode *inode); |
210 | |||
211 | int (*get_uuid)(struct super_block *sb, u8 *buf, u32 *len, u64 *offset); | ||
212 | int (*map_blocks)(struct inode *inode, loff_t offset, | ||
213 | u64 len, struct iomap *iomap, | ||
214 | bool write, u32 *device_generation); | ||
215 | int (*commit_blocks)(struct inode *inode, struct iomap *iomaps, | ||
216 | int nr_iomaps, struct iattr *iattr); | ||
194 | }; | 217 | }; |
195 | 218 | ||
196 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, | 219 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index 87f14e90e984..a23556c32703 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
@@ -19,12 +19,16 @@ | |||
19 | #define F2FS_MAX_LOG_SECTOR_SIZE 12 /* 12 bits for 4096 bytes */ | 19 | #define F2FS_MAX_LOG_SECTOR_SIZE 12 /* 12 bits for 4096 bytes */ |
20 | #define F2FS_LOG_SECTORS_PER_BLOCK 3 /* log number for sector/blk */ | 20 | #define F2FS_LOG_SECTORS_PER_BLOCK 3 /* log number for sector/blk */ |
21 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ | 21 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ |
22 | #define F2FS_BLKSIZE_BITS 12 /* bits for F2FS_BLKSIZE */ | ||
22 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ | 23 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ |
23 | #define F2FS_BLK_ALIGN(x) (((x) + F2FS_BLKSIZE - 1) / F2FS_BLKSIZE) | 24 | #define F2FS_BLK_ALIGN(x) (((x) + F2FS_BLKSIZE - 1) / F2FS_BLKSIZE) |
24 | 25 | ||
25 | #define NULL_ADDR ((block_t)0) /* used as block_t addresses */ | 26 | #define NULL_ADDR ((block_t)0) /* used as block_t addresses */ |
26 | #define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ | 27 | #define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ |
27 | 28 | ||
29 | #define F2FS_BYTES_TO_BLK(bytes) ((bytes) >> F2FS_BLKSIZE_BITS) | ||
30 | #define F2FS_BLK_TO_BYTES(blk) ((blk) << F2FS_BLKSIZE_BITS) | ||
31 | |||
28 | /* 0, 1(node nid), 2(meta nid) are reserved node id */ | 32 | /* 0, 1(node nid), 2(meta nid) are reserved node id */ |
29 | #define F2FS_RESERVED_NODE_NUM 3 | 33 | #define F2FS_RESERVED_NODE_NUM 3 |
30 | 34 | ||
@@ -87,6 +91,7 @@ struct f2fs_super_block { | |||
87 | /* | 91 | /* |
88 | * For checkpoint | 92 | * For checkpoint |
89 | */ | 93 | */ |
94 | #define CP_FASTBOOT_FLAG 0x00000020 | ||
90 | #define CP_FSCK_FLAG 0x00000010 | 95 | #define CP_FSCK_FLAG 0x00000010 |
91 | #define CP_ERROR_FLAG 0x00000008 | 96 | #define CP_ERROR_FLAG 0x00000008 |
92 | #define CP_COMPACT_SUM_FLAG 0x00000004 | 97 | #define CP_COMPACT_SUM_FLAG 0x00000004 |
@@ -224,6 +229,8 @@ enum { | |||
224 | OFFSET_BIT_SHIFT | 229 | OFFSET_BIT_SHIFT |
225 | }; | 230 | }; |
226 | 231 | ||
232 | #define OFFSET_BIT_MASK (0x07) /* (0x01 << OFFSET_BIT_SHIFT) - 1 */ | ||
233 | |||
227 | struct node_footer { | 234 | struct node_footer { |
228 | __le32 nid; /* node id */ | 235 | __le32 nid; /* node id */ |
229 | __le32 ino; /* inode nunmber */ | 236 | __le32 ino; /* inode nunmber */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 09bb7a18d287..043f3283b71c 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -726,7 +726,9 @@ extern int fb_videomode_from_videomode(const struct videomode *vm, | |||
726 | struct fb_videomode *fbmode); | 726 | struct fb_videomode *fbmode); |
727 | 727 | ||
728 | /* drivers/video/modedb.c */ | 728 | /* drivers/video/modedb.c */ |
729 | #define VESA_MODEDB_SIZE 34 | 729 | #define VESA_MODEDB_SIZE 43 |
730 | #define DMT_SIZE 0x50 | ||
731 | |||
730 | extern void fb_var_to_videomode(struct fb_videomode *mode, | 732 | extern void fb_var_to_videomode(struct fb_videomode *mode, |
731 | const struct fb_var_screeninfo *var); | 733 | const struct fb_var_screeninfo *var); |
732 | extern void fb_videomode_to_var(struct fb_var_screeninfo *var, | 734 | extern void fb_videomode_to_var(struct fb_var_screeninfo *var, |
@@ -777,9 +779,17 @@ struct fb_videomode { | |||
777 | u32 flag; | 779 | u32 flag; |
778 | }; | 780 | }; |
779 | 781 | ||
782 | struct dmt_videomode { | ||
783 | u32 dmt_id; | ||
784 | u32 std_2byte_code; | ||
785 | u32 cvt_3byte_code; | ||
786 | const struct fb_videomode *mode; | ||
787 | }; | ||
788 | |||
780 | extern const char *fb_mode_option; | 789 | extern const char *fb_mode_option; |
781 | extern const struct fb_videomode vesa_modes[]; | 790 | extern const struct fb_videomode vesa_modes[]; |
782 | extern const struct fb_videomode cea_modes[64]; | 791 | extern const struct fb_videomode cea_modes[64]; |
792 | extern const struct dmt_videomode dmt_modes[]; | ||
783 | 793 | ||
784 | struct fb_modelist { | 794 | struct fb_modelist { |
785 | struct list_head list; | 795 | struct list_head list; |
diff --git a/include/linux/fec.h b/include/linux/fec.h index bcff455d1d53..1454a503622d 100644 --- a/include/linux/fec.h +++ b/include/linux/fec.h | |||
@@ -19,6 +19,7 @@ | |||
19 | struct fec_platform_data { | 19 | struct fec_platform_data { |
20 | phy_interface_t phy; | 20 | phy_interface_t phy; |
21 | unsigned char mac[ETH_ALEN]; | 21 | unsigned char mac[ETH_ALEN]; |
22 | void (*sleep_mode_enable)(int enabled); | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | #endif | 25 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 42efe13077b6..b4d71b5e1ff2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/byteorder.h> | 34 | #include <asm/byteorder.h> |
35 | #include <uapi/linux/fs.h> | 35 | #include <uapi/linux/fs.h> |
36 | 36 | ||
37 | struct backing_dev_info; | ||
37 | struct export_operations; | 38 | struct export_operations; |
38 | struct hd_geometry; | 39 | struct hd_geometry; |
39 | struct iovec; | 40 | struct iovec; |
@@ -50,6 +51,7 @@ struct swap_info_struct; | |||
50 | struct seq_file; | 51 | struct seq_file; |
51 | struct workqueue_struct; | 52 | struct workqueue_struct; |
52 | struct iov_iter; | 53 | struct iov_iter; |
54 | struct vm_fault; | ||
53 | 55 | ||
54 | extern void __init inode_init(void); | 56 | extern void __init inode_init(void); |
55 | extern void __init inode_init_early(void); | 57 | extern void __init inode_init_early(void); |
@@ -360,8 +362,6 @@ struct address_space_operations { | |||
360 | int (*releasepage) (struct page *, gfp_t); | 362 | int (*releasepage) (struct page *, gfp_t); |
361 | void (*freepage)(struct page *); | 363 | void (*freepage)(struct page *); |
362 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); | 364 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); |
363 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | ||
364 | void **, unsigned long *); | ||
365 | /* | 365 | /* |
366 | * migrate the contents of a page to the specified target. If | 366 | * migrate the contents of a page to the specified target. If |
367 | * migrate_mode is MIGRATE_ASYNC, it must not block. | 367 | * migrate_mode is MIGRATE_ASYNC, it must not block. |
@@ -394,14 +394,12 @@ int pagecache_write_end(struct file *, struct address_space *mapping, | |||
394 | loff_t pos, unsigned len, unsigned copied, | 394 | loff_t pos, unsigned len, unsigned copied, |
395 | struct page *page, void *fsdata); | 395 | struct page *page, void *fsdata); |
396 | 396 | ||
397 | struct backing_dev_info; | ||
398 | struct address_space { | 397 | struct address_space { |
399 | struct inode *host; /* owner: inode, block_device */ | 398 | struct inode *host; /* owner: inode, block_device */ |
400 | struct radix_tree_root page_tree; /* radix tree of all pages */ | 399 | struct radix_tree_root page_tree; /* radix tree of all pages */ |
401 | spinlock_t tree_lock; /* and lock protecting it */ | 400 | spinlock_t tree_lock; /* and lock protecting it */ |
402 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ | 401 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ |
403 | struct rb_root i_mmap; /* tree of private and shared mappings */ | 402 | struct rb_root i_mmap; /* tree of private and shared mappings */ |
404 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | ||
405 | struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ | 403 | struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ |
406 | /* Protected by tree_lock together with the radix tree */ | 404 | /* Protected by tree_lock together with the radix tree */ |
407 | unsigned long nrpages; /* number of total pages */ | 405 | unsigned long nrpages; /* number of total pages */ |
@@ -409,7 +407,6 @@ struct address_space { | |||
409 | pgoff_t writeback_index;/* writeback starts here */ | 407 | pgoff_t writeback_index;/* writeback starts here */ |
410 | const struct address_space_operations *a_ops; /* methods */ | 408 | const struct address_space_operations *a_ops; /* methods */ |
411 | unsigned long flags; /* error bits/gfp mask */ | 409 | unsigned long flags; /* error bits/gfp mask */ |
412 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ | ||
413 | spinlock_t private_lock; /* for use by the address_space */ | 410 | spinlock_t private_lock; /* for use by the address_space */ |
414 | struct list_head private_list; /* ditto */ | 411 | struct list_head private_list; /* ditto */ |
415 | void *private_data; /* ditto */ | 412 | void *private_data; /* ditto */ |
@@ -493,8 +490,7 @@ static inline void i_mmap_unlock_read(struct address_space *mapping) | |||
493 | */ | 490 | */ |
494 | static inline int mapping_mapped(struct address_space *mapping) | 491 | static inline int mapping_mapped(struct address_space *mapping) |
495 | { | 492 | { |
496 | return !RB_EMPTY_ROOT(&mapping->i_mmap) || | 493 | return !RB_EMPTY_ROOT(&mapping->i_mmap); |
497 | !list_empty(&mapping->i_mmap_nonlinear); | ||
498 | } | 494 | } |
499 | 495 | ||
500 | /* | 496 | /* |
@@ -625,7 +621,7 @@ struct inode { | |||
625 | atomic_t i_readcount; /* struct files open RO */ | 621 | atomic_t i_readcount; /* struct files open RO */ |
626 | #endif | 622 | #endif |
627 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 623 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
628 | struct file_lock *i_flock; | 624 | struct file_lock_context *i_flctx; |
629 | struct address_space i_data; | 625 | struct address_space i_data; |
630 | struct list_head i_devices; | 626 | struct list_head i_devices; |
631 | union { | 627 | union { |
@@ -875,6 +871,7 @@ static inline struct file *get_file(struct file *f) | |||
875 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ | 871 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ |
876 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ | 872 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ |
877 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ | 873 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ |
874 | #define FL_LAYOUT 2048 /* outstanding pNFS layout */ | ||
878 | 875 | ||
879 | /* | 876 | /* |
880 | * Special return value from posix_lock_file() and vfs_lock_file() for | 877 | * Special return value from posix_lock_file() and vfs_lock_file() for |
@@ -885,6 +882,8 @@ static inline struct file *get_file(struct file *f) | |||
885 | /* legacy typedef, should eventually be removed */ | 882 | /* legacy typedef, should eventually be removed */ |
886 | typedef void *fl_owner_t; | 883 | typedef void *fl_owner_t; |
887 | 884 | ||
885 | struct file_lock; | ||
886 | |||
888 | struct file_lock_operations { | 887 | struct file_lock_operations { |
889 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 888 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
890 | void (*fl_release_private)(struct file_lock *); | 889 | void (*fl_release_private)(struct file_lock *); |
@@ -898,7 +897,7 @@ struct lock_manager_operations { | |||
898 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 897 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
899 | int (*lm_grant)(struct file_lock *, int); | 898 | int (*lm_grant)(struct file_lock *, int); |
900 | bool (*lm_break)(struct file_lock *); | 899 | bool (*lm_break)(struct file_lock *); |
901 | int (*lm_change)(struct file_lock **, int, struct list_head *); | 900 | int (*lm_change)(struct file_lock *, int, struct list_head *); |
902 | void (*lm_setup)(struct file_lock *, void **); | 901 | void (*lm_setup)(struct file_lock *, void **); |
903 | }; | 902 | }; |
904 | 903 | ||
@@ -923,17 +922,17 @@ int locks_in_grace(struct net *); | |||
923 | * FIXME: should we create a separate "struct lock_request" to help distinguish | 922 | * FIXME: should we create a separate "struct lock_request" to help distinguish |
924 | * these two uses? | 923 | * these two uses? |
925 | * | 924 | * |
926 | * The i_flock list is ordered by: | 925 | * The varous i_flctx lists are ordered by: |
927 | * | 926 | * |
928 | * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX | 927 | * 1) lock owner |
929 | * 2) lock owner | 928 | * 2) lock range start |
930 | * 3) lock range start | 929 | * 3) lock range end |
931 | * 4) lock range end | ||
932 | * | 930 | * |
933 | * Obviously, the last two criteria only matter for POSIX locks. | 931 | * Obviously, the last two criteria only matter for POSIX locks. |
934 | */ | 932 | */ |
935 | struct file_lock { | 933 | struct file_lock { |
936 | struct file_lock *fl_next; /* singly linked list for this inode */ | 934 | struct file_lock *fl_next; /* singly linked list for this inode */ |
935 | struct list_head fl_list; /* link into file_lock_context */ | ||
937 | struct hlist_node fl_link; /* node in global lists */ | 936 | struct hlist_node fl_link; /* node in global lists */ |
938 | struct list_head fl_block; /* circular list of blocked processes */ | 937 | struct list_head fl_block; /* circular list of blocked processes */ |
939 | fl_owner_t fl_owner; | 938 | fl_owner_t fl_owner; |
@@ -964,6 +963,13 @@ struct file_lock { | |||
964 | } fl_u; | 963 | } fl_u; |
965 | }; | 964 | }; |
966 | 965 | ||
966 | struct file_lock_context { | ||
967 | spinlock_t flc_lock; | ||
968 | struct list_head flc_flock; | ||
969 | struct list_head flc_posix; | ||
970 | struct list_head flc_lease; | ||
971 | }; | ||
972 | |||
967 | /* The following constant reflects the upper bound of the file/locking space */ | 973 | /* The following constant reflects the upper bound of the file/locking space */ |
968 | #ifndef OFFSET_MAX | 974 | #ifndef OFFSET_MAX |
969 | #define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) | 975 | #define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) |
@@ -990,6 +996,7 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
990 | extern int fcntl_getlease(struct file *filp); | 996 | extern int fcntl_getlease(struct file *filp); |
991 | 997 | ||
992 | /* fs/locks.c */ | 998 | /* fs/locks.c */ |
999 | void locks_free_lock_context(struct file_lock_context *ctx); | ||
993 | void locks_free_lock(struct file_lock *fl); | 1000 | void locks_free_lock(struct file_lock *fl); |
994 | extern void locks_init_lock(struct file_lock *); | 1001 | extern void locks_init_lock(struct file_lock *); |
995 | extern struct file_lock * locks_alloc_lock(void); | 1002 | extern struct file_lock * locks_alloc_lock(void); |
@@ -1010,7 +1017,7 @@ extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int t | |||
1010 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1017 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
1011 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1018 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
1012 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1019 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
1013 | extern int lease_modify(struct file_lock **, int, struct list_head *); | 1020 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
1014 | #else /* !CONFIG_FILE_LOCKING */ | 1021 | #else /* !CONFIG_FILE_LOCKING */ |
1015 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, | 1022 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, |
1016 | struct flock __user *user) | 1023 | struct flock __user *user) |
@@ -1047,6 +1054,11 @@ static inline int fcntl_getlease(struct file *filp) | |||
1047 | return F_UNLCK; | 1054 | return F_UNLCK; |
1048 | } | 1055 | } |
1049 | 1056 | ||
1057 | static inline void | ||
1058 | locks_free_lock_context(struct file_lock_context *ctx) | ||
1059 | { | ||
1060 | } | ||
1061 | |||
1050 | static inline void locks_init_lock(struct file_lock *fl) | 1062 | static inline void locks_init_lock(struct file_lock *fl) |
1051 | { | 1063 | { |
1052 | return; | 1064 | return; |
@@ -1137,7 +1149,7 @@ static inline int vfs_setlease(struct file *filp, long arg, | |||
1137 | return -EINVAL; | 1149 | return -EINVAL; |
1138 | } | 1150 | } |
1139 | 1151 | ||
1140 | static inline int lease_modify(struct file_lock **before, int arg, | 1152 | static inline int lease_modify(struct file_lock *fl, int arg, |
1141 | struct list_head *dispose) | 1153 | struct list_head *dispose) |
1142 | { | 1154 | { |
1143 | return -EINVAL; | 1155 | return -EINVAL; |
@@ -1184,8 +1196,6 @@ struct mm_struct; | |||
1184 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ | 1196 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ |
1185 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ | 1197 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ |
1186 | 1198 | ||
1187 | extern struct list_head super_blocks; | ||
1188 | extern spinlock_t sb_lock; | ||
1189 | 1199 | ||
1190 | /* Possible states of 'frozen' field */ | 1200 | /* Possible states of 'frozen' field */ |
1191 | enum { | 1201 | enum { |
@@ -1502,6 +1512,26 @@ struct block_device_operations; | |||
1502 | #define HAVE_COMPAT_IOCTL 1 | 1512 | #define HAVE_COMPAT_IOCTL 1 |
1503 | #define HAVE_UNLOCKED_IOCTL 1 | 1513 | #define HAVE_UNLOCKED_IOCTL 1 |
1504 | 1514 | ||
1515 | /* | ||
1516 | * These flags let !MMU mmap() govern direct device mapping vs immediate | ||
1517 | * copying more easily for MAP_PRIVATE, especially for ROM filesystems. | ||
1518 | * | ||
1519 | * NOMMU_MAP_COPY: Copy can be mapped (MAP_PRIVATE) | ||
1520 | * NOMMU_MAP_DIRECT: Can be mapped directly (MAP_SHARED) | ||
1521 | * NOMMU_MAP_READ: Can be mapped for reading | ||
1522 | * NOMMU_MAP_WRITE: Can be mapped for writing | ||
1523 | * NOMMU_MAP_EXEC: Can be mapped for execution | ||
1524 | */ | ||
1525 | #define NOMMU_MAP_COPY 0x00000001 | ||
1526 | #define NOMMU_MAP_DIRECT 0x00000008 | ||
1527 | #define NOMMU_MAP_READ VM_MAYREAD | ||
1528 | #define NOMMU_MAP_WRITE VM_MAYWRITE | ||
1529 | #define NOMMU_MAP_EXEC VM_MAYEXEC | ||
1530 | |||
1531 | #define NOMMU_VMFLAGS \ | ||
1532 | (NOMMU_MAP_READ | NOMMU_MAP_WRITE | NOMMU_MAP_EXEC) | ||
1533 | |||
1534 | |||
1505 | struct iov_iter; | 1535 | struct iov_iter; |
1506 | 1536 | ||
1507 | struct file_operations { | 1537 | struct file_operations { |
@@ -1536,6 +1566,9 @@ struct file_operations { | |||
1536 | long (*fallocate)(struct file *file, int mode, loff_t offset, | 1566 | long (*fallocate)(struct file *file, int mode, loff_t offset, |
1537 | loff_t len); | 1567 | loff_t len); |
1538 | void (*show_fdinfo)(struct seq_file *m, struct file *f); | 1568 | void (*show_fdinfo)(struct seq_file *m, struct file *f); |
1569 | #ifndef CONFIG_MMU | ||
1570 | unsigned (*mmap_capabilities)(struct file *); | ||
1571 | #endif | ||
1539 | }; | 1572 | }; |
1540 | 1573 | ||
1541 | struct inode_operations { | 1574 | struct inode_operations { |
@@ -1618,8 +1651,10 @@ struct super_operations { | |||
1618 | struct dquot **(*get_dquots)(struct inode *); | 1651 | struct dquot **(*get_dquots)(struct inode *); |
1619 | #endif | 1652 | #endif |
1620 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 1653 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
1621 | long (*nr_cached_objects)(struct super_block *, int); | 1654 | long (*nr_cached_objects)(struct super_block *, |
1622 | long (*free_cached_objects)(struct super_block *, long, int); | 1655 | struct shrink_control *); |
1656 | long (*free_cached_objects)(struct super_block *, | ||
1657 | struct shrink_control *); | ||
1623 | }; | 1658 | }; |
1624 | 1659 | ||
1625 | /* | 1660 | /* |
@@ -1638,6 +1673,11 @@ struct super_operations { | |||
1638 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | 1673 | #define S_IMA 1024 /* Inode has an associated IMA struct */ |
1639 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | 1674 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ |
1640 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ | 1675 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ |
1676 | #ifdef CONFIG_FS_DAX | ||
1677 | #define S_DAX 8192 /* Direct Access, avoiding the page cache */ | ||
1678 | #else | ||
1679 | #define S_DAX 0 /* Make all the DAX code disappear */ | ||
1680 | #endif | ||
1641 | 1681 | ||
1642 | /* | 1682 | /* |
1643 | * Note that nosuid etc flags are inode-specific: setting some file-system | 1683 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -1675,6 +1715,7 @@ struct super_operations { | |||
1675 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | 1715 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) |
1676 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | 1716 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) |
1677 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | 1717 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) |
1718 | #define IS_DAX(inode) ((inode)->i_flags & S_DAX) | ||
1678 | 1719 | ||
1679 | #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ | 1720 | #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ |
1680 | (inode)->i_rdev == WHITEOUT_DEV) | 1721 | (inode)->i_rdev == WHITEOUT_DEV) |
@@ -1746,8 +1787,12 @@ struct super_operations { | |||
1746 | #define __I_DIO_WAKEUP 9 | 1787 | #define __I_DIO_WAKEUP 9 |
1747 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) | 1788 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) |
1748 | #define I_LINKABLE (1 << 10) | 1789 | #define I_LINKABLE (1 << 10) |
1790 | #define I_DIRTY_TIME (1 << 11) | ||
1791 | #define __I_DIRTY_TIME_EXPIRED 12 | ||
1792 | #define I_DIRTY_TIME_EXPIRED (1 << __I_DIRTY_TIME_EXPIRED) | ||
1749 | 1793 | ||
1750 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1794 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1795 | #define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME) | ||
1751 | 1796 | ||
1752 | extern void __mark_inode_dirty(struct inode *, int); | 1797 | extern void __mark_inode_dirty(struct inode *, int); |
1753 | static inline void mark_inode_dirty(struct inode *inode) | 1798 | static inline void mark_inode_dirty(struct inode *inode) |
@@ -1910,6 +1955,7 @@ extern int current_umask(void); | |||
1910 | 1955 | ||
1911 | extern void ihold(struct inode * inode); | 1956 | extern void ihold(struct inode * inode); |
1912 | extern void iput(struct inode *); | 1957 | extern void iput(struct inode *); |
1958 | extern int generic_update_time(struct inode *, struct timespec *, int); | ||
1913 | 1959 | ||
1914 | static inline struct inode *file_inode(const struct file *f) | 1960 | static inline struct inode *file_inode(const struct file *f) |
1915 | { | 1961 | { |
@@ -1959,7 +2005,7 @@ static inline int locks_verify_truncate(struct inode *inode, | |||
1959 | struct file *filp, | 2005 | struct file *filp, |
1960 | loff_t size) | 2006 | loff_t size) |
1961 | { | 2007 | { |
1962 | if (inode->i_flock && mandatory_lock(inode)) | 2008 | if (inode->i_flctx && mandatory_lock(inode)) |
1963 | return locks_mandatory_area( | 2009 | return locks_mandatory_area( |
1964 | FLOCK_VERIFY_WRITE, inode, filp, | 2010 | FLOCK_VERIFY_WRITE, inode, filp, |
1965 | size < inode->i_size ? size : inode->i_size, | 2011 | size < inode->i_size ? size : inode->i_size, |
@@ -1973,11 +2019,12 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1973 | { | 2019 | { |
1974 | /* | 2020 | /* |
1975 | * Since this check is lockless, we must ensure that any refcounts | 2021 | * Since this check is lockless, we must ensure that any refcounts |
1976 | * taken are done before checking inode->i_flock. Otherwise, we could | 2022 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
1977 | * end up racing with tasks trying to set a new lease on this file. | 2023 | * could end up racing with tasks trying to set a new lease on this |
2024 | * file. | ||
1978 | */ | 2025 | */ |
1979 | smp_mb(); | 2026 | smp_mb(); |
1980 | if (inode->i_flock) | 2027 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |
1981 | return __break_lease(inode, mode, FL_LEASE); | 2028 | return __break_lease(inode, mode, FL_LEASE); |
1982 | return 0; | 2029 | return 0; |
1983 | } | 2030 | } |
@@ -1986,11 +2033,12 @@ static inline int break_deleg(struct inode *inode, unsigned int mode) | |||
1986 | { | 2033 | { |
1987 | /* | 2034 | /* |
1988 | * Since this check is lockless, we must ensure that any refcounts | 2035 | * Since this check is lockless, we must ensure that any refcounts |
1989 | * taken are done before checking inode->i_flock. Otherwise, we could | 2036 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
1990 | * end up racing with tasks trying to set a new lease on this file. | 2037 | * could end up racing with tasks trying to set a new lease on this |
2038 | * file. | ||
1991 | */ | 2039 | */ |
1992 | smp_mb(); | 2040 | smp_mb(); |
1993 | if (inode->i_flock) | 2041 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |
1994 | return __break_lease(inode, mode, FL_DELEG); | 2042 | return __break_lease(inode, mode, FL_DELEG); |
1995 | return 0; | 2043 | return 0; |
1996 | } | 2044 | } |
@@ -2017,6 +2065,16 @@ static inline int break_deleg_wait(struct inode **delegated_inode) | |||
2017 | return ret; | 2065 | return ret; |
2018 | } | 2066 | } |
2019 | 2067 | ||
2068 | static inline int break_layout(struct inode *inode, bool wait) | ||
2069 | { | ||
2070 | smp_mb(); | ||
2071 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) | ||
2072 | return __break_lease(inode, | ||
2073 | wait ? O_WRONLY : O_WRONLY | O_NONBLOCK, | ||
2074 | FL_LAYOUT); | ||
2075 | return 0; | ||
2076 | } | ||
2077 | |||
2020 | #else /* !CONFIG_FILE_LOCKING */ | 2078 | #else /* !CONFIG_FILE_LOCKING */ |
2021 | static inline int locks_mandatory_locked(struct file *file) | 2079 | static inline int locks_mandatory_locked(struct file *file) |
2022 | { | 2080 | { |
@@ -2072,6 +2130,11 @@ static inline int break_deleg_wait(struct inode **delegated_inode) | |||
2072 | return 0; | 2130 | return 0; |
2073 | } | 2131 | } |
2074 | 2132 | ||
2133 | static inline int break_layout(struct inode *inode, bool wait) | ||
2134 | { | ||
2135 | return 0; | ||
2136 | } | ||
2137 | |||
2075 | #endif /* CONFIG_FILE_LOCKING */ | 2138 | #endif /* CONFIG_FILE_LOCKING */ |
2076 | 2139 | ||
2077 | /* fs/open.c */ | 2140 | /* fs/open.c */ |
@@ -2080,6 +2143,7 @@ struct filename { | |||
2080 | const char *name; /* pointer to actual string */ | 2143 | const char *name; /* pointer to actual string */ |
2081 | const __user char *uptr; /* original userland pointer */ | 2144 | const __user char *uptr; /* original userland pointer */ |
2082 | struct audit_names *aname; | 2145 | struct audit_names *aname; |
2146 | int refcnt; | ||
2083 | bool separate; /* should "name" be freed? */ | 2147 | bool separate; /* should "name" be freed? */ |
2084 | }; | 2148 | }; |
2085 | 2149 | ||
@@ -2101,6 +2165,7 @@ extern int filp_close(struct file *, fl_owner_t id); | |||
2101 | extern struct filename *getname_flags(const char __user *, int, int *); | 2165 | extern struct filename *getname_flags(const char __user *, int, int *); |
2102 | extern struct filename *getname(const char __user *); | 2166 | extern struct filename *getname(const char __user *); |
2103 | extern struct filename *getname_kernel(const char *); | 2167 | extern struct filename *getname_kernel(const char *); |
2168 | extern void putname(struct filename *name); | ||
2104 | 2169 | ||
2105 | enum { | 2170 | enum { |
2106 | FILE_CREATED = 1, | 2171 | FILE_CREATED = 1, |
@@ -2121,15 +2186,8 @@ extern void __init vfs_caches_init(unsigned long); | |||
2121 | 2186 | ||
2122 | extern struct kmem_cache *names_cachep; | 2187 | extern struct kmem_cache *names_cachep; |
2123 | 2188 | ||
2124 | extern void final_putname(struct filename *name); | ||
2125 | |||
2126 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) | 2189 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) |
2127 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | 2190 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) |
2128 | #ifndef CONFIG_AUDITSYSCALL | ||
2129 | #define putname(name) final_putname(name) | ||
2130 | #else | ||
2131 | extern void putname(struct filename *name); | ||
2132 | #endif | ||
2133 | 2191 | ||
2134 | #ifdef CONFIG_BLOCK | 2192 | #ifdef CONFIG_BLOCK |
2135 | extern int register_blkdev(unsigned int, const char *); | 2193 | extern int register_blkdev(unsigned int, const char *); |
@@ -2436,6 +2494,11 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino); | |||
2436 | 2494 | ||
2437 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); | 2495 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); |
2438 | extern struct inode * iget_locked(struct super_block *, unsigned long); | 2496 | extern struct inode * iget_locked(struct super_block *, unsigned long); |
2497 | extern struct inode *find_inode_nowait(struct super_block *, | ||
2498 | unsigned long, | ||
2499 | int (*match)(struct inode *, | ||
2500 | unsigned long, void *), | ||
2501 | void *data); | ||
2439 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); | 2502 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); |
2440 | extern int insert_inode_locked(struct inode *); | 2503 | extern int insert_inode_locked(struct inode *); |
2441 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 2504 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
@@ -2481,8 +2544,6 @@ extern int sb_min_blocksize(struct super_block *, int); | |||
2481 | 2544 | ||
2482 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | 2545 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); |
2483 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 2546 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
2484 | extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, | ||
2485 | unsigned long size, pgoff_t pgoff); | ||
2486 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 2547 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
2487 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); | 2548 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); |
2488 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); | 2549 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); |
@@ -2494,6 +2555,9 @@ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t l | |||
2494 | extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 2555 | extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
2495 | extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 2556 | extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
2496 | 2557 | ||
2558 | ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos); | ||
2559 | ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos); | ||
2560 | |||
2497 | /* fs/block_dev.c */ | 2561 | /* fs/block_dev.c */ |
2498 | extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); | 2562 | extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); |
2499 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); | 2563 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); |
@@ -2527,19 +2591,13 @@ extern loff_t fixed_size_llseek(struct file *file, loff_t offset, | |||
2527 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2591 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2528 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2592 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2529 | 2593 | ||
2530 | #ifdef CONFIG_FS_XIP | 2594 | ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *, |
2531 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, | 2595 | loff_t, get_block_t, dio_iodone_t, int flags); |
2532 | loff_t *ppos); | 2596 | int dax_clear_blocks(struct inode *, sector_t block, long size); |
2533 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); | 2597 | int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); |
2534 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, | 2598 | int dax_truncate_page(struct inode *, loff_t from, get_block_t); |
2535 | size_t len, loff_t *ppos); | 2599 | int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t); |
2536 | extern int xip_truncate_page(struct address_space *mapping, loff_t from); | 2600 | #define dax_mkwrite(vma, vmf, gb) dax_fault(vma, vmf, gb) |
2537 | #else | ||
2538 | static inline int xip_truncate_page(struct address_space *mapping, loff_t from) | ||
2539 | { | ||
2540 | return 0; | ||
2541 | } | ||
2542 | #endif | ||
2543 | 2601 | ||
2544 | #ifdef CONFIG_BLOCK | 2602 | #ifdef CONFIG_BLOCK |
2545 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, | 2603 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, |
@@ -2696,6 +2754,11 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root); | |||
2696 | extern void save_mount_options(struct super_block *sb, char *options); | 2754 | extern void save_mount_options(struct super_block *sb, char *options); |
2697 | extern void replace_mount_options(struct super_block *sb, char *options); | 2755 | extern void replace_mount_options(struct super_block *sb, char *options); |
2698 | 2756 | ||
2757 | static inline bool io_is_direct(struct file *filp) | ||
2758 | { | ||
2759 | return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp)); | ||
2760 | } | ||
2761 | |||
2699 | static inline ino_t parent_ino(struct dentry *dentry) | 2762 | static inline ino_t parent_ino(struct dentry *dentry) |
2700 | { | 2763 | { |
2701 | ino_t res; | 2764 | ino_t res; |
diff --git a/include/linux/fs_pin.h b/include/linux/fs_pin.h index f66525e72ccf..9dc4e0384bfb 100644 --- a/include/linux/fs_pin.h +++ b/include/linux/fs_pin.h | |||
@@ -1,17 +1,22 @@ | |||
1 | #include <linux/fs.h> | 1 | #include <linux/wait.h> |
2 | 2 | ||
3 | struct fs_pin { | 3 | struct fs_pin { |
4 | atomic_long_t count; | 4 | wait_queue_head_t wait; |
5 | union { | 5 | int done; |
6 | struct { | 6 | struct hlist_node s_list; |
7 | struct hlist_node s_list; | 7 | struct hlist_node m_list; |
8 | struct hlist_node m_list; | ||
9 | }; | ||
10 | struct rcu_head rcu; | ||
11 | }; | ||
12 | void (*kill)(struct fs_pin *); | 8 | void (*kill)(struct fs_pin *); |
13 | }; | 9 | }; |
14 | 10 | ||
15 | void pin_put(struct fs_pin *); | 11 | struct vfsmount; |
12 | |||
13 | static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *)) | ||
14 | { | ||
15 | init_waitqueue_head(&p->wait); | ||
16 | p->kill = kill; | ||
17 | } | ||
18 | |||
16 | void pin_remove(struct fs_pin *); | 19 | void pin_remove(struct fs_pin *); |
20 | void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *); | ||
17 | void pin_insert(struct fs_pin *, struct vfsmount *); | 21 | void pin_insert(struct fs_pin *, struct vfsmount *); |
22 | void pin_kill(struct fs_pin *); | ||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 1c804b057fb1..7ee1774edee5 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -101,8 +101,10 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
101 | new_dir_mask |= FS_ISDIR; | 101 | new_dir_mask |= FS_ISDIR; |
102 | } | 102 | } |
103 | 103 | ||
104 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); | 104 | fsnotify(old_dir, old_dir_mask, source, FSNOTIFY_EVENT_INODE, old_name, |
105 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name, fs_cookie); | 105 | fs_cookie); |
106 | fsnotify(new_dir, new_dir_mask, source, FSNOTIFY_EVENT_INODE, new_name, | ||
107 | fs_cookie); | ||
106 | 108 | ||
107 | if (target) | 109 | if (target) |
108 | fsnotify_link_count(target); | 110 | fsnotify_link_count(target); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index d36f68b08acc..c674ee8f7fca 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -44,6 +44,10 @@ const char *ftrace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, | |||
44 | const char *ftrace_print_hex_seq(struct trace_seq *p, | 44 | const char *ftrace_print_hex_seq(struct trace_seq *p, |
45 | const unsigned char *buf, int len); | 45 | const unsigned char *buf, int len); |
46 | 46 | ||
47 | const char *ftrace_print_array_seq(struct trace_seq *p, | ||
48 | const void *buf, int buf_len, | ||
49 | size_t el_size); | ||
50 | |||
47 | struct trace_iterator; | 51 | struct trace_iterator; |
48 | struct trace_event; | 52 | struct trace_event; |
49 | 53 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b840e3b2770d..51bd1e72a917 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -334,18 +334,22 @@ alloc_pages(gfp_t gfp_mask, unsigned int order) | |||
334 | } | 334 | } |
335 | extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, | 335 | extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, |
336 | struct vm_area_struct *vma, unsigned long addr, | 336 | struct vm_area_struct *vma, unsigned long addr, |
337 | int node); | 337 | int node, bool hugepage); |
338 | #define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ | ||
339 | alloc_pages_vma(gfp_mask, order, vma, addr, numa_node_id(), true) | ||
338 | #else | 340 | #else |
339 | #define alloc_pages(gfp_mask, order) \ | 341 | #define alloc_pages(gfp_mask, order) \ |
340 | alloc_pages_node(numa_node_id(), gfp_mask, order) | 342 | alloc_pages_node(numa_node_id(), gfp_mask, order) |
341 | #define alloc_pages_vma(gfp_mask, order, vma, addr, node) \ | 343 | #define alloc_pages_vma(gfp_mask, order, vma, addr, node, false)\ |
344 | alloc_pages(gfp_mask, order) | ||
345 | #define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ | ||
342 | alloc_pages(gfp_mask, order) | 346 | alloc_pages(gfp_mask, order) |
343 | #endif | 347 | #endif |
344 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 348 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
345 | #define alloc_page_vma(gfp_mask, vma, addr) \ | 349 | #define alloc_page_vma(gfp_mask, vma, addr) \ |
346 | alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id()) | 350 | alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id(), false) |
347 | #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ | 351 | #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ |
348 | alloc_pages_vma(gfp_mask, 0, vma, addr, node) | 352 | alloc_pages_vma(gfp_mask, 0, vma, addr, node, false) |
349 | 353 | ||
350 | extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order); | 354 | extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order); |
351 | extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask, | 355 | extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask, |
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index fd85cb120ee0..45afc2dee560 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h | |||
@@ -340,31 +340,32 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) | |||
340 | * etc. | 340 | * etc. |
341 | */ | 341 | */ |
342 | #define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags) | 342 | #define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags) |
343 | #define gpiod_get(varargs...) __gpiod_get(varargs, 0) | 343 | #define gpiod_get(varargs...) __gpiod_get(varargs, GPIOD_ASIS) |
344 | #define __gpiod_get_index(dev, con_id, index, flags, ...) \ | 344 | #define __gpiod_get_index(dev, con_id, index, flags, ...) \ |
345 | __gpiod_get_index(dev, con_id, index, flags) | 345 | __gpiod_get_index(dev, con_id, index, flags) |
346 | #define gpiod_get_index(varargs...) __gpiod_get_index(varargs, 0) | 346 | #define gpiod_get_index(varargs...) __gpiod_get_index(varargs, GPIOD_ASIS) |
347 | #define __gpiod_get_optional(dev, con_id, flags, ...) \ | 347 | #define __gpiod_get_optional(dev, con_id, flags, ...) \ |
348 | __gpiod_get_optional(dev, con_id, flags) | 348 | __gpiod_get_optional(dev, con_id, flags) |
349 | #define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, 0) | 349 | #define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, GPIOD_ASIS) |
350 | #define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \ | 350 | #define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \ |
351 | __gpiod_get_index_optional(dev, con_id, index, flags) | 351 | __gpiod_get_index_optional(dev, con_id, index, flags) |
352 | #define gpiod_get_index_optional(varargs...) \ | 352 | #define gpiod_get_index_optional(varargs...) \ |
353 | __gpiod_get_index_optional(varargs, 0) | 353 | __gpiod_get_index_optional(varargs, GPIOD_ASIS) |
354 | #define __devm_gpiod_get(dev, con_id, flags, ...) \ | 354 | #define __devm_gpiod_get(dev, con_id, flags, ...) \ |
355 | __devm_gpiod_get(dev, con_id, flags) | 355 | __devm_gpiod_get(dev, con_id, flags) |
356 | #define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, 0) | 356 | #define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, GPIOD_ASIS) |
357 | #define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \ | 357 | #define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \ |
358 | __devm_gpiod_get_index(dev, con_id, index, flags) | 358 | __devm_gpiod_get_index(dev, con_id, index, flags) |
359 | #define devm_gpiod_get_index(varargs...) __devm_gpiod_get_index(varargs, 0) | 359 | #define devm_gpiod_get_index(varargs...) \ |
360 | __devm_gpiod_get_index(varargs, GPIOD_ASIS) | ||
360 | #define __devm_gpiod_get_optional(dev, con_id, flags, ...) \ | 361 | #define __devm_gpiod_get_optional(dev, con_id, flags, ...) \ |
361 | __devm_gpiod_get_optional(dev, con_id, flags) | 362 | __devm_gpiod_get_optional(dev, con_id, flags) |
362 | #define devm_gpiod_get_optional(varargs...) \ | 363 | #define devm_gpiod_get_optional(varargs...) \ |
363 | __devm_gpiod_get_optional(varargs, 0) | 364 | __devm_gpiod_get_optional(varargs, GPIOD_ASIS) |
364 | #define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \ | 365 | #define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \ |
365 | __devm_gpiod_get_index_optional(dev, con_id, index, flags) | 366 | __devm_gpiod_get_index_optional(dev, con_id, index, flags) |
366 | #define devm_gpiod_get_index_optional(varargs...) \ | 367 | #define devm_gpiod_get_index_optional(varargs...) \ |
367 | __devm_gpiod_get_index_optional(varargs, 0) | 368 | __devm_gpiod_get_index_optional(varargs, GPIOD_ASIS) |
368 | 369 | ||
369 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) | 370 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) |
370 | 371 | ||
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index cbb5790a35cd..e9744202fa29 100644 --- a/include/linux/hdmi.h +++ b/include/linux/hdmi.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define __LINUX_HDMI_H_ | 25 | #define __LINUX_HDMI_H_ |
26 | 26 | ||
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/device.h> | ||
28 | 29 | ||
29 | enum hdmi_infoframe_type { | 30 | enum hdmi_infoframe_type { |
30 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, | 31 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, |
@@ -52,12 +53,18 @@ enum hdmi_colorspace { | |||
52 | HDMI_COLORSPACE_RGB, | 53 | HDMI_COLORSPACE_RGB, |
53 | HDMI_COLORSPACE_YUV422, | 54 | HDMI_COLORSPACE_YUV422, |
54 | HDMI_COLORSPACE_YUV444, | 55 | HDMI_COLORSPACE_YUV444, |
56 | HDMI_COLORSPACE_YUV420, | ||
57 | HDMI_COLORSPACE_RESERVED4, | ||
58 | HDMI_COLORSPACE_RESERVED5, | ||
59 | HDMI_COLORSPACE_RESERVED6, | ||
60 | HDMI_COLORSPACE_IDO_DEFINED, | ||
55 | }; | 61 | }; |
56 | 62 | ||
57 | enum hdmi_scan_mode { | 63 | enum hdmi_scan_mode { |
58 | HDMI_SCAN_MODE_NONE, | 64 | HDMI_SCAN_MODE_NONE, |
59 | HDMI_SCAN_MODE_OVERSCAN, | 65 | HDMI_SCAN_MODE_OVERSCAN, |
60 | HDMI_SCAN_MODE_UNDERSCAN, | 66 | HDMI_SCAN_MODE_UNDERSCAN, |
67 | HDMI_SCAN_MODE_RESERVED, | ||
61 | }; | 68 | }; |
62 | 69 | ||
63 | enum hdmi_colorimetry { | 70 | enum hdmi_colorimetry { |
@@ -71,6 +78,7 @@ enum hdmi_picture_aspect { | |||
71 | HDMI_PICTURE_ASPECT_NONE, | 78 | HDMI_PICTURE_ASPECT_NONE, |
72 | HDMI_PICTURE_ASPECT_4_3, | 79 | HDMI_PICTURE_ASPECT_4_3, |
73 | HDMI_PICTURE_ASPECT_16_9, | 80 | HDMI_PICTURE_ASPECT_16_9, |
81 | HDMI_PICTURE_ASPECT_RESERVED, | ||
74 | }; | 82 | }; |
75 | 83 | ||
76 | enum hdmi_active_aspect { | 84 | enum hdmi_active_aspect { |
@@ -92,12 +100,18 @@ enum hdmi_extended_colorimetry { | |||
92 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, | 100 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, |
93 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, | 101 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, |
94 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, | 102 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, |
103 | |||
104 | /* The following EC values are only defined in CEA-861-F. */ | ||
105 | HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM, | ||
106 | HDMI_EXTENDED_COLORIMETRY_BT2020, | ||
107 | HDMI_EXTENDED_COLORIMETRY_RESERVED, | ||
95 | }; | 108 | }; |
96 | 109 | ||
97 | enum hdmi_quantization_range { | 110 | enum hdmi_quantization_range { |
98 | HDMI_QUANTIZATION_RANGE_DEFAULT, | 111 | HDMI_QUANTIZATION_RANGE_DEFAULT, |
99 | HDMI_QUANTIZATION_RANGE_LIMITED, | 112 | HDMI_QUANTIZATION_RANGE_LIMITED, |
100 | HDMI_QUANTIZATION_RANGE_FULL, | 113 | HDMI_QUANTIZATION_RANGE_FULL, |
114 | HDMI_QUANTIZATION_RANGE_RESERVED, | ||
101 | }; | 115 | }; |
102 | 116 | ||
103 | /* non-uniform picture scaling */ | 117 | /* non-uniform picture scaling */ |
@@ -114,7 +128,7 @@ enum hdmi_ycc_quantization_range { | |||
114 | }; | 128 | }; |
115 | 129 | ||
116 | enum hdmi_content_type { | 130 | enum hdmi_content_type { |
117 | HDMI_CONTENT_TYPE_NONE, | 131 | HDMI_CONTENT_TYPE_GRAPHICS, |
118 | HDMI_CONTENT_TYPE_PHOTO, | 132 | HDMI_CONTENT_TYPE_PHOTO, |
119 | HDMI_CONTENT_TYPE_CINEMA, | 133 | HDMI_CONTENT_TYPE_CINEMA, |
120 | HDMI_CONTENT_TYPE_GAME, | 134 | HDMI_CONTENT_TYPE_GAME, |
@@ -194,6 +208,7 @@ enum hdmi_audio_coding_type { | |||
194 | HDMI_AUDIO_CODING_TYPE_MLP, | 208 | HDMI_AUDIO_CODING_TYPE_MLP, |
195 | HDMI_AUDIO_CODING_TYPE_DST, | 209 | HDMI_AUDIO_CODING_TYPE_DST, |
196 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, | 210 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, |
211 | HDMI_AUDIO_CODING_TYPE_CXT, | ||
197 | }; | 212 | }; |
198 | 213 | ||
199 | enum hdmi_audio_sample_size { | 214 | enum hdmi_audio_sample_size { |
@@ -215,10 +230,25 @@ enum hdmi_audio_sample_frequency { | |||
215 | }; | 230 | }; |
216 | 231 | ||
217 | enum hdmi_audio_coding_type_ext { | 232 | enum hdmi_audio_coding_type_ext { |
218 | HDMI_AUDIO_CODING_TYPE_EXT_STREAM, | 233 | /* Refer to Audio Coding Type (CT) field in Data Byte 1 */ |
234 | HDMI_AUDIO_CODING_TYPE_EXT_CT, | ||
235 | |||
236 | /* | ||
237 | * The next three CXT values are defined in CEA-861-E only. | ||
238 | * They do not exist in older versions, and in CEA-861-F they are | ||
239 | * defined as 'Not in use'. | ||
240 | */ | ||
219 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, | 241 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, |
220 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, | 242 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, |
221 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, | 243 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, |
244 | |||
245 | /* The following CXT values are only defined in CEA-861-F. */ | ||
246 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC, | ||
247 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_V2, | ||
248 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC, | ||
249 | HDMI_AUDIO_CODING_TYPE_EXT_DRA, | ||
250 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_SURROUND, | ||
251 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC_SURROUND = 10, | ||
222 | }; | 252 | }; |
223 | 253 | ||
224 | struct hdmi_audio_infoframe { | 254 | struct hdmi_audio_infoframe { |
@@ -299,5 +329,8 @@ union hdmi_infoframe { | |||
299 | 329 | ||
300 | ssize_t | 330 | ssize_t |
301 | hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size); | 331 | hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size); |
332 | int hdmi_infoframe_unpack(union hdmi_infoframe *frame, void *buffer); | ||
333 | void hdmi_infoframe_log(const char *level, struct device *dev, | ||
334 | union hdmi_infoframe *frame); | ||
302 | 335 | ||
303 | #endif /* _DRM_HDMI_H */ | 336 | #endif /* _DRM_HDMI_H */ |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 06c4607744f6..efc7787a41a8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -574,7 +574,9 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data) | |||
574 | #define HID_GLOBAL_STACK_SIZE 4 | 574 | #define HID_GLOBAL_STACK_SIZE 4 |
575 | #define HID_COLLECTION_STACK_SIZE 4 | 575 | #define HID_COLLECTION_STACK_SIZE 4 |
576 | 576 | ||
577 | #define HID_SCAN_FLAG_MT_WIN_8 0x00000001 | 577 | #define HID_SCAN_FLAG_MT_WIN_8 BIT(0) |
578 | #define HID_SCAN_FLAG_VENDOR_SPECIFIC BIT(1) | ||
579 | #define HID_SCAN_FLAG_GD_POINTER BIT(2) | ||
578 | 580 | ||
579 | struct hid_parser { | 581 | struct hid_parser { |
580 | struct hid_global global; | 582 | struct hid_global global; |
diff --git a/include/linux/host1x.h b/include/linux/host1x.h index bb9840fd1e18..464f33814a94 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h | |||
@@ -250,17 +250,29 @@ void host1x_job_unpin(struct host1x_job *job); | |||
250 | struct host1x_device; | 250 | struct host1x_device; |
251 | 251 | ||
252 | struct host1x_driver { | 252 | struct host1x_driver { |
253 | struct device_driver driver; | ||
254 | |||
253 | const struct of_device_id *subdevs; | 255 | const struct of_device_id *subdevs; |
254 | struct list_head list; | 256 | struct list_head list; |
255 | const char *name; | ||
256 | 257 | ||
257 | int (*probe)(struct host1x_device *device); | 258 | int (*probe)(struct host1x_device *device); |
258 | int (*remove)(struct host1x_device *device); | 259 | int (*remove)(struct host1x_device *device); |
260 | void (*shutdown)(struct host1x_device *device); | ||
259 | }; | 261 | }; |
260 | 262 | ||
261 | int host1x_driver_register(struct host1x_driver *driver); | 263 | static inline struct host1x_driver * |
264 | to_host1x_driver(struct device_driver *driver) | ||
265 | { | ||
266 | return container_of(driver, struct host1x_driver, driver); | ||
267 | } | ||
268 | |||
269 | int host1x_driver_register_full(struct host1x_driver *driver, | ||
270 | struct module *owner); | ||
262 | void host1x_driver_unregister(struct host1x_driver *driver); | 271 | void host1x_driver_unregister(struct host1x_driver *driver); |
263 | 272 | ||
273 | #define host1x_driver_register(driver) \ | ||
274 | host1x_driver_register_full(driver, THIS_MODULE) | ||
275 | |||
264 | struct host1x_device { | 276 | struct host1x_device { |
265 | struct host1x_driver *driver; | 277 | struct host1x_driver *driver; |
266 | struct list_head list; | 278 | struct list_head list; |
@@ -272,6 +284,8 @@ struct host1x_device { | |||
272 | 284 | ||
273 | struct mutex clients_lock; | 285 | struct mutex clients_lock; |
274 | struct list_head clients; | 286 | struct list_head clients; |
287 | |||
288 | bool registered; | ||
275 | }; | 289 | }; |
276 | 290 | ||
277 | static inline struct host1x_device *to_host1x_device(struct device *dev) | 291 | static inline struct host1x_device *to_host1x_device(struct device *dev) |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index a036d058a249..05f6df1fdf5b 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -170,6 +170,7 @@ enum hrtimer_base_type { | |||
170 | * @clock_was_set: Indicates that clock was set from irq context. | 170 | * @clock_was_set: Indicates that clock was set from irq context. |
171 | * @expires_next: absolute time of the next event which was scheduled | 171 | * @expires_next: absolute time of the next event which was scheduled |
172 | * via clock_set_next_event() | 172 | * via clock_set_next_event() |
173 | * @in_hrtirq: hrtimer_interrupt() is currently executing | ||
173 | * @hres_active: State of high resolution mode | 174 | * @hres_active: State of high resolution mode |
174 | * @hang_detected: The last hrtimer interrupt detected a hang | 175 | * @hang_detected: The last hrtimer interrupt detected a hang |
175 | * @nr_events: Total number of hrtimer interrupt events | 176 | * @nr_events: Total number of hrtimer interrupt events |
@@ -185,6 +186,7 @@ struct hrtimer_cpu_base { | |||
185 | unsigned int clock_was_set; | 186 | unsigned int clock_was_set; |
186 | #ifdef CONFIG_HIGH_RES_TIMERS | 187 | #ifdef CONFIG_HIGH_RES_TIMERS |
187 | ktime_t expires_next; | 188 | ktime_t expires_next; |
189 | int in_hrtirq; | ||
188 | int hres_active; | 190 | int hres_active; |
189 | int hang_detected; | 191 | int hang_detected; |
190 | unsigned long nr_events; | 192 | unsigned long nr_events; |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ad9051bab267..f10b20f05159 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -157,6 +157,13 @@ static inline int hpage_nr_pages(struct page *page) | |||
157 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | 157 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, |
158 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); | 158 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); |
159 | 159 | ||
160 | extern struct page *huge_zero_page; | ||
161 | |||
162 | static inline bool is_huge_zero_page(struct page *page) | ||
163 | { | ||
164 | return ACCESS_ONCE(huge_zero_page) == page; | ||
165 | } | ||
166 | |||
160 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | 167 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ |
161 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | 168 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) |
162 | #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) | 169 | #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) |
@@ -206,6 +213,11 @@ static inline int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_str | |||
206 | return 0; | 213 | return 0; |
207 | } | 214 | } |
208 | 215 | ||
216 | static inline bool is_huge_zero_page(struct page *page) | ||
217 | { | ||
218 | return false; | ||
219 | } | ||
220 | |||
209 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 221 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
210 | 222 | ||
211 | #endif /* _LINUX_HUGE_MM_H */ | 223 | #endif /* _LINUX_HUGE_MM_H */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 431b7fc605c9..7b5785032049 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -86,7 +86,7 @@ void free_huge_page(struct page *page); | |||
86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | extern unsigned long hugepages_treat_as_movable; | 89 | extern int hugepages_treat_as_movable; |
90 | extern int sysctl_hugetlb_shm_group; | 90 | extern int sysctl_hugetlb_shm_group; |
91 | extern struct list_head huge_boot_pages; | 91 | extern struct list_head huge_boot_pages; |
92 | 92 | ||
@@ -99,9 +99,9 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); | |||
99 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | 99 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, |
100 | int write); | 100 | int write); |
101 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 101 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
102 | pmd_t *pmd, int write); | 102 | pmd_t *pmd, int flags); |
103 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, | 103 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, |
104 | pud_t *pud, int write); | 104 | pud_t *pud, int flags); |
105 | int pmd_huge(pmd_t pmd); | 105 | int pmd_huge(pmd_t pmd); |
106 | int pud_huge(pud_t pmd); | 106 | int pud_huge(pud_t pmd); |
107 | unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | 107 | unsigned long hugetlb_change_protection(struct vm_area_struct *vma, |
@@ -133,8 +133,8 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
133 | static inline void hugetlb_show_meminfo(void) | 133 | static inline void hugetlb_show_meminfo(void) |
134 | { | 134 | { |
135 | } | 135 | } |
136 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 136 | #define follow_huge_pmd(mm, addr, pmd, flags) NULL |
137 | #define follow_huge_pud(mm, addr, pud, write) NULL | 137 | #define follow_huge_pud(mm, addr, pud, flags) NULL |
138 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) | 138 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) |
139 | #define pmd_huge(x) 0 | 139 | #define pmd_huge(x) 0 |
140 | #define pud_huge(x) 0 | 140 | #define pud_huge(x) 0 |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 914bb08cd738..eb7b414d232b 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
@@ -12,8 +12,10 @@ | |||
12 | #ifndef LINUX_HWRANDOM_H_ | 12 | #ifndef LINUX_HWRANDOM_H_ |
13 | #define LINUX_HWRANDOM_H_ | 13 | #define LINUX_HWRANDOM_H_ |
14 | 14 | ||
15 | #include <linux/completion.h> | ||
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
16 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/kref.h> | ||
17 | 19 | ||
18 | /** | 20 | /** |
19 | * struct hwrng - Hardware Random Number Generator driver | 21 | * struct hwrng - Hardware Random Number Generator driver |
@@ -44,6 +46,8 @@ struct hwrng { | |||
44 | 46 | ||
45 | /* internal. */ | 47 | /* internal. */ |
46 | struct list_head list; | 48 | struct list_head list; |
49 | struct kref ref; | ||
50 | struct completion cleanup_done; | ||
47 | }; | 51 | }; |
48 | 52 | ||
49 | /** Register a new Hardware Random Number Generator driver. */ | 53 | /** Register a new Hardware Random Number Generator driver. */ |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 476c685ca6f9..5a2ba674795e 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -57,6 +57,18 @@ struct hv_multipage_buffer { | |||
57 | u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT]; | 57 | u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT]; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* | ||
61 | * Multiple-page buffer array; the pfn array is variable size: | ||
62 | * The number of entries in the PFN array is determined by | ||
63 | * "len" and "offset". | ||
64 | */ | ||
65 | struct hv_mpb_array { | ||
66 | /* Length and Offset determines the # of pfns in the array */ | ||
67 | u32 len; | ||
68 | u32 offset; | ||
69 | u64 pfn_array[]; | ||
70 | }; | ||
71 | |||
60 | /* 0x18 includes the proprietary packet header */ | 72 | /* 0x18 includes the proprietary packet header */ |
61 | #define MAX_PAGE_BUFFER_PACKET (0x18 + \ | 73 | #define MAX_PAGE_BUFFER_PACKET (0x18 + \ |
62 | (sizeof(struct hv_page_buffer) * \ | 74 | (sizeof(struct hv_page_buffer) * \ |
@@ -722,7 +734,12 @@ struct vmbus_channel { | |||
722 | */ | 734 | */ |
723 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); | 735 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); |
724 | 736 | ||
725 | spinlock_t sc_lock; | 737 | /* |
738 | * The spinlock to protect the structure. It is being used to protect | ||
739 | * test-and-set access to various attributes of the structure as well | ||
740 | * as all sc_list operations. | ||
741 | */ | ||
742 | spinlock_t lock; | ||
726 | /* | 743 | /* |
727 | * All Sub-channels of a primary channel are linked here. | 744 | * All Sub-channels of a primary channel are linked here. |
728 | */ | 745 | */ |
@@ -814,6 +831,18 @@ struct vmbus_channel_packet_multipage_buffer { | |||
814 | struct hv_multipage_buffer range; | 831 | struct hv_multipage_buffer range; |
815 | } __packed; | 832 | } __packed; |
816 | 833 | ||
834 | /* The format must be the same as struct vmdata_gpa_direct */ | ||
835 | struct vmbus_packet_mpb_array { | ||
836 | u16 type; | ||
837 | u16 dataoffset8; | ||
838 | u16 length8; | ||
839 | u16 flags; | ||
840 | u64 transactionid; | ||
841 | u32 reserved; | ||
842 | u32 rangecount; /* Always 1 in this case */ | ||
843 | struct hv_mpb_array range; | ||
844 | } __packed; | ||
845 | |||
817 | 846 | ||
818 | extern int vmbus_open(struct vmbus_channel *channel, | 847 | extern int vmbus_open(struct vmbus_channel *channel, |
819 | u32 send_ringbuffersize, | 848 | u32 send_ringbuffersize, |
@@ -845,6 +874,13 @@ extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel, | |||
845 | u32 bufferlen, | 874 | u32 bufferlen, |
846 | u64 requestid); | 875 | u64 requestid); |
847 | 876 | ||
877 | extern int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, | ||
878 | struct vmbus_packet_mpb_array *mpb, | ||
879 | u32 desc_size, | ||
880 | void *buffer, | ||
881 | u32 bufferlen, | ||
882 | u64 requestid); | ||
883 | |||
848 | extern int vmbus_establish_gpadl(struct vmbus_channel *channel, | 884 | extern int vmbus_establish_gpadl(struct vmbus_channel *channel, |
849 | void *kbuffer, | 885 | void *kbuffer, |
850 | u32 size, | 886 | u32 size, |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 7c7695940ddd..f17da50402a4 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -130,8 +130,6 @@ extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, | |||
130 | * @probe: Callback for device binding | 130 | * @probe: Callback for device binding |
131 | * @remove: Callback for device unbinding | 131 | * @remove: Callback for device unbinding |
132 | * @shutdown: Callback for device shutdown | 132 | * @shutdown: Callback for device shutdown |
133 | * @suspend: Callback for device suspend | ||
134 | * @resume: Callback for device resume | ||
135 | * @alert: Alert callback, for example for the SMBus alert protocol | 133 | * @alert: Alert callback, for example for the SMBus alert protocol |
136 | * @command: Callback for bus-wide signaling (optional) | 134 | * @command: Callback for bus-wide signaling (optional) |
137 | * @driver: Device driver model driver | 135 | * @driver: Device driver model driver |
@@ -174,8 +172,6 @@ struct i2c_driver { | |||
174 | 172 | ||
175 | /* driver model interfaces that don't relate to enumeration */ | 173 | /* driver model interfaces that don't relate to enumeration */ |
176 | void (*shutdown)(struct i2c_client *); | 174 | void (*shutdown)(struct i2c_client *); |
177 | int (*suspend)(struct i2c_client *, pm_message_t mesg); | ||
178 | int (*resume)(struct i2c_client *); | ||
179 | 175 | ||
180 | /* Alert callback, for example for the SMBus alert protocol. | 176 | /* Alert callback, for example for the SMBus alert protocol. |
181 | * The format and meaning of the data value depends on the protocol. | 177 | * The format and meaning of the data value depends on the protocol. |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h deleted file mode 100644 index d23c3c20b201..000000000000 --- a/include/linux/i2o.h +++ /dev/null | |||
@@ -1,988 +0,0 @@ | |||
1 | /* | ||
2 | * I2O kernel space accessible structures/APIs | ||
3 | * | ||
4 | * (c) Copyright 1999, 2000 Red Hat Software | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | ************************************************************************* | ||
12 | * | ||
13 | * This header file defined the I2O APIs/structures for use by | ||
14 | * the I2O kernel modules. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef _I2O_H | ||
19 | #define _I2O_H | ||
20 | |||
21 | #include <linux/i2o-dev.h> | ||
22 | |||
23 | /* How many different OSM's are we allowing */ | ||
24 | #define I2O_MAX_DRIVERS 8 | ||
25 | |||
26 | #include <linux/pci.h> | ||
27 | #include <linux/bug.h> | ||
28 | #include <linux/dma-mapping.h> | ||
29 | #include <linux/string.h> | ||
30 | #include <linux/slab.h> | ||
31 | #include <linux/workqueue.h> /* work_struct */ | ||
32 | #include <linux/mempool.h> | ||
33 | #include <linux/mutex.h> | ||
34 | #include <linux/scatterlist.h> | ||
35 | #include <linux/semaphore.h> /* Needed for MUTEX init macros */ | ||
36 | |||
37 | #include <asm/io.h> | ||
38 | |||
39 | /* message queue empty */ | ||
40 | #define I2O_QUEUE_EMPTY 0xffffffff | ||
41 | |||
42 | /* | ||
43 | * Cache strategies | ||
44 | */ | ||
45 | |||
46 | /* The NULL strategy leaves everything up to the controller. This tends to be a | ||
47 | * pessimal but functional choice. | ||
48 | */ | ||
49 | #define CACHE_NULL 0 | ||
50 | /* Prefetch data when reading. We continually attempt to load the next 32 sectors | ||
51 | * into the controller cache. | ||
52 | */ | ||
53 | #define CACHE_PREFETCH 1 | ||
54 | /* Prefetch data when reading. We sometimes attempt to load the next 32 sectors | ||
55 | * into the controller cache. When an I/O is less <= 8K we assume its probably | ||
56 | * not sequential and don't prefetch (default) | ||
57 | */ | ||
58 | #define CACHE_SMARTFETCH 2 | ||
59 | /* Data is written to the cache and then out on to the disk. The I/O must be | ||
60 | * physically on the medium before the write is acknowledged (default without | ||
61 | * NVRAM) | ||
62 | */ | ||
63 | #define CACHE_WRITETHROUGH 17 | ||
64 | /* Data is written to the cache and then out on to the disk. The controller | ||
65 | * is permitted to write back the cache any way it wants. (default if battery | ||
66 | * backed NVRAM is present). It can be useful to set this for swap regardless of | ||
67 | * battery state. | ||
68 | */ | ||
69 | #define CACHE_WRITEBACK 18 | ||
70 | /* Optimise for under powered controllers, especially on RAID1 and RAID0. We | ||
71 | * write large I/O's directly to disk bypassing the cache to avoid the extra | ||
72 | * memory copy hits. Small writes are writeback cached | ||
73 | */ | ||
74 | #define CACHE_SMARTBACK 19 | ||
75 | /* Optimise for under powered controllers, especially on RAID1 and RAID0. We | ||
76 | * write large I/O's directly to disk bypassing the cache to avoid the extra | ||
77 | * memory copy hits. Small writes are writethrough cached. Suitable for devices | ||
78 | * lacking battery backup | ||
79 | */ | ||
80 | #define CACHE_SMARTTHROUGH 20 | ||
81 | |||
82 | /* | ||
83 | * Ioctl structures | ||
84 | */ | ||
85 | |||
86 | #define BLKI2OGRSTRAT _IOR('2', 1, int) | ||
87 | #define BLKI2OGWSTRAT _IOR('2', 2, int) | ||
88 | #define BLKI2OSRSTRAT _IOW('2', 3, int) | ||
89 | #define BLKI2OSWSTRAT _IOW('2', 4, int) | ||
90 | |||
91 | /* | ||
92 | * I2O Function codes | ||
93 | */ | ||
94 | |||
95 | /* | ||
96 | * Executive Class | ||
97 | */ | ||
98 | #define I2O_CMD_ADAPTER_ASSIGN 0xB3 | ||
99 | #define I2O_CMD_ADAPTER_READ 0xB2 | ||
100 | #define I2O_CMD_ADAPTER_RELEASE 0xB5 | ||
101 | #define I2O_CMD_BIOS_INFO_SET 0xA5 | ||
102 | #define I2O_CMD_BOOT_DEVICE_SET 0xA7 | ||
103 | #define I2O_CMD_CONFIG_VALIDATE 0xBB | ||
104 | #define I2O_CMD_CONN_SETUP 0xCA | ||
105 | #define I2O_CMD_DDM_DESTROY 0xB1 | ||
106 | #define I2O_CMD_DDM_ENABLE 0xD5 | ||
107 | #define I2O_CMD_DDM_QUIESCE 0xC7 | ||
108 | #define I2O_CMD_DDM_RESET 0xD9 | ||
109 | #define I2O_CMD_DDM_SUSPEND 0xAF | ||
110 | #define I2O_CMD_DEVICE_ASSIGN 0xB7 | ||
111 | #define I2O_CMD_DEVICE_RELEASE 0xB9 | ||
112 | #define I2O_CMD_HRT_GET 0xA8 | ||
113 | #define I2O_CMD_ADAPTER_CLEAR 0xBE | ||
114 | #define I2O_CMD_ADAPTER_CONNECT 0xC9 | ||
115 | #define I2O_CMD_ADAPTER_RESET 0xBD | ||
116 | #define I2O_CMD_LCT_NOTIFY 0xA2 | ||
117 | #define I2O_CMD_OUTBOUND_INIT 0xA1 | ||
118 | #define I2O_CMD_PATH_ENABLE 0xD3 | ||
119 | #define I2O_CMD_PATH_QUIESCE 0xC5 | ||
120 | #define I2O_CMD_PATH_RESET 0xD7 | ||
121 | #define I2O_CMD_STATIC_MF_CREATE 0xDD | ||
122 | #define I2O_CMD_STATIC_MF_RELEASE 0xDF | ||
123 | #define I2O_CMD_STATUS_GET 0xA0 | ||
124 | #define I2O_CMD_SW_DOWNLOAD 0xA9 | ||
125 | #define I2O_CMD_SW_UPLOAD 0xAB | ||
126 | #define I2O_CMD_SW_REMOVE 0xAD | ||
127 | #define I2O_CMD_SYS_ENABLE 0xD1 | ||
128 | #define I2O_CMD_SYS_MODIFY 0xC1 | ||
129 | #define I2O_CMD_SYS_QUIESCE 0xC3 | ||
130 | #define I2O_CMD_SYS_TAB_SET 0xA3 | ||
131 | |||
132 | /* | ||
133 | * Utility Class | ||
134 | */ | ||
135 | #define I2O_CMD_UTIL_NOP 0x00 | ||
136 | #define I2O_CMD_UTIL_ABORT 0x01 | ||
137 | #define I2O_CMD_UTIL_CLAIM 0x09 | ||
138 | #define I2O_CMD_UTIL_RELEASE 0x0B | ||
139 | #define I2O_CMD_UTIL_PARAMS_GET 0x06 | ||
140 | #define I2O_CMD_UTIL_PARAMS_SET 0x05 | ||
141 | #define I2O_CMD_UTIL_EVT_REGISTER 0x13 | ||
142 | #define I2O_CMD_UTIL_EVT_ACK 0x14 | ||
143 | #define I2O_CMD_UTIL_CONFIG_DIALOG 0x10 | ||
144 | #define I2O_CMD_UTIL_DEVICE_RESERVE 0x0D | ||
145 | #define I2O_CMD_UTIL_DEVICE_RELEASE 0x0F | ||
146 | #define I2O_CMD_UTIL_LOCK 0x17 | ||
147 | #define I2O_CMD_UTIL_LOCK_RELEASE 0x19 | ||
148 | #define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY 0x15 | ||
149 | |||
150 | /* | ||
151 | * SCSI Host Bus Adapter Class | ||
152 | */ | ||
153 | #define I2O_CMD_SCSI_EXEC 0x81 | ||
154 | #define I2O_CMD_SCSI_ABORT 0x83 | ||
155 | #define I2O_CMD_SCSI_BUSRESET 0x27 | ||
156 | |||
157 | /* | ||
158 | * Bus Adapter Class | ||
159 | */ | ||
160 | #define I2O_CMD_BUS_ADAPTER_RESET 0x85 | ||
161 | #define I2O_CMD_BUS_RESET 0x87 | ||
162 | #define I2O_CMD_BUS_SCAN 0x89 | ||
163 | #define I2O_CMD_BUS_QUIESCE 0x8b | ||
164 | |||
165 | /* | ||
166 | * Random Block Storage Class | ||
167 | */ | ||
168 | #define I2O_CMD_BLOCK_READ 0x30 | ||
169 | #define I2O_CMD_BLOCK_WRITE 0x31 | ||
170 | #define I2O_CMD_BLOCK_CFLUSH 0x37 | ||
171 | #define I2O_CMD_BLOCK_MLOCK 0x49 | ||
172 | #define I2O_CMD_BLOCK_MUNLOCK 0x4B | ||
173 | #define I2O_CMD_BLOCK_MMOUNT 0x41 | ||
174 | #define I2O_CMD_BLOCK_MEJECT 0x43 | ||
175 | #define I2O_CMD_BLOCK_POWER 0x70 | ||
176 | |||
177 | #define I2O_CMD_PRIVATE 0xFF | ||
178 | |||
179 | /* Command status values */ | ||
180 | |||
181 | #define I2O_CMD_IN_PROGRESS 0x01 | ||
182 | #define I2O_CMD_REJECTED 0x02 | ||
183 | #define I2O_CMD_FAILED 0x03 | ||
184 | #define I2O_CMD_COMPLETED 0x04 | ||
185 | |||
186 | /* I2O API function return values */ | ||
187 | |||
188 | #define I2O_RTN_NO_ERROR 0 | ||
189 | #define I2O_RTN_NOT_INIT 1 | ||
190 | #define I2O_RTN_FREE_Q_EMPTY 2 | ||
191 | #define I2O_RTN_TCB_ERROR 3 | ||
192 | #define I2O_RTN_TRANSACTION_ERROR 4 | ||
193 | #define I2O_RTN_ADAPTER_ALREADY_INIT 5 | ||
194 | #define I2O_RTN_MALLOC_ERROR 6 | ||
195 | #define I2O_RTN_ADPTR_NOT_REGISTERED 7 | ||
196 | #define I2O_RTN_MSG_REPLY_TIMEOUT 8 | ||
197 | #define I2O_RTN_NO_STATUS 9 | ||
198 | #define I2O_RTN_NO_FIRM_VER 10 | ||
199 | #define I2O_RTN_NO_LINK_SPEED 11 | ||
200 | |||
201 | /* Reply message status defines for all messages */ | ||
202 | |||
203 | #define I2O_REPLY_STATUS_SUCCESS 0x00 | ||
204 | #define I2O_REPLY_STATUS_ABORT_DIRTY 0x01 | ||
205 | #define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02 | ||
206 | #define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03 | ||
207 | #define I2O_REPLY_STATUS_ERROR_DIRTY 0x04 | ||
208 | #define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05 | ||
209 | #define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06 | ||
210 | #define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08 | ||
211 | #define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09 | ||
212 | #define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0A | ||
213 | #define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0B | ||
214 | #define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80 | ||
215 | |||
216 | /* Status codes and Error Information for Parameter functions */ | ||
217 | |||
218 | #define I2O_PARAMS_STATUS_SUCCESS 0x00 | ||
219 | #define I2O_PARAMS_STATUS_BAD_KEY_ABORT 0x01 | ||
220 | #define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE 0x02 | ||
221 | #define I2O_PARAMS_STATUS_BUFFER_FULL 0x03 | ||
222 | #define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL 0x04 | ||
223 | #define I2O_PARAMS_STATUS_FIELD_UNREADABLE 0x05 | ||
224 | #define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE 0x06 | ||
225 | #define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS 0x07 | ||
226 | #define I2O_PARAMS_STATUS_INVALID_GROUP_ID 0x08 | ||
227 | #define I2O_PARAMS_STATUS_INVALID_OPERATION 0x09 | ||
228 | #define I2O_PARAMS_STATUS_NO_KEY_FIELD 0x0A | ||
229 | #define I2O_PARAMS_STATUS_NO_SUCH_FIELD 0x0B | ||
230 | #define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP 0x0C | ||
231 | #define I2O_PARAMS_STATUS_OPERATION_ERROR 0x0D | ||
232 | #define I2O_PARAMS_STATUS_SCALAR_ERROR 0x0E | ||
233 | #define I2O_PARAMS_STATUS_TABLE_ERROR 0x0F | ||
234 | #define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE 0x10 | ||
235 | |||
236 | /* DetailedStatusCode defines for Executive, DDM, Util and Transaction error | ||
237 | * messages: Table 3-2 Detailed Status Codes.*/ | ||
238 | |||
239 | #define I2O_DSC_SUCCESS 0x0000 | ||
240 | #define I2O_DSC_BAD_KEY 0x0002 | ||
241 | #define I2O_DSC_TCL_ERROR 0x0003 | ||
242 | #define I2O_DSC_REPLY_BUFFER_FULL 0x0004 | ||
243 | #define I2O_DSC_NO_SUCH_PAGE 0x0005 | ||
244 | #define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT 0x0006 | ||
245 | #define I2O_DSC_INSUFFICIENT_RESOURCE_HARD 0x0007 | ||
246 | #define I2O_DSC_CHAIN_BUFFER_TOO_LARGE 0x0009 | ||
247 | #define I2O_DSC_UNSUPPORTED_FUNCTION 0x000A | ||
248 | #define I2O_DSC_DEVICE_LOCKED 0x000B | ||
249 | #define I2O_DSC_DEVICE_RESET 0x000C | ||
250 | #define I2O_DSC_INAPPROPRIATE_FUNCTION 0x000D | ||
251 | #define I2O_DSC_INVALID_INITIATOR_ADDRESS 0x000E | ||
252 | #define I2O_DSC_INVALID_MESSAGE_FLAGS 0x000F | ||
253 | #define I2O_DSC_INVALID_OFFSET 0x0010 | ||
254 | #define I2O_DSC_INVALID_PARAMETER 0x0011 | ||
255 | #define I2O_DSC_INVALID_REQUEST 0x0012 | ||
256 | #define I2O_DSC_INVALID_TARGET_ADDRESS 0x0013 | ||
257 | #define I2O_DSC_MESSAGE_TOO_LARGE 0x0014 | ||
258 | #define I2O_DSC_MESSAGE_TOO_SMALL 0x0015 | ||
259 | #define I2O_DSC_MISSING_PARAMETER 0x0016 | ||
260 | #define I2O_DSC_TIMEOUT 0x0017 | ||
261 | #define I2O_DSC_UNKNOWN_ERROR 0x0018 | ||
262 | #define I2O_DSC_UNKNOWN_FUNCTION 0x0019 | ||
263 | #define I2O_DSC_UNSUPPORTED_VERSION 0x001A | ||
264 | #define I2O_DSC_DEVICE_BUSY 0x001B | ||
265 | #define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C | ||
266 | |||
267 | /* DetailedStatusCode defines for Block Storage Operation: Table 6-7 Detailed | ||
268 | Status Codes.*/ | ||
269 | |||
270 | #define I2O_BSA_DSC_SUCCESS 0x0000 | ||
271 | #define I2O_BSA_DSC_MEDIA_ERROR 0x0001 | ||
272 | #define I2O_BSA_DSC_ACCESS_ERROR 0x0002 | ||
273 | #define I2O_BSA_DSC_DEVICE_FAILURE 0x0003 | ||
274 | #define I2O_BSA_DSC_DEVICE_NOT_READY 0x0004 | ||
275 | #define I2O_BSA_DSC_MEDIA_NOT_PRESENT 0x0005 | ||
276 | #define I2O_BSA_DSC_MEDIA_LOCKED 0x0006 | ||
277 | #define I2O_BSA_DSC_MEDIA_FAILURE 0x0007 | ||
278 | #define I2O_BSA_DSC_PROTOCOL_FAILURE 0x0008 | ||
279 | #define I2O_BSA_DSC_BUS_FAILURE 0x0009 | ||
280 | #define I2O_BSA_DSC_ACCESS_VIOLATION 0x000A | ||
281 | #define I2O_BSA_DSC_WRITE_PROTECTED 0x000B | ||
282 | #define I2O_BSA_DSC_DEVICE_RESET 0x000C | ||
283 | #define I2O_BSA_DSC_VOLUME_CHANGED 0x000D | ||
284 | #define I2O_BSA_DSC_TIMEOUT 0x000E | ||
285 | |||
286 | /* FailureStatusCodes, Table 3-3 Message Failure Codes */ | ||
287 | |||
288 | #define I2O_FSC_TRANSPORT_SERVICE_SUSPENDED 0x81 | ||
289 | #define I2O_FSC_TRANSPORT_SERVICE_TERMINATED 0x82 | ||
290 | #define I2O_FSC_TRANSPORT_CONGESTION 0x83 | ||
291 | #define I2O_FSC_TRANSPORT_FAILURE 0x84 | ||
292 | #define I2O_FSC_TRANSPORT_STATE_ERROR 0x85 | ||
293 | #define I2O_FSC_TRANSPORT_TIME_OUT 0x86 | ||
294 | #define I2O_FSC_TRANSPORT_ROUTING_FAILURE 0x87 | ||
295 | #define I2O_FSC_TRANSPORT_INVALID_VERSION 0x88 | ||
296 | #define I2O_FSC_TRANSPORT_INVALID_OFFSET 0x89 | ||
297 | #define I2O_FSC_TRANSPORT_INVALID_MSG_FLAGS 0x8A | ||
298 | #define I2O_FSC_TRANSPORT_FRAME_TOO_SMALL 0x8B | ||
299 | #define I2O_FSC_TRANSPORT_FRAME_TOO_LARGE 0x8C | ||
300 | #define I2O_FSC_TRANSPORT_INVALID_TARGET_ID 0x8D | ||
301 | #define I2O_FSC_TRANSPORT_INVALID_INITIATOR_ID 0x8E | ||
302 | #define I2O_FSC_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F | ||
303 | #define I2O_FSC_TRANSPORT_UNKNOWN_FAILURE 0xFF | ||
304 | |||
305 | /* Device Claim Types */ | ||
306 | #define I2O_CLAIM_PRIMARY 0x01000000 | ||
307 | #define I2O_CLAIM_MANAGEMENT 0x02000000 | ||
308 | #define I2O_CLAIM_AUTHORIZED 0x03000000 | ||
309 | #define I2O_CLAIM_SECONDARY 0x04000000 | ||
310 | |||
311 | /* Message header defines for VersionOffset */ | ||
312 | #define I2OVER15 0x0001 | ||
313 | #define I2OVER20 0x0002 | ||
314 | |||
315 | /* Default is 1.5 */ | ||
316 | #define I2OVERSION I2OVER15 | ||
317 | |||
318 | #define SGL_OFFSET_0 I2OVERSION | ||
319 | #define SGL_OFFSET_4 (0x0040 | I2OVERSION) | ||
320 | #define SGL_OFFSET_5 (0x0050 | I2OVERSION) | ||
321 | #define SGL_OFFSET_6 (0x0060 | I2OVERSION) | ||
322 | #define SGL_OFFSET_7 (0x0070 | I2OVERSION) | ||
323 | #define SGL_OFFSET_8 (0x0080 | I2OVERSION) | ||
324 | #define SGL_OFFSET_9 (0x0090 | I2OVERSION) | ||
325 | #define SGL_OFFSET_10 (0x00A0 | I2OVERSION) | ||
326 | #define SGL_OFFSET_11 (0x00B0 | I2OVERSION) | ||
327 | #define SGL_OFFSET_12 (0x00C0 | I2OVERSION) | ||
328 | #define SGL_OFFSET(x) (((x)<<4) | I2OVERSION) | ||
329 | |||
330 | /* Transaction Reply Lists (TRL) Control Word structure */ | ||
331 | #define TRL_SINGLE_FIXED_LENGTH 0x00 | ||
332 | #define TRL_SINGLE_VARIABLE_LENGTH 0x40 | ||
333 | #define TRL_MULTIPLE_FIXED_LENGTH 0x80 | ||
334 | |||
335 | /* msg header defines for MsgFlags */ | ||
336 | #define MSG_STATIC 0x0100 | ||
337 | #define MSG_64BIT_CNTXT 0x0200 | ||
338 | #define MSG_MULTI_TRANS 0x1000 | ||
339 | #define MSG_FAIL 0x2000 | ||
340 | #define MSG_FINAL 0x4000 | ||
341 | #define MSG_REPLY 0x8000 | ||
342 | |||
343 | /* minimum size msg */ | ||
344 | #define THREE_WORD_MSG_SIZE 0x00030000 | ||
345 | #define FOUR_WORD_MSG_SIZE 0x00040000 | ||
346 | #define FIVE_WORD_MSG_SIZE 0x00050000 | ||
347 | #define SIX_WORD_MSG_SIZE 0x00060000 | ||
348 | #define SEVEN_WORD_MSG_SIZE 0x00070000 | ||
349 | #define EIGHT_WORD_MSG_SIZE 0x00080000 | ||
350 | #define NINE_WORD_MSG_SIZE 0x00090000 | ||
351 | #define TEN_WORD_MSG_SIZE 0x000A0000 | ||
352 | #define ELEVEN_WORD_MSG_SIZE 0x000B0000 | ||
353 | #define I2O_MESSAGE_SIZE(x) ((x)<<16) | ||
354 | |||
355 | /* special TID assignments */ | ||
356 | #define ADAPTER_TID 0 | ||
357 | #define HOST_TID 1 | ||
358 | |||
359 | /* outbound queue defines */ | ||
360 | #define I2O_MAX_OUTBOUND_MSG_FRAMES 128 | ||
361 | #define I2O_OUTBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */ | ||
362 | |||
363 | /* inbound queue definitions */ | ||
364 | #define I2O_MSG_INPOOL_MIN 32 | ||
365 | #define I2O_INBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */ | ||
366 | |||
367 | #define I2O_POST_WAIT_OK 0 | ||
368 | #define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT | ||
369 | |||
370 | #define I2O_CONTEXT_LIST_MIN_LENGTH 15 | ||
371 | #define I2O_CONTEXT_LIST_USED 0x01 | ||
372 | #define I2O_CONTEXT_LIST_DELETED 0x02 | ||
373 | |||
374 | /* timeouts */ | ||
375 | #define I2O_TIMEOUT_INIT_OUTBOUND_QUEUE 15 | ||
376 | #define I2O_TIMEOUT_MESSAGE_GET 5 | ||
377 | #define I2O_TIMEOUT_RESET 30 | ||
378 | #define I2O_TIMEOUT_STATUS_GET 5 | ||
379 | #define I2O_TIMEOUT_LCT_GET 360 | ||
380 | #define I2O_TIMEOUT_SCSI_SCB_ABORT 240 | ||
381 | |||
382 | /* retries */ | ||
383 | #define I2O_HRT_GET_TRIES 3 | ||
384 | #define I2O_LCT_GET_TRIES 3 | ||
385 | |||
386 | /* defines for max_sectors and max_phys_segments */ | ||
387 | #define I2O_MAX_SECTORS 1024 | ||
388 | #define I2O_MAX_SECTORS_LIMITED 128 | ||
389 | #define I2O_MAX_PHYS_SEGMENTS BLK_MAX_SEGMENTS | ||
390 | |||
391 | /* | ||
392 | * Message structures | ||
393 | */ | ||
394 | struct i2o_message { | ||
395 | union { | ||
396 | struct { | ||
397 | u8 version_offset; | ||
398 | u8 flags; | ||
399 | u16 size; | ||
400 | u32 target_tid:12; | ||
401 | u32 init_tid:12; | ||
402 | u32 function:8; | ||
403 | u32 icntxt; /* initiator context */ | ||
404 | u32 tcntxt; /* transaction context */ | ||
405 | } s; | ||
406 | u32 head[4]; | ||
407 | } u; | ||
408 | /* List follows */ | ||
409 | u32 body[0]; | ||
410 | }; | ||
411 | |||
412 | /* MFA and I2O message used by mempool */ | ||
413 | struct i2o_msg_mfa { | ||
414 | u32 mfa; /* MFA returned by the controller */ | ||
415 | struct i2o_message msg; /* I2O message */ | ||
416 | }; | ||
417 | |||
418 | /* | ||
419 | * Each I2O device entity has one of these. There is one per device. | ||
420 | */ | ||
421 | struct i2o_device { | ||
422 | i2o_lct_entry lct_data; /* Device LCT information */ | ||
423 | |||
424 | struct i2o_controller *iop; /* Controlling IOP */ | ||
425 | struct list_head list; /* node in IOP devices list */ | ||
426 | |||
427 | struct device device; | ||
428 | |||
429 | struct mutex lock; /* device lock */ | ||
430 | }; | ||
431 | |||
432 | /* | ||
433 | * Event structure provided to the event handling function | ||
434 | */ | ||
435 | struct i2o_event { | ||
436 | struct work_struct work; | ||
437 | struct i2o_device *i2o_dev; /* I2O device pointer from which the | ||
438 | event reply was initiated */ | ||
439 | u16 size; /* Size of data in 32-bit words */ | ||
440 | u32 tcntxt; /* Transaction context used at | ||
441 | registration */ | ||
442 | u32 event_indicator; /* Event indicator from reply */ | ||
443 | u32 data[0]; /* Event data from reply */ | ||
444 | }; | ||
445 | |||
446 | /* | ||
447 | * I2O classes which could be handled by the OSM | ||
448 | */ | ||
449 | struct i2o_class_id { | ||
450 | u16 class_id:12; | ||
451 | }; | ||
452 | |||
453 | /* | ||
454 | * I2O driver structure for OSMs | ||
455 | */ | ||
456 | struct i2o_driver { | ||
457 | char *name; /* OSM name */ | ||
458 | int context; /* Low 8 bits of the transaction info */ | ||
459 | struct i2o_class_id *classes; /* I2O classes that this OSM handles */ | ||
460 | |||
461 | /* Message reply handler */ | ||
462 | int (*reply) (struct i2o_controller *, u32, struct i2o_message *); | ||
463 | |||
464 | /* Event handler */ | ||
465 | work_func_t event; | ||
466 | |||
467 | struct workqueue_struct *event_queue; /* Event queue */ | ||
468 | |||
469 | struct device_driver driver; | ||
470 | |||
471 | /* notification of changes */ | ||
472 | void (*notify_controller_add) (struct i2o_controller *); | ||
473 | void (*notify_controller_remove) (struct i2o_controller *); | ||
474 | void (*notify_device_add) (struct i2o_device *); | ||
475 | void (*notify_device_remove) (struct i2o_device *); | ||
476 | |||
477 | struct semaphore lock; | ||
478 | }; | ||
479 | |||
480 | /* | ||
481 | * Contains DMA mapped address information | ||
482 | */ | ||
483 | struct i2o_dma { | ||
484 | void *virt; | ||
485 | dma_addr_t phys; | ||
486 | size_t len; | ||
487 | }; | ||
488 | |||
489 | /* | ||
490 | * Contains slab cache and mempool information | ||
491 | */ | ||
492 | struct i2o_pool { | ||
493 | char *name; | ||
494 | struct kmem_cache *slab; | ||
495 | mempool_t *mempool; | ||
496 | }; | ||
497 | |||
498 | /* | ||
499 | * Contains IO mapped address information | ||
500 | */ | ||
501 | struct i2o_io { | ||
502 | void __iomem *virt; | ||
503 | unsigned long phys; | ||
504 | unsigned long len; | ||
505 | }; | ||
506 | |||
507 | /* | ||
508 | * Context queue entry, used for 32-bit context on 64-bit systems | ||
509 | */ | ||
510 | struct i2o_context_list_element { | ||
511 | struct list_head list; | ||
512 | u32 context; | ||
513 | void *ptr; | ||
514 | unsigned long timestamp; | ||
515 | }; | ||
516 | |||
517 | /* | ||
518 | * Each I2O controller has one of these objects | ||
519 | */ | ||
520 | struct i2o_controller { | ||
521 | char name[16]; | ||
522 | int unit; | ||
523 | int type; | ||
524 | |||
525 | struct pci_dev *pdev; /* PCI device */ | ||
526 | |||
527 | unsigned int promise:1; /* Promise controller */ | ||
528 | unsigned int adaptec:1; /* DPT / Adaptec controller */ | ||
529 | unsigned int raptor:1; /* split bar */ | ||
530 | unsigned int no_quiesce:1; /* dont quiesce before reset */ | ||
531 | unsigned int short_req:1; /* use small block sizes */ | ||
532 | unsigned int limit_sectors:1; /* limit number of sectors / request */ | ||
533 | unsigned int pae_support:1; /* controller has 64-bit SGL support */ | ||
534 | |||
535 | struct list_head devices; /* list of I2O devices */ | ||
536 | struct list_head list; /* Controller list */ | ||
537 | |||
538 | void __iomem *in_port; /* Inbout port address */ | ||
539 | void __iomem *out_port; /* Outbound port address */ | ||
540 | void __iomem *irq_status; /* Interrupt status register address */ | ||
541 | void __iomem *irq_mask; /* Interrupt mask register address */ | ||
542 | |||
543 | struct i2o_dma status; /* IOP status block */ | ||
544 | |||
545 | struct i2o_dma hrt; /* HW Resource Table */ | ||
546 | i2o_lct *lct; /* Logical Config Table */ | ||
547 | struct i2o_dma dlct; /* Temp LCT */ | ||
548 | struct mutex lct_lock; /* Lock for LCT updates */ | ||
549 | struct i2o_dma status_block; /* IOP status block */ | ||
550 | |||
551 | struct i2o_io base; /* controller messaging unit */ | ||
552 | struct i2o_io in_queue; /* inbound message queue Host->IOP */ | ||
553 | struct i2o_dma out_queue; /* outbound message queue IOP->Host */ | ||
554 | |||
555 | struct i2o_pool in_msg; /* mempool for inbound messages */ | ||
556 | |||
557 | unsigned int battery:1; /* Has a battery backup */ | ||
558 | unsigned int io_alloc:1; /* An I/O resource was allocated */ | ||
559 | unsigned int mem_alloc:1; /* A memory resource was allocated */ | ||
560 | |||
561 | struct resource io_resource; /* I/O resource allocated to the IOP */ | ||
562 | struct resource mem_resource; /* Mem resource allocated to the IOP */ | ||
563 | |||
564 | struct device device; | ||
565 | struct i2o_device *exec; /* Executive */ | ||
566 | #if BITS_PER_LONG == 64 | ||
567 | spinlock_t context_list_lock; /* lock for context_list */ | ||
568 | atomic_t context_list_counter; /* needed for unique contexts */ | ||
569 | struct list_head context_list; /* list of context id's | ||
570 | and pointers */ | ||
571 | #endif | ||
572 | spinlock_t lock; /* lock for controller | ||
573 | configuration */ | ||
574 | void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ | ||
575 | }; | ||
576 | |||
577 | /* | ||
578 | * I2O System table entry | ||
579 | * | ||
580 | * The system table contains information about all the IOPs in the | ||
581 | * system. It is sent to all IOPs so that they can create peer2peer | ||
582 | * connections between them. | ||
583 | */ | ||
584 | struct i2o_sys_tbl_entry { | ||
585 | u16 org_id; | ||
586 | u16 reserved1; | ||
587 | u32 iop_id:12; | ||
588 | u32 reserved2:20; | ||
589 | u16 seg_num:12; | ||
590 | u16 i2o_version:4; | ||
591 | u8 iop_state; | ||
592 | u8 msg_type; | ||
593 | u16 frame_size; | ||
594 | u16 reserved3; | ||
595 | u32 last_changed; | ||
596 | u32 iop_capabilities; | ||
597 | u32 inbound_low; | ||
598 | u32 inbound_high; | ||
599 | }; | ||
600 | |||
601 | struct i2o_sys_tbl { | ||
602 | u8 num_entries; | ||
603 | u8 version; | ||
604 | u16 reserved1; | ||
605 | u32 change_ind; | ||
606 | u32 reserved2; | ||
607 | u32 reserved3; | ||
608 | struct i2o_sys_tbl_entry iops[0]; | ||
609 | }; | ||
610 | |||
611 | extern struct list_head i2o_controllers; | ||
612 | |||
613 | /* Message functions */ | ||
614 | extern struct i2o_message *i2o_msg_get_wait(struct i2o_controller *, int); | ||
615 | extern int i2o_msg_post_wait_mem(struct i2o_controller *, struct i2o_message *, | ||
616 | unsigned long, struct i2o_dma *); | ||
617 | |||
618 | /* IOP functions */ | ||
619 | extern int i2o_status_get(struct i2o_controller *); | ||
620 | |||
621 | extern int i2o_event_register(struct i2o_device *, struct i2o_driver *, int, | ||
622 | u32); | ||
623 | extern struct i2o_device *i2o_iop_find_device(struct i2o_controller *, u16); | ||
624 | extern struct i2o_controller *i2o_find_iop(int); | ||
625 | |||
626 | /* Functions needed for handling 64-bit pointers in 32-bit context */ | ||
627 | #if BITS_PER_LONG == 64 | ||
628 | extern u32 i2o_cntxt_list_add(struct i2o_controller *, void *); | ||
629 | extern void *i2o_cntxt_list_get(struct i2o_controller *, u32); | ||
630 | extern u32 i2o_cntxt_list_remove(struct i2o_controller *, void *); | ||
631 | extern u32 i2o_cntxt_list_get_ptr(struct i2o_controller *, void *); | ||
632 | |||
633 | static inline u32 i2o_ptr_low(void *ptr) | ||
634 | { | ||
635 | return (u32) (u64) ptr; | ||
636 | }; | ||
637 | |||
638 | static inline u32 i2o_ptr_high(void *ptr) | ||
639 | { | ||
640 | return (u32) ((u64) ptr >> 32); | ||
641 | }; | ||
642 | |||
643 | static inline u32 i2o_dma_low(dma_addr_t dma_addr) | ||
644 | { | ||
645 | return (u32) (u64) dma_addr; | ||
646 | }; | ||
647 | |||
648 | static inline u32 i2o_dma_high(dma_addr_t dma_addr) | ||
649 | { | ||
650 | return (u32) ((u64) dma_addr >> 32); | ||
651 | }; | ||
652 | #else | ||
653 | static inline u32 i2o_cntxt_list_add(struct i2o_controller *c, void *ptr) | ||
654 | { | ||
655 | return (u32) ptr; | ||
656 | }; | ||
657 | |||
658 | static inline void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context) | ||
659 | { | ||
660 | return (void *)context; | ||
661 | }; | ||
662 | |||
663 | static inline u32 i2o_cntxt_list_remove(struct i2o_controller *c, void *ptr) | ||
664 | { | ||
665 | return (u32) ptr; | ||
666 | }; | ||
667 | |||
668 | static inline u32 i2o_cntxt_list_get_ptr(struct i2o_controller *c, void *ptr) | ||
669 | { | ||
670 | return (u32) ptr; | ||
671 | }; | ||
672 | |||
673 | static inline u32 i2o_ptr_low(void *ptr) | ||
674 | { | ||
675 | return (u32) ptr; | ||
676 | }; | ||
677 | |||
678 | static inline u32 i2o_ptr_high(void *ptr) | ||
679 | { | ||
680 | return 0; | ||
681 | }; | ||
682 | |||
683 | static inline u32 i2o_dma_low(dma_addr_t dma_addr) | ||
684 | { | ||
685 | return (u32) dma_addr; | ||
686 | }; | ||
687 | |||
688 | static inline u32 i2o_dma_high(dma_addr_t dma_addr) | ||
689 | { | ||
690 | return 0; | ||
691 | }; | ||
692 | #endif | ||
693 | |||
694 | extern u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size); | ||
695 | extern dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, | ||
696 | size_t size, | ||
697 | enum dma_data_direction direction, | ||
698 | u32 ** sg_ptr); | ||
699 | extern int i2o_dma_map_sg(struct i2o_controller *c, | ||
700 | struct scatterlist *sg, int sg_count, | ||
701 | enum dma_data_direction direction, | ||
702 | u32 ** sg_ptr); | ||
703 | extern int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, size_t len); | ||
704 | extern void i2o_dma_free(struct device *dev, struct i2o_dma *addr); | ||
705 | extern int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, | ||
706 | size_t len); | ||
707 | extern int i2o_pool_alloc(struct i2o_pool *pool, const char *name, | ||
708 | size_t size, int min_nr); | ||
709 | extern void i2o_pool_free(struct i2o_pool *pool); | ||
710 | /* I2O driver (OSM) functions */ | ||
711 | extern int i2o_driver_register(struct i2o_driver *); | ||
712 | extern void i2o_driver_unregister(struct i2o_driver *); | ||
713 | |||
714 | /** | ||
715 | * i2o_driver_notify_controller_add - Send notification of added controller | ||
716 | * @drv: I2O driver | ||
717 | * @c: I2O controller | ||
718 | * | ||
719 | * Send notification of added controller to a single registered driver. | ||
720 | */ | ||
721 | static inline void i2o_driver_notify_controller_add(struct i2o_driver *drv, | ||
722 | struct i2o_controller *c) | ||
723 | { | ||
724 | if (drv->notify_controller_add) | ||
725 | drv->notify_controller_add(c); | ||
726 | }; | ||
727 | |||
728 | /** | ||
729 | * i2o_driver_notify_controller_remove - Send notification of removed controller | ||
730 | * @drv: I2O driver | ||
731 | * @c: I2O controller | ||
732 | * | ||
733 | * Send notification of removed controller to a single registered driver. | ||
734 | */ | ||
735 | static inline void i2o_driver_notify_controller_remove(struct i2o_driver *drv, | ||
736 | struct i2o_controller *c) | ||
737 | { | ||
738 | if (drv->notify_controller_remove) | ||
739 | drv->notify_controller_remove(c); | ||
740 | }; | ||
741 | |||
742 | /** | ||
743 | * i2o_driver_notify_device_add - Send notification of added device | ||
744 | * @drv: I2O driver | ||
745 | * @i2o_dev: the added i2o_device | ||
746 | * | ||
747 | * Send notification of added device to a single registered driver. | ||
748 | */ | ||
749 | static inline void i2o_driver_notify_device_add(struct i2o_driver *drv, | ||
750 | struct i2o_device *i2o_dev) | ||
751 | { | ||
752 | if (drv->notify_device_add) | ||
753 | drv->notify_device_add(i2o_dev); | ||
754 | }; | ||
755 | |||
756 | /** | ||
757 | * i2o_driver_notify_device_remove - Send notification of removed device | ||
758 | * @drv: I2O driver | ||
759 | * @i2o_dev: the added i2o_device | ||
760 | * | ||
761 | * Send notification of removed device to a single registered driver. | ||
762 | */ | ||
763 | static inline void i2o_driver_notify_device_remove(struct i2o_driver *drv, | ||
764 | struct i2o_device *i2o_dev) | ||
765 | { | ||
766 | if (drv->notify_device_remove) | ||
767 | drv->notify_device_remove(i2o_dev); | ||
768 | }; | ||
769 | |||
770 | extern void i2o_driver_notify_controller_add_all(struct i2o_controller *); | ||
771 | extern void i2o_driver_notify_controller_remove_all(struct i2o_controller *); | ||
772 | extern void i2o_driver_notify_device_add_all(struct i2o_device *); | ||
773 | extern void i2o_driver_notify_device_remove_all(struct i2o_device *); | ||
774 | |||
775 | /* I2O device functions */ | ||
776 | extern int i2o_device_claim(struct i2o_device *); | ||
777 | extern int i2o_device_claim_release(struct i2o_device *); | ||
778 | |||
779 | /* Exec OSM functions */ | ||
780 | extern int i2o_exec_lct_get(struct i2o_controller *); | ||
781 | |||
782 | /* device / driver / kobject conversion functions */ | ||
783 | #define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver) | ||
784 | #define to_i2o_device(dev) container_of(dev, struct i2o_device, device) | ||
785 | #define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device) | ||
786 | |||
787 | /** | ||
788 | * i2o_out_to_virt - Turn an I2O message to a virtual address | ||
789 | * @c: controller | ||
790 | * @m: message engine value | ||
791 | * | ||
792 | * Turn a receive message from an I2O controller bus address into | ||
793 | * a Linux virtual address. The shared page frame is a linear block | ||
794 | * so we simply have to shift the offset. This function does not | ||
795 | * work for sender side messages as they are ioremap objects | ||
796 | * provided by the I2O controller. | ||
797 | */ | ||
798 | static inline struct i2o_message *i2o_msg_out_to_virt(struct i2o_controller *c, | ||
799 | u32 m) | ||
800 | { | ||
801 | BUG_ON(m < c->out_queue.phys | ||
802 | || m >= c->out_queue.phys + c->out_queue.len); | ||
803 | |||
804 | return c->out_queue.virt + (m - c->out_queue.phys); | ||
805 | }; | ||
806 | |||
807 | /** | ||
808 | * i2o_msg_in_to_virt - Turn an I2O message to a virtual address | ||
809 | * @c: controller | ||
810 | * @m: message engine value | ||
811 | * | ||
812 | * Turn a send message from an I2O controller bus address into | ||
813 | * a Linux virtual address. The shared page frame is a linear block | ||
814 | * so we simply have to shift the offset. This function does not | ||
815 | * work for receive side messages as they are kmalloc objects | ||
816 | * in a different pool. | ||
817 | */ | ||
818 | static inline struct i2o_message __iomem *i2o_msg_in_to_virt(struct | ||
819 | i2o_controller *c, | ||
820 | u32 m) | ||
821 | { | ||
822 | return c->in_queue.virt + m; | ||
823 | }; | ||
824 | |||
825 | /** | ||
826 | * i2o_msg_get - obtain an I2O message from the IOP | ||
827 | * @c: I2O controller | ||
828 | * | ||
829 | * This function tries to get a message frame. If no message frame is | ||
830 | * available do not wait until one is available (see also i2o_msg_get_wait). | ||
831 | * The returned pointer to the message frame is not in I/O memory, it is | ||
832 | * allocated from a mempool. But because a MFA is allocated from the | ||
833 | * controller too it is guaranteed that i2o_msg_post() will never fail. | ||
834 | * | ||
835 | * On a success a pointer to the message frame is returned. If the message | ||
836 | * queue is empty -EBUSY is returned and if no memory is available -ENOMEM | ||
837 | * is returned. | ||
838 | */ | ||
839 | static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c) | ||
840 | { | ||
841 | struct i2o_msg_mfa *mmsg = mempool_alloc(c->in_msg.mempool, GFP_ATOMIC); | ||
842 | if (!mmsg) | ||
843 | return ERR_PTR(-ENOMEM); | ||
844 | |||
845 | mmsg->mfa = readl(c->in_port); | ||
846 | if (unlikely(mmsg->mfa >= c->in_queue.len)) { | ||
847 | u32 mfa = mmsg->mfa; | ||
848 | |||
849 | mempool_free(mmsg, c->in_msg.mempool); | ||
850 | |||
851 | if (mfa == I2O_QUEUE_EMPTY) | ||
852 | return ERR_PTR(-EBUSY); | ||
853 | return ERR_PTR(-EFAULT); | ||
854 | } | ||
855 | |||
856 | return &mmsg->msg; | ||
857 | }; | ||
858 | |||
859 | /** | ||
860 | * i2o_msg_post - Post I2O message to I2O controller | ||
861 | * @c: I2O controller to which the message should be send | ||
862 | * @msg: message returned by i2o_msg_get() | ||
863 | * | ||
864 | * Post the message to the I2O controller and return immediately. | ||
865 | */ | ||
866 | static inline void i2o_msg_post(struct i2o_controller *c, | ||
867 | struct i2o_message *msg) | ||
868 | { | ||
869 | struct i2o_msg_mfa *mmsg; | ||
870 | |||
871 | mmsg = container_of(msg, struct i2o_msg_mfa, msg); | ||
872 | memcpy_toio(i2o_msg_in_to_virt(c, mmsg->mfa), msg, | ||
873 | (le32_to_cpu(msg->u.head[0]) >> 16) << 2); | ||
874 | writel(mmsg->mfa, c->in_port); | ||
875 | mempool_free(mmsg, c->in_msg.mempool); | ||
876 | }; | ||
877 | |||
878 | /** | ||
879 | * i2o_msg_post_wait - Post and wait a message and wait until return | ||
880 | * @c: controller | ||
881 | * @msg: message to post | ||
882 | * @timeout: time in seconds to wait | ||
883 | * | ||
884 | * This API allows an OSM to post a message and then be told whether or | ||
885 | * not the system received a successful reply. If the message times out | ||
886 | * then the value '-ETIMEDOUT' is returned. | ||
887 | * | ||
888 | * Returns 0 on success or negative error code on failure. | ||
889 | */ | ||
890 | static inline int i2o_msg_post_wait(struct i2o_controller *c, | ||
891 | struct i2o_message *msg, | ||
892 | unsigned long timeout) | ||
893 | { | ||
894 | return i2o_msg_post_wait_mem(c, msg, timeout, NULL); | ||
895 | }; | ||
896 | |||
897 | /** | ||
898 | * i2o_msg_nop_mfa - Returns a fetched MFA back to the controller | ||
899 | * @c: I2O controller from which the MFA was fetched | ||
900 | * @mfa: MFA which should be returned | ||
901 | * | ||
902 | * This function must be used for preserved messages, because i2o_msg_nop() | ||
903 | * also returns the allocated memory back to the msg_pool mempool. | ||
904 | */ | ||
905 | static inline void i2o_msg_nop_mfa(struct i2o_controller *c, u32 mfa) | ||
906 | { | ||
907 | struct i2o_message __iomem *msg; | ||
908 | u32 nop[3] = { | ||
909 | THREE_WORD_MSG_SIZE | SGL_OFFSET_0, | ||
910 | I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | ADAPTER_TID, | ||
911 | 0x00000000 | ||
912 | }; | ||
913 | |||
914 | msg = i2o_msg_in_to_virt(c, mfa); | ||
915 | memcpy_toio(msg, nop, sizeof(nop)); | ||
916 | writel(mfa, c->in_port); | ||
917 | }; | ||
918 | |||
919 | /** | ||
920 | * i2o_msg_nop - Returns a message which is not used | ||
921 | * @c: I2O controller from which the message was created | ||
922 | * @msg: message which should be returned | ||
923 | * | ||
924 | * If you fetch a message via i2o_msg_get, and can't use it, you must | ||
925 | * return the message with this function. Otherwise the MFA is lost as well | ||
926 | * as the allocated memory from the mempool. | ||
927 | */ | ||
928 | static inline void i2o_msg_nop(struct i2o_controller *c, | ||
929 | struct i2o_message *msg) | ||
930 | { | ||
931 | struct i2o_msg_mfa *mmsg; | ||
932 | mmsg = container_of(msg, struct i2o_msg_mfa, msg); | ||
933 | |||
934 | i2o_msg_nop_mfa(c, mmsg->mfa); | ||
935 | mempool_free(mmsg, c->in_msg.mempool); | ||
936 | }; | ||
937 | |||
938 | /** | ||
939 | * i2o_flush_reply - Flush reply from I2O controller | ||
940 | * @c: I2O controller | ||
941 | * @m: the message identifier | ||
942 | * | ||
943 | * The I2O controller must be informed that the reply message is not needed | ||
944 | * anymore. If you forget to flush the reply, the message frame can't be | ||
945 | * used by the controller anymore and is therefore lost. | ||
946 | */ | ||
947 | static inline void i2o_flush_reply(struct i2o_controller *c, u32 m) | ||
948 | { | ||
949 | writel(m, c->out_port); | ||
950 | }; | ||
951 | |||
952 | /* | ||
953 | * Endian handling wrapped into the macro - keeps the core code | ||
954 | * cleaner. | ||
955 | */ | ||
956 | |||
957 | #define i2o_raw_writel(val, mem) __raw_writel(cpu_to_le32(val), mem) | ||
958 | |||
959 | extern int i2o_parm_field_get(struct i2o_device *, int, int, void *, int); | ||
960 | extern int i2o_parm_table_get(struct i2o_device *, int, int, int, void *, int, | ||
961 | void *, int); | ||
962 | |||
963 | /* debugging and troubleshooting/diagnostic helpers. */ | ||
964 | #define osm_printk(level, format, arg...) \ | ||
965 | printk(level "%s: " format, OSM_NAME , ## arg) | ||
966 | |||
967 | #ifdef DEBUG | ||
968 | #define osm_debug(format, arg...) \ | ||
969 | osm_printk(KERN_DEBUG, format , ## arg) | ||
970 | #else | ||
971 | #define osm_debug(format, arg...) \ | ||
972 | do { } while (0) | ||
973 | #endif | ||
974 | |||
975 | #define osm_err(format, arg...) \ | ||
976 | osm_printk(KERN_ERR, format , ## arg) | ||
977 | #define osm_info(format, arg...) \ | ||
978 | osm_printk(KERN_INFO, format , ## arg) | ||
979 | #define osm_warn(format, arg...) \ | ||
980 | osm_printk(KERN_WARNING, format , ## arg) | ||
981 | |||
982 | /* debugging functions */ | ||
983 | extern void i2o_report_status(const char *, const char *, struct i2o_message *); | ||
984 | extern void i2o_dump_message(struct i2o_message *); | ||
985 | extern void i2o_dump_hrt(struct i2o_controller *c); | ||
986 | extern void i2o_debug_state(struct i2o_controller *c); | ||
987 | |||
988 | #endif /* _I2O_H */ | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4f4eea8a6288..b9c7897dc566 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -1017,6 +1017,15 @@ struct ieee80211_mmie { | |||
1017 | u8 mic[8]; | 1017 | u8 mic[8]; |
1018 | } __packed; | 1018 | } __packed; |
1019 | 1019 | ||
1020 | /* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ | ||
1021 | struct ieee80211_mmie_16 { | ||
1022 | u8 element_id; | ||
1023 | u8 length; | ||
1024 | __le16 key_id; | ||
1025 | u8 sequence_number[6]; | ||
1026 | u8 mic[16]; | ||
1027 | } __packed; | ||
1028 | |||
1020 | struct ieee80211_vendor_ie { | 1029 | struct ieee80211_vendor_ie { |
1021 | u8 element_id; | 1030 | u8 element_id; |
1022 | u8 len; | 1031 | u8 len; |
@@ -1994,9 +2003,15 @@ enum ieee80211_key_len { | |||
1994 | WLAN_KEY_LEN_WEP40 = 5, | 2003 | WLAN_KEY_LEN_WEP40 = 5, |
1995 | WLAN_KEY_LEN_WEP104 = 13, | 2004 | WLAN_KEY_LEN_WEP104 = 13, |
1996 | WLAN_KEY_LEN_CCMP = 16, | 2005 | WLAN_KEY_LEN_CCMP = 16, |
2006 | WLAN_KEY_LEN_CCMP_256 = 32, | ||
1997 | WLAN_KEY_LEN_TKIP = 32, | 2007 | WLAN_KEY_LEN_TKIP = 32, |
1998 | WLAN_KEY_LEN_AES_CMAC = 16, | 2008 | WLAN_KEY_LEN_AES_CMAC = 16, |
1999 | WLAN_KEY_LEN_SMS4 = 32, | 2009 | WLAN_KEY_LEN_SMS4 = 32, |
2010 | WLAN_KEY_LEN_GCMP = 16, | ||
2011 | WLAN_KEY_LEN_GCMP_256 = 32, | ||
2012 | WLAN_KEY_LEN_BIP_CMAC_256 = 32, | ||
2013 | WLAN_KEY_LEN_BIP_GMAC_128 = 16, | ||
2014 | WLAN_KEY_LEN_BIP_GMAC_256 = 32, | ||
2000 | }; | 2015 | }; |
2001 | 2016 | ||
2002 | #define IEEE80211_WEP_IV_LEN 4 | 2017 | #define IEEE80211_WEP_IV_LEN 4 |
@@ -2004,9 +2019,16 @@ enum ieee80211_key_len { | |||
2004 | #define IEEE80211_CCMP_HDR_LEN 8 | 2019 | #define IEEE80211_CCMP_HDR_LEN 8 |
2005 | #define IEEE80211_CCMP_MIC_LEN 8 | 2020 | #define IEEE80211_CCMP_MIC_LEN 8 |
2006 | #define IEEE80211_CCMP_PN_LEN 6 | 2021 | #define IEEE80211_CCMP_PN_LEN 6 |
2022 | #define IEEE80211_CCMP_256_HDR_LEN 8 | ||
2023 | #define IEEE80211_CCMP_256_MIC_LEN 16 | ||
2024 | #define IEEE80211_CCMP_256_PN_LEN 6 | ||
2007 | #define IEEE80211_TKIP_IV_LEN 8 | 2025 | #define IEEE80211_TKIP_IV_LEN 8 |
2008 | #define IEEE80211_TKIP_ICV_LEN 4 | 2026 | #define IEEE80211_TKIP_ICV_LEN 4 |
2009 | #define IEEE80211_CMAC_PN_LEN 6 | 2027 | #define IEEE80211_CMAC_PN_LEN 6 |
2028 | #define IEEE80211_GMAC_PN_LEN 6 | ||
2029 | #define IEEE80211_GCMP_HDR_LEN 8 | ||
2030 | #define IEEE80211_GCMP_MIC_LEN 16 | ||
2031 | #define IEEE80211_GCMP_PN_LEN 6 | ||
2010 | 2032 | ||
2011 | /* Public action codes */ | 2033 | /* Public action codes */ |
2012 | enum ieee80211_pub_actioncode { | 2034 | enum ieee80211_pub_actioncode { |
@@ -2230,6 +2252,11 @@ enum ieee80211_sa_query_action { | |||
2230 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 2252 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
2231 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 2253 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
2232 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 | 2254 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 |
2255 | #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09 | ||
2256 | #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A | ||
2257 | #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B | ||
2258 | #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C | ||
2259 | #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D | ||
2233 | 2260 | ||
2234 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 | 2261 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 |
2235 | 2262 | ||
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 0a8ce762a47f..a57bca2ea97e 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -50,24 +50,6 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use | |||
50 | typedef int br_should_route_hook_t(struct sk_buff *skb); | 50 | typedef int br_should_route_hook_t(struct sk_buff *skb); |
51 | extern br_should_route_hook_t __rcu *br_should_route_hook; | 51 | extern br_should_route_hook_t __rcu *br_should_route_hook; |
52 | 52 | ||
53 | #if IS_ENABLED(CONFIG_BRIDGE) | ||
54 | int br_fdb_external_learn_add(struct net_device *dev, | ||
55 | const unsigned char *addr, u16 vid); | ||
56 | int br_fdb_external_learn_del(struct net_device *dev, | ||
57 | const unsigned char *addr, u16 vid); | ||
58 | #else | ||
59 | static inline int br_fdb_external_learn_add(struct net_device *dev, | ||
60 | const unsigned char *addr, u16 vid) | ||
61 | { | ||
62 | return 0; | ||
63 | } | ||
64 | static inline int br_fdb_external_learn_del(struct net_device *dev, | ||
65 | const unsigned char *addr, u16 vid) | ||
66 | { | ||
67 | return 0; | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) | 53 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) |
72 | int br_multicast_list_adjacent(struct net_device *dev, | 54 | int br_multicast_list_adjacent(struct net_device *dev, |
73 | struct list_head *br_ip_list); | 55 | struct list_head *br_ip_list); |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 515a35e2a48a..b11b28a30b9e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -78,9 +78,9 @@ static inline bool is_vlan_dev(struct net_device *dev) | |||
78 | return dev->priv_flags & IFF_802_1Q_VLAN; | 78 | return dev->priv_flags & IFF_802_1Q_VLAN; |
79 | } | 79 | } |
80 | 80 | ||
81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 81 | #define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | 83 | #define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats | 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats |
@@ -376,7 +376,7 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb, | |||
376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | 376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) |
377 | { | 377 | { |
378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, | 378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, |
379 | vlan_tx_tag_get(skb)); | 379 | skb_vlan_tag_get(skb)); |
380 | if (likely(skb)) | 380 | if (likely(skb)) |
381 | skb->vlan_tci = 0; | 381 | skb->vlan_tci = 0; |
382 | return skb; | 382 | return skb; |
@@ -393,7 +393,7 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | |||
393 | */ | 393 | */ |
394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) | 394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) |
395 | { | 395 | { |
396 | if (vlan_tx_tag_present(skb)) | 396 | if (skb_vlan_tag_present(skb)) |
397 | skb = __vlan_hwaccel_push_inside(skb); | 397 | skb = __vlan_hwaccel_push_inside(skb); |
398 | return skb; | 398 | return skb; |
399 | } | 399 | } |
@@ -442,8 +442,8 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | 442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, |
443 | u16 *vlan_tci) | 443 | u16 *vlan_tci) |
444 | { | 444 | { |
445 | if (vlan_tx_tag_present(skb)) { | 445 | if (skb_vlan_tag_present(skb)) { |
446 | *vlan_tci = vlan_tx_tag_get(skb); | 446 | *vlan_tci = skb_vlan_tag_get(skb); |
447 | return 0; | 447 | return 0; |
448 | } else { | 448 | } else { |
449 | *vlan_tci = 0; | 449 | *vlan_tci = 0; |
@@ -472,27 +472,59 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
472 | /** | 472 | /** |
473 | * vlan_get_protocol - get protocol EtherType. | 473 | * vlan_get_protocol - get protocol EtherType. |
474 | * @skb: skbuff to query | 474 | * @skb: skbuff to query |
475 | * @type: first vlan protocol | ||
476 | * @depth: buffer to store length of eth and vlan tags in bytes | ||
475 | * | 477 | * |
476 | * Returns the EtherType of the packet, regardless of whether it is | 478 | * Returns the EtherType of the packet, regardless of whether it is |
477 | * vlan encapsulated (normal or hardware accelerated) or not. | 479 | * vlan encapsulated (normal or hardware accelerated) or not. |
478 | */ | 480 | */ |
479 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | 481 | static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, |
482 | int *depth) | ||
480 | { | 483 | { |
481 | __be16 protocol = 0; | 484 | unsigned int vlan_depth = skb->mac_len; |
482 | 485 | ||
483 | if (vlan_tx_tag_present(skb) || | 486 | /* if type is 802.1Q/AD then the header should already be |
484 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | 487 | * present at mac_len - VLAN_HLEN (if mac_len > 0), or at |
485 | protocol = skb->protocol; | 488 | * ETH_HLEN otherwise |
486 | else { | 489 | */ |
487 | __be16 proto, *protop; | 490 | if (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { |
488 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | 491 | if (vlan_depth) { |
489 | h_vlan_encapsulated_proto), | 492 | if (WARN_ON(vlan_depth < VLAN_HLEN)) |
490 | sizeof(proto), &proto); | 493 | return 0; |
491 | if (likely(protop)) | 494 | vlan_depth -= VLAN_HLEN; |
492 | protocol = *protop; | 495 | } else { |
496 | vlan_depth = ETH_HLEN; | ||
497 | } | ||
498 | do { | ||
499 | struct vlan_hdr *vh; | ||
500 | |||
501 | if (unlikely(!pskb_may_pull(skb, | ||
502 | vlan_depth + VLAN_HLEN))) | ||
503 | return 0; | ||
504 | |||
505 | vh = (struct vlan_hdr *)(skb->data + vlan_depth); | ||
506 | type = vh->h_vlan_encapsulated_proto; | ||
507 | vlan_depth += VLAN_HLEN; | ||
508 | } while (type == htons(ETH_P_8021Q) || | ||
509 | type == htons(ETH_P_8021AD)); | ||
493 | } | 510 | } |
494 | 511 | ||
495 | return protocol; | 512 | if (depth) |
513 | *depth = vlan_depth; | ||
514 | |||
515 | return type; | ||
516 | } | ||
517 | |||
518 | /** | ||
519 | * vlan_get_protocol - get protocol EtherType. | ||
520 | * @skb: skbuff to query | ||
521 | * | ||
522 | * Returns the EtherType of the packet, regardless of whether it is | ||
523 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
524 | */ | ||
525 | static inline __be16 vlan_get_protocol(struct sk_buff *skb) | ||
526 | { | ||
527 | return __vlan_get_protocol(skb, skb->protocol, NULL); | ||
496 | } | 528 | } |
497 | 529 | ||
498 | static inline void vlan_set_encap_proto(struct sk_buff *skb, | 530 | static inline void vlan_set_encap_proto(struct sk_buff *skb, |
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 519392763393..b65850a41127 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
@@ -25,9 +25,7 @@ struct iio_buffer; | |||
25 | * available. | 25 | * available. |
26 | * @request_update: if a parameter change has been marked, update underlying | 26 | * @request_update: if a parameter change has been marked, update underlying |
27 | * storage. | 27 | * storage. |
28 | * @get_bytes_per_datum:get current bytes per datum | ||
29 | * @set_bytes_per_datum:set number of bytes per datum | 28 | * @set_bytes_per_datum:set number of bytes per datum |
30 | * @get_length: get number of datums in buffer | ||
31 | * @set_length: set number of datums in buffer | 29 | * @set_length: set number of datums in buffer |
32 | * @release: called when the last reference to the buffer is dropped, | 30 | * @release: called when the last reference to the buffer is dropped, |
33 | * should free all resources allocated by the buffer. | 31 | * should free all resources allocated by the buffer. |
@@ -49,9 +47,7 @@ struct iio_buffer_access_funcs { | |||
49 | 47 | ||
50 | int (*request_update)(struct iio_buffer *buffer); | 48 | int (*request_update)(struct iio_buffer *buffer); |
51 | 49 | ||
52 | int (*get_bytes_per_datum)(struct iio_buffer *buffer); | ||
53 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); | 50 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); |
54 | int (*get_length)(struct iio_buffer *buffer); | ||
55 | int (*set_length)(struct iio_buffer *buffer, int length); | 51 | int (*set_length)(struct iio_buffer *buffer, int length); |
56 | 52 | ||
57 | void (*release)(struct iio_buffer *buffer); | 53 | void (*release)(struct iio_buffer *buffer); |
@@ -85,10 +81,11 @@ struct iio_buffer { | |||
85 | bool scan_timestamp; | 81 | bool scan_timestamp; |
86 | const struct iio_buffer_access_funcs *access; | 82 | const struct iio_buffer_access_funcs *access; |
87 | struct list_head scan_el_dev_attr_list; | 83 | struct list_head scan_el_dev_attr_list; |
84 | struct attribute_group buffer_group; | ||
88 | struct attribute_group scan_el_group; | 85 | struct attribute_group scan_el_group; |
89 | wait_queue_head_t pollq; | 86 | wait_queue_head_t pollq; |
90 | bool stufftoread; | 87 | bool stufftoread; |
91 | const struct attribute_group *attrs; | 88 | const struct attribute **attrs; |
92 | struct list_head demux_list; | 89 | struct list_head demux_list; |
93 | void *demux_bounce; | 90 | void *demux_bounce; |
94 | struct list_head buffer_list; | 91 | struct list_head buffer_list; |
@@ -117,15 +114,6 @@ int iio_scan_mask_query(struct iio_dev *indio_dev, | |||
117 | struct iio_buffer *buffer, int bit); | 114 | struct iio_buffer *buffer, int bit); |
118 | 115 | ||
119 | /** | 116 | /** |
120 | * iio_scan_mask_set() - set particular bit in the scan mask | ||
121 | * @indio_dev IIO device structure | ||
122 | * @buffer: the buffer whose scan mask we are interested in | ||
123 | * @bit: the bit to be set. | ||
124 | **/ | ||
125 | int iio_scan_mask_set(struct iio_dev *indio_dev, | ||
126 | struct iio_buffer *buffer, int bit); | ||
127 | |||
128 | /** | ||
129 | * iio_push_to_buffers() - push to a registered buffer. | 117 | * iio_push_to_buffers() - push to a registered buffer. |
130 | * @indio_dev: iio_dev structure for device. | 118 | * @indio_dev: iio_dev structure for device. |
131 | * @data: Full scan. | 119 | * @data: Full scan. |
@@ -159,56 +147,6 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, | |||
159 | 147 | ||
160 | int iio_update_demux(struct iio_dev *indio_dev); | 148 | int iio_update_demux(struct iio_dev *indio_dev); |
161 | 149 | ||
162 | /** | ||
163 | * iio_buffer_register() - register the buffer with IIO core | ||
164 | * @indio_dev: device with the buffer to be registered | ||
165 | * @channels: the channel descriptions used to construct buffer | ||
166 | * @num_channels: the number of channels | ||
167 | **/ | ||
168 | int iio_buffer_register(struct iio_dev *indio_dev, | ||
169 | const struct iio_chan_spec *channels, | ||
170 | int num_channels); | ||
171 | |||
172 | /** | ||
173 | * iio_buffer_unregister() - unregister the buffer from IIO core | ||
174 | * @indio_dev: the device with the buffer to be unregistered | ||
175 | **/ | ||
176 | void iio_buffer_unregister(struct iio_dev *indio_dev); | ||
177 | |||
178 | /** | ||
179 | * iio_buffer_read_length() - attr func to get number of datums in the buffer | ||
180 | **/ | ||
181 | ssize_t iio_buffer_read_length(struct device *dev, | ||
182 | struct device_attribute *attr, | ||
183 | char *buf); | ||
184 | /** | ||
185 | * iio_buffer_write_length() - attr func to set number of datums in the buffer | ||
186 | **/ | ||
187 | ssize_t iio_buffer_write_length(struct device *dev, | ||
188 | struct device_attribute *attr, | ||
189 | const char *buf, | ||
190 | size_t len); | ||
191 | /** | ||
192 | * iio_buffer_store_enable() - attr to turn the buffer on | ||
193 | **/ | ||
194 | ssize_t iio_buffer_store_enable(struct device *dev, | ||
195 | struct device_attribute *attr, | ||
196 | const char *buf, | ||
197 | size_t len); | ||
198 | /** | ||
199 | * iio_buffer_show_enable() - attr to see if the buffer is on | ||
200 | **/ | ||
201 | ssize_t iio_buffer_show_enable(struct device *dev, | ||
202 | struct device_attribute *attr, | ||
203 | char *buf); | ||
204 | #define IIO_BUFFER_LENGTH_ATTR DEVICE_ATTR(length, S_IRUGO | S_IWUSR, \ | ||
205 | iio_buffer_read_length, \ | ||
206 | iio_buffer_write_length) | ||
207 | |||
208 | #define IIO_BUFFER_ENABLE_ATTR DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, \ | ||
209 | iio_buffer_show_enable, \ | ||
210 | iio_buffer_store_enable) | ||
211 | |||
212 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, | 150 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, |
213 | const unsigned long *mask); | 151 | const unsigned long *mask); |
214 | 152 | ||
@@ -232,16 +170,6 @@ static inline void iio_device_attach_buffer(struct iio_dev *indio_dev, | |||
232 | 170 | ||
233 | #else /* CONFIG_IIO_BUFFER */ | 171 | #else /* CONFIG_IIO_BUFFER */ |
234 | 172 | ||
235 | static inline int iio_buffer_register(struct iio_dev *indio_dev, | ||
236 | const struct iio_chan_spec *channels, | ||
237 | int num_channels) | ||
238 | { | ||
239 | return 0; | ||
240 | } | ||
241 | |||
242 | static inline void iio_buffer_unregister(struct iio_dev *indio_dev) | ||
243 | {} | ||
244 | |||
245 | static inline void iio_buffer_get(struct iio_buffer *buffer) {} | 173 | static inline void iio_buffer_get(struct iio_buffer *buffer) {} |
246 | static inline void iio_buffer_put(struct iio_buffer *buffer) {} | 174 | static inline void iio_buffer_put(struct iio_buffer *buffer) {} |
247 | 175 | ||
diff --git a/include/linux/iio/common/ssp_sensors.h b/include/linux/iio/common/ssp_sensors.h new file mode 100644 index 000000000000..f4d1b0edb432 --- /dev/null +++ b/include/linux/iio/common/ssp_sensors.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014, Samsung Electronics Co. Ltd. All Rights Reserved. | ||
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 | */ | ||
15 | #ifndef _SSP_SENSORS_H_ | ||
16 | #define _SSP_SENSORS_H_ | ||
17 | |||
18 | #include <linux/iio/iio.h> | ||
19 | |||
20 | #define SSP_TIME_SIZE 4 | ||
21 | #define SSP_ACCELEROMETER_SIZE 6 | ||
22 | #define SSP_GYROSCOPE_SIZE 6 | ||
23 | #define SSP_BIO_HRM_RAW_SIZE 8 | ||
24 | #define SSP_BIO_HRM_RAW_FAC_SIZE 36 | ||
25 | #define SSP_BIO_HRM_LIB_SIZE 8 | ||
26 | |||
27 | /** | ||
28 | * enum ssp_sensor_type - SSP sensor type | ||
29 | */ | ||
30 | enum ssp_sensor_type { | ||
31 | SSP_ACCELEROMETER_SENSOR = 0, | ||
32 | SSP_GYROSCOPE_SENSOR, | ||
33 | SSP_GEOMAGNETIC_UNCALIB_SENSOR, | ||
34 | SSP_GEOMAGNETIC_RAW, | ||
35 | SSP_GEOMAGNETIC_SENSOR, | ||
36 | SSP_PRESSURE_SENSOR, | ||
37 | SSP_GESTURE_SENSOR, | ||
38 | SSP_PROXIMITY_SENSOR, | ||
39 | SSP_TEMPERATURE_HUMIDITY_SENSOR, | ||
40 | SSP_LIGHT_SENSOR, | ||
41 | SSP_PROXIMITY_RAW, | ||
42 | SSP_ORIENTATION_SENSOR, | ||
43 | SSP_STEP_DETECTOR, | ||
44 | SSP_SIG_MOTION_SENSOR, | ||
45 | SSP_GYRO_UNCALIB_SENSOR, | ||
46 | SSP_GAME_ROTATION_VECTOR, | ||
47 | SSP_ROTATION_VECTOR, | ||
48 | SSP_STEP_COUNTER, | ||
49 | SSP_BIO_HRM_RAW, | ||
50 | SSP_BIO_HRM_RAW_FAC, | ||
51 | SSP_BIO_HRM_LIB, | ||
52 | SSP_SENSOR_MAX, | ||
53 | }; | ||
54 | |||
55 | struct ssp_data; | ||
56 | |||
57 | /** | ||
58 | * struct ssp_sensor_data - Sensor object | ||
59 | * @process_data: Callback to feed sensor data. | ||
60 | * @type: Used sensor type. | ||
61 | * @buffer: Received data buffer. | ||
62 | */ | ||
63 | struct ssp_sensor_data { | ||
64 | int (*process_data)(struct iio_dev *indio_dev, void *buf, | ||
65 | int64_t timestamp); | ||
66 | enum ssp_sensor_type type; | ||
67 | u8 *buffer; | ||
68 | }; | ||
69 | |||
70 | void ssp_register_consumer(struct iio_dev *indio_dev, | ||
71 | enum ssp_sensor_type type); | ||
72 | |||
73 | int ssp_enable_sensor(struct ssp_data *data, enum ssp_sensor_type type, | ||
74 | u32 delay); | ||
75 | |||
76 | int ssp_disable_sensor(struct ssp_data *data, enum ssp_sensor_type type); | ||
77 | |||
78 | u32 ssp_get_sensor_delay(struct ssp_data *data, enum ssp_sensor_type); | ||
79 | |||
80 | int ssp_change_delay(struct ssp_data *data, enum ssp_sensor_type type, | ||
81 | u32 delay); | ||
82 | #endif /* _SSP_SENSORS_H_ */ | ||
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 651f9a0e2765..26fb8f6342bb 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -151,6 +151,16 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val); | |||
151 | int iio_read_channel_processed(struct iio_channel *chan, int *val); | 151 | int iio_read_channel_processed(struct iio_channel *chan, int *val); |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * iio_write_channel_raw() - write to a given channel | ||
155 | * @chan: The channel being queried. | ||
156 | * @val: Value being written. | ||
157 | * | ||
158 | * Note raw writes to iio channels are in dac counts and hence | ||
159 | * scale will need to be applied if standard units required. | ||
160 | */ | ||
161 | int iio_write_channel_raw(struct iio_channel *chan, int val); | ||
162 | |||
163 | /** | ||
154 | * iio_get_channel_type() - get the type of a channel | 164 | * iio_get_channel_type() - get the type of a channel |
155 | * @channel: The channel being queried. | 165 | * @channel: The channel being queried. |
156 | * @type: The type of the channel. | 166 | * @type: The type of the channel. |
@@ -191,7 +201,7 @@ int iio_read_channel_scale(struct iio_channel *chan, int *val, | |||
191 | * The scale factor allows to increase the precession of the returned value. For | 201 | * The scale factor allows to increase the precession of the returned value. For |
192 | * a scale factor of 1 the function will return the result in the normal IIO | 202 | * a scale factor of 1 the function will return the result in the normal IIO |
193 | * unit for the channel type. E.g. millivolt for voltage channels, if you want | 203 | * unit for the channel type. E.g. millivolt for voltage channels, if you want |
194 | * nanovolts instead pass 1000 as the scale factor. | 204 | * nanovolts instead pass 1000000 as the scale factor. |
195 | */ | 205 | */ |
196 | int iio_convert_raw_to_processed(struct iio_channel *chan, int raw, | 206 | int iio_convert_raw_to_processed(struct iio_channel *chan, int raw, |
197 | int *processed, unsigned int scale); | 207 | int *processed, unsigned int scale); |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3642ce7ef512..80d855061064 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -38,6 +38,11 @@ enum iio_chan_info_enum { | |||
38 | IIO_CHAN_INFO_HARDWAREGAIN, | 38 | IIO_CHAN_INFO_HARDWAREGAIN, |
39 | IIO_CHAN_INFO_HYSTERESIS, | 39 | IIO_CHAN_INFO_HYSTERESIS, |
40 | IIO_CHAN_INFO_INT_TIME, | 40 | IIO_CHAN_INFO_INT_TIME, |
41 | IIO_CHAN_INFO_ENABLE, | ||
42 | IIO_CHAN_INFO_CALIBHEIGHT, | ||
43 | IIO_CHAN_INFO_CALIBWEIGHT, | ||
44 | IIO_CHAN_INFO_DEBOUNCE_COUNT, | ||
45 | IIO_CHAN_INFO_DEBOUNCE_TIME, | ||
41 | }; | 46 | }; |
42 | 47 | ||
43 | enum iio_shared_by { | 48 | enum iio_shared_by { |
@@ -284,10 +289,11 @@ static inline s64 iio_get_time_ns(void) | |||
284 | /* Device operating modes */ | 289 | /* Device operating modes */ |
285 | #define INDIO_DIRECT_MODE 0x01 | 290 | #define INDIO_DIRECT_MODE 0x01 |
286 | #define INDIO_BUFFER_TRIGGERED 0x02 | 291 | #define INDIO_BUFFER_TRIGGERED 0x02 |
292 | #define INDIO_BUFFER_SOFTWARE 0x04 | ||
287 | #define INDIO_BUFFER_HARDWARE 0x08 | 293 | #define INDIO_BUFFER_HARDWARE 0x08 |
288 | 294 | ||
289 | #define INDIO_ALL_BUFFER_MODES \ | 295 | #define INDIO_ALL_BUFFER_MODES \ |
290 | (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE) | 296 | (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE) |
291 | 297 | ||
292 | #define INDIO_MAX_RAW_ELEMENTS 4 | 298 | #define INDIO_MAX_RAW_ELEMENTS 4 |
293 | 299 | ||
@@ -591,7 +597,8 @@ void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | |||
591 | static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) | 597 | static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) |
592 | { | 598 | { |
593 | return indio_dev->currentmode | 599 | return indio_dev->currentmode |
594 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE); | 600 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | |
601 | INDIO_BUFFER_SOFTWARE); | ||
595 | } | 602 | } |
596 | 603 | ||
597 | /** | 604 | /** |
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h index 25eeac762e84..1683bc710d14 100644 --- a/include/linux/iio/kfifo_buf.h +++ b/include/linux/iio/kfifo_buf.h | |||
@@ -5,7 +5,10 @@ | |||
5 | #include <linux/iio/iio.h> | 5 | #include <linux/iio/iio.h> |
6 | #include <linux/iio/buffer.h> | 6 | #include <linux/iio/buffer.h> |
7 | 7 | ||
8 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); | 8 | struct iio_buffer *iio_kfifo_allocate(void); |
9 | void iio_kfifo_free(struct iio_buffer *r); | 9 | void iio_kfifo_free(struct iio_buffer *r); |
10 | 10 | ||
11 | struct iio_buffer *devm_iio_kfifo_allocate(struct device *dev); | ||
12 | void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r); | ||
13 | |||
11 | #endif | 14 | #endif |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4a2af8adf874..580ed5bdb3fa 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -30,6 +30,11 @@ enum iio_chan_type { | |||
30 | IIO_CCT, | 30 | IIO_CCT, |
31 | IIO_PRESSURE, | 31 | IIO_PRESSURE, |
32 | IIO_HUMIDITYRELATIVE, | 32 | IIO_HUMIDITYRELATIVE, |
33 | IIO_ACTIVITY, | ||
34 | IIO_STEPS, | ||
35 | IIO_ENERGY, | ||
36 | IIO_DISTANCE, | ||
37 | IIO_VELOCITY, | ||
33 | }; | 38 | }; |
34 | 39 | ||
35 | enum iio_modifier { | 40 | enum iio_modifier { |
@@ -59,7 +64,12 @@ enum iio_modifier { | |||
59 | IIO_MOD_NORTH_MAGN, | 64 | IIO_MOD_NORTH_MAGN, |
60 | IIO_MOD_NORTH_TRUE, | 65 | IIO_MOD_NORTH_TRUE, |
61 | IIO_MOD_NORTH_MAGN_TILT_COMP, | 66 | IIO_MOD_NORTH_MAGN_TILT_COMP, |
62 | IIO_MOD_NORTH_TRUE_TILT_COMP | 67 | IIO_MOD_NORTH_TRUE_TILT_COMP, |
68 | IIO_MOD_RUNNING, | ||
69 | IIO_MOD_JOGGING, | ||
70 | IIO_MOD_WALKING, | ||
71 | IIO_MOD_STILL, | ||
72 | IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z, | ||
63 | }; | 73 | }; |
64 | 74 | ||
65 | enum iio_event_type { | 75 | enum iio_event_type { |
@@ -68,6 +78,7 @@ enum iio_event_type { | |||
68 | IIO_EV_TYPE_ROC, | 78 | IIO_EV_TYPE_ROC, |
69 | IIO_EV_TYPE_THRESH_ADAPTIVE, | 79 | IIO_EV_TYPE_THRESH_ADAPTIVE, |
70 | IIO_EV_TYPE_MAG_ADAPTIVE, | 80 | IIO_EV_TYPE_MAG_ADAPTIVE, |
81 | IIO_EV_TYPE_CHANGE, | ||
71 | }; | 82 | }; |
72 | 83 | ||
73 | enum iio_event_info { | 84 | enum iio_event_info { |
@@ -81,6 +92,7 @@ enum iio_event_direction { | |||
81 | IIO_EV_DIR_EITHER, | 92 | IIO_EV_DIR_EITHER, |
82 | IIO_EV_DIR_RISING, | 93 | IIO_EV_DIR_RISING, |
83 | IIO_EV_DIR_FALLING, | 94 | IIO_EV_DIR_FALLING, |
95 | IIO_EV_DIR_NONE, | ||
84 | }; | 96 | }; |
85 | 97 | ||
86 | #define IIO_VAL_INT 1 | 98 | #define IIO_VAL_INT 1 |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 3037fc085e8e..696d22312b31 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -175,6 +175,13 @@ extern struct task_group root_task_group; | |||
175 | # define INIT_NUMA_BALANCING(tsk) | 175 | # define INIT_NUMA_BALANCING(tsk) |
176 | #endif | 176 | #endif |
177 | 177 | ||
178 | #ifdef CONFIG_KASAN | ||
179 | # define INIT_KASAN(tsk) \ | ||
180 | .kasan_depth = 1, | ||
181 | #else | ||
182 | # define INIT_KASAN(tsk) | ||
183 | #endif | ||
184 | |||
178 | /* | 185 | /* |
179 | * INIT_TASK is used to set up the first task table, touch at | 186 | * INIT_TASK is used to set up the first task table, touch at |
180 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 187 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -193,6 +200,9 @@ extern struct task_group root_task_group; | |||
193 | .nr_cpus_allowed= NR_CPUS, \ | 200 | .nr_cpus_allowed= NR_CPUS, \ |
194 | .mm = NULL, \ | 201 | .mm = NULL, \ |
195 | .active_mm = &init_mm, \ | 202 | .active_mm = &init_mm, \ |
203 | .restart_block = { \ | ||
204 | .fn = do_no_restart_syscall, \ | ||
205 | }, \ | ||
196 | .se = { \ | 206 | .se = { \ |
197 | .group_node = LIST_HEAD_INIT(tsk.se.group_node), \ | 207 | .group_node = LIST_HEAD_INIT(tsk.se.group_node), \ |
198 | }, \ | 208 | }, \ |
@@ -247,6 +257,7 @@ extern struct task_group root_task_group; | |||
247 | INIT_RT_MUTEXES(tsk) \ | 257 | INIT_RT_MUTEXES(tsk) \ |
248 | INIT_VTIME(tsk) \ | 258 | INIT_VTIME(tsk) \ |
249 | INIT_NUMA_BALANCING(tsk) \ | 259 | INIT_NUMA_BALANCING(tsk) \ |
260 | INIT_KASAN(tsk) \ | ||
250 | } | 261 | } |
251 | 262 | ||
252 | 263 | ||
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index f583ff639776..d7188de4db96 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
@@ -119,7 +119,8 @@ struct input_mt_pos { | |||
119 | }; | 119 | }; |
120 | 120 | ||
121 | int input_mt_assign_slots(struct input_dev *dev, int *slots, | 121 | int input_mt_assign_slots(struct input_dev *dev, int *slots, |
122 | const struct input_mt_pos *pos, int num_pos); | 122 | const struct input_mt_pos *pos, int num_pos, |
123 | int dmax); | ||
123 | 124 | ||
124 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); | 125 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); |
125 | 126 | ||
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h new file mode 100644 index 000000000000..1c30014ed176 --- /dev/null +++ b/include/linux/iopoll.h | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. | ||
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 version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef _LINUX_IOPOLL_H | ||
16 | #define _LINUX_IOPOLL_H | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/hrtimer.h> | ||
21 | #include <linux/delay.h> | ||
22 | #include <linux/errno.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | /** | ||
26 | * readx_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs | ||
27 | * @op: accessor function (takes @addr as its only argument) | ||
28 | * @addr: Address to poll | ||
29 | * @val: Variable to read the value into | ||
30 | * @cond: Break condition (usually involving @val) | ||
31 | * @sleep_us: Maximum time to sleep between reads in us (0 | ||
32 | * tight-loops). Should be less than ~20ms since usleep_range | ||
33 | * is used (see Documentation/timers/timers-howto.txt). | ||
34 | * @timeout_us: Timeout in us, 0 means never timeout | ||
35 | * | ||
36 | * Returns 0 on success and -ETIMEDOUT upon a timeout. In either | ||
37 | * case, the last read value at @addr is stored in @val. Must not | ||
38 | * be called from atomic context if sleep_us or timeout_us are used. | ||
39 | * | ||
40 | * When available, you'll probably want to use one of the specialized | ||
41 | * macros defined below rather than this macro directly. | ||
42 | */ | ||
43 | #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ | ||
44 | ({ \ | ||
45 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ | ||
46 | might_sleep_if(sleep_us); \ | ||
47 | for (;;) { \ | ||
48 | (val) = op(addr); \ | ||
49 | if (cond) \ | ||
50 | break; \ | ||
51 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ | ||
52 | (val) = op(addr); \ | ||
53 | break; \ | ||
54 | } \ | ||
55 | if (sleep_us) \ | ||
56 | usleep_range((sleep_us >> 2) + 1, sleep_us); \ | ||
57 | } \ | ||
58 | (cond) ? 0 : -ETIMEDOUT; \ | ||
59 | }) | ||
60 | |||
61 | /** | ||
62 | * readx_poll_timeout_atomic - Periodically poll an address until a condition is met or a timeout occurs | ||
63 | * @op: accessor function (takes @addr as its only argument) | ||
64 | * @addr: Address to poll | ||
65 | * @val: Variable to read the value into | ||
66 | * @cond: Break condition (usually involving @val) | ||
67 | * @delay_us: Time to udelay between reads in us (0 tight-loops). Should | ||
68 | * be less than ~10us since udelay is used (see | ||
69 | * Documentation/timers/timers-howto.txt). | ||
70 | * @timeout_us: Timeout in us, 0 means never timeout | ||
71 | * | ||
72 | * Returns 0 on success and -ETIMEDOUT upon a timeout. In either | ||
73 | * case, the last read value at @addr is stored in @val. | ||
74 | * | ||
75 | * When available, you'll probably want to use one of the specialized | ||
76 | * macros defined below rather than this macro directly. | ||
77 | */ | ||
78 | #define readx_poll_timeout_atomic(op, addr, val, cond, delay_us, timeout_us) \ | ||
79 | ({ \ | ||
80 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ | ||
81 | for (;;) { \ | ||
82 | (val) = op(addr); \ | ||
83 | if (cond) \ | ||
84 | break; \ | ||
85 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ | ||
86 | (val) = op(addr); \ | ||
87 | break; \ | ||
88 | } \ | ||
89 | if (delay_us) \ | ||
90 | udelay(delay_us); \ | ||
91 | } \ | ||
92 | (cond) ? 0 : -ETIMEDOUT; \ | ||
93 | }) | ||
94 | |||
95 | |||
96 | #define readb_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
97 | readx_poll_timeout(readb, addr, val, cond, delay_us, timeout_us) | ||
98 | |||
99 | #define readb_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
100 | readx_poll_timeout_atomic(readb, addr, val, cond, delay_us, timeout_us) | ||
101 | |||
102 | #define readw_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
103 | readx_poll_timeout(readw, addr, val, cond, delay_us, timeout_us) | ||
104 | |||
105 | #define readw_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
106 | readx_poll_timeout_atomic(readw, addr, val, cond, delay_us, timeout_us) | ||
107 | |||
108 | #define readl_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
109 | readx_poll_timeout(readl, addr, val, cond, delay_us, timeout_us) | ||
110 | |||
111 | #define readl_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
112 | readx_poll_timeout_atomic(readl, addr, val, cond, delay_us, timeout_us) | ||
113 | |||
114 | #define readq_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
115 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ||
116 | |||
117 | #define readq_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
118 | readx_poll_timeout_atomic(readq, addr, val, cond, delay_us, timeout_us) | ||
119 | |||
120 | #define readb_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
121 | readx_poll_timeout(readb_relaxed, addr, val, cond, delay_us, timeout_us) | ||
122 | |||
123 | #define readb_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
124 | readx_poll_timeout_atomic(readb_relaxed, addr, val, cond, delay_us, timeout_us) | ||
125 | |||
126 | #define readw_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
127 | readx_poll_timeout(readw_relaxed, addr, val, cond, delay_us, timeout_us) | ||
128 | |||
129 | #define readw_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
130 | readx_poll_timeout_atomic(readw_relaxed, addr, val, cond, delay_us, timeout_us) | ||
131 | |||
132 | #define readl_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
133 | readx_poll_timeout(readl_relaxed, addr, val, cond, delay_us, timeout_us) | ||
134 | |||
135 | #define readl_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
136 | readx_poll_timeout_atomic(readl_relaxed, addr, val, cond, delay_us, timeout_us) | ||
137 | |||
138 | #define readq_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
139 | readx_poll_timeout(readq_relaxed, addr, val, cond, delay_us, timeout_us) | ||
140 | |||
141 | #define readq_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
142 | readx_poll_timeout_atomic(readq_relaxed, addr, val, cond, delay_us, timeout_us) | ||
143 | |||
144 | #endif /* _LINUX_IOPOLL_H */ | ||
diff --git a/include/linux/iova.h b/include/linux/iova.h index 19e81d5ccb6d..3920a19d8194 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
@@ -16,9 +16,6 @@ | |||
16 | #include <linux/rbtree.h> | 16 | #include <linux/rbtree.h> |
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | 18 | ||
19 | /* IO virtual address start page frame number */ | ||
20 | #define IOVA_START_PFN (1) | ||
21 | |||
22 | /* iova structure */ | 19 | /* iova structure */ |
23 | struct iova { | 20 | struct iova { |
24 | struct rb_node node; | 21 | struct rb_node node; |
@@ -31,6 +28,8 @@ struct iova_domain { | |||
31 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | 28 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ |
32 | struct rb_root rbroot; /* iova domain rbtree root */ | 29 | struct rb_root rbroot; /* iova domain rbtree root */ |
33 | struct rb_node *cached32_node; /* Save last alloced node */ | 30 | struct rb_node *cached32_node; /* Save last alloced node */ |
31 | unsigned long granule; /* pfn granularity for this domain */ | ||
32 | unsigned long start_pfn; /* Lower limit for this domain */ | ||
34 | unsigned long dma_32bit_pfn; | 33 | unsigned long dma_32bit_pfn; |
35 | }; | 34 | }; |
36 | 35 | ||
@@ -39,6 +38,39 @@ static inline unsigned long iova_size(struct iova *iova) | |||
39 | return iova->pfn_hi - iova->pfn_lo + 1; | 38 | return iova->pfn_hi - iova->pfn_lo + 1; |
40 | } | 39 | } |
41 | 40 | ||
41 | static inline unsigned long iova_shift(struct iova_domain *iovad) | ||
42 | { | ||
43 | return __ffs(iovad->granule); | ||
44 | } | ||
45 | |||
46 | static inline unsigned long iova_mask(struct iova_domain *iovad) | ||
47 | { | ||
48 | return iovad->granule - 1; | ||
49 | } | ||
50 | |||
51 | static inline size_t iova_offset(struct iova_domain *iovad, dma_addr_t iova) | ||
52 | { | ||
53 | return iova & iova_mask(iovad); | ||
54 | } | ||
55 | |||
56 | static inline size_t iova_align(struct iova_domain *iovad, size_t size) | ||
57 | { | ||
58 | return ALIGN(size, iovad->granule); | ||
59 | } | ||
60 | |||
61 | static inline dma_addr_t iova_dma_addr(struct iova_domain *iovad, struct iova *iova) | ||
62 | { | ||
63 | return (dma_addr_t)iova->pfn_lo << iova_shift(iovad); | ||
64 | } | ||
65 | |||
66 | static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) | ||
67 | { | ||
68 | return iova >> iova_shift(iovad); | ||
69 | } | ||
70 | |||
71 | int iommu_iova_cache_init(void); | ||
72 | void iommu_iova_cache_destroy(void); | ||
73 | |||
42 | struct iova *alloc_iova_mem(void); | 74 | struct iova *alloc_iova_mem(void); |
43 | void free_iova_mem(struct iova *iova); | 75 | void free_iova_mem(struct iova *iova); |
44 | void free_iova(struct iova_domain *iovad, unsigned long pfn); | 76 | void free_iova(struct iova_domain *iovad, unsigned long pfn); |
@@ -49,7 +81,8 @@ struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size, | |||
49 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, | 81 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, |
50 | unsigned long pfn_hi); | 82 | unsigned long pfn_hi); |
51 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); | 83 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); |
52 | void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit); | 84 | void init_iova_domain(struct iova_domain *iovad, unsigned long granule, |
85 | unsigned long start_pfn, unsigned long pfn_32bit); | ||
53 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); | 86 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); |
54 | void put_iova_domain(struct iova_domain *iovad); | 87 | void put_iova_domain(struct iova_domain *iovad); |
55 | struct iova *split_and_remove_iova(struct iova_domain *iovad, | 88 | struct iova *split_and_remove_iova(struct iova_domain *iovad, |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index c694e7baa621..4d5169f5d7d1 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -52,6 +52,7 @@ struct ipv6_devconf { | |||
52 | __s32 force_tllao; | 52 | __s32 force_tllao; |
53 | __s32 ndisc_notify; | 53 | __s32 ndisc_notify; |
54 | __s32 suppress_frag_ndisc; | 54 | __s32 suppress_frag_ndisc; |
55 | __s32 accept_ra_mtu; | ||
55 | void *sysctl; | 56 | void *sysctl; |
56 | }; | 57 | }; |
57 | 58 | ||
@@ -124,6 +125,12 @@ struct ipv6_mc_socklist; | |||
124 | struct ipv6_ac_socklist; | 125 | struct ipv6_ac_socklist; |
125 | struct ipv6_fl_socklist; | 126 | struct ipv6_fl_socklist; |
126 | 127 | ||
128 | struct inet6_cork { | ||
129 | struct ipv6_txoptions *opt; | ||
130 | u8 hop_limit; | ||
131 | u8 tclass; | ||
132 | }; | ||
133 | |||
127 | /** | 134 | /** |
128 | * struct ipv6_pinfo - ipv6 private area | 135 | * struct ipv6_pinfo - ipv6 private area |
129 | * | 136 | * |
@@ -216,11 +223,7 @@ struct ipv6_pinfo { | |||
216 | struct ipv6_txoptions *opt; | 223 | struct ipv6_txoptions *opt; |
217 | struct sk_buff *pktoptions; | 224 | struct sk_buff *pktoptions; |
218 | struct sk_buff *rxpmtu; | 225 | struct sk_buff *rxpmtu; |
219 | struct { | 226 | struct inet6_cork cork; |
220 | struct ipv6_txoptions *opt; | ||
221 | u8 hop_limit; | ||
222 | u8 tclass; | ||
223 | } cork; | ||
224 | }; | 227 | }; |
225 | 228 | ||
226 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ | 229 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ |
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 1e8b0cf30792..800544bc7bfd 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define GICD_SETSPI_SR 0x0050 | 33 | #define GICD_SETSPI_SR 0x0050 |
34 | #define GICD_CLRSPI_SR 0x0058 | 34 | #define GICD_CLRSPI_SR 0x0058 |
35 | #define GICD_SEIR 0x0068 | 35 | #define GICD_SEIR 0x0068 |
36 | #define GICD_IGROUPR 0x0080 | ||
36 | #define GICD_ISENABLER 0x0100 | 37 | #define GICD_ISENABLER 0x0100 |
37 | #define GICD_ICENABLER 0x0180 | 38 | #define GICD_ICENABLER 0x0180 |
38 | #define GICD_ISPENDR 0x0200 | 39 | #define GICD_ISPENDR 0x0200 |
@@ -41,14 +42,37 @@ | |||
41 | #define GICD_ICACTIVER 0x0380 | 42 | #define GICD_ICACTIVER 0x0380 |
42 | #define GICD_IPRIORITYR 0x0400 | 43 | #define GICD_IPRIORITYR 0x0400 |
43 | #define GICD_ICFGR 0x0C00 | 44 | #define GICD_ICFGR 0x0C00 |
45 | #define GICD_IGRPMODR 0x0D00 | ||
46 | #define GICD_NSACR 0x0E00 | ||
44 | #define GICD_IROUTER 0x6000 | 47 | #define GICD_IROUTER 0x6000 |
48 | #define GICD_IDREGS 0xFFD0 | ||
45 | #define GICD_PIDR2 0xFFE8 | 49 | #define GICD_PIDR2 0xFFE8 |
46 | 50 | ||
51 | /* | ||
52 | * Those registers are actually from GICv2, but the spec demands that they | ||
53 | * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3). | ||
54 | */ | ||
55 | #define GICD_ITARGETSR 0x0800 | ||
56 | #define GICD_SGIR 0x0F00 | ||
57 | #define GICD_CPENDSGIR 0x0F10 | ||
58 | #define GICD_SPENDSGIR 0x0F20 | ||
59 | |||
47 | #define GICD_CTLR_RWP (1U << 31) | 60 | #define GICD_CTLR_RWP (1U << 31) |
61 | #define GICD_CTLR_DS (1U << 6) | ||
48 | #define GICD_CTLR_ARE_NS (1U << 4) | 62 | #define GICD_CTLR_ARE_NS (1U << 4) |
49 | #define GICD_CTLR_ENABLE_G1A (1U << 1) | 63 | #define GICD_CTLR_ENABLE_G1A (1U << 1) |
50 | #define GICD_CTLR_ENABLE_G1 (1U << 0) | 64 | #define GICD_CTLR_ENABLE_G1 (1U << 0) |
51 | 65 | ||
66 | /* | ||
67 | * In systems with a single security state (what we emulate in KVM) | ||
68 | * the meaning of the interrupt group enable bits is slightly different | ||
69 | */ | ||
70 | #define GICD_CTLR_ENABLE_SS_G1 (1U << 1) | ||
71 | #define GICD_CTLR_ENABLE_SS_G0 (1U << 0) | ||
72 | |||
73 | #define GICD_TYPER_LPIS (1U << 17) | ||
74 | #define GICD_TYPER_MBIS (1U << 16) | ||
75 | |||
52 | #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1) | 76 | #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1) |
53 | #define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32) | 77 | #define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32) |
54 | #define GICD_TYPER_LPIS (1U << 17) | 78 | #define GICD_TYPER_LPIS (1U << 17) |
@@ -60,6 +84,8 @@ | |||
60 | #define GIC_PIDR2_ARCH_GICv3 0x30 | 84 | #define GIC_PIDR2_ARCH_GICv3 0x30 |
61 | #define GIC_PIDR2_ARCH_GICv4 0x40 | 85 | #define GIC_PIDR2_ARCH_GICv4 0x40 |
62 | 86 | ||
87 | #define GIC_V3_DIST_SIZE 0x10000 | ||
88 | |||
63 | /* | 89 | /* |
64 | * Re-Distributor registers, offsets from RD_base | 90 | * Re-Distributor registers, offsets from RD_base |
65 | */ | 91 | */ |
@@ -78,6 +104,7 @@ | |||
78 | #define GICR_SYNCR 0x00C0 | 104 | #define GICR_SYNCR 0x00C0 |
79 | #define GICR_MOVLPIR 0x0100 | 105 | #define GICR_MOVLPIR 0x0100 |
80 | #define GICR_MOVALLR 0x0110 | 106 | #define GICR_MOVALLR 0x0110 |
107 | #define GICR_IDREGS GICD_IDREGS | ||
81 | #define GICR_PIDR2 GICD_PIDR2 | 108 | #define GICR_PIDR2 GICD_PIDR2 |
82 | 109 | ||
83 | #define GICR_CTLR_ENABLE_LPIS (1UL << 0) | 110 | #define GICR_CTLR_ENABLE_LPIS (1UL << 0) |
@@ -104,6 +131,7 @@ | |||
104 | /* | 131 | /* |
105 | * Re-Distributor registers, offsets from SGI_base | 132 | * Re-Distributor registers, offsets from SGI_base |
106 | */ | 133 | */ |
134 | #define GICR_IGROUPR0 GICD_IGROUPR | ||
107 | #define GICR_ISENABLER0 GICD_ISENABLER | 135 | #define GICR_ISENABLER0 GICD_ISENABLER |
108 | #define GICR_ICENABLER0 GICD_ICENABLER | 136 | #define GICR_ICENABLER0 GICD_ICENABLER |
109 | #define GICR_ISPENDR0 GICD_ISPENDR | 137 | #define GICR_ISPENDR0 GICD_ISPENDR |
@@ -112,11 +140,15 @@ | |||
112 | #define GICR_ICACTIVER0 GICD_ICACTIVER | 140 | #define GICR_ICACTIVER0 GICD_ICACTIVER |
113 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR | 141 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR |
114 | #define GICR_ICFGR0 GICD_ICFGR | 142 | #define GICR_ICFGR0 GICD_ICFGR |
143 | #define GICR_IGRPMODR0 GICD_IGRPMODR | ||
144 | #define GICR_NSACR GICD_NSACR | ||
115 | 145 | ||
116 | #define GICR_TYPER_PLPIS (1U << 0) | 146 | #define GICR_TYPER_PLPIS (1U << 0) |
117 | #define GICR_TYPER_VLPIS (1U << 1) | 147 | #define GICR_TYPER_VLPIS (1U << 1) |
118 | #define GICR_TYPER_LAST (1U << 4) | 148 | #define GICR_TYPER_LAST (1U << 4) |
119 | 149 | ||
150 | #define GIC_V3_REDIST_SIZE 0x20000 | ||
151 | |||
120 | #define LPI_PROP_GROUP1 (1 << 1) | 152 | #define LPI_PROP_GROUP1 (1 << 1) |
121 | #define LPI_PROP_ENABLED (1 << 0) | 153 | #define LPI_PROP_ENABLED (1 << 0) |
122 | 154 | ||
@@ -248,6 +280,18 @@ | |||
248 | #define ICC_SRE_EL2_SRE (1 << 0) | 280 | #define ICC_SRE_EL2_SRE (1 << 0) |
249 | #define ICC_SRE_EL2_ENABLE (1 << 3) | 281 | #define ICC_SRE_EL2_ENABLE (1 << 3) |
250 | 282 | ||
283 | #define ICC_SGI1R_TARGET_LIST_SHIFT 0 | ||
284 | #define ICC_SGI1R_TARGET_LIST_MASK (0xffff << ICC_SGI1R_TARGET_LIST_SHIFT) | ||
285 | #define ICC_SGI1R_AFFINITY_1_SHIFT 16 | ||
286 | #define ICC_SGI1R_AFFINITY_1_MASK (0xff << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
287 | #define ICC_SGI1R_SGI_ID_SHIFT 24 | ||
288 | #define ICC_SGI1R_SGI_ID_MASK (0xff << ICC_SGI1R_SGI_ID_SHIFT) | ||
289 | #define ICC_SGI1R_AFFINITY_2_SHIFT 32 | ||
290 | #define ICC_SGI1R_AFFINITY_2_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
291 | #define ICC_SGI1R_IRQ_ROUTING_MODE_BIT 40 | ||
292 | #define ICC_SGI1R_AFFINITY_3_SHIFT 48 | ||
293 | #define ICC_SGI1R_AFFINITY_3_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
294 | |||
251 | /* | 295 | /* |
252 | * System register definitions | 296 | * System register definitions |
253 | */ | 297 | */ |
diff --git a/include/linux/irqchip/irq-omap-intc.h b/include/linux/irqchip/irq-omap-intc.h index e06b370cfc0d..2e3d1afeb674 100644 --- a/include/linux/irqchip/irq-omap-intc.h +++ b/include/linux/irqchip/irq-omap-intc.h | |||
@@ -18,9 +18,7 @@ | |||
18 | #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H | 18 | #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H |
19 | #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H | 19 | #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H |
20 | 20 | ||
21 | void omap2_init_irq(void); | ||
22 | void omap3_init_irq(void); | 21 | void omap3_init_irq(void); |
23 | void ti81xx_init_irq(void); | ||
24 | 22 | ||
25 | int omap_irq_pending(void); | 23 | int omap_irq_pending(void); |
26 | void omap_intc_save_context(void); | 24 | void omap_intc_save_context(void); |
diff --git a/include/linux/irqchip/mips-gic.h b/include/linux/irqchip/mips-gic.h index 420f77b34d02..e6a6aac451db 100644 --- a/include/linux/irqchip/mips-gic.h +++ b/include/linux/irqchip/mips-gic.h | |||
@@ -243,7 +243,6 @@ extern void gic_write_cpu_compare(cycle_t cnt, int cpu); | |||
243 | extern void gic_send_ipi(unsigned int intr); | 243 | extern void gic_send_ipi(unsigned int intr); |
244 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); | 244 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); |
245 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); | 245 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); |
246 | extern unsigned int gic_get_timer_pending(void); | ||
247 | extern int gic_get_c0_compare_int(void); | 246 | extern int gic_get_c0_compare_int(void); |
248 | extern int gic_get_c0_perfcount_int(void); | 247 | extern int gic_get_c0_perfcount_int(void); |
249 | #endif /* __LINUX_IRQCHIP_MIPS_GIC_H */ | 248 | #endif /* __LINUX_IRQCHIP_MIPS_GIC_H */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 31229e0be90b..d32615280be9 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -956,15 +956,6 @@ void __log_wait_for_space(journal_t *journal); | |||
956 | extern void __journal_drop_transaction(journal_t *, transaction_t *); | 956 | extern void __journal_drop_transaction(journal_t *, transaction_t *); |
957 | extern int cleanup_journal_tail(journal_t *); | 957 | extern int cleanup_journal_tail(journal_t *); |
958 | 958 | ||
959 | /* Debugging code only: */ | ||
960 | |||
961 | #define jbd_ENOSYS() \ | ||
962 | do { \ | ||
963 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ | ||
964 | current->state = TASK_UNINTERRUPTIBLE; \ | ||
965 | schedule(); \ | ||
966 | } while (1) | ||
967 | |||
968 | /* | 959 | /* |
969 | * is_journal_abort | 960 | * is_journal_abort |
970 | * | 961 | * |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 704b9a599b26..20e7f78041c8 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1251,15 +1251,6 @@ void __jbd2_log_wait_for_space(journal_t *journal); | |||
1251 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); | 1251 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); |
1252 | extern int jbd2_cleanup_journal_tail(journal_t *); | 1252 | extern int jbd2_cleanup_journal_tail(journal_t *); |
1253 | 1253 | ||
1254 | /* Debugging code only: */ | ||
1255 | |||
1256 | #define jbd_ENOSYS() \ | ||
1257 | do { \ | ||
1258 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ | ||
1259 | current->state = TASK_UNINTERRUPTIBLE; \ | ||
1260 | schedule(); \ | ||
1261 | } while (1) | ||
1262 | |||
1263 | /* | 1254 | /* |
1264 | * is_journal_abort | 1255 | * is_journal_abort |
1265 | * | 1256 | * |
diff --git a/include/linux/kasan.h b/include/linux/kasan.h new file mode 100644 index 000000000000..72ba725ddf9c --- /dev/null +++ b/include/linux/kasan.h | |||
@@ -0,0 +1,89 @@ | |||
1 | #ifndef _LINUX_KASAN_H | ||
2 | #define _LINUX_KASAN_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct kmem_cache; | ||
7 | struct page; | ||
8 | |||
9 | #ifdef CONFIG_KASAN | ||
10 | |||
11 | #define KASAN_SHADOW_SCALE_SHIFT 3 | ||
12 | #define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL) | ||
13 | |||
14 | #include <asm/kasan.h> | ||
15 | #include <linux/sched.h> | ||
16 | |||
17 | static inline void *kasan_mem_to_shadow(const void *addr) | ||
18 | { | ||
19 | return (void *)((unsigned long)addr >> KASAN_SHADOW_SCALE_SHIFT) | ||
20 | + KASAN_SHADOW_OFFSET; | ||
21 | } | ||
22 | |||
23 | /* Enable reporting bugs after kasan_disable_current() */ | ||
24 | static inline void kasan_enable_current(void) | ||
25 | { | ||
26 | current->kasan_depth++; | ||
27 | } | ||
28 | |||
29 | /* Disable reporting bugs for current task */ | ||
30 | static inline void kasan_disable_current(void) | ||
31 | { | ||
32 | current->kasan_depth--; | ||
33 | } | ||
34 | |||
35 | void kasan_unpoison_shadow(const void *address, size_t size); | ||
36 | |||
37 | void kasan_alloc_pages(struct page *page, unsigned int order); | ||
38 | void kasan_free_pages(struct page *page, unsigned int order); | ||
39 | |||
40 | void kasan_poison_slab(struct page *page); | ||
41 | void kasan_unpoison_object_data(struct kmem_cache *cache, void *object); | ||
42 | void kasan_poison_object_data(struct kmem_cache *cache, void *object); | ||
43 | |||
44 | void kasan_kmalloc_large(const void *ptr, size_t size); | ||
45 | void kasan_kfree_large(const void *ptr); | ||
46 | void kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size); | ||
47 | void kasan_krealloc(const void *object, size_t new_size); | ||
48 | |||
49 | void kasan_slab_alloc(struct kmem_cache *s, void *object); | ||
50 | void kasan_slab_free(struct kmem_cache *s, void *object); | ||
51 | |||
52 | #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) | ||
53 | |||
54 | int kasan_module_alloc(void *addr, size_t size); | ||
55 | void kasan_module_free(void *addr); | ||
56 | |||
57 | #else /* CONFIG_KASAN */ | ||
58 | |||
59 | #define MODULE_ALIGN 1 | ||
60 | |||
61 | static inline void kasan_unpoison_shadow(const void *address, size_t size) {} | ||
62 | |||
63 | static inline void kasan_enable_current(void) {} | ||
64 | static inline void kasan_disable_current(void) {} | ||
65 | |||
66 | static inline void kasan_alloc_pages(struct page *page, unsigned int order) {} | ||
67 | static inline void kasan_free_pages(struct page *page, unsigned int order) {} | ||
68 | |||
69 | static inline void kasan_poison_slab(struct page *page) {} | ||
70 | static inline void kasan_unpoison_object_data(struct kmem_cache *cache, | ||
71 | void *object) {} | ||
72 | static inline void kasan_poison_object_data(struct kmem_cache *cache, | ||
73 | void *object) {} | ||
74 | |||
75 | static inline void kasan_kmalloc_large(void *ptr, size_t size) {} | ||
76 | static inline void kasan_kfree_large(const void *ptr) {} | ||
77 | static inline void kasan_kmalloc(struct kmem_cache *s, const void *object, | ||
78 | size_t size) {} | ||
79 | static inline void kasan_krealloc(const void *object, size_t new_size) {} | ||
80 | |||
81 | static inline void kasan_slab_alloc(struct kmem_cache *s, void *object) {} | ||
82 | static inline void kasan_slab_free(struct kmem_cache *s, void *object) {} | ||
83 | |||
84 | static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } | ||
85 | static inline void kasan_module_free(void *addr) {} | ||
86 | |||
87 | #endif /* CONFIG_KASAN */ | ||
88 | |||
89 | #endif /* LINUX_KASAN_H */ | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 75ae2e2631fc..a19bcf9e762e 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
@@ -156,8 +156,14 @@ typedef enum { | |||
156 | KDB_REASON_SYSTEM_NMI, /* In NMI due to SYSTEM cmd; regs valid */ | 156 | KDB_REASON_SYSTEM_NMI, /* In NMI due to SYSTEM cmd; regs valid */ |
157 | } kdb_reason_t; | 157 | } kdb_reason_t; |
158 | 158 | ||
159 | enum kdb_msgsrc { | ||
160 | KDB_MSGSRC_INTERNAL, /* direct call to kdb_printf() */ | ||
161 | KDB_MSGSRC_PRINTK, /* trapped from printk() */ | ||
162 | }; | ||
163 | |||
159 | extern int kdb_trap_printk; | 164 | extern int kdb_trap_printk; |
160 | extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args); | 165 | extern __printf(2, 0) int vkdb_printf(enum kdb_msgsrc src, const char *fmt, |
166 | va_list args); | ||
161 | extern __printf(1, 2) int kdb_printf(const char *, ...); | 167 | extern __printf(1, 2) int kdb_printf(const char *, ...); |
162 | typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); | 168 | typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); |
163 | 169 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 64ce58bee6f5..d6d630d31ef3 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -471,6 +471,7 @@ extern enum system_states { | |||
471 | #define TAINT_OOT_MODULE 12 | 471 | #define TAINT_OOT_MODULE 12 |
472 | #define TAINT_UNSIGNED_MODULE 13 | 472 | #define TAINT_UNSIGNED_MODULE 13 |
473 | #define TAINT_SOFTLOCKUP 14 | 473 | #define TAINT_SOFTLOCKUP 14 |
474 | #define TAINT_LIVEPATCH 15 | ||
474 | 475 | ||
475 | extern const char hex_asc[]; | 476 | extern const char hex_asc[]; |
476 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 477 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
@@ -799,9 +800,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
799 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | 800 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
800 | (type *)( (char *)__mptr - offsetof(type,member) );}) | 801 | (type *)( (char *)__mptr - offsetof(type,member) );}) |
801 | 802 | ||
802 | /* Trap pasters of __FUNCTION__ at compile-time */ | ||
803 | #define __FUNCTION__ (__func__) | ||
804 | |||
805 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ | 803 | /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ |
806 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 804 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
807 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD | 805 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index d4e01b358341..71ecdab1671b 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -43,7 +43,6 @@ enum kernfs_node_flag { | |||
43 | KERNFS_HAS_SEQ_SHOW = 0x0040, | 43 | KERNFS_HAS_SEQ_SHOW = 0x0040, |
44 | KERNFS_HAS_MMAP = 0x0080, | 44 | KERNFS_HAS_MMAP = 0x0080, |
45 | KERNFS_LOCKDEP = 0x0100, | 45 | KERNFS_LOCKDEP = 0x0100, |
46 | KERNFS_STATIC_NAME = 0x0200, | ||
47 | KERNFS_SUICIDAL = 0x0400, | 46 | KERNFS_SUICIDAL = 0x0400, |
48 | KERNFS_SUICIDED = 0x0800, | 47 | KERNFS_SUICIDED = 0x0800, |
49 | }; | 48 | }; |
@@ -291,7 +290,6 @@ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, | |||
291 | umode_t mode, loff_t size, | 290 | umode_t mode, loff_t size, |
292 | const struct kernfs_ops *ops, | 291 | const struct kernfs_ops *ops, |
293 | void *priv, const void *ns, | 292 | void *priv, const void *ns, |
294 | bool name_is_static, | ||
295 | struct lock_class_key *key); | 293 | struct lock_class_key *key); |
296 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, | 294 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, |
297 | const char *name, | 295 | const char *name, |
@@ -369,8 +367,7 @@ kernfs_create_dir_ns(struct kernfs_node *parent, const char *name, | |||
369 | static inline struct kernfs_node * | 367 | static inline struct kernfs_node * |
370 | __kernfs_create_file(struct kernfs_node *parent, const char *name, | 368 | __kernfs_create_file(struct kernfs_node *parent, const char *name, |
371 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | 369 | umode_t mode, loff_t size, const struct kernfs_ops *ops, |
372 | void *priv, const void *ns, bool name_is_static, | 370 | void *priv, const void *ns, struct lock_class_key *key) |
373 | struct lock_class_key *key) | ||
374 | { return ERR_PTR(-ENOSYS); } | 371 | { return ERR_PTR(-ENOSYS); } |
375 | 372 | ||
376 | static inline struct kernfs_node * | 373 | static inline struct kernfs_node * |
@@ -439,7 +436,7 @@ kernfs_create_file_ns(struct kernfs_node *parent, const char *name, | |||
439 | key = (struct lock_class_key *)&ops->lockdep_key; | 436 | key = (struct lock_class_key *)&ops->lockdep_key; |
440 | #endif | 437 | #endif |
441 | return __kernfs_create_file(parent, name, mode, size, ops, priv, ns, | 438 | return __kernfs_create_file(parent, name, mode, size, ops, priv, ns, |
442 | false, key); | 439 | key); |
443 | } | 440 | } |
444 | 441 | ||
445 | static inline struct kernfs_node * | 442 | static inline struct kernfs_node * |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 9d957b7ae095..e60a745ac198 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -1,6 +1,19 @@ | |||
1 | #ifndef LINUX_KEXEC_H | 1 | #ifndef LINUX_KEXEC_H |
2 | #define LINUX_KEXEC_H | 2 | #define LINUX_KEXEC_H |
3 | 3 | ||
4 | #define IND_DESTINATION_BIT 0 | ||
5 | #define IND_INDIRECTION_BIT 1 | ||
6 | #define IND_DONE_BIT 2 | ||
7 | #define IND_SOURCE_BIT 3 | ||
8 | |||
9 | #define IND_DESTINATION (1 << IND_DESTINATION_BIT) | ||
10 | #define IND_INDIRECTION (1 << IND_INDIRECTION_BIT) | ||
11 | #define IND_DONE (1 << IND_DONE_BIT) | ||
12 | #define IND_SOURCE (1 << IND_SOURCE_BIT) | ||
13 | #define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE) | ||
14 | |||
15 | #if !defined(__ASSEMBLY__) | ||
16 | |||
4 | #include <uapi/linux/kexec.h> | 17 | #include <uapi/linux/kexec.h> |
5 | 18 | ||
6 | #ifdef CONFIG_KEXEC | 19 | #ifdef CONFIG_KEXEC |
@@ -64,10 +77,6 @@ | |||
64 | */ | 77 | */ |
65 | 78 | ||
66 | typedef unsigned long kimage_entry_t; | 79 | typedef unsigned long kimage_entry_t; |
67 | #define IND_DESTINATION 0x1 | ||
68 | #define IND_INDIRECTION 0x2 | ||
69 | #define IND_DONE 0x4 | ||
70 | #define IND_SOURCE 0x8 | ||
71 | 80 | ||
72 | struct kexec_segment { | 81 | struct kexec_segment { |
73 | /* | 82 | /* |
@@ -122,8 +131,6 @@ struct kimage { | |||
122 | kimage_entry_t *entry; | 131 | kimage_entry_t *entry; |
123 | kimage_entry_t *last_entry; | 132 | kimage_entry_t *last_entry; |
124 | 133 | ||
125 | unsigned long destination; | ||
126 | |||
127 | unsigned long start; | 134 | unsigned long start; |
128 | struct page *control_code_page; | 135 | struct page *control_code_page; |
129 | struct page *swap_page; | 136 | struct page *swap_page; |
@@ -313,4 +320,7 @@ struct task_struct; | |||
313 | static inline void crash_kexec(struct pt_regs *regs) { } | 320 | static inline void crash_kexec(struct pt_regs *regs) { } |
314 | static inline int kexec_should_crash(struct task_struct *p) { return 0; } | 321 | static inline int kexec_should_crash(struct task_struct *p) { return 0; } |
315 | #endif /* CONFIG_KEXEC */ | 322 | #endif /* CONFIG_KEXEC */ |
323 | |||
324 | #endif /* !defined(__ASSEBMLY__) */ | ||
325 | |||
316 | #endif /* LINUX_KEXEC_H */ | 326 | #endif /* LINUX_KEXEC_H */ |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 5297f9fa0ef2..1ab54754a86d 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -308,7 +308,8 @@ struct optimized_kprobe { | |||
308 | /* Architecture dependent functions for direct jump optimization */ | 308 | /* Architecture dependent functions for direct jump optimization */ |
309 | extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); | 309 | extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); |
310 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); | 310 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); |
311 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); | 311 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, |
312 | struct kprobe *orig); | ||
312 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); | 313 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); |
313 | extern void arch_optimize_kprobes(struct list_head *oplist); | 314 | extern void arch_optimize_kprobes(struct list_head *oplist); |
314 | extern void arch_unoptimize_kprobes(struct list_head *oplist, | 315 | extern void arch_unoptimize_kprobes(struct list_head *oplist, |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c9d645ad98ff..5fc3d1083071 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -166,7 +166,17 @@ static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | #if BITS_PER_LONG < 64 | 168 | #if BITS_PER_LONG < 64 |
169 | extern u64 ktime_divns(const ktime_t kt, s64 div); | 169 | extern u64 __ktime_divns(const ktime_t kt, s64 div); |
170 | static inline u64 ktime_divns(const ktime_t kt, s64 div) | ||
171 | { | ||
172 | if (__builtin_constant_p(div) && !(div >> 32)) { | ||
173 | u64 ns = kt.tv64; | ||
174 | do_div(ns, div); | ||
175 | return ns; | ||
176 | } else { | ||
177 | return __ktime_divns(kt, div); | ||
178 | } | ||
179 | } | ||
170 | #else /* BITS_PER_LONG < 64 */ | 180 | #else /* BITS_PER_LONG < 64 */ |
171 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) | 181 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) |
172 | #endif | 182 | #endif |
@@ -186,6 +196,11 @@ static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | |||
186 | return ktime_to_us(ktime_sub(later, earlier)); | 196 | return ktime_to_us(ktime_sub(later, earlier)); |
187 | } | 197 | } |
188 | 198 | ||
199 | static inline s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier) | ||
200 | { | ||
201 | return ktime_to_ms(ktime_sub(later, earlier)); | ||
202 | } | ||
203 | |||
189 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) | 204 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) |
190 | { | 205 | { |
191 | return ktime_add_ns(kt, usec * NSEC_PER_USEC); | 206 | return ktime_add_ns(kt, usec * NSEC_PER_USEC); |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 26f106022c88..d12b2104d19b 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -33,10 +33,6 @@ | |||
33 | 33 | ||
34 | #include <asm/kvm_host.h> | 34 | #include <asm/kvm_host.h> |
35 | 35 | ||
36 | #ifndef KVM_MMIO_SIZE | ||
37 | #define KVM_MMIO_SIZE 8 | ||
38 | #endif | ||
39 | |||
40 | /* | 36 | /* |
41 | * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used | 37 | * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used |
42 | * in kvm, other bits are visible for userspace which are defined in | 38 | * in kvm, other bits are visible for userspace which are defined in |
@@ -200,17 +196,6 @@ int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, unsigned long hva, | |||
200 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | 196 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); |
201 | #endif | 197 | #endif |
202 | 198 | ||
203 | /* | ||
204 | * Carry out a gup that requires IO. Allow the mm to relinquish the mmap | ||
205 | * semaphore if the filemap/swap has to wait on a page lock. pagep == NULL | ||
206 | * controls whether we retry the gup one more time to completion in that case. | ||
207 | * Typically this is called after a FAULT_FLAG_RETRY_NOWAIT in the main tdp | ||
208 | * handler. | ||
209 | */ | ||
210 | int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm, | ||
211 | unsigned long addr, bool write_fault, | ||
212 | struct page **pagep); | ||
213 | |||
214 | enum { | 199 | enum { |
215 | OUTSIDE_GUEST_MODE, | 200 | OUTSIDE_GUEST_MODE, |
216 | IN_GUEST_MODE, | 201 | IN_GUEST_MODE, |
@@ -611,6 +596,15 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext); | |||
611 | 596 | ||
612 | int kvm_get_dirty_log(struct kvm *kvm, | 597 | int kvm_get_dirty_log(struct kvm *kvm, |
613 | struct kvm_dirty_log *log, int *is_dirty); | 598 | struct kvm_dirty_log *log, int *is_dirty); |
599 | |||
600 | int kvm_get_dirty_log_protect(struct kvm *kvm, | ||
601 | struct kvm_dirty_log *log, bool *is_dirty); | ||
602 | |||
603 | void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm, | ||
604 | struct kvm_memory_slot *slot, | ||
605 | gfn_t gfn_offset, | ||
606 | unsigned long mask); | ||
607 | |||
614 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | 608 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, |
615 | struct kvm_dirty_log *log); | 609 | struct kvm_dirty_log *log); |
616 | 610 | ||
@@ -652,7 +646,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); | |||
652 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); | 646 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); |
653 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); | 647 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); |
654 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); | 648 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); |
655 | int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu); | 649 | void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu); |
656 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); | 650 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); |
657 | 651 | ||
658 | int kvm_arch_hardware_enable(void); | 652 | int kvm_arch_hardware_enable(void); |
@@ -1042,6 +1036,8 @@ void kvm_unregister_device_ops(u32 type); | |||
1042 | 1036 | ||
1043 | extern struct kvm_device_ops kvm_mpic_ops; | 1037 | extern struct kvm_device_ops kvm_mpic_ops; |
1044 | extern struct kvm_device_ops kvm_xics_ops; | 1038 | extern struct kvm_device_ops kvm_xics_ops; |
1039 | extern struct kvm_device_ops kvm_arm_vgic_v2_ops; | ||
1040 | extern struct kvm_device_ops kvm_arm_vgic_v3_ops; | ||
1045 | 1041 | ||
1046 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT | 1042 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT |
1047 | 1043 | ||
diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h new file mode 100644 index 000000000000..5ba2facd7a51 --- /dev/null +++ b/include/linux/led-class-flash.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * LED Flash class interface | ||
3 | * | ||
4 | * Copyright (C) 2015 Samsung Electronics Co., Ltd. | ||
5 | * Author: Jacek Anaszewski <j.anaszewski@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | #ifndef __LINUX_FLASH_LEDS_H_INCLUDED | ||
13 | #define __LINUX_FLASH_LEDS_H_INCLUDED | ||
14 | |||
15 | #include <linux/leds.h> | ||
16 | #include <uapi/linux/v4l2-controls.h> | ||
17 | |||
18 | struct device_node; | ||
19 | struct led_classdev_flash; | ||
20 | |||
21 | /* | ||
22 | * Supported led fault bits - must be kept in synch | ||
23 | * with V4L2_FLASH_FAULT bits. | ||
24 | */ | ||
25 | #define LED_FAULT_OVER_VOLTAGE (1 << 0) | ||
26 | #define LED_FAULT_TIMEOUT (1 << 1) | ||
27 | #define LED_FAULT_OVER_TEMPERATURE (1 << 2) | ||
28 | #define LED_FAULT_SHORT_CIRCUIT (1 << 3) | ||
29 | #define LED_FAULT_OVER_CURRENT (1 << 4) | ||
30 | #define LED_FAULT_INDICATOR (1 << 5) | ||
31 | #define LED_FAULT_UNDER_VOLTAGE (1 << 6) | ||
32 | #define LED_FAULT_INPUT_VOLTAGE (1 << 7) | ||
33 | #define LED_FAULT_LED_OVER_TEMPERATURE (1 << 8) | ||
34 | #define LED_NUM_FLASH_FAULTS 9 | ||
35 | |||
36 | #define LED_FLASH_MAX_SYSFS_GROUPS 7 | ||
37 | |||
38 | struct led_flash_ops { | ||
39 | /* set flash brightness */ | ||
40 | int (*flash_brightness_set)(struct led_classdev_flash *fled_cdev, | ||
41 | u32 brightness); | ||
42 | /* get flash brightness */ | ||
43 | int (*flash_brightness_get)(struct led_classdev_flash *fled_cdev, | ||
44 | u32 *brightness); | ||
45 | /* set flash strobe state */ | ||
46 | int (*strobe_set)(struct led_classdev_flash *fled_cdev, bool state); | ||
47 | /* get flash strobe state */ | ||
48 | int (*strobe_get)(struct led_classdev_flash *fled_cdev, bool *state); | ||
49 | /* set flash timeout */ | ||
50 | int (*timeout_set)(struct led_classdev_flash *fled_cdev, u32 timeout); | ||
51 | /* get the flash LED fault */ | ||
52 | int (*fault_get)(struct led_classdev_flash *fled_cdev, u32 *fault); | ||
53 | }; | ||
54 | |||
55 | /* | ||
56 | * Current value of a flash setting along | ||
57 | * with its constraints. | ||
58 | */ | ||
59 | struct led_flash_setting { | ||
60 | /* maximum allowed value */ | ||
61 | u32 min; | ||
62 | /* maximum allowed value */ | ||
63 | u32 max; | ||
64 | /* step value */ | ||
65 | u32 step; | ||
66 | /* current value */ | ||
67 | u32 val; | ||
68 | }; | ||
69 | |||
70 | struct led_classdev_flash { | ||
71 | /* led class device */ | ||
72 | struct led_classdev led_cdev; | ||
73 | |||
74 | /* flash led specific ops */ | ||
75 | const struct led_flash_ops *ops; | ||
76 | |||
77 | /* flash brightness value in microamperes along with its constraints */ | ||
78 | struct led_flash_setting brightness; | ||
79 | |||
80 | /* flash timeout value in microseconds along with its constraints */ | ||
81 | struct led_flash_setting timeout; | ||
82 | |||
83 | /* LED Flash class sysfs groups */ | ||
84 | const struct attribute_group *sysfs_groups[LED_FLASH_MAX_SYSFS_GROUPS]; | ||
85 | |||
86 | /* LEDs available for flash strobe synchronization */ | ||
87 | struct led_classdev_flash **sync_leds; | ||
88 | |||
89 | /* Number of LEDs available for flash strobe synchronization */ | ||
90 | int num_sync_leds; | ||
91 | |||
92 | /* | ||
93 | * The identifier of the sub-led to synchronize the flash strobe with. | ||
94 | * Identifiers start from 1, which reflects the first element from the | ||
95 | * sync_leds array. 0 means that the flash strobe should not be | ||
96 | * synchronized. | ||
97 | */ | ||
98 | u32 sync_led_id; | ||
99 | }; | ||
100 | |||
101 | static inline struct led_classdev_flash *lcdev_to_flcdev( | ||
102 | struct led_classdev *lcdev) | ||
103 | { | ||
104 | return container_of(lcdev, struct led_classdev_flash, led_cdev); | ||
105 | } | ||
106 | |||
107 | /** | ||
108 | * led_classdev_flash_register - register a new object of led_classdev class | ||
109 | * with support for flash LEDs | ||
110 | * @parent: the flash LED to register | ||
111 | * @fled_cdev: the led_classdev_flash structure for this device | ||
112 | * | ||
113 | * Returns: 0 on success or negative error value on failure | ||
114 | */ | ||
115 | extern int led_classdev_flash_register(struct device *parent, | ||
116 | struct led_classdev_flash *fled_cdev); | ||
117 | |||
118 | /** | ||
119 | * led_classdev_flash_unregister - unregisters an object of led_classdev class | ||
120 | * with support for flash LEDs | ||
121 | * @fled_cdev: the flash LED to unregister | ||
122 | * | ||
123 | * Unregister a previously registered via led_classdev_flash_register object | ||
124 | */ | ||
125 | extern void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev); | ||
126 | |||
127 | /** | ||
128 | * led_set_flash_strobe - setup flash strobe | ||
129 | * @fled_cdev: the flash LED to set strobe on | ||
130 | * @state: 1 - strobe flash, 0 - stop flash strobe | ||
131 | * | ||
132 | * Strobe the flash LED. | ||
133 | * | ||
134 | * Returns: 0 on success or negative error value on failure | ||
135 | */ | ||
136 | static inline int led_set_flash_strobe(struct led_classdev_flash *fled_cdev, | ||
137 | bool state) | ||
138 | { | ||
139 | return fled_cdev->ops->strobe_set(fled_cdev, state); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * led_get_flash_strobe - get flash strobe status | ||
144 | * @fled_cdev: the flash LED to query | ||
145 | * @state: 1 - flash is strobing, 0 - flash is off | ||
146 | * | ||
147 | * Check whether the flash is strobing at the moment. | ||
148 | * | ||
149 | * Returns: 0 on success or negative error value on failure | ||
150 | */ | ||
151 | static inline int led_get_flash_strobe(struct led_classdev_flash *fled_cdev, | ||
152 | bool *state) | ||
153 | { | ||
154 | if (fled_cdev->ops->strobe_get) | ||
155 | return fled_cdev->ops->strobe_get(fled_cdev, state); | ||
156 | |||
157 | return -EINVAL; | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * led_set_flash_brightness - set flash LED brightness | ||
162 | * @fled_cdev: the flash LED to set | ||
163 | * @brightness: the brightness to set it to | ||
164 | * | ||
165 | * Set a flash LED's brightness. | ||
166 | * | ||
167 | * Returns: 0 on success or negative error value on failure | ||
168 | */ | ||
169 | extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, | ||
170 | u32 brightness); | ||
171 | |||
172 | /** | ||
173 | * led_update_flash_brightness - update flash LED brightness | ||
174 | * @fled_cdev: the flash LED to query | ||
175 | * | ||
176 | * Get a flash LED's current brightness and update led_flash->brightness | ||
177 | * member with the obtained value. | ||
178 | * | ||
179 | * Returns: 0 on success or negative error value on failure | ||
180 | */ | ||
181 | extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); | ||
182 | |||
183 | /** | ||
184 | * led_set_flash_timeout - set flash LED timeout | ||
185 | * @fled_cdev: the flash LED to set | ||
186 | * @timeout: the flash timeout to set it to | ||
187 | * | ||
188 | * Set the flash strobe duration. | ||
189 | * | ||
190 | * Returns: 0 on success or negative error value on failure | ||
191 | */ | ||
192 | extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, | ||
193 | u32 timeout); | ||
194 | |||
195 | /** | ||
196 | * led_get_flash_fault - get the flash LED fault | ||
197 | * @fled_cdev: the flash LED to query | ||
198 | * @fault: bitmask containing flash faults | ||
199 | * | ||
200 | * Get the flash LED fault. | ||
201 | * | ||
202 | * Returns: 0 on success or negative error value on failure | ||
203 | */ | ||
204 | extern int led_get_flash_fault(struct led_classdev_flash *fled_cdev, | ||
205 | u32 *fault); | ||
206 | |||
207 | #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */ | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index cfceef32c9b3..f70f84f35674 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -46,6 +46,8 @@ struct led_classdev { | |||
46 | #define LED_SYSFS_DISABLE (1 << 20) | 46 | #define LED_SYSFS_DISABLE (1 << 20) |
47 | #define SET_BRIGHTNESS_ASYNC (1 << 21) | 47 | #define SET_BRIGHTNESS_ASYNC (1 << 21) |
48 | #define SET_BRIGHTNESS_SYNC (1 << 22) | 48 | #define SET_BRIGHTNESS_SYNC (1 << 22) |
49 | #define LED_DEV_CAP_FLASH (1 << 23) | ||
50 | #define LED_DEV_CAP_SYNC_STROBE (1 << 24) | ||
49 | 51 | ||
50 | /* Set LED brightness level */ | 52 | /* Set LED brightness level */ |
51 | /* Must not sleep, use a workqueue if needed */ | 53 | /* Must not sleep, use a workqueue if needed */ |
@@ -81,6 +83,7 @@ struct led_classdev { | |||
81 | unsigned long blink_delay_on, blink_delay_off; | 83 | unsigned long blink_delay_on, blink_delay_off; |
82 | struct timer_list blink_timer; | 84 | struct timer_list blink_timer; |
83 | int blink_brightness; | 85 | int blink_brightness; |
86 | void (*flash_resume)(struct led_classdev *led_cdev); | ||
84 | 87 | ||
85 | struct work_struct set_brightness_work; | 88 | struct work_struct set_brightness_work; |
86 | int delayed_set_value; | 89 | int delayed_set_value; |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index 495203ff221c..acd5b12565cc 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -8,52 +8,13 @@ | |||
8 | * | 8 | * |
9 | * The Guest needs devices to do anything useful. Since we don't let it touch | 9 | * The Guest needs devices to do anything useful. Since we don't let it touch |
10 | * real devices (think of the damage it could do!) we provide virtual devices. | 10 | * real devices (think of the damage it could do!) we provide virtual devices. |
11 | * We could emulate a PCI bus with various devices on it, but that is a fairly | 11 | * We emulate a PCI bus with virtio devices on it; we used to have our own |
12 | * complex burden for the Host and suboptimal for the Guest, so we have our own | 12 | * lguest bus which was far simpler, but this tests the virtio 1.0 standard. |
13 | * simple lguest bus and we use "virtio" drivers. These drivers need a set of | ||
14 | * routines from us which will actually do the virtual I/O, but they handle all | ||
15 | * the net/block/console stuff themselves. This means that if we want to add | ||
16 | * a new device, we simply need to write a new virtio driver and create support | ||
17 | * for it in the Launcher: this code won't need to change. | ||
18 | * | 13 | * |
19 | * Virtio devices are also used by kvm, so we can simply reuse their optimized | 14 | * Virtio devices are also used by kvm, so we can simply reuse their optimized |
20 | * device drivers. And one day when everyone uses virtio, my plan will be | 15 | * device drivers. And one day when everyone uses virtio, my plan will be |
21 | * complete. Bwahahahah! | 16 | * complete. Bwahahahah! |
22 | * | ||
23 | * Devices are described by a simplified ID, a status byte, and some "config" | ||
24 | * bytes which describe this device's configuration. This is placed by the | ||
25 | * Launcher just above the top of physical memory: | ||
26 | */ | ||
27 | struct lguest_device_desc { | ||
28 | /* The device type: console, network, disk etc. Type 0 terminates. */ | ||
29 | __u8 type; | ||
30 | /* The number of virtqueues (first in config array) */ | ||
31 | __u8 num_vq; | ||
32 | /* | ||
33 | * The number of bytes of feature bits. Multiply by 2: one for host | ||
34 | * features and one for Guest acknowledgements. | ||
35 | */ | ||
36 | __u8 feature_len; | ||
37 | /* The number of bytes of the config array after virtqueues. */ | ||
38 | __u8 config_len; | ||
39 | /* A status byte, written by the Guest. */ | ||
40 | __u8 status; | ||
41 | __u8 config[0]; | ||
42 | }; | ||
43 | |||
44 | /*D:135 | ||
45 | * This is how we expect the device configuration field for a virtqueue | ||
46 | * to be laid out in config space. | ||
47 | */ | 17 | */ |
48 | struct lguest_vqconfig { | ||
49 | /* The number of entries in the virtio_ring */ | ||
50 | __u16 num; | ||
51 | /* The interrupt we get when something happens. */ | ||
52 | __u16 irq; | ||
53 | /* The page number of the virtio ring for this device. */ | ||
54 | __u32 pfn; | ||
55 | }; | ||
56 | /*:*/ | ||
57 | 18 | ||
58 | /* Write command first word is a request. */ | 19 | /* Write command first word is a request. */ |
59 | enum lguest_req | 20 | enum lguest_req |
@@ -62,12 +23,22 @@ enum lguest_req | |||
62 | LHREQ_GETDMA, /* No longer used */ | 23 | LHREQ_GETDMA, /* No longer used */ |
63 | LHREQ_IRQ, /* + irq */ | 24 | LHREQ_IRQ, /* + irq */ |
64 | LHREQ_BREAK, /* No longer used */ | 25 | LHREQ_BREAK, /* No longer used */ |
65 | LHREQ_EVENTFD, /* + address, fd. */ | 26 | LHREQ_EVENTFD, /* No longer used. */ |
27 | LHREQ_GETREG, /* + offset within struct pt_regs (then read value). */ | ||
28 | LHREQ_SETREG, /* + offset within struct pt_regs, value. */ | ||
29 | LHREQ_TRAP, /* + trap number to deliver to guest. */ | ||
66 | }; | 30 | }; |
67 | 31 | ||
68 | /* | 32 | /* |
69 | * The alignment to use between consumer and producer parts of vring. | 33 | * This is what read() of the lguest fd populates. trap == |
70 | * x86 pagesize for historical reasons. | 34 | * LGUEST_TRAP_ENTRY for an LHCALL_NOTIFY (addr is the |
35 | * argument), 14 for a page fault in the MMIO region (addr is | ||
36 | * the trap address, insn is the instruction), or 13 for a GPF | ||
37 | * (insn is the instruction). | ||
71 | */ | 38 | */ |
72 | #define LGUEST_VRING_ALIGN 4096 | 39 | struct lguest_pending { |
40 | __u8 trap; | ||
41 | __u8 insn[7]; | ||
42 | __u32 addr; | ||
43 | }; | ||
73 | #endif /* _LINUX_LGUEST_LAUNCHER */ | 44 | #endif /* _LINUX_LGUEST_LAUNCHER */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 91f705de2c0b..fc03efa64ffe 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -823,10 +823,10 @@ struct ata_port { | |||
823 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 823 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
824 | 824 | ||
825 | struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; | 825 | struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; |
826 | unsigned long qc_allocated; | 826 | unsigned long sas_tag_allocated; /* for sas tag allocation only */ |
827 | unsigned int qc_active; | 827 | unsigned int qc_active; |
828 | int nr_active_links; /* #links with active qcs */ | 828 | int nr_active_links; /* #links with active qcs */ |
829 | unsigned int last_tag; /* track next tag hw expects */ | 829 | unsigned int sas_last_tag; /* track next tag hw expects */ |
830 | 830 | ||
831 | struct ata_link link; /* host default link */ | 831 | struct ata_link link; /* host default link */ |
832 | struct ata_link *slave_link; /* see ata_slave_link_init() */ | 832 | struct ata_link *slave_link; /* see ata_slave_link_init() */ |
@@ -1340,12 +1340,19 @@ extern const struct ata_port_operations ata_base_port_ops; | |||
1340 | extern const struct ata_port_operations sata_port_ops; | 1340 | extern const struct ata_port_operations sata_port_ops; |
1341 | extern struct device_attribute *ata_common_sdev_attrs[]; | 1341 | extern struct device_attribute *ata_common_sdev_attrs[]; |
1342 | 1342 | ||
1343 | /* | ||
1344 | * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated | ||
1345 | * by the edge drivers. Because the 'module' field of sht must be the | ||
1346 | * edge driver's module reference, otherwise the driver can be unloaded | ||
1347 | * even if the scsi_device is being accessed. | ||
1348 | */ | ||
1343 | #define ATA_BASE_SHT(drv_name) \ | 1349 | #define ATA_BASE_SHT(drv_name) \ |
1344 | .module = THIS_MODULE, \ | 1350 | .module = THIS_MODULE, \ |
1345 | .name = drv_name, \ | 1351 | .name = drv_name, \ |
1346 | .ioctl = ata_scsi_ioctl, \ | 1352 | .ioctl = ata_scsi_ioctl, \ |
1347 | .queuecommand = ata_scsi_queuecmd, \ | 1353 | .queuecommand = ata_scsi_queuecmd, \ |
1348 | .can_queue = ATA_DEF_QUEUE, \ | 1354 | .can_queue = ATA_DEF_QUEUE, \ |
1355 | .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ | ||
1349 | .this_id = ATA_SHT_THIS_ID, \ | 1356 | .this_id = ATA_SHT_THIS_ID, \ |
1350 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, \ | 1357 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, \ |
1351 | .emulated = ATA_SHT_EMULATED, \ | 1358 | .emulated = ATA_SHT_EMULATED, \ |
diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index f3434533fbf8..2a6b9947aaa3 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h | |||
@@ -9,6 +9,9 @@ | |||
9 | 9 | ||
10 | #include <linux/list.h> | 10 | #include <linux/list.h> |
11 | #include <linux/nodemask.h> | 11 | #include <linux/nodemask.h> |
12 | #include <linux/shrinker.h> | ||
13 | |||
14 | struct mem_cgroup; | ||
12 | 15 | ||
13 | /* list_lru_walk_cb has to always return one of those */ | 16 | /* list_lru_walk_cb has to always return one of those */ |
14 | enum lru_status { | 17 | enum lru_status { |
@@ -21,24 +24,45 @@ enum lru_status { | |||
21 | internally, but has to return locked. */ | 24 | internally, but has to return locked. */ |
22 | }; | 25 | }; |
23 | 26 | ||
24 | struct list_lru_node { | 27 | struct list_lru_one { |
25 | spinlock_t lock; | ||
26 | struct list_head list; | 28 | struct list_head list; |
27 | /* kept as signed so we can catch imbalance bugs */ | 29 | /* may become negative during memcg reparenting */ |
28 | long nr_items; | 30 | long nr_items; |
31 | }; | ||
32 | |||
33 | struct list_lru_memcg { | ||
34 | /* array of per cgroup lists, indexed by memcg_cache_id */ | ||
35 | struct list_lru_one *lru[0]; | ||
36 | }; | ||
37 | |||
38 | struct list_lru_node { | ||
39 | /* protects all lists on the node, including per cgroup */ | ||
40 | spinlock_t lock; | ||
41 | /* global list, used for the root cgroup in cgroup aware lrus */ | ||
42 | struct list_lru_one lru; | ||
43 | #ifdef CONFIG_MEMCG_KMEM | ||
44 | /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ | ||
45 | struct list_lru_memcg *memcg_lrus; | ||
46 | #endif | ||
29 | } ____cacheline_aligned_in_smp; | 47 | } ____cacheline_aligned_in_smp; |
30 | 48 | ||
31 | struct list_lru { | 49 | struct list_lru { |
32 | struct list_lru_node *node; | 50 | struct list_lru_node *node; |
33 | nodemask_t active_nodes; | 51 | #ifdef CONFIG_MEMCG_KMEM |
52 | struct list_head list; | ||
53 | #endif | ||
34 | }; | 54 | }; |
35 | 55 | ||
36 | void list_lru_destroy(struct list_lru *lru); | 56 | void list_lru_destroy(struct list_lru *lru); |
37 | int list_lru_init_key(struct list_lru *lru, struct lock_class_key *key); | 57 | int __list_lru_init(struct list_lru *lru, bool memcg_aware, |
38 | static inline int list_lru_init(struct list_lru *lru) | 58 | struct lock_class_key *key); |
39 | { | 59 | |
40 | return list_lru_init_key(lru, NULL); | 60 | #define list_lru_init(lru) __list_lru_init((lru), false, NULL) |
41 | } | 61 | #define list_lru_init_key(lru, key) __list_lru_init((lru), false, (key)) |
62 | #define list_lru_init_memcg(lru) __list_lru_init((lru), true, NULL) | ||
63 | |||
64 | int memcg_update_all_list_lrus(int num_memcgs); | ||
65 | void memcg_drain_all_list_lrus(int src_idx, int dst_idx); | ||
42 | 66 | ||
43 | /** | 67 | /** |
44 | * list_lru_add: add an element to the lru list's tail | 68 | * list_lru_add: add an element to the lru list's tail |
@@ -72,32 +96,48 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item); | |||
72 | bool list_lru_del(struct list_lru *lru, struct list_head *item); | 96 | bool list_lru_del(struct list_lru *lru, struct list_head *item); |
73 | 97 | ||
74 | /** | 98 | /** |
75 | * list_lru_count_node: return the number of objects currently held by @lru | 99 | * list_lru_count_one: return the number of objects currently held by @lru |
76 | * @lru: the lru pointer. | 100 | * @lru: the lru pointer. |
77 | * @nid: the node id to count from. | 101 | * @nid: the node id to count from. |
102 | * @memcg: the cgroup to count from. | ||
78 | * | 103 | * |
79 | * Always return a non-negative number, 0 for empty lists. There is no | 104 | * Always return a non-negative number, 0 for empty lists. There is no |
80 | * guarantee that the list is not updated while the count is being computed. | 105 | * guarantee that the list is not updated while the count is being computed. |
81 | * Callers that want such a guarantee need to provide an outer lock. | 106 | * Callers that want such a guarantee need to provide an outer lock. |
82 | */ | 107 | */ |
108 | unsigned long list_lru_count_one(struct list_lru *lru, | ||
109 | int nid, struct mem_cgroup *memcg); | ||
83 | unsigned long list_lru_count_node(struct list_lru *lru, int nid); | 110 | unsigned long list_lru_count_node(struct list_lru *lru, int nid); |
111 | |||
112 | static inline unsigned long list_lru_shrink_count(struct list_lru *lru, | ||
113 | struct shrink_control *sc) | ||
114 | { | ||
115 | return list_lru_count_one(lru, sc->nid, sc->memcg); | ||
116 | } | ||
117 | |||
84 | static inline unsigned long list_lru_count(struct list_lru *lru) | 118 | static inline unsigned long list_lru_count(struct list_lru *lru) |
85 | { | 119 | { |
86 | long count = 0; | 120 | long count = 0; |
87 | int nid; | 121 | int nid; |
88 | 122 | ||
89 | for_each_node_mask(nid, lru->active_nodes) | 123 | for_each_node_state(nid, N_NORMAL_MEMORY) |
90 | count += list_lru_count_node(lru, nid); | 124 | count += list_lru_count_node(lru, nid); |
91 | 125 | ||
92 | return count; | 126 | return count; |
93 | } | 127 | } |
94 | 128 | ||
95 | typedef enum lru_status | 129 | void list_lru_isolate(struct list_lru_one *list, struct list_head *item); |
96 | (*list_lru_walk_cb)(struct list_head *item, spinlock_t *lock, void *cb_arg); | 130 | void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item, |
131 | struct list_head *head); | ||
132 | |||
133 | typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item, | ||
134 | struct list_lru_one *list, spinlock_t *lock, void *cb_arg); | ||
135 | |||
97 | /** | 136 | /** |
98 | * list_lru_walk_node: walk a list_lru, isolating and disposing freeable items. | 137 | * list_lru_walk_one: walk a list_lru, isolating and disposing freeable items. |
99 | * @lru: the lru pointer. | 138 | * @lru: the lru pointer. |
100 | * @nid: the node id to scan from. | 139 | * @nid: the node id to scan from. |
140 | * @memcg: the cgroup to scan from. | ||
101 | * @isolate: callback function that is resposible for deciding what to do with | 141 | * @isolate: callback function that is resposible for deciding what to do with |
102 | * the item currently being scanned | 142 | * the item currently being scanned |
103 | * @cb_arg: opaque type that will be passed to @isolate | 143 | * @cb_arg: opaque type that will be passed to @isolate |
@@ -115,18 +155,30 @@ typedef enum lru_status | |||
115 | * | 155 | * |
116 | * Return value: the number of objects effectively removed from the LRU. | 156 | * Return value: the number of objects effectively removed from the LRU. |
117 | */ | 157 | */ |
158 | unsigned long list_lru_walk_one(struct list_lru *lru, | ||
159 | int nid, struct mem_cgroup *memcg, | ||
160 | list_lru_walk_cb isolate, void *cb_arg, | ||
161 | unsigned long *nr_to_walk); | ||
118 | unsigned long list_lru_walk_node(struct list_lru *lru, int nid, | 162 | unsigned long list_lru_walk_node(struct list_lru *lru, int nid, |
119 | list_lru_walk_cb isolate, void *cb_arg, | 163 | list_lru_walk_cb isolate, void *cb_arg, |
120 | unsigned long *nr_to_walk); | 164 | unsigned long *nr_to_walk); |
121 | 165 | ||
122 | static inline unsigned long | 166 | static inline unsigned long |
167 | list_lru_shrink_walk(struct list_lru *lru, struct shrink_control *sc, | ||
168 | list_lru_walk_cb isolate, void *cb_arg) | ||
169 | { | ||
170 | return list_lru_walk_one(lru, sc->nid, sc->memcg, isolate, cb_arg, | ||
171 | &sc->nr_to_scan); | ||
172 | } | ||
173 | |||
174 | static inline unsigned long | ||
123 | list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate, | 175 | list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate, |
124 | void *cb_arg, unsigned long nr_to_walk) | 176 | void *cb_arg, unsigned long nr_to_walk) |
125 | { | 177 | { |
126 | long isolated = 0; | 178 | long isolated = 0; |
127 | int nid; | 179 | int nid; |
128 | 180 | ||
129 | for_each_node_mask(nid, lru->active_nodes) { | 181 | for_each_node_state(nid, N_NORMAL_MEMORY) { |
130 | isolated += list_lru_walk_node(lru, nid, isolate, | 182 | isolated += list_lru_walk_node(lru, nid, isolate, |
131 | cb_arg, &nr_to_walk); | 183 | cb_arg, &nr_to_walk); |
132 | if (nr_to_walk <= 0) | 184 | if (nr_to_walk <= 0) |
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 5d10ae364b5e..f266661d2666 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef _LINUX_LIST_NULLS_H | 1 | #ifndef _LINUX_LIST_NULLS_H |
2 | #define _LINUX_LIST_NULLS_H | 2 | #define _LINUX_LIST_NULLS_H |
3 | 3 | ||
4 | #include <linux/poison.h> | ||
5 | #include <linux/const.h> | ||
6 | |||
4 | /* | 7 | /* |
5 | * Special version of lists, where end of list is not a NULL pointer, | 8 | * Special version of lists, where end of list is not a NULL pointer, |
6 | * but a 'nulls' marker, which can have many different values. | 9 | * but a 'nulls' marker, which can have many different values. |
@@ -21,8 +24,9 @@ struct hlist_nulls_head { | |||
21 | struct hlist_nulls_node { | 24 | struct hlist_nulls_node { |
22 | struct hlist_nulls_node *next, **pprev; | 25 | struct hlist_nulls_node *next, **pprev; |
23 | }; | 26 | }; |
27 | #define NULLS_MARKER(value) (1UL | (((long)value) << 1)) | ||
24 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ | 28 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ |
25 | ((ptr)->first = (struct hlist_nulls_node *) (1UL | (((long)nulls) << 1))) | 29 | ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls)) |
26 | 30 | ||
27 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) | 31 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) |
28 | /** | 32 | /** |
diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h new file mode 100644 index 000000000000..95023fd8b00d --- /dev/null +++ b/include/linux/livepatch.h | |||
@@ -0,0 +1,133 @@ | |||
1 | /* | ||
2 | * livepatch.h - Kernel Live Patching Core | ||
3 | * | ||
4 | * Copyright (C) 2014 Seth Jennings <sjenning@redhat.com> | ||
5 | * Copyright (C) 2014 SUSE | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #ifndef _LINUX_LIVEPATCH_H_ | ||
22 | #define _LINUX_LIVEPATCH_H_ | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | #include <linux/ftrace.h> | ||
26 | |||
27 | #if IS_ENABLED(CONFIG_LIVEPATCH) | ||
28 | |||
29 | #include <asm/livepatch.h> | ||
30 | |||
31 | enum klp_state { | ||
32 | KLP_DISABLED, | ||
33 | KLP_ENABLED | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * struct klp_func - function structure for live patching | ||
38 | * @old_name: name of the function to be patched | ||
39 | * @new_func: pointer to the patched function code | ||
40 | * @old_addr: a hint conveying at what address the old function | ||
41 | * can be found (optional, vmlinux patches only) | ||
42 | * @kobj: kobject for sysfs resources | ||
43 | * @state: tracks function-level patch application state | ||
44 | * @stack_node: list node for klp_ops func_stack list | ||
45 | */ | ||
46 | struct klp_func { | ||
47 | /* external */ | ||
48 | const char *old_name; | ||
49 | void *new_func; | ||
50 | /* | ||
51 | * The old_addr field is optional and can be used to resolve | ||
52 | * duplicate symbol names in the vmlinux object. If this | ||
53 | * information is not present, the symbol is located by name | ||
54 | * with kallsyms. If the name is not unique and old_addr is | ||
55 | * not provided, the patch application fails as there is no | ||
56 | * way to resolve the ambiguity. | ||
57 | */ | ||
58 | unsigned long old_addr; | ||
59 | |||
60 | /* internal */ | ||
61 | struct kobject kobj; | ||
62 | enum klp_state state; | ||
63 | struct list_head stack_node; | ||
64 | }; | ||
65 | |||
66 | /** | ||
67 | * struct klp_reloc - relocation structure for live patching | ||
68 | * @loc: address where the relocation will be written | ||
69 | * @val: address of the referenced symbol (optional, | ||
70 | * vmlinux patches only) | ||
71 | * @type: ELF relocation type | ||
72 | * @name: name of the referenced symbol (for lookup/verification) | ||
73 | * @addend: offset from the referenced symbol | ||
74 | * @external: symbol is either exported or within the live patch module itself | ||
75 | */ | ||
76 | struct klp_reloc { | ||
77 | unsigned long loc; | ||
78 | unsigned long val; | ||
79 | unsigned long type; | ||
80 | const char *name; | ||
81 | int addend; | ||
82 | int external; | ||
83 | }; | ||
84 | |||
85 | /** | ||
86 | * struct klp_object - kernel object structure for live patching | ||
87 | * @name: module name (or NULL for vmlinux) | ||
88 | * @relocs: relocation entries to be applied at load time | ||
89 | * @funcs: function entries for functions to be patched in the object | ||
90 | * @kobj: kobject for sysfs resources | ||
91 | * @mod: kernel module associated with the patched object | ||
92 | * (NULL for vmlinux) | ||
93 | * @state: tracks object-level patch application state | ||
94 | */ | ||
95 | struct klp_object { | ||
96 | /* external */ | ||
97 | const char *name; | ||
98 | struct klp_reloc *relocs; | ||
99 | struct klp_func *funcs; | ||
100 | |||
101 | /* internal */ | ||
102 | struct kobject *kobj; | ||
103 | struct module *mod; | ||
104 | enum klp_state state; | ||
105 | }; | ||
106 | |||
107 | /** | ||
108 | * struct klp_patch - patch structure for live patching | ||
109 | * @mod: reference to the live patch module | ||
110 | * @objs: object entries for kernel objects to be patched | ||
111 | * @list: list node for global list of registered patches | ||
112 | * @kobj: kobject for sysfs resources | ||
113 | * @state: tracks patch-level application state | ||
114 | */ | ||
115 | struct klp_patch { | ||
116 | /* external */ | ||
117 | struct module *mod; | ||
118 | struct klp_object *objs; | ||
119 | |||
120 | /* internal */ | ||
121 | struct list_head list; | ||
122 | struct kobject kobj; | ||
123 | enum klp_state state; | ||
124 | }; | ||
125 | |||
126 | extern int klp_register_patch(struct klp_patch *); | ||
127 | extern int klp_unregister_patch(struct klp_patch *); | ||
128 | extern int klp_enable_patch(struct klp_patch *); | ||
129 | extern int klp_disable_patch(struct klp_patch *); | ||
130 | |||
131 | #endif /* CONFIG_LIVEPATCH */ | ||
132 | |||
133 | #endif /* _LINUX_LIVEPATCH_H_ */ | ||
diff --git a/include/linux/lockref.h b/include/linux/lockref.h index 4bfde0e99ed5..b10b122dd099 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h | |||
@@ -28,12 +28,13 @@ struct lockref { | |||
28 | #endif | 28 | #endif |
29 | struct { | 29 | struct { |
30 | spinlock_t lock; | 30 | spinlock_t lock; |
31 | unsigned int count; | 31 | int count; |
32 | }; | 32 | }; |
33 | }; | 33 | }; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | extern void lockref_get(struct lockref *); | 36 | extern void lockref_get(struct lockref *); |
37 | extern int lockref_put_return(struct lockref *); | ||
37 | extern int lockref_get_not_zero(struct lockref *); | 38 | extern int lockref_get_not_zero(struct lockref *); |
38 | extern int lockref_get_or_lock(struct lockref *); | 39 | extern int lockref_get_or_lock(struct lockref *); |
39 | extern int lockref_put_or_lock(struct lockref *); | 40 | extern int lockref_put_or_lock(struct lockref *); |
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h index 164aad1f9f12..0819d36a3a74 100644 --- a/include/linux/mei_cl_bus.h +++ b/include/linux/mei_cl_bus.h | |||
@@ -25,8 +25,8 @@ int __mei_cl_driver_register(struct mei_cl_driver *driver, | |||
25 | 25 | ||
26 | void mei_cl_driver_unregister(struct mei_cl_driver *driver); | 26 | void mei_cl_driver_unregister(struct mei_cl_driver *driver); |
27 | 27 | ||
28 | int mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); | 28 | ssize_t mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); |
29 | int mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); | 29 | ssize_t mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); |
30 | 30 | ||
31 | typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, | 31 | typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, |
32 | u32 events, void *context); | 32 | u32 events, void *context); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7c95af8d552c..72dff5fb0d0c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -52,7 +52,27 @@ struct mem_cgroup_reclaim_cookie { | |||
52 | unsigned int generation; | 52 | unsigned int generation; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | enum mem_cgroup_events_index { | ||
56 | MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */ | ||
57 | MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */ | ||
58 | MEM_CGROUP_EVENTS_PGFAULT, /* # of page-faults */ | ||
59 | MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */ | ||
60 | MEM_CGROUP_EVENTS_NSTATS, | ||
61 | /* default hierarchy events */ | ||
62 | MEMCG_LOW = MEM_CGROUP_EVENTS_NSTATS, | ||
63 | MEMCG_HIGH, | ||
64 | MEMCG_MAX, | ||
65 | MEMCG_OOM, | ||
66 | MEMCG_NR_EVENTS, | ||
67 | }; | ||
68 | |||
55 | #ifdef CONFIG_MEMCG | 69 | #ifdef CONFIG_MEMCG |
70 | void mem_cgroup_events(struct mem_cgroup *memcg, | ||
71 | enum mem_cgroup_events_index idx, | ||
72 | unsigned int nr); | ||
73 | |||
74 | bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg); | ||
75 | |||
56 | int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, | 76 | int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, |
57 | gfp_t gfp_mask, struct mem_cgroup **memcgp); | 77 | gfp_t gfp_mask, struct mem_cgroup **memcgp); |
58 | void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, | 78 | void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, |
@@ -102,6 +122,7 @@ void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | |||
102 | * For memory reclaim. | 122 | * For memory reclaim. |
103 | */ | 123 | */ |
104 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); | 124 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); |
125 | bool mem_cgroup_lruvec_online(struct lruvec *lruvec); | ||
105 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 126 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
106 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); | 127 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); |
107 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); | 128 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); |
@@ -138,12 +159,10 @@ static inline bool mem_cgroup_disabled(void) | |||
138 | return false; | 159 | return false; |
139 | } | 160 | } |
140 | 161 | ||
141 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, bool *locked, | 162 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page); |
142 | unsigned long *flags); | ||
143 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, bool *locked, | ||
144 | unsigned long *flags); | ||
145 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, | 163 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, |
146 | enum mem_cgroup_stat_index idx, int val); | 164 | enum mem_cgroup_stat_index idx, int val); |
165 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg); | ||
147 | 166 | ||
148 | static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg, | 167 | static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg, |
149 | enum mem_cgroup_stat_index idx) | 168 | enum mem_cgroup_stat_index idx) |
@@ -176,6 +195,18 @@ void mem_cgroup_split_huge_fixup(struct page *head); | |||
176 | #else /* CONFIG_MEMCG */ | 195 | #else /* CONFIG_MEMCG */ |
177 | struct mem_cgroup; | 196 | struct mem_cgroup; |
178 | 197 | ||
198 | static inline void mem_cgroup_events(struct mem_cgroup *memcg, | ||
199 | enum mem_cgroup_events_index idx, | ||
200 | unsigned int nr) | ||
201 | { | ||
202 | } | ||
203 | |||
204 | static inline bool mem_cgroup_low(struct mem_cgroup *root, | ||
205 | struct mem_cgroup *memcg) | ||
206 | { | ||
207 | return false; | ||
208 | } | ||
209 | |||
179 | static inline int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, | 210 | static inline int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, |
180 | gfp_t gfp_mask, | 211 | gfp_t gfp_mask, |
181 | struct mem_cgroup **memcgp) | 212 | struct mem_cgroup **memcgp) |
@@ -268,6 +299,11 @@ mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec) | |||
268 | return 1; | 299 | return 1; |
269 | } | 300 | } |
270 | 301 | ||
302 | static inline bool mem_cgroup_lruvec_online(struct lruvec *lruvec) | ||
303 | { | ||
304 | return true; | ||
305 | } | ||
306 | |||
271 | static inline unsigned long | 307 | static inline unsigned long |
272 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) | 308 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
273 | { | 309 | { |
@@ -285,14 +321,12 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
285 | { | 321 | { |
286 | } | 322 | } |
287 | 323 | ||
288 | static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, | 324 | static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page) |
289 | bool *locked, unsigned long *flags) | ||
290 | { | 325 | { |
291 | return NULL; | 326 | return NULL; |
292 | } | 327 | } |
293 | 328 | ||
294 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, | 329 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg) |
295 | bool *locked, unsigned long *flags) | ||
296 | { | 330 | { |
297 | } | 331 | } |
298 | 332 | ||
@@ -364,7 +398,9 @@ static inline void sock_release_memcg(struct sock *sk) | |||
364 | #ifdef CONFIG_MEMCG_KMEM | 398 | #ifdef CONFIG_MEMCG_KMEM |
365 | extern struct static_key memcg_kmem_enabled_key; | 399 | extern struct static_key memcg_kmem_enabled_key; |
366 | 400 | ||
367 | extern int memcg_limited_groups_array_size; | 401 | extern int memcg_nr_cache_ids; |
402 | extern void memcg_get_cache_ids(void); | ||
403 | extern void memcg_put_cache_ids(void); | ||
368 | 404 | ||
369 | /* | 405 | /* |
370 | * Helper macro to loop through all memcg-specific caches. Callers must still | 406 | * Helper macro to loop through all memcg-specific caches. Callers must still |
@@ -372,13 +408,15 @@ extern int memcg_limited_groups_array_size; | |||
372 | * the slab_mutex must be held when looping through those caches | 408 | * the slab_mutex must be held when looping through those caches |
373 | */ | 409 | */ |
374 | #define for_each_memcg_cache_index(_idx) \ | 410 | #define for_each_memcg_cache_index(_idx) \ |
375 | for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++) | 411 | for ((_idx) = 0; (_idx) < memcg_nr_cache_ids; (_idx)++) |
376 | 412 | ||
377 | static inline bool memcg_kmem_enabled(void) | 413 | static inline bool memcg_kmem_enabled(void) |
378 | { | 414 | { |
379 | return static_key_false(&memcg_kmem_enabled_key); | 415 | return static_key_false(&memcg_kmem_enabled_key); |
380 | } | 416 | } |
381 | 417 | ||
418 | bool memcg_kmem_is_active(struct mem_cgroup *memcg); | ||
419 | |||
382 | /* | 420 | /* |
383 | * In general, we'll do everything in our power to not incur in any overhead | 421 | * In general, we'll do everything in our power to not incur in any overhead |
384 | * for non-memcg users for the kmem functions. Not even a function call, if we | 422 | * for non-memcg users for the kmem functions. Not even a function call, if we |
@@ -398,15 +436,14 @@ void __memcg_kmem_uncharge_pages(struct page *page, int order); | |||
398 | 436 | ||
399 | int memcg_cache_id(struct mem_cgroup *memcg); | 437 | int memcg_cache_id(struct mem_cgroup *memcg); |
400 | 438 | ||
401 | void memcg_update_array_size(int num_groups); | ||
402 | |||
403 | struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep); | 439 | struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep); |
404 | void __memcg_kmem_put_cache(struct kmem_cache *cachep); | 440 | void __memcg_kmem_put_cache(struct kmem_cache *cachep); |
405 | 441 | ||
406 | int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order); | 442 | struct mem_cgroup *__mem_cgroup_from_kmem(void *ptr); |
407 | void __memcg_uncharge_slab(struct kmem_cache *cachep, int order); | ||
408 | 443 | ||
409 | int __memcg_cleanup_cache_params(struct kmem_cache *s); | 444 | int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, |
445 | unsigned long nr_pages); | ||
446 | void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages); | ||
410 | 447 | ||
411 | /** | 448 | /** |
412 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. | 449 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. |
@@ -500,6 +537,13 @@ static __always_inline void memcg_kmem_put_cache(struct kmem_cache *cachep) | |||
500 | if (memcg_kmem_enabled()) | 537 | if (memcg_kmem_enabled()) |
501 | __memcg_kmem_put_cache(cachep); | 538 | __memcg_kmem_put_cache(cachep); |
502 | } | 539 | } |
540 | |||
541 | static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr) | ||
542 | { | ||
543 | if (!memcg_kmem_enabled()) | ||
544 | return NULL; | ||
545 | return __mem_cgroup_from_kmem(ptr); | ||
546 | } | ||
503 | #else | 547 | #else |
504 | #define for_each_memcg_cache_index(_idx) \ | 548 | #define for_each_memcg_cache_index(_idx) \ |
505 | for (; NULL; ) | 549 | for (; NULL; ) |
@@ -509,6 +553,11 @@ static inline bool memcg_kmem_enabled(void) | |||
509 | return false; | 553 | return false; |
510 | } | 554 | } |
511 | 555 | ||
556 | static inline bool memcg_kmem_is_active(struct mem_cgroup *memcg) | ||
557 | { | ||
558 | return false; | ||
559 | } | ||
560 | |||
512 | static inline bool | 561 | static inline bool |
513 | memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) | 562 | memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) |
514 | { | 563 | { |
@@ -529,6 +578,14 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg) | |||
529 | return -1; | 578 | return -1; |
530 | } | 579 | } |
531 | 580 | ||
581 | static inline void memcg_get_cache_ids(void) | ||
582 | { | ||
583 | } | ||
584 | |||
585 | static inline void memcg_put_cache_ids(void) | ||
586 | { | ||
587 | } | ||
588 | |||
532 | static inline struct kmem_cache * | 589 | static inline struct kmem_cache * |
533 | memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) | 590 | memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) |
534 | { | 591 | { |
@@ -538,6 +595,11 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) | |||
538 | static inline void memcg_kmem_put_cache(struct kmem_cache *cachep) | 595 | static inline void memcg_kmem_put_cache(struct kmem_cache *cachep) |
539 | { | 596 | { |
540 | } | 597 | } |
598 | |||
599 | static inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr) | ||
600 | { | ||
601 | return NULL; | ||
602 | } | ||
541 | #endif /* CONFIG_MEMCG_KMEM */ | 603 | #endif /* CONFIG_MEMCG_KMEM */ |
542 | #endif /* _LINUX_MEMCONTROL_H */ | 604 | #endif /* _LINUX_MEMCONTROL_H */ |
543 | 605 | ||
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index cc892a8d8d6e..12a5b396921e 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
@@ -461,7 +461,6 @@ struct ab8500_fg; | |||
461 | #ifdef CONFIG_AB8500_BM | 461 | #ifdef CONFIG_AB8500_BM |
462 | extern struct abx500_bm_data ab8500_bm_data; | 462 | extern struct abx500_bm_data ab8500_bm_data; |
463 | 463 | ||
464 | void ab8500_fg_reinit(void); | ||
465 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); | 464 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); |
466 | struct ab8500_btemp *ab8500_btemp_get(void); | 465 | struct ab8500_btemp *ab8500_btemp_get(void); |
467 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); | 466 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); |
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 81589d176ae8..dfabd6db7ddf 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h | |||
@@ -124,10 +124,27 @@ enum { | |||
124 | #define AXP288_PMIC_ADC_H 0x56 | 124 | #define AXP288_PMIC_ADC_H 0x56 |
125 | #define AXP288_PMIC_ADC_L 0x57 | 125 | #define AXP288_PMIC_ADC_L 0x57 |
126 | #define AXP288_ADC_TS_PIN_CTRL 0x84 | 126 | #define AXP288_ADC_TS_PIN_CTRL 0x84 |
127 | |||
128 | #define AXP288_PMIC_ADC_EN 0x84 | 127 | #define AXP288_PMIC_ADC_EN 0x84 |
129 | #define AXP288_FG_TUNE5 0xed | ||
130 | 128 | ||
129 | /* Fuel Gauge */ | ||
130 | #define AXP288_FG_RDC1_REG 0xba | ||
131 | #define AXP288_FG_RDC0_REG 0xbb | ||
132 | #define AXP288_FG_OCVH_REG 0xbc | ||
133 | #define AXP288_FG_OCVL_REG 0xbd | ||
134 | #define AXP288_FG_OCV_CURVE_REG 0xc0 | ||
135 | #define AXP288_FG_DES_CAP1_REG 0xe0 | ||
136 | #define AXP288_FG_DES_CAP0_REG 0xe1 | ||
137 | #define AXP288_FG_CC_MTR1_REG 0xe2 | ||
138 | #define AXP288_FG_CC_MTR0_REG 0xe3 | ||
139 | #define AXP288_FG_OCV_CAP_REG 0xe4 | ||
140 | #define AXP288_FG_CC_CAP_REG 0xe5 | ||
141 | #define AXP288_FG_LOW_CAP_REG 0xe6 | ||
142 | #define AXP288_FG_TUNE0 0xe8 | ||
143 | #define AXP288_FG_TUNE1 0xe9 | ||
144 | #define AXP288_FG_TUNE2 0xea | ||
145 | #define AXP288_FG_TUNE3 0xeb | ||
146 | #define AXP288_FG_TUNE4 0xec | ||
147 | #define AXP288_FG_TUNE5 0xed | ||
131 | 148 | ||
132 | /* Regulators IDs */ | 149 | /* Regulators IDs */ |
133 | enum { | 150 | enum { |
@@ -236,4 +253,26 @@ struct axp20x_dev { | |||
236 | const struct regmap_irq_chip *regmap_irq_chip; | 253 | const struct regmap_irq_chip *regmap_irq_chip; |
237 | }; | 254 | }; |
238 | 255 | ||
256 | #define BATTID_LEN 64 | ||
257 | #define OCV_CURVE_SIZE 32 | ||
258 | #define MAX_THERM_CURVE_SIZE 25 | ||
259 | #define PD_DEF_MIN_TEMP 0 | ||
260 | #define PD_DEF_MAX_TEMP 55 | ||
261 | |||
262 | struct axp20x_fg_pdata { | ||
263 | char battid[BATTID_LEN + 1]; | ||
264 | int design_cap; | ||
265 | int min_volt; | ||
266 | int max_volt; | ||
267 | int max_temp; | ||
268 | int min_temp; | ||
269 | int cap1; | ||
270 | int cap0; | ||
271 | int rdc1; | ||
272 | int rdc0; | ||
273 | int ocv_curve[OCV_CURVE_SIZE]; | ||
274 | int tcsz; | ||
275 | int thermistor_curve[MAX_THERM_CURVE_SIZE][2]; | ||
276 | }; | ||
277 | |||
239 | #endif /* __LINUX_MFD_AXP20X_H */ | 278 | #endif /* __LINUX_MFD_AXP20X_H */ |
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h index b92a3262f8f6..79f4d822ba13 100644 --- a/include/linux/mfd/da9063/core.h +++ b/include/linux/mfd/da9063/core.h | |||
@@ -36,6 +36,7 @@ enum da9063_models { | |||
36 | enum da9063_variant_codes { | 36 | enum da9063_variant_codes { |
37 | PMIC_DA9063_AD = 0x3, | 37 | PMIC_DA9063_AD = 0x3, |
38 | PMIC_DA9063_BB = 0x5, | 38 | PMIC_DA9063_BB = 0x5, |
39 | PMIC_DA9063_CA = 0x6, | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | /* Interrupts */ | 42 | /* Interrupts */ |
diff --git a/include/linux/mfd/da9150/core.h b/include/linux/mfd/da9150/core.h new file mode 100644 index 000000000000..76e668933a77 --- /dev/null +++ b/include/linux/mfd/da9150/core.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * DA9150 MFD Driver - Core Data | ||
3 | * | ||
4 | * Copyright (c) 2014 Dialog Semiconductor | ||
5 | * | ||
6 | * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __DA9150_CORE_H | ||
15 | #define __DA9150_CORE_H | ||
16 | |||
17 | #include <linux/device.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/regmap.h> | ||
20 | |||
21 | /* I2C address paging */ | ||
22 | #define DA9150_REG_PAGE_SHIFT 8 | ||
23 | #define DA9150_REG_PAGE_MASK 0xFF | ||
24 | |||
25 | /* IRQs */ | ||
26 | #define DA9150_NUM_IRQ_REGS 4 | ||
27 | #define DA9150_IRQ_VBUS 0 | ||
28 | #define DA9150_IRQ_CHG 1 | ||
29 | #define DA9150_IRQ_TCLASS 2 | ||
30 | #define DA9150_IRQ_TJUNC 3 | ||
31 | #define DA9150_IRQ_VFAULT 4 | ||
32 | #define DA9150_IRQ_CONF 5 | ||
33 | #define DA9150_IRQ_DAT 6 | ||
34 | #define DA9150_IRQ_DTYPE 7 | ||
35 | #define DA9150_IRQ_ID 8 | ||
36 | #define DA9150_IRQ_ADP 9 | ||
37 | #define DA9150_IRQ_SESS_END 10 | ||
38 | #define DA9150_IRQ_SESS_VLD 11 | ||
39 | #define DA9150_IRQ_FG 12 | ||
40 | #define DA9150_IRQ_GP 13 | ||
41 | #define DA9150_IRQ_TBAT 14 | ||
42 | #define DA9150_IRQ_GPIOA 15 | ||
43 | #define DA9150_IRQ_GPIOB 16 | ||
44 | #define DA9150_IRQ_GPIOC 17 | ||
45 | #define DA9150_IRQ_GPIOD 18 | ||
46 | #define DA9150_IRQ_GPADC 19 | ||
47 | #define DA9150_IRQ_WKUP 20 | ||
48 | |||
49 | struct da9150_pdata { | ||
50 | int irq_base; | ||
51 | }; | ||
52 | |||
53 | struct da9150 { | ||
54 | struct device *dev; | ||
55 | struct regmap *regmap; | ||
56 | struct regmap_irq_chip_data *regmap_irq_data; | ||
57 | int irq; | ||
58 | int irq_base; | ||
59 | }; | ||
60 | |||
61 | /* Device I/O */ | ||
62 | u8 da9150_reg_read(struct da9150 *da9150, u16 reg); | ||
63 | void da9150_reg_write(struct da9150 *da9150, u16 reg, u8 val); | ||
64 | void da9150_set_bits(struct da9150 *da9150, u16 reg, u8 mask, u8 val); | ||
65 | |||
66 | void da9150_bulk_read(struct da9150 *da9150, u16 reg, int count, u8 *buf); | ||
67 | void da9150_bulk_write(struct da9150 *da9150, u16 reg, int count, const u8 *buf); | ||
68 | #endif /* __DA9150_CORE_H */ | ||
diff --git a/include/linux/mfd/da9150/registers.h b/include/linux/mfd/da9150/registers.h new file mode 100644 index 000000000000..27ca6ee4d840 --- /dev/null +++ b/include/linux/mfd/da9150/registers.h | |||
@@ -0,0 +1,1155 @@ | |||
1 | /* | ||
2 | * DA9150 MFD Driver - Registers | ||
3 | * | ||
4 | * Copyright (c) 2014 Dialog Semiconductor | ||
5 | * | ||
6 | * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __DA9150_REGISTERS_H | ||
15 | #define __DA9150_REGISTERS_H | ||
16 | |||
17 | #include <linux/bitops.h> | ||
18 | |||
19 | /* Registers */ | ||
20 | #define DA9150_PAGE_CON 0x000 | ||
21 | #define DA9150_STATUS_A 0x068 | ||
22 | #define DA9150_STATUS_B 0x069 | ||
23 | #define DA9150_STATUS_C 0x06A | ||
24 | #define DA9150_STATUS_D 0x06B | ||
25 | #define DA9150_STATUS_E 0x06C | ||
26 | #define DA9150_STATUS_F 0x06D | ||
27 | #define DA9150_STATUS_G 0x06E | ||
28 | #define DA9150_STATUS_H 0x06F | ||
29 | #define DA9150_STATUS_I 0x070 | ||
30 | #define DA9150_STATUS_J 0x071 | ||
31 | #define DA9150_STATUS_K 0x072 | ||
32 | #define DA9150_STATUS_L 0x073 | ||
33 | #define DA9150_STATUS_N 0x074 | ||
34 | #define DA9150_FAULT_LOG_A 0x076 | ||
35 | #define DA9150_FAULT_LOG_B 0x077 | ||
36 | #define DA9150_EVENT_E 0x078 | ||
37 | #define DA9150_EVENT_F 0x079 | ||
38 | #define DA9150_EVENT_G 0x07A | ||
39 | #define DA9150_EVENT_H 0x07B | ||
40 | #define DA9150_IRQ_MASK_E 0x07C | ||
41 | #define DA9150_IRQ_MASK_F 0x07D | ||
42 | #define DA9150_IRQ_MASK_G 0x07E | ||
43 | #define DA9150_IRQ_MASK_H 0x07F | ||
44 | #define DA9150_PAGE_CON_1 0x080 | ||
45 | #define DA9150_CONFIG_A 0x0E0 | ||
46 | #define DA9150_CONFIG_B 0x0E1 | ||
47 | #define DA9150_CONFIG_C 0x0E2 | ||
48 | #define DA9150_CONFIG_D 0x0E3 | ||
49 | #define DA9150_CONFIG_E 0x0E4 | ||
50 | #define DA9150_CONTROL_A 0x0E5 | ||
51 | #define DA9150_CONTROL_B 0x0E6 | ||
52 | #define DA9150_CONTROL_C 0x0E7 | ||
53 | #define DA9150_GPIO_A_B 0x0E8 | ||
54 | #define DA9150_GPIO_C_D 0x0E9 | ||
55 | #define DA9150_GPIO_MODE_CONT 0x0EA | ||
56 | #define DA9150_GPIO_CTRL_B 0x0EB | ||
57 | #define DA9150_GPIO_CTRL_A 0x0EC | ||
58 | #define DA9150_GPIO_CTRL_C 0x0ED | ||
59 | #define DA9150_GPIO_CFG_A 0x0EE | ||
60 | #define DA9150_GPIO_CFG_B 0x0EF | ||
61 | #define DA9150_GPIO_CFG_C 0x0F0 | ||
62 | #define DA9150_GPADC_MAN 0x0F2 | ||
63 | #define DA9150_GPADC_RES_A 0x0F4 | ||
64 | #define DA9150_GPADC_RES_B 0x0F5 | ||
65 | #define DA9150_PAGE_CON_2 0x100 | ||
66 | #define DA9150_OTP_CONT_SHARED 0x101 | ||
67 | #define DA9150_INTERFACE_SHARED 0x105 | ||
68 | #define DA9150_CONFIG_A_SHARED 0x106 | ||
69 | #define DA9150_CONFIG_D_SHARED 0x109 | ||
70 | #define DA9150_ADETVB_CFG_C 0x150 | ||
71 | #define DA9150_ADETD_STAT 0x151 | ||
72 | #define DA9150_ADET_CMPSTAT 0x152 | ||
73 | #define DA9150_ADET_CTRL_A 0x153 | ||
74 | #define DA9150_ADETVB_CFG_B 0x154 | ||
75 | #define DA9150_ADETVB_CFG_A 0x155 | ||
76 | #define DA9150_ADETAC_CFG_A 0x156 | ||
77 | #define DA9150_ADDETAC_CFG_B 0x157 | ||
78 | #define DA9150_ADETAC_CFG_C 0x158 | ||
79 | #define DA9150_ADETAC_CFG_D 0x159 | ||
80 | #define DA9150_ADETVB_CFG_D 0x15A | ||
81 | #define DA9150_ADETID_CFG_A 0x15B | ||
82 | #define DA9150_ADET_RID_PT_CHG_H 0x15C | ||
83 | #define DA9150_ADET_RID_PT_CHG_L 0x15D | ||
84 | #define DA9150_PPR_TCTR_B 0x160 | ||
85 | #define DA9150_PPR_BKCTRL_A 0x163 | ||
86 | #define DA9150_PPR_BKCFG_A 0x164 | ||
87 | #define DA9150_PPR_BKCFG_B 0x165 | ||
88 | #define DA9150_PPR_CHGCTRL_A 0x166 | ||
89 | #define DA9150_PPR_CHGCTRL_B 0x167 | ||
90 | #define DA9150_PPR_CHGCTRL_C 0x168 | ||
91 | #define DA9150_PPR_TCTR_A 0x169 | ||
92 | #define DA9150_PPR_CHGCTRL_D 0x16A | ||
93 | #define DA9150_PPR_CHGCTRL_E 0x16B | ||
94 | #define DA9150_PPR_CHGCTRL_F 0x16C | ||
95 | #define DA9150_PPR_CHGCTRL_G 0x16D | ||
96 | #define DA9150_PPR_CHGCTRL_H 0x16E | ||
97 | #define DA9150_PPR_CHGCTRL_I 0x16F | ||
98 | #define DA9150_PPR_CHGCTRL_J 0x170 | ||
99 | #define DA9150_PPR_CHGCTRL_K 0x171 | ||
100 | #define DA9150_PPR_CHGCTRL_L 0x172 | ||
101 | #define DA9150_PPR_CHGCTRL_M 0x173 | ||
102 | #define DA9150_PPR_THYST_A 0x174 | ||
103 | #define DA9150_PPR_THYST_B 0x175 | ||
104 | #define DA9150_PPR_THYST_C 0x176 | ||
105 | #define DA9150_PPR_THYST_D 0x177 | ||
106 | #define DA9150_PPR_THYST_E 0x178 | ||
107 | #define DA9150_PPR_THYST_F 0x179 | ||
108 | #define DA9150_PPR_THYST_G 0x17A | ||
109 | #define DA9150_PAGE_CON_3 0x180 | ||
110 | #define DA9150_PAGE_CON_4 0x200 | ||
111 | #define DA9150_PAGE_CON_5 0x280 | ||
112 | #define DA9150_PAGE_CON_6 0x300 | ||
113 | #define DA9150_COREBTLD_STAT_A 0x302 | ||
114 | #define DA9150_COREBTLD_CTRL_A 0x303 | ||
115 | #define DA9150_CORE_CONFIG_A 0x304 | ||
116 | #define DA9150_CORE_CONFIG_C 0x305 | ||
117 | #define DA9150_CORE_CONFIG_B 0x306 | ||
118 | #define DA9150_CORE_CFG_DATA_A 0x307 | ||
119 | #define DA9150_CORE_CFG_DATA_B 0x308 | ||
120 | #define DA9150_CORE_CMD_A 0x309 | ||
121 | #define DA9150_CORE_DATA_A 0x30A | ||
122 | #define DA9150_CORE_DATA_B 0x30B | ||
123 | #define DA9150_CORE_DATA_C 0x30C | ||
124 | #define DA9150_CORE_DATA_D 0x30D | ||
125 | #define DA9150_CORE2WIRE_STAT_A 0x310 | ||
126 | #define DA9150_CORE2WIRE_CTRL_A 0x311 | ||
127 | #define DA9150_FW_CTRL_A 0x312 | ||
128 | #define DA9150_FW_CTRL_C 0x313 | ||
129 | #define DA9150_FW_CTRL_D 0x314 | ||
130 | #define DA9150_FG_CTRL_A 0x315 | ||
131 | #define DA9150_FG_CTRL_B 0x316 | ||
132 | #define DA9150_FW_CTRL_E 0x317 | ||
133 | #define DA9150_FW_CTRL_B 0x318 | ||
134 | #define DA9150_GPADC_CMAN 0x320 | ||
135 | #define DA9150_GPADC_CRES_A 0x322 | ||
136 | #define DA9150_GPADC_CRES_B 0x323 | ||
137 | #define DA9150_CC_CFG_A 0x328 | ||
138 | #define DA9150_CC_CFG_B 0x329 | ||
139 | #define DA9150_CC_ICHG_RES_A 0x32A | ||
140 | #define DA9150_CC_ICHG_RES_B 0x32B | ||
141 | #define DA9150_CC_IAVG_RES_A 0x32C | ||
142 | #define DA9150_CC_IAVG_RES_B 0x32D | ||
143 | #define DA9150_TAUX_CTRL_A 0x330 | ||
144 | #define DA9150_TAUX_RELOAD_H 0x332 | ||
145 | #define DA9150_TAUX_RELOAD_L 0x333 | ||
146 | #define DA9150_TAUX_VALUE_H 0x334 | ||
147 | #define DA9150_TAUX_VALUE_L 0x335 | ||
148 | #define DA9150_AUX_DATA_0 0x338 | ||
149 | #define DA9150_AUX_DATA_1 0x339 | ||
150 | #define DA9150_AUX_DATA_2 0x33A | ||
151 | #define DA9150_AUX_DATA_3 0x33B | ||
152 | #define DA9150_BIF_CTRL 0x340 | ||
153 | #define DA9150_TBAT_CTRL_A 0x342 | ||
154 | #define DA9150_TBAT_CTRL_B 0x343 | ||
155 | #define DA9150_TBAT_RES_A 0x344 | ||
156 | #define DA9150_TBAT_RES_B 0x345 | ||
157 | |||
158 | /* DA9150_PAGE_CON = 0x000 */ | ||
159 | #define DA9150_PAGE_SHIFT 0 | ||
160 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
161 | #define DA9150_I2C_PAGE_SHIFT 1 | ||
162 | #define DA9150_I2C_PAGE_MASK (0x1f << 1) | ||
163 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
164 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
165 | #define DA9150_REVERT_SHIFT 7 | ||
166 | #define DA9150_REVERT_MASK BIT(7) | ||
167 | |||
168 | /* DA9150_STATUS_A = 0x068 */ | ||
169 | #define DA9150_WKUP_STAT_SHIFT 2 | ||
170 | #define DA9150_WKUP_STAT_MASK (0x0f << 2) | ||
171 | #define DA9150_SLEEP_STAT_SHIFT 6 | ||
172 | #define DA9150_SLEEP_STAT_MASK (0x03 << 6) | ||
173 | |||
174 | /* DA9150_STATUS_B = 0x069 */ | ||
175 | #define DA9150_VFAULT_STAT_SHIFT 0 | ||
176 | #define DA9150_VFAULT_STAT_MASK BIT(0) | ||
177 | #define DA9150_TFAULT_STAT_SHIFT 1 | ||
178 | #define DA9150_TFAULT_STAT_MASK BIT(1) | ||
179 | |||
180 | /* DA9150_STATUS_C = 0x06A */ | ||
181 | #define DA9150_VDD33_STAT_SHIFT 0 | ||
182 | #define DA9150_VDD33_STAT_MASK BIT(0) | ||
183 | #define DA9150_VDD33_SLEEP_SHIFT 1 | ||
184 | #define DA9150_VDD33_SLEEP_MASK BIT(1) | ||
185 | #define DA9150_LFOSC_STAT_SHIFT 7 | ||
186 | #define DA9150_LFOSC_STAT_MASK BIT(7) | ||
187 | |||
188 | /* DA9150_STATUS_D = 0x06B */ | ||
189 | #define DA9150_GPIOA_STAT_SHIFT 0 | ||
190 | #define DA9150_GPIOA_STAT_MASK BIT(0) | ||
191 | #define DA9150_GPIOB_STAT_SHIFT 1 | ||
192 | #define DA9150_GPIOB_STAT_MASK BIT(1) | ||
193 | #define DA9150_GPIOC_STAT_SHIFT 2 | ||
194 | #define DA9150_GPIOC_STAT_MASK BIT(2) | ||
195 | #define DA9150_GPIOD_STAT_SHIFT 3 | ||
196 | #define DA9150_GPIOD_STAT_MASK BIT(3) | ||
197 | |||
198 | /* DA9150_STATUS_E = 0x06C */ | ||
199 | #define DA9150_DTYPE_SHIFT 0 | ||
200 | #define DA9150_DTYPE_MASK (0x1f << 0) | ||
201 | #define DA9150_DTYPE_DT_NIL (0x00 << 0) | ||
202 | #define DA9150_DTYPE_DT_USB_OTG BIT(0) | ||
203 | #define DA9150_DTYPE_DT_USB_STD (0x02 << 0) | ||
204 | #define DA9150_DTYPE_DT_USB_CHG (0x03 << 0) | ||
205 | #define DA9150_DTYPE_DT_ACA_CHG (0x04 << 0) | ||
206 | #define DA9150_DTYPE_DT_ACA_OTG (0x05 << 0) | ||
207 | #define DA9150_DTYPE_DT_ACA_DOC (0x06 << 0) | ||
208 | #define DA9150_DTYPE_DT_DED_CHG (0x07 << 0) | ||
209 | #define DA9150_DTYPE_DT_CR5_CHG (0x08 << 0) | ||
210 | #define DA9150_DTYPE_DT_CR4_CHG (0x0c << 0) | ||
211 | #define DA9150_DTYPE_DT_PT_CHG (0x11 << 0) | ||
212 | #define DA9150_DTYPE_DT_NN_ACC (0x16 << 0) | ||
213 | #define DA9150_DTYPE_DT_NN_CHG (0x17 << 0) | ||
214 | |||
215 | /* DA9150_STATUS_F = 0x06D */ | ||
216 | #define DA9150_SESS_VLD_SHIFT 0 | ||
217 | #define DA9150_SESS_VLD_MASK BIT(0) | ||
218 | #define DA9150_ID_ERR_SHIFT 1 | ||
219 | #define DA9150_ID_ERR_MASK BIT(1) | ||
220 | #define DA9150_PT_CHG_SHIFT 2 | ||
221 | #define DA9150_PT_CHG_MASK BIT(2) | ||
222 | |||
223 | /* DA9150_STATUS_G = 0x06E */ | ||
224 | #define DA9150_RID_SHIFT 0 | ||
225 | #define DA9150_RID_MASK (0xff << 0) | ||
226 | |||
227 | /* DA9150_STATUS_H = 0x06F */ | ||
228 | #define DA9150_VBUS_STAT_SHIFT 0 | ||
229 | #define DA9150_VBUS_STAT_MASK (0x07 << 0) | ||
230 | #define DA9150_VBUS_STAT_OFF (0x00 << 0) | ||
231 | #define DA9150_VBUS_STAT_WAIT BIT(0) | ||
232 | #define DA9150_VBUS_STAT_CHG (0x02 << 0) | ||
233 | #define DA9150_VBUS_TRED_SHIFT 3 | ||
234 | #define DA9150_VBUS_TRED_MASK BIT(3) | ||
235 | #define DA9150_VBUS_DROP_STAT_SHIFT 4 | ||
236 | #define DA9150_VBUS_DROP_STAT_MASK (0x0f << 4) | ||
237 | |||
238 | /* DA9150_STATUS_I = 0x070 */ | ||
239 | #define DA9150_VBUS_ISET_STAT_SHIFT 0 | ||
240 | #define DA9150_VBUS_ISET_STAT_MASK (0x1f << 0) | ||
241 | #define DA9150_VBUS_OT_SHIFT 7 | ||
242 | #define DA9150_VBUS_OT_MASK BIT(7) | ||
243 | |||
244 | /* DA9150_STATUS_J = 0x071 */ | ||
245 | #define DA9150_CHG_STAT_SHIFT 0 | ||
246 | #define DA9150_CHG_STAT_MASK (0x0f << 0) | ||
247 | #define DA9150_CHG_STAT_OFF (0x00 << 0) | ||
248 | #define DA9150_CHG_STAT_SUSP BIT(0) | ||
249 | #define DA9150_CHG_STAT_ACT (0x02 << 0) | ||
250 | #define DA9150_CHG_STAT_PRE (0x03 << 0) | ||
251 | #define DA9150_CHG_STAT_CC (0x04 << 0) | ||
252 | #define DA9150_CHG_STAT_CV (0x05 << 0) | ||
253 | #define DA9150_CHG_STAT_FULL (0x06 << 0) | ||
254 | #define DA9150_CHG_STAT_TEMP (0x07 << 0) | ||
255 | #define DA9150_CHG_STAT_TIME (0x08 << 0) | ||
256 | #define DA9150_CHG_STAT_BAT (0x09 << 0) | ||
257 | #define DA9150_CHG_TEMP_SHIFT 4 | ||
258 | #define DA9150_CHG_TEMP_MASK (0x07 << 4) | ||
259 | #define DA9150_CHG_TEMP_UNDER (0x06 << 4) | ||
260 | #define DA9150_CHG_TEMP_OVER (0x07 << 4) | ||
261 | #define DA9150_CHG_IEND_STAT_SHIFT 7 | ||
262 | #define DA9150_CHG_IEND_STAT_MASK BIT(7) | ||
263 | |||
264 | /* DA9150_STATUS_K = 0x072 */ | ||
265 | #define DA9150_CHG_IAV_H_SHIFT 0 | ||
266 | #define DA9150_CHG_IAV_H_MASK (0xff << 0) | ||
267 | |||
268 | /* DA9150_STATUS_L = 0x073 */ | ||
269 | #define DA9150_CHG_IAV_L_SHIFT 5 | ||
270 | #define DA9150_CHG_IAV_L_MASK (0x07 << 5) | ||
271 | |||
272 | /* DA9150_STATUS_N = 0x074 */ | ||
273 | #define DA9150_CHG_TIME_SHIFT 1 | ||
274 | #define DA9150_CHG_TIME_MASK BIT(1) | ||
275 | #define DA9150_CHG_TRED_SHIFT 2 | ||
276 | #define DA9150_CHG_TRED_MASK BIT(2) | ||
277 | #define DA9150_CHG_TJUNC_CLASS_SHIFT 3 | ||
278 | #define DA9150_CHG_TJUNC_CLASS_MASK (0x07 << 3) | ||
279 | #define DA9150_CHG_TJUNC_CLASS_6 (0x06 << 3) | ||
280 | #define DA9150_EBS_STAT_SHIFT 6 | ||
281 | #define DA9150_EBS_STAT_MASK BIT(6) | ||
282 | #define DA9150_CHG_BAT_REMOVED_SHIFT 7 | ||
283 | #define DA9150_CHG_BAT_REMOVED_MASK BIT(7) | ||
284 | |||
285 | /* DA9150_FAULT_LOG_A = 0x076 */ | ||
286 | #define DA9150_TEMP_FAULT_SHIFT 0 | ||
287 | #define DA9150_TEMP_FAULT_MASK BIT(0) | ||
288 | #define DA9150_VSYS_FAULT_SHIFT 1 | ||
289 | #define DA9150_VSYS_FAULT_MASK BIT(1) | ||
290 | #define DA9150_START_FAULT_SHIFT 2 | ||
291 | #define DA9150_START_FAULT_MASK BIT(2) | ||
292 | #define DA9150_EXT_FAULT_SHIFT 3 | ||
293 | #define DA9150_EXT_FAULT_MASK BIT(3) | ||
294 | #define DA9150_POR_FAULT_SHIFT 4 | ||
295 | #define DA9150_POR_FAULT_MASK BIT(4) | ||
296 | |||
297 | /* DA9150_FAULT_LOG_B = 0x077 */ | ||
298 | #define DA9150_VBUS_FAULT_SHIFT 0 | ||
299 | #define DA9150_VBUS_FAULT_MASK BIT(0) | ||
300 | #define DA9150_OTG_FAULT_SHIFT 1 | ||
301 | #define DA9150_OTG_FAULT_MASK BIT(1) | ||
302 | |||
303 | /* DA9150_EVENT_E = 0x078 */ | ||
304 | #define DA9150_E_VBUS_SHIFT 0 | ||
305 | #define DA9150_E_VBUS_MASK BIT(0) | ||
306 | #define DA9150_E_CHG_SHIFT 1 | ||
307 | #define DA9150_E_CHG_MASK BIT(1) | ||
308 | #define DA9150_E_TCLASS_SHIFT 2 | ||
309 | #define DA9150_E_TCLASS_MASK BIT(2) | ||
310 | #define DA9150_E_TJUNC_SHIFT 3 | ||
311 | #define DA9150_E_TJUNC_MASK BIT(3) | ||
312 | #define DA9150_E_VFAULT_SHIFT 4 | ||
313 | #define DA9150_E_VFAULT_MASK BIT(4) | ||
314 | #define DA9150_EVENTS_H_SHIFT 5 | ||
315 | #define DA9150_EVENTS_H_MASK BIT(5) | ||
316 | #define DA9150_EVENTS_G_SHIFT 6 | ||
317 | #define DA9150_EVENTS_G_MASK BIT(6) | ||
318 | #define DA9150_EVENTS_F_SHIFT 7 | ||
319 | #define DA9150_EVENTS_F_MASK BIT(7) | ||
320 | |||
321 | /* DA9150_EVENT_F = 0x079 */ | ||
322 | #define DA9150_E_CONF_SHIFT 0 | ||
323 | #define DA9150_E_CONF_MASK BIT(0) | ||
324 | #define DA9150_E_DAT_SHIFT 1 | ||
325 | #define DA9150_E_DAT_MASK BIT(1) | ||
326 | #define DA9150_E_DTYPE_SHIFT 3 | ||
327 | #define DA9150_E_DTYPE_MASK BIT(3) | ||
328 | #define DA9150_E_ID_SHIFT 4 | ||
329 | #define DA9150_E_ID_MASK BIT(4) | ||
330 | #define DA9150_E_ADP_SHIFT 5 | ||
331 | #define DA9150_E_ADP_MASK BIT(5) | ||
332 | #define DA9150_E_SESS_END_SHIFT 6 | ||
333 | #define DA9150_E_SESS_END_MASK BIT(6) | ||
334 | #define DA9150_E_SESS_VLD_SHIFT 7 | ||
335 | #define DA9150_E_SESS_VLD_MASK BIT(7) | ||
336 | |||
337 | /* DA9150_EVENT_G = 0x07A */ | ||
338 | #define DA9150_E_FG_SHIFT 0 | ||
339 | #define DA9150_E_FG_MASK BIT(0) | ||
340 | #define DA9150_E_GP_SHIFT 1 | ||
341 | #define DA9150_E_GP_MASK BIT(1) | ||
342 | #define DA9150_E_TBAT_SHIFT 2 | ||
343 | #define DA9150_E_TBAT_MASK BIT(2) | ||
344 | #define DA9150_E_GPIOA_SHIFT 3 | ||
345 | #define DA9150_E_GPIOA_MASK BIT(3) | ||
346 | #define DA9150_E_GPIOB_SHIFT 4 | ||
347 | #define DA9150_E_GPIOB_MASK BIT(4) | ||
348 | #define DA9150_E_GPIOC_SHIFT 5 | ||
349 | #define DA9150_E_GPIOC_MASK BIT(5) | ||
350 | #define DA9150_E_GPIOD_SHIFT 6 | ||
351 | #define DA9150_E_GPIOD_MASK BIT(6) | ||
352 | #define DA9150_E_GPADC_SHIFT 7 | ||
353 | #define DA9150_E_GPADC_MASK BIT(7) | ||
354 | |||
355 | /* DA9150_EVENT_H = 0x07B */ | ||
356 | #define DA9150_E_WKUP_SHIFT 0 | ||
357 | #define DA9150_E_WKUP_MASK BIT(0) | ||
358 | |||
359 | /* DA9150_IRQ_MASK_E = 0x07C */ | ||
360 | #define DA9150_M_VBUS_SHIFT 0 | ||
361 | #define DA9150_M_VBUS_MASK BIT(0) | ||
362 | #define DA9150_M_CHG_SHIFT 1 | ||
363 | #define DA9150_M_CHG_MASK BIT(1) | ||
364 | #define DA9150_M_TJUNC_SHIFT 3 | ||
365 | #define DA9150_M_TJUNC_MASK BIT(3) | ||
366 | #define DA9150_M_VFAULT_SHIFT 4 | ||
367 | #define DA9150_M_VFAULT_MASK BIT(4) | ||
368 | |||
369 | /* DA9150_IRQ_MASK_F = 0x07D */ | ||
370 | #define DA9150_M_CONF_SHIFT 0 | ||
371 | #define DA9150_M_CONF_MASK BIT(0) | ||
372 | #define DA9150_M_DAT_SHIFT 1 | ||
373 | #define DA9150_M_DAT_MASK BIT(1) | ||
374 | #define DA9150_M_DTYPE_SHIFT 3 | ||
375 | #define DA9150_M_DTYPE_MASK BIT(3) | ||
376 | #define DA9150_M_ID_SHIFT 4 | ||
377 | #define DA9150_M_ID_MASK BIT(4) | ||
378 | #define DA9150_M_ADP_SHIFT 5 | ||
379 | #define DA9150_M_ADP_MASK BIT(5) | ||
380 | #define DA9150_M_SESS_END_SHIFT 6 | ||
381 | #define DA9150_M_SESS_END_MASK BIT(6) | ||
382 | #define DA9150_M_SESS_VLD_SHIFT 7 | ||
383 | #define DA9150_M_SESS_VLD_MASK BIT(7) | ||
384 | |||
385 | /* DA9150_IRQ_MASK_G = 0x07E */ | ||
386 | #define DA9150_M_FG_SHIFT 0 | ||
387 | #define DA9150_M_FG_MASK BIT(0) | ||
388 | #define DA9150_M_GP_SHIFT 1 | ||
389 | #define DA9150_M_GP_MASK BIT(1) | ||
390 | #define DA9150_M_TBAT_SHIFT 2 | ||
391 | #define DA9150_M_TBAT_MASK BIT(2) | ||
392 | #define DA9150_M_GPIOA_SHIFT 3 | ||
393 | #define DA9150_M_GPIOA_MASK BIT(3) | ||
394 | #define DA9150_M_GPIOB_SHIFT 4 | ||
395 | #define DA9150_M_GPIOB_MASK BIT(4) | ||
396 | #define DA9150_M_GPIOC_SHIFT 5 | ||
397 | #define DA9150_M_GPIOC_MASK BIT(5) | ||
398 | #define DA9150_M_GPIOD_SHIFT 6 | ||
399 | #define DA9150_M_GPIOD_MASK BIT(6) | ||
400 | #define DA9150_M_GPADC_SHIFT 7 | ||
401 | #define DA9150_M_GPADC_MASK BIT(7) | ||
402 | |||
403 | /* DA9150_IRQ_MASK_H = 0x07F */ | ||
404 | #define DA9150_M_WKUP_SHIFT 0 | ||
405 | #define DA9150_M_WKUP_MASK BIT(0) | ||
406 | |||
407 | /* DA9150_PAGE_CON_1 = 0x080 */ | ||
408 | #define DA9150_PAGE_SHIFT 0 | ||
409 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
410 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
411 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
412 | #define DA9150_REVERT_SHIFT 7 | ||
413 | #define DA9150_REVERT_MASK BIT(7) | ||
414 | |||
415 | /* DA9150_CONFIG_A = 0x0E0 */ | ||
416 | #define DA9150_RESET_DUR_SHIFT 0 | ||
417 | #define DA9150_RESET_DUR_MASK (0x03 << 0) | ||
418 | #define DA9150_RESET_EXT_SHIFT 2 | ||
419 | #define DA9150_RESET_EXT_MASK (0x03 << 2) | ||
420 | #define DA9150_START_MAX_SHIFT 4 | ||
421 | #define DA9150_START_MAX_MASK (0x03 << 4) | ||
422 | #define DA9150_PS_WAIT_EN_SHIFT 6 | ||
423 | #define DA9150_PS_WAIT_EN_MASK BIT(6) | ||
424 | #define DA9150_PS_DISABLE_DIRECT_SHIFT 7 | ||
425 | #define DA9150_PS_DISABLE_DIRECT_MASK BIT(7) | ||
426 | |||
427 | /* DA9150_CONFIG_B = 0x0E1 */ | ||
428 | #define DA9150_VFAULT_ADJ_SHIFT 0 | ||
429 | #define DA9150_VFAULT_ADJ_MASK (0x0f << 0) | ||
430 | #define DA9150_VFAULT_HYST_SHIFT 4 | ||
431 | #define DA9150_VFAULT_HYST_MASK (0x07 << 4) | ||
432 | #define DA9150_VFAULT_EN_SHIFT 7 | ||
433 | #define DA9150_VFAULT_EN_MASK BIT(7) | ||
434 | |||
435 | /* DA9150_CONFIG_C = 0x0E2 */ | ||
436 | #define DA9150_VSYS_MIN_SHIFT 3 | ||
437 | #define DA9150_VSYS_MIN_MASK (0x1f << 3) | ||
438 | |||
439 | /* DA9150_CONFIG_D = 0x0E3 */ | ||
440 | #define DA9150_LFOSC_EXT_SHIFT 0 | ||
441 | #define DA9150_LFOSC_EXT_MASK BIT(0) | ||
442 | #define DA9150_VDD33_DWN_SHIFT 1 | ||
443 | #define DA9150_VDD33_DWN_MASK BIT(1) | ||
444 | #define DA9150_WKUP_PM_EN_SHIFT 2 | ||
445 | #define DA9150_WKUP_PM_EN_MASK BIT(2) | ||
446 | #define DA9150_WKUP_CE_SEL_SHIFT 3 | ||
447 | #define DA9150_WKUP_CE_SEL_MASK (0x03 << 3) | ||
448 | #define DA9150_WKUP_CLK32K_EN_SHIFT 5 | ||
449 | #define DA9150_WKUP_CLK32K_EN_MASK BIT(5) | ||
450 | #define DA9150_DISABLE_DEL_SHIFT 7 | ||
451 | #define DA9150_DISABLE_DEL_MASK BIT(7) | ||
452 | |||
453 | /* DA9150_CONFIG_E = 0x0E4 */ | ||
454 | #define DA9150_PM_SPKSUP_DIS_SHIFT 0 | ||
455 | #define DA9150_PM_SPKSUP_DIS_MASK BIT(0) | ||
456 | #define DA9150_PM_MERGE_SHIFT 1 | ||
457 | #define DA9150_PM_MERGE_MASK BIT(1) | ||
458 | #define DA9150_PM_SR_OFF_SHIFT 2 | ||
459 | #define DA9150_PM_SR_OFF_MASK BIT(2) | ||
460 | #define DA9150_PM_TIMEOUT_EN_SHIFT 3 | ||
461 | #define DA9150_PM_TIMEOUT_EN_MASK BIT(3) | ||
462 | #define DA9150_PM_DLY_SEL_SHIFT 4 | ||
463 | #define DA9150_PM_DLY_SEL_MASK (0x07 << 4) | ||
464 | #define DA9150_PM_OUT_DLY_SEL_SHIFT 7 | ||
465 | #define DA9150_PM_OUT_DLY_SEL_MASK BIT(7) | ||
466 | |||
467 | /* DA9150_CONTROL_A = 0x0E5 */ | ||
468 | #define DA9150_VDD33_SL_SHIFT 0 | ||
469 | #define DA9150_VDD33_SL_MASK BIT(0) | ||
470 | #define DA9150_VDD33_LPM_SHIFT 1 | ||
471 | #define DA9150_VDD33_LPM_MASK (0x03 << 1) | ||
472 | #define DA9150_VDD33_EN_SHIFT 3 | ||
473 | #define DA9150_VDD33_EN_MASK BIT(3) | ||
474 | #define DA9150_GPI_LPM_SHIFT 6 | ||
475 | #define DA9150_GPI_LPM_MASK BIT(6) | ||
476 | #define DA9150_PM_IF_LPM_SHIFT 7 | ||
477 | #define DA9150_PM_IF_LPM_MASK BIT(7) | ||
478 | |||
479 | /* DA9150_CONTROL_B = 0x0E6 */ | ||
480 | #define DA9150_LPM_SHIFT 0 | ||
481 | #define DA9150_LPM_MASK BIT(0) | ||
482 | #define DA9150_RESET_SHIFT 1 | ||
483 | #define DA9150_RESET_MASK BIT(1) | ||
484 | #define DA9150_RESET_USRCONF_EN_SHIFT 2 | ||
485 | #define DA9150_RESET_USRCONF_EN_MASK BIT(2) | ||
486 | |||
487 | /* DA9150_CONTROL_C = 0x0E7 */ | ||
488 | #define DA9150_DISABLE_SHIFT 0 | ||
489 | #define DA9150_DISABLE_MASK BIT(0) | ||
490 | |||
491 | /* DA9150_GPIO_A_B = 0x0E8 */ | ||
492 | #define DA9150_GPIOA_PIN_SHIFT 0 | ||
493 | #define DA9150_GPIOA_PIN_MASK (0x07 << 0) | ||
494 | #define DA9150_GPIOA_PIN_GPI (0x00 << 0) | ||
495 | #define DA9150_GPIOA_PIN_GPO_OD BIT(0) | ||
496 | #define DA9150_GPIOA_TYPE_SHIFT 3 | ||
497 | #define DA9150_GPIOA_TYPE_MASK BIT(3) | ||
498 | #define DA9150_GPIOB_PIN_SHIFT 4 | ||
499 | #define DA9150_GPIOB_PIN_MASK (0x07 << 4) | ||
500 | #define DA9150_GPIOB_PIN_GPI (0x00 << 4) | ||
501 | #define DA9150_GPIOB_PIN_GPO_OD BIT(4) | ||
502 | #define DA9150_GPIOB_TYPE_SHIFT 7 | ||
503 | #define DA9150_GPIOB_TYPE_MASK BIT(7) | ||
504 | |||
505 | /* DA9150_GPIO_C_D = 0x0E9 */ | ||
506 | #define DA9150_GPIOC_PIN_SHIFT 0 | ||
507 | #define DA9150_GPIOC_PIN_MASK (0x07 << 0) | ||
508 | #define DA9150_GPIOC_PIN_GPI (0x00 << 0) | ||
509 | #define DA9150_GPIOC_PIN_GPO_OD BIT(0) | ||
510 | #define DA9150_GPIOC_TYPE_SHIFT 3 | ||
511 | #define DA9150_GPIOC_TYPE_MASK BIT(3) | ||
512 | #define DA9150_GPIOD_PIN_SHIFT 4 | ||
513 | #define DA9150_GPIOD_PIN_MASK (0x07 << 4) | ||
514 | #define DA9150_GPIOD_PIN_GPI (0x00 << 4) | ||
515 | #define DA9150_GPIOD_PIN_GPO_OD BIT(4) | ||
516 | #define DA9150_GPIOD_TYPE_SHIFT 7 | ||
517 | #define DA9150_GPIOD_TYPE_MASK BIT(7) | ||
518 | |||
519 | /* DA9150_GPIO_MODE_CONT = 0x0EA */ | ||
520 | #define DA9150_GPIOA_MODE_SHIFT 0 | ||
521 | #define DA9150_GPIOA_MODE_MASK BIT(0) | ||
522 | #define DA9150_GPIOB_MODE_SHIFT 1 | ||
523 | #define DA9150_GPIOB_MODE_MASK BIT(1) | ||
524 | #define DA9150_GPIOC_MODE_SHIFT 2 | ||
525 | #define DA9150_GPIOC_MODE_MASK BIT(2) | ||
526 | #define DA9150_GPIOD_MODE_SHIFT 3 | ||
527 | #define DA9150_GPIOD_MODE_MASK BIT(3) | ||
528 | #define DA9150_GPIOA_CONT_SHIFT 4 | ||
529 | #define DA9150_GPIOA_CONT_MASK BIT(4) | ||
530 | #define DA9150_GPIOB_CONT_SHIFT 5 | ||
531 | #define DA9150_GPIOB_CONT_MASK BIT(5) | ||
532 | #define DA9150_GPIOC_CONT_SHIFT 6 | ||
533 | #define DA9150_GPIOC_CONT_MASK BIT(6) | ||
534 | #define DA9150_GPIOD_CONT_SHIFT 7 | ||
535 | #define DA9150_GPIOD_CONT_MASK BIT(7) | ||
536 | |||
537 | /* DA9150_GPIO_CTRL_B = 0x0EB */ | ||
538 | #define DA9150_WAKE_PIN_SHIFT 0 | ||
539 | #define DA9150_WAKE_PIN_MASK (0x03 << 0) | ||
540 | #define DA9150_WAKE_MODE_SHIFT 2 | ||
541 | #define DA9150_WAKE_MODE_MASK BIT(2) | ||
542 | #define DA9150_WAKE_CONT_SHIFT 3 | ||
543 | #define DA9150_WAKE_CONT_MASK BIT(3) | ||
544 | #define DA9150_WAKE_DLY_SHIFT 4 | ||
545 | #define DA9150_WAKE_DLY_MASK BIT(4) | ||
546 | |||
547 | /* DA9150_GPIO_CTRL_A = 0x0EC */ | ||
548 | #define DA9150_GPIOA_ANAEN_SHIFT 0 | ||
549 | #define DA9150_GPIOA_ANAEN_MASK BIT(0) | ||
550 | #define DA9150_GPIOB_ANAEN_SHIFT 1 | ||
551 | #define DA9150_GPIOB_ANAEN_MASK BIT(1) | ||
552 | #define DA9150_GPIOC_ANAEN_SHIFT 2 | ||
553 | #define DA9150_GPIOC_ANAEN_MASK BIT(2) | ||
554 | #define DA9150_GPIOD_ANAEN_SHIFT 3 | ||
555 | #define DA9150_GPIOD_ANAEN_MASK BIT(3) | ||
556 | #define DA9150_GPIO_ANAEN 0x01 | ||
557 | #define DA9150_GPIO_ANAEN_MASK 0x0F | ||
558 | #define DA9150_CHGLED_PIN_SHIFT 5 | ||
559 | #define DA9150_CHGLED_PIN_MASK (0x07 << 5) | ||
560 | |||
561 | /* DA9150_GPIO_CTRL_C = 0x0ED */ | ||
562 | #define DA9150_CHGBL_DUR_SHIFT 0 | ||
563 | #define DA9150_CHGBL_DUR_MASK (0x03 << 0) | ||
564 | #define DA9150_CHGBL_DBL_SHIFT 2 | ||
565 | #define DA9150_CHGBL_DBL_MASK BIT(2) | ||
566 | #define DA9150_CHGBL_FRQ_SHIFT 3 | ||
567 | #define DA9150_CHGBL_FRQ_MASK (0x03 << 3) | ||
568 | #define DA9150_CHGBL_FLKR_SHIFT 5 | ||
569 | #define DA9150_CHGBL_FLKR_MASK BIT(5) | ||
570 | |||
571 | /* DA9150_GPIO_CFG_A = 0x0EE */ | ||
572 | #define DA9150_CE_LPM_DEB_SHIFT 0 | ||
573 | #define DA9150_CE_LPM_DEB_MASK (0x07 << 0) | ||
574 | |||
575 | /* DA9150_GPIO_CFG_B = 0x0EF */ | ||
576 | #define DA9150_GPIOA_PUPD_SHIFT 0 | ||
577 | #define DA9150_GPIOA_PUPD_MASK BIT(0) | ||
578 | #define DA9150_GPIOB_PUPD_SHIFT 1 | ||
579 | #define DA9150_GPIOB_PUPD_MASK BIT(1) | ||
580 | #define DA9150_GPIOC_PUPD_SHIFT 2 | ||
581 | #define DA9150_GPIOC_PUPD_MASK BIT(2) | ||
582 | #define DA9150_GPIOD_PUPD_SHIFT 3 | ||
583 | #define DA9150_GPIOD_PUPD_MASK BIT(3) | ||
584 | #define DA9150_GPIO_PUPD_MASK (0xF << 0) | ||
585 | #define DA9150_GPI_DEB_SHIFT 4 | ||
586 | #define DA9150_GPI_DEB_MASK (0x07 << 4) | ||
587 | #define DA9150_LPM_EN_SHIFT 7 | ||
588 | #define DA9150_LPM_EN_MASK BIT(7) | ||
589 | |||
590 | /* DA9150_GPIO_CFG_C = 0x0F0 */ | ||
591 | #define DA9150_GPI_V_SHIFT 0 | ||
592 | #define DA9150_GPI_V_MASK BIT(0) | ||
593 | #define DA9150_VDDIO_INT_SHIFT 1 | ||
594 | #define DA9150_VDDIO_INT_MASK BIT(1) | ||
595 | #define DA9150_FAULT_PIN_SHIFT 3 | ||
596 | #define DA9150_FAULT_PIN_MASK (0x07 << 3) | ||
597 | #define DA9150_FAULT_TYPE_SHIFT 6 | ||
598 | #define DA9150_FAULT_TYPE_MASK BIT(6) | ||
599 | #define DA9150_NIRQ_PUPD_SHIFT 7 | ||
600 | #define DA9150_NIRQ_PUPD_MASK BIT(7) | ||
601 | |||
602 | /* DA9150_GPADC_MAN = 0x0F2 */ | ||
603 | #define DA9150_GPADC_EN_SHIFT 0 | ||
604 | #define DA9150_GPADC_EN_MASK BIT(0) | ||
605 | #define DA9150_GPADC_MUX_SHIFT 1 | ||
606 | #define DA9150_GPADC_MUX_MASK (0x1f << 1) | ||
607 | |||
608 | /* DA9150_GPADC_RES_A = 0x0F4 */ | ||
609 | #define DA9150_GPADC_RES_H_SHIFT 0 | ||
610 | #define DA9150_GPADC_RES_H_MASK (0xff << 0) | ||
611 | |||
612 | /* DA9150_GPADC_RES_B = 0x0F5 */ | ||
613 | #define DA9150_GPADC_RUN_SHIFT 0 | ||
614 | #define DA9150_GPADC_RUN_MASK BIT(0) | ||
615 | #define DA9150_GPADC_RES_L_SHIFT 6 | ||
616 | #define DA9150_GPADC_RES_L_MASK (0x03 << 6) | ||
617 | #define DA9150_GPADC_RES_L_BITS 2 | ||
618 | |||
619 | /* DA9150_PAGE_CON_2 = 0x100 */ | ||
620 | #define DA9150_PAGE_SHIFT 0 | ||
621 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
622 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
623 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
624 | #define DA9150_REVERT_SHIFT 7 | ||
625 | #define DA9150_REVERT_MASK BIT(7) | ||
626 | |||
627 | /* DA9150_OTP_CONT_SHARED = 0x101 */ | ||
628 | #define DA9150_PC_DONE_SHIFT 3 | ||
629 | #define DA9150_PC_DONE_MASK BIT(3) | ||
630 | |||
631 | /* DA9150_INTERFACE_SHARED = 0x105 */ | ||
632 | #define DA9150_IF_BASE_ADDR_SHIFT 4 | ||
633 | #define DA9150_IF_BASE_ADDR_MASK (0x0f << 4) | ||
634 | |||
635 | /* DA9150_CONFIG_A_SHARED = 0x106 */ | ||
636 | #define DA9150_NIRQ_VDD_SHIFT 1 | ||
637 | #define DA9150_NIRQ_VDD_MASK BIT(1) | ||
638 | #define DA9150_NIRQ_PIN_SHIFT 2 | ||
639 | #define DA9150_NIRQ_PIN_MASK BIT(2) | ||
640 | #define DA9150_NIRQ_TYPE_SHIFT 3 | ||
641 | #define DA9150_NIRQ_TYPE_MASK BIT(3) | ||
642 | #define DA9150_PM_IF_V_SHIFT 4 | ||
643 | #define DA9150_PM_IF_V_MASK BIT(4) | ||
644 | #define DA9150_PM_IF_FMP_SHIFT 5 | ||
645 | #define DA9150_PM_IF_FMP_MASK BIT(5) | ||
646 | #define DA9150_PM_IF_HSM_SHIFT 6 | ||
647 | #define DA9150_PM_IF_HSM_MASK BIT(6) | ||
648 | |||
649 | /* DA9150_CONFIG_D_SHARED = 0x109 */ | ||
650 | #define DA9150_NIRQ_MODE_SHIFT 1 | ||
651 | #define DA9150_NIRQ_MODE_MASK BIT(1) | ||
652 | |||
653 | /* DA9150_ADETVB_CFG_C = 0x150 */ | ||
654 | #define DA9150_TADP_RISE_SHIFT 0 | ||
655 | #define DA9150_TADP_RISE_MASK (0xff << 0) | ||
656 | |||
657 | /* DA9150_ADETD_STAT = 0x151 */ | ||
658 | #define DA9150_DCD_STAT_SHIFT 0 | ||
659 | #define DA9150_DCD_STAT_MASK BIT(0) | ||
660 | #define DA9150_PCD_STAT_SHIFT 1 | ||
661 | #define DA9150_PCD_STAT_MASK (0x03 << 1) | ||
662 | #define DA9150_SCD_STAT_SHIFT 3 | ||
663 | #define DA9150_SCD_STAT_MASK (0x03 << 3) | ||
664 | #define DA9150_DP_STAT_SHIFT 5 | ||
665 | #define DA9150_DP_STAT_MASK BIT(5) | ||
666 | #define DA9150_DM_STAT_SHIFT 6 | ||
667 | #define DA9150_DM_STAT_MASK BIT(6) | ||
668 | |||
669 | /* DA9150_ADET_CMPSTAT = 0x152 */ | ||
670 | #define DA9150_DP_COMP_SHIFT 1 | ||
671 | #define DA9150_DP_COMP_MASK BIT(1) | ||
672 | #define DA9150_DM_COMP_SHIFT 2 | ||
673 | #define DA9150_DM_COMP_MASK BIT(2) | ||
674 | #define DA9150_ADP_SNS_COMP_SHIFT 3 | ||
675 | #define DA9150_ADP_SNS_COMP_MASK BIT(3) | ||
676 | #define DA9150_ADP_PRB_COMP_SHIFT 4 | ||
677 | #define DA9150_ADP_PRB_COMP_MASK BIT(4) | ||
678 | #define DA9150_ID_COMP_SHIFT 5 | ||
679 | #define DA9150_ID_COMP_MASK BIT(5) | ||
680 | |||
681 | /* DA9150_ADET_CTRL_A = 0x153 */ | ||
682 | #define DA9150_AID_DAT_SHIFT 0 | ||
683 | #define DA9150_AID_DAT_MASK BIT(0) | ||
684 | #define DA9150_AID_ID_SHIFT 1 | ||
685 | #define DA9150_AID_ID_MASK BIT(1) | ||
686 | #define DA9150_AID_TRIG_SHIFT 2 | ||
687 | #define DA9150_AID_TRIG_MASK BIT(2) | ||
688 | |||
689 | /* DA9150_ADETVB_CFG_B = 0x154 */ | ||
690 | #define DA9150_VB_MODE_SHIFT 0 | ||
691 | #define DA9150_VB_MODE_MASK (0x03 << 0) | ||
692 | #define DA9150_VB_MODE_VB_SESS BIT(0) | ||
693 | |||
694 | #define DA9150_TADP_PRB_SHIFT 2 | ||
695 | #define DA9150_TADP_PRB_MASK BIT(2) | ||
696 | #define DA9150_DAT_RPD_EXT_SHIFT 5 | ||
697 | #define DA9150_DAT_RPD_EXT_MASK BIT(5) | ||
698 | #define DA9150_CONF_RPD_SHIFT 6 | ||
699 | #define DA9150_CONF_RPD_MASK BIT(6) | ||
700 | #define DA9150_CONF_SRP_SHIFT 7 | ||
701 | #define DA9150_CONF_SRP_MASK BIT(7) | ||
702 | |||
703 | /* DA9150_ADETVB_CFG_A = 0x155 */ | ||
704 | #define DA9150_AID_MODE_SHIFT 0 | ||
705 | #define DA9150_AID_MODE_MASK (0x03 << 0) | ||
706 | #define DA9150_AID_EXT_POL_SHIFT 2 | ||
707 | #define DA9150_AID_EXT_POL_MASK BIT(2) | ||
708 | |||
709 | /* DA9150_ADETAC_CFG_A = 0x156 */ | ||
710 | #define DA9150_ISET_CDP_SHIFT 0 | ||
711 | #define DA9150_ISET_CDP_MASK (0x1f << 0) | ||
712 | #define DA9150_CONF_DBP_SHIFT 5 | ||
713 | #define DA9150_CONF_DBP_MASK BIT(5) | ||
714 | |||
715 | /* DA9150_ADDETAC_CFG_B = 0x157 */ | ||
716 | #define DA9150_ISET_DCHG_SHIFT 0 | ||
717 | #define DA9150_ISET_DCHG_MASK (0x1f << 0) | ||
718 | #define DA9150_CONF_GPIOA_SHIFT 5 | ||
719 | #define DA9150_CONF_GPIOA_MASK BIT(5) | ||
720 | #define DA9150_CONF_GPIOB_SHIFT 6 | ||
721 | #define DA9150_CONF_GPIOB_MASK BIT(6) | ||
722 | #define DA9150_AID_VB_SHIFT 7 | ||
723 | #define DA9150_AID_VB_MASK BIT(7) | ||
724 | |||
725 | /* DA9150_ADETAC_CFG_C = 0x158 */ | ||
726 | #define DA9150_ISET_DEF_SHIFT 0 | ||
727 | #define DA9150_ISET_DEF_MASK (0x1f << 0) | ||
728 | #define DA9150_CONF_MODE_SHIFT 5 | ||
729 | #define DA9150_CONF_MODE_MASK (0x03 << 5) | ||
730 | #define DA9150_AID_CR_DIS_SHIFT 7 | ||
731 | #define DA9150_AID_CR_DIS_MASK BIT(7) | ||
732 | |||
733 | /* DA9150_ADETAC_CFG_D = 0x159 */ | ||
734 | #define DA9150_ISET_UNIT_SHIFT 0 | ||
735 | #define DA9150_ISET_UNIT_MASK (0x1f << 0) | ||
736 | #define DA9150_AID_UNCLAMP_SHIFT 5 | ||
737 | #define DA9150_AID_UNCLAMP_MASK BIT(5) | ||
738 | |||
739 | /* DA9150_ADETVB_CFG_D = 0x15A */ | ||
740 | #define DA9150_ID_MODE_SHIFT 0 | ||
741 | #define DA9150_ID_MODE_MASK (0x03 << 0) | ||
742 | #define DA9150_DAT_MODE_SHIFT 2 | ||
743 | #define DA9150_DAT_MODE_MASK (0x0f << 2) | ||
744 | #define DA9150_DAT_SWP_SHIFT 6 | ||
745 | #define DA9150_DAT_SWP_MASK BIT(6) | ||
746 | #define DA9150_DAT_CLAMP_EXT_SHIFT 7 | ||
747 | #define DA9150_DAT_CLAMP_EXT_MASK BIT(7) | ||
748 | |||
749 | /* DA9150_ADETID_CFG_A = 0x15B */ | ||
750 | #define DA9150_TID_POLL_SHIFT 0 | ||
751 | #define DA9150_TID_POLL_MASK (0x07 << 0) | ||
752 | #define DA9150_RID_CONV_SHIFT 3 | ||
753 | #define DA9150_RID_CONV_MASK BIT(3) | ||
754 | |||
755 | /* DA9150_ADET_RID_PT_CHG_H = 0x15C */ | ||
756 | #define DA9150_RID_PT_CHG_H_SHIFT 0 | ||
757 | #define DA9150_RID_PT_CHG_H_MASK (0xff << 0) | ||
758 | |||
759 | /* DA9150_ADET_RID_PT_CHG_L = 0x15D */ | ||
760 | #define DA9150_RID_PT_CHG_L_SHIFT 6 | ||
761 | #define DA9150_RID_PT_CHG_L_MASK (0x03 << 6) | ||
762 | |||
763 | /* DA9150_PPR_TCTR_B = 0x160 */ | ||
764 | #define DA9150_CHG_TCTR_VAL_SHIFT 0 | ||
765 | #define DA9150_CHG_TCTR_VAL_MASK (0xff << 0) | ||
766 | |||
767 | /* DA9150_PPR_BKCTRL_A = 0x163 */ | ||
768 | #define DA9150_VBUS_MODE_SHIFT 0 | ||
769 | #define DA9150_VBUS_MODE_MASK (0x03 << 0) | ||
770 | #define DA9150_VBUS_MODE_CHG BIT(0) | ||
771 | #define DA9150_VBUS_MODE_OTG (0x02 << 0) | ||
772 | #define DA9150_VBUS_LPM_SHIFT 2 | ||
773 | #define DA9150_VBUS_LPM_MASK (0x03 << 2) | ||
774 | #define DA9150_VBUS_SUSP_SHIFT 4 | ||
775 | #define DA9150_VBUS_SUSP_MASK BIT(4) | ||
776 | #define DA9150_VBUS_PWM_SHIFT 5 | ||
777 | #define DA9150_VBUS_PWM_MASK BIT(5) | ||
778 | #define DA9150_VBUS_ISO_SHIFT 6 | ||
779 | #define DA9150_VBUS_ISO_MASK BIT(6) | ||
780 | #define DA9150_VBUS_LDO_SHIFT 7 | ||
781 | #define DA9150_VBUS_LDO_MASK BIT(7) | ||
782 | |||
783 | /* DA9150_PPR_BKCFG_A = 0x164 */ | ||
784 | #define DA9150_VBUS_ISET_SHIFT 0 | ||
785 | #define DA9150_VBUS_ISET_MASK (0x1f << 0) | ||
786 | #define DA9150_VBUS_IMAX_SHIFT 5 | ||
787 | #define DA9150_VBUS_IMAX_MASK BIT(5) | ||
788 | #define DA9150_VBUS_IOTG_SHIFT 6 | ||
789 | #define DA9150_VBUS_IOTG_MASK (0x03 << 6) | ||
790 | |||
791 | /* DA9150_PPR_BKCFG_B = 0x165 */ | ||
792 | #define DA9150_VBUS_DROP_SHIFT 0 | ||
793 | #define DA9150_VBUS_DROP_MASK (0x0f << 0) | ||
794 | #define DA9150_VBUS_FAULT_DIS_SHIFT 6 | ||
795 | #define DA9150_VBUS_FAULT_DIS_MASK BIT(6) | ||
796 | #define DA9150_OTG_FAULT_DIS_SHIFT 7 | ||
797 | #define DA9150_OTG_FAULT_DIS_MASK BIT(7) | ||
798 | |||
799 | /* DA9150_PPR_CHGCTRL_A = 0x166 */ | ||
800 | #define DA9150_CHG_EN_SHIFT 0 | ||
801 | #define DA9150_CHG_EN_MASK BIT(0) | ||
802 | |||
803 | /* DA9150_PPR_CHGCTRL_B = 0x167 */ | ||
804 | #define DA9150_CHG_VBAT_SHIFT 0 | ||
805 | #define DA9150_CHG_VBAT_MASK (0x1f << 0) | ||
806 | #define DA9150_CHG_VDROP_SHIFT 6 | ||
807 | #define DA9150_CHG_VDROP_MASK (0x03 << 6) | ||
808 | |||
809 | /* DA9150_PPR_CHGCTRL_C = 0x168 */ | ||
810 | #define DA9150_CHG_VFAULT_SHIFT 0 | ||
811 | #define DA9150_CHG_VFAULT_MASK (0x0f << 0) | ||
812 | #define DA9150_CHG_IPRE_SHIFT 4 | ||
813 | #define DA9150_CHG_IPRE_MASK (0x03 << 4) | ||
814 | |||
815 | /* DA9150_PPR_TCTR_A = 0x169 */ | ||
816 | #define DA9150_CHG_TCTR_SHIFT 0 | ||
817 | #define DA9150_CHG_TCTR_MASK (0x07 << 0) | ||
818 | #define DA9150_CHG_TCTR_MODE_SHIFT 4 | ||
819 | #define DA9150_CHG_TCTR_MODE_MASK BIT(4) | ||
820 | |||
821 | /* DA9150_PPR_CHGCTRL_D = 0x16A */ | ||
822 | #define DA9150_CHG_IBAT_SHIFT 0 | ||
823 | #define DA9150_CHG_IBAT_MASK (0xff << 0) | ||
824 | |||
825 | /* DA9150_PPR_CHGCTRL_E = 0x16B */ | ||
826 | #define DA9150_CHG_IEND_SHIFT 0 | ||
827 | #define DA9150_CHG_IEND_MASK (0xff << 0) | ||
828 | |||
829 | /* DA9150_PPR_CHGCTRL_F = 0x16C */ | ||
830 | #define DA9150_CHG_VCOLD_SHIFT 0 | ||
831 | #define DA9150_CHG_VCOLD_MASK (0x1f << 0) | ||
832 | #define DA9150_TBAT_TQA_EN_SHIFT 6 | ||
833 | #define DA9150_TBAT_TQA_EN_MASK BIT(6) | ||
834 | #define DA9150_TBAT_TDP_EN_SHIFT 7 | ||
835 | #define DA9150_TBAT_TDP_EN_MASK BIT(7) | ||
836 | |||
837 | /* DA9150_PPR_CHGCTRL_G = 0x16D */ | ||
838 | #define DA9150_CHG_VWARM_SHIFT 0 | ||
839 | #define DA9150_CHG_VWARM_MASK (0x1f << 0) | ||
840 | |||
841 | /* DA9150_PPR_CHGCTRL_H = 0x16E */ | ||
842 | #define DA9150_CHG_VHOT_SHIFT 0 | ||
843 | #define DA9150_CHG_VHOT_MASK (0x1f << 0) | ||
844 | |||
845 | /* DA9150_PPR_CHGCTRL_I = 0x16F */ | ||
846 | #define DA9150_CHG_ICOLD_SHIFT 0 | ||
847 | #define DA9150_CHG_ICOLD_MASK (0xff << 0) | ||
848 | |||
849 | /* DA9150_PPR_CHGCTRL_J = 0x170 */ | ||
850 | #define DA9150_CHG_IWARM_SHIFT 0 | ||
851 | #define DA9150_CHG_IWARM_MASK (0xff << 0) | ||
852 | |||
853 | /* DA9150_PPR_CHGCTRL_K = 0x171 */ | ||
854 | #define DA9150_CHG_IHOT_SHIFT 0 | ||
855 | #define DA9150_CHG_IHOT_MASK (0xff << 0) | ||
856 | |||
857 | /* DA9150_PPR_CHGCTRL_L = 0x172 */ | ||
858 | #define DA9150_CHG_IBAT_TRED_SHIFT 0 | ||
859 | #define DA9150_CHG_IBAT_TRED_MASK (0xff << 0) | ||
860 | |||
861 | /* DA9150_PPR_CHGCTRL_M = 0x173 */ | ||
862 | #define DA9150_CHG_VFLOAT_SHIFT 0 | ||
863 | #define DA9150_CHG_VFLOAT_MASK (0x0f << 0) | ||
864 | #define DA9150_CHG_LPM_SHIFT 5 | ||
865 | #define DA9150_CHG_LPM_MASK BIT(5) | ||
866 | #define DA9150_CHG_NBLO_SHIFT 6 | ||
867 | #define DA9150_CHG_NBLO_MASK BIT(6) | ||
868 | #define DA9150_EBS_EN_SHIFT 7 | ||
869 | #define DA9150_EBS_EN_MASK BIT(7) | ||
870 | |||
871 | /* DA9150_PPR_THYST_A = 0x174 */ | ||
872 | #define DA9150_TBAT_T1_SHIFT 0 | ||
873 | #define DA9150_TBAT_T1_MASK (0xff << 0) | ||
874 | |||
875 | /* DA9150_PPR_THYST_B = 0x175 */ | ||
876 | #define DA9150_TBAT_T2_SHIFT 0 | ||
877 | #define DA9150_TBAT_T2_MASK (0xff << 0) | ||
878 | |||
879 | /* DA9150_PPR_THYST_C = 0x176 */ | ||
880 | #define DA9150_TBAT_T3_SHIFT 0 | ||
881 | #define DA9150_TBAT_T3_MASK (0xff << 0) | ||
882 | |||
883 | /* DA9150_PPR_THYST_D = 0x177 */ | ||
884 | #define DA9150_TBAT_T4_SHIFT 0 | ||
885 | #define DA9150_TBAT_T4_MASK (0xff << 0) | ||
886 | |||
887 | /* DA9150_PPR_THYST_E = 0x178 */ | ||
888 | #define DA9150_TBAT_T5_SHIFT 0 | ||
889 | #define DA9150_TBAT_T5_MASK (0xff << 0) | ||
890 | |||
891 | /* DA9150_PPR_THYST_F = 0x179 */ | ||
892 | #define DA9150_TBAT_H1_SHIFT 0 | ||
893 | #define DA9150_TBAT_H1_MASK (0xff << 0) | ||
894 | |||
895 | /* DA9150_PPR_THYST_G = 0x17A */ | ||
896 | #define DA9150_TBAT_H5_SHIFT 0 | ||
897 | #define DA9150_TBAT_H5_MASK (0xff << 0) | ||
898 | |||
899 | /* DA9150_PAGE_CON_3 = 0x180 */ | ||
900 | #define DA9150_PAGE_SHIFT 0 | ||
901 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
902 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
903 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
904 | #define DA9150_REVERT_SHIFT 7 | ||
905 | #define DA9150_REVERT_MASK BIT(7) | ||
906 | |||
907 | /* DA9150_PAGE_CON_4 = 0x200 */ | ||
908 | #define DA9150_PAGE_SHIFT 0 | ||
909 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
910 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
911 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
912 | #define DA9150_REVERT_SHIFT 7 | ||
913 | #define DA9150_REVERT_MASK BIT(7) | ||
914 | |||
915 | /* DA9150_PAGE_CON_5 = 0x280 */ | ||
916 | #define DA9150_PAGE_SHIFT 0 | ||
917 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
918 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
919 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
920 | #define DA9150_REVERT_SHIFT 7 | ||
921 | #define DA9150_REVERT_MASK BIT(7) | ||
922 | |||
923 | /* DA9150_PAGE_CON_6 = 0x300 */ | ||
924 | #define DA9150_PAGE_SHIFT 0 | ||
925 | #define DA9150_PAGE_MASK (0x3f << 0) | ||
926 | #define DA9150_WRITE_MODE_SHIFT 6 | ||
927 | #define DA9150_WRITE_MODE_MASK BIT(6) | ||
928 | #define DA9150_REVERT_SHIFT 7 | ||
929 | #define DA9150_REVERT_MASK BIT(7) | ||
930 | |||
931 | /* DA9150_COREBTLD_STAT_A = 0x302 */ | ||
932 | #define DA9150_BOOTLD_STAT_SHIFT 0 | ||
933 | #define DA9150_BOOTLD_STAT_MASK (0x03 << 0) | ||
934 | #define DA9150_CORE_LOCKUP_SHIFT 2 | ||
935 | #define DA9150_CORE_LOCKUP_MASK BIT(2) | ||
936 | |||
937 | /* DA9150_COREBTLD_CTRL_A = 0x303 */ | ||
938 | #define DA9150_CORE_RESET_SHIFT 0 | ||
939 | #define DA9150_CORE_RESET_MASK BIT(0) | ||
940 | #define DA9150_CORE_STOP_SHIFT 1 | ||
941 | #define DA9150_CORE_STOP_MASK BIT(1) | ||
942 | |||
943 | /* DA9150_CORE_CONFIG_A = 0x304 */ | ||
944 | #define DA9150_CORE_MEMMUX_SHIFT 0 | ||
945 | #define DA9150_CORE_MEMMUX_MASK (0x03 << 0) | ||
946 | #define DA9150_WDT_AUTO_START_SHIFT 2 | ||
947 | #define DA9150_WDT_AUTO_START_MASK BIT(2) | ||
948 | #define DA9150_WDT_AUTO_LOCK_SHIFT 3 | ||
949 | #define DA9150_WDT_AUTO_LOCK_MASK BIT(3) | ||
950 | #define DA9150_WDT_HLT_NO_CLK_SHIFT 4 | ||
951 | #define DA9150_WDT_HLT_NO_CLK_MASK BIT(4) | ||
952 | |||
953 | /* DA9150_CORE_CONFIG_C = 0x305 */ | ||
954 | #define DA9150_CORE_SW_SIZE_SHIFT 0 | ||
955 | #define DA9150_CORE_SW_SIZE_MASK (0xff << 0) | ||
956 | |||
957 | /* DA9150_CORE_CONFIG_B = 0x306 */ | ||
958 | #define DA9150_BOOTLD_EN_SHIFT 0 | ||
959 | #define DA9150_BOOTLD_EN_MASK BIT(0) | ||
960 | #define DA9150_CORE_EN_SHIFT 2 | ||
961 | #define DA9150_CORE_EN_MASK BIT(2) | ||
962 | #define DA9150_CORE_SW_SRC_SHIFT 3 | ||
963 | #define DA9150_CORE_SW_SRC_MASK (0x07 << 3) | ||
964 | #define DA9150_DEEP_SLEEP_EN_SHIFT 7 | ||
965 | #define DA9150_DEEP_SLEEP_EN_MASK BIT(7) | ||
966 | |||
967 | /* DA9150_CORE_CFG_DATA_A = 0x307 */ | ||
968 | #define DA9150_CORE_CFG_DT_A_SHIFT 0 | ||
969 | #define DA9150_CORE_CFG_DT_A_MASK (0xff << 0) | ||
970 | |||
971 | /* DA9150_CORE_CFG_DATA_B = 0x308 */ | ||
972 | #define DA9150_CORE_CFG_DT_B_SHIFT 0 | ||
973 | #define DA9150_CORE_CFG_DT_B_MASK (0xff << 0) | ||
974 | |||
975 | /* DA9150_CORE_CMD_A = 0x309 */ | ||
976 | #define DA9150_CORE_CMD_SHIFT 0 | ||
977 | #define DA9150_CORE_CMD_MASK (0xff << 0) | ||
978 | |||
979 | /* DA9150_CORE_DATA_A = 0x30A */ | ||
980 | #define DA9150_CORE_DATA_0_SHIFT 0 | ||
981 | #define DA9150_CORE_DATA_0_MASK (0xff << 0) | ||
982 | |||
983 | /* DA9150_CORE_DATA_B = 0x30B */ | ||
984 | #define DA9150_CORE_DATA_1_SHIFT 0 | ||
985 | #define DA9150_CORE_DATA_1_MASK (0xff << 0) | ||
986 | |||
987 | /* DA9150_CORE_DATA_C = 0x30C */ | ||
988 | #define DA9150_CORE_DATA_2_SHIFT 0 | ||
989 | #define DA9150_CORE_DATA_2_MASK (0xff << 0) | ||
990 | |||
991 | /* DA9150_CORE_DATA_D = 0x30D */ | ||
992 | #define DA9150_CORE_DATA_3_SHIFT 0 | ||
993 | #define DA9150_CORE_DATA_3_MASK (0xff << 0) | ||
994 | |||
995 | /* DA9150_CORE2WIRE_STAT_A = 0x310 */ | ||
996 | #define DA9150_FW_FWDL_ERR_SHIFT 7 | ||
997 | #define DA9150_FW_FWDL_ERR_MASK BIT(7) | ||
998 | |||
999 | /* DA9150_CORE2WIRE_CTRL_A = 0x311 */ | ||
1000 | #define DA9150_FW_FWDL_EN_SHIFT 0 | ||
1001 | #define DA9150_FW_FWDL_EN_MASK BIT(0) | ||
1002 | #define DA9150_FG_QIF_EN_SHIFT 1 | ||
1003 | #define DA9150_FG_QIF_EN_MASK BIT(1) | ||
1004 | #define DA9150_CORE_BASE_ADDR_SHIFT 4 | ||
1005 | #define DA9150_CORE_BASE_ADDR_MASK (0x0f << 4) | ||
1006 | |||
1007 | /* DA9150_FW_CTRL_A = 0x312 */ | ||
1008 | #define DA9150_FW_SEAL_SHIFT 0 | ||
1009 | #define DA9150_FW_SEAL_MASK (0xff << 0) | ||
1010 | |||
1011 | /* DA9150_FW_CTRL_C = 0x313 */ | ||
1012 | #define DA9150_FW_FWDL_CRC_SHIFT 0 | ||
1013 | #define DA9150_FW_FWDL_CRC_MASK (0xff << 0) | ||
1014 | |||
1015 | /* DA9150_FW_CTRL_D = 0x314 */ | ||
1016 | #define DA9150_FW_FWDL_BASE_SHIFT 0 | ||
1017 | #define DA9150_FW_FWDL_BASE_MASK (0x0f << 0) | ||
1018 | |||
1019 | /* DA9150_FG_CTRL_A = 0x315 */ | ||
1020 | #define DA9150_FG_QIF_CODE_SHIFT 0 | ||
1021 | #define DA9150_FG_QIF_CODE_MASK (0xff << 0) | ||
1022 | |||
1023 | /* DA9150_FG_CTRL_B = 0x316 */ | ||
1024 | #define DA9150_FG_QIF_VALUE_SHIFT 0 | ||
1025 | #define DA9150_FG_QIF_VALUE_MASK (0xff << 0) | ||
1026 | |||
1027 | /* DA9150_FW_CTRL_E = 0x317 */ | ||
1028 | #define DA9150_FW_FWDL_SEG_SHIFT 0 | ||
1029 | #define DA9150_FW_FWDL_SEG_MASK (0xff << 0) | ||
1030 | |||
1031 | /* DA9150_FW_CTRL_B = 0x318 */ | ||
1032 | #define DA9150_FW_FWDL_VALUE_SHIFT 0 | ||
1033 | #define DA9150_FW_FWDL_VALUE_MASK (0xff << 0) | ||
1034 | |||
1035 | /* DA9150_GPADC_CMAN = 0x320 */ | ||
1036 | #define DA9150_GPADC_CEN_SHIFT 0 | ||
1037 | #define DA9150_GPADC_CEN_MASK BIT(0) | ||
1038 | #define DA9150_GPADC_CMUX_SHIFT 1 | ||
1039 | #define DA9150_GPADC_CMUX_MASK (0x1f << 1) | ||
1040 | |||
1041 | /* DA9150_GPADC_CRES_A = 0x322 */ | ||
1042 | #define DA9150_GPADC_CRES_H_SHIFT 0 | ||
1043 | #define DA9150_GPADC_CRES_H_MASK (0xff << 0) | ||
1044 | |||
1045 | /* DA9150_GPADC_CRES_B = 0x323 */ | ||
1046 | #define DA9150_GPADC_CRUN_SHIFT 0 | ||
1047 | #define DA9150_GPADC_CRUN_MASK BIT(0) | ||
1048 | #define DA9150_GPADC_CRES_L_SHIFT 6 | ||
1049 | #define DA9150_GPADC_CRES_L_MASK (0x03 << 6) | ||
1050 | |||
1051 | /* DA9150_CC_CFG_A = 0x328 */ | ||
1052 | #define DA9150_CC_EN_SHIFT 0 | ||
1053 | #define DA9150_CC_EN_MASK BIT(0) | ||
1054 | #define DA9150_CC_TIMEBASE_SHIFT 1 | ||
1055 | #define DA9150_CC_TIMEBASE_MASK (0x03 << 1) | ||
1056 | #define DA9150_CC_CFG_SHIFT 5 | ||
1057 | #define DA9150_CC_CFG_MASK (0x03 << 5) | ||
1058 | #define DA9150_CC_ENDLESS_MODE_SHIFT 7 | ||
1059 | #define DA9150_CC_ENDLESS_MODE_MASK BIT(7) | ||
1060 | |||
1061 | /* DA9150_CC_CFG_B = 0x329 */ | ||
1062 | #define DA9150_CC_OPT_SHIFT 0 | ||
1063 | #define DA9150_CC_OPT_MASK (0x03 << 0) | ||
1064 | #define DA9150_CC_PREAMP_SHIFT 2 | ||
1065 | #define DA9150_CC_PREAMP_MASK (0x03 << 2) | ||
1066 | |||
1067 | /* DA9150_CC_ICHG_RES_A = 0x32A */ | ||
1068 | #define DA9150_CC_ICHG_RES_H_SHIFT 0 | ||
1069 | #define DA9150_CC_ICHG_RES_H_MASK (0xff << 0) | ||
1070 | |||
1071 | /* DA9150_CC_ICHG_RES_B = 0x32B */ | ||
1072 | #define DA9150_CC_ICHG_RES_L_SHIFT 3 | ||
1073 | #define DA9150_CC_ICHG_RES_L_MASK (0x1f << 3) | ||
1074 | |||
1075 | /* DA9150_CC_IAVG_RES_A = 0x32C */ | ||
1076 | #define DA9150_CC_IAVG_RES_H_SHIFT 0 | ||
1077 | #define DA9150_CC_IAVG_RES_H_MASK (0xff << 0) | ||
1078 | |||
1079 | /* DA9150_CC_IAVG_RES_B = 0x32D */ | ||
1080 | #define DA9150_CC_IAVG_RES_L_SHIFT 0 | ||
1081 | #define DA9150_CC_IAVG_RES_L_MASK (0xff << 0) | ||
1082 | |||
1083 | /* DA9150_TAUX_CTRL_A = 0x330 */ | ||
1084 | #define DA9150_TAUX_EN_SHIFT 0 | ||
1085 | #define DA9150_TAUX_EN_MASK BIT(0) | ||
1086 | #define DA9150_TAUX_MOD_SHIFT 1 | ||
1087 | #define DA9150_TAUX_MOD_MASK BIT(1) | ||
1088 | #define DA9150_TAUX_UPDATE_SHIFT 2 | ||
1089 | #define DA9150_TAUX_UPDATE_MASK BIT(2) | ||
1090 | |||
1091 | /* DA9150_TAUX_RELOAD_H = 0x332 */ | ||
1092 | #define DA9150_TAUX_RLD_H_SHIFT 0 | ||
1093 | #define DA9150_TAUX_RLD_H_MASK (0xff << 0) | ||
1094 | |||
1095 | /* DA9150_TAUX_RELOAD_L = 0x333 */ | ||
1096 | #define DA9150_TAUX_RLD_L_SHIFT 3 | ||
1097 | #define DA9150_TAUX_RLD_L_MASK (0x1f << 3) | ||
1098 | |||
1099 | /* DA9150_TAUX_VALUE_H = 0x334 */ | ||
1100 | #define DA9150_TAUX_VAL_H_SHIFT 0 | ||
1101 | #define DA9150_TAUX_VAL_H_MASK (0xff << 0) | ||
1102 | |||
1103 | /* DA9150_TAUX_VALUE_L = 0x335 */ | ||
1104 | #define DA9150_TAUX_VAL_L_SHIFT 3 | ||
1105 | #define DA9150_TAUX_VAL_L_MASK (0x1f << 3) | ||
1106 | |||
1107 | /* DA9150_AUX_DATA_0 = 0x338 */ | ||
1108 | #define DA9150_AUX_DAT_0_SHIFT 0 | ||
1109 | #define DA9150_AUX_DAT_0_MASK (0xff << 0) | ||
1110 | |||
1111 | /* DA9150_AUX_DATA_1 = 0x339 */ | ||
1112 | #define DA9150_AUX_DAT_1_SHIFT 0 | ||
1113 | #define DA9150_AUX_DAT_1_MASK (0xff << 0) | ||
1114 | |||
1115 | /* DA9150_AUX_DATA_2 = 0x33A */ | ||
1116 | #define DA9150_AUX_DAT_2_SHIFT 0 | ||
1117 | #define DA9150_AUX_DAT_2_MASK (0xff << 0) | ||
1118 | |||
1119 | /* DA9150_AUX_DATA_3 = 0x33B */ | ||
1120 | #define DA9150_AUX_DAT_3_SHIFT 0 | ||
1121 | #define DA9150_AUX_DAT_3_MASK (0xff << 0) | ||
1122 | |||
1123 | /* DA9150_BIF_CTRL = 0x340 */ | ||
1124 | #define DA9150_BIF_ISRC_EN_SHIFT 0 | ||
1125 | #define DA9150_BIF_ISRC_EN_MASK BIT(0) | ||
1126 | |||
1127 | /* DA9150_TBAT_CTRL_A = 0x342 */ | ||
1128 | #define DA9150_TBAT_EN_SHIFT 0 | ||
1129 | #define DA9150_TBAT_EN_MASK BIT(0) | ||
1130 | #define DA9150_TBAT_SW1_SHIFT 1 | ||
1131 | #define DA9150_TBAT_SW1_MASK BIT(1) | ||
1132 | #define DA9150_TBAT_SW2_SHIFT 2 | ||
1133 | #define DA9150_TBAT_SW2_MASK BIT(2) | ||
1134 | |||
1135 | /* DA9150_TBAT_CTRL_B = 0x343 */ | ||
1136 | #define DA9150_TBAT_SW_FRC_SHIFT 0 | ||
1137 | #define DA9150_TBAT_SW_FRC_MASK BIT(0) | ||
1138 | #define DA9150_TBAT_STAT_SW1_SHIFT 1 | ||
1139 | #define DA9150_TBAT_STAT_SW1_MASK BIT(1) | ||
1140 | #define DA9150_TBAT_STAT_SW2_SHIFT 2 | ||
1141 | #define DA9150_TBAT_STAT_SW2_MASK BIT(2) | ||
1142 | #define DA9150_TBAT_HIGH_CURR_SHIFT 3 | ||
1143 | #define DA9150_TBAT_HIGH_CURR_MASK BIT(3) | ||
1144 | |||
1145 | /* DA9150_TBAT_RES_A = 0x344 */ | ||
1146 | #define DA9150_TBAT_RES_H_SHIFT 0 | ||
1147 | #define DA9150_TBAT_RES_H_MASK (0xff << 0) | ||
1148 | |||
1149 | /* DA9150_TBAT_RES_B = 0x345 */ | ||
1150 | #define DA9150_TBAT_RES_DIS_SHIFT 0 | ||
1151 | #define DA9150_TBAT_RES_DIS_MASK BIT(0) | ||
1152 | #define DA9150_TBAT_RES_L_SHIFT 6 | ||
1153 | #define DA9150_TBAT_RES_L_MASK (0x03 << 6) | ||
1154 | |||
1155 | #endif /* __DA9150_REGISTERS_H */ | ||
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h index 960b92ad450d..f5043490d67c 100644 --- a/include/linux/mfd/max77686-private.h +++ b/include/linux/mfd/max77686-private.h | |||
@@ -447,7 +447,6 @@ struct max77686_dev { | |||
447 | struct regmap_irq_chip_data *rtc_irq_data; | 447 | struct regmap_irq_chip_data *rtc_irq_data; |
448 | 448 | ||
449 | int irq; | 449 | int irq; |
450 | bool wakeup; | ||
451 | struct mutex irqlock; | 450 | struct mutex irqlock; |
452 | int irq_masks_cur[MAX77686_IRQ_GROUP_NR]; | 451 | int irq_masks_cur[MAX77686_IRQ_GROUP_NR]; |
453 | int irq_masks_cache[MAX77686_IRQ_GROUP_NR]; | 452 | int irq_masks_cache[MAX77686_IRQ_GROUP_NR]; |
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 553f7d09258a..bb995ab9a575 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
@@ -119,12 +119,6 @@ enum max77802_regulators { | |||
119 | MAX77802_REG_MAX, | 119 | MAX77802_REG_MAX, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct max77686_regulator_data { | ||
123 | int id; | ||
124 | struct regulator_init_data *initdata; | ||
125 | struct device_node *of_node; | ||
126 | }; | ||
127 | |||
128 | enum max77686_opmode { | 122 | enum max77686_opmode { |
129 | MAX77686_OPMODE_NORMAL, | 123 | MAX77686_OPMODE_NORMAL, |
130 | MAX77686_OPMODE_LP, | 124 | MAX77686_OPMODE_LP, |
@@ -136,26 +130,4 @@ struct max77686_opmode_data { | |||
136 | int mode; | 130 | int mode; |
137 | }; | 131 | }; |
138 | 132 | ||
139 | struct max77686_platform_data { | ||
140 | int ono; | ||
141 | int wakeup; | ||
142 | |||
143 | /* ---- PMIC ---- */ | ||
144 | struct max77686_regulator_data *regulators; | ||
145 | int num_regulators; | ||
146 | |||
147 | struct max77686_opmode_data *opmode_data; | ||
148 | |||
149 | /* | ||
150 | * GPIO-DVS feature is not enabled with the current version of | ||
151 | * MAX77686 driver. Buck2/3/4_voltages[0] is used as the default | ||
152 | * voltage at probe. DVS/SELB gpios are set as OUTPUT-LOW. | ||
153 | */ | ||
154 | int buck234_gpio_dvs[3]; /* GPIO of [0]DVS1, [1]DVS2, [2]DVS3 */ | ||
155 | int buck234_gpio_selb[3]; /* [0]SELB2, [1]SELB3, [2]SELB4 */ | ||
156 | unsigned int buck2_voltage[8]; /* buckx_voltage in uV */ | ||
157 | unsigned int buck3_voltage[8]; | ||
158 | unsigned int buck4_voltage[8]; | ||
159 | }; | ||
160 | |||
161 | #endif /* __LINUX_MFD_MAX77686_H */ | 133 | #endif /* __LINUX_MFD_MAX77686_H */ |
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 08dae01258b9..955dd990beaf 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
@@ -143,10 +143,118 @@ enum max77693_pmic_reg { | |||
143 | #define FLASH_INT_FLED1_SHORT BIT(3) | 143 | #define FLASH_INT_FLED1_SHORT BIT(3) |
144 | #define FLASH_INT_OVER_CURRENT BIT(4) | 144 | #define FLASH_INT_OVER_CURRENT BIT(4) |
145 | 145 | ||
146 | /* Fast charge timer in in hours */ | ||
147 | #define DEFAULT_FAST_CHARGE_TIMER 4 | ||
148 | /* microamps */ | ||
149 | #define DEFAULT_TOP_OFF_THRESHOLD_CURRENT 150000 | ||
150 | /* minutes */ | ||
151 | #define DEFAULT_TOP_OFF_TIMER 30 | ||
152 | /* microvolts */ | ||
153 | #define DEFAULT_CONSTANT_VOLT 4200000 | ||
154 | /* microvolts */ | ||
155 | #define DEFAULT_MIN_SYSTEM_VOLT 3600000 | ||
156 | /* celsius */ | ||
157 | #define DEFAULT_THERMAL_REGULATION_TEMP 100 | ||
158 | /* microamps */ | ||
159 | #define DEFAULT_BATTERY_OVERCURRENT 3500000 | ||
160 | /* microvolts */ | ||
161 | #define DEFAULT_CHARGER_INPUT_THRESHOLD_VOLT 4300000 | ||
162 | |||
163 | /* MAX77693_CHG_REG_CHG_INT_OK register */ | ||
164 | #define CHG_INT_OK_BYP_SHIFT 0 | ||
165 | #define CHG_INT_OK_BAT_SHIFT 3 | ||
166 | #define CHG_INT_OK_CHG_SHIFT 4 | ||
167 | #define CHG_INT_OK_CHGIN_SHIFT 6 | ||
168 | #define CHG_INT_OK_DETBAT_SHIFT 7 | ||
169 | #define CHG_INT_OK_BYP_MASK BIT(CHG_INT_OK_BYP_SHIFT) | ||
170 | #define CHG_INT_OK_BAT_MASK BIT(CHG_INT_OK_BAT_SHIFT) | ||
171 | #define CHG_INT_OK_CHG_MASK BIT(CHG_INT_OK_CHG_SHIFT) | ||
172 | #define CHG_INT_OK_CHGIN_MASK BIT(CHG_INT_OK_CHGIN_SHIFT) | ||
173 | #define CHG_INT_OK_DETBAT_MASK BIT(CHG_INT_OK_DETBAT_SHIFT) | ||
174 | |||
175 | /* MAX77693_CHG_REG_CHG_DETAILS_00 register */ | ||
176 | #define CHG_DETAILS_00_CHGIN_SHIFT 5 | ||
177 | #define CHG_DETAILS_00_CHGIN_MASK (0x3 << CHG_DETAILS_00_CHGIN_SHIFT) | ||
178 | |||
179 | /* MAX77693_CHG_REG_CHG_DETAILS_01 register */ | ||
180 | #define CHG_DETAILS_01_CHG_SHIFT 0 | ||
181 | #define CHG_DETAILS_01_BAT_SHIFT 4 | ||
182 | #define CHG_DETAILS_01_TREG_SHIFT 7 | ||
183 | #define CHG_DETAILS_01_CHG_MASK (0xf << CHG_DETAILS_01_CHG_SHIFT) | ||
184 | #define CHG_DETAILS_01_BAT_MASK (0x7 << CHG_DETAILS_01_BAT_SHIFT) | ||
185 | #define CHG_DETAILS_01_TREG_MASK BIT(7) | ||
186 | |||
187 | /* MAX77693_CHG_REG_CHG_DETAILS_01/CHG field */ | ||
188 | enum max77693_charger_charging_state { | ||
189 | MAX77693_CHARGING_PREQUALIFICATION = 0x0, | ||
190 | MAX77693_CHARGING_FAST_CONST_CURRENT, | ||
191 | MAX77693_CHARGING_FAST_CONST_VOLTAGE, | ||
192 | MAX77693_CHARGING_TOP_OFF, | ||
193 | MAX77693_CHARGING_DONE, | ||
194 | MAX77693_CHARGING_HIGH_TEMP, | ||
195 | MAX77693_CHARGING_TIMER_EXPIRED, | ||
196 | MAX77693_CHARGING_THERMISTOR_SUSPEND, | ||
197 | MAX77693_CHARGING_OFF, | ||
198 | MAX77693_CHARGING_RESERVED, | ||
199 | MAX77693_CHARGING_OVER_TEMP, | ||
200 | MAX77693_CHARGING_WATCHDOG_EXPIRED, | ||
201 | }; | ||
202 | |||
203 | /* MAX77693_CHG_REG_CHG_DETAILS_01/BAT field */ | ||
204 | enum max77693_charger_battery_state { | ||
205 | MAX77693_BATTERY_NOBAT = 0x0, | ||
206 | /* Dead-battery or low-battery prequalification */ | ||
207 | MAX77693_BATTERY_PREQUALIFICATION, | ||
208 | MAX77693_BATTERY_TIMER_EXPIRED, | ||
209 | MAX77693_BATTERY_GOOD, | ||
210 | MAX77693_BATTERY_LOWVOLTAGE, | ||
211 | MAX77693_BATTERY_OVERVOLTAGE, | ||
212 | MAX77693_BATTERY_OVERCURRENT, | ||
213 | MAX77693_BATTERY_RESERVED, | ||
214 | }; | ||
215 | |||
216 | /* MAX77693_CHG_REG_CHG_DETAILS_02 register */ | ||
217 | #define CHG_DETAILS_02_BYP_SHIFT 0 | ||
218 | #define CHG_DETAILS_02_BYP_MASK (0xf << CHG_DETAILS_02_BYP_SHIFT) | ||
219 | |||
146 | /* MAX77693 CHG_CNFG_00 register */ | 220 | /* MAX77693 CHG_CNFG_00 register */ |
147 | #define CHG_CNFG_00_CHG_MASK 0x1 | 221 | #define CHG_CNFG_00_CHG_MASK 0x1 |
148 | #define CHG_CNFG_00_BUCK_MASK 0x4 | 222 | #define CHG_CNFG_00_BUCK_MASK 0x4 |
149 | 223 | ||
224 | /* MAX77693_CHG_REG_CHG_CNFG_01 register */ | ||
225 | #define CHG_CNFG_01_FCHGTIME_SHIFT 0 | ||
226 | #define CHG_CNFG_01_CHGRSTRT_SHIFT 4 | ||
227 | #define CHG_CNFG_01_PQEN_SHIFT 7 | ||
228 | #define CHG_CNFG_01_FCHGTIME_MASK (0x7 << CHG_CNFG_01_FCHGTIME_SHIFT) | ||
229 | #define CHG_CNFG_01_CHGRSTRT_MASK (0x3 << CHG_CNFG_01_CHGRSTRT_SHIFT) | ||
230 | #define CHG_CNFG_01_PQEN_MAKS BIT(CHG_CNFG_01_PQEN_SHIFT) | ||
231 | |||
232 | /* MAX77693_CHG_REG_CHG_CNFG_03 register */ | ||
233 | #define CHG_CNFG_03_TOITH_SHIFT 0 | ||
234 | #define CHG_CNFG_03_TOTIME_SHIFT 3 | ||
235 | #define CHG_CNFG_03_TOITH_MASK (0x7 << CHG_CNFG_03_TOITH_SHIFT) | ||
236 | #define CHG_CNFG_03_TOTIME_MASK (0x7 << CHG_CNFG_03_TOTIME_SHIFT) | ||
237 | |||
238 | /* MAX77693_CHG_REG_CHG_CNFG_04 register */ | ||
239 | #define CHG_CNFG_04_CHGCVPRM_SHIFT 0 | ||
240 | #define CHG_CNFG_04_MINVSYS_SHIFT 5 | ||
241 | #define CHG_CNFG_04_CHGCVPRM_MASK (0x1f << CHG_CNFG_04_CHGCVPRM_SHIFT) | ||
242 | #define CHG_CNFG_04_MINVSYS_MASK (0x7 << CHG_CNFG_04_MINVSYS_SHIFT) | ||
243 | |||
244 | /* MAX77693_CHG_REG_CHG_CNFG_06 register */ | ||
245 | #define CHG_CNFG_06_CHGPROT_SHIFT 2 | ||
246 | #define CHG_CNFG_06_CHGPROT_MASK (0x3 << CHG_CNFG_06_CHGPROT_SHIFT) | ||
247 | |||
248 | /* MAX77693_CHG_REG_CHG_CNFG_07 register */ | ||
249 | #define CHG_CNFG_07_REGTEMP_SHIFT 5 | ||
250 | #define CHG_CNFG_07_REGTEMP_MASK (0x3 << CHG_CNFG_07_REGTEMP_SHIFT) | ||
251 | |||
252 | /* MAX77693_CHG_REG_CHG_CNFG_12 register */ | ||
253 | #define CHG_CNFG_12_B2SOVRC_SHIFT 0 | ||
254 | #define CHG_CNFG_12_VCHGINREG_SHIFT 3 | ||
255 | #define CHG_CNFG_12_B2SOVRC_MASK (0x7 << CHG_CNFG_12_B2SOVRC_SHIFT) | ||
256 | #define CHG_CNFG_12_VCHGINREG_MASK (0x3 << CHG_CNFG_12_VCHGINREG_SHIFT) | ||
257 | |||
150 | /* MAX77693 CHG_CNFG_09 Register */ | 258 | /* MAX77693 CHG_CNFG_09 Register */ |
151 | #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F | 259 | #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F |
152 | 260 | ||
diff --git a/include/linux/mfd/qcom_rpm.h b/include/linux/mfd/qcom_rpm.h new file mode 100644 index 000000000000..742ebf1b76ca --- /dev/null +++ b/include/linux/mfd/qcom_rpm.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __QCOM_RPM_H__ | ||
2 | #define __QCOM_RPM_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct qcom_rpm; | ||
7 | |||
8 | #define QCOM_RPM_ACTIVE_STATE 0 | ||
9 | #define QCOM_RPM_SLEEP_STATE 1 | ||
10 | |||
11 | int qcom_rpm_write(struct qcom_rpm *rpm, int state, int resource, u32 *buf, size_t count); | ||
12 | |||
13 | #endif | ||
diff --git a/include/linux/mfd/rt5033-private.h b/include/linux/mfd/rt5033-private.h new file mode 100644 index 000000000000..1b63fc2f42d1 --- /dev/null +++ b/include/linux/mfd/rt5033-private.h | |||
@@ -0,0 +1,260 @@ | |||
1 | /* | ||
2 | * MFD core driver for Richtek RT5033 | ||
3 | * | ||
4 | * Copyright (C) 2014 Samsung Electronics, Co., Ltd. | ||
5 | * Author: Beomho Seo <beomho.seo@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published bythe Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __RT5033_PRIVATE_H__ | ||
13 | #define __RT5033_PRIVATE_H__ | ||
14 | |||
15 | enum rt5033_reg { | ||
16 | RT5033_REG_CHG_STAT = 0x00, | ||
17 | RT5033_REG_CHG_CTRL1 = 0x01, | ||
18 | RT5033_REG_CHG_CTRL2 = 0x02, | ||
19 | RT5033_REG_DEVICE_ID = 0x03, | ||
20 | RT5033_REG_CHG_CTRL3 = 0x04, | ||
21 | RT5033_REG_CHG_CTRL4 = 0x05, | ||
22 | RT5033_REG_CHG_CTRL5 = 0x06, | ||
23 | RT5033_REG_RT_CTRL0 = 0x07, | ||
24 | RT5033_REG_CHG_RESET = 0x08, | ||
25 | /* Reserved 0x09~0x18 */ | ||
26 | RT5033_REG_RT_CTRL1 = 0x19, | ||
27 | /* Reserved 0x1A~0x20 */ | ||
28 | RT5033_REG_FLED_FUNCTION1 = 0x21, | ||
29 | RT5033_REG_FLED_FUNCTION2 = 0x22, | ||
30 | RT5033_REG_FLED_STROBE_CTRL1 = 0x23, | ||
31 | RT5033_REG_FLED_STROBE_CTRL2 = 0x24, | ||
32 | RT5033_REG_FLED_CTRL1 = 0x25, | ||
33 | RT5033_REG_FLED_CTRL2 = 0x26, | ||
34 | RT5033_REG_FLED_CTRL3 = 0x27, | ||
35 | RT5033_REG_FLED_CTRL4 = 0x28, | ||
36 | RT5033_REG_FLED_CTRL5 = 0x29, | ||
37 | /* Reserved 0x2A~0x40 */ | ||
38 | RT5033_REG_CTRL = 0x41, | ||
39 | RT5033_REG_BUCK_CTRL = 0x42, | ||
40 | RT5033_REG_LDO_CTRL = 0x43, | ||
41 | /* Reserved 0x44~0x46 */ | ||
42 | RT5033_REG_MANUAL_RESET_CTRL = 0x47, | ||
43 | /* Reserved 0x48~0x5F */ | ||
44 | RT5033_REG_CHG_IRQ1 = 0x60, | ||
45 | RT5033_REG_CHG_IRQ2 = 0x61, | ||
46 | RT5033_REG_CHG_IRQ3 = 0x62, | ||
47 | RT5033_REG_CHG_IRQ1_CTRL = 0x63, | ||
48 | RT5033_REG_CHG_IRQ2_CTRL = 0x64, | ||
49 | RT5033_REG_CHG_IRQ3_CTRL = 0x65, | ||
50 | RT5033_REG_LED_IRQ_STAT = 0x66, | ||
51 | RT5033_REG_LED_IRQ_CTRL = 0x67, | ||
52 | RT5033_REG_PMIC_IRQ_STAT = 0x68, | ||
53 | RT5033_REG_PMIC_IRQ_CTRL = 0x69, | ||
54 | RT5033_REG_SHDN_CTRL = 0x6A, | ||
55 | RT5033_REG_OFF_EVENT = 0x6B, | ||
56 | |||
57 | RT5033_REG_END, | ||
58 | }; | ||
59 | |||
60 | /* RT5033 Charger state register */ | ||
61 | #define RT5033_CHG_STAT_MASK 0x20 | ||
62 | #define RT5033_CHG_STAT_DISCHARGING 0x00 | ||
63 | #define RT5033_CHG_STAT_FULL 0x10 | ||
64 | #define RT5033_CHG_STAT_CHARGING 0x20 | ||
65 | #define RT5033_CHG_STAT_NOT_CHARGING 0x30 | ||
66 | #define RT5033_CHG_STAT_TYPE_MASK 0x60 | ||
67 | #define RT5033_CHG_STAT_TYPE_PRE 0x20 | ||
68 | #define RT5033_CHG_STAT_TYPE_FAST 0x60 | ||
69 | |||
70 | /* RT5033 CHGCTRL1 register */ | ||
71 | #define RT5033_CHGCTRL1_IAICR_MASK 0xe0 | ||
72 | #define RT5033_CHGCTRL1_MODE_MASK 0x01 | ||
73 | |||
74 | /* RT5033 CHGCTRL2 register */ | ||
75 | #define RT5033_CHGCTRL2_CV_MASK 0xfc | ||
76 | |||
77 | /* RT5033 CHGCTRL3 register */ | ||
78 | #define RT5033_CHGCTRL3_CFO_EN_MASK 0x40 | ||
79 | #define RT5033_CHGCTRL3_TIMER_MASK 0x38 | ||
80 | #define RT5033_CHGCTRL3_TIMER_EN_MASK 0x01 | ||
81 | |||
82 | /* RT5033 CHGCTRL4 register */ | ||
83 | #define RT5033_CHGCTRL4_EOC_MASK 0x07 | ||
84 | #define RT5033_CHGCTRL4_IPREC_MASK 0x18 | ||
85 | |||
86 | /* RT5033 CHGCTRL5 register */ | ||
87 | #define RT5033_CHGCTRL5_VPREC_MASK 0x0f | ||
88 | #define RT5033_CHGCTRL5_ICHG_MASK 0xf0 | ||
89 | #define RT5033_CHGCTRL5_ICHG_SHIFT 0x04 | ||
90 | #define RT5033_CHG_MAX_CURRENT 0x0d | ||
91 | |||
92 | /* RT5033 RT CTRL1 register */ | ||
93 | #define RT5033_RT_CTRL1_UUG_MASK 0x02 | ||
94 | #define RT5033_RT_HZ_MASK 0x01 | ||
95 | |||
96 | /* RT5033 control register */ | ||
97 | #define RT5033_CTRL_FCCM_BUCK_MASK 0x00 | ||
98 | #define RT5033_CTRL_BUCKOMS_MASK 0x01 | ||
99 | #define RT5033_CTRL_LDOOMS_MASK 0x02 | ||
100 | #define RT5033_CTRL_SLDOOMS_MASK 0x03 | ||
101 | #define RT5033_CTRL_EN_BUCK_MASK 0x04 | ||
102 | #define RT5033_CTRL_EN_LDO_MASK 0x05 | ||
103 | #define RT5033_CTRL_EN_SAFE_LDO_MASK 0x06 | ||
104 | #define RT5033_CTRL_LDO_SLEEP_MASK 0x07 | ||
105 | |||
106 | /* RT5033 BUCK control register */ | ||
107 | #define RT5033_BUCK_CTRL_MASK 0x1f | ||
108 | |||
109 | /* RT5033 LDO control register */ | ||
110 | #define RT5033_LDO_CTRL_MASK 0x1f | ||
111 | |||
112 | /* RT5033 charger property - model, manufacturer */ | ||
113 | |||
114 | #define RT5033_CHARGER_MODEL "RT5033WSC Charger" | ||
115 | #define RT5033_MANUFACTURER "Richtek Technology Corporation" | ||
116 | |||
117 | /* | ||
118 | * RT5033 charger fast-charge current lmits (as in CHGCTRL1 register), | ||
119 | * AICR mode limits the input current for example, | ||
120 | * the AIRC 100 mode limits the input current to 100 mA. | ||
121 | */ | ||
122 | #define RT5033_AICR_100_MODE 0x20 | ||
123 | #define RT5033_AICR_500_MODE 0x40 | ||
124 | #define RT5033_AICR_700_MODE 0x60 | ||
125 | #define RT5033_AICR_900_MODE 0x80 | ||
126 | #define RT5033_AICR_1500_MODE 0xc0 | ||
127 | #define RT5033_AICR_2000_MODE 0xe0 | ||
128 | #define RT5033_AICR_MODE_MASK 0xe0 | ||
129 | |||
130 | /* RT5033 use internal timer need to set time */ | ||
131 | #define RT5033_FAST_CHARGE_TIMER4 0x00 | ||
132 | #define RT5033_FAST_CHARGE_TIMER6 0x01 | ||
133 | #define RT5033_FAST_CHARGE_TIMER8 0x02 | ||
134 | #define RT5033_FAST_CHARGE_TIMER9 0x03 | ||
135 | #define RT5033_FAST_CHARGE_TIMER12 0x04 | ||
136 | #define RT5033_FAST_CHARGE_TIMER14 0x05 | ||
137 | #define RT5033_FAST_CHARGE_TIMER16 0x06 | ||
138 | |||
139 | #define RT5033_INT_TIMER_ENABLE 0x01 | ||
140 | |||
141 | /* RT5033 charger termination enable mask */ | ||
142 | #define RT5033_TE_ENABLE_MASK 0x08 | ||
143 | |||
144 | /* | ||
145 | * RT5033 charger opa mode. RT50300 have two opa mode charger mode | ||
146 | * and boost mode for OTG | ||
147 | */ | ||
148 | |||
149 | #define RT5033_CHARGER_MODE 0x00 | ||
150 | #define RT5033_BOOST_MODE 0x01 | ||
151 | |||
152 | /* RT5033 charger termination enable */ | ||
153 | #define RT5033_TE_ENABLE 0x08 | ||
154 | |||
155 | /* RT5033 charger CFO enable */ | ||
156 | #define RT5033_CFO_ENABLE 0x40 | ||
157 | |||
158 | /* RT5033 charger constant charge voltage (as in CHGCTRL2 register), uV */ | ||
159 | #define RT5033_CHARGER_CONST_VOLTAGE_LIMIT_MIN 3650000U | ||
160 | #define RT5033_CHARGER_CONST_VOLTAGE_STEP_NUM 25000U | ||
161 | #define RT5033_CHARGER_CONST_VOLTAGE_LIMIT_MAX 4400000U | ||
162 | |||
163 | /* RT5033 charger pre-charge current limits (as in CHGCTRL4 register), uA */ | ||
164 | #define RT5033_CHARGER_PRE_CURRENT_LIMIT_MIN 350000U | ||
165 | #define RT5033_CHARGER_PRE_CURRENT_STEP_NUM 100000U | ||
166 | #define RT5033_CHARGER_PRE_CURRENT_LIMIT_MAX 650000U | ||
167 | |||
168 | /* RT5033 charger fast-charge current (as in CHGCTRL5 register), uA */ | ||
169 | #define RT5033_CHARGER_FAST_CURRENT_MIN 700000U | ||
170 | #define RT5033_CHARGER_FAST_CURRENT_STEP_NUM 100000U | ||
171 | #define RT5033_CHARGER_FAST_CURRENT_MAX 2000000U | ||
172 | |||
173 | /* | ||
174 | * RT5033 charger const-charge end of charger current ( | ||
175 | * as in CHGCTRL4 register), uA | ||
176 | */ | ||
177 | #define RT5033_CHARGER_EOC_MIN 150000U | ||
178 | #define RT5033_CHARGER_EOC_REF 300000U | ||
179 | #define RT5033_CHARGER_EOC_STEP_NUM1 50000U | ||
180 | #define RT5033_CHARGER_EOC_STEP_NUM2 100000U | ||
181 | #define RT5033_CHARGER_EOC_MAX 600000U | ||
182 | |||
183 | /* | ||
184 | * RT5033 charger pre-charge threshold volt limits | ||
185 | * (as in CHGCTRL5 register), uV | ||
186 | */ | ||
187 | |||
188 | #define RT5033_CHARGER_PRE_THRESHOLD_LIMIT_MIN 2300000U | ||
189 | #define RT5033_CHARGER_PRE_THRESHOLD_STEP_NUM 100000U | ||
190 | #define RT5033_CHARGER_PRE_THRESHOLD_LIMIT_MAX 3800000U | ||
191 | |||
192 | /* | ||
193 | * RT5033 charger enable UUG, If UUG enable MOS auto control by H/W charger | ||
194 | * circuit. | ||
195 | */ | ||
196 | #define RT5033_CHARGER_UUG_ENABLE 0x02 | ||
197 | |||
198 | /* RT5033 charger High impedance mode */ | ||
199 | #define RT5033_CHARGER_HZ_DISABLE 0x00 | ||
200 | #define RT5033_CHARGER_HZ_ENABLE 0x01 | ||
201 | |||
202 | /* RT5033 regulator BUCK output voltage uV */ | ||
203 | #define RT5033_REGULATOR_BUCK_VOLTAGE_MIN 1000000U | ||
204 | #define RT5033_REGULATOR_BUCK_VOLTAGE_MAX 3000000U | ||
205 | #define RT5033_REGULATOR_BUCK_VOLTAGE_STEP 100000U | ||
206 | #define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 32 | ||
207 | |||
208 | /* RT5033 regulator LDO output voltage uV */ | ||
209 | #define RT5033_REGULATOR_LDO_VOLTAGE_MIN 1200000U | ||
210 | #define RT5033_REGULATOR_LDO_VOLTAGE_MAX 3000000U | ||
211 | #define RT5033_REGULATOR_LDO_VOLTAGE_STEP 100000U | ||
212 | #define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 32 | ||
213 | |||
214 | /* RT5033 regulator SAFE LDO output voltage uV */ | ||
215 | #define RT5033_REGULATOR_SAFE_LDO_VOLTAGE 4900000U | ||
216 | |||
217 | enum rt5033_fuel_reg { | ||
218 | RT5033_FUEL_REG_OCV_H = 0x00, | ||
219 | RT5033_FUEL_REG_OCV_L = 0x01, | ||
220 | RT5033_FUEL_REG_VBAT_H = 0x02, | ||
221 | RT5033_FUEL_REG_VBAT_L = 0x03, | ||
222 | RT5033_FUEL_REG_SOC_H = 0x04, | ||
223 | RT5033_FUEL_REG_SOC_L = 0x05, | ||
224 | RT5033_FUEL_REG_CTRL_H = 0x06, | ||
225 | RT5033_FUEL_REG_CTRL_L = 0x07, | ||
226 | RT5033_FUEL_REG_CRATE = 0x08, | ||
227 | RT5033_FUEL_REG_DEVICE_ID = 0x09, | ||
228 | RT5033_FUEL_REG_AVG_VOLT_H = 0x0A, | ||
229 | RT5033_FUEL_REG_AVG_VOLT_L = 0x0B, | ||
230 | RT5033_FUEL_REG_CONFIG_H = 0x0C, | ||
231 | RT5033_FUEL_REG_CONFIG_L = 0x0D, | ||
232 | /* Reserved 0x0E~0x0F */ | ||
233 | RT5033_FUEL_REG_IRQ_CTRL = 0x10, | ||
234 | RT5033_FUEL_REG_IRQ_FLAG = 0x11, | ||
235 | RT5033_FUEL_VMIN = 0x12, | ||
236 | RT5033_FUEL_SMIN = 0x13, | ||
237 | /* Reserved 0x14~0x1F */ | ||
238 | RT5033_FUEL_VGCOMP1 = 0x20, | ||
239 | RT5033_FUEL_VGCOMP2 = 0x21, | ||
240 | RT5033_FUEL_VGCOMP3 = 0x22, | ||
241 | RT5033_FUEL_VGCOMP4 = 0x23, | ||
242 | /* Reserved 0x24~0xFD */ | ||
243 | RT5033_FUEL_MFA_H = 0xFE, | ||
244 | RT5033_FUEL_MFA_L = 0xFF, | ||
245 | |||
246 | RT5033_FUEL_REG_END, | ||
247 | }; | ||
248 | |||
249 | /* RT5033 fuel gauge battery present property */ | ||
250 | #define RT5033_FUEL_BAT_PRESENT 0x02 | ||
251 | |||
252 | /* RT5033 PMIC interrupts */ | ||
253 | #define RT5033_PMIC_IRQ_BUCKOCP 2 | ||
254 | #define RT5033_PMIC_IRQ_BUCKLV 3 | ||
255 | #define RT5033_PMIC_IRQ_SAFELDOLV 4 | ||
256 | #define RT5033_PMIC_IRQ_LDOLV 5 | ||
257 | #define RT5033_PMIC_IRQ_OT 6 | ||
258 | #define RT5033_PMIC_IRQ_VDDA_UV 7 | ||
259 | |||
260 | #endif /* __RT5033_PRIVATE_H__ */ | ||
diff --git a/include/linux/mfd/rt5033.h b/include/linux/mfd/rt5033.h new file mode 100644 index 000000000000..010cff49a98e --- /dev/null +++ b/include/linux/mfd/rt5033.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * MFD core driver for the RT5033 | ||
3 | * | ||
4 | * Copyright (C) 2014 Samsung Electronics | ||
5 | * Author: Beomho Seo <beomho.seo@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published bythe Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __RT5033_H__ | ||
13 | #define __RT5033_H__ | ||
14 | |||
15 | #include <linux/regulator/consumer.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/regmap.h> | ||
18 | #include <linux/power_supply.h> | ||
19 | |||
20 | /* RT5033 regulator IDs */ | ||
21 | enum rt5033_regulators { | ||
22 | RT5033_BUCK = 0, | ||
23 | RT5033_LDO, | ||
24 | RT5033_SAFE_LDO, | ||
25 | |||
26 | RT5033_REGULATOR_NUM, | ||
27 | }; | ||
28 | |||
29 | struct rt5033_dev { | ||
30 | struct device *dev; | ||
31 | |||
32 | struct regmap *regmap; | ||
33 | struct regmap_irq_chip_data *irq_data; | ||
34 | int irq; | ||
35 | bool wakeup; | ||
36 | }; | ||
37 | |||
38 | struct rt5033_battery { | ||
39 | struct i2c_client *client; | ||
40 | struct rt5033_dev *rt5033; | ||
41 | struct regmap *regmap; | ||
42 | struct power_supply psy; | ||
43 | }; | ||
44 | |||
45 | /* RT5033 charger platform data */ | ||
46 | struct rt5033_charger_data { | ||
47 | unsigned int pre_uamp; | ||
48 | unsigned int pre_uvolt; | ||
49 | unsigned int const_uvolt; | ||
50 | unsigned int eoc_uamp; | ||
51 | unsigned int fast_uamp; | ||
52 | }; | ||
53 | |||
54 | struct rt5033_charger { | ||
55 | struct device *dev; | ||
56 | struct rt5033_dev *rt5033; | ||
57 | struct power_supply psy; | ||
58 | |||
59 | struct rt5033_charger_data *chg; | ||
60 | }; | ||
61 | |||
62 | #endif /* __RT5033_H__ */ | ||
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index f742b6717d52..c9d869027300 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
@@ -118,20 +118,6 @@ extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); | |||
118 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) | 118 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) |
119 | 119 | ||
120 | /** | 120 | /** |
121 | * struct stmpe_gpio_platform_data - STMPE GPIO platform data | ||
122 | * @norequest_mask: bitmask specifying which GPIOs should _not_ be | ||
123 | * requestable due to different usage (e.g. touch, keypad) | ||
124 | * STMPE_GPIO_NOREQ_* macros can be used here. | ||
125 | * @setup: board specific setup callback. | ||
126 | * @remove: board specific remove callback | ||
127 | */ | ||
128 | struct stmpe_gpio_platform_data { | ||
129 | unsigned norequest_mask; | ||
130 | void (*setup)(struct stmpe *stmpe, unsigned gpio_base); | ||
131 | void (*remove)(struct stmpe *stmpe, unsigned gpio_base); | ||
132 | }; | ||
133 | |||
134 | /** | ||
135 | * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform | 121 | * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform |
136 | * data | 122 | * data |
137 | * @sample_time: ADC converstion time in number of clock. | 123 | * @sample_time: ADC converstion time in number of clock. |
@@ -182,7 +168,6 @@ struct stmpe_ts_platform_data { | |||
182 | * @irq_over_gpio: true if gpio is used to get irq | 168 | * @irq_over_gpio: true if gpio is used to get irq |
183 | * @irq_gpio: gpio number over which irq will be requested (significant only if | 169 | * @irq_gpio: gpio number over which irq will be requested (significant only if |
184 | * irq_over_gpio is true) | 170 | * irq_over_gpio is true) |
185 | * @gpio: GPIO-specific platform data | ||
186 | * @ts: touchscreen-specific platform data | 171 | * @ts: touchscreen-specific platform data |
187 | */ | 172 | */ |
188 | struct stmpe_platform_data { | 173 | struct stmpe_platform_data { |
@@ -194,7 +179,6 @@ struct stmpe_platform_data { | |||
194 | int irq_gpio; | 179 | int irq_gpio; |
195 | int autosleep_timeout; | 180 | int autosleep_timeout; |
196 | 181 | ||
197 | struct stmpe_gpio_platform_data *gpio; | ||
198 | struct stmpe_ts_platform_data *ts; | 182 | struct stmpe_ts_platform_data *ts; |
199 | }; | 183 | }; |
200 | 184 | ||
diff --git a/include/linux/mfd/syscon/atmel-matrix.h b/include/linux/mfd/syscon/atmel-matrix.h new file mode 100644 index 000000000000..8293c3e2a82a --- /dev/null +++ b/include/linux/mfd/syscon/atmel-matrix.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Atmel Corporation. | ||
3 | * | ||
4 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_MFD_SYSCON_ATMEL_MATRIX_H | ||
13 | #define _LINUX_MFD_SYSCON_ATMEL_MATRIX_H | ||
14 | |||
15 | #define AT91SAM9260_MATRIX_MCFG 0x00 | ||
16 | #define AT91SAM9260_MATRIX_SCFG 0x40 | ||
17 | #define AT91SAM9260_MATRIX_PRS 0x80 | ||
18 | #define AT91SAM9260_MATRIX_MRCR 0x100 | ||
19 | #define AT91SAM9260_MATRIX_EBICSA 0x11c | ||
20 | |||
21 | #define AT91SAM9261_MATRIX_MRCR 0x0 | ||
22 | #define AT91SAM9261_MATRIX_SCFG 0x4 | ||
23 | #define AT91SAM9261_MATRIX_TCR 0x24 | ||
24 | #define AT91SAM9261_MATRIX_EBICSA 0x30 | ||
25 | #define AT91SAM9261_MATRIX_USBPUCR 0x34 | ||
26 | |||
27 | #define AT91SAM9263_MATRIX_MCFG 0x00 | ||
28 | #define AT91SAM9263_MATRIX_SCFG 0x40 | ||
29 | #define AT91SAM9263_MATRIX_PRS 0x80 | ||
30 | #define AT91SAM9263_MATRIX_MRCR 0x100 | ||
31 | #define AT91SAM9263_MATRIX_TCR 0x114 | ||
32 | #define AT91SAM9263_MATRIX_EBI0CSA 0x120 | ||
33 | #define AT91SAM9263_MATRIX_EBI1CSA 0x124 | ||
34 | |||
35 | #define AT91SAM9RL_MATRIX_MCFG 0x00 | ||
36 | #define AT91SAM9RL_MATRIX_SCFG 0x40 | ||
37 | #define AT91SAM9RL_MATRIX_PRS 0x80 | ||
38 | #define AT91SAM9RL_MATRIX_MRCR 0x100 | ||
39 | #define AT91SAM9RL_MATRIX_TCR 0x114 | ||
40 | #define AT91SAM9RL_MATRIX_EBICSA 0x120 | ||
41 | |||
42 | #define AT91SAM9G45_MATRIX_MCFG 0x00 | ||
43 | #define AT91SAM9G45_MATRIX_SCFG 0x40 | ||
44 | #define AT91SAM9G45_MATRIX_PRS 0x80 | ||
45 | #define AT91SAM9G45_MATRIX_MRCR 0x100 | ||
46 | #define AT91SAM9G45_MATRIX_TCR 0x110 | ||
47 | #define AT91SAM9G45_MATRIX_DDRMPR 0x118 | ||
48 | #define AT91SAM9G45_MATRIX_EBICSA 0x128 | ||
49 | |||
50 | #define AT91SAM9N12_MATRIX_MCFG 0x00 | ||
51 | #define AT91SAM9N12_MATRIX_SCFG 0x40 | ||
52 | #define AT91SAM9N12_MATRIX_PRS 0x80 | ||
53 | #define AT91SAM9N12_MATRIX_MRCR 0x100 | ||
54 | #define AT91SAM9N12_MATRIX_EBICSA 0x118 | ||
55 | |||
56 | #define AT91SAM9X5_MATRIX_MCFG 0x00 | ||
57 | #define AT91SAM9X5_MATRIX_SCFG 0x40 | ||
58 | #define AT91SAM9X5_MATRIX_PRS 0x80 | ||
59 | #define AT91SAM9X5_MATRIX_MRCR 0x100 | ||
60 | #define AT91SAM9X5_MATRIX_EBICSA 0x120 | ||
61 | |||
62 | #define SAMA5D3_MATRIX_MCFG 0x00 | ||
63 | #define SAMA5D3_MATRIX_SCFG 0x40 | ||
64 | #define SAMA5D3_MATRIX_PRS 0x80 | ||
65 | #define SAMA5D3_MATRIX_MRCR 0x100 | ||
66 | |||
67 | #define AT91_MATRIX_MCFG(o, x) ((o) + ((x) * 0x4)) | ||
68 | #define AT91_MATRIX_ULBT GENMASK(2, 0) | ||
69 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) | ||
70 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) | ||
71 | #define AT91_MATRIX_ULBT_FOUR (2 << 0) | ||
72 | #define AT91_MATRIX_ULBT_EIGHT (3 << 0) | ||
73 | #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) | ||
74 | |||
75 | #define AT91_MATRIX_SCFG(o, x) ((o) + ((x) * 0x4)) | ||
76 | #define AT91_MATRIX_SLOT_CYCLE GENMASK(7, 0) | ||
77 | #define AT91_MATRIX_DEFMSTR_TYPE GENMASK(17, 16) | ||
78 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | ||
79 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | ||
80 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | ||
81 | #define AT91_MATRIX_FIXED_DEFMSTR GENMASK(20, 18) | ||
82 | #define AT91_MATRIX_ARBT GENMASK(25, 24) | ||
83 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | ||
84 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | ||
85 | |||
86 | #define AT91_MATRIX_ITCM_SIZE GENMASK(3, 0) | ||
87 | #define AT91_MATRIX_ITCM_0 (0 << 0) | ||
88 | #define AT91_MATRIX_ITCM_16 (5 << 0) | ||
89 | #define AT91_MATRIX_ITCM_32 (6 << 0) | ||
90 | #define AT91_MATRIX_ITCM_64 (7 << 0) | ||
91 | #define AT91_MATRIX_DTCM_SIZE GENMASK(7, 4) | ||
92 | #define AT91_MATRIX_DTCM_0 (0 << 4) | ||
93 | #define AT91_MATRIX_DTCM_16 (5 << 4) | ||
94 | #define AT91_MATRIX_DTCM_32 (6 << 4) | ||
95 | #define AT91_MATRIX_DTCM_64 (7 << 4) | ||
96 | |||
97 | #define AT91_MATRIX_PRAS(o, x) ((o) + ((x) * 0x8)) | ||
98 | #define AT91_MATRIX_PRBS(o, x) ((o) + ((x) * 0x8) + 0x4) | ||
99 | #define AT91_MATRIX_MPR(x) GENMASK(((x) * 0x4) + 1, ((x) * 0x4)) | ||
100 | |||
101 | #define AT91_MATRIX_RCB(x) BIT(x) | ||
102 | |||
103 | #define AT91_MATRIX_CSA(cs, val) (val << (cs)) | ||
104 | #define AT91_MATRIX_DBPUC BIT(8) | ||
105 | #define AT91_MATRIX_DBPDC BIT(9) | ||
106 | #define AT91_MATRIX_VDDIOMSEL BIT(16) | ||
107 | #define AT91_MATRIX_VDDIOMSEL_1_8V (0 << 16) | ||
108 | #define AT91_MATRIX_VDDIOMSEL_3_3V (1 << 16) | ||
109 | #define AT91_MATRIX_EBI_IOSR BIT(17) | ||
110 | #define AT91_MATRIX_DDR_IOSR BIT(18) | ||
111 | #define AT91_MATRIX_NFD0_SELECT BIT(24) | ||
112 | #define AT91_MATRIX_DDR_MP_EN BIT(25) | ||
113 | #define AT91_MATRIX_EBI_NUM_CS 8 | ||
114 | |||
115 | #define AT91_MATRIX_USBPUCR_PUON BIT(30) | ||
116 | |||
117 | #endif /* _LINUX_MFD_SYSCON_ATMEL_MATRIX_H */ | ||
diff --git a/include/linux/mfd/syscon/atmel-smc.h b/include/linux/mfd/syscon/atmel-smc.h new file mode 100644 index 000000000000..be6ebe64eebe --- /dev/null +++ b/include/linux/mfd/syscon/atmel-smc.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * Atmel SMC (Static Memory Controller) register offsets and bit definitions. | ||
3 | * | ||
4 | * Copyright (C) 2014 Atmel | ||
5 | * Copyright (C) 2014 Free Electrons | ||
6 | * | ||
7 | * Author: Boris Brezillon <boris.brezillon@free-electrons.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef _LINUX_MFD_SYSCON_ATMEL_SMC_H_ | ||
15 | #define _LINUX_MFD_SYSCON_ATMEL_SMC_H_ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/regmap.h> | ||
19 | |||
20 | #define AT91SAM9_SMC_GENERIC 0x00 | ||
21 | #define AT91SAM9_SMC_GENERIC_BLK_SZ 0x10 | ||
22 | |||
23 | #define SAMA5_SMC_GENERIC 0x600 | ||
24 | #define SAMA5_SMC_GENERIC_BLK_SZ 0x14 | ||
25 | |||
26 | #define AT91SAM9_SMC_SETUP(o) ((o) + 0x00) | ||
27 | #define AT91SAM9_SMC_NWESETUP(x) (x) | ||
28 | #define AT91SAM9_SMC_NCS_WRSETUP(x) ((x) << 8) | ||
29 | #define AT91SAM9_SMC_NRDSETUP(x) ((x) << 16) | ||
30 | #define AT91SAM9_SMC_NCS_NRDSETUP(x) ((x) << 24) | ||
31 | |||
32 | #define AT91SAM9_SMC_PULSE(o) ((o) + 0x04) | ||
33 | #define AT91SAM9_SMC_NWEPULSE(x) (x) | ||
34 | #define AT91SAM9_SMC_NCS_WRPULSE(x) ((x) << 8) | ||
35 | #define AT91SAM9_SMC_NRDPULSE(x) ((x) << 16) | ||
36 | #define AT91SAM9_SMC_NCS_NRDPULSE(x) ((x) << 24) | ||
37 | |||
38 | #define AT91SAM9_SMC_CYCLE(o) ((o) + 0x08) | ||
39 | #define AT91SAM9_SMC_NWECYCLE(x) (x) | ||
40 | #define AT91SAM9_SMC_NRDCYCLE(x) ((x) << 16) | ||
41 | |||
42 | #define AT91SAM9_SMC_MODE(o) ((o) + 0x0c) | ||
43 | #define SAMA5_SMC_MODE(o) ((o) + 0x10) | ||
44 | #define AT91_SMC_READMODE BIT(0) | ||
45 | #define AT91_SMC_READMODE_NCS (0 << 0) | ||
46 | #define AT91_SMC_READMODE_NRD (1 << 0) | ||
47 | #define AT91_SMC_WRITEMODE BIT(1) | ||
48 | #define AT91_SMC_WRITEMODE_NCS (0 << 1) | ||
49 | #define AT91_SMC_WRITEMODE_NWE (1 << 1) | ||
50 | #define AT91_SMC_EXNWMODE GENMASK(5, 4) | ||
51 | #define AT91_SMC_EXNWMODE_DISABLE (0 << 4) | ||
52 | #define AT91_SMC_EXNWMODE_FROZEN (2 << 4) | ||
53 | #define AT91_SMC_EXNWMODE_READY (3 << 4) | ||
54 | #define AT91_SMC_BAT BIT(8) | ||
55 | #define AT91_SMC_BAT_SELECT (0 << 8) | ||
56 | #define AT91_SMC_BAT_WRITE (1 << 8) | ||
57 | #define AT91_SMC_DBW GENMASK(13, 12) | ||
58 | #define AT91_SMC_DBW_8 (0 << 12) | ||
59 | #define AT91_SMC_DBW_16 (1 << 12) | ||
60 | #define AT91_SMC_DBW_32 (2 << 12) | ||
61 | #define AT91_SMC_TDF GENMASK(19, 16) | ||
62 | #define AT91_SMC_TDF_(x) ((((x) - 1) << 16) & AT91_SMC_TDF) | ||
63 | #define AT91_SMC_TDF_MAX 16 | ||
64 | #define AT91_SMC_TDFMODE_OPTIMIZED BIT(20) | ||
65 | #define AT91_SMC_PMEN BIT(24) | ||
66 | #define AT91_SMC_PS GENMASK(29, 28) | ||
67 | #define AT91_SMC_PS_4 (0 << 28) | ||
68 | #define AT91_SMC_PS_8 (1 << 28) | ||
69 | #define AT91_SMC_PS_16 (2 << 28) | ||
70 | #define AT91_SMC_PS_32 (3 << 28) | ||
71 | |||
72 | |||
73 | /* | ||
74 | * This function converts a setup timing expressed in nanoseconds into an | ||
75 | * encoded value that can be written in the SMC_SETUP register. | ||
76 | * | ||
77 | * The following formula is described in atmel datasheets (section | ||
78 | * "SMC Setup Register"): | ||
79 | * | ||
80 | * setup length = (128* SETUP[5] + SETUP[4:0]) | ||
81 | * | ||
82 | * where setup length is the timing expressed in cycles. | ||
83 | */ | ||
84 | static inline u32 at91sam9_smc_setup_ns_to_cycles(unsigned int clk_rate, | ||
85 | u32 timing_ns) | ||
86 | { | ||
87 | u32 clk_period = DIV_ROUND_UP(NSEC_PER_SEC, clk_rate); | ||
88 | u32 coded_cycles = 0; | ||
89 | u32 cycles; | ||
90 | |||
91 | cycles = DIV_ROUND_UP(timing_ns, clk_period); | ||
92 | if (cycles / 32) { | ||
93 | coded_cycles |= 1 << 5; | ||
94 | if (cycles < 128) | ||
95 | cycles = 0; | ||
96 | } | ||
97 | |||
98 | coded_cycles |= cycles % 32; | ||
99 | |||
100 | return coded_cycles; | ||
101 | } | ||
102 | |||
103 | /* | ||
104 | * This function converts a pulse timing expressed in nanoseconds into an | ||
105 | * encoded value that can be written in the SMC_PULSE register. | ||
106 | * | ||
107 | * The following formula is described in atmel datasheets (section | ||
108 | * "SMC Pulse Register"): | ||
109 | * | ||
110 | * pulse length = (256* PULSE[6] + PULSE[5:0]) | ||
111 | * | ||
112 | * where pulse length is the timing expressed in cycles. | ||
113 | */ | ||
114 | static inline u32 at91sam9_smc_pulse_ns_to_cycles(unsigned int clk_rate, | ||
115 | u32 timing_ns) | ||
116 | { | ||
117 | u32 clk_period = DIV_ROUND_UP(NSEC_PER_SEC, clk_rate); | ||
118 | u32 coded_cycles = 0; | ||
119 | u32 cycles; | ||
120 | |||
121 | cycles = DIV_ROUND_UP(timing_ns, clk_period); | ||
122 | if (cycles / 64) { | ||
123 | coded_cycles |= 1 << 6; | ||
124 | if (cycles < 256) | ||
125 | cycles = 0; | ||
126 | } | ||
127 | |||
128 | coded_cycles |= cycles % 64; | ||
129 | |||
130 | return coded_cycles; | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * This function converts a cycle timing expressed in nanoseconds into an | ||
135 | * encoded value that can be written in the SMC_CYCLE register. | ||
136 | * | ||
137 | * The following formula is described in atmel datasheets (section | ||
138 | * "SMC Cycle Register"): | ||
139 | * | ||
140 | * cycle length = (CYCLE[8:7]*256 + CYCLE[6:0]) | ||
141 | * | ||
142 | * where cycle length is the timing expressed in cycles. | ||
143 | */ | ||
144 | static inline u32 at91sam9_smc_cycle_ns_to_cycles(unsigned int clk_rate, | ||
145 | u32 timing_ns) | ||
146 | { | ||
147 | u32 clk_period = DIV_ROUND_UP(NSEC_PER_SEC, clk_rate); | ||
148 | u32 coded_cycles = 0; | ||
149 | u32 cycles; | ||
150 | |||
151 | cycles = DIV_ROUND_UP(timing_ns, clk_period); | ||
152 | if (cycles / 128) { | ||
153 | coded_cycles = cycles / 256; | ||
154 | cycles %= 256; | ||
155 | if (cycles >= 128) { | ||
156 | coded_cycles++; | ||
157 | cycles = 0; | ||
158 | } | ||
159 | |||
160 | if (coded_cycles > 0x3) { | ||
161 | coded_cycles = 0x3; | ||
162 | cycles = 0x7f; | ||
163 | } | ||
164 | |||
165 | coded_cycles <<= 7; | ||
166 | } | ||
167 | |||
168 | coded_cycles |= cycles % 128; | ||
169 | |||
170 | return coded_cycles; | ||
171 | } | ||
172 | |||
173 | #endif /* _LINUX_MFD_SYSCON_ATMEL_SMC_H_ */ | ||
diff --git a/include/linux/mfd/syscon/exynos4-pmu.h b/include/linux/mfd/syscon/exynos4-pmu.h new file mode 100644 index 000000000000..278b1b1549e9 --- /dev/null +++ b/include/linux/mfd/syscon/exynos4-pmu.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Samsung Electronics Co., Ltd. | ||
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 version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_ | ||
10 | #define _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_ | ||
11 | |||
12 | /* Exynos4 PMU register definitions */ | ||
13 | |||
14 | /* MIPI_PHYn_CONTROL register offset: n = 0..1 */ | ||
15 | #define EXYNOS4_MIPI_PHY_CONTROL(n) (0x710 + (n) * 4) | ||
16 | #define EXYNOS4_MIPI_PHY_ENABLE (1 << 0) | ||
17 | #define EXYNOS4_MIPI_PHY_SRESETN (1 << 1) | ||
18 | #define EXYNOS4_MIPI_PHY_MRESETN (1 << 2) | ||
19 | #define EXYNOS4_MIPI_PHY_RESET_MASK (3 << 1) | ||
20 | |||
21 | #endif /* _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_ */ | ||
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h index e1c12d84c26a..c203c9c56776 100644 --- a/include/linux/mfd/tc3589x.h +++ b/include/linux/mfd/tc3589x.h | |||
@@ -163,24 +163,12 @@ struct tc3589x_keypad_platform_data { | |||
163 | }; | 163 | }; |
164 | 164 | ||
165 | /** | 165 | /** |
166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | ||
167 | * @setup: callback for board-specific initialization | ||
168 | * @remove: callback for board-specific teardown | ||
169 | */ | ||
170 | struct tc3589x_gpio_platform_data { | ||
171 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
172 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
173 | }; | ||
174 | |||
175 | /** | ||
176 | * struct tc3589x_platform_data - TC3589x platform data | 166 | * struct tc3589x_platform_data - TC3589x platform data |
177 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | 167 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) |
178 | * @gpio: GPIO-specific platform data | ||
179 | * @keypad: keypad-specific platform data | 168 | * @keypad: keypad-specific platform data |
180 | */ | 169 | */ |
181 | struct tc3589x_platform_data { | 170 | struct tc3589x_platform_data { |
182 | unsigned int block; | 171 | unsigned int block; |
183 | struct tc3589x_gpio_platform_data *gpio; | ||
184 | const struct tc3589x_keypad_platform_data *keypad; | 172 | const struct tc3589x_keypad_platform_data *keypad; |
185 | }; | 173 | }; |
186 | 174 | ||
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index e2e70053470e..3f4e994ace2b 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
@@ -52,6 +52,7 @@ | |||
52 | 52 | ||
53 | /* IRQ enable */ | 53 | /* IRQ enable */ |
54 | #define IRQENB_HW_PEN BIT(0) | 54 | #define IRQENB_HW_PEN BIT(0) |
55 | #define IRQENB_EOS BIT(1) | ||
55 | #define IRQENB_FIFO0THRES BIT(2) | 56 | #define IRQENB_FIFO0THRES BIT(2) |
56 | #define IRQENB_FIFO0OVRRUN BIT(3) | 57 | #define IRQENB_FIFO0OVRRUN BIT(3) |
57 | #define IRQENB_FIFO0UNDRFLW BIT(4) | 58 | #define IRQENB_FIFO0UNDRFLW BIT(4) |
@@ -107,7 +108,7 @@ | |||
107 | /* Charge delay */ | 108 | /* Charge delay */ |
108 | #define CHARGEDLY_OPEN_MASK (0x3FFFF << 0) | 109 | #define CHARGEDLY_OPEN_MASK (0x3FFFF << 0) |
109 | #define CHARGEDLY_OPEN(val) ((val) << 0) | 110 | #define CHARGEDLY_OPEN(val) ((val) << 0) |
110 | #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(1) | 111 | #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(0x400) |
111 | 112 | ||
112 | /* Control register */ | 113 | /* Control register */ |
113 | #define CNTRLREG_TSCSSENB BIT(0) | 114 | #define CNTRLREG_TSCSSENB BIT(0) |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 57388171610d..605812820e48 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -96,11 +96,6 @@ | |||
96 | #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) | 96 | #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) |
97 | 97 | ||
98 | /* | 98 | /* |
99 | * Some controllers have DMA enable/disable register | ||
100 | */ | ||
101 | #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) | ||
102 | |||
103 | /* | ||
104 | * Some controllers allows to set SDx actual clock | 99 | * Some controllers allows to set SDx actual clock |
105 | */ | 100 | */ |
106 | #define TMIO_MMC_CLK_ACTUAL (1 << 10) | 101 | #define TMIO_MMC_CLK_ACTUAL (1 << 10) |
@@ -112,18 +107,6 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | |||
112 | 107 | ||
113 | struct dma_chan; | 108 | struct dma_chan; |
114 | 109 | ||
115 | struct tmio_mmc_dma { | ||
116 | void *chan_priv_tx; | ||
117 | void *chan_priv_rx; | ||
118 | int slave_id_tx; | ||
119 | int slave_id_rx; | ||
120 | int alignment_shift; | ||
121 | dma_addr_t dma_rx_offset; | ||
122 | bool (*filter)(struct dma_chan *chan, void *arg); | ||
123 | }; | ||
124 | |||
125 | struct tmio_mmc_host; | ||
126 | |||
127 | /* | 110 | /* |
128 | * data for the MMC controller | 111 | * data for the MMC controller |
129 | */ | 112 | */ |
@@ -132,19 +115,12 @@ struct tmio_mmc_data { | |||
132 | unsigned long capabilities; | 115 | unsigned long capabilities; |
133 | unsigned long capabilities2; | 116 | unsigned long capabilities2; |
134 | unsigned long flags; | 117 | unsigned long flags; |
135 | unsigned long bus_shift; | ||
136 | u32 ocr_mask; /* available voltages */ | 118 | u32 ocr_mask; /* available voltages */ |
137 | struct tmio_mmc_dma *dma; | ||
138 | struct device *dev; | ||
139 | unsigned int cd_gpio; | 119 | unsigned int cd_gpio; |
120 | int alignment_shift; | ||
121 | dma_addr_t dma_rx_offset; | ||
140 | void (*set_pwr)(struct platform_device *host, int state); | 122 | void (*set_pwr)(struct platform_device *host, int state); |
141 | void (*set_clk_div)(struct platform_device *host, int state); | 123 | void (*set_clk_div)(struct platform_device *host, int state); |
142 | int (*write16_hook)(struct tmio_mmc_host *host, int addr); | ||
143 | /* clock management callbacks */ | ||
144 | int (*clk_enable)(struct platform_device *pdev, unsigned int *f); | ||
145 | void (*clk_disable)(struct platform_device *pdev); | ||
146 | int (*multi_io_quirk)(struct mmc_card *card, | ||
147 | unsigned int direction, int blk_size); | ||
148 | }; | 124 | }; |
149 | 125 | ||
150 | /* | 126 | /* |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index fab9b32ace8e..78baed5f2952 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -67,7 +67,6 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
67 | 67 | ||
68 | #ifdef CONFIG_NUMA_BALANCING | 68 | #ifdef CONFIG_NUMA_BALANCING |
69 | extern bool pmd_trans_migrating(pmd_t pmd); | 69 | extern bool pmd_trans_migrating(pmd_t pmd); |
70 | extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd); | ||
71 | extern int migrate_misplaced_page(struct page *page, | 70 | extern int migrate_misplaced_page(struct page *page, |
72 | struct vm_area_struct *vma, int node); | 71 | struct vm_area_struct *vma, int node); |
73 | extern bool migrate_ratelimited(int node); | 72 | extern bool migrate_ratelimited(int node); |
@@ -76,9 +75,6 @@ static inline bool pmd_trans_migrating(pmd_t pmd) | |||
76 | { | 75 | { |
77 | return false; | 76 | return false; |
78 | } | 77 | } |
79 | static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd) | ||
80 | { | ||
81 | } | ||
82 | static inline int migrate_misplaced_page(struct page *page, | 78 | static inline int migrate_misplaced_page(struct page *page, |
83 | struct vm_area_struct *vma, int node) | 79 | struct vm_area_struct *vma, int node) |
84 | { | 80 | { |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 64d25941b329..7b6d4e9ff603 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -71,6 +71,7 @@ enum { | |||
71 | 71 | ||
72 | /*master notify fw on finish for slave's flr*/ | 72 | /*master notify fw on finish for slave's flr*/ |
73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, | 73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, |
74 | MLX4_CMD_VIRT_PORT_MAP = 0x5c, | ||
74 | MLX4_CMD_GET_OP_REQ = 0x59, | 75 | MLX4_CMD_GET_OP_REQ = 0x59, |
75 | 76 | ||
76 | /* TPT commands */ | 77 | /* TPT commands */ |
@@ -165,9 +166,15 @@ enum { | |||
165 | }; | 166 | }; |
166 | 167 | ||
167 | enum { | 168 | enum { |
168 | MLX4_CMD_TIME_CLASS_A = 10000, | 169 | MLX4_CMD_TIME_CLASS_A = 60000, |
169 | MLX4_CMD_TIME_CLASS_B = 10000, | 170 | MLX4_CMD_TIME_CLASS_B = 60000, |
170 | MLX4_CMD_TIME_CLASS_C = 10000, | 171 | MLX4_CMD_TIME_CLASS_C = 60000, |
172 | }; | ||
173 | |||
174 | enum { | ||
175 | /* virtual to physical port mapping opcode modifiers */ | ||
176 | MLX4_GET_PORT_VIRT2PHY = 0x0, | ||
177 | MLX4_SET_PORT_VIRT2PHY = 0x1, | ||
171 | }; | 178 | }; |
172 | 179 | ||
173 | enum { | 180 | enum { |
@@ -279,6 +286,8 @@ int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_in | |||
279 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); | 286 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); |
280 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, | 287 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, |
281 | struct mlx4_config_dev_params *params); | 288 | struct mlx4_config_dev_params *params); |
289 | void mlx4_cmd_wake_completions(struct mlx4_dev *dev); | ||
290 | void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev); | ||
282 | /* | 291 | /* |
283 | * mlx4_get_slave_default_vlan - | 292 | * mlx4_get_slave_default_vlan - |
284 | * return true if VST ( default vlan) | 293 | * return true if VST ( default vlan) |
@@ -288,5 +297,6 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, | |||
288 | u16 *vlan, u8 *qos); | 297 | u16 *vlan, u8 *qos); |
289 | 298 | ||
290 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) | 299 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) |
300 | #define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17) | ||
291 | 301 | ||
292 | #endif /* MLX4_CMD_H */ | 302 | #endif /* MLX4_CMD_H */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 25c791e295fd..e4ebff7e9d02 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | #include <linux/atomic.h> | 43 | #include <linux/atomic.h> |
44 | 44 | ||
45 | #include <linux/clocksource.h> | 45 | #include <linux/timecounter.h> |
46 | 46 | ||
47 | #define MAX_MSIX_P_PORT 17 | 47 | #define MAX_MSIX_P_PORT 17 |
48 | #define MAX_MSIX 64 | 48 | #define MAX_MSIX 64 |
@@ -70,6 +70,7 @@ enum { | |||
70 | MLX4_FLAG_SLAVE = 1 << 3, | 70 | MLX4_FLAG_SLAVE = 1 << 3, |
71 | MLX4_FLAG_SRIOV = 1 << 4, | 71 | MLX4_FLAG_SRIOV = 1 << 4, |
72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, | 72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, |
73 | MLX4_FLAG_BONDED = 1 << 7 | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | enum { | 76 | enum { |
@@ -97,7 +98,7 @@ enum { | |||
97 | MLX4_MAX_NUM_PF = 16, | 98 | MLX4_MAX_NUM_PF = 16, |
98 | MLX4_MAX_NUM_VF = 126, | 99 | MLX4_MAX_NUM_VF = 126, |
99 | MLX4_MAX_NUM_VF_P_PORT = 64, | 100 | MLX4_MAX_NUM_VF_P_PORT = 64, |
100 | MLX4_MFUNC_MAX = 80, | 101 | MLX4_MFUNC_MAX = 128, |
101 | MLX4_MAX_EQ_NUM = 1024, | 102 | MLX4_MAX_EQ_NUM = 1024, |
102 | MLX4_MFUNC_EQ_NUM = 4, | 103 | MLX4_MFUNC_EQ_NUM = 4, |
103 | MLX4_MFUNC_MAX_EQES = 8, | 104 | MLX4_MFUNC_MAX_EQES = 8, |
@@ -200,7 +201,9 @@ enum { | |||
200 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, | 201 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, |
201 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, | 202 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, |
202 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, | 203 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, |
203 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19 | 204 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19, |
205 | MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20, | ||
206 | MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21 | ||
204 | }; | 207 | }; |
205 | 208 | ||
206 | enum { | 209 | enum { |
@@ -208,6 +211,10 @@ enum { | |||
208 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 | 211 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 |
209 | }; | 212 | }; |
210 | 213 | ||
214 | enum { | ||
215 | MLX4_VF_CAP_FLAG_RESET = 1 << 0 | ||
216 | }; | ||
217 | |||
211 | /* bit enums for an 8-bit flags field indicating special use | 218 | /* bit enums for an 8-bit flags field indicating special use |
212 | * QPs which require special handling in qp_reserve_range. | 219 | * QPs which require special handling in qp_reserve_range. |
213 | * Currently, this only includes QPs used by the ETH interface, | 220 | * Currently, this only includes QPs used by the ETH interface, |
@@ -248,9 +255,14 @@ enum { | |||
248 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 255 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
249 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, | 256 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, |
250 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, | 257 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, |
258 | MLX4_BMME_FLAG_PORT_REMAP = 1 << 24, | ||
251 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, | 259 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, |
252 | }; | 260 | }; |
253 | 261 | ||
262 | enum { | ||
263 | MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP | ||
264 | }; | ||
265 | |||
254 | enum mlx4_event { | 266 | enum mlx4_event { |
255 | MLX4_EVENT_TYPE_COMP = 0x00, | 267 | MLX4_EVENT_TYPE_COMP = 0x00, |
256 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, | 268 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, |
@@ -276,6 +288,7 @@ enum mlx4_event { | |||
276 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, | 288 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, |
277 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, | 289 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, |
278 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, | 290 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, |
291 | MLX4_EVENT_TYPE_RECOVERABLE_ERROR_EVENT = 0x3e, | ||
279 | MLX4_EVENT_TYPE_NONE = 0xff, | 292 | MLX4_EVENT_TYPE_NONE = 0xff, |
280 | }; | 293 | }; |
281 | 294 | ||
@@ -285,6 +298,11 @@ enum { | |||
285 | }; | 298 | }; |
286 | 299 | ||
287 | enum { | 300 | enum { |
301 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_BAD_CABLE = 1, | ||
302 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_UNSUPPORTED_CABLE = 2, | ||
303 | }; | ||
304 | |||
305 | enum { | ||
288 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, | 306 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, |
289 | }; | 307 | }; |
290 | 308 | ||
@@ -411,6 +429,16 @@ enum { | |||
411 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, | 429 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, |
412 | }; | 430 | }; |
413 | 431 | ||
432 | enum { | ||
433 | MLX4_DEVICE_STATE_UP = 1 << 0, | ||
434 | MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, | ||
435 | }; | ||
436 | |||
437 | enum { | ||
438 | MLX4_INTERFACE_STATE_UP = 1 << 0, | ||
439 | MLX4_INTERFACE_STATE_DELETION = 1 << 1, | ||
440 | }; | ||
441 | |||
414 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ | 442 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ |
415 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) | 443 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) |
416 | 444 | ||
@@ -535,6 +563,7 @@ struct mlx4_caps { | |||
535 | u8 alloc_res_qp_mask; | 563 | u8 alloc_res_qp_mask; |
536 | u32 dmfs_high_rate_qpn_base; | 564 | u32 dmfs_high_rate_qpn_base; |
537 | u32 dmfs_high_rate_qpn_range; | 565 | u32 dmfs_high_rate_qpn_range; |
566 | u32 vf_caps; | ||
538 | }; | 567 | }; |
539 | 568 | ||
540 | struct mlx4_buf_list { | 569 | struct mlx4_buf_list { |
@@ -660,6 +689,8 @@ struct mlx4_cq { | |||
660 | void (*comp)(struct mlx4_cq *); | 689 | void (*comp)(struct mlx4_cq *); |
661 | void *priv; | 690 | void *priv; |
662 | } tasklet_ctx; | 691 | } tasklet_ctx; |
692 | int reset_notify_added; | ||
693 | struct list_head reset_notify; | ||
663 | }; | 694 | }; |
664 | 695 | ||
665 | struct mlx4_qp { | 696 | struct mlx4_qp { |
@@ -744,8 +775,23 @@ struct mlx4_vf_dev { | |||
744 | u8 n_ports; | 775 | u8 n_ports; |
745 | }; | 776 | }; |
746 | 777 | ||
747 | struct mlx4_dev { | 778 | struct mlx4_dev_persistent { |
748 | struct pci_dev *pdev; | 779 | struct pci_dev *pdev; |
780 | struct mlx4_dev *dev; | ||
781 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
782 | int num_vfs; | ||
783 | enum mlx4_port_type curr_port_type[MLX4_MAX_PORTS + 1]; | ||
784 | enum mlx4_port_type curr_port_poss_type[MLX4_MAX_PORTS + 1]; | ||
785 | struct work_struct catas_work; | ||
786 | struct workqueue_struct *catas_wq; | ||
787 | struct mutex device_state_mutex; /* protect HW state */ | ||
788 | u8 state; | ||
789 | struct mutex interface_state_mutex; /* protect SW state */ | ||
790 | u8 interface_state; | ||
791 | }; | ||
792 | |||
793 | struct mlx4_dev { | ||
794 | struct mlx4_dev_persistent *persist; | ||
749 | unsigned long flags; | 795 | unsigned long flags; |
750 | unsigned long num_slaves; | 796 | unsigned long num_slaves; |
751 | struct mlx4_caps caps; | 797 | struct mlx4_caps caps; |
@@ -754,13 +800,11 @@ struct mlx4_dev { | |||
754 | struct radix_tree_root qp_table_tree; | 800 | struct radix_tree_root qp_table_tree; |
755 | u8 rev_id; | 801 | u8 rev_id; |
756 | char board_id[MLX4_BOARD_ID_LEN]; | 802 | char board_id[MLX4_BOARD_ID_LEN]; |
757 | int num_vfs; | ||
758 | int numa_node; | 803 | int numa_node; |
759 | int oper_log_mgm_entry_size; | 804 | int oper_log_mgm_entry_size; |
760 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; | 805 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; |
761 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; | 806 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; |
762 | struct mlx4_vf_dev *dev_vfs; | 807 | struct mlx4_vf_dev *dev_vfs; |
763 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
764 | }; | 808 | }; |
765 | 809 | ||
766 | struct mlx4_eqe { | 810 | struct mlx4_eqe { |
@@ -832,6 +876,11 @@ struct mlx4_eqe { | |||
832 | } __packed tbl_change_info; | 876 | } __packed tbl_change_info; |
833 | } params; | 877 | } params; |
834 | } __packed port_mgmt_change; | 878 | } __packed port_mgmt_change; |
879 | struct { | ||
880 | u8 reserved[3]; | ||
881 | u8 port; | ||
882 | u32 reserved1[5]; | ||
883 | } __packed bad_cable; | ||
835 | } event; | 884 | } event; |
836 | u8 slave_id; | 885 | u8 slave_id; |
837 | u8 reserved3[2]; | 886 | u8 reserved3[2]; |
@@ -1338,6 +1387,8 @@ int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); | |||
1338 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); | 1387 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); |
1339 | 1388 | ||
1340 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); | 1389 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); |
1390 | int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis); | ||
1391 | int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2); | ||
1341 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); | 1392 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); |
1342 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); | 1393 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); |
1343 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, | 1394 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 022055c8fb26..9553a73d2049 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -49,6 +49,10 @@ enum mlx4_dev_event { | |||
49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, | 49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | enum { | ||
53 | MLX4_INTFF_BONDING = 1 << 0 | ||
54 | }; | ||
55 | |||
52 | struct mlx4_interface { | 56 | struct mlx4_interface { |
53 | void * (*add) (struct mlx4_dev *dev); | 57 | void * (*add) (struct mlx4_dev *dev); |
54 | void (*remove)(struct mlx4_dev *dev, void *context); | 58 | void (*remove)(struct mlx4_dev *dev, void *context); |
@@ -57,11 +61,26 @@ struct mlx4_interface { | |||
57 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | 61 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); |
58 | struct list_head list; | 62 | struct list_head list; |
59 | enum mlx4_protocol protocol; | 63 | enum mlx4_protocol protocol; |
64 | int flags; | ||
60 | }; | 65 | }; |
61 | 66 | ||
62 | int mlx4_register_interface(struct mlx4_interface *intf); | 67 | int mlx4_register_interface(struct mlx4_interface *intf); |
63 | void mlx4_unregister_interface(struct mlx4_interface *intf); | 68 | void mlx4_unregister_interface(struct mlx4_interface *intf); |
64 | 69 | ||
70 | int mlx4_bond(struct mlx4_dev *dev); | ||
71 | int mlx4_unbond(struct mlx4_dev *dev); | ||
72 | static inline int mlx4_is_bonded(struct mlx4_dev *dev) | ||
73 | { | ||
74 | return !!(dev->flags & MLX4_FLAG_BONDED); | ||
75 | } | ||
76 | |||
77 | struct mlx4_port_map { | ||
78 | u8 port1; | ||
79 | u8 port2; | ||
80 | }; | ||
81 | |||
82 | int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p); | ||
83 | |||
65 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); | 84 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); |
66 | 85 | ||
67 | static inline u64 mlx4_mac_to_u64(u8 *addr) | 86 | static inline u64 mlx4_mac_to_u64(u8 *addr) |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 467ccdf94c98..2bbc62aa818a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -96,6 +96,7 @@ enum { | |||
96 | MLX4_QP_BIT_RRE = 1 << 15, | 96 | MLX4_QP_BIT_RRE = 1 << 15, |
97 | MLX4_QP_BIT_RWE = 1 << 14, | 97 | MLX4_QP_BIT_RWE = 1 << 14, |
98 | MLX4_QP_BIT_RAE = 1 << 13, | 98 | MLX4_QP_BIT_RAE = 1 << 13, |
99 | MLX4_QP_BIT_FPP = 1 << 3, | ||
99 | MLX4_QP_BIT_RIC = 1 << 4, | 100 | MLX4_QP_BIT_RIC = 1 << 4, |
100 | }; | 101 | }; |
101 | 102 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index dd5ea3016fc4..47a93928b90f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -138,7 +138,6 @@ extern unsigned int kobjsize(const void *objp); | |||
138 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 138 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
139 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | 139 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ |
140 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 140 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
141 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | ||
142 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ | 141 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ |
143 | #define VM_ARCH_2 0x02000000 | 142 | #define VM_ARCH_2 0x02000000 |
144 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ | 143 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ |
@@ -206,27 +205,26 @@ extern unsigned int kobjsize(const void *objp); | |||
206 | extern pgprot_t protection_map[16]; | 205 | extern pgprot_t protection_map[16]; |
207 | 206 | ||
208 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 207 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
209 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 208 | #define FAULT_FLAG_MKWRITE 0x02 /* Fault was mkwrite of existing pte */ |
210 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 209 | #define FAULT_FLAG_ALLOW_RETRY 0x04 /* Retry fault if blocking */ |
211 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | 210 | #define FAULT_FLAG_RETRY_NOWAIT 0x08 /* Don't drop mmap_sem and wait when retrying */ |
212 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ | 211 | #define FAULT_FLAG_KILLABLE 0x10 /* The fault task is in SIGKILL killable region */ |
213 | #define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ | 212 | #define FAULT_FLAG_TRIED 0x20 /* Second try */ |
214 | #define FAULT_FLAG_TRIED 0x40 /* second try */ | 213 | #define FAULT_FLAG_USER 0x40 /* The fault originated in userspace */ |
215 | #define FAULT_FLAG_USER 0x80 /* The fault originated in userspace */ | ||
216 | 214 | ||
217 | /* | 215 | /* |
218 | * vm_fault is filled by the the pagefault handler and passed to the vma's | 216 | * vm_fault is filled by the the pagefault handler and passed to the vma's |
219 | * ->fault function. The vma's ->fault is responsible for returning a bitmask | 217 | * ->fault function. The vma's ->fault is responsible for returning a bitmask |
220 | * of VM_FAULT_xxx flags that give details about how the fault was handled. | 218 | * of VM_FAULT_xxx flags that give details about how the fault was handled. |
221 | * | 219 | * |
222 | * pgoff should be used in favour of virtual_address, if possible. If pgoff | 220 | * pgoff should be used in favour of virtual_address, if possible. |
223 | * is used, one may implement ->remap_pages to get nonlinear mapping support. | ||
224 | */ | 221 | */ |
225 | struct vm_fault { | 222 | struct vm_fault { |
226 | unsigned int flags; /* FAULT_FLAG_xxx flags */ | 223 | unsigned int flags; /* FAULT_FLAG_xxx flags */ |
227 | pgoff_t pgoff; /* Logical page offset based on vma */ | 224 | pgoff_t pgoff; /* Logical page offset based on vma */ |
228 | void __user *virtual_address; /* Faulting virtual address */ | 225 | void __user *virtual_address; /* Faulting virtual address */ |
229 | 226 | ||
227 | struct page *cow_page; /* Handler may choose to COW */ | ||
230 | struct page *page; /* ->fault handlers should return a | 228 | struct page *page; /* ->fault handlers should return a |
231 | * page here, unless VM_FAULT_NOPAGE | 229 | * page here, unless VM_FAULT_NOPAGE |
232 | * is set (which is also implied by | 230 | * is set (which is also implied by |
@@ -287,9 +285,13 @@ struct vm_operations_struct { | |||
287 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 285 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
288 | unsigned long addr); | 286 | unsigned long addr); |
289 | #endif | 287 | #endif |
290 | /* called by sys_remap_file_pages() to populate non-linear mapping */ | 288 | /* |
291 | int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, | 289 | * Called by vm_normal_page() for special PTEs to find the |
292 | unsigned long size, pgoff_t pgoff); | 290 | * page for @addr. This is useful if the default behavior |
291 | * (using pte_page()) would not find the correct page. | ||
292 | */ | ||
293 | struct page *(*find_special_page)(struct vm_area_struct *vma, | ||
294 | unsigned long addr); | ||
293 | }; | 295 | }; |
294 | 296 | ||
295 | struct mmu_gather; | 297 | struct mmu_gather; |
@@ -446,6 +448,12 @@ static inline struct page *compound_head_by_tail(struct page *tail) | |||
446 | return tail; | 448 | return tail; |
447 | } | 449 | } |
448 | 450 | ||
451 | /* | ||
452 | * Since either compound page could be dismantled asynchronously in THP | ||
453 | * or we access asynchronously arbitrary positioned struct page, there | ||
454 | * would be tail flag race. To handle this race, we should call | ||
455 | * smp_rmb() before checking tail flag. compound_head_by_tail() did it. | ||
456 | */ | ||
449 | static inline struct page *compound_head(struct page *page) | 457 | static inline struct page *compound_head(struct page *page) |
450 | { | 458 | { |
451 | if (unlikely(PageTail(page))) | 459 | if (unlikely(PageTail(page))) |
@@ -454,6 +462,18 @@ static inline struct page *compound_head(struct page *page) | |||
454 | } | 462 | } |
455 | 463 | ||
456 | /* | 464 | /* |
465 | * If we access compound page synchronously such as access to | ||
466 | * allocated page, there is no need to handle tail flag race, so we can | ||
467 | * check tail flag directly without any synchronization primitive. | ||
468 | */ | ||
469 | static inline struct page *compound_head_fast(struct page *page) | ||
470 | { | ||
471 | if (unlikely(PageTail(page))) | ||
472 | return page->first_page; | ||
473 | return page; | ||
474 | } | ||
475 | |||
476 | /* | ||
457 | * The atomic page->_mapcount, starts from -1: so that transitions | 477 | * The atomic page->_mapcount, starts from -1: so that transitions |
458 | * both from it and to it can be tracked, using atomic_inc_and_test | 478 | * both from it and to it can be tracked, using atomic_inc_and_test |
459 | * and atomic_add_negative(-1). | 479 | * and atomic_add_negative(-1). |
@@ -465,7 +485,8 @@ static inline void page_mapcount_reset(struct page *page) | |||
465 | 485 | ||
466 | static inline int page_mapcount(struct page *page) | 486 | static inline int page_mapcount(struct page *page) |
467 | { | 487 | { |
468 | return atomic_read(&(page)->_mapcount) + 1; | 488 | VM_BUG_ON_PAGE(PageSlab(page), page); |
489 | return atomic_read(&page->_mapcount) + 1; | ||
469 | } | 490 | } |
470 | 491 | ||
471 | static inline int page_count(struct page *page) | 492 | static inline int page_count(struct page *page) |
@@ -531,7 +552,14 @@ static inline void get_page(struct page *page) | |||
531 | static inline struct page *virt_to_head_page(const void *x) | 552 | static inline struct page *virt_to_head_page(const void *x) |
532 | { | 553 | { |
533 | struct page *page = virt_to_page(x); | 554 | struct page *page = virt_to_page(x); |
534 | return compound_head(page); | 555 | |
556 | /* | ||
557 | * We don't need to worry about synchronization of tail flag | ||
558 | * when we call virt_to_head_page() since it is only called for | ||
559 | * already allocated page and this page won't be freed until | ||
560 | * this virt_to_head_page() is finished. So use _fast variant. | ||
561 | */ | ||
562 | return compound_head_fast(page); | ||
535 | } | 563 | } |
536 | 564 | ||
537 | /* | 565 | /* |
@@ -601,29 +629,28 @@ int split_free_page(struct page *page); | |||
601 | * prototype for that function and accessor functions. | 629 | * prototype for that function and accessor functions. |
602 | * These are _only_ valid on the head of a PG_compound page. | 630 | * These are _only_ valid on the head of a PG_compound page. |
603 | */ | 631 | */ |
604 | typedef void compound_page_dtor(struct page *); | ||
605 | 632 | ||
606 | static inline void set_compound_page_dtor(struct page *page, | 633 | static inline void set_compound_page_dtor(struct page *page, |
607 | compound_page_dtor *dtor) | 634 | compound_page_dtor *dtor) |
608 | { | 635 | { |
609 | page[1].lru.next = (void *)dtor; | 636 | page[1].compound_dtor = dtor; |
610 | } | 637 | } |
611 | 638 | ||
612 | static inline compound_page_dtor *get_compound_page_dtor(struct page *page) | 639 | static inline compound_page_dtor *get_compound_page_dtor(struct page *page) |
613 | { | 640 | { |
614 | return (compound_page_dtor *)page[1].lru.next; | 641 | return page[1].compound_dtor; |
615 | } | 642 | } |
616 | 643 | ||
617 | static inline int compound_order(struct page *page) | 644 | static inline int compound_order(struct page *page) |
618 | { | 645 | { |
619 | if (!PageHead(page)) | 646 | if (!PageHead(page)) |
620 | return 0; | 647 | return 0; |
621 | return (unsigned long)page[1].lru.prev; | 648 | return page[1].compound_order; |
622 | } | 649 | } |
623 | 650 | ||
624 | static inline void set_compound_order(struct page *page, unsigned long order) | 651 | static inline void set_compound_order(struct page *page, unsigned long order) |
625 | { | 652 | { |
626 | page[1].lru.prev = (void *)order; | 653 | page[1].compound_order = order; |
627 | } | 654 | } |
628 | 655 | ||
629 | #ifdef CONFIG_MMU | 656 | #ifdef CONFIG_MMU |
@@ -1121,7 +1148,6 @@ extern void user_shm_unlock(size_t, struct user_struct *); | |||
1121 | * Parameter block passed down to zap_pte_range in exceptional cases. | 1148 | * Parameter block passed down to zap_pte_range in exceptional cases. |
1122 | */ | 1149 | */ |
1123 | struct zap_details { | 1150 | struct zap_details { |
1124 | struct vm_area_struct *nonlinear_vma; /* Check page->index if set */ | ||
1125 | struct address_space *check_mapping; /* Check page->mapping if set */ | 1151 | struct address_space *check_mapping; /* Check page->mapping if set */ |
1126 | pgoff_t first_index; /* Lowest page->index to unmap */ | 1152 | pgoff_t first_index; /* Lowest page->index to unmap */ |
1127 | pgoff_t last_index; /* Highest page->index to unmap */ | 1153 | pgoff_t last_index; /* Highest page->index to unmap */ |
@@ -1139,8 +1165,6 @@ void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma, | |||
1139 | 1165 | ||
1140 | /** | 1166 | /** |
1141 | * mm_walk - callbacks for walk_page_range | 1167 | * mm_walk - callbacks for walk_page_range |
1142 | * @pgd_entry: if set, called for each non-empty PGD (top-level) entry | ||
1143 | * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry | ||
1144 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | 1168 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry |
1145 | * this handler is required to be able to handle | 1169 | * this handler is required to be able to handle |
1146 | * pmd_trans_huge() pmds. They may simply choose to | 1170 | * pmd_trans_huge() pmds. They may simply choose to |
@@ -1148,16 +1172,18 @@ void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma, | |||
1148 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | 1172 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry |
1149 | * @pte_hole: if set, called for each hole at all levels | 1173 | * @pte_hole: if set, called for each hole at all levels |
1150 | * @hugetlb_entry: if set, called for each hugetlb entry | 1174 | * @hugetlb_entry: if set, called for each hugetlb entry |
1151 | * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry | 1175 | * @test_walk: caller specific callback function to determine whether |
1152 | * is used. | 1176 | * we walk over the current vma or not. A positive returned |
1177 | * value means "do page table walk over the current vma," | ||
1178 | * and a negative one means "abort current page table walk | ||
1179 | * right now." 0 means "skip the current vma." | ||
1180 | * @mm: mm_struct representing the target process of page table walk | ||
1181 | * @vma: vma currently walked (NULL if walking outside vmas) | ||
1182 | * @private: private data for callbacks' usage | ||
1153 | * | 1183 | * |
1154 | * (see walk_page_range for more details) | 1184 | * (see the comment on walk_page_range() for more details) |
1155 | */ | 1185 | */ |
1156 | struct mm_walk { | 1186 | struct mm_walk { |
1157 | int (*pgd_entry)(pgd_t *pgd, unsigned long addr, | ||
1158 | unsigned long next, struct mm_walk *walk); | ||
1159 | int (*pud_entry)(pud_t *pud, unsigned long addr, | ||
1160 | unsigned long next, struct mm_walk *walk); | ||
1161 | int (*pmd_entry)(pmd_t *pmd, unsigned long addr, | 1187 | int (*pmd_entry)(pmd_t *pmd, unsigned long addr, |
1162 | unsigned long next, struct mm_walk *walk); | 1188 | unsigned long next, struct mm_walk *walk); |
1163 | int (*pte_entry)(pte_t *pte, unsigned long addr, | 1189 | int (*pte_entry)(pte_t *pte, unsigned long addr, |
@@ -1167,12 +1193,16 @@ struct mm_walk { | |||
1167 | int (*hugetlb_entry)(pte_t *pte, unsigned long hmask, | 1193 | int (*hugetlb_entry)(pte_t *pte, unsigned long hmask, |
1168 | unsigned long addr, unsigned long next, | 1194 | unsigned long addr, unsigned long next, |
1169 | struct mm_walk *walk); | 1195 | struct mm_walk *walk); |
1196 | int (*test_walk)(unsigned long addr, unsigned long next, | ||
1197 | struct mm_walk *walk); | ||
1170 | struct mm_struct *mm; | 1198 | struct mm_struct *mm; |
1199 | struct vm_area_struct *vma; | ||
1171 | void *private; | 1200 | void *private; |
1172 | }; | 1201 | }; |
1173 | 1202 | ||
1174 | int walk_page_range(unsigned long addr, unsigned long end, | 1203 | int walk_page_range(unsigned long addr, unsigned long end, |
1175 | struct mm_walk *walk); | 1204 | struct mm_walk *walk); |
1205 | int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk); | ||
1176 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, | 1206 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
1177 | unsigned long end, unsigned long floor, unsigned long ceiling); | 1207 | unsigned long end, unsigned long floor, unsigned long ceiling); |
1178 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | 1208 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, |
@@ -1236,6 +1266,17 @@ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1236 | unsigned long start, unsigned long nr_pages, | 1266 | unsigned long start, unsigned long nr_pages, |
1237 | int write, int force, struct page **pages, | 1267 | int write, int force, struct page **pages, |
1238 | struct vm_area_struct **vmas); | 1268 | struct vm_area_struct **vmas); |
1269 | long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm, | ||
1270 | unsigned long start, unsigned long nr_pages, | ||
1271 | int write, int force, struct page **pages, | ||
1272 | int *locked); | ||
1273 | long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | ||
1274 | unsigned long start, unsigned long nr_pages, | ||
1275 | int write, int force, struct page **pages, | ||
1276 | unsigned int gup_flags); | ||
1277 | long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | ||
1278 | unsigned long start, unsigned long nr_pages, | ||
1279 | int write, int force, struct page **pages); | ||
1239 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 1280 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
1240 | struct page **pages); | 1281 | struct page **pages); |
1241 | struct kvec; | 1282 | struct kvec; |
@@ -1368,6 +1409,11 @@ static inline void update_hiwater_vm(struct mm_struct *mm) | |||
1368 | mm->hiwater_vm = mm->total_vm; | 1409 | mm->hiwater_vm = mm->total_vm; |
1369 | } | 1410 | } |
1370 | 1411 | ||
1412 | static inline void reset_mm_hiwater_rss(struct mm_struct *mm) | ||
1413 | { | ||
1414 | mm->hiwater_rss = get_mm_rss(mm); | ||
1415 | } | ||
1416 | |||
1371 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | 1417 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, |
1372 | struct mm_struct *mm) | 1418 | struct mm_struct *mm) |
1373 | { | 1419 | { |
@@ -1407,14 +1453,45 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | |||
1407 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | 1453 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); |
1408 | #endif | 1454 | #endif |
1409 | 1455 | ||
1410 | #ifdef __PAGETABLE_PMD_FOLDED | 1456 | #if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU) |
1411 | static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, | 1457 | static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, |
1412 | unsigned long address) | 1458 | unsigned long address) |
1413 | { | 1459 | { |
1414 | return 0; | 1460 | return 0; |
1415 | } | 1461 | } |
1462 | |||
1463 | static inline void mm_nr_pmds_init(struct mm_struct *mm) {} | ||
1464 | |||
1465 | static inline unsigned long mm_nr_pmds(struct mm_struct *mm) | ||
1466 | { | ||
1467 | return 0; | ||
1468 | } | ||
1469 | |||
1470 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) {} | ||
1471 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) {} | ||
1472 | |||
1416 | #else | 1473 | #else |
1417 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | 1474 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
1475 | |||
1476 | static inline void mm_nr_pmds_init(struct mm_struct *mm) | ||
1477 | { | ||
1478 | atomic_long_set(&mm->nr_pmds, 0); | ||
1479 | } | ||
1480 | |||
1481 | static inline unsigned long mm_nr_pmds(struct mm_struct *mm) | ||
1482 | { | ||
1483 | return atomic_long_read(&mm->nr_pmds); | ||
1484 | } | ||
1485 | |||
1486 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) | ||
1487 | { | ||
1488 | atomic_long_inc(&mm->nr_pmds); | ||
1489 | } | ||
1490 | |||
1491 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) | ||
1492 | { | ||
1493 | atomic_long_dec(&mm->nr_pmds); | ||
1494 | } | ||
1418 | #endif | 1495 | #endif |
1419 | 1496 | ||
1420 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, | 1497 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
@@ -1777,12 +1854,6 @@ struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node, | |||
1777 | for (vma = vma_interval_tree_iter_first(root, start, last); \ | 1854 | for (vma = vma_interval_tree_iter_first(root, start, last); \ |
1778 | vma; vma = vma_interval_tree_iter_next(vma, start, last)) | 1855 | vma; vma = vma_interval_tree_iter_next(vma, start, last)) |
1779 | 1856 | ||
1780 | static inline void vma_nonlinear_insert(struct vm_area_struct *vma, | ||
1781 | struct list_head *list) | ||
1782 | { | ||
1783 | list_add_tail(&vma->shared.nonlinear, list); | ||
1784 | } | ||
1785 | |||
1786 | void anon_vma_interval_tree_insert(struct anon_vma_chain *node, | 1857 | void anon_vma_interval_tree_insert(struct anon_vma_chain *node, |
1787 | struct rb_root *root); | 1858 | struct rb_root *root); |
1788 | void anon_vma_interval_tree_remove(struct anon_vma_chain *node, | 1859 | void anon_vma_interval_tree_remove(struct anon_vma_chain *node, |
@@ -2110,9 +2181,8 @@ int drop_caches_sysctl_handler(struct ctl_table *, int, | |||
2110 | void __user *, size_t *, loff_t *); | 2181 | void __user *, size_t *, loff_t *); |
2111 | #endif | 2182 | #endif |
2112 | 2183 | ||
2113 | unsigned long shrink_node_slabs(gfp_t gfp_mask, int nid, | 2184 | void drop_slab(void); |
2114 | unsigned long nr_scanned, | 2185 | void drop_slab_node(int nid); |
2115 | unsigned long nr_eligible); | ||
2116 | 2186 | ||
2117 | #ifndef CONFIG_MMU | 2187 | #ifndef CONFIG_MMU |
2118 | #define randomize_va_space 0 | 2188 | #define randomize_va_space 0 |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 6d34aa266a8c..199a03aab8dc 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -28,6 +28,8 @@ struct mem_cgroup; | |||
28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) | 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) |
29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) | 29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) |
30 | 30 | ||
31 | typedef void compound_page_dtor(struct page *); | ||
32 | |||
31 | /* | 33 | /* |
32 | * Each physical page in the system has a struct page associated with | 34 | * Each physical page in the system has a struct page associated with |
33 | * it to keep track of whatever it is we are using the page for at the | 35 | * it to keep track of whatever it is we are using the page for at the |
@@ -142,6 +144,12 @@ struct page { | |||
142 | struct rcu_head rcu_head; /* Used by SLAB | 144 | struct rcu_head rcu_head; /* Used by SLAB |
143 | * when destroying via RCU | 145 | * when destroying via RCU |
144 | */ | 146 | */ |
147 | /* First tail page of compound page */ | ||
148 | struct { | ||
149 | compound_page_dtor *compound_dtor; | ||
150 | unsigned long compound_order; | ||
151 | }; | ||
152 | |||
145 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | 153 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS |
146 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | 154 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ |
147 | #endif | 155 | #endif |
@@ -273,15 +281,11 @@ struct vm_area_struct { | |||
273 | 281 | ||
274 | /* | 282 | /* |
275 | * For areas with an address space and backing store, | 283 | * For areas with an address space and backing store, |
276 | * linkage into the address_space->i_mmap interval tree, or | 284 | * linkage into the address_space->i_mmap interval tree. |
277 | * linkage of vma in the address_space->i_mmap_nonlinear list. | ||
278 | */ | 285 | */ |
279 | union { | 286 | struct { |
280 | struct { | 287 | struct rb_node rb; |
281 | struct rb_node rb; | 288 | unsigned long rb_subtree_last; |
282 | unsigned long rb_subtree_last; | ||
283 | } linear; | ||
284 | struct list_head nonlinear; | ||
285 | } shared; | 289 | } shared; |
286 | 290 | ||
287 | /* | 291 | /* |
@@ -359,7 +363,8 @@ struct mm_struct { | |||
359 | pgd_t * pgd; | 363 | pgd_t * pgd; |
360 | atomic_t mm_users; /* How many users with user space? */ | 364 | atomic_t mm_users; /* How many users with user space? */ |
361 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 365 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
362 | atomic_long_t nr_ptes; /* Page table pages */ | 366 | atomic_long_t nr_ptes; /* PTE page table pages */ |
367 | atomic_long_t nr_pmds; /* PMD page table pages */ | ||
363 | int map_count; /* number of VMAs */ | 368 | int map_count; /* number of VMAs */ |
364 | 369 | ||
365 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | 370 | spinlock_t page_table_lock; /* Protects page tables and some counters */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 4d69c00497bd..a6cf4c063e4e 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -83,7 +83,7 @@ struct mmc_ext_csd { | |||
83 | bool hpi; /* HPI support bit */ | 83 | bool hpi; /* HPI support bit */ |
84 | unsigned int hpi_cmd; /* cmd used as HPI */ | 84 | unsigned int hpi_cmd; /* cmd used as HPI */ |
85 | bool bkops; /* background support bit */ | 85 | bool bkops; /* background support bit */ |
86 | bool bkops_en; /* background enable bit */ | 86 | bool man_bkops_en; /* manual bkops enable bit */ |
87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ | 87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ |
88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
89 | unsigned int boot_ro_lock; /* ro lock support */ | 89 | unsigned int boot_ro_lock; /* ro lock support */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index cb2b0400d284..160448f920ac 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -182,7 +182,6 @@ extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | |||
182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | 182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, |
183 | bool is_rel_write); | 183 | bool is_rel_write); |
184 | extern int mmc_hw_reset(struct mmc_host *host); | 184 | extern int mmc_hw_reset(struct mmc_host *host); |
185 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
186 | extern int mmc_can_reset(struct mmc_card *card); | 185 | extern int mmc_can_reset(struct mmc_card *card); |
187 | 186 | ||
188 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 187 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 42b724e8d503..471fb3116dbe 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -106,6 +106,11 @@ struct mmc_data; | |||
106 | * @cur_slot, @mrq and @state. These must always be updated | 106 | * @cur_slot, @mrq and @state. These must always be updated |
107 | * at the same time while holding @lock. | 107 | * at the same time while holding @lock. |
108 | * | 108 | * |
109 | * @irq_lock is an irq-safe spinlock protecting the INTMASK register | ||
110 | * to allow the interrupt handler to modify it directly. Held for only long | ||
111 | * enough to read-modify-write INTMASK and no other locks are grabbed when | ||
112 | * holding this one. | ||
113 | * | ||
109 | * The @mrq field of struct dw_mci_slot is also protected by @lock, | 114 | * The @mrq field of struct dw_mci_slot is also protected by @lock, |
110 | * and must always be written at the same time as the slot is added to | 115 | * and must always be written at the same time as the slot is added to |
111 | * @queue. | 116 | * @queue. |
@@ -125,6 +130,7 @@ struct mmc_data; | |||
125 | */ | 130 | */ |
126 | struct dw_mci { | 131 | struct dw_mci { |
127 | spinlock_t lock; | 132 | spinlock_t lock; |
133 | spinlock_t irq_lock; | ||
128 | void __iomem *regs; | 134 | void __iomem *regs; |
129 | 135 | ||
130 | struct scatterlist *sg; | 136 | struct scatterlist *sg; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9f322706f7cb..0c8cbe5d1550 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -166,7 +166,6 @@ struct mmc_async_req { | |||
166 | * struct mmc_slot - MMC slot functions | 166 | * struct mmc_slot - MMC slot functions |
167 | * | 167 | * |
168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL | 168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL |
169 | * @lock: protect the @handler_priv pointer | ||
170 | * @handler_priv: MMC/SD-card slot context | 169 | * @handler_priv: MMC/SD-card slot context |
171 | * | 170 | * |
172 | * Some MMC/SD host controllers implement slot-functions like card and | 171 | * Some MMC/SD host controllers implement slot-functions like card and |
@@ -176,7 +175,6 @@ struct mmc_async_req { | |||
176 | */ | 175 | */ |
177 | struct mmc_slot { | 176 | struct mmc_slot { |
178 | int cd_irq; | 177 | int cd_irq; |
179 | struct mutex lock; | ||
180 | void *handler_priv; | 178 | void *handler_priv; |
181 | }; | 179 | }; |
182 | 180 | ||
@@ -197,6 +195,7 @@ struct mmc_context_info { | |||
197 | }; | 195 | }; |
198 | 196 | ||
199 | struct regulator; | 197 | struct regulator; |
198 | struct mmc_pwrseq; | ||
200 | 199 | ||
201 | struct mmc_supply { | 200 | struct mmc_supply { |
202 | struct regulator *vmmc; /* Card power supply */ | 201 | struct regulator *vmmc; /* Card power supply */ |
@@ -208,6 +207,7 @@ struct mmc_host { | |||
208 | struct device class_dev; | 207 | struct device class_dev; |
209 | int index; | 208 | int index; |
210 | const struct mmc_host_ops *ops; | 209 | const struct mmc_host_ops *ops; |
210 | struct mmc_pwrseq *pwrseq; | ||
211 | unsigned int f_min; | 211 | unsigned int f_min; |
212 | unsigned int f_max; | 212 | unsigned int f_max; |
213 | unsigned int f_init; | 213 | unsigned int f_init; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 49ad7a943638..124f562118b8 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -53,11 +53,6 @@ | |||
53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ |
54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ | 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ |
55 | 55 | ||
56 | #define MMC_TUNING_BLK_PATTERN_4BIT_SIZE 64 | ||
57 | #define MMC_TUNING_BLK_PATTERN_8BIT_SIZE 128 | ||
58 | extern const u8 tuning_blk_pattern_4bit[MMC_TUNING_BLK_PATTERN_4BIT_SIZE]; | ||
59 | extern const u8 tuning_blk_pattern_8bit[MMC_TUNING_BLK_PATTERN_8BIT_SIZE]; | ||
60 | |||
61 | /* class 3 */ | 56 | /* class 3 */ |
62 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 57 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
63 | 58 | ||
@@ -433,6 +428,11 @@ struct _mmc_csd { | |||
433 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 | 428 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 |
434 | 429 | ||
435 | /* | 430 | /* |
431 | * BKOPS modes | ||
432 | */ | ||
433 | #define EXT_CSD_MANUAL_BKOPS_MASK 0x01 | ||
434 | |||
435 | /* | ||
436 | * MMC_SWITCH access modes | 436 | * MMC_SWITCH access modes |
437 | */ | 437 | */ |
438 | 438 | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index f767a0de611f..c3e3db196738 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -17,6 +17,11 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/mmc/host.h> | 18 | #include <linux/mmc/host.h> |
19 | 19 | ||
20 | struct sdhci_host_next { | ||
21 | unsigned int sg_count; | ||
22 | s32 cookie; | ||
23 | }; | ||
24 | |||
20 | struct sdhci_host { | 25 | struct sdhci_host { |
21 | /* Data set by hardware interface driver */ | 26 | /* Data set by hardware interface driver */ |
22 | const char *hw_name; /* Hardware bus name */ | 27 | const char *hw_name; /* Hardware bus name */ |
@@ -106,6 +111,10 @@ struct sdhci_host { | |||
106 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) | 111 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) |
107 | /* Capability register bit-63 indicates HS400 support */ | 112 | /* Capability register bit-63 indicates HS400 support */ |
108 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) | 113 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) |
114 | /* forced tuned clock */ | ||
115 | #define SDHCI_QUIRK2_TUNING_WORK_AROUND (1<<12) | ||
116 | /* disable the block count for single block transactions */ | ||
117 | #define SDHCI_QUIRK2_SUPPORT_SINGLE (1<<13) | ||
109 | 118 | ||
110 | int irq; /* Device IRQ */ | 119 | int irq; /* Device IRQ */ |
111 | void __iomem *ioaddr; /* Mapped address */ | 120 | void __iomem *ioaddr; /* Mapped address */ |
@@ -203,6 +212,7 @@ struct sdhci_host { | |||
203 | #define SDHCI_TUNING_MODE_1 0 | 212 | #define SDHCI_TUNING_MODE_1 0 |
204 | struct timer_list tuning_timer; /* Timer for tuning */ | 213 | struct timer_list tuning_timer; /* Timer for tuning */ |
205 | 214 | ||
215 | struct sdhci_host_next next_data; | ||
206 | unsigned long private[0] ____cacheline_aligned; | 216 | unsigned long private[0] ____cacheline_aligned; |
207 | }; | 217 | }; |
208 | #endif /* LINUX_MMC_SDHCI_H */ | 218 | #endif /* LINUX_MMC_SDHCI_H */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 0f01fe065424..996807963716 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
@@ -24,13 +24,15 @@ | |||
24 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
25 | */ | 25 | */ |
26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 | 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 |
27 | #define SDIO_DEVICE_ID_BROADCOM_43143 43143 | 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 0xa887 |
28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 |
29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 |
30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 |
31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 |
32 | #define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c | ||
33 | #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d | ||
32 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 | 34 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 |
33 | #define SDIO_DEVICE_ID_BROADCOM_43362 43362 | 35 | #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 |
34 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 | 36 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 |
35 | 37 | ||
36 | #define SDIO_VENDOR_ID_INTEL 0x0089 | 38 | #define SDIO_VENDOR_ID_INTEL 0x0089 |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 68927ae50845..da77e5e2041d 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -3,20 +3,10 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct platform_device; | ||
7 | |||
8 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | 6 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" |
9 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | 7 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" |
10 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | 8 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" |
11 | 9 | ||
12 | /** | ||
13 | * struct sh_mobile_sdhi_ops - SDHI driver callbacks | ||
14 | * @cd_wakeup: trigger a card-detection run | ||
15 | */ | ||
16 | struct sh_mobile_sdhi_ops { | ||
17 | void (*cd_wakeup)(const struct platform_device *pdev); | ||
18 | }; | ||
19 | |||
20 | struct sh_mobile_sdhi_info { | 10 | struct sh_mobile_sdhi_info { |
21 | int dma_slave_tx; | 11 | int dma_slave_tx; |
22 | int dma_slave_rx; | 12 | int dma_slave_rx; |
@@ -25,11 +15,6 @@ struct sh_mobile_sdhi_info { | |||
25 | unsigned long tmio_caps2; | 15 | unsigned long tmio_caps2; |
26 | u32 tmio_ocr_mask; /* available MMC voltages */ | 16 | u32 tmio_ocr_mask; /* available MMC voltages */ |
27 | unsigned int cd_gpio; | 17 | unsigned int cd_gpio; |
28 | |||
29 | /* callbacks for board specific setup code */ | ||
30 | int (*init)(struct platform_device *pdev, | ||
31 | const struct sh_mobile_sdhi_ops *ops); | ||
32 | void (*cleanup)(struct platform_device *pdev); | ||
33 | }; | 18 | }; |
34 | 19 | ||
35 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ | 20 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ |
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index e56fa24c9322..3945a8c9d3cb 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h | |||
@@ -15,12 +15,10 @@ struct mmc_host; | |||
15 | 15 | ||
16 | int mmc_gpio_get_ro(struct mmc_host *host); | 16 | int mmc_gpio_get_ro(struct mmc_host *host); |
17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); | 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); |
18 | void mmc_gpio_free_ro(struct mmc_host *host); | ||
19 | 18 | ||
20 | int mmc_gpio_get_cd(struct mmc_host *host); | 19 | int mmc_gpio_get_cd(struct mmc_host *host); |
21 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, | 20 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, |
22 | unsigned int debounce); | 21 | unsigned int debounce); |
23 | void mmc_gpio_free_cd(struct mmc_host *host); | ||
24 | 22 | ||
25 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | 23 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, |
26 | unsigned int idx, bool override_active_level, | 24 | unsigned int idx, bool override_active_level, |
@@ -28,7 +26,8 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | |||
28 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, | 26 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, |
29 | unsigned int idx, bool override_active_level, | 27 | unsigned int idx, bool override_active_level, |
30 | unsigned int debounce, bool *gpio_invert); | 28 | unsigned int debounce, bool *gpio_invert); |
31 | void mmc_gpiod_free_cd(struct mmc_host *host); | 29 | void mmc_gpio_set_cd_isr(struct mmc_host *host, |
30 | irqreturn_t (*isr)(int irq, void *dev_id)); | ||
32 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); | 31 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); |
33 | 32 | ||
34 | #endif | 33 | #endif |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2f0856d14b21..f279d9c158cd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -426,7 +426,7 @@ struct zone { | |||
426 | const char *name; | 426 | const char *name; |
427 | 427 | ||
428 | /* | 428 | /* |
429 | * Number of MIGRATE_RESEVE page block. To maintain for just | 429 | * Number of MIGRATE_RESERVE page block. To maintain for just |
430 | * optimization. Protected by zone->lock. | 430 | * optimization. Protected by zone->lock. |
431 | */ | 431 | */ |
432 | int nr_migrate_reserve_block; | 432 | int nr_migrate_reserve_block; |
@@ -970,7 +970,6 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
970 | * @z - The cursor used as a starting point for the search | 970 | * @z - The cursor used as a starting point for the search |
971 | * @highest_zoneidx - The zone index of the highest zone to return | 971 | * @highest_zoneidx - The zone index of the highest zone to return |
972 | * @nodes - An optional nodemask to filter the zonelist with | 972 | * @nodes - An optional nodemask to filter the zonelist with |
973 | * @zone - The first suitable zone found is returned via this parameter | ||
974 | * | 973 | * |
975 | * This function returns the next zone at or below a given zone index that is | 974 | * This function returns the next zone at or below a given zone index that is |
976 | * within the allowed nodemask using a cursor as the starting point for the | 975 | * within the allowed nodemask using a cursor as the starting point for the |
@@ -980,8 +979,7 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
980 | */ | 979 | */ |
981 | struct zoneref *next_zones_zonelist(struct zoneref *z, | 980 | struct zoneref *next_zones_zonelist(struct zoneref *z, |
982 | enum zone_type highest_zoneidx, | 981 | enum zone_type highest_zoneidx, |
983 | nodemask_t *nodes, | 982 | nodemask_t *nodes); |
984 | struct zone **zone); | ||
985 | 983 | ||
986 | /** | 984 | /** |
987 | * first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nodemask in a zonelist | 985 | * first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nodemask in a zonelist |
@@ -1000,8 +998,10 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
1000 | nodemask_t *nodes, | 998 | nodemask_t *nodes, |
1001 | struct zone **zone) | 999 | struct zone **zone) |
1002 | { | 1000 | { |
1003 | return next_zones_zonelist(zonelist->_zonerefs, highest_zoneidx, nodes, | 1001 | struct zoneref *z = next_zones_zonelist(zonelist->_zonerefs, |
1004 | zone); | 1002 | highest_zoneidx, nodes); |
1003 | *zone = zonelist_zone(z); | ||
1004 | return z; | ||
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | /** | 1007 | /** |
@@ -1018,7 +1018,8 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
1018 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ | 1018 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ |
1019 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ | 1019 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ |
1020 | zone; \ | 1020 | zone; \ |
1021 | z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \ | 1021 | z = next_zones_zonelist(++z, highidx, nodemask), \ |
1022 | zone = zonelist_zone(z)) \ | ||
1022 | 1023 | ||
1023 | /** | 1024 | /** |
1024 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index | 1025 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 745def862580..e530533b94be 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -53,9 +53,9 @@ struct ieee1394_device_id { | |||
53 | 53 | ||
54 | /** | 54 | /** |
55 | * struct usb_device_id - identifies USB devices for probing and hotplugging | 55 | * struct usb_device_id - identifies USB devices for probing and hotplugging |
56 | * @match_flags: Bit mask controlling of the other fields are used to match | 56 | * @match_flags: Bit mask controlling which of the other fields are used to |
57 | * against new devices. Any field except for driver_info may be used, | 57 | * match against new devices. Any field except for driver_info may be |
58 | * although some only make sense in conjunction with other fields. | 58 | * used, although some only make sense in conjunction with other fields. |
59 | * This is usually set by a USB_DEVICE_*() macro, which sets all | 59 | * This is usually set by a USB_DEVICE_*() macro, which sets all |
60 | * other fields in this structure except for driver_info. | 60 | * other fields in this structure except for driver_info. |
61 | * @idVendor: USB vendor ID for a device; numbers are assigned | 61 | * @idVendor: USB vendor ID for a device; numbers are assigned |
@@ -220,8 +220,7 @@ struct serio_device_id { | |||
220 | /* | 220 | /* |
221 | * Struct used for matching a device | 221 | * Struct used for matching a device |
222 | */ | 222 | */ |
223 | struct of_device_id | 223 | struct of_device_id { |
224 | { | ||
225 | char name[32]; | 224 | char name[32]; |
226 | char type[32]; | 225 | char type[32]; |
227 | char compatible[128]; | 226 | char compatible[128]; |
@@ -365,8 +364,6 @@ struct ssb_device_id { | |||
365 | } __attribute__((packed, aligned(2))); | 364 | } __attribute__((packed, aligned(2))); |
366 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ | 365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
367 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | 366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } |
368 | #define SSB_DEVTABLE_END \ | ||
369 | { 0, }, | ||
370 | 367 | ||
371 | #define SSB_ANY_VENDOR 0xFFFF | 368 | #define SSB_ANY_VENDOR 0xFFFF |
372 | #define SSB_ANY_ID 0xFFFF | 369 | #define SSB_ANY_ID 0xFFFF |
@@ -381,8 +378,6 @@ struct bcma_device_id { | |||
381 | } __attribute__((packed,aligned(2))); | 378 | } __attribute__((packed,aligned(2))); |
382 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | 379 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
383 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | 380 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } |
384 | #define BCMA_CORETABLE_END \ | ||
385 | { 0, }, | ||
386 | 381 | ||
387 | #define BCMA_ANY_MANUF 0xFFFF | 382 | #define BCMA_ANY_MANUF 0xFFFF |
388 | #define BCMA_ANY_ID 0xFFFF | 383 | #define BCMA_ANY_ID 0xFFFF |
diff --git a/include/linux/module.h b/include/linux/module.h index b653d7c0a05a..42999fe2dbd0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -135,7 +135,7 @@ void trim_init_extable(struct module *m); | |||
135 | #ifdef MODULE | 135 | #ifdef MODULE |
136 | /* Creates an alias so file2alias.c can find device table. */ | 136 | /* Creates an alias so file2alias.c can find device table. */ |
137 | #define MODULE_DEVICE_TABLE(type, name) \ | 137 | #define MODULE_DEVICE_TABLE(type, name) \ |
138 | extern const struct type##_device_id __mod_##type##__##name##_device_table \ | 138 | extern const typeof(name) __mod_##type##__##name##_device_table \ |
139 | __attribute__ ((unused, alias(__stringify(name)))) | 139 | __attribute__ ((unused, alias(__stringify(name)))) |
140 | #else /* !MODULE */ | 140 | #else /* !MODULE */ |
141 | #define MODULE_DEVICE_TABLE(type, name) | 141 | #define MODULE_DEVICE_TABLE(type, name) |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 031ff3a9a0bd..f17fa75809aa 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -227,6 +227,7 @@ struct mtd_info { | |||
227 | int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); | 227 | int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); |
228 | int (*_suspend) (struct mtd_info *mtd); | 228 | int (*_suspend) (struct mtd_info *mtd); |
229 | void (*_resume) (struct mtd_info *mtd); | 229 | void (*_resume) (struct mtd_info *mtd); |
230 | void (*_reboot) (struct mtd_info *mtd); | ||
230 | /* | 231 | /* |
231 | * If the driver is something smart, like UBI, it may need to maintain | 232 | * If the driver is something smart, like UBI, it may need to maintain |
232 | * its own reference counting. The below functions are only for driver. | 233 | * its own reference counting. The below functions are only for driver. |
@@ -408,4 +409,6 @@ static inline int mtd_is_bitflip_or_eccerr(int err) { | |||
408 | return mtd_is_bitflip(err) || mtd_is_eccerr(err); | 409 | return mtd_is_bitflip(err) || mtd_is_eccerr(err); |
409 | } | 410 | } |
410 | 411 | ||
412 | unsigned mtd_mmap_capabilities(struct mtd_info *mtd); | ||
413 | |||
411 | #endif /* __MTD_MTD_H__ */ | 414 | #endif /* __MTD_MTD_H__ */ |
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 63aeccf9ddc8..4720b86ee73d 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h | |||
@@ -56,6 +56,10 @@ | |||
56 | /* Used for Spansion flashes only. */ | 56 | /* Used for Spansion flashes only. */ |
57 | #define SPINOR_OP_BRWR 0x17 /* Bank register write */ | 57 | #define SPINOR_OP_BRWR 0x17 /* Bank register write */ |
58 | 58 | ||
59 | /* Used for Micron flashes only. */ | ||
60 | #define SPINOR_OP_RD_EVCR 0x65 /* Read EVCR register */ | ||
61 | #define SPINOR_OP_WD_EVCR 0x61 /* Write EVCR register */ | ||
62 | |||
59 | /* Status Register bits. */ | 63 | /* Status Register bits. */ |
60 | #define SR_WIP 1 /* Write in progress */ | 64 | #define SR_WIP 1 /* Write in progress */ |
61 | #define SR_WEL 2 /* Write enable latch */ | 65 | #define SR_WEL 2 /* Write enable latch */ |
@@ -67,6 +71,9 @@ | |||
67 | 71 | ||
68 | #define SR_QUAD_EN_MX 0x40 /* Macronix Quad I/O */ | 72 | #define SR_QUAD_EN_MX 0x40 /* Macronix Quad I/O */ |
69 | 73 | ||
74 | /* Enhanced Volatile Configuration Register bits */ | ||
75 | #define EVCR_QUAD_EN_MICRON 0x80 /* Micron Quad I/O */ | ||
76 | |||
70 | /* Flag Status Register bits */ | 77 | /* Flag Status Register bits */ |
71 | #define FSR_READY 0x80 | 78 | #define FSR_READY 0x80 |
72 | 79 | ||
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index c3918a0684fe..1e271cb559cd 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -23,22 +23,32 @@ | |||
23 | 23 | ||
24 | #include <linux/ioctl.h> | 24 | #include <linux/ioctl.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/scatterlist.h> | ||
26 | #include <mtd/ubi-user.h> | 27 | #include <mtd/ubi-user.h> |
27 | 28 | ||
28 | /* All voumes/LEBs */ | 29 | /* All voumes/LEBs */ |
29 | #define UBI_ALL -1 | 30 | #define UBI_ALL -1 |
30 | 31 | ||
31 | /* | 32 | /* |
33 | * Maximum number of scatter gather list entries, | ||
34 | * we use only 64 to have a lower memory foot print. | ||
35 | */ | ||
36 | #define UBI_MAX_SG_COUNT 64 | ||
37 | |||
38 | /* | ||
32 | * enum ubi_open_mode - UBI volume open mode constants. | 39 | * enum ubi_open_mode - UBI volume open mode constants. |
33 | * | 40 | * |
34 | * UBI_READONLY: read-only mode | 41 | * UBI_READONLY: read-only mode |
35 | * UBI_READWRITE: read-write mode | 42 | * UBI_READWRITE: read-write mode |
36 | * UBI_EXCLUSIVE: exclusive mode | 43 | * UBI_EXCLUSIVE: exclusive mode |
44 | * UBI_METAONLY: modify only the volume meta-data, | ||
45 | * i.e. the data stored in the volume table, but not in any of volume LEBs. | ||
37 | */ | 46 | */ |
38 | enum { | 47 | enum { |
39 | UBI_READONLY = 1, | 48 | UBI_READONLY = 1, |
40 | UBI_READWRITE, | 49 | UBI_READWRITE, |
41 | UBI_EXCLUSIVE | 50 | UBI_EXCLUSIVE, |
51 | UBI_METAONLY | ||
42 | }; | 52 | }; |
43 | 53 | ||
44 | /** | 54 | /** |
@@ -116,6 +126,35 @@ struct ubi_volume_info { | |||
116 | }; | 126 | }; |
117 | 127 | ||
118 | /** | 128 | /** |
129 | * struct ubi_sgl - UBI scatter gather list data structure. | ||
130 | * @list_pos: current position in @sg[] | ||
131 | * @page_pos: current position in @sg[@list_pos] | ||
132 | * @sg: the scatter gather list itself | ||
133 | * | ||
134 | * ubi_sgl is a wrapper around a scatter list which keeps track of the | ||
135 | * current position in the list and the current list item such that | ||
136 | * it can be used across multiple ubi_leb_read_sg() calls. | ||
137 | */ | ||
138 | struct ubi_sgl { | ||
139 | int list_pos; | ||
140 | int page_pos; | ||
141 | struct scatterlist sg[UBI_MAX_SG_COUNT]; | ||
142 | }; | ||
143 | |||
144 | /** | ||
145 | * ubi_sgl_init - initialize an UBI scatter gather list data structure. | ||
146 | * @usgl: the UBI scatter gather struct itself | ||
147 | * | ||
148 | * Please note that you still have to use sg_init_table() or any adequate | ||
149 | * function to initialize the unterlaying struct scatterlist. | ||
150 | */ | ||
151 | static inline void ubi_sgl_init(struct ubi_sgl *usgl) | ||
152 | { | ||
153 | usgl->list_pos = 0; | ||
154 | usgl->page_pos = 0; | ||
155 | } | ||
156 | |||
157 | /** | ||
119 | * struct ubi_device_info - UBI device description data structure. | 158 | * struct ubi_device_info - UBI device description data structure. |
120 | * @ubi_num: ubi device number | 159 | * @ubi_num: ubi device number |
121 | * @leb_size: logical eraseblock size on this UBI device | 160 | * @leb_size: logical eraseblock size on this UBI device |
@@ -210,6 +249,8 @@ int ubi_unregister_volume_notifier(struct notifier_block *nb); | |||
210 | void ubi_close_volume(struct ubi_volume_desc *desc); | 249 | void ubi_close_volume(struct ubi_volume_desc *desc); |
211 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 250 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
212 | int len, int check); | 251 | int len, int check); |
252 | int ubi_leb_read_sg(struct ubi_volume_desc *desc, int lnum, struct ubi_sgl *sgl, | ||
253 | int offset, int len, int check); | ||
213 | int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, | 254 | int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, |
214 | int offset, int len); | 255 | int offset, int len); |
215 | int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, | 256 | int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, |
@@ -230,4 +271,14 @@ static inline int ubi_read(struct ubi_volume_desc *desc, int lnum, char *buf, | |||
230 | { | 271 | { |
231 | return ubi_leb_read(desc, lnum, buf, offset, len, 0); | 272 | return ubi_leb_read(desc, lnum, buf, offset, len, 0); |
232 | } | 273 | } |
274 | |||
275 | /* | ||
276 | * This function is the same as the 'ubi_leb_read_sg()' function, but it does | ||
277 | * not provide the checking capability. | ||
278 | */ | ||
279 | static inline int ubi_read_sg(struct ubi_volume_desc *desc, int lnum, | ||
280 | struct ubi_sgl *sgl, int offset, int len) | ||
281 | { | ||
282 | return ubi_leb_read_sg(desc, lnum, sgl, offset, len, 0); | ||
283 | } | ||
233 | #endif /* !__LINUX_UBI_H__ */ | 284 | #endif /* !__LINUX_UBI_H__ */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index cc31498fc526..2cb7531e7d7a 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -59,7 +59,6 @@ struct mutex { | |||
59 | struct optimistic_spin_queue osq; /* Spinner MCS lock */ | 59 | struct optimistic_spin_queue osq; /* Spinner MCS lock */ |
60 | #endif | 60 | #endif |
61 | #ifdef CONFIG_DEBUG_MUTEXES | 61 | #ifdef CONFIG_DEBUG_MUTEXES |
62 | const char *name; | ||
63 | void *magic; | 62 | void *magic; |
64 | #endif | 63 | #endif |
65 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 64 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 8e30685affeb..7d59dc6ab789 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -66,6 +66,7 @@ enum { | |||
66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ | 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ |
67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ | 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ |
68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ | 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ |
69 | NETIF_F_HW_SWITCH_OFFLOAD_BIT, /* HW switch offload */ | ||
69 | 70 | ||
70 | /* | 71 | /* |
71 | * Add your fresh new feature above and remember to update | 72 | * Add your fresh new feature above and remember to update |
@@ -124,6 +125,7 @@ enum { | |||
124 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) | 125 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) |
125 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) | 126 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) |
126 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) | 127 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) |
128 | #define NETIF_F_HW_SWITCH_OFFLOAD __NETIF_F(HW_SWITCH_OFFLOAD) | ||
127 | 129 | ||
128 | /* Features valid for ethtool to change */ | 130 | /* Features valid for ethtool to change */ |
129 | /* = all defined minus driver/device-class-related */ | 131 | /* = all defined minus driver/device-class-related */ |
@@ -159,7 +161,9 @@ enum { | |||
159 | */ | 161 | */ |
160 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 162 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
161 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 163 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
162 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) | 164 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED | \ |
165 | NETIF_F_HW_SWITCH_OFFLOAD) | ||
166 | |||
163 | /* | 167 | /* |
164 | * If one device doesn't support one of these features, then disable it | 168 | * If one device doesn't support one of these features, then disable it |
165 | * for all in netdev_increment_features. | 169 | * for all in netdev_increment_features. |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 52fd8e8694cf..5897b4ea5a3f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/netdev_features.h> | 51 | #include <linux/netdev_features.h> |
52 | #include <linux/neighbour.h> | 52 | #include <linux/neighbour.h> |
53 | #include <uapi/linux/netdevice.h> | 53 | #include <uapi/linux/netdevice.h> |
54 | #include <uapi/linux/if_bonding.h> | ||
54 | 55 | ||
55 | struct netpoll_info; | 56 | struct netpoll_info; |
56 | struct device; | 57 | struct device; |
@@ -643,39 +644,40 @@ struct rps_dev_flow_table { | |||
643 | /* | 644 | /* |
644 | * The rps_sock_flow_table contains mappings of flows to the last CPU | 645 | * The rps_sock_flow_table contains mappings of flows to the last CPU |
645 | * on which they were processed by the application (set in recvmsg). | 646 | * on which they were processed by the application (set in recvmsg). |
647 | * Each entry is a 32bit value. Upper part is the high order bits | ||
648 | * of flow hash, lower part is cpu number. | ||
649 | * rps_cpu_mask is used to partition the space, depending on number of | ||
650 | * possible cpus : rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1 | ||
651 | * For example, if 64 cpus are possible, rps_cpu_mask = 0x3f, | ||
652 | * meaning we use 32-6=26 bits for the hash. | ||
646 | */ | 653 | */ |
647 | struct rps_sock_flow_table { | 654 | struct rps_sock_flow_table { |
648 | unsigned int mask; | 655 | u32 mask; |
649 | u16 ents[0]; | 656 | |
657 | u32 ents[0] ____cacheline_aligned_in_smp; | ||
650 | }; | 658 | }; |
651 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | 659 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (offsetof(struct rps_sock_flow_table, ents[_num])) |
652 | ((_num) * sizeof(u16))) | ||
653 | 660 | ||
654 | #define RPS_NO_CPU 0xffff | 661 | #define RPS_NO_CPU 0xffff |
655 | 662 | ||
663 | extern u32 rps_cpu_mask; | ||
664 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
665 | |||
656 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, | 666 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, |
657 | u32 hash) | 667 | u32 hash) |
658 | { | 668 | { |
659 | if (table && hash) { | 669 | if (table && hash) { |
660 | unsigned int cpu, index = hash & table->mask; | 670 | unsigned int index = hash & table->mask; |
671 | u32 val = hash & ~rps_cpu_mask; | ||
661 | 672 | ||
662 | /* We only give a hint, preemption can change cpu under us */ | 673 | /* We only give a hint, preemption can change cpu under us */ |
663 | cpu = raw_smp_processor_id(); | 674 | val |= raw_smp_processor_id(); |
664 | 675 | ||
665 | if (table->ents[index] != cpu) | 676 | if (table->ents[index] != val) |
666 | table->ents[index] = cpu; | 677 | table->ents[index] = val; |
667 | } | 678 | } |
668 | } | 679 | } |
669 | 680 | ||
670 | static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | ||
671 | u32 hash) | ||
672 | { | ||
673 | if (table && hash) | ||
674 | table->ents[hash & table->mask] = RPS_NO_CPU; | ||
675 | } | ||
676 | |||
677 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
678 | |||
679 | #ifdef CONFIG_RFS_ACCEL | 681 | #ifdef CONFIG_RFS_ACCEL |
680 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, | 682 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, |
681 | u16 filter_id); | 683 | u16 filter_id); |
@@ -1154,13 +1156,15 @@ struct net_device_ops { | |||
1154 | int idx); | 1156 | int idx); |
1155 | 1157 | ||
1156 | int (*ndo_bridge_setlink)(struct net_device *dev, | 1158 | int (*ndo_bridge_setlink)(struct net_device *dev, |
1157 | struct nlmsghdr *nlh); | 1159 | struct nlmsghdr *nlh, |
1160 | u16 flags); | ||
1158 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | 1161 | int (*ndo_bridge_getlink)(struct sk_buff *skb, |
1159 | u32 pid, u32 seq, | 1162 | u32 pid, u32 seq, |
1160 | struct net_device *dev, | 1163 | struct net_device *dev, |
1161 | u32 filter_mask); | 1164 | u32 filter_mask); |
1162 | int (*ndo_bridge_dellink)(struct net_device *dev, | 1165 | int (*ndo_bridge_dellink)(struct net_device *dev, |
1163 | struct nlmsghdr *nlh); | 1166 | struct nlmsghdr *nlh, |
1167 | u16 flags); | ||
1164 | int (*ndo_change_carrier)(struct net_device *dev, | 1168 | int (*ndo_change_carrier)(struct net_device *dev, |
1165 | bool new_carrier); | 1169 | bool new_carrier); |
1166 | int (*ndo_get_phys_port_id)(struct net_device *dev, | 1170 | int (*ndo_get_phys_port_id)(struct net_device *dev, |
@@ -1514,6 +1518,8 @@ struct net_device { | |||
1514 | struct list_head napi_list; | 1518 | struct list_head napi_list; |
1515 | struct list_head unreg_list; | 1519 | struct list_head unreg_list; |
1516 | struct list_head close_list; | 1520 | struct list_head close_list; |
1521 | struct list_head ptype_all; | ||
1522 | struct list_head ptype_specific; | ||
1517 | 1523 | ||
1518 | struct { | 1524 | struct { |
1519 | struct list_head upper; | 1525 | struct list_head upper; |
@@ -1917,13 +1923,8 @@ struct napi_gro_cb { | |||
1917 | /* Number of segments aggregated. */ | 1923 | /* Number of segments aggregated. */ |
1918 | u16 count; | 1924 | u16 count; |
1919 | 1925 | ||
1920 | /* This is non-zero if the packet may be of the same flow. */ | 1926 | /* Start offset for remote checksum offload */ |
1921 | u8 same_flow; | 1927 | u16 gro_remcsum_start; |
1922 | |||
1923 | /* Free the skb? */ | ||
1924 | u8 free; | ||
1925 | #define NAPI_GRO_FREE 1 | ||
1926 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 | ||
1927 | 1928 | ||
1928 | /* jiffies when first packet was created/queued */ | 1929 | /* jiffies when first packet was created/queued */ |
1929 | unsigned long age; | 1930 | unsigned long age; |
@@ -1931,6 +1932,9 @@ struct napi_gro_cb { | |||
1931 | /* Used in ipv6_gro_receive() and foo-over-udp */ | 1932 | /* Used in ipv6_gro_receive() and foo-over-udp */ |
1932 | u16 proto; | 1933 | u16 proto; |
1933 | 1934 | ||
1935 | /* This is non-zero if the packet may be of the same flow. */ | ||
1936 | u8 same_flow:1; | ||
1937 | |||
1934 | /* Used in udp_gro_receive */ | 1938 | /* Used in udp_gro_receive */ |
1935 | u8 udp_mark:1; | 1939 | u8 udp_mark:1; |
1936 | 1940 | ||
@@ -1940,9 +1944,16 @@ struct napi_gro_cb { | |||
1940 | /* Number of checksums via CHECKSUM_UNNECESSARY */ | 1944 | /* Number of checksums via CHECKSUM_UNNECESSARY */ |
1941 | u8 csum_cnt:3; | 1945 | u8 csum_cnt:3; |
1942 | 1946 | ||
1947 | /* Free the skb? */ | ||
1948 | u8 free:2; | ||
1949 | #define NAPI_GRO_FREE 1 | ||
1950 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 | ||
1951 | |||
1943 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ | 1952 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ |
1944 | u8 is_ipv6:1; | 1953 | u8 is_ipv6:1; |
1945 | 1954 | ||
1955 | /* 7 bit hole */ | ||
1956 | |||
1946 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ | 1957 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ |
1947 | __wsum csum; | 1958 | __wsum csum; |
1948 | 1959 | ||
@@ -1969,7 +1980,7 @@ struct offload_callbacks { | |||
1969 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1980 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
1970 | netdev_features_t features); | 1981 | netdev_features_t features); |
1971 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1982 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
1972 | struct sk_buff *skb); | 1983 | struct sk_buff *skb); |
1973 | int (*gro_complete)(struct sk_buff *skb, int nhoff); | 1984 | int (*gro_complete)(struct sk_buff *skb, int nhoff); |
1974 | }; | 1985 | }; |
1975 | 1986 | ||
@@ -1979,10 +1990,21 @@ struct packet_offload { | |||
1979 | struct list_head list; | 1990 | struct list_head list; |
1980 | }; | 1991 | }; |
1981 | 1992 | ||
1993 | struct udp_offload; | ||
1994 | |||
1995 | struct udp_offload_callbacks { | ||
1996 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
1997 | struct sk_buff *skb, | ||
1998 | struct udp_offload *uoff); | ||
1999 | int (*gro_complete)(struct sk_buff *skb, | ||
2000 | int nhoff, | ||
2001 | struct udp_offload *uoff); | ||
2002 | }; | ||
2003 | |||
1982 | struct udp_offload { | 2004 | struct udp_offload { |
1983 | __be16 port; | 2005 | __be16 port; |
1984 | u8 ipproto; | 2006 | u8 ipproto; |
1985 | struct offload_callbacks callbacks; | 2007 | struct udp_offload_callbacks callbacks; |
1986 | }; | 2008 | }; |
1987 | 2009 | ||
1988 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | 2010 | /* often modified stats are per cpu, other are shared (netdev->stats) */ |
@@ -2041,6 +2063,7 @@ struct pcpu_sw_netstats { | |||
2041 | #define NETDEV_RESEND_IGMP 0x0016 | 2063 | #define NETDEV_RESEND_IGMP 0x0016 |
2042 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ | 2064 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ |
2043 | #define NETDEV_CHANGEINFODATA 0x0018 | 2065 | #define NETDEV_CHANGEINFODATA 0x0018 |
2066 | #define NETDEV_BONDING_INFO 0x0019 | ||
2044 | 2067 | ||
2045 | int register_netdevice_notifier(struct notifier_block *nb); | 2068 | int register_netdevice_notifier(struct notifier_block *nb); |
2046 | int unregister_netdevice_notifier(struct notifier_block *nb); | 2069 | int unregister_netdevice_notifier(struct notifier_block *nb); |
@@ -2224,11 +2247,20 @@ static inline void skb_gro_postpull_rcsum(struct sk_buff *skb, | |||
2224 | 2247 | ||
2225 | __sum16 __skb_gro_checksum_complete(struct sk_buff *skb); | 2248 | __sum16 __skb_gro_checksum_complete(struct sk_buff *skb); |
2226 | 2249 | ||
2250 | static inline bool skb_at_gro_remcsum_start(struct sk_buff *skb) | ||
2251 | { | ||
2252 | return (NAPI_GRO_CB(skb)->gro_remcsum_start - skb_headroom(skb) == | ||
2253 | skb_gro_offset(skb)); | ||
2254 | } | ||
2255 | |||
2227 | static inline bool __skb_gro_checksum_validate_needed(struct sk_buff *skb, | 2256 | static inline bool __skb_gro_checksum_validate_needed(struct sk_buff *skb, |
2228 | bool zero_okay, | 2257 | bool zero_okay, |
2229 | __sum16 check) | 2258 | __sum16 check) |
2230 | { | 2259 | { |
2231 | return (skb->ip_summed != CHECKSUM_PARTIAL && | 2260 | return ((skb->ip_summed != CHECKSUM_PARTIAL || |
2261 | skb_checksum_start_offset(skb) < | ||
2262 | skb_gro_offset(skb)) && | ||
2263 | !skb_at_gro_remcsum_start(skb) && | ||
2232 | NAPI_GRO_CB(skb)->csum_cnt == 0 && | 2264 | NAPI_GRO_CB(skb)->csum_cnt == 0 && |
2233 | (!zero_okay || check)); | 2265 | (!zero_okay || check)); |
2234 | } | 2266 | } |
@@ -2303,6 +2335,49 @@ do { \ | |||
2303 | compute_pseudo(skb, proto)); \ | 2335 | compute_pseudo(skb, proto)); \ |
2304 | } while (0) | 2336 | } while (0) |
2305 | 2337 | ||
2338 | struct gro_remcsum { | ||
2339 | int offset; | ||
2340 | __wsum delta; | ||
2341 | }; | ||
2342 | |||
2343 | static inline void skb_gro_remcsum_init(struct gro_remcsum *grc) | ||
2344 | { | ||
2345 | grc->delta = 0; | ||
2346 | } | ||
2347 | |||
2348 | static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr, | ||
2349 | int start, int offset, | ||
2350 | struct gro_remcsum *grc, | ||
2351 | bool nopartial) | ||
2352 | { | ||
2353 | __wsum delta; | ||
2354 | |||
2355 | BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); | ||
2356 | |||
2357 | if (!nopartial) { | ||
2358 | NAPI_GRO_CB(skb)->gro_remcsum_start = | ||
2359 | ((unsigned char *)ptr + start) - skb->head; | ||
2360 | return; | ||
2361 | } | ||
2362 | |||
2363 | delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset); | ||
2364 | |||
2365 | /* Adjust skb->csum since we changed the packet */ | ||
2366 | NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); | ||
2367 | |||
2368 | grc->offset = (ptr + offset) - (void *)skb->head; | ||
2369 | grc->delta = delta; | ||
2370 | } | ||
2371 | |||
2372 | static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb, | ||
2373 | struct gro_remcsum *grc) | ||
2374 | { | ||
2375 | if (!grc->delta) | ||
2376 | return; | ||
2377 | |||
2378 | remcsum_unadjust((__sum16 *)(skb->head + grc->offset), grc->delta); | ||
2379 | } | ||
2380 | |||
2306 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 2381 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
2307 | unsigned short type, | 2382 | unsigned short type, |
2308 | const void *daddr, const void *saddr, | 2383 | const void *daddr, const void *saddr, |
@@ -3464,6 +3539,19 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, | |||
3464 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | 3539 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, |
3465 | netdev_features_t features); | 3540 | netdev_features_t features); |
3466 | 3541 | ||
3542 | struct netdev_bonding_info { | ||
3543 | ifslave slave; | ||
3544 | ifbond master; | ||
3545 | }; | ||
3546 | |||
3547 | struct netdev_notifier_bonding_info { | ||
3548 | struct netdev_notifier_info info; /* must be first */ | ||
3549 | struct netdev_bonding_info bonding_info; | ||
3550 | }; | ||
3551 | |||
3552 | void netdev_bonding_info_change(struct net_device *dev, | ||
3553 | struct netdev_bonding_info *bonding_info); | ||
3554 | |||
3467 | static inline | 3555 | static inline |
3468 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | 3556 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) |
3469 | { | 3557 | { |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 022b761dbf0a..ed43cb74b11d 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -411,6 +411,7 @@ enum lock_type4 { | |||
411 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) | 411 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) |
412 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) | 412 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) |
413 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) | 413 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) |
414 | #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) | ||
414 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | 415 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
415 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) | 416 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
416 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) | 417 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) |
@@ -516,6 +517,8 @@ enum pnfs_layouttype { | |||
516 | LAYOUT_NFSV4_1_FILES = 1, | 517 | LAYOUT_NFSV4_1_FILES = 1, |
517 | LAYOUT_OSD2_OBJECTS = 2, | 518 | LAYOUT_OSD2_OBJECTS = 2, |
518 | LAYOUT_BLOCK_VOLUME = 3, | 519 | LAYOUT_BLOCK_VOLUME = 3, |
520 | LAYOUT_FLEX_FILES = 4, | ||
521 | LAYOUT_TYPE_MAX | ||
519 | }; | 522 | }; |
520 | 523 | ||
521 | /* used for both layout return and recall */ | 524 | /* used for both layout return and recall */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 6d627b92df53..2f77e0c651c8 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -180,7 +180,6 @@ struct nfs_inode { | |||
180 | /* NFSv4 state */ | 180 | /* NFSv4 state */ |
181 | struct list_head open_states; | 181 | struct list_head open_states; |
182 | struct nfs_delegation __rcu *delegation; | 182 | struct nfs_delegation __rcu *delegation; |
183 | fmode_t delegation_state; | ||
184 | struct rw_semaphore rwsem; | 183 | struct rw_semaphore rwsem; |
185 | 184 | ||
186 | /* pNFS layout information */ | 185 | /* pNFS layout information */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index ddea982355f3..5e1273d4de14 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -77,10 +77,6 @@ struct nfs_client { | |||
77 | /* Client owner identifier */ | 77 | /* Client owner identifier */ |
78 | const char * cl_owner_id; | 78 | const char * cl_owner_id; |
79 | 79 | ||
80 | /* Our own IP address, as a null-terminated string. | ||
81 | * This is used to generate the mv0 callback address. | ||
82 | */ | ||
83 | char cl_ipaddr[48]; | ||
84 | u32 cl_cb_ident; /* v4.0 callback identifier */ | 80 | u32 cl_cb_ident; /* v4.0 callback identifier */ |
85 | const struct nfs4_minor_version_ops *cl_mvops; | 81 | const struct nfs4_minor_version_ops *cl_mvops; |
86 | unsigned long cl_mig_gen; | 82 | unsigned long cl_mig_gen; |
@@ -108,6 +104,11 @@ struct nfs_client { | |||
108 | #define NFS_SP4_MACH_CRED_COMMIT 6 /* COMMIT */ | 104 | #define NFS_SP4_MACH_CRED_COMMIT 6 /* COMMIT */ |
109 | #endif /* CONFIG_NFS_V4 */ | 105 | #endif /* CONFIG_NFS_V4 */ |
110 | 106 | ||
107 | /* Our own IP address, as a null-terminated string. | ||
108 | * This is used to generate the mv0 callback address. | ||
109 | */ | ||
110 | char cl_ipaddr[48]; | ||
111 | |||
111 | #ifdef CONFIG_NFS_FSCACHE | 112 | #ifdef CONFIG_NFS_FSCACHE |
112 | struct fscache_cookie *fscache; /* client index cache cookie */ | 113 | struct fscache_cookie *fscache; /* client index cache cookie */ |
113 | #endif | 114 | #endif |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 0f4b79da6584..333844e38f66 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
@@ -73,5 +73,7 @@ int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, kgid_t | |||
73 | int nfs_map_uid_to_name(const struct nfs_server *, kuid_t, char *, size_t); | 73 | int nfs_map_uid_to_name(const struct nfs_server *, kuid_t, char *, size_t); |
74 | int nfs_map_gid_to_group(const struct nfs_server *, kgid_t, char *, size_t); | 74 | int nfs_map_gid_to_group(const struct nfs_server *, kgid_t, char *, size_t); |
75 | 75 | ||
76 | int nfs_map_string_to_numeric(const char *name, size_t namelen, __u32 *res); | ||
77 | |||
76 | extern unsigned int nfs_idmap_cache_timeout; | 78 | extern unsigned int nfs_idmap_cache_timeout; |
77 | #endif /* NFS_IDMAP_H */ | 79 | #endif /* NFS_IDMAP_H */ |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 6c3e06ee2fb7..3eb072dbce83 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -58,6 +58,9 @@ struct nfs_pageio_ops { | |||
58 | size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, | 58 | size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, |
59 | struct nfs_page *); | 59 | struct nfs_page *); |
60 | int (*pg_doio)(struct nfs_pageio_descriptor *); | 60 | int (*pg_doio)(struct nfs_pageio_descriptor *); |
61 | unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *, | ||
62 | struct nfs_page *); | ||
63 | void (*pg_cleanup)(struct nfs_pageio_descriptor *); | ||
61 | }; | 64 | }; |
62 | 65 | ||
63 | struct nfs_rw_ops { | 66 | struct nfs_rw_ops { |
@@ -69,18 +72,21 @@ struct nfs_rw_ops { | |||
69 | struct inode *); | 72 | struct inode *); |
70 | void (*rw_result)(struct rpc_task *, struct nfs_pgio_header *); | 73 | void (*rw_result)(struct rpc_task *, struct nfs_pgio_header *); |
71 | void (*rw_initiate)(struct nfs_pgio_header *, struct rpc_message *, | 74 | void (*rw_initiate)(struct nfs_pgio_header *, struct rpc_message *, |
75 | const struct nfs_rpc_ops *, | ||
72 | struct rpc_task_setup *, int); | 76 | struct rpc_task_setup *, int); |
73 | }; | 77 | }; |
74 | 78 | ||
75 | struct nfs_pageio_descriptor { | 79 | struct nfs_pgio_mirror { |
76 | struct list_head pg_list; | 80 | struct list_head pg_list; |
77 | unsigned long pg_bytes_written; | 81 | unsigned long pg_bytes_written; |
78 | size_t pg_count; | 82 | size_t pg_count; |
79 | size_t pg_bsize; | 83 | size_t pg_bsize; |
80 | unsigned int pg_base; | 84 | unsigned int pg_base; |
81 | unsigned char pg_moreio : 1, | 85 | unsigned char pg_recoalesce : 1; |
82 | pg_recoalesce : 1; | 86 | }; |
83 | 87 | ||
88 | struct nfs_pageio_descriptor { | ||
89 | unsigned char pg_moreio : 1; | ||
84 | struct inode *pg_inode; | 90 | struct inode *pg_inode; |
85 | const struct nfs_pageio_ops *pg_ops; | 91 | const struct nfs_pageio_ops *pg_ops; |
86 | const struct nfs_rw_ops *pg_rw_ops; | 92 | const struct nfs_rw_ops *pg_rw_ops; |
@@ -91,8 +97,18 @@ struct nfs_pageio_descriptor { | |||
91 | struct pnfs_layout_segment *pg_lseg; | 97 | struct pnfs_layout_segment *pg_lseg; |
92 | struct nfs_direct_req *pg_dreq; | 98 | struct nfs_direct_req *pg_dreq; |
93 | void *pg_layout_private; | 99 | void *pg_layout_private; |
100 | unsigned int pg_bsize; /* default bsize for mirrors */ | ||
101 | |||
102 | u32 pg_mirror_count; | ||
103 | struct nfs_pgio_mirror *pg_mirrors; | ||
104 | struct nfs_pgio_mirror pg_mirrors_static[1]; | ||
105 | struct nfs_pgio_mirror *pg_mirrors_dynamic; | ||
106 | u32 pg_mirror_idx; /* current mirror */ | ||
94 | }; | 107 | }; |
95 | 108 | ||
109 | /* arbitrarily selected limit to number of mirrors */ | ||
110 | #define NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX 16 | ||
111 | |||
96 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 112 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
97 | 113 | ||
98 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, | 114 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 467c84efb596..4cb3eaa89cf7 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -285,6 +285,7 @@ struct nfs4_layoutcommit_data { | |||
285 | struct nfs_fattr fattr; | 285 | struct nfs_fattr fattr; |
286 | struct list_head lseg_list; | 286 | struct list_head lseg_list; |
287 | struct rpc_cred *cred; | 287 | struct rpc_cred *cred; |
288 | struct inode *inode; | ||
288 | struct nfs4_layoutcommit_args args; | 289 | struct nfs4_layoutcommit_args args; |
289 | struct nfs4_layoutcommit_res res; | 290 | struct nfs4_layoutcommit_res res; |
290 | }; | 291 | }; |
@@ -293,6 +294,7 @@ struct nfs4_layoutreturn_args { | |||
293 | struct nfs4_sequence_args seq_args; | 294 | struct nfs4_sequence_args seq_args; |
294 | struct pnfs_layout_hdr *layout; | 295 | struct pnfs_layout_hdr *layout; |
295 | struct inode *inode; | 296 | struct inode *inode; |
297 | struct pnfs_layout_range range; | ||
296 | nfs4_stateid stateid; | 298 | nfs4_stateid stateid; |
297 | __u32 layout_type; | 299 | __u32 layout_type; |
298 | }; | 300 | }; |
@@ -308,6 +310,7 @@ struct nfs4_layoutreturn { | |||
308 | struct nfs4_layoutreturn_res res; | 310 | struct nfs4_layoutreturn_res res; |
309 | struct rpc_cred *cred; | 311 | struct rpc_cred *cred; |
310 | struct nfs_client *clp; | 312 | struct nfs_client *clp; |
313 | struct inode *inode; | ||
311 | int rpc_status; | 314 | int rpc_status; |
312 | }; | 315 | }; |
313 | 316 | ||
@@ -325,6 +328,7 @@ struct nfs_openargs { | |||
325 | struct nfs_seqid * seqid; | 328 | struct nfs_seqid * seqid; |
326 | int open_flags; | 329 | int open_flags; |
327 | fmode_t fmode; | 330 | fmode_t fmode; |
331 | u32 share_access; | ||
328 | u32 access; | 332 | u32 access; |
329 | __u64 clientid; | 333 | __u64 clientid; |
330 | struct stateowner_id id; | 334 | struct stateowner_id id; |
@@ -389,9 +393,10 @@ struct nfs_open_confirmres { | |||
389 | struct nfs_closeargs { | 393 | struct nfs_closeargs { |
390 | struct nfs4_sequence_args seq_args; | 394 | struct nfs4_sequence_args seq_args; |
391 | struct nfs_fh * fh; | 395 | struct nfs_fh * fh; |
392 | nfs4_stateid * stateid; | 396 | nfs4_stateid stateid; |
393 | struct nfs_seqid * seqid; | 397 | struct nfs_seqid * seqid; |
394 | fmode_t fmode; | 398 | fmode_t fmode; |
399 | u32 share_access; | ||
395 | const u32 * bitmask; | 400 | const u32 * bitmask; |
396 | }; | 401 | }; |
397 | 402 | ||
@@ -416,12 +421,13 @@ struct nfs_lock_args { | |||
416 | struct nfs_fh * fh; | 421 | struct nfs_fh * fh; |
417 | struct file_lock * fl; | 422 | struct file_lock * fl; |
418 | struct nfs_seqid * lock_seqid; | 423 | struct nfs_seqid * lock_seqid; |
419 | nfs4_stateid * lock_stateid; | 424 | nfs4_stateid lock_stateid; |
420 | struct nfs_seqid * open_seqid; | 425 | struct nfs_seqid * open_seqid; |
421 | nfs4_stateid * open_stateid; | 426 | nfs4_stateid open_stateid; |
422 | struct nfs_lowner lock_owner; | 427 | struct nfs_lowner lock_owner; |
423 | unsigned char block : 1; | 428 | unsigned char block : 1; |
424 | unsigned char reclaim : 1; | 429 | unsigned char reclaim : 1; |
430 | unsigned char new_lock : 1; | ||
425 | unsigned char new_lock_owner : 1; | 431 | unsigned char new_lock_owner : 1; |
426 | }; | 432 | }; |
427 | 433 | ||
@@ -437,7 +443,7 @@ struct nfs_locku_args { | |||
437 | struct nfs_fh * fh; | 443 | struct nfs_fh * fh; |
438 | struct file_lock * fl; | 444 | struct file_lock * fl; |
439 | struct nfs_seqid * seqid; | 445 | struct nfs_seqid * seqid; |
440 | nfs4_stateid * stateid; | 446 | nfs4_stateid stateid; |
441 | }; | 447 | }; |
442 | 448 | ||
443 | struct nfs_locku_res { | 449 | struct nfs_locku_res { |
@@ -513,6 +519,7 @@ struct nfs_pgio_res { | |||
513 | struct nfs4_sequence_res seq_res; | 519 | struct nfs4_sequence_res seq_res; |
514 | struct nfs_fattr * fattr; | 520 | struct nfs_fattr * fattr; |
515 | __u32 count; | 521 | __u32 count; |
522 | __u32 op_status; | ||
516 | int eof; /* used by read */ | 523 | int eof; /* used by read */ |
517 | struct nfs_writeverf * verf; /* used by write */ | 524 | struct nfs_writeverf * verf; /* used by write */ |
518 | const struct nfs_server *server; /* used by write */ | 525 | const struct nfs_server *server; /* used by write */ |
@@ -532,6 +539,7 @@ struct nfs_commitargs { | |||
532 | 539 | ||
533 | struct nfs_commitres { | 540 | struct nfs_commitres { |
534 | struct nfs4_sequence_res seq_res; | 541 | struct nfs4_sequence_res seq_res; |
542 | __u32 op_status; | ||
535 | struct nfs_fattr *fattr; | 543 | struct nfs_fattr *fattr; |
536 | struct nfs_writeverf *verf; | 544 | struct nfs_writeverf *verf; |
537 | const struct nfs_server *server; | 545 | const struct nfs_server *server; |
@@ -1159,8 +1167,15 @@ struct nfs41_impl_id { | |||
1159 | struct nfstime4 date; | 1167 | struct nfstime4 date; |
1160 | }; | 1168 | }; |
1161 | 1169 | ||
1170 | struct nfs41_bind_conn_to_session_args { | ||
1171 | struct nfs_client *client; | ||
1172 | struct nfs4_sessionid sessionid; | ||
1173 | u32 dir; | ||
1174 | bool use_conn_in_rdma_mode; | ||
1175 | }; | ||
1176 | |||
1162 | struct nfs41_bind_conn_to_session_res { | 1177 | struct nfs41_bind_conn_to_session_res { |
1163 | struct nfs4_session *session; | 1178 | struct nfs4_sessionid sessionid; |
1164 | u32 dir; | 1179 | u32 dir; |
1165 | bool use_conn_in_rdma_mode; | 1180 | bool use_conn_in_rdma_mode; |
1166 | }; | 1181 | }; |
@@ -1177,6 +1192,8 @@ struct nfs41_exchange_id_res { | |||
1177 | 1192 | ||
1178 | struct nfs41_create_session_args { | 1193 | struct nfs41_create_session_args { |
1179 | struct nfs_client *client; | 1194 | struct nfs_client *client; |
1195 | u64 clientid; | ||
1196 | uint32_t seqid; | ||
1180 | uint32_t flags; | 1197 | uint32_t flags; |
1181 | uint32_t cb_program; | 1198 | uint32_t cb_program; |
1182 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | 1199 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ |
@@ -1184,7 +1201,11 @@ struct nfs41_create_session_args { | |||
1184 | }; | 1201 | }; |
1185 | 1202 | ||
1186 | struct nfs41_create_session_res { | 1203 | struct nfs41_create_session_res { |
1187 | struct nfs_client *client; | 1204 | struct nfs4_sessionid sessionid; |
1205 | uint32_t seqid; | ||
1206 | uint32_t flags; | ||
1207 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | ||
1208 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ | ||
1188 | }; | 1209 | }; |
1189 | 1210 | ||
1190 | struct nfs41_reclaim_complete_args { | 1211 | struct nfs41_reclaim_complete_args { |
@@ -1325,7 +1346,8 @@ struct nfs_pgio_header { | |||
1325 | __u64 mds_offset; /* Filelayout dense stripe */ | 1346 | __u64 mds_offset; /* Filelayout dense stripe */ |
1326 | struct nfs_page_array page_array; | 1347 | struct nfs_page_array page_array; |
1327 | struct nfs_client *ds_clp; /* pNFS data server */ | 1348 | struct nfs_client *ds_clp; /* pNFS data server */ |
1328 | int ds_idx; /* ds index if ds_clp is set */ | 1349 | int ds_commit_idx; /* ds index if ds_clp is set */ |
1350 | int pgio_mirror_idx;/* mirror index in pgio layer */ | ||
1329 | }; | 1351 | }; |
1330 | 1352 | ||
1331 | struct nfs_mds_commit_info { | 1353 | struct nfs_mds_commit_info { |
@@ -1342,7 +1364,7 @@ struct nfs_commit_completion_ops { | |||
1342 | }; | 1364 | }; |
1343 | 1365 | ||
1344 | struct nfs_commit_info { | 1366 | struct nfs_commit_info { |
1345 | spinlock_t *lock; | 1367 | spinlock_t *lock; /* inode->i_lock */ |
1346 | struct nfs_mds_commit_info *mds; | 1368 | struct nfs_mds_commit_info *mds; |
1347 | struct pnfs_ds_commit_info *ds; | 1369 | struct pnfs_ds_commit_info *ds; |
1348 | struct nfs_direct_req *dreq; /* O_DIRECT request */ | 1370 | struct nfs_direct_req *dreq; /* O_DIRECT request */ |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 83a6aeda899d..6e85889cf9ab 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -8,14 +8,13 @@ | |||
8 | * See detailed comments in the file linux/bitmap.h describing the | 8 | * See detailed comments in the file linux/bitmap.h describing the |
9 | * data type on which these nodemasks are based. | 9 | * data type on which these nodemasks are based. |
10 | * | 10 | * |
11 | * For details of nodemask_scnprintf() and nodemask_parse_user(), | 11 | * For details of nodemask_parse_user(), see bitmap_parse_user() in |
12 | * see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c. | 12 | * lib/bitmap.c. For details of nodelist_parse(), see bitmap_parselist(), |
13 | * For details of nodelist_scnprintf() and nodelist_parse(), see | 13 | * also in bitmap.c. For details of node_remap(), see bitmap_bitremap in |
14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | 14 | * lib/bitmap.c. For details of nodes_remap(), see bitmap_remap in |
15 | * For details of node_remap(), see bitmap_bitremap in lib/bitmap.c. | 15 | * lib/bitmap.c. For details of nodes_onto(), see bitmap_onto in |
16 | * For details of nodes_remap(), see bitmap_remap in lib/bitmap.c. | 16 | * lib/bitmap.c. For details of nodes_fold(), see bitmap_fold in |
17 | * For details of nodes_onto(), see bitmap_onto in lib/bitmap.c. | 17 | * lib/bitmap.c. |
18 | * For details of nodes_fold(), see bitmap_fold in lib/bitmap.c. | ||
19 | * | 18 | * |
20 | * The available nodemask operations are: | 19 | * The available nodemask operations are: |
21 | * | 20 | * |
@@ -52,9 +51,7 @@ | |||
52 | * NODE_MASK_NONE Initializer - no bits set | 51 | * NODE_MASK_NONE Initializer - no bits set |
53 | * unsigned long *nodes_addr(mask) Array of unsigned long's in mask | 52 | * unsigned long *nodes_addr(mask) Array of unsigned long's in mask |
54 | * | 53 | * |
55 | * int nodemask_scnprintf(buf, len, mask) Format nodemask for printing | ||
56 | * int nodemask_parse_user(ubuf, ulen, mask) Parse ascii string as nodemask | 54 | * int nodemask_parse_user(ubuf, ulen, mask) Parse ascii string as nodemask |
57 | * int nodelist_scnprintf(buf, len, mask) Format nodemask as list for printing | ||
58 | * int nodelist_parse(buf, map) Parse ascii string as nodelist | 55 | * int nodelist_parse(buf, map) Parse ascii string as nodelist |
59 | * int node_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | 56 | * int node_remap(oldbit, old, new) newbit = map(old, new)(oldbit) |
60 | * void nodes_remap(dst, src, old, new) *dst = map(old, new)(src) | 57 | * void nodes_remap(dst, src, old, new) *dst = map(old, new)(src) |
@@ -98,6 +95,14 @@ | |||
98 | typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; | 95 | typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; |
99 | extern nodemask_t _unused_nodemask_arg_; | 96 | extern nodemask_t _unused_nodemask_arg_; |
100 | 97 | ||
98 | /** | ||
99 | * nodemask_pr_args - printf args to output a nodemask | ||
100 | * @maskp: nodemask to be printed | ||
101 | * | ||
102 | * Can be used to provide arguments for '%*pb[l]' when printing a nodemask. | ||
103 | */ | ||
104 | #define nodemask_pr_args(maskp) MAX_NUMNODES, (maskp)->bits | ||
105 | |||
101 | /* | 106 | /* |
102 | * The inline keyword gives the compiler room to decide to inline, or | 107 | * The inline keyword gives the compiler room to decide to inline, or |
103 | * not inline a function as it sees best. However, as these functions | 108 | * not inline a function as it sees best. However, as these functions |
@@ -120,13 +125,13 @@ static inline void __node_clear(int node, volatile nodemask_t *dstp) | |||
120 | } | 125 | } |
121 | 126 | ||
122 | #define nodes_setall(dst) __nodes_setall(&(dst), MAX_NUMNODES) | 127 | #define nodes_setall(dst) __nodes_setall(&(dst), MAX_NUMNODES) |
123 | static inline void __nodes_setall(nodemask_t *dstp, int nbits) | 128 | static inline void __nodes_setall(nodemask_t *dstp, unsigned int nbits) |
124 | { | 129 | { |
125 | bitmap_fill(dstp->bits, nbits); | 130 | bitmap_fill(dstp->bits, nbits); |
126 | } | 131 | } |
127 | 132 | ||
128 | #define nodes_clear(dst) __nodes_clear(&(dst), MAX_NUMNODES) | 133 | #define nodes_clear(dst) __nodes_clear(&(dst), MAX_NUMNODES) |
129 | static inline void __nodes_clear(nodemask_t *dstp, int nbits) | 134 | static inline void __nodes_clear(nodemask_t *dstp, unsigned int nbits) |
130 | { | 135 | { |
131 | bitmap_zero(dstp->bits, nbits); | 136 | bitmap_zero(dstp->bits, nbits); |
132 | } | 137 | } |
@@ -144,7 +149,7 @@ static inline int __node_test_and_set(int node, nodemask_t *addr) | |||
144 | #define nodes_and(dst, src1, src2) \ | 149 | #define nodes_and(dst, src1, src2) \ |
145 | __nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES) | 150 | __nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES) |
146 | static inline void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p, | 151 | static inline void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p, |
147 | const nodemask_t *src2p, int nbits) | 152 | const nodemask_t *src2p, unsigned int nbits) |
148 | { | 153 | { |
149 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | 154 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); |
150 | } | 155 | } |
@@ -152,7 +157,7 @@ static inline void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p, | |||
152 | #define nodes_or(dst, src1, src2) \ | 157 | #define nodes_or(dst, src1, src2) \ |
153 | __nodes_or(&(dst), &(src1), &(src2), MAX_NUMNODES) | 158 | __nodes_or(&(dst), &(src1), &(src2), MAX_NUMNODES) |
154 | static inline void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p, | 159 | static inline void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p, |
155 | const nodemask_t *src2p, int nbits) | 160 | const nodemask_t *src2p, unsigned int nbits) |
156 | { | 161 | { |
157 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | 162 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); |
158 | } | 163 | } |
@@ -160,7 +165,7 @@ static inline void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p, | |||
160 | #define nodes_xor(dst, src1, src2) \ | 165 | #define nodes_xor(dst, src1, src2) \ |
161 | __nodes_xor(&(dst), &(src1), &(src2), MAX_NUMNODES) | 166 | __nodes_xor(&(dst), &(src1), &(src2), MAX_NUMNODES) |
162 | static inline void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p, | 167 | static inline void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p, |
163 | const nodemask_t *src2p, int nbits) | 168 | const nodemask_t *src2p, unsigned int nbits) |
164 | { | 169 | { |
165 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | 170 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); |
166 | } | 171 | } |
@@ -168,7 +173,7 @@ static inline void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p, | |||
168 | #define nodes_andnot(dst, src1, src2) \ | 173 | #define nodes_andnot(dst, src1, src2) \ |
169 | __nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES) | 174 | __nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES) |
170 | static inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p, | 175 | static inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p, |
171 | const nodemask_t *src2p, int nbits) | 176 | const nodemask_t *src2p, unsigned int nbits) |
172 | { | 177 | { |
173 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | 178 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); |
174 | } | 179 | } |
@@ -176,7 +181,7 @@ static inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p, | |||
176 | #define nodes_complement(dst, src) \ | 181 | #define nodes_complement(dst, src) \ |
177 | __nodes_complement(&(dst), &(src), MAX_NUMNODES) | 182 | __nodes_complement(&(dst), &(src), MAX_NUMNODES) |
178 | static inline void __nodes_complement(nodemask_t *dstp, | 183 | static inline void __nodes_complement(nodemask_t *dstp, |
179 | const nodemask_t *srcp, int nbits) | 184 | const nodemask_t *srcp, unsigned int nbits) |
180 | { | 185 | { |
181 | bitmap_complement(dstp->bits, srcp->bits, nbits); | 186 | bitmap_complement(dstp->bits, srcp->bits, nbits); |
182 | } | 187 | } |
@@ -184,7 +189,7 @@ static inline void __nodes_complement(nodemask_t *dstp, | |||
184 | #define nodes_equal(src1, src2) \ | 189 | #define nodes_equal(src1, src2) \ |
185 | __nodes_equal(&(src1), &(src2), MAX_NUMNODES) | 190 | __nodes_equal(&(src1), &(src2), MAX_NUMNODES) |
186 | static inline int __nodes_equal(const nodemask_t *src1p, | 191 | static inline int __nodes_equal(const nodemask_t *src1p, |
187 | const nodemask_t *src2p, int nbits) | 192 | const nodemask_t *src2p, unsigned int nbits) |
188 | { | 193 | { |
189 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | 194 | return bitmap_equal(src1p->bits, src2p->bits, nbits); |
190 | } | 195 | } |
@@ -192,7 +197,7 @@ static inline int __nodes_equal(const nodemask_t *src1p, | |||
192 | #define nodes_intersects(src1, src2) \ | 197 | #define nodes_intersects(src1, src2) \ |
193 | __nodes_intersects(&(src1), &(src2), MAX_NUMNODES) | 198 | __nodes_intersects(&(src1), &(src2), MAX_NUMNODES) |
194 | static inline int __nodes_intersects(const nodemask_t *src1p, | 199 | static inline int __nodes_intersects(const nodemask_t *src1p, |
195 | const nodemask_t *src2p, int nbits) | 200 | const nodemask_t *src2p, unsigned int nbits) |
196 | { | 201 | { |
197 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | 202 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); |
198 | } | 203 | } |
@@ -200,25 +205,25 @@ static inline int __nodes_intersects(const nodemask_t *src1p, | |||
200 | #define nodes_subset(src1, src2) \ | 205 | #define nodes_subset(src1, src2) \ |
201 | __nodes_subset(&(src1), &(src2), MAX_NUMNODES) | 206 | __nodes_subset(&(src1), &(src2), MAX_NUMNODES) |
202 | static inline int __nodes_subset(const nodemask_t *src1p, | 207 | static inline int __nodes_subset(const nodemask_t *src1p, |
203 | const nodemask_t *src2p, int nbits) | 208 | const nodemask_t *src2p, unsigned int nbits) |
204 | { | 209 | { |
205 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | 210 | return bitmap_subset(src1p->bits, src2p->bits, nbits); |
206 | } | 211 | } |
207 | 212 | ||
208 | #define nodes_empty(src) __nodes_empty(&(src), MAX_NUMNODES) | 213 | #define nodes_empty(src) __nodes_empty(&(src), MAX_NUMNODES) |
209 | static inline int __nodes_empty(const nodemask_t *srcp, int nbits) | 214 | static inline int __nodes_empty(const nodemask_t *srcp, unsigned int nbits) |
210 | { | 215 | { |
211 | return bitmap_empty(srcp->bits, nbits); | 216 | return bitmap_empty(srcp->bits, nbits); |
212 | } | 217 | } |
213 | 218 | ||
214 | #define nodes_full(nodemask) __nodes_full(&(nodemask), MAX_NUMNODES) | 219 | #define nodes_full(nodemask) __nodes_full(&(nodemask), MAX_NUMNODES) |
215 | static inline int __nodes_full(const nodemask_t *srcp, int nbits) | 220 | static inline int __nodes_full(const nodemask_t *srcp, unsigned int nbits) |
216 | { | 221 | { |
217 | return bitmap_full(srcp->bits, nbits); | 222 | return bitmap_full(srcp->bits, nbits); |
218 | } | 223 | } |
219 | 224 | ||
220 | #define nodes_weight(nodemask) __nodes_weight(&(nodemask), MAX_NUMNODES) | 225 | #define nodes_weight(nodemask) __nodes_weight(&(nodemask), MAX_NUMNODES) |
221 | static inline int __nodes_weight(const nodemask_t *srcp, int nbits) | 226 | static inline int __nodes_weight(const nodemask_t *srcp, unsigned int nbits) |
222 | { | 227 | { |
223 | return bitmap_weight(srcp->bits, nbits); | 228 | return bitmap_weight(srcp->bits, nbits); |
224 | } | 229 | } |
@@ -304,14 +309,6 @@ static inline int __first_unset_node(const nodemask_t *maskp) | |||
304 | 309 | ||
305 | #define nodes_addr(src) ((src).bits) | 310 | #define nodes_addr(src) ((src).bits) |
306 | 311 | ||
307 | #define nodemask_scnprintf(buf, len, src) \ | ||
308 | __nodemask_scnprintf((buf), (len), &(src), MAX_NUMNODES) | ||
309 | static inline int __nodemask_scnprintf(char *buf, int len, | ||
310 | const nodemask_t *srcp, int nbits) | ||
311 | { | ||
312 | return bitmap_scnprintf(buf, len, srcp->bits, nbits); | ||
313 | } | ||
314 | |||
315 | #define nodemask_parse_user(ubuf, ulen, dst) \ | 312 | #define nodemask_parse_user(ubuf, ulen, dst) \ |
316 | __nodemask_parse_user((ubuf), (ulen), &(dst), MAX_NUMNODES) | 313 | __nodemask_parse_user((ubuf), (ulen), &(dst), MAX_NUMNODES) |
317 | static inline int __nodemask_parse_user(const char __user *buf, int len, | 314 | static inline int __nodemask_parse_user(const char __user *buf, int len, |
@@ -320,14 +317,6 @@ static inline int __nodemask_parse_user(const char __user *buf, int len, | |||
320 | return bitmap_parse_user(buf, len, dstp->bits, nbits); | 317 | return bitmap_parse_user(buf, len, dstp->bits, nbits); |
321 | } | 318 | } |
322 | 319 | ||
323 | #define nodelist_scnprintf(buf, len, src) \ | ||
324 | __nodelist_scnprintf((buf), (len), &(src), MAX_NUMNODES) | ||
325 | static inline int __nodelist_scnprintf(char *buf, int len, | ||
326 | const nodemask_t *srcp, int nbits) | ||
327 | { | ||
328 | return bitmap_scnlistprintf(buf, len, srcp->bits, nbits); | ||
329 | } | ||
330 | |||
331 | #define nodelist_parse(buf, dst) __nodelist_parse((buf), &(dst), MAX_NUMNODES) | 320 | #define nodelist_parse(buf, dst) __nodelist_parse((buf), &(dst), MAX_NUMNODES) |
332 | static inline int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits) | 321 | static inline int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits) |
333 | { | 322 | { |
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 258945fcabf1..0adad4a5419b 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include <uapi/linux/nvme.h> | 18 | #include <uapi/linux/nvme.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/miscdevice.h> | ||
21 | #include <linux/kref.h> | 20 | #include <linux/kref.h> |
22 | #include <linux/blk-mq.h> | 21 | #include <linux/blk-mq.h> |
23 | 22 | ||
@@ -62,8 +61,6 @@ enum { | |||
62 | NVME_CSTS_SHST_MASK = 3 << 2, | 61 | NVME_CSTS_SHST_MASK = 3 << 2, |
63 | }; | 62 | }; |
64 | 63 | ||
65 | #define NVME_VS(major, minor) (major << 16 | minor) | ||
66 | |||
67 | extern unsigned char nvme_io_timeout; | 64 | extern unsigned char nvme_io_timeout; |
68 | #define NVME_IO_TIMEOUT (nvme_io_timeout * HZ) | 65 | #define NVME_IO_TIMEOUT (nvme_io_timeout * HZ) |
69 | 66 | ||
@@ -91,9 +88,10 @@ struct nvme_dev { | |||
91 | struct nvme_bar __iomem *bar; | 88 | struct nvme_bar __iomem *bar; |
92 | struct list_head namespaces; | 89 | struct list_head namespaces; |
93 | struct kref kref; | 90 | struct kref kref; |
94 | struct miscdevice miscdev; | 91 | struct device *device; |
95 | work_func_t reset_workfn; | 92 | work_func_t reset_workfn; |
96 | struct work_struct reset_work; | 93 | struct work_struct reset_work; |
94 | struct work_struct probe_work; | ||
97 | char name[12]; | 95 | char name[12]; |
98 | char serial[20]; | 96 | char serial[20]; |
99 | char model[40]; | 97 | char model[40]; |
@@ -105,7 +103,6 @@ struct nvme_dev { | |||
105 | u16 abort_limit; | 103 | u16 abort_limit; |
106 | u8 event_limit; | 104 | u8 event_limit; |
107 | u8 vwc; | 105 | u8 vwc; |
108 | u8 initialized; | ||
109 | }; | 106 | }; |
110 | 107 | ||
111 | /* | 108 | /* |
@@ -121,6 +118,7 @@ struct nvme_ns { | |||
121 | unsigned ns_id; | 118 | unsigned ns_id; |
122 | int lba_shift; | 119 | int lba_shift; |
123 | int ms; | 120 | int ms; |
121 | int pi_type; | ||
124 | u64 mode_select_num_blocks; | 122 | u64 mode_select_num_blocks; |
125 | u32 mode_select_block_len; | 123 | u32 mode_select_block_len; |
126 | }; | 124 | }; |
@@ -132,13 +130,13 @@ struct nvme_ns { | |||
132 | * allocated to store the PRP list. | 130 | * allocated to store the PRP list. |
133 | */ | 131 | */ |
134 | struct nvme_iod { | 132 | struct nvme_iod { |
135 | void *private; /* For the use of the submitter of the I/O */ | 133 | unsigned long private; /* For the use of the submitter of the I/O */ |
136 | int npages; /* In the PRP list. 0 means small pool in use */ | 134 | int npages; /* In the PRP list. 0 means small pool in use */ |
137 | int offset; /* Of PRP list */ | 135 | int offset; /* Of PRP list */ |
138 | int nents; /* Used in scatterlist */ | 136 | int nents; /* Used in scatterlist */ |
139 | int length; /* Of data, in bytes */ | 137 | int length; /* Of data, in bytes */ |
140 | dma_addr_t first_dma; | 138 | dma_addr_t first_dma; |
141 | struct list_head node; | 139 | struct scatterlist meta_sg[1]; /* metadata requires single contiguous buffer */ |
142 | struct scatterlist sg[0]; | 140 | struct scatterlist sg[0]; |
143 | }; | 141 | }; |
144 | 142 | ||
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 38fc05036015..69dbe312b11b 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
@@ -52,6 +52,7 @@ extern int of_get_named_gpio_flags(struct device_node *np, | |||
52 | 52 | ||
53 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
54 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
55 | extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); | ||
55 | 56 | ||
56 | extern void of_gpiochip_add(struct gpio_chip *gc); | 57 | extern void of_gpiochip_add(struct gpio_chip *gc); |
57 | extern void of_gpiochip_remove(struct gpio_chip *gc); | 58 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 76200984d1e2..d5771bed59c9 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -47,6 +47,10 @@ static inline bool oom_task_origin(const struct task_struct *p) | |||
47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); | 47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); |
48 | } | 48 | } |
49 | 49 | ||
50 | extern void mark_tsk_oom_victim(struct task_struct *tsk); | ||
51 | |||
52 | extern void unmark_oom_victim(void); | ||
53 | |||
50 | extern unsigned long oom_badness(struct task_struct *p, | 54 | extern unsigned long oom_badness(struct task_struct *p, |
51 | struct mem_cgroup *memcg, const nodemask_t *nodemask, | 55 | struct mem_cgroup *memcg, const nodemask_t *nodemask, |
52 | unsigned long totalpages); | 56 | unsigned long totalpages); |
@@ -68,22 +72,14 @@ extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, | |||
68 | unsigned long totalpages, const nodemask_t *nodemask, | 72 | unsigned long totalpages, const nodemask_t *nodemask, |
69 | bool force_kill); | 73 | bool force_kill); |
70 | 74 | ||
71 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 75 | extern bool out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
72 | int order, nodemask_t *mask, bool force_kill); | 76 | int order, nodemask_t *mask, bool force_kill); |
73 | extern int register_oom_notifier(struct notifier_block *nb); | 77 | extern int register_oom_notifier(struct notifier_block *nb); |
74 | extern int unregister_oom_notifier(struct notifier_block *nb); | 78 | extern int unregister_oom_notifier(struct notifier_block *nb); |
75 | 79 | ||
76 | extern bool oom_killer_disabled; | 80 | extern bool oom_killer_disabled; |
77 | 81 | extern bool oom_killer_disable(void); | |
78 | static inline void oom_killer_disable(void) | 82 | extern void oom_killer_enable(void); |
79 | { | ||
80 | oom_killer_disabled = true; | ||
81 | } | ||
82 | |||
83 | static inline void oom_killer_enable(void) | ||
84 | { | ||
85 | oom_killer_disabled = false; | ||
86 | } | ||
87 | 83 | ||
88 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 84 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
89 | 85 | ||
diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h index 90230d5811c5..3a6490e81b28 100644 --- a/include/linux/osq_lock.h +++ b/include/linux/osq_lock.h | |||
@@ -5,8 +5,11 @@ | |||
5 | * An MCS like lock especially tailored for optimistic spinning for sleeping | 5 | * An MCS like lock especially tailored for optimistic spinning for sleeping |
6 | * lock implementations (mutex, rwsem, etc). | 6 | * lock implementations (mutex, rwsem, etc). |
7 | */ | 7 | */ |
8 | 8 | struct optimistic_spin_node { | |
9 | #define OSQ_UNLOCKED_VAL (0) | 9 | struct optimistic_spin_node *next, *prev; |
10 | int locked; /* 1 if lock acquired */ | ||
11 | int cpu; /* encoded CPU # + 1 value */ | ||
12 | }; | ||
10 | 13 | ||
11 | struct optimistic_spin_queue { | 14 | struct optimistic_spin_queue { |
12 | /* | 15 | /* |
@@ -16,6 +19,8 @@ struct optimistic_spin_queue { | |||
16 | atomic_t tail; | 19 | atomic_t tail; |
17 | }; | 20 | }; |
18 | 21 | ||
22 | #define OSQ_UNLOCKED_VAL (0) | ||
23 | |||
19 | /* Init macro and function. */ | 24 | /* Init macro and function. */ |
20 | #define OSQ_LOCK_UNLOCKED { ATOMIC_INIT(OSQ_UNLOCKED_VAL) } | 25 | #define OSQ_LOCK_UNLOCKED { ATOMIC_INIT(OSQ_UNLOCKED_VAL) } |
21 | 26 | ||
@@ -24,4 +29,7 @@ static inline void osq_lock_init(struct optimistic_spin_queue *lock) | |||
24 | atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); | 29 | atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); |
25 | } | 30 | } |
26 | 31 | ||
32 | extern bool osq_lock(struct optimistic_spin_queue *lock); | ||
33 | extern void osq_unlock(struct optimistic_spin_queue *lock); | ||
34 | |||
27 | #endif | 35 | #endif |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e1f5fcd79792..5ed7bdaf22d5 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -121,8 +121,12 @@ enum pageflags { | |||
121 | PG_fscache = PG_private_2, /* page backed by cache */ | 121 | PG_fscache = PG_private_2, /* page backed by cache */ |
122 | 122 | ||
123 | /* XEN */ | 123 | /* XEN */ |
124 | /* Pinned in Xen as a read-only pagetable page. */ | ||
124 | PG_pinned = PG_owner_priv_1, | 125 | PG_pinned = PG_owner_priv_1, |
126 | /* Pinned as part of domain save (see xen_mm_pin_all()). */ | ||
125 | PG_savepinned = PG_dirty, | 127 | PG_savepinned = PG_dirty, |
128 | /* Has a grant mapping of another (foreign) domain's page. */ | ||
129 | PG_foreign = PG_owner_priv_1, | ||
126 | 130 | ||
127 | /* SLOB */ | 131 | /* SLOB */ |
128 | PG_slob_free = PG_private, | 132 | PG_slob_free = PG_private, |
@@ -215,6 +219,7 @@ __PAGEFLAG(Slab, slab) | |||
215 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ | 219 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ |
216 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ | 220 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ |
217 | PAGEFLAG(SavePinned, savepinned); /* Xen */ | 221 | PAGEFLAG(SavePinned, savepinned); /* Xen */ |
222 | PAGEFLAG(Foreign, foreign); /* Xen */ | ||
218 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 223 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
219 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | 224 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) |
220 | __SETPAGEFLAG(SwapBacked, swapbacked) | 225 | __SETPAGEFLAG(SwapBacked, swapbacked) |
diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h index 955421575d16..17fa4f8de3a6 100644 --- a/include/linux/page_counter.h +++ b/include/linux/page_counter.h | |||
@@ -41,7 +41,8 @@ int page_counter_try_charge(struct page_counter *counter, | |||
41 | struct page_counter **fail); | 41 | struct page_counter **fail); |
42 | void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); | 42 | void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); |
43 | int page_counter_limit(struct page_counter *counter, unsigned long limit); | 43 | int page_counter_limit(struct page_counter *counter, unsigned long limit); |
44 | int page_counter_memparse(const char *buf, unsigned long *nr_pages); | 44 | int page_counter_memparse(const char *buf, const char *max, |
45 | unsigned long *nr_pages); | ||
45 | 46 | ||
46 | static inline void page_counter_reset_watermark(struct page_counter *counter) | 47 | static inline void page_counter_reset_watermark(struct page_counter *counter) |
47 | { | 48 | { |
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index d2a2c84c72d0..c42981cd99aa 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h | |||
@@ -40,7 +40,7 @@ struct page_ext { | |||
40 | #ifdef CONFIG_PAGE_OWNER | 40 | #ifdef CONFIG_PAGE_OWNER |
41 | unsigned int order; | 41 | unsigned int order; |
42 | gfp_t gfp_mask; | 42 | gfp_t gfp_mask; |
43 | struct stack_trace trace; | 43 | unsigned int nr_entries; |
44 | unsigned long trace_entries[8]; | 44 | unsigned long trace_entries[8]; |
45 | #endif | 45 | #endif |
46 | }; | 46 | }; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 9603094ed59b..211e9da8a7d7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
32 | #include <linux/resource_ext.h> | ||
32 | #include <uapi/linux/pci.h> | 33 | #include <uapi/linux/pci.h> |
33 | 34 | ||
34 | #include <linux/pci_ids.h> | 35 | #include <linux/pci_ids.h> |
@@ -177,6 +178,8 @@ enum pci_dev_flags { | |||
177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), | 178 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), |
178 | /* Do not use bus resets for device */ | 179 | /* Do not use bus resets for device */ |
179 | PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6), | 180 | PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6), |
181 | /* Do not use PM reset even if device advertises NoSoftRst- */ | ||
182 | PCI_DEV_FLAGS_NO_PM_RESET = (__force pci_dev_flags_t) (1 << 7), | ||
180 | }; | 183 | }; |
181 | 184 | ||
182 | enum pci_irq_reroute_variant { | 185 | enum pci_irq_reroute_variant { |
@@ -397,16 +400,10 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
397 | return (pdev->error_state != pci_channel_io_normal); | 400 | return (pdev->error_state != pci_channel_io_normal); |
398 | } | 401 | } |
399 | 402 | ||
400 | struct pci_host_bridge_window { | ||
401 | struct list_head list; | ||
402 | struct resource *res; /* host bridge aperture (CPU address) */ | ||
403 | resource_size_t offset; /* bus address + offset = CPU address */ | ||
404 | }; | ||
405 | |||
406 | struct pci_host_bridge { | 403 | struct pci_host_bridge { |
407 | struct device dev; | 404 | struct device dev; |
408 | struct pci_bus *bus; /* root bus */ | 405 | struct pci_bus *bus; /* root bus */ |
409 | struct list_head windows; /* pci_host_bridge_windows */ | 406 | struct list_head windows; /* resource_entry */ |
410 | void (*release_fn)(struct pci_host_bridge *); | 407 | void (*release_fn)(struct pci_host_bridge *); |
411 | void *release_data; | 408 | void *release_data; |
412 | }; | 409 | }; |
@@ -562,6 +559,7 @@ static inline int pcibios_err_to_errno(int err) | |||
562 | /* Low-level architecture-dependent routines */ | 559 | /* Low-level architecture-dependent routines */ |
563 | 560 | ||
564 | struct pci_ops { | 561 | struct pci_ops { |
562 | void __iomem *(*map_bus)(struct pci_bus *bus, unsigned int devfn, int where); | ||
565 | int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); | 563 | int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); |
566 | int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); | 564 | int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); |
567 | }; | 565 | }; |
@@ -859,6 +857,16 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, | |||
859 | int where, u16 val); | 857 | int where, u16 val); |
860 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, | 858 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, |
861 | int where, u32 val); | 859 | int where, u32 val); |
860 | |||
861 | int pci_generic_config_read(struct pci_bus *bus, unsigned int devfn, | ||
862 | int where, int size, u32 *val); | ||
863 | int pci_generic_config_write(struct pci_bus *bus, unsigned int devfn, | ||
864 | int where, int size, u32 val); | ||
865 | int pci_generic_config_read32(struct pci_bus *bus, unsigned int devfn, | ||
866 | int where, int size, u32 *val); | ||
867 | int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, | ||
868 | int where, int size, u32 val); | ||
869 | |||
862 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); | 870 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); |
863 | 871 | ||
864 | static inline int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) | 872 | static inline int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) |
@@ -1850,6 +1858,8 @@ static inline void pci_set_of_node(struct pci_dev *dev) { } | |||
1850 | static inline void pci_release_of_node(struct pci_dev *dev) { } | 1858 | static inline void pci_release_of_node(struct pci_dev *dev) { } |
1851 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } | 1859 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } |
1852 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } | 1860 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } |
1861 | static inline struct device_node * | ||
1862 | pci_device_to_OF_node(const struct pci_dev *pdev) { return NULL; } | ||
1853 | #endif /* CONFIG_OF */ | 1863 | #endif /* CONFIG_OF */ |
1854 | 1864 | ||
1855 | #ifdef CONFIG_EEH | 1865 | #ifdef CONFIG_EEH |
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index b4337646388b..12c9b485beb7 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h | |||
@@ -128,8 +128,22 @@ static inline void percpu_ref_kill(struct percpu_ref *ref) | |||
128 | static inline bool __ref_is_percpu(struct percpu_ref *ref, | 128 | static inline bool __ref_is_percpu(struct percpu_ref *ref, |
129 | unsigned long __percpu **percpu_countp) | 129 | unsigned long __percpu **percpu_countp) |
130 | { | 130 | { |
131 | /* paired with smp_store_release() in percpu_ref_reinit() */ | 131 | unsigned long percpu_ptr; |
132 | unsigned long percpu_ptr = lockless_dereference(ref->percpu_count_ptr); | 132 | |
133 | /* | ||
134 | * The value of @ref->percpu_count_ptr is tested for | ||
135 | * !__PERCPU_REF_ATOMIC, which may be set asynchronously, and then | ||
136 | * used as a pointer. If the compiler generates a separate fetch | ||
137 | * when using it as a pointer, __PERCPU_REF_ATOMIC may be set in | ||
138 | * between contaminating the pointer value, meaning that | ||
139 | * ACCESS_ONCE() is required when fetching it. | ||
140 | * | ||
141 | * Also, we need a data dependency barrier to be paired with | ||
142 | * smp_store_release() in __percpu_ref_switch_to_percpu(). | ||
143 | * | ||
144 | * Use lockless deref which contains both. | ||
145 | */ | ||
146 | percpu_ptr = lockless_dereference(ref->percpu_count_ptr); | ||
133 | 147 | ||
134 | /* | 148 | /* |
135 | * Theoretically, the following could test just ATOMIC; however, | 149 | * Theoretically, the following could test just ATOMIC; however, |
@@ -233,7 +247,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) | |||
233 | if (__ref_is_percpu(ref, &percpu_count)) { | 247 | if (__ref_is_percpu(ref, &percpu_count)) { |
234 | this_cpu_inc(*percpu_count); | 248 | this_cpu_inc(*percpu_count); |
235 | ret = true; | 249 | ret = true; |
236 | } else if (!(ACCESS_ONCE(ref->percpu_count_ptr) & __PERCPU_REF_DEAD)) { | 250 | } else if (!(ref->percpu_count_ptr & __PERCPU_REF_DEAD)) { |
237 | ret = atomic_long_inc_not_zero(&ref->count); | 251 | ret = atomic_long_inc_not_zero(&ref->count); |
238 | } | 252 | } |
239 | 253 | ||
@@ -281,6 +295,20 @@ static inline void percpu_ref_put(struct percpu_ref *ref) | |||
281 | } | 295 | } |
282 | 296 | ||
283 | /** | 297 | /** |
298 | * percpu_ref_is_dying - test whether a percpu refcount is dying or dead | ||
299 | * @ref: percpu_ref to test | ||
300 | * | ||
301 | * Returns %true if @ref is dying or dead. | ||
302 | * | ||
303 | * This function is safe to call as long as @ref is between init and exit | ||
304 | * and the caller is responsible for synchronizing against state changes. | ||
305 | */ | ||
306 | static inline bool percpu_ref_is_dying(struct percpu_ref *ref) | ||
307 | { | ||
308 | return ref->percpu_count_ptr & __PERCPU_REF_DEAD; | ||
309 | } | ||
310 | |||
311 | /** | ||
284 | * percpu_ref_is_zero - test whether a percpu refcount reached zero | 312 | * percpu_ref_is_zero - test whether a percpu refcount reached zero |
285 | * @ref: percpu_ref to test | 313 | * @ref: percpu_ref to test |
286 | * | 314 | * |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 724d3720c9b1..a503100388cc 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -928,12 +928,22 @@ struct perf_pmu_events_attr { | |||
928 | const char *event_str; | 928 | const char *event_str; |
929 | }; | 929 | }; |
930 | 930 | ||
931 | ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr, | ||
932 | char *page); | ||
933 | |||
931 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ | 934 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ |
932 | static struct perf_pmu_events_attr _var = { \ | 935 | static struct perf_pmu_events_attr _var = { \ |
933 | .attr = __ATTR(_name, 0444, _show, NULL), \ | 936 | .attr = __ATTR(_name, 0444, _show, NULL), \ |
934 | .id = _id, \ | 937 | .id = _id, \ |
935 | }; | 938 | }; |
936 | 939 | ||
940 | #define PMU_EVENT_ATTR_STRING(_name, _var, _str) \ | ||
941 | static struct perf_pmu_events_attr _var = { \ | ||
942 | .attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \ | ||
943 | .id = 0, \ | ||
944 | .event_str = _str, \ | ||
945 | }; | ||
946 | |||
937 | #define PMU_FORMAT_ATTR(_name, _format) \ | 947 | #define PMU_FORMAT_ATTR(_name, _format) \ |
938 | static ssize_t \ | 948 | static ssize_t \ |
939 | _name##_show(struct device *dev, \ | 949 | _name##_show(struct device *dev, \ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 22af8f8f5802..685809835b5c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -327,6 +327,8 @@ struct phy_c45_device_ids { | |||
327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | 327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. |
328 | * is_c45: Set to true if this phy uses clause 45 addressing. | 328 | * is_c45: Set to true if this phy uses clause 45 addressing. |
329 | * is_internal: Set to true if this phy is internal to a MAC. | 329 | * is_internal: Set to true if this phy is internal to a MAC. |
330 | * has_fixups: Set to true if this phy has fixups/quirks. | ||
331 | * suspended: Set to true if this phy has been suspended successfully. | ||
330 | * state: state of the PHY for management purposes | 332 | * state: state of the PHY for management purposes |
331 | * dev_flags: Device-specific flags used by the PHY driver. | 333 | * dev_flags: Device-specific flags used by the PHY driver. |
332 | * addr: Bus address of PHY | 334 | * addr: Bus address of PHY |
@@ -364,6 +366,7 @@ struct phy_device { | |||
364 | bool is_c45; | 366 | bool is_c45; |
365 | bool is_internal; | 367 | bool is_internal; |
366 | bool has_fixups; | 368 | bool has_fixups; |
369 | bool suspended; | ||
367 | 370 | ||
368 | enum phy_state state; | 371 | enum phy_state state; |
369 | 372 | ||
@@ -565,6 +568,15 @@ struct phy_driver { | |||
565 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, | 568 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, |
566 | int devnum, int regnum, u32 val); | 569 | int devnum, int regnum, u32 val); |
567 | 570 | ||
571 | /* Get the size and type of the eeprom contained within a plug-in | ||
572 | * module */ | ||
573 | int (*module_info)(struct phy_device *dev, | ||
574 | struct ethtool_modinfo *modinfo); | ||
575 | |||
576 | /* Get the eeprom information from the plug-in module */ | ||
577 | int (*module_eeprom)(struct phy_device *dev, | ||
578 | struct ethtool_eeprom *ee, u8 *data); | ||
579 | |||
568 | struct device_driver driver; | 580 | struct device_driver driver; |
569 | }; | 581 | }; |
570 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | 582 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) |
diff --git a/include/linux/phy/phy-qcom-ufs.h b/include/linux/phy/phy-qcom-ufs.h new file mode 100644 index 000000000000..9d18e9f948e9 --- /dev/null +++ b/include/linux/phy/phy-qcom-ufs.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013-2015, Linux Foundation. All rights reserved. | ||
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 version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef PHY_QCOM_UFS_H_ | ||
16 | #define PHY_QCOM_UFS_H_ | ||
17 | |||
18 | #include "phy.h" | ||
19 | |||
20 | /** | ||
21 | * ufs_qcom_phy_enable_ref_clk() - Enable the phy | ||
22 | * ref clock. | ||
23 | * @phy: reference to a generic phy | ||
24 | * | ||
25 | * returns 0 for success, and non-zero for error. | ||
26 | */ | ||
27 | int ufs_qcom_phy_enable_ref_clk(struct phy *phy); | ||
28 | |||
29 | /** | ||
30 | * ufs_qcom_phy_disable_ref_clk() - Disable the phy | ||
31 | * ref clock. | ||
32 | * @phy: reference to a generic phy. | ||
33 | */ | ||
34 | void ufs_qcom_phy_disable_ref_clk(struct phy *phy); | ||
35 | |||
36 | /** | ||
37 | * ufs_qcom_phy_enable_dev_ref_clk() - Enable the device | ||
38 | * ref clock. | ||
39 | * @phy: reference to a generic phy. | ||
40 | */ | ||
41 | void ufs_qcom_phy_enable_dev_ref_clk(struct phy *phy); | ||
42 | |||
43 | /** | ||
44 | * ufs_qcom_phy_disable_dev_ref_clk() - Disable the device | ||
45 | * ref clock. | ||
46 | * @phy: reference to a generic phy. | ||
47 | */ | ||
48 | void ufs_qcom_phy_disable_dev_ref_clk(struct phy *phy); | ||
49 | |||
50 | int ufs_qcom_phy_enable_iface_clk(struct phy *phy); | ||
51 | void ufs_qcom_phy_disable_iface_clk(struct phy *phy); | ||
52 | int ufs_qcom_phy_start_serdes(struct phy *phy); | ||
53 | int ufs_qcom_phy_set_tx_lane_enable(struct phy *phy, u32 tx_lanes); | ||
54 | int ufs_qcom_phy_calibrate_phy(struct phy *phy, bool is_rate_B); | ||
55 | int ufs_qcom_phy_is_pcs_ready(struct phy *phy); | ||
56 | void ufs_qcom_phy_save_controller_version(struct phy *phy, | ||
57 | u8 major, u16 minor, u16 step); | ||
58 | |||
59 | #endif /* PHY_QCOM_UFS_H_ */ | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index b9cf6c51b181..918b117a7cd3 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -19,7 +19,7 @@ struct pidmap { | |||
19 | #define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) | 19 | #define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) |
20 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT+BITS_PER_PAGE-1)/BITS_PER_PAGE) | 20 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT+BITS_PER_PAGE-1)/BITS_PER_PAGE) |
21 | 21 | ||
22 | struct bsd_acct_struct; | 22 | struct fs_pin; |
23 | 23 | ||
24 | struct pid_namespace { | 24 | struct pid_namespace { |
25 | struct kref kref; | 25 | struct kref kref; |
@@ -37,7 +37,7 @@ struct pid_namespace { | |||
37 | struct dentry *proc_thread_self; | 37 | struct dentry *proc_thread_self; |
38 | #endif | 38 | #endif |
39 | #ifdef CONFIG_BSD_PROCESS_ACCT | 39 | #ifdef CONFIG_BSD_PROCESS_ACCT |
40 | struct bsd_acct_struct *bacct; | 40 | struct fs_pin *bacct; |
41 | #endif | 41 | #endif |
42 | struct user_namespace *user_ns; | 42 | struct user_namespace *user_ns; |
43 | struct work_struct proc_work; | 43 | struct work_struct proc_work; |
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index 18eccefea06e..72c0415d6c21 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h | |||
@@ -82,7 +82,7 @@ static inline int pinctrl_gpio_direction_output(unsigned gpio) | |||
82 | 82 | ||
83 | static inline struct pinctrl * __must_check pinctrl_get(struct device *dev) | 83 | static inline struct pinctrl * __must_check pinctrl_get(struct device *dev) |
84 | { | 84 | { |
85 | return NULL; | 85 | return ERR_PTR(-ENOSYS); |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline void pinctrl_put(struct pinctrl *p) | 88 | static inline void pinctrl_put(struct pinctrl *p) |
@@ -93,7 +93,7 @@ static inline struct pinctrl_state * __must_check pinctrl_lookup_state( | |||
93 | struct pinctrl *p, | 93 | struct pinctrl *p, |
94 | const char *name) | 94 | const char *name) |
95 | { | 95 | { |
96 | return NULL; | 96 | return ERR_PTR(-ENOSYS); |
97 | } | 97 | } |
98 | 98 | ||
99 | static inline int pinctrl_select_state(struct pinctrl *p, | 99 | static inline int pinctrl_select_state(struct pinctrl *p, |
@@ -104,7 +104,7 @@ static inline int pinctrl_select_state(struct pinctrl *p, | |||
104 | 104 | ||
105 | static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev) | 105 | static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev) |
106 | { | 106 | { |
107 | return NULL; | 107 | return ERR_PTR(-ENOSYS); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline void devm_pinctrl_put(struct pinctrl *p) | 110 | static inline void devm_pinctrl_put(struct pinctrl *p) |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d578a60eff23..fe65962b264f 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -115,6 +115,18 @@ enum pin_config_param { | |||
115 | PIN_CONFIG_END = 0x7FFF, | 115 | PIN_CONFIG_END = 0x7FFF, |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #ifdef CONFIG_DEBUG_FS | ||
119 | #define PCONFDUMP(a, b, c, d) { .param = a, .display = b, .format = c, \ | ||
120 | .has_arg = d } | ||
121 | |||
122 | struct pin_config_item { | ||
123 | const enum pin_config_param param; | ||
124 | const char * const display; | ||
125 | const char * const format; | ||
126 | bool has_arg; | ||
127 | }; | ||
128 | #endif /* CONFIG_DEBUG_FS */ | ||
129 | |||
118 | /* | 130 | /* |
119 | * Helpful configuration macro to be used in tables etc. | 131 | * Helpful configuration macro to be used in tables etc. |
120 | */ | 132 | */ |
@@ -150,6 +162,12 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param | |||
150 | struct pinctrl_dev; | 162 | struct pinctrl_dev; |
151 | struct pinctrl_map; | 163 | struct pinctrl_map; |
152 | 164 | ||
165 | struct pinconf_generic_params { | ||
166 | const char * const property; | ||
167 | enum pin_config_param param; | ||
168 | u32 default_value; | ||
169 | }; | ||
170 | |||
153 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, | 171 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, |
154 | struct device_node *np, struct pinctrl_map **map, | 172 | struct device_node *np, struct pinctrl_map **map, |
155 | unsigned *reserved_maps, unsigned *num_maps, | 173 | unsigned *reserved_maps, unsigned *num_maps, |
@@ -174,6 +192,17 @@ static inline int pinconf_generic_dt_node_to_map_pin( | |||
174 | PIN_MAP_TYPE_CONFIGS_PIN); | 192 | PIN_MAP_TYPE_CONFIGS_PIN); |
175 | } | 193 | } |
176 | 194 | ||
195 | static inline int pinconf_generic_dt_node_to_map_all( | ||
196 | struct pinctrl_dev *pctldev, struct device_node *np_config, | ||
197 | struct pinctrl_map **map, unsigned *num_maps) | ||
198 | { | ||
199 | /* | ||
200 | * passing the type as PIN_MAP_TYPE_INVALID causes the underlying parser | ||
201 | * to infer the map type from the DT properties used. | ||
202 | */ | ||
203 | return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, | ||
204 | PIN_MAP_TYPE_INVALID); | ||
205 | } | ||
177 | #endif | 206 | #endif |
178 | 207 | ||
179 | #endif /* CONFIG_GENERIC_PINCONF */ | 208 | #endif /* CONFIG_GENERIC_PINCONF */ |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index cc8e1aff0e28..66e4697516de 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -24,6 +24,7 @@ struct pinctrl_dev; | |||
24 | struct pinctrl_map; | 24 | struct pinctrl_map; |
25 | struct pinmux_ops; | 25 | struct pinmux_ops; |
26 | struct pinconf_ops; | 26 | struct pinconf_ops; |
27 | struct pin_config_item; | ||
27 | struct gpio_chip; | 28 | struct gpio_chip; |
28 | struct device_node; | 29 | struct device_node; |
29 | 30 | ||
@@ -117,6 +118,12 @@ struct pinctrl_ops { | |||
117 | * @confops: pin config operations vtable, if you support pin configuration in | 118 | * @confops: pin config operations vtable, if you support pin configuration in |
118 | * your driver | 119 | * your driver |
119 | * @owner: module providing the pin controller, used for refcounting | 120 | * @owner: module providing the pin controller, used for refcounting |
121 | * @num_custom_params: Number of driver-specific custom parameters to be parsed | ||
122 | * from the hardware description | ||
123 | * @custom_params: List of driver_specific custom parameters to be parsed from | ||
124 | * the hardware description | ||
125 | * @custom_conf_items: Information how to print @params in debugfs, must be | ||
126 | * the same size as the @custom_params, i.e. @num_custom_params | ||
120 | */ | 127 | */ |
121 | struct pinctrl_desc { | 128 | struct pinctrl_desc { |
122 | const char *name; | 129 | const char *name; |
@@ -126,6 +133,11 @@ struct pinctrl_desc { | |||
126 | const struct pinmux_ops *pmxops; | 133 | const struct pinmux_ops *pmxops; |
127 | const struct pinconf_ops *confops; | 134 | const struct pinconf_ops *confops; |
128 | struct module *owner; | 135 | struct module *owner; |
136 | #ifdef CONFIG_GENERIC_PINCONF | ||
137 | unsigned int num_custom_params; | ||
138 | const struct pinconf_generic_params *custom_params; | ||
139 | const struct pin_config_item *custom_conf_items; | ||
140 | #endif | ||
129 | }; | 141 | }; |
130 | 142 | ||
131 | /* External interface to pin controller */ | 143 | /* External interface to pin controller */ |
diff --git a/include/linux/platform_data/bfin_rotary.h b/include/linux/platform_data/bfin_rotary.h new file mode 100644 index 000000000000..98829370fee2 --- /dev/null +++ b/include/linux/platform_data/bfin_rotary.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | * board initialization should put one of these structures into platform_data | ||
3 | * and place the bfin-rotary onto platform_bus named "bfin-rotary". | ||
4 | * | ||
5 | * Copyright 2008-2010 Analog Devices Inc. | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef _BFIN_ROTARY_H | ||
11 | #define _BFIN_ROTARY_H | ||
12 | |||
13 | /* mode bitmasks */ | ||
14 | #define ROT_QUAD_ENC CNTMODE_QUADENC /* quadrature/grey code encoder mode */ | ||
15 | #define ROT_BIN_ENC CNTMODE_BINENC /* binary encoder mode */ | ||
16 | #define ROT_UD_CNT CNTMODE_UDCNT /* rotary counter mode */ | ||
17 | #define ROT_DIR_CNT CNTMODE_DIRCNT /* direction counter mode */ | ||
18 | |||
19 | #define ROT_DEBE DEBE /* Debounce Enable */ | ||
20 | |||
21 | #define ROT_CDGINV CDGINV /* CDG Pin Polarity Invert */ | ||
22 | #define ROT_CUDINV CUDINV /* CUD Pin Polarity Invert */ | ||
23 | #define ROT_CZMINV CZMINV /* CZM Pin Polarity Invert */ | ||
24 | |||
25 | struct bfin_rotary_platform_data { | ||
26 | /* set rotary UP KEY_### or BTN_### in case you prefer | ||
27 | * bfin-rotary to send EV_KEY otherwise set 0 | ||
28 | */ | ||
29 | unsigned int rotary_up_key; | ||
30 | /* set rotary DOWN KEY_### or BTN_### in case you prefer | ||
31 | * bfin-rotary to send EV_KEY otherwise set 0 | ||
32 | */ | ||
33 | unsigned int rotary_down_key; | ||
34 | /* set rotary BUTTON KEY_### or BTN_### */ | ||
35 | unsigned int rotary_button_key; | ||
36 | /* set rotary Relative Axis REL_### in case you prefer | ||
37 | * bfin-rotary to send EV_REL otherwise set 0 | ||
38 | */ | ||
39 | unsigned int rotary_rel_code; | ||
40 | unsigned short debounce; /* 0..17 */ | ||
41 | unsigned short mode; | ||
42 | unsigned short pm_wakeup; | ||
43 | unsigned short *pin_list; | ||
44 | }; | ||
45 | |||
46 | /* CNT_CONFIG bitmasks */ | ||
47 | #define CNTE (1 << 0) /* Counter Enable */ | ||
48 | #define DEBE (1 << 1) /* Debounce Enable */ | ||
49 | #define CDGINV (1 << 4) /* CDG Pin Polarity Invert */ | ||
50 | #define CUDINV (1 << 5) /* CUD Pin Polarity Invert */ | ||
51 | #define CZMINV (1 << 6) /* CZM Pin Polarity Invert */ | ||
52 | #define CNTMODE_SHIFT 8 | ||
53 | #define CNTMODE (0x7 << CNTMODE_SHIFT) /* Counter Operating Mode */ | ||
54 | #define ZMZC (1 << 1) /* CZM Zeroes Counter Enable */ | ||
55 | #define BNDMODE_SHIFT 12 | ||
56 | #define BNDMODE (0x3 << BNDMODE_SHIFT) /* Boundary register Mode */ | ||
57 | #define INPDIS (1 << 15) /* CUG and CDG Input Disable */ | ||
58 | |||
59 | #define CNTMODE_QUADENC (0 << CNTMODE_SHIFT) /* quadrature encoder mode */ | ||
60 | #define CNTMODE_BINENC (1 << CNTMODE_SHIFT) /* binary encoder mode */ | ||
61 | #define CNTMODE_UDCNT (2 << CNTMODE_SHIFT) /* up/down counter mode */ | ||
62 | #define CNTMODE_DIRCNT (4 << CNTMODE_SHIFT) /* direction counter mode */ | ||
63 | #define CNTMODE_DIRTMR (5 << CNTMODE_SHIFT) /* direction timer mode */ | ||
64 | |||
65 | #define BNDMODE_COMP (0 << BNDMODE_SHIFT) /* boundary compare mode */ | ||
66 | #define BNDMODE_ZERO (1 << BNDMODE_SHIFT) /* boundary compare and zero mode */ | ||
67 | #define BNDMODE_CAPT (2 << BNDMODE_SHIFT) /* boundary capture mode */ | ||
68 | #define BNDMODE_AEXT (3 << BNDMODE_SHIFT) /* boundary auto-extend mode */ | ||
69 | |||
70 | /* CNT_IMASK bitmasks */ | ||
71 | #define ICIE (1 << 0) /* Illegal Gray/Binary Code Interrupt Enable */ | ||
72 | #define UCIE (1 << 1) /* Up count Interrupt Enable */ | ||
73 | #define DCIE (1 << 2) /* Down count Interrupt Enable */ | ||
74 | #define MINCIE (1 << 3) /* Min Count Interrupt Enable */ | ||
75 | #define MAXCIE (1 << 4) /* Max Count Interrupt Enable */ | ||
76 | #define COV31IE (1 << 5) /* Bit 31 Overflow Interrupt Enable */ | ||
77 | #define COV15IE (1 << 6) /* Bit 15 Overflow Interrupt Enable */ | ||
78 | #define CZEROIE (1 << 7) /* Count to Zero Interrupt Enable */ | ||
79 | #define CZMIE (1 << 8) /* CZM Pin Interrupt Enable */ | ||
80 | #define CZMEIE (1 << 9) /* CZM Error Interrupt Enable */ | ||
81 | #define CZMZIE (1 << 10) /* CZM Zeroes Counter Interrupt Enable */ | ||
82 | |||
83 | /* CNT_STATUS bitmasks */ | ||
84 | #define ICII (1 << 0) /* Illegal Gray/Binary Code Interrupt Identifier */ | ||
85 | #define UCII (1 << 1) /* Up count Interrupt Identifier */ | ||
86 | #define DCII (1 << 2) /* Down count Interrupt Identifier */ | ||
87 | #define MINCII (1 << 3) /* Min Count Interrupt Identifier */ | ||
88 | #define MAXCII (1 << 4) /* Max Count Interrupt Identifier */ | ||
89 | #define COV31II (1 << 5) /* Bit 31 Overflow Interrupt Identifier */ | ||
90 | #define COV15II (1 << 6) /* Bit 15 Overflow Interrupt Identifier */ | ||
91 | #define CZEROII (1 << 7) /* Count to Zero Interrupt Identifier */ | ||
92 | #define CZMII (1 << 8) /* CZM Pin Interrupt Identifier */ | ||
93 | #define CZMEII (1 << 9) /* CZM Error Interrupt Identifier */ | ||
94 | #define CZMZII (1 << 10) /* CZM Zeroes Counter Interrupt Identifier */ | ||
95 | |||
96 | /* CNT_COMMAND bitmasks */ | ||
97 | #define W1LCNT 0xf /* Load Counter Register */ | ||
98 | #define W1LMIN 0xf0 /* Load Min Register */ | ||
99 | #define W1LMAX 0xf00 /* Load Max Register */ | ||
100 | #define W1ZMONCE (1 << 12) /* Enable CZM Clear Counter Once */ | ||
101 | |||
102 | #define W1LCNT_ZERO (1 << 0) /* write 1 to load CNT_COUNTER with zero */ | ||
103 | #define W1LCNT_MIN (1 << 2) /* write 1 to load CNT_COUNTER from CNT_MIN */ | ||
104 | #define W1LCNT_MAX (1 << 3) /* write 1 to load CNT_COUNTER from CNT_MAX */ | ||
105 | |||
106 | #define W1LMIN_ZERO (1 << 4) /* write 1 to load CNT_MIN with zero */ | ||
107 | #define W1LMIN_CNT (1 << 5) /* write 1 to load CNT_MIN from CNT_COUNTER */ | ||
108 | #define W1LMIN_MAX (1 << 7) /* write 1 to load CNT_MIN from CNT_MAX */ | ||
109 | |||
110 | #define W1LMAX_ZERO (1 << 8) /* write 1 to load CNT_MAX with zero */ | ||
111 | #define W1LMAX_CNT (1 << 9) /* write 1 to load CNT_MAX from CNT_COUNTER */ | ||
112 | #define W1LMAX_MIN (1 << 10) /* write 1 to load CNT_MAX from CNT_MIN */ | ||
113 | |||
114 | /* CNT_DEBOUNCE bitmasks */ | ||
115 | #define DPRESCALE 0xf /* Load Counter Register */ | ||
116 | |||
117 | #endif | ||
diff --git a/include/linux/platform_data/cpuidle-exynos.h b/include/linux/platform_data/cpuidle-exynos.h new file mode 100644 index 000000000000..bfa40e4c5d5f --- /dev/null +++ b/include/linux/platform_data/cpuidle-exynos.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __CPUIDLE_EXYNOS_H | ||
11 | #define __CPUIDLE_EXYNOS_H | ||
12 | |||
13 | struct cpuidle_exynos_data { | ||
14 | int (*cpu0_enter_aftr)(void); | ||
15 | int (*cpu1_powerdown)(void); | ||
16 | void (*pre_enter_aftr)(void); | ||
17 | void (*post_enter_aftr)(void); | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h index d8155c005242..87ac14c584f2 100644 --- a/include/linux/platform_data/dma-dw.h +++ b/include/linux/platform_data/dma-dw.h | |||
@@ -13,10 +13,12 @@ | |||
13 | 13 | ||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | 15 | ||
16 | #define DW_DMA_MAX_NR_MASTERS 4 | ||
17 | |||
16 | /** | 18 | /** |
17 | * struct dw_dma_slave - Controller-specific information about a slave | 19 | * struct dw_dma_slave - Controller-specific information about a slave |
18 | * | 20 | * |
19 | * @dma_dev: required DMA master device. Depricated. | 21 | * @dma_dev: required DMA master device |
20 | * @src_id: src request line | 22 | * @src_id: src request line |
21 | * @dst_id: dst request line | 23 | * @dst_id: dst request line |
22 | * @src_master: src master for transfers on allocated channel. | 24 | * @src_master: src master for transfers on allocated channel. |
@@ -53,7 +55,7 @@ struct dw_dma_platform_data { | |||
53 | unsigned char chan_priority; | 55 | unsigned char chan_priority; |
54 | unsigned short block_size; | 56 | unsigned short block_size; |
55 | unsigned char nr_masters; | 57 | unsigned char nr_masters; |
56 | unsigned char data_width[4]; | 58 | unsigned char data_width[DW_DMA_MAX_NR_MASTERS]; |
57 | }; | 59 | }; |
58 | 60 | ||
59 | #endif /* _PLATFORM_DATA_DMA_DW_H */ | 61 | #endif /* _PLATFORM_DATA_DMA_DW_H */ |
diff --git a/include/linux/platform_data/dma-mmp_tdma.h b/include/linux/platform_data/dma-mmp_tdma.h index 66574ea39f97..0c72886030ef 100644 --- a/include/linux/platform_data/dma-mmp_tdma.h +++ b/include/linux/platform_data/dma-mmp_tdma.h | |||
@@ -28,6 +28,13 @@ struct sram_platdata { | |||
28 | int granularity; | 28 | int granularity; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | #ifdef CONFIG_ARM | ||
31 | extern struct gen_pool *sram_get_gpool(char *pool_name); | 32 | extern struct gen_pool *sram_get_gpool(char *pool_name); |
33 | #else | ||
34 | static inline struct gen_pool *sram_get_gpool(char *pool_name) | ||
35 | { | ||
36 | return NULL; | ||
37 | } | ||
38 | #endif | ||
32 | 39 | ||
33 | #endif /* __DMA_MMP_TDMA_H */ | 40 | #endif /* __DMA_MMP_TDMA_H */ |
diff --git a/include/linux/platform_data/ipmmu-vmsa.h b/include/linux/platform_data/ipmmu-vmsa.h deleted file mode 100644 index 5275b3ac6d37..000000000000 --- a/include/linux/platform_data/ipmmu-vmsa.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * IPMMU VMSA Platform Data | ||
3 | * | ||
4 | * Copyright (C) 2014 Renesas Electronics Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | */ | ||
10 | |||
11 | #ifndef __IPMMU_VMSA_H__ | ||
12 | #define __IPMMU_VMSA_H__ | ||
13 | |||
14 | struct ipmmu_vmsa_master { | ||
15 | const char *name; | ||
16 | unsigned int utlb; | ||
17 | }; | ||
18 | |||
19 | struct ipmmu_vmsa_platform_data { | ||
20 | const struct ipmmu_vmsa_master *masters; | ||
21 | unsigned int num_masters; | ||
22 | }; | ||
23 | |||
24 | #endif /* __IPMMU_VMSA_H__ */ | ||
diff --git a/include/linux/platform_data/irda-sa11x0.h b/include/linux/platform_data/irda-sa11x0.h new file mode 100644 index 000000000000..38f77b5e56cf --- /dev/null +++ b/include/linux/platform_data/irda-sa11x0.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/mach/irda.h | ||
3 | * | ||
4 | * Copyright (C) 2004 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 | #ifndef __ASM_ARM_MACH_IRDA_H | ||
11 | #define __ASM_ARM_MACH_IRDA_H | ||
12 | |||
13 | struct irda_platform_data { | ||
14 | int (*startup)(struct device *); | ||
15 | void (*shutdown)(struct device *); | ||
16 | int (*set_power)(struct device *, unsigned int state); | ||
17 | void (*set_speed)(struct device *, unsigned int speed); | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h index 5c188f4e9bec..929469291406 100644 --- a/include/linux/platform_data/mmc-omap.h +++ b/include/linux/platform_data/mmc-omap.h | |||
@@ -31,10 +31,6 @@ struct omap_mmc_platform_data { | |||
31 | void (*cleanup)(struct device *dev); | 31 | void (*cleanup)(struct device *dev); |
32 | void (*shutdown)(struct device *dev); | 32 | void (*shutdown)(struct device *dev); |
33 | 33 | ||
34 | /* To handle board related suspend/resume functionality for MMC */ | ||
35 | int (*suspend)(struct device *dev, int slot); | ||
36 | int (*resume)(struct device *dev, int slot); | ||
37 | |||
38 | /* Return context loss count due to PM states changing */ | 34 | /* Return context loss count due to PM states changing */ |
39 | int (*get_context_loss_count)(struct device *dev); | 35 | int (*get_context_loss_count)(struct device *dev); |
40 | 36 | ||
diff --git a/include/linux/platform_data/regulator-haptic.h b/include/linux/platform_data/regulator-haptic.h new file mode 100644 index 000000000000..5658e58e0738 --- /dev/null +++ b/include/linux/platform_data/regulator-haptic.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Regulator Haptic Platform Data | ||
3 | * | ||
4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
5 | * Author: Jaewon Kim <jaewon02.kim@samsung.com> | ||
6 | * Author: Hyunhee Kim <hyunhee.kim@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 version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef _REGULATOR_HAPTIC_H | ||
14 | #define _REGULATOR_HAPTIC_H | ||
15 | |||
16 | /* | ||
17 | * struct regulator_haptic_data - Platform device data | ||
18 | * | ||
19 | * @max_volt: maximum voltage value supplied to the haptic motor. | ||
20 | * <The unit of the voltage is a micro> | ||
21 | * @min_volt: minimum voltage value supplied to the haptic motor. | ||
22 | * <The unit of the voltage is a micro> | ||
23 | */ | ||
24 | struct regulator_haptic_data { | ||
25 | unsigned int max_volt; | ||
26 | unsigned int min_volt; | ||
27 | }; | ||
28 | |||
29 | #endif /* _REGULATOR_HAPTIC_H */ | ||
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h index 5087fff96d86..cc2bdafb0c69 100644 --- a/include/linux/platform_data/st21nfca.h +++ b/include/linux/platform_data/st21nfca.h | |||
@@ -26,6 +26,8 @@ | |||
26 | struct st21nfca_nfc_platform_data { | 26 | struct st21nfca_nfc_platform_data { |
27 | unsigned int gpio_ena; | 27 | unsigned int gpio_ena; |
28 | unsigned int irq_polarity; | 28 | unsigned int irq_polarity; |
29 | bool is_ese_present; | ||
30 | bool is_uicc_present; | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | #endif /* _ST21NFCA_HCI_H_ */ | 33 | #endif /* _ST21NFCA_HCI_H_ */ |
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h index c3b432f5b63e..b023373d9874 100644 --- a/include/linux/platform_data/st21nfcb.h +++ b/include/linux/platform_data/st21nfcb.h | |||
@@ -19,8 +19,6 @@ | |||
19 | #ifndef _ST21NFCB_NCI_H_ | 19 | #ifndef _ST21NFCB_NCI_H_ |
20 | #define _ST21NFCB_NCI_H_ | 20 | #define _ST21NFCB_NCI_H_ |
21 | 21 | ||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" | 22 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" |
25 | 23 | ||
26 | struct st21nfcb_nfc_platform_data { | 24 | struct st21nfcb_nfc_platform_data { |
@@ -28,4 +26,4 @@ struct st21nfcb_nfc_platform_data { | |||
28 | unsigned int irq_polarity; | 26 | unsigned int irq_polarity; |
29 | }; | 27 | }; |
30 | 28 | ||
31 | #endif /* _ST21NFCA_HCI_H_ */ | 29 | #endif /* _ST21NFCB_NCI_H_ */ |
diff --git a/include/linux/platform_data/tpm_stm_st33.h b/include/linux/platform_data/tpm_stm_st33.h new file mode 100644 index 000000000000..ff75310c0f47 --- /dev/null +++ b/include/linux/platform_data/tpm_stm_st33.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * STMicroelectronics TPM I2C Linux driver for TPM ST33ZP24 | ||
3 | * Copyright (C) 2009, 2010 STMicroelectronics | ||
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; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
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 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * STMicroelectronics version 1.2.0, Copyright (C) 2010 | ||
19 | * STMicroelectronics comes with ABSOLUTELY NO WARRANTY. | ||
20 | * This is free software, and you are welcome to redistribute it | ||
21 | * under certain conditions. | ||
22 | * | ||
23 | * @Author: Christophe RICARD tpmsupport@st.com | ||
24 | * | ||
25 | * @File: stm_st33_tpm.h | ||
26 | * | ||
27 | * @Date: 09/15/2010 | ||
28 | */ | ||
29 | #ifndef __STM_ST33_TPM_H__ | ||
30 | #define __STM_ST33_TPM_H__ | ||
31 | |||
32 | #define TPM_ST33_I2C "st33zp24-i2c" | ||
33 | #define TPM_ST33_SPI "st33zp24-spi" | ||
34 | |||
35 | struct st33zp24_platform_data { | ||
36 | int io_lpcpd; | ||
37 | }; | ||
38 | |||
39 | #endif /* __STM_ST33_TPM_H__ */ | ||
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h deleted file mode 100644 index 63170e2614b3..000000000000 --- a/include/linux/platform_data/vsp1.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * vsp1.h -- R-Car VSP1 Platform Data | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Corporation | ||
5 | * | ||
6 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.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 | #ifndef __PLATFORM_VSP1_H__ | ||
14 | #define __PLATFORM_VSP1_H__ | ||
15 | |||
16 | #define VSP1_HAS_LIF (1 << 0) | ||
17 | #define VSP1_HAS_LUT (1 << 1) | ||
18 | #define VSP1_HAS_SRU (1 << 2) | ||
19 | |||
20 | struct vsp1_platform_data { | ||
21 | unsigned int features; | ||
22 | unsigned int rpf_count; | ||
23 | unsigned int uds_count; | ||
24 | unsigned int wpf_count; | ||
25 | }; | ||
26 | |||
27 | #endif /* __PLATFORM_VSP1_H__ */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8b5976364619..e2f1be6dd9dd 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -597,7 +597,7 @@ struct dev_pm_info { | |||
597 | 597 | ||
598 | extern void update_pm_runtime_accounting(struct device *dev); | 598 | extern void update_pm_runtime_accounting(struct device *dev); |
599 | extern int dev_pm_get_subsys_data(struct device *dev); | 599 | extern int dev_pm_get_subsys_data(struct device *dev); |
600 | extern int dev_pm_put_subsys_data(struct device *dev); | 600 | extern void dev_pm_put_subsys_data(struct device *dev); |
601 | 601 | ||
602 | /* | 602 | /* |
603 | * Power domains provide callbacks that are executed during system suspend, | 603 | * Power domains provide callbacks that are executed during system suspend, |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index a9edab2c787a..080e778118ba 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -113,8 +113,6 @@ struct generic_pm_domain_data { | |||
113 | struct pm_domain_data base; | 113 | struct pm_domain_data base; |
114 | struct gpd_timing_data td; | 114 | struct gpd_timing_data td; |
115 | struct notifier_block nb; | 115 | struct notifier_block nb; |
116 | struct mutex lock; | ||
117 | unsigned int refcount; | ||
118 | int need_restore; | 116 | int need_restore; |
119 | }; | 117 | }; |
120 | 118 | ||
@@ -140,7 +138,6 @@ extern int __pm_genpd_name_add_device(const char *domain_name, | |||
140 | 138 | ||
141 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 139 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
142 | struct device *dev); | 140 | struct device *dev); |
143 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); | ||
144 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 141 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
145 | struct generic_pm_domain *new_subdomain); | 142 | struct generic_pm_domain *new_subdomain); |
146 | extern int pm_genpd_add_subdomain_names(const char *master_name, | 143 | extern int pm_genpd_add_subdomain_names(const char *master_name, |
@@ -187,7 +184,6 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | |||
187 | { | 184 | { |
188 | return -ENOSYS; | 185 | return -ENOSYS; |
189 | } | 186 | } |
190 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} | ||
191 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 187 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
192 | struct generic_pm_domain *new_sd) | 188 | struct generic_pm_domain *new_sd) |
193 | { | 189 | { |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 195aafc6cd07..6512e9cbc6d5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/mod_devicetable.h> | 14 | #include <linux/mod_devicetable.h> |
15 | #include <linux/console.h> | ||
15 | 16 | ||
16 | #define PNP_NAME_LEN 50 | 17 | #define PNP_NAME_LEN 50 |
17 | 18 | ||
@@ -309,15 +310,22 @@ struct pnp_fixup { | |||
309 | #define PNP_DISABLE 0x0004 | 310 | #define PNP_DISABLE 0x0004 |
310 | #define PNP_CONFIGURABLE 0x0008 | 311 | #define PNP_CONFIGURABLE 0x0008 |
311 | #define PNP_REMOVABLE 0x0010 | 312 | #define PNP_REMOVABLE 0x0010 |
313 | #define PNP_CONSOLE 0x0020 | ||
312 | 314 | ||
313 | #define pnp_can_read(dev) (((dev)->protocol->get) && \ | 315 | #define pnp_can_read(dev) (((dev)->protocol->get) && \ |
314 | ((dev)->capabilities & PNP_READ)) | 316 | ((dev)->capabilities & PNP_READ)) |
315 | #define pnp_can_write(dev) (((dev)->protocol->set) && \ | 317 | #define pnp_can_write(dev) (((dev)->protocol->set) && \ |
316 | ((dev)->capabilities & PNP_WRITE)) | 318 | ((dev)->capabilities & PNP_WRITE)) |
317 | #define pnp_can_disable(dev) (((dev)->protocol->disable) && \ | 319 | #define pnp_can_disable(dev) (((dev)->protocol->disable) && \ |
318 | ((dev)->capabilities & PNP_DISABLE)) | 320 | ((dev)->capabilities & PNP_DISABLE) && \ |
321 | (!((dev)->capabilities & PNP_CONSOLE) || \ | ||
322 | console_suspend_enabled)) | ||
319 | #define pnp_can_configure(dev) ((!(dev)->active) && \ | 323 | #define pnp_can_configure(dev) ((!(dev)->active) && \ |
320 | ((dev)->capabilities & PNP_CONFIGURABLE)) | 324 | ((dev)->capabilities & PNP_CONFIGURABLE)) |
325 | #define pnp_can_suspend(dev) (((dev)->protocol->suspend) && \ | ||
326 | (!((dev)->capabilities & PNP_CONSOLE) || \ | ||
327 | console_suspend_enabled)) | ||
328 | |||
321 | 329 | ||
322 | #ifdef CONFIG_ISAPNP | 330 | #ifdef CONFIG_ISAPNP |
323 | extern struct pnp_protocol isapnp_protocol; | 331 | extern struct pnp_protocol isapnp_protocol; |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index e97fc656a058..416ebeb6ee1e 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/power_supply.h> | 18 | #include <linux/power_supply.h> |
19 | #include <linux/extcon.h> | 19 | #include <linux/extcon.h> |
20 | #include <linux/alarmtimer.h> | ||
20 | 21 | ||
21 | enum data_source { | 22 | enum data_source { |
22 | CM_BATTERY_PRESENT, | 23 | CM_BATTERY_PRESENT, |
@@ -45,29 +46,6 @@ enum cm_event_types { | |||
45 | }; | 46 | }; |
46 | 47 | ||
47 | /** | 48 | /** |
48 | * struct charger_global_desc | ||
49 | * @rtc_name: the name of RTC used to wake up the system from suspend. | ||
50 | * @rtc_only_wakeup: | ||
51 | * If the system is woken up by waekup-sources other than the RTC or | ||
52 | * callbacks, Charger Manager should recognize with | ||
53 | * rtc_only_wakeup() returning false. | ||
54 | * If the RTC given to CM is the only wakeup reason, | ||
55 | * rtc_only_wakeup should return true. | ||
56 | * @assume_timer_stops_in_suspend: | ||
57 | * Assume that the jiffy timer stops in suspend-to-RAM. | ||
58 | * When enabled, CM does not rely on jiffies value in | ||
59 | * suspend_again and assumes that jiffies value does not | ||
60 | * change during suspend. | ||
61 | */ | ||
62 | struct charger_global_desc { | ||
63 | char *rtc_name; | ||
64 | |||
65 | bool (*rtc_only_wakeup)(void); | ||
66 | |||
67 | bool assume_timer_stops_in_suspend; | ||
68 | }; | ||
69 | |||
70 | /** | ||
71 | * struct charger_cable | 49 | * struct charger_cable |
72 | * @extcon_name: the name of extcon device. | 50 | * @extcon_name: the name of extcon device. |
73 | * @name: the name of charger cable(external connector). | 51 | * @name: the name of charger cable(external connector). |
@@ -266,22 +244,14 @@ struct charger_manager { | |||
266 | char psy_name_buf[PSY_NAME_MAX + 1]; | 244 | char psy_name_buf[PSY_NAME_MAX + 1]; |
267 | struct power_supply charger_psy; | 245 | struct power_supply charger_psy; |
268 | 246 | ||
269 | bool status_save_ext_pwr_inserted; | ||
270 | bool status_save_batt; | ||
271 | |||
272 | u64 charging_start_time; | 247 | u64 charging_start_time; |
273 | u64 charging_end_time; | 248 | u64 charging_end_time; |
274 | }; | 249 | }; |
275 | 250 | ||
276 | #ifdef CONFIG_CHARGER_MANAGER | 251 | #ifdef CONFIG_CHARGER_MANAGER |
277 | extern int setup_charger_manager(struct charger_global_desc *gd); | ||
278 | extern bool cm_suspend_again(void); | ||
279 | extern void cm_notify_event(struct power_supply *psy, | 252 | extern void cm_notify_event(struct power_supply *psy, |
280 | enum cm_event_types type, char *msg); | 253 | enum cm_event_types type, char *msg); |
281 | #else | 254 | #else |
282 | static inline int setup_charger_manager(struct charger_global_desc *gd) | ||
283 | { return 0; } | ||
284 | static inline bool cm_suspend_again(void) { return false; } | ||
285 | static inline void cm_notify_event(struct power_supply *psy, | 255 | static inline void cm_notify_event(struct power_supply *psy, |
286 | enum cm_event_types type, char *msg) { } | 256 | enum cm_event_types type, char *msg) { } |
287 | #endif | 257 | #endif |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 4d5bf5726578..baa3f97d8ce8 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -417,9 +417,9 @@ enum { | |||
417 | DUMP_PREFIX_ADDRESS, | 417 | DUMP_PREFIX_ADDRESS, |
418 | DUMP_PREFIX_OFFSET | 418 | DUMP_PREFIX_OFFSET |
419 | }; | 419 | }; |
420 | extern void hex_dump_to_buffer(const void *buf, size_t len, | 420 | extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, |
421 | int rowsize, int groupsize, | 421 | int groupsize, char *linebuf, size_t linebuflen, |
422 | char *linebuf, size_t linebuflen, bool ascii); | 422 | bool ascii); |
423 | #ifdef CONFIG_PRINTK | 423 | #ifdef CONFIG_PRINTK |
424 | extern void print_hex_dump(const char *level, const char *prefix_str, | 424 | extern void print_hex_dump(const char *level, const char *prefix_str, |
425 | int prefix_type, int rowsize, int groupsize, | 425 | int prefix_type, int rowsize, int groupsize, |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index ece0c6bbfcc5..8884f6e507f7 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -39,6 +39,7 @@ enum pstore_type_id { | |||
39 | PSTORE_TYPE_PPC_RTAS = 4, | 39 | PSTORE_TYPE_PPC_RTAS = 4, |
40 | PSTORE_TYPE_PPC_OF = 5, | 40 | PSTORE_TYPE_PPC_OF = 5, |
41 | PSTORE_TYPE_PPC_COMMON = 6, | 41 | PSTORE_TYPE_PPC_COMMON = 6, |
42 | PSTORE_TYPE_PMSG = 7, | ||
42 | PSTORE_TYPE_UNKNOWN = 255 | 43 | PSTORE_TYPE_UNKNOWN = 255 |
43 | }; | 44 | }; |
44 | 45 | ||
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h index 4af3fdc85b01..9c9d6c154c8e 100644 --- a/include/linux/pstore_ram.h +++ b/include/linux/pstore_ram.h | |||
@@ -81,6 +81,7 @@ struct ramoops_platform_data { | |||
81 | unsigned long record_size; | 81 | unsigned long record_size; |
82 | unsigned long console_size; | 82 | unsigned long console_size; |
83 | unsigned long ftrace_size; | 83 | unsigned long ftrace_size; |
84 | unsigned long pmsg_size; | ||
84 | int dump_oops; | 85 | int dump_oops; |
85 | struct persistent_ram_ecc_info ecc_info; | 86 | struct persistent_ram_ecc_info ecc_info; |
86 | }; | 87 | }; |
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index 77aed9ea1d26..dab545bb66b3 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ | 37 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ |
38 | 38 | ||
39 | #define SSTO (0x28) /* SSP Time Out Register */ | 39 | #define SSTO (0x28) /* SSP Time Out Register */ |
40 | #define DDS_RATE (0x28) /* SSP DDS Clock Rate Register (Intel Quark) */ | ||
40 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ | 41 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ |
41 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ | 42 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ |
42 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | 43 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 097d7eb2441e..d534e8ed308a 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -216,19 +216,21 @@ struct mem_dqinfo { | |||
216 | unsigned long dqi_flags; | 216 | unsigned long dqi_flags; |
217 | unsigned int dqi_bgrace; | 217 | unsigned int dqi_bgrace; |
218 | unsigned int dqi_igrace; | 218 | unsigned int dqi_igrace; |
219 | qsize_t dqi_maxblimit; | 219 | qsize_t dqi_max_spc_limit; |
220 | qsize_t dqi_maxilimit; | 220 | qsize_t dqi_max_ino_limit; |
221 | void *dqi_priv; | 221 | void *dqi_priv; |
222 | }; | 222 | }; |
223 | 223 | ||
224 | struct super_block; | 224 | struct super_block; |
225 | 225 | ||
226 | #define DQF_MASK 0xffff /* Mask for format specific flags */ | 226 | /* Mask for flags passed to userspace */ |
227 | #define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */ | 227 | #define DQF_GETINFO_MASK (DQF_ROOT_SQUASH | DQF_SYS_FILE) |
228 | #define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */ | 228 | /* Mask for flags modifiable from userspace */ |
229 | #define DQF_SYS_FILE_B 16 | 229 | #define DQF_SETINFO_MASK DQF_ROOT_SQUASH |
230 | #define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */ | 230 | |
231 | #define DQF_INFO_DIRTY_B 31 | 231 | enum { |
232 | DQF_INFO_DIRTY_B = DQF_PRIVATE, | ||
233 | }; | ||
232 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ | 234 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ |
233 | 235 | ||
234 | extern void mark_info_dirty(struct super_block *sb, int type); | 236 | extern void mark_info_dirty(struct super_block *sb, int type); |
@@ -367,15 +369,15 @@ struct qc_dqblk { | |||
367 | /* Operations handling requests from userspace */ | 369 | /* Operations handling requests from userspace */ |
368 | struct quotactl_ops { | 370 | struct quotactl_ops { |
369 | int (*quota_on)(struct super_block *, int, int, struct path *); | 371 | int (*quota_on)(struct super_block *, int, int, struct path *); |
370 | int (*quota_on_meta)(struct super_block *, int, int); | ||
371 | int (*quota_off)(struct super_block *, int); | 372 | int (*quota_off)(struct super_block *, int); |
373 | int (*quota_enable)(struct super_block *, unsigned int); | ||
374 | int (*quota_disable)(struct super_block *, unsigned int); | ||
372 | int (*quota_sync)(struct super_block *, int); | 375 | int (*quota_sync)(struct super_block *, int); |
373 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 376 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
374 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 377 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
375 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 378 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
376 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 379 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
377 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 380 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); |
378 | int (*set_xstate)(struct super_block *, unsigned int, int); | ||
379 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); | 381 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); |
380 | int (*rm_xquota)(struct super_block *, unsigned int); | 382 | int (*rm_xquota)(struct super_block *, unsigned int); |
381 | }; | 383 | }; |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 29e3455f7d41..df73258cca47 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -166,6 +166,7 @@ static inline bool sb_has_quota_active(struct super_block *sb, int type) | |||
166 | */ | 166 | */ |
167 | extern const struct dquot_operations dquot_operations; | 167 | extern const struct dquot_operations dquot_operations; |
168 | extern const struct quotactl_ops dquot_quotactl_ops; | 168 | extern const struct quotactl_ops dquot_quotactl_ops; |
169 | extern const struct quotactl_ops dquot_quotactl_sysfile_ops; | ||
169 | 170 | ||
170 | #else | 171 | #else |
171 | 172 | ||
@@ -386,4 +387,6 @@ static inline void dquot_release_reservation_block(struct inode *inode, | |||
386 | __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); | 387 | __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); |
387 | } | 388 | } |
388 | 389 | ||
390 | unsigned int qtype_enforce_flag(int type); | ||
391 | |||
389 | #endif /* _LINUX_QUOTAOPS_ */ | 392 | #endif /* _LINUX_QUOTAOPS_ */ |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 57e75ae9910f..fb31765e935a 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -51,7 +51,7 @@ struct rb_root { | |||
51 | 51 | ||
52 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | 52 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) |
53 | 53 | ||
54 | /* 'empty' nodes are nodes that are known not to be inserted in an rbree */ | 54 | /* 'empty' nodes are nodes that are known not to be inserted in an rbtree */ |
55 | #define RB_EMPTY_NODE(node) \ | 55 | #define RB_EMPTY_NODE(node) \ |
56 | ((node)->__rb_parent_color == (unsigned long)(node)) | 56 | ((node)->__rb_parent_color == (unsigned long)(node)) |
57 | #define RB_CLEAR_NODE(node) \ | 57 | #define RB_CLEAR_NODE(node) \ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 529bc946f450..a18b16f1dc0e 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -524,11 +524,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, | |||
524 | * @member: the name of the hlist_node within the struct. | 524 | * @member: the name of the hlist_node within the struct. |
525 | */ | 525 | */ |
526 | #define hlist_for_each_entry_continue_rcu(pos, member) \ | 526 | #define hlist_for_each_entry_continue_rcu(pos, member) \ |
527 | for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ | 527 | for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ |
528 | typeof(*(pos)), member); \ | 528 | &(pos)->member)), typeof(*(pos)), member); \ |
529 | pos; \ | 529 | pos; \ |
530 | pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ | 530 | pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ |
531 | typeof(*(pos)), member)) | 531 | &(pos)->member)), typeof(*(pos)), member)) |
532 | 532 | ||
533 | /** | 533 | /** |
534 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | 534 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point |
@@ -536,11 +536,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, | |||
536 | * @member: the name of the hlist_node within the struct. | 536 | * @member: the name of the hlist_node within the struct. |
537 | */ | 537 | */ |
538 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ | 538 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ |
539 | for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ | 539 | for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \ |
540 | typeof(*(pos)), member); \ | 540 | &(pos)->member)), typeof(*(pos)), member); \ |
541 | pos; \ | 541 | pos; \ |
542 | pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ | 542 | pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \ |
543 | typeof(*(pos)), member)) | 543 | &(pos)->member)), typeof(*(pos)), member)) |
544 | 544 | ||
545 | /** | 545 | /** |
546 | * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point | 546 | * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index ed4f5939a452..78097491cd99 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -331,12 +331,13 @@ static inline void rcu_init_nohz(void) | |||
331 | extern struct srcu_struct tasks_rcu_exit_srcu; | 331 | extern struct srcu_struct tasks_rcu_exit_srcu; |
332 | #define rcu_note_voluntary_context_switch(t) \ | 332 | #define rcu_note_voluntary_context_switch(t) \ |
333 | do { \ | 333 | do { \ |
334 | rcu_all_qs(); \ | ||
334 | if (ACCESS_ONCE((t)->rcu_tasks_holdout)) \ | 335 | if (ACCESS_ONCE((t)->rcu_tasks_holdout)) \ |
335 | ACCESS_ONCE((t)->rcu_tasks_holdout) = false; \ | 336 | ACCESS_ONCE((t)->rcu_tasks_holdout) = false; \ |
336 | } while (0) | 337 | } while (0) |
337 | #else /* #ifdef CONFIG_TASKS_RCU */ | 338 | #else /* #ifdef CONFIG_TASKS_RCU */ |
338 | #define TASKS_RCU(x) do { } while (0) | 339 | #define TASKS_RCU(x) do { } while (0) |
339 | #define rcu_note_voluntary_context_switch(t) do { } while (0) | 340 | #define rcu_note_voluntary_context_switch(t) rcu_all_qs() |
340 | #endif /* #else #ifdef CONFIG_TASKS_RCU */ | 341 | #endif /* #else #ifdef CONFIG_TASKS_RCU */ |
341 | 342 | ||
342 | /** | 343 | /** |
@@ -582,11 +583,11 @@ static inline void rcu_preempt_sleep_check(void) | |||
582 | }) | 583 | }) |
583 | #define __rcu_dereference_check(p, c, space) \ | 584 | #define __rcu_dereference_check(p, c, space) \ |
584 | ({ \ | 585 | ({ \ |
585 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ | 586 | /* Dependency order vs. p above. */ \ |
587 | typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \ | ||
586 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ | 588 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ |
587 | rcu_dereference_sparse(p, space); \ | 589 | rcu_dereference_sparse(p, space); \ |
588 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | 590 | ((typeof(*p) __force __kernel *)(________p1)); \ |
589 | ((typeof(*p) __force __kernel *)(_________p1)); \ | ||
590 | }) | 591 | }) |
591 | #define __rcu_dereference_protected(p, c, space) \ | 592 | #define __rcu_dereference_protected(p, c, space) \ |
592 | ({ \ | 593 | ({ \ |
@@ -603,10 +604,10 @@ static inline void rcu_preempt_sleep_check(void) | |||
603 | }) | 604 | }) |
604 | #define __rcu_dereference_index_check(p, c) \ | 605 | #define __rcu_dereference_index_check(p, c) \ |
605 | ({ \ | 606 | ({ \ |
606 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 607 | /* Dependency order vs. p above. */ \ |
608 | typeof(p) _________p1 = lockless_dereference(p); \ | ||
607 | rcu_lockdep_assert(c, \ | 609 | rcu_lockdep_assert(c, \ |
608 | "suspicious rcu_dereference_index_check() usage"); \ | 610 | "suspicious rcu_dereference_index_check() usage"); \ |
609 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | ||
610 | (_________p1); \ | 611 | (_________p1); \ |
611 | }) | 612 | }) |
612 | 613 | ||
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 0e5366200154..937edaeb150d 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -92,17 +92,49 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * Return the number of grace periods. | 95 | * Return the number of grace periods started. |
96 | */ | 96 | */ |
97 | static inline long rcu_batches_completed(void) | 97 | static inline unsigned long rcu_batches_started(void) |
98 | { | 98 | { |
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Return the number of bottom-half grace periods. | 103 | * Return the number of bottom-half grace periods started. |
104 | */ | 104 | */ |
105 | static inline long rcu_batches_completed_bh(void) | 105 | static inline unsigned long rcu_batches_started_bh(void) |
106 | { | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * Return the number of sched grace periods started. | ||
112 | */ | ||
113 | static inline unsigned long rcu_batches_started_sched(void) | ||
114 | { | ||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | /* | ||
119 | * Return the number of grace periods completed. | ||
120 | */ | ||
121 | static inline unsigned long rcu_batches_completed(void) | ||
122 | { | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * Return the number of bottom-half grace periods completed. | ||
128 | */ | ||
129 | static inline unsigned long rcu_batches_completed_bh(void) | ||
130 | { | ||
131 | return 0; | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * Return the number of sched grace periods completed. | ||
136 | */ | ||
137 | static inline unsigned long rcu_batches_completed_sched(void) | ||
106 | { | 138 | { |
107 | return 0; | 139 | return 0; |
108 | } | 140 | } |
@@ -154,7 +186,10 @@ static inline bool rcu_is_watching(void) | |||
154 | return true; | 186 | return true; |
155 | } | 187 | } |
156 | 188 | ||
157 | |||
158 | #endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ | 189 | #endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ |
159 | 190 | ||
191 | static inline void rcu_all_qs(void) | ||
192 | { | ||
193 | } | ||
194 | |||
160 | #endif /* __LINUX_RCUTINY_H */ | 195 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 52953790dcca..d2e583a6aaca 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -81,9 +81,12 @@ void cond_synchronize_rcu(unsigned long oldstate); | |||
81 | 81 | ||
82 | extern unsigned long rcutorture_testseq; | 82 | extern unsigned long rcutorture_testseq; |
83 | extern unsigned long rcutorture_vernum; | 83 | extern unsigned long rcutorture_vernum; |
84 | long rcu_batches_completed(void); | 84 | unsigned long rcu_batches_started(void); |
85 | long rcu_batches_completed_bh(void); | 85 | unsigned long rcu_batches_started_bh(void); |
86 | long rcu_batches_completed_sched(void); | 86 | unsigned long rcu_batches_started_sched(void); |
87 | unsigned long rcu_batches_completed(void); | ||
88 | unsigned long rcu_batches_completed_bh(void); | ||
89 | unsigned long rcu_batches_completed_sched(void); | ||
87 | void show_rcu_gp_kthreads(void); | 90 | void show_rcu_gp_kthreads(void); |
88 | 91 | ||
89 | void rcu_force_quiescent_state(void); | 92 | void rcu_force_quiescent_state(void); |
@@ -97,4 +100,6 @@ extern int rcu_scheduler_active __read_mostly; | |||
97 | 100 | ||
98 | bool rcu_is_watching(void); | 101 | bool rcu_is_watching(void); |
99 | 102 | ||
103 | void rcu_all_qs(void); | ||
104 | |||
100 | #endif /* __LINUX_RCUTREE_H */ | 105 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 4419b99d8d6e..116655d92269 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -468,7 +468,7 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
468 | * | 468 | * |
469 | * @reg: Offset of the register within the regmap bank | 469 | * @reg: Offset of the register within the regmap bank |
470 | * @lsb: lsb of the register field. | 470 | * @lsb: lsb of the register field. |
471 | * @reg: msb of the register field. | 471 | * @msb: msb of the register field. |
472 | * @id_size: port size if it has some ports | 472 | * @id_size: port size if it has some ports |
473 | * @id_offset: address offset for each ports | 473 | * @id_offset: address offset for each ports |
474 | */ | 474 | */ |
diff --git a/include/linux/regulator/da9211.h b/include/linux/regulator/da9211.h index 5479394fefce..5dd65acc2a69 100644 --- a/include/linux/regulator/da9211.h +++ b/include/linux/regulator/da9211.h | |||
@@ -32,6 +32,8 @@ struct da9211_pdata { | |||
32 | * 2 : 2 phase 2 buck | 32 | * 2 : 2 phase 2 buck |
33 | */ | 33 | */ |
34 | int num_buck; | 34 | int num_buck; |
35 | int gpio_ren[DA9211_MAX_REGULATORS]; | ||
36 | struct device_node *reg_node[DA9211_MAX_REGULATORS]; | ||
35 | struct regulator_init_data *init_data[DA9211_MAX_REGULATORS]; | 37 | struct regulator_init_data *init_data[DA9211_MAX_REGULATORS]; |
36 | }; | 38 | }; |
37 | #endif | 39 | #endif |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 5f1e9ca47417..d4ad5b5a02bb 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | struct regmap; | 22 | struct regmap; |
23 | struct regulator_dev; | 23 | struct regulator_dev; |
24 | struct regulator_config; | ||
24 | struct regulator_init_data; | 25 | struct regulator_init_data; |
25 | struct regulator_enable_gpio; | 26 | struct regulator_enable_gpio; |
26 | 27 | ||
@@ -205,6 +206,15 @@ enum regulator_type { | |||
205 | * @supply_name: Identifying the regulator supply | 206 | * @supply_name: Identifying the regulator supply |
206 | * @of_match: Name used to identify regulator in DT. | 207 | * @of_match: Name used to identify regulator in DT. |
207 | * @regulators_node: Name of node containing regulator definitions in DT. | 208 | * @regulators_node: Name of node containing regulator definitions in DT. |
209 | * @of_parse_cb: Optional callback called only if of_match is present. | ||
210 | * Will be called for each regulator parsed from DT, during | ||
211 | * init_data parsing. | ||
212 | * The regulator_config passed as argument to the callback will | ||
213 | * be a copy of config passed to regulator_register, valid only | ||
214 | * for this particular call. Callback may freely change the | ||
215 | * config but it cannot store it for later usage. | ||
216 | * Callback should return 0 on success or negative ERRNO | ||
217 | * indicating failure. | ||
208 | * @id: Numerical identifier for the regulator. | 218 | * @id: Numerical identifier for the regulator. |
209 | * @ops: Regulator operations table. | 219 | * @ops: Regulator operations table. |
210 | * @irq: Interrupt number for the regulator. | 220 | * @irq: Interrupt number for the regulator. |
@@ -251,6 +261,9 @@ struct regulator_desc { | |||
251 | const char *supply_name; | 261 | const char *supply_name; |
252 | const char *of_match; | 262 | const char *of_match; |
253 | const char *regulators_node; | 263 | const char *regulators_node; |
264 | int (*of_parse_cb)(struct device_node *, | ||
265 | const struct regulator_desc *, | ||
266 | struct regulator_config *); | ||
254 | int id; | 267 | int id; |
255 | bool continuous_voltage_range; | 268 | bool continuous_voltage_range; |
256 | unsigned n_voltages; | 269 | unsigned n_voltages; |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 0b08d05d470b..b07562e082c4 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -191,15 +191,22 @@ struct regulator_init_data { | |||
191 | void *driver_data; /* core does not touch this */ | 191 | void *driver_data; /* core does not touch this */ |
192 | }; | 192 | }; |
193 | 193 | ||
194 | int regulator_suspend_prepare(suspend_state_t state); | ||
195 | int regulator_suspend_finish(void); | ||
196 | |||
197 | #ifdef CONFIG_REGULATOR | 194 | #ifdef CONFIG_REGULATOR |
198 | void regulator_has_full_constraints(void); | 195 | void regulator_has_full_constraints(void); |
196 | int regulator_suspend_prepare(suspend_state_t state); | ||
197 | int regulator_suspend_finish(void); | ||
199 | #else | 198 | #else |
200 | static inline void regulator_has_full_constraints(void) | 199 | static inline void regulator_has_full_constraints(void) |
201 | { | 200 | { |
202 | } | 201 | } |
202 | static inline int regulator_suspend_prepare(suspend_state_t state) | ||
203 | { | ||
204 | return 0; | ||
205 | } | ||
206 | static inline int regulator_suspend_finish(void) | ||
207 | { | ||
208 | return 0; | ||
209 | } | ||
203 | #endif | 210 | #endif |
204 | 211 | ||
205 | #endif | 212 | #endif |
diff --git a/include/linux/regulator/mt6397-regulator.h b/include/linux/regulator/mt6397-regulator.h new file mode 100644 index 000000000000..30cc5963e265 --- /dev/null +++ b/include/linux/regulator/mt6397-regulator.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 MediaTek Inc. | ||
3 | * Author: Flora Fu <flora.fu@mediatek.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 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 | |||
15 | #ifndef __LINUX_REGULATOR_MT6397_H | ||
16 | #define __LINUX_REGULATOR_MT6397_H | ||
17 | |||
18 | enum { | ||
19 | MT6397_ID_VPCA15 = 0, | ||
20 | MT6397_ID_VPCA7, | ||
21 | MT6397_ID_VSRAMCA15, | ||
22 | MT6397_ID_VSRAMCA7, | ||
23 | MT6397_ID_VCORE, | ||
24 | MT6397_ID_VGPU, | ||
25 | MT6397_ID_VDRM, | ||
26 | MT6397_ID_VIO18 = 7, | ||
27 | MT6397_ID_VTCXO, | ||
28 | MT6397_ID_VA28, | ||
29 | MT6397_ID_VCAMA, | ||
30 | MT6397_ID_VIO28, | ||
31 | MT6397_ID_VUSB, | ||
32 | MT6397_ID_VMC, | ||
33 | MT6397_ID_VMCH, | ||
34 | MT6397_ID_VEMC3V3, | ||
35 | MT6397_ID_VGP1, | ||
36 | MT6397_ID_VGP2, | ||
37 | MT6397_ID_VGP3, | ||
38 | MT6397_ID_VGP4, | ||
39 | MT6397_ID_VGP5, | ||
40 | MT6397_ID_VGP6, | ||
41 | MT6397_ID_VIBR, | ||
42 | MT6397_ID_RG_MAX, | ||
43 | }; | ||
44 | |||
45 | #define MT6397_MAX_REGULATOR MT6397_ID_RG_MAX | ||
46 | #define MT6397_REGULATOR_ID97 0x97 | ||
47 | #define MT6397_REGULATOR_ID91 0x91 | ||
48 | |||
49 | #endif /* __LINUX_REGULATOR_MT6397_H */ | ||
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h index 364f7a7c43db..70c6c66c5bcf 100644 --- a/include/linux/regulator/pfuze100.h +++ b/include/linux/regulator/pfuze100.h | |||
@@ -49,6 +49,20 @@ | |||
49 | #define PFUZE200_VGEN5 11 | 49 | #define PFUZE200_VGEN5 11 |
50 | #define PFUZE200_VGEN6 12 | 50 | #define PFUZE200_VGEN6 12 |
51 | 51 | ||
52 | #define PFUZE3000_SW1A 0 | ||
53 | #define PFUZE3000_SW1B 1 | ||
54 | #define PFUZE3000_SW2 2 | ||
55 | #define PFUZE3000_SW3 3 | ||
56 | #define PFUZE3000_SWBST 4 | ||
57 | #define PFUZE3000_VSNVS 5 | ||
58 | #define PFUZE3000_VREFDDR 6 | ||
59 | #define PFUZE3000_VLDO1 7 | ||
60 | #define PFUZE3000_VLDO2 8 | ||
61 | #define PFUZE3000_VCCSD 9 | ||
62 | #define PFUZE3000_V33 10 | ||
63 | #define PFUZE3000_VLDO3 11 | ||
64 | #define PFUZE3000_VLDO4 12 | ||
65 | |||
52 | struct regulator_init_data; | 66 | struct regulator_init_data; |
53 | 67 | ||
54 | struct pfuze_regulator_platform_data { | 68 | struct pfuze_regulator_platform_data { |
diff --git a/include/linux/resource_ext.h b/include/linux/resource_ext.h new file mode 100644 index 000000000000..e2bf63d881d4 --- /dev/null +++ b/include/linux/resource_ext.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015, Intel Corporation | ||
3 | * Author: Jiang Liu <jiang.liu@linux.intel.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | #ifndef _LINUX_RESOURCE_EXT_H | ||
15 | #define _LINUX_RESOURCE_EXT_H | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/ioport.h> | ||
19 | #include <linux/slab.h> | ||
20 | |||
21 | /* Represent resource window for bridge devices */ | ||
22 | struct resource_win { | ||
23 | struct resource res; /* In master (CPU) address space */ | ||
24 | resource_size_t offset; /* Translation offset for bridge */ | ||
25 | }; | ||
26 | |||
27 | /* | ||
28 | * Common resource list management data structure and interfaces to support | ||
29 | * ACPI, PNP and PCI host bridge etc. | ||
30 | */ | ||
31 | struct resource_entry { | ||
32 | struct list_head node; | ||
33 | struct resource *res; /* In master (CPU) address space */ | ||
34 | resource_size_t offset; /* Translation offset for bridge */ | ||
35 | struct resource __res; /* Default storage for res */ | ||
36 | }; | ||
37 | |||
38 | extern struct resource_entry * | ||
39 | resource_list_create_entry(struct resource *res, size_t extra_size); | ||
40 | extern void resource_list_free(struct list_head *head); | ||
41 | |||
42 | static inline void resource_list_add(struct resource_entry *entry, | ||
43 | struct list_head *head) | ||
44 | { | ||
45 | list_add(&entry->node, head); | ||
46 | } | ||
47 | |||
48 | static inline void resource_list_add_tail(struct resource_entry *entry, | ||
49 | struct list_head *head) | ||
50 | { | ||
51 | list_add_tail(&entry->node, head); | ||
52 | } | ||
53 | |||
54 | static inline void resource_list_del(struct resource_entry *entry) | ||
55 | { | ||
56 | list_del(&entry->node); | ||
57 | } | ||
58 | |||
59 | static inline void resource_list_free_entry(struct resource_entry *entry) | ||
60 | { | ||
61 | kfree(entry); | ||
62 | } | ||
63 | |||
64 | static inline void | ||
65 | resource_list_destroy_entry(struct resource_entry *entry) | ||
66 | { | ||
67 | resource_list_del(entry); | ||
68 | resource_list_free_entry(entry); | ||
69 | } | ||
70 | |||
71 | #define resource_list_for_each_entry(entry, list) \ | ||
72 | list_for_each_entry((entry), (list), node) | ||
73 | |||
74 | #define resource_list_for_each_entry_safe(entry, tmp, list) \ | ||
75 | list_for_each_entry_safe((entry), (tmp), (list), node) | ||
76 | |||
77 | #endif /* _LINUX_RESOURCE_EXT_H */ | ||
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index b93fd89b2e5e..58851275fed9 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
@@ -18,16 +18,45 @@ | |||
18 | #ifndef _LINUX_RHASHTABLE_H | 18 | #ifndef _LINUX_RHASHTABLE_H |
19 | #define _LINUX_RHASHTABLE_H | 19 | #define _LINUX_RHASHTABLE_H |
20 | 20 | ||
21 | #include <linux/rculist.h> | 21 | #include <linux/compiler.h> |
22 | #include <linux/list_nulls.h> | ||
23 | #include <linux/workqueue.h> | ||
24 | #include <linux/mutex.h> | ||
25 | |||
26 | /* | ||
27 | * The end of the chain is marked with a special nulls marks which has | ||
28 | * the following format: | ||
29 | * | ||
30 | * +-------+-----------------------------------------------------+-+ | ||
31 | * | Base | Hash |1| | ||
32 | * +-------+-----------------------------------------------------+-+ | ||
33 | * | ||
34 | * Base (4 bits) : Reserved to distinguish between multiple tables. | ||
35 | * Specified via &struct rhashtable_params.nulls_base. | ||
36 | * Hash (27 bits): Full hash (unmasked) of first element added to bucket | ||
37 | * 1 (1 bit) : Nulls marker (always set) | ||
38 | * | ||
39 | * The remaining bits of the next pointer remain unused for now. | ||
40 | */ | ||
41 | #define RHT_BASE_BITS 4 | ||
42 | #define RHT_HASH_BITS 27 | ||
43 | #define RHT_BASE_SHIFT RHT_HASH_BITS | ||
22 | 44 | ||
23 | struct rhash_head { | 45 | struct rhash_head { |
24 | struct rhash_head __rcu *next; | 46 | struct rhash_head __rcu *next; |
25 | }; | 47 | }; |
26 | 48 | ||
27 | #define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL) | 49 | /** |
28 | 50 | * struct bucket_table - Table of hash buckets | |
51 | * @size: Number of hash buckets | ||
52 | * @locks_mask: Mask to apply before accessing locks[] | ||
53 | * @locks: Array of spinlocks protecting individual buckets | ||
54 | * @buckets: size * hash buckets | ||
55 | */ | ||
29 | struct bucket_table { | 56 | struct bucket_table { |
30 | size_t size; | 57 | size_t size; |
58 | unsigned int locks_mask; | ||
59 | spinlock_t *locks; | ||
31 | struct rhash_head __rcu *buckets[]; | 60 | struct rhash_head __rcu *buckets[]; |
32 | }; | 61 | }; |
33 | 62 | ||
@@ -45,11 +74,16 @@ struct rhashtable; | |||
45 | * @hash_rnd: Seed to use while hashing | 74 | * @hash_rnd: Seed to use while hashing |
46 | * @max_shift: Maximum number of shifts while expanding | 75 | * @max_shift: Maximum number of shifts while expanding |
47 | * @min_shift: Minimum number of shifts while shrinking | 76 | * @min_shift: Minimum number of shifts while shrinking |
77 | * @nulls_base: Base value to generate nulls marker | ||
78 | * @locks_mul: Number of bucket locks to allocate per cpu (default: 128) | ||
48 | * @hashfn: Function to hash key | 79 | * @hashfn: Function to hash key |
49 | * @obj_hashfn: Function to hash object | 80 | * @obj_hashfn: Function to hash object |
50 | * @grow_decision: If defined, may return true if table should expand | 81 | * @grow_decision: If defined, may return true if table should expand |
51 | * @shrink_decision: If defined, may return true if table should shrink | 82 | * @shrink_decision: If defined, may return true if table should shrink |
52 | * @mutex_is_held: Must return true if protecting mutex is held | 83 | * |
84 | * Note: when implementing the grow and shrink decision function, min/max | ||
85 | * shift must be enforced, otherwise, resizing watermarks they set may be | ||
86 | * useless. | ||
53 | */ | 87 | */ |
54 | struct rhashtable_params { | 88 | struct rhashtable_params { |
55 | size_t nelem_hint; | 89 | size_t nelem_hint; |
@@ -59,36 +93,95 @@ struct rhashtable_params { | |||
59 | u32 hash_rnd; | 93 | u32 hash_rnd; |
60 | size_t max_shift; | 94 | size_t max_shift; |
61 | size_t min_shift; | 95 | size_t min_shift; |
96 | u32 nulls_base; | ||
97 | size_t locks_mul; | ||
62 | rht_hashfn_t hashfn; | 98 | rht_hashfn_t hashfn; |
63 | rht_obj_hashfn_t obj_hashfn; | 99 | rht_obj_hashfn_t obj_hashfn; |
64 | bool (*grow_decision)(const struct rhashtable *ht, | 100 | bool (*grow_decision)(const struct rhashtable *ht, |
65 | size_t new_size); | 101 | size_t new_size); |
66 | bool (*shrink_decision)(const struct rhashtable *ht, | 102 | bool (*shrink_decision)(const struct rhashtable *ht, |
67 | size_t new_size); | 103 | size_t new_size); |
68 | #ifdef CONFIG_PROVE_LOCKING | ||
69 | int (*mutex_is_held)(void *parent); | ||
70 | void *parent; | ||
71 | #endif | ||
72 | }; | 104 | }; |
73 | 105 | ||
74 | /** | 106 | /** |
75 | * struct rhashtable - Hash table handle | 107 | * struct rhashtable - Hash table handle |
76 | * @tbl: Bucket table | 108 | * @tbl: Bucket table |
109 | * @future_tbl: Table under construction during expansion/shrinking | ||
77 | * @nelems: Number of elements in table | 110 | * @nelems: Number of elements in table |
78 | * @shift: Current size (1 << shift) | 111 | * @shift: Current size (1 << shift) |
79 | * @p: Configuration parameters | 112 | * @p: Configuration parameters |
113 | * @run_work: Deferred worker to expand/shrink asynchronously | ||
114 | * @mutex: Mutex to protect current/future table swapping | ||
115 | * @walkers: List of active walkers | ||
116 | * @being_destroyed: True if table is set up for destruction | ||
80 | */ | 117 | */ |
81 | struct rhashtable { | 118 | struct rhashtable { |
82 | struct bucket_table __rcu *tbl; | 119 | struct bucket_table __rcu *tbl; |
83 | size_t nelems; | 120 | struct bucket_table __rcu *future_tbl; |
84 | size_t shift; | 121 | atomic_t nelems; |
122 | atomic_t shift; | ||
85 | struct rhashtable_params p; | 123 | struct rhashtable_params p; |
124 | struct work_struct run_work; | ||
125 | struct mutex mutex; | ||
126 | struct list_head walkers; | ||
127 | bool being_destroyed; | ||
128 | }; | ||
129 | |||
130 | /** | ||
131 | * struct rhashtable_walker - Hash table walker | ||
132 | * @list: List entry on list of walkers | ||
133 | * @resize: Resize event occured | ||
134 | */ | ||
135 | struct rhashtable_walker { | ||
136 | struct list_head list; | ||
137 | bool resize; | ||
86 | }; | 138 | }; |
87 | 139 | ||
140 | /** | ||
141 | * struct rhashtable_iter - Hash table iterator, fits into netlink cb | ||
142 | * @ht: Table to iterate through | ||
143 | * @p: Current pointer | ||
144 | * @walker: Associated rhashtable walker | ||
145 | * @slot: Current slot | ||
146 | * @skip: Number of entries to skip in slot | ||
147 | */ | ||
148 | struct rhashtable_iter { | ||
149 | struct rhashtable *ht; | ||
150 | struct rhash_head *p; | ||
151 | struct rhashtable_walker *walker; | ||
152 | unsigned int slot; | ||
153 | unsigned int skip; | ||
154 | }; | ||
155 | |||
156 | static inline unsigned long rht_marker(const struct rhashtable *ht, u32 hash) | ||
157 | { | ||
158 | return NULLS_MARKER(ht->p.nulls_base + hash); | ||
159 | } | ||
160 | |||
161 | #define INIT_RHT_NULLS_HEAD(ptr, ht, hash) \ | ||
162 | ((ptr) = (typeof(ptr)) rht_marker(ht, hash)) | ||
163 | |||
164 | static inline bool rht_is_a_nulls(const struct rhash_head *ptr) | ||
165 | { | ||
166 | return ((unsigned long) ptr & 1); | ||
167 | } | ||
168 | |||
169 | static inline unsigned long rht_get_nulls_value(const struct rhash_head *ptr) | ||
170 | { | ||
171 | return ((unsigned long) ptr) >> 1; | ||
172 | } | ||
173 | |||
88 | #ifdef CONFIG_PROVE_LOCKING | 174 | #ifdef CONFIG_PROVE_LOCKING |
89 | int lockdep_rht_mutex_is_held(const struct rhashtable *ht); | 175 | int lockdep_rht_mutex_is_held(struct rhashtable *ht); |
176 | int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash); | ||
90 | #else | 177 | #else |
91 | static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | 178 | static inline int lockdep_rht_mutex_is_held(struct rhashtable *ht) |
179 | { | ||
180 | return 1; | ||
181 | } | ||
182 | |||
183 | static inline int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, | ||
184 | u32 hash) | ||
92 | { | 185 | { |
93 | return 1; | 186 | return 1; |
94 | } | 187 | } |
@@ -96,13 +189,8 @@ static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | |||
96 | 189 | ||
97 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); | 190 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); |
98 | 191 | ||
99 | u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len); | ||
100 | u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr); | ||
101 | |||
102 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); | 192 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); |
103 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); | 193 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); |
104 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, | ||
105 | struct rhash_head __rcu **pprev); | ||
106 | 194 | ||
107 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); | 195 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); |
108 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | 196 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); |
@@ -110,11 +198,23 @@ bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | |||
110 | int rhashtable_expand(struct rhashtable *ht); | 198 | int rhashtable_expand(struct rhashtable *ht); |
111 | int rhashtable_shrink(struct rhashtable *ht); | 199 | int rhashtable_shrink(struct rhashtable *ht); |
112 | 200 | ||
113 | void *rhashtable_lookup(const struct rhashtable *ht, const void *key); | 201 | void *rhashtable_lookup(struct rhashtable *ht, const void *key); |
114 | void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash, | 202 | void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key, |
115 | bool (*compare)(void *, void *), void *arg); | 203 | bool (*compare)(void *, void *), void *arg); |
116 | 204 | ||
117 | void rhashtable_destroy(const struct rhashtable *ht); | 205 | bool rhashtable_lookup_insert(struct rhashtable *ht, struct rhash_head *obj); |
206 | bool rhashtable_lookup_compare_insert(struct rhashtable *ht, | ||
207 | struct rhash_head *obj, | ||
208 | bool (*compare)(void *, void *), | ||
209 | void *arg); | ||
210 | |||
211 | int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter); | ||
212 | void rhashtable_walk_exit(struct rhashtable_iter *iter); | ||
213 | int rhashtable_walk_start(struct rhashtable_iter *iter) __acquires(RCU); | ||
214 | void *rhashtable_walk_next(struct rhashtable_iter *iter); | ||
215 | void rhashtable_walk_stop(struct rhashtable_iter *iter) __releases(RCU); | ||
216 | |||
217 | void rhashtable_destroy(struct rhashtable *ht); | ||
118 | 218 | ||
119 | #define rht_dereference(p, ht) \ | 219 | #define rht_dereference(p, ht) \ |
120 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) | 220 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) |
@@ -122,92 +222,146 @@ void rhashtable_destroy(const struct rhashtable *ht); | |||
122 | #define rht_dereference_rcu(p, ht) \ | 222 | #define rht_dereference_rcu(p, ht) \ |
123 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) | 223 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) |
124 | 224 | ||
125 | #define rht_entry(ptr, type, member) container_of(ptr, type, member) | 225 | #define rht_dereference_bucket(p, tbl, hash) \ |
126 | #define rht_entry_safe(ptr, type, member) \ | 226 | rcu_dereference_protected(p, lockdep_rht_bucket_is_held(tbl, hash)) |
127 | ({ \ | 227 | |
128 | typeof(ptr) __ptr = (ptr); \ | 228 | #define rht_dereference_bucket_rcu(p, tbl, hash) \ |
129 | __ptr ? rht_entry(__ptr, type, member) : NULL; \ | 229 | rcu_dereference_check(p, lockdep_rht_bucket_is_held(tbl, hash)) |
130 | }) | ||
131 | 230 | ||
132 | #define rht_next_entry_safe(pos, ht, member) \ | 231 | #define rht_entry(tpos, pos, member) \ |
133 | ({ \ | 232 | ({ tpos = container_of(pos, typeof(*tpos), member); 1; }) |
134 | pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \ | 233 | |
135 | typeof(*(pos)), member) : NULL; \ | 234 | /** |
136 | }) | 235 | * rht_for_each_continue - continue iterating over hash chain |
236 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
237 | * @head: the previous &struct rhash_head to continue from | ||
238 | * @tbl: the &struct bucket_table | ||
239 | * @hash: the hash value / bucket index | ||
240 | */ | ||
241 | #define rht_for_each_continue(pos, head, tbl, hash) \ | ||
242 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
243 | !rht_is_a_nulls(pos); \ | ||
244 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
137 | 245 | ||
138 | /** | 246 | /** |
139 | * rht_for_each - iterate over hash chain | 247 | * rht_for_each - iterate over hash chain |
140 | * @pos: &struct rhash_head to use as a loop cursor. | 248 | * @pos: the &struct rhash_head to use as a loop cursor. |
141 | * @head: head of the hash chain (struct rhash_head *) | 249 | * @tbl: the &struct bucket_table |
142 | * @ht: pointer to your struct rhashtable | 250 | * @hash: the hash value / bucket index |
143 | */ | 251 | */ |
144 | #define rht_for_each(pos, head, ht) \ | 252 | #define rht_for_each(pos, tbl, hash) \ |
145 | for (pos = rht_dereference(head, ht); \ | 253 | rht_for_each_continue(pos, (tbl)->buckets[hash], tbl, hash) |
146 | pos; \ | 254 | |
147 | pos = rht_dereference((pos)->next, ht)) | 255 | /** |
256 | * rht_for_each_entry_continue - continue iterating over hash chain | ||
257 | * @tpos: the type * to use as a loop cursor. | ||
258 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
259 | * @head: the previous &struct rhash_head to continue from | ||
260 | * @tbl: the &struct bucket_table | ||
261 | * @hash: the hash value / bucket index | ||
262 | * @member: name of the &struct rhash_head within the hashable struct. | ||
263 | */ | ||
264 | #define rht_for_each_entry_continue(tpos, pos, head, tbl, hash, member) \ | ||
265 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
266 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ | ||
267 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
148 | 268 | ||
149 | /** | 269 | /** |
150 | * rht_for_each_entry - iterate over hash chain of given type | 270 | * rht_for_each_entry - iterate over hash chain of given type |
151 | * @pos: type * to use as a loop cursor. | 271 | * @tpos: the type * to use as a loop cursor. |
152 | * @head: head of the hash chain (struct rhash_head *) | 272 | * @pos: the &struct rhash_head to use as a loop cursor. |
153 | * @ht: pointer to your struct rhashtable | 273 | * @tbl: the &struct bucket_table |
154 | * @member: name of the rhash_head within the hashable struct. | 274 | * @hash: the hash value / bucket index |
275 | * @member: name of the &struct rhash_head within the hashable struct. | ||
155 | */ | 276 | */ |
156 | #define rht_for_each_entry(pos, head, ht, member) \ | 277 | #define rht_for_each_entry(tpos, pos, tbl, hash, member) \ |
157 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 278 | rht_for_each_entry_continue(tpos, pos, (tbl)->buckets[hash], \ |
158 | typeof(*(pos)), member); \ | 279 | tbl, hash, member) |
159 | pos; \ | ||
160 | pos = rht_next_entry_safe(pos, ht, member)) | ||
161 | 280 | ||
162 | /** | 281 | /** |
163 | * rht_for_each_entry_safe - safely iterate over hash chain of given type | 282 | * rht_for_each_entry_safe - safely iterate over hash chain of given type |
164 | * @pos: type * to use as a loop cursor. | 283 | * @tpos: the type * to use as a loop cursor. |
165 | * @n: type * to use for temporary next object storage | 284 | * @pos: the &struct rhash_head to use as a loop cursor. |
166 | * @head: head of the hash chain (struct rhash_head *) | 285 | * @next: the &struct rhash_head to use as next in loop cursor. |
167 | * @ht: pointer to your struct rhashtable | 286 | * @tbl: the &struct bucket_table |
168 | * @member: name of the rhash_head within the hashable struct. | 287 | * @hash: the hash value / bucket index |
288 | * @member: name of the &struct rhash_head within the hashable struct. | ||
169 | * | 289 | * |
170 | * This hash chain list-traversal primitive allows for the looped code to | 290 | * This hash chain list-traversal primitive allows for the looped code to |
171 | * remove the loop cursor from the list. | 291 | * remove the loop cursor from the list. |
172 | */ | 292 | */ |
173 | #define rht_for_each_entry_safe(pos, n, head, ht, member) \ | 293 | #define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \ |
174 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 294 | for (pos = rht_dereference_bucket((tbl)->buckets[hash], tbl, hash), \ |
175 | typeof(*(pos)), member), \ | 295 | next = !rht_is_a_nulls(pos) ? \ |
176 | n = rht_next_entry_safe(pos, ht, member); \ | 296 | rht_dereference_bucket(pos->next, tbl, hash) : NULL; \ |
177 | pos; \ | 297 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
178 | pos = n, \ | 298 | pos = next, \ |
179 | n = rht_next_entry_safe(pos, ht, member)) | 299 | next = !rht_is_a_nulls(pos) ? \ |
300 | rht_dereference_bucket(pos->next, tbl, hash) : NULL) | ||
301 | |||
302 | /** | ||
303 | * rht_for_each_rcu_continue - continue iterating over rcu hash chain | ||
304 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
305 | * @head: the previous &struct rhash_head to continue from | ||
306 | * @tbl: the &struct bucket_table | ||
307 | * @hash: the hash value / bucket index | ||
308 | * | ||
309 | * This hash chain list-traversal primitive may safely run concurrently with | ||
310 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
311 | * traversal is guarded by rcu_read_lock(). | ||
312 | */ | ||
313 | #define rht_for_each_rcu_continue(pos, head, tbl, hash) \ | ||
314 | for (({barrier(); }), \ | ||
315 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ | ||
316 | !rht_is_a_nulls(pos); \ | ||
317 | pos = rcu_dereference_raw(pos->next)) | ||
180 | 318 | ||
181 | /** | 319 | /** |
182 | * rht_for_each_rcu - iterate over rcu hash chain | 320 | * rht_for_each_rcu - iterate over rcu hash chain |
183 | * @pos: &struct rhash_head to use as a loop cursor. | 321 | * @pos: the &struct rhash_head to use as a loop cursor. |
184 | * @head: head of the hash chain (struct rhash_head *) | 322 | * @tbl: the &struct bucket_table |
185 | * @ht: pointer to your struct rhashtable | 323 | * @hash: the hash value / bucket index |
324 | * | ||
325 | * This hash chain list-traversal primitive may safely run concurrently with | ||
326 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
327 | * traversal is guarded by rcu_read_lock(). | ||
328 | */ | ||
329 | #define rht_for_each_rcu(pos, tbl, hash) \ | ||
330 | rht_for_each_rcu_continue(pos, (tbl)->buckets[hash], tbl, hash) | ||
331 | |||
332 | /** | ||
333 | * rht_for_each_entry_rcu_continue - continue iterating over rcu hash chain | ||
334 | * @tpos: the type * to use as a loop cursor. | ||
335 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
336 | * @head: the previous &struct rhash_head to continue from | ||
337 | * @tbl: the &struct bucket_table | ||
338 | * @hash: the hash value / bucket index | ||
339 | * @member: name of the &struct rhash_head within the hashable struct. | ||
186 | * | 340 | * |
187 | * This hash chain list-traversal primitive may safely run concurrently with | 341 | * This hash chain list-traversal primitive may safely run concurrently with |
188 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 342 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
189 | * traversal is guarded by rcu_read_lock(). | 343 | * traversal is guarded by rcu_read_lock(). |
190 | */ | 344 | */ |
191 | #define rht_for_each_rcu(pos, head, ht) \ | 345 | #define rht_for_each_entry_rcu_continue(tpos, pos, head, tbl, hash, member) \ |
192 | for (pos = rht_dereference_rcu(head, ht); \ | 346 | for (({barrier(); }), \ |
193 | pos; \ | 347 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ |
194 | pos = rht_dereference_rcu((pos)->next, ht)) | 348 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
349 | pos = rht_dereference_bucket_rcu(pos->next, tbl, hash)) | ||
195 | 350 | ||
196 | /** | 351 | /** |
197 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type | 352 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type |
198 | * @pos: type * to use as a loop cursor. | 353 | * @tpos: the type * to use as a loop cursor. |
199 | * @head: head of the hash chain (struct rhash_head *) | 354 | * @pos: the &struct rhash_head to use as a loop cursor. |
200 | * @member: name of the rhash_head within the hashable struct. | 355 | * @tbl: the &struct bucket_table |
356 | * @hash: the hash value / bucket index | ||
357 | * @member: name of the &struct rhash_head within the hashable struct. | ||
201 | * | 358 | * |
202 | * This hash chain list-traversal primitive may safely run concurrently with | 359 | * This hash chain list-traversal primitive may safely run concurrently with |
203 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 360 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
204 | * traversal is guarded by rcu_read_lock(). | 361 | * traversal is guarded by rcu_read_lock(). |
205 | */ | 362 | */ |
206 | #define rht_for_each_entry_rcu(pos, head, member) \ | 363 | #define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \ |
207 | for (pos = rht_entry_safe(rcu_dereference_raw(head), \ | 364 | rht_for_each_entry_rcu_continue(tpos, pos, (tbl)->buckets[hash],\ |
208 | typeof(*(pos)), member); \ | 365 | tbl, hash, member) |
209 | pos; \ | ||
210 | pos = rht_entry_safe(rcu_dereference_raw((pos)->member.next), \ | ||
211 | typeof(*(pos)), member)) | ||
212 | 366 | ||
213 | #endif /* _LINUX_RHASHTABLE_H */ | 367 | #endif /* _LINUX_RHASHTABLE_H */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index d9d7e7e56352..c4c559a45dc8 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -198,7 +198,7 @@ int page_referenced(struct page *, int is_locked, | |||
198 | int try_to_unmap(struct page *, enum ttu_flags flags); | 198 | int try_to_unmap(struct page *, enum ttu_flags flags); |
199 | 199 | ||
200 | /* | 200 | /* |
201 | * Called from mm/filemap_xip.c to unmap empty zero page | 201 | * Used by uprobes to replace a userspace page safely |
202 | */ | 202 | */ |
203 | pte_t *__page_check_address(struct page *, struct mm_struct *, | 203 | pte_t *__page_check_address(struct page *, struct mm_struct *, |
204 | unsigned long, spinlock_t **, int); | 204 | unsigned long, spinlock_t **, int); |
@@ -246,7 +246,6 @@ int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | |||
246 | * arg: passed to rmap_one() and invalid_vma() | 246 | * arg: passed to rmap_one() and invalid_vma() |
247 | * rmap_one: executed on each vma where page is mapped | 247 | * rmap_one: executed on each vma where page is mapped |
248 | * done: for checking traversing termination condition | 248 | * done: for checking traversing termination condition |
249 | * file_nonlinear: for handling file nonlinear mapping | ||
250 | * anon_lock: for getting anon_lock by optimized way rather than default | 249 | * anon_lock: for getting anon_lock by optimized way rather than default |
251 | * invalid_vma: for skipping uninterested vma | 250 | * invalid_vma: for skipping uninterested vma |
252 | */ | 251 | */ |
@@ -255,7 +254,6 @@ struct rmap_walk_control { | |||
255 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | 254 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, |
256 | unsigned long addr, void *arg); | 255 | unsigned long addr, void *arg); |
257 | int (*done)(struct page *page); | 256 | int (*done)(struct page *page); |
258 | int (*file_nonlinear)(struct page *, struct address_space *, void *arg); | ||
259 | struct anon_vma *(*anon_lock)(struct page *page); | 257 | struct anon_vma *(*anon_lock)(struct page *page); |
260 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | 258 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); |
261 | }; | 259 | }; |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 6d6be09a2fe5..dcad7ee0d746 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -161,7 +161,7 @@ extern void devm_rtc_device_unregister(struct device *dev, | |||
161 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); | 161 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); |
162 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); | 162 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); |
163 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); | 163 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); |
164 | extern int rtc_set_ntp_time(struct timespec now); | 164 | extern int rtc_set_ntp_time(struct timespec64 now); |
165 | int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm); | 165 | int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm); |
166 | extern int rtc_read_alarm(struct rtc_device *rtc, | 166 | extern int rtc_read_alarm(struct rtc_device *rtc, |
167 | struct rtc_wkalrm *alrm); | 167 | struct rtc_wkalrm *alrm); |
diff --git a/include/linux/rtc/ds1685.h b/include/linux/rtc/ds1685.h new file mode 100644 index 000000000000..e6337a56d741 --- /dev/null +++ b/include/linux/rtc/ds1685.h | |||
@@ -0,0 +1,375 @@ | |||
1 | /* | ||
2 | * Definitions for the registers, addresses, and platform data of the | ||
3 | * DS1685/DS1687-series RTC chips. | ||
4 | * | ||
5 | * This Driver also works for the DS17X85/DS17X87 RTC chips. Functionally | ||
6 | * similar to the DS1685/DS1687, they support a few extra features which | ||
7 | * include larger, battery-backed NV-SRAM, burst-mode access, and an RTC | ||
8 | * write counter. | ||
9 | * | ||
10 | * Copyright (C) 2011-2014 Joshua Kinard <kumba@gentoo.org>. | ||
11 | * Copyright (C) 2009 Matthias Fuchs <matthias.fuchs@esd-electronics.com>. | ||
12 | * | ||
13 | * References: | ||
14 | * DS1685/DS1687 3V/5V Real-Time Clocks, 19-5215, Rev 4/10. | ||
15 | * DS17x85/DS17x87 3V/5V Real-Time Clocks, 19-5222, Rev 4/10. | ||
16 | * DS1689/DS1693 3V/5V Serialized Real-Time Clocks, Rev 112105. | ||
17 | * Application Note 90, Using the Multiplex Bus RTC Extended Features. | ||
18 | * | ||
19 | * This program is free software; you can redistribute it and/or modify | ||
20 | * it under the terms of the GNU General Public License version 2 as | ||
21 | * published by the Free Software Foundation. | ||
22 | */ | ||
23 | |||
24 | #ifndef _LINUX_RTC_DS1685_H_ | ||
25 | #define _LINUX_RTC_DS1685_H_ | ||
26 | |||
27 | #include <linux/rtc.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/workqueue.h> | ||
30 | |||
31 | /** | ||
32 | * struct ds1685_priv - DS1685 private data structure. | ||
33 | * @dev: pointer to the rtc_device structure. | ||
34 | * @regs: iomapped base address pointer of the RTC registers. | ||
35 | * @regstep: padding/step size between registers (optional). | ||
36 | * @baseaddr: base address of the RTC device. | ||
37 | * @size: resource size. | ||
38 | * @lock: private lock variable for spin locking/unlocking. | ||
39 | * @work: private workqueue. | ||
40 | * @irq: IRQ number assigned to the RTC device. | ||
41 | * @prepare_poweroff: pointer to platform pre-poweroff function. | ||
42 | * @wake_alarm: pointer to platform wake alarm function. | ||
43 | * @post_ram_clear: pointer to platform post ram-clear function. | ||
44 | */ | ||
45 | struct ds1685_priv { | ||
46 | struct rtc_device *dev; | ||
47 | void __iomem *regs; | ||
48 | u32 regstep; | ||
49 | resource_size_t baseaddr; | ||
50 | size_t size; | ||
51 | spinlock_t lock; | ||
52 | struct work_struct work; | ||
53 | int irq_num; | ||
54 | bool bcd_mode; | ||
55 | bool no_irq; | ||
56 | bool uie_unsupported; | ||
57 | bool alloc_io_resources; | ||
58 | u8 (*read)(struct ds1685_priv *, int); | ||
59 | void (*write)(struct ds1685_priv *, int, u8); | ||
60 | void (*prepare_poweroff)(void); | ||
61 | void (*wake_alarm)(void); | ||
62 | void (*post_ram_clear)(void); | ||
63 | }; | ||
64 | |||
65 | |||
66 | /** | ||
67 | * struct ds1685_rtc_platform_data - platform data structure. | ||
68 | * @plat_prepare_poweroff: platform-specific pre-poweroff function. | ||
69 | * @plat_wake_alarm: platform-specific wake alarm function. | ||
70 | * @plat_post_ram_clear: platform-specific post ram-clear function. | ||
71 | * | ||
72 | * If your platform needs to use a custom padding/step size between | ||
73 | * registers, or uses one or more of the extended interrupts and needs special | ||
74 | * handling, then include this header file in your platform definition and | ||
75 | * set regstep and the plat_* pointers as appropriate. | ||
76 | */ | ||
77 | struct ds1685_rtc_platform_data { | ||
78 | const u32 regstep; | ||
79 | const bool bcd_mode; | ||
80 | const bool no_irq; | ||
81 | const bool uie_unsupported; | ||
82 | const bool alloc_io_resources; | ||
83 | u8 (*plat_read)(struct ds1685_priv *, int); | ||
84 | void (*plat_write)(struct ds1685_priv *, int, u8); | ||
85 | void (*plat_prepare_poweroff)(void); | ||
86 | void (*plat_wake_alarm)(void); | ||
87 | void (*plat_post_ram_clear)(void); | ||
88 | }; | ||
89 | |||
90 | |||
91 | /* | ||
92 | * Time Registers. | ||
93 | */ | ||
94 | #define RTC_SECS 0x00 /* Seconds 00-59 */ | ||
95 | #define RTC_SECS_ALARM 0x01 /* Alarm Seconds 00-59 */ | ||
96 | #define RTC_MINS 0x02 /* Minutes 00-59 */ | ||
97 | #define RTC_MINS_ALARM 0x03 /* Alarm Minutes 00-59 */ | ||
98 | #define RTC_HRS 0x04 /* Hours 01-12 AM/PM || 00-23 */ | ||
99 | #define RTC_HRS_ALARM 0x05 /* Alarm Hours 01-12 AM/PM || 00-23 */ | ||
100 | #define RTC_WDAY 0x06 /* Day of Week 01-07 */ | ||
101 | #define RTC_MDAY 0x07 /* Day of Month 01-31 */ | ||
102 | #define RTC_MONTH 0x08 /* Month 01-12 */ | ||
103 | #define RTC_YEAR 0x09 /* Year 00-99 */ | ||
104 | #define RTC_CENTURY 0x48 /* Century 00-99 */ | ||
105 | #define RTC_MDAY_ALARM 0x49 /* Alarm Day of Month 01-31 */ | ||
106 | |||
107 | |||
108 | /* | ||
109 | * Bit masks for the Time registers in BCD Mode (DM = 0). | ||
110 | */ | ||
111 | #define RTC_SECS_BCD_MASK 0x7f /* - x x x x x x x */ | ||
112 | #define RTC_MINS_BCD_MASK 0x7f /* - x x x x x x x */ | ||
113 | #define RTC_HRS_12_BCD_MASK 0x1f /* - - - x x x x x */ | ||
114 | #define RTC_HRS_24_BCD_MASK 0x3f /* - - x x x x x x */ | ||
115 | #define RTC_MDAY_BCD_MASK 0x3f /* - - x x x x x x */ | ||
116 | #define RTC_MONTH_BCD_MASK 0x1f /* - - - x x x x x */ | ||
117 | #define RTC_YEAR_BCD_MASK 0xff /* x x x x x x x x */ | ||
118 | |||
119 | /* | ||
120 | * Bit masks for the Time registers in BIN Mode (DM = 1). | ||
121 | */ | ||
122 | #define RTC_SECS_BIN_MASK 0x3f /* - - x x x x x x */ | ||
123 | #define RTC_MINS_BIN_MASK 0x3f /* - - x x x x x x */ | ||
124 | #define RTC_HRS_12_BIN_MASK 0x0f /* - - - - x x x x */ | ||
125 | #define RTC_HRS_24_BIN_MASK 0x1f /* - - - x x x x x */ | ||
126 | #define RTC_MDAY_BIN_MASK 0x1f /* - - - x x x x x */ | ||
127 | #define RTC_MONTH_BIN_MASK 0x0f /* - - - - x x x x */ | ||
128 | #define RTC_YEAR_BIN_MASK 0x7f /* - x x x x x x x */ | ||
129 | |||
130 | /* | ||
131 | * Bit masks common for the Time registers in BCD or BIN Mode. | ||
132 | */ | ||
133 | #define RTC_WDAY_MASK 0x07 /* - - - - - x x x */ | ||
134 | #define RTC_CENTURY_MASK 0xff /* x x x x x x x x */ | ||
135 | #define RTC_MDAY_ALARM_MASK 0xff /* x x x x x x x x */ | ||
136 | #define RTC_HRS_AMPM_MASK BIT(7) /* Mask for the AM/PM bit */ | ||
137 | |||
138 | |||
139 | |||
140 | /* | ||
141 | * Control Registers. | ||
142 | */ | ||
143 | #define RTC_CTRL_A 0x0a /* Control Register A */ | ||
144 | #define RTC_CTRL_B 0x0b /* Control Register B */ | ||
145 | #define RTC_CTRL_C 0x0c /* Control Register C */ | ||
146 | #define RTC_CTRL_D 0x0d /* Control Register D */ | ||
147 | #define RTC_EXT_CTRL_4A 0x4a /* Extended Control Register 4A */ | ||
148 | #define RTC_EXT_CTRL_4B 0x4b /* Extended Control Register 4B */ | ||
149 | |||
150 | |||
151 | /* | ||
152 | * Bit names in Control Register A. | ||
153 | */ | ||
154 | #define RTC_CTRL_A_UIP BIT(7) /* Update In Progress */ | ||
155 | #define RTC_CTRL_A_DV2 BIT(6) /* Countdown Chain */ | ||
156 | #define RTC_CTRL_A_DV1 BIT(5) /* Oscillator Enable */ | ||
157 | #define RTC_CTRL_A_DV0 BIT(4) /* Bank Select */ | ||
158 | #define RTC_CTRL_A_RS2 BIT(2) /* Rate-Selection Bit 2 */ | ||
159 | #define RTC_CTRL_A_RS3 BIT(3) /* Rate-Selection Bit 3 */ | ||
160 | #define RTC_CTRL_A_RS1 BIT(1) /* Rate-Selection Bit 1 */ | ||
161 | #define RTC_CTRL_A_RS0 BIT(0) /* Rate-Selection Bit 0 */ | ||
162 | #define RTC_CTRL_A_RS_MASK 0x0f /* RS3 + RS2 + RS1 + RS0 */ | ||
163 | |||
164 | /* | ||
165 | * Bit names in Control Register B. | ||
166 | */ | ||
167 | #define RTC_CTRL_B_SET BIT(7) /* SET Bit */ | ||
168 | #define RTC_CTRL_B_PIE BIT(6) /* Periodic-Interrupt Enable */ | ||
169 | #define RTC_CTRL_B_AIE BIT(5) /* Alarm-Interrupt Enable */ | ||
170 | #define RTC_CTRL_B_UIE BIT(4) /* Update-Ended Interrupt-Enable */ | ||
171 | #define RTC_CTRL_B_SQWE BIT(3) /* Square-Wave Enable */ | ||
172 | #define RTC_CTRL_B_DM BIT(2) /* Data Mode */ | ||
173 | #define RTC_CTRL_B_2412 BIT(1) /* 12-Hr/24-Hr Mode */ | ||
174 | #define RTC_CTRL_B_DSE BIT(0) /* Daylight Savings Enable */ | ||
175 | #define RTC_CTRL_B_PAU_MASK 0x70 /* PIE + AIE + UIE */ | ||
176 | |||
177 | |||
178 | /* | ||
179 | * Bit names in Control Register C. | ||
180 | * | ||
181 | * BIT(0), BIT(1), BIT(2), & BIT(3) are unused, always return 0, and cannot | ||
182 | * be written to. | ||
183 | */ | ||
184 | #define RTC_CTRL_C_IRQF BIT(7) /* Interrupt-Request Flag */ | ||
185 | #define RTC_CTRL_C_PF BIT(6) /* Periodic-Interrupt Flag */ | ||
186 | #define RTC_CTRL_C_AF BIT(5) /* Alarm-Interrupt Flag */ | ||
187 | #define RTC_CTRL_C_UF BIT(4) /* Update-Ended Interrupt Flag */ | ||
188 | #define RTC_CTRL_C_PAU_MASK 0x70 /* PF + AF + UF */ | ||
189 | |||
190 | |||
191 | /* | ||
192 | * Bit names in Control Register D. | ||
193 | * | ||
194 | * BIT(0) through BIT(6) are unused, always return 0, and cannot | ||
195 | * be written to. | ||
196 | */ | ||
197 | #define RTC_CTRL_D_VRT BIT(7) /* Valid RAM and Time */ | ||
198 | |||
199 | |||
200 | /* | ||
201 | * Bit names in Extended Control Register 4A. | ||
202 | * | ||
203 | * On the DS1685/DS1687/DS1689/DS1693, BIT(4) and BIT(5) are reserved for | ||
204 | * future use. They can be read from and written to, but have no effect | ||
205 | * on the RTC's operation. | ||
206 | * | ||
207 | * On the DS17x85/DS17x87, BIT(5) is Burst-Mode Enable (BME), and allows | ||
208 | * access to the extended NV-SRAM by automatically incrementing the address | ||
209 | * register when they are read from or written to. | ||
210 | */ | ||
211 | #define RTC_CTRL_4A_VRT2 BIT(7) /* Auxillary Battery Status */ | ||
212 | #define RTC_CTRL_4A_INCR BIT(6) /* Increment-in-Progress Status */ | ||
213 | #define RTC_CTRL_4A_PAB BIT(3) /* Power-Active Bar Control */ | ||
214 | #define RTC_CTRL_4A_RF BIT(2) /* RAM-Clear Flag */ | ||
215 | #define RTC_CTRL_4A_WF BIT(1) /* Wake-Up Alarm Flag */ | ||
216 | #define RTC_CTRL_4A_KF BIT(0) /* Kickstart Flag */ | ||
217 | #if !defined(CONFIG_RTC_DRV_DS1685) && !defined(CONFIG_RTC_DRV_DS1689) | ||
218 | #define RTC_CTRL_4A_BME BIT(5) /* Burst-Mode Enable */ | ||
219 | #endif | ||
220 | #define RTC_CTRL_4A_RWK_MASK 0x07 /* RF + WF + KF */ | ||
221 | |||
222 | |||
223 | /* | ||
224 | * Bit names in Extended Control Register 4B. | ||
225 | */ | ||
226 | #define RTC_CTRL_4B_ABE BIT(7) /* Auxillary Battery Enable */ | ||
227 | #define RTC_CTRL_4B_E32K BIT(6) /* Enable 32.768Hz on SQW Pin */ | ||
228 | #define RTC_CTRL_4B_CS BIT(5) /* Crystal Select */ | ||
229 | #define RTC_CTRL_4B_RCE BIT(4) /* RAM Clear-Enable */ | ||
230 | #define RTC_CTRL_4B_PRS BIT(3) /* PAB Reset-Select */ | ||
231 | #define RTC_CTRL_4B_RIE BIT(2) /* RAM Clear-Interrupt Enable */ | ||
232 | #define RTC_CTRL_4B_WIE BIT(1) /* Wake-Up Alarm-Interrupt Enable */ | ||
233 | #define RTC_CTRL_4B_KSE BIT(0) /* Kickstart Interrupt-Enable */ | ||
234 | #define RTC_CTRL_4B_RWK_MASK 0x07 /* RIE + WIE + KSE */ | ||
235 | |||
236 | |||
237 | /* | ||
238 | * Misc register names in Bank 1. | ||
239 | * | ||
240 | * The DV0 bit in Control Register A must be set to 1 for these registers | ||
241 | * to become available, including Extended Control Registers 4A & 4B. | ||
242 | */ | ||
243 | #define RTC_BANK1_SSN_MODEL 0x40 /* Model Number */ | ||
244 | #define RTC_BANK1_SSN_BYTE_1 0x41 /* 1st Byte of Serial Number */ | ||
245 | #define RTC_BANK1_SSN_BYTE_2 0x42 /* 2nd Byte of Serial Number */ | ||
246 | #define RTC_BANK1_SSN_BYTE_3 0x43 /* 3rd Byte of Serial Number */ | ||
247 | #define RTC_BANK1_SSN_BYTE_4 0x44 /* 4th Byte of Serial Number */ | ||
248 | #define RTC_BANK1_SSN_BYTE_5 0x45 /* 5th Byte of Serial Number */ | ||
249 | #define RTC_BANK1_SSN_BYTE_6 0x46 /* 6th Byte of Serial Number */ | ||
250 | #define RTC_BANK1_SSN_CRC 0x47 /* Serial CRC Byte */ | ||
251 | #define RTC_BANK1_RAM_DATA_PORT 0x53 /* Extended RAM Data Port */ | ||
252 | |||
253 | |||
254 | /* | ||
255 | * Model-specific registers in Bank 1. | ||
256 | * | ||
257 | * The addresses below differ depending on the model of the RTC chip | ||
258 | * selected in the kernel configuration. Not all of these features are | ||
259 | * supported in the main driver at present. | ||
260 | * | ||
261 | * DS1685/DS1687 - Extended NV-SRAM address (LSB only). | ||
262 | * DS1689/DS1693 - Vcc, Vbat, Pwr Cycle Counters & Customer-specific S/N. | ||
263 | * DS17x85/DS17x87 - Extended NV-SRAM addresses (MSB & LSB) & Write counter. | ||
264 | */ | ||
265 | #if defined(CONFIG_RTC_DRV_DS1685) | ||
266 | #define RTC_BANK1_RAM_ADDR 0x50 /* NV-SRAM Addr */ | ||
267 | #elif defined(CONFIG_RTC_DRV_DS1689) | ||
268 | #define RTC_BANK1_VCC_CTR_LSB 0x54 /* Vcc Counter Addr (LSB) */ | ||
269 | #define RTC_BANK1_VCC_CTR_MSB 0x57 /* Vcc Counter Addr (MSB) */ | ||
270 | #define RTC_BANK1_VBAT_CTR_LSB 0x58 /* Vbat Counter Addr (LSB) */ | ||
271 | #define RTC_BANK1_VBAT_CTR_MSB 0x5b /* Vbat Counter Addr (MSB) */ | ||
272 | #define RTC_BANK1_PWR_CTR_LSB 0x5c /* Pwr Cycle Counter Addr (LSB) */ | ||
273 | #define RTC_BANK1_PWR_CTR_MSB 0x5d /* Pwr Cycle Counter Addr (MSB) */ | ||
274 | #define RTC_BANK1_UNIQ_SN 0x60 /* Customer-specific S/N */ | ||
275 | #else /* DS17x85/DS17x87 */ | ||
276 | #define RTC_BANK1_RAM_ADDR_LSB 0x50 /* NV-SRAM Addr (LSB) */ | ||
277 | #define RTC_BANK1_RAM_ADDR_MSB 0x51 /* NV-SRAM Addr (MSB) */ | ||
278 | #define RTC_BANK1_WRITE_CTR 0x5e /* RTC Write Counter */ | ||
279 | #endif | ||
280 | |||
281 | |||
282 | /* | ||
283 | * Model numbers. | ||
284 | * | ||
285 | * The DS1688/DS1691 and DS1689/DS1693 chips share the same model number | ||
286 | * and the manual doesn't indicate any major differences. As such, they | ||
287 | * are regarded as the same chip in this driver. | ||
288 | */ | ||
289 | #define RTC_MODEL_DS1685 0x71 /* DS1685/DS1687 */ | ||
290 | #define RTC_MODEL_DS17285 0x72 /* DS17285/DS17287 */ | ||
291 | #define RTC_MODEL_DS1689 0x73 /* DS1688/DS1691/DS1689/DS1693 */ | ||
292 | #define RTC_MODEL_DS17485 0x74 /* DS17485/DS17487 */ | ||
293 | #define RTC_MODEL_DS17885 0x78 /* DS17885/DS17887 */ | ||
294 | |||
295 | |||
296 | /* | ||
297 | * Periodic Interrupt Rates / Square-Wave Output Frequency | ||
298 | * | ||
299 | * Periodic rates are selected by setting the RS3-RS0 bits in Control | ||
300 | * Register A and enabled via either the E32K bit in Extended Control | ||
301 | * Register 4B or the SQWE bit in Control Register B. | ||
302 | * | ||
303 | * E32K overrides the settings of RS3-RS0 and outputs a frequency of 32768Hz | ||
304 | * on the SQW pin of the RTC chip. While there are 16 possible selections, | ||
305 | * the 1-of-16 decoder is only able to divide the base 32768Hz signal into 13 | ||
306 | * smaller frequencies. The values 0x01 and 0x02 are not used and are | ||
307 | * synonymous with 0x08 and 0x09, respectively. | ||
308 | * | ||
309 | * When E32K is set to a logic 1, periodic interrupts are disabled and reading | ||
310 | * /dev/rtc will return -EINVAL. This also applies if the periodic interrupt | ||
311 | * frequency is set to 0Hz. | ||
312 | * | ||
313 | * Not currently used by the rtc-ds1685 driver because the RTC core removed | ||
314 | * support for hardware-generated periodic-interrupts in favour of | ||
315 | * hrtimer-generated interrupts. But these defines are kept around for use | ||
316 | * in userland, as documentation to the hardware, and possible future use if | ||
317 | * hardware-generated periodic interrupts are ever added back. | ||
318 | */ | ||
319 | /* E32K RS3 RS2 RS1 RS0 */ | ||
320 | #define RTC_SQW_8192HZ 0x03 /* 0 0 0 1 1 */ | ||
321 | #define RTC_SQW_4096HZ 0x04 /* 0 0 1 0 0 */ | ||
322 | #define RTC_SQW_2048HZ 0x05 /* 0 0 1 0 1 */ | ||
323 | #define RTC_SQW_1024HZ 0x06 /* 0 0 1 1 0 */ | ||
324 | #define RTC_SQW_512HZ 0x07 /* 0 0 1 1 1 */ | ||
325 | #define RTC_SQW_256HZ 0x08 /* 0 1 0 0 0 */ | ||
326 | #define RTC_SQW_128HZ 0x09 /* 0 1 0 0 1 */ | ||
327 | #define RTC_SQW_64HZ 0x0a /* 0 1 0 1 0 */ | ||
328 | #define RTC_SQW_32HZ 0x0b /* 0 1 0 1 1 */ | ||
329 | #define RTC_SQW_16HZ 0x0c /* 0 1 1 0 0 */ | ||
330 | #define RTC_SQW_8HZ 0x0d /* 0 1 1 0 1 */ | ||
331 | #define RTC_SQW_4HZ 0x0e /* 0 1 1 1 0 */ | ||
332 | #define RTC_SQW_2HZ 0x0f /* 0 1 1 1 1 */ | ||
333 | #define RTC_SQW_0HZ 0x00 /* 0 0 0 0 0 */ | ||
334 | #define RTC_SQW_32768HZ 32768 /* 1 - - - - */ | ||
335 | #define RTC_MAX_USER_FREQ 8192 | ||
336 | |||
337 | |||
338 | /* | ||
339 | * NVRAM data & addresses: | ||
340 | * - 50 bytes of NVRAM are available just past the clock registers. | ||
341 | * - 64 additional bytes are available in Bank0. | ||
342 | * | ||
343 | * Extended, battery-backed NV-SRAM: | ||
344 | * - DS1685/DS1687 - 128 bytes. | ||
345 | * - DS1689/DS1693 - 0 bytes. | ||
346 | * - DS17285/DS17287 - 2048 bytes. | ||
347 | * - DS17485/DS17487 - 4096 bytes. | ||
348 | * - DS17885/DS17887 - 8192 bytes. | ||
349 | */ | ||
350 | #define NVRAM_TIME_BASE 0x0e /* NVRAM Addr in Time regs */ | ||
351 | #define NVRAM_BANK0_BASE 0x40 /* NVRAM Addr in Bank0 regs */ | ||
352 | #define NVRAM_SZ_TIME 50 | ||
353 | #define NVRAM_SZ_BANK0 64 | ||
354 | #if defined(CONFIG_RTC_DRV_DS1685) | ||
355 | # define NVRAM_SZ_EXTND 128 | ||
356 | #elif defined(CONFIG_RTC_DRV_DS1689) | ||
357 | # define NVRAM_SZ_EXTND 0 | ||
358 | #elif defined(CONFIG_RTC_DRV_DS17285) | ||
359 | # define NVRAM_SZ_EXTND 2048 | ||
360 | #elif defined(CONFIG_RTC_DRV_DS17485) | ||
361 | # define NVRAM_SZ_EXTND 4096 | ||
362 | #elif defined(CONFIG_RTC_DRV_DS17885) | ||
363 | # define NVRAM_SZ_EXTND 8192 | ||
364 | #endif | ||
365 | #define NVRAM_TOTAL_SZ_BANK0 (NVRAM_SZ_TIME + NVRAM_SZ_BANK0) | ||
366 | #define NVRAM_TOTAL_SZ (NVRAM_TOTAL_SZ_BANK0 + NVRAM_SZ_EXTND) | ||
367 | |||
368 | |||
369 | /* | ||
370 | * Function Prototypes. | ||
371 | */ | ||
372 | extern void __noreturn | ||
373 | ds1685_rtc_poweroff(struct platform_device *pdev); | ||
374 | |||
375 | #endif /* _LINUX_RTC_DS1685_H_ */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8db31ef98d2f..6d77432e14ff 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -363,9 +363,6 @@ extern void show_regs(struct pt_regs *); | |||
363 | */ | 363 | */ |
364 | extern void show_stack(struct task_struct *task, unsigned long *sp); | 364 | extern void show_stack(struct task_struct *task, unsigned long *sp); |
365 | 365 | ||
366 | void io_schedule(void); | ||
367 | long io_schedule_timeout(long timeout); | ||
368 | |||
369 | extern void cpu_init (void); | 366 | extern void cpu_init (void); |
370 | extern void trap_init(void); | 367 | extern void trap_init(void); |
371 | extern void update_process_times(int user); | 368 | extern void update_process_times(int user); |
@@ -422,6 +419,13 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout); | |||
422 | asmlinkage void schedule(void); | 419 | asmlinkage void schedule(void); |
423 | extern void schedule_preempt_disabled(void); | 420 | extern void schedule_preempt_disabled(void); |
424 | 421 | ||
422 | extern long io_schedule_timeout(long timeout); | ||
423 | |||
424 | static inline void io_schedule(void) | ||
425 | { | ||
426 | io_schedule_timeout(MAX_SCHEDULE_TIMEOUT); | ||
427 | } | ||
428 | |||
425 | struct nsproxy; | 429 | struct nsproxy; |
426 | struct user_namespace; | 430 | struct user_namespace; |
427 | 431 | ||
@@ -1370,6 +1374,8 @@ struct task_struct { | |||
1370 | 1374 | ||
1371 | unsigned long atomic_flags; /* Flags needing atomic access. */ | 1375 | unsigned long atomic_flags; /* Flags needing atomic access. */ |
1372 | 1376 | ||
1377 | struct restart_block restart_block; | ||
1378 | |||
1373 | pid_t pid; | 1379 | pid_t pid; |
1374 | pid_t tgid; | 1380 | pid_t tgid; |
1375 | 1381 | ||
@@ -1662,6 +1668,9 @@ struct task_struct { | |||
1662 | unsigned long timer_slack_ns; | 1668 | unsigned long timer_slack_ns; |
1663 | unsigned long default_timer_slack_ns; | 1669 | unsigned long default_timer_slack_ns; |
1664 | 1670 | ||
1671 | #ifdef CONFIG_KASAN | ||
1672 | unsigned int kasan_depth; | ||
1673 | #endif | ||
1665 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 1674 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
1666 | /* Index of current stored address in ret_stack */ | 1675 | /* Index of current stored address in ret_stack */ |
1667 | int curr_ret_stack; | 1676 | int curr_ret_stack; |
@@ -2145,6 +2154,7 @@ extern unsigned long long notrace sched_clock(void); | |||
2145 | */ | 2154 | */ |
2146 | extern u64 cpu_clock(int cpu); | 2155 | extern u64 cpu_clock(int cpu); |
2147 | extern u64 local_clock(void); | 2156 | extern u64 local_clock(void); |
2157 | extern u64 running_clock(void); | ||
2148 | extern u64 sched_clock_cpu(int cpu); | 2158 | extern u64 sched_clock_cpu(int cpu); |
2149 | 2159 | ||
2150 | 2160 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index ba96471c11ba..a1b7dbd127ff 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1281,6 +1281,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1281 | * @alter contains the flag indicating whether changes are to be made. | 1281 | * @alter contains the flag indicating whether changes are to be made. |
1282 | * Return 0 if permission is granted. | 1282 | * Return 0 if permission is granted. |
1283 | * | 1283 | * |
1284 | * @binder_set_context_mgr | ||
1285 | * Check whether @mgr is allowed to be the binder context manager. | ||
1286 | * @mgr contains the task_struct for the task being registered. | ||
1287 | * Return 0 if permission is granted. | ||
1288 | * @binder_transaction | ||
1289 | * Check whether @from is allowed to invoke a binder transaction call | ||
1290 | * to @to. | ||
1291 | * @from contains the task_struct for the sending task. | ||
1292 | * @to contains the task_struct for the receiving task. | ||
1293 | * @binder_transfer_binder | ||
1294 | * Check whether @from is allowed to transfer a binder reference to @to. | ||
1295 | * @from contains the task_struct for the sending task. | ||
1296 | * @to contains the task_struct for the receiving task. | ||
1297 | * @binder_transfer_file | ||
1298 | * Check whether @from is allowed to transfer @file to @to. | ||
1299 | * @from contains the task_struct for the sending task. | ||
1300 | * @file contains the struct file being transferred. | ||
1301 | * @to contains the task_struct for the receiving task. | ||
1302 | * | ||
1284 | * @ptrace_access_check: | 1303 | * @ptrace_access_check: |
1285 | * Check permission before allowing the current process to trace the | 1304 | * Check permission before allowing the current process to trace the |
1286 | * @child process. | 1305 | * @child process. |
@@ -1441,6 +1460,14 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1441 | struct security_operations { | 1460 | struct security_operations { |
1442 | char name[SECURITY_NAME_MAX + 1]; | 1461 | char name[SECURITY_NAME_MAX + 1]; |
1443 | 1462 | ||
1463 | int (*binder_set_context_mgr) (struct task_struct *mgr); | ||
1464 | int (*binder_transaction) (struct task_struct *from, | ||
1465 | struct task_struct *to); | ||
1466 | int (*binder_transfer_binder) (struct task_struct *from, | ||
1467 | struct task_struct *to); | ||
1468 | int (*binder_transfer_file) (struct task_struct *from, | ||
1469 | struct task_struct *to, struct file *file); | ||
1470 | |||
1444 | int (*ptrace_access_check) (struct task_struct *child, unsigned int mode); | 1471 | int (*ptrace_access_check) (struct task_struct *child, unsigned int mode); |
1445 | int (*ptrace_traceme) (struct task_struct *parent); | 1472 | int (*ptrace_traceme) (struct task_struct *parent); |
1446 | int (*capget) (struct task_struct *target, | 1473 | int (*capget) (struct task_struct *target, |
@@ -1739,6 +1766,13 @@ extern void __init security_fixup_ops(struct security_operations *ops); | |||
1739 | 1766 | ||
1740 | 1767 | ||
1741 | /* Security operations */ | 1768 | /* Security operations */ |
1769 | int security_binder_set_context_mgr(struct task_struct *mgr); | ||
1770 | int security_binder_transaction(struct task_struct *from, | ||
1771 | struct task_struct *to); | ||
1772 | int security_binder_transfer_binder(struct task_struct *from, | ||
1773 | struct task_struct *to); | ||
1774 | int security_binder_transfer_file(struct task_struct *from, | ||
1775 | struct task_struct *to, struct file *file); | ||
1742 | int security_ptrace_access_check(struct task_struct *child, unsigned int mode); | 1776 | int security_ptrace_access_check(struct task_struct *child, unsigned int mode); |
1743 | int security_ptrace_traceme(struct task_struct *parent); | 1777 | int security_ptrace_traceme(struct task_struct *parent); |
1744 | int security_capget(struct task_struct *target, | 1778 | int security_capget(struct task_struct *target, |
@@ -1927,6 +1961,30 @@ static inline int security_init(void) | |||
1927 | return 0; | 1961 | return 0; |
1928 | } | 1962 | } |
1929 | 1963 | ||
1964 | static inline int security_binder_set_context_mgr(struct task_struct *mgr) | ||
1965 | { | ||
1966 | return 0; | ||
1967 | } | ||
1968 | |||
1969 | static inline int security_binder_transaction(struct task_struct *from, | ||
1970 | struct task_struct *to) | ||
1971 | { | ||
1972 | return 0; | ||
1973 | } | ||
1974 | |||
1975 | static inline int security_binder_transfer_binder(struct task_struct *from, | ||
1976 | struct task_struct *to) | ||
1977 | { | ||
1978 | return 0; | ||
1979 | } | ||
1980 | |||
1981 | static inline int security_binder_transfer_file(struct task_struct *from, | ||
1982 | struct task_struct *to, | ||
1983 | struct file *file) | ||
1984 | { | ||
1985 | return 0; | ||
1986 | } | ||
1987 | |||
1930 | static inline int security_ptrace_access_check(struct task_struct *child, | 1988 | static inline int security_ptrace_access_check(struct task_struct *child, |
1931 | unsigned int mode) | 1989 | unsigned int mode) |
1932 | { | 1990 | { |
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h index 9aafe0e24c68..fb7eb9ccb1cd 100644 --- a/include/linux/seq_buf.h +++ b/include/linux/seq_buf.h | |||
@@ -125,9 +125,6 @@ extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, | |||
125 | unsigned int len); | 125 | unsigned int len); |
126 | extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc); | 126 | extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc); |
127 | 127 | ||
128 | extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp, | ||
129 | int nmaskbits); | ||
130 | |||
131 | #ifdef CONFIG_BINARY_PRINTF | 128 | #ifdef CONFIG_BINARY_PRINTF |
132 | extern int | 129 | extern int |
133 | seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary); | 130 | seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary); |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index cf6a9daaaf6d..afbb1fd77c77 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -126,31 +126,6 @@ int seq_path(struct seq_file *, const struct path *, const char *); | |||
126 | int seq_dentry(struct seq_file *, struct dentry *, const char *); | 126 | int seq_dentry(struct seq_file *, struct dentry *, const char *); |
127 | int seq_path_root(struct seq_file *m, const struct path *path, | 127 | int seq_path_root(struct seq_file *m, const struct path *path, |
128 | const struct path *root, const char *esc); | 128 | const struct path *root, const char *esc); |
129 | int seq_bitmap(struct seq_file *m, const unsigned long *bits, | ||
130 | unsigned int nr_bits); | ||
131 | static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask) | ||
132 | { | ||
133 | return seq_bitmap(m, cpumask_bits(mask), nr_cpu_ids); | ||
134 | } | ||
135 | |||
136 | static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) | ||
137 | { | ||
138 | return seq_bitmap(m, mask->bits, MAX_NUMNODES); | ||
139 | } | ||
140 | |||
141 | int seq_bitmap_list(struct seq_file *m, const unsigned long *bits, | ||
142 | unsigned int nr_bits); | ||
143 | |||
144 | static inline int seq_cpumask_list(struct seq_file *m, | ||
145 | const struct cpumask *mask) | ||
146 | { | ||
147 | return seq_bitmap_list(m, cpumask_bits(mask), nr_cpu_ids); | ||
148 | } | ||
149 | |||
150 | static inline int seq_nodemask_list(struct seq_file *m, nodemask_t *mask) | ||
151 | { | ||
152 | return seq_bitmap_list(m, mask->bits, MAX_NUMNODES); | ||
153 | } | ||
154 | 129 | ||
155 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); | 130 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); |
156 | int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); | 131 | int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index e02acf0a0ec9..a8efa235b7c1 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -85,6 +85,9 @@ struct uart_8250_port { | |||
85 | unsigned char mcr_force; /* mask of forced bits */ | 85 | unsigned char mcr_force; /* mask of forced bits */ |
86 | unsigned char cur_iotype; /* Running I/O type */ | 86 | unsigned char cur_iotype; /* Running I/O type */ |
87 | unsigned int rpm_tx_active; | 87 | unsigned int rpm_tx_active; |
88 | unsigned char canary; /* non-zero during system sleep | ||
89 | * if no_console_suspend | ||
90 | */ | ||
88 | 91 | ||
89 | /* | 92 | /* |
90 | * Some bits in registers are cleared on a read, so they must | 93 | * Some bits in registers are cleared on a read, so they must |
@@ -126,6 +129,7 @@ extern int serial8250_do_startup(struct uart_port *port); | |||
126 | extern void serial8250_do_shutdown(struct uart_port *port); | 129 | extern void serial8250_do_shutdown(struct uart_port *port); |
127 | extern void serial8250_do_pm(struct uart_port *port, unsigned int state, | 130 | extern void serial8250_do_pm(struct uart_port *port, unsigned int state, |
128 | unsigned int oldstate); | 131 | unsigned int oldstate); |
132 | extern void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl); | ||
129 | extern int fsl8250_handle_irq(struct uart_port *port); | 133 | extern int fsl8250_handle_irq(struct uart_port *port); |
130 | int serial8250_handle_irq(struct uart_port *port, unsigned int iir); | 134 | int serial8250_handle_irq(struct uart_port *port, unsigned int iir); |
131 | unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr); | 135 | unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 057038cf2788..baf3e1d08416 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -123,6 +123,7 @@ struct uart_port { | |||
123 | void (*set_termios)(struct uart_port *, | 123 | void (*set_termios)(struct uart_port *, |
124 | struct ktermios *new, | 124 | struct ktermios *new, |
125 | struct ktermios *old); | 125 | struct ktermios *old); |
126 | void (*set_mctrl)(struct uart_port *, unsigned int); | ||
126 | int (*startup)(struct uart_port *port); | 127 | int (*startup)(struct uart_port *port); |
127 | void (*shutdown)(struct uart_port *port); | 128 | void (*shutdown)(struct uart_port *port); |
128 | void (*throttle)(struct uart_port *port); | 129 | void (*throttle)(struct uart_port *port); |
@@ -190,8 +191,10 @@ struct uart_port { | |||
190 | #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) | 191 | #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) |
191 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ ) | 192 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ ) |
192 | 193 | ||
193 | /* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */ | 194 | /* Port has hardware-assisted h/w flow control */ |
194 | #define UPF_HARD_FLOW ((__force upf_t) (1 << 21)) | 195 | #define UPF_AUTO_CTS ((__force upf_t) (1 << 20)) |
196 | #define UPF_AUTO_RTS ((__force upf_t) (1 << 21)) | ||
197 | #define UPF_HARD_FLOW ((__force upf_t) (UPF_AUTO_CTS | UPF_AUTO_RTS)) | ||
195 | /* Port has hardware-assisted s/w flow control */ | 198 | /* Port has hardware-assisted s/w flow control */ |
196 | #define UPF_SOFT_FLOW ((__force upf_t) (1 << 22)) | 199 | #define UPF_SOFT_FLOW ((__force upf_t) (1 << 22)) |
197 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 200 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
@@ -213,11 +216,17 @@ struct uart_port { | |||
213 | #error Change mask not equivalent to userspace-visible bit defines | 216 | #error Change mask not equivalent to userspace-visible bit defines |
214 | #endif | 217 | #endif |
215 | 218 | ||
216 | /* status must be updated while holding port lock */ | 219 | /* |
220 | * Must hold termios_rwsem, port mutex and port lock to change; | ||
221 | * can hold any one lock to read. | ||
222 | */ | ||
217 | upstat_t status; | 223 | upstat_t status; |
218 | 224 | ||
219 | #define UPSTAT_CTS_ENABLE ((__force upstat_t) (1 << 0)) | 225 | #define UPSTAT_CTS_ENABLE ((__force upstat_t) (1 << 0)) |
220 | #define UPSTAT_DCD_ENABLE ((__force upstat_t) (1 << 1)) | 226 | #define UPSTAT_DCD_ENABLE ((__force upstat_t) (1 << 1)) |
227 | #define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2)) | ||
228 | #define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3)) | ||
229 | #define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4)) | ||
221 | 230 | ||
222 | int hw_stopped; /* sw-assisted CTS flow state */ | 231 | int hw_stopped; /* sw-assisted CTS flow state */ |
223 | unsigned int mctrl; /* current modem ctrl settings */ | 232 | unsigned int mctrl; /* current modem ctrl settings */ |
@@ -391,6 +400,13 @@ static inline bool uart_cts_enabled(struct uart_port *uport) | |||
391 | return !!(uport->status & UPSTAT_CTS_ENABLE); | 400 | return !!(uport->status & UPSTAT_CTS_ENABLE); |
392 | } | 401 | } |
393 | 402 | ||
403 | static inline bool uart_softcts_mode(struct uart_port *uport) | ||
404 | { | ||
405 | upstat_t mask = UPSTAT_CTS_ENABLE | UPSTAT_AUTOCTS; | ||
406 | |||
407 | return ((uport->status & mask) == UPSTAT_CTS_ENABLE); | ||
408 | } | ||
409 | |||
394 | /* | 410 | /* |
395 | * The following are helper functions for the low level drivers. | 411 | * The following are helper functions for the low level drivers. |
396 | */ | 412 | */ |
diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h index e6fc9567690b..a7f004a3c177 100644 --- a/include/linux/serial_s3c.h +++ b/include/linux/serial_s3c.h | |||
@@ -104,6 +104,31 @@ | |||
104 | S3C2410_UCON_RXIRQMODE | \ | 104 | S3C2410_UCON_RXIRQMODE | \ |
105 | S3C2410_UCON_RXFIFO_TOI) | 105 | S3C2410_UCON_RXFIFO_TOI) |
106 | 106 | ||
107 | #define S3C64XX_UCON_TXBURST_1 (0<<20) | ||
108 | #define S3C64XX_UCON_TXBURST_4 (1<<20) | ||
109 | #define S3C64XX_UCON_TXBURST_8 (2<<20) | ||
110 | #define S3C64XX_UCON_TXBURST_16 (3<<20) | ||
111 | #define S3C64XX_UCON_TXBURST_MASK (0xf<<20) | ||
112 | #define S3C64XX_UCON_RXBURST_1 (0<<16) | ||
113 | #define S3C64XX_UCON_RXBURST_4 (1<<16) | ||
114 | #define S3C64XX_UCON_RXBURST_8 (2<<16) | ||
115 | #define S3C64XX_UCON_RXBURST_16 (3<<16) | ||
116 | #define S3C64XX_UCON_RXBURST_MASK (0xf<<16) | ||
117 | #define S3C64XX_UCON_TIMEOUT_SHIFT (12) | ||
118 | #define S3C64XX_UCON_TIMEOUT_MASK (0xf<<12) | ||
119 | #define S3C64XX_UCON_EMPTYINT_EN (1<<11) | ||
120 | #define S3C64XX_UCON_DMASUS_EN (1<<10) | ||
121 | #define S3C64XX_UCON_TXINT_LEVEL (1<<9) | ||
122 | #define S3C64XX_UCON_RXINT_LEVEL (1<<8) | ||
123 | #define S3C64XX_UCON_TIMEOUT_EN (1<<7) | ||
124 | #define S3C64XX_UCON_ERRINT_EN (1<<6) | ||
125 | #define S3C64XX_UCON_TXMODE_DMA (2<<2) | ||
126 | #define S3C64XX_UCON_TXMODE_CPU (1<<2) | ||
127 | #define S3C64XX_UCON_TXMODE_MASK (3<<2) | ||
128 | #define S3C64XX_UCON_RXMODE_DMA (2<<0) | ||
129 | #define S3C64XX_UCON_RXMODE_CPU (1<<0) | ||
130 | #define S3C64XX_UCON_RXMODE_MASK (3<<0) | ||
131 | |||
107 | #define S3C2410_UFCON_FIFOMODE (1<<0) | 132 | #define S3C2410_UFCON_FIFOMODE (1<<0) |
108 | #define S3C2410_UFCON_TXTRIG0 (0<<6) | 133 | #define S3C2410_UFCON_TXTRIG0 (0<<6) |
109 | #define S3C2410_UFCON_RXTRIG8 (1<<4) | 134 | #define S3C2410_UFCON_RXTRIG8 (1<<4) |
@@ -155,6 +180,7 @@ | |||
155 | #define S3C2440_UFSTAT_TXMASK (63<<8) | 180 | #define S3C2440_UFSTAT_TXMASK (63<<8) |
156 | #define S3C2440_UFSTAT_RXMASK (63) | 181 | #define S3C2440_UFSTAT_RXMASK (63) |
157 | 182 | ||
183 | #define S3C2410_UTRSTAT_TIMEOUT (1<<3) | ||
158 | #define S3C2410_UTRSTAT_TXE (1<<2) | 184 | #define S3C2410_UTRSTAT_TXE (1<<2) |
159 | #define S3C2410_UTRSTAT_TXFE (1<<1) | 185 | #define S3C2410_UTRSTAT_TXFE (1<<1) |
160 | #define S3C2410_UTRSTAT_RXDR (1<<0) | 186 | #define S3C2410_UTRSTAT_RXDR (1<<0) |
@@ -179,8 +205,10 @@ | |||
179 | #define S3C64XX_UINTM 0x38 | 205 | #define S3C64XX_UINTM 0x38 |
180 | 206 | ||
181 | #define S3C64XX_UINTM_RXD (0) | 207 | #define S3C64XX_UINTM_RXD (0) |
208 | #define S3C64XX_UINTM_ERROR (1) | ||
182 | #define S3C64XX_UINTM_TXD (2) | 209 | #define S3C64XX_UINTM_TXD (2) |
183 | #define S3C64XX_UINTM_RXD_MSK (1 << S3C64XX_UINTM_RXD) | 210 | #define S3C64XX_UINTM_RXD_MSK (1 << S3C64XX_UINTM_RXD) |
211 | #define S3C64XX_UINTM_ERR_MSK (1 << S3C64XX_UINTM_ERROR) | ||
184 | #define S3C64XX_UINTM_TXD_MSK (1 << S3C64XX_UINTM_TXD) | 212 | #define S3C64XX_UINTM_TXD_MSK (1 << S3C64XX_UINTM_TXD) |
185 | 213 | ||
186 | /* Following are specific to S5PV210 */ | 214 | /* Following are specific to S5PV210 */ |
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index f4aee75f00b1..4fcacd915d45 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h | |||
@@ -20,6 +20,9 @@ struct shrink_control { | |||
20 | 20 | ||
21 | /* current node being shrunk (for NUMA aware shrinkers) */ | 21 | /* current node being shrunk (for NUMA aware shrinkers) */ |
22 | int nid; | 22 | int nid; |
23 | |||
24 | /* current memcg being shrunk (for memcg aware shrinkers) */ | ||
25 | struct mem_cgroup *memcg; | ||
23 | }; | 26 | }; |
24 | 27 | ||
25 | #define SHRINK_STOP (~0UL) | 28 | #define SHRINK_STOP (~0UL) |
@@ -61,7 +64,8 @@ struct shrinker { | |||
61 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | 64 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ |
62 | 65 | ||
63 | /* Flags */ | 66 | /* Flags */ |
64 | #define SHRINKER_NUMA_AWARE (1 << 0) | 67 | #define SHRINKER_NUMA_AWARE (1 << 0) |
68 | #define SHRINKER_MEMCG_AWARE (1 << 1) | ||
65 | 69 | ||
66 | extern int register_shrinker(struct shrinker *); | 70 | extern int register_shrinker(struct shrinker *); |
67 | extern void unregister_shrinker(struct shrinker *); | 71 | extern void unregister_shrinker(struct shrinker *); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 85ab7d72b54c..30007afe70b3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -83,11 +83,15 @@ | |||
83 | * | 83 | * |
84 | * CHECKSUM_PARTIAL: | 84 | * CHECKSUM_PARTIAL: |
85 | * | 85 | * |
86 | * This is identical to the case for output below. This may occur on a packet | 86 | * A checksum is set up to be offloaded to a device as described in the |
87 | * output description for CHECKSUM_PARTIAL. This may occur on a packet | ||
87 | * received directly from another Linux OS, e.g., a virtualized Linux kernel | 88 | * received directly from another Linux OS, e.g., a virtualized Linux kernel |
88 | * on the same host. The packet can be treated in the same way as | 89 | * on the same host, or it may be set in the input path in GRO or remote |
89 | * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the | 90 | * checksum offload. For the purposes of checksum verification, the checksum |
90 | * checksum must be filled in by the OS or the hardware. | 91 | * referred to by skb->csum_start + skb->csum_offset and any preceding |
92 | * checksums in the packet are considered verified. Any checksums in the | ||
93 | * packet that are after the checksum being offloaded are not considered to | ||
94 | * be verified. | ||
91 | * | 95 | * |
92 | * B. Checksumming on output. | 96 | * B. Checksumming on output. |
93 | * | 97 | * |
@@ -626,8 +630,11 @@ struct sk_buff { | |||
626 | __u32 hash; | 630 | __u32 hash; |
627 | __be16 vlan_proto; | 631 | __be16 vlan_proto; |
628 | __u16 vlan_tci; | 632 | __u16 vlan_tci; |
629 | #ifdef CONFIG_NET_RX_BUSY_POLL | 633 | #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) |
630 | unsigned int napi_id; | 634 | union { |
635 | unsigned int napi_id; | ||
636 | unsigned int sender_cpu; | ||
637 | }; | ||
631 | #endif | 638 | #endif |
632 | #ifdef CONFIG_NETWORK_SECMARK | 639 | #ifdef CONFIG_NETWORK_SECMARK |
633 | __u32 secmark; | 640 | __u32 secmark; |
@@ -2484,19 +2491,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) | |||
2484 | } | 2491 | } |
2485 | 2492 | ||
2486 | static inline int skb_add_data(struct sk_buff *skb, | 2493 | static inline int skb_add_data(struct sk_buff *skb, |
2487 | char __user *from, int copy) | 2494 | struct iov_iter *from, int copy) |
2488 | { | 2495 | { |
2489 | const int off = skb->len; | 2496 | const int off = skb->len; |
2490 | 2497 | ||
2491 | if (skb->ip_summed == CHECKSUM_NONE) { | 2498 | if (skb->ip_summed == CHECKSUM_NONE) { |
2492 | int err = 0; | 2499 | __wsum csum = 0; |
2493 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), | 2500 | if (csum_and_copy_from_iter(skb_put(skb, copy), copy, |
2494 | copy, 0, &err); | 2501 | &csum, from) == copy) { |
2495 | if (!err) { | ||
2496 | skb->csum = csum_block_add(skb->csum, csum, off); | 2502 | skb->csum = csum_block_add(skb->csum, csum, off); |
2497 | return 0; | 2503 | return 0; |
2498 | } | 2504 | } |
2499 | } else if (!copy_from_user(skb_put(skb, copy), from, copy)) | 2505 | } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy) |
2500 | return 0; | 2506 | return 0; |
2501 | 2507 | ||
2502 | __skb_trim(skb, off); | 2508 | __skb_trim(skb, off); |
@@ -2693,8 +2699,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | |||
2693 | 2699 | ||
2694 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) | 2700 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) |
2695 | { | 2701 | { |
2696 | /* XXX: stripping const */ | 2702 | return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; |
2697 | return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len); | ||
2698 | } | 2703 | } |
2699 | 2704 | ||
2700 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) | 2705 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) |
@@ -2914,7 +2919,10 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb); | |||
2914 | 2919 | ||
2915 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | 2920 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) |
2916 | { | 2921 | { |
2917 | return ((skb->ip_summed & CHECKSUM_UNNECESSARY) || skb->csum_valid); | 2922 | return ((skb->ip_summed == CHECKSUM_UNNECESSARY) || |
2923 | skb->csum_valid || | ||
2924 | (skb->ip_summed == CHECKSUM_PARTIAL && | ||
2925 | skb_checksum_start_offset(skb) >= 0)); | ||
2918 | } | 2926 | } |
2919 | 2927 | ||
2920 | /** | 2928 | /** |
@@ -3071,7 +3079,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | |||
3071 | 3079 | ||
3072 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | 3080 | #define skb_checksum_validate_zero_check(skb, proto, check, \ |
3073 | compute_pseudo) \ | 3081 | compute_pseudo) \ |
3074 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | 3082 | __skb_checksum_validate(skb, proto, true, true, check, compute_pseudo) |
3075 | 3083 | ||
3076 | #define skb_checksum_simple_validate(skb) \ | 3084 | #define skb_checksum_simple_validate(skb) \ |
3077 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | 3085 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) |
@@ -3096,6 +3104,40 @@ do { \ | |||
3096 | compute_pseudo(skb, proto)); \ | 3104 | compute_pseudo(skb, proto)); \ |
3097 | } while (0) | 3105 | } while (0) |
3098 | 3106 | ||
3107 | static inline void skb_remcsum_adjust_partial(struct sk_buff *skb, void *ptr, | ||
3108 | u16 start, u16 offset) | ||
3109 | { | ||
3110 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
3111 | skb->csum_start = ((unsigned char *)ptr + start) - skb->head; | ||
3112 | skb->csum_offset = offset - start; | ||
3113 | } | ||
3114 | |||
3115 | /* Update skbuf and packet to reflect the remote checksum offload operation. | ||
3116 | * When called, ptr indicates the starting point for skb->csum when | ||
3117 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete | ||
3118 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. | ||
3119 | */ | ||
3120 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, | ||
3121 | int start, int offset, bool nopartial) | ||
3122 | { | ||
3123 | __wsum delta; | ||
3124 | |||
3125 | if (!nopartial) { | ||
3126 | skb_remcsum_adjust_partial(skb, ptr, start, offset); | ||
3127 | return; | ||
3128 | } | ||
3129 | |||
3130 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { | ||
3131 | __skb_checksum_complete(skb); | ||
3132 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); | ||
3133 | } | ||
3134 | |||
3135 | delta = remcsum_adjust(ptr, skb->csum, start, offset); | ||
3136 | |||
3137 | /* Adjust skb->csum since we changed the packet */ | ||
3138 | skb->csum = csum_add(skb->csum, delta); | ||
3139 | } | ||
3140 | |||
3099 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 3141 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
3100 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 3142 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
3101 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 3143 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9a139b637069..76f1feeabd38 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -104,6 +104,7 @@ | |||
104 | (unsigned long)ZERO_SIZE_PTR) | 104 | (unsigned long)ZERO_SIZE_PTR) |
105 | 105 | ||
106 | #include <linux/kmemleak.h> | 106 | #include <linux/kmemleak.h> |
107 | #include <linux/kasan.h> | ||
107 | 108 | ||
108 | struct mem_cgroup; | 109 | struct mem_cgroup; |
109 | /* | 110 | /* |
@@ -115,14 +116,12 @@ int slab_is_available(void); | |||
115 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | 116 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, |
116 | unsigned long, | 117 | unsigned long, |
117 | void (*)(void *)); | 118 | void (*)(void *)); |
118 | #ifdef CONFIG_MEMCG_KMEM | ||
119 | struct kmem_cache *memcg_create_kmem_cache(struct mem_cgroup *, | ||
120 | struct kmem_cache *, | ||
121 | const char *); | ||
122 | #endif | ||
123 | void kmem_cache_destroy(struct kmem_cache *); | 119 | void kmem_cache_destroy(struct kmem_cache *); |
124 | int kmem_cache_shrink(struct kmem_cache *); | 120 | int kmem_cache_shrink(struct kmem_cache *); |
125 | void kmem_cache_free(struct kmem_cache *, void *); | 121 | |
122 | void memcg_create_kmem_cache(struct mem_cgroup *, struct kmem_cache *); | ||
123 | void memcg_deactivate_kmem_caches(struct mem_cgroup *); | ||
124 | void memcg_destroy_kmem_caches(struct mem_cgroup *); | ||
126 | 125 | ||
127 | /* | 126 | /* |
128 | * Please use this macro to create slab caches. Simply specify the | 127 | * Please use this macro to create slab caches. Simply specify the |
@@ -289,6 +288,7 @@ static __always_inline int kmalloc_index(size_t size) | |||
289 | 288 | ||
290 | void *__kmalloc(size_t size, gfp_t flags); | 289 | void *__kmalloc(size_t size, gfp_t flags); |
291 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags); | 290 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags); |
291 | void kmem_cache_free(struct kmem_cache *, void *); | ||
292 | 292 | ||
293 | #ifdef CONFIG_NUMA | 293 | #ifdef CONFIG_NUMA |
294 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | 294 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
@@ -326,7 +326,10 @@ kmem_cache_alloc_node_trace(struct kmem_cache *s, | |||
326 | static __always_inline void *kmem_cache_alloc_trace(struct kmem_cache *s, | 326 | static __always_inline void *kmem_cache_alloc_trace(struct kmem_cache *s, |
327 | gfp_t flags, size_t size) | 327 | gfp_t flags, size_t size) |
328 | { | 328 | { |
329 | return kmem_cache_alloc(s, flags); | 329 | void *ret = kmem_cache_alloc(s, flags); |
330 | |||
331 | kasan_kmalloc(s, ret, size); | ||
332 | return ret; | ||
330 | } | 333 | } |
331 | 334 | ||
332 | static __always_inline void * | 335 | static __always_inline void * |
@@ -334,7 +337,10 @@ kmem_cache_alloc_node_trace(struct kmem_cache *s, | |||
334 | gfp_t gfpflags, | 337 | gfp_t gfpflags, |
335 | int node, size_t size) | 338 | int node, size_t size) |
336 | { | 339 | { |
337 | return kmem_cache_alloc_node(s, gfpflags, node); | 340 | void *ret = kmem_cache_alloc_node(s, gfpflags, node); |
341 | |||
342 | kasan_kmalloc(s, ret, size); | ||
343 | return ret; | ||
338 | } | 344 | } |
339 | #endif /* CONFIG_TRACING */ | 345 | #endif /* CONFIG_TRACING */ |
340 | 346 | ||
@@ -474,14 +480,14 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
474 | #ifndef ARCH_SLAB_MINALIGN | 480 | #ifndef ARCH_SLAB_MINALIGN |
475 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) | 481 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) |
476 | #endif | 482 | #endif |
483 | |||
484 | struct memcg_cache_array { | ||
485 | struct rcu_head rcu; | ||
486 | struct kmem_cache *entries[0]; | ||
487 | }; | ||
488 | |||
477 | /* | 489 | /* |
478 | * This is the main placeholder for memcg-related information in kmem caches. | 490 | * This is the main placeholder for memcg-related information in kmem caches. |
479 | * struct kmem_cache will hold a pointer to it, so the memory cost while | ||
480 | * disabled is 1 pointer. The runtime cost while enabled, gets bigger than it | ||
481 | * would otherwise be if that would be bundled in kmem_cache: we'll need an | ||
482 | * extra pointer chase. But the trade off clearly lays in favor of not | ||
483 | * penalizing non-users. | ||
484 | * | ||
485 | * Both the root cache and the child caches will have it. For the root cache, | 491 | * Both the root cache and the child caches will have it. For the root cache, |
486 | * this will hold a dynamically allocated array large enough to hold | 492 | * this will hold a dynamically allocated array large enough to hold |
487 | * information about the currently limited memcgs in the system. To allow the | 493 | * information about the currently limited memcgs in the system. To allow the |
@@ -491,19 +497,18 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
491 | * Child caches will hold extra metadata needed for its operation. Fields are: | 497 | * Child caches will hold extra metadata needed for its operation. Fields are: |
492 | * | 498 | * |
493 | * @memcg: pointer to the memcg this cache belongs to | 499 | * @memcg: pointer to the memcg this cache belongs to |
494 | * @list: list_head for the list of all caches in this memcg | ||
495 | * @root_cache: pointer to the global, root cache, this cache was derived from | 500 | * @root_cache: pointer to the global, root cache, this cache was derived from |
501 | * | ||
502 | * Both root and child caches of the same kind are linked into a list chained | ||
503 | * through @list. | ||
496 | */ | 504 | */ |
497 | struct memcg_cache_params { | 505 | struct memcg_cache_params { |
498 | bool is_root_cache; | 506 | bool is_root_cache; |
507 | struct list_head list; | ||
499 | union { | 508 | union { |
500 | struct { | 509 | struct memcg_cache_array __rcu *memcg_caches; |
501 | struct rcu_head rcu_head; | ||
502 | struct kmem_cache *memcg_caches[0]; | ||
503 | }; | ||
504 | struct { | 510 | struct { |
505 | struct mem_cgroup *memcg; | 511 | struct mem_cgroup *memcg; |
506 | struct list_head list; | ||
507 | struct kmem_cache *root_cache; | 512 | struct kmem_cache *root_cache; |
508 | }; | 513 | }; |
509 | }; | 514 | }; |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index b869d1662ba3..33d049066c3d 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -70,7 +70,7 @@ struct kmem_cache { | |||
70 | int obj_offset; | 70 | int obj_offset; |
71 | #endif /* CONFIG_DEBUG_SLAB */ | 71 | #endif /* CONFIG_DEBUG_SLAB */ |
72 | #ifdef CONFIG_MEMCG_KMEM | 72 | #ifdef CONFIG_MEMCG_KMEM |
73 | struct memcg_cache_params *memcg_params; | 73 | struct memcg_cache_params memcg_params; |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | struct kmem_cache_node *node[MAX_NUMNODES]; | 76 | struct kmem_cache_node *node[MAX_NUMNODES]; |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index d82abd40a3c0..33885118523c 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -85,7 +85,7 @@ struct kmem_cache { | |||
85 | struct kobject kobj; /* For sysfs */ | 85 | struct kobject kobj; /* For sysfs */ |
86 | #endif | 86 | #endif |
87 | #ifdef CONFIG_MEMCG_KMEM | 87 | #ifdef CONFIG_MEMCG_KMEM |
88 | struct memcg_cache_params *memcg_params; | 88 | struct memcg_cache_params memcg_params; |
89 | int max_attr_size; /* for propagation, maximum size of a stored attr */ | 89 | int max_attr_size; /* for propagation, maximum size of a stored attr */ |
90 | #ifdef CONFIG_SYSFS | 90 | #ifdef CONFIG_SYSFS |
91 | struct kset *memcg_kset; | 91 | struct kset *memcg_kset; |
@@ -110,4 +110,23 @@ static inline void sysfs_slab_remove(struct kmem_cache *s) | |||
110 | } | 110 | } |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | |||
114 | /** | ||
115 | * virt_to_obj - returns address of the beginning of object. | ||
116 | * @s: object's kmem_cache | ||
117 | * @slab_page: address of slab page | ||
118 | * @x: address within object memory range | ||
119 | * | ||
120 | * Returns address of the beginning of object | ||
121 | */ | ||
122 | static inline void *virt_to_obj(struct kmem_cache *s, | ||
123 | const void *slab_page, | ||
124 | const void *x) | ||
125 | { | ||
126 | return (void *)x - ((x - slab_page) % s->size); | ||
127 | } | ||
128 | |||
129 | void object_err(struct kmem_cache *s, struct page *page, | ||
130 | u8 *object, char *reason); | ||
131 | |||
113 | #endif /* _LINUX_SLUB_DEF_H */ | 132 | #endif /* _LINUX_SLUB_DEF_H */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 93dff5fff524..be91db2a7017 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -151,6 +151,13 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, | |||
151 | static inline void kick_all_cpus_sync(void) { } | 151 | static inline void kick_all_cpus_sync(void) { } |
152 | static inline void wake_up_all_idle_cpus(void) { } | 152 | static inline void wake_up_all_idle_cpus(void) { } |
153 | 153 | ||
154 | #ifdef CONFIG_UP_LATE_INIT | ||
155 | extern void __init up_late_init(void); | ||
156 | static inline void smp_init(void) { up_late_init(); } | ||
157 | #else | ||
158 | static inline void smp_init(void) { } | ||
159 | #endif | ||
160 | |||
154 | #endif /* !SMP */ | 161 | #endif /* !SMP */ |
155 | 162 | ||
156 | /* | 163 | /* |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6e49a14365dc..5c19cba34dce 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -318,13 +318,6 @@ struct ucred { | |||
318 | /* IPX options */ | 318 | /* IPX options */ |
319 | #define IPX_TYPE 1 | 319 | #define IPX_TYPE 1 |
320 | 320 | ||
321 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | ||
322 | struct iovec *iov, | ||
323 | int offset, | ||
324 | unsigned int len, __wsum *csump); | ||
325 | extern unsigned long iov_pages(const struct iovec *iov, int offset, | ||
326 | unsigned long nr_segs); | ||
327 | |||
328 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); | 321 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); |
329 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 322 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
330 | 323 | ||
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h index b2b1afbb3202..cd519a11c2c6 100644 --- a/include/linux/spi/at86rf230.h +++ b/include/linux/spi/at86rf230.h | |||
@@ -12,10 +12,6 @@ | |||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | * | ||
19 | * Written by: | 15 | * Written by: |
20 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> | 16 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> |
21 | */ | 17 | */ |
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h index bc8677c8eba9..e69e9b51b21a 100644 --- a/include/linux/spi/l4f00242t03.h +++ b/include/linux/spi/l4f00242t03.h | |||
@@ -12,10 +12,6 @@ | |||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | 15 | */ |
20 | 16 | ||
21 | #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ | 17 | #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ |
diff --git a/include/linux/spi/lms283gf05.h b/include/linux/spi/lms283gf05.h index 555d254e6606..fdd1d1d51da5 100644 --- a/include/linux/spi/lms283gf05.h +++ b/include/linux/spi/lms283gf05.h | |||
@@ -11,10 +11,6 @@ | |||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | 14 | */ |
19 | 15 | ||
20 | #ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ | 16 | #ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ |
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h index 4835486f58e5..381d368b91b4 100644 --- a/include/linux/spi/mxs-spi.h +++ b/include/linux/spi/mxs-spi.h | |||
@@ -15,10 +15,6 @@ | |||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | * GNU General Public License for more details. | 17 | * GNU General Public License for more details. |
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
22 | */ | 18 | */ |
23 | 19 | ||
24 | #ifndef __LINUX_SPI_MXS_SPI_H__ | 20 | #ifndef __LINUX_SPI_MXS_SPI_H__ |
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h index d5a316550177..6d36dacec4ba 100644 --- a/include/linux/spi/pxa2xx_spi.h +++ b/include/linux/spi/pxa2xx_spi.h | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 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 | */ | 13 | */ |
18 | #ifndef __linux_pxa2xx_spi_h | 14 | #ifndef __linux_pxa2xx_spi_h |
19 | #define __linux_pxa2xx_spi_h | 15 | #define __linux_pxa2xx_spi_h |
@@ -57,7 +53,6 @@ struct pxa2xx_spi_chip { | |||
57 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) | 53 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) |
58 | 54 | ||
59 | #include <linux/clk.h> | 55 | #include <linux/clk.h> |
60 | #include <mach/dma.h> | ||
61 | 56 | ||
62 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | 57 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); |
63 | 58 | ||
diff --git a/include/linux/spi/rspi.h b/include/linux/spi/rspi.h index e546b2ceb623..a693188cc08b 100644 --- a/include/linux/spi/rspi.h +++ b/include/linux/spi/rspi.h | |||
@@ -11,11 +11,6 @@ | |||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | * | ||
19 | */ | 14 | */ |
20 | 15 | ||
21 | #ifndef __LINUX_SPI_RENESAS_SPI_H__ | 16 | #ifndef __LINUX_SPI_RENESAS_SPI_H__ |
diff --git a/include/linux/spi/sh_hspi.h b/include/linux/spi/sh_hspi.h index a1121f872ac1..aa0d440ab4f0 100644 --- a/include/linux/spi/sh_hspi.h +++ b/include/linux/spi/sh_hspi.h | |||
@@ -9,10 +9,6 @@ | |||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
16 | */ | 12 | */ |
17 | #ifndef SH_HSPI_H | 13 | #ifndef SH_HSPI_H |
18 | #define SH_HSPI_H | 14 | #define SH_HSPI_H |
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h index 88a14d81c49e..b087a85f5f72 100644 --- a/include/linux/spi/sh_msiof.h +++ b/include/linux/spi/sh_msiof.h | |||
@@ -7,6 +7,8 @@ struct sh_msiof_spi_info { | |||
7 | u16 num_chipselect; | 7 | u16 num_chipselect; |
8 | unsigned int dma_tx_id; | 8 | unsigned int dma_tx_id; |
9 | unsigned int dma_rx_id; | 9 | unsigned int dma_rx_id; |
10 | u32 dtdl; | ||
11 | u32 syncdl; | ||
10 | }; | 12 | }; |
11 | 13 | ||
12 | #endif /* __SPI_SH_MSIOF_H__ */ | 14 | #endif /* __SPI_SH_MSIOF_H__ */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a6ef2a8e6de4..ed9489d893a4 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -10,10 +10,6 @@ | |||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 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 | */ | 13 | */ |
18 | 14 | ||
19 | #ifndef __LINUX_SPI_H | 15 | #ifndef __LINUX_SPI_H |
@@ -260,6 +256,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
260 | * @pump_messages: work struct for scheduling work to the message pump | 256 | * @pump_messages: work struct for scheduling work to the message pump |
261 | * @queue_lock: spinlock to syncronise access to message queue | 257 | * @queue_lock: spinlock to syncronise access to message queue |
262 | * @queue: message queue | 258 | * @queue: message queue |
259 | * @idling: the device is entering idle state | ||
263 | * @cur_msg: the currently in-flight message | 260 | * @cur_msg: the currently in-flight message |
264 | * @cur_msg_prepared: spi_prepare_message was called for the currently | 261 | * @cur_msg_prepared: spi_prepare_message was called for the currently |
265 | * in-flight message | 262 | * in-flight message |
@@ -425,6 +422,7 @@ struct spi_master { | |||
425 | spinlock_t queue_lock; | 422 | spinlock_t queue_lock; |
426 | struct list_head queue; | 423 | struct list_head queue; |
427 | struct spi_message *cur_msg; | 424 | struct spi_message *cur_msg; |
425 | bool idling; | ||
428 | bool busy; | 426 | bool busy; |
429 | bool running; | 427 | bool running; |
430 | bool rt; | 428 | bool rt; |
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h index 60b59187e590..414c6fddfcf0 100644 --- a/include/linux/spi/tle62x0.h +++ b/include/linux/spi/tle62x0.h | |||
@@ -12,10 +12,6 @@ | |||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | 15 | */ |
20 | 16 | ||
21 | struct tle62x0_pdata { | 17 | struct tle62x0_pdata { |
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h index 8f721e465e05..563b3b1799a8 100644 --- a/include/linux/spi/tsc2005.h +++ b/include/linux/spi/tsc2005.h | |||
@@ -12,11 +12,6 @@ | |||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | 15 | */ |
21 | 16 | ||
22 | #ifndef _LINUX_SPI_TSC2005_H | 17 | #ifndef _LINUX_SPI_TSC2005_H |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 262ba4ef9a8e..3e18379dfa6f 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -190,6 +190,8 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
191 | # define raw_spin_lock_nested(lock, subclass) \ | 191 | # define raw_spin_lock_nested(lock, subclass) \ |
192 | _raw_spin_lock_nested(lock, subclass) | 192 | _raw_spin_lock_nested(lock, subclass) |
193 | # define raw_spin_lock_bh_nested(lock, subclass) \ | ||
194 | _raw_spin_lock_bh_nested(lock, subclass) | ||
193 | 195 | ||
194 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ | 196 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ |
195 | do { \ | 197 | do { \ |
@@ -205,6 +207,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
205 | # define raw_spin_lock_nested(lock, subclass) \ | 207 | # define raw_spin_lock_nested(lock, subclass) \ |
206 | _raw_spin_lock(((void)(subclass), (lock))) | 208 | _raw_spin_lock(((void)(subclass), (lock))) |
207 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) | 209 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) |
210 | # define raw_spin_lock_bh_nested(lock, subclass) _raw_spin_lock_bh(lock) | ||
208 | #endif | 211 | #endif |
209 | 212 | ||
210 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 213 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
@@ -324,6 +327,11 @@ do { \ | |||
324 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ | 327 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ |
325 | } while (0) | 328 | } while (0) |
326 | 329 | ||
330 | #define spin_lock_bh_nested(lock, subclass) \ | ||
331 | do { \ | ||
332 | raw_spin_lock_bh_nested(spinlock_check(lock), subclass);\ | ||
333 | } while (0) | ||
334 | |||
327 | #define spin_lock_nest_lock(lock, nest_lock) \ | 335 | #define spin_lock_nest_lock(lock, nest_lock) \ |
328 | do { \ | 336 | do { \ |
329 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ | 337 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 42dfab89e740..5344268e6e62 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr); | |||
22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); |
23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) | 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) |
24 | __acquires(lock); | 24 | __acquires(lock); |
25 | void __lockfunc _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass) | ||
26 | __acquires(lock); | ||
25 | void __lockfunc | 27 | void __lockfunc |
26 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) | 28 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) |
27 | __acquires(lock); | 29 | __acquires(lock); |
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index d0d188861ad6..d3afef9d8dbe 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
@@ -57,6 +57,7 @@ | |||
57 | 57 | ||
58 | #define _raw_spin_lock(lock) __LOCK(lock) | 58 | #define _raw_spin_lock(lock) __LOCK(lock) |
59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) | 59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) |
60 | #define _raw_spin_lock_bh_nested(lock, subclass) __LOCK(lock) | ||
60 | #define _raw_read_lock(lock) __LOCK(lock) | 61 | #define _raw_read_lock(lock) __LOCK(lock) |
61 | #define _raw_write_lock(lock) __LOCK(lock) | 62 | #define _raw_write_lock(lock) __LOCK(lock) |
62 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) | 63 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index a2783cb5d275..9cfd9623fb03 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -45,7 +45,7 @@ struct rcu_batch { | |||
45 | #define RCU_BATCH_INIT(name) { NULL, &(name.head) } | 45 | #define RCU_BATCH_INIT(name) { NULL, &(name.head) } |
46 | 46 | ||
47 | struct srcu_struct { | 47 | struct srcu_struct { |
48 | unsigned completed; | 48 | unsigned long completed; |
49 | struct srcu_struct_array __percpu *per_cpu_ref; | 49 | struct srcu_struct_array __percpu *per_cpu_ref; |
50 | spinlock_t queue_lock; /* protect ->batch_queue, ->running */ | 50 | spinlock_t queue_lock; /* protect ->batch_queue, ->running */ |
51 | bool running; | 51 | bool running; |
@@ -102,13 +102,11 @@ void process_srcu(struct work_struct *work); | |||
102 | * define and init a srcu struct at build time. | 102 | * define and init a srcu struct at build time. |
103 | * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. | 103 | * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. |
104 | */ | 104 | */ |
105 | #define DEFINE_SRCU(name) \ | 105 | #define __DEFINE_SRCU(name, is_static) \ |
106 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | 106 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ |
107 | struct srcu_struct name = __SRCU_STRUCT_INIT(name); | 107 | is_static struct srcu_struct name = __SRCU_STRUCT_INIT(name) |
108 | 108 | #define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */) | |
109 | #define DEFINE_STATIC_SRCU(name) \ | 109 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) |
110 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | ||
111 | static struct srcu_struct name = __SRCU_STRUCT_INIT(name); | ||
112 | 110 | ||
113 | /** | 111 | /** |
114 | * call_srcu() - Queue a callback for invocation after an SRCU grace period | 112 | * call_srcu() - Queue a callback for invocation after an SRCU grace period |
@@ -135,7 +133,7 @@ int __srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | |||
135 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 133 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
136 | void synchronize_srcu(struct srcu_struct *sp); | 134 | void synchronize_srcu(struct srcu_struct *sp); |
137 | void synchronize_srcu_expedited(struct srcu_struct *sp); | 135 | void synchronize_srcu_expedited(struct srcu_struct *sp); |
138 | long srcu_batches_completed(struct srcu_struct *sp); | 136 | unsigned long srcu_batches_completed(struct srcu_struct *sp); |
139 | void srcu_barrier(struct srcu_struct *sp); | 137 | void srcu_barrier(struct srcu_struct *sp); |
140 | 138 | ||
141 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 139 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index f7b9100686c3..c0f707ac192b 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -173,6 +173,7 @@ | |||
173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) | 173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) |
174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) | 174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) |
175 | #define SSB_SPROMSIZE_WORDS_R10 230 | 175 | #define SSB_SPROMSIZE_WORDS_R10 230 |
176 | #define SSB_SPROMSIZE_WORDS_R11 234 | ||
176 | #define SSB_SPROM_BASE1 0x1000 | 177 | #define SSB_SPROM_BASE1 0x1000 |
177 | #define SSB_SPROM_BASE31 0x0800 | 178 | #define SSB_SPROM_BASE31 0x0800 |
178 | #define SSB_SPROM_REVISION 0x007E | 179 | #define SSB_SPROM_REVISION 0x007E |
diff --git a/include/linux/string.h b/include/linux/string.h index 2e22a2e58f3a..e40099e585c9 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -40,9 +40,6 @@ extern int strcmp(const char *,const char *); | |||
40 | #ifndef __HAVE_ARCH_STRNCMP | 40 | #ifndef __HAVE_ARCH_STRNCMP |
41 | extern int strncmp(const char *,const char *,__kernel_size_t); | 41 | extern int strncmp(const char *,const char *,__kernel_size_t); |
42 | #endif | 42 | #endif |
43 | #ifndef __HAVE_ARCH_STRNICMP | ||
44 | #define strnicmp strncasecmp | ||
45 | #endif | ||
46 | #ifndef __HAVE_ARCH_STRCASECMP | 43 | #ifndef __HAVE_ARCH_STRCASECMP |
47 | extern int strcasecmp(const char *s1, const char *s2); | 44 | extern int strcasecmp(const char *s1, const char *s2); |
48 | #endif | 45 | #endif |
@@ -115,7 +112,10 @@ extern void * memchr(const void *,int,__kernel_size_t); | |||
115 | #endif | 112 | #endif |
116 | void *memchr_inv(const void *s, int c, size_t n); | 113 | void *memchr_inv(const void *s, int c, size_t n); |
117 | 114 | ||
115 | extern void kfree_const(const void *x); | ||
116 | |||
118 | extern char *kstrdup(const char *s, gfp_t gfp); | 117 | extern char *kstrdup(const char *s, gfp_t gfp); |
118 | extern const char *kstrdup_const(const char *s, gfp_t gfp); | ||
119 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); | 119 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); |
120 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | 120 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); |
121 | 121 | ||
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index 6eb567ac56bc..657571817260 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h | |||
@@ -10,8 +10,8 @@ enum string_size_units { | |||
10 | STRING_UNITS_2, /* use binary powers of 2^10 */ | 10 | STRING_UNITS_2, /* use binary powers of 2^10 */ |
11 | }; | 11 | }; |
12 | 12 | ||
13 | int string_get_size(u64 size, enum string_size_units units, | 13 | void string_get_size(u64 size, enum string_size_units units, |
14 | char *buf, int len); | 14 | char *buf, int len); |
15 | 15 | ||
16 | #define UNESCAPE_SPACE 0x01 | 16 | #define UNESCAPE_SPACE 0x01 |
17 | #define UNESCAPE_OCTAL 0x02 | 17 | #define UNESCAPE_OCTAL 0x02 |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index d86acc63b25f..598ba80ec30c 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -57,7 +57,7 @@ struct rpc_clnt { | |||
57 | const struct rpc_timeout *cl_timeout; /* Timeout strategy */ | 57 | const struct rpc_timeout *cl_timeout; /* Timeout strategy */ |
58 | 58 | ||
59 | int cl_nodelen; /* nodename length */ | 59 | int cl_nodelen; /* nodename length */ |
60 | char cl_nodename[UNX_MAXNODENAME]; | 60 | char cl_nodename[UNX_MAXNODENAME+1]; |
61 | struct rpc_pipe_dir_head cl_pipedir_objects; | 61 | struct rpc_pipe_dir_head cl_pipedir_objects; |
62 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 62 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
63 | struct rpc_rtt cl_rtt_default; | 63 | struct rpc_rtt cl_rtt_default; |
@@ -112,6 +112,7 @@ struct rpc_create_args { | |||
112 | struct sockaddr *saddress; | 112 | struct sockaddr *saddress; |
113 | const struct rpc_timeout *timeout; | 113 | const struct rpc_timeout *timeout; |
114 | const char *servername; | 114 | const char *servername; |
115 | const char *nodename; | ||
115 | const struct rpc_program *program; | 116 | const struct rpc_program *program; |
116 | u32 prognumber; /* overrides program->number */ | 117 | u32 prognumber; /* overrides program->number */ |
117 | u32 version; | 118 | u32 version; |
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index eecb5a71e6c0..694eecb2f1b5 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
@@ -79,6 +79,8 @@ struct rpc_clnt; | |||
79 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | 79 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); |
80 | void rpc_count_iostats(const struct rpc_task *, | 80 | void rpc_count_iostats(const struct rpc_task *, |
81 | struct rpc_iostats *); | 81 | struct rpc_iostats *); |
82 | void rpc_count_iostats_metrics(const struct rpc_task *, | ||
83 | struct rpc_iostats *); | ||
82 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | 84 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); |
83 | void rpc_free_iostats(struct rpc_iostats *); | 85 | void rpc_free_iostats(struct rpc_iostats *); |
84 | 86 | ||
@@ -87,6 +89,11 @@ void rpc_free_iostats(struct rpc_iostats *); | |||
87 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } | 89 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } |
88 | static inline void rpc_count_iostats(const struct rpc_task *task, | 90 | static inline void rpc_count_iostats(const struct rpc_task *task, |
89 | struct rpc_iostats *stats) {} | 91 | struct rpc_iostats *stats) {} |
92 | static inline void rpc_count_iostats_metrics(const struct rpc_task *task, | ||
93 | struct rpc_iostats *stats) | ||
94 | { | ||
95 | } | ||
96 | |||
90 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} | 97 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} |
91 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} | 98 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} |
92 | 99 | ||
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h index b78f16b1dea3..f33c5a4d6fe4 100644 --- a/include/linux/sunrpc/rpc_rdma.h +++ b/include/linux/sunrpc/rpc_rdma.h | |||
@@ -42,6 +42,9 @@ | |||
42 | 42 | ||
43 | #include <linux/types.h> | 43 | #include <linux/types.h> |
44 | 44 | ||
45 | #define RPCRDMA_VERSION 1 | ||
46 | #define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION) | ||
47 | |||
45 | struct rpcrdma_segment { | 48 | struct rpcrdma_segment { |
46 | __be32 rs_handle; /* Registered memory handle */ | 49 | __be32 rs_handle; /* Registered memory handle */ |
47 | __be32 rs_length; /* Length of the chunk in bytes */ | 50 | __be32 rs_length; /* Length of the chunk in bytes */ |
@@ -95,7 +98,10 @@ struct rpcrdma_msg { | |||
95 | } rm_body; | 98 | } rm_body; |
96 | }; | 99 | }; |
97 | 100 | ||
98 | #define RPCRDMA_HDRLEN_MIN 28 | 101 | /* |
102 | * Smallest RPC/RDMA header: rm_xid through rm_type, then rm_nochunks | ||
103 | */ | ||
104 | #define RPCRDMA_HDRLEN_MIN (sizeof(__be32) * 7) | ||
99 | 105 | ||
100 | enum rpcrdma_errcode { | 106 | enum rpcrdma_errcode { |
101 | ERR_VERS = 1, | 107 | ERR_VERS = 1, |
@@ -115,4 +121,10 @@ enum rpcrdma_proc { | |||
115 | RDMA_ERROR = 4 /* An RPC RDMA encoding error */ | 121 | RDMA_ERROR = 4 /* An RPC RDMA encoding error */ |
116 | }; | 122 | }; |
117 | 123 | ||
124 | #define rdma_msg cpu_to_be32(RDMA_MSG) | ||
125 | #define rdma_nomsg cpu_to_be32(RDMA_NOMSG) | ||
126 | #define rdma_msgp cpu_to_be32(RDMA_MSGP) | ||
127 | #define rdma_done cpu_to_be32(RDMA_DONE) | ||
128 | #define rdma_error cpu_to_be32(RDMA_ERROR) | ||
129 | |||
118 | #endif /* _LINUX_SUNRPC_RPC_RDMA_H */ | 130 | #endif /* _LINUX_SUNRPC_RPC_RDMA_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 6f22cfeef5e3..fae6fb947fc8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -110,7 +110,7 @@ struct svc_serv { | |||
110 | * We use sv_nrthreads as a reference count. svc_destroy() drops | 110 | * We use sv_nrthreads as a reference count. svc_destroy() drops |
111 | * this refcount, so we need to bump it up around operations that | 111 | * this refcount, so we need to bump it up around operations that |
112 | * change the number of threads. Horrible, but there it is. | 112 | * change the number of threads. Horrible, but there it is. |
113 | * Should be called with the BKL held. | 113 | * Should be called with the "service mutex" held. |
114 | */ | 114 | */ |
115 | static inline void svc_get(struct svc_serv *serv) | 115 | static inline void svc_get(struct svc_serv *serv) |
116 | { | 116 | { |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 975da754c778..df8edf8ec914 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -63,8 +63,6 @@ extern atomic_t rdma_stat_rq_prod; | |||
63 | extern atomic_t rdma_stat_sq_poll; | 63 | extern atomic_t rdma_stat_sq_poll; |
64 | extern atomic_t rdma_stat_sq_prod; | 64 | extern atomic_t rdma_stat_sq_prod; |
65 | 65 | ||
66 | #define RPCRDMA_VERSION 1 | ||
67 | |||
68 | /* | 66 | /* |
69 | * Contexts are built when an RDMA request is created and are a | 67 | * Contexts are built when an RDMA request is created and are a |
70 | * record of the resources that can be recovered when the request | 68 | * record of the resources that can be recovered when the request |
@@ -79,6 +77,7 @@ struct svc_rdma_op_ctxt { | |||
79 | enum ib_wr_opcode wr_op; | 77 | enum ib_wr_opcode wr_op; |
80 | enum ib_wc_status wc_status; | 78 | enum ib_wc_status wc_status; |
81 | u32 byte_len; | 79 | u32 byte_len; |
80 | u32 position; | ||
82 | struct svcxprt_rdma *xprt; | 81 | struct svcxprt_rdma *xprt; |
83 | unsigned long flags; | 82 | unsigned long flags; |
84 | enum dma_data_direction direction; | 83 | enum dma_data_direction direction; |
@@ -150,6 +149,10 @@ struct svcxprt_rdma { | |||
150 | struct ib_cq *sc_rq_cq; | 149 | struct ib_cq *sc_rq_cq; |
151 | struct ib_cq *sc_sq_cq; | 150 | struct ib_cq *sc_sq_cq; |
152 | struct ib_mr *sc_phys_mr; /* MR for server memory */ | 151 | struct ib_mr *sc_phys_mr; /* MR for server memory */ |
152 | int (*sc_reader)(struct svcxprt_rdma *, | ||
153 | struct svc_rqst *, | ||
154 | struct svc_rdma_op_ctxt *, | ||
155 | int *, u32 *, u32, u32, u64, bool); | ||
153 | u32 sc_dev_caps; /* distilled device caps */ | 156 | u32 sc_dev_caps; /* distilled device caps */ |
154 | u32 sc_dma_lkey; /* local dma key */ | 157 | u32 sc_dma_lkey; /* local dma key */ |
155 | unsigned int sc_frmr_pg_list_len; | 158 | unsigned int sc_frmr_pg_list_len; |
@@ -178,8 +181,6 @@ struct svcxprt_rdma { | |||
178 | #define RPCRDMA_MAX_REQ_SIZE 4096 | 181 | #define RPCRDMA_MAX_REQ_SIZE 4096 |
179 | 182 | ||
180 | /* svc_rdma_marshal.c */ | 183 | /* svc_rdma_marshal.c */ |
181 | extern void svc_rdma_rcl_chunk_counts(struct rpcrdma_read_chunk *, | ||
182 | int *, int *); | ||
183 | extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *); | 184 | extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *); |
184 | extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *); | 185 | extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *); |
185 | extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *, | 186 | extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *, |
@@ -197,6 +198,12 @@ extern int svc_rdma_xdr_get_reply_hdr_len(struct rpcrdma_msg *); | |||
197 | 198 | ||
198 | /* svc_rdma_recvfrom.c */ | 199 | /* svc_rdma_recvfrom.c */ |
199 | extern int svc_rdma_recvfrom(struct svc_rqst *); | 200 | extern int svc_rdma_recvfrom(struct svc_rqst *); |
201 | extern int rdma_read_chunk_lcl(struct svcxprt_rdma *, struct svc_rqst *, | ||
202 | struct svc_rdma_op_ctxt *, int *, u32 *, | ||
203 | u32, u32, u64, bool); | ||
204 | extern int rdma_read_chunk_frmr(struct svcxprt_rdma *, struct svc_rqst *, | ||
205 | struct svc_rdma_op_ctxt *, int *, u32 *, | ||
206 | u32, u32, u64, bool); | ||
200 | 207 | ||
201 | /* svc_rdma_sendto.c */ | 208 | /* svc_rdma_sendto.c */ |
202 | extern int svc_rdma_sendto(struct svc_rqst *); | 209 | extern int svc_rdma_sendto(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 9d27ac45b909..8b93ef53df3c 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -347,6 +347,9 @@ void xprt_force_disconnect(struct rpc_xprt *xprt); | |||
347 | void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | 347 | void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); |
348 | int xs_swapper(struct rpc_xprt *xprt, int enable); | 348 | int xs_swapper(struct rpc_xprt *xprt, int enable); |
349 | 349 | ||
350 | bool xprt_lock_connect(struct rpc_xprt *, struct rpc_task *, void *); | ||
351 | void xprt_unlock_connect(struct rpc_xprt *, void *); | ||
352 | |||
350 | /* | 353 | /* |
351 | * Reserved bit positions in xprt->state | 354 | * Reserved bit positions in xprt->state |
352 | */ | 355 | */ |
@@ -357,10 +360,7 @@ int xs_swapper(struct rpc_xprt *xprt, int enable); | |||
357 | #define XPRT_BOUND (4) | 360 | #define XPRT_BOUND (4) |
358 | #define XPRT_BINDING (5) | 361 | #define XPRT_BINDING (5) |
359 | #define XPRT_CLOSING (6) | 362 | #define XPRT_CLOSING (6) |
360 | #define XPRT_CONNECTION_ABORT (7) | ||
361 | #define XPRT_CONNECTION_CLOSE (8) | ||
362 | #define XPRT_CONGESTED (9) | 363 | #define XPRT_CONGESTED (9) |
363 | #define XPRT_CONNECTION_REUSE (10) | ||
364 | 364 | ||
365 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 365 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
366 | { | 366 | { |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 3388c1b6f7d8..5efe743ce1e8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -201,6 +201,21 @@ struct platform_freeze_ops { | |||
201 | */ | 201 | */ |
202 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); | 202 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
203 | extern int suspend_valid_only_mem(suspend_state_t state); | 203 | extern int suspend_valid_only_mem(suspend_state_t state); |
204 | |||
205 | /* Suspend-to-idle state machnine. */ | ||
206 | enum freeze_state { | ||
207 | FREEZE_STATE_NONE, /* Not suspended/suspending. */ | ||
208 | FREEZE_STATE_ENTER, /* Enter suspend-to-idle. */ | ||
209 | FREEZE_STATE_WAKE, /* Wake up from suspend-to-idle. */ | ||
210 | }; | ||
211 | |||
212 | extern enum freeze_state __read_mostly suspend_freeze_state; | ||
213 | |||
214 | static inline bool idle_should_freeze(void) | ||
215 | { | ||
216 | return unlikely(suspend_freeze_state == FREEZE_STATE_ENTER); | ||
217 | } | ||
218 | |||
204 | extern void freeze_set_ops(const struct platform_freeze_ops *ops); | 219 | extern void freeze_set_ops(const struct platform_freeze_ops *ops); |
205 | extern void freeze_wake(void); | 220 | extern void freeze_wake(void); |
206 | 221 | ||
@@ -228,6 +243,7 @@ extern int pm_suspend(suspend_state_t state); | |||
228 | 243 | ||
229 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} | 244 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
230 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 245 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
246 | static inline bool idle_should_freeze(void) { return false; } | ||
231 | static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {} | 247 | static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {} |
232 | static inline void freeze_wake(void) {} | 248 | static inline void freeze_wake(void) {} |
233 | #endif /* !CONFIG_SUSPEND */ | 249 | #endif /* !CONFIG_SUSPEND */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 34e8b60ab973..7067eca501e2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -437,16 +437,6 @@ extern int reuse_swap_page(struct page *); | |||
437 | extern int try_to_free_swap(struct page *); | 437 | extern int try_to_free_swap(struct page *); |
438 | struct backing_dev_info; | 438 | struct backing_dev_info; |
439 | 439 | ||
440 | #ifdef CONFIG_MEMCG | ||
441 | extern void | ||
442 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | ||
443 | #else | ||
444 | static inline void | ||
445 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | ||
446 | { | ||
447 | } | ||
448 | #endif | ||
449 | |||
450 | #else /* CONFIG_SWAP */ | 440 | #else /* CONFIG_SWAP */ |
451 | 441 | ||
452 | #define swap_address_space(entry) (NULL) | 442 | #define swap_address_space(entry) (NULL) |
@@ -547,11 +537,6 @@ static inline swp_entry_t get_swap_page(void) | |||
547 | return entry; | 537 | return entry; |
548 | } | 538 | } |
549 | 539 | ||
550 | static inline void | ||
551 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
552 | { | ||
553 | } | ||
554 | |||
555 | #endif /* CONFIG_SWAP */ | 540 | #endif /* CONFIG_SWAP */ |
556 | #endif /* __KERNEL__*/ | 541 | #endif /* __KERNEL__*/ |
557 | #endif /* _LINUX_SWAP_H */ | 542 | #endif /* _LINUX_SWAP_H */ |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 6adfb7bfbf44..cedf3d3c373f 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -54,7 +54,7 @@ static inline pgoff_t swp_offset(swp_entry_t entry) | |||
54 | /* check whether a pte points to a swap entry */ | 54 | /* check whether a pte points to a swap entry */ |
55 | static inline int is_swap_pte(pte_t pte) | 55 | static inline int is_swap_pte(pte_t pte) |
56 | { | 56 | { |
57 | return !pte_none(pte) && !pte_present_nonuma(pte) && !pte_file(pte); | 57 | return !pte_none(pte) && !pte_present(pte); |
58 | } | 58 | } |
59 | #endif | 59 | #endif |
60 | 60 | ||
@@ -66,7 +66,6 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte) | |||
66 | { | 66 | { |
67 | swp_entry_t arch_entry; | 67 | swp_entry_t arch_entry; |
68 | 68 | ||
69 | BUG_ON(pte_file(pte)); | ||
70 | if (pte_swp_soft_dirty(pte)) | 69 | if (pte_swp_soft_dirty(pte)) |
71 | pte = pte_swp_clear_soft_dirty(pte); | 70 | pte = pte_swp_clear_soft_dirty(pte); |
72 | arch_entry = __pte_to_swp_entry(pte); | 71 | arch_entry = __pte_to_swp_entry(pte); |
@@ -82,7 +81,6 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) | |||
82 | swp_entry_t arch_entry; | 81 | swp_entry_t arch_entry; |
83 | 82 | ||
84 | arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); | 83 | arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); |
85 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); | ||
86 | return __swp_entry_to_pte(arch_entry); | 84 | return __swp_entry_to_pte(arch_entry); |
87 | } | 85 | } |
88 | 86 | ||
@@ -137,6 +135,8 @@ static inline void make_migration_entry_read(swp_entry_t *entry) | |||
137 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); | 135 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); |
138 | } | 136 | } |
139 | 137 | ||
138 | extern void __migration_entry_wait(struct mm_struct *mm, pte_t *ptep, | ||
139 | spinlock_t *ptl); | ||
140 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 140 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
141 | unsigned long address); | 141 | unsigned long address); |
142 | extern void migration_entry_wait_huge(struct vm_area_struct *vma, | 142 | extern void migration_entry_wait_huge(struct vm_area_struct *vma, |
@@ -150,6 +150,8 @@ static inline int is_migration_entry(swp_entry_t swp) | |||
150 | } | 150 | } |
151 | #define migration_entry_to_page(swp) NULL | 151 | #define migration_entry_to_page(swp) NULL |
152 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 152 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
153 | static inline void __migration_entry_wait(struct mm_struct *mm, pte_t *ptep, | ||
154 | spinlock_t *ptl) { } | ||
153 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 155 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
154 | unsigned long address) { } | 156 | unsigned long address) { } |
155 | static inline void migration_entry_wait_huge(struct vm_area_struct *vma, | 157 | static inline void migration_entry_wait_huge(struct vm_area_struct *vma, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 85893d744901..76d1e38aabe1 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -410,12 +410,16 @@ asmlinkage long sys_newlstat(const char __user *filename, | |||
410 | struct stat __user *statbuf); | 410 | struct stat __user *statbuf); |
411 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); | 411 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); |
412 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); | 412 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); |
413 | #if BITS_PER_LONG == 32 | 413 | #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64) |
414 | asmlinkage long sys_stat64(const char __user *filename, | 414 | asmlinkage long sys_stat64(const char __user *filename, |
415 | struct stat64 __user *statbuf); | 415 | struct stat64 __user *statbuf); |
416 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); | 416 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); |
417 | asmlinkage long sys_lstat64(const char __user *filename, | 417 | asmlinkage long sys_lstat64(const char __user *filename, |
418 | struct stat64 __user *statbuf); | 418 | struct stat64 __user *statbuf); |
419 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, | ||
420 | struct stat64 __user *statbuf, int flag); | ||
421 | #endif | ||
422 | #if BITS_PER_LONG == 32 | ||
419 | asmlinkage long sys_truncate64(const char __user *path, loff_t length); | 423 | asmlinkage long sys_truncate64(const char __user *path, loff_t length); |
420 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); | 424 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); |
421 | #endif | 425 | #endif |
@@ -771,8 +775,6 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | |||
771 | umode_t mode); | 775 | umode_t mode); |
772 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, | 776 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, |
773 | struct stat __user *statbuf, int flag); | 777 | struct stat __user *statbuf, int flag); |
774 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, | ||
775 | struct stat64 __user *statbuf, int flag); | ||
776 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, | 778 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, |
777 | int bufsiz); | 779 | int bufsiz); |
778 | asmlinkage long sys_utimensat(int dfd, const char __user *filename, | 780 | asmlinkage long sys_utimensat(int dfd, const char __user *filename, |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 67309ece0772..1a7adb411647 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -115,6 +115,7 @@ struct tcp_request_sock { | |||
115 | u32 rcv_isn; | 115 | u32 rcv_isn; |
116 | u32 snt_isn; | 116 | u32 snt_isn; |
117 | u32 snt_synack; /* synack sent time */ | 117 | u32 snt_synack; /* synack sent time */ |
118 | u32 last_oow_ack_time; /* last SYNACK */ | ||
118 | u32 rcv_nxt; /* the ack # by SYNACK. For | 119 | u32 rcv_nxt; /* the ack # by SYNACK. For |
119 | * FastOpen it's the seq# | 120 | * FastOpen it's the seq# |
120 | * after data-in-SYN. | 121 | * after data-in-SYN. |
@@ -152,6 +153,7 @@ struct tcp_sock { | |||
152 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ | 153 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ |
153 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 154 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
154 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 155 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
156 | u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */ | ||
155 | 157 | ||
156 | u32 tsoffset; /* timestamp offset */ | 158 | u32 tsoffset; /* timestamp offset */ |
157 | 159 | ||
@@ -340,6 +342,10 @@ struct tcp_timewait_sock { | |||
340 | u32 tw_rcv_wnd; | 342 | u32 tw_rcv_wnd; |
341 | u32 tw_ts_offset; | 343 | u32 tw_ts_offset; |
342 | u32 tw_ts_recent; | 344 | u32 tw_ts_recent; |
345 | |||
346 | /* The time we sent the last out-of-window ACK: */ | ||
347 | u32 tw_last_oow_ack_time; | ||
348 | |||
343 | long tw_ts_recent_stamp; | 349 | long tw_ts_recent_stamp; |
344 | #ifdef CONFIG_TCP_MD5SIG | 350 | #ifdef CONFIG_TCP_MD5SIG |
345 | struct tcp_md5sig_key *tw_md5_key; | 351 | struct tcp_md5sig_key *tw_md5_key; |
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 884d6263e962..c78dcfeaf25f 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
@@ -86,6 +86,7 @@ struct st_proto_s { | |||
86 | extern long st_register(struct st_proto_s *); | 86 | extern long st_register(struct st_proto_s *); |
87 | extern long st_unregister(struct st_proto_s *); | 87 | extern long st_unregister(struct st_proto_s *); |
88 | 88 | ||
89 | extern struct ti_st_plat_data *dt_pdata; | ||
89 | 90 | ||
90 | /* | 91 | /* |
91 | * header information used by st_core.c | 92 | * header information used by st_core.c |
@@ -261,7 +262,7 @@ struct kim_data_s { | |||
261 | struct completion kim_rcvd, ldisc_installed; | 262 | struct completion kim_rcvd, ldisc_installed; |
262 | char resp_buffer[30]; | 263 | char resp_buffer[30]; |
263 | const struct firmware *fw_entry; | 264 | const struct firmware *fw_entry; |
264 | long nshutdown; | 265 | unsigned nshutdown; |
265 | unsigned long rx_state; | 266 | unsigned long rx_state; |
266 | unsigned long rx_count; | 267 | unsigned long rx_count; |
267 | struct sk_buff *rx_skb; | 268 | struct sk_buff *rx_skb; |
@@ -269,8 +270,8 @@ struct kim_data_s { | |||
269 | struct chip_version version; | 270 | struct chip_version version; |
270 | unsigned char ldisc_install; | 271 | unsigned char ldisc_install; |
271 | unsigned char dev_name[UART_DEV_NAME_LEN + 1]; | 272 | unsigned char dev_name[UART_DEV_NAME_LEN + 1]; |
272 | unsigned char flow_cntrl; | 273 | unsigned flow_cntrl; |
273 | unsigned long baud_rate; | 274 | unsigned baud_rate; |
274 | }; | 275 | }; |
275 | 276 | ||
276 | /** | 277 | /** |
@@ -436,10 +437,10 @@ struct gps_event_hdr { | |||
436 | * | 437 | * |
437 | */ | 438 | */ |
438 | struct ti_st_plat_data { | 439 | struct ti_st_plat_data { |
439 | long nshutdown_gpio; | 440 | u32 nshutdown_gpio; |
440 | unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ | 441 | unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ |
441 | unsigned char flow_cntrl; /* flow control flag */ | 442 | u32 flow_cntrl; /* flow control flag */ |
442 | unsigned long baud_rate; | 443 | u32 baud_rate; |
443 | int (*suspend)(struct platform_device *, pm_message_t); | 444 | int (*suspend)(struct platform_device *, pm_message_t); |
444 | int (*resume)(struct platform_device *); | 445 | int (*resume)(struct platform_device *); |
445 | int (*chip_enable) (struct kim_data_s *); | 446 | int (*chip_enable) (struct kim_data_s *); |
diff --git a/include/linux/tick.h b/include/linux/tick.h index eda850ca757a..9c085dc12ae9 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -79,6 +79,9 @@ extern void __init tick_init(void); | |||
79 | extern int tick_is_oneshot_available(void); | 79 | extern int tick_is_oneshot_available(void); |
80 | extern struct tick_device *tick_get_device(int cpu); | 80 | extern struct tick_device *tick_get_device(int cpu); |
81 | 81 | ||
82 | extern void tick_freeze(void); | ||
83 | extern void tick_unfreeze(void); | ||
84 | |||
82 | # ifdef CONFIG_HIGH_RES_TIMERS | 85 | # ifdef CONFIG_HIGH_RES_TIMERS |
83 | extern int tick_init_highres(void); | 86 | extern int tick_init_highres(void); |
84 | extern int tick_program_event(ktime_t expires, int force); | 87 | extern int tick_program_event(ktime_t expires, int force); |
@@ -119,6 +122,8 @@ static inline int tick_oneshot_mode_active(void) { return 0; } | |||
119 | 122 | ||
120 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ | 123 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ |
121 | static inline void tick_init(void) { } | 124 | static inline void tick_init(void) { } |
125 | static inline void tick_freeze(void) { } | ||
126 | static inline void tick_unfreeze(void) { } | ||
122 | static inline void tick_cancel_sched_timer(int cpu) { } | 127 | static inline void tick_cancel_sched_timer(int cpu) { } |
123 | static inline void tick_clock_notify(void) { } | 128 | static inline void tick_clock_notify(void) { } |
124 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 129 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
@@ -226,5 +231,4 @@ static inline void tick_nohz_task_switch(struct task_struct *tsk) | |||
226 | __tick_nohz_task_switch(tsk); | 231 | __tick_nohz_task_switch(tsk); |
227 | } | 232 | } |
228 | 233 | ||
229 | |||
230 | #endif | 234 | #endif |
diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h new file mode 100644 index 000000000000..4382035a75bb --- /dev/null +++ b/include/linux/timecounter.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * linux/include/linux/timecounter.h | ||
3 | * | ||
4 | * based on code that migrated away from | ||
5 | * linux/include/linux/clocksource.h | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | #ifndef _LINUX_TIMECOUNTER_H | ||
18 | #define _LINUX_TIMECOUNTER_H | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | |||
22 | /* simplify initialization of mask field */ | ||
23 | #define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | ||
24 | |||
25 | /** | ||
26 | * struct cyclecounter - hardware abstraction for a free running counter | ||
27 | * Provides completely state-free accessors to the underlying hardware. | ||
28 | * Depending on which hardware it reads, the cycle counter may wrap | ||
29 | * around quickly. Locking rules (if necessary) have to be defined | ||
30 | * by the implementor and user of specific instances of this API. | ||
31 | * | ||
32 | * @read: returns the current cycle value | ||
33 | * @mask: bitmask for two's complement | ||
34 | * subtraction of non 64 bit counters, | ||
35 | * see CYCLECOUNTER_MASK() helper macro | ||
36 | * @mult: cycle to nanosecond multiplier | ||
37 | * @shift: cycle to nanosecond divisor (power of two) | ||
38 | */ | ||
39 | struct cyclecounter { | ||
40 | cycle_t (*read)(const struct cyclecounter *cc); | ||
41 | cycle_t mask; | ||
42 | u32 mult; | ||
43 | u32 shift; | ||
44 | }; | ||
45 | |||
46 | /** | ||
47 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
48 | * Contains the state needed by timecounter_read() to detect | ||
49 | * cycle counter wrap around. Initialize with | ||
50 | * timecounter_init(). Also used to convert cycle counts into the | ||
51 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
52 | * of this code are responsible for initializing the underlying | ||
53 | * cycle counter hardware, locking issues and reading the time | ||
54 | * more often than the cycle counter wraps around. The nanosecond | ||
55 | * counter will only wrap around after ~585 years. | ||
56 | * | ||
57 | * @cc: the cycle counter used by this instance | ||
58 | * @cycle_last: most recent cycle counter value seen by | ||
59 | * timecounter_read() | ||
60 | * @nsec: continuously increasing count | ||
61 | * @mask: bit mask for maintaining the 'frac' field | ||
62 | * @frac: accumulated fractional nanoseconds | ||
63 | */ | ||
64 | struct timecounter { | ||
65 | const struct cyclecounter *cc; | ||
66 | cycle_t cycle_last; | ||
67 | u64 nsec; | ||
68 | u64 mask; | ||
69 | u64 frac; | ||
70 | }; | ||
71 | |||
72 | /** | ||
73 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
74 | * @cc: Pointer to cycle counter. | ||
75 | * @cycles: Cycles | ||
76 | * @mask: bit mask for maintaining the 'frac' field | ||
77 | * @frac: pointer to storage for the fractional nanoseconds. | ||
78 | */ | ||
79 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
80 | cycle_t cycles, u64 mask, u64 *frac) | ||
81 | { | ||
82 | u64 ns = (u64) cycles; | ||
83 | |||
84 | ns = (ns * cc->mult) + *frac; | ||
85 | *frac = ns & mask; | ||
86 | return ns >> cc->shift; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * timecounter_adjtime - Shifts the time of the clock. | ||
91 | * @delta: Desired change in nanoseconds. | ||
92 | */ | ||
93 | static inline void timecounter_adjtime(struct timecounter *tc, s64 delta) | ||
94 | { | ||
95 | tc->nsec += delta; | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * timecounter_init - initialize a time counter | ||
100 | * @tc: Pointer to time counter which is to be initialized/reset | ||
101 | * @cc: A cycle counter, ready to be used. | ||
102 | * @start_tstamp: Arbitrary initial time stamp. | ||
103 | * | ||
104 | * After this call the current cycle register (roughly) corresponds to | ||
105 | * the initial time stamp. Every call to timecounter_read() increments | ||
106 | * the time stamp counter by the number of elapsed nanoseconds. | ||
107 | */ | ||
108 | extern void timecounter_init(struct timecounter *tc, | ||
109 | const struct cyclecounter *cc, | ||
110 | u64 start_tstamp); | ||
111 | |||
112 | /** | ||
113 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
114 | * plus the initial time stamp | ||
115 | * @tc: Pointer to time counter. | ||
116 | * | ||
117 | * In other words, keeps track of time since the same epoch as | ||
118 | * the function which generated the initial time stamp. | ||
119 | */ | ||
120 | extern u64 timecounter_read(struct timecounter *tc); | ||
121 | |||
122 | /** | ||
123 | * timecounter_cyc2time - convert a cycle counter to same | ||
124 | * time base as values returned by | ||
125 | * timecounter_read() | ||
126 | * @tc: Pointer to time counter. | ||
127 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
128 | * | ||
129 | * Cycle counts that are converted correctly as long as they | ||
130 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
131 | * with "max cycle count" == cs->mask+1. | ||
132 | * | ||
133 | * This allows conversion of cycle counter values which were generated | ||
134 | * in the past. | ||
135 | */ | ||
136 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
137 | cycle_t cycle_tstamp); | ||
138 | |||
139 | #endif | ||
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 9b63d13ba82b..3eaae4754275 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
@@ -33,6 +33,7 @@ extern time64_t ktime_get_real_seconds(void); | |||
33 | 33 | ||
34 | extern int __getnstimeofday64(struct timespec64 *tv); | 34 | extern int __getnstimeofday64(struct timespec64 *tv); |
35 | extern void getnstimeofday64(struct timespec64 *tv); | 35 | extern void getnstimeofday64(struct timespec64 *tv); |
36 | extern void getboottime64(struct timespec64 *ts); | ||
36 | 37 | ||
37 | #if BITS_PER_LONG == 64 | 38 | #if BITS_PER_LONG == 64 |
38 | /** | 39 | /** |
@@ -72,6 +73,11 @@ static inline struct timespec get_monotonic_coarse(void) | |||
72 | { | 73 | { |
73 | return get_monotonic_coarse64(); | 74 | return get_monotonic_coarse64(); |
74 | } | 75 | } |
76 | |||
77 | static inline void getboottime(struct timespec *ts) | ||
78 | { | ||
79 | return getboottime64(ts); | ||
80 | } | ||
75 | #else | 81 | #else |
76 | /** | 82 | /** |
77 | * Deprecated. Use do_settimeofday64(). | 83 | * Deprecated. Use do_settimeofday64(). |
@@ -129,9 +135,15 @@ static inline struct timespec get_monotonic_coarse(void) | |||
129 | { | 135 | { |
130 | return timespec64_to_timespec(get_monotonic_coarse64()); | 136 | return timespec64_to_timespec(get_monotonic_coarse64()); |
131 | } | 137 | } |
132 | #endif | ||
133 | 138 | ||
134 | extern void getboottime(struct timespec *ts); | 139 | static inline void getboottime(struct timespec *ts) |
140 | { | ||
141 | struct timespec64 ts64; | ||
142 | |||
143 | getboottime64(&ts64); | ||
144 | *ts = timespec64_to_timespec(ts64); | ||
145 | } | ||
146 | #endif | ||
135 | 147 | ||
136 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | 148 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) |
137 | #define ktime_get_real_ts64(ts) getnstimeofday64(ts) | 149 | #define ktime_get_real_ts64(ts) getnstimeofday64(ts) |
@@ -217,6 +229,11 @@ static inline void get_monotonic_boottime(struct timespec *ts) | |||
217 | *ts = ktime_to_timespec(ktime_get_boottime()); | 229 | *ts = ktime_to_timespec(ktime_get_boottime()); |
218 | } | 230 | } |
219 | 231 | ||
232 | static inline void get_monotonic_boottime64(struct timespec64 *ts) | ||
233 | { | ||
234 | *ts = ktime_to_timespec64(ktime_get_boottime()); | ||
235 | } | ||
236 | |||
220 | static inline void timekeeping_clocktai(struct timespec *ts) | 237 | static inline void timekeeping_clocktai(struct timespec *ts) |
221 | { | 238 | { |
222 | *ts = ktime_to_timespec(ktime_get_clocktai()); | 239 | *ts = ktime_to_timespec(ktime_get_clocktai()); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index e08e21e5f601..c72851328ca9 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -173,7 +173,7 @@ extern void syscall_unregfunc(void); | |||
173 | TP_PROTO(data_proto), \ | 173 | TP_PROTO(data_proto), \ |
174 | TP_ARGS(data_args), \ | 174 | TP_ARGS(data_args), \ |
175 | TP_CONDITION(cond),,); \ | 175 | TP_CONDITION(cond),,); \ |
176 | if (IS_ENABLED(CONFIG_LOCKDEP)) { \ | 176 | if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ |
177 | rcu_read_lock_sched_notrace(); \ | 177 | rcu_read_lock_sched_notrace(); \ |
178 | rcu_dereference_sched(__tracepoint_##name.funcs);\ | 178 | rcu_dereference_sched(__tracepoint_##name.funcs);\ |
179 | rcu_read_unlock_sched_notrace(); \ | 179 | rcu_read_unlock_sched_notrace(); \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 7d66ae508e5c..358a337af598 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -14,6 +14,29 @@ | |||
14 | #include <linux/llist.h> | 14 | #include <linux/llist.h> |
15 | 15 | ||
16 | 16 | ||
17 | /* | ||
18 | * Lock subclasses for tty locks | ||
19 | * | ||
20 | * TTY_LOCK_NORMAL is for normal ttys and master ptys. | ||
21 | * TTY_LOCK_SLAVE is for slave ptys only. | ||
22 | * | ||
23 | * Lock subclasses are necessary for handling nested locking with pty pairs. | ||
24 | * tty locks which use nested locking: | ||
25 | * | ||
26 | * legacy_mutex - Nested tty locks are necessary for releasing pty pairs. | ||
27 | * The stable lock order is master pty first, then slave pty. | ||
28 | * termios_rwsem - The stable lock order is tty_buffer lock->termios_rwsem. | ||
29 | * Subclassing this lock enables the slave pty to hold its | ||
30 | * termios_rwsem when claiming the master tty_buffer lock. | ||
31 | * tty_buffer lock - slave ptys can claim nested buffer lock when handling | ||
32 | * signal chars. The stable lock order is slave pty, then | ||
33 | * master. | ||
34 | */ | ||
35 | |||
36 | enum { | ||
37 | TTY_LOCK_NORMAL = 0, | ||
38 | TTY_LOCK_SLAVE, | ||
39 | }; | ||
17 | 40 | ||
18 | /* | 41 | /* |
19 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are | 42 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are |
@@ -443,6 +466,7 @@ extern void tty_flush_to_ldisc(struct tty_struct *tty); | |||
443 | extern void tty_buffer_free_all(struct tty_port *port); | 466 | extern void tty_buffer_free_all(struct tty_port *port); |
444 | extern void tty_buffer_flush(struct tty_struct *tty, struct tty_ldisc *ld); | 467 | extern void tty_buffer_flush(struct tty_struct *tty, struct tty_ldisc *ld); |
445 | extern void tty_buffer_init(struct tty_port *port); | 468 | extern void tty_buffer_init(struct tty_port *port); |
469 | extern void tty_buffer_set_lock_subclass(struct tty_port *port); | ||
446 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 470 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
447 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 471 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
448 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, | 472 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, |
@@ -467,7 +491,6 @@ static inline speed_t tty_get_baud_rate(struct tty_struct *tty) | |||
467 | 491 | ||
468 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); | 492 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); |
469 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); | 493 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); |
470 | extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); | ||
471 | 494 | ||
472 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); | 495 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); |
473 | extern void tty_ldisc_deref(struct tty_ldisc *); | 496 | extern void tty_ldisc_deref(struct tty_ldisc *); |
diff --git a/include/linux/types.h b/include/linux/types.h index a0bb7048687f..6747247e3f9f 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -135,12 +135,9 @@ typedef unsigned long blkcnt_t; | |||
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * The type of an index into the pagecache. Use a #define so asm/types.h | 138 | * The type of an index into the pagecache. |
139 | * can override it. | ||
140 | */ | 139 | */ |
141 | #ifndef pgoff_t | ||
142 | #define pgoff_t unsigned long | 140 | #define pgoff_t unsigned long |
143 | #endif | ||
144 | 141 | ||
145 | /* A dma_addr_t can hold any valid DMA or bus address for the platform */ | 142 | /* A dma_addr_t can hold any valid DMA or bus address for the platform */ |
146 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT | 143 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
@@ -213,5 +210,8 @@ struct callback_head { | |||
213 | }; | 210 | }; |
214 | #define rcu_head callback_head | 211 | #define rcu_head callback_head |
215 | 212 | ||
213 | /* clocksource cycle base type */ | ||
214 | typedef u64 cycle_t; | ||
215 | |||
216 | #endif /* __ASSEMBLY__ */ | 216 | #endif /* __ASSEMBLY__ */ |
217 | #endif /* _LINUX_TYPES_H */ | 217 | #endif /* _LINUX_TYPES_H */ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index ee3277593222..247cfdcc4b08 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -49,11 +49,7 @@ struct udp_sock { | |||
49 | unsigned int corkflag; /* Cork is required */ | 49 | unsigned int corkflag; /* Cork is required */ |
50 | __u8 encap_type; /* Is this an Encapsulation socket? */ | 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ |
51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ | 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ |
52 | no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */ | 52 | no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */ |
53 | convert_csum:1;/* On receive, convert checksum | ||
54 | * unnecessary to checksum complete | ||
55 | * if possible. | ||
56 | */ | ||
57 | /* | 53 | /* |
58 | * Following member retains the information to create a UDP header | 54 | * Following member retains the information to create a UDP header |
59 | * when the socket is uncorked. | 55 | * when the socket is uncorked. |
@@ -102,16 +98,6 @@ static inline bool udp_get_no_check6_rx(struct sock *sk) | |||
102 | return udp_sk(sk)->no_check6_rx; | 98 | return udp_sk(sk)->no_check6_rx; |
103 | } | 99 | } |
104 | 100 | ||
105 | static inline void udp_set_convert_csum(struct sock *sk, bool val) | ||
106 | { | ||
107 | udp_sk(sk)->convert_csum = val; | ||
108 | } | ||
109 | |||
110 | static inline bool udp_get_convert_csum(struct sock *sk) | ||
111 | { | ||
112 | return udp_sk(sk)->convert_csum; | ||
113 | } | ||
114 | |||
115 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | 101 | #define udp_portaddr_for_each_entry(__sk, node, list) \ |
116 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | 102 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) |
117 | 103 | ||
diff --git a/include/linux/uio.h b/include/linux/uio.h index 1c5e453f7ea9..07a022641996 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -88,7 +88,9 @@ size_t iov_iter_zero(size_t bytes, struct iov_iter *); | |||
88 | unsigned long iov_iter_alignment(const struct iov_iter *i); | 88 | unsigned long iov_iter_alignment(const struct iov_iter *i); |
89 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, | 89 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, |
90 | unsigned long nr_segs, size_t count); | 90 | unsigned long nr_segs, size_t count); |
91 | void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *iov, | 91 | void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *kvec, |
92 | unsigned long nr_segs, size_t count); | ||
93 | void iov_iter_bvec(struct iov_iter *i, int direction, const struct bio_vec *bvec, | ||
92 | unsigned long nr_segs, size_t count); | 94 | unsigned long nr_segs, size_t count); |
93 | ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, | 95 | ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, |
94 | size_t maxsize, unsigned maxpages, size_t *start); | 96 | size_t maxsize, unsigned maxpages, size_t *start); |
@@ -135,10 +137,4 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) | |||
135 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 137 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
136 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 138 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
137 | 139 | ||
138 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | ||
139 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | ||
140 | int offset, int len); | ||
141 | int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | ||
142 | int offset, int len); | ||
143 | |||
144 | #endif | 140 | #endif |
diff --git a/include/linux/usb.h b/include/linux/usb.h index f89c24a03bd9..7ee1b5c3b4cb 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -82,7 +82,7 @@ struct usb_host_interface { | |||
82 | int extralen; | 82 | int extralen; |
83 | unsigned char *extra; /* Extra descriptors */ | 83 | unsigned char *extra; /* Extra descriptors */ |
84 | 84 | ||
85 | /* array of desc.bNumEndpoint endpoints associated with this | 85 | /* array of desc.bNumEndpoints endpoints associated with this |
86 | * interface setting. these will be in no particular order. | 86 | * interface setting. these will be in no particular order. |
87 | */ | 87 | */ |
88 | struct usb_host_endpoint *endpoint; | 88 | struct usb_host_endpoint *endpoint; |
@@ -127,10 +127,6 @@ enum usb_interface_condition { | |||
127 | * to the sysfs representation for that device. | 127 | * to the sysfs representation for that device. |
128 | * @pm_usage_cnt: PM usage counter for this interface | 128 | * @pm_usage_cnt: PM usage counter for this interface |
129 | * @reset_ws: Used for scheduling resets from atomic context. | 129 | * @reset_ws: Used for scheduling resets from atomic context. |
130 | * @reset_running: set to 1 if the interface is currently running a | ||
131 | * queued reset so that usb_cancel_queued_reset() doesn't try to | ||
132 | * remove from the workqueue when running inside the worker | ||
133 | * thread. See __usb_queue_reset_device(). | ||
134 | * @resetting_device: USB core reset the device, so use alt setting 0 as | 130 | * @resetting_device: USB core reset the device, so use alt setting 0 as |
135 | * current; needs bandwidth alloc after reset. | 131 | * current; needs bandwidth alloc after reset. |
136 | * | 132 | * |
@@ -181,7 +177,6 @@ struct usb_interface { | |||
181 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 177 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
182 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | 178 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ |
183 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 179 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
184 | unsigned reset_running:1; | ||
185 | unsigned resetting_device:1; /* true: bandwidth alloc after reset */ | 180 | unsigned resetting_device:1; /* true: bandwidth alloc after reset */ |
186 | 181 | ||
187 | struct device dev; /* interface specific device info */ | 182 | struct device dev; /* interface specific device info */ |
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index 7eb4dcd0d386..db0431b39a63 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
@@ -34,6 +34,8 @@ struct usb_hcd; | |||
34 | * after initialization. | 34 | * after initialization. |
35 | * @no_io_watchdog: set to 1 if the controller does not need the I/O | 35 | * @no_io_watchdog: set to 1 if the controller does not need the I/O |
36 | * watchdog to run. | 36 | * watchdog to run. |
37 | * @reset_on_resume: set to 1 if the controller needs to be reset after | ||
38 | * a suspend / resume cycle (but can't detect that itself). | ||
37 | * | 39 | * |
38 | * These are general configuration options for the EHCI controller. All of | 40 | * These are general configuration options for the EHCI controller. All of |
39 | * these options are activating more or less workarounds for some hardware. | 41 | * these options are activating more or less workarounds for some hardware. |
@@ -45,6 +47,8 @@ struct usb_ehci_pdata { | |||
45 | unsigned big_endian_desc:1; | 47 | unsigned big_endian_desc:1; |
46 | unsigned big_endian_mmio:1; | 48 | unsigned big_endian_mmio:1; |
47 | unsigned no_io_watchdog:1; | 49 | unsigned no_io_watchdog:1; |
50 | unsigned reset_on_resume:1; | ||
51 | unsigned dma_mask_64:1; | ||
48 | 52 | ||
49 | /* Turn on all power and clocks */ | 53 | /* Turn on all power and clocks */ |
50 | int (*power_on)(struct platform_device *pdev); | 54 | int (*power_on)(struct platform_device *pdev); |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 70ddb3943b62..e2f00fd8cd47 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -523,6 +523,7 @@ struct usb_gadget_ops { | |||
523 | * enabled HNP support. | 523 | * enabled HNP support. |
524 | * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to | 524 | * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to |
525 | * MaxPacketSize. | 525 | * MaxPacketSize. |
526 | * @is_selfpowered: if the gadget is self-powered. | ||
526 | * | 527 | * |
527 | * Gadgets have a mostly-portable "gadget driver" implementing device | 528 | * Gadgets have a mostly-portable "gadget driver" implementing device |
528 | * functions, handling all usb configurations and interfaces. Gadget | 529 | * functions, handling all usb configurations and interfaces. Gadget |
@@ -563,6 +564,7 @@ struct usb_gadget { | |||
563 | unsigned a_hnp_support:1; | 564 | unsigned a_hnp_support:1; |
564 | unsigned a_alt_hnp_support:1; | 565 | unsigned a_alt_hnp_support:1; |
565 | unsigned quirk_ep_out_aligned_size:1; | 566 | unsigned quirk_ep_out_aligned_size:1; |
567 | unsigned is_selfpowered:1; | ||
566 | }; | 568 | }; |
567 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) | 569 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) |
568 | 570 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 086bf13307e6..68b1e836dff1 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -146,6 +146,8 @@ struct usb_hcd { | |||
146 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ | 146 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ |
147 | unsigned can_do_streams:1; /* HC supports streams */ | 147 | unsigned can_do_streams:1; /* HC supports streams */ |
148 | unsigned tpl_support:1; /* OTG & EH TPL support */ | 148 | unsigned tpl_support:1; /* OTG & EH TPL support */ |
149 | unsigned cant_recv_wakeups:1; | ||
150 | /* wakeup requests from downstream aren't received */ | ||
149 | 151 | ||
150 | unsigned int irq; /* irq allocated */ | 152 | unsigned int irq; /* irq allocated */ |
151 | void __iomem *regs; /* device memory/io */ | 153 | void __iomem *regs; /* device memory/io */ |
@@ -453,6 +455,7 @@ extern const struct dev_pm_ops usb_hcd_pci_pm_ops; | |||
453 | #endif /* CONFIG_PCI */ | 455 | #endif /* CONFIG_PCI */ |
454 | 456 | ||
455 | /* pci-ish (pdev null is ok) buffer alloc/mapping support */ | 457 | /* pci-ish (pdev null is ok) buffer alloc/mapping support */ |
458 | void usb_init_pool_max(void); | ||
456 | int hcd_buffer_create(struct usb_hcd *hcd); | 459 | int hcd_buffer_create(struct usb_hcd *hcd); |
457 | void hcd_buffer_destroy(struct usb_hcd *hcd); | 460 | void hcd_buffer_destroy(struct usb_hcd *hcd); |
458 | 461 | ||
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index f499c23e6342..bc91b5d380fd 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* USB OTG (On The Go) defines */ | ||
2 | /* | 1 | /* |
2 | * USB PHY defines | ||
3 | * | 3 | * |
4 | * These APIs may be used between USB controllers. USB device drivers | 4 | * These APIs may be used between USB controllers. USB device drivers |
5 | * (for either host or peripheral roles) don't use these calls; they | 5 | * (for either host or peripheral roles) don't use these calls; they |
@@ -106,7 +106,7 @@ struct usb_phy { | |||
106 | int (*set_power)(struct usb_phy *x, | 106 | int (*set_power)(struct usb_phy *x, |
107 | unsigned mA); | 107 | unsigned mA); |
108 | 108 | ||
109 | /* for non-OTG B devices: set transceiver into suspend mode */ | 109 | /* Set transceiver into suspend mode */ |
110 | int (*set_suspend)(struct usb_phy *x, | 110 | int (*set_suspend)(struct usb_phy *x, |
111 | int suspend); | 111 | int suspend); |
112 | 112 | ||
diff --git a/include/linux/usb/usb_phy_generic.h b/include/linux/usb/usb_phy_generic.h index 68adae83affc..c13632d5292e 100644 --- a/include/linux/usb/usb_phy_generic.h +++ b/include/linux/usb/usb_phy_generic.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LINUX_USB_NOP_XCEIV_H | 2 | #define __LINUX_USB_NOP_XCEIV_H |
3 | 3 | ||
4 | #include <linux/usb/otg.h> | 4 | #include <linux/usb/otg.h> |
5 | #include <linux/gpio/consumer.h> | ||
5 | 6 | ||
6 | struct usb_phy_generic_platform_data { | 7 | struct usb_phy_generic_platform_data { |
7 | enum usb_phy_type type; | 8 | enum usb_phy_type type; |
@@ -11,6 +12,7 @@ struct usb_phy_generic_platform_data { | |||
11 | unsigned int needs_vcc:1; | 12 | unsigned int needs_vcc:1; |
12 | unsigned int needs_reset:1; /* deprecated */ | 13 | unsigned int needs_reset:1; /* deprecated */ |
13 | int gpio_reset; | 14 | int gpio_reset; |
15 | struct gpio_desc *gpiod_vbus; | ||
14 | }; | 16 | }; |
15 | 17 | ||
16 | #if IS_ENABLED(CONFIG_NOP_USB_XCEIV) | 18 | #if IS_ENABLED(CONFIG_NOP_USB_XCEIV) |
diff --git a/include/linux/vfio.h b/include/linux/vfio.h index d3204115f15d..2d67b8998fd8 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h | |||
@@ -26,6 +26,7 @@ | |||
26 | * @ioctl: Perform ioctl(2) on device file descriptor, supporting VFIO_DEVICE_* | 26 | * @ioctl: Perform ioctl(2) on device file descriptor, supporting VFIO_DEVICE_* |
27 | * operations documented below | 27 | * operations documented below |
28 | * @mmap: Perform mmap(2) on a region of the device file descriptor | 28 | * @mmap: Perform mmap(2) on a region of the device file descriptor |
29 | * @request: Request for the bus driver to release the device | ||
29 | */ | 30 | */ |
30 | struct vfio_device_ops { | 31 | struct vfio_device_ops { |
31 | char *name; | 32 | char *name; |
@@ -38,6 +39,7 @@ struct vfio_device_ops { | |||
38 | long (*ioctl)(void *device_data, unsigned int cmd, | 39 | long (*ioctl)(void *device_data, unsigned int cmd, |
39 | unsigned long arg); | 40 | unsigned long arg); |
40 | int (*mmap)(void *device_data, struct vm_area_struct *vma); | 41 | int (*mmap)(void *device_data, struct vm_area_struct *vma); |
42 | void (*request)(void *device_data, unsigned int count); | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | extern int vfio_add_group_dev(struct device *dev, | 45 | extern int vfio_add_group_dev(struct device *dev, |
diff --git a/include/linux/virtio_mmio.h b/include/linux/virtio_mmio.h index 5c7b6f0daef8..c4b09689ab64 100644 --- a/include/linux/virtio_mmio.h +++ b/include/linux/virtio_mmio.h | |||
@@ -51,23 +51,29 @@ | |||
51 | /* Virtio vendor ID - Read Only */ | 51 | /* Virtio vendor ID - Read Only */ |
52 | #define VIRTIO_MMIO_VENDOR_ID 0x00c | 52 | #define VIRTIO_MMIO_VENDOR_ID 0x00c |
53 | 53 | ||
54 | /* Bitmask of the features supported by the host | 54 | /* Bitmask of the features supported by the device (host) |
55 | * (32 bits per set) - Read Only */ | 55 | * (32 bits per set) - Read Only */ |
56 | #define VIRTIO_MMIO_HOST_FEATURES 0x010 | 56 | #define VIRTIO_MMIO_DEVICE_FEATURES 0x010 |
57 | 57 | ||
58 | /* Host features set selector - Write Only */ | 58 | /* Device (host) features set selector - Write Only */ |
59 | #define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014 | 59 | #define VIRTIO_MMIO_DEVICE_FEATURES_SEL 0x014 |
60 | 60 | ||
61 | /* Bitmask of features activated by the guest | 61 | /* Bitmask of features activated by the driver (guest) |
62 | * (32 bits per set) - Write Only */ | 62 | * (32 bits per set) - Write Only */ |
63 | #define VIRTIO_MMIO_GUEST_FEATURES 0x020 | 63 | #define VIRTIO_MMIO_DRIVER_FEATURES 0x020 |
64 | 64 | ||
65 | /* Activated features set selector - Write Only */ | 65 | /* Activated features set selector - Write Only */ |
66 | #define VIRTIO_MMIO_GUEST_FEATURES_SEL 0x024 | 66 | #define VIRTIO_MMIO_DRIVER_FEATURES_SEL 0x024 |
67 | |||
68 | |||
69 | #ifndef VIRTIO_MMIO_NO_LEGACY /* LEGACY DEVICES ONLY! */ | ||
67 | 70 | ||
68 | /* Guest's memory page size in bytes - Write Only */ | 71 | /* Guest's memory page size in bytes - Write Only */ |
69 | #define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 | 72 | #define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 |
70 | 73 | ||
74 | #endif | ||
75 | |||
76 | |||
71 | /* Queue selector - Write Only */ | 77 | /* Queue selector - Write Only */ |
72 | #define VIRTIO_MMIO_QUEUE_SEL 0x030 | 78 | #define VIRTIO_MMIO_QUEUE_SEL 0x030 |
73 | 79 | ||
@@ -77,12 +83,21 @@ | |||
77 | /* Queue size for the currently selected queue - Write Only */ | 83 | /* Queue size for the currently selected queue - Write Only */ |
78 | #define VIRTIO_MMIO_QUEUE_NUM 0x038 | 84 | #define VIRTIO_MMIO_QUEUE_NUM 0x038 |
79 | 85 | ||
86 | |||
87 | #ifndef VIRTIO_MMIO_NO_LEGACY /* LEGACY DEVICES ONLY! */ | ||
88 | |||
80 | /* Used Ring alignment for the currently selected queue - Write Only */ | 89 | /* Used Ring alignment for the currently selected queue - Write Only */ |
81 | #define VIRTIO_MMIO_QUEUE_ALIGN 0x03c | 90 | #define VIRTIO_MMIO_QUEUE_ALIGN 0x03c |
82 | 91 | ||
83 | /* Guest's PFN for the currently selected queue - Read Write */ | 92 | /* Guest's PFN for the currently selected queue - Read Write */ |
84 | #define VIRTIO_MMIO_QUEUE_PFN 0x040 | 93 | #define VIRTIO_MMIO_QUEUE_PFN 0x040 |
85 | 94 | ||
95 | #endif | ||
96 | |||
97 | |||
98 | /* Ready bit for the currently selected queue - Read Write */ | ||
99 | #define VIRTIO_MMIO_QUEUE_READY 0x044 | ||
100 | |||
86 | /* Queue notifier - Write Only */ | 101 | /* Queue notifier - Write Only */ |
87 | #define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 | 102 | #define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 |
88 | 103 | ||
@@ -95,6 +110,21 @@ | |||
95 | /* Device status register - Read Write */ | 110 | /* Device status register - Read Write */ |
96 | #define VIRTIO_MMIO_STATUS 0x070 | 111 | #define VIRTIO_MMIO_STATUS 0x070 |
97 | 112 | ||
113 | /* Selected queue's Descriptor Table address, 64 bits in two halves */ | ||
114 | #define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080 | ||
115 | #define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084 | ||
116 | |||
117 | /* Selected queue's Available Ring address, 64 bits in two halves */ | ||
118 | #define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090 | ||
119 | #define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094 | ||
120 | |||
121 | /* Selected queue's Used Ring address, 64 bits in two halves */ | ||
122 | #define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0 | ||
123 | #define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4 | ||
124 | |||
125 | /* Configuration atomicity value */ | ||
126 | #define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc | ||
127 | |||
98 | /* The config space is defined by each driver as | 128 | /* The config space is defined by each driver as |
99 | * the per-driver configuration space - Read Write */ | 129 | * the per-driver configuration space - Read Write */ |
100 | #define VIRTIO_MMIO_CONFIG 0x100 | 130 | #define VIRTIO_MMIO_CONFIG 0x100 |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index b87696fdf06a..7d7acb35603d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -16,6 +16,7 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | |||
16 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | 16 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ | 17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
18 | #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ | 18 | #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ |
19 | #define VM_NO_GUARD 0x00000040 /* don't add guard page */ | ||
19 | /* bits [20..32] reserved for arch specific ioremap internals */ | 20 | /* bits [20..32] reserved for arch specific ioremap internals */ |
20 | 21 | ||
21 | /* | 22 | /* |
@@ -75,7 +76,9 @@ extern void *vmalloc_32_user(unsigned long size); | |||
75 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 76 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
76 | extern void *__vmalloc_node_range(unsigned long size, unsigned long align, | 77 | extern void *__vmalloc_node_range(unsigned long size, unsigned long align, |
77 | unsigned long start, unsigned long end, gfp_t gfp_mask, | 78 | unsigned long start, unsigned long end, gfp_t gfp_mask, |
78 | pgprot_t prot, int node, const void *caller); | 79 | pgprot_t prot, unsigned long vm_flags, int node, |
80 | const void *caller); | ||
81 | |||
79 | extern void vfree(const void *addr); | 82 | extern void vfree(const void *addr); |
80 | 83 | ||
81 | extern void *vmap(struct page **pages, unsigned int count, | 84 | extern void *vmap(struct page **pages, unsigned int count, |
@@ -96,8 +99,12 @@ void vmalloc_sync_all(void); | |||
96 | 99 | ||
97 | static inline size_t get_vm_area_size(const struct vm_struct *area) | 100 | static inline size_t get_vm_area_size(const struct vm_struct *area) |
98 | { | 101 | { |
99 | /* return actual size without guard page */ | 102 | if (!(area->flags & VM_NO_GUARD)) |
100 | return area->size - PAGE_SIZE; | 103 | /* return actual size without guard page */ |
104 | return area->size - PAGE_SIZE; | ||
105 | else | ||
106 | return area->size; | ||
107 | |||
101 | } | 108 | } |
102 | 109 | ||
103 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | 110 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); |
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h index 5691f752ce8f..63df3a2a8ce5 100644 --- a/include/linux/vmw_vmci_api.h +++ b/include/linux/vmw_vmci_api.h | |||
@@ -74,7 +74,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair, | |||
74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, | 74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, |
75 | int mode); | 75 | int mode); |
76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, | 76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, |
77 | void *iov, size_t iov_size, int mode); | 77 | struct msghdr *msg, size_t iov_size, int mode); |
78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | 78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, |
79 | struct msghdr *msg, size_t iov_size, int mode); | 79 | struct msghdr *msg, size_t iov_size, int mode); |
80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, | 80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, |
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index 057db7d2f448..f38c10ba3ff5 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h | |||
@@ -21,10 +21,6 @@ | |||
21 | #ifndef VT_BUF_HAVE_RW | 21 | #ifndef VT_BUF_HAVE_RW |
22 | #define scr_writew(val, addr) (*(addr) = (val)) | 22 | #define scr_writew(val, addr) (*(addr) = (val)) |
23 | #define scr_readw(addr) (*(addr)) | 23 | #define scr_readw(addr) (*(addr)) |
24 | #define scr_memcpyw(d, s, c) memcpy(d, s, c) | ||
25 | #define scr_memmovew(d, s, c) memmove(d, s, c) | ||
26 | #define VT_BUF_HAVE_MEMCPYW | ||
27 | #define VT_BUF_HAVE_MEMMOVEW | ||
28 | #endif | 24 | #endif |
29 | 25 | ||
30 | #ifndef VT_BUF_HAVE_MEMSETW | 26 | #ifndef VT_BUF_HAVE_MEMSETW |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 2232ed16635a..2db83349865b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -267,6 +267,21 @@ do { \ | |||
267 | __wait_event(wq, condition); \ | 267 | __wait_event(wq, condition); \ |
268 | } while (0) | 268 | } while (0) |
269 | 269 | ||
270 | #define __io_wait_event(wq, condition) \ | ||
271 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | ||
272 | io_schedule()) | ||
273 | |||
274 | /* | ||
275 | * io_wait_event() -- like wait_event() but with io_schedule() | ||
276 | */ | ||
277 | #define io_wait_event(wq, condition) \ | ||
278 | do { \ | ||
279 | might_sleep(); \ | ||
280 | if (condition) \ | ||
281 | break; \ | ||
282 | __io_wait_event(wq, condition); \ | ||
283 | } while (0) | ||
284 | |||
270 | #define __wait_event_freezable(wq, condition) \ | 285 | #define __wait_event_freezable(wq, condition) \ |
271 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ | 286 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
272 | schedule(); try_to_freeze()) | 287 | schedule(); try_to_freeze()) |
@@ -363,7 +378,6 @@ do { \ | |||
363 | */ | 378 | */ |
364 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ | 379 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ |
365 | do { \ | 380 | do { \ |
366 | might_sleep(); \ | ||
367 | if (condition) \ | 381 | if (condition) \ |
368 | break; \ | 382 | break; \ |
369 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ | 383 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ |
@@ -991,6 +1005,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode) | |||
991 | } | 1005 | } |
992 | 1006 | ||
993 | /** | 1007 | /** |
1008 | * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses | ||
1009 | * @word: the word being waited on, a kernel virtual address | ||
1010 | * @bit: the bit of the word being waited on | ||
1011 | * @mode: the task state to sleep in | ||
1012 | * @timeout: timeout, in jiffies | ||
1013 | * | ||
1014 | * Use the standard hashed waitqueue table to wait for a bit | ||
1015 | * to be cleared. This is similar to wait_on_bit(), except also takes a | ||
1016 | * timeout parameter. | ||
1017 | * | ||
1018 | * Returned value will be zero if the bit was cleared before the | ||
1019 | * @timeout elapsed, or non-zero if the @timeout elapsed or process | ||
1020 | * received a signal and the mode permitted wakeup on that signal. | ||
1021 | */ | ||
1022 | static inline int | ||
1023 | wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout) | ||
1024 | { | ||
1025 | might_sleep(); | ||
1026 | if (!test_bit(bit, word)) | ||
1027 | return 0; | ||
1028 | return out_of_line_wait_on_bit_timeout(word, bit, | ||
1029 | bit_wait_timeout, | ||
1030 | mode, timeout); | ||
1031 | } | ||
1032 | |||
1033 | /** | ||
994 | * wait_on_bit_action - wait for a bit to be cleared | 1034 | * wait_on_bit_action - wait for a bit to be cleared |
995 | * @word: the word being waited on, a kernel virtual address | 1035 | * @word: the word being waited on, a kernel virtual address |
996 | * @bit: the bit of the word being waited on | 1036 | * @bit: the bit of the word being waited on |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index b996e6cde6bb..74db135f9957 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -220,14 +220,10 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
220 | #endif | 220 | #endif |
221 | 221 | ||
222 | #define INIT_WORK(_work, _func) \ | 222 | #define INIT_WORK(_work, _func) \ |
223 | do { \ | 223 | __INIT_WORK((_work), (_func), 0) |
224 | __INIT_WORK((_work), (_func), 0); \ | ||
225 | } while (0) | ||
226 | 224 | ||
227 | #define INIT_WORK_ONSTACK(_work, _func) \ | 225 | #define INIT_WORK_ONSTACK(_work, _func) \ |
228 | do { \ | 226 | __INIT_WORK((_work), (_func), 1) |
229 | __INIT_WORK((_work), (_func), 1); \ | ||
230 | } while (0) | ||
231 | 227 | ||
232 | #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ | 228 | #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ |
233 | do { \ | 229 | do { \ |
diff --git a/include/linux/zpool.h b/include/linux/zpool.h index f14bd75f08b3..56529b34dc63 100644 --- a/include/linux/zpool.h +++ b/include/linux/zpool.h | |||
@@ -36,7 +36,8 @@ enum zpool_mapmode { | |||
36 | ZPOOL_MM_DEFAULT = ZPOOL_MM_RW | 36 | ZPOOL_MM_DEFAULT = ZPOOL_MM_RW |
37 | }; | 37 | }; |
38 | 38 | ||
39 | struct zpool *zpool_create_pool(char *type, gfp_t gfp, struct zpool_ops *ops); | 39 | struct zpool *zpool_create_pool(char *type, char *name, |
40 | gfp_t gfp, struct zpool_ops *ops); | ||
40 | 41 | ||
41 | char *zpool_get_type(struct zpool *pool); | 42 | char *zpool_get_type(struct zpool *pool); |
42 | 43 | ||
@@ -80,7 +81,7 @@ struct zpool_driver { | |||
80 | atomic_t refcount; | 81 | atomic_t refcount; |
81 | struct list_head list; | 82 | struct list_head list; |
82 | 83 | ||
83 | void *(*create)(gfp_t gfp, struct zpool_ops *ops); | 84 | void *(*create)(char *name, gfp_t gfp, struct zpool_ops *ops); |
84 | void (*destroy)(void *pool); | 85 | void (*destroy)(void *pool); |
85 | 86 | ||
86 | int (*malloc)(void *pool, size_t size, gfp_t gfp, | 87 | int (*malloc)(void *pool, size_t size, gfp_t gfp, |
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h index 05c214760977..3283c6a55425 100644 --- a/include/linux/zsmalloc.h +++ b/include/linux/zsmalloc.h | |||
@@ -36,7 +36,7 @@ enum zs_mapmode { | |||
36 | 36 | ||
37 | struct zs_pool; | 37 | struct zs_pool; |
38 | 38 | ||
39 | struct zs_pool *zs_create_pool(gfp_t flags); | 39 | struct zs_pool *zs_create_pool(char *name, gfp_t flags); |
40 | void zs_destroy_pool(struct zs_pool *pool); | 40 | void zs_destroy_pool(struct zs_pool *pool); |
41 | 41 | ||
42 | unsigned long zs_malloc(struct zs_pool *pool, size_t size); | 42 | unsigned long zs_malloc(struct zs_pool *pool, size_t size); |
diff --git a/include/media/smiapp.h b/include/media/smiapp.h index 0b8f124a630c..268a3cdbf6cb 100644 --- a/include/media/smiapp.h +++ b/include/media/smiapp.h | |||
@@ -65,19 +65,19 @@ struct smiapp_platform_data { | |||
65 | unsigned short i2c_addr_dfl; /* Default i2c addr */ | 65 | unsigned short i2c_addr_dfl; /* Default i2c addr */ |
66 | unsigned short i2c_addr_alt; /* Alternate i2c addr */ | 66 | unsigned short i2c_addr_alt; /* Alternate i2c addr */ |
67 | 67 | ||
68 | unsigned int nvm_size; /* bytes */ | 68 | uint32_t nvm_size; /* bytes */ |
69 | unsigned int ext_clk; /* sensor external clk */ | 69 | uint32_t ext_clk; /* sensor external clk */ |
70 | 70 | ||
71 | unsigned int lanes; /* Number of CSI-2 lanes */ | 71 | unsigned int lanes; /* Number of CSI-2 lanes */ |
72 | u8 csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ | 72 | uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ |
73 | const s64 *op_sys_clock; | 73 | uint64_t *op_sys_clock; |
74 | 74 | ||
75 | enum smiapp_module_board_orient module_board_orient; | 75 | enum smiapp_module_board_orient module_board_orient; |
76 | 76 | ||
77 | struct smiapp_flash_strobe_parms *strobe_setup; | 77 | struct smiapp_flash_strobe_parms *strobe_setup; |
78 | 78 | ||
79 | int (*set_xclk)(struct v4l2_subdev *sd, int hz); | 79 | int (*set_xclk)(struct v4l2_subdev *sd, int hz); |
80 | int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ | 80 | int32_t xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #endif /* __SMIAPP_H_ */ | 83 | #endif /* __SMIAPP_H_ */ |
diff --git a/include/media/tea575x.h b/include/media/tea575x.h index 2d4fa59db902..5d096578b736 100644 --- a/include/media/tea575x.h +++ b/include/media/tea575x.h | |||
@@ -71,6 +71,11 @@ struct snd_tea575x { | |||
71 | int (*ext_init)(struct snd_tea575x *tea); | 71 | int (*ext_init)(struct snd_tea575x *tea); |
72 | }; | 72 | }; |
73 | 73 | ||
74 | int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea, | ||
75 | struct v4l2_frequency_band *band); | ||
76 | int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v); | ||
77 | int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea, | ||
78 | const struct v4l2_hw_freq_seek *a); | ||
74 | int snd_tea575x_hw_init(struct snd_tea575x *tea); | 79 | int snd_tea575x_hw_init(struct snd_tea575x *tea); |
75 | int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); | 80 | int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); |
76 | void snd_tea575x_exit(struct snd_tea575x *tea); | 81 | void snd_tea575x_exit(struct snd_tea575x *tea); |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index eb76cfd47189..3e4fddfc840c 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -124,7 +124,8 @@ struct video_device | |||
124 | spinlock_t fh_lock; /* Lock for all v4l2_fhs */ | 124 | spinlock_t fh_lock; /* Lock for all v4l2_fhs */ |
125 | struct list_head fh_list; /* List of struct v4l2_fh */ | 125 | struct list_head fh_list; /* List of struct v4l2_fh */ |
126 | 126 | ||
127 | int debug; /* Activates debug level*/ | 127 | /* Internal device debug flags, not for use by drivers */ |
128 | int dev_debug; | ||
128 | 129 | ||
129 | /* Video standard vars */ | 130 | /* Video standard vars */ |
130 | v4l2_std_id tvnorms; /* Supported tv norms */ | 131 | v4l2_std_id tvnorms; /* Supported tv norms */ |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 53605f0f9903..8537983b9b22 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -291,9 +291,18 @@ struct v4l2_ioctl_ops { | |||
291 | 291 | ||
292 | /* v4l debugging and diagnostics */ | 292 | /* v4l debugging and diagnostics */ |
293 | 293 | ||
294 | /* Debug bitmask flags to be used on V4L2 */ | 294 | /* Device debug flags to be used with the video device debug attribute */ |
295 | #define V4L2_DEBUG_IOCTL 0x01 | 295 | |
296 | #define V4L2_DEBUG_IOCTL_ARG 0x02 | 296 | /* Just log the ioctl name + error code */ |
297 | #define V4L2_DEV_DEBUG_IOCTL 0x01 | ||
298 | /* Log the ioctl name arguments + error code */ | ||
299 | #define V4L2_DEV_DEBUG_IOCTL_ARG 0x02 | ||
300 | /* Log the file operations open, release, mmap and get_unmapped_area */ | ||
301 | #define V4L2_DEV_DEBUG_FOP 0x04 | ||
302 | /* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */ | ||
303 | #define V4L2_DEV_DEBUG_STREAMING 0x08 | ||
304 | /* Log poll() */ | ||
305 | #define V4L2_DEV_DEBUG_POLL 0x10 | ||
297 | 306 | ||
298 | /* Video standard functions */ | 307 | /* Video standard functions */ |
299 | extern const char *v4l2_norm_to_name(v4l2_std_id id); | 308 | extern const char *v4l2_norm_to_name(v4l2_std_id id); |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 5860292d42eb..5beeb8744fd1 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -342,8 +342,6 @@ struct v4l2_subdev_video_ops { | |||
342 | struct v4l2_dv_timings *timings); | 342 | struct v4l2_dv_timings *timings); |
343 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, | 343 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, |
344 | u32 *code); | 344 | u32 *code); |
345 | int (*enum_mbus_fsizes)(struct v4l2_subdev *sd, | ||
346 | struct v4l2_frmsizeenum *fsize); | ||
347 | int (*g_mbus_fmt)(struct v4l2_subdev *sd, | 345 | int (*g_mbus_fmt)(struct v4l2_subdev *sd, |
348 | struct v4l2_mbus_framefmt *fmt); | 346 | struct v4l2_mbus_framefmt *fmt); |
349 | int (*try_mbus_fmt)(struct v4l2_subdev *sd, | 347 | int (*try_mbus_fmt)(struct v4l2_subdev *sd, |
@@ -503,10 +501,6 @@ struct v4l2_subdev_pad_ops { | |||
503 | struct v4l2_subdev_format *format); | 501 | struct v4l2_subdev_format *format); |
504 | int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 502 | int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
505 | struct v4l2_subdev_format *format); | 503 | struct v4l2_subdev_format *format); |
506 | int (*set_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
507 | struct v4l2_subdev_crop *crop); | ||
508 | int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
509 | struct v4l2_subdev_crop *crop); | ||
510 | int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 504 | int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
511 | struct v4l2_subdev_selection *sel); | 505 | struct v4l2_subdev_selection *sel); |
512 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 506 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index fb6fd4d8f4ed..d8b27854e3bf 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
@@ -84,16 +84,8 @@ struct videobuf_dma_sg_memory { | |||
84 | * Despite the name, this is totally unrelated to videobuf, except that | 84 | * Despite the name, this is totally unrelated to videobuf, except that |
85 | * videobuf-dma-sg uses the same API internally. | 85 | * videobuf-dma-sg uses the same API internally. |
86 | */ | 86 | */ |
87 | void videobuf_dma_init(struct videobuf_dmabuf *dma); | ||
88 | int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, | ||
89 | unsigned long data, unsigned long size); | ||
90 | int videobuf_dma_init_kernel(struct videobuf_dmabuf *dma, int direction, | ||
91 | int nr_pages); | ||
92 | int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, | ||
93 | dma_addr_t addr, int nr_pages); | ||
94 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | 87 | int videobuf_dma_free(struct videobuf_dmabuf *dma); |
95 | 88 | ||
96 | int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma); | ||
97 | int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); | 89 | int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); |
98 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | 90 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); |
99 | 91 | ||
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h index d63965a1faaf..c3bfa473c3aa 100644 --- a/include/media/videobuf-dvb.h +++ b/include/media/videobuf-dvb.h | |||
@@ -56,9 +56,3 @@ struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_fro | |||
56 | int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); | 56 | int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); |
57 | 57 | ||
58 | #endif /* _VIDEOBUF_DVB_H_ */ | 58 | #endif /* _VIDEOBUF_DVB_H_ */ |
59 | |||
60 | /* | ||
61 | * Local variables: | ||
62 | * c-basic-offset: 8 | ||
63 | * End: | ||
64 | */ | ||
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index d13573bb879e..80456f72d70a 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -62,6 +62,9 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg); | |||
62 | 62 | ||
63 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, | 63 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, |
64 | const struct net_device *dev, int strict); | 64 | const struct net_device *dev, int strict); |
65 | int ipv6_chk_addr_and_flags(struct net *net, const struct in6_addr *addr, | ||
66 | const struct net_device *dev, int strict, | ||
67 | u32 banned_flags); | ||
65 | 68 | ||
66 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 69 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
67 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr); | 70 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr); |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 58695ffeb138..e00455aab18c 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -273,7 +273,7 @@ struct l2cap_ctrl { | |||
273 | 273 | ||
274 | struct hci_dev; | 274 | struct hci_dev; |
275 | 275 | ||
276 | typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status); | 276 | typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); |
277 | 277 | ||
278 | struct hci_req_ctrl { | 278 | struct hci_req_ctrl { |
279 | bool start; | 279 | bool start; |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 40129b3838b2..8e54f825153c 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -102,6 +102,28 @@ enum { | |||
102 | */ | 102 | */ |
103 | HCI_QUIRK_FIXUP_BUFFER_SIZE, | 103 | HCI_QUIRK_FIXUP_BUFFER_SIZE, |
104 | 104 | ||
105 | /* When this quirk is set, then a controller that does not | ||
106 | * indicate support for Inquiry Result with RSSI is assumed to | ||
107 | * support it anyway. Some early Bluetooth 1.2 controllers had | ||
108 | * wrongly configured local features that will require forcing | ||
109 | * them to enable this mode. Getting RSSI information with the | ||
110 | * inquiry responses is preferred since it allows for a better | ||
111 | * user expierence. | ||
112 | * | ||
113 | * This quirk must be set before hci_register_dev is called. | ||
114 | */ | ||
115 | HCI_QUIRK_FIXUP_INQUIRY_MODE, | ||
116 | |||
117 | /* When this quirk is set, then the HCI Read Local Supported | ||
118 | * Commands command is not supported. In general Bluetooth 1.2 | ||
119 | * and later controllers should support this command. However | ||
120 | * some controllers indicate Bluetooth 1.2 support, but do | ||
121 | * not support this command. | ||
122 | * | ||
123 | * This quirk must be set before hci_register_dev is called. | ||
124 | */ | ||
125 | HCI_QUIRK_BROKEN_LOCAL_COMMANDS, | ||
126 | |||
105 | /* When this quirk is set, then no stored link key handling | 127 | /* When this quirk is set, then no stored link key handling |
106 | * is performed. This is mainly due to the fact that the | 128 | * is performed. This is mainly due to the fact that the |
107 | * HCI Delete Stored Link Key command is advertised, but | 129 | * HCI Delete Stored Link Key command is advertised, but |
@@ -162,8 +184,7 @@ enum { | |||
162 | */ | 184 | */ |
163 | enum { | 185 | enum { |
164 | HCI_DUT_MODE, | 186 | HCI_DUT_MODE, |
165 | HCI_FORCE_SC, | 187 | HCI_FORCE_BREDR_SMP, |
166 | HCI_FORCE_LESC, | ||
167 | HCI_FORCE_STATIC_ADDR, | 188 | HCI_FORCE_STATIC_ADDR, |
168 | }; | 189 | }; |
169 | 190 | ||
@@ -343,6 +364,7 @@ enum { | |||
343 | #define HCI_LE_ENCRYPTION 0x01 | 364 | #define HCI_LE_ENCRYPTION 0x01 |
344 | #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 | 365 | #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 |
345 | #define HCI_LE_PING 0x10 | 366 | #define HCI_LE_PING 0x10 |
367 | #define HCI_LE_DATA_LEN_EXT 0x20 | ||
346 | #define HCI_LE_EXT_SCAN_POLICY 0x80 | 368 | #define HCI_LE_EXT_SCAN_POLICY 0x80 |
347 | 369 | ||
348 | /* Connection modes */ | 370 | /* Connection modes */ |
@@ -833,11 +855,26 @@ struct hci_cp_set_event_flt { | |||
833 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 | 855 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 |
834 | #define HCI_CONN_SETUP_AUTO_ON 0x02 | 856 | #define HCI_CONN_SETUP_AUTO_ON 0x02 |
835 | 857 | ||
858 | #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d | ||
859 | struct hci_cp_read_stored_link_key { | ||
860 | bdaddr_t bdaddr; | ||
861 | __u8 read_all; | ||
862 | } __packed; | ||
863 | struct hci_rp_read_stored_link_key { | ||
864 | __u8 status; | ||
865 | __u8 max_keys; | ||
866 | __u8 num_keys; | ||
867 | } __packed; | ||
868 | |||
836 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 | 869 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 |
837 | struct hci_cp_delete_stored_link_key { | 870 | struct hci_cp_delete_stored_link_key { |
838 | bdaddr_t bdaddr; | 871 | bdaddr_t bdaddr; |
839 | __u8 delete_all; | 872 | __u8 delete_all; |
840 | } __packed; | 873 | } __packed; |
874 | struct hci_rp_delete_stored_link_key { | ||
875 | __u8 status; | ||
876 | __u8 num_keys; | ||
877 | } __packed; | ||
841 | 878 | ||
842 | #define HCI_MAX_NAME_LENGTH 248 | 879 | #define HCI_MAX_NAME_LENGTH 248 |
843 | 880 | ||
@@ -1371,6 +1408,39 @@ struct hci_cp_le_conn_param_req_neg_reply { | |||
1371 | __u8 reason; | 1408 | __u8 reason; |
1372 | } __packed; | 1409 | } __packed; |
1373 | 1410 | ||
1411 | #define HCI_OP_LE_SET_DATA_LEN 0x2022 | ||
1412 | struct hci_cp_le_set_data_len { | ||
1413 | __le16 handle; | ||
1414 | __le16 tx_len; | ||
1415 | __le16 tx_time; | ||
1416 | } __packed; | ||
1417 | struct hci_rp_le_set_data_len { | ||
1418 | __u8 status; | ||
1419 | __le16 handle; | ||
1420 | } __packed; | ||
1421 | |||
1422 | #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 | ||
1423 | struct hci_rp_le_read_def_data_len { | ||
1424 | __u8 status; | ||
1425 | __le16 tx_len; | ||
1426 | __le16 tx_time; | ||
1427 | } __packed; | ||
1428 | |||
1429 | #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 | ||
1430 | struct hci_cp_le_write_def_data_len { | ||
1431 | __le16 tx_len; | ||
1432 | __le16 tx_time; | ||
1433 | } __packed; | ||
1434 | |||
1435 | #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f | ||
1436 | struct hci_rp_le_read_max_data_len { | ||
1437 | __u8 status; | ||
1438 | __le16 tx_len; | ||
1439 | __le16 tx_time; | ||
1440 | __le16 rx_len; | ||
1441 | __le16 rx_time; | ||
1442 | } __packed; | ||
1443 | |||
1374 | /* ---- HCI Events ---- */ | 1444 | /* ---- HCI Events ---- */ |
1375 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 1445 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
1376 | 1446 | ||
@@ -1796,6 +1866,15 @@ struct hci_ev_le_remote_conn_param_req { | |||
1796 | __le16 timeout; | 1866 | __le16 timeout; |
1797 | } __packed; | 1867 | } __packed; |
1798 | 1868 | ||
1869 | #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 | ||
1870 | struct hci_ev_le_data_len_change { | ||
1871 | __le16 handle; | ||
1872 | __le16 tx_len; | ||
1873 | __le16 tx_time; | ||
1874 | __le16 rx_len; | ||
1875 | __le16 rx_time; | ||
1876 | } __packed; | ||
1877 | |||
1799 | #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B | 1878 | #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B |
1800 | struct hci_ev_le_direct_adv_info { | 1879 | struct hci_ev_le_direct_adv_info { |
1801 | __u8 evt_type; | 1880 | __u8 evt_type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 3c7827005c25..52863c3e0b13 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -79,6 +79,8 @@ struct discovery_state { | |||
79 | s8 rssi; | 79 | s8 rssi; |
80 | u16 uuid_count; | 80 | u16 uuid_count; |
81 | u8 (*uuids)[16]; | 81 | u8 (*uuids)[16]; |
82 | unsigned long scan_start; | ||
83 | unsigned long scan_duration; | ||
82 | }; | 84 | }; |
83 | 85 | ||
84 | struct hci_conn_hash { | 86 | struct hci_conn_hash { |
@@ -145,6 +147,7 @@ struct oob_data { | |||
145 | struct list_head list; | 147 | struct list_head list; |
146 | bdaddr_t bdaddr; | 148 | bdaddr_t bdaddr; |
147 | u8 bdaddr_type; | 149 | u8 bdaddr_type; |
150 | u8 present; | ||
148 | u8 hash192[16]; | 151 | u8 hash192[16]; |
149 | u8 rand192[16]; | 152 | u8 rand192[16]; |
150 | u8 hash256[16]; | 153 | u8 hash256[16]; |
@@ -205,6 +208,8 @@ struct hci_dev { | |||
205 | __u16 lmp_subver; | 208 | __u16 lmp_subver; |
206 | __u16 voice_setting; | 209 | __u16 voice_setting; |
207 | __u8 num_iac; | 210 | __u8 num_iac; |
211 | __u8 stored_max_keys; | ||
212 | __u8 stored_num_keys; | ||
208 | __u8 io_capability; | 213 | __u8 io_capability; |
209 | __s8 inq_tx_power; | 214 | __s8 inq_tx_power; |
210 | __u16 page_scan_interval; | 215 | __u16 page_scan_interval; |
@@ -220,10 +225,17 @@ struct hci_dev { | |||
220 | __u16 le_conn_max_interval; | 225 | __u16 le_conn_max_interval; |
221 | __u16 le_conn_latency; | 226 | __u16 le_conn_latency; |
222 | __u16 le_supv_timeout; | 227 | __u16 le_supv_timeout; |
228 | __u16 le_def_tx_len; | ||
229 | __u16 le_def_tx_time; | ||
230 | __u16 le_max_tx_len; | ||
231 | __u16 le_max_tx_time; | ||
232 | __u16 le_max_rx_len; | ||
233 | __u16 le_max_rx_time; | ||
223 | __u16 discov_interleaved_timeout; | 234 | __u16 discov_interleaved_timeout; |
224 | __u16 conn_info_min_age; | 235 | __u16 conn_info_min_age; |
225 | __u16 conn_info_max_age; | 236 | __u16 conn_info_max_age; |
226 | __u8 ssp_debug_mode; | 237 | __u8 ssp_debug_mode; |
238 | __u8 hw_error_code; | ||
227 | __u32 clock; | 239 | __u32 clock; |
228 | 240 | ||
229 | __u16 devid_source; | 241 | __u16 devid_source; |
@@ -285,6 +297,7 @@ struct hci_dev { | |||
285 | 297 | ||
286 | struct work_struct power_on; | 298 | struct work_struct power_on; |
287 | struct delayed_work power_off; | 299 | struct delayed_work power_off; |
300 | struct work_struct error_reset; | ||
288 | 301 | ||
289 | __u16 discov_timeout; | 302 | __u16 discov_timeout; |
290 | struct delayed_work discov_off; | 303 | struct delayed_work discov_off; |
@@ -343,6 +356,7 @@ struct hci_dev { | |||
343 | unsigned long dev_flags; | 356 | unsigned long dev_flags; |
344 | 357 | ||
345 | struct delayed_work le_scan_disable; | 358 | struct delayed_work le_scan_disable; |
359 | struct delayed_work le_scan_restart; | ||
346 | 360 | ||
347 | __s8 adv_tx_power; | 361 | __s8 adv_tx_power; |
348 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | 362 | __u8 adv_data[HCI_MAX_AD_LENGTH]; |
@@ -361,6 +375,7 @@ struct hci_dev { | |||
361 | int (*setup)(struct hci_dev *hdev); | 375 | int (*setup)(struct hci_dev *hdev); |
362 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); | 376 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); |
363 | void (*notify)(struct hci_dev *hdev, unsigned int evt); | 377 | void (*notify)(struct hci_dev *hdev, unsigned int evt); |
378 | void (*hw_error)(struct hci_dev *hdev, u8 code); | ||
364 | int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); | 379 | int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); |
365 | }; | 380 | }; |
366 | 381 | ||
@@ -434,6 +449,7 @@ struct hci_conn { | |||
434 | struct delayed_work le_conn_timeout; | 449 | struct delayed_work le_conn_timeout; |
435 | 450 | ||
436 | struct device dev; | 451 | struct device dev; |
452 | struct dentry *debugfs; | ||
437 | 453 | ||
438 | struct hci_dev *hdev; | 454 | struct hci_dev *hdev; |
439 | void *l2cap_data; | 455 | void *l2cap_data; |
@@ -518,6 +534,8 @@ static inline void hci_discovery_filter_clear(struct hci_dev *hdev) | |||
518 | hdev->discovery.uuid_count = 0; | 534 | hdev->discovery.uuid_count = 0; |
519 | kfree(hdev->discovery.uuids); | 535 | kfree(hdev->discovery.uuids); |
520 | hdev->discovery.uuids = NULL; | 536 | hdev->discovery.uuids = NULL; |
537 | hdev->discovery.scan_start = 0; | ||
538 | hdev->discovery.scan_duration = 0; | ||
521 | } | 539 | } |
522 | 540 | ||
523 | bool hci_discovery_active(struct hci_dev *hdev); | 541 | bool hci_discovery_active(struct hci_dev *hdev); |
@@ -772,7 +790,6 @@ int hci_conn_check_link_mode(struct hci_conn *conn); | |||
772 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); | 790 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); |
773 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type, | 791 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type, |
774 | bool initiator); | 792 | bool initiator); |
775 | int hci_conn_change_link_key(struct hci_conn *conn); | ||
776 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); | 793 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); |
777 | 794 | ||
778 | void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); | 795 | void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); |
@@ -920,8 +937,6 @@ struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, | |||
920 | bdaddr_t *addr, u8 addr_type); | 937 | bdaddr_t *addr, u8 addr_type); |
921 | struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, | 938 | struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, |
922 | bdaddr_t *addr, u8 addr_type); | 939 | bdaddr_t *addr, u8 addr_type); |
923 | int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, | ||
924 | u8 auto_connect); | ||
925 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); | 940 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); |
926 | void hci_conn_params_clear_all(struct hci_dev *hdev); | 941 | void hci_conn_params_clear_all(struct hci_dev *hdev); |
927 | void hci_conn_params_clear_disabled(struct hci_dev *hdev); | 942 | void hci_conn_params_clear_disabled(struct hci_dev *hdev); |
@@ -930,8 +945,6 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, | |||
930 | bdaddr_t *addr, | 945 | bdaddr_t *addr, |
931 | u8 addr_type); | 946 | u8 addr_type); |
932 | 947 | ||
933 | void hci_update_background_scan(struct hci_dev *hdev); | ||
934 | |||
935 | void hci_uuids_clear(struct hci_dev *hdev); | 948 | void hci_uuids_clear(struct hci_dev *hdev); |
936 | 949 | ||
937 | void hci_link_keys_clear(struct hci_dev *hdev); | 950 | void hci_link_keys_clear(struct hci_dev *hdev); |
@@ -1014,8 +1027,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
1014 | 1027 | ||
1015 | #define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ | 1028 | #define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ |
1016 | !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) | 1029 | !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) |
1017 | #define bredr_sc_enabled(dev) ((lmp_sc_capable(dev) || \ | 1030 | #define bredr_sc_enabled(dev) (lmp_sc_capable(dev) && \ |
1018 | test_bit(HCI_FORCE_SC, &(dev)->dbg_flags)) && \ | ||
1019 | test_bit(HCI_SC_ENABLED, &(dev)->dev_flags)) | 1031 | test_bit(HCI_SC_ENABLED, &(dev)->dev_flags)) |
1020 | 1032 | ||
1021 | /* ----- HCI protocols ----- */ | 1033 | /* ----- HCI protocols ----- */ |
@@ -1284,30 +1296,8 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency, | |||
1284 | int hci_register_cb(struct hci_cb *hcb); | 1296 | int hci_register_cb(struct hci_cb *hcb); |
1285 | int hci_unregister_cb(struct hci_cb *hcb); | 1297 | int hci_unregister_cb(struct hci_cb *hcb); |
1286 | 1298 | ||
1287 | struct hci_request { | ||
1288 | struct hci_dev *hdev; | ||
1289 | struct sk_buff_head cmd_q; | ||
1290 | |||
1291 | /* If something goes wrong when building the HCI request, the error | ||
1292 | * value is stored in this field. | ||
1293 | */ | ||
1294 | int err; | ||
1295 | }; | ||
1296 | |||
1297 | void hci_req_init(struct hci_request *req, struct hci_dev *hdev); | ||
1298 | int hci_req_run(struct hci_request *req, hci_req_complete_t complete); | ||
1299 | void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, | ||
1300 | const void *param); | ||
1301 | void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, | ||
1302 | const void *param, u8 event); | ||
1303 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); | ||
1304 | bool hci_req_pending(struct hci_dev *hdev); | 1299 | bool hci_req_pending(struct hci_dev *hdev); |
1305 | 1300 | ||
1306 | void hci_req_add_le_scan_disable(struct hci_request *req); | ||
1307 | void hci_req_add_le_passive_scan(struct hci_request *req); | ||
1308 | |||
1309 | void hci_update_page_scan(struct hci_dev *hdev, struct hci_request *req); | ||
1310 | |||
1311 | struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, | 1301 | struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, |
1312 | const void *param, u32 timeout); | 1302 | const void *param, u32 timeout); |
1313 | struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, | 1303 | struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, |
@@ -1344,6 +1334,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event); | |||
1344 | #define DISCOV_INTERLEAVED_TIMEOUT 5120 /* msec */ | 1334 | #define DISCOV_INTERLEAVED_TIMEOUT 5120 /* msec */ |
1345 | #define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 | 1335 | #define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 |
1346 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 | 1336 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 |
1337 | #define DISCOV_LE_RESTART_DELAY msecs_to_jiffies(200) /* msec */ | ||
1347 | 1338 | ||
1348 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | 1339 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); |
1349 | int mgmt_new_settings(struct hci_dev *hdev); | 1340 | int mgmt_new_settings(struct hci_dev *hdev); |
@@ -1388,7 +1379,6 @@ int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
1388 | void mgmt_auth_failed(struct hci_conn *conn, u8 status); | 1379 | void mgmt_auth_failed(struct hci_conn *conn, u8 status); |
1389 | void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); | 1380 | void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); |
1390 | void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); | 1381 | void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); |
1391 | void mgmt_sc_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); | ||
1392 | void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, | 1382 | void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, |
1393 | u8 status); | 1383 | u8 status); |
1394 | void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); | 1384 | void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); |
@@ -1417,8 +1407,6 @@ u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency, | |||
1417 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, | 1407 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, |
1418 | __u8 ltk[16]); | 1408 | __u8 ltk[16]); |
1419 | 1409 | ||
1420 | int hci_update_random_address(struct hci_request *req, bool require_privacy, | ||
1421 | u8 *own_addr_type); | ||
1422 | void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1410 | void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1423 | u8 *bdaddr_type); | 1411 | u8 *bdaddr_type); |
1424 | 1412 | ||
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index d1bb342d083f..2239a3753092 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -248,6 +248,7 @@ struct l2cap_conn_rsp { | |||
248 | #define L2CAP_PSM_SDP 0x0001 | 248 | #define L2CAP_PSM_SDP 0x0001 |
249 | #define L2CAP_PSM_RFCOMM 0x0003 | 249 | #define L2CAP_PSM_RFCOMM 0x0003 |
250 | #define L2CAP_PSM_3DSP 0x0021 | 250 | #define L2CAP_PSM_3DSP 0x0021 |
251 | #define L2CAP_PSM_IPSP 0x0023 /* 6LoWPAN */ | ||
251 | 252 | ||
252 | /* channel identifier */ | 253 | /* channel identifier */ |
253 | #define L2CAP_CID_SIGNALING 0x0001 | 254 | #define L2CAP_CID_SIGNALING 0x0001 |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 95c34d5180fa..e218a30f2061 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -301,10 +301,6 @@ struct mgmt_cp_user_passkey_neg_reply { | |||
301 | #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020 | 301 | #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020 |
302 | #define MGMT_READ_LOCAL_OOB_DATA_SIZE 0 | 302 | #define MGMT_READ_LOCAL_OOB_DATA_SIZE 0 |
303 | struct mgmt_rp_read_local_oob_data { | 303 | struct mgmt_rp_read_local_oob_data { |
304 | __u8 hash[16]; | ||
305 | __u8 rand[16]; | ||
306 | } __packed; | ||
307 | struct mgmt_rp_read_local_oob_ext_data { | ||
308 | __u8 hash192[16]; | 304 | __u8 hash192[16]; |
309 | __u8 rand192[16]; | 305 | __u8 rand192[16]; |
310 | __u8 hash256[16]; | 306 | __u8 hash256[16]; |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 578b83127af1..4190af53a46a 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -24,8 +24,6 @@ | |||
24 | #ifndef __RFCOMM_H | 24 | #ifndef __RFCOMM_H |
25 | #define __RFCOMM_H | 25 | #define __RFCOMM_H |
26 | 26 | ||
27 | #define RFCOMM_PSM 3 | ||
28 | |||
29 | #define RFCOMM_CONN_TIMEOUT (HZ * 30) | 27 | #define RFCOMM_CONN_TIMEOUT (HZ * 30) |
30 | #define RFCOMM_DISC_TIMEOUT (HZ * 20) | 28 | #define RFCOMM_DISC_TIMEOUT (HZ * 20) |
31 | #define RFCOMM_AUTH_TIMEOUT (HZ * 25) | 29 | #define RFCOMM_AUTH_TIMEOUT (HZ * 25) |
diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h index e01d903633ef..f04cdbb7848e 100644 --- a/include/net/bond_3ad.h +++ b/include/net/bond_3ad.h | |||
@@ -274,7 +274,6 @@ void bond_3ad_handle_link_change(struct slave *slave, char link); | |||
274 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); | 274 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); |
275 | int __bond_3ad_get_active_agg_info(struct bonding *bond, | 275 | int __bond_3ad_get_active_agg_info(struct bonding *bond, |
276 | struct ad_info *ad_info); | 276 | struct ad_info *ad_info); |
277 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); | ||
278 | int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, | 277 | int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, |
279 | struct slave *slave); | 278 | struct slave *slave); |
280 | int bond_3ad_set_carrier(struct bonding *bond); | 279 | int bond_3ad_set_carrier(struct bonding *bond); |
diff --git a/include/net/bonding.h b/include/net/bonding.h index 983a94b86b95..fda6feeb6c1f 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h | |||
@@ -150,6 +150,12 @@ struct bond_parm_tbl { | |||
150 | int mode; | 150 | int mode; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | struct netdev_notify_work { | ||
154 | struct delayed_work work; | ||
155 | struct net_device *dev; | ||
156 | struct netdev_bonding_info bonding_info; | ||
157 | }; | ||
158 | |||
153 | struct slave { | 159 | struct slave { |
154 | struct net_device *dev; /* first - useful for panic debug */ | 160 | struct net_device *dev; /* first - useful for panic debug */ |
155 | struct bonding *bond; /* our master */ | 161 | struct bonding *bond; /* our master */ |
@@ -243,6 +249,8 @@ struct bonding { | |||
243 | #define bond_slave_get_rtnl(dev) \ | 249 | #define bond_slave_get_rtnl(dev) \ |
244 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) | 250 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) |
245 | 251 | ||
252 | void bond_queue_slave_event(struct slave *slave); | ||
253 | |||
246 | struct bond_vlan_tag { | 254 | struct bond_vlan_tag { |
247 | __be16 vlan_proto; | 255 | __be16 vlan_proto; |
248 | unsigned short vlan_id; | 256 | unsigned short vlan_id; |
@@ -315,6 +323,7 @@ static inline void bond_set_active_slave(struct slave *slave) | |||
315 | { | 323 | { |
316 | if (slave->backup) { | 324 | if (slave->backup) { |
317 | slave->backup = 0; | 325 | slave->backup = 0; |
326 | bond_queue_slave_event(slave); | ||
318 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 327 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
319 | } | 328 | } |
320 | } | 329 | } |
@@ -323,6 +332,7 @@ static inline void bond_set_backup_slave(struct slave *slave) | |||
323 | { | 332 | { |
324 | if (!slave->backup) { | 333 | if (!slave->backup) { |
325 | slave->backup = 1; | 334 | slave->backup = 1; |
335 | bond_queue_slave_event(slave); | ||
326 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 336 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
327 | } | 337 | } |
328 | } | 338 | } |
@@ -336,6 +346,7 @@ static inline void bond_set_slave_state(struct slave *slave, | |||
336 | slave->backup = slave_state; | 346 | slave->backup = slave_state; |
337 | if (notify) { | 347 | if (notify) { |
338 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 348 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
349 | bond_queue_slave_event(slave); | ||
339 | slave->should_notify = 0; | 350 | slave->should_notify = 0; |
340 | } else { | 351 | } else { |
341 | if (slave->should_notify) | 352 | if (slave->should_notify) |
@@ -490,6 +501,12 @@ static inline bool bond_is_slave_inactive(struct slave *slave) | |||
490 | return slave->inactive; | 501 | return slave->inactive; |
491 | } | 502 | } |
492 | 503 | ||
504 | static inline void bond_set_slave_link_state(struct slave *slave, int state) | ||
505 | { | ||
506 | slave->link = state; | ||
507 | bond_queue_slave_event(slave); | ||
508 | } | ||
509 | |||
493 | static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) | 510 | static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) |
494 | { | 511 | { |
495 | struct in_device *in_dev; | 512 | struct in_device *in_dev; |
@@ -525,6 +542,7 @@ void bond_sysfs_slave_del(struct slave *slave); | |||
525 | int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); | 542 | int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); |
526 | int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); | 543 | int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); |
527 | u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb); | 544 | u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb); |
545 | int bond_set_carrier(struct bonding *bond); | ||
528 | void bond_select_active_slave(struct bonding *bond); | 546 | void bond_select_active_slave(struct bonding *bond); |
529 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); | 547 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); |
530 | void bond_create_debugfs(void); | 548 | void bond_create_debugfs(void); |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 4ebb816241fa..64e09e1e8099 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -520,37 +520,41 @@ ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef) | |||
520 | * | 520 | * |
521 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 521 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
522 | * @SURVEY_INFO_IN_USE: channel is currently being used | 522 | * @SURVEY_INFO_IN_USE: channel is currently being used |
523 | * @SURVEY_INFO_CHANNEL_TIME: channel active time (in ms) was filled in | 523 | * @SURVEY_INFO_TIME: active time (in ms) was filled in |
524 | * @SURVEY_INFO_CHANNEL_TIME_BUSY: channel busy time was filled in | 524 | * @SURVEY_INFO_TIME_BUSY: busy time was filled in |
525 | * @SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: extension channel busy time was filled in | 525 | * @SURVEY_INFO_TIME_EXT_BUSY: extension channel busy time was filled in |
526 | * @SURVEY_INFO_CHANNEL_TIME_RX: channel receive time was filled in | 526 | * @SURVEY_INFO_TIME_RX: receive time was filled in |
527 | * @SURVEY_INFO_CHANNEL_TIME_TX: channel transmit time was filled in | 527 | * @SURVEY_INFO_TIME_TX: transmit time was filled in |
528 | * @SURVEY_INFO_TIME_SCAN: scan time was filled in | ||
528 | * | 529 | * |
529 | * Used by the driver to indicate which info in &struct survey_info | 530 | * Used by the driver to indicate which info in &struct survey_info |
530 | * it has filled in during the get_survey(). | 531 | * it has filled in during the get_survey(). |
531 | */ | 532 | */ |
532 | enum survey_info_flags { | 533 | enum survey_info_flags { |
533 | SURVEY_INFO_NOISE_DBM = 1<<0, | 534 | SURVEY_INFO_NOISE_DBM = BIT(0), |
534 | SURVEY_INFO_IN_USE = 1<<1, | 535 | SURVEY_INFO_IN_USE = BIT(1), |
535 | SURVEY_INFO_CHANNEL_TIME = 1<<2, | 536 | SURVEY_INFO_TIME = BIT(2), |
536 | SURVEY_INFO_CHANNEL_TIME_BUSY = 1<<3, | 537 | SURVEY_INFO_TIME_BUSY = BIT(3), |
537 | SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 1<<4, | 538 | SURVEY_INFO_TIME_EXT_BUSY = BIT(4), |
538 | SURVEY_INFO_CHANNEL_TIME_RX = 1<<5, | 539 | SURVEY_INFO_TIME_RX = BIT(5), |
539 | SURVEY_INFO_CHANNEL_TIME_TX = 1<<6, | 540 | SURVEY_INFO_TIME_TX = BIT(6), |
541 | SURVEY_INFO_TIME_SCAN = BIT(7), | ||
540 | }; | 542 | }; |
541 | 543 | ||
542 | /** | 544 | /** |
543 | * struct survey_info - channel survey response | 545 | * struct survey_info - channel survey response |
544 | * | 546 | * |
545 | * @channel: the channel this survey record reports, mandatory | 547 | * @channel: the channel this survey record reports, may be %NULL for a single |
548 | * record to report global statistics | ||
546 | * @filled: bitflag of flags from &enum survey_info_flags | 549 | * @filled: bitflag of flags from &enum survey_info_flags |
547 | * @noise: channel noise in dBm. This and all following fields are | 550 | * @noise: channel noise in dBm. This and all following fields are |
548 | * optional | 551 | * optional |
549 | * @channel_time: amount of time in ms the radio spent on the channel | 552 | * @time: amount of time in ms the radio was turn on (on the channel) |
550 | * @channel_time_busy: amount of time the primary channel was sensed busy | 553 | * @time_busy: amount of time the primary channel was sensed busy |
551 | * @channel_time_ext_busy: amount of time the extension channel was sensed busy | 554 | * @time_ext_busy: amount of time the extension channel was sensed busy |
552 | * @channel_time_rx: amount of time the radio spent receiving data | 555 | * @time_rx: amount of time the radio spent receiving data |
553 | * @channel_time_tx: amount of time the radio spent transmitting data | 556 | * @time_tx: amount of time the radio spent transmitting data |
557 | * @time_scan: amount of time the radio spent for scanning | ||
554 | * | 558 | * |
555 | * Used by dump_survey() to report back per-channel survey information. | 559 | * Used by dump_survey() to report back per-channel survey information. |
556 | * | 560 | * |
@@ -559,11 +563,12 @@ enum survey_info_flags { | |||
559 | */ | 563 | */ |
560 | struct survey_info { | 564 | struct survey_info { |
561 | struct ieee80211_channel *channel; | 565 | struct ieee80211_channel *channel; |
562 | u64 channel_time; | 566 | u64 time; |
563 | u64 channel_time_busy; | 567 | u64 time_busy; |
564 | u64 channel_time_ext_busy; | 568 | u64 time_ext_busy; |
565 | u64 channel_time_rx; | 569 | u64 time_rx; |
566 | u64 channel_time_tx; | 570 | u64 time_tx; |
571 | u64 time_scan; | ||
567 | u32 filled; | 572 | u32 filled; |
568 | s8 noise; | 573 | s8 noise; |
569 | }; | 574 | }; |
@@ -861,75 +866,6 @@ int cfg80211_check_station_change(struct wiphy *wiphy, | |||
861 | enum cfg80211_station_type statype); | 866 | enum cfg80211_station_type statype); |
862 | 867 | ||
863 | /** | 868 | /** |
864 | * enum station_info_flags - station information flags | ||
865 | * | ||
866 | * Used by the driver to indicate which info in &struct station_info | ||
867 | * it has filled in during get_station() or dump_station(). | ||
868 | * | ||
869 | * @STATION_INFO_INACTIVE_TIME: @inactive_time filled | ||
870 | * @STATION_INFO_RX_BYTES: @rx_bytes filled | ||
871 | * @STATION_INFO_TX_BYTES: @tx_bytes filled | ||
872 | * @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value | ||
873 | * @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value | ||
874 | * @STATION_INFO_LLID: @llid filled | ||
875 | * @STATION_INFO_PLID: @plid filled | ||
876 | * @STATION_INFO_PLINK_STATE: @plink_state filled | ||
877 | * @STATION_INFO_SIGNAL: @signal filled | ||
878 | * @STATION_INFO_TX_BITRATE: @txrate fields are filled | ||
879 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) | ||
880 | * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value | ||
881 | * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value | ||
882 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | ||
883 | * @STATION_INFO_TX_FAILED: @tx_failed filled | ||
884 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | ||
885 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled | ||
886 | * @STATION_INFO_RX_BITRATE: @rxrate fields are filled | ||
887 | * @STATION_INFO_BSS_PARAM: @bss_param filled | ||
888 | * @STATION_INFO_CONNECTED_TIME: @connected_time filled | ||
889 | * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled | ||
890 | * @STATION_INFO_STA_FLAGS: @sta_flags filled | ||
891 | * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled | ||
892 | * @STATION_INFO_T_OFFSET: @t_offset filled | ||
893 | * @STATION_INFO_LOCAL_PM: @local_pm filled | ||
894 | * @STATION_INFO_PEER_PM: @peer_pm filled | ||
895 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled | ||
896 | * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled | ||
897 | * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled | ||
898 | * @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled | ||
899 | */ | ||
900 | enum station_info_flags { | ||
901 | STATION_INFO_INACTIVE_TIME = BIT(0), | ||
902 | STATION_INFO_RX_BYTES = BIT(1), | ||
903 | STATION_INFO_TX_BYTES = BIT(2), | ||
904 | STATION_INFO_LLID = BIT(3), | ||
905 | STATION_INFO_PLID = BIT(4), | ||
906 | STATION_INFO_PLINK_STATE = BIT(5), | ||
907 | STATION_INFO_SIGNAL = BIT(6), | ||
908 | STATION_INFO_TX_BITRATE = BIT(7), | ||
909 | STATION_INFO_RX_PACKETS = BIT(8), | ||
910 | STATION_INFO_TX_PACKETS = BIT(9), | ||
911 | STATION_INFO_TX_RETRIES = BIT(10), | ||
912 | STATION_INFO_TX_FAILED = BIT(11), | ||
913 | STATION_INFO_RX_DROP_MISC = BIT(12), | ||
914 | STATION_INFO_SIGNAL_AVG = BIT(13), | ||
915 | STATION_INFO_RX_BITRATE = BIT(14), | ||
916 | STATION_INFO_BSS_PARAM = BIT(15), | ||
917 | STATION_INFO_CONNECTED_TIME = BIT(16), | ||
918 | STATION_INFO_ASSOC_REQ_IES = BIT(17), | ||
919 | STATION_INFO_STA_FLAGS = BIT(18), | ||
920 | STATION_INFO_BEACON_LOSS_COUNT = BIT(19), | ||
921 | STATION_INFO_T_OFFSET = BIT(20), | ||
922 | STATION_INFO_LOCAL_PM = BIT(21), | ||
923 | STATION_INFO_PEER_PM = BIT(22), | ||
924 | STATION_INFO_NONPEER_PM = BIT(23), | ||
925 | STATION_INFO_RX_BYTES64 = BIT(24), | ||
926 | STATION_INFO_TX_BYTES64 = BIT(25), | ||
927 | STATION_INFO_CHAIN_SIGNAL = BIT(26), | ||
928 | STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27), | ||
929 | STATION_INFO_EXPECTED_THROUGHPUT = BIT(28), | ||
930 | }; | ||
931 | |||
932 | /** | ||
933 | * enum station_info_rate_flags - bitrate info flags | 869 | * enum station_info_rate_flags - bitrate info flags |
934 | * | 870 | * |
935 | * Used by the driver to indicate the specific rate transmission | 871 | * Used by the driver to indicate the specific rate transmission |
@@ -937,22 +873,35 @@ enum station_info_flags { | |||
937 | * | 873 | * |
938 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS | 874 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
939 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS | 875 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS |
940 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission | ||
941 | * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission | ||
942 | * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission | ||
943 | * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission | ||
944 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 876 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
945 | * @RATE_INFO_FLAGS_60G: 60GHz MCS | 877 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
946 | */ | 878 | */ |
947 | enum rate_info_flags { | 879 | enum rate_info_flags { |
948 | RATE_INFO_FLAGS_MCS = BIT(0), | 880 | RATE_INFO_FLAGS_MCS = BIT(0), |
949 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), | 881 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
950 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), | 882 | RATE_INFO_FLAGS_SHORT_GI = BIT(2), |
951 | RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), | 883 | RATE_INFO_FLAGS_60G = BIT(3), |
952 | RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), | 884 | }; |
953 | RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), | 885 | |
954 | RATE_INFO_FLAGS_SHORT_GI = BIT(6), | 886 | /** |
955 | RATE_INFO_FLAGS_60G = BIT(7), | 887 | * enum rate_info_bw - rate bandwidth information |
888 | * | ||
889 | * Used by the driver to indicate the rate bandwidth. | ||
890 | * | ||
891 | * @RATE_INFO_BW_5: 5 MHz bandwidth | ||
892 | * @RATE_INFO_BW_10: 10 MHz bandwidth | ||
893 | * @RATE_INFO_BW_20: 20 MHz bandwidth | ||
894 | * @RATE_INFO_BW_40: 40 MHz bandwidth | ||
895 | * @RATE_INFO_BW_80: 80 MHz bandwidth | ||
896 | * @RATE_INFO_BW_160: 160 MHz bandwidth | ||
897 | */ | ||
898 | enum rate_info_bw { | ||
899 | RATE_INFO_BW_5, | ||
900 | RATE_INFO_BW_10, | ||
901 | RATE_INFO_BW_20, | ||
902 | RATE_INFO_BW_40, | ||
903 | RATE_INFO_BW_80, | ||
904 | RATE_INFO_BW_160, | ||
956 | }; | 905 | }; |
957 | 906 | ||
958 | /** | 907 | /** |
@@ -964,12 +913,14 @@ enum rate_info_flags { | |||
964 | * @mcs: mcs index if struct describes a 802.11n bitrate | 913 | * @mcs: mcs index if struct describes a 802.11n bitrate |
965 | * @legacy: bitrate in 100kbit/s for 802.11abg | 914 | * @legacy: bitrate in 100kbit/s for 802.11abg |
966 | * @nss: number of streams (VHT only) | 915 | * @nss: number of streams (VHT only) |
916 | * @bw: bandwidth (from &enum rate_info_bw) | ||
967 | */ | 917 | */ |
968 | struct rate_info { | 918 | struct rate_info { |
969 | u8 flags; | 919 | u8 flags; |
970 | u8 mcs; | 920 | u8 mcs; |
971 | u16 legacy; | 921 | u16 legacy; |
972 | u8 nss; | 922 | u8 nss; |
923 | u8 bw; | ||
973 | }; | 924 | }; |
974 | 925 | ||
975 | /** | 926 | /** |
@@ -1003,6 +954,24 @@ struct sta_bss_parameters { | |||
1003 | u16 beacon_interval; | 954 | u16 beacon_interval; |
1004 | }; | 955 | }; |
1005 | 956 | ||
957 | /** | ||
958 | * struct cfg80211_tid_stats - per-TID statistics | ||
959 | * @filled: bitmap of flags using the bits of &enum nl80211_tid_stats to | ||
960 | * indicate the relevant values in this struct are filled | ||
961 | * @rx_msdu: number of received MSDUs | ||
962 | * @tx_msdu: number of (attempted) transmitted MSDUs | ||
963 | * @tx_msdu_retries: number of retries (not counting the first) for | ||
964 | * transmitted MSDUs | ||
965 | * @tx_msdu_failed: number of failed transmitted MSDUs | ||
966 | */ | ||
967 | struct cfg80211_tid_stats { | ||
968 | u32 filled; | ||
969 | u64 rx_msdu; | ||
970 | u64 tx_msdu; | ||
971 | u64 tx_msdu_retries; | ||
972 | u64 tx_msdu_failed; | ||
973 | }; | ||
974 | |||
1006 | #define IEEE80211_MAX_CHAINS 4 | 975 | #define IEEE80211_MAX_CHAINS 4 |
1007 | 976 | ||
1008 | /** | 977 | /** |
@@ -1010,11 +979,12 @@ struct sta_bss_parameters { | |||
1010 | * | 979 | * |
1011 | * Station information filled by driver for get_station() and dump_station. | 980 | * Station information filled by driver for get_station() and dump_station. |
1012 | * | 981 | * |
1013 | * @filled: bitflag of flags from &enum station_info_flags | 982 | * @filled: bitflag of flags using the bits of &enum nl80211_sta_info to |
983 | * indicate the relevant values in this struct for them | ||
1014 | * @connected_time: time(in secs) since a station is last connected | 984 | * @connected_time: time(in secs) since a station is last connected |
1015 | * @inactive_time: time since last station activity (tx/rx) in milliseconds | 985 | * @inactive_time: time since last station activity (tx/rx) in milliseconds |
1016 | * @rx_bytes: bytes received from this station | 986 | * @rx_bytes: bytes (size of MPDUs) received from this station |
1017 | * @tx_bytes: bytes transmitted to this station | 987 | * @tx_bytes: bytes (size of MPDUs) transmitted to this station |
1018 | * @llid: mesh local link id | 988 | * @llid: mesh local link id |
1019 | * @plid: mesh peer link id | 989 | * @plid: mesh peer link id |
1020 | * @plink_state: mesh peer link state | 990 | * @plink_state: mesh peer link state |
@@ -1027,10 +997,10 @@ struct sta_bss_parameters { | |||
1027 | * @chain_signal_avg: per-chain signal strength average in dBm | 997 | * @chain_signal_avg: per-chain signal strength average in dBm |
1028 | * @txrate: current unicast bitrate from this station | 998 | * @txrate: current unicast bitrate from this station |
1029 | * @rxrate: current unicast bitrate to this station | 999 | * @rxrate: current unicast bitrate to this station |
1030 | * @rx_packets: packets received from this station | 1000 | * @rx_packets: packets (MSDUs & MMPDUs) received from this station |
1031 | * @tx_packets: packets transmitted to this station | 1001 | * @tx_packets: packets (MSDUs & MMPDUs) transmitted to this station |
1032 | * @tx_retries: cumulative retry counts | 1002 | * @tx_retries: cumulative retry counts (MPDUs) |
1033 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | 1003 | * @tx_failed: number of failed transmissions (MPDUs) (retries exceeded, no ACK) |
1034 | * @rx_dropped_misc: Dropped for un-specified reason. | 1004 | * @rx_dropped_misc: Dropped for un-specified reason. |
1035 | * @bss_param: current BSS parameters | 1005 | * @bss_param: current BSS parameters |
1036 | * @generation: generation number for nl80211 dumps. | 1006 | * @generation: generation number for nl80211 dumps. |
@@ -1050,6 +1020,11 @@ struct sta_bss_parameters { | |||
1050 | * @nonpeer_pm: non-peer mesh STA power save mode | 1020 | * @nonpeer_pm: non-peer mesh STA power save mode |
1051 | * @expected_throughput: expected throughput in kbps (including 802.11 headers) | 1021 | * @expected_throughput: expected throughput in kbps (including 802.11 headers) |
1052 | * towards this station. | 1022 | * towards this station. |
1023 | * @rx_beacon: number of beacons received from this peer | ||
1024 | * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received | ||
1025 | * from this peer | ||
1026 | * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last | ||
1027 | * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs. | ||
1053 | */ | 1028 | */ |
1054 | struct station_info { | 1029 | struct station_info { |
1055 | u32 filled; | 1030 | u32 filled; |
@@ -1090,10 +1065,9 @@ struct station_info { | |||
1090 | 1065 | ||
1091 | u32 expected_throughput; | 1066 | u32 expected_throughput; |
1092 | 1067 | ||
1093 | /* | 1068 | u64 rx_beacon; |
1094 | * Note: Add a new enum station_info_flags value for each new field and | 1069 | u8 rx_beacon_signal_avg; |
1095 | * use it to check which fields are initialized. | 1070 | struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS + 1]; |
1096 | */ | ||
1097 | }; | 1071 | }; |
1098 | 1072 | ||
1099 | /** | 1073 | /** |
@@ -1516,6 +1490,13 @@ struct cfg80211_match_set { | |||
1516 | * @mac_addr_mask: MAC address mask used with randomisation, bits that | 1490 | * @mac_addr_mask: MAC address mask used with randomisation, bits that |
1517 | * are 0 in the mask should be randomised, bits that are 1 should | 1491 | * are 0 in the mask should be randomised, bits that are 1 should |
1518 | * be taken from the @mac_addr | 1492 | * be taken from the @mac_addr |
1493 | * @rcu_head: RCU callback used to free the struct | ||
1494 | * @owner_nlportid: netlink portid of owner (if this should is a request | ||
1495 | * owned by a particular socket) | ||
1496 | * @delay: delay in seconds to use before starting the first scan | ||
1497 | * cycle. The driver may ignore this parameter and start | ||
1498 | * immediately (or at any other time), if this feature is not | ||
1499 | * supported. | ||
1519 | */ | 1500 | */ |
1520 | struct cfg80211_sched_scan_request { | 1501 | struct cfg80211_sched_scan_request { |
1521 | struct cfg80211_ssid *ssids; | 1502 | struct cfg80211_ssid *ssids; |
@@ -1529,6 +1510,7 @@ struct cfg80211_sched_scan_request { | |||
1529 | struct cfg80211_match_set *match_sets; | 1510 | struct cfg80211_match_set *match_sets; |
1530 | int n_match_sets; | 1511 | int n_match_sets; |
1531 | s32 min_rssi_thold; | 1512 | s32 min_rssi_thold; |
1513 | u32 delay; | ||
1532 | 1514 | ||
1533 | u8 mac_addr[ETH_ALEN] __aligned(2); | 1515 | u8 mac_addr[ETH_ALEN] __aligned(2); |
1534 | u8 mac_addr_mask[ETH_ALEN] __aligned(2); | 1516 | u8 mac_addr_mask[ETH_ALEN] __aligned(2); |
@@ -1537,6 +1519,8 @@ struct cfg80211_sched_scan_request { | |||
1537 | struct wiphy *wiphy; | 1519 | struct wiphy *wiphy; |
1538 | struct net_device *dev; | 1520 | struct net_device *dev; |
1539 | unsigned long scan_start; | 1521 | unsigned long scan_start; |
1522 | struct rcu_head rcu_head; | ||
1523 | u32 owner_nlportid; | ||
1540 | 1524 | ||
1541 | /* keep last */ | 1525 | /* keep last */ |
1542 | struct ieee80211_channel *channels[0]; | 1526 | struct ieee80211_channel *channels[0]; |
@@ -3011,6 +2995,8 @@ struct wiphy_vendor_command { | |||
3011 | * @regulatory_flags: wiphy regulatory flags, see | 2995 | * @regulatory_flags: wiphy regulatory flags, see |
3012 | * &enum ieee80211_regulatory_flags | 2996 | * &enum ieee80211_regulatory_flags |
3013 | * @features: features advertised to nl80211, see &enum nl80211_feature_flags. | 2997 | * @features: features advertised to nl80211, see &enum nl80211_feature_flags. |
2998 | * @ext_features: extended features advertised to nl80211, see | ||
2999 | * &enum nl80211_ext_feature_index. | ||
3014 | * @bss_priv_size: each BSS struct has private data allocated with it, | 3000 | * @bss_priv_size: each BSS struct has private data allocated with it, |
3015 | * this variable determines its size | 3001 | * this variable determines its size |
3016 | * @max_scan_ssids: maximum number of SSIDs the device can scan for in | 3002 | * @max_scan_ssids: maximum number of SSIDs the device can scan for in |
@@ -3120,6 +3106,7 @@ struct wiphy { | |||
3120 | u16 max_acl_mac_addrs; | 3106 | u16 max_acl_mac_addrs; |
3121 | 3107 | ||
3122 | u32 flags, regulatory_flags, features; | 3108 | u32 flags, regulatory_flags, features; |
3109 | u8 ext_features[DIV_ROUND_UP(NUM_NL80211_EXT_FEATURES, 8)]; | ||
3123 | 3110 | ||
3124 | u32 ap_sme_capa; | 3111 | u32 ap_sme_capa; |
3125 | 3112 | ||
@@ -3808,6 +3795,34 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, | |||
3808 | int regulatory_hint(struct wiphy *wiphy, const char *alpha2); | 3795 | int regulatory_hint(struct wiphy *wiphy, const char *alpha2); |
3809 | 3796 | ||
3810 | /** | 3797 | /** |
3798 | * regulatory_set_wiphy_regd - set regdom info for self managed drivers | ||
3799 | * @wiphy: the wireless device we want to process the regulatory domain on | ||
3800 | * @rd: the regulatory domain informatoin to use for this wiphy | ||
3801 | * | ||
3802 | * Set the regulatory domain information for self-managed wiphys, only they | ||
3803 | * may use this function. See %REGULATORY_WIPHY_SELF_MANAGED for more | ||
3804 | * information. | ||
3805 | * | ||
3806 | * Return: 0 on success. -EINVAL, -EPERM | ||
3807 | */ | ||
3808 | int regulatory_set_wiphy_regd(struct wiphy *wiphy, | ||
3809 | struct ieee80211_regdomain *rd); | ||
3810 | |||
3811 | /** | ||
3812 | * regulatory_set_wiphy_regd_sync_rtnl - set regdom for self-managed drivers | ||
3813 | * @wiphy: the wireless device we want to process the regulatory domain on | ||
3814 | * @rd: the regulatory domain information to use for this wiphy | ||
3815 | * | ||
3816 | * This functions requires the RTNL to be held and applies the new regdomain | ||
3817 | * synchronously to this wiphy. For more details see | ||
3818 | * regulatory_set_wiphy_regd(). | ||
3819 | * | ||
3820 | * Return: 0 on success. -EINVAL, -EPERM | ||
3821 | */ | ||
3822 | int regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy, | ||
3823 | struct ieee80211_regdomain *rd); | ||
3824 | |||
3825 | /** | ||
3811 | * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain | 3826 | * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain |
3812 | * @wiphy: the wireless device we want to process the regulatory domain on | 3827 | * @wiphy: the wireless device we want to process the regulatory domain on |
3813 | * @regd: the custom regulatory domain to use for this wiphy | 3828 | * @regd: the custom regulatory domain to use for this wiphy |
@@ -4565,13 +4580,27 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
4565 | struct station_info *sinfo, gfp_t gfp); | 4580 | struct station_info *sinfo, gfp_t gfp); |
4566 | 4581 | ||
4567 | /** | 4582 | /** |
4583 | * cfg80211_del_sta_sinfo - notify userspace about deletion of a station | ||
4584 | * @dev: the netdev | ||
4585 | * @mac_addr: the station's address | ||
4586 | * @sinfo: the station information/statistics | ||
4587 | * @gfp: allocation flags | ||
4588 | */ | ||
4589 | void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr, | ||
4590 | struct station_info *sinfo, gfp_t gfp); | ||
4591 | |||
4592 | /** | ||
4568 | * cfg80211_del_sta - notify userspace about deletion of a station | 4593 | * cfg80211_del_sta - notify userspace about deletion of a station |
4569 | * | 4594 | * |
4570 | * @dev: the netdev | 4595 | * @dev: the netdev |
4571 | * @mac_addr: the station's address | 4596 | * @mac_addr: the station's address |
4572 | * @gfp: allocation flags | 4597 | * @gfp: allocation flags |
4573 | */ | 4598 | */ |
4574 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | 4599 | static inline void cfg80211_del_sta(struct net_device *dev, |
4600 | const u8 *mac_addr, gfp_t gfp) | ||
4601 | { | ||
4602 | cfg80211_del_sta_sinfo(dev, mac_addr, NULL, gfp); | ||
4603 | } | ||
4575 | 4604 | ||
4576 | /** | 4605 | /** |
4577 | * cfg80211_conn_failed - connection request failed notification | 4606 | * cfg80211_conn_failed - connection request failed notification |
@@ -5033,6 +5062,42 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
5033 | */ | 5062 | */ |
5034 | void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); | 5063 | void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); |
5035 | 5064 | ||
5065 | /** | ||
5066 | * wiphy_ext_feature_set - set the extended feature flag | ||
5067 | * | ||
5068 | * @wiphy: the wiphy to modify. | ||
5069 | * @ftidx: extended feature bit index. | ||
5070 | * | ||
5071 | * The extended features are flagged in multiple bytes (see | ||
5072 | * &struct wiphy.@ext_features) | ||
5073 | */ | ||
5074 | static inline void wiphy_ext_feature_set(struct wiphy *wiphy, | ||
5075 | enum nl80211_ext_feature_index ftidx) | ||
5076 | { | ||
5077 | u8 *ft_byte; | ||
5078 | |||
5079 | ft_byte = &wiphy->ext_features[ftidx / 8]; | ||
5080 | *ft_byte |= BIT(ftidx % 8); | ||
5081 | } | ||
5082 | |||
5083 | /** | ||
5084 | * wiphy_ext_feature_isset - check the extended feature flag | ||
5085 | * | ||
5086 | * @wiphy: the wiphy to modify. | ||
5087 | * @ftidx: extended feature bit index. | ||
5088 | * | ||
5089 | * The extended features are flagged in multiple bytes (see | ||
5090 | * &struct wiphy.@ext_features) | ||
5091 | */ | ||
5092 | static inline bool | ||
5093 | wiphy_ext_feature_isset(struct wiphy *wiphy, | ||
5094 | enum nl80211_ext_feature_index ftidx) | ||
5095 | { | ||
5096 | u8 ft_byte; | ||
5097 | |||
5098 | ft_byte = wiphy->ext_features[ftidx / 8]; | ||
5099 | return (ft_byte & BIT(ftidx % 8)) != 0; | ||
5100 | } | ||
5036 | 5101 | ||
5037 | /* ethtool helper */ | 5102 | /* ethtool helper */ |
5038 | void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); | 5103 | void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); |
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h index 7f713acfa106..eeda67652766 100644 --- a/include/net/cfg802154.h +++ b/include/net/cfg802154.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <net/nl802154.h> | 25 | #include <net/nl802154.h> |
26 | 26 | ||
27 | struct wpan_phy; | 27 | struct wpan_phy; |
28 | struct wpan_phy_cca; | ||
28 | 29 | ||
29 | struct cfg802154_ops { | 30 | struct cfg802154_ops { |
30 | struct net_device * (*add_virtual_intf_deprecated)(struct wpan_phy *wpan_phy, | 31 | struct net_device * (*add_virtual_intf_deprecated)(struct wpan_phy *wpan_phy, |
@@ -39,6 +40,8 @@ struct cfg802154_ops { | |||
39 | int (*del_virtual_intf)(struct wpan_phy *wpan_phy, | 40 | int (*del_virtual_intf)(struct wpan_phy *wpan_phy, |
40 | struct wpan_dev *wpan_dev); | 41 | struct wpan_dev *wpan_dev); |
41 | int (*set_channel)(struct wpan_phy *wpan_phy, u8 page, u8 channel); | 42 | int (*set_channel)(struct wpan_phy *wpan_phy, u8 page, u8 channel); |
43 | int (*set_cca_mode)(struct wpan_phy *wpan_phy, | ||
44 | const struct wpan_phy_cca *cca); | ||
42 | int (*set_pan_id)(struct wpan_phy *wpan_phy, | 45 | int (*set_pan_id)(struct wpan_phy *wpan_phy, |
43 | struct wpan_dev *wpan_dev, __le16 pan_id); | 46 | struct wpan_dev *wpan_dev, __le16 pan_id); |
44 | int (*set_short_addr)(struct wpan_phy *wpan_phy, | 47 | int (*set_short_addr)(struct wpan_phy *wpan_phy, |
@@ -56,6 +59,11 @@ struct cfg802154_ops { | |||
56 | struct wpan_dev *wpan_dev, bool mode); | 59 | struct wpan_dev *wpan_dev, bool mode); |
57 | }; | 60 | }; |
58 | 61 | ||
62 | struct wpan_phy_cca { | ||
63 | enum nl802154_cca_modes mode; | ||
64 | enum nl802154_cca_opts opt; | ||
65 | }; | ||
66 | |||
59 | struct wpan_phy { | 67 | struct wpan_phy { |
60 | struct mutex pib_lock; | 68 | struct mutex pib_lock; |
61 | 69 | ||
@@ -76,7 +84,7 @@ struct wpan_phy { | |||
76 | u8 current_page; | 84 | u8 current_page; |
77 | u32 channels_supported[IEEE802154_MAX_PAGE + 1]; | 85 | u32 channels_supported[IEEE802154_MAX_PAGE + 1]; |
78 | s8 transmit_power; | 86 | s8 transmit_power; |
79 | u8 cca_mode; | 87 | struct wpan_phy_cca cca; |
80 | 88 | ||
81 | __le64 perm_extended_addr; | 89 | __le64 perm_extended_addr; |
82 | 90 | ||
diff --git a/include/net/checksum.h b/include/net/checksum.h index e339a9513e29..0a55ac715077 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
@@ -167,4 +167,9 @@ static inline __wsum remcsum_adjust(void *ptr, __wsum csum, | |||
167 | return delta; | 167 | return delta; |
168 | } | 168 | } |
169 | 169 | ||
170 | static inline void remcsum_unadjust(__sum16 *psum, __wsum delta) | ||
171 | { | ||
172 | *psum = csum_fold(csum_sub(delta, *psum)); | ||
173 | } | ||
174 | |||
170 | #endif | 175 | #endif |
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a6fd939f202d..3ebb168b9afc 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -121,13 +121,6 @@ extern int cipso_v4_rbm_strictvalid; | |||
121 | #endif | 121 | #endif |
122 | 122 | ||
123 | /* | 123 | /* |
124 | * Helper Functions | ||
125 | */ | ||
126 | |||
127 | #define CIPSO_V4_OPTEXIST(x) (IPCB(x)->opt.cipso != 0) | ||
128 | #define CIPSO_V4_OPTPTR(x) (skb_network_header(x) + IPCB(x)->opt.cipso) | ||
129 | |||
130 | /* | ||
131 | * DOI List Functions | 124 | * DOI List Functions |
132 | */ | 125 | */ |
133 | 126 | ||
@@ -190,7 +183,7 @@ static inline int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi *doi_def, | |||
190 | 183 | ||
191 | #ifdef CONFIG_NETLABEL | 184 | #ifdef CONFIG_NETLABEL |
192 | void cipso_v4_cache_invalidate(void); | 185 | void cipso_v4_cache_invalidate(void); |
193 | int cipso_v4_cache_add(const struct sk_buff *skb, | 186 | int cipso_v4_cache_add(const unsigned char *cipso_ptr, |
194 | const struct netlbl_lsm_secattr *secattr); | 187 | const struct netlbl_lsm_secattr *secattr); |
195 | #else | 188 | #else |
196 | static inline void cipso_v4_cache_invalidate(void) | 189 | static inline void cipso_v4_cache_invalidate(void) |
@@ -198,7 +191,7 @@ static inline void cipso_v4_cache_invalidate(void) | |||
198 | return; | 191 | return; |
199 | } | 192 | } |
200 | 193 | ||
201 | static inline int cipso_v4_cache_add(const struct sk_buff *skb, | 194 | static inline int cipso_v4_cache_add(const unsigned char *cipso_ptr, |
202 | const struct netlbl_lsm_secattr *secattr) | 195 | const struct netlbl_lsm_secattr *secattr) |
203 | { | 196 | { |
204 | return 0; | 197 | return 0; |
@@ -211,6 +204,8 @@ static inline int cipso_v4_cache_add(const struct sk_buff *skb, | |||
211 | 204 | ||
212 | #ifdef CONFIG_NETLABEL | 205 | #ifdef CONFIG_NETLABEL |
213 | void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway); | 206 | void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway); |
207 | int cipso_v4_getattr(const unsigned char *cipso, | ||
208 | struct netlbl_lsm_secattr *secattr); | ||
214 | int cipso_v4_sock_setattr(struct sock *sk, | 209 | int cipso_v4_sock_setattr(struct sock *sk, |
215 | const struct cipso_v4_doi *doi_def, | 210 | const struct cipso_v4_doi *doi_def, |
216 | const struct netlbl_lsm_secattr *secattr); | 211 | const struct netlbl_lsm_secattr *secattr); |
@@ -226,6 +221,7 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb, | |||
226 | int cipso_v4_skbuff_delattr(struct sk_buff *skb); | 221 | int cipso_v4_skbuff_delattr(struct sk_buff *skb); |
227 | int cipso_v4_skbuff_getattr(const struct sk_buff *skb, | 222 | int cipso_v4_skbuff_getattr(const struct sk_buff *skb, |
228 | struct netlbl_lsm_secattr *secattr); | 223 | struct netlbl_lsm_secattr *secattr); |
224 | unsigned char *cipso_v4_optptr(const struct sk_buff *skb); | ||
229 | int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option); | 225 | int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option); |
230 | #else | 226 | #else |
231 | static inline void cipso_v4_error(struct sk_buff *skb, | 227 | static inline void cipso_v4_error(struct sk_buff *skb, |
@@ -235,6 +231,12 @@ static inline void cipso_v4_error(struct sk_buff *skb, | |||
235 | return; | 231 | return; |
236 | } | 232 | } |
237 | 233 | ||
234 | static inline int cipso_v4_getattr(const unsigned char *cipso, | ||
235 | struct netlbl_lsm_secattr *secattr) | ||
236 | { | ||
237 | return -ENOSYS; | ||
238 | } | ||
239 | |||
238 | static inline int cipso_v4_sock_setattr(struct sock *sk, | 240 | static inline int cipso_v4_sock_setattr(struct sock *sk, |
239 | const struct cipso_v4_doi *doi_def, | 241 | const struct cipso_v4_doi *doi_def, |
240 | const struct netlbl_lsm_secattr *secattr) | 242 | const struct netlbl_lsm_secattr *secattr) |
@@ -282,6 +284,11 @@ static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, | |||
282 | return -ENOSYS; | 284 | return -ENOSYS; |
283 | } | 285 | } |
284 | 286 | ||
287 | static inline unsigned char *cipso_v4_optptr(const struct sk_buff *skb) | ||
288 | { | ||
289 | return NULL; | ||
290 | } | ||
291 | |||
285 | static inline int cipso_v4_validate(const struct sk_buff *skb, | 292 | static inline int cipso_v4_validate(const struct sk_buff *skb, |
286 | unsigned char **option) | 293 | unsigned char **option) |
287 | { | 294 | { |
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index 7ee2df083542..dc8fd81412bf 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h | |||
@@ -22,9 +22,9 @@ struct flow_keys { | |||
22 | __be32 ports; | 22 | __be32 ports; |
23 | __be16 port16[2]; | 23 | __be16 port16[2]; |
24 | }; | 24 | }; |
25 | u16 thoff; | 25 | u16 thoff; |
26 | u16 n_proto; | 26 | __be16 n_proto; |
27 | u8 ip_proto; | 27 | u8 ip_proto; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow, | 30 | bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow, |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 6c92415311ca..0574abd3db86 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -211,6 +211,23 @@ static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr, | |||
211 | } | 211 | } |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * genlmsg_parse - parse attributes of a genetlink message | ||
215 | * @nlh: netlink message header | ||
216 | * @family: genetlink message family | ||
217 | * @tb: destination array with maxtype+1 elements | ||
218 | * @maxtype: maximum attribute type to be expected | ||
219 | * @policy: validation policy | ||
220 | * */ | ||
221 | static inline int genlmsg_parse(const struct nlmsghdr *nlh, | ||
222 | const struct genl_family *family, | ||
223 | struct nlattr *tb[], int maxtype, | ||
224 | const struct nla_policy *policy) | ||
225 | { | ||
226 | return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, | ||
227 | policy); | ||
228 | } | ||
229 | |||
230 | /** | ||
214 | * genl_dump_check_consistent - check if sequence is consistent and advertise if not | 231 | * genl_dump_check_consistent - check if sequence is consistent and advertise if not |
215 | * @cb: netlink callback structure that stores the sequence number | 232 | * @cb: netlink callback structure that stores the sequence number |
216 | * @user_hdr: user header as returned from genlmsg_put() | 233 | * @user_hdr: user header as returned from genlmsg_put() |
@@ -250,9 +267,9 @@ static inline void *genlmsg_put_reply(struct sk_buff *skb, | |||
250 | * @skb: socket buffer the message is stored in | 267 | * @skb: socket buffer the message is stored in |
251 | * @hdr: user specific header | 268 | * @hdr: user specific header |
252 | */ | 269 | */ |
253 | static inline int genlmsg_end(struct sk_buff *skb, void *hdr) | 270 | static inline void genlmsg_end(struct sk_buff *skb, void *hdr) |
254 | { | 271 | { |
255 | return nlmsg_end(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); | 272 | nlmsg_end(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); |
256 | } | 273 | } |
257 | 274 | ||
258 | /** | 275 | /** |
diff --git a/include/net/geneve.h b/include/net/geneve.h index 112132cf8e2e..14fb8d3390b4 100644 --- a/include/net/geneve.h +++ b/include/net/geneve.h | |||
@@ -68,13 +68,12 @@ struct geneve_sock; | |||
68 | typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb); | 68 | typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb); |
69 | 69 | ||
70 | struct geneve_sock { | 70 | struct geneve_sock { |
71 | struct hlist_node hlist; | 71 | struct list_head list; |
72 | geneve_rcv_t *rcv; | 72 | geneve_rcv_t *rcv; |
73 | void *rcv_data; | 73 | void *rcv_data; |
74 | struct work_struct del_work; | ||
75 | struct socket *sock; | 74 | struct socket *sock; |
76 | struct rcu_head rcu; | 75 | struct rcu_head rcu; |
77 | atomic_t refcnt; | 76 | int refcnt; |
78 | struct udp_offload udp_offloads; | 77 | struct udp_offload udp_offloads; |
79 | }; | 78 | }; |
80 | 79 | ||
@@ -91,7 +90,7 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, | |||
91 | struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, | 90 | struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, |
92 | __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, | 91 | __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, |
93 | __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt, | 92 | __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt, |
94 | bool xnet); | 93 | bool csum, bool xnet); |
95 | #endif /*ifdef CONFIG_INET */ | 94 | #endif /*ifdef CONFIG_INET */ |
96 | 95 | ||
97 | #endif /*ifdef__NET_GENEVE_H */ | 96 | #endif /*ifdef__NET_GENEVE_H */ |
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h index 734d9b5f577a..0f712c0bc0bf 100644 --- a/include/net/gro_cells.h +++ b/include/net/gro_cells.h | |||
@@ -8,25 +8,23 @@ | |||
8 | struct gro_cell { | 8 | struct gro_cell { |
9 | struct sk_buff_head napi_skbs; | 9 | struct sk_buff_head napi_skbs; |
10 | struct napi_struct napi; | 10 | struct napi_struct napi; |
11 | } ____cacheline_aligned_in_smp; | 11 | }; |
12 | 12 | ||
13 | struct gro_cells { | 13 | struct gro_cells { |
14 | unsigned int gro_cells_mask; | 14 | struct gro_cell __percpu *cells; |
15 | struct gro_cell *cells; | ||
16 | }; | 15 | }; |
17 | 16 | ||
18 | static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) | 17 | static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) |
19 | { | 18 | { |
20 | struct gro_cell *cell = gcells->cells; | 19 | struct gro_cell *cell; |
21 | struct net_device *dev = skb->dev; | 20 | struct net_device *dev = skb->dev; |
22 | 21 | ||
23 | if (!cell || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { | 22 | if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { |
24 | netif_rx(skb); | 23 | netif_rx(skb); |
25 | return; | 24 | return; |
26 | } | 25 | } |
27 | 26 | ||
28 | if (skb_rx_queue_recorded(skb)) | 27 | cell = this_cpu_ptr(gcells->cells); |
29 | cell += skb_get_rx_queue(skb) & gcells->gro_cells_mask; | ||
30 | 28 | ||
31 | if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { | 29 | if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { |
32 | atomic_long_inc(&dev->rx_dropped); | 30 | atomic_long_inc(&dev->rx_dropped); |
@@ -72,15 +70,12 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de | |||
72 | { | 70 | { |
73 | int i; | 71 | int i; |
74 | 72 | ||
75 | gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; | 73 | gcells->cells = alloc_percpu(struct gro_cell); |
76 | gcells->cells = kcalloc(gcells->gro_cells_mask + 1, | ||
77 | sizeof(struct gro_cell), | ||
78 | GFP_KERNEL); | ||
79 | if (!gcells->cells) | 74 | if (!gcells->cells) |
80 | return -ENOMEM; | 75 | return -ENOMEM; |
81 | 76 | ||
82 | for (i = 0; i <= gcells->gro_cells_mask; i++) { | 77 | for_each_possible_cpu(i) { |
83 | struct gro_cell *cell = gcells->cells + i; | 78 | struct gro_cell *cell = per_cpu_ptr(gcells->cells, i); |
84 | 79 | ||
85 | skb_queue_head_init(&cell->napi_skbs); | 80 | skb_queue_head_init(&cell->napi_skbs); |
86 | netif_napi_add(dev, &cell->napi, gro_cell_poll, 64); | 81 | netif_napi_add(dev, &cell->napi, gro_cell_poll, 64); |
@@ -91,16 +86,16 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de | |||
91 | 86 | ||
92 | static inline void gro_cells_destroy(struct gro_cells *gcells) | 87 | static inline void gro_cells_destroy(struct gro_cells *gcells) |
93 | { | 88 | { |
94 | struct gro_cell *cell = gcells->cells; | ||
95 | int i; | 89 | int i; |
96 | 90 | ||
97 | if (!cell) | 91 | if (!gcells->cells) |
98 | return; | 92 | return; |
99 | for (i = 0; i <= gcells->gro_cells_mask; i++,cell++) { | 93 | for_each_possible_cpu(i) { |
94 | struct gro_cell *cell = per_cpu_ptr(gcells->cells, i); | ||
100 | netif_napi_del(&cell->napi); | 95 | netif_napi_del(&cell->napi); |
101 | skb_queue_purge(&cell->napi_skbs); | 96 | skb_queue_purge(&cell->napi_skbs); |
102 | } | 97 | } |
103 | kfree(gcells->cells); | 98 | free_percpu(gcells->cells); |
104 | gcells->cells = NULL; | 99 | gcells->cells = NULL; |
105 | } | 100 | } |
106 | 101 | ||
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 83bb8a73d23c..94a297052442 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
29 | #include <linux/ieee802154.h> | 29 | #include <linux/ieee802154.h> |
30 | 30 | ||
31 | #include <net/cfg802154.h> | ||
32 | |||
31 | struct ieee802154_sechdr { | 33 | struct ieee802154_sechdr { |
32 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
33 | u8 level:3, | 35 | u8 level:3, |
@@ -337,7 +339,7 @@ struct ieee802154_mac_params { | |||
337 | s8 frame_retries; | 339 | s8 frame_retries; |
338 | 340 | ||
339 | bool lbt; | 341 | bool lbt; |
340 | u8 cca_mode; | 342 | struct wpan_phy_cca cca; |
341 | s32 cca_ed_level; | 343 | s32 cca_ed_level; |
342 | }; | 344 | }; |
343 | 345 | ||
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 848e85cb5c61..5976bdecf58b 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -98,7 +98,8 @@ struct inet_connection_sock { | |||
98 | const struct tcp_congestion_ops *icsk_ca_ops; | 98 | const struct tcp_congestion_ops *icsk_ca_ops; |
99 | const struct inet_connection_sock_af_ops *icsk_af_ops; | 99 | const struct inet_connection_sock_af_ops *icsk_af_ops; |
100 | unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); | 100 | unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); |
101 | __u8 icsk_ca_state; | 101 | __u8 icsk_ca_state:7, |
102 | icsk_ca_dst_locked:1; | ||
102 | __u8 icsk_retransmits; | 103 | __u8 icsk_retransmits; |
103 | __u8 icsk_pending; | 104 | __u8 icsk_pending; |
104 | __u8 icsk_backoff; | 105 | __u8 icsk_backoff; |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a829b77523cf..eb16c7beed1e 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #ifndef _INET_SOCK_H | 16 | #ifndef _INET_SOCK_H |
17 | #define _INET_SOCK_H | 17 | #define _INET_SOCK_H |
18 | 18 | ||
19 | 19 | #include <linux/bitops.h> | |
20 | #include <linux/kmemcheck.h> | 20 | #include <linux/kmemcheck.h> |
21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -184,6 +184,7 @@ struct inet_sock { | |||
184 | mc_all:1, | 184 | mc_all:1, |
185 | nodefrag:1; | 185 | nodefrag:1; |
186 | __u8 rcv_tos; | 186 | __u8 rcv_tos; |
187 | __u8 convert_csum; | ||
187 | int uc_index; | 188 | int uc_index; |
188 | int mc_index; | 189 | int mc_index; |
189 | __be32 mc_addr; | 190 | __be32 mc_addr; |
@@ -194,6 +195,16 @@ struct inet_sock { | |||
194 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ | 195 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ |
195 | #define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ | 196 | #define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ |
196 | 197 | ||
198 | /* cmsg flags for inet */ | ||
199 | #define IP_CMSG_PKTINFO BIT(0) | ||
200 | #define IP_CMSG_TTL BIT(1) | ||
201 | #define IP_CMSG_TOS BIT(2) | ||
202 | #define IP_CMSG_RECVOPTS BIT(3) | ||
203 | #define IP_CMSG_RETOPTS BIT(4) | ||
204 | #define IP_CMSG_PASSSEC BIT(5) | ||
205 | #define IP_CMSG_ORIGDSTADDR BIT(6) | ||
206 | #define IP_CMSG_CHECKSUM BIT(7) | ||
207 | |||
197 | static inline struct inet_sock *inet_sk(const struct sock *sk) | 208 | static inline struct inet_sock *inet_sk(const struct sock *sk) |
198 | { | 209 | { |
199 | return (struct inet_sock *)sk; | 210 | return (struct inet_sock *)sk; |
@@ -250,4 +261,20 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
250 | return flags; | 261 | return flags; |
251 | } | 262 | } |
252 | 263 | ||
264 | static inline void inet_inc_convert_csum(struct sock *sk) | ||
265 | { | ||
266 | inet_sk(sk)->convert_csum++; | ||
267 | } | ||
268 | |||
269 | static inline void inet_dec_convert_csum(struct sock *sk) | ||
270 | { | ||
271 | if (inet_sk(sk)->convert_csum > 0) | ||
272 | inet_sk(sk)->convert_csum--; | ||
273 | } | ||
274 | |||
275 | static inline bool inet_get_convert_csum(struct sock *sk) | ||
276 | { | ||
277 | return !!inet_sk(sk)->convert_csum; | ||
278 | } | ||
279 | |||
253 | #endif /* _INET_SOCK_H */ | 280 | #endif /* _INET_SOCK_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index f7cbd703d15d..025c61c0dffb 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -181,7 +181,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
181 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; | 181 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; |
182 | } | 182 | } |
183 | 183 | ||
184 | void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, | 184 | void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, |
185 | const struct ip_options *sopt, | 185 | const struct ip_options *sopt, |
186 | __be32 daddr, __be32 saddr, | 186 | __be32 daddr, __be32 saddr, |
187 | const struct ip_reply_arg *arg, | 187 | const struct ip_reply_arg *arg, |
@@ -538,7 +538,7 @@ int ip_options_rcv_srr(struct sk_buff *skb); | |||
538 | */ | 538 | */ |
539 | 539 | ||
540 | void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb); | 540 | void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb); |
541 | void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 541 | void ip_cmsg_recv_offset(struct msghdr *msg, struct sk_buff *skb, int offset); |
542 | int ip_cmsg_send(struct net *net, struct msghdr *msg, | 542 | int ip_cmsg_send(struct net *net, struct msghdr *msg, |
543 | struct ipcm_cookie *ipc, bool allow_ipv6); | 543 | struct ipcm_cookie *ipc, bool allow_ipv6); |
544 | int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | 544 | int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, |
@@ -558,6 +558,11 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | |||
558 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 558 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
559 | u32 info); | 559 | u32 info); |
560 | 560 | ||
561 | static inline void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) | ||
562 | { | ||
563 | ip_cmsg_recv_offset(msg, skb, 0); | ||
564 | } | ||
565 | |||
561 | bool icmp_global_allow(void); | 566 | bool icmp_global_allow(void); |
562 | extern int sysctl_icmp_msgs_per_sec; | 567 | extern int sysctl_icmp_msgs_per_sec; |
563 | extern int sysctl_icmp_msgs_burst; | 568 | extern int sysctl_icmp_msgs_burst; |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 8eea35d32a75..20e80fa7bbdd 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -74,6 +74,11 @@ struct fib6_node { | |||
74 | #define FIB6_SUBTREE(fn) ((fn)->subtree) | 74 | #define FIB6_SUBTREE(fn) ((fn)->subtree) |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | struct mx6_config { | ||
78 | const u32 *mx; | ||
79 | DECLARE_BITMAP(mx_valid, RTAX_MAX); | ||
80 | }; | ||
81 | |||
77 | /* | 82 | /* |
78 | * routing information | 83 | * routing information |
79 | * | 84 | * |
@@ -291,9 +296,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root, | |||
291 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), | 296 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), |
292 | void *arg); | 297 | void *arg); |
293 | 298 | ||
294 | int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info, | 299 | int fib6_add(struct fib6_node *root, struct rt6_info *rt, |
295 | struct nlattr *mx, int mx_len); | 300 | struct nl_info *info, struct mx6_config *mxc); |
296 | |||
297 | int fib6_del(struct rt6_info *rt, struct nl_info *info); | 301 | int fib6_del(struct rt6_info *rt, struct nl_info *info); |
298 | 302 | ||
299 | void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); | 303 | void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 9326c41c2d7f..76c091b53dae 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -70,6 +70,7 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t, const struct in6_addr *laddr, | |||
70 | __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw); | 70 | __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw); |
71 | __u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, | 71 | __u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, |
72 | const struct in6_addr *raddr); | 72 | const struct in6_addr *raddr); |
73 | struct net *ip6_tnl_get_link_net(const struct net_device *dev); | ||
73 | 74 | ||
74 | static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | 75 | static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
75 | { | 76 | { |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 09a819ee2151..5bd120e4bc0a 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -222,16 +222,19 @@ static inline struct fib_table *fib_new_table(struct net *net, u32 id) | |||
222 | static inline int fib_lookup(struct net *net, const struct flowi4 *flp, | 222 | static inline int fib_lookup(struct net *net, const struct flowi4 *flp, |
223 | struct fib_result *res) | 223 | struct fib_result *res) |
224 | { | 224 | { |
225 | struct fib_table *table; | 225 | int err = -ENETUNREACH; |
226 | |||
227 | rcu_read_lock(); | ||
228 | |||
229 | if (!fib_table_lookup(fib_get_table(net, RT_TABLE_LOCAL), flp, res, | ||
230 | FIB_LOOKUP_NOREF) || | ||
231 | !fib_table_lookup(fib_get_table(net, RT_TABLE_MAIN), flp, res, | ||
232 | FIB_LOOKUP_NOREF)) | ||
233 | err = 0; | ||
226 | 234 | ||
227 | table = fib_get_table(net, RT_TABLE_LOCAL); | 235 | rcu_read_unlock(); |
228 | if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF)) | ||
229 | return 0; | ||
230 | 236 | ||
231 | table = fib_get_table(net, RT_TABLE_MAIN); | 237 | return err; |
232 | if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF)) | ||
233 | return 0; | ||
234 | return -ENETUNREACH; | ||
235 | } | 238 | } |
236 | 239 | ||
237 | #else /* CONFIG_IP_MULTIPLE_TABLES */ | 240 | #else /* CONFIG_IP_MULTIPLE_TABLES */ |
@@ -247,20 +250,25 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp, | |||
247 | struct fib_result *res) | 250 | struct fib_result *res) |
248 | { | 251 | { |
249 | if (!net->ipv4.fib_has_custom_rules) { | 252 | if (!net->ipv4.fib_has_custom_rules) { |
253 | int err = -ENETUNREACH; | ||
254 | |||
255 | rcu_read_lock(); | ||
256 | |||
250 | res->tclassid = 0; | 257 | res->tclassid = 0; |
251 | if (net->ipv4.fib_local && | 258 | if ((net->ipv4.fib_local && |
252 | !fib_table_lookup(net->ipv4.fib_local, flp, res, | 259 | !fib_table_lookup(net->ipv4.fib_local, flp, res, |
253 | FIB_LOOKUP_NOREF)) | 260 | FIB_LOOKUP_NOREF)) || |
254 | return 0; | 261 | (net->ipv4.fib_main && |
255 | if (net->ipv4.fib_main && | 262 | !fib_table_lookup(net->ipv4.fib_main, flp, res, |
256 | !fib_table_lookup(net->ipv4.fib_main, flp, res, | 263 | FIB_LOOKUP_NOREF)) || |
257 | FIB_LOOKUP_NOREF)) | 264 | (net->ipv4.fib_default && |
258 | return 0; | 265 | !fib_table_lookup(net->ipv4.fib_default, flp, res, |
259 | if (net->ipv4.fib_default && | 266 | FIB_LOOKUP_NOREF))) |
260 | !fib_table_lookup(net->ipv4.fib_default, flp, res, | 267 | err = 0; |
261 | FIB_LOOKUP_NOREF)) | 268 | |
262 | return 0; | 269 | rcu_read_unlock(); |
263 | return -ENETUNREACH; | 270 | |
271 | return err; | ||
264 | } | 272 | } |
265 | return __fib_lookup(net, flp, res); | 273 | return __fib_lookup(net, flp, res); |
266 | } | 274 | } |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 25a59eb388a6..2c47061a6954 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
@@ -97,7 +97,10 @@ struct ip_tunnel { | |||
97 | #define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100) | 97 | #define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100) |
98 | #define TUNNEL_OAM __cpu_to_be16(0x0200) | 98 | #define TUNNEL_OAM __cpu_to_be16(0x0200) |
99 | #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) | 99 | #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) |
100 | #define TUNNEL_OPTIONS_PRESENT __cpu_to_be16(0x0800) | 100 | #define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800) |
101 | #define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000) | ||
102 | |||
103 | #define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT) | ||
101 | 104 | ||
102 | struct tnl_ptk_info { | 105 | struct tnl_ptk_info { |
103 | __be16 flags; | 106 | __be16 flags; |
@@ -138,6 +141,7 @@ int ip_tunnel_encap_del_ops(const struct ip_tunnel_encap_ops *op, | |||
138 | int ip_tunnel_init(struct net_device *dev); | 141 | int ip_tunnel_init(struct net_device *dev); |
139 | void ip_tunnel_uninit(struct net_device *dev); | 142 | void ip_tunnel_uninit(struct net_device *dev); |
140 | void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); | 143 | void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); |
144 | struct net *ip_tunnel_get_link_net(const struct net_device *dev); | ||
141 | int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, | 145 | int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, |
142 | struct rtnl_link_ops *ops, char *devname); | 146 | struct rtnl_link_ops *ops, char *devname); |
143 | 147 | ||
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 4292929392b0..4c9fe224d73b 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -671,6 +671,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add | |||
671 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); | 671 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); |
672 | } | 672 | } |
673 | 673 | ||
674 | void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); | ||
674 | void ipv6_proxy_select_ident(struct sk_buff *skb); | 675 | void ipv6_proxy_select_ident(struct sk_buff *skb); |
675 | 676 | ||
676 | int ip6_dst_hoplimit(struct dst_entry *dst); | 677 | int ip6_dst_hoplimit(struct dst_entry *dst); |
@@ -708,7 +709,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, | |||
708 | __be32 flowlabel, bool autolabel) | 709 | __be32 flowlabel, bool autolabel) |
709 | { | 710 | { |
710 | if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) { | 711 | if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) { |
711 | __be32 hash; | 712 | u32 hash; |
712 | 713 | ||
713 | hash = skb_get_hash(skb); | 714 | hash = skb_get_hash(skb); |
714 | 715 | ||
@@ -718,7 +719,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, | |||
718 | */ | 719 | */ |
719 | hash ^= hash >> 12; | 720 | hash ^= hash >> 12; |
720 | 721 | ||
721 | flowlabel = hash & IPV6_FLOWLABEL_MASK; | 722 | flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; |
722 | } | 723 | } |
723 | 724 | ||
724 | return flowlabel; | 725 | return flowlabel; |
@@ -788,6 +789,25 @@ int ip6_push_pending_frames(struct sock *sk); | |||
788 | 789 | ||
789 | void ip6_flush_pending_frames(struct sock *sk); | 790 | void ip6_flush_pending_frames(struct sock *sk); |
790 | 791 | ||
792 | int ip6_send_skb(struct sk_buff *skb); | ||
793 | |||
794 | struct sk_buff *__ip6_make_skb(struct sock *sk, struct sk_buff_head *queue, | ||
795 | struct inet_cork_full *cork, | ||
796 | struct inet6_cork *v6_cork); | ||
797 | struct sk_buff *ip6_make_skb(struct sock *sk, | ||
798 | int getfrag(void *from, char *to, int offset, | ||
799 | int len, int odd, struct sk_buff *skb), | ||
800 | void *from, int length, int transhdrlen, | ||
801 | int hlimit, int tclass, struct ipv6_txoptions *opt, | ||
802 | struct flowi6 *fl6, struct rt6_info *rt, | ||
803 | unsigned int flags, int dontfrag); | ||
804 | |||
805 | static inline struct sk_buff *ip6_finish_skb(struct sock *sk) | ||
806 | { | ||
807 | return __ip6_make_skb(sk, &sk->sk_write_queue, &inet_sk(sk)->cork, | ||
808 | &inet6_sk(sk)->cork); | ||
809 | } | ||
810 | |||
791 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); | 811 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); |
792 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 812 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
793 | const struct in6_addr *final_dst); | 813 | const struct in6_addr *final_dst); |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 29c7be8808d5..d52914b75331 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -376,6 +376,12 @@ enum ieee80211_rssi_event { | |||
376 | * @ssid_len: Length of SSID given in @ssid. | 376 | * @ssid_len: Length of SSID given in @ssid. |
377 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 377 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
378 | * @txpower: TX power in dBm | 378 | * @txpower: TX power in dBm |
379 | * @txpower_type: TX power adjustment used to control per packet Transmit | ||
380 | * Power Control (TPC) in lower driver for the current vif. In particular | ||
381 | * TPC is enabled if value passed in %txpower_type is | ||
382 | * NL80211_TX_POWER_LIMITED (allow using less than specified from | ||
383 | * userspace), whereas TPC is disabled if %txpower_type is set to | ||
384 | * NL80211_TX_POWER_FIXED (use value configured from userspace) | ||
379 | * @p2p_noa_attr: P2P NoA attribute for P2P powersave | 385 | * @p2p_noa_attr: P2P NoA attribute for P2P powersave |
380 | */ | 386 | */ |
381 | struct ieee80211_bss_conf { | 387 | struct ieee80211_bss_conf { |
@@ -411,6 +417,7 @@ struct ieee80211_bss_conf { | |||
411 | size_t ssid_len; | 417 | size_t ssid_len; |
412 | bool hidden_ssid; | 418 | bool hidden_ssid; |
413 | int txpower; | 419 | int txpower; |
420 | enum nl80211_tx_power_setting txpower_type; | ||
414 | struct ieee80211_p2p_noa_attr p2p_noa_attr; | 421 | struct ieee80211_p2p_noa_attr p2p_noa_attr; |
415 | }; | 422 | }; |
416 | 423 | ||
@@ -505,8 +512,11 @@ struct ieee80211_bss_conf { | |||
505 | * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it | 512 | * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it |
506 | * would be fragmented by size (this is optional, only used for | 513 | * would be fragmented by size (this is optional, only used for |
507 | * monitor injection). | 514 | * monitor injection). |
508 | * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll | 515 | * @IEEE80211_TX_STAT_NOACK_TRANSMITTED: A frame that was marked with |
509 | * frame (PS-Poll or uAPSD). | 516 | * IEEE80211_TX_CTL_NO_ACK has been successfully transmitted without |
517 | * any errors (like issues specific to the driver/HW). | ||
518 | * This flag must not be set for frames that don't request no-ack | ||
519 | * behaviour with IEEE80211_TX_CTL_NO_ACK. | ||
510 | * | 520 | * |
511 | * Note: If you have to add new flags to the enumeration, then don't | 521 | * Note: If you have to add new flags to the enumeration, then don't |
512 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 522 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
@@ -542,7 +552,7 @@ enum mac80211_tx_info_flags { | |||
542 | IEEE80211_TX_STATUS_EOSP = BIT(28), | 552 | IEEE80211_TX_STATUS_EOSP = BIT(28), |
543 | IEEE80211_TX_CTL_USE_MINRATE = BIT(29), | 553 | IEEE80211_TX_CTL_USE_MINRATE = BIT(29), |
544 | IEEE80211_TX_CTL_DONTFRAG = BIT(30), | 554 | IEEE80211_TX_CTL_DONTFRAG = BIT(30), |
545 | IEEE80211_TX_CTL_PS_RESPONSE = BIT(31), | 555 | IEEE80211_TX_STAT_NOACK_TRANSMITTED = BIT(31), |
546 | }; | 556 | }; |
547 | 557 | ||
548 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 558 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
@@ -552,11 +562,14 @@ enum mac80211_tx_info_flags { | |||
552 | * | 562 | * |
553 | * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control | 563 | * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control |
554 | * protocol frame (e.g. EAP) | 564 | * protocol frame (e.g. EAP) |
565 | * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll | ||
566 | * frame (PS-Poll or uAPSD). | ||
555 | * | 567 | * |
556 | * These flags are used in tx_info->control.flags. | 568 | * These flags are used in tx_info->control.flags. |
557 | */ | 569 | */ |
558 | enum mac80211_tx_control_flags { | 570 | enum mac80211_tx_control_flags { |
559 | IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), | 571 | IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), |
572 | IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1), | ||
560 | }; | 573 | }; |
561 | 574 | ||
562 | /* | 575 | /* |
@@ -925,15 +938,13 @@ enum mac80211_rx_flags { | |||
925 | * These flags are used with the @vht_flag member of | 938 | * These flags are used with the @vht_flag member of |
926 | * &struct ieee80211_rx_status. | 939 | * &struct ieee80211_rx_status. |
927 | * @RX_VHT_FLAG_80MHZ: 80 MHz was used | 940 | * @RX_VHT_FLAG_80MHZ: 80 MHz was used |
928 | * @RX_VHT_FLAG_80P80MHZ: 80+80 MHz was used | ||
929 | * @RX_VHT_FLAG_160MHZ: 160 MHz was used | 941 | * @RX_VHT_FLAG_160MHZ: 160 MHz was used |
930 | * @RX_VHT_FLAG_BF: packet was beamformed | 942 | * @RX_VHT_FLAG_BF: packet was beamformed |
931 | */ | 943 | */ |
932 | enum mac80211_rx_vht_flags { | 944 | enum mac80211_rx_vht_flags { |
933 | RX_VHT_FLAG_80MHZ = BIT(0), | 945 | RX_VHT_FLAG_80MHZ = BIT(0), |
934 | RX_VHT_FLAG_80P80MHZ = BIT(1), | 946 | RX_VHT_FLAG_160MHZ = BIT(1), |
935 | RX_VHT_FLAG_160MHZ = BIT(2), | 947 | RX_VHT_FLAG_BF = BIT(2), |
936 | RX_VHT_FLAG_BF = BIT(3), | ||
937 | }; | 948 | }; |
938 | 949 | ||
939 | /** | 950 | /** |
@@ -1181,10 +1192,15 @@ struct ieee80211_channel_switch { | |||
1181 | * monitoring on this virtual interface -- i.e. it can monitor | 1192 | * monitoring on this virtual interface -- i.e. it can monitor |
1182 | * connection quality related parameters, such as the RSSI level and | 1193 | * connection quality related parameters, such as the RSSI level and |
1183 | * provide notifications if configured trigger levels are reached. | 1194 | * provide notifications if configured trigger levels are reached. |
1195 | * @IEEE80211_VIF_SUPPORTS_UAPSD: The device can do U-APSD for this | ||
1196 | * interface. This flag should be set during interface addition, | ||
1197 | * but may be set/cleared as late as authentication to an AP. It is | ||
1198 | * only valid for managed/station mode interfaces. | ||
1184 | */ | 1199 | */ |
1185 | enum ieee80211_vif_flags { | 1200 | enum ieee80211_vif_flags { |
1186 | IEEE80211_VIF_BEACON_FILTER = BIT(0), | 1201 | IEEE80211_VIF_BEACON_FILTER = BIT(0), |
1187 | IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), | 1202 | IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), |
1203 | IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), | ||
1188 | }; | 1204 | }; |
1189 | 1205 | ||
1190 | /** | 1206 | /** |
@@ -1270,19 +1286,22 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | |||
1270 | * | 1286 | * |
1271 | * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the | 1287 | * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the |
1272 | * driver to indicate that it requires IV generation for this | 1288 | * driver to indicate that it requires IV generation for this |
1273 | * particular key. | 1289 | * particular key. Setting this flag does not necessarily mean that SKBs |
1290 | * will have sufficient tailroom for ICV or MIC. | ||
1274 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by | 1291 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by |
1275 | * the driver for a TKIP key if it requires Michael MIC | 1292 | * the driver for a TKIP key if it requires Michael MIC |
1276 | * generation in software. | 1293 | * generation in software. |
1277 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | 1294 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates |
1278 | * that the key is pairwise rather then a shared key. | 1295 | * that the key is pairwise rather then a shared key. |
1279 | * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a | 1296 | * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a |
1280 | * CCMP key if it requires CCMP encryption of management frames (MFP) to | 1297 | * CCMP/GCMP key if it requires CCMP/GCMP encryption of management frames |
1281 | * be done in software. | 1298 | * (MFP) to be done in software. |
1282 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver | 1299 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver |
1283 | * if space should be prepared for the IV, but the IV | 1300 | * if space should be prepared for the IV, but the IV |
1284 | * itself should not be generated. Do not set together with | 1301 | * itself should not be generated. Do not set together with |
1285 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. | 1302 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does |
1303 | * not necessarily mean that SKBs will have sufficient tailroom for ICV or | ||
1304 | * MIC. | ||
1286 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received | 1305 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received |
1287 | * management frames. The flag can help drivers that have a hardware | 1306 | * management frames. The flag can help drivers that have a hardware |
1288 | * crypto implementation that doesn't deal with management frames | 1307 | * crypto implementation that doesn't deal with management frames |
@@ -1291,8 +1310,11 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | |||
1291 | * RX, if your crypto engine can't deal with TX you can also set the | 1310 | * RX, if your crypto engine can't deal with TX you can also set the |
1292 | * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. | 1311 | * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. |
1293 | * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the | 1312 | * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the |
1294 | * driver for a CCMP key to indicate that is requires IV generation | 1313 | * driver for a CCMP/GCMP key to indicate that is requires IV generation |
1295 | * only for managment frames (MFP). | 1314 | * only for managment frames (MFP). |
1315 | * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the | ||
1316 | * driver for a key to indicate that sufficient tailroom must always | ||
1317 | * be reserved for ICV or MIC, even when HW encryption is enabled. | ||
1296 | */ | 1318 | */ |
1297 | enum ieee80211_key_flags { | 1319 | enum ieee80211_key_flags { |
1298 | IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), | 1320 | IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), |
@@ -1302,6 +1324,7 @@ enum ieee80211_key_flags { | |||
1302 | IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(4), | 1324 | IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(4), |
1303 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(5), | 1325 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(5), |
1304 | IEEE80211_KEY_FLAG_RX_MGMT = BIT(6), | 1326 | IEEE80211_KEY_FLAG_RX_MGMT = BIT(6), |
1327 | IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7), | ||
1305 | }; | 1328 | }; |
1306 | 1329 | ||
1307 | /** | 1330 | /** |
@@ -1580,11 +1603,6 @@ struct ieee80211_tx_control { | |||
1580 | * @IEEE80211_HW_MFP_CAPABLE: | 1603 | * @IEEE80211_HW_MFP_CAPABLE: |
1581 | * Hardware supports management frame protection (MFP, IEEE 802.11w). | 1604 | * Hardware supports management frame protection (MFP, IEEE 802.11w). |
1582 | * | 1605 | * |
1583 | * @IEEE80211_HW_SUPPORTS_UAPSD: | ||
1584 | * Hardware supports Unscheduled Automatic Power Save Delivery | ||
1585 | * (U-APSD) in managed mode. The mode is configured with | ||
1586 | * conf_tx() operation. | ||
1587 | * | ||
1588 | * @IEEE80211_HW_REPORTS_TX_ACK_STATUS: | 1606 | * @IEEE80211_HW_REPORTS_TX_ACK_STATUS: |
1589 | * Hardware can provide ack status reports of Tx frames to | 1607 | * Hardware can provide ack status reports of Tx frames to |
1590 | * the stack. | 1608 | * the stack. |
@@ -1623,6 +1641,12 @@ struct ieee80211_tx_control { | |||
1623 | * be created. It is expected user-space will create vifs as | 1641 | * be created. It is expected user-space will create vifs as |
1624 | * desired (and thus have them named as desired). | 1642 | * desired (and thus have them named as desired). |
1625 | * | 1643 | * |
1644 | * @IEEE80211_HW_SW_CRYPTO_CONTROL: The driver wants to control which of the | ||
1645 | * crypto algorithms can be done in software - so don't automatically | ||
1646 | * try to fall back to it if hardware crypto fails, but do so only if | ||
1647 | * the driver returns 1. This also forces the driver to advertise its | ||
1648 | * supported cipher suites. | ||
1649 | * | ||
1626 | * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface | 1650 | * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface |
1627 | * queue mapping in order to use different queues (not just one per AC) | 1651 | * queue mapping in order to use different queues (not just one per AC) |
1628 | * for different virtual interfaces. See the doc section on HW queue | 1652 | * for different virtual interfaces. See the doc section on HW queue |
@@ -1670,8 +1694,8 @@ enum ieee80211_hw_flags { | |||
1670 | IEEE80211_HW_MFP_CAPABLE = 1<<13, | 1694 | IEEE80211_HW_MFP_CAPABLE = 1<<13, |
1671 | IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, | 1695 | IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, |
1672 | IEEE80211_HW_NO_AUTO_VIF = 1<<15, | 1696 | IEEE80211_HW_NO_AUTO_VIF = 1<<15, |
1673 | /* free slot */ | 1697 | IEEE80211_HW_SW_CRYPTO_CONTROL = 1<<16, |
1674 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, | 1698 | /* free slots */ |
1675 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1699 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
1676 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | 1700 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, |
1677 | IEEE80211_HW_QUEUE_CONTROL = 1<<20, | 1701 | IEEE80211_HW_QUEUE_CONTROL = 1<<20, |
@@ -1945,6 +1969,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1945 | * added; if you return 0 then hw_key_idx must be assigned to the | 1969 | * added; if you return 0 then hw_key_idx must be assigned to the |
1946 | * hardware key index, you are free to use the full u8 range. | 1970 | * hardware key index, you are free to use the full u8 range. |
1947 | * | 1971 | * |
1972 | * Note that in the case that the @IEEE80211_HW_SW_CRYPTO_CONTROL flag is | ||
1973 | * set, mac80211 will not automatically fall back to software crypto if | ||
1974 | * enabling hardware crypto failed. The set_key() call may also return the | ||
1975 | * value 1 to permit this specific key/algorithm to be done in software. | ||
1976 | * | ||
1948 | * When the cmd is %DISABLE_KEY then it must succeed. | 1977 | * When the cmd is %DISABLE_KEY then it must succeed. |
1949 | * | 1978 | * |
1950 | * Note that it is permissible to not decrypt a frame even if a key | 1979 | * Note that it is permissible to not decrypt a frame even if a key |
@@ -2023,7 +2052,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
2023 | * enabled whenever user has enabled powersave. | 2052 | * enabled whenever user has enabled powersave. |
2024 | * | 2053 | * |
2025 | * Driver informs U-APSD client support by enabling | 2054 | * Driver informs U-APSD client support by enabling |
2026 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the | 2055 | * %IEEE80211_VIF_SUPPORTS_UAPSD flag. The mode is configured through the |
2027 | * uapsd parameter in conf_tx() operation. Hardware needs to send the QoS | 2056 | * uapsd parameter in conf_tx() operation. Hardware needs to send the QoS |
2028 | * Nullfunc frames and stay awake until the service period has ended. To | 2057 | * Nullfunc frames and stay awake until the service period has ended. To |
2029 | * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames | 2058 | * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames |
@@ -2696,6 +2725,14 @@ enum ieee80211_reconfig_type { | |||
2696 | * is only used if the configured rate control algorithm actually uses | 2725 | * is only used if the configured rate control algorithm actually uses |
2697 | * the new rate table API, and is therefore optional. Must be atomic. | 2726 | * the new rate table API, and is therefore optional. Must be atomic. |
2698 | * | 2727 | * |
2728 | * @sta_statistics: Get statistics for this station. For example with beacon | ||
2729 | * filtering, the statistics kept by mac80211 might not be accurate, so | ||
2730 | * let the driver pre-fill the statistics. The driver can fill most of | ||
2731 | * the values (indicating which by setting the filled bitmap), but not | ||
2732 | * all of them make sense - see the source for which ones are possible. | ||
2733 | * Statistics that the driver doesn't fill will be filled by mac80211. | ||
2734 | * The callback can sleep. | ||
2735 | * | ||
2699 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 2736 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
2700 | * bursting) for a hardware TX queue. | 2737 | * bursting) for a hardware TX queue. |
2701 | * Returns a negative error code on failure. | 2738 | * Returns a negative error code on failure. |
@@ -2856,9 +2893,6 @@ enum ieee80211_reconfig_type { | |||
2856 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | 2893 | * @get_et_strings: Ethtool API to get a set of strings to describe stats |
2857 | * and perhaps other supported types of ethtool data-sets. | 2894 | * and perhaps other supported types of ethtool data-sets. |
2858 | * | 2895 | * |
2859 | * @get_rssi: Get current signal strength in dBm, the function is optional | ||
2860 | * and can sleep. | ||
2861 | * | ||
2862 | * @mgd_prepare_tx: Prepare for transmitting a management frame for association | 2896 | * @mgd_prepare_tx: Prepare for transmitting a management frame for association |
2863 | * before associated. In multi-channel scenarios, a virtual interface is | 2897 | * before associated. In multi-channel scenarios, a virtual interface is |
2864 | * bound to a channel before it is associated, but as it isn't associated | 2898 | * bound to a channel before it is associated, but as it isn't associated |
@@ -3059,6 +3093,10 @@ struct ieee80211_ops { | |||
3059 | void (*sta_rate_tbl_update)(struct ieee80211_hw *hw, | 3093 | void (*sta_rate_tbl_update)(struct ieee80211_hw *hw, |
3060 | struct ieee80211_vif *vif, | 3094 | struct ieee80211_vif *vif, |
3061 | struct ieee80211_sta *sta); | 3095 | struct ieee80211_sta *sta); |
3096 | void (*sta_statistics)(struct ieee80211_hw *hw, | ||
3097 | struct ieee80211_vif *vif, | ||
3098 | struct ieee80211_sta *sta, | ||
3099 | struct station_info *sinfo); | ||
3062 | int (*conf_tx)(struct ieee80211_hw *hw, | 3100 | int (*conf_tx)(struct ieee80211_hw *hw, |
3063 | struct ieee80211_vif *vif, u16 ac, | 3101 | struct ieee80211_vif *vif, u16 ac, |
3064 | const struct ieee80211_tx_queue_params *params); | 3102 | const struct ieee80211_tx_queue_params *params); |
@@ -3126,8 +3164,6 @@ struct ieee80211_ops { | |||
3126 | void (*get_et_strings)(struct ieee80211_hw *hw, | 3164 | void (*get_et_strings)(struct ieee80211_hw *hw, |
3127 | struct ieee80211_vif *vif, | 3165 | struct ieee80211_vif *vif, |
3128 | u32 sset, u8 *data); | 3166 | u32 sset, u8 *data); |
3129 | int (*get_rssi)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
3130 | struct ieee80211_sta *sta, s8 *rssi_dbm); | ||
3131 | 3167 | ||
3132 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | 3168 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, |
3133 | struct ieee80211_vif *vif); | 3169 | struct ieee80211_vif *vif); |
@@ -4062,6 +4098,10 @@ void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf, | |||
4062 | * reverse order than in packet) | 4098 | * reverse order than in packet) |
4063 | * @aes_cmac: PN data, most significant byte first (big endian, | 4099 | * @aes_cmac: PN data, most significant byte first (big endian, |
4064 | * reverse order than in packet) | 4100 | * reverse order than in packet) |
4101 | * @aes_gmac: PN data, most significant byte first (big endian, | ||
4102 | * reverse order than in packet) | ||
4103 | * @gcmp: PN data, most significant byte first (big endian, | ||
4104 | * reverse order than in packet) | ||
4065 | */ | 4105 | */ |
4066 | struct ieee80211_key_seq { | 4106 | struct ieee80211_key_seq { |
4067 | union { | 4107 | union { |
@@ -4075,6 +4115,12 @@ struct ieee80211_key_seq { | |||
4075 | struct { | 4115 | struct { |
4076 | u8 pn[6]; | 4116 | u8 pn[6]; |
4077 | } aes_cmac; | 4117 | } aes_cmac; |
4118 | struct { | ||
4119 | u8 pn[6]; | ||
4120 | } aes_gmac; | ||
4121 | struct { | ||
4122 | u8 pn[6]; | ||
4123 | } gcmp; | ||
4078 | }; | 4124 | }; |
4079 | }; | 4125 | }; |
4080 | 4126 | ||
@@ -4099,7 +4145,7 @@ void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf, | |||
4099 | * ieee80211_get_key_rx_seq - get key RX sequence counter | 4145 | * ieee80211_get_key_rx_seq - get key RX sequence counter |
4100 | * | 4146 | * |
4101 | * @keyconf: the parameter passed with the set key | 4147 | * @keyconf: the parameter passed with the set key |
4102 | * @tid: The TID, or -1 for the management frame value (CCMP only); | 4148 | * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); |
4103 | * the value on TID 0 is also used for non-QoS frames. For | 4149 | * the value on TID 0 is also used for non-QoS frames. For |
4104 | * CMAC, only TID 0 is valid. | 4150 | * CMAC, only TID 0 is valid. |
4105 | * @seq: buffer to receive the sequence data | 4151 | * @seq: buffer to receive the sequence data |
@@ -4135,7 +4181,7 @@ void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf, | |||
4135 | * ieee80211_set_key_rx_seq - set key RX sequence counter | 4181 | * ieee80211_set_key_rx_seq - set key RX sequence counter |
4136 | * | 4182 | * |
4137 | * @keyconf: the parameter passed with the set key | 4183 | * @keyconf: the parameter passed with the set key |
4138 | * @tid: The TID, or -1 for the management frame value (CCMP only); | 4184 | * @tid: The TID, or -1 for the management frame value (CCMP/GCMP only); |
4139 | * the value on TID 0 is also used for non-QoS frames. For | 4185 | * the value on TID 0 is also used for non-QoS frames. For |
4140 | * CMAC, only TID 0 is valid. | 4186 | * CMAC, only TID 0 is valid. |
4141 | * @seq: new sequence data | 4187 | * @seq: new sequence data |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index c823d910b46c..850647811749 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/ieee802154.h> | 20 | #include <linux/ieee802154.h> |
21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
22 | 22 | ||
23 | #include <net/cfg802154.h> | ||
24 | |||
23 | /* General MAC frame format: | 25 | /* General MAC frame format: |
24 | * 2 bytes: Frame Control | 26 | * 2 bytes: Frame Control |
25 | * 1 byte: Sequence Number | 27 | * 1 byte: Sequence Number |
@@ -212,7 +214,8 @@ struct ieee802154_ops { | |||
212 | unsigned long changed); | 214 | unsigned long changed); |
213 | int (*set_txpower)(struct ieee802154_hw *hw, int db); | 215 | int (*set_txpower)(struct ieee802154_hw *hw, int db); |
214 | int (*set_lbt)(struct ieee802154_hw *hw, bool on); | 216 | int (*set_lbt)(struct ieee802154_hw *hw, bool on); |
215 | int (*set_cca_mode)(struct ieee802154_hw *hw, u8 mode); | 217 | int (*set_cca_mode)(struct ieee802154_hw *hw, |
218 | const struct wpan_phy_cca *cca); | ||
216 | int (*set_cca_ed_level)(struct ieee802154_hw *hw, | 219 | int (*set_cca_ed_level)(struct ieee802154_hw *hw, |
217 | s32 level); | 220 | s32 level); |
218 | int (*set_csma_params)(struct ieee802154_hw *hw, | 221 | int (*set_csma_params)(struct ieee802154_hw *hw, |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 2e8756b8c775..36faf4990c4b 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -60,6 +60,7 @@ struct net { | |||
60 | struct list_head exit_list; /* Use only net_mutex */ | 60 | struct list_head exit_list; /* Use only net_mutex */ |
61 | 61 | ||
62 | struct user_namespace *user_ns; /* Owning user namespace */ | 62 | struct user_namespace *user_ns; /* Owning user namespace */ |
63 | struct idr netns_ids; | ||
63 | 64 | ||
64 | struct ns_common ns; | 65 | struct ns_common ns; |
65 | 66 | ||
@@ -290,6 +291,9 @@ static inline struct net *read_pnet(struct net * const *pnet) | |||
290 | #define __net_initconst __initconst | 291 | #define __net_initconst __initconst |
291 | #endif | 292 | #endif |
292 | 293 | ||
294 | int peernet2id(struct net *net, struct net *peer); | ||
295 | struct net *get_net_ns_by_id(struct net *net, int id); | ||
296 | |||
293 | struct pernet_operations { | 297 | struct pernet_operations { |
294 | struct list_head list; | 298 | struct list_head list; |
295 | int (*init)(struct net *net); | 299 | int (*init)(struct net *net); |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index f0daed2b54d1..74f271a172dd 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -191,8 +191,6 @@ __nf_conntrack_find(struct net *net, u16 zone, | |||
191 | int nf_conntrack_hash_check_insert(struct nf_conn *ct); | 191 | int nf_conntrack_hash_check_insert(struct nf_conn *ct); |
192 | bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); | 192 | bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); |
193 | 193 | ||
194 | void nf_conntrack_flush_report(struct net *net, u32 portid, int report); | ||
195 | |||
196 | bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff, | 194 | bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff, |
197 | u_int16_t l3num, struct nf_conntrack_tuple *tuple); | 195 | u_int16_t l3num, struct nf_conntrack_tuple *tuple); |
198 | bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, | 196 | bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, |
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 3ae969e3acf0..9eaaa7884586 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
@@ -530,6 +530,8 @@ enum nft_chain_type { | |||
530 | 530 | ||
531 | int nft_chain_validate_dependency(const struct nft_chain *chain, | 531 | int nft_chain_validate_dependency(const struct nft_chain *chain, |
532 | enum nft_chain_type type); | 532 | enum nft_chain_type type); |
533 | int nft_chain_validate_hooks(const struct nft_chain *chain, | ||
534 | unsigned int hook_flags); | ||
533 | 535 | ||
534 | struct nft_stats { | 536 | struct nft_stats { |
535 | u64 bytes; | 537 | u64 bytes; |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 64158353ecb2..e010ee8da41d 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -490,14 +490,10 @@ static inline struct sk_buff *nlmsg_new(size_t payload, gfp_t flags) | |||
490 | * Corrects the netlink message header to include the appeneded | 490 | * Corrects the netlink message header to include the appeneded |
491 | * attributes. Only necessary if attributes have been added to | 491 | * attributes. Only necessary if attributes have been added to |
492 | * the message. | 492 | * the message. |
493 | * | ||
494 | * Returns the total data length of the skb. | ||
495 | */ | 493 | */ |
496 | static inline int nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) | 494 | static inline void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) |
497 | { | 495 | { |
498 | nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; | 496 | nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; |
499 | |||
500 | return skb->len; | ||
501 | } | 497 | } |
502 | 498 | ||
503 | /** | 499 | /** |
@@ -520,8 +516,10 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb) | |||
520 | */ | 516 | */ |
521 | static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) | 517 | static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) |
522 | { | 518 | { |
523 | if (mark) | 519 | if (mark) { |
520 | WARN_ON((unsigned char *) mark < skb->data); | ||
524 | skb_trim(skb, (unsigned char *) mark - skb->data); | 521 | skb_trim(skb, (unsigned char *) mark - skb->data); |
522 | } | ||
525 | } | 523 | } |
526 | 524 | ||
527 | /** | 525 | /** |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 24945cefc4fd..dbe225478adb 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -48,10 +48,12 @@ struct netns_ipv4 { | |||
48 | struct hlist_head *fib_table_hash; | 48 | struct hlist_head *fib_table_hash; |
49 | struct sock *fibnl; | 49 | struct sock *fibnl; |
50 | 50 | ||
51 | struct sock **icmp_sk; | 51 | struct sock * __percpu *icmp_sk; |
52 | |||
52 | struct inet_peer_base *peers; | 53 | struct inet_peer_base *peers; |
53 | struct tcpm_hash_bucket *tcp_metrics_hash; | 54 | struct tcpm_hash_bucket *tcp_metrics_hash; |
54 | unsigned int tcp_metrics_hash_log; | 55 | unsigned int tcp_metrics_hash_log; |
56 | struct sock * __percpu *tcp_sk; | ||
55 | struct netns_frags frags; | 57 | struct netns_frags frags; |
56 | #ifdef CONFIG_NETFILTER | 58 | #ifdef CONFIG_NETFILTER |
57 | struct xt_table *iptable_filter; | 59 | struct xt_table *iptable_filter; |
@@ -80,6 +82,8 @@ struct netns_ipv4 { | |||
80 | 82 | ||
81 | int sysctl_fwmark_reflect; | 83 | int sysctl_fwmark_reflect; |
82 | int sysctl_tcp_fwmark_accept; | 84 | int sysctl_tcp_fwmark_accept; |
85 | int sysctl_tcp_mtu_probing; | ||
86 | int sysctl_tcp_base_mss; | ||
83 | 87 | ||
84 | struct ping_group_range ping_group_range; | 88 | struct ping_group_range ping_group_range; |
85 | 89 | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 14bd0e1c47fa..ab672b537dd4 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -51,8 +51,10 @@ struct nfc_hci_ops { | |||
51 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | 51 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); |
52 | int (*check_presence)(struct nfc_hci_dev *hdev, | 52 | int (*check_presence)(struct nfc_hci_dev *hdev, |
53 | struct nfc_target *target); | 53 | struct nfc_target *target); |
54 | int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 54 | int (*event_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 event, |
55 | struct sk_buff *skb); | 55 | struct sk_buff *skb); |
56 | void (*cmd_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, | ||
57 | struct sk_buff *skb); | ||
56 | int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); | 58 | int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); |
57 | int (*discover_se)(struct nfc_hci_dev *dev); | 59 | int (*discover_se)(struct nfc_hci_dev *dev); |
58 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); | 60 | int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); |
@@ -63,8 +65,10 @@ struct nfc_hci_ops { | |||
63 | }; | 65 | }; |
64 | 66 | ||
65 | /* Pipes */ | 67 | /* Pipes */ |
66 | #define NFC_HCI_INVALID_PIPE 0x80 | ||
67 | #define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 | 68 | #define NFC_HCI_DO_NOT_CREATE_PIPE 0x81 |
69 | #define NFC_HCI_INVALID_PIPE 0x80 | ||
70 | #define NFC_HCI_INVALID_GATE 0xFF | ||
71 | #define NFC_HCI_INVALID_HOST 0x80 | ||
68 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 | 72 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 |
69 | #define NFC_HCI_ADMIN_PIPE 0x01 | 73 | #define NFC_HCI_ADMIN_PIPE 0x01 |
70 | 74 | ||
@@ -73,7 +77,13 @@ struct nfc_hci_gate { | |||
73 | u8 pipe; | 77 | u8 pipe; |
74 | }; | 78 | }; |
75 | 79 | ||
80 | struct nfc_hci_pipe { | ||
81 | u8 gate; | ||
82 | u8 dest_host; | ||
83 | }; | ||
84 | |||
76 | #define NFC_HCI_MAX_CUSTOM_GATES 50 | 85 | #define NFC_HCI_MAX_CUSTOM_GATES 50 |
86 | #define NFC_HCI_MAX_PIPES 127 | ||
77 | struct nfc_hci_init_data { | 87 | struct nfc_hci_init_data { |
78 | u8 gate_count; | 88 | u8 gate_count; |
79 | struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; | 89 | struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; |
@@ -125,6 +135,7 @@ struct nfc_hci_dev { | |||
125 | void *clientdata; | 135 | void *clientdata; |
126 | 136 | ||
127 | u8 gate2pipe[NFC_HCI_MAX_GATES]; | 137 | u8 gate2pipe[NFC_HCI_MAX_GATES]; |
138 | struct nfc_hci_pipe pipes[NFC_HCI_MAX_PIPES]; | ||
128 | 139 | ||
129 | u8 sw_romlib; | 140 | u8 sw_romlib; |
130 | u8 sw_patch; | 141 | u8 sw_patch; |
@@ -167,6 +178,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
167 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 178 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
168 | 179 | ||
169 | int nfc_hci_result_to_errno(u8 result); | 180 | int nfc_hci_result_to_errno(u8 result); |
181 | void nfc_hci_reset_pipes(struct nfc_hci_dev *dev); | ||
182 | void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host); | ||
170 | 183 | ||
171 | /* Host IDs */ | 184 | /* Host IDs */ |
172 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 185 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
@@ -219,6 +232,12 @@ int nfc_hci_result_to_errno(u8 result); | |||
219 | #define NFC_HCI_EVT_POST_DATA 0x02 | 232 | #define NFC_HCI_EVT_POST_DATA 0x02 |
220 | #define NFC_HCI_EVT_HOT_PLUG 0x03 | 233 | #define NFC_HCI_EVT_HOT_PLUG 0x03 |
221 | 234 | ||
235 | /* Generic commands */ | ||
236 | #define NFC_HCI_ANY_SET_PARAMETER 0x01 | ||
237 | #define NFC_HCI_ANY_GET_PARAMETER 0x02 | ||
238 | #define NFC_HCI_ANY_OPEN_PIPE 0x03 | ||
239 | #define NFC_HCI_ANY_CLOSE_PIPE 0x04 | ||
240 | |||
222 | /* Reader RF gates events */ | 241 | /* Reader RF gates events */ |
223 | #define NFC_HCI_EVT_READER_REQUESTED 0x10 | 242 | #define NFC_HCI_EVT_READER_REQUESTED 0x10 |
224 | #define NFC_HCI_EVT_END_OPERATION 0x11 | 243 | #define NFC_HCI_EVT_END_OPERATION 0x11 |
@@ -249,8 +268,6 @@ int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | |||
249 | int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | 268 | int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, |
250 | const u8 *param, size_t param_len, | 269 | const u8 *param, size_t param_len, |
251 | data_exchange_cb_t cb, void *cb_context); | 270 | data_exchange_cb_t cb, void *cb_context); |
252 | int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | ||
253 | const u8 *param, size_t param_len); | ||
254 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 271 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
255 | const u8 *param, size_t param_len); | 272 | const u8 *param, size_t param_len); |
256 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | 273 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); |
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index e7257a4653b4..a2f2f3d3196d 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
@@ -62,6 +62,25 @@ | |||
62 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 | 62 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 |
63 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 | 63 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 |
64 | 64 | ||
65 | /* NFCEE Interface/Protocols */ | ||
66 | #define NCI_NFCEE_INTERFACE_APDU 0x00 | ||
67 | #define NCI_NFCEE_INTERFACE_HCI_ACCESS 0x01 | ||
68 | #define NCI_NFCEE_INTERFACE_TYPE3_CMD_SET 0x02 | ||
69 | #define NCI_NFCEE_INTERFACE_TRANSPARENT 0x03 | ||
70 | |||
71 | /* Destination type */ | ||
72 | #define NCI_DESTINATION_NFCC_LOOPBACK 0x01 | ||
73 | #define NCI_DESTINATION_REMOTE_NFC_ENDPOINT 0x02 | ||
74 | #define NCI_DESTINATION_NFCEE 0x03 | ||
75 | |||
76 | /* Destination-specific parameters type */ | ||
77 | #define NCI_DESTINATION_SPECIFIC_PARAM_RF_TYPE 0x00 | ||
78 | #define NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE 0x01 | ||
79 | |||
80 | /* NFCEE Discovery Action */ | ||
81 | #define NCI_NFCEE_DISCOVERY_ACTION_DISABLE 0x00 | ||
82 | #define NCI_NFCEE_DISCOVERY_ACTION_ENABLE 0x01 | ||
83 | |||
65 | /* NCI RF Technology and Mode */ | 84 | /* NCI RF Technology and Mode */ |
66 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 | 85 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 |
67 | #define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 | 86 | #define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 |
@@ -224,6 +243,28 @@ struct nci_core_set_config_cmd { | |||
224 | struct set_config_param param; /* support 1 param per cmd is enough */ | 243 | struct set_config_param param; /* support 1 param per cmd is enough */ |
225 | } __packed; | 244 | } __packed; |
226 | 245 | ||
246 | #define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
247 | #define DEST_SPEC_PARAMS_ID_INDEX 0 | ||
248 | #define DEST_SPEC_PARAMS_PROTOCOL_INDEX 1 | ||
249 | struct dest_spec_params { | ||
250 | __u8 id; | ||
251 | __u8 protocol; | ||
252 | } __packed; | ||
253 | |||
254 | struct core_conn_create_dest_spec_params { | ||
255 | __u8 type; | ||
256 | __u8 length; | ||
257 | __u8 value[0]; | ||
258 | } __packed; | ||
259 | |||
260 | struct nci_core_conn_create_cmd { | ||
261 | __u8 destination_type; | ||
262 | __u8 number_destination_params; | ||
263 | struct core_conn_create_dest_spec_params params[0]; | ||
264 | } __packed; | ||
265 | |||
266 | #define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x05) | ||
267 | |||
227 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 268 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
228 | struct disc_map_config { | 269 | struct disc_map_config { |
229 | __u8 rf_protocol; | 270 | __u8 rf_protocol; |
@@ -260,6 +301,19 @@ struct nci_rf_deactivate_cmd { | |||
260 | __u8 type; | 301 | __u8 type; |
261 | } __packed; | 302 | } __packed; |
262 | 303 | ||
304 | #define NCI_OP_NFCEE_DISCOVER_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
305 | struct nci_nfcee_discover_cmd { | ||
306 | __u8 discovery_action; | ||
307 | } __packed; | ||
308 | |||
309 | #define NCI_OP_NFCEE_MODE_SET_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01) | ||
310 | #define NCI_NFCEE_DISABLE 0x00 | ||
311 | #define NCI_NFCEE_ENABLE 0x01 | ||
312 | struct nci_nfcee_mode_set_cmd { | ||
313 | __u8 nfcee_id; | ||
314 | __u8 nfcee_mode; | ||
315 | } __packed; | ||
316 | |||
263 | /* ----------------------- */ | 317 | /* ----------------------- */ |
264 | /* ---- NCI Responses ---- */ | 318 | /* ---- NCI Responses ---- */ |
265 | /* ----------------------- */ | 319 | /* ----------------------- */ |
@@ -295,6 +349,16 @@ struct nci_core_set_config_rsp { | |||
295 | __u8 params_id[0]; /* variable size array */ | 349 | __u8 params_id[0]; /* variable size array */ |
296 | } __packed; | 350 | } __packed; |
297 | 351 | ||
352 | #define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
353 | struct nci_core_conn_create_rsp { | ||
354 | __u8 status; | ||
355 | __u8 max_ctrl_pkt_payload_len; | ||
356 | __u8 credits_cnt; | ||
357 | __u8 conn_id; | ||
358 | } __packed; | ||
359 | |||
360 | #define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x05) | ||
361 | |||
298 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 362 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
299 | 363 | ||
300 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | 364 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) |
@@ -303,6 +367,13 @@ struct nci_core_set_config_rsp { | |||
303 | 367 | ||
304 | #define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) | 368 | #define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) |
305 | 369 | ||
370 | #define NCI_OP_NFCEE_DISCOVER_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
371 | struct nci_nfcee_discover_rsp { | ||
372 | __u8 status; | ||
373 | __u8 num_nfcee; | ||
374 | } __packed; | ||
375 | |||
376 | #define NCI_OP_NFCEE_MODE_SET_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01) | ||
306 | /* --------------------------- */ | 377 | /* --------------------------- */ |
307 | /* ---- NCI Notifications ---- */ | 378 | /* ---- NCI Notifications ---- */ |
308 | /* --------------------------- */ | 379 | /* --------------------------- */ |
@@ -430,4 +501,30 @@ struct nci_rf_deactivate_ntf { | |||
430 | __u8 reason; | 501 | __u8 reason; |
431 | } __packed; | 502 | } __packed; |
432 | 503 | ||
504 | #define NCI_OP_RF_NFCEE_ACTION_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x09) | ||
505 | struct nci_rf_nfcee_action_ntf { | ||
506 | __u8 nfcee_id; | ||
507 | __u8 trigger; | ||
508 | __u8 supported_data_length; | ||
509 | __u8 supported_data[0]; | ||
510 | } __packed; | ||
511 | |||
512 | #define NCI_OP_NFCEE_DISCOVER_NTF nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
513 | struct nci_nfcee_supported_protocol { | ||
514 | __u8 num_protocol; | ||
515 | __u8 supported_protocol[0]; | ||
516 | } __packed; | ||
517 | |||
518 | struct nci_nfcee_information_tlv { | ||
519 | __u8 num_tlv; | ||
520 | __u8 information_tlv[0]; | ||
521 | } __packed; | ||
522 | |||
523 | struct nci_nfcee_discover_ntf { | ||
524 | __u8 nfcee_id; | ||
525 | __u8 nfcee_status; | ||
526 | struct nci_nfcee_supported_protocol supported_protocols; | ||
527 | struct nci_nfcee_information_tlv information_tlv; | ||
528 | } __packed; | ||
529 | |||
433 | #endif /* __NCI_H */ | 530 | #endif /* __NCI_H */ |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 9e51bb4d841e..ff87f8611fa3 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
@@ -78,15 +78,107 @@ struct nci_ops { | |||
78 | int (*se_io)(struct nci_dev *ndev, u32 se_idx, | 78 | int (*se_io)(struct nci_dev *ndev, u32 se_idx, |
79 | u8 *apdu, size_t apdu_length, | 79 | u8 *apdu, size_t apdu_length, |
80 | se_io_cb_t cb, void *cb_context); | 80 | se_io_cb_t cb, void *cb_context); |
81 | int (*hci_load_session)(struct nci_dev *ndev); | ||
82 | void (*hci_event_received)(struct nci_dev *ndev, u8 pipe, u8 event, | ||
83 | struct sk_buff *skb); | ||
84 | void (*hci_cmd_received)(struct nci_dev *ndev, u8 pipe, u8 cmd, | ||
85 | struct sk_buff *skb); | ||
81 | }; | 86 | }; |
82 | 87 | ||
83 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 | 88 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 |
84 | #define NCI_MAX_DISCOVERED_TARGETS 10 | 89 | #define NCI_MAX_DISCOVERED_TARGETS 10 |
90 | #define NCI_MAX_NUM_NFCEE 255 | ||
91 | #define NCI_MAX_CONN_ID 7 | ||
92 | |||
93 | struct nci_conn_info { | ||
94 | struct list_head list; | ||
95 | __u8 id; /* can be an RF Discovery ID or an NFCEE ID */ | ||
96 | __u8 conn_id; | ||
97 | __u8 max_pkt_payload_len; | ||
98 | |||
99 | atomic_t credits_cnt; | ||
100 | __u8 initial_num_credits; | ||
101 | |||
102 | data_exchange_cb_t data_exchange_cb; | ||
103 | void *data_exchange_cb_context; | ||
104 | |||
105 | struct sk_buff *rx_skb; | ||
106 | }; | ||
107 | |||
108 | #define NCI_INVALID_CONN_ID 0x80 | ||
109 | |||
110 | #define NCI_HCI_ANY_OPEN_PIPE 0x03 | ||
111 | |||
112 | /* Gates */ | ||
113 | #define NCI_HCI_ADMIN_GATE 0x00 | ||
114 | #define NCI_HCI_LINK_MGMT_GATE 0x06 | ||
115 | |||
116 | /* Pipes */ | ||
117 | #define NCI_HCI_LINK_MGMT_PIPE 0x00 | ||
118 | #define NCI_HCI_ADMIN_PIPE 0x01 | ||
119 | |||
120 | /* Generic responses */ | ||
121 | #define NCI_HCI_ANY_OK 0x00 | ||
122 | #define NCI_HCI_ANY_E_NOT_CONNECTED 0x01 | ||
123 | #define NCI_HCI_ANY_E_CMD_PAR_UNKNOWN 0x02 | ||
124 | #define NCI_HCI_ANY_E_NOK 0x03 | ||
125 | #define NCI_HCI_ANY_E_PIPES_FULL 0x04 | ||
126 | #define NCI_HCI_ANY_E_REG_PAR_UNKNOWN 0x05 | ||
127 | #define NCI_HCI_ANY_E_PIPE_NOT_OPENED 0x06 | ||
128 | #define NCI_HCI_ANY_E_CMD_NOT_SUPPORTED 0x07 | ||
129 | #define NCI_HCI_ANY_E_INHIBITED 0x08 | ||
130 | #define NCI_HCI_ANY_E_TIMEOUT 0x09 | ||
131 | #define NCI_HCI_ANY_E_REG_ACCESS_DENIED 0x0a | ||
132 | #define NCI_HCI_ANY_E_PIPE_ACCESS_DENIED 0x0b | ||
133 | |||
134 | #define NCI_HCI_DO_NOT_OPEN_PIPE 0x81 | ||
135 | #define NCI_HCI_INVALID_PIPE 0x80 | ||
136 | #define NCI_HCI_INVALID_GATE 0xFF | ||
137 | #define NCI_HCI_INVALID_HOST 0x80 | ||
138 | |||
139 | #define NCI_HCI_MAX_CUSTOM_GATES 50 | ||
140 | #define NCI_HCI_MAX_PIPES 127 | ||
141 | |||
142 | struct nci_hci_gate { | ||
143 | u8 gate; | ||
144 | u8 pipe; | ||
145 | u8 dest_host; | ||
146 | } __packed; | ||
147 | |||
148 | struct nci_hci_pipe { | ||
149 | u8 gate; | ||
150 | u8 host; | ||
151 | } __packed; | ||
152 | |||
153 | struct nci_hci_init_data { | ||
154 | u8 gate_count; | ||
155 | struct nci_hci_gate gates[NCI_HCI_MAX_CUSTOM_GATES]; | ||
156 | char session_id[9]; | ||
157 | }; | ||
158 | |||
159 | #define NCI_HCI_MAX_GATES 256 | ||
160 | |||
161 | struct nci_hci_dev { | ||
162 | u8 nfcee_id; | ||
163 | struct nci_dev *ndev; | ||
164 | struct nci_conn_info *conn_info; | ||
165 | |||
166 | struct nci_hci_init_data init_data; | ||
167 | struct nci_hci_pipe pipes[NCI_HCI_MAX_PIPES]; | ||
168 | u8 gate2pipe[NCI_HCI_MAX_GATES]; | ||
169 | int expected_pipes; | ||
170 | int count_pipes; | ||
171 | |||
172 | struct sk_buff_head rx_hcp_frags; | ||
173 | struct work_struct msg_rx_work; | ||
174 | struct sk_buff_head msg_rx_queue; | ||
175 | }; | ||
85 | 176 | ||
86 | /* NCI Core structures */ | 177 | /* NCI Core structures */ |
87 | struct nci_dev { | 178 | struct nci_dev { |
88 | struct nfc_dev *nfc_dev; | 179 | struct nfc_dev *nfc_dev; |
89 | struct nci_ops *ops; | 180 | struct nci_ops *ops; |
181 | struct nci_hci_dev *hci_dev; | ||
90 | 182 | ||
91 | int tx_headroom; | 183 | int tx_headroom; |
92 | int tx_tailroom; | 184 | int tx_tailroom; |
@@ -95,7 +187,10 @@ struct nci_dev { | |||
95 | unsigned long flags; | 187 | unsigned long flags; |
96 | 188 | ||
97 | atomic_t cmd_cnt; | 189 | atomic_t cmd_cnt; |
98 | atomic_t credits_cnt; | 190 | __u8 cur_conn_id; |
191 | |||
192 | struct list_head conn_info_list; | ||
193 | struct nci_conn_info *rf_conn_info; | ||
99 | 194 | ||
100 | struct timer_list cmd_timer; | 195 | struct timer_list cmd_timer; |
101 | struct timer_list data_timer; | 196 | struct timer_list data_timer; |
@@ -141,13 +236,10 @@ struct nci_dev { | |||
141 | __u8 manufact_id; | 236 | __u8 manufact_id; |
142 | __u32 manufact_specific_info; | 237 | __u32 manufact_specific_info; |
143 | 238 | ||
144 | /* received during NCI_OP_RF_INTF_ACTIVATED_NTF */ | 239 | /* Save RF Discovery ID or NFCEE ID under conn_create */ |
145 | __u8 max_data_pkt_payload_size; | 240 | __u8 cur_id; |
146 | __u8 initial_num_credits; | ||
147 | 241 | ||
148 | /* stored during nci_data_exchange */ | 242 | /* stored during nci_data_exchange */ |
149 | data_exchange_cb_t data_exchange_cb; | ||
150 | void *data_exchange_cb_context; | ||
151 | struct sk_buff *rx_data_reassembly; | 243 | struct sk_buff *rx_data_reassembly; |
152 | 244 | ||
153 | /* stored during intf_activated_ntf */ | 245 | /* stored during intf_activated_ntf */ |
@@ -163,9 +255,36 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops, | |||
163 | void nci_free_device(struct nci_dev *ndev); | 255 | void nci_free_device(struct nci_dev *ndev); |
164 | int nci_register_device(struct nci_dev *ndev); | 256 | int nci_register_device(struct nci_dev *ndev); |
165 | void nci_unregister_device(struct nci_dev *ndev); | 257 | void nci_unregister_device(struct nci_dev *ndev); |
258 | int nci_request(struct nci_dev *ndev, | ||
259 | void (*req)(struct nci_dev *ndev, | ||
260 | unsigned long opt), | ||
261 | unsigned long opt, __u32 timeout); | ||
166 | int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); | 262 | int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); |
167 | int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); | 263 | int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); |
168 | 264 | ||
265 | int nci_nfcee_discover(struct nci_dev *ndev, u8 action); | ||
266 | int nci_nfcee_mode_set(struct nci_dev *ndev, u8 nfcee_id, u8 nfcee_mode); | ||
267 | int nci_core_conn_create(struct nci_dev *ndev, u8 destination_type, | ||
268 | u8 number_destination_params, | ||
269 | size_t params_len, | ||
270 | struct core_conn_create_dest_spec_params *params); | ||
271 | int nci_core_conn_close(struct nci_dev *ndev, u8 conn_id); | ||
272 | |||
273 | struct nci_hci_dev *nci_hci_allocate(struct nci_dev *ndev); | ||
274 | int nci_hci_send_event(struct nci_dev *ndev, u8 gate, u8 event, | ||
275 | const u8 *param, size_t param_len); | ||
276 | int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, | ||
277 | u8 cmd, const u8 *param, size_t param_len, | ||
278 | struct sk_buff **skb); | ||
279 | int nci_hci_open_pipe(struct nci_dev *ndev, u8 pipe); | ||
280 | int nci_hci_connect_gate(struct nci_dev *ndev, u8 dest_host, | ||
281 | u8 dest_gate, u8 pipe); | ||
282 | int nci_hci_set_param(struct nci_dev *ndev, u8 gate, u8 idx, | ||
283 | const u8 *param, size_t param_len); | ||
284 | int nci_hci_get_param(struct nci_dev *ndev, u8 gate, u8 idx, | ||
285 | struct sk_buff **skb); | ||
286 | int nci_hci_dev_session_init(struct nci_dev *ndev); | ||
287 | |||
169 | static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, | 288 | static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, |
170 | unsigned int len, | 289 | unsigned int len, |
171 | gfp_t how) | 290 | gfp_t how) |
@@ -200,7 +319,9 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb); | |||
200 | int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload); | 319 | int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload); |
201 | int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); | 320 | int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); |
202 | void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, | 321 | void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, |
203 | int err); | 322 | __u8 conn_id, int err); |
323 | void nci_hci_data_received_cb(void *context, struct sk_buff *skb, int err); | ||
324 | |||
204 | void nci_clear_target_list(struct nci_dev *ndev); | 325 | void nci_clear_target_list(struct nci_dev *ndev); |
205 | 326 | ||
206 | /* ----- NCI requests ----- */ | 327 | /* ----- NCI requests ----- */ |
@@ -209,6 +330,8 @@ void nci_clear_target_list(struct nci_dev *ndev); | |||
209 | #define NCI_REQ_CANCELED 2 | 330 | #define NCI_REQ_CANCELED 2 |
210 | 331 | ||
211 | void nci_req_complete(struct nci_dev *ndev, int result); | 332 | void nci_req_complete(struct nci_dev *ndev, int result); |
333 | struct nci_conn_info *nci_get_conn_info_by_conn_id(struct nci_dev *ndev, | ||
334 | int conn_id); | ||
212 | 335 | ||
213 | /* ----- NCI status code ----- */ | 336 | /* ----- NCI status code ----- */ |
214 | int nci_to_errno(__u8 code); | 337 | int nci_to_errno(__u8 code); |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 12adb817c27a..73190e65d5c1 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -135,6 +135,31 @@ struct nfc_se { | |||
135 | u16 state; | 135 | u16 state; |
136 | }; | 136 | }; |
137 | 137 | ||
138 | /** | ||
139 | * nfc_evt_transaction - A struct for NFC secure element event transaction. | ||
140 | * | ||
141 | * @aid: The application identifier triggering the event | ||
142 | * | ||
143 | * @aid_len: The application identifier length [5:16] | ||
144 | * | ||
145 | * @params: The application parameters transmitted during the transaction | ||
146 | * | ||
147 | * @params_len: The applications parameters length [0:255] | ||
148 | * | ||
149 | */ | ||
150 | #define NFC_MIN_AID_LENGTH 5 | ||
151 | #define NFC_MAX_AID_LENGTH 16 | ||
152 | #define NFC_MAX_PARAMS_LENGTH 255 | ||
153 | |||
154 | #define NFC_EVT_TRANSACTION_AID_TAG 0x81 | ||
155 | #define NFC_EVT_TRANSACTION_PARAMS_TAG 0x82 | ||
156 | struct nfc_evt_transaction { | ||
157 | u32 aid_len; | ||
158 | u8 aid[NFC_MAX_AID_LENGTH]; | ||
159 | u8 params_len; | ||
160 | u8 params[NFC_MAX_PARAMS_LENGTH]; | ||
161 | } __packed; | ||
162 | |||
138 | struct nfc_genl_data { | 163 | struct nfc_genl_data { |
139 | u32 poll_req_portid; | 164 | u32 poll_req_portid; |
140 | struct mutex genl_data_mutex; | 165 | struct mutex genl_data_mutex; |
@@ -262,6 +287,8 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); | |||
262 | 287 | ||
263 | void nfc_driver_failure(struct nfc_dev *dev, int err); | 288 | void nfc_driver_failure(struct nfc_dev *dev, int err); |
264 | 289 | ||
290 | int nfc_se_transaction(struct nfc_dev *dev, u8 se_idx, | ||
291 | struct nfc_evt_transaction *evt_transaction); | ||
265 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); | 292 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); |
266 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); | 293 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); |
267 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); | 294 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); |
diff --git a/include/net/nl802154.h b/include/net/nl802154.h index 6dbd406ca41b..f8b5bc997959 100644 --- a/include/net/nl802154.h +++ b/include/net/nl802154.h | |||
@@ -82,7 +82,7 @@ enum nl802154_attrs { | |||
82 | NL802154_ATTR_TX_POWER, | 82 | NL802154_ATTR_TX_POWER, |
83 | 83 | ||
84 | NL802154_ATTR_CCA_MODE, | 84 | NL802154_ATTR_CCA_MODE, |
85 | NL802154_ATTR_CCA_MODE3_AND, | 85 | NL802154_ATTR_CCA_OPT, |
86 | NL802154_ATTR_CCA_ED_LEVEL, | 86 | NL802154_ATTR_CCA_ED_LEVEL, |
87 | 87 | ||
88 | NL802154_ATTR_MAX_FRAME_RETRIES, | 88 | NL802154_ATTR_MAX_FRAME_RETRIES, |
@@ -119,4 +119,47 @@ enum nl802154_iftype { | |||
119 | NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1 | 119 | NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1 |
120 | }; | 120 | }; |
121 | 121 | ||
122 | /** | ||
123 | * enum nl802154_cca_modes - cca modes | ||
124 | * | ||
125 | * @__NL802154_CCA_INVALID: cca mode number 0 is reserved | ||
126 | * @NL802154_CCA_ENERGY: Energy above threshold | ||
127 | * @NL802154_CCA_CARRIER: Carrier sense only | ||
128 | * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold | ||
129 | * @NL802154_CCA_ALOHA: CCA shall always report an idle medium | ||
130 | * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame | ||
131 | * @NL802154_CCA_UWB_MULTIPEXED: UWB preamble sense based on the packet with | ||
132 | * the multiplexed preamble | ||
133 | * @__NL802154_CCA_ATTR_AFTER_LAST: Internal | ||
134 | * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number | ||
135 | */ | ||
136 | enum nl802154_cca_modes { | ||
137 | __NL802154_CCA_INVALID, | ||
138 | NL802154_CCA_ENERGY, | ||
139 | NL802154_CCA_CARRIER, | ||
140 | NL802154_CCA_ENERGY_CARRIER, | ||
141 | NL802154_CCA_ALOHA, | ||
142 | NL802154_CCA_UWB_SHR, | ||
143 | NL802154_CCA_UWB_MULTIPEXED, | ||
144 | |||
145 | /* keep last */ | ||
146 | __NL802154_CCA_ATTR_AFTER_LAST, | ||
147 | NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1 | ||
148 | }; | ||
149 | |||
150 | /** | ||
151 | * enum nl802154_cca_opts - additional options for cca modes | ||
152 | * | ||
153 | * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR | ||
154 | * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND | ||
155 | */ | ||
156 | enum nl802154_cca_opts { | ||
157 | NL802154_CCA_OPT_ENERGY_CARRIER_AND, | ||
158 | NL802154_CCA_OPT_ENERGY_CARRIER_OR, | ||
159 | |||
160 | /* keep last */ | ||
161 | __NL802154_CCA_OPT_ATTR_AFTER_LAST, | ||
162 | NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1 | ||
163 | }; | ||
164 | |||
122 | #endif /* __NL802154_H */ | 165 | #endif /* __NL802154_H */ |
diff --git a/include/net/ping.h b/include/net/ping.h index f074060bc5de..cc16d413f681 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
@@ -59,7 +59,7 @@ extern struct pingv6_ops pingv6_ops; | |||
59 | 59 | ||
60 | struct pingfakehdr { | 60 | struct pingfakehdr { |
61 | struct icmphdr icmph; | 61 | struct icmphdr icmph; |
62 | struct iovec *iov; | 62 | struct msghdr *msg; |
63 | sa_family_t family; | 63 | sa_family_t family; |
64 | __wsum wcheck; | 64 | __wsum wcheck; |
65 | }; | 65 | }; |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 27a33833ff4a..2342bf12cb78 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/jiffies.h> | 4 | #include <linux/jiffies.h> |
5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
6 | #include <linux/if_vlan.h> | ||
6 | #include <net/sch_generic.h> | 7 | #include <net/sch_generic.h> |
7 | 8 | ||
8 | struct qdisc_walker { | 9 | struct qdisc_walker { |
@@ -114,6 +115,17 @@ int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, | |||
114 | int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, | 115 | int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
115 | struct tcf_result *res); | 116 | struct tcf_result *res); |
116 | 117 | ||
118 | static inline __be16 tc_skb_protocol(const struct sk_buff *skb) | ||
119 | { | ||
120 | /* We need to take extra care in case the skb came via | ||
121 | * vlan accelerated path. In that case, use skb->vlan_proto | ||
122 | * as the original vlan header was already stripped. | ||
123 | */ | ||
124 | if (skb_vlan_tag_present(skb)) | ||
125 | return skb->vlan_proto; | ||
126 | return skb->protocol; | ||
127 | } | ||
128 | |||
117 | /* Calculate maximal size of packet seen by hard_start_xmit | 129 | /* Calculate maximal size of packet seen by hard_start_xmit |
118 | routine of this device. | 130 | routine of this device. |
119 | */ | 131 | */ |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index b776d72d84be..ebc5a2ed8631 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -147,6 +147,24 @@ struct regulatory_request { | |||
147 | * NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO, | 147 | * NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO, |
148 | * NL80211_IFTYPE_P2P_DEVICE. The flag will be set by default if a device | 148 | * NL80211_IFTYPE_P2P_DEVICE. The flag will be set by default if a device |
149 | * includes any modes unsupported for enforcement checking. | 149 | * includes any modes unsupported for enforcement checking. |
150 | * @REGULATORY_WIPHY_SELF_MANAGED: for devices that employ wiphy-specific | ||
151 | * regdom management. These devices will ignore all regdom changes not | ||
152 | * originating from their own wiphy. | ||
153 | * A self-managed wiphys only employs regulatory information obtained from | ||
154 | * the FW and driver and does not use other cfg80211 sources like | ||
155 | * beacon-hints, country-code IEs and hints from other devices on the same | ||
156 | * system. Conversely, a self-managed wiphy does not share its regulatory | ||
157 | * hints with other devices in the system. If a system contains several | ||
158 | * devices, one or more of which are self-managed, there might be | ||
159 | * contradictory regulatory settings between them. Usage of flag is | ||
160 | * generally discouraged. Only use it if the FW/driver is incompatible | ||
161 | * with non-locally originated hints. | ||
162 | * This flag is incompatible with the flags: %REGULATORY_CUSTOM_REG, | ||
163 | * %REGULATORY_STRICT_REG, %REGULATORY_COUNTRY_IE_FOLLOW_POWER, | ||
164 | * %REGULATORY_COUNTRY_IE_IGNORE and %REGULATORY_DISABLE_BEACON_HINTS. | ||
165 | * Mixing any of the above flags with this flag will result in a failure | ||
166 | * to register the wiphy. This flag implies | ||
167 | * %REGULATORY_DISABLE_BEACON_HINTS and %REGULATORY_COUNTRY_IE_IGNORE. | ||
150 | */ | 168 | */ |
151 | enum ieee80211_regulatory_flags { | 169 | enum ieee80211_regulatory_flags { |
152 | REGULATORY_CUSTOM_REG = BIT(0), | 170 | REGULATORY_CUSTOM_REG = BIT(0), |
@@ -156,6 +174,7 @@ enum ieee80211_regulatory_flags { | |||
156 | REGULATORY_COUNTRY_IE_IGNORE = BIT(4), | 174 | REGULATORY_COUNTRY_IE_IGNORE = BIT(4), |
157 | REGULATORY_ENABLE_RELAX_NO_IR = BIT(5), | 175 | REGULATORY_ENABLE_RELAX_NO_IR = BIT(5), |
158 | REGULATORY_IGNORE_STALE_KICKOFF = BIT(6), | 176 | REGULATORY_IGNORE_STALE_KICKOFF = BIT(6), |
177 | REGULATORY_WIPHY_SELF_MANAGED = BIT(7), | ||
159 | }; | 178 | }; |
160 | 179 | ||
161 | struct ieee80211_freq_range { | 180 | struct ieee80211_freq_range { |
diff --git a/include/net/route.h b/include/net/route.h index b17cf28f996e..fe22d03afb6a 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -46,6 +46,7 @@ | |||
46 | 46 | ||
47 | struct fib_nh; | 47 | struct fib_nh; |
48 | struct fib_info; | 48 | struct fib_info; |
49 | struct uncached_list; | ||
49 | struct rtable { | 50 | struct rtable { |
50 | struct dst_entry dst; | 51 | struct dst_entry dst; |
51 | 52 | ||
@@ -64,6 +65,7 @@ struct rtable { | |||
64 | u32 rt_pmtu; | 65 | u32 rt_pmtu; |
65 | 66 | ||
66 | struct list_head rt_uncached; | 67 | struct list_head rt_uncached; |
68 | struct uncached_list *rt_uncached_list; | ||
67 | }; | 69 | }; |
68 | 70 | ||
69 | static inline bool rt_is_input_route(const struct rtable *rt) | 71 | static inline bool rt_is_input_route(const struct rtable *rt) |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index e21b9f9653c0..6c6d5393fc34 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -46,6 +46,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) | |||
46 | * to create when creating a new device. | 46 | * to create when creating a new device. |
47 | * @get_num_rx_queues: Function to determine number of receive queues | 47 | * @get_num_rx_queues: Function to determine number of receive queues |
48 | * to create when creating a new device. | 48 | * to create when creating a new device. |
49 | * @get_link_net: Function to get the i/o netns of the device | ||
49 | */ | 50 | */ |
50 | struct rtnl_link_ops { | 51 | struct rtnl_link_ops { |
51 | struct list_head list; | 52 | struct list_head list; |
@@ -93,6 +94,7 @@ struct rtnl_link_ops { | |||
93 | int (*fill_slave_info)(struct sk_buff *skb, | 94 | int (*fill_slave_info)(struct sk_buff *skb, |
94 | const struct net_device *dev, | 95 | const struct net_device *dev, |
95 | const struct net_device *slave_dev); | 96 | const struct net_device *slave_dev); |
97 | struct net *(*get_link_net)(const struct net_device *dev); | ||
96 | }; | 98 | }; |
97 | 99 | ||
98 | int __rtnl_link_register(struct rtnl_link_ops *ops); | 100 | int __rtnl_link_register(struct rtnl_link_ops *ops); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 3d282cbb66bf..c605d305c577 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -79,6 +79,9 @@ struct Qdisc { | |||
79 | struct netdev_queue *dev_queue; | 79 | struct netdev_queue *dev_queue; |
80 | 80 | ||
81 | struct gnet_stats_rate_est64 rate_est; | 81 | struct gnet_stats_rate_est64 rate_est; |
82 | struct gnet_stats_basic_cpu __percpu *cpu_bstats; | ||
83 | struct gnet_stats_queue __percpu *cpu_qstats; | ||
84 | |||
82 | struct Qdisc *next_sched; | 85 | struct Qdisc *next_sched; |
83 | struct sk_buff *gso_skb; | 86 | struct sk_buff *gso_skb; |
84 | /* | 87 | /* |
@@ -86,15 +89,9 @@ struct Qdisc { | |||
86 | */ | 89 | */ |
87 | unsigned long state; | 90 | unsigned long state; |
88 | struct sk_buff_head q; | 91 | struct sk_buff_head q; |
89 | union { | 92 | struct gnet_stats_basic_packed bstats; |
90 | struct gnet_stats_basic_packed bstats; | ||
91 | struct gnet_stats_basic_cpu __percpu *cpu_bstats; | ||
92 | } __packed; | ||
93 | unsigned int __state; | 93 | unsigned int __state; |
94 | union { | 94 | struct gnet_stats_queue qstats; |
95 | struct gnet_stats_queue qstats; | ||
96 | struct gnet_stats_queue __percpu *cpu_qstats; | ||
97 | } __packed; | ||
98 | struct rcu_head rcu_head; | 95 | struct rcu_head rcu_head; |
99 | int padded; | 96 | int padded; |
100 | atomic_t refcnt; | 97 | atomic_t refcnt; |
diff --git a/include/net/sock.h b/include/net/sock.h index 2210fec65669..ab186b1d31ff 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -857,18 +857,6 @@ static inline void sock_rps_record_flow_hash(__u32 hash) | |||
857 | #endif | 857 | #endif |
858 | } | 858 | } |
859 | 859 | ||
860 | static inline void sock_rps_reset_flow_hash(__u32 hash) | ||
861 | { | ||
862 | #ifdef CONFIG_RPS | ||
863 | struct rps_sock_flow_table *sock_flow_table; | ||
864 | |||
865 | rcu_read_lock(); | ||
866 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
867 | rps_reset_sock_flow(sock_flow_table, hash); | ||
868 | rcu_read_unlock(); | ||
869 | #endif | ||
870 | } | ||
871 | |||
872 | static inline void sock_rps_record_flow(const struct sock *sk) | 860 | static inline void sock_rps_record_flow(const struct sock *sk) |
873 | { | 861 | { |
874 | #ifdef CONFIG_RPS | 862 | #ifdef CONFIG_RPS |
@@ -876,28 +864,18 @@ static inline void sock_rps_record_flow(const struct sock *sk) | |||
876 | #endif | 864 | #endif |
877 | } | 865 | } |
878 | 866 | ||
879 | static inline void sock_rps_reset_flow(const struct sock *sk) | ||
880 | { | ||
881 | #ifdef CONFIG_RPS | ||
882 | sock_rps_reset_flow_hash(sk->sk_rxhash); | ||
883 | #endif | ||
884 | } | ||
885 | |||
886 | static inline void sock_rps_save_rxhash(struct sock *sk, | 867 | static inline void sock_rps_save_rxhash(struct sock *sk, |
887 | const struct sk_buff *skb) | 868 | const struct sk_buff *skb) |
888 | { | 869 | { |
889 | #ifdef CONFIG_RPS | 870 | #ifdef CONFIG_RPS |
890 | if (unlikely(sk->sk_rxhash != skb->hash)) { | 871 | if (unlikely(sk->sk_rxhash != skb->hash)) |
891 | sock_rps_reset_flow(sk); | ||
892 | sk->sk_rxhash = skb->hash; | 872 | sk->sk_rxhash = skb->hash; |
893 | } | ||
894 | #endif | 873 | #endif |
895 | } | 874 | } |
896 | 875 | ||
897 | static inline void sock_rps_reset_rxhash(struct sock *sk) | 876 | static inline void sock_rps_reset_rxhash(struct sock *sk) |
898 | { | 877 | { |
899 | #ifdef CONFIG_RPS | 878 | #ifdef CONFIG_RPS |
900 | sock_rps_reset_flow(sk); | ||
901 | sk->sk_rxhash = 0; | 879 | sk->sk_rxhash = 0; |
902 | #endif | 880 | #endif |
903 | } | 881 | } |
@@ -1099,11 +1077,6 @@ static inline bool memcg_proto_active(struct cg_proto *cg_proto) | |||
1099 | return test_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); | 1077 | return test_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); |
1100 | } | 1078 | } |
1101 | 1079 | ||
1102 | static inline bool memcg_proto_activated(struct cg_proto *cg_proto) | ||
1103 | { | ||
1104 | return test_bit(MEMCG_SOCK_ACTIVATED, &cg_proto->flags); | ||
1105 | } | ||
1106 | |||
1107 | #ifdef SOCK_REFCNT_DEBUG | 1080 | #ifdef SOCK_REFCNT_DEBUG |
1108 | static inline void sk_refcnt_debug_inc(struct sock *sk) | 1081 | static inline void sk_refcnt_debug_inc(struct sock *sk) |
1109 | { | 1082 | { |
@@ -1374,29 +1347,6 @@ void sk_prot_clear_portaddr_nulls(struct sock *sk, int size); | |||
1374 | #define SOCK_BINDADDR_LOCK 4 | 1347 | #define SOCK_BINDADDR_LOCK 4 |
1375 | #define SOCK_BINDPORT_LOCK 8 | 1348 | #define SOCK_BINDPORT_LOCK 8 |
1376 | 1349 | ||
1377 | /* sock_iocb: used to kick off async processing of socket ios */ | ||
1378 | struct sock_iocb { | ||
1379 | struct list_head list; | ||
1380 | |||
1381 | int flags; | ||
1382 | int size; | ||
1383 | struct socket *sock; | ||
1384 | struct sock *sk; | ||
1385 | struct scm_cookie *scm; | ||
1386 | struct msghdr *msg, async_msg; | ||
1387 | struct kiocb *kiocb; | ||
1388 | }; | ||
1389 | |||
1390 | static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb) | ||
1391 | { | ||
1392 | return (struct sock_iocb *)iocb->private; | ||
1393 | } | ||
1394 | |||
1395 | static inline struct kiocb *siocb_to_kiocb(struct sock_iocb *si) | ||
1396 | { | ||
1397 | return si->kiocb; | ||
1398 | } | ||
1399 | |||
1400 | struct socket_alloc { | 1350 | struct socket_alloc { |
1401 | struct socket socket; | 1351 | struct socket socket; |
1402 | struct inode vfs_inode; | 1352 | struct inode vfs_inode; |
@@ -1826,27 +1776,25 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) | |||
1826 | } | 1776 | } |
1827 | 1777 | ||
1828 | static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, | 1778 | static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, |
1829 | char __user *from, char *to, | 1779 | struct iov_iter *from, char *to, |
1830 | int copy, int offset) | 1780 | int copy, int offset) |
1831 | { | 1781 | { |
1832 | if (skb->ip_summed == CHECKSUM_NONE) { | 1782 | if (skb->ip_summed == CHECKSUM_NONE) { |
1833 | int err = 0; | 1783 | __wsum csum = 0; |
1834 | __wsum csum = csum_and_copy_from_user(from, to, copy, 0, &err); | 1784 | if (csum_and_copy_from_iter(to, copy, &csum, from) != copy) |
1835 | if (err) | 1785 | return -EFAULT; |
1836 | return err; | ||
1837 | skb->csum = csum_block_add(skb->csum, csum, offset); | 1786 | skb->csum = csum_block_add(skb->csum, csum, offset); |
1838 | } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { | 1787 | } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { |
1839 | if (!access_ok(VERIFY_READ, from, copy) || | 1788 | if (copy_from_iter_nocache(to, copy, from) != copy) |
1840 | __copy_from_user_nocache(to, from, copy)) | ||
1841 | return -EFAULT; | 1789 | return -EFAULT; |
1842 | } else if (copy_from_user(to, from, copy)) | 1790 | } else if (copy_from_iter(to, copy, from) != copy) |
1843 | return -EFAULT; | 1791 | return -EFAULT; |
1844 | 1792 | ||
1845 | return 0; | 1793 | return 0; |
1846 | } | 1794 | } |
1847 | 1795 | ||
1848 | static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, | 1796 | static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, |
1849 | char __user *from, int copy) | 1797 | struct iov_iter *from, int copy) |
1850 | { | 1798 | { |
1851 | int err, offset = skb->len; | 1799 | int err, offset = skb->len; |
1852 | 1800 | ||
@@ -1858,7 +1806,7 @@ static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, | |||
1858 | return err; | 1806 | return err; |
1859 | } | 1807 | } |
1860 | 1808 | ||
1861 | static inline int skb_copy_to_page_nocache(struct sock *sk, char __user *from, | 1809 | static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from, |
1862 | struct sk_buff *skb, | 1810 | struct sk_buff *skb, |
1863 | struct page *page, | 1811 | struct page *page, |
1864 | int off, int copy) | 1812 | int off, int copy) |
@@ -2262,6 +2210,7 @@ bool sk_net_capable(const struct sock *sk, int cap); | |||
2262 | extern __u32 sysctl_wmem_max; | 2210 | extern __u32 sysctl_wmem_max; |
2263 | extern __u32 sysctl_rmem_max; | 2211 | extern __u32 sysctl_rmem_max; |
2264 | 2212 | ||
2213 | extern int sysctl_tstamp_allow_data; | ||
2265 | extern int sysctl_optmem_max; | 2214 | extern int sysctl_optmem_max; |
2266 | 2215 | ||
2267 | extern __u32 sysctl_wmem_default; | 2216 | extern __u32 sysctl_wmem_default; |
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 8a6d1641fd9b..cfcdac2e5d25 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -11,13 +11,46 @@ | |||
11 | #define _LINUX_SWITCHDEV_H_ | 11 | #define _LINUX_SWITCHDEV_H_ |
12 | 12 | ||
13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
14 | #include <linux/notifier.h> | ||
15 | |||
16 | enum netdev_switch_notifier_type { | ||
17 | NETDEV_SWITCH_FDB_ADD = 1, | ||
18 | NETDEV_SWITCH_FDB_DEL, | ||
19 | }; | ||
20 | |||
21 | struct netdev_switch_notifier_info { | ||
22 | struct net_device *dev; | ||
23 | }; | ||
24 | |||
25 | struct netdev_switch_notifier_fdb_info { | ||
26 | struct netdev_switch_notifier_info info; /* must be first */ | ||
27 | const unsigned char *addr; | ||
28 | u16 vid; | ||
29 | }; | ||
30 | |||
31 | static inline struct net_device * | ||
32 | netdev_switch_notifier_info_to_dev(const struct netdev_switch_notifier_info *info) | ||
33 | { | ||
34 | return info->dev; | ||
35 | } | ||
14 | 36 | ||
15 | #ifdef CONFIG_NET_SWITCHDEV | 37 | #ifdef CONFIG_NET_SWITCHDEV |
16 | 38 | ||
17 | int netdev_switch_parent_id_get(struct net_device *dev, | 39 | int netdev_switch_parent_id_get(struct net_device *dev, |
18 | struct netdev_phys_item_id *psid); | 40 | struct netdev_phys_item_id *psid); |
19 | int netdev_switch_port_stp_update(struct net_device *dev, u8 state); | 41 | int netdev_switch_port_stp_update(struct net_device *dev, u8 state); |
20 | 42 | int register_netdev_switch_notifier(struct notifier_block *nb); | |
43 | int unregister_netdev_switch_notifier(struct notifier_block *nb); | ||
44 | int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev, | ||
45 | struct netdev_switch_notifier_info *info); | ||
46 | int netdev_switch_port_bridge_setlink(struct net_device *dev, | ||
47 | struct nlmsghdr *nlh, u16 flags); | ||
48 | int netdev_switch_port_bridge_dellink(struct net_device *dev, | ||
49 | struct nlmsghdr *nlh, u16 flags); | ||
50 | int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev, | ||
51 | struct nlmsghdr *nlh, u16 flags); | ||
52 | int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev, | ||
53 | struct nlmsghdr *nlh, u16 flags); | ||
21 | #else | 54 | #else |
22 | 55 | ||
23 | static inline int netdev_switch_parent_id_get(struct net_device *dev, | 56 | static inline int netdev_switch_parent_id_get(struct net_device *dev, |
@@ -32,6 +65,50 @@ static inline int netdev_switch_port_stp_update(struct net_device *dev, | |||
32 | return -EOPNOTSUPP; | 65 | return -EOPNOTSUPP; |
33 | } | 66 | } |
34 | 67 | ||
68 | static inline int register_netdev_switch_notifier(struct notifier_block *nb) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static inline int unregister_netdev_switch_notifier(struct notifier_block *nb) | ||
74 | { | ||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static inline int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev, | ||
79 | struct netdev_switch_notifier_info *info) | ||
80 | { | ||
81 | return NOTIFY_DONE; | ||
82 | } | ||
83 | |||
84 | static inline int netdev_switch_port_bridge_setlink(struct net_device *dev, | ||
85 | struct nlmsghdr *nlh, | ||
86 | u16 flags) | ||
87 | { | ||
88 | return -EOPNOTSUPP; | ||
89 | } | ||
90 | |||
91 | static inline int netdev_switch_port_bridge_dellink(struct net_device *dev, | ||
92 | struct nlmsghdr *nlh, | ||
93 | u16 flags) | ||
94 | { | ||
95 | return -EOPNOTSUPP; | ||
96 | } | ||
97 | |||
98 | static inline int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev, | ||
99 | struct nlmsghdr *nlh, | ||
100 | u16 flags) | ||
101 | { | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev, | ||
106 | struct nlmsghdr *nlh, | ||
107 | u16 flags) | ||
108 | { | ||
109 | return 0; | ||
110 | } | ||
111 | |||
35 | #endif | 112 | #endif |
36 | 113 | ||
37 | #endif /* _LINUX_SWITCHDEV_H_ */ | 114 | #endif /* _LINUX_SWITCHDEV_H_ */ |
diff --git a/include/net/tc_act/tc_bpf.h b/include/net/tc_act/tc_bpf.h new file mode 100644 index 000000000000..86a070ffc930 --- /dev/null +++ b/include/net/tc_act/tc_bpf.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us> | ||
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 | |||
10 | #ifndef __NET_TC_BPF_H | ||
11 | #define __NET_TC_BPF_H | ||
12 | |||
13 | #include <linux/filter.h> | ||
14 | #include <net/act_api.h> | ||
15 | |||
16 | struct tcf_bpf { | ||
17 | struct tcf_common common; | ||
18 | struct bpf_prog *filter; | ||
19 | struct sock_filter *bpf_ops; | ||
20 | u16 bpf_num_ops; | ||
21 | }; | ||
22 | #define to_bpf(a) \ | ||
23 | container_of(a->priv, struct tcf_bpf, common) | ||
24 | |||
25 | #endif /* __NET_TC_BPF_H */ | ||
diff --git a/include/net/tc_act/tc_connmark.h b/include/net/tc_act/tc_connmark.h new file mode 100644 index 000000000000..5c1104c2e24f --- /dev/null +++ b/include/net/tc_act/tc_connmark.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __NET_TC_CONNMARK_H | ||
2 | #define __NET_TC_CONNMARK_H | ||
3 | |||
4 | #include <net/act_api.h> | ||
5 | |||
6 | struct tcf_connmark_info { | ||
7 | struct tcf_common common; | ||
8 | u16 zone; | ||
9 | }; | ||
10 | |||
11 | #define to_connmark(a) \ | ||
12 | container_of(a->priv, struct tcf_connmark_info, common) | ||
13 | |||
14 | #endif /* __NET_TC_CONNMARK_H */ | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index f50f29faf76f..8d6b983d5099 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -262,8 +262,6 @@ extern int sysctl_tcp_low_latency; | |||
262 | extern int sysctl_tcp_nometrics_save; | 262 | extern int sysctl_tcp_nometrics_save; |
263 | extern int sysctl_tcp_moderate_rcvbuf; | 263 | extern int sysctl_tcp_moderate_rcvbuf; |
264 | extern int sysctl_tcp_tso_win_divisor; | 264 | extern int sysctl_tcp_tso_win_divisor; |
265 | extern int sysctl_tcp_mtu_probing; | ||
266 | extern int sysctl_tcp_base_mss; | ||
267 | extern int sysctl_tcp_workaround_signed_windows; | 265 | extern int sysctl_tcp_workaround_signed_windows; |
268 | extern int sysctl_tcp_slow_start_after_idle; | 266 | extern int sysctl_tcp_slow_start_after_idle; |
269 | extern int sysctl_tcp_thin_linear_timeouts; | 267 | extern int sysctl_tcp_thin_linear_timeouts; |
@@ -274,6 +272,7 @@ extern int sysctl_tcp_challenge_ack_limit; | |||
274 | extern unsigned int sysctl_tcp_notsent_lowat; | 272 | extern unsigned int sysctl_tcp_notsent_lowat; |
275 | extern int sysctl_tcp_min_tso_segs; | 273 | extern int sysctl_tcp_min_tso_segs; |
276 | extern int sysctl_tcp_autocorking; | 274 | extern int sysctl_tcp_autocorking; |
275 | extern int sysctl_tcp_invalid_ratelimit; | ||
277 | 276 | ||
278 | extern atomic_long_t tcp_memory_allocated; | 277 | extern atomic_long_t tcp_memory_allocated; |
279 | extern struct percpu_counter tcp_sockets_allocated; | 278 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -448,6 +447,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); | |||
448 | struct sock *tcp_create_openreq_child(struct sock *sk, | 447 | struct sock *tcp_create_openreq_child(struct sock *sk, |
449 | struct request_sock *req, | 448 | struct request_sock *req, |
450 | struct sk_buff *skb); | 449 | struct sk_buff *skb); |
450 | void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst); | ||
451 | struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | 451 | struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, |
452 | struct request_sock *req, | 452 | struct request_sock *req, |
453 | struct dst_entry *dst); | 453 | struct dst_entry *dst); |
@@ -636,6 +636,11 @@ static inline u32 tcp_rto_min_us(struct sock *sk) | |||
636 | return jiffies_to_usecs(tcp_rto_min(sk)); | 636 | return jiffies_to_usecs(tcp_rto_min(sk)); |
637 | } | 637 | } |
638 | 638 | ||
639 | static inline bool tcp_ca_dst_locked(const struct dst_entry *dst) | ||
640 | { | ||
641 | return dst_metric_locked(dst, RTAX_CC_ALGO); | ||
642 | } | ||
643 | |||
639 | /* Compute the actual receive window we are currently advertising. | 644 | /* Compute the actual receive window we are currently advertising. |
640 | * Rcv_nxt can be after the window if our peer push more data | 645 | * Rcv_nxt can be after the window if our peer push more data |
641 | * than the offered window. | 646 | * than the offered window. |
@@ -787,6 +792,8 @@ enum tcp_ca_ack_event_flags { | |||
787 | #define TCP_CA_MAX 128 | 792 | #define TCP_CA_MAX 128 |
788 | #define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX) | 793 | #define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX) |
789 | 794 | ||
795 | #define TCP_CA_UNSPEC 0 | ||
796 | |||
790 | /* Algorithm can be set on socket without CAP_NET_ADMIN privileges */ | 797 | /* Algorithm can be set on socket without CAP_NET_ADMIN privileges */ |
791 | #define TCP_CONG_NON_RESTRICTED 0x1 | 798 | #define TCP_CONG_NON_RESTRICTED 0x1 |
792 | /* Requires ECN/ECT set on all packets */ | 799 | /* Requires ECN/ECT set on all packets */ |
@@ -794,7 +801,8 @@ enum tcp_ca_ack_event_flags { | |||
794 | 801 | ||
795 | struct tcp_congestion_ops { | 802 | struct tcp_congestion_ops { |
796 | struct list_head list; | 803 | struct list_head list; |
797 | unsigned long flags; | 804 | u32 key; |
805 | u32 flags; | ||
798 | 806 | ||
799 | /* initialize private data (optional) */ | 807 | /* initialize private data (optional) */ |
800 | void (*init)(struct sock *sk); | 808 | void (*init)(struct sock *sk); |
@@ -834,13 +842,24 @@ void tcp_get_available_congestion_control(char *buf, size_t len); | |||
834 | void tcp_get_allowed_congestion_control(char *buf, size_t len); | 842 | void tcp_get_allowed_congestion_control(char *buf, size_t len); |
835 | int tcp_set_allowed_congestion_control(char *allowed); | 843 | int tcp_set_allowed_congestion_control(char *allowed); |
836 | int tcp_set_congestion_control(struct sock *sk, const char *name); | 844 | int tcp_set_congestion_control(struct sock *sk, const char *name); |
837 | void tcp_slow_start(struct tcp_sock *tp, u32 acked); | 845 | u32 tcp_slow_start(struct tcp_sock *tp, u32 acked); |
838 | void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w); | 846 | void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked); |
839 | 847 | ||
840 | u32 tcp_reno_ssthresh(struct sock *sk); | 848 | u32 tcp_reno_ssthresh(struct sock *sk); |
841 | void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked); | 849 | void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked); |
842 | extern struct tcp_congestion_ops tcp_reno; | 850 | extern struct tcp_congestion_ops tcp_reno; |
843 | 851 | ||
852 | struct tcp_congestion_ops *tcp_ca_find_key(u32 key); | ||
853 | u32 tcp_ca_get_key_by_name(const char *name); | ||
854 | #ifdef CONFIG_INET | ||
855 | char *tcp_ca_get_name_by_key(u32 key, char *buffer); | ||
856 | #else | ||
857 | static inline char *tcp_ca_get_name_by_key(u32 key, char *buffer) | ||
858 | { | ||
859 | return NULL; | ||
860 | } | ||
861 | #endif | ||
862 | |||
844 | static inline bool tcp_ca_needs_ecn(const struct sock *sk) | 863 | static inline bool tcp_ca_needs_ecn(const struct sock *sk) |
845 | { | 864 | { |
846 | const struct inet_connection_sock *icsk = inet_csk(sk); | 865 | const struct inet_connection_sock *icsk = inet_csk(sk); |
@@ -1124,6 +1143,7 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
1124 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; | 1143 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
1125 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; | 1144 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; |
1126 | tcp_rsk(req)->snt_synack = tcp_time_stamp; | 1145 | tcp_rsk(req)->snt_synack = tcp_time_stamp; |
1146 | tcp_rsk(req)->last_oow_ack_time = 0; | ||
1127 | req->mss = rx_opt->mss_clamp; | 1147 | req->mss = rx_opt->mss_clamp; |
1128 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1148 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
1129 | ireq->tstamp_ok = rx_opt->tstamp_ok; | 1149 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
@@ -1216,6 +1236,37 @@ static inline bool tcp_paws_reject(const struct tcp_options_received *rx_opt, | |||
1216 | return true; | 1236 | return true; |
1217 | } | 1237 | } |
1218 | 1238 | ||
1239 | /* Return true if we're currently rate-limiting out-of-window ACKs and | ||
1240 | * thus shouldn't send a dupack right now. We rate-limit dupacks in | ||
1241 | * response to out-of-window SYNs or ACKs to mitigate ACK loops or DoS | ||
1242 | * attacks that send repeated SYNs or ACKs for the same connection. To | ||
1243 | * do this, we do not send a duplicate SYNACK or ACK if the remote | ||
1244 | * endpoint is sending out-of-window SYNs or pure ACKs at a high rate. | ||
1245 | */ | ||
1246 | static inline bool tcp_oow_rate_limited(struct net *net, | ||
1247 | const struct sk_buff *skb, | ||
1248 | int mib_idx, u32 *last_oow_ack_time) | ||
1249 | { | ||
1250 | /* Data packets without SYNs are not likely part of an ACK loop. */ | ||
1251 | if ((TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq) && | ||
1252 | !tcp_hdr(skb)->syn) | ||
1253 | goto not_rate_limited; | ||
1254 | |||
1255 | if (*last_oow_ack_time) { | ||
1256 | s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time); | ||
1257 | |||
1258 | if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) { | ||
1259 | NET_INC_STATS_BH(net, mib_idx); | ||
1260 | return true; /* rate-limited: don't send yet! */ | ||
1261 | } | ||
1262 | } | ||
1263 | |||
1264 | *last_oow_ack_time = tcp_time_stamp; | ||
1265 | |||
1266 | not_rate_limited: | ||
1267 | return false; /* not rate-limited: go ahead, send dupack now! */ | ||
1268 | } | ||
1269 | |||
1219 | static inline void tcp_mib_init(struct net *net) | 1270 | static inline void tcp_mib_init(struct net *net) |
1220 | { | 1271 | { |
1221 | /* See RFC 2012 */ | 1272 | /* See RFC 2012 */ |
@@ -1693,4 +1744,19 @@ static inline struct ip_options_rcu *tcp_v4_save_options(struct sk_buff *skb) | |||
1693 | return dopt; | 1744 | return dopt; |
1694 | } | 1745 | } |
1695 | 1746 | ||
1747 | /* locally generated TCP pure ACKs have skb->truesize == 2 | ||
1748 | * (check tcp_send_ack() in net/ipv4/tcp_output.c ) | ||
1749 | * This is much faster than dissecting the packet to find out. | ||
1750 | * (Think of GRE encapsulations, IPv4, IPv6, ...) | ||
1751 | */ | ||
1752 | static inline bool skb_is_tcp_pure_ack(const struct sk_buff *skb) | ||
1753 | { | ||
1754 | return skb->truesize == 2; | ||
1755 | } | ||
1756 | |||
1757 | static inline void skb_set_tcp_pure_ack(struct sk_buff *skb) | ||
1758 | { | ||
1759 | skb->truesize = 2; | ||
1760 | } | ||
1761 | |||
1696 | #endif /* _TCP_H */ | 1762 | #endif /* _TCP_H */ |
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h index 2a50a70ef587..1a20d33d56bc 100644 --- a/include/net/udp_tunnel.h +++ b/include/net/udp_tunnel.h | |||
@@ -77,17 +77,17 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock, | |||
77 | struct udp_tunnel_sock_cfg *sock_cfg); | 77 | struct udp_tunnel_sock_cfg *sock_cfg); |
78 | 78 | ||
79 | /* Transmit the skb using UDP encapsulation. */ | 79 | /* Transmit the skb using UDP encapsulation. */ |
80 | int udp_tunnel_xmit_skb(struct socket *sock, struct rtable *rt, | 80 | int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, |
81 | struct sk_buff *skb, __be32 src, __be32 dst, | 81 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, |
82 | __u8 tos, __u8 ttl, __be16 df, __be16 src_port, | 82 | __be16 df, __be16 src_port, __be16 dst_port, |
83 | __be16 dst_port, bool xnet); | 83 | bool xnet, bool nocheck); |
84 | 84 | ||
85 | #if IS_ENABLED(CONFIG_IPV6) | 85 | #if IS_ENABLED(CONFIG_IPV6) |
86 | int udp_tunnel6_xmit_skb(struct socket *sock, struct dst_entry *dst, | 86 | int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, |
87 | struct sk_buff *skb, struct net_device *dev, | 87 | struct net_device *dev, struct in6_addr *saddr, |
88 | struct in6_addr *saddr, struct in6_addr *daddr, | 88 | struct in6_addr *daddr, |
89 | __u8 prio, __u8 ttl, __be16 src_port, | 89 | __u8 prio, __u8 ttl, __be16 src_port, |
90 | __be16 dst_port); | 90 | __be16 dst_port, bool nocheck); |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | void udp_tunnel_sock_release(struct socket *sock); | 93 | void udp_tunnel_sock_release(struct socket *sock); |
diff --git a/include/net/udplite.h b/include/net/udplite.h index ae7c8d1fbcad..80761938b9a7 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
@@ -20,8 +20,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset, | |||
20 | int len, int odd, struct sk_buff *skb) | 20 | int len, int odd, struct sk_buff *skb) |
21 | { | 21 | { |
22 | struct msghdr *msg = from; | 22 | struct msghdr *msg = from; |
23 | /* XXX: stripping const */ | 23 | return copy_from_iter(to, len, &msg->msg_iter) != len ? -EFAULT : 0; |
24 | return memcpy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len); | ||
25 | } | 24 | } |
26 | 25 | ||
27 | /* Designate sk as UDP-Lite socket */ | 26 | /* Designate sk as UDP-Lite socket */ |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 903461aa5644..eabd3a038674 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
@@ -11,14 +11,96 @@ | |||
11 | #define VNI_HASH_BITS 10 | 11 | #define VNI_HASH_BITS 10 |
12 | #define VNI_HASH_SIZE (1<<VNI_HASH_BITS) | 12 | #define VNI_HASH_SIZE (1<<VNI_HASH_BITS) |
13 | 13 | ||
14 | /* VXLAN protocol header */ | 14 | /* |
15 | * VXLAN Group Based Policy Extension: | ||
16 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
17 | * |1|-|-|-|1|-|-|-|R|D|R|R|A|R|R|R| Group Policy ID | | ||
18 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
19 | * | VXLAN Network Identifier (VNI) | Reserved | | ||
20 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
21 | * | ||
22 | * D = Don't Learn bit. When set, this bit indicates that the egress | ||
23 | * VTEP MUST NOT learn the source address of the encapsulated frame. | ||
24 | * | ||
25 | * A = Indicates that the group policy has already been applied to | ||
26 | * this packet. Policies MUST NOT be applied by devices when the | ||
27 | * A bit is set. | ||
28 | * | ||
29 | * [0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy | ||
30 | */ | ||
31 | struct vxlanhdr_gbp { | ||
32 | __u8 vx_flags; | ||
33 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
34 | __u8 reserved_flags1:3, | ||
35 | policy_applied:1, | ||
36 | reserved_flags2:2, | ||
37 | dont_learn:1, | ||
38 | reserved_flags3:1; | ||
39 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
40 | __u8 reserved_flags1:1, | ||
41 | dont_learn:1, | ||
42 | reserved_flags2:2, | ||
43 | policy_applied:1, | ||
44 | reserved_flags3:3; | ||
45 | #else | ||
46 | #error "Please fix <asm/byteorder.h>" | ||
47 | #endif | ||
48 | __be16 policy_id; | ||
49 | __be32 vx_vni; | ||
50 | }; | ||
51 | |||
52 | #define VXLAN_GBP_USED_BITS (VXLAN_HF_GBP | 0xFFFFFF) | ||
53 | |||
54 | /* skb->mark mapping | ||
55 | * | ||
56 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
57 | * |R|R|R|R|R|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID | | ||
58 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
59 | */ | ||
60 | #define VXLAN_GBP_DONT_LEARN (BIT(6) << 16) | ||
61 | #define VXLAN_GBP_POLICY_APPLIED (BIT(3) << 16) | ||
62 | #define VXLAN_GBP_ID_MASK (0xFFFF) | ||
63 | |||
64 | /* VXLAN protocol header: | ||
65 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
66 | * |G|R|R|R|I|R|R|C| Reserved | | ||
67 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
68 | * | VXLAN Network Identifier (VNI) | Reserved | | ||
69 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
70 | * | ||
71 | * G = 1 Group Policy (VXLAN-GBP) | ||
72 | * I = 1 VXLAN Network Identifier (VNI) present | ||
73 | * C = 1 Remote checksum offload (RCO) | ||
74 | */ | ||
15 | struct vxlanhdr { | 75 | struct vxlanhdr { |
16 | __be32 vx_flags; | 76 | __be32 vx_flags; |
17 | __be32 vx_vni; | 77 | __be32 vx_vni; |
18 | }; | 78 | }; |
19 | 79 | ||
80 | /* VXLAN header flags. */ | ||
81 | #define VXLAN_HF_RCO BIT(24) | ||
82 | #define VXLAN_HF_VNI BIT(27) | ||
83 | #define VXLAN_HF_GBP BIT(31) | ||
84 | |||
85 | /* Remote checksum offload header option */ | ||
86 | #define VXLAN_RCO_MASK 0x7f /* Last byte of vni field */ | ||
87 | #define VXLAN_RCO_UDP 0x80 /* Indicate UDP RCO (TCP when not set *) */ | ||
88 | #define VXLAN_RCO_SHIFT 1 /* Left shift of start */ | ||
89 | #define VXLAN_RCO_SHIFT_MASK ((1 << VXLAN_RCO_SHIFT) - 1) | ||
90 | #define VXLAN_MAX_REMCSUM_START (VXLAN_RCO_MASK << VXLAN_RCO_SHIFT) | ||
91 | |||
92 | #define VXLAN_N_VID (1u << 24) | ||
93 | #define VXLAN_VID_MASK (VXLAN_N_VID - 1) | ||
94 | #define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) | ||
95 | |||
96 | struct vxlan_metadata { | ||
97 | __be32 vni; | ||
98 | u32 gbp; | ||
99 | }; | ||
100 | |||
20 | struct vxlan_sock; | 101 | struct vxlan_sock; |
21 | typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key); | 102 | typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, |
103 | struct vxlan_metadata *md); | ||
22 | 104 | ||
23 | /* per UDP socket information */ | 105 | /* per UDP socket information */ |
24 | struct vxlan_sock { | 106 | struct vxlan_sock { |
@@ -31,6 +113,7 @@ struct vxlan_sock { | |||
31 | struct hlist_head vni_list[VNI_HASH_SIZE]; | 113 | struct hlist_head vni_list[VNI_HASH_SIZE]; |
32 | atomic_t refcnt; | 114 | atomic_t refcnt; |
33 | struct udp_offload udp_offloads; | 115 | struct udp_offload udp_offloads; |
116 | u32 flags; | ||
34 | }; | 117 | }; |
35 | 118 | ||
36 | #define VXLAN_F_LEARN 0x01 | 119 | #define VXLAN_F_LEARN 0x01 |
@@ -42,6 +125,18 @@ struct vxlan_sock { | |||
42 | #define VXLAN_F_UDP_CSUM 0x40 | 125 | #define VXLAN_F_UDP_CSUM 0x40 |
43 | #define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80 | 126 | #define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80 |
44 | #define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100 | 127 | #define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100 |
128 | #define VXLAN_F_REMCSUM_TX 0x200 | ||
129 | #define VXLAN_F_REMCSUM_RX 0x400 | ||
130 | #define VXLAN_F_GBP 0x800 | ||
131 | #define VXLAN_F_REMCSUM_NOPARTIAL 0x1000 | ||
132 | |||
133 | /* Flags that are used in the receive patch. These flags must match in | ||
134 | * order for a socket to be shareable | ||
135 | */ | ||
136 | #define VXLAN_F_RCV_FLAGS (VXLAN_F_GBP | \ | ||
137 | VXLAN_F_UDP_ZERO_CSUM6_RX | \ | ||
138 | VXLAN_F_REMCSUM_RX | \ | ||
139 | VXLAN_F_REMCSUM_NOPARTIAL) | ||
45 | 140 | ||
46 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, | 141 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, |
47 | vxlan_rcv_t *rcv, void *data, | 142 | vxlan_rcv_t *rcv, void *data, |
@@ -49,10 +144,10 @@ struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, | |||
49 | 144 | ||
50 | void vxlan_sock_release(struct vxlan_sock *vs); | 145 | void vxlan_sock_release(struct vxlan_sock *vs); |
51 | 146 | ||
52 | int vxlan_xmit_skb(struct vxlan_sock *vs, | 147 | int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb, |
53 | struct rtable *rt, struct sk_buff *skb, | ||
54 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, | 148 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, |
55 | __be16 src_port, __be16 dst_port, __be32 vni, bool xnet); | 149 | __be16 src_port, __be16 dst_port, struct vxlan_metadata *md, |
150 | bool xnet, u32 vxflags); | ||
56 | 151 | ||
57 | static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, | 152 | static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, |
58 | netdev_features_t features) | 153 | netdev_features_t features) |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0d74f1de99aa..65994a19e840 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -1707,10 +1707,7 @@ static inline int ib_copy_from_udata(void *dest, struct ib_udata *udata, size_t | |||
1707 | 1707 | ||
1708 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) | 1708 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) |
1709 | { | 1709 | { |
1710 | size_t copy_sz; | 1710 | return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; |
1711 | |||
1712 | copy_sz = min_t(size_t, len, udata->outlen); | ||
1713 | return copy_to_user(udata->outbuf, src, copy_sz) ? -EFAULT : 0; | ||
1714 | } | 1711 | } |
1715 | 1712 | ||
1716 | /** | 1713 | /** |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 8a7f8ad58aac..d0a66aa1868d 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -195,6 +195,9 @@ enum scsi_timeouts { | |||
195 | #define ATA_16 0x85 /* 16-byte pass-thru */ | 195 | #define ATA_16 0x85 /* 16-byte pass-thru */ |
196 | #define ATA_12 0xa1 /* 12-byte pass-thru */ | 196 | #define ATA_12 0xa1 /* 12-byte pass-thru */ |
197 | 197 | ||
198 | /* Vendor specific CDBs start here */ | ||
199 | #define VENDOR_SPECIFIC_CDB 0xc0 | ||
200 | |||
198 | /* | 201 | /* |
199 | * SCSI command lengths | 202 | * SCSI command lengths |
200 | */ | 203 | */ |
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h index 7982795df595..f8170e90b49d 100644 --- a/include/scsi/scsi_dbg.h +++ b/include/scsi/scsi_dbg.h | |||
@@ -5,8 +5,11 @@ struct scsi_cmnd; | |||
5 | struct scsi_device; | 5 | struct scsi_device; |
6 | struct scsi_sense_hdr; | 6 | struct scsi_sense_hdr; |
7 | 7 | ||
8 | #define SCSI_LOG_BUFSIZE 128 | ||
9 | |||
8 | extern void scsi_print_command(struct scsi_cmnd *); | 10 | extern void scsi_print_command(struct scsi_cmnd *); |
9 | extern void __scsi_print_command(const unsigned char *, size_t); | 11 | extern size_t __scsi_format_command(char *, size_t, |
12 | const unsigned char *, size_t); | ||
10 | extern void scsi_show_extd_sense(const struct scsi_device *, const char *, | 13 | extern void scsi_show_extd_sense(const struct scsi_device *, const char *, |
11 | unsigned char, unsigned char); | 14 | unsigned char, unsigned char); |
12 | extern void scsi_show_sense_hdr(const struct scsi_device *, const char *, | 15 | extern void scsi_show_sense_hdr(const struct scsi_device *, const char *, |
@@ -17,12 +20,73 @@ extern void scsi_print_sense(const struct scsi_cmnd *); | |||
17 | extern void __scsi_print_sense(const struct scsi_device *, const char *name, | 20 | extern void __scsi_print_sense(const struct scsi_device *, const char *name, |
18 | const unsigned char *sense_buffer, | 21 | const unsigned char *sense_buffer, |
19 | int sense_len); | 22 | int sense_len); |
20 | extern void scsi_print_result(struct scsi_cmnd *, const char *, int); | 23 | extern void scsi_print_result(const struct scsi_cmnd *, const char *, int); |
21 | extern const char *scsi_hostbyte_string(int); | 24 | |
22 | extern const char *scsi_driverbyte_string(int); | 25 | #ifdef CONFIG_SCSI_CONSTANTS |
23 | extern const char *scsi_mlreturn_string(int); | 26 | extern bool scsi_opcode_sa_name(int, int, const char **, const char **); |
24 | extern const char *scsi_sense_key_string(unsigned char); | 27 | extern const char *scsi_sense_key_string(unsigned char); |
25 | extern const char *scsi_extd_sense_format(unsigned char, unsigned char, | 28 | extern const char *scsi_extd_sense_format(unsigned char, unsigned char, |
26 | const char **); | 29 | const char **); |
30 | extern const char *scsi_mlreturn_string(int); | ||
31 | extern const char *scsi_hostbyte_string(int); | ||
32 | extern const char *scsi_driverbyte_string(int); | ||
33 | #else | ||
34 | static inline bool | ||
35 | scsi_opcode_sa_name(int cmd, int sa, | ||
36 | const char **cdb_name, const char **sa_name) | ||
37 | { | ||
38 | *cdb_name = NULL; | ||
39 | switch (cmd) { | ||
40 | case VARIABLE_LENGTH_CMD: | ||
41 | case MAINTENANCE_IN: | ||
42 | case MAINTENANCE_OUT: | ||
43 | case PERSISTENT_RESERVE_IN: | ||
44 | case PERSISTENT_RESERVE_OUT: | ||
45 | case SERVICE_ACTION_IN_12: | ||
46 | case SERVICE_ACTION_OUT_12: | ||
47 | case SERVICE_ACTION_BIDIRECTIONAL: | ||
48 | case SERVICE_ACTION_IN_16: | ||
49 | case SERVICE_ACTION_OUT_16: | ||
50 | case EXTENDED_COPY: | ||
51 | case RECEIVE_COPY_RESULTS: | ||
52 | *sa_name = NULL; | ||
53 | return true; | ||
54 | default: | ||
55 | return false; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | static inline const char * | ||
60 | scsi_sense_key_string(unsigned char key) | ||
61 | { | ||
62 | return NULL; | ||
63 | } | ||
64 | |||
65 | static inline const char * | ||
66 | scsi_extd_sense_format(unsigned char asc, unsigned char ascq, const char **fmt) | ||
67 | { | ||
68 | *fmt = NULL; | ||
69 | return NULL; | ||
70 | } | ||
71 | |||
72 | static inline const char * | ||
73 | scsi_mlreturn_string(int result) | ||
74 | { | ||
75 | return NULL; | ||
76 | } | ||
77 | |||
78 | static inline const char * | ||
79 | scsi_hostbyte_string(int result) | ||
80 | { | ||
81 | return NULL; | ||
82 | } | ||
83 | |||
84 | static inline const char * | ||
85 | scsi_driverbyte_string(int result) | ||
86 | { | ||
87 | return NULL; | ||
88 | } | ||
89 | |||
90 | #endif | ||
27 | 91 | ||
28 | #endif /* _SCSI_SCSI_DBG_H */ | 92 | #endif /* _SCSI_SCSI_DBG_H */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 3a4edd1f7dbb..a4c9336811d1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -230,9 +230,6 @@ struct scsi_dh_data { | |||
230 | #define transport_class_to_sdev(class_dev) \ | 230 | #define transport_class_to_sdev(class_dev) \ |
231 | to_scsi_device(class_dev->parent) | 231 | to_scsi_device(class_dev->parent) |
232 | 232 | ||
233 | #define sdev_printk(prefix, sdev, fmt, a...) \ | ||
234 | dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) | ||
235 | |||
236 | #define sdev_dbg(sdev, fmt, a...) \ | 233 | #define sdev_dbg(sdev, fmt, a...) \ |
237 | dev_dbg(&(sdev)->sdev_gendev, fmt, ##a) | 234 | dev_dbg(&(sdev)->sdev_gendev, fmt, ##a) |
238 | 235 | ||
@@ -240,16 +237,15 @@ struct scsi_dh_data { | |||
240 | * like scmd_printk, but the device name is passed in | 237 | * like scmd_printk, but the device name is passed in |
241 | * as a string pointer | 238 | * as a string pointer |
242 | */ | 239 | */ |
243 | #define sdev_prefix_printk(l, sdev, p, fmt, a...) \ | 240 | __printf(4, 5) void |
244 | (p) ? \ | 241 | sdev_prefix_printk(const char *, const struct scsi_device *, const char *, |
245 | sdev_printk(l, sdev, "[%s] " fmt, p, ##a) : \ | 242 | const char *, ...); |
246 | sdev_printk(l, sdev, fmt, ##a) | 243 | |
247 | 244 | #define sdev_printk(l, sdev, fmt, a...) \ | |
248 | #define scmd_printk(prefix, scmd, fmt, a...) \ | 245 | sdev_prefix_printk(l, sdev, NULL, fmt, ##a) |
249 | (scmd)->request->rq_disk ? \ | 246 | |
250 | sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \ | 247 | __printf(3, 4) void |
251 | (scmd)->request->rq_disk->disk_name, ##a) : \ | 248 | scmd_printk(const char *, const struct scsi_cmnd *, const char *, ...); |
252 | sdev_printk(prefix, (scmd)->device, fmt, ##a) | ||
253 | 249 | ||
254 | #define scmd_dbg(scmd, fmt, a...) \ | 250 | #define scmd_dbg(scmd, fmt, a...) \ |
255 | do { \ | 251 | do { \ |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 019e66858ce6..e113c757d555 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -402,6 +402,9 @@ struct scsi_host_template { | |||
402 | */ | 402 | */ |
403 | unsigned char present; | 403 | unsigned char present; |
404 | 404 | ||
405 | /* If use block layer to manage tags, this is tag allocation policy */ | ||
406 | int tag_alloc_policy; | ||
407 | |||
405 | /* | 408 | /* |
406 | * Let the block layer assigns tags to all commands. | 409 | * Let the block layer assigns tags to all commands. |
407 | */ | 410 | */ |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 9708b28bd2aa..b27977e8aaed 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -66,7 +66,8 @@ static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | |||
66 | * devices on the shared host (for libata) | 66 | * devices on the shared host (for libata) |
67 | */ | 67 | */ |
68 | if (!shost->bqt) { | 68 | if (!shost->bqt) { |
69 | shost->bqt = blk_init_tags(depth); | 69 | shost->bqt = blk_init_tags(depth, |
70 | shost->hostt->tag_alloc_policy); | ||
70 | if (!shost->bqt) | 71 | if (!shost->bqt) |
71 | return -ENOMEM; | 72 | return -ENOMEM; |
72 | } | 73 | } |
diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h index 8e1249474e84..b5f7b5f8d008 100644 --- a/include/soc/tegra/fuse.h +++ b/include/soc/tegra/fuse.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define TEGRA30 0x30 | 21 | #define TEGRA30 0x30 |
22 | #define TEGRA114 0x35 | 22 | #define TEGRA114 0x35 |
23 | #define TEGRA124 0x40 | 23 | #define TEGRA124 0x40 |
24 | #define TEGRA132 0x13 | ||
24 | 25 | ||
25 | #define TEGRA_FUSE_SKU_CALIB_0 0xf0 | 26 | #define TEGRA_FUSE_SKU_CALIB_0 0xf0 |
26 | #define TEGRA30_FUSE_SATA_CALIB 0x124 | 27 | #define TEGRA30_FUSE_SATA_CALIB 0x124 |
diff --git a/include/soc/tegra/pm.h b/include/soc/tegra/pm.h index 30fe2078a547..03909101d4e7 100644 --- a/include/soc/tegra/pm.h +++ b/include/soc/tegra/pm.h | |||
@@ -17,7 +17,7 @@ enum tegra_suspend_mode { | |||
17 | TEGRA_MAX_SUSPEND_MODE, | 17 | TEGRA_MAX_SUSPEND_MODE, |
18 | }; | 18 | }; |
19 | 19 | ||
20 | #ifdef CONFIG_PM_SLEEP | 20 | #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM) |
21 | enum tegra_suspend_mode | 21 | enum tegra_suspend_mode |
22 | tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode); | 22 | tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode); |
23 | 23 | ||
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h index abdf609c5918..f2d3a6d07210 100644 --- a/include/sound/ad1816a.h +++ b/include/sound/ad1816a.h | |||
@@ -170,10 +170,9 @@ extern int snd_ad1816a_create(struct snd_card *card, unsigned long port, | |||
170 | int irq, int dma1, int dma2, | 170 | int irq, int dma1, int dma2, |
171 | struct snd_ad1816a *chip); | 171 | struct snd_ad1816a *chip); |
172 | 172 | ||
173 | extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm); | 173 | extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device); |
174 | extern int snd_ad1816a_mixer(struct snd_ad1816a *chip); | 174 | extern int snd_ad1816a_mixer(struct snd_ad1816a *chip); |
175 | extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, | 175 | extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device); |
176 | struct snd_timer **rtimer); | ||
177 | #ifdef CONFIG_PM | 176 | #ifdef CONFIG_PM |
178 | extern void snd_ad1816a_suspend(struct snd_ad1816a *chip); | 177 | extern void snd_ad1816a_suspend(struct snd_ad1816a *chip); |
179 | extern void snd_ad1816a_resume(struct snd_ad1816a *chip); | 178 | extern void snd_ad1816a_resume(struct snd_ad1816a *chip); |
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index 2609048c1d44..58c145620c3c 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h | |||
@@ -286,7 +286,8 @@ struct ak4113 { | |||
286 | ak4113_write_t *write; | 286 | ak4113_write_t *write; |
287 | ak4113_read_t *read; | 287 | ak4113_read_t *read; |
288 | void *private_data; | 288 | void *private_data; |
289 | unsigned int init:1; | 289 | atomic_t wq_processing; |
290 | struct mutex reinit_mutex; | ||
290 | spinlock_t lock; | 291 | spinlock_t lock; |
291 | unsigned char regmap[AK4113_WRITABLE_REGS]; | 292 | unsigned char regmap[AK4113_WRITABLE_REGS]; |
292 | struct snd_kcontrol *kctls[AK4113_CONTROLS]; | 293 | struct snd_kcontrol *kctls[AK4113_CONTROLS]; |
@@ -317,5 +318,13 @@ int snd_ak4113_build(struct ak4113 *ak4113, | |||
317 | int snd_ak4113_external_rate(struct ak4113 *ak4113); | 318 | int snd_ak4113_external_rate(struct ak4113 *ak4113); |
318 | int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags); | 319 | int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags); |
319 | 320 | ||
321 | #ifdef CONFIG_PM | ||
322 | void snd_ak4113_suspend(struct ak4113 *chip); | ||
323 | void snd_ak4113_resume(struct ak4113 *chip); | ||
324 | #else | ||
325 | static inline void snd_ak4113_suspend(struct ak4113 *chip) {} | ||
326 | static inline void snd_ak4113_resume(struct ak4113 *chip) {} | ||
327 | #endif | ||
328 | |||
320 | #endif /* __SOUND_AK4113_H */ | 329 | #endif /* __SOUND_AK4113_H */ |
321 | 330 | ||
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h index 52f02a60dba7..b6feb7e225f2 100644 --- a/include/sound/ak4114.h +++ b/include/sound/ak4114.h | |||
@@ -168,7 +168,8 @@ struct ak4114 { | |||
168 | ak4114_write_t * write; | 168 | ak4114_write_t * write; |
169 | ak4114_read_t * read; | 169 | ak4114_read_t * read; |
170 | void * private_data; | 170 | void * private_data; |
171 | unsigned int init: 1; | 171 | atomic_t wq_processing; |
172 | struct mutex reinit_mutex; | ||
172 | spinlock_t lock; | 173 | spinlock_t lock; |
173 | unsigned char regmap[6]; | 174 | unsigned char regmap[6]; |
174 | unsigned char txcsb[5]; | 175 | unsigned char txcsb[5]; |
@@ -199,5 +200,13 @@ int snd_ak4114_build(struct ak4114 *ak4114, | |||
199 | int snd_ak4114_external_rate(struct ak4114 *ak4114); | 200 | int snd_ak4114_external_rate(struct ak4114 *ak4114); |
200 | int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags); | 201 | int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags); |
201 | 202 | ||
203 | #ifdef CONFIG_PM | ||
204 | void snd_ak4114_suspend(struct ak4114 *chip); | ||
205 | void snd_ak4114_resume(struct ak4114 *chip); | ||
206 | #else | ||
207 | static inline void snd_ak4114_suspend(struct ak4114 *chip) {} | ||
208 | static inline void snd_ak4114_resume(struct ak4114 *chip) {} | ||
209 | #endif | ||
210 | |||
202 | #endif /* __SOUND_AK4114_H */ | 211 | #endif /* __SOUND_AK4114_H */ |
203 | 212 | ||
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index 396e8f73670a..f48089d364c5 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
30 | #include <sound/core.h> | ||
30 | #include <sound/compress_offload.h> | 31 | #include <sound/compress_offload.h> |
31 | #include <sound/asound.h> | 32 | #include <sound/asound.h> |
32 | #include <sound/pcm.h> | 33 | #include <sound/pcm.h> |
@@ -134,7 +135,7 @@ struct snd_compr_ops { | |||
134 | /** | 135 | /** |
135 | * struct snd_compr: Compressed device | 136 | * struct snd_compr: Compressed device |
136 | * @name: DSP device name | 137 | * @name: DSP device name |
137 | * @dev: Device pointer | 138 | * @dev: associated device instance |
138 | * @ops: pointer to DSP callbacks | 139 | * @ops: pointer to DSP callbacks |
139 | * @private_data: pointer to DSP pvt data | 140 | * @private_data: pointer to DSP pvt data |
140 | * @card: sound card pointer | 141 | * @card: sound card pointer |
@@ -144,7 +145,7 @@ struct snd_compr_ops { | |||
144 | */ | 145 | */ |
145 | struct snd_compr { | 146 | struct snd_compr { |
146 | const char *name; | 147 | const char *name; |
147 | struct device *dev; | 148 | struct device dev; |
148 | struct snd_compr_ops *ops; | 149 | struct snd_compr_ops *ops; |
149 | void *private_data; | 150 | void *private_data; |
150 | struct snd_card *card; | 151 | struct snd_card *card; |
diff --git a/include/sound/control.h b/include/sound/control.h index 042613938a1d..75f3054023f7 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -93,12 +93,17 @@ struct snd_kctl_event { | |||
93 | 93 | ||
94 | struct pid; | 94 | struct pid; |
95 | 95 | ||
96 | enum { | ||
97 | SND_CTL_SUBDEV_PCM, | ||
98 | SND_CTL_SUBDEV_RAWMIDI, | ||
99 | SND_CTL_SUBDEV_ITEMS, | ||
100 | }; | ||
101 | |||
96 | struct snd_ctl_file { | 102 | struct snd_ctl_file { |
97 | struct list_head list; /* list of all control files */ | 103 | struct list_head list; /* list of all control files */ |
98 | struct snd_card *card; | 104 | struct snd_card *card; |
99 | struct pid *pid; | 105 | struct pid *pid; |
100 | int prefer_pcm_subdevice; | 106 | int preferred_subdevice[SND_CTL_SUBDEV_ITEMS]; |
101 | int prefer_rawmidi_subdevice; | ||
102 | wait_queue_head_t change_sleep; | 107 | wait_queue_head_t change_sleep; |
103 | spinlock_t read_lock; | 108 | spinlock_t read_lock; |
104 | struct fasync_struct *fasync; | 109 | struct fasync_struct *fasync; |
@@ -138,6 +143,8 @@ int snd_ctl_unregister_ioctl_compat(snd_kctl_ioctl_func_t fcn); | |||
138 | #define snd_ctl_unregister_ioctl_compat(fcn) | 143 | #define snd_ctl_unregister_ioctl_compat(fcn) |
139 | #endif | 144 | #endif |
140 | 145 | ||
146 | int snd_ctl_get_preferred_subdevice(struct snd_card *card, int type); | ||
147 | |||
141 | static inline unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) | 148 | static inline unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) |
142 | { | 149 | { |
143 | return id->numid - kctl->id.numid; | 150 | return id->numid - kctl->id.numid; |
diff --git a/include/sound/core.h b/include/sound/core.h index 1df3f2fe5350..da5748289968 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -109,6 +109,7 @@ struct snd_card { | |||
109 | private data */ | 109 | private data */ |
110 | struct list_head devices; /* devices */ | 110 | struct list_head devices; /* devices */ |
111 | 111 | ||
112 | struct device ctl_dev; /* control device */ | ||
112 | unsigned int last_numid; /* last used numeric ID */ | 113 | unsigned int last_numid; /* last used numeric ID */ |
113 | struct rw_semaphore controls_rwsem; /* controls list lock */ | 114 | struct rw_semaphore controls_rwsem; /* controls list lock */ |
114 | rwlock_t ctl_files_rwlock; /* ctl_files list lock */ | 115 | rwlock_t ctl_files_rwlock; /* ctl_files list lock */ |
@@ -131,6 +132,7 @@ struct snd_card { | |||
131 | struct completion *release_completion; | 132 | struct completion *release_completion; |
132 | struct device *dev; /* device assigned to this card */ | 133 | struct device *dev; /* device assigned to this card */ |
133 | struct device card_dev; /* cardX object for sysfs */ | 134 | struct device card_dev; /* cardX object for sysfs */ |
135 | const struct attribute_group *dev_groups[4]; /* assigned sysfs attr */ | ||
134 | bool registered; /* card_dev is registered? */ | 136 | bool registered; /* card_dev is registered? */ |
135 | 137 | ||
136 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
@@ -206,43 +208,13 @@ extern struct class *sound_class; | |||
206 | 208 | ||
207 | void snd_request_card(int card); | 209 | void snd_request_card(int card); |
208 | 210 | ||
209 | int snd_register_device_for_dev(int type, struct snd_card *card, | 211 | void snd_device_initialize(struct device *dev, struct snd_card *card); |
210 | int dev, | ||
211 | const struct file_operations *f_ops, | ||
212 | void *private_data, | ||
213 | const char *name, | ||
214 | struct device *device); | ||
215 | 212 | ||
216 | /** | 213 | int snd_register_device(int type, struct snd_card *card, int dev, |
217 | * snd_register_device - Register the ALSA device file for the card | 214 | const struct file_operations *f_ops, |
218 | * @type: the device type, SNDRV_DEVICE_TYPE_XXX | 215 | void *private_data, struct device *device); |
219 | * @card: the card instance | 216 | int snd_unregister_device(struct device *dev); |
220 | * @dev: the device index | ||
221 | * @f_ops: the file operations | ||
222 | * @private_data: user pointer for f_ops->open() | ||
223 | * @name: the device file name | ||
224 | * | ||
225 | * Registers an ALSA device file for the given card. | ||
226 | * The operators have to be set in reg parameter. | ||
227 | * | ||
228 | * This function uses the card's device pointer to link to the | ||
229 | * correct &struct device. | ||
230 | * | ||
231 | * Return: Zero if successful, or a negative error code on failure. | ||
232 | */ | ||
233 | static inline int snd_register_device(int type, struct snd_card *card, int dev, | ||
234 | const struct file_operations *f_ops, | ||
235 | void *private_data, | ||
236 | const char *name) | ||
237 | { | ||
238 | return snd_register_device_for_dev(type, card, dev, f_ops, | ||
239 | private_data, name, | ||
240 | snd_card_get_device_link(card)); | ||
241 | } | ||
242 | |||
243 | int snd_unregister_device(int type, struct snd_card *card, int dev); | ||
244 | void *snd_lookup_minor_data(unsigned int minor, int type); | 217 | void *snd_lookup_minor_data(unsigned int minor, int type); |
245 | struct device *snd_get_device(int type, struct snd_card *card, int dev); | ||
246 | 218 | ||
247 | #ifdef CONFIG_SND_OSSEMUL | 219 | #ifdef CONFIG_SND_OSSEMUL |
248 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 220 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
@@ -291,6 +263,8 @@ void snd_card_set_id(struct snd_card *card, const char *id); | |||
291 | int snd_card_register(struct snd_card *card); | 263 | int snd_card_register(struct snd_card *card); |
292 | int snd_card_info_init(void); | 264 | int snd_card_info_init(void); |
293 | int snd_card_info_done(void); | 265 | int snd_card_info_done(void); |
266 | int snd_card_add_dev_attr(struct snd_card *card, | ||
267 | const struct attribute_group *group); | ||
294 | int snd_component_add(struct snd_card *card, const char *component); | 268 | int snd_component_add(struct snd_card *card, const char *component); |
295 | int snd_card_file_add(struct snd_card *card, struct file *file); | 269 | int snd_card_file_add(struct snd_card *card, struct file *file); |
296 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 270 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index c46908c1bb3f..0de95ccb92cf 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -33,8 +33,8 @@ | |||
33 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/firmware.h> | 35 | #include <linux/firmware.h> |
36 | #include <linux/io.h> | ||
36 | 37 | ||
37 | #include <asm/io.h> | ||
38 | #include <uapi/sound/emu10k1.h> | 38 | #include <uapi/sound/emu10k1.h> |
39 | 39 | ||
40 | /* ------------------- DEFINES -------------------- */ | 40 | /* ------------------- DEFINES -------------------- */ |
@@ -1809,17 +1809,17 @@ int snd_emu10k1_create(struct snd_card *card, | |||
1809 | uint subsystem, | 1809 | uint subsystem, |
1810 | struct snd_emu10k1 ** remu); | 1810 | struct snd_emu10k1 ** remu); |
1811 | 1811 | ||
1812 | int snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1812 | int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device); |
1813 | int snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1813 | int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device); |
1814 | int snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1814 | int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device); |
1815 | int snd_p16v_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1815 | int snd_p16v_pcm(struct snd_emu10k1 *emu, int device); |
1816 | int snd_p16v_free(struct snd_emu10k1 * emu); | 1816 | int snd_p16v_free(struct snd_emu10k1 * emu); |
1817 | int snd_p16v_mixer(struct snd_emu10k1 * emu); | 1817 | int snd_p16v_mixer(struct snd_emu10k1 * emu); |
1818 | int snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1818 | int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device); |
1819 | int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); | 1819 | int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 *emu, int device); |
1820 | int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device); | 1820 | int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device); |
1821 | int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device); | 1821 | int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device); |
1822 | int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep ** rhwdep); | 1822 | int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device); |
1823 | 1823 | ||
1824 | irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id); | 1824 | irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id); |
1825 | 1825 | ||
diff --git a/include/sound/es1688.h b/include/sound/es1688.h index 1d636a2d8896..b34f23a5bb74 100644 --- a/include/sound/es1688.h +++ b/include/sound/es1688.h | |||
@@ -115,8 +115,7 @@ int snd_es1688_create(struct snd_card *card, | |||
115 | int mpu_irq, | 115 | int mpu_irq, |
116 | int dma8, | 116 | int dma8, |
117 | unsigned short hardware); | 117 | unsigned short hardware); |
118 | int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device, | 118 | int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device); |
119 | struct snd_pcm **rpcm); | ||
120 | int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); | 119 | int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); |
121 | int snd_es1688_reset(struct snd_es1688 *chip); | 120 | int snd_es1688_reset(struct snd_es1688 *chip); |
122 | 121 | ||
diff --git a/include/sound/gus.h b/include/sound/gus.h index 42905d811da7..07c116fe78c8 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <sound/timer.h> | 27 | #include <sound/timer.h> |
28 | #include <sound/seq_midi_emul.h> | 28 | #include <sound/seq_midi_emul.h> |
29 | #include <sound/seq_device.h> | 29 | #include <sound/seq_device.h> |
30 | #include <asm/io.h> | 30 | #include <linux/io.h> |
31 | 31 | ||
32 | /* IO ports */ | 32 | /* IO ports */ |
33 | 33 | ||
@@ -591,7 +591,7 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus); | |||
591 | 591 | ||
592 | /* gus_pcm.c */ | 592 | /* gus_pcm.c */ |
593 | 593 | ||
594 | int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm); | 594 | int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index); |
595 | 595 | ||
596 | #ifdef CONFIG_SND_DEBUG | 596 | #ifdef CONFIG_SND_DEBUG |
597 | extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus); | 597 | extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus); |
@@ -620,7 +620,7 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus); | |||
620 | 620 | ||
621 | /* gus_uart.c */ | 621 | /* gus_uart.c */ |
622 | 622 | ||
623 | int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi); | 623 | int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device); |
624 | 624 | ||
625 | /* gus_dram.c */ | 625 | /* gus_dram.c */ |
626 | int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, | 626 | int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, |
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h index ae04a3ec9c77..ab9fcb2f97f0 100644 --- a/include/sound/hwdep.h +++ b/include/sound/hwdep.h | |||
@@ -68,8 +68,7 @@ struct snd_hwdep { | |||
68 | wait_queue_head_t open_wait; | 68 | wait_queue_head_t open_wait; |
69 | void *private_data; | 69 | void *private_data; |
70 | void (*private_free) (struct snd_hwdep *hwdep); | 70 | void (*private_free) (struct snd_hwdep *hwdep); |
71 | struct device *dev; | 71 | struct device dev; |
72 | const struct attribute_group **groups; | ||
73 | 72 | ||
74 | struct mutex open_mutex; | 73 | struct mutex open_mutex; |
75 | int used; /* reference counter */ | 74 | int used; /* reference counter */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index b429b73e875e..c0ddb7e69c28 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -94,9 +94,6 @@ struct snd_pcm_ops { | |||
94 | #define SNDRV_PCM_DEVICES 8 | 94 | #define SNDRV_PCM_DEVICES 8 |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | #define SNDRV_PCM_IOCTL1_FALSE ((void *)0) | ||
98 | #define SNDRV_PCM_IOCTL1_TRUE ((void *)1) | ||
99 | |||
100 | #define SNDRV_PCM_IOCTL1_RESET 0 | 97 | #define SNDRV_PCM_IOCTL1_RESET 0 |
101 | #define SNDRV_PCM_IOCTL1_INFO 1 | 98 | #define SNDRV_PCM_IOCTL1_INFO 1 |
102 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 | 99 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 |
@@ -109,6 +106,7 @@ struct snd_pcm_ops { | |||
109 | #define SNDRV_PCM_TRIGGER_PAUSE_RELEASE 4 | 106 | #define SNDRV_PCM_TRIGGER_PAUSE_RELEASE 4 |
110 | #define SNDRV_PCM_TRIGGER_SUSPEND 5 | 107 | #define SNDRV_PCM_TRIGGER_SUSPEND 5 |
111 | #define SNDRV_PCM_TRIGGER_RESUME 6 | 108 | #define SNDRV_PCM_TRIGGER_RESUME 6 |
109 | #define SNDRV_PCM_TRIGGER_DRAIN 7 | ||
112 | 110 | ||
113 | #define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1) | 111 | #define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1) |
114 | 112 | ||
@@ -275,12 +273,19 @@ struct snd_pcm_hw_constraint_list { | |||
275 | unsigned int mask; | 273 | unsigned int mask; |
276 | }; | 274 | }; |
277 | 275 | ||
276 | struct snd_pcm_hw_constraint_ranges { | ||
277 | unsigned int count; | ||
278 | const struct snd_interval *ranges; | ||
279 | unsigned int mask; | ||
280 | }; | ||
281 | |||
278 | struct snd_pcm_hwptr_log; | 282 | struct snd_pcm_hwptr_log; |
279 | 283 | ||
280 | struct snd_pcm_runtime { | 284 | struct snd_pcm_runtime { |
281 | /* -- Status -- */ | 285 | /* -- Status -- */ |
282 | struct snd_pcm_substream *trigger_master; | 286 | struct snd_pcm_substream *trigger_master; |
283 | struct timespec trigger_tstamp; /* trigger timestamp */ | 287 | struct timespec trigger_tstamp; /* trigger timestamp */ |
288 | bool trigger_tstamp_latched; /* trigger timestamp latched in low-level driver/hardware */ | ||
284 | int overrange; | 289 | int overrange; |
285 | snd_pcm_uframes_t avail_max; | 290 | snd_pcm_uframes_t avail_max; |
286 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ | 291 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ |
@@ -449,6 +454,7 @@ struct snd_pcm_str { | |||
449 | #endif | 454 | #endif |
450 | #endif | 455 | #endif |
451 | struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */ | 456 | struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */ |
457 | struct device dev; | ||
452 | }; | 458 | }; |
453 | 459 | ||
454 | struct snd_pcm { | 460 | struct snd_pcm { |
@@ -465,7 +471,6 @@ struct snd_pcm { | |||
465 | wait_queue_head_t open_wait; | 471 | wait_queue_head_t open_wait; |
466 | void *private_data; | 472 | void *private_data; |
467 | void (*private_free) (struct snd_pcm *pcm); | 473 | void (*private_free) (struct snd_pcm *pcm); |
468 | struct device *dev; /* actual hw device this belongs to */ | ||
469 | bool internal; /* pcm is for internal use only */ | 474 | bool internal; /* pcm is for internal use only */ |
470 | bool nonatomic; /* whole PCM operations are in non-atomic context */ | 475 | bool nonatomic; /* whole PCM operations are in non-atomic context */ |
471 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 476 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
@@ -520,7 +525,6 @@ void snd_pcm_release_substream(struct snd_pcm_substream *substream); | |||
520 | int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file, | 525 | int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file, |
521 | struct snd_pcm_substream **rsubstream); | 526 | struct snd_pcm_substream **rsubstream); |
522 | void snd_pcm_detach_substream(struct snd_pcm_substream *substream); | 527 | void snd_pcm_detach_substream(struct snd_pcm_substream *substream); |
523 | void snd_pcm_vma_notify_data(void *client, void *data); | ||
524 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); | 528 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
525 | 529 | ||
526 | 530 | ||
@@ -910,6 +914,8 @@ void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, | |||
910 | const struct snd_interval *b, struct snd_interval *c); | 914 | const struct snd_interval *b, struct snd_interval *c); |
911 | int snd_interval_list(struct snd_interval *i, unsigned int count, | 915 | int snd_interval_list(struct snd_interval *i, unsigned int count, |
912 | const unsigned int *list, unsigned int mask); | 916 | const unsigned int *list, unsigned int mask); |
917 | int snd_interval_ranges(struct snd_interval *i, unsigned int count, | ||
918 | const struct snd_interval *list, unsigned int mask); | ||
913 | int snd_interval_ratnum(struct snd_interval *i, | 919 | int snd_interval_ratnum(struct snd_interval *i, |
914 | unsigned int rats_count, struct snd_ratnum *rats, | 920 | unsigned int rats_count, struct snd_ratnum *rats, |
915 | unsigned int *nump, unsigned int *denp); | 921 | unsigned int *nump, unsigned int *denp); |
@@ -934,6 +940,10 @@ int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, | |||
934 | unsigned int cond, | 940 | unsigned int cond, |
935 | snd_pcm_hw_param_t var, | 941 | snd_pcm_hw_param_t var, |
936 | const struct snd_pcm_hw_constraint_list *l); | 942 | const struct snd_pcm_hw_constraint_list *l); |
943 | int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime, | ||
944 | unsigned int cond, | ||
945 | snd_pcm_hw_param_t var, | ||
946 | const struct snd_pcm_hw_constraint_ranges *r); | ||
937 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, | 947 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
938 | unsigned int cond, | 948 | unsigned int cond, |
939 | snd_pcm_hw_param_t var, | 949 | snd_pcm_hw_param_t var, |
@@ -986,21 +996,15 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ | |||
986 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); | 996 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); |
987 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); | 997 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); |
988 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); | 998 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); |
989 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsigned, int big_endian); | ||
990 | 999 | ||
991 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, | 1000 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, |
992 | const struct snd_pcm_ops *ops); | 1001 | const struct snd_pcm_ops *ops); |
993 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); | 1002 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |
994 | int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); | ||
995 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, | 1003 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
996 | unsigned int cmd, void *arg); | 1004 | unsigned int cmd, void *arg); |
997 | int snd_pcm_update_state(struct snd_pcm_substream *substream, | 1005 | int snd_pcm_update_state(struct snd_pcm_substream *substream, |
998 | struct snd_pcm_runtime *runtime); | 1006 | struct snd_pcm_runtime *runtime); |
999 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); | 1007 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); |
1000 | int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); | ||
1001 | int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); | ||
1002 | int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream); | ||
1003 | int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream); | ||
1004 | void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr); | 1008 | void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr); |
1005 | void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); | 1009 | void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); |
1006 | snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, | 1010 | snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 6b1c78f05fab..3c45f3924ba7 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -38,31 +38,6 @@ int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, | |||
38 | #define MASK_OFS(i) ((i) >> 5) | 38 | #define MASK_OFS(i) ((i) >> 5) |
39 | #define MASK_BIT(i) (1U << ((i) & 31)) | 39 | #define MASK_BIT(i) (1U << ((i) & 31)) |
40 | 40 | ||
41 | static inline unsigned int ld2(u_int32_t v) | ||
42 | { | ||
43 | unsigned r = 0; | ||
44 | |||
45 | if (v >= 0x10000) { | ||
46 | v >>= 16; | ||
47 | r += 16; | ||
48 | } | ||
49 | if (v >= 0x100) { | ||
50 | v >>= 8; | ||
51 | r += 8; | ||
52 | } | ||
53 | if (v >= 0x10) { | ||
54 | v >>= 4; | ||
55 | r += 4; | ||
56 | } | ||
57 | if (v >= 4) { | ||
58 | v >>= 2; | ||
59 | r += 2; | ||
60 | } | ||
61 | if (v >= 2) | ||
62 | r++; | ||
63 | return r; | ||
64 | } | ||
65 | |||
66 | static inline size_t snd_mask_sizeof(void) | 41 | static inline size_t snd_mask_sizeof(void) |
67 | { | 42 | { |
68 | return sizeof(struct snd_mask); | 43 | return sizeof(struct snd_mask); |
@@ -92,7 +67,7 @@ static inline unsigned int snd_mask_min(const struct snd_mask *mask) | |||
92 | int i; | 67 | int i; |
93 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { | 68 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { |
94 | if (mask->bits[i]) | 69 | if (mask->bits[i]) |
95 | return ffs(mask->bits[i]) - 1 + (i << 5); | 70 | return __ffs(mask->bits[i]) + (i << 5); |
96 | } | 71 | } |
97 | return 0; | 72 | return 0; |
98 | } | 73 | } |
@@ -102,7 +77,7 @@ static inline unsigned int snd_mask_max(const struct snd_mask *mask) | |||
102 | int i; | 77 | int i; |
103 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { | 78 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { |
104 | if (mask->bits[i]) | 79 | if (mask->bits[i]) |
105 | return ld2(mask->bits[i]) + (i << 5); | 80 | return __fls(mask->bits[i]) + (i << 5); |
106 | } | 81 | } |
107 | return 0; | 82 | return 0; |
108 | } | 83 | } |
@@ -325,43 +300,68 @@ static inline int snd_interval_eq(const struct snd_interval *i1, const struct sn | |||
325 | i1->max == i2->max && i1->openmax == i2->openmax; | 300 | i1->max == i2->max && i1->openmax == i2->openmax; |
326 | } | 301 | } |
327 | 302 | ||
328 | static inline unsigned int add(unsigned int a, unsigned int b) | 303 | /** |
304 | * params_access - get the access type from the hw params | ||
305 | * @p: hw params | ||
306 | */ | ||
307 | static inline snd_pcm_access_t params_access(const struct snd_pcm_hw_params *p) | ||
329 | { | 308 | { |
330 | if (a >= UINT_MAX - b) | 309 | return (__force snd_pcm_access_t)snd_mask_min(hw_param_mask_c(p, |
331 | return UINT_MAX; | 310 | SNDRV_PCM_HW_PARAM_ACCESS)); |
332 | return a + b; | ||
333 | } | 311 | } |
334 | 312 | ||
335 | static inline unsigned int sub(unsigned int a, unsigned int b) | 313 | /** |
314 | * params_format - get the sample format from the hw params | ||
315 | * @p: hw params | ||
316 | */ | ||
317 | static inline snd_pcm_format_t params_format(const struct snd_pcm_hw_params *p) | ||
336 | { | 318 | { |
337 | if (a > b) | 319 | return (__force snd_pcm_format_t)snd_mask_min(hw_param_mask_c(p, |
338 | return a - b; | 320 | SNDRV_PCM_HW_PARAM_FORMAT)); |
339 | return 0; | ||
340 | } | 321 | } |
341 | 322 | ||
342 | #define params_access(p) ((__force snd_pcm_access_t)\ | 323 | /** |
343 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS))) | 324 | * params_subformat - get the sample subformat from the hw params |
344 | #define params_format(p) ((__force snd_pcm_format_t)\ | 325 | * @p: hw params |
345 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT))) | 326 | */ |
346 | #define params_subformat(p) \ | 327 | static inline snd_pcm_subformat_t |
347 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) | 328 | params_subformat(const struct snd_pcm_hw_params *p) |
329 | { | ||
330 | return (__force snd_pcm_subformat_t)snd_mask_min(hw_param_mask_c(p, | ||
331 | SNDRV_PCM_HW_PARAM_SUBFORMAT)); | ||
332 | } | ||
348 | 333 | ||
334 | /** | ||
335 | * params_period_bytes - get the period size (in bytes) from the hw params | ||
336 | * @p: hw params | ||
337 | */ | ||
349 | static inline unsigned int | 338 | static inline unsigned int |
350 | params_period_bytes(const struct snd_pcm_hw_params *p) | 339 | params_period_bytes(const struct snd_pcm_hw_params *p) |
351 | { | 340 | { |
352 | return (params_period_size(p) * | 341 | return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->min; |
353 | snd_pcm_format_physical_width(params_format(p)) * | ||
354 | params_channels(p)) / 8; | ||
355 | } | 342 | } |
356 | 343 | ||
357 | static inline int | 344 | /** |
358 | params_width(const struct snd_pcm_hw_params *p) | 345 | * params_width - get the number of bits of the sample format from the hw params |
346 | * @p: hw params | ||
347 | * | ||
348 | * This function returns the number of bits per sample that the selected sample | ||
349 | * format of the hw params has. | ||
350 | */ | ||
351 | static inline int params_width(const struct snd_pcm_hw_params *p) | ||
359 | { | 352 | { |
360 | return snd_pcm_format_width(params_format(p)); | 353 | return snd_pcm_format_width(params_format(p)); |
361 | } | 354 | } |
362 | 355 | ||
363 | static inline int | 356 | /* |
364 | params_physical_width(const struct snd_pcm_hw_params *p) | 357 | * params_physical_width - get the storage size of the sample format from the hw params |
358 | * @p: hw params | ||
359 | * | ||
360 | * This functions returns the number of bits per sample that the selected sample | ||
361 | * format of the hw params takes up in memory. This will be equal or larger than | ||
362 | * params_width(). | ||
363 | */ | ||
364 | static inline int params_physical_width(const struct snd_pcm_hw_params *p) | ||
365 | { | 365 | { |
366 | return snd_pcm_format_physical_width(params_format(p)); | 366 | return snd_pcm_format_physical_width(params_format(p)); |
367 | } | 367 | } |
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 311dafe6cc4b..f6cbef78db62 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/device.h> | ||
31 | 32 | ||
32 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | 33 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) |
33 | #include <sound/seq_device.h> | 34 | #include <sound/seq_device.h> |
@@ -139,7 +140,8 @@ struct snd_rawmidi { | |||
139 | struct mutex open_mutex; | 140 | struct mutex open_mutex; |
140 | wait_queue_head_t open_wait; | 141 | wait_queue_head_t open_wait; |
141 | 142 | ||
142 | struct snd_info_entry *dev; | 143 | struct device dev; |
144 | |||
143 | struct snd_info_entry *proc_entry; | 145 | struct snd_info_entry *proc_entry; |
144 | 146 | ||
145 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | 147 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) |
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h index 83284cae464c..4cecd0c175f6 100644 --- a/include/sound/rcar_snd.h +++ b/include/sound/rcar_snd.h | |||
@@ -55,6 +55,7 @@ struct rsnd_ssi_platform_info { | |||
55 | struct rsnd_src_platform_info { | 55 | struct rsnd_src_platform_info { |
56 | u32 convert_rate; /* sampling rate convert */ | 56 | u32 convert_rate; /* sampling rate convert */ |
57 | int dma_id; /* for Gen2 SCU */ | 57 | int dma_id; /* for Gen2 SCU */ |
58 | int irq; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | /* | 61 | /* |
diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h index d9eb7d861cd0..a6207043ac3c 100644 --- a/include/sound/rt5677.h +++ b/include/sound/rt5677.h | |||
@@ -37,6 +37,9 @@ struct rt5677_platform_data { | |||
37 | OFF, GPIO4, GPIO5 and GPIO6 respectively */ | 37 | OFF, GPIO4, GPIO5 and GPIO6 respectively */ |
38 | unsigned int jd2_gpio; | 38 | unsigned int jd2_gpio; |
39 | unsigned int jd3_gpio; | 39 | unsigned int jd3_gpio; |
40 | |||
41 | /* Set MICBIAS1 VDD 1v8 or 3v3 */ | ||
42 | bool micbias1_vdd_3v3; | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | #endif | 45 | #endif |
diff --git a/include/sound/sb.h b/include/sound/sb.h index ba3960329646..bacefaee411a 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <sound/pcm.h> | 25 | #include <sound/pcm.h> |
26 | #include <sound/rawmidi.h> | 26 | #include <sound/rawmidi.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <asm/io.h> | 28 | #include <linux/io.h> |
29 | 29 | ||
30 | enum sb_hw_type { | 30 | enum sb_hw_type { |
31 | SB_HW_AUTO, | 31 | SB_HW_AUTO, |
@@ -308,7 +308,7 @@ void snd_sbmixer_resume(struct snd_sb *chip); | |||
308 | #endif | 308 | #endif |
309 | 309 | ||
310 | /* sb8_init.c */ | 310 | /* sb8_init.c */ |
311 | int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm); | 311 | int snd_sb8dsp_pcm(struct snd_sb *chip, int device); |
312 | /* sb8.c */ | 312 | /* sb8.c */ |
313 | irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip); | 313 | irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip); |
314 | int snd_sb8_playback_open(struct snd_pcm_substream *substream); | 314 | int snd_sb8_playback_open(struct snd_pcm_substream *substream); |
@@ -317,10 +317,10 @@ int snd_sb8_playback_close(struct snd_pcm_substream *substream); | |||
317 | int snd_sb8_capture_close(struct snd_pcm_substream *substream); | 317 | int snd_sb8_capture_close(struct snd_pcm_substream *substream); |
318 | /* midi8.c */ | 318 | /* midi8.c */ |
319 | irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip); | 319 | irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip); |
320 | int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi); | 320 | int snd_sb8dsp_midi(struct snd_sb *chip, int device); |
321 | 321 | ||
322 | /* sb16_init.c */ | 322 | /* sb16_init.c */ |
323 | int snd_sb16dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm); | 323 | int snd_sb16dsp_pcm(struct snd_sb *chip, int device); |
324 | const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction); | 324 | const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction); |
325 | int snd_sb16dsp_configure(struct snd_sb *chip); | 325 | int snd_sb16dsp_configure(struct snd_sb *chip); |
326 | /* sb16.c */ | 326 | /* sb16.c */ |
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h index eea5400fe373..18a2ac58b88f 100644 --- a/include/sound/seq_kernel.h +++ b/include/sound/seq_kernel.h | |||
@@ -27,11 +27,8 @@ | |||
27 | typedef struct snd_seq_real_time snd_seq_real_time_t; | 27 | typedef struct snd_seq_real_time snd_seq_real_time_t; |
28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; | 28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; |
29 | 29 | ||
30 | /* maximum number of events dequeued per schedule interval */ | ||
31 | #define SNDRV_SEQ_MAX_DEQUEUE 50 | ||
32 | |||
33 | /* maximum number of queues */ | 30 | /* maximum number of queues */ |
34 | #define SNDRV_SEQ_MAX_QUEUES 8 | 31 | #define SNDRV_SEQ_MAX_QUEUES 32 |
35 | 32 | ||
36 | /* max number of concurrent clients */ | 33 | /* max number of concurrent clients */ |
37 | #define SNDRV_SEQ_MAX_CLIENTS 192 | 34 | #define SNDRV_SEQ_MAX_CLIENTS 192 |
@@ -42,9 +39,6 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t; | |||
42 | /* max number of events in memory pool */ | 39 | /* max number of events in memory pool */ |
43 | #define SNDRV_SEQ_MAX_EVENTS 2000 | 40 | #define SNDRV_SEQ_MAX_EVENTS 2000 |
44 | 41 | ||
45 | /* default number of events in memory chunk */ | ||
46 | #define SNDRV_SEQ_DEFAULT_CHUNK_EVENTS 64 | ||
47 | |||
48 | /* default number of events in memory pool */ | 42 | /* default number of events in memory pool */ |
49 | #define SNDRV_SEQ_DEFAULT_EVENTS 500 | 43 | #define SNDRV_SEQ_DEFAULT_EVENTS 500 |
50 | 44 | ||
@@ -70,7 +64,6 @@ struct snd_seq_port_callback { | |||
70 | int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info); | 64 | int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info); |
71 | int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop); | 65 | int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop); |
72 | void (*private_free)(void *private_data); | 66 | void (*private_free)(void *private_data); |
73 | unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */ | ||
74 | /*...*/ | 67 | /*...*/ |
75 | }; | 68 | }; |
76 | 69 | ||
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h index 9b0ac77177b6..1255ddb1d3e2 100644 --- a/include/sound/simple_card.h +++ b/include/sound/simple_card.h | |||
@@ -20,6 +20,7 @@ struct asoc_simple_dai { | |||
20 | unsigned int sysclk; | 20 | unsigned int sysclk; |
21 | int slots; | 21 | int slots; |
22 | int slot_width; | 22 | int slot_width; |
23 | struct clk *clk; | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | struct asoc_simple_card_info { | 26 | struct asoc_simple_card_info { |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 89823cfe6f04..8d7416e46861 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -405,7 +405,7 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, | |||
405 | struct snd_soc_dapm_update *update); | 405 | struct snd_soc_dapm_update *update); |
406 | 406 | ||
407 | /* dapm sys fs - used by the core */ | 407 | /* dapm sys fs - used by the core */ |
408 | int snd_soc_dapm_sys_add(struct device *dev); | 408 | extern struct attribute *soc_dapm_dev_attrs[]; |
409 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, | 409 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, |
410 | struct dentry *parent); | 410 | struct dentry *parent); |
411 | 411 | ||
@@ -431,7 +431,6 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | |||
431 | const char *pin); | 431 | const char *pin); |
432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
433 | const char *pin); | 433 | const char *pin); |
434 | void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card); | ||
435 | unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); | 434 | unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); |
436 | 435 | ||
437 | /* Mostly internal - should not normally be used */ | 436 | /* Mostly internal - should not normally be used */ |
@@ -526,7 +525,6 @@ struct snd_soc_dapm_widget { | |||
526 | enum snd_soc_dapm_type id; | 525 | enum snd_soc_dapm_type id; |
527 | const char *name; /* widget name */ | 526 | const char *name; /* widget name */ |
528 | const char *sname; /* stream name */ | 527 | const char *sname; /* stream name */ |
529 | struct snd_soc_codec *codec; | ||
530 | struct list_head list; | 528 | struct list_head list; |
531 | struct snd_soc_dapm_context *dapm; | 529 | struct snd_soc_dapm_context *dapm; |
532 | 530 | ||
diff --git a/include/sound/soc.h b/include/sound/soc.h index b4fca9aed2a2..0d1ade195628 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -429,6 +429,9 @@ bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd); | |||
429 | void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream); | 429 | void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream); |
430 | void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream); | 430 | void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream); |
431 | 431 | ||
432 | int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, | ||
433 | unsigned int dai_fmt); | ||
434 | |||
432 | /* Utility functions to get clock rates from various things */ | 435 | /* Utility functions to get clock rates from various things */ |
433 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 436 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
434 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); | 437 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); |
@@ -498,6 +501,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, | |||
498 | unsigned int mask, unsigned int value); | 501 | unsigned int mask, unsigned int value); |
499 | 502 | ||
500 | #ifdef CONFIG_SND_SOC_AC97_BUS | 503 | #ifdef CONFIG_SND_SOC_AC97_BUS |
504 | struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec); | ||
501 | struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec); | 505 | struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec); |
502 | void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); | 506 | void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); |
503 | 507 | ||
diff --git a/include/sound/sta32x.h b/include/sound/sta32x.h index 8d93b0357a14..a894f7d17b1a 100644 --- a/include/sound/sta32x.h +++ b/include/sound/sta32x.h | |||
@@ -24,12 +24,20 @@ | |||
24 | #define STA32X_THERMAL_RECOVERY_ENABLE 2 | 24 | #define STA32X_THERMAL_RECOVERY_ENABLE 2 |
25 | 25 | ||
26 | struct sta32x_platform_data { | 26 | struct sta32x_platform_data { |
27 | int output_conf; | 27 | u8 output_conf; |
28 | int ch1_output_mapping; | 28 | u8 ch1_output_mapping; |
29 | int ch2_output_mapping; | 29 | u8 ch2_output_mapping; |
30 | int ch3_output_mapping; | 30 | u8 ch3_output_mapping; |
31 | int thermal_conf; | ||
32 | int needs_esd_watchdog; | 31 | int needs_esd_watchdog; |
32 | u8 drop_compensation_ns; | ||
33 | unsigned int thermal_warning_recovery:1; | ||
34 | unsigned int thermal_warning_adjustment:1; | ||
35 | unsigned int fault_detect_recovery:1; | ||
36 | unsigned int max_power_use_mpcc:1; | ||
37 | unsigned int max_power_correction:1; | ||
38 | unsigned int am_reduction_mode:1; | ||
39 | unsigned int odd_pwm_speed_mode:1; | ||
40 | unsigned int invalid_input_detect_mute:1; | ||
33 | }; | 41 | }; |
34 | 42 | ||
35 | #endif /* __LINUX_SND__STA32X_H */ | 43 | #endif /* __LINUX_SND__STA32X_H */ |
diff --git a/include/sound/wss.h b/include/sound/wss.h index 0c7f034f1e86..1823e3a964e2 100644 --- a/include/sound/wss.h +++ b/include/sound/wss.h | |||
@@ -154,8 +154,8 @@ int snd_wss_create(struct snd_card *card, | |||
154 | unsigned short hardware, | 154 | unsigned short hardware, |
155 | unsigned short hwshare, | 155 | unsigned short hwshare, |
156 | struct snd_wss **rchip); | 156 | struct snd_wss **rchip); |
157 | int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm); | 157 | int snd_wss_pcm(struct snd_wss *chip, int device); |
158 | int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer); | 158 | int snd_wss_timer(struct snd_wss *chip, int device); |
159 | int snd_wss_mixer(struct snd_wss *chip); | 159 | int snd_wss_mixer(struct snd_wss *chip); |
160 | 160 | ||
161 | const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction); | 161 | const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction); |
@@ -167,7 +167,7 @@ int snd_cs4236_create(struct snd_card *card, | |||
167 | unsigned short hardware, | 167 | unsigned short hardware, |
168 | unsigned short hwshare, | 168 | unsigned short hwshare, |
169 | struct snd_wss **rchip); | 169 | struct snd_wss **rchip); |
170 | int snd_cs4236_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm); | 170 | int snd_cs4236_pcm(struct snd_wss *chip, int device); |
171 | int snd_cs4236_mixer(struct snd_wss *chip); | 171 | int snd_cs4236_mixer(struct snd_wss *chip); |
172 | 172 | ||
173 | /* | 173 | /* |
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h new file mode 100644 index 000000000000..d3583d3ee193 --- /dev/null +++ b/include/target/iscsi/iscsi_target_core.h | |||
@@ -0,0 +1,897 @@ | |||
1 | #ifndef ISCSI_TARGET_CORE_H | ||
2 | #define ISCSI_TARGET_CORE_H | ||
3 | |||
4 | #include <linux/in.h> | ||
5 | #include <linux/configfs.h> | ||
6 | #include <net/sock.h> | ||
7 | #include <net/tcp.h> | ||
8 | #include <scsi/scsi_cmnd.h> | ||
9 | #include <scsi/iscsi_proto.h> | ||
10 | #include <target/target_core_base.h> | ||
11 | |||
12 | #define ISCSIT_VERSION "v4.1.0" | ||
13 | #define ISCSI_MAX_DATASN_MISSING_COUNT 16 | ||
14 | #define ISCSI_TX_THREAD_TCP_TIMEOUT 2 | ||
15 | #define ISCSI_RX_THREAD_TCP_TIMEOUT 2 | ||
16 | #define SECONDS_FOR_ASYNC_LOGOUT 10 | ||
17 | #define SECONDS_FOR_ASYNC_TEXT 10 | ||
18 | #define SECONDS_FOR_LOGOUT_COMP 15 | ||
19 | #define WHITE_SPACE " \t\v\f\n\r" | ||
20 | #define ISCSIT_MIN_TAGS 16 | ||
21 | #define ISCSIT_EXTRA_TAGS 8 | ||
22 | #define ISCSIT_TCP_BACKLOG 256 | ||
23 | |||
24 | /* struct iscsi_node_attrib sanity values */ | ||
25 | #define NA_DATAOUT_TIMEOUT 3 | ||
26 | #define NA_DATAOUT_TIMEOUT_MAX 60 | ||
27 | #define NA_DATAOUT_TIMEOUT_MIX 2 | ||
28 | #define NA_DATAOUT_TIMEOUT_RETRIES 5 | ||
29 | #define NA_DATAOUT_TIMEOUT_RETRIES_MAX 15 | ||
30 | #define NA_DATAOUT_TIMEOUT_RETRIES_MIN 1 | ||
31 | #define NA_NOPIN_TIMEOUT 15 | ||
32 | #define NA_NOPIN_TIMEOUT_MAX 60 | ||
33 | #define NA_NOPIN_TIMEOUT_MIN 3 | ||
34 | #define NA_NOPIN_RESPONSE_TIMEOUT 30 | ||
35 | #define NA_NOPIN_RESPONSE_TIMEOUT_MAX 60 | ||
36 | #define NA_NOPIN_RESPONSE_TIMEOUT_MIN 3 | ||
37 | #define NA_RANDOM_DATAIN_PDU_OFFSETS 0 | ||
38 | #define NA_RANDOM_DATAIN_SEQ_OFFSETS 0 | ||
39 | #define NA_RANDOM_R2T_OFFSETS 0 | ||
40 | |||
41 | /* struct iscsi_tpg_attrib sanity values */ | ||
42 | #define TA_AUTHENTICATION 1 | ||
43 | #define TA_LOGIN_TIMEOUT 15 | ||
44 | #define TA_LOGIN_TIMEOUT_MAX 30 | ||
45 | #define TA_LOGIN_TIMEOUT_MIN 5 | ||
46 | #define TA_NETIF_TIMEOUT 2 | ||
47 | #define TA_NETIF_TIMEOUT_MAX 15 | ||
48 | #define TA_NETIF_TIMEOUT_MIN 2 | ||
49 | #define TA_GENERATE_NODE_ACLS 0 | ||
50 | #define TA_DEFAULT_CMDSN_DEPTH 64 | ||
51 | #define TA_DEFAULT_CMDSN_DEPTH_MAX 512 | ||
52 | #define TA_DEFAULT_CMDSN_DEPTH_MIN 1 | ||
53 | #define TA_CACHE_DYNAMIC_ACLS 0 | ||
54 | /* Enabled by default in demo mode (generic_node_acls=1) */ | ||
55 | #define TA_DEMO_MODE_WRITE_PROTECT 1 | ||
56 | /* Disabled by default in production mode w/ explict ACLs */ | ||
57 | #define TA_PROD_MODE_WRITE_PROTECT 0 | ||
58 | #define TA_DEMO_MODE_DISCOVERY 1 | ||
59 | #define TA_DEFAULT_ERL 0 | ||
60 | #define TA_CACHE_CORE_NPS 0 | ||
61 | /* T10 protection information disabled by default */ | ||
62 | #define TA_DEFAULT_T10_PI 0 | ||
63 | |||
64 | #define ISCSI_IOV_DATA_BUFFER 5 | ||
65 | |||
66 | enum iscsit_transport_type { | ||
67 | ISCSI_TCP = 0, | ||
68 | ISCSI_SCTP_TCP = 1, | ||
69 | ISCSI_SCTP_UDP = 2, | ||
70 | ISCSI_IWARP_TCP = 3, | ||
71 | ISCSI_IWARP_SCTP = 4, | ||
72 | ISCSI_INFINIBAND = 5, | ||
73 | }; | ||
74 | |||
75 | /* RFC-3720 7.1.4 Standard Connection State Diagram for a Target */ | ||
76 | enum target_conn_state_table { | ||
77 | TARG_CONN_STATE_FREE = 0x1, | ||
78 | TARG_CONN_STATE_XPT_UP = 0x3, | ||
79 | TARG_CONN_STATE_IN_LOGIN = 0x4, | ||
80 | TARG_CONN_STATE_LOGGED_IN = 0x5, | ||
81 | TARG_CONN_STATE_IN_LOGOUT = 0x6, | ||
82 | TARG_CONN_STATE_LOGOUT_REQUESTED = 0x7, | ||
83 | TARG_CONN_STATE_CLEANUP_WAIT = 0x8, | ||
84 | }; | ||
85 | |||
86 | /* RFC-3720 7.3.2 Session State Diagram for a Target */ | ||
87 | enum target_sess_state_table { | ||
88 | TARG_SESS_STATE_FREE = 0x1, | ||
89 | TARG_SESS_STATE_ACTIVE = 0x2, | ||
90 | TARG_SESS_STATE_LOGGED_IN = 0x3, | ||
91 | TARG_SESS_STATE_FAILED = 0x4, | ||
92 | TARG_SESS_STATE_IN_CONTINUE = 0x5, | ||
93 | }; | ||
94 | |||
95 | /* struct iscsi_data_count->type */ | ||
96 | enum data_count_type { | ||
97 | ISCSI_RX_DATA = 1, | ||
98 | ISCSI_TX_DATA = 2, | ||
99 | }; | ||
100 | |||
101 | /* struct iscsi_datain_req->dr_complete */ | ||
102 | enum datain_req_comp_table { | ||
103 | DATAIN_COMPLETE_NORMAL = 1, | ||
104 | DATAIN_COMPLETE_WITHIN_COMMAND_RECOVERY = 2, | ||
105 | DATAIN_COMPLETE_CONNECTION_RECOVERY = 3, | ||
106 | }; | ||
107 | |||
108 | /* struct iscsi_datain_req->recovery */ | ||
109 | enum datain_req_rec_table { | ||
110 | DATAIN_WITHIN_COMMAND_RECOVERY = 1, | ||
111 | DATAIN_CONNECTION_RECOVERY = 2, | ||
112 | }; | ||
113 | |||
114 | /* struct iscsi_portal_group->state */ | ||
115 | enum tpg_state_table { | ||
116 | TPG_STATE_FREE = 0, | ||
117 | TPG_STATE_ACTIVE = 1, | ||
118 | TPG_STATE_INACTIVE = 2, | ||
119 | TPG_STATE_COLD_RESET = 3, | ||
120 | }; | ||
121 | |||
122 | /* struct iscsi_tiqn->tiqn_state */ | ||
123 | enum tiqn_state_table { | ||
124 | TIQN_STATE_ACTIVE = 1, | ||
125 | TIQN_STATE_SHUTDOWN = 2, | ||
126 | }; | ||
127 | |||
128 | /* struct iscsi_cmd->cmd_flags */ | ||
129 | enum cmd_flags_table { | ||
130 | ICF_GOT_LAST_DATAOUT = 0x00000001, | ||
131 | ICF_GOT_DATACK_SNACK = 0x00000002, | ||
132 | ICF_NON_IMMEDIATE_UNSOLICITED_DATA = 0x00000004, | ||
133 | ICF_SENT_LAST_R2T = 0x00000008, | ||
134 | ICF_WITHIN_COMMAND_RECOVERY = 0x00000010, | ||
135 | ICF_CONTIG_MEMORY = 0x00000020, | ||
136 | ICF_ATTACHED_TO_RQUEUE = 0x00000040, | ||
137 | ICF_OOO_CMDSN = 0x00000080, | ||
138 | ICF_SENDTARGETS_ALL = 0x00000100, | ||
139 | ICF_SENDTARGETS_SINGLE = 0x00000200, | ||
140 | }; | ||
141 | |||
142 | /* struct iscsi_cmd->i_state */ | ||
143 | enum cmd_i_state_table { | ||
144 | ISTATE_NO_STATE = 0, | ||
145 | ISTATE_NEW_CMD = 1, | ||
146 | ISTATE_DEFERRED_CMD = 2, | ||
147 | ISTATE_UNSOLICITED_DATA = 3, | ||
148 | ISTATE_RECEIVE_DATAOUT = 4, | ||
149 | ISTATE_RECEIVE_DATAOUT_RECOVERY = 5, | ||
150 | ISTATE_RECEIVED_LAST_DATAOUT = 6, | ||
151 | ISTATE_WITHIN_DATAOUT_RECOVERY = 7, | ||
152 | ISTATE_IN_CONNECTION_RECOVERY = 8, | ||
153 | ISTATE_RECEIVED_TASKMGT = 9, | ||
154 | ISTATE_SEND_ASYNCMSG = 10, | ||
155 | ISTATE_SENT_ASYNCMSG = 11, | ||
156 | ISTATE_SEND_DATAIN = 12, | ||
157 | ISTATE_SEND_LAST_DATAIN = 13, | ||
158 | ISTATE_SENT_LAST_DATAIN = 14, | ||
159 | ISTATE_SEND_LOGOUTRSP = 15, | ||
160 | ISTATE_SENT_LOGOUTRSP = 16, | ||
161 | ISTATE_SEND_NOPIN = 17, | ||
162 | ISTATE_SENT_NOPIN = 18, | ||
163 | ISTATE_SEND_REJECT = 19, | ||
164 | ISTATE_SENT_REJECT = 20, | ||
165 | ISTATE_SEND_R2T = 21, | ||
166 | ISTATE_SENT_R2T = 22, | ||
167 | ISTATE_SEND_R2T_RECOVERY = 23, | ||
168 | ISTATE_SENT_R2T_RECOVERY = 24, | ||
169 | ISTATE_SEND_LAST_R2T = 25, | ||
170 | ISTATE_SENT_LAST_R2T = 26, | ||
171 | ISTATE_SEND_LAST_R2T_RECOVERY = 27, | ||
172 | ISTATE_SENT_LAST_R2T_RECOVERY = 28, | ||
173 | ISTATE_SEND_STATUS = 29, | ||
174 | ISTATE_SEND_STATUS_BROKEN_PC = 30, | ||
175 | ISTATE_SENT_STATUS = 31, | ||
176 | ISTATE_SEND_STATUS_RECOVERY = 32, | ||
177 | ISTATE_SENT_STATUS_RECOVERY = 33, | ||
178 | ISTATE_SEND_TASKMGTRSP = 34, | ||
179 | ISTATE_SENT_TASKMGTRSP = 35, | ||
180 | ISTATE_SEND_TEXTRSP = 36, | ||
181 | ISTATE_SENT_TEXTRSP = 37, | ||
182 | ISTATE_SEND_NOPIN_WANT_RESPONSE = 38, | ||
183 | ISTATE_SENT_NOPIN_WANT_RESPONSE = 39, | ||
184 | ISTATE_SEND_NOPIN_NO_RESPONSE = 40, | ||
185 | ISTATE_REMOVE = 41, | ||
186 | ISTATE_FREE = 42, | ||
187 | }; | ||
188 | |||
189 | /* Used for iscsi_recover_cmdsn() return values */ | ||
190 | enum recover_cmdsn_ret_table { | ||
191 | CMDSN_ERROR_CANNOT_RECOVER = -1, | ||
192 | CMDSN_NORMAL_OPERATION = 0, | ||
193 | CMDSN_LOWER_THAN_EXP = 1, | ||
194 | CMDSN_HIGHER_THAN_EXP = 2, | ||
195 | CMDSN_MAXCMDSN_OVERRUN = 3, | ||
196 | }; | ||
197 | |||
198 | /* Used for iscsi_handle_immediate_data() return values */ | ||
199 | enum immedate_data_ret_table { | ||
200 | IMMEDIATE_DATA_CANNOT_RECOVER = -1, | ||
201 | IMMEDIATE_DATA_NORMAL_OPERATION = 0, | ||
202 | IMMEDIATE_DATA_ERL1_CRC_FAILURE = 1, | ||
203 | }; | ||
204 | |||
205 | /* Used for iscsi_decide_dataout_action() return values */ | ||
206 | enum dataout_action_ret_table { | ||
207 | DATAOUT_CANNOT_RECOVER = -1, | ||
208 | DATAOUT_NORMAL = 0, | ||
209 | DATAOUT_SEND_R2T = 1, | ||
210 | DATAOUT_SEND_TO_TRANSPORT = 2, | ||
211 | DATAOUT_WITHIN_COMMAND_RECOVERY = 3, | ||
212 | }; | ||
213 | |||
214 | /* Used for struct iscsi_node_auth->naf_flags */ | ||
215 | enum naf_flags_table { | ||
216 | NAF_USERID_SET = 0x01, | ||
217 | NAF_PASSWORD_SET = 0x02, | ||
218 | NAF_USERID_IN_SET = 0x04, | ||
219 | NAF_PASSWORD_IN_SET = 0x08, | ||
220 | }; | ||
221 | |||
222 | /* Used by various struct timer_list to manage iSCSI specific state */ | ||
223 | enum iscsi_timer_flags_table { | ||
224 | ISCSI_TF_RUNNING = 0x01, | ||
225 | ISCSI_TF_STOP = 0x02, | ||
226 | ISCSI_TF_EXPIRED = 0x04, | ||
227 | }; | ||
228 | |||
229 | /* Used for struct iscsi_np->np_flags */ | ||
230 | enum np_flags_table { | ||
231 | NPF_IP_NETWORK = 0x00, | ||
232 | }; | ||
233 | |||
234 | /* Used for struct iscsi_np->np_thread_state */ | ||
235 | enum np_thread_state_table { | ||
236 | ISCSI_NP_THREAD_ACTIVE = 1, | ||
237 | ISCSI_NP_THREAD_INACTIVE = 2, | ||
238 | ISCSI_NP_THREAD_RESET = 3, | ||
239 | ISCSI_NP_THREAD_SHUTDOWN = 4, | ||
240 | ISCSI_NP_THREAD_EXIT = 5, | ||
241 | }; | ||
242 | |||
243 | struct iscsi_conn_ops { | ||
244 | u8 HeaderDigest; /* [0,1] == [None,CRC32C] */ | ||
245 | u8 DataDigest; /* [0,1] == [None,CRC32C] */ | ||
246 | u32 MaxRecvDataSegmentLength; /* [512..2**24-1] */ | ||
247 | u32 MaxXmitDataSegmentLength; /* [512..2**24-1] */ | ||
248 | u8 OFMarker; /* [0,1] == [No,Yes] */ | ||
249 | u8 IFMarker; /* [0,1] == [No,Yes] */ | ||
250 | u32 OFMarkInt; /* [1..65535] */ | ||
251 | u32 IFMarkInt; /* [1..65535] */ | ||
252 | /* | ||
253 | * iSER specific connection parameters | ||
254 | */ | ||
255 | u32 InitiatorRecvDataSegmentLength; /* [512..2**24-1] */ | ||
256 | u32 TargetRecvDataSegmentLength; /* [512..2**24-1] */ | ||
257 | }; | ||
258 | |||
259 | struct iscsi_sess_ops { | ||
260 | char InitiatorName[224]; | ||
261 | char InitiatorAlias[256]; | ||
262 | char TargetName[224]; | ||
263 | char TargetAlias[256]; | ||
264 | char TargetAddress[256]; | ||
265 | u16 TargetPortalGroupTag; /* [0..65535] */ | ||
266 | u16 MaxConnections; /* [1..65535] */ | ||
267 | u8 InitialR2T; /* [0,1] == [No,Yes] */ | ||
268 | u8 ImmediateData; /* [0,1] == [No,Yes] */ | ||
269 | u32 MaxBurstLength; /* [512..2**24-1] */ | ||
270 | u32 FirstBurstLength; /* [512..2**24-1] */ | ||
271 | u16 DefaultTime2Wait; /* [0..3600] */ | ||
272 | u16 DefaultTime2Retain; /* [0..3600] */ | ||
273 | u16 MaxOutstandingR2T; /* [1..65535] */ | ||
274 | u8 DataPDUInOrder; /* [0,1] == [No,Yes] */ | ||
275 | u8 DataSequenceInOrder; /* [0,1] == [No,Yes] */ | ||
276 | u8 ErrorRecoveryLevel; /* [0..2] */ | ||
277 | u8 SessionType; /* [0,1] == [Normal,Discovery]*/ | ||
278 | /* | ||
279 | * iSER specific session parameters | ||
280 | */ | ||
281 | u8 RDMAExtensions; /* [0,1] == [No,Yes] */ | ||
282 | }; | ||
283 | |||
284 | struct iscsi_queue_req { | ||
285 | int state; | ||
286 | struct iscsi_cmd *cmd; | ||
287 | struct list_head qr_list; | ||
288 | }; | ||
289 | |||
290 | struct iscsi_data_count { | ||
291 | int data_length; | ||
292 | int sync_and_steering; | ||
293 | enum data_count_type type; | ||
294 | u32 iov_count; | ||
295 | u32 ss_iov_count; | ||
296 | u32 ss_marker_count; | ||
297 | struct kvec *iov; | ||
298 | }; | ||
299 | |||
300 | struct iscsi_param_list { | ||
301 | bool iser; | ||
302 | struct list_head param_list; | ||
303 | struct list_head extra_response_list; | ||
304 | }; | ||
305 | |||
306 | struct iscsi_datain_req { | ||
307 | enum datain_req_comp_table dr_complete; | ||
308 | int generate_recovery_values; | ||
309 | enum datain_req_rec_table recovery; | ||
310 | u32 begrun; | ||
311 | u32 runlength; | ||
312 | u32 data_length; | ||
313 | u32 data_offset; | ||
314 | u32 data_sn; | ||
315 | u32 next_burst_len; | ||
316 | u32 read_data_done; | ||
317 | u32 seq_send_order; | ||
318 | struct list_head cmd_datain_node; | ||
319 | } ____cacheline_aligned; | ||
320 | |||
321 | struct iscsi_ooo_cmdsn { | ||
322 | u16 cid; | ||
323 | u32 batch_count; | ||
324 | u32 cmdsn; | ||
325 | u32 exp_cmdsn; | ||
326 | struct iscsi_cmd *cmd; | ||
327 | struct list_head ooo_list; | ||
328 | } ____cacheline_aligned; | ||
329 | |||
330 | struct iscsi_datain { | ||
331 | u8 flags; | ||
332 | u32 data_sn; | ||
333 | u32 length; | ||
334 | u32 offset; | ||
335 | } ____cacheline_aligned; | ||
336 | |||
337 | struct iscsi_r2t { | ||
338 | int seq_complete; | ||
339 | int recovery_r2t; | ||
340 | int sent_r2t; | ||
341 | u32 r2t_sn; | ||
342 | u32 offset; | ||
343 | u32 targ_xfer_tag; | ||
344 | u32 xfer_len; | ||
345 | struct list_head r2t_list; | ||
346 | } ____cacheline_aligned; | ||
347 | |||
348 | struct iscsi_cmd { | ||
349 | enum iscsi_timer_flags_table dataout_timer_flags; | ||
350 | /* DataOUT timeout retries */ | ||
351 | u8 dataout_timeout_retries; | ||
352 | /* Within command recovery count */ | ||
353 | u8 error_recovery_count; | ||
354 | /* iSCSI dependent state for out or order CmdSNs */ | ||
355 | enum cmd_i_state_table deferred_i_state; | ||
356 | /* iSCSI dependent state */ | ||
357 | enum cmd_i_state_table i_state; | ||
358 | /* Command is an immediate command (ISCSI_OP_IMMEDIATE set) */ | ||
359 | u8 immediate_cmd; | ||
360 | /* Immediate data present */ | ||
361 | u8 immediate_data; | ||
362 | /* iSCSI Opcode */ | ||
363 | u8 iscsi_opcode; | ||
364 | /* iSCSI Response Code */ | ||
365 | u8 iscsi_response; | ||
366 | /* Logout reason when iscsi_opcode == ISCSI_INIT_LOGOUT_CMND */ | ||
367 | u8 logout_reason; | ||
368 | /* Logout response code when iscsi_opcode == ISCSI_INIT_LOGOUT_CMND */ | ||
369 | u8 logout_response; | ||
370 | /* MaxCmdSN has been incremented */ | ||
371 | u8 maxcmdsn_inc; | ||
372 | /* Immediate Unsolicited Dataout */ | ||
373 | u8 unsolicited_data; | ||
374 | /* Reject reason code */ | ||
375 | u8 reject_reason; | ||
376 | /* CID contained in logout PDU when opcode == ISCSI_INIT_LOGOUT_CMND */ | ||
377 | u16 logout_cid; | ||
378 | /* Command flags */ | ||
379 | enum cmd_flags_table cmd_flags; | ||
380 | /* Initiator Task Tag assigned from Initiator */ | ||
381 | itt_t init_task_tag; | ||
382 | /* Target Transfer Tag assigned from Target */ | ||
383 | u32 targ_xfer_tag; | ||
384 | /* CmdSN assigned from Initiator */ | ||
385 | u32 cmd_sn; | ||
386 | /* ExpStatSN assigned from Initiator */ | ||
387 | u32 exp_stat_sn; | ||
388 | /* StatSN assigned to this ITT */ | ||
389 | u32 stat_sn; | ||
390 | /* DataSN Counter */ | ||
391 | u32 data_sn; | ||
392 | /* R2TSN Counter */ | ||
393 | u32 r2t_sn; | ||
394 | /* Last DataSN acknowledged via DataAck SNACK */ | ||
395 | u32 acked_data_sn; | ||
396 | /* Used for echoing NOPOUT ping data */ | ||
397 | u32 buf_ptr_size; | ||
398 | /* Used to store DataDigest */ | ||
399 | u32 data_crc; | ||
400 | /* Counter for MaxOutstandingR2T */ | ||
401 | u32 outstanding_r2ts; | ||
402 | /* Next R2T Offset when DataSequenceInOrder=Yes */ | ||
403 | u32 r2t_offset; | ||
404 | /* Iovec current and orig count for iscsi_cmd->iov_data */ | ||
405 | u32 iov_data_count; | ||
406 | u32 orig_iov_data_count; | ||
407 | /* Number of miscellaneous iovecs used for IP stack calls */ | ||
408 | u32 iov_misc_count; | ||
409 | /* Number of struct iscsi_pdu in struct iscsi_cmd->pdu_list */ | ||
410 | u32 pdu_count; | ||
411 | /* Next struct iscsi_pdu to send in struct iscsi_cmd->pdu_list */ | ||
412 | u32 pdu_send_order; | ||
413 | /* Current struct iscsi_pdu in struct iscsi_cmd->pdu_list */ | ||
414 | u32 pdu_start; | ||
415 | /* Next struct iscsi_seq to send in struct iscsi_cmd->seq_list */ | ||
416 | u32 seq_send_order; | ||
417 | /* Number of struct iscsi_seq in struct iscsi_cmd->seq_list */ | ||
418 | u32 seq_count; | ||
419 | /* Current struct iscsi_seq in struct iscsi_cmd->seq_list */ | ||
420 | u32 seq_no; | ||
421 | /* Lowest offset in current DataOUT sequence */ | ||
422 | u32 seq_start_offset; | ||
423 | /* Highest offset in current DataOUT sequence */ | ||
424 | u32 seq_end_offset; | ||
425 | /* Total size in bytes received so far of READ data */ | ||
426 | u32 read_data_done; | ||
427 | /* Total size in bytes received so far of WRITE data */ | ||
428 | u32 write_data_done; | ||
429 | /* Counter for FirstBurstLength key */ | ||
430 | u32 first_burst_len; | ||
431 | /* Counter for MaxBurstLength key */ | ||
432 | u32 next_burst_len; | ||
433 | /* Transfer size used for IP stack calls */ | ||
434 | u32 tx_size; | ||
435 | /* Buffer used for various purposes */ | ||
436 | void *buf_ptr; | ||
437 | /* Used by SendTargets=[iqn.,eui.] discovery */ | ||
438 | void *text_in_ptr; | ||
439 | /* See include/linux/dma-mapping.h */ | ||
440 | enum dma_data_direction data_direction; | ||
441 | /* iSCSI PDU Header + CRC */ | ||
442 | unsigned char pdu[ISCSI_HDR_LEN + ISCSI_CRC_LEN]; | ||
443 | /* Number of times struct iscsi_cmd is present in immediate queue */ | ||
444 | atomic_t immed_queue_count; | ||
445 | atomic_t response_queue_count; | ||
446 | spinlock_t datain_lock; | ||
447 | spinlock_t dataout_timeout_lock; | ||
448 | /* spinlock for protecting struct iscsi_cmd->i_state */ | ||
449 | spinlock_t istate_lock; | ||
450 | /* spinlock for adding within command recovery entries */ | ||
451 | spinlock_t error_lock; | ||
452 | /* spinlock for adding R2Ts */ | ||
453 | spinlock_t r2t_lock; | ||
454 | /* DataIN List */ | ||
455 | struct list_head datain_list; | ||
456 | /* R2T List */ | ||
457 | struct list_head cmd_r2t_list; | ||
458 | /* Timer for DataOUT */ | ||
459 | struct timer_list dataout_timer; | ||
460 | /* Iovecs for SCSI data payload RX/TX w/ kernel level sockets */ | ||
461 | struct kvec *iov_data; | ||
462 | /* Iovecs for miscellaneous purposes */ | ||
463 | #define ISCSI_MISC_IOVECS 5 | ||
464 | struct kvec iov_misc[ISCSI_MISC_IOVECS]; | ||
465 | /* Array of struct iscsi_pdu used for DataPDUInOrder=No */ | ||
466 | struct iscsi_pdu *pdu_list; | ||
467 | /* Current struct iscsi_pdu used for DataPDUInOrder=No */ | ||
468 | struct iscsi_pdu *pdu_ptr; | ||
469 | /* Array of struct iscsi_seq used for DataSequenceInOrder=No */ | ||
470 | struct iscsi_seq *seq_list; | ||
471 | /* Current struct iscsi_seq used for DataSequenceInOrder=No */ | ||
472 | struct iscsi_seq *seq_ptr; | ||
473 | /* TMR Request when iscsi_opcode == ISCSI_OP_SCSI_TMFUNC */ | ||
474 | struct iscsi_tmr_req *tmr_req; | ||
475 | /* Connection this command is alligient to */ | ||
476 | struct iscsi_conn *conn; | ||
477 | /* Pointer to connection recovery entry */ | ||
478 | struct iscsi_conn_recovery *cr; | ||
479 | /* Session the command is part of, used for connection recovery */ | ||
480 | struct iscsi_session *sess; | ||
481 | /* list_head for connection list */ | ||
482 | struct list_head i_conn_node; | ||
483 | /* The TCM I/O descriptor that is accessed via container_of() */ | ||
484 | struct se_cmd se_cmd; | ||
485 | /* Sense buffer that will be mapped into outgoing status */ | ||
486 | #define ISCSI_SENSE_BUFFER_LEN (TRANSPORT_SENSE_BUFFER + 2) | ||
487 | unsigned char sense_buffer[ISCSI_SENSE_BUFFER_LEN]; | ||
488 | |||
489 | u32 padding; | ||
490 | u8 pad_bytes[4]; | ||
491 | |||
492 | struct scatterlist *first_data_sg; | ||
493 | u32 first_data_sg_off; | ||
494 | u32 kmapped_nents; | ||
495 | sense_reason_t sense_reason; | ||
496 | } ____cacheline_aligned; | ||
497 | |||
498 | struct iscsi_tmr_req { | ||
499 | bool task_reassign:1; | ||
500 | u32 exp_data_sn; | ||
501 | struct iscsi_cmd *ref_cmd; | ||
502 | struct iscsi_conn_recovery *conn_recovery; | ||
503 | struct se_tmr_req *se_tmr_req; | ||
504 | }; | ||
505 | |||
506 | struct iscsi_conn { | ||
507 | wait_queue_head_t queues_wq; | ||
508 | /* Authentication Successful for this connection */ | ||
509 | u8 auth_complete; | ||
510 | /* State connection is currently in */ | ||
511 | u8 conn_state; | ||
512 | u8 conn_logout_reason; | ||
513 | u8 network_transport; | ||
514 | enum iscsi_timer_flags_table nopin_timer_flags; | ||
515 | enum iscsi_timer_flags_table nopin_response_timer_flags; | ||
516 | /* Used to know what thread encountered a transport failure */ | ||
517 | u8 which_thread; | ||
518 | /* connection id assigned by the Initiator */ | ||
519 | u16 cid; | ||
520 | /* Remote TCP Port */ | ||
521 | u16 login_port; | ||
522 | u16 local_port; | ||
523 | int net_size; | ||
524 | int login_family; | ||
525 | u32 auth_id; | ||
526 | u32 conn_flags; | ||
527 | /* Used for iscsi_tx_login_rsp() */ | ||
528 | itt_t login_itt; | ||
529 | u32 exp_statsn; | ||
530 | /* Per connection status sequence number */ | ||
531 | u32 stat_sn; | ||
532 | /* IFMarkInt's Current Value */ | ||
533 | u32 if_marker; | ||
534 | /* OFMarkInt's Current Value */ | ||
535 | u32 of_marker; | ||
536 | /* Used for calculating OFMarker offset to next PDU */ | ||
537 | u32 of_marker_offset; | ||
538 | #define IPV6_ADDRESS_SPACE 48 | ||
539 | unsigned char login_ip[IPV6_ADDRESS_SPACE]; | ||
540 | unsigned char local_ip[IPV6_ADDRESS_SPACE]; | ||
541 | int conn_usage_count; | ||
542 | int conn_waiting_on_uc; | ||
543 | atomic_t check_immediate_queue; | ||
544 | atomic_t conn_logout_remove; | ||
545 | atomic_t connection_exit; | ||
546 | atomic_t connection_recovery; | ||
547 | atomic_t connection_reinstatement; | ||
548 | atomic_t connection_wait_rcfr; | ||
549 | atomic_t sleep_on_conn_wait_comp; | ||
550 | atomic_t transport_failed; | ||
551 | struct completion conn_post_wait_comp; | ||
552 | struct completion conn_wait_comp; | ||
553 | struct completion conn_wait_rcfr_comp; | ||
554 | struct completion conn_waiting_on_uc_comp; | ||
555 | struct completion conn_logout_comp; | ||
556 | struct completion tx_half_close_comp; | ||
557 | struct completion rx_half_close_comp; | ||
558 | /* socket used by this connection */ | ||
559 | struct socket *sock; | ||
560 | void (*orig_data_ready)(struct sock *); | ||
561 | void (*orig_state_change)(struct sock *); | ||
562 | #define LOGIN_FLAGS_READ_ACTIVE 1 | ||
563 | #define LOGIN_FLAGS_CLOSED 2 | ||
564 | #define LOGIN_FLAGS_READY 4 | ||
565 | unsigned long login_flags; | ||
566 | struct delayed_work login_work; | ||
567 | struct delayed_work login_cleanup_work; | ||
568 | struct iscsi_login *login; | ||
569 | struct timer_list nopin_timer; | ||
570 | struct timer_list nopin_response_timer; | ||
571 | struct timer_list transport_timer; | ||
572 | struct task_struct *login_kworker; | ||
573 | /* Spinlock used for add/deleting cmd's from conn_cmd_list */ | ||
574 | spinlock_t cmd_lock; | ||
575 | spinlock_t conn_usage_lock; | ||
576 | spinlock_t immed_queue_lock; | ||
577 | spinlock_t nopin_timer_lock; | ||
578 | spinlock_t response_queue_lock; | ||
579 | spinlock_t state_lock; | ||
580 | /* libcrypto RX and TX contexts for crc32c */ | ||
581 | struct hash_desc conn_rx_hash; | ||
582 | struct hash_desc conn_tx_hash; | ||
583 | /* Used for scheduling TX and RX connection kthreads */ | ||
584 | cpumask_var_t conn_cpumask; | ||
585 | unsigned int conn_rx_reset_cpumask:1; | ||
586 | unsigned int conn_tx_reset_cpumask:1; | ||
587 | /* list_head of struct iscsi_cmd for this connection */ | ||
588 | struct list_head conn_cmd_list; | ||
589 | struct list_head immed_queue_list; | ||
590 | struct list_head response_queue_list; | ||
591 | struct iscsi_conn_ops *conn_ops; | ||
592 | struct iscsi_login *conn_login; | ||
593 | struct iscsit_transport *conn_transport; | ||
594 | struct iscsi_param_list *param_list; | ||
595 | /* Used for per connection auth state machine */ | ||
596 | void *auth_protocol; | ||
597 | void *context; | ||
598 | struct iscsi_login_thread_s *login_thread; | ||
599 | struct iscsi_portal_group *tpg; | ||
600 | struct iscsi_tpg_np *tpg_np; | ||
601 | /* Pointer to parent session */ | ||
602 | struct iscsi_session *sess; | ||
603 | /* Pointer to thread_set in use for this conn's threads */ | ||
604 | struct iscsi_thread_set *thread_set; | ||
605 | /* list_head for session connection list */ | ||
606 | struct list_head conn_list; | ||
607 | } ____cacheline_aligned; | ||
608 | |||
609 | struct iscsi_conn_recovery { | ||
610 | u16 cid; | ||
611 | u32 cmd_count; | ||
612 | u32 maxrecvdatasegmentlength; | ||
613 | u32 maxxmitdatasegmentlength; | ||
614 | int ready_for_reallegiance; | ||
615 | struct list_head conn_recovery_cmd_list; | ||
616 | spinlock_t conn_recovery_cmd_lock; | ||
617 | struct timer_list time2retain_timer; | ||
618 | struct iscsi_session *sess; | ||
619 | struct list_head cr_list; | ||
620 | } ____cacheline_aligned; | ||
621 | |||
622 | struct iscsi_session { | ||
623 | u8 initiator_vendor; | ||
624 | u8 isid[6]; | ||
625 | enum iscsi_timer_flags_table time2retain_timer_flags; | ||
626 | u8 version_active; | ||
627 | u16 cid_called; | ||
628 | u16 conn_recovery_count; | ||
629 | u16 tsih; | ||
630 | /* state session is currently in */ | ||
631 | u32 session_state; | ||
632 | /* session wide counter: initiator assigned task tag */ | ||
633 | itt_t init_task_tag; | ||
634 | /* session wide counter: target assigned task tag */ | ||
635 | u32 targ_xfer_tag; | ||
636 | u32 cmdsn_window; | ||
637 | |||
638 | /* protects cmdsn values */ | ||
639 | struct mutex cmdsn_mutex; | ||
640 | /* session wide counter: expected command sequence number */ | ||
641 | u32 exp_cmd_sn; | ||
642 | /* session wide counter: maximum allowed command sequence number */ | ||
643 | u32 max_cmd_sn; | ||
644 | struct list_head sess_ooo_cmdsn_list; | ||
645 | |||
646 | /* LIO specific session ID */ | ||
647 | u32 sid; | ||
648 | char auth_type[8]; | ||
649 | /* unique within the target */ | ||
650 | int session_index; | ||
651 | /* Used for session reference counting */ | ||
652 | int session_usage_count; | ||
653 | int session_waiting_on_uc; | ||
654 | atomic_long_t cmd_pdus; | ||
655 | atomic_long_t rsp_pdus; | ||
656 | atomic_long_t tx_data_octets; | ||
657 | atomic_long_t rx_data_octets; | ||
658 | atomic_long_t conn_digest_errors; | ||
659 | atomic_long_t conn_timeout_errors; | ||
660 | u64 creation_time; | ||
661 | /* Number of active connections */ | ||
662 | atomic_t nconn; | ||
663 | atomic_t session_continuation; | ||
664 | atomic_t session_fall_back_to_erl0; | ||
665 | atomic_t session_logout; | ||
666 | atomic_t session_reinstatement; | ||
667 | atomic_t session_stop_active; | ||
668 | atomic_t sleep_on_sess_wait_comp; | ||
669 | /* connection list */ | ||
670 | struct list_head sess_conn_list; | ||
671 | struct list_head cr_active_list; | ||
672 | struct list_head cr_inactive_list; | ||
673 | spinlock_t conn_lock; | ||
674 | spinlock_t cr_a_lock; | ||
675 | spinlock_t cr_i_lock; | ||
676 | spinlock_t session_usage_lock; | ||
677 | spinlock_t ttt_lock; | ||
678 | struct completion async_msg_comp; | ||
679 | struct completion reinstatement_comp; | ||
680 | struct completion session_wait_comp; | ||
681 | struct completion session_waiting_on_uc_comp; | ||
682 | struct timer_list time2retain_timer; | ||
683 | struct iscsi_sess_ops *sess_ops; | ||
684 | struct se_session *se_sess; | ||
685 | struct iscsi_portal_group *tpg; | ||
686 | } ____cacheline_aligned; | ||
687 | |||
688 | struct iscsi_login { | ||
689 | u8 auth_complete; | ||
690 | u8 checked_for_existing; | ||
691 | u8 current_stage; | ||
692 | u8 leading_connection; | ||
693 | u8 first_request; | ||
694 | u8 version_min; | ||
695 | u8 version_max; | ||
696 | u8 login_complete; | ||
697 | u8 login_failed; | ||
698 | bool zero_tsih; | ||
699 | char isid[6]; | ||
700 | u32 cmd_sn; | ||
701 | itt_t init_task_tag; | ||
702 | u32 initial_exp_statsn; | ||
703 | u32 rsp_length; | ||
704 | u16 cid; | ||
705 | u16 tsih; | ||
706 | char req[ISCSI_HDR_LEN]; | ||
707 | char rsp[ISCSI_HDR_LEN]; | ||
708 | char *req_buf; | ||
709 | char *rsp_buf; | ||
710 | struct iscsi_conn *conn; | ||
711 | struct iscsi_np *np; | ||
712 | } ____cacheline_aligned; | ||
713 | |||
714 | struct iscsi_node_attrib { | ||
715 | u32 dataout_timeout; | ||
716 | u32 dataout_timeout_retries; | ||
717 | u32 default_erl; | ||
718 | u32 nopin_timeout; | ||
719 | u32 nopin_response_timeout; | ||
720 | u32 random_datain_pdu_offsets; | ||
721 | u32 random_datain_seq_offsets; | ||
722 | u32 random_r2t_offsets; | ||
723 | u32 tmr_cold_reset; | ||
724 | u32 tmr_warm_reset; | ||
725 | struct iscsi_node_acl *nacl; | ||
726 | }; | ||
727 | |||
728 | struct se_dev_entry_s; | ||
729 | |||
730 | struct iscsi_node_auth { | ||
731 | enum naf_flags_table naf_flags; | ||
732 | int authenticate_target; | ||
733 | /* Used for iscsit_global->discovery_auth, | ||
734 | * set to zero (auth disabled) by default */ | ||
735 | int enforce_discovery_auth; | ||
736 | #define MAX_USER_LEN 256 | ||
737 | #define MAX_PASS_LEN 256 | ||
738 | char userid[MAX_USER_LEN]; | ||
739 | char password[MAX_PASS_LEN]; | ||
740 | char userid_mutual[MAX_USER_LEN]; | ||
741 | char password_mutual[MAX_PASS_LEN]; | ||
742 | }; | ||
743 | |||
744 | #include "iscsi_target_stat.h" | ||
745 | |||
746 | struct iscsi_node_stat_grps { | ||
747 | struct config_group iscsi_sess_stats_group; | ||
748 | struct config_group iscsi_conn_stats_group; | ||
749 | }; | ||
750 | |||
751 | struct iscsi_node_acl { | ||
752 | struct iscsi_node_attrib node_attrib; | ||
753 | struct iscsi_node_auth node_auth; | ||
754 | struct iscsi_node_stat_grps node_stat_grps; | ||
755 | struct se_node_acl se_node_acl; | ||
756 | }; | ||
757 | |||
758 | struct iscsi_tpg_attrib { | ||
759 | u32 authentication; | ||
760 | u32 login_timeout; | ||
761 | u32 netif_timeout; | ||
762 | u32 generate_node_acls; | ||
763 | u32 cache_dynamic_acls; | ||
764 | u32 default_cmdsn_depth; | ||
765 | u32 demo_mode_write_protect; | ||
766 | u32 prod_mode_write_protect; | ||
767 | u32 demo_mode_discovery; | ||
768 | u32 default_erl; | ||
769 | u8 t10_pi; | ||
770 | struct iscsi_portal_group *tpg; | ||
771 | }; | ||
772 | |||
773 | struct iscsi_np { | ||
774 | int np_network_transport; | ||
775 | int np_ip_proto; | ||
776 | int np_sock_type; | ||
777 | enum np_thread_state_table np_thread_state; | ||
778 | bool enabled; | ||
779 | enum iscsi_timer_flags_table np_login_timer_flags; | ||
780 | u32 np_exports; | ||
781 | enum np_flags_table np_flags; | ||
782 | unsigned char np_ip[IPV6_ADDRESS_SPACE]; | ||
783 | u16 np_port; | ||
784 | spinlock_t np_thread_lock; | ||
785 | struct completion np_restart_comp; | ||
786 | struct socket *np_socket; | ||
787 | struct __kernel_sockaddr_storage np_sockaddr; | ||
788 | struct task_struct *np_thread; | ||
789 | struct timer_list np_login_timer; | ||
790 | void *np_context; | ||
791 | struct iscsit_transport *np_transport; | ||
792 | struct list_head np_list; | ||
793 | } ____cacheline_aligned; | ||
794 | |||
795 | struct iscsi_tpg_np { | ||
796 | struct iscsi_np *tpg_np; | ||
797 | struct iscsi_portal_group *tpg; | ||
798 | struct iscsi_tpg_np *tpg_np_parent; | ||
799 | struct list_head tpg_np_list; | ||
800 | struct list_head tpg_np_child_list; | ||
801 | struct list_head tpg_np_parent_list; | ||
802 | struct se_tpg_np se_tpg_np; | ||
803 | spinlock_t tpg_np_parent_lock; | ||
804 | struct completion tpg_np_comp; | ||
805 | struct kref tpg_np_kref; | ||
806 | }; | ||
807 | |||
808 | struct iscsi_portal_group { | ||
809 | unsigned char tpg_chap_id; | ||
810 | /* TPG State */ | ||
811 | enum tpg_state_table tpg_state; | ||
812 | /* Target Portal Group Tag */ | ||
813 | u16 tpgt; | ||
814 | /* Id assigned to target sessions */ | ||
815 | u16 ntsih; | ||
816 | /* Number of active sessions */ | ||
817 | u32 nsessions; | ||
818 | /* Number of Network Portals available for this TPG */ | ||
819 | u32 num_tpg_nps; | ||
820 | /* Per TPG LIO specific session ID. */ | ||
821 | u32 sid; | ||
822 | /* Spinlock for adding/removing Network Portals */ | ||
823 | spinlock_t tpg_np_lock; | ||
824 | spinlock_t tpg_state_lock; | ||
825 | struct se_portal_group tpg_se_tpg; | ||
826 | struct mutex tpg_access_lock; | ||
827 | struct semaphore np_login_sem; | ||
828 | struct iscsi_tpg_attrib tpg_attrib; | ||
829 | struct iscsi_node_auth tpg_demo_auth; | ||
830 | /* Pointer to default list of iSCSI parameters for TPG */ | ||
831 | struct iscsi_param_list *param_list; | ||
832 | struct iscsi_tiqn *tpg_tiqn; | ||
833 | struct list_head tpg_gnp_list; | ||
834 | struct list_head tpg_list; | ||
835 | } ____cacheline_aligned; | ||
836 | |||
837 | struct iscsi_wwn_stat_grps { | ||
838 | struct config_group iscsi_stat_group; | ||
839 | struct config_group iscsi_instance_group; | ||
840 | struct config_group iscsi_sess_err_group; | ||
841 | struct config_group iscsi_tgt_attr_group; | ||
842 | struct config_group iscsi_login_stats_group; | ||
843 | struct config_group iscsi_logout_stats_group; | ||
844 | }; | ||
845 | |||
846 | struct iscsi_tiqn { | ||
847 | #define ISCSI_IQN_LEN 224 | ||
848 | unsigned char tiqn[ISCSI_IQN_LEN]; | ||
849 | enum tiqn_state_table tiqn_state; | ||
850 | int tiqn_access_count; | ||
851 | u32 tiqn_active_tpgs; | ||
852 | u32 tiqn_ntpgs; | ||
853 | u32 tiqn_num_tpg_nps; | ||
854 | u32 tiqn_nsessions; | ||
855 | struct list_head tiqn_list; | ||
856 | struct list_head tiqn_tpg_list; | ||
857 | spinlock_t tiqn_state_lock; | ||
858 | spinlock_t tiqn_tpg_lock; | ||
859 | struct se_wwn tiqn_wwn; | ||
860 | struct iscsi_wwn_stat_grps tiqn_stat_grps; | ||
861 | int tiqn_index; | ||
862 | struct iscsi_sess_err_stats sess_err_stats; | ||
863 | struct iscsi_login_stats login_stats; | ||
864 | struct iscsi_logout_stats logout_stats; | ||
865 | } ____cacheline_aligned; | ||
866 | |||
867 | struct iscsit_global { | ||
868 | /* In core shutdown */ | ||
869 | u32 in_shutdown; | ||
870 | u32 active_ts; | ||
871 | /* Unique identifier used for the authentication daemon */ | ||
872 | u32 auth_id; | ||
873 | u32 inactive_ts; | ||
874 | /* Thread Set bitmap count */ | ||
875 | int ts_bitmap_count; | ||
876 | /* Thread Set bitmap pointer */ | ||
877 | unsigned long *ts_bitmap; | ||
878 | /* Used for iSCSI discovery session authentication */ | ||
879 | struct iscsi_node_acl discovery_acl; | ||
880 | struct iscsi_portal_group *discovery_tpg; | ||
881 | }; | ||
882 | |||
883 | static inline u32 session_get_next_ttt(struct iscsi_session *session) | ||
884 | { | ||
885 | u32 ttt; | ||
886 | |||
887 | spin_lock_bh(&session->ttt_lock); | ||
888 | ttt = session->targ_xfer_tag++; | ||
889 | if (ttt == 0xFFFFFFFF) | ||
890 | ttt = session->targ_xfer_tag++; | ||
891 | spin_unlock_bh(&session->ttt_lock); | ||
892 | |||
893 | return ttt; | ||
894 | } | ||
895 | |||
896 | extern struct iscsi_cmd *iscsit_find_cmd_from_itt(struct iscsi_conn *, itt_t); | ||
897 | #endif /* ISCSI_TARGET_CORE_H */ | ||
diff --git a/include/target/iscsi/iscsi_target_stat.h b/include/target/iscsi/iscsi_target_stat.h new file mode 100644 index 000000000000..3ff76b4faad3 --- /dev/null +++ b/include/target/iscsi/iscsi_target_stat.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef ISCSI_TARGET_STAT_H | ||
2 | #define ISCSI_TARGET_STAT_H | ||
3 | |||
4 | /* | ||
5 | * For struct iscsi_tiqn->tiqn_wwn default groups | ||
6 | */ | ||
7 | extern struct config_item_type iscsi_stat_instance_cit; | ||
8 | extern struct config_item_type iscsi_stat_sess_err_cit; | ||
9 | extern struct config_item_type iscsi_stat_tgt_attr_cit; | ||
10 | extern struct config_item_type iscsi_stat_login_cit; | ||
11 | extern struct config_item_type iscsi_stat_logout_cit; | ||
12 | |||
13 | /* | ||
14 | * For struct iscsi_session->se_sess default groups | ||
15 | */ | ||
16 | extern struct config_item_type iscsi_stat_sess_cit; | ||
17 | |||
18 | /* iSCSI session error types */ | ||
19 | #define ISCSI_SESS_ERR_UNKNOWN 0 | ||
20 | #define ISCSI_SESS_ERR_DIGEST 1 | ||
21 | #define ISCSI_SESS_ERR_CXN_TIMEOUT 2 | ||
22 | #define ISCSI_SESS_ERR_PDU_FORMAT 3 | ||
23 | |||
24 | /* iSCSI session error stats */ | ||
25 | struct iscsi_sess_err_stats { | ||
26 | spinlock_t lock; | ||
27 | u32 digest_errors; | ||
28 | u32 cxn_timeout_errors; | ||
29 | u32 pdu_format_errors; | ||
30 | u32 last_sess_failure_type; | ||
31 | char last_sess_fail_rem_name[224]; | ||
32 | } ____cacheline_aligned; | ||
33 | |||
34 | /* iSCSI login failure types (sub oids) */ | ||
35 | #define ISCSI_LOGIN_FAIL_OTHER 2 | ||
36 | #define ISCSI_LOGIN_FAIL_REDIRECT 3 | ||
37 | #define ISCSI_LOGIN_FAIL_AUTHORIZE 4 | ||
38 | #define ISCSI_LOGIN_FAIL_AUTHENTICATE 5 | ||
39 | #define ISCSI_LOGIN_FAIL_NEGOTIATE 6 | ||
40 | |||
41 | /* iSCSI login stats */ | ||
42 | struct iscsi_login_stats { | ||
43 | spinlock_t lock; | ||
44 | u32 accepts; | ||
45 | u32 other_fails; | ||
46 | u32 redirects; | ||
47 | u32 authorize_fails; | ||
48 | u32 authenticate_fails; | ||
49 | u32 negotiate_fails; /* used for notifications */ | ||
50 | u64 last_fail_time; /* time stamp (jiffies) */ | ||
51 | u32 last_fail_type; | ||
52 | int last_intr_fail_ip_family; | ||
53 | unsigned char last_intr_fail_ip_addr[IPV6_ADDRESS_SPACE]; | ||
54 | char last_intr_fail_name[224]; | ||
55 | } ____cacheline_aligned; | ||
56 | |||
57 | /* iSCSI logout stats */ | ||
58 | struct iscsi_logout_stats { | ||
59 | spinlock_t lock; | ||
60 | u32 normal_logouts; | ||
61 | u32 abnormal_logouts; | ||
62 | } ____cacheline_aligned; | ||
63 | |||
64 | #endif /*** ISCSI_TARGET_STAT_H ***/ | ||
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h index daef9daa500c..e6bb166f12c2 100644 --- a/include/target/iscsi/iscsi_transport.h +++ b/include/target/iscsi/iscsi_transport.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> |
2 | #include <linux/list.h> | 2 | #include <linux/list.h> |
3 | #include "../../../drivers/target/iscsi/iscsi_target_core.h" | 3 | #include "iscsi_target_core.h" |
4 | 4 | ||
5 | struct iscsit_transport { | 5 | struct iscsit_transport { |
6 | #define ISCSIT_TRANSPORT_NAME 16 | 6 | #define ISCSIT_TRANSPORT_NAME 16 |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 4a8795a87b9e..672150b6aaf5 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -407,7 +407,7 @@ struct t10_reservation { | |||
407 | /* Activate Persistence across Target Power Loss enabled | 407 | /* Activate Persistence across Target Power Loss enabled |
408 | * for SCSI device */ | 408 | * for SCSI device */ |
409 | int pr_aptpl_active; | 409 | int pr_aptpl_active; |
410 | #define PR_APTPL_BUF_LEN 8192 | 410 | #define PR_APTPL_BUF_LEN 262144 |
411 | u32 pr_generation; | 411 | u32 pr_generation; |
412 | spinlock_t registration_lock; | 412 | spinlock_t registration_lock; |
413 | spinlock_t aptpl_reg_lock; | 413 | spinlock_t aptpl_reg_lock; |
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index c6814b917bdf..9a6a3fe0fb51 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h | |||
@@ -11,39 +11,55 @@ | |||
11 | 11 | ||
12 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, | 12 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, |
13 | 13 | ||
14 | TP_PROTO(unsigned long nr_scanned, | 14 | TP_PROTO( |
15 | unsigned long start_pfn, | ||
16 | unsigned long end_pfn, | ||
17 | unsigned long nr_scanned, | ||
15 | unsigned long nr_taken), | 18 | unsigned long nr_taken), |
16 | 19 | ||
17 | TP_ARGS(nr_scanned, nr_taken), | 20 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken), |
18 | 21 | ||
19 | TP_STRUCT__entry( | 22 | TP_STRUCT__entry( |
23 | __field(unsigned long, start_pfn) | ||
24 | __field(unsigned long, end_pfn) | ||
20 | __field(unsigned long, nr_scanned) | 25 | __field(unsigned long, nr_scanned) |
21 | __field(unsigned long, nr_taken) | 26 | __field(unsigned long, nr_taken) |
22 | ), | 27 | ), |
23 | 28 | ||
24 | TP_fast_assign( | 29 | TP_fast_assign( |
30 | __entry->start_pfn = start_pfn; | ||
31 | __entry->end_pfn = end_pfn; | ||
25 | __entry->nr_scanned = nr_scanned; | 32 | __entry->nr_scanned = nr_scanned; |
26 | __entry->nr_taken = nr_taken; | 33 | __entry->nr_taken = nr_taken; |
27 | ), | 34 | ), |
28 | 35 | ||
29 | TP_printk("nr_scanned=%lu nr_taken=%lu", | 36 | TP_printk("range=(0x%lx ~ 0x%lx) nr_scanned=%lu nr_taken=%lu", |
37 | __entry->start_pfn, | ||
38 | __entry->end_pfn, | ||
30 | __entry->nr_scanned, | 39 | __entry->nr_scanned, |
31 | __entry->nr_taken) | 40 | __entry->nr_taken) |
32 | ); | 41 | ); |
33 | 42 | ||
34 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, | 43 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, |
35 | 44 | ||
36 | TP_PROTO(unsigned long nr_scanned, | 45 | TP_PROTO( |
46 | unsigned long start_pfn, | ||
47 | unsigned long end_pfn, | ||
48 | unsigned long nr_scanned, | ||
37 | unsigned long nr_taken), | 49 | unsigned long nr_taken), |
38 | 50 | ||
39 | TP_ARGS(nr_scanned, nr_taken) | 51 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) |
40 | ); | 52 | ); |
41 | 53 | ||
42 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, | 54 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, |
43 | TP_PROTO(unsigned long nr_scanned, | 55 | |
56 | TP_PROTO( | ||
57 | unsigned long start_pfn, | ||
58 | unsigned long end_pfn, | ||
59 | unsigned long nr_scanned, | ||
44 | unsigned long nr_taken), | 60 | unsigned long nr_taken), |
45 | 61 | ||
46 | TP_ARGS(nr_scanned, nr_taken) | 62 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) |
47 | ); | 63 | ); |
48 | 64 | ||
49 | TRACE_EVENT(mm_compaction_migratepages, | 65 | TRACE_EVENT(mm_compaction_migratepages, |
@@ -85,47 +101,198 @@ TRACE_EVENT(mm_compaction_migratepages, | |||
85 | ); | 101 | ); |
86 | 102 | ||
87 | TRACE_EVENT(mm_compaction_begin, | 103 | TRACE_EVENT(mm_compaction_begin, |
88 | TP_PROTO(unsigned long zone_start, unsigned long migrate_start, | 104 | TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn, |
89 | unsigned long free_start, unsigned long zone_end), | 105 | unsigned long free_pfn, unsigned long zone_end, bool sync), |
90 | 106 | ||
91 | TP_ARGS(zone_start, migrate_start, free_start, zone_end), | 107 | TP_ARGS(zone_start, migrate_pfn, free_pfn, zone_end, sync), |
92 | 108 | ||
93 | TP_STRUCT__entry( | 109 | TP_STRUCT__entry( |
94 | __field(unsigned long, zone_start) | 110 | __field(unsigned long, zone_start) |
95 | __field(unsigned long, migrate_start) | 111 | __field(unsigned long, migrate_pfn) |
96 | __field(unsigned long, free_start) | 112 | __field(unsigned long, free_pfn) |
97 | __field(unsigned long, zone_end) | 113 | __field(unsigned long, zone_end) |
114 | __field(bool, sync) | ||
98 | ), | 115 | ), |
99 | 116 | ||
100 | TP_fast_assign( | 117 | TP_fast_assign( |
101 | __entry->zone_start = zone_start; | 118 | __entry->zone_start = zone_start; |
102 | __entry->migrate_start = migrate_start; | 119 | __entry->migrate_pfn = migrate_pfn; |
103 | __entry->free_start = free_start; | 120 | __entry->free_pfn = free_pfn; |
104 | __entry->zone_end = zone_end; | 121 | __entry->zone_end = zone_end; |
122 | __entry->sync = sync; | ||
105 | ), | 123 | ), |
106 | 124 | ||
107 | TP_printk("zone_start=%lu migrate_start=%lu free_start=%lu zone_end=%lu", | 125 | TP_printk("zone_start=0x%lx migrate_pfn=0x%lx free_pfn=0x%lx zone_end=0x%lx, mode=%s", |
108 | __entry->zone_start, | 126 | __entry->zone_start, |
109 | __entry->migrate_start, | 127 | __entry->migrate_pfn, |
110 | __entry->free_start, | 128 | __entry->free_pfn, |
111 | __entry->zone_end) | 129 | __entry->zone_end, |
130 | __entry->sync ? "sync" : "async") | ||
112 | ); | 131 | ); |
113 | 132 | ||
114 | TRACE_EVENT(mm_compaction_end, | 133 | TRACE_EVENT(mm_compaction_end, |
115 | TP_PROTO(int status), | 134 | TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn, |
135 | unsigned long free_pfn, unsigned long zone_end, bool sync, | ||
136 | int status), | ||
116 | 137 | ||
117 | TP_ARGS(status), | 138 | TP_ARGS(zone_start, migrate_pfn, free_pfn, zone_end, sync, status), |
118 | 139 | ||
119 | TP_STRUCT__entry( | 140 | TP_STRUCT__entry( |
141 | __field(unsigned long, zone_start) | ||
142 | __field(unsigned long, migrate_pfn) | ||
143 | __field(unsigned long, free_pfn) | ||
144 | __field(unsigned long, zone_end) | ||
145 | __field(bool, sync) | ||
120 | __field(int, status) | 146 | __field(int, status) |
121 | ), | 147 | ), |
122 | 148 | ||
123 | TP_fast_assign( | 149 | TP_fast_assign( |
150 | __entry->zone_start = zone_start; | ||
151 | __entry->migrate_pfn = migrate_pfn; | ||
152 | __entry->free_pfn = free_pfn; | ||
153 | __entry->zone_end = zone_end; | ||
154 | __entry->sync = sync; | ||
124 | __entry->status = status; | 155 | __entry->status = status; |
125 | ), | 156 | ), |
126 | 157 | ||
127 | TP_printk("status=%d", __entry->status) | 158 | TP_printk("zone_start=0x%lx migrate_pfn=0x%lx free_pfn=0x%lx zone_end=0x%lx, mode=%s status=%s", |
159 | __entry->zone_start, | ||
160 | __entry->migrate_pfn, | ||
161 | __entry->free_pfn, | ||
162 | __entry->zone_end, | ||
163 | __entry->sync ? "sync" : "async", | ||
164 | compaction_status_string[__entry->status]) | ||
165 | ); | ||
166 | |||
167 | TRACE_EVENT(mm_compaction_try_to_compact_pages, | ||
168 | |||
169 | TP_PROTO( | ||
170 | int order, | ||
171 | gfp_t gfp_mask, | ||
172 | enum migrate_mode mode), | ||
173 | |||
174 | TP_ARGS(order, gfp_mask, mode), | ||
175 | |||
176 | TP_STRUCT__entry( | ||
177 | __field(int, order) | ||
178 | __field(gfp_t, gfp_mask) | ||
179 | __field(enum migrate_mode, mode) | ||
180 | ), | ||
181 | |||
182 | TP_fast_assign( | ||
183 | __entry->order = order; | ||
184 | __entry->gfp_mask = gfp_mask; | ||
185 | __entry->mode = mode; | ||
186 | ), | ||
187 | |||
188 | TP_printk("order=%d gfp_mask=0x%x mode=%d", | ||
189 | __entry->order, | ||
190 | __entry->gfp_mask, | ||
191 | (int)__entry->mode) | ||
192 | ); | ||
193 | |||
194 | DECLARE_EVENT_CLASS(mm_compaction_suitable_template, | ||
195 | |||
196 | TP_PROTO(struct zone *zone, | ||
197 | int order, | ||
198 | int ret), | ||
199 | |||
200 | TP_ARGS(zone, order, ret), | ||
201 | |||
202 | TP_STRUCT__entry( | ||
203 | __field(int, nid) | ||
204 | __field(char *, name) | ||
205 | __field(int, order) | ||
206 | __field(int, ret) | ||
207 | ), | ||
208 | |||
209 | TP_fast_assign( | ||
210 | __entry->nid = zone_to_nid(zone); | ||
211 | __entry->name = (char *)zone->name; | ||
212 | __entry->order = order; | ||
213 | __entry->ret = ret; | ||
214 | ), | ||
215 | |||
216 | TP_printk("node=%d zone=%-8s order=%d ret=%s", | ||
217 | __entry->nid, | ||
218 | __entry->name, | ||
219 | __entry->order, | ||
220 | compaction_status_string[__entry->ret]) | ||
221 | ); | ||
222 | |||
223 | DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_finished, | ||
224 | |||
225 | TP_PROTO(struct zone *zone, | ||
226 | int order, | ||
227 | int ret), | ||
228 | |||
229 | TP_ARGS(zone, order, ret) | ||
230 | ); | ||
231 | |||
232 | DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_suitable, | ||
233 | |||
234 | TP_PROTO(struct zone *zone, | ||
235 | int order, | ||
236 | int ret), | ||
237 | |||
238 | TP_ARGS(zone, order, ret) | ||
239 | ); | ||
240 | |||
241 | #ifdef CONFIG_COMPACTION | ||
242 | DECLARE_EVENT_CLASS(mm_compaction_defer_template, | ||
243 | |||
244 | TP_PROTO(struct zone *zone, int order), | ||
245 | |||
246 | TP_ARGS(zone, order), | ||
247 | |||
248 | TP_STRUCT__entry( | ||
249 | __field(int, nid) | ||
250 | __field(char *, name) | ||
251 | __field(int, order) | ||
252 | __field(unsigned int, considered) | ||
253 | __field(unsigned int, defer_shift) | ||
254 | __field(int, order_failed) | ||
255 | ), | ||
256 | |||
257 | TP_fast_assign( | ||
258 | __entry->nid = zone_to_nid(zone); | ||
259 | __entry->name = (char *)zone->name; | ||
260 | __entry->order = order; | ||
261 | __entry->considered = zone->compact_considered; | ||
262 | __entry->defer_shift = zone->compact_defer_shift; | ||
263 | __entry->order_failed = zone->compact_order_failed; | ||
264 | ), | ||
265 | |||
266 | TP_printk("node=%d zone=%-8s order=%d order_failed=%d consider=%u limit=%lu", | ||
267 | __entry->nid, | ||
268 | __entry->name, | ||
269 | __entry->order, | ||
270 | __entry->order_failed, | ||
271 | __entry->considered, | ||
272 | 1UL << __entry->defer_shift) | ||
273 | ); | ||
274 | |||
275 | DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_deferred, | ||
276 | |||
277 | TP_PROTO(struct zone *zone, int order), | ||
278 | |||
279 | TP_ARGS(zone, order) | ||
280 | ); | ||
281 | |||
282 | DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_compaction, | ||
283 | |||
284 | TP_PROTO(struct zone *zone, int order), | ||
285 | |||
286 | TP_ARGS(zone, order) | ||
287 | ); | ||
288 | |||
289 | DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset, | ||
290 | |||
291 | TP_PROTO(struct zone *zone, int order), | ||
292 | |||
293 | TP_ARGS(zone, order) | ||
128 | ); | 294 | ); |
295 | #endif | ||
129 | 296 | ||
130 | #endif /* _TRACE_COMPACTION_H */ | 297 | #endif /* _TRACE_COMPACTION_H */ |
131 | 298 | ||
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 6cfb841fea7c..6e5abd6d38a2 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -73,6 +73,36 @@ struct extent_status; | |||
73 | { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"}) | 73 | { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"}) |
74 | 74 | ||
75 | 75 | ||
76 | TRACE_EVENT(ext4_other_inode_update_time, | ||
77 | TP_PROTO(struct inode *inode, ino_t orig_ino), | ||
78 | |||
79 | TP_ARGS(inode, orig_ino), | ||
80 | |||
81 | TP_STRUCT__entry( | ||
82 | __field( dev_t, dev ) | ||
83 | __field( ino_t, ino ) | ||
84 | __field( ino_t, orig_ino ) | ||
85 | __field( uid_t, uid ) | ||
86 | __field( gid_t, gid ) | ||
87 | __field( __u16, mode ) | ||
88 | ), | ||
89 | |||
90 | TP_fast_assign( | ||
91 | __entry->orig_ino = orig_ino; | ||
92 | __entry->dev = inode->i_sb->s_dev; | ||
93 | __entry->ino = inode->i_ino; | ||
94 | __entry->uid = i_uid_read(inode); | ||
95 | __entry->gid = i_gid_read(inode); | ||
96 | __entry->mode = inode->i_mode; | ||
97 | ), | ||
98 | |||
99 | TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u", | ||
100 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
101 | (unsigned long) __entry->orig_ino, | ||
102 | (unsigned long) __entry->ino, __entry->mode, | ||
103 | __entry->uid, __entry->gid) | ||
104 | ); | ||
105 | |||
76 | TRACE_EVENT(ext4_free_inode, | 106 | TRACE_EVENT(ext4_free_inode, |
77 | TP_PROTO(struct inode *inode), | 107 | TP_PROTO(struct inode *inode), |
78 | 108 | ||
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index bbc4de9baef7..5422dbfaf97d 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #define show_cpreason(type) \ | 72 | #define show_cpreason(type) \ |
73 | __print_symbolic(type, \ | 73 | __print_symbolic(type, \ |
74 | { CP_UMOUNT, "Umount" }, \ | 74 | { CP_UMOUNT, "Umount" }, \ |
75 | { CP_FASTBOOT, "Fastboot" }, \ | ||
75 | { CP_SYNC, "Sync" }, \ | 76 | { CP_SYNC, "Sync" }, \ |
76 | { CP_DISCARD, "Discard" }) | 77 | { CP_DISCARD, "Discard" }) |
77 | 78 | ||
@@ -148,14 +149,14 @@ DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter, | |||
148 | 149 | ||
149 | TRACE_EVENT(f2fs_sync_file_exit, | 150 | TRACE_EVENT(f2fs_sync_file_exit, |
150 | 151 | ||
151 | TP_PROTO(struct inode *inode, bool need_cp, int datasync, int ret), | 152 | TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret), |
152 | 153 | ||
153 | TP_ARGS(inode, need_cp, datasync, ret), | 154 | TP_ARGS(inode, need_cp, datasync, ret), |
154 | 155 | ||
155 | TP_STRUCT__entry( | 156 | TP_STRUCT__entry( |
156 | __field(dev_t, dev) | 157 | __field(dev_t, dev) |
157 | __field(ino_t, ino) | 158 | __field(ino_t, ino) |
158 | __field(bool, need_cp) | 159 | __field(int, need_cp) |
159 | __field(int, datasync) | 160 | __field(int, datasync) |
160 | __field(int, ret) | 161 | __field(int, ret) |
161 | ), | 162 | ), |
@@ -190,7 +191,7 @@ TRACE_EVENT(f2fs_sync_fs, | |||
190 | 191 | ||
191 | TP_fast_assign( | 192 | TP_fast_assign( |
192 | __entry->dev = sb->s_dev; | 193 | __entry->dev = sb->s_dev; |
193 | __entry->dirty = F2FS_SB(sb)->s_dirty; | 194 | __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY); |
194 | __entry->wait = wait; | 195 | __entry->wait = wait; |
195 | ), | 196 | ), |
196 | 197 | ||
@@ -440,38 +441,6 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, | |||
440 | __entry->err) | 441 | __entry->err) |
441 | ); | 442 | ); |
442 | 443 | ||
443 | TRACE_EVENT_CONDITION(f2fs_submit_page_bio, | ||
444 | |||
445 | TP_PROTO(struct page *page, sector_t blkaddr, int type), | ||
446 | |||
447 | TP_ARGS(page, blkaddr, type), | ||
448 | |||
449 | TP_CONDITION(page->mapping), | ||
450 | |||
451 | TP_STRUCT__entry( | ||
452 | __field(dev_t, dev) | ||
453 | __field(ino_t, ino) | ||
454 | __field(pgoff_t, index) | ||
455 | __field(sector_t, blkaddr) | ||
456 | __field(int, type) | ||
457 | ), | ||
458 | |||
459 | TP_fast_assign( | ||
460 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
461 | __entry->ino = page->mapping->host->i_ino; | ||
462 | __entry->index = page->index; | ||
463 | __entry->blkaddr = blkaddr; | ||
464 | __entry->type = type; | ||
465 | ), | ||
466 | |||
467 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | ||
468 | "blkaddr = 0x%llx, bio_type = %s%s", | ||
469 | show_dev_ino(__entry), | ||
470 | (unsigned long)__entry->index, | ||
471 | (unsigned long long)__entry->blkaddr, | ||
472 | show_bio_type(__entry->type)) | ||
473 | ); | ||
474 | |||
475 | TRACE_EVENT(f2fs_get_data_block, | 444 | TRACE_EVENT(f2fs_get_data_block, |
476 | TP_PROTO(struct inode *inode, sector_t iblock, | 445 | TP_PROTO(struct inode *inode, sector_t iblock, |
477 | struct buffer_head *bh, int ret), | 446 | struct buffer_head *bh, int ret), |
@@ -680,11 +649,63 @@ TRACE_EVENT(f2fs_reserve_new_block, | |||
680 | __entry->ofs_in_node) | 649 | __entry->ofs_in_node) |
681 | ); | 650 | ); |
682 | 651 | ||
652 | DECLARE_EVENT_CLASS(f2fs__submit_page_bio, | ||
653 | |||
654 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), | ||
655 | |||
656 | TP_ARGS(page, fio), | ||
657 | |||
658 | TP_STRUCT__entry( | ||
659 | __field(dev_t, dev) | ||
660 | __field(ino_t, ino) | ||
661 | __field(pgoff_t, index) | ||
662 | __field(block_t, blkaddr) | ||
663 | __field(int, rw) | ||
664 | __field(int, type) | ||
665 | ), | ||
666 | |||
667 | TP_fast_assign( | ||
668 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
669 | __entry->ino = page->mapping->host->i_ino; | ||
670 | __entry->index = page->index; | ||
671 | __entry->blkaddr = fio->blk_addr; | ||
672 | __entry->rw = fio->rw; | ||
673 | __entry->type = fio->type; | ||
674 | ), | ||
675 | |||
676 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | ||
677 | "blkaddr = 0x%llx, rw = %s%s, type = %s", | ||
678 | show_dev_ino(__entry), | ||
679 | (unsigned long)__entry->index, | ||
680 | (unsigned long long)__entry->blkaddr, | ||
681 | show_bio_type(__entry->rw), | ||
682 | show_block_type(__entry->type)) | ||
683 | ); | ||
684 | |||
685 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio, | ||
686 | |||
687 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), | ||
688 | |||
689 | TP_ARGS(page, fio), | ||
690 | |||
691 | TP_CONDITION(page->mapping) | ||
692 | ); | ||
693 | |||
694 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio, | ||
695 | |||
696 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), | ||
697 | |||
698 | TP_ARGS(page, fio), | ||
699 | |||
700 | TP_CONDITION(page->mapping) | ||
701 | ); | ||
702 | |||
683 | DECLARE_EVENT_CLASS(f2fs__submit_bio, | 703 | DECLARE_EVENT_CLASS(f2fs__submit_bio, |
684 | 704 | ||
685 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | 705 | TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio, |
706 | struct bio *bio), | ||
686 | 707 | ||
687 | TP_ARGS(sb, rw, type, bio), | 708 | TP_ARGS(sb, fio, bio), |
688 | 709 | ||
689 | TP_STRUCT__entry( | 710 | TP_STRUCT__entry( |
690 | __field(dev_t, dev) | 711 | __field(dev_t, dev) |
@@ -696,8 +717,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, | |||
696 | 717 | ||
697 | TP_fast_assign( | 718 | TP_fast_assign( |
698 | __entry->dev = sb->s_dev; | 719 | __entry->dev = sb->s_dev; |
699 | __entry->rw = rw; | 720 | __entry->rw = fio->rw; |
700 | __entry->type = type; | 721 | __entry->type = fio->type; |
701 | __entry->sector = bio->bi_iter.bi_sector; | 722 | __entry->sector = bio->bi_iter.bi_sector; |
702 | __entry->size = bio->bi_iter.bi_size; | 723 | __entry->size = bio->bi_iter.bi_size; |
703 | ), | 724 | ), |
@@ -712,18 +733,20 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, | |||
712 | 733 | ||
713 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio, | 734 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio, |
714 | 735 | ||
715 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | 736 | TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio, |
737 | struct bio *bio), | ||
716 | 738 | ||
717 | TP_ARGS(sb, rw, type, bio), | 739 | TP_ARGS(sb, fio, bio), |
718 | 740 | ||
719 | TP_CONDITION(bio) | 741 | TP_CONDITION(bio) |
720 | ); | 742 | ); |
721 | 743 | ||
722 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio, | 744 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio, |
723 | 745 | ||
724 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | 746 | TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio, |
747 | struct bio *bio), | ||
725 | 748 | ||
726 | TP_ARGS(sb, rw, type, bio), | 749 | TP_ARGS(sb, fio, bio), |
727 | 750 | ||
728 | TP_CONDITION(bio) | 751 | TP_CONDITION(bio) |
729 | ); | 752 | ); |
@@ -916,38 +939,6 @@ TRACE_EVENT(f2fs_writepages, | |||
916 | __entry->for_sync) | 939 | __entry->for_sync) |
917 | ); | 940 | ); |
918 | 941 | ||
919 | TRACE_EVENT(f2fs_submit_page_mbio, | ||
920 | |||
921 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), | ||
922 | |||
923 | TP_ARGS(page, rw, type, blk_addr), | ||
924 | |||
925 | TP_STRUCT__entry( | ||
926 | __field(dev_t, dev) | ||
927 | __field(ino_t, ino) | ||
928 | __field(int, rw) | ||
929 | __field(int, type) | ||
930 | __field(pgoff_t, index) | ||
931 | __field(block_t, block) | ||
932 | ), | ||
933 | |||
934 | TP_fast_assign( | ||
935 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
936 | __entry->ino = page->mapping->host->i_ino; | ||
937 | __entry->rw = rw; | ||
938 | __entry->type = type; | ||
939 | __entry->index = page->index; | ||
940 | __entry->block = blk_addr; | ||
941 | ), | ||
942 | |||
943 | TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx", | ||
944 | show_dev_ino(__entry), | ||
945 | show_bio_type(__entry->rw), | ||
946 | show_block_type(__entry->type), | ||
947 | (unsigned long)__entry->index, | ||
948 | (unsigned long long)__entry->block) | ||
949 | ); | ||
950 | |||
951 | TRACE_EVENT(f2fs_write_checkpoint, | 942 | TRACE_EVENT(f2fs_write_checkpoint, |
952 | 943 | ||
953 | TP_PROTO(struct super_block *sb, int reason, char *msg), | 944 | TP_PROTO(struct super_block *sb, int reason, char *msg), |
@@ -998,14 +989,15 @@ TRACE_EVENT(f2fs_issue_discard, | |||
998 | 989 | ||
999 | TRACE_EVENT(f2fs_issue_flush, | 990 | TRACE_EVENT(f2fs_issue_flush, |
1000 | 991 | ||
1001 | TP_PROTO(struct super_block *sb, bool nobarrier, bool flush_merge), | 992 | TP_PROTO(struct super_block *sb, unsigned int nobarrier, |
993 | unsigned int flush_merge), | ||
1002 | 994 | ||
1003 | TP_ARGS(sb, nobarrier, flush_merge), | 995 | TP_ARGS(sb, nobarrier, flush_merge), |
1004 | 996 | ||
1005 | TP_STRUCT__entry( | 997 | TP_STRUCT__entry( |
1006 | __field(dev_t, dev) | 998 | __field(dev_t, dev) |
1007 | __field(bool, nobarrier) | 999 | __field(unsigned int, nobarrier) |
1008 | __field(bool, flush_merge) | 1000 | __field(unsigned int, flush_merge) |
1009 | ), | 1001 | ), |
1010 | 1002 | ||
1011 | TP_fast_assign( | 1003 | TP_fast_assign( |
diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index a8f5c32d174b..2c7befb10f13 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h | |||
@@ -83,7 +83,7 @@ DEFINE_EVENT(iommu_device_event, detach_device_from_domain, | |||
83 | TP_ARGS(dev) | 83 | TP_ARGS(dev) |
84 | ); | 84 | ); |
85 | 85 | ||
86 | DECLARE_EVENT_CLASS(iommu_map_unmap, | 86 | TRACE_EVENT(map, |
87 | 87 | ||
88 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 88 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), |
89 | 89 | ||
@@ -92,7 +92,7 @@ DECLARE_EVENT_CLASS(iommu_map_unmap, | |||
92 | TP_STRUCT__entry( | 92 | TP_STRUCT__entry( |
93 | __field(u64, iova) | 93 | __field(u64, iova) |
94 | __field(u64, paddr) | 94 | __field(u64, paddr) |
95 | __field(int, size) | 95 | __field(size_t, size) |
96 | ), | 96 | ), |
97 | 97 | ||
98 | TP_fast_assign( | 98 | TP_fast_assign( |
@@ -101,26 +101,31 @@ DECLARE_EVENT_CLASS(iommu_map_unmap, | |||
101 | __entry->size = size; | 101 | __entry->size = size; |
102 | ), | 102 | ), |
103 | 103 | ||
104 | TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=0x%x", | 104 | TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=%zu", |
105 | __entry->iova, __entry->paddr, __entry->size | 105 | __entry->iova, __entry->paddr, __entry->size |
106 | ) | 106 | ) |
107 | ); | 107 | ); |
108 | 108 | ||
109 | DEFINE_EVENT(iommu_map_unmap, map, | 109 | TRACE_EVENT(unmap, |
110 | 110 | ||
111 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 111 | TP_PROTO(unsigned long iova, size_t size, size_t unmapped_size), |
112 | |||
113 | TP_ARGS(iova, paddr, size) | ||
114 | ); | ||
115 | 112 | ||
116 | DEFINE_EVENT_PRINT(iommu_map_unmap, unmap, | 113 | TP_ARGS(iova, size, unmapped_size), |
117 | 114 | ||
118 | TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), | 115 | TP_STRUCT__entry( |
116 | __field(u64, iova) | ||
117 | __field(size_t, size) | ||
118 | __field(size_t, unmapped_size) | ||
119 | ), | ||
119 | 120 | ||
120 | TP_ARGS(iova, paddr, size), | 121 | TP_fast_assign( |
122 | __entry->iova = iova; | ||
123 | __entry->size = size; | ||
124 | __entry->unmapped_size = unmapped_size; | ||
125 | ), | ||
121 | 126 | ||
122 | TP_printk("IOMMU: iova=0x%016llx size=0x%x", | 127 | TP_printk("IOMMU: iova=0x%016llx size=%zu unmapped_size=%zu", |
123 | __entry->iova, __entry->size | 128 | __entry->iova, __entry->size, __entry->unmapped_size |
124 | ) | 129 | ) |
125 | ); | 130 | ); |
126 | 131 | ||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index aece1346ceb7..4ad10baecd4d 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -268,11 +268,11 @@ TRACE_EVENT(mm_page_alloc_extfrag, | |||
268 | 268 | ||
269 | TP_PROTO(struct page *page, | 269 | TP_PROTO(struct page *page, |
270 | int alloc_order, int fallback_order, | 270 | int alloc_order, int fallback_order, |
271 | int alloc_migratetype, int fallback_migratetype, int new_migratetype), | 271 | int alloc_migratetype, int fallback_migratetype), |
272 | 272 | ||
273 | TP_ARGS(page, | 273 | TP_ARGS(page, |
274 | alloc_order, fallback_order, | 274 | alloc_order, fallback_order, |
275 | alloc_migratetype, fallback_migratetype, new_migratetype), | 275 | alloc_migratetype, fallback_migratetype), |
276 | 276 | ||
277 | TP_STRUCT__entry( | 277 | TP_STRUCT__entry( |
278 | __field( struct page *, page ) | 278 | __field( struct page *, page ) |
@@ -289,7 +289,8 @@ TRACE_EVENT(mm_page_alloc_extfrag, | |||
289 | __entry->fallback_order = fallback_order; | 289 | __entry->fallback_order = fallback_order; |
290 | __entry->alloc_migratetype = alloc_migratetype; | 290 | __entry->alloc_migratetype = alloc_migratetype; |
291 | __entry->fallback_migratetype = fallback_migratetype; | 291 | __entry->fallback_migratetype = fallback_migratetype; |
292 | __entry->change_ownership = (new_migratetype == alloc_migratetype); | 292 | __entry->change_ownership = (alloc_migratetype == |
293 | get_pageblock_migratetype(page)); | ||
293 | ), | 294 | ), |
294 | 295 | ||
295 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", | 296 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 86b399c66c3d..a44062da684b 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -37,6 +37,25 @@ TRACE_EVENT(kvm_userspace_exit, | |||
37 | __entry->errno < 0 ? -__entry->errno : __entry->reason) | 37 | __entry->errno < 0 ? -__entry->errno : __entry->reason) |
38 | ); | 38 | ); |
39 | 39 | ||
40 | TRACE_EVENT(kvm_vcpu_wakeup, | ||
41 | TP_PROTO(__u64 ns, bool waited), | ||
42 | TP_ARGS(ns, waited), | ||
43 | |||
44 | TP_STRUCT__entry( | ||
45 | __field( __u64, ns ) | ||
46 | __field( bool, waited ) | ||
47 | ), | ||
48 | |||
49 | TP_fast_assign( | ||
50 | __entry->ns = ns; | ||
51 | __entry->waited = waited; | ||
52 | ), | ||
53 | |||
54 | TP_printk("%s time %lld ns", | ||
55 | __entry->waited ? "wait" : "poll", | ||
56 | __entry->ns) | ||
57 | ); | ||
58 | |||
40 | #if defined(CONFIG_HAVE_KVM_IRQFD) | 59 | #if defined(CONFIG_HAVE_KVM_IRQFD) |
41 | TRACE_EVENT(kvm_set_irq, | 60 | TRACE_EVENT(kvm_set_irq, |
42 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | 61 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
diff --git a/include/trace/events/net.h b/include/trace/events/net.h index 1de256b35807..49cc7c3de252 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h | |||
@@ -40,9 +40,9 @@ TRACE_EVENT(net_dev_start_xmit, | |||
40 | __assign_str(name, dev->name); | 40 | __assign_str(name, dev->name); |
41 | __entry->queue_mapping = skb->queue_mapping; | 41 | __entry->queue_mapping = skb->queue_mapping; |
42 | __entry->skbaddr = skb; | 42 | __entry->skbaddr = skb; |
43 | __entry->vlan_tagged = vlan_tx_tag_present(skb); | 43 | __entry->vlan_tagged = skb_vlan_tag_present(skb); |
44 | __entry->vlan_proto = ntohs(skb->vlan_proto); | 44 | __entry->vlan_proto = ntohs(skb->vlan_proto); |
45 | __entry->vlan_tci = vlan_tx_tag_get(skb); | 45 | __entry->vlan_tci = skb_vlan_tag_get(skb); |
46 | __entry->protocol = ntohs(skb->protocol); | 46 | __entry->protocol = ntohs(skb->protocol); |
47 | __entry->ip_summed = skb->ip_summed; | 47 | __entry->ip_summed = skb->ip_summed; |
48 | __entry->len = skb->len; | 48 | __entry->len = skb->len; |
@@ -174,9 +174,9 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, | |||
174 | #endif | 174 | #endif |
175 | __entry->queue_mapping = skb->queue_mapping; | 175 | __entry->queue_mapping = skb->queue_mapping; |
176 | __entry->skbaddr = skb; | 176 | __entry->skbaddr = skb; |
177 | __entry->vlan_tagged = vlan_tx_tag_present(skb); | 177 | __entry->vlan_tagged = skb_vlan_tag_present(skb); |
178 | __entry->vlan_proto = ntohs(skb->vlan_proto); | 178 | __entry->vlan_proto = ntohs(skb->vlan_proto); |
179 | __entry->vlan_tci = vlan_tx_tag_get(skb); | 179 | __entry->vlan_tci = skb_vlan_tag_get(skb); |
180 | __entry->protocol = ntohs(skb->protocol); | 180 | __entry->protocol = ntohs(skb->protocol); |
181 | __entry->ip_summed = skb->ip_summed; | 181 | __entry->ip_summed = skb->ip_summed; |
182 | __entry->hash = skb->hash; | 182 | __entry->hash = skb->hash; |
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h index 13391d288107..0e7635765153 100644 --- a/include/trace/events/tlb.h +++ b/include/trace/events/tlb.h | |||
@@ -13,11 +13,13 @@ | |||
13 | { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ | 13 | { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ |
14 | { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } | 14 | { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } |
15 | 15 | ||
16 | TRACE_EVENT(tlb_flush, | 16 | TRACE_EVENT_CONDITION(tlb_flush, |
17 | 17 | ||
18 | TP_PROTO(int reason, unsigned long pages), | 18 | TP_PROTO(int reason, unsigned long pages), |
19 | TP_ARGS(reason, pages), | 19 | TP_ARGS(reason, pages), |
20 | 20 | ||
21 | TP_CONDITION(cpu_online(smp_processor_id())), | ||
22 | |||
21 | TP_STRUCT__entry( | 23 | TP_STRUCT__entry( |
22 | __field( int, reason) | 24 | __field( int, reason) |
23 | __field(unsigned long, pages) | 25 | __field(unsigned long, pages) |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index cee02d65ab3f..5a14ead59696 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -18,6 +18,8 @@ | |||
18 | {I_FREEING, "I_FREEING"}, \ | 18 | {I_FREEING, "I_FREEING"}, \ |
19 | {I_CLEAR, "I_CLEAR"}, \ | 19 | {I_CLEAR, "I_CLEAR"}, \ |
20 | {I_SYNC, "I_SYNC"}, \ | 20 | {I_SYNC, "I_SYNC"}, \ |
21 | {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ | ||
22 | {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ | ||
21 | {I_REFERENCED, "I_REFERENCED"} \ | 23 | {I_REFERENCED, "I_REFERENCED"} \ |
22 | ) | 24 | ) |
23 | 25 | ||
@@ -47,7 +49,7 @@ TRACE_EVENT(writeback_dirty_page, | |||
47 | 49 | ||
48 | TP_fast_assign( | 50 | TP_fast_assign( |
49 | strncpy(__entry->name, | 51 | strncpy(__entry->name, |
50 | mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32); | 52 | mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", 32); |
51 | __entry->ino = mapping ? mapping->host->i_ino : 0; | 53 | __entry->ino = mapping ? mapping->host->i_ino : 0; |
52 | __entry->index = page->index; | 54 | __entry->index = page->index; |
53 | ), | 55 | ), |
@@ -68,26 +70,36 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template, | |||
68 | TP_STRUCT__entry ( | 70 | TP_STRUCT__entry ( |
69 | __array(char, name, 32) | 71 | __array(char, name, 32) |
70 | __field(unsigned long, ino) | 72 | __field(unsigned long, ino) |
73 | __field(unsigned long, state) | ||
71 | __field(unsigned long, flags) | 74 | __field(unsigned long, flags) |
72 | ), | 75 | ), |
73 | 76 | ||
74 | TP_fast_assign( | 77 | TP_fast_assign( |
75 | struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; | 78 | struct backing_dev_info *bdi = inode_to_bdi(inode); |
76 | 79 | ||
77 | /* may be called for files on pseudo FSes w/ unregistered bdi */ | 80 | /* may be called for files on pseudo FSes w/ unregistered bdi */ |
78 | strncpy(__entry->name, | 81 | strncpy(__entry->name, |
79 | bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); | 82 | bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); |
80 | __entry->ino = inode->i_ino; | 83 | __entry->ino = inode->i_ino; |
84 | __entry->state = inode->i_state; | ||
81 | __entry->flags = flags; | 85 | __entry->flags = flags; |
82 | ), | 86 | ), |
83 | 87 | ||
84 | TP_printk("bdi %s: ino=%lu flags=%s", | 88 | TP_printk("bdi %s: ino=%lu state=%s flags=%s", |
85 | __entry->name, | 89 | __entry->name, |
86 | __entry->ino, | 90 | __entry->ino, |
91 | show_inode_state(__entry->state), | ||
87 | show_inode_state(__entry->flags) | 92 | show_inode_state(__entry->flags) |
88 | ) | 93 | ) |
89 | ); | 94 | ); |
90 | 95 | ||
96 | DEFINE_EVENT(writeback_dirty_inode_template, writeback_mark_inode_dirty, | ||
97 | |||
98 | TP_PROTO(struct inode *inode, int flags), | ||
99 | |||
100 | TP_ARGS(inode, flags) | ||
101 | ); | ||
102 | |||
91 | DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode_start, | 103 | DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode_start, |
92 | 104 | ||
93 | TP_PROTO(struct inode *inode, int flags), | 105 | TP_PROTO(struct inode *inode, int flags), |
@@ -116,7 +128,7 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, | |||
116 | 128 | ||
117 | TP_fast_assign( | 129 | TP_fast_assign( |
118 | strncpy(__entry->name, | 130 | strncpy(__entry->name, |
119 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | 131 | dev_name(inode_to_bdi(inode)->dev), 32); |
120 | __entry->ino = inode->i_ino; | 132 | __entry->ino = inode->i_ino; |
121 | __entry->sync_mode = wbc->sync_mode; | 133 | __entry->sync_mode = wbc->sync_mode; |
122 | ), | 134 | ), |
@@ -156,10 +168,8 @@ DECLARE_EVENT_CLASS(writeback_work_class, | |||
156 | __field(int, reason) | 168 | __field(int, reason) |
157 | ), | 169 | ), |
158 | TP_fast_assign( | 170 | TP_fast_assign( |
159 | struct device *dev = bdi->dev; | 171 | strncpy(__entry->name, |
160 | if (!dev) | 172 | bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); |
161 | dev = default_backing_dev_info.dev; | ||
162 | strncpy(__entry->name, dev_name(dev), 32); | ||
163 | __entry->nr_pages = work->nr_pages; | 173 | __entry->nr_pages = work->nr_pages; |
164 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; | 174 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; |
165 | __entry->sync_mode = work->sync_mode; | 175 | __entry->sync_mode = work->sync_mode; |
@@ -598,6 +608,52 @@ DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, | |||
598 | TP_ARGS(inode, wbc, nr_to_write) | 608 | TP_ARGS(inode, wbc, nr_to_write) |
599 | ); | 609 | ); |
600 | 610 | ||
611 | DECLARE_EVENT_CLASS(writeback_lazytime_template, | ||
612 | TP_PROTO(struct inode *inode), | ||
613 | |||
614 | TP_ARGS(inode), | ||
615 | |||
616 | TP_STRUCT__entry( | ||
617 | __field( dev_t, dev ) | ||
618 | __field(unsigned long, ino ) | ||
619 | __field(unsigned long, state ) | ||
620 | __field( __u16, mode ) | ||
621 | __field(unsigned long, dirtied_when ) | ||
622 | ), | ||
623 | |||
624 | TP_fast_assign( | ||
625 | __entry->dev = inode->i_sb->s_dev; | ||
626 | __entry->ino = inode->i_ino; | ||
627 | __entry->state = inode->i_state; | ||
628 | __entry->mode = inode->i_mode; | ||
629 | __entry->dirtied_when = inode->dirtied_when; | ||
630 | ), | ||
631 | |||
632 | TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o", | ||
633 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
634 | __entry->ino, __entry->dirtied_when, | ||
635 | show_inode_state(__entry->state), __entry->mode) | ||
636 | ); | ||
637 | |||
638 | DEFINE_EVENT(writeback_lazytime_template, writeback_lazytime, | ||
639 | TP_PROTO(struct inode *inode), | ||
640 | |||
641 | TP_ARGS(inode) | ||
642 | ); | ||
643 | |||
644 | DEFINE_EVENT(writeback_lazytime_template, writeback_lazytime_iput, | ||
645 | TP_PROTO(struct inode *inode), | ||
646 | |||
647 | TP_ARGS(inode) | ||
648 | ); | ||
649 | |||
650 | DEFINE_EVENT(writeback_lazytime_template, writeback_dirty_inode_enqueue, | ||
651 | |||
652 | TP_PROTO(struct inode *inode), | ||
653 | |||
654 | TP_ARGS(inode) | ||
655 | ); | ||
656 | |||
601 | #endif /* _TRACE_WRITEBACK_H */ | 657 | #endif /* _TRACE_WRITEBACK_H */ |
602 | 658 | ||
603 | /* This part must be outside protection */ | 659 | /* This part must be outside protection */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 27609dfcce25..41bf65f04dd9 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -263,6 +263,14 @@ | |||
263 | #undef __print_hex | 263 | #undef __print_hex |
264 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) | 264 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) |
265 | 265 | ||
266 | #undef __print_array | ||
267 | #define __print_array(array, count, el_size) \ | ||
268 | ({ \ | ||
269 | BUILD_BUG_ON(el_size != 1 && el_size != 2 && \ | ||
270 | el_size != 4 && el_size != 8); \ | ||
271 | ftrace_print_array_seq(p, array, count, el_size); \ | ||
272 | }) | ||
273 | |||
266 | #undef DECLARE_EVENT_CLASS | 274 | #undef DECLARE_EVENT_CLASS |
267 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 275 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
268 | static notrace enum print_line_t \ | 276 | static notrace enum print_line_t \ |
@@ -674,6 +682,7 @@ static inline void ftrace_test_probe_##call(void) \ | |||
674 | #undef __get_dynamic_array_len | 682 | #undef __get_dynamic_array_len |
675 | #undef __get_str | 683 | #undef __get_str |
676 | #undef __get_bitmask | 684 | #undef __get_bitmask |
685 | #undef __print_array | ||
677 | 686 | ||
678 | #undef TP_printk | 687 | #undef TP_printk |
679 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) | 688 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) |
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index b0b855613641..01b2d6d0e355 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h | |||
@@ -654,6 +654,13 @@ struct drm_get_cap { | |||
654 | */ | 654 | */ |
655 | #define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 | 655 | #define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 |
656 | 656 | ||
657 | /** | ||
658 | * DRM_CLIENT_CAP_ATOMIC | ||
659 | * | ||
660 | * If set to 1, the DRM core will expose atomic properties to userspace | ||
661 | */ | ||
662 | #define DRM_CLIENT_CAP_ATOMIC 3 | ||
663 | |||
657 | /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ | 664 | /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ |
658 | struct drm_set_client_cap { | 665 | struct drm_set_client_cap { |
659 | __u64 capability; | 666 | __u64 capability; |
@@ -777,6 +784,7 @@ struct drm_prime_handle { | |||
777 | #define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) | 784 | #define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) |
778 | #define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) | 785 | #define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) |
779 | #define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) | 786 | #define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) |
787 | #define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) | ||
780 | 788 | ||
781 | /** | 789 | /** |
782 | * Device specific ioctls should only be in their respective headers | 790 | * Device specific ioctls should only be in their respective headers |
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 646ae5f39f42..a284f11a8ef5 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h | |||
@@ -109,9 +109,6 @@ | |||
109 | #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ | 109 | #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ |
110 | #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ | 110 | #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ |
111 | 111 | ||
112 | /* special NV12 tiled format */ | ||
113 | #define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ | ||
114 | |||
115 | /* | 112 | /* |
116 | * 3 plane YCbCr | 113 | * 3 plane YCbCr |
117 | * index 0: Y plane, [7:0] Y | 114 | * index 0: Y plane, [7:0] Y |
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 86574b0005ff..ca788e01dab2 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h | |||
@@ -272,6 +272,13 @@ struct drm_mode_get_connector { | |||
272 | #define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) | 272 | #define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) |
273 | #define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) | 273 | #define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) |
274 | 274 | ||
275 | /* the PROP_ATOMIC flag is used to hide properties from userspace that | ||
276 | * is not aware of atomic properties. This is mostly to work around | ||
277 | * older userspace (DDX drivers) that read/write each prop they find, | ||
278 | * witout being aware that this could be triggering a lengthy modeset. | ||
279 | */ | ||
280 | #define DRM_MODE_PROP_ATOMIC 0x80000000 | ||
281 | |||
275 | struct drm_mode_property_enum { | 282 | struct drm_mode_property_enum { |
276 | __u64 value; | 283 | __u64 value; |
277 | char name[DRM_PROP_NAME_LEN]; | 284 | char name[DRM_PROP_NAME_LEN]; |
@@ -338,7 +345,7 @@ struct drm_mode_fb_cmd2 { | |||
338 | 345 | ||
339 | /* | 346 | /* |
340 | * In case of planar formats, this ioctl allows up to 4 | 347 | * In case of planar formats, this ioctl allows up to 4 |
341 | * buffer objects with offets and pitches per plane. | 348 | * buffer objects with offsets and pitches per plane. |
342 | * The pitch and offset order is dictated by the fourcc, | 349 | * The pitch and offset order is dictated by the fourcc, |
343 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | 350 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: |
344 | * | 351 | * |
@@ -346,9 +353,9 @@ struct drm_mode_fb_cmd2 { | |||
346 | * followed by an interleaved U/V plane containing | 353 | * followed by an interleaved U/V plane containing |
347 | * 8 bit 2x2 subsampled colour difference samples. | 354 | * 8 bit 2x2 subsampled colour difference samples. |
348 | * | 355 | * |
349 | * So it would consist of Y as offset[0] and UV as | 356 | * So it would consist of Y as offsets[0] and UV as |
350 | * offeset[1]. Note that offset[0] will generally | 357 | * offsets[1]. Note that offsets[0] will generally |
351 | * be 0. | 358 | * be 0 (but this is not required). |
352 | */ | 359 | */ |
353 | __u32 handles[4]; | 360 | __u32 handles[4]; |
354 | __u32 pitches[4]; /* pitch for each plane */ | 361 | __u32 pitches[4]; /* pitch for each plane */ |
@@ -519,4 +526,27 @@ struct drm_mode_destroy_dumb { | |||
519 | uint32_t handle; | 526 | uint32_t handle; |
520 | }; | 527 | }; |
521 | 528 | ||
529 | /* page-flip flags are valid, plus: */ | ||
530 | #define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 | ||
531 | #define DRM_MODE_ATOMIC_NONBLOCK 0x0200 | ||
532 | #define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 | ||
533 | |||
534 | #define DRM_MODE_ATOMIC_FLAGS (\ | ||
535 | DRM_MODE_PAGE_FLIP_EVENT |\ | ||
536 | DRM_MODE_PAGE_FLIP_ASYNC |\ | ||
537 | DRM_MODE_ATOMIC_TEST_ONLY |\ | ||
538 | DRM_MODE_ATOMIC_NONBLOCK |\ | ||
539 | DRM_MODE_ATOMIC_ALLOW_MODESET) | ||
540 | |||
541 | struct drm_mode_atomic { | ||
542 | __u32 flags; | ||
543 | __u32 count_objs; | ||
544 | __u64 objs_ptr; | ||
545 | __u64 count_props_ptr; | ||
546 | __u64 props_ptr; | ||
547 | __u64 prop_values_ptr; | ||
548 | __u64 reserved; | ||
549 | __u64 user_data; | ||
550 | }; | ||
551 | |||
522 | #endif | 552 | #endif |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 250262265ee3..6eed16b92a24 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
@@ -224,6 +224,8 @@ typedef struct _drm_i915_sarea { | |||
224 | #define DRM_I915_REG_READ 0x31 | 224 | #define DRM_I915_REG_READ 0x31 |
225 | #define DRM_I915_GET_RESET_STATS 0x32 | 225 | #define DRM_I915_GET_RESET_STATS 0x32 |
226 | #define DRM_I915_GEM_USERPTR 0x33 | 226 | #define DRM_I915_GEM_USERPTR 0x33 |
227 | #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 | ||
228 | #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 | ||
227 | 229 | ||
228 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 230 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
229 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 231 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -275,6 +277,8 @@ typedef struct _drm_i915_sarea { | |||
275 | #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) | 277 | #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) |
276 | #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) | 278 | #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) |
277 | #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) | 279 | #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) |
280 | #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) | ||
281 | #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) | ||
278 | 282 | ||
279 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 283 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
280 | * on the security mechanisms provided by hardware. | 284 | * on the security mechanisms provided by hardware. |
@@ -341,6 +345,8 @@ typedef struct drm_i915_irq_wait { | |||
341 | #define I915_PARAM_HAS_WT 27 | 345 | #define I915_PARAM_HAS_WT 27 |
342 | #define I915_PARAM_CMD_PARSER_VERSION 28 | 346 | #define I915_PARAM_CMD_PARSER_VERSION 28 |
343 | #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 | 347 | #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 |
348 | #define I915_PARAM_MMAP_VERSION 30 | ||
349 | #define I915_PARAM_HAS_BSD2 31 | ||
344 | 350 | ||
345 | typedef struct drm_i915_getparam { | 351 | typedef struct drm_i915_getparam { |
346 | int param; | 352 | int param; |
@@ -488,6 +494,14 @@ struct drm_i915_gem_mmap { | |||
488 | * This is a fixed-size type for 32/64 compatibility. | 494 | * This is a fixed-size type for 32/64 compatibility. |
489 | */ | 495 | */ |
490 | __u64 addr_ptr; | 496 | __u64 addr_ptr; |
497 | |||
498 | /** | ||
499 | * Flags for extended behaviour. | ||
500 | * | ||
501 | * Added in version 2. | ||
502 | */ | ||
503 | __u64 flags; | ||
504 | #define I915_MMAP_WC 0x1 | ||
491 | }; | 505 | }; |
492 | 506 | ||
493 | struct drm_i915_gem_mmap_gtt { | 507 | struct drm_i915_gem_mmap_gtt { |
@@ -737,7 +751,13 @@ struct drm_i915_gem_execbuffer2 { | |||
737 | */ | 751 | */ |
738 | #define I915_EXEC_HANDLE_LUT (1<<12) | 752 | #define I915_EXEC_HANDLE_LUT (1<<12) |
739 | 753 | ||
740 | #define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) | 754 | /** Used for switching BSD rings on the platforms with two BSD rings */ |
755 | #define I915_EXEC_BSD_MASK (3<<13) | ||
756 | #define I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */ | ||
757 | #define I915_EXEC_BSD_RING1 (1<<13) | ||
758 | #define I915_EXEC_BSD_RING2 (2<<13) | ||
759 | |||
760 | #define __I915_EXEC_UNKNOWN_FLAGS -(1<<15) | ||
741 | 761 | ||
742 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | 762 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
743 | #define i915_execbuffer2_set_context_id(eb2, context) \ | 763 | #define i915_execbuffer2_set_context_id(eb2, context) \ |
@@ -1073,4 +1093,12 @@ struct drm_i915_gem_userptr { | |||
1073 | __u32 handle; | 1093 | __u32 handle; |
1074 | }; | 1094 | }; |
1075 | 1095 | ||
1096 | struct drm_i915_gem_context_param { | ||
1097 | __u32 ctx_id; | ||
1098 | __u32 size; | ||
1099 | __u64 param; | ||
1100 | #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 | ||
1101 | __u64 value; | ||
1102 | }; | ||
1103 | |||
1076 | #endif /* _UAPI_I915_DRM_H_ */ | 1104 | #endif /* _UAPI_I915_DRM_H_ */ |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 00b100023c47..68ceb97c458c 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
@@ -35,6 +35,7 @@ header-y += adfs_fs.h | |||
35 | header-y += affs_hardblocks.h | 35 | header-y += affs_hardblocks.h |
36 | header-y += agpgart.h | 36 | header-y += agpgart.h |
37 | header-y += aio_abi.h | 37 | header-y += aio_abi.h |
38 | header-y += am437x-vpfe.h | ||
38 | header-y += apm_bios.h | 39 | header-y += apm_bios.h |
39 | header-y += arcfb.h | 40 | header-y += arcfb.h |
40 | header-y += atalk.h | 41 | header-y += atalk.h |
@@ -283,6 +284,7 @@ header-y += net.h | |||
283 | header-y += netlink_diag.h | 284 | header-y += netlink_diag.h |
284 | header-y += netlink.h | 285 | header-y += netlink.h |
285 | header-y += netrom.h | 286 | header-y += netrom.h |
287 | header-y += net_namespace.h | ||
286 | header-y += net_tstamp.h | 288 | header-y += net_tstamp.h |
287 | header-y += nfc.h | 289 | header-y += nfc.h |
288 | header-y += nfs2.h | 290 | header-y += nfs2.h |
@@ -368,7 +370,6 @@ header-y += snmp.h | |||
368 | header-y += sock_diag.h | 370 | header-y += sock_diag.h |
369 | header-y += socket.h | 371 | header-y += socket.h |
370 | header-y += sockios.h | 372 | header-y += sockios.h |
371 | header-y += som.h | ||
372 | header-y += sonet.h | 373 | header-y += sonet.h |
373 | header-y += sonypi.h | 374 | header-y += sonypi.h |
374 | header-y += soundcard.h | 375 | header-y += soundcard.h |
diff --git a/include/uapi/linux/am437x-vpfe.h b/include/uapi/linux/am437x-vpfe.h new file mode 100644 index 000000000000..9b03033f9cd6 --- /dev/null +++ b/include/uapi/linux/am437x-vpfe.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 - 2014 Texas Instruments, Inc. | ||
3 | * | ||
4 | * Benoit Parrot <bparrot@ti.com> | ||
5 | * Lad, Prabhakar <prabhakar.csengg@gmail.com> | ||
6 | * | ||
7 | * This program is free software; you may redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; version 2 of the License. | ||
10 | * | ||
11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
12 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
13 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
15 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
16 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
17 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
18 | * SOFTWARE. | ||
19 | */ | ||
20 | |||
21 | #ifndef AM437X_VPFE_USER_H | ||
22 | #define AM437X_VPFE_USER_H | ||
23 | |||
24 | enum vpfe_ccdc_data_size { | ||
25 | VPFE_CCDC_DATA_16BITS = 0, | ||
26 | VPFE_CCDC_DATA_15BITS, | ||
27 | VPFE_CCDC_DATA_14BITS, | ||
28 | VPFE_CCDC_DATA_13BITS, | ||
29 | VPFE_CCDC_DATA_12BITS, | ||
30 | VPFE_CCDC_DATA_11BITS, | ||
31 | VPFE_CCDC_DATA_10BITS, | ||
32 | VPFE_CCDC_DATA_8BITS, | ||
33 | }; | ||
34 | |||
35 | /* enum for No of pixel per line to be avg. in Black Clamping*/ | ||
36 | enum vpfe_ccdc_sample_length { | ||
37 | VPFE_CCDC_SAMPLE_1PIXELS = 0, | ||
38 | VPFE_CCDC_SAMPLE_2PIXELS, | ||
39 | VPFE_CCDC_SAMPLE_4PIXELS, | ||
40 | VPFE_CCDC_SAMPLE_8PIXELS, | ||
41 | VPFE_CCDC_SAMPLE_16PIXELS, | ||
42 | }; | ||
43 | |||
44 | /* enum for No of lines in Black Clamping */ | ||
45 | enum vpfe_ccdc_sample_line { | ||
46 | VPFE_CCDC_SAMPLE_1LINES = 0, | ||
47 | VPFE_CCDC_SAMPLE_2LINES, | ||
48 | VPFE_CCDC_SAMPLE_4LINES, | ||
49 | VPFE_CCDC_SAMPLE_8LINES, | ||
50 | VPFE_CCDC_SAMPLE_16LINES, | ||
51 | }; | ||
52 | |||
53 | /* enum for Alaw gamma width */ | ||
54 | enum vpfe_ccdc_gamma_width { | ||
55 | VPFE_CCDC_GAMMA_BITS_15_6 = 0, /* use bits 15-6 for gamma */ | ||
56 | VPFE_CCDC_GAMMA_BITS_14_5, | ||
57 | VPFE_CCDC_GAMMA_BITS_13_4, | ||
58 | VPFE_CCDC_GAMMA_BITS_12_3, | ||
59 | VPFE_CCDC_GAMMA_BITS_11_2, | ||
60 | VPFE_CCDC_GAMMA_BITS_10_1, | ||
61 | VPFE_CCDC_GAMMA_BITS_09_0, /* use bits 9-0 for gamma */ | ||
62 | }; | ||
63 | |||
64 | /* structure for ALaw */ | ||
65 | struct vpfe_ccdc_a_law { | ||
66 | /* Enable/disable A-Law */ | ||
67 | unsigned char enable; | ||
68 | /* Gamma Width Input */ | ||
69 | enum vpfe_ccdc_gamma_width gamma_wd; | ||
70 | }; | ||
71 | |||
72 | /* structure for Black Clamping */ | ||
73 | struct vpfe_ccdc_black_clamp { | ||
74 | unsigned char enable; | ||
75 | /* only if bClampEnable is TRUE */ | ||
76 | enum vpfe_ccdc_sample_length sample_pixel; | ||
77 | /* only if bClampEnable is TRUE */ | ||
78 | enum vpfe_ccdc_sample_line sample_ln; | ||
79 | /* only if bClampEnable is TRUE */ | ||
80 | unsigned short start_pixel; | ||
81 | /* only if bClampEnable is TRUE */ | ||
82 | unsigned short sgain; | ||
83 | /* only if bClampEnable is FALSE */ | ||
84 | unsigned short dc_sub; | ||
85 | }; | ||
86 | |||
87 | /* structure for Black Level Compensation */ | ||
88 | struct vpfe_ccdc_black_compensation { | ||
89 | /* Constant value to subtract from Red component */ | ||
90 | char r; | ||
91 | /* Constant value to subtract from Gr component */ | ||
92 | char gr; | ||
93 | /* Constant value to subtract from Blue component */ | ||
94 | char b; | ||
95 | /* Constant value to subtract from Gb component */ | ||
96 | char gb; | ||
97 | }; | ||
98 | |||
99 | /* Structure for CCDC configuration parameters for raw capture mode passed | ||
100 | * by application | ||
101 | */ | ||
102 | struct vpfe_ccdc_config_params_raw { | ||
103 | /* data size value from 8 to 16 bits */ | ||
104 | enum vpfe_ccdc_data_size data_sz; | ||
105 | /* Structure for Optional A-Law */ | ||
106 | struct vpfe_ccdc_a_law alaw; | ||
107 | /* Structure for Optical Black Clamp */ | ||
108 | struct vpfe_ccdc_black_clamp blk_clamp; | ||
109 | /* Structure for Black Compensation */ | ||
110 | struct vpfe_ccdc_black_compensation blk_comp; | ||
111 | }; | ||
112 | |||
113 | /* | ||
114 | * Private IOCTL | ||
115 | * VIDIOC_AM437X_CCDC_CFG - Set CCDC configuration for raw capture | ||
116 | * This is an experimental ioctl that will change in future kernels. So use | ||
117 | * this ioctl with care ! | ||
118 | **/ | ||
119 | #define VIDIOC_AM437X_CCDC_CFG \ | ||
120 | _IOW('V', BASE_VIDIOC_PRIVATE + 1, void *) | ||
121 | |||
122 | #endif /* AM437X_VPFE_USER_H */ | ||
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h index 611e1c5893b4..b6dec05c7196 100644 --- a/include/uapi/linux/btrfs.h +++ b/include/uapi/linux/btrfs.h | |||
@@ -495,8 +495,7 @@ struct btrfs_ioctl_send_args { | |||
495 | 495 | ||
496 | /* Error codes as returned by the kernel */ | 496 | /* Error codes as returned by the kernel */ |
497 | enum btrfs_err_code { | 497 | enum btrfs_err_code { |
498 | notused, | 498 | BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1, |
499 | BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET, | ||
500 | BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET, | 499 | BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET, |
501 | BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET, | 500 | BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET, |
502 | BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET, | 501 | BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET, |
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h index a570d7b5796c..889f3a5b7b18 100644 --- a/include/uapi/linux/dm-ioctl.h +++ b/include/uapi/linux/dm-ioctl.h | |||
@@ -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 29 | 270 | #define DM_VERSION_MINOR 30 |
271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 0 |
272 | #define DM_VERSION_EXTRA "-ioctl (2014-10-28)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2014-12-22)" |
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 */ |
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 5f66d9c2889d..2e49fc880d29 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h | |||
@@ -139,6 +139,7 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) | |||
139 | 139 | ||
140 | #define ETHTOOL_FWVERS_LEN 32 | 140 | #define ETHTOOL_FWVERS_LEN 32 |
141 | #define ETHTOOL_BUSINFO_LEN 32 | 141 | #define ETHTOOL_BUSINFO_LEN 32 |
142 | #define ETHTOOL_EROMVERS_LEN 32 | ||
142 | 143 | ||
143 | /** | 144 | /** |
144 | * struct ethtool_drvinfo - general driver and device information | 145 | * struct ethtool_drvinfo - general driver and device information |
@@ -148,6 +149,7 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) | |||
148 | * not be an empty string. | 149 | * not be an empty string. |
149 | * @version: Driver version string; may be an empty string | 150 | * @version: Driver version string; may be an empty string |
150 | * @fw_version: Firmware version string; may be an empty string | 151 | * @fw_version: Firmware version string; may be an empty string |
152 | * @erom_version: Expansion ROM version string; may be an empty string | ||
151 | * @bus_info: Device bus address. This should match the dev_name() | 153 | * @bus_info: Device bus address. This should match the dev_name() |
152 | * string for the underlying bus device, if there is one. May be | 154 | * string for the underlying bus device, if there is one. May be |
153 | * an empty string. | 155 | * an empty string. |
@@ -176,7 +178,7 @@ struct ethtool_drvinfo { | |||
176 | char version[32]; | 178 | char version[32]; |
177 | char fw_version[ETHTOOL_FWVERS_LEN]; | 179 | char fw_version[ETHTOOL_FWVERS_LEN]; |
178 | char bus_info[ETHTOOL_BUSINFO_LEN]; | 180 | char bus_info[ETHTOOL_BUSINFO_LEN]; |
179 | char reserved1[32]; | 181 | char erom_version[ETHTOOL_EROMVERS_LEN]; |
180 | char reserved2[12]; | 182 | char reserved2[12]; |
181 | __u32 n_priv_flags; | 183 | __u32 n_priv_flags; |
182 | __u32 n_stats; | 184 | __u32 n_stats; |
diff --git a/include/uapi/linux/fou.h b/include/uapi/linux/fou.h index 8df06894da23..c303588bb767 100644 --- a/include/uapi/linux/fou.h +++ b/include/uapi/linux/fou.h | |||
@@ -14,6 +14,7 @@ enum { | |||
14 | FOU_ATTR_AF, /* u8 */ | 14 | FOU_ATTR_AF, /* u8 */ |
15 | FOU_ATTR_IPPROTO, /* u8 */ | 15 | FOU_ATTR_IPPROTO, /* u8 */ |
16 | FOU_ATTR_TYPE, /* u8 */ | 16 | FOU_ATTR_TYPE, /* u8 */ |
17 | FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */ | ||
17 | 18 | ||
18 | __FOU_ATTR_MAX, | 19 | __FOU_ATTR_MAX, |
19 | }; | 20 | }; |
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 3735fa0a6784..9b964a5920af 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h | |||
@@ -90,6 +90,7 @@ struct inodes_stat_t { | |||
90 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 90 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
91 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 91 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
92 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 92 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
93 | #define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */ | ||
93 | 94 | ||
94 | /* These sb flags are internal to the kernel */ | 95 | /* These sb flags are internal to the kernel */ |
95 | #define MS_NOSEC (1<<28) | 96 | #define MS_NOSEC (1<<28) |
@@ -100,7 +101,8 @@ struct inodes_stat_t { | |||
100 | /* | 101 | /* |
101 | * Superblock flags that can be altered by MS_REMOUNT | 102 | * Superblock flags that can be altered by MS_REMOUNT |
102 | */ | 103 | */ |
103 | #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION) | 104 | #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\ |
105 | MS_LAZYTIME) | ||
104 | 106 | ||
105 | /* | 107 | /* |
106 | * Old magic mount flag and mask | 108 | * Old magic mount flag and mask |
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index b03ee8f62d3c..eaaea6208b42 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
@@ -125,6 +125,8 @@ enum { | |||
125 | #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */ | 125 | #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */ |
126 | #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */ | 126 | #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */ |
127 | #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */ | 127 | #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */ |
128 | #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */ | ||
129 | #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */ | ||
128 | 130 | ||
129 | struct bridge_vlan_info { | 131 | struct bridge_vlan_info { |
130 | __u16 flags; | 132 | __u16 flags; |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index f7d0d2d7173a..dfd0bb22e554 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -146,6 +146,7 @@ enum { | |||
146 | IFLA_PHYS_PORT_ID, | 146 | IFLA_PHYS_PORT_ID, |
147 | IFLA_CARRIER_CHANGES, | 147 | IFLA_CARRIER_CHANGES, |
148 | IFLA_PHYS_SWITCH_ID, | 148 | IFLA_PHYS_SWITCH_ID, |
149 | IFLA_LINK_NETNSID, | ||
149 | __IFLA_MAX | 150 | __IFLA_MAX |
150 | }; | 151 | }; |
151 | 152 | ||
@@ -370,6 +371,10 @@ enum { | |||
370 | IFLA_VXLAN_UDP_CSUM, | 371 | IFLA_VXLAN_UDP_CSUM, |
371 | IFLA_VXLAN_UDP_ZERO_CSUM6_TX, | 372 | IFLA_VXLAN_UDP_ZERO_CSUM6_TX, |
372 | IFLA_VXLAN_UDP_ZERO_CSUM6_RX, | 373 | IFLA_VXLAN_UDP_ZERO_CSUM6_RX, |
374 | IFLA_VXLAN_REMCSUM_TX, | ||
375 | IFLA_VXLAN_REMCSUM_RX, | ||
376 | IFLA_VXLAN_GBP, | ||
377 | IFLA_VXLAN_REMCSUM_NOPARTIAL, | ||
373 | __IFLA_VXLAN_MAX | 378 | __IFLA_VXLAN_MAX |
374 | }; | 379 | }; |
375 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 380 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h index c33a65e3d62c..589ced069e8a 100644 --- a/include/uapi/linux/in.h +++ b/include/uapi/linux/in.h | |||
@@ -109,6 +109,7 @@ struct in_addr { | |||
109 | 109 | ||
110 | #define IP_MINTTL 21 | 110 | #define IP_MINTTL 21 |
111 | #define IP_NODEFRAG 22 | 111 | #define IP_NODEFRAG 22 |
112 | #define IP_CHECKSUM 23 | ||
112 | 113 | ||
113 | /* IP_MTU_DISCOVER values */ | 114 | /* IP_MTU_DISCOVER values */ |
114 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 115 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a1d7e931ab72..b0a813079852 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
@@ -166,6 +166,7 @@ struct input_keymap_entry { | |||
166 | #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ | 166 | #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ |
167 | #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ | 167 | #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ |
168 | #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ | 168 | #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ |
169 | #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ | ||
169 | 170 | ||
170 | #define INPUT_PROP_MAX 0x1f | 171 | #define INPUT_PROP_MAX 0x1f |
171 | #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) | 172 | #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) |
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index e863d088b9a5..437a6a4b125a 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _UAPI_IPV6_H | 1 | #ifndef _UAPI_IPV6_H |
2 | #define _UAPI_IPV6_H | 2 | #define _UAPI_IPV6_H |
3 | 3 | ||
4 | #include <linux/libc-compat.h> | ||
4 | #include <linux/types.h> | 5 | #include <linux/types.h> |
5 | #include <linux/in6.h> | 6 | #include <linux/in6.h> |
6 | #include <asm/byteorder.h> | 7 | #include <asm/byteorder.h> |
@@ -15,16 +16,19 @@ | |||
15 | * *under construction* | 16 | * *under construction* |
16 | */ | 17 | */ |
17 | 18 | ||
18 | 19 | #if __UAPI_DEF_IN6_PKTINFO | |
19 | struct in6_pktinfo { | 20 | struct in6_pktinfo { |
20 | struct in6_addr ipi6_addr; | 21 | struct in6_addr ipi6_addr; |
21 | int ipi6_ifindex; | 22 | int ipi6_ifindex; |
22 | }; | 23 | }; |
24 | #endif | ||
23 | 25 | ||
26 | #if __UAPI_DEF_IP6_MTUINFO | ||
24 | struct ip6_mtuinfo { | 27 | struct ip6_mtuinfo { |
25 | struct sockaddr_in6 ip6m_addr; | 28 | struct sockaddr_in6 ip6m_addr; |
26 | __u32 ip6m_mtu; | 29 | __u32 ip6m_mtu; |
27 | }; | 30 | }; |
31 | #endif | ||
28 | 32 | ||
29 | struct in6_ifreq { | 33 | struct in6_ifreq { |
30 | struct in6_addr ifr6_addr; | 34 | struct in6_addr ifr6_addr; |
@@ -165,6 +169,7 @@ enum { | |||
165 | DEVCONF_SUPPRESS_FRAG_NDISC, | 169 | DEVCONF_SUPPRESS_FRAG_NDISC, |
166 | DEVCONF_ACCEPT_RA_FROM_LOCAL, | 170 | DEVCONF_ACCEPT_RA_FROM_LOCAL, |
167 | DEVCONF_USE_OPTIMISTIC, | 171 | DEVCONF_USE_OPTIMISTIC, |
172 | DEVCONF_ACCEPT_RA_MTU, | ||
168 | DEVCONF_MAX | 173 | DEVCONF_MAX |
169 | }; | 174 | }; |
170 | 175 | ||
diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h index 2f96d233c980..a6c4962e5d46 100644 --- a/include/uapi/linux/kernel-page-flags.h +++ b/include/uapi/linux/kernel-page-flags.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define KPF_KSM 21 | 32 | #define KPF_KSM 21 |
33 | #define KPF_THP 22 | 33 | #define KPF_THP 22 |
34 | #define KPF_BALLOON 23 | 34 | #define KPF_BALLOON 23 |
35 | #define KPF_ZERO_PAGE 24 | ||
35 | 36 | ||
36 | 37 | ||
37 | #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ | 38 | #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ |
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h index 6925f5b42f89..99048e501b88 100644 --- a/include/uapi/linux/kexec.h +++ b/include/uapi/linux/kexec.h | |||
@@ -55,12 +55,6 @@ struct kexec_segment { | |||
55 | size_t memsz; | 55 | size_t memsz; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* Load a new kernel image as described by the kexec_segment array | ||
59 | * consisting of passed number of segments at the entry-point address. | ||
60 | * The flags allow different useage types. | ||
61 | */ | ||
62 | extern int kexec_load(void *, size_t, struct kexec_segment *, | ||
63 | unsigned long int); | ||
64 | #endif /* __KERNEL__ */ | 58 | #endif /* __KERNEL__ */ |
65 | 59 | ||
66 | #endif /* _UAPILINUX_KEXEC_H */ | 60 | #endif /* _UAPILINUX_KEXEC_H */ |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index a37fd1224f36..805570650062 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -491,6 +491,11 @@ struct kvm_s390_emerg_info { | |||
491 | __u16 code; | 491 | __u16 code; |
492 | }; | 492 | }; |
493 | 493 | ||
494 | #define KVM_S390_STOP_FLAG_STORE_STATUS 0x01 | ||
495 | struct kvm_s390_stop_info { | ||
496 | __u32 flags; | ||
497 | }; | ||
498 | |||
494 | struct kvm_s390_mchk_info { | 499 | struct kvm_s390_mchk_info { |
495 | __u64 cr14; | 500 | __u64 cr14; |
496 | __u64 mcic; | 501 | __u64 mcic; |
@@ -509,6 +514,7 @@ struct kvm_s390_irq { | |||
509 | struct kvm_s390_emerg_info emerg; | 514 | struct kvm_s390_emerg_info emerg; |
510 | struct kvm_s390_extcall_info extcall; | 515 | struct kvm_s390_extcall_info extcall; |
511 | struct kvm_s390_prefix_info prefix; | 516 | struct kvm_s390_prefix_info prefix; |
517 | struct kvm_s390_stop_info stop; | ||
512 | struct kvm_s390_mchk_info mchk; | 518 | struct kvm_s390_mchk_info mchk; |
513 | char reserved[64]; | 519 | char reserved[64]; |
514 | } u; | 520 | } u; |
@@ -753,6 +759,7 @@ struct kvm_ppc_smmu_info { | |||
753 | #define KVM_CAP_PPC_FIXUP_HCALL 103 | 759 | #define KVM_CAP_PPC_FIXUP_HCALL 103 |
754 | #define KVM_CAP_PPC_ENABLE_HCALL 104 | 760 | #define KVM_CAP_PPC_ENABLE_HCALL 104 |
755 | #define KVM_CAP_CHECK_EXTENSION_VM 105 | 761 | #define KVM_CAP_CHECK_EXTENSION_VM 105 |
762 | #define KVM_CAP_S390_USER_SIGP 106 | ||
756 | 763 | ||
757 | #ifdef KVM_CAP_IRQ_ROUTING | 764 | #ifdef KVM_CAP_IRQ_ROUTING |
758 | 765 | ||
@@ -952,6 +959,8 @@ enum kvm_device_type { | |||
952 | #define KVM_DEV_TYPE_ARM_VGIC_V2 KVM_DEV_TYPE_ARM_VGIC_V2 | 959 | #define KVM_DEV_TYPE_ARM_VGIC_V2 KVM_DEV_TYPE_ARM_VGIC_V2 |
953 | KVM_DEV_TYPE_FLIC, | 960 | KVM_DEV_TYPE_FLIC, |
954 | #define KVM_DEV_TYPE_FLIC KVM_DEV_TYPE_FLIC | 961 | #define KVM_DEV_TYPE_FLIC KVM_DEV_TYPE_FLIC |
962 | KVM_DEV_TYPE_ARM_VGIC_V3, | ||
963 | #define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V3 | ||
955 | KVM_DEV_TYPE_MAX, | 964 | KVM_DEV_TYPE_MAX, |
956 | }; | 965 | }; |
957 | 966 | ||
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h index 21caa2631c20..347ef22a964e 100644 --- a/include/uapi/linux/l2tp.h +++ b/include/uapi/linux/l2tp.h | |||
@@ -178,5 +178,6 @@ enum l2tp_seqmode { | |||
178 | */ | 178 | */ |
179 | #define L2TP_GENL_NAME "l2tp" | 179 | #define L2TP_GENL_NAME "l2tp" |
180 | #define L2TP_GENL_VERSION 0x1 | 180 | #define L2TP_GENL_VERSION 0x1 |
181 | #define L2TP_GENL_MCGROUP "l2tp" | ||
181 | 182 | ||
182 | #endif /* _UAPI_LINUX_L2TP_H_ */ | 183 | #endif /* _UAPI_LINUX_L2TP_H_ */ |
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index e28807ad17fa..fa673e9cc040 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h | |||
@@ -70,6 +70,8 @@ | |||
70 | #define __UAPI_DEF_IPV6_MREQ 0 | 70 | #define __UAPI_DEF_IPV6_MREQ 0 |
71 | #define __UAPI_DEF_IPPROTO_V6 0 | 71 | #define __UAPI_DEF_IPPROTO_V6 0 |
72 | #define __UAPI_DEF_IPV6_OPTIONS 0 | 72 | #define __UAPI_DEF_IPV6_OPTIONS 0 |
73 | #define __UAPI_DEF_IN6_PKTINFO 0 | ||
74 | #define __UAPI_DEF_IP6_MTUINFO 0 | ||
73 | 75 | ||
74 | #else | 76 | #else |
75 | 77 | ||
@@ -84,6 +86,8 @@ | |||
84 | #define __UAPI_DEF_IPV6_MREQ 1 | 86 | #define __UAPI_DEF_IPV6_MREQ 1 |
85 | #define __UAPI_DEF_IPPROTO_V6 1 | 87 | #define __UAPI_DEF_IPPROTO_V6 1 |
86 | #define __UAPI_DEF_IPV6_OPTIONS 1 | 88 | #define __UAPI_DEF_IPV6_OPTIONS 1 |
89 | #define __UAPI_DEF_IN6_PKTINFO 1 | ||
90 | #define __UAPI_DEF_IP6_MTUINFO 1 | ||
87 | 91 | ||
88 | #endif /* _NETINET_IN_H */ | 92 | #endif /* _NETINET_IN_H */ |
89 | 93 | ||
@@ -106,6 +110,8 @@ | |||
106 | #define __UAPI_DEF_IPV6_MREQ 1 | 110 | #define __UAPI_DEF_IPV6_MREQ 1 |
107 | #define __UAPI_DEF_IPPROTO_V6 1 | 111 | #define __UAPI_DEF_IPPROTO_V6 1 |
108 | #define __UAPI_DEF_IPV6_OPTIONS 1 | 112 | #define __UAPI_DEF_IPV6_OPTIONS 1 |
113 | #define __UAPI_DEF_IN6_PKTINFO 1 | ||
114 | #define __UAPI_DEF_IP6_MTUINFO 1 | ||
109 | 115 | ||
110 | /* Definitions for xattr.h */ | 116 | /* Definitions for xattr.h */ |
111 | #define __UAPI_DEF_XATTR 1 | 117 | #define __UAPI_DEF_XATTR 1 |
diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h index 0d11c3dcd3a1..9cd8b21dddbe 100644 --- a/include/uapi/linux/mempolicy.h +++ b/include/uapi/linux/mempolicy.h | |||
@@ -67,7 +67,7 @@ enum mpol_rebind_step { | |||
67 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ | 67 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ |
68 | #define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */ | 68 | #define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */ |
69 | #define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */ | 69 | #define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */ |
70 | #define MPOL_F_MORON (1 << 4) /* Migrate On pte_numa Reference On Node */ | 70 | #define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */ |
71 | 71 | ||
72 | 72 | ||
73 | #endif /* _UAPI_LINUX_MEMPOLICY_H */ | 73 | #endif /* _UAPI_LINUX_MEMPOLICY_H */ |
diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h index e284ff919d6e..e956704f5fb1 100644 --- a/include/uapi/linux/msdos_fs.h +++ b/include/uapi/linux/msdos_fs.h | |||
@@ -134,7 +134,7 @@ struct fat_boot_sector { | |||
134 | __u8 vol_id[4]; /* volume ID */ | 134 | __u8 vol_id[4]; /* volume ID */ |
135 | __u8 vol_label[11]; /* volume label */ | 135 | __u8 vol_label[11]; /* volume label */ |
136 | __u8 fs_type[8]; /* file system type */ | 136 | __u8 fs_type[8]; /* file system type */ |
137 | /* other fiealds are not added here */ | 137 | /* other fields are not added here */ |
138 | } fat16; | 138 | } fat16; |
139 | 139 | ||
140 | struct { | 140 | struct { |
@@ -157,7 +157,7 @@ struct fat_boot_sector { | |||
157 | __u8 vol_id[4]; /* volume ID */ | 157 | __u8 vol_id[4]; /* volume ID */ |
158 | __u8 vol_label[11]; /* volume label */ | 158 | __u8 vol_label[11]; /* volume label */ |
159 | __u8 fs_type[8]; /* file system type */ | 159 | __u8 fs_type[8]; /* file system type */ |
160 | /* other fiealds are not added here */ | 160 | /* other fields are not added here */ |
161 | } fat32; | 161 | } fat32; |
162 | }; | 162 | }; |
163 | }; | 163 | }; |
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h index f3d77f9f1e0b..3873a35509aa 100644 --- a/include/uapi/linux/neighbour.h +++ b/include/uapi/linux/neighbour.h | |||
@@ -25,6 +25,7 @@ enum { | |||
25 | NDA_VNI, | 25 | NDA_VNI, |
26 | NDA_IFINDEX, | 26 | NDA_IFINDEX, |
27 | NDA_MASTER, | 27 | NDA_MASTER, |
28 | NDA_LINK_NETNSID, | ||
28 | __NDA_MAX | 29 | __NDA_MAX |
29 | }; | 30 | }; |
30 | 31 | ||
diff --git a/include/uapi/linux/net_namespace.h b/include/uapi/linux/net_namespace.h new file mode 100644 index 000000000000..778cd2c3ebf4 --- /dev/null +++ b/include/uapi/linux/net_namespace.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* Copyright (c) 2015 6WIND S.A. | ||
2 | * Author: Nicolas Dichtel <nicolas.dichtel@6wind.com> | ||
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 | #ifndef _UAPI_LINUX_NET_NAMESPACE_H_ | ||
9 | #define _UAPI_LINUX_NET_NAMESPACE_H_ | ||
10 | |||
11 | /* Attributes of RTM_NEWNSID/RTM_GETNSID messages */ | ||
12 | enum { | ||
13 | NETNSA_NONE, | ||
14 | #define NETNSA_NSID_NOT_ASSIGNED -1 | ||
15 | NETNSA_NSID, | ||
16 | NETNSA_PID, | ||
17 | NETNSA_FD, | ||
18 | __NETNSA_MAX, | ||
19 | }; | ||
20 | |||
21 | #define NETNSA_MAX (__NETNSA_MAX - 1) | ||
22 | |||
23 | #endif /* _UAPI_LINUX_NET_NAMESPACE_H_ */ | ||
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h index edbc888ceb51..6d1abea9746e 100644 --- a/include/uapi/linux/net_tstamp.h +++ b/include/uapi/linux/net_tstamp.h | |||
@@ -24,8 +24,9 @@ enum { | |||
24 | SOF_TIMESTAMPING_TX_SCHED = (1<<8), | 24 | SOF_TIMESTAMPING_TX_SCHED = (1<<8), |
25 | SOF_TIMESTAMPING_TX_ACK = (1<<9), | 25 | SOF_TIMESTAMPING_TX_ACK = (1<<9), |
26 | SOF_TIMESTAMPING_OPT_CMSG = (1<<10), | 26 | SOF_TIMESTAMPING_OPT_CMSG = (1<<10), |
27 | SOF_TIMESTAMPING_OPT_TSONLY = (1<<11), | ||
27 | 28 | ||
28 | SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_CMSG, | 29 | SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TSONLY, |
29 | SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | | 30 | SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | |
30 | SOF_TIMESTAMPING_LAST | 31 | SOF_TIMESTAMPING_LAST |
31 | }; | 32 | }; |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 8119255feae4..c1e2e63cf9b5 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -183,6 +183,7 @@ enum nfc_attrs { | |||
183 | NFC_ATTR_SE_APDU, | 183 | NFC_ATTR_SE_APDU, |
184 | NFC_ATTR_TARGET_ISO15693_DSFID, | 184 | NFC_ATTR_TARGET_ISO15693_DSFID, |
185 | NFC_ATTR_TARGET_ISO15693_UID, | 185 | NFC_ATTR_TARGET_ISO15693_UID, |
186 | NFC_ATTR_SE_PARAMS, | ||
186 | /* private: internal use only */ | 187 | /* private: internal use only */ |
187 | __NFC_ATTR_AFTER_LAST | 188 | __NFC_ATTR_AFTER_LAST |
188 | }; | 189 | }; |
diff --git a/include/uapi/linux/nfsd/debug.h b/include/uapi/linux/nfsd/debug.h index 1fdc95bb2375..0bf130a1c58d 100644 --- a/include/uapi/linux/nfsd/debug.h +++ b/include/uapi/linux/nfsd/debug.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define NFSDDBG_REPCACHE 0x0080 | 32 | #define NFSDDBG_REPCACHE 0x0080 |
33 | #define NFSDDBG_XDR 0x0100 | 33 | #define NFSDDBG_XDR 0x0100 |
34 | #define NFSDDBG_LOCKD 0x0200 | 34 | #define NFSDDBG_LOCKD 0x0200 |
35 | #define NFSDDBG_PNFS 0x0400 | ||
35 | #define NFSDDBG_ALL 0x7FFF | 36 | #define NFSDDBG_ALL 0x7FFF |
36 | #define NFSDDBG_NOCHANGE 0xFFFF | 37 | #define NFSDDBG_NOCHANGE 0xFFFF |
37 | 38 | ||
diff --git a/include/uapi/linux/nfsd/export.h b/include/uapi/linux/nfsd/export.h index 584b6ef3a5e8..4742f2cb42f2 100644 --- a/include/uapi/linux/nfsd/export.h +++ b/include/uapi/linux/nfsd/export.h | |||
@@ -47,8 +47,10 @@ | |||
47 | * exported filesystem. | 47 | * exported filesystem. |
48 | */ | 48 | */ |
49 | #define NFSEXP_V4ROOT 0x10000 | 49 | #define NFSEXP_V4ROOT 0x10000 |
50 | #define NFSEXP_NOPNFS 0x20000 | ||
51 | |||
50 | /* All flags that we claim to support. (Note we don't support NOACL.) */ | 52 | /* All flags that we claim to support. (Note we don't support NOACL.) */ |
51 | #define NFSEXP_ALLFLAGS 0x1FE7F | 53 | #define NFSEXP_ALLFLAGS 0x3FE7F |
52 | 54 | ||
53 | /* The flags that may vary depending on security flavor: */ | 55 | /* The flags that may vary depending on security flavor: */ |
54 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ | 56 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index b37bd5a1cb82..68b294e83944 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -29,6 +29,13 @@ | |||
29 | 29 | ||
30 | #define NL80211_GENL_NAME "nl80211" | 30 | #define NL80211_GENL_NAME "nl80211" |
31 | 31 | ||
32 | #define NL80211_MULTICAST_GROUP_CONFIG "config" | ||
33 | #define NL80211_MULTICAST_GROUP_SCAN "scan" | ||
34 | #define NL80211_MULTICAST_GROUP_REG "regulatory" | ||
35 | #define NL80211_MULTICAST_GROUP_MLME "mlme" | ||
36 | #define NL80211_MULTICAST_GROUP_VENDOR "vendor" | ||
37 | #define NL80211_MULTICAST_GROUP_TESTMODE "testmode" | ||
38 | |||
32 | /** | 39 | /** |
33 | * DOC: Station handling | 40 | * DOC: Station handling |
34 | * | 41 | * |
@@ -173,8 +180,8 @@ | |||
173 | * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME. | 180 | * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME. |
174 | * | 181 | * |
175 | * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration; | 182 | * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration; |
176 | * either a dump request on a %NL80211_ATTR_WIPHY or a specific get | 183 | * either a dump request for all interfaces or a specific get with a |
177 | * on an %NL80211_ATTR_IFINDEX is supported. | 184 | * single %NL80211_ATTR_IFINDEX is supported. |
178 | * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires | 185 | * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires |
179 | * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE. | 186 | * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE. |
180 | * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response | 187 | * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response |
@@ -252,7 +259,18 @@ | |||
252 | * %NL80211_ATTR_IFINDEX. | 259 | * %NL80211_ATTR_IFINDEX. |
253 | * | 260 | * |
254 | * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set | 261 | * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set |
255 | * regulatory domain. | 262 | * regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device |
263 | * has a private regulatory domain, it will be returned. Otherwise, the | ||
264 | * global regdomain will be returned. | ||
265 | * A device will have a private regulatory domain if it uses the | ||
266 | * regulatory_hint() API. Even when a private regdomain is used the channel | ||
267 | * information will still be mended according to further hints from | ||
268 | * the regulatory core to help with compliance. A dump version of this API | ||
269 | * is now available which will returns the global regdomain as well as | ||
270 | * all private regdomains of present wiphys (for those that have it). | ||
271 | * If a wiphy is self-managed (%NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then | ||
272 | * its private regdomain is the only valid one for it. The regulatory | ||
273 | * core is not used to help with compliance in this case. | ||
256 | * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command | 274 | * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command |
257 | * after being queried by the kernel. CRDA replies by sending a regulatory | 275 | * after being queried by the kernel. CRDA replies by sending a regulatory |
258 | * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our | 276 | * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our |
@@ -306,7 +324,9 @@ | |||
306 | * if passed, define which channels should be scanned; if not | 324 | * if passed, define which channels should be scanned; if not |
307 | * passed, all channels allowed for the current regulatory domain | 325 | * passed, all channels allowed for the current regulatory domain |
308 | * are used. Extra IEs can also be passed from the userspace by | 326 | * are used. Extra IEs can also be passed from the userspace by |
309 | * using the %NL80211_ATTR_IE attribute. | 327 | * using the %NL80211_ATTR_IE attribute. The first cycle of the |
328 | * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY | ||
329 | * is supplied. | ||
310 | * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if | 330 | * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if |
311 | * scheduled scan is not running. The caller may assume that as soon | 331 | * scheduled scan is not running. The caller may assume that as soon |
312 | * as the call returns, it is safe to start a new scheduled scan again. | 332 | * as the call returns, it is safe to start a new scheduled scan again. |
@@ -774,6 +794,10 @@ | |||
774 | * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel | 794 | * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel |
775 | * when this command completes. | 795 | * when this command completes. |
776 | * | 796 | * |
797 | * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used | ||
798 | * as an event to indicate changes for devices with wiphy-specific regdom | ||
799 | * management. | ||
800 | * | ||
777 | * @NL80211_CMD_MAX: highest used command number | 801 | * @NL80211_CMD_MAX: highest used command number |
778 | * @__NL80211_CMD_AFTER_LAST: internal use | 802 | * @__NL80211_CMD_AFTER_LAST: internal use |
779 | */ | 803 | */ |
@@ -958,6 +982,8 @@ enum nl80211_commands { | |||
958 | NL80211_CMD_TDLS_CHANNEL_SWITCH, | 982 | NL80211_CMD_TDLS_CHANNEL_SWITCH, |
959 | NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, | 983 | NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, |
960 | 984 | ||
985 | NL80211_CMD_WIPHY_REG_CHANGE, | ||
986 | |||
961 | /* add new commands above here */ | 987 | /* add new commands above here */ |
962 | 988 | ||
963 | /* used to define NL80211_CMD_MAX below */ | 989 | /* used to define NL80211_CMD_MAX below */ |
@@ -1655,6 +1681,9 @@ enum nl80211_commands { | |||
1655 | * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface | 1681 | * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface |
1656 | * creation then the new interface will be owned by the netlink socket | 1682 | * creation then the new interface will be owned by the netlink socket |
1657 | * that created it and will be destroyed when the socket is closed. | 1683 | * that created it and will be destroyed when the socket is closed. |
1684 | * If set during scheduled scan start then the new scan req will be | ||
1685 | * owned by the netlink socket that created it and the scheduled scan will | ||
1686 | * be stopped when the socket is closed. | ||
1658 | * | 1687 | * |
1659 | * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is | 1688 | * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is |
1660 | * the TDLS link initiator. | 1689 | * the TDLS link initiator. |
@@ -1688,6 +1717,29 @@ enum nl80211_commands { | |||
1688 | * | 1717 | * |
1689 | * @NL80211_ATTR_MAC_MASK: MAC address mask | 1718 | * @NL80211_ATTR_MAC_MASK: MAC address mask |
1690 | * | 1719 | * |
1720 | * @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating this device | ||
1721 | * is self-managing its regulatory information and any regulatory domain | ||
1722 | * obtained from it is coming from the device's wiphy and not the global | ||
1723 | * cfg80211 regdomain. | ||
1724 | * | ||
1725 | * @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte | ||
1726 | * array. The feature flags are identified by their bit index (see &enum | ||
1727 | * nl80211_ext_feature_index). The bit index is ordered starting at the | ||
1728 | * least-significant bit of the first byte in the array, ie. bit index 0 | ||
1729 | * is located at bit 0 of byte 0. bit index 25 would be located at bit 1 | ||
1730 | * of byte 3 (u8 array). | ||
1731 | * | ||
1732 | * @NL80211_ATTR_SURVEY_RADIO_STATS: Request overall radio statistics to be | ||
1733 | * returned along with other survey data. If set, @NL80211_CMD_GET_SURVEY | ||
1734 | * may return a survey entry without a channel indicating global radio | ||
1735 | * statistics (only some values are valid and make sense.) | ||
1736 | * For devices that don't return such an entry even then, the information | ||
1737 | * should be contained in the result as the sum of the respective counters | ||
1738 | * over all channels. | ||
1739 | * | ||
1740 | * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before a scheduled scan (or a | ||
1741 | * WoWLAN net-detect scan) is started, u32 in seconds. | ||
1742 | * | ||
1691 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available | 1743 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
1692 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1744 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1693 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1745 | * @__NL80211_ATTR_AFTER_LAST: internal use |
@@ -2045,6 +2097,16 @@ enum nl80211_attrs { | |||
2045 | 2097 | ||
2046 | NL80211_ATTR_MAC_MASK, | 2098 | NL80211_ATTR_MAC_MASK, |
2047 | 2099 | ||
2100 | NL80211_ATTR_WIPHY_SELF_MANAGED_REG, | ||
2101 | |||
2102 | NL80211_ATTR_EXT_FEATURES, | ||
2103 | |||
2104 | NL80211_ATTR_SURVEY_RADIO_STATS, | ||
2105 | |||
2106 | NL80211_ATTR_NETNS_FD, | ||
2107 | |||
2108 | NL80211_ATTR_SCHED_SCAN_DELAY, | ||
2109 | |||
2048 | /* add attributes here, update the policy in nl80211.c */ | 2110 | /* add attributes here, update the policy in nl80211.c */ |
2049 | 2111 | ||
2050 | __NL80211_ATTR_AFTER_LAST, | 2112 | __NL80211_ATTR_AFTER_LAST, |
@@ -2085,7 +2147,7 @@ enum nl80211_attrs { | |||
2085 | 2147 | ||
2086 | #define NL80211_MAX_SUPP_RATES 32 | 2148 | #define NL80211_MAX_SUPP_RATES 32 |
2087 | #define NL80211_MAX_SUPP_HT_RATES 77 | 2149 | #define NL80211_MAX_SUPP_HT_RATES 77 |
2088 | #define NL80211_MAX_SUPP_REG_RULES 32 | 2150 | #define NL80211_MAX_SUPP_REG_RULES 64 |
2089 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 | 2151 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 |
2090 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 2152 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
2091 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 2153 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
@@ -2225,8 +2287,15 @@ struct nl80211_sta_flag_update { | |||
2225 | * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) | 2287 | * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) |
2226 | * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) | 2288 | * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) |
2227 | * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate | 2289 | * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate |
2228 | * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate | 2290 | * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the |
2291 | * same as 160 for purposes of the bitrates | ||
2229 | * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate | 2292 | * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate |
2293 | * @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is | ||
2294 | * a legacy rate and will be reported as the actual bitrate, i.e. | ||
2295 | * half the base (20 MHz) rate | ||
2296 | * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is | ||
2297 | * a legacy rate and will be reported as the actual bitrate, i.e. | ||
2298 | * a quarter of the base (20 MHz) rate | ||
2230 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 2299 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
2231 | */ | 2300 | */ |
2232 | enum nl80211_rate_info { | 2301 | enum nl80211_rate_info { |
@@ -2241,6 +2310,8 @@ enum nl80211_rate_info { | |||
2241 | NL80211_RATE_INFO_80_MHZ_WIDTH, | 2310 | NL80211_RATE_INFO_80_MHZ_WIDTH, |
2242 | NL80211_RATE_INFO_80P80_MHZ_WIDTH, | 2311 | NL80211_RATE_INFO_80P80_MHZ_WIDTH, |
2243 | NL80211_RATE_INFO_160_MHZ_WIDTH, | 2312 | NL80211_RATE_INFO_160_MHZ_WIDTH, |
2313 | NL80211_RATE_INFO_10_MHZ_WIDTH, | ||
2314 | NL80211_RATE_INFO_5_MHZ_WIDTH, | ||
2244 | 2315 | ||
2245 | /* keep last */ | 2316 | /* keep last */ |
2246 | __NL80211_RATE_INFO_AFTER_LAST, | 2317 | __NL80211_RATE_INFO_AFTER_LAST, |
@@ -2285,18 +2356,24 @@ enum nl80211_sta_bss_param { | |||
2285 | * | 2356 | * |
2286 | * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved | 2357 | * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved |
2287 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) | 2358 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) |
2288 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) | 2359 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (MPDU length) |
2289 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 2360 | * (u32, from this station) |
2290 | * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station) | 2361 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (MPDU length) |
2291 | * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station) | 2362 | * (u32, to this station) |
2363 | * @NL80211_STA_INFO_RX_BYTES64: total received bytes (MPDU length) | ||
2364 | * (u64, from this station) | ||
2365 | * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (MPDU length) | ||
2366 | * (u64, to this station) | ||
2292 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | 2367 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) |
2293 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | 2368 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute |
2294 | * containing info as possible, see &enum nl80211_rate_info | 2369 | * containing info as possible, see &enum nl80211_rate_info |
2295 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) | 2370 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs) |
2296 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this | 2371 | * (u32, from this station) |
2297 | * station) | 2372 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs) |
2298 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | 2373 | * (u32, to this station) |
2299 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | 2374 | * @NL80211_STA_INFO_TX_RETRIES: total retries (MPDUs) (u32, to this station) |
2375 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (MPDUs) | ||
2376 | * (u32, to this station) | ||
2300 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) | 2377 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) |
2301 | * @NL80211_STA_INFO_LLID: the station's mesh LLID | 2378 | * @NL80211_STA_INFO_LLID: the station's mesh LLID |
2302 | * @NL80211_STA_INFO_PLID: the station's mesh PLID | 2379 | * @NL80211_STA_INFO_PLID: the station's mesh PLID |
@@ -2320,6 +2397,16 @@ enum nl80211_sta_bss_param { | |||
2320 | * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. | 2397 | * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. |
2321 | * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the | 2398 | * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the |
2322 | * 802.11 header (u32, kbps) | 2399 | * 802.11 header (u32, kbps) |
2400 | * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons | ||
2401 | * (u64) | ||
2402 | * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64) | ||
2403 | * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average | ||
2404 | * for beacons only (u8, dBm) | ||
2405 | * @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats) | ||
2406 | * This is a nested attribute where each the inner attribute number is the | ||
2407 | * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; | ||
2408 | * each one of those is again nested with &enum nl80211_tid_stats | ||
2409 | * attributes carrying the actual values. | ||
2323 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 2410 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
2324 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 2411 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
2325 | */ | 2412 | */ |
@@ -2352,6 +2439,10 @@ enum nl80211_sta_info { | |||
2352 | NL80211_STA_INFO_CHAIN_SIGNAL, | 2439 | NL80211_STA_INFO_CHAIN_SIGNAL, |
2353 | NL80211_STA_INFO_CHAIN_SIGNAL_AVG, | 2440 | NL80211_STA_INFO_CHAIN_SIGNAL_AVG, |
2354 | NL80211_STA_INFO_EXPECTED_THROUGHPUT, | 2441 | NL80211_STA_INFO_EXPECTED_THROUGHPUT, |
2442 | NL80211_STA_INFO_RX_DROP_MISC, | ||
2443 | NL80211_STA_INFO_BEACON_RX, | ||
2444 | NL80211_STA_INFO_BEACON_SIGNAL_AVG, | ||
2445 | NL80211_STA_INFO_TID_STATS, | ||
2355 | 2446 | ||
2356 | /* keep last */ | 2447 | /* keep last */ |
2357 | __NL80211_STA_INFO_AFTER_LAST, | 2448 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -2359,6 +2450,31 @@ enum nl80211_sta_info { | |||
2359 | }; | 2450 | }; |
2360 | 2451 | ||
2361 | /** | 2452 | /** |
2453 | * enum nl80211_tid_stats - per TID statistics attributes | ||
2454 | * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved | ||
2455 | * @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64) | ||
2456 | * @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or | ||
2457 | * attempted to transmit; u64) | ||
2458 | * @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for | ||
2459 | * transmitted MSDUs (not counting the first attempt; u64) | ||
2460 | * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted | ||
2461 | * MSDUs (u64) | ||
2462 | * @NUM_NL80211_TID_STATS: number of attributes here | ||
2463 | * @NL80211_TID_STATS_MAX: highest numbered attribute here | ||
2464 | */ | ||
2465 | enum nl80211_tid_stats { | ||
2466 | __NL80211_TID_STATS_INVALID, | ||
2467 | NL80211_TID_STATS_RX_MSDU, | ||
2468 | NL80211_TID_STATS_TX_MSDU, | ||
2469 | NL80211_TID_STATS_TX_MSDU_RETRIES, | ||
2470 | NL80211_TID_STATS_TX_MSDU_FAILED, | ||
2471 | |||
2472 | /* keep last */ | ||
2473 | NUM_NL80211_TID_STATS, | ||
2474 | NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1 | ||
2475 | }; | ||
2476 | |||
2477 | /** | ||
2362 | * enum nl80211_mpath_flags - nl80211 mesh path flags | 2478 | * enum nl80211_mpath_flags - nl80211 mesh path flags |
2363 | * | 2479 | * |
2364 | * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active | 2480 | * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active |
@@ -2772,16 +2888,18 @@ enum nl80211_user_reg_hint_type { | |||
2772 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel | 2888 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel |
2773 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) | 2889 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) |
2774 | * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used | 2890 | * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used |
2775 | * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio | 2891 | * @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio |
2776 | * spent on this channel | 2892 | * was turned on (on channel or globally) |
2777 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary | 2893 | * @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary |
2778 | * channel was sensed busy (either due to activity or energy detect) | 2894 | * channel was sensed busy (either due to activity or energy detect) |
2779 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension | 2895 | * @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension |
2780 | * channel was sensed busy | 2896 | * channel was sensed busy |
2781 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent | 2897 | * @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent |
2782 | * receiving data | 2898 | * receiving data (on channel or globally) |
2783 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent | 2899 | * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent |
2784 | * transmitting data | 2900 | * transmitting data (on channel or globally) |
2901 | * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan | ||
2902 | * (on this channel or globally) | ||
2785 | * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number | 2903 | * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number |
2786 | * currently defined | 2904 | * currently defined |
2787 | * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use | 2905 | * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use |
@@ -2791,17 +2909,25 @@ enum nl80211_survey_info { | |||
2791 | NL80211_SURVEY_INFO_FREQUENCY, | 2909 | NL80211_SURVEY_INFO_FREQUENCY, |
2792 | NL80211_SURVEY_INFO_NOISE, | 2910 | NL80211_SURVEY_INFO_NOISE, |
2793 | NL80211_SURVEY_INFO_IN_USE, | 2911 | NL80211_SURVEY_INFO_IN_USE, |
2794 | NL80211_SURVEY_INFO_CHANNEL_TIME, | 2912 | NL80211_SURVEY_INFO_TIME, |
2795 | NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, | 2913 | NL80211_SURVEY_INFO_TIME_BUSY, |
2796 | NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, | 2914 | NL80211_SURVEY_INFO_TIME_EXT_BUSY, |
2797 | NL80211_SURVEY_INFO_CHANNEL_TIME_RX, | 2915 | NL80211_SURVEY_INFO_TIME_RX, |
2798 | NL80211_SURVEY_INFO_CHANNEL_TIME_TX, | 2916 | NL80211_SURVEY_INFO_TIME_TX, |
2917 | NL80211_SURVEY_INFO_TIME_SCAN, | ||
2799 | 2918 | ||
2800 | /* keep last */ | 2919 | /* keep last */ |
2801 | __NL80211_SURVEY_INFO_AFTER_LAST, | 2920 | __NL80211_SURVEY_INFO_AFTER_LAST, |
2802 | NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 | 2921 | NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 |
2803 | }; | 2922 | }; |
2804 | 2923 | ||
2924 | /* keep old names for compatibility */ | ||
2925 | #define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME | ||
2926 | #define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY | ||
2927 | #define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY | ||
2928 | #define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX | ||
2929 | #define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX | ||
2930 | |||
2805 | /** | 2931 | /** |
2806 | * enum nl80211_mntr_flags - monitor configuration flags | 2932 | * enum nl80211_mntr_flags - monitor configuration flags |
2807 | * | 2933 | * |
@@ -3238,6 +3364,9 @@ enum nl80211_bss { | |||
3238 | /** | 3364 | /** |
3239 | * enum nl80211_bss_status - BSS "status" | 3365 | * enum nl80211_bss_status - BSS "status" |
3240 | * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. | 3366 | * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. |
3367 | * Note that this is no longer used since cfg80211 no longer | ||
3368 | * keeps track of whether or not authentication was done with | ||
3369 | * a given BSS. | ||
3241 | * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. | 3370 | * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. |
3242 | * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. | 3371 | * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. |
3243 | * | 3372 | * |
@@ -3621,9 +3750,12 @@ struct nl80211_pattern_support { | |||
3621 | * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network | 3750 | * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network |
3622 | * is detected. This is a nested attribute that contains the | 3751 | * is detected. This is a nested attribute that contains the |
3623 | * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It | 3752 | * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It |
3624 | * specifies how the scan is performed (e.g. the interval and the | 3753 | * specifies how the scan is performed (e.g. the interval, the |
3625 | * channels to scan) as well as the scan results that will | 3754 | * channels to scan and the initial delay) as well as the scan |
3626 | * trigger a wake (i.e. the matchsets). | 3755 | * results that will trigger a wake (i.e. the matchsets). This |
3756 | * attribute is also sent in a response to | ||
3757 | * @NL80211_CMD_GET_WIPHY, indicating the number of match sets | ||
3758 | * supported by the driver (u32). | ||
3627 | * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute | 3759 | * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute |
3628 | * containing an array with information about what triggered the | 3760 | * containing an array with information about what triggered the |
3629 | * wake up. If no elements are present in the array, it means | 3761 | * wake up. If no elements are present in the array, it means |
@@ -4194,6 +4326,19 @@ enum nl80211_feature_flags { | |||
4194 | }; | 4326 | }; |
4195 | 4327 | ||
4196 | /** | 4328 | /** |
4329 | * enum nl80211_ext_feature_index - bit index of extended features. | ||
4330 | * | ||
4331 | * @NUM_NL80211_EXT_FEATURES: number of extended features. | ||
4332 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. | ||
4333 | */ | ||
4334 | enum nl80211_ext_feature_index { | ||
4335 | |||
4336 | /* add new features before the definition below */ | ||
4337 | NUM_NL80211_EXT_FEATURES, | ||
4338 | MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1 | ||
4339 | }; | ||
4340 | |||
4341 | /** | ||
4197 | * enum nl80211_probe_resp_offload_support_attr - optional supported | 4342 | * enum nl80211_probe_resp_offload_support_attr - optional supported |
4198 | * protocols for probe-response offloading by the driver/FW. | 4343 | * protocols for probe-response offloading by the driver/FW. |
4199 | * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. | 4344 | * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. |
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h index 26386cf3db44..aef9a81b2d75 100644 --- a/include/uapi/linux/nvme.h +++ b/include/uapi/linux/nvme.h | |||
@@ -115,7 +115,13 @@ struct nvme_id_ns { | |||
115 | __le16 nawun; | 115 | __le16 nawun; |
116 | __le16 nawupf; | 116 | __le16 nawupf; |
117 | __le16 nacwu; | 117 | __le16 nacwu; |
118 | __u8 rsvd40[80]; | 118 | __le16 nabsn; |
119 | __le16 nabo; | ||
120 | __le16 nabspf; | ||
121 | __u16 rsvd46; | ||
122 | __le64 nvmcap[2]; | ||
123 | __u8 rsvd64[40]; | ||
124 | __u8 nguid[16]; | ||
119 | __u8 eui64[8]; | 125 | __u8 eui64[8]; |
120 | struct nvme_lbaf lbaf[16]; | 126 | struct nvme_lbaf lbaf[16]; |
121 | __u8 rsvd192[192]; | 127 | __u8 rsvd192[192]; |
@@ -124,10 +130,22 @@ struct nvme_id_ns { | |||
124 | 130 | ||
125 | enum { | 131 | enum { |
126 | NVME_NS_FEAT_THIN = 1 << 0, | 132 | NVME_NS_FEAT_THIN = 1 << 0, |
133 | NVME_NS_FLBAS_LBA_MASK = 0xf, | ||
134 | NVME_NS_FLBAS_META_EXT = 0x10, | ||
127 | NVME_LBAF_RP_BEST = 0, | 135 | NVME_LBAF_RP_BEST = 0, |
128 | NVME_LBAF_RP_BETTER = 1, | 136 | NVME_LBAF_RP_BETTER = 1, |
129 | NVME_LBAF_RP_GOOD = 2, | 137 | NVME_LBAF_RP_GOOD = 2, |
130 | NVME_LBAF_RP_DEGRADED = 3, | 138 | NVME_LBAF_RP_DEGRADED = 3, |
139 | NVME_NS_DPC_PI_LAST = 1 << 4, | ||
140 | NVME_NS_DPC_PI_FIRST = 1 << 3, | ||
141 | NVME_NS_DPC_PI_TYPE3 = 1 << 2, | ||
142 | NVME_NS_DPC_PI_TYPE2 = 1 << 1, | ||
143 | NVME_NS_DPC_PI_TYPE1 = 1 << 0, | ||
144 | NVME_NS_DPS_PI_FIRST = 1 << 3, | ||
145 | NVME_NS_DPS_PI_MASK = 0x7, | ||
146 | NVME_NS_DPS_PI_TYPE1 = 1, | ||
147 | NVME_NS_DPS_PI_TYPE2 = 2, | ||
148 | NVME_NS_DPS_PI_TYPE3 = 3, | ||
131 | }; | 149 | }; |
132 | 150 | ||
133 | struct nvme_smart_log { | 151 | struct nvme_smart_log { |
@@ -261,6 +279,10 @@ enum { | |||
261 | NVME_RW_DSM_LATENCY_LOW = 3 << 4, | 279 | NVME_RW_DSM_LATENCY_LOW = 3 << 4, |
262 | NVME_RW_DSM_SEQ_REQ = 1 << 6, | 280 | NVME_RW_DSM_SEQ_REQ = 1 << 6, |
263 | NVME_RW_DSM_COMPRESSED = 1 << 7, | 281 | NVME_RW_DSM_COMPRESSED = 1 << 7, |
282 | NVME_RW_PRINFO_PRCHK_REF = 1 << 10, | ||
283 | NVME_RW_PRINFO_PRCHK_APP = 1 << 11, | ||
284 | NVME_RW_PRINFO_PRCHK_GUARD = 1 << 12, | ||
285 | NVME_RW_PRINFO_PRACT = 1 << 13, | ||
264 | }; | 286 | }; |
265 | 287 | ||
266 | struct nvme_dsm_cmd { | 288 | struct nvme_dsm_cmd { |
@@ -549,6 +571,8 @@ struct nvme_passthru_cmd { | |||
549 | __u32 result; | 571 | __u32 result; |
550 | }; | 572 | }; |
551 | 573 | ||
574 | #define NVME_VS(major, minor) (((major) << 16) | ((minor) << 8)) | ||
575 | |||
552 | #define nvme_admin_cmd nvme_passthru_cmd | 576 | #define nvme_admin_cmd nvme_passthru_cmd |
553 | 577 | ||
554 | #define NVME_IOCTL_ID _IO('N', 0x40) | 578 | #define NVME_IOCTL_ID _IO('N', 0x40) |
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index f714e8633352..bbd49a0c46c7 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
@@ -252,11 +252,21 @@ enum ovs_vport_attr { | |||
252 | 252 | ||
253 | #define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) | 253 | #define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) |
254 | 254 | ||
255 | enum { | ||
256 | OVS_VXLAN_EXT_UNSPEC, | ||
257 | OVS_VXLAN_EXT_GBP, /* Flag or __u32 */ | ||
258 | __OVS_VXLAN_EXT_MAX, | ||
259 | }; | ||
260 | |||
261 | #define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1) | ||
262 | |||
263 | |||
255 | /* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. | 264 | /* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. |
256 | */ | 265 | */ |
257 | enum { | 266 | enum { |
258 | OVS_TUNNEL_ATTR_UNSPEC, | 267 | OVS_TUNNEL_ATTR_UNSPEC, |
259 | OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */ | 268 | OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */ |
269 | OVS_TUNNEL_ATTR_EXTENSION, | ||
260 | __OVS_TUNNEL_ATTR_MAX | 270 | __OVS_TUNNEL_ATTR_MAX |
261 | }; | 271 | }; |
262 | 272 | ||
@@ -328,6 +338,7 @@ enum ovs_tunnel_key_attr { | |||
328 | OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */ | 338 | OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */ |
329 | OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */ | 339 | OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */ |
330 | OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */ | 340 | OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */ |
341 | OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS, /* Nested OVS_VXLAN_EXT_* */ | ||
331 | __OVS_TUNNEL_KEY_ATTR_MAX | 342 | __OVS_TUNNEL_KEY_ATTR_MAX |
332 | }; | 343 | }; |
333 | 344 | ||
@@ -448,6 +459,14 @@ struct ovs_key_nd { | |||
448 | * a wildcarded match. Omitting attribute is treated as wildcarding all | 459 | * a wildcarded match. Omitting attribute is treated as wildcarding all |
449 | * corresponding fields. Optional for all requests. If not present, | 460 | * corresponding fields. Optional for all requests. If not present, |
450 | * all flow key bits are exact match bits. | 461 | * all flow key bits are exact match bits. |
462 | * @OVS_FLOW_ATTR_UFID: A value between 1-16 octets specifying a unique | ||
463 | * identifier for the flow. Causes the flow to be indexed by this value rather | ||
464 | * than the value of the %OVS_FLOW_ATTR_KEY attribute. Optional for all | ||
465 | * requests. Present in notifications if the flow was created with this | ||
466 | * attribute. | ||
467 | * @OVS_FLOW_ATTR_UFID_FLAGS: A 32-bit value of OR'd %OVS_UFID_F_* | ||
468 | * flags that provide alternative semantics for flow installation and | ||
469 | * retrieval. Optional for all requests. | ||
451 | * | 470 | * |
452 | * These attributes follow the &struct ovs_header within the Generic Netlink | 471 | * These attributes follow the &struct ovs_header within the Generic Netlink |
453 | * payload for %OVS_FLOW_* commands. | 472 | * payload for %OVS_FLOW_* commands. |
@@ -463,12 +482,24 @@ enum ovs_flow_attr { | |||
463 | OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ | 482 | OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ |
464 | OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error | 483 | OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error |
465 | * logging should be suppressed. */ | 484 | * logging should be suppressed. */ |
485 | OVS_FLOW_ATTR_UFID, /* Variable length unique flow identifier. */ | ||
486 | OVS_FLOW_ATTR_UFID_FLAGS,/* u32 of OVS_UFID_F_*. */ | ||
466 | __OVS_FLOW_ATTR_MAX | 487 | __OVS_FLOW_ATTR_MAX |
467 | }; | 488 | }; |
468 | 489 | ||
469 | #define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) | 490 | #define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) |
470 | 491 | ||
471 | /** | 492 | /** |
493 | * Omit attributes for notifications. | ||
494 | * | ||
495 | * If a datapath request contains an %OVS_UFID_F_OMIT_* flag, then the datapath | ||
496 | * may omit the corresponding %OVS_FLOW_ATTR_* from the response. | ||
497 | */ | ||
498 | #define OVS_UFID_F_OMIT_KEY (1 << 0) | ||
499 | #define OVS_UFID_F_OMIT_MASK (1 << 1) | ||
500 | #define OVS_UFID_F_OMIT_ACTIONS (1 << 2) | ||
501 | |||
502 | /** | ||
472 | * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. | 503 | * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. |
473 | * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with | 504 | * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with |
474 | * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of | 505 | * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of |
@@ -568,6 +599,12 @@ struct ovs_action_hash { | |||
568 | * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The | 599 | * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The |
569 | * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its | 600 | * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its |
570 | * value. | 601 | * value. |
602 | * @OVS_ACTION_ATTR_SET_MASKED: Replaces the contents of an existing header. A | ||
603 | * nested %OVS_KEY_ATTR_* attribute specifies a header to modify, its value, | ||
604 | * and a mask. For every bit set in the mask, the corresponding bit value | ||
605 | * is copied from the value to the packet header field, rest of the bits are | ||
606 | * left unchanged. The non-masked value bits must be passed in as zeroes. | ||
607 | * Masking is not supported for the %OVS_KEY_ATTR_TUNNEL attribute. | ||
571 | * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the | 608 | * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the |
572 | * packet. | 609 | * packet. |
573 | * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. | 610 | * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. |
@@ -586,6 +623,9 @@ struct ovs_action_hash { | |||
586 | * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all | 623 | * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all |
587 | * fields within a header are modifiable, e.g. the IPv4 protocol and fragment | 624 | * fields within a header are modifiable, e.g. the IPv4 protocol and fragment |
588 | * type may not be changed. | 625 | * type may not be changed. |
626 | * | ||
627 | * @OVS_ACTION_ATTR_SET_TO_MASKED: Kernel internal masked set action translated | ||
628 | * from the @OVS_ACTION_ATTR_SET. | ||
589 | */ | 629 | */ |
590 | 630 | ||
591 | enum ovs_action_attr { | 631 | enum ovs_action_attr { |
@@ -600,8 +640,19 @@ enum ovs_action_attr { | |||
600 | OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ | 640 | OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ |
601 | OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */ | 641 | OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */ |
602 | OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */ | 642 | OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */ |
643 | OVS_ACTION_ATTR_SET_MASKED, /* One nested OVS_KEY_ATTR_* including | ||
644 | * data immediately followed by a mask. | ||
645 | * The data must be zero for the unmasked | ||
646 | * bits. */ | ||
603 | 647 | ||
604 | __OVS_ACTION_ATTR_MAX | 648 | __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted |
649 | * from userspace. */ | ||
650 | |||
651 | #ifdef __KERNEL__ | ||
652 | OVS_ACTION_ATTR_SET_TO_MASKED, /* Kernel module internal masked | ||
653 | * set action converted from | ||
654 | * OVS_ACTION_ATTR_SET. */ | ||
655 | #endif | ||
605 | }; | 656 | }; |
606 | 657 | ||
607 | #define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) | 658 | #define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 4a1d0cc38ff2..efe3443572ba 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
@@ -451,6 +451,10 @@ | |||
451 | #define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ | 451 | #define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ |
452 | #define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */ | 452 | #define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */ |
453 | #define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ | 453 | #define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ |
454 | #define PCI_EXP_DEVCTL_READRQ_128B 0x0000 /* 128 Bytes */ | ||
455 | #define PCI_EXP_DEVCTL_READRQ_256B 0x1000 /* 256 Bytes */ | ||
456 | #define PCI_EXP_DEVCTL_READRQ_512B 0x2000 /* 512 Bytes */ | ||
457 | #define PCI_EXP_DEVCTL_READRQ_1024B 0x3000 /* 1024 Bytes */ | ||
454 | #define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */ | 458 | #define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */ |
455 | #define PCI_EXP_DEVSTA 10 /* Device Status */ | 459 | #define PCI_EXP_DEVSTA 10 /* Device Status */ |
456 | #define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */ | 460 | #define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */ |
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index d62316baae94..534b84710745 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h | |||
@@ -774,6 +774,8 @@ enum { | |||
774 | 774 | ||
775 | TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ | 775 | TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ |
776 | 776 | ||
777 | TCA_FQ_ORPHAN_MASK, /* mask applied to orphaned skb hashes */ | ||
778 | |||
777 | __TCA_FQ_MAX | 779 | __TCA_FQ_MAX |
778 | }; | 780 | }; |
779 | 781 | ||
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h index 89f63503f903..31891d9535e2 100644 --- a/include/uapi/linux/prctl.h +++ b/include/uapi/linux/prctl.h | |||
@@ -185,4 +185,9 @@ struct prctl_mm_map { | |||
185 | #define PR_MPX_ENABLE_MANAGEMENT 43 | 185 | #define PR_MPX_ENABLE_MANAGEMENT 43 |
186 | #define PR_MPX_DISABLE_MANAGEMENT 44 | 186 | #define PR_MPX_DISABLE_MANAGEMENT 44 |
187 | 187 | ||
188 | #define PR_SET_FP_MODE 45 | ||
189 | #define PR_GET_FP_MODE 46 | ||
190 | # define PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ | ||
191 | # define PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ | ||
192 | |||
188 | #endif /* _LINUX_PRCTL_H */ | 193 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/uapi/linux/quota.h b/include/uapi/linux/quota.h index 3b6cfbeb086d..1f49b8341c99 100644 --- a/include/uapi/linux/quota.h +++ b/include/uapi/linux/quota.h | |||
@@ -126,10 +126,22 @@ struct if_dqblk { | |||
126 | #define IIF_FLAGS 4 | 126 | #define IIF_FLAGS 4 |
127 | #define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS) | 127 | #define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS) |
128 | 128 | ||
129 | enum { | ||
130 | DQF_ROOT_SQUASH_B = 0, | ||
131 | DQF_SYS_FILE_B = 16, | ||
132 | /* Kernel internal flags invisible to userspace */ | ||
133 | DQF_PRIVATE | ||
134 | }; | ||
135 | |||
136 | /* Root squash enabled (for v1 quota format) */ | ||
137 | #define DQF_ROOT_SQUASH (1 << DQF_ROOT_SQUASH_B) | ||
138 | /* Quota stored in a system file */ | ||
139 | #define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) | ||
140 | |||
129 | struct if_dqinfo { | 141 | struct if_dqinfo { |
130 | __u64 dqi_bgrace; | 142 | __u64 dqi_bgrace; |
131 | __u64 dqi_igrace; | 143 | __u64 dqi_igrace; |
132 | __u32 dqi_flags; | 144 | __u32 dqi_flags; /* DFQ_* */ |
133 | __u32 dqi_valid; | 145 | __u32 dqi_valid; |
134 | }; | 146 | }; |
135 | 147 | ||
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 9c9b8b4480cd..5cc5d66bf519 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -132,6 +132,11 @@ enum { | |||
132 | RTM_GETMDB = 86, | 132 | RTM_GETMDB = 86, |
133 | #define RTM_GETMDB RTM_GETMDB | 133 | #define RTM_GETMDB RTM_GETMDB |
134 | 134 | ||
135 | RTM_NEWNSID = 88, | ||
136 | #define RTM_NEWNSID RTM_NEWNSID | ||
137 | RTM_GETNSID = 90, | ||
138 | #define RTM_GETNSID RTM_GETNSID | ||
139 | |||
135 | __RTM_MAX, | 140 | __RTM_MAX, |
136 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 141 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
137 | }; | 142 | }; |
@@ -389,6 +394,8 @@ enum { | |||
389 | #define RTAX_INITRWND RTAX_INITRWND | 394 | #define RTAX_INITRWND RTAX_INITRWND |
390 | RTAX_QUICKACK, | 395 | RTAX_QUICKACK, |
391 | #define RTAX_QUICKACK RTAX_QUICKACK | 396 | #define RTAX_QUICKACK RTAX_QUICKACK |
397 | RTAX_CC_ALGO, | ||
398 | #define RTAX_CC_ALGO RTAX_CC_ALGO | ||
392 | __RTAX_MAX | 399 | __RTAX_MAX |
393 | }; | 400 | }; |
394 | 401 | ||
@@ -634,6 +641,7 @@ struct tcamsg { | |||
634 | /* New extended info filters for IFLA_EXT_MASK */ | 641 | /* New extended info filters for IFLA_EXT_MASK */ |
635 | #define RTEXT_FILTER_VF (1 << 0) | 642 | #define RTEXT_FILTER_VF (1 << 0) |
636 | #define RTEXT_FILTER_BRVLAN (1 << 1) | 643 | #define RTEXT_FILTER_BRVLAN (1 << 1) |
644 | #define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2) | ||
637 | 645 | ||
638 | /* End of information exported to user level */ | 646 | /* End of information exported to user level */ |
639 | 647 | ||
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index c17218094f18..b2122813f18a 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -55,7 +55,8 @@ | |||
55 | #define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */ | 55 | #define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */ |
56 | #define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ | 56 | #define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ |
57 | #define PORT_RT2880 29 /* Ralink RT2880 internal UART */ | 57 | #define PORT_RT2880 29 /* Ralink RT2880 internal UART */ |
58 | #define PORT_MAX_8250 29 /* max port ID */ | 58 | #define PORT_16550A_FSL64 30 /* Freescale 16550 UART with 64 FIFOs */ |
59 | #define PORT_MAX_8250 30 /* max port ID */ | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * ARM specific type numbers. These are not currently guaranteed | 62 | * ARM specific type numbers. These are not currently guaranteed |
@@ -248,4 +249,13 @@ | |||
248 | /* MESON */ | 249 | /* MESON */ |
249 | #define PORT_MESON 109 | 250 | #define PORT_MESON 109 |
250 | 251 | ||
252 | /* Conexant Digicolor */ | ||
253 | #define PORT_DIGICOLOR 110 | ||
254 | |||
255 | /* SPRD SERIAL */ | ||
256 | #define PORT_SPRD 111 | ||
257 | |||
258 | /* Cris v10 / v32 SoC */ | ||
259 | #define PORT_CRIS 112 | ||
260 | |||
251 | #endif /* _UAPILINUX_SERIAL_CORE_H */ | 261 | #endif /* _UAPILINUX_SERIAL_CORE_H */ |
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 53af3b790129..00adb01fa5f3 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h | |||
@@ -86,7 +86,8 @@ | |||
86 | #define UART_FCR6_T_TRIGGER_8 0x10 /* Mask for transmit trigger set at 8 */ | 86 | #define UART_FCR6_T_TRIGGER_8 0x10 /* Mask for transmit trigger set at 8 */ |
87 | #define UART_FCR6_T_TRIGGER_24 0x20 /* Mask for transmit trigger set at 24 */ | 87 | #define UART_FCR6_T_TRIGGER_24 0x20 /* Mask for transmit trigger set at 24 */ |
88 | #define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */ | 88 | #define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */ |
89 | #define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */ | 89 | #define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750 and |
90 | some Freescale UARTs) */ | ||
90 | 91 | ||
91 | #define UART_FCR_R_TRIG_SHIFT 6 | 92 | #define UART_FCR_R_TRIG_SHIFT 6 |
92 | #define UART_FCR_R_TRIG_BITS(x) \ | 93 | #define UART_FCR_R_TRIG_BITS(x) \ |
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index b22224100011..6a6fb747c78d 100644 --- a/include/uapi/linux/snmp.h +++ b/include/uapi/linux/snmp.h | |||
@@ -270,6 +270,12 @@ enum | |||
270 | LINUX_MIB_TCPHYSTARTTRAINCWND, /* TCPHystartTrainCwnd */ | 270 | LINUX_MIB_TCPHYSTARTTRAINCWND, /* TCPHystartTrainCwnd */ |
271 | LINUX_MIB_TCPHYSTARTDELAYDETECT, /* TCPHystartDelayDetect */ | 271 | LINUX_MIB_TCPHYSTARTDELAYDETECT, /* TCPHystartDelayDetect */ |
272 | LINUX_MIB_TCPHYSTARTDELAYCWND, /* TCPHystartDelayCwnd */ | 272 | LINUX_MIB_TCPHYSTARTDELAYCWND, /* TCPHystartDelayCwnd */ |
273 | LINUX_MIB_TCPACKSKIPPEDSYNRECV, /* TCPACKSkippedSynRecv */ | ||
274 | LINUX_MIB_TCPACKSKIPPEDPAWS, /* TCPACKSkippedPAWS */ | ||
275 | LINUX_MIB_TCPACKSKIPPEDSEQ, /* TCPACKSkippedSeq */ | ||
276 | LINUX_MIB_TCPACKSKIPPEDFINWAIT2, /* TCPACKSkippedFinWait2 */ | ||
277 | LINUX_MIB_TCPACKSKIPPEDTIMEWAIT, /* TCPACKSkippedTimeWait */ | ||
278 | LINUX_MIB_TCPACKSKIPPEDCHALLENGE, /* TCPACKSkippedChallenge */ | ||
273 | __LINUX_MIB_MAX | 279 | __LINUX_MIB_MAX |
274 | }; | 280 | }; |
275 | 281 | ||
diff --git a/include/uapi/linux/som.h b/include/uapi/linux/som.h deleted file mode 100644 index 166594e4e7be..000000000000 --- a/include/uapi/linux/som.h +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | #ifndef _LINUX_SOM_H | ||
2 | #define _LINUX_SOM_H | ||
3 | |||
4 | /* File format definition for SOM executables / shared libraries */ | ||
5 | |||
6 | /* we need struct timespec */ | ||
7 | #include <linux/time.h> | ||
8 | |||
9 | #define SOM_PAGESIZE 4096 | ||
10 | |||
11 | /* this is the SOM header */ | ||
12 | struct som_hdr { | ||
13 | short system_id; /* magic number - system */ | ||
14 | short a_magic; /* magic number - file type */ | ||
15 | unsigned int version_id; /* versiod ID: YYMMDDHH */ | ||
16 | struct timespec file_time; /* system clock */ | ||
17 | unsigned int entry_space; /* space for entry point */ | ||
18 | unsigned int entry_subspace; /* subspace for entry point */ | ||
19 | unsigned int entry_offset; /* offset of entry point */ | ||
20 | unsigned int aux_header_location; /* auxiliary header location */ | ||
21 | unsigned int aux_header_size; /* auxiliary header size */ | ||
22 | unsigned int som_length; /* length of entire SOM */ | ||
23 | unsigned int presumed_dp; /* compiler's DP value */ | ||
24 | unsigned int space_location; /* space dictionary location */ | ||
25 | unsigned int space_total; /* number of space entries */ | ||
26 | unsigned int subspace_location; /* subspace entries location */ | ||
27 | unsigned int subspace_total; /* number of subspace entries */ | ||
28 | unsigned int loader_fixup_location; /* MPE/iX loader fixup */ | ||
29 | unsigned int loader_fixup_total; /* number of fixup records */ | ||
30 | unsigned int space_strings_location; /* (sub)space names */ | ||
31 | unsigned int space_strings_size; /* size of strings area */ | ||
32 | unsigned int init_array_location; /* reserved */ | ||
33 | unsigned int init_array_total; /* reserved */ | ||
34 | unsigned int compiler_location; /* module dictionary */ | ||
35 | unsigned int compiler_total; /* number of modules */ | ||
36 | unsigned int symbol_location; /* symbol dictionary */ | ||
37 | unsigned int symbol_total; /* number of symbols */ | ||
38 | unsigned int fixup_request_location; /* fixup requests */ | ||
39 | unsigned int fixup_request_total; /* number of fixup requests */ | ||
40 | unsigned int symbol_strings_location;/* module & symbol names area */ | ||
41 | unsigned int symbol_strings_size; /* size of strings area */ | ||
42 | unsigned int unloadable_sp_location; /* unloadable spaces location */ | ||
43 | unsigned int unloadable_sp_size; /* size of data */ | ||
44 | unsigned int checksum; | ||
45 | }; | ||
46 | |||
47 | /* values for system_id */ | ||
48 | |||
49 | #define SOM_SID_PARISC_1_0 0x020b | ||
50 | #define SOM_SID_PARISC_1_1 0x0210 | ||
51 | #define SOM_SID_PARISC_2_0 0x0214 | ||
52 | |||
53 | /* values for a_magic */ | ||
54 | |||
55 | #define SOM_LIB_EXEC 0x0104 | ||
56 | #define SOM_RELOCATABLE 0x0106 | ||
57 | #define SOM_EXEC_NONSHARE 0x0107 | ||
58 | #define SOM_EXEC_SHARE 0x0108 | ||
59 | #define SOM_EXEC_DEMAND 0x010B | ||
60 | #define SOM_LIB_DYN 0x010D | ||
61 | #define SOM_LIB_SHARE 0x010E | ||
62 | #define SOM_LIB_RELOC 0x0619 | ||
63 | |||
64 | /* values for version_id. Decimal not hex, yes. Grr. */ | ||
65 | |||
66 | #define SOM_ID_OLD 85082112 | ||
67 | #define SOM_ID_NEW 87102412 | ||
68 | |||
69 | struct aux_id { | ||
70 | unsigned int mandatory :1; /* the linker must understand this */ | ||
71 | unsigned int copy :1; /* Must be copied by the linker */ | ||
72 | unsigned int append :1; /* Must be merged by the linker */ | ||
73 | unsigned int ignore :1; /* Discard section if unknown */ | ||
74 | unsigned int reserved :12; | ||
75 | unsigned int type :16; /* Header type */ | ||
76 | unsigned int length; /* length of _following_ data */ | ||
77 | }; | ||
78 | |||
79 | /* The Exec Auxiliary Header. Called The HP-UX Header within HP apparently. */ | ||
80 | struct som_exec_auxhdr { | ||
81 | struct aux_id som_auxhdr; | ||
82 | int exec_tsize; /* Text size in bytes */ | ||
83 | int exec_tmem; /* Address to load text at */ | ||
84 | int exec_tfile; /* Location of text in file */ | ||
85 | int exec_dsize; /* Data size in bytes */ | ||
86 | int exec_dmem; /* Address to load data at */ | ||
87 | int exec_dfile; /* Location of data in file */ | ||
88 | int exec_bsize; /* Uninitialised data (bss) */ | ||
89 | int exec_entry; /* Address to start executing */ | ||
90 | int exec_flags; /* loader flags */ | ||
91 | int exec_bfill; /* initialisation value for bss */ | ||
92 | }; | ||
93 | |||
94 | /* Oh, the things people do to avoid casts. Shame it'll break with gcc's | ||
95 | * new aliasing rules really. | ||
96 | */ | ||
97 | union name_pt { | ||
98 | char * n_name; | ||
99 | unsigned int n_strx; | ||
100 | }; | ||
101 | |||
102 | /* The Space Dictionary */ | ||
103 | struct space_dictionary_record { | ||
104 | union name_pt name; /* index to subspace name */ | ||
105 | unsigned int is_loadable :1; /* loadable */ | ||
106 | unsigned int is_defined :1; /* defined within file */ | ||
107 | unsigned int is_private :1; /* not sharable */ | ||
108 | unsigned int has_intermediate_code :1; /* contains intermediate code */ | ||
109 | unsigned int is_tspecific :1; /* thread specific */ | ||
110 | unsigned int reserved :11; /* for future expansion */ | ||
111 | unsigned int sort_key :8; /* for linker */ | ||
112 | unsigned int reserved2 :8; /* for future expansion */ | ||
113 | |||
114 | int space_number; /* index */ | ||
115 | int subspace_index; /* index into subspace dict */ | ||
116 | unsigned int subspace_quantity; /* number of subspaces */ | ||
117 | int loader_fix_index; /* for loader */ | ||
118 | unsigned int loader_fix_quantity; /* for loader */ | ||
119 | int init_pointer_index; /* data pointer array index */ | ||
120 | unsigned int init_pointer_quantity; /* number of data pointers */ | ||
121 | }; | ||
122 | |||
123 | /* The Subspace Dictionary */ | ||
124 | struct subspace_dictionary_record { | ||
125 | int space_index; | ||
126 | unsigned int access_control_bits :7; | ||
127 | unsigned int memory_resident :1; | ||
128 | unsigned int dup_common :1; | ||
129 | unsigned int is_common :1; | ||
130 | unsigned int quadrant :2; | ||
131 | unsigned int initially_frozen :1; | ||
132 | unsigned int is_first :1; | ||
133 | unsigned int code_only :1; | ||
134 | unsigned int sort_key :8; | ||
135 | unsigned int replicate_init :1; | ||
136 | unsigned int continuation :1; | ||
137 | unsigned int is_tspecific :1; | ||
138 | unsigned int is_comdat :1; | ||
139 | unsigned int reserved :4; | ||
140 | |||
141 | int file_loc_init_value; | ||
142 | unsigned int initialization_length; | ||
143 | unsigned int subspace_start; | ||
144 | unsigned int subspace_length; | ||
145 | |||
146 | unsigned int reserved2 :5; | ||
147 | unsigned int alignment :27; | ||
148 | |||
149 | union name_pt name; | ||
150 | int fixup_request_index; | ||
151 | unsigned int fixup_request_quantity; | ||
152 | }; | ||
153 | |||
154 | #endif /* _LINUX_SOM_H */ | ||
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild index b057da2b87a4..19d5219b0b99 100644 --- a/include/uapi/linux/tc_act/Kbuild +++ b/include/uapi/linux/tc_act/Kbuild | |||
@@ -8,3 +8,4 @@ header-y += tc_nat.h | |||
8 | header-y += tc_pedit.h | 8 | header-y += tc_pedit.h |
9 | header-y += tc_skbedit.h | 9 | header-y += tc_skbedit.h |
10 | header-y += tc_vlan.h | 10 | header-y += tc_vlan.h |
11 | header-y += tc_bpf.h | ||
diff --git a/include/uapi/linux/tc_act/tc_bpf.h b/include/uapi/linux/tc_act/tc_bpf.h new file mode 100644 index 000000000000..5288bd77e63b --- /dev/null +++ b/include/uapi/linux/tc_act/tc_bpf.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us> | ||
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 | |||
10 | #ifndef __LINUX_TC_BPF_H | ||
11 | #define __LINUX_TC_BPF_H | ||
12 | |||
13 | #include <linux/pkt_cls.h> | ||
14 | |||
15 | #define TCA_ACT_BPF 13 | ||
16 | |||
17 | struct tc_act_bpf { | ||
18 | tc_gen; | ||
19 | }; | ||
20 | |||
21 | enum { | ||
22 | TCA_ACT_BPF_UNSPEC, | ||
23 | TCA_ACT_BPF_TM, | ||
24 | TCA_ACT_BPF_PARMS, | ||
25 | TCA_ACT_BPF_OPS_LEN, | ||
26 | TCA_ACT_BPF_OPS, | ||
27 | __TCA_ACT_BPF_MAX, | ||
28 | }; | ||
29 | #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1) | ||
30 | |||
31 | #endif | ||
diff --git a/include/uapi/linux/tc_act/tc_connmark.h b/include/uapi/linux/tc_act/tc_connmark.h new file mode 100644 index 000000000000..994b0971bce2 --- /dev/null +++ b/include/uapi/linux/tc_act/tc_connmark.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef __UAPI_TC_CONNMARK_H | ||
2 | #define __UAPI_TC_CONNMARK_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/pkt_cls.h> | ||
6 | |||
7 | #define TCA_ACT_CONNMARK 14 | ||
8 | |||
9 | struct tc_connmark { | ||
10 | tc_gen; | ||
11 | __u16 zone; | ||
12 | }; | ||
13 | |||
14 | enum { | ||
15 | TCA_CONNMARK_UNSPEC, | ||
16 | TCA_CONNMARK_PARMS, | ||
17 | TCA_CONNMARK_TM, | ||
18 | __TCA_CONNMARK_MAX | ||
19 | }; | ||
20 | #define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1) | ||
21 | |||
22 | #endif | ||
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h index 876d0a14863c..087b0ef82c07 100644 --- a/include/uapi/linux/tipc_config.h +++ b/include/uapi/linux/tipc_config.h | |||
@@ -272,6 +272,26 @@ static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) | |||
272 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); | 272 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); |
273 | } | 273 | } |
274 | 274 | ||
275 | static inline int TLV_GET_LEN(struct tlv_desc *tlv) | ||
276 | { | ||
277 | return ntohs(tlv->tlv_len); | ||
278 | } | ||
279 | |||
280 | static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len) | ||
281 | { | ||
282 | tlv->tlv_len = htons(len); | ||
283 | } | ||
284 | |||
285 | static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) | ||
286 | { | ||
287 | return (ntohs(tlv->tlv_type) == type); | ||
288 | } | ||
289 | |||
290 | static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type) | ||
291 | { | ||
292 | tlv->tlv_type = htons(type); | ||
293 | } | ||
294 | |||
275 | static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) | 295 | static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) |
276 | { | 296 | { |
277 | struct tlv_desc *tlv_ptr; | 297 | struct tlv_desc *tlv_ptr; |
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index 295ba299e7bd..108dd7997014 100644 --- a/include/uapi/linux/usb/functionfs.h +++ b/include/uapi/linux/usb/functionfs.h | |||
@@ -20,6 +20,7 @@ enum functionfs_flags { | |||
20 | FUNCTIONFS_HAS_SS_DESC = 4, | 20 | FUNCTIONFS_HAS_SS_DESC = 4, |
21 | FUNCTIONFS_HAS_MS_OS_DESC = 8, | 21 | FUNCTIONFS_HAS_MS_OS_DESC = 8, |
22 | FUNCTIONFS_VIRTUAL_ADDR = 16, | 22 | FUNCTIONFS_VIRTUAL_ADDR = 16, |
23 | FUNCTIONFS_EVENTFD = 32, | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | /* Descriptor of an non-audio endpoint */ | 26 | /* Descriptor of an non-audio endpoint */ |
diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h index abe5f4bd4d82..019ba1e0799a 100644 --- a/include/uapi/linux/usbdevice_fs.h +++ b/include/uapi/linux/usbdevice_fs.h | |||
@@ -128,11 +128,12 @@ struct usbdevfs_hub_portinfo { | |||
128 | char port [127]; /* e.g. port 3 connects to device 27 */ | 128 | char port [127]; /* e.g. port 3 connects to device 27 */ |
129 | }; | 129 | }; |
130 | 130 | ||
131 | /* Device capability flags */ | 131 | /* System and bus capability flags */ |
132 | #define USBDEVFS_CAP_ZERO_PACKET 0x01 | 132 | #define USBDEVFS_CAP_ZERO_PACKET 0x01 |
133 | #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 | 133 | #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 |
134 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 | 134 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 |
135 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 | 135 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 |
136 | #define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10 | ||
136 | 137 | ||
137 | /* USBDEVFS_DISCONNECT_CLAIM flags & struct */ | 138 | /* USBDEVFS_DISCONNECT_CLAIM flags & struct */ |
138 | 139 | ||
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 661f119a51b8..9f6e108ff4a0 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
@@ -170,6 +170,10 @@ enum v4l2_colorfx { | |||
170 | * We reserve 16 controls for this driver. */ | 170 | * We reserve 16 controls for this driver. */ |
171 | #define V4L2_CID_USER_SAA7134_BASE (V4L2_CID_USER_BASE + 0x1060) | 171 | #define V4L2_CID_USER_SAA7134_BASE (V4L2_CID_USER_BASE + 0x1060) |
172 | 172 | ||
173 | /* The base for the adv7180 driver controls. | ||
174 | * We reserve 16 controls for this driver. */ | ||
175 | #define V4L2_CID_USER_ADV7180_BASE (V4L2_CID_USER_BASE + 0x1070) | ||
176 | |||
173 | /* MPEG-class control IDs */ | 177 | /* MPEG-class control IDs */ |
174 | /* The MPEG controls are applicable to all codec controls | 178 | /* The MPEG controls are applicable to all codec controls |
175 | * and the 'MPEG' part of the define is historical */ | 179 | * and the 'MPEG' part of the define is historical */ |
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 29715d27548f..82889c30f4f5 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h | |||
@@ -333,6 +333,7 @@ enum { | |||
333 | VFIO_PCI_MSI_IRQ_INDEX, | 333 | VFIO_PCI_MSI_IRQ_INDEX, |
334 | VFIO_PCI_MSIX_IRQ_INDEX, | 334 | VFIO_PCI_MSIX_IRQ_INDEX, |
335 | VFIO_PCI_ERR_IRQ_INDEX, | 335 | VFIO_PCI_ERR_IRQ_INDEX, |
336 | VFIO_PCI_REQ_IRQ_INDEX, | ||
336 | VFIO_PCI_NUM_IRQS | 337 | VFIO_PCI_NUM_IRQS |
337 | }; | 338 | }; |
338 | 339 | ||
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index d279c1b75cf7..fbdc3602ee27 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
@@ -463,10 +463,11 @@ struct v4l2_pix_format { | |||
463 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ | 463 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ |
464 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ | 464 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ |
465 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ | 465 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ |
466 | #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */ | 466 | /* 10bit raw bayer packed, 5 bytes for every 4 pixels */ |
467 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ | 467 | #define V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A') |
468 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ | 468 | #define V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A') |
469 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ | 469 | #define V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A') |
470 | #define V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A') | ||
470 | /* 10bit raw bayer a-law compressed to 8 bits */ | 471 | /* 10bit raw bayer a-law compressed to 8 bits */ |
471 | #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8') | 472 | #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8') |
472 | #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8') | 473 | #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8') |
@@ -477,10 +478,10 @@ struct v4l2_pix_format { | |||
477 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') | 478 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') |
478 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') | 479 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') |
479 | #define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8') | 480 | #define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8') |
480 | /* | 481 | #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */ |
481 | * 10bit raw bayer, expanded to 16 bits | 482 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ |
482 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... | 483 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ |
483 | */ | 484 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ |
484 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ | 485 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ |
485 | 486 | ||
486 | /* compressed formats */ | 487 | /* compressed formats */ |
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f7059e93..4b0488f20b2e 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h | |||
@@ -36,8 +36,7 @@ | |||
36 | /* Size of a PFN in the balloon interface. */ | 36 | /* Size of a PFN in the balloon interface. */ |
37 | #define VIRTIO_BALLOON_PFN_SHIFT 12 | 37 | #define VIRTIO_BALLOON_PFN_SHIFT 12 |
38 | 38 | ||
39 | struct virtio_balloon_config | 39 | struct virtio_balloon_config { |
40 | { | ||
41 | /* Number of pages host wants Guest to give up. */ | 40 | /* Number of pages host wants Guest to give up. */ |
42 | __le32 num_pages; | 41 | __le32 num_pages; |
43 | /* Number of pages we've actually got in balloon. */ | 42 | /* Number of pages we've actually got in balloon. */ |
diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 247c8ba8544a..3c53eec4ae22 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h | |||
@@ -31,22 +31,25 @@ | |||
31 | #include <linux/virtio_types.h> | 31 | #include <linux/virtio_types.h> |
32 | 32 | ||
33 | /* Feature bits */ | 33 | /* Feature bits */ |
34 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
35 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 34 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
36 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 35 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
37 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | 36 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ |
38 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 37 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
39 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 38 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
40 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
41 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
42 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ | 39 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ |
43 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
44 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ | 40 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ |
45 | 41 | ||
42 | /* Legacy feature bits */ | ||
43 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
44 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
45 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
46 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
47 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
46 | #ifndef __KERNEL__ | 48 | #ifndef __KERNEL__ |
47 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ | 49 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ |
48 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE | 50 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE |
49 | #endif | 51 | #endif |
52 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
50 | 53 | ||
51 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ | 54 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ |
52 | 55 | ||
@@ -100,8 +103,10 @@ struct virtio_blk_config { | |||
100 | #define VIRTIO_BLK_T_IN 0 | 103 | #define VIRTIO_BLK_T_IN 0 |
101 | #define VIRTIO_BLK_T_OUT 1 | 104 | #define VIRTIO_BLK_T_OUT 1 |
102 | 105 | ||
106 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
103 | /* This bit says it's a scsi command, not an actual read or write. */ | 107 | /* This bit says it's a scsi command, not an actual read or write. */ |
104 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 108 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
109 | #endif /* VIRTIO_BLK_NO_LEGACY */ | ||
105 | 110 | ||
106 | /* Cache flush command */ | 111 | /* Cache flush command */ |
107 | #define VIRTIO_BLK_T_FLUSH 4 | 112 | #define VIRTIO_BLK_T_FLUSH 4 |
@@ -109,8 +114,10 @@ struct virtio_blk_config { | |||
109 | /* Get device ID command */ | 114 | /* Get device ID command */ |
110 | #define VIRTIO_BLK_T_GET_ID 8 | 115 | #define VIRTIO_BLK_T_GET_ID 8 |
111 | 116 | ||
117 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
112 | /* Barrier before this op. */ | 118 | /* Barrier before this op. */ |
113 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 119 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
120 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
114 | 121 | ||
115 | /* This is the first element of the read scatter-gather list. */ | 122 | /* This is the first element of the read scatter-gather list. */ |
116 | struct virtio_blk_outhdr { | 123 | struct virtio_blk_outhdr { |
@@ -122,12 +129,14 @@ struct virtio_blk_outhdr { | |||
122 | __virtio64 sector; | 129 | __virtio64 sector; |
123 | }; | 130 | }; |
124 | 131 | ||
132 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
125 | struct virtio_scsi_inhdr { | 133 | struct virtio_scsi_inhdr { |
126 | __virtio32 errors; | 134 | __virtio32 errors; |
127 | __virtio32 data_len; | 135 | __virtio32 data_len; |
128 | __virtio32 sense_len; | 136 | __virtio32 sense_len; |
129 | __virtio32 residual; | 137 | __virtio32 residual; |
130 | }; | 138 | }; |
139 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
131 | 140 | ||
132 | /* And this is the final byte of the write scatter-gather list. */ | 141 | /* And this is the final byte of the write scatter-gather list. */ |
133 | #define VIRTIO_BLK_S_OK 0 | 142 | #define VIRTIO_BLK_S_OK 0 |
diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index a6d0cdeaacd4..c18264df9504 100644 --- a/include/uapi/linux/virtio_config.h +++ b/include/uapi/linux/virtio_config.h | |||
@@ -49,12 +49,14 @@ | |||
49 | #define VIRTIO_TRANSPORT_F_START 28 | 49 | #define VIRTIO_TRANSPORT_F_START 28 |
50 | #define VIRTIO_TRANSPORT_F_END 33 | 50 | #define VIRTIO_TRANSPORT_F_END 33 |
51 | 51 | ||
52 | #ifndef VIRTIO_CONFIG_NO_LEGACY | ||
52 | /* Do we get callbacks when the ring is completely used, even if we've | 53 | /* Do we get callbacks when the ring is completely used, even if we've |
53 | * suppressed them? */ | 54 | * suppressed them? */ |
54 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 55 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
55 | 56 | ||
56 | /* Can the device handle any descriptor layout? */ | 57 | /* Can the device handle any descriptor layout? */ |
57 | #define VIRTIO_F_ANY_LAYOUT 27 | 58 | #define VIRTIO_F_ANY_LAYOUT 27 |
59 | #endif /* VIRTIO_CONFIG_NO_LEGACY */ | ||
58 | 60 | ||
59 | /* v1.0 compliant. */ | 61 | /* v1.0 compliant. */ |
60 | #define VIRTIO_F_VERSION_1 32 | 62 | #define VIRTIO_F_VERSION_1 32 |
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index b5f1677b291c..7bbee79ca293 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h | |||
@@ -35,7 +35,6 @@ | |||
35 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ | 35 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ |
36 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ | 36 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ |
37 | #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ | 37 | #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ |
38 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ | ||
39 | #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ | 38 | #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ |
40 | #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ | 39 | #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ |
41 | #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ | 40 | #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ |
@@ -56,6 +55,10 @@ | |||
56 | * Steering */ | 55 | * Steering */ |
57 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ | 56 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ |
58 | 57 | ||
58 | #ifndef VIRTIO_NET_NO_LEGACY | ||
59 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ | ||
60 | #endif /* VIRTIO_NET_NO_LEGACY */ | ||
61 | |||
59 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 62 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
60 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ | 63 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ |
61 | 64 | ||
@@ -71,19 +74,39 @@ struct virtio_net_config { | |||
71 | __u16 max_virtqueue_pairs; | 74 | __u16 max_virtqueue_pairs; |
72 | } __attribute__((packed)); | 75 | } __attribute__((packed)); |
73 | 76 | ||
77 | /* | ||
78 | * This header comes first in the scatter-gather list. If you don't | ||
79 | * specify GSO or CSUM features, you can simply ignore the header. | ||
80 | * | ||
81 | * This is bitwise-equivalent to the legacy struct virtio_net_hdr_mrg_rxbuf, | ||
82 | * only flattened. | ||
83 | */ | ||
84 | struct virtio_net_hdr_v1 { | ||
85 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */ | ||
86 | #define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */ | ||
87 | __u8 flags; | ||
88 | #define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */ | ||
89 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ | ||
90 | #define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */ | ||
91 | #define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ | ||
92 | #define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */ | ||
93 | __u8 gso_type; | ||
94 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ | ||
95 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ | ||
96 | __virtio16 csum_start; /* Position to start checksumming from */ | ||
97 | __virtio16 csum_offset; /* Offset after that to place checksum */ | ||
98 | __virtio16 num_buffers; /* Number of merged rx buffers */ | ||
99 | }; | ||
100 | |||
101 | #ifndef VIRTIO_NET_NO_LEGACY | ||
74 | /* This header comes first in the scatter-gather list. | 102 | /* This header comes first in the scatter-gather list. |
75 | * If VIRTIO_F_ANY_LAYOUT is not negotiated, it must | 103 | * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must |
76 | * be the first element of the scatter-gather list. If you don't | 104 | * be the first element of the scatter-gather list. If you don't |
77 | * specify GSO or CSUM features, you can simply ignore the header. */ | 105 | * specify GSO or CSUM features, you can simply ignore the header. */ |
78 | struct virtio_net_hdr { | 106 | struct virtio_net_hdr { |
79 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset | 107 | /* See VIRTIO_NET_HDR_F_* */ |
80 | #define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid | ||
81 | __u8 flags; | 108 | __u8 flags; |
82 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame | 109 | /* See VIRTIO_NET_HDR_GSO_* */ |
83 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) | ||
84 | #define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO) | ||
85 | #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP | ||
86 | #define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set | ||
87 | __u8 gso_type; | 110 | __u8 gso_type; |
88 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ | 111 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ |
89 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ | 112 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ |
@@ -97,6 +120,7 @@ struct virtio_net_hdr_mrg_rxbuf { | |||
97 | struct virtio_net_hdr hdr; | 120 | struct virtio_net_hdr hdr; |
98 | __virtio16 num_buffers; /* Number of merged rx buffers */ | 121 | __virtio16 num_buffers; /* Number of merged rx buffers */ |
99 | }; | 122 | }; |
123 | #endif /* ...VIRTIO_NET_NO_LEGACY */ | ||
100 | 124 | ||
101 | /* | 125 | /* |
102 | * Control virtqueue data structures | 126 | * Control virtqueue data structures |
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 35b552c7f330..75301468359f 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #ifndef _LINUX_VIRTIO_PCI_H | 39 | #ifndef _LINUX_VIRTIO_PCI_H |
40 | #define _LINUX_VIRTIO_PCI_H | 40 | #define _LINUX_VIRTIO_PCI_H |
41 | 41 | ||
42 | #include <linux/virtio_config.h> | 42 | #include <linux/types.h> |
43 | 43 | ||
44 | #ifndef VIRTIO_PCI_NO_LEGACY | 44 | #ifndef VIRTIO_PCI_NO_LEGACY |
45 | 45 | ||
@@ -99,4 +99,95 @@ | |||
99 | /* Vector value used to disable MSI for queue */ | 99 | /* Vector value used to disable MSI for queue */ |
100 | #define VIRTIO_MSI_NO_VECTOR 0xffff | 100 | #define VIRTIO_MSI_NO_VECTOR 0xffff |
101 | 101 | ||
102 | #ifndef VIRTIO_PCI_NO_MODERN | ||
103 | |||
104 | /* IDs for different capabilities. Must all exist. */ | ||
105 | |||
106 | /* Common configuration */ | ||
107 | #define VIRTIO_PCI_CAP_COMMON_CFG 1 | ||
108 | /* Notifications */ | ||
109 | #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 | ||
110 | /* ISR access */ | ||
111 | #define VIRTIO_PCI_CAP_ISR_CFG 3 | ||
112 | /* Device specific configuration */ | ||
113 | #define VIRTIO_PCI_CAP_DEVICE_CFG 4 | ||
114 | /* PCI configuration access */ | ||
115 | #define VIRTIO_PCI_CAP_PCI_CFG 5 | ||
116 | |||
117 | /* This is the PCI capability header: */ | ||
118 | struct virtio_pci_cap { | ||
119 | __u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */ | ||
120 | __u8 cap_next; /* Generic PCI field: next ptr. */ | ||
121 | __u8 cap_len; /* Generic PCI field: capability length */ | ||
122 | __u8 cfg_type; /* Identifies the structure. */ | ||
123 | __u8 bar; /* Where to find it. */ | ||
124 | __u8 padding[3]; /* Pad to full dword. */ | ||
125 | __le32 offset; /* Offset within bar. */ | ||
126 | __le32 length; /* Length of the structure, in bytes. */ | ||
127 | }; | ||
128 | |||
129 | struct virtio_pci_notify_cap { | ||
130 | struct virtio_pci_cap cap; | ||
131 | __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ | ||
132 | }; | ||
133 | |||
134 | /* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */ | ||
135 | struct virtio_pci_common_cfg { | ||
136 | /* About the whole device. */ | ||
137 | __le32 device_feature_select; /* read-write */ | ||
138 | __le32 device_feature; /* read-only */ | ||
139 | __le32 guest_feature_select; /* read-write */ | ||
140 | __le32 guest_feature; /* read-write */ | ||
141 | __le16 msix_config; /* read-write */ | ||
142 | __le16 num_queues; /* read-only */ | ||
143 | __u8 device_status; /* read-write */ | ||
144 | __u8 config_generation; /* read-only */ | ||
145 | |||
146 | /* About a specific virtqueue. */ | ||
147 | __le16 queue_select; /* read-write */ | ||
148 | __le16 queue_size; /* read-write, power of 2. */ | ||
149 | __le16 queue_msix_vector; /* read-write */ | ||
150 | __le16 queue_enable; /* read-write */ | ||
151 | __le16 queue_notify_off; /* read-only */ | ||
152 | __le32 queue_desc_lo; /* read-write */ | ||
153 | __le32 queue_desc_hi; /* read-write */ | ||
154 | __le32 queue_avail_lo; /* read-write */ | ||
155 | __le32 queue_avail_hi; /* read-write */ | ||
156 | __le32 queue_used_lo; /* read-write */ | ||
157 | __le32 queue_used_hi; /* read-write */ | ||
158 | }; | ||
159 | |||
160 | /* Macro versions of offsets for the Old Timers! */ | ||
161 | #define VIRTIO_PCI_CAP_VNDR 0 | ||
162 | #define VIRTIO_PCI_CAP_NEXT 1 | ||
163 | #define VIRTIO_PCI_CAP_LEN 2 | ||
164 | #define VIRTIO_PCI_CAP_CFG_TYPE 3 | ||
165 | #define VIRTIO_PCI_CAP_BAR 4 | ||
166 | #define VIRTIO_PCI_CAP_OFFSET 8 | ||
167 | #define VIRTIO_PCI_CAP_LENGTH 12 | ||
168 | |||
169 | #define VIRTIO_PCI_NOTIFY_CAP_MULT 16 | ||
170 | |||
171 | #define VIRTIO_PCI_COMMON_DFSELECT 0 | ||
172 | #define VIRTIO_PCI_COMMON_DF 4 | ||
173 | #define VIRTIO_PCI_COMMON_GFSELECT 8 | ||
174 | #define VIRTIO_PCI_COMMON_GF 12 | ||
175 | #define VIRTIO_PCI_COMMON_MSIX 16 | ||
176 | #define VIRTIO_PCI_COMMON_NUMQ 18 | ||
177 | #define VIRTIO_PCI_COMMON_STATUS 20 | ||
178 | #define VIRTIO_PCI_COMMON_CFGGENERATION 21 | ||
179 | #define VIRTIO_PCI_COMMON_Q_SELECT 22 | ||
180 | #define VIRTIO_PCI_COMMON_Q_SIZE 24 | ||
181 | #define VIRTIO_PCI_COMMON_Q_MSIX 26 | ||
182 | #define VIRTIO_PCI_COMMON_Q_ENABLE 28 | ||
183 | #define VIRTIO_PCI_COMMON_Q_NOFF 30 | ||
184 | #define VIRTIO_PCI_COMMON_Q_DESCLO 32 | ||
185 | #define VIRTIO_PCI_COMMON_Q_DESCHI 36 | ||
186 | #define VIRTIO_PCI_COMMON_Q_AVAILLO 40 | ||
187 | #define VIRTIO_PCI_COMMON_Q_AVAILHI 44 | ||
188 | #define VIRTIO_PCI_COMMON_Q_USEDLO 48 | ||
189 | #define VIRTIO_PCI_COMMON_Q_USEDHI 52 | ||
190 | |||
191 | #endif /* VIRTIO_PCI_NO_MODERN */ | ||
192 | |||
102 | #endif | 193 | #endif |
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 4275b961bf60..b513e662d8e4 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
@@ -202,10 +202,6 @@ struct ib_uverbs_query_device_resp { | |||
202 | __u8 reserved[4]; | 202 | __u8 reserved[4]; |
203 | }; | 203 | }; |
204 | 204 | ||
205 | enum { | ||
206 | IB_USER_VERBS_EX_QUERY_DEVICE_ODP = 1ULL << 0, | ||
207 | }; | ||
208 | |||
209 | struct ib_uverbs_ex_query_device { | 205 | struct ib_uverbs_ex_query_device { |
210 | __u32 comp_mask; | 206 | __u32 comp_mask; |
211 | __u32 reserved; | 207 | __u32 reserved; |
@@ -224,7 +220,7 @@ struct ib_uverbs_odp_caps { | |||
224 | struct ib_uverbs_ex_query_device_resp { | 220 | struct ib_uverbs_ex_query_device_resp { |
225 | struct ib_uverbs_query_device_resp base; | 221 | struct ib_uverbs_query_device_resp base; |
226 | __u32 comp_mask; | 222 | __u32 comp_mask; |
227 | __u32 reserved; | 223 | __u32 response_length; |
228 | struct ib_uverbs_odp_caps odp_caps; | 224 | struct ib_uverbs_odp_caps odp_caps; |
229 | }; | 225 | }; |
230 | 226 | ||
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 1f23cd635957..0e88e7a0f0eb 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h | |||
@@ -268,6 +268,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
268 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 268 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
269 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | 269 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ |
270 | #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ | 270 | #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ |
271 | #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ | ||
271 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | 272 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
272 | 273 | ||
273 | typedef int __bitwise snd_pcm_state_t; | 274 | typedef int __bitwise snd_pcm_state_t; |
diff --git a/include/uapi/sound/usb_stream.h b/include/uapi/sound/usb_stream.h new file mode 100644 index 000000000000..cfe8fba00714 --- /dev/null +++ b/include/uapi/sound/usb_stream.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.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 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * 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 Foundation, | ||
16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _UAPI__SOUND_USB_STREAM_H | ||
20 | #define _UAPI__SOUND_USB_STREAM_H | ||
21 | |||
22 | #define USB_STREAM_INTERFACE_VERSION 2 | ||
23 | |||
24 | #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \ | ||
25 | _IOW('H', 0x90, struct usb_stream_config) | ||
26 | |||
27 | struct usb_stream_packet { | ||
28 | unsigned offset; | ||
29 | unsigned length; | ||
30 | }; | ||
31 | |||
32 | |||
33 | struct usb_stream_config { | ||
34 | unsigned version; | ||
35 | unsigned sample_rate; | ||
36 | unsigned period_frames; | ||
37 | unsigned frame_size; | ||
38 | }; | ||
39 | |||
40 | struct usb_stream { | ||
41 | struct usb_stream_config cfg; | ||
42 | unsigned read_size; | ||
43 | unsigned write_size; | ||
44 | |||
45 | int period_size; | ||
46 | |||
47 | unsigned state; | ||
48 | |||
49 | int idle_insize; | ||
50 | int idle_outsize; | ||
51 | int sync_packet; | ||
52 | unsigned insize_done; | ||
53 | unsigned periods_done; | ||
54 | unsigned periods_polled; | ||
55 | |||
56 | struct usb_stream_packet outpacket[2]; | ||
57 | unsigned inpackets; | ||
58 | unsigned inpacket_head; | ||
59 | unsigned inpacket_split; | ||
60 | unsigned inpacket_split_at; | ||
61 | unsigned next_inpacket_split; | ||
62 | unsigned next_inpacket_split_at; | ||
63 | struct usb_stream_packet inpacket[0]; | ||
64 | }; | ||
65 | |||
66 | enum usb_stream_state { | ||
67 | usb_stream_invalid, | ||
68 | usb_stream_stopped, | ||
69 | usb_stream_sync0, | ||
70 | usb_stream_sync1, | ||
71 | usb_stream_ready, | ||
72 | usb_stream_running, | ||
73 | usb_stream_xrun, | ||
74 | }; | ||
75 | |||
76 | #endif /* _UAPI__SOUND_USB_STREAM_H */ | ||
diff --git a/include/video/exynos7_decon.h b/include/video/exynos7_decon.h new file mode 100644 index 000000000000..a62b11b613f6 --- /dev/null +++ b/include/video/exynos7_decon.h | |||
@@ -0,0 +1,349 @@ | |||
1 | /* include/video/exynos7_decon.h | ||
2 | * | ||
3 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
4 | * Author: Ajay Kumar <ajaykumar.rs@samsung.com> | ||
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 | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | /* VIDCON0 */ | ||
13 | #define VIDCON0 0x00 | ||
14 | |||
15 | #define VIDCON0_SWRESET (1 << 28) | ||
16 | #define VIDCON0_DECON_STOP_STATUS (1 << 2) | ||
17 | #define VIDCON0_ENVID (1 << 1) | ||
18 | #define VIDCON0_ENVID_F (1 << 0) | ||
19 | |||
20 | /* VIDOUTCON0 */ | ||
21 | #define VIDOUTCON0 0x4 | ||
22 | |||
23 | #define VIDOUTCON0_DUAL_MASK (0x3 << 24) | ||
24 | #define VIDOUTCON0_DUAL_ON (0x3 << 24) | ||
25 | #define VIDOUTCON0_DISP_IF_1_ON (0x2 << 24) | ||
26 | #define VIDOUTCON0_DISP_IF_0_ON (0x1 << 24) | ||
27 | #define VIDOUTCON0_DUAL_OFF (0x0 << 24) | ||
28 | #define VIDOUTCON0_IF_SHIFT 23 | ||
29 | #define VIDOUTCON0_IF_MASK (0x1 << 23) | ||
30 | #define VIDOUTCON0_RGBIF (0x0 << 23) | ||
31 | #define VIDOUTCON0_I80IF (0x1 << 23) | ||
32 | |||
33 | /* VIDCON3 */ | ||
34 | #define VIDCON3 0x8 | ||
35 | |||
36 | /* VIDCON4 */ | ||
37 | #define VIDCON4 0xC | ||
38 | #define VIDCON4_FIFOCNT_START_EN (1 << 0) | ||
39 | |||
40 | /* VCLKCON0 */ | ||
41 | #define VCLKCON0 0x10 | ||
42 | #define VCLKCON0_CLKVALUP (1 << 8) | ||
43 | #define VCLKCON0_VCLKFREE (1 << 0) | ||
44 | |||
45 | /* VCLKCON */ | ||
46 | #define VCLKCON1 0x14 | ||
47 | #define VCLKCON1_CLKVAL_NUM_VCLK(val) (((val) & 0xff) << 0) | ||
48 | #define VCLKCON2 0x18 | ||
49 | |||
50 | /* SHADOWCON */ | ||
51 | #define SHADOWCON 0x30 | ||
52 | |||
53 | #define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win))) | ||
54 | |||
55 | /* WINCONx */ | ||
56 | #define WINCON(_win) (0x50 + ((_win) * 4)) | ||
57 | |||
58 | #define WINCONx_BUFSTATUS (0x3 << 30) | ||
59 | #define WINCONx_BUFSEL_MASK (0x3 << 28) | ||
60 | #define WINCONx_BUFSEL_SHIFT 28 | ||
61 | #define WINCONx_TRIPLE_BUF_MODE (0x1 << 18) | ||
62 | #define WINCONx_DOUBLE_BUF_MODE (0x0 << 18) | ||
63 | #define WINCONx_BURSTLEN_16WORD (0x0 << 11) | ||
64 | #define WINCONx_BURSTLEN_8WORD (0x1 << 11) | ||
65 | #define WINCONx_BURSTLEN_MASK (0x1 << 11) | ||
66 | #define WINCONx_BURSTLEN_SHIFT 11 | ||
67 | #define WINCONx_BLD_PLANE (0 << 8) | ||
68 | #define WINCONx_BLD_PIX (1 << 8) | ||
69 | #define WINCONx_ALPHA_MUL (1 << 7) | ||
70 | |||
71 | #define WINCONx_BPPMODE_MASK (0xf << 2) | ||
72 | #define WINCONx_BPPMODE_SHIFT 2 | ||
73 | #define WINCONx_BPPMODE_16BPP_565 (0x8 << 2) | ||
74 | #define WINCONx_BPPMODE_24BPP_BGRx (0x7 << 2) | ||
75 | #define WINCONx_BPPMODE_24BPP_RGBx (0x6 << 2) | ||
76 | #define WINCONx_BPPMODE_24BPP_xBGR (0x5 << 2) | ||
77 | #define WINCONx_BPPMODE_24BPP_xRGB (0x4 << 2) | ||
78 | #define WINCONx_BPPMODE_32BPP_BGRA (0x3 << 2) | ||
79 | #define WINCONx_BPPMODE_32BPP_RGBA (0x2 << 2) | ||
80 | #define WINCONx_BPPMODE_32BPP_ABGR (0x1 << 2) | ||
81 | #define WINCONx_BPPMODE_32BPP_ARGB (0x0 << 2) | ||
82 | #define WINCONx_ALPHA_SEL (1 << 1) | ||
83 | #define WINCONx_ENWIN (1 << 0) | ||
84 | |||
85 | #define WINCON1_ALPHA_MUL_F (1 << 7) | ||
86 | #define WINCON2_ALPHA_MUL_F (1 << 7) | ||
87 | #define WINCON3_ALPHA_MUL_F (1 << 7) | ||
88 | #define WINCON4_ALPHA_MUL_F (1 << 7) | ||
89 | |||
90 | /* VIDOSDxH: The height for the OSD image(READ ONLY)*/ | ||
91 | #define VIDOSD_H(_x) (0x80 + ((_x) * 4)) | ||
92 | |||
93 | /* Frame buffer start addresses: VIDWxxADD0n */ | ||
94 | #define VIDW_BUF_START(_win) (0x80 + ((_win) * 0x10)) | ||
95 | #define VIDW_BUF_START1(_win) (0x84 + ((_win) * 0x10)) | ||
96 | #define VIDW_BUF_START2(_win) (0x88 + ((_win) * 0x10)) | ||
97 | |||
98 | #define VIDW_WHOLE_X(_win) (0x0130 + ((_win) * 8)) | ||
99 | #define VIDW_WHOLE_Y(_win) (0x0134 + ((_win) * 8)) | ||
100 | #define VIDW_OFFSET_X(_win) (0x0170 + ((_win) * 8)) | ||
101 | #define VIDW_OFFSET_Y(_win) (0x0174 + ((_win) * 8)) | ||
102 | #define VIDW_BLKOFFSET(_win) (0x01B0 + ((_win) * 4)) | ||
103 | #define VIDW_BLKSIZE(win) (0x0200 + ((_win) * 4)) | ||
104 | |||
105 | /* Interrupt controls register */ | ||
106 | #define VIDINTCON2 0x228 | ||
107 | |||
108 | #define VIDINTCON1_INTEXTRA1_EN (1 << 1) | ||
109 | #define VIDINTCON1_INTEXTRA0_EN (1 << 0) | ||
110 | |||
111 | /* Interrupt controls and status register */ | ||
112 | #define VIDINTCON3 0x22C | ||
113 | |||
114 | #define VIDINTCON1_INTEXTRA1_PEND (1 << 1) | ||
115 | #define VIDINTCON1_INTEXTRA0_PEND (1 << 0) | ||
116 | |||
117 | /* VIDOSDxA ~ VIDOSDxE */ | ||
118 | #define VIDOSD_BASE 0x230 | ||
119 | |||
120 | #define OSD_STRIDE 0x20 | ||
121 | |||
122 | #define VIDOSD_A(_win) (VIDOSD_BASE + \ | ||
123 | ((_win) * OSD_STRIDE) + 0x00) | ||
124 | #define VIDOSD_B(_win) (VIDOSD_BASE + \ | ||
125 | ((_win) * OSD_STRIDE) + 0x04) | ||
126 | #define VIDOSD_C(_win) (VIDOSD_BASE + \ | ||
127 | ((_win) * OSD_STRIDE) + 0x08) | ||
128 | #define VIDOSD_D(_win) (VIDOSD_BASE + \ | ||
129 | ((_win) * OSD_STRIDE) + 0x0C) | ||
130 | #define VIDOSD_E(_win) (VIDOSD_BASE + \ | ||
131 | ((_win) * OSD_STRIDE) + 0x10) | ||
132 | |||
133 | #define VIDOSDxA_TOPLEFT_X_MASK (0x1fff << 13) | ||
134 | #define VIDOSDxA_TOPLEFT_X_SHIFT 13 | ||
135 | #define VIDOSDxA_TOPLEFT_X_LIMIT 0x1fff | ||
136 | #define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x1fff) << 13) | ||
137 | |||
138 | #define VIDOSDxA_TOPLEFT_Y_MASK (0x1fff << 0) | ||
139 | #define VIDOSDxA_TOPLEFT_Y_SHIFT 0 | ||
140 | #define VIDOSDxA_TOPLEFT_Y_LIMIT 0x1fff | ||
141 | #define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x1fff) << 0) | ||
142 | |||
143 | #define VIDOSDxB_BOTRIGHT_X_MASK (0x1fff << 13) | ||
144 | #define VIDOSDxB_BOTRIGHT_X_SHIFT 13 | ||
145 | #define VIDOSDxB_BOTRIGHT_X_LIMIT 0x1fff | ||
146 | #define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x1fff) << 13) | ||
147 | |||
148 | #define VIDOSDxB_BOTRIGHT_Y_MASK (0x1fff << 0) | ||
149 | #define VIDOSDxB_BOTRIGHT_Y_SHIFT 0 | ||
150 | #define VIDOSDxB_BOTRIGHT_Y_LIMIT 0x1fff | ||
151 | #define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x1fff) << 0) | ||
152 | |||
153 | #define VIDOSDxC_ALPHA0_R_F(_x) (((_x) & 0xFF) << 16) | ||
154 | #define VIDOSDxC_ALPHA0_G_F(_x) (((_x) & 0xFF) << 8) | ||
155 | #define VIDOSDxC_ALPHA0_B_F(_x) (((_x) & 0xFF) << 0) | ||
156 | |||
157 | #define VIDOSDxD_ALPHA1_R_F(_x) (((_x) & 0xFF) << 16) | ||
158 | #define VIDOSDxD_ALPHA1_G_F(_x) (((_x) & 0xFF) << 8) | ||
159 | #define VIDOSDxD_ALPHA1_B_F(_x) (((_x) & 0xFF) >> 0) | ||
160 | |||
161 | /* Window MAP (Color map) */ | ||
162 | #define WINxMAP(_win) (0x340 + ((_win) * 4)) | ||
163 | |||
164 | #define WINxMAP_MAP (1 << 24) | ||
165 | #define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0) | ||
166 | #define WINxMAP_MAP_COLOUR_SHIFT 0 | ||
167 | #define WINxMAP_MAP_COLOUR_LIMIT 0xffffff | ||
168 | #define WINxMAP_MAP_COLOUR(_x) ((_x) << 0) | ||
169 | |||
170 | /* Window colour-key control registers */ | ||
171 | #define WKEYCON 0x370 | ||
172 | |||
173 | #define WKEYCON0 0x00 | ||
174 | #define WKEYCON1 0x04 | ||
175 | #define WxKEYCON0_KEYBL_EN (1 << 26) | ||
176 | #define WxKEYCON0_KEYEN_F (1 << 25) | ||
177 | #define WxKEYCON0_DIRCON (1 << 24) | ||
178 | #define WxKEYCON0_COMPKEY_MASK (0xffffff << 0) | ||
179 | #define WxKEYCON0_COMPKEY_SHIFT 0 | ||
180 | #define WxKEYCON0_COMPKEY_LIMIT 0xffffff | ||
181 | #define WxKEYCON0_COMPKEY(_x) ((_x) << 0) | ||
182 | #define WxKEYCON1_COLVAL_MASK (0xffffff << 0) | ||
183 | #define WxKEYCON1_COLVAL_SHIFT 0 | ||
184 | #define WxKEYCON1_COLVAL_LIMIT 0xffffff | ||
185 | #define WxKEYCON1_COLVAL(_x) ((_x) << 0) | ||
186 | |||
187 | /* color key control register for hardware window 1 ~ 4. */ | ||
188 | #define WKEYCON0_BASE(x) ((WKEYCON + WKEYCON0) + ((x - 1) * 8)) | ||
189 | /* color key value register for hardware window 1 ~ 4. */ | ||
190 | #define WKEYCON1_BASE(x) ((WKEYCON + WKEYCON1) + ((x - 1) * 8)) | ||
191 | |||
192 | /* Window KEY Alpha value */ | ||
193 | #define WxKEYALPHA(_win) (0x3A0 + (((_win) - 1) * 0x4)) | ||
194 | |||
195 | #define Wx_KEYALPHA_R_F_SHIFT 16 | ||
196 | #define Wx_KEYALPHA_G_F_SHIFT 8 | ||
197 | #define Wx_KEYALPHA_B_F_SHIFT 0 | ||
198 | |||
199 | /* Blending equation */ | ||
200 | #define BLENDE(_win) (0x03C0 + ((_win) * 4)) | ||
201 | #define BLENDE_COEF_ZERO 0x0 | ||
202 | #define BLENDE_COEF_ONE 0x1 | ||
203 | #define BLENDE_COEF_ALPHA_A 0x2 | ||
204 | #define BLENDE_COEF_ONE_MINUS_ALPHA_A 0x3 | ||
205 | #define BLENDE_COEF_ALPHA_B 0x4 | ||
206 | #define BLENDE_COEF_ONE_MINUS_ALPHA_B 0x5 | ||
207 | #define BLENDE_COEF_ALPHA0 0x6 | ||
208 | #define BLENDE_COEF_A 0xA | ||
209 | #define BLENDE_COEF_ONE_MINUS_A 0xB | ||
210 | #define BLENDE_COEF_B 0xC | ||
211 | #define BLENDE_COEF_ONE_MINUS_B 0xD | ||
212 | #define BLENDE_Q_FUNC(_v) ((_v) << 18) | ||
213 | #define BLENDE_P_FUNC(_v) ((_v) << 12) | ||
214 | #define BLENDE_B_FUNC(_v) ((_v) << 6) | ||
215 | #define BLENDE_A_FUNC(_v) ((_v) << 0) | ||
216 | |||
217 | /* Blending equation control */ | ||
218 | #define BLENDCON 0x3D8 | ||
219 | #define BLENDCON_NEW_MASK (1 << 0) | ||
220 | #define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0) | ||
221 | #define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0) | ||
222 | |||
223 | /* Interrupt control register */ | ||
224 | #define VIDINTCON0 0x500 | ||
225 | |||
226 | #define VIDINTCON0_WAKEUP_MASK (0x3f << 26) | ||
227 | #define VIDINTCON0_INTEXTRAEN (1 << 21) | ||
228 | |||
229 | #define VIDINTCON0_FRAMESEL0_SHIFT 15 | ||
230 | #define VIDINTCON0_FRAMESEL0_MASK (0x3 << 15) | ||
231 | #define VIDINTCON0_FRAMESEL0_BACKPORCH (0x0 << 15) | ||
232 | #define VIDINTCON0_FRAMESEL0_VSYNC (0x1 << 15) | ||
233 | #define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15) | ||
234 | #define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) | ||
235 | |||
236 | #define VIDINTCON0_INT_FRAME (1 << 11) | ||
237 | |||
238 | #define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 3) | ||
239 | #define VIDINTCON0_FIFOLEVEL_SHIFT 3 | ||
240 | #define VIDINTCON0_FIFOLEVEL_EMPTY (0x0 << 3) | ||
241 | #define VIDINTCON0_FIFOLEVEL_TO25PC (0x1 << 3) | ||
242 | #define VIDINTCON0_FIFOLEVEL_TO50PC (0x2 << 3) | ||
243 | #define VIDINTCON0_FIFOLEVEL_FULL (0x4 << 3) | ||
244 | |||
245 | #define VIDINTCON0_FIFOSEL_MAIN_EN (1 << 1) | ||
246 | #define VIDINTCON0_INT_FIFO (1 << 1) | ||
247 | |||
248 | #define VIDINTCON0_INT_ENABLE (1 << 0) | ||
249 | |||
250 | /* Interrupt controls and status register */ | ||
251 | #define VIDINTCON1 0x504 | ||
252 | |||
253 | #define VIDINTCON1_INT_EXTRA (1 << 3) | ||
254 | #define VIDINTCON1_INT_I80 (1 << 2) | ||
255 | #define VIDINTCON1_INT_FRAME (1 << 1) | ||
256 | #define VIDINTCON1_INT_FIFO (1 << 0) | ||
257 | |||
258 | /* VIDCON1 */ | ||
259 | #define VIDCON1(_x) (0x0600 + ((_x) * 0x50)) | ||
260 | #define VIDCON1_LINECNT_GET(_v) (((_v) >> 17) & 0x1fff) | ||
261 | #define VIDCON1_VCLK_MASK (0x3 << 9) | ||
262 | #define VIDCON1_VCLK_HOLD (0x0 << 9) | ||
263 | #define VIDCON1_VCLK_RUN (0x1 << 9) | ||
264 | #define VIDCON1_VCLK_RUN_VDEN_DISABLE (0x3 << 9) | ||
265 | #define VIDCON1_RGB_ORDER_O_MASK (0x7 << 4) | ||
266 | #define VIDCON1_RGB_ORDER_O_RGB (0x0 << 4) | ||
267 | #define VIDCON1_RGB_ORDER_O_GBR (0x1 << 4) | ||
268 | #define VIDCON1_RGB_ORDER_O_BRG (0x2 << 4) | ||
269 | #define VIDCON1_RGB_ORDER_O_BGR (0x4 << 4) | ||
270 | #define VIDCON1_RGB_ORDER_O_RBG (0x5 << 4) | ||
271 | #define VIDCON1_RGB_ORDER_O_GRB (0x6 << 4) | ||
272 | |||
273 | /* VIDTCON0 */ | ||
274 | #define VIDTCON0 0x610 | ||
275 | |||
276 | #define VIDTCON0_VBPD_MASK (0xffff << 16) | ||
277 | #define VIDTCON0_VBPD_SHIFT 16 | ||
278 | #define VIDTCON0_VBPD_LIMIT 0xffff | ||
279 | #define VIDTCON0_VBPD(_x) ((_x) << 16) | ||
280 | |||
281 | #define VIDTCON0_VFPD_MASK (0xffff << 0) | ||
282 | #define VIDTCON0_VFPD_SHIFT 0 | ||
283 | #define VIDTCON0_VFPD_LIMIT 0xffff | ||
284 | #define VIDTCON0_VFPD(_x) ((_x) << 0) | ||
285 | |||
286 | /* VIDTCON1 */ | ||
287 | #define VIDTCON1 0x614 | ||
288 | |||
289 | #define VIDTCON1_VSPW_MASK (0xffff << 16) | ||
290 | #define VIDTCON1_VSPW_SHIFT 16 | ||
291 | #define VIDTCON1_VSPW_LIMIT 0xffff | ||
292 | #define VIDTCON1_VSPW(_x) ((_x) << 16) | ||
293 | |||
294 | /* VIDTCON2 */ | ||
295 | #define VIDTCON2 0x618 | ||
296 | |||
297 | #define VIDTCON2_HBPD_MASK (0xffff << 16) | ||
298 | #define VIDTCON2_HBPD_SHIFT 16 | ||
299 | #define VIDTCON2_HBPD_LIMIT 0xffff | ||
300 | #define VIDTCON2_HBPD(_x) ((_x) << 16) | ||
301 | |||
302 | #define VIDTCON2_HFPD_MASK (0xffff << 0) | ||
303 | #define VIDTCON2_HFPD_SHIFT 0 | ||
304 | #define VIDTCON2_HFPD_LIMIT 0xffff | ||
305 | #define VIDTCON2_HFPD(_x) ((_x) << 0) | ||
306 | |||
307 | /* VIDTCON3 */ | ||
308 | #define VIDTCON3 0x61C | ||
309 | |||
310 | #define VIDTCON3_HSPW_MASK (0xffff << 16) | ||
311 | #define VIDTCON3_HSPW_SHIFT 16 | ||
312 | #define VIDTCON3_HSPW_LIMIT 0xffff | ||
313 | #define VIDTCON3_HSPW(_x) ((_x) << 16) | ||
314 | |||
315 | /* VIDTCON4 */ | ||
316 | #define VIDTCON4 0x620 | ||
317 | |||
318 | #define VIDTCON4_LINEVAL_MASK (0xfff << 16) | ||
319 | #define VIDTCON4_LINEVAL_SHIFT 16 | ||
320 | #define VIDTCON4_LINEVAL_LIMIT 0xfff | ||
321 | #define VIDTCON4_LINEVAL(_x) (((_x) & 0xfff) << 16) | ||
322 | |||
323 | #define VIDTCON4_HOZVAL_MASK (0xfff << 0) | ||
324 | #define VIDTCON4_HOZVAL_SHIFT 0 | ||
325 | #define VIDTCON4_HOZVAL_LIMIT 0xfff | ||
326 | #define VIDTCON4_HOZVAL(_x) (((_x) & 0xfff) << 0) | ||
327 | |||
328 | /* LINECNT OP THRSHOLD*/ | ||
329 | #define LINECNT_OP_THRESHOLD 0x630 | ||
330 | |||
331 | /* CRCCTRL */ | ||
332 | #define CRCCTRL 0x6C8 | ||
333 | #define CRCCTRL_CRCCLKEN (0x1 << 2) | ||
334 | #define CRCCTRL_CRCSTART_F (0x1 << 1) | ||
335 | #define CRCCTRL_CRCEN (0x1 << 0) | ||
336 | |||
337 | /* DECON_CMU */ | ||
338 | #define DECON_CMU 0x704 | ||
339 | |||
340 | #define DECON_CMU_ALL_CLKGATE_ENABLE 0x3 | ||
341 | #define DECON_CMU_SE_CLKGATE_ENABLE (0x1 << 2) | ||
342 | #define DECON_CMU_SFR_CLKGATE_ENABLE (0x1 << 1) | ||
343 | #define DECON_CMU_MEM_CLKGATE_ENABLE (0x1 << 0) | ||
344 | |||
345 | /* DECON_UPDATE */ | ||
346 | #define DECON_UPDATE 0x710 | ||
347 | |||
348 | #define DECON_UPDATE_SLAVE_SYNC (1 << 4) | ||
349 | #define DECON_UPDATE_STANDALONE_F (1 << 0) | ||
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index c74bf4a0520e..73390c120cad 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/bitmap.h> | 17 | #include <linux/bitmap.h> |
18 | #include <linux/fb.h> | 18 | #include <linux/fb.h> |
19 | #include <media/v4l2-mediabus.h> | 19 | #include <media/v4l2-mediabus.h> |
20 | #include <video/videomode.h> | ||
20 | 21 | ||
21 | struct ipu_soc; | 22 | struct ipu_soc; |
22 | 23 | ||
@@ -32,28 +33,15 @@ enum ipuv3_type { | |||
32 | * Bitfield of Display Interface signal polarities. | 33 | * Bitfield of Display Interface signal polarities. |
33 | */ | 34 | */ |
34 | struct ipu_di_signal_cfg { | 35 | struct ipu_di_signal_cfg { |
35 | unsigned datamask_en:1; | ||
36 | unsigned interlaced:1; | ||
37 | unsigned odd_field_first:1; | ||
38 | unsigned clksel_en:1; | ||
39 | unsigned clkidle_en:1; | ||
40 | unsigned data_pol:1; /* true = inverted */ | 36 | unsigned data_pol:1; /* true = inverted */ |
41 | unsigned clk_pol:1; /* true = rising edge */ | 37 | unsigned clk_pol:1; /* true = rising edge */ |
42 | unsigned enable_pol:1; | 38 | unsigned enable_pol:1; |
43 | unsigned Hsync_pol:1; /* true = active high */ | ||
44 | unsigned Vsync_pol:1; | ||
45 | 39 | ||
46 | u16 width; | 40 | struct videomode mode; |
47 | u16 height; | 41 | |
48 | u32 pixel_fmt; | 42 | u32 pixel_fmt; |
49 | u16 h_start_width; | ||
50 | u16 h_sync_width; | ||
51 | u16 h_end_width; | ||
52 | u16 v_start_width; | ||
53 | u16 v_sync_width; | ||
54 | u16 v_end_width; | ||
55 | u32 v_to_h_sync; | 43 | u32 v_to_h_sync; |
56 | unsigned long pixelclock; | 44 | |
57 | #define IPU_DI_CLKMODE_SYNC (1 << 0) | 45 | #define IPU_DI_CLKMODE_SYNC (1 << 0) |
58 | #define IPU_DI_CLKMODE_EXT (1 << 1) | 46 | #define IPU_DI_CLKMODE_EXT (1 << 1) |
59 | unsigned long clkflags; | 47 | unsigned long clkflags; |
@@ -236,6 +224,7 @@ void ipu_di_put(struct ipu_di *); | |||
236 | int ipu_di_disable(struct ipu_di *); | 224 | int ipu_di_disable(struct ipu_di *); |
237 | int ipu_di_enable(struct ipu_di *); | 225 | int ipu_di_enable(struct ipu_di *); |
238 | int ipu_di_get_num(struct ipu_di *); | 226 | int ipu_di_get_num(struct ipu_di *); |
227 | int ipu_di_adjust_videomode(struct ipu_di *di, struct videomode *mode); | ||
239 | int ipu_di_init_sync_panel(struct ipu_di *, struct ipu_di_signal_cfg *sig); | 228 | int ipu_di_init_sync_panel(struct ipu_di *, struct ipu_di_signal_cfg *sig); |
240 | 229 | ||
241 | /* | 230 | /* |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 6a84498ea513..60de61fea8e3 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -314,6 +314,7 @@ enum omapdss_version { | |||
314 | OMAPDSS_VER_OMAP4, /* All other OMAP4s */ | 314 | OMAPDSS_VER_OMAP4, /* All other OMAP4s */ |
315 | OMAPDSS_VER_OMAP5, | 315 | OMAPDSS_VER_OMAP5, |
316 | OMAPDSS_VER_AM43xx, | 316 | OMAPDSS_VER_AM43xx, |
317 | OMAPDSS_VER_DRA7xx, | ||
317 | }; | 318 | }; |
318 | 319 | ||
319 | /* Board specific data */ | 320 | /* Board specific data */ |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 3387465b9caa..143ca5ffab7a 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -45,6 +45,8 @@ | |||
45 | #include <asm/xen/hypervisor.h> | 45 | #include <asm/xen/hypervisor.h> |
46 | 46 | ||
47 | #include <xen/features.h> | 47 | #include <xen/features.h> |
48 | #include <linux/mm_types.h> | ||
49 | #include <linux/page-flags.h> | ||
48 | 50 | ||
49 | #define GNTTAB_RESERVED_XENSTORE 1 | 51 | #define GNTTAB_RESERVED_XENSTORE 1 |
50 | 52 | ||
@@ -58,6 +60,22 @@ struct gnttab_free_callback { | |||
58 | u16 count; | 60 | u16 count; |
59 | }; | 61 | }; |
60 | 62 | ||
63 | struct gntab_unmap_queue_data; | ||
64 | |||
65 | typedef void (*gnttab_unmap_refs_done)(int result, struct gntab_unmap_queue_data *data); | ||
66 | |||
67 | struct gntab_unmap_queue_data | ||
68 | { | ||
69 | struct delayed_work gnttab_work; | ||
70 | void *data; | ||
71 | gnttab_unmap_refs_done done; | ||
72 | struct gnttab_unmap_grant_ref *unmap_ops; | ||
73 | struct gnttab_unmap_grant_ref *kunmap_ops; | ||
74 | struct page **pages; | ||
75 | unsigned int count; | ||
76 | unsigned int age; | ||
77 | }; | ||
78 | |||
61 | int gnttab_init(void); | 79 | int gnttab_init(void); |
62 | int gnttab_suspend(void); | 80 | int gnttab_suspend(void); |
63 | int gnttab_resume(void); | 81 | int gnttab_resume(void); |
@@ -163,12 +181,17 @@ void gnttab_free_auto_xlat_frames(void); | |||
163 | 181 | ||
164 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 182 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
165 | 183 | ||
184 | int gnttab_alloc_pages(int nr_pages, struct page **pages); | ||
185 | void gnttab_free_pages(int nr_pages, struct page **pages); | ||
186 | |||
166 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | 187 | int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, |
167 | struct gnttab_map_grant_ref *kmap_ops, | 188 | struct gnttab_map_grant_ref *kmap_ops, |
168 | struct page **pages, unsigned int count); | 189 | struct page **pages, unsigned int count); |
169 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 190 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
170 | struct gnttab_map_grant_ref *kunmap_ops, | 191 | struct gnttab_unmap_grant_ref *kunmap_ops, |
171 | struct page **pages, unsigned int count); | 192 | struct page **pages, unsigned int count); |
193 | void gnttab_unmap_refs_async(struct gntab_unmap_queue_data* item); | ||
194 | |||
172 | 195 | ||
173 | /* Perform a batch of grant map/copy operations. Retry every batch slot | 196 | /* Perform a batch of grant map/copy operations. Retry every batch slot |
174 | * for which the hypervisor returns GNTST_eagain. This is typically due | 197 | * for which the hypervisor returns GNTST_eagain. This is typically due |
@@ -182,4 +205,22 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
182 | void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count); | 205 | void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count); |
183 | void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count); | 206 | void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count); |
184 | 207 | ||
208 | |||
209 | struct xen_page_foreign { | ||
210 | domid_t domid; | ||
211 | grant_ref_t gref; | ||
212 | }; | ||
213 | |||
214 | static inline struct xen_page_foreign *xen_page_foreign(struct page *page) | ||
215 | { | ||
216 | if (!PageForeign(page)) | ||
217 | return NULL; | ||
218 | #if BITS_PER_LONG < 64 | ||
219 | return (struct xen_page_foreign *)page->private; | ||
220 | #else | ||
221 | BUILD_BUG_ON(sizeof(struct xen_page_foreign) > BITS_PER_LONG); | ||
222 | return (struct xen_page_foreign *)&page->private; | ||
223 | #endif | ||
224 | } | ||
225 | |||
185 | #endif /* __ASM_GNTTAB_H__ */ | 226 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index 131a6ccdba25..6ad3d110bb81 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h | |||
@@ -41,6 +41,12 @@ | |||
41 | /* x86: Does this Xen host support the MMU_PT_UPDATE_PRESERVE_AD hypercall? */ | 41 | /* x86: Does this Xen host support the MMU_PT_UPDATE_PRESERVE_AD hypercall? */ |
42 | #define XENFEAT_mmu_pt_update_preserve_ad 5 | 42 | #define XENFEAT_mmu_pt_update_preserve_ad 5 |
43 | 43 | ||
44 | /* | ||
45 | * If set, GNTTABOP_map_grant_ref honors flags to be placed into guest kernel | ||
46 | * available pte bits. | ||
47 | */ | ||
48 | #define XENFEAT_gnttab_map_avail_bits 7 | ||
49 | |||
44 | /* x86: Does this Xen host support the HVM callback vector type? */ | 50 | /* x86: Does this Xen host support the HVM callback vector type? */ |
45 | #define XENFEAT_hvm_callback_vector 8 | 51 | #define XENFEAT_hvm_callback_vector 8 |
46 | 52 | ||
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h index bcce56439d64..56806bc90c2f 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h | |||
@@ -526,6 +526,13 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_cache_flush); | |||
526 | #define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte) | 526 | #define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte) |
527 | 527 | ||
528 | /* | 528 | /* |
529 | * Bits to be placed in guest kernel available PTE bits (architecture | ||
530 | * dependent; only supported when XENFEAT_gnttab_map_avail_bits is set). | ||
531 | */ | ||
532 | #define _GNTMAP_guest_avail0 (16) | ||
533 | #define GNTMAP_guest_avail_mask ((uint32_t)~0 << _GNTMAP_guest_avail0) | ||
534 | |||
535 | /* | ||
529 | * Values for error status returns. All errors are -ve. | 536 | * Values for error status returns. All errors are -ve. |
530 | */ | 537 | */ |
531 | #define GNTST_okay (0) /* Normal return. */ | 538 | #define GNTST_okay (0) /* Normal return. */ |
diff --git a/include/xen/page.h b/include/xen/page.h index 12765b6f9517..c5ed20bb3fe9 100644 --- a/include/xen/page.h +++ b/include/xen/page.h | |||
@@ -3,6 +3,11 @@ | |||
3 | 3 | ||
4 | #include <asm/xen/page.h> | 4 | #include <asm/xen/page.h> |
5 | 5 | ||
6 | static inline unsigned long page_to_mfn(struct page *page) | ||
7 | { | ||
8 | return pfn_to_mfn(page_to_pfn(page)); | ||
9 | } | ||
10 | |||
6 | struct xen_memory_region { | 11 | struct xen_memory_region { |
7 | phys_addr_t start; | 12 | phys_addr_t start; |
8 | phys_addr_t size; | 13 | phys_addr_t size; |