diff options
Diffstat (limited to 'include')
456 files changed, 12333 insertions, 3876 deletions
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h index a1e45cdd729a..c927a0b1de78 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 0943457e0fa5..14ceff788c40 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -138,7 +138,7 @@ | |||
138 | 138 | ||
139 | /* Maximum sleep allowed via Sleep() operator */ | 139 | /* Maximum sleep allowed via Sleep() operator */ |
140 | 140 | ||
141 | #define ACPI_MAX_SLEEP 2000 /* Two seconds */ | 141 | #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ |
142 | 142 | ||
143 | /* Address Range lists are per-space_id (Memory and I/O only) */ | 143 | /* Address Range lists are per-space_id (Memory and I/O only) */ |
144 | 144 | ||
@@ -150,11 +150,6 @@ | |||
150 | * | 150 | * |
151 | *****************************************************************************/ | 151 | *****************************************************************************/ |
152 | 152 | ||
153 | /* Number of distinct GPE register blocks and register width */ | ||
154 | |||
155 | #define ACPI_MAX_GPE_BLOCKS 2 | ||
156 | #define ACPI_GPE_REGISTER_WIDTH 8 | ||
157 | |||
158 | /* Method info (in WALK_STATE), containing local variables and argumetns */ | 153 | /* Method info (in WALK_STATE), containing local variables and argumetns */ |
159 | 154 | ||
160 | #define ACPI_METHOD_NUM_LOCALS 8 | 155 | #define ACPI_METHOD_NUM_LOCALS 8 |
@@ -163,12 +158,6 @@ | |||
163 | #define ACPI_METHOD_NUM_ARGS 7 | 158 | #define ACPI_METHOD_NUM_ARGS 7 |
164 | #define ACPI_METHOD_MAX_ARG 6 | 159 | #define ACPI_METHOD_MAX_ARG 6 |
165 | 160 | ||
166 | /* Length of _HID, _UID, _CID, and UUID values */ | ||
167 | |||
168 | #define ACPI_DEVICE_ID_LENGTH 0x09 | ||
169 | #define ACPI_MAX_CID_LENGTH 48 | ||
170 | #define ACPI_UUID_LENGTH 16 | ||
171 | |||
172 | /* | 161 | /* |
173 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG | 162 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG |
174 | */ | 163 | */ |
@@ -186,17 +175,6 @@ | |||
186 | */ | 175 | */ |
187 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 | 176 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 |
188 | 177 | ||
189 | /* Names within the namespace are 4 bytes long */ | ||
190 | |||
191 | #define ACPI_NAME_SIZE 4 | ||
192 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ | ||
193 | #define ACPI_PATH_SEPARATOR '.' | ||
194 | |||
195 | /* Sizes for ACPI table headers */ | ||
196 | |||
197 | #define ACPI_OEM_ID_SIZE 6 | ||
198 | #define ACPI_OEM_TABLE_ID_SIZE 8 | ||
199 | |||
200 | /* Constants used in searching for the RSDP in low memory */ | 178 | /* Constants used in searching for the RSDP in low memory */ |
201 | 179 | ||
202 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ | 180 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ |
@@ -213,6 +191,7 @@ | |||
213 | /* Maximum space_ids for Operation Regions */ | 191 | /* Maximum space_ids for Operation Regions */ |
214 | 192 | ||
215 | #define ACPI_MAX_ADDRESS_SPACE 255 | 193 | #define ACPI_MAX_ADDRESS_SPACE 255 |
194 | #define ACPI_NUM_DEFAULT_SPACES 4 | ||
216 | 195 | ||
217 | /* Array sizes. Used for range checking also */ | 196 | /* Array sizes. Used for range checking also */ |
218 | 197 | ||
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 6c3890e02140..9bf59d0e8aaa 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 7665df663284..ce08ef7d969c 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 2457ac849655..9885276178e0 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -72,6 +72,7 @@ | |||
72 | #define ACPI_EXAMPLE 0x00004000 | 72 | #define ACPI_EXAMPLE 0x00004000 |
73 | #define ACPI_DRIVER 0x00008000 | 73 | #define ACPI_DRIVER 0x00008000 |
74 | #define DT_COMPILER 0x00010000 | 74 | #define DT_COMPILER 0x00010000 |
75 | #define ASL_PREPROCESSOR 0x00020000 | ||
75 | 76 | ||
76 | #define ACPI_ALL_COMPONENTS 0x0001FFFF | 77 | #define ACPI_ALL_COMPONENTS 0x0001FFFF |
77 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) | 78 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) |
@@ -262,18 +263,140 @@ | |||
262 | * Common parameters used for debug output functions: | 263 | * Common parameters used for debug output functions: |
263 | * line number, function name, module(file) name, component ID | 264 | * line number, function name, module(file) name, component ID |
264 | */ | 265 | */ |
265 | #define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | 266 | #define ACPI_DEBUG_PARAMETERS \ |
267 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ||
268 | |||
269 | /* Check if debug output is currently dynamically enabled */ | ||
270 | |||
271 | #define ACPI_IS_DEBUG_ENABLED(level, component) \ | ||
272 | ((level & acpi_dbg_level) && (component & acpi_dbg_layer)) | ||
266 | 273 | ||
267 | /* | 274 | /* |
268 | * Master debug print macros | 275 | * Master debug print macros |
269 | * Print message if and only if: | 276 | * Print message if and only if: |
270 | * 1) Debug print for the current component is enabled | 277 | * 1) Debug print for the current component is enabled |
271 | * 2) Debug error level or trace level for the print statement is enabled | 278 | * 2) Debug error level or trace level for the print statement is enabled |
279 | * | ||
280 | * November 2012: Moved the runtime check for whether to actually emit the | ||
281 | * debug message outside of the print function itself. This improves overall | ||
282 | * performance at a relatively small code cost. Implementation involves the | ||
283 | * use of variadic macros supported by C99. | ||
284 | * | ||
285 | * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from | ||
286 | * complaining about these constructs. On other compilers the do...while | ||
287 | * adds some extra code, so this feature is optional. | ||
272 | */ | 288 | */ |
273 | #define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist | 289 | #ifdef ACPI_USE_DO_WHILE_0 |
274 | #define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist | 290 | #define ACPI_DO_WHILE0(a) do a while(0) |
275 | |||
276 | #else | 291 | #else |
292 | #define ACPI_DO_WHILE0(a) a | ||
293 | #endif | ||
294 | |||
295 | /* DEBUG_PRINT functions */ | ||
296 | |||
297 | #define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist | ||
298 | #define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist | ||
299 | |||
300 | /* Helper macros for DEBUG_PRINT */ | ||
301 | |||
302 | #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \ | ||
303 | ACPI_DO_WHILE0 ({ \ | ||
304 | if (ACPI_IS_DEBUG_ENABLED (level, component)) \ | ||
305 | { \ | ||
306 | function (level, line, filename, modulename, component, __VA_ARGS__); \ | ||
307 | } \ | ||
308 | }) | ||
309 | |||
310 | #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ | ||
311 | ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \ | ||
312 | filename, modulename, component, __VA_ARGS__) | ||
313 | |||
314 | #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ | ||
315 | ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \ | ||
316 | filename, modulename, component, __VA_ARGS__) | ||
317 | |||
318 | /* | ||
319 | * Function entry tracing | ||
320 | * | ||
321 | * The name of the function is emitted as a local variable that is | ||
322 | * intended to be used by both the entry trace and the exit trace. | ||
323 | */ | ||
324 | |||
325 | /* Helper macro */ | ||
326 | |||
327 | #define ACPI_TRACE_ENTRY(name, function, cast, param) \ | ||
328 | ACPI_FUNCTION_NAME (name) \ | ||
329 | function (ACPI_DEBUG_PARAMETERS, cast (param)) | ||
330 | |||
331 | /* The actual entry trace macros */ | ||
332 | |||
333 | #define ACPI_FUNCTION_TRACE(name) \ | ||
334 | ACPI_FUNCTION_NAME(name) \ | ||
335 | acpi_ut_trace (ACPI_DEBUG_PARAMETERS) | ||
336 | |||
337 | #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \ | ||
338 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer) | ||
339 | |||
340 | #define ACPI_FUNCTION_TRACE_U32(name, value) \ | ||
341 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value) | ||
342 | |||
343 | #define ACPI_FUNCTION_TRACE_STR(name, string) \ | ||
344 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string) | ||
345 | |||
346 | #define ACPI_FUNCTION_ENTRY() \ | ||
347 | acpi_ut_track_stack_ptr() | ||
348 | |||
349 | /* | ||
350 | * Function exit tracing | ||
351 | * | ||
352 | * These macros include a return statement. This is usually considered | ||
353 | * bad form, but having a separate exit macro before the actual return | ||
354 | * is very ugly and difficult to maintain. | ||
355 | * | ||
356 | * One of the FUNCTION_TRACE macros above must be used in conjunction | ||
357 | * with these macros so that "_AcpiFunctionName" is defined. | ||
358 | */ | ||
359 | |||
360 | /* Exit trace helper macro */ | ||
361 | |||
362 | #define ACPI_TRACE_EXIT(function, cast, param) \ | ||
363 | ACPI_DO_WHILE0 ({ \ | ||
364 | function (ACPI_DEBUG_PARAMETERS, cast (param)); \ | ||
365 | return ((param)); \ | ||
366 | }) | ||
367 | |||
368 | /* The actual exit macros */ | ||
369 | |||
370 | #define return_VOID \ | ||
371 | ACPI_DO_WHILE0 ({ \ | ||
372 | acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ | ||
373 | return; \ | ||
374 | }) | ||
375 | |||
376 | #define return_ACPI_STATUS(status) \ | ||
377 | ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status) | ||
378 | |||
379 | #define return_PTR(pointer) \ | ||
380 | ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer) | ||
381 | |||
382 | #define return_VALUE(value) \ | ||
383 | ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value) | ||
384 | |||
385 | /* Conditional execution */ | ||
386 | |||
387 | #define ACPI_DEBUG_EXEC(a) a | ||
388 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; | ||
389 | #define _VERBOSE_STRUCTURES | ||
390 | |||
391 | /* Various object display routines for debug */ | ||
392 | |||
393 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0) | ||
394 | #define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c) | ||
395 | #define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b) | ||
396 | #define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d) | ||
397 | #define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) | ||
398 | |||
399 | #else /* ACPI_DEBUG_OUTPUT */ | ||
277 | /* | 400 | /* |
278 | * This is the non-debug case -- make everything go away, | 401 | * This is the non-debug case -- make everything go away, |
279 | * leaving no executable debug code! | 402 | * leaving no executable debug code! |
@@ -281,6 +404,32 @@ | |||
281 | #define ACPI_FUNCTION_NAME(a) | 404 | #define ACPI_FUNCTION_NAME(a) |
282 | #define ACPI_DEBUG_PRINT(pl) | 405 | #define ACPI_DEBUG_PRINT(pl) |
283 | #define ACPI_DEBUG_PRINT_RAW(pl) | 406 | #define ACPI_DEBUG_PRINT_RAW(pl) |
407 | #define ACPI_DEBUG_EXEC(a) | ||
408 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | ||
409 | #define ACPI_FUNCTION_TRACE(a) | ||
410 | #define ACPI_FUNCTION_TRACE_PTR(a, b) | ||
411 | #define ACPI_FUNCTION_TRACE_U32(a, b) | ||
412 | #define ACPI_FUNCTION_TRACE_STR(a, b) | ||
413 | #define ACPI_FUNCTION_EXIT | ||
414 | #define ACPI_FUNCTION_STATUS_EXIT(s) | ||
415 | #define ACPI_FUNCTION_VALUE_EXIT(s) | ||
416 | #define ACPI_FUNCTION_ENTRY() | ||
417 | #define ACPI_DUMP_STACK_ENTRY(a) | ||
418 | #define ACPI_DUMP_OPERANDS(a, b, c) | ||
419 | #define ACPI_DUMP_ENTRY(a, b) | ||
420 | #define ACPI_DUMP_TABLES(a, b) | ||
421 | #define ACPI_DUMP_PATHNAME(a, b, c, d) | ||
422 | #define ACPI_DUMP_BUFFER(a, b) | ||
423 | #define ACPI_DEBUG_PRINT(pl) | ||
424 | #define ACPI_DEBUG_PRINT_RAW(pl) | ||
425 | #define ACPI_IS_DEBUG_ENABLED(level, component) 0 | ||
426 | |||
427 | /* Return macros must have a return statement at the minimum */ | ||
428 | |||
429 | #define return_VOID return | ||
430 | #define return_ACPI_STATUS(s) return(s) | ||
431 | #define return_VALUE(s) return(s) | ||
432 | #define return_PTR(s) return(s) | ||
284 | 433 | ||
285 | #endif /* ACPI_DEBUG_OUTPUT */ | 434 | #endif /* ACPI_DEBUG_OUTPUT */ |
286 | 435 | ||
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index c1ea8436961f..618787715d56 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7ced5dc20dd3..e65278f560c4 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -84,28 +84,29 @@ struct acpi_driver; | |||
84 | struct acpi_device; | 84 | struct acpi_device; |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * ACPI Scan Handler | ||
88 | * ----------------- | ||
89 | */ | ||
90 | |||
91 | struct acpi_scan_handler { | ||
92 | const struct acpi_device_id *ids; | ||
93 | struct list_head list_node; | ||
94 | int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); | ||
95 | void (*detach)(struct acpi_device *dev); | ||
96 | }; | ||
97 | |||
98 | /* | ||
87 | * ACPI Driver | 99 | * ACPI Driver |
88 | * ----------- | 100 | * ----------- |
89 | */ | 101 | */ |
90 | 102 | ||
91 | typedef int (*acpi_op_add) (struct acpi_device * device); | 103 | typedef int (*acpi_op_add) (struct acpi_device * device); |
92 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); | 104 | typedef int (*acpi_op_remove) (struct acpi_device * device); |
93 | typedef int (*acpi_op_start) (struct acpi_device * device); | ||
94 | typedef int (*acpi_op_bind) (struct acpi_device * device); | ||
95 | typedef int (*acpi_op_unbind) (struct acpi_device * device); | ||
96 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); | 105 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); |
97 | 106 | ||
98 | struct acpi_bus_ops { | ||
99 | u32 acpi_op_add:1; | ||
100 | u32 acpi_op_start:1; | ||
101 | }; | ||
102 | |||
103 | struct acpi_device_ops { | 107 | struct acpi_device_ops { |
104 | acpi_op_add add; | 108 | acpi_op_add add; |
105 | acpi_op_remove remove; | 109 | acpi_op_remove remove; |
106 | acpi_op_start start; | ||
107 | acpi_op_bind bind; | ||
108 | acpi_op_unbind unbind; | ||
109 | acpi_op_notify notify; | 110 | acpi_op_notify notify; |
110 | }; | 111 | }; |
111 | 112 | ||
@@ -148,7 +149,8 @@ struct acpi_device_flags { | |||
148 | u32 power_manageable:1; | 149 | u32 power_manageable:1; |
149 | u32 performance_manageable:1; | 150 | u32 performance_manageable:1; |
150 | u32 eject_pending:1; | 151 | u32 eject_pending:1; |
151 | u32 reserved:24; | 152 | u32 match_driver:1; |
153 | u32 reserved:23; | ||
152 | }; | 154 | }; |
153 | 155 | ||
154 | /* File System */ | 156 | /* File System */ |
@@ -207,7 +209,7 @@ struct acpi_device_power_state { | |||
207 | } flags; | 209 | } flags; |
208 | int power; /* % Power (compared to D0) */ | 210 | int power; /* % Power (compared to D0) */ |
209 | int latency; /* Dx->D0 time (microseconds) */ | 211 | int latency; /* Dx->D0 time (microseconds) */ |
210 | struct acpi_handle_list resources; /* Power resources referenced */ | 212 | struct list_head resources; /* Power resources referenced */ |
211 | }; | 213 | }; |
212 | 214 | ||
213 | struct acpi_device_power { | 215 | struct acpi_device_power { |
@@ -250,7 +252,7 @@ struct acpi_device_wakeup { | |||
250 | acpi_handle gpe_device; | 252 | acpi_handle gpe_device; |
251 | u64 gpe_number; | 253 | u64 gpe_number; |
252 | u64 sleep_state; | 254 | u64 sleep_state; |
253 | struct acpi_handle_list resources; | 255 | struct list_head resources; |
254 | struct acpi_device_wakeup_flags flags; | 256 | struct acpi_device_wakeup_flags flags; |
255 | int prepare_count; | 257 | int prepare_count; |
256 | }; | 258 | }; |
@@ -279,16 +281,17 @@ struct acpi_device { | |||
279 | struct acpi_device_wakeup wakeup; | 281 | struct acpi_device_wakeup wakeup; |
280 | struct acpi_device_perf performance; | 282 | struct acpi_device_perf performance; |
281 | struct acpi_device_dir dir; | 283 | struct acpi_device_dir dir; |
282 | struct acpi_device_ops ops; | 284 | struct acpi_scan_handler *handler; |
283 | struct acpi_driver *driver; | 285 | struct acpi_driver *driver; |
284 | void *driver_data; | 286 | void *driver_data; |
285 | struct device dev; | 287 | struct device dev; |
286 | struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ | ||
287 | enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ | 288 | enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ |
288 | u8 physical_node_count; | 289 | u8 physical_node_count; |
289 | struct list_head physical_node_list; | 290 | struct list_head physical_node_list; |
290 | struct mutex physical_node_lock; | 291 | struct mutex physical_node_lock; |
291 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); | 292 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); |
293 | struct list_head power_dependent; | ||
294 | void (*remove)(struct acpi_device *); | ||
292 | }; | 295 | }; |
293 | 296 | ||
294 | static inline void *acpi_driver_data(struct acpi_device *d) | 297 | static inline void *acpi_driver_data(struct acpi_device *d) |
@@ -316,10 +319,19 @@ struct acpi_bus_event { | |||
316 | }; | 319 | }; |
317 | 320 | ||
318 | struct acpi_eject_event { | 321 | struct acpi_eject_event { |
319 | acpi_handle handle; | 322 | struct acpi_device *device; |
320 | u32 event; | 323 | u32 event; |
321 | }; | 324 | }; |
322 | 325 | ||
326 | struct acpi_hp_work { | ||
327 | struct work_struct work; | ||
328 | acpi_handle handle; | ||
329 | u32 type; | ||
330 | void *context; | ||
331 | }; | ||
332 | void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context, | ||
333 | void (*func)(struct work_struct *work)); | ||
334 | |||
323 | extern struct kobject *acpi_kobj; | 335 | extern struct kobject *acpi_kobj; |
324 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 336 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
325 | void acpi_bus_private_data_handler(acpi_handle, void *); | 337 | void acpi_bus_private_data_handler(acpi_handle, void *); |
@@ -339,13 +351,51 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); | |||
339 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 351 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
340 | unsigned long long *sta); | 352 | unsigned long long *sta); |
341 | int acpi_bus_get_status(struct acpi_device *device); | 353 | int acpi_bus_get_status(struct acpi_device *device); |
354 | |||
355 | #ifdef CONFIG_PM | ||
342 | int acpi_bus_set_power(acpi_handle handle, int state); | 356 | int acpi_bus_set_power(acpi_handle handle, int state); |
357 | const char *acpi_power_state_string(int state); | ||
358 | int acpi_device_get_power(struct acpi_device *device, int *state); | ||
343 | int acpi_device_set_power(struct acpi_device *device, int state); | 359 | int acpi_device_set_power(struct acpi_device *device, int state); |
360 | int acpi_bus_init_power(struct acpi_device *device); | ||
344 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 361 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
345 | bool acpi_bus_power_manageable(acpi_handle handle); | 362 | bool acpi_bus_power_manageable(acpi_handle handle); |
346 | bool acpi_bus_can_wakeup(acpi_handle handle); | 363 | bool acpi_bus_can_wakeup(acpi_handle handle); |
347 | int acpi_power_resource_register_device(struct device *dev, acpi_handle handle); | 364 | #else /* !CONFIG_PM */ |
348 | void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle); | 365 | static inline int acpi_bus_set_power(acpi_handle handle, int state) |
366 | { | ||
367 | return 0; | ||
368 | } | ||
369 | static inline const char *acpi_power_state_string(int state) | ||
370 | { | ||
371 | return "D0"; | ||
372 | } | ||
373 | static inline int acpi_device_get_power(struct acpi_device *device, int *state) | ||
374 | { | ||
375 | return 0; | ||
376 | } | ||
377 | static inline int acpi_device_set_power(struct acpi_device *device, int state) | ||
378 | { | ||
379 | return 0; | ||
380 | } | ||
381 | static inline int acpi_bus_init_power(struct acpi_device *device) | ||
382 | { | ||
383 | return 0; | ||
384 | } | ||
385 | static inline int acpi_bus_update_power(acpi_handle handle, int *state_p) | ||
386 | { | ||
387 | return 0; | ||
388 | } | ||
389 | static inline bool acpi_bus_power_manageable(acpi_handle handle) | ||
390 | { | ||
391 | return false; | ||
392 | } | ||
393 | static inline bool acpi_bus_can_wakeup(acpi_handle handle) | ||
394 | { | ||
395 | return false; | ||
396 | } | ||
397 | #endif /* !CONFIG_PM */ | ||
398 | |||
349 | #ifdef CONFIG_ACPI_PROC_EVENT | 399 | #ifdef CONFIG_ACPI_PROC_EVENT |
350 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); | 400 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); |
351 | int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); | 401 | int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); |
@@ -354,13 +404,15 @@ int acpi_bus_receive_event(struct acpi_bus_event *event); | |||
354 | static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) | 404 | static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) |
355 | { return 0; } | 405 | { return 0; } |
356 | #endif | 406 | #endif |
407 | |||
408 | void acpi_scan_lock_acquire(void); | ||
409 | void acpi_scan_lock_release(void); | ||
410 | int acpi_scan_add_handler(struct acpi_scan_handler *handler); | ||
357 | int acpi_bus_register_driver(struct acpi_driver *driver); | 411 | int acpi_bus_register_driver(struct acpi_driver *driver); |
358 | void acpi_bus_unregister_driver(struct acpi_driver *driver); | 412 | void acpi_bus_unregister_driver(struct acpi_driver *driver); |
359 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | 413 | int acpi_bus_scan(acpi_handle handle); |
360 | acpi_handle handle, int type); | ||
361 | void acpi_bus_hot_remove_device(void *context); | 414 | void acpi_bus_hot_remove_device(void *context); |
362 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 415 | void acpi_bus_trim(struct acpi_device *start); |
363 | int acpi_bus_start(struct acpi_device *device); | ||
364 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); | 416 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); |
365 | int acpi_match_device_ids(struct acpi_device *device, | 417 | int acpi_match_device_ids(struct acpi_device *device, |
366 | const struct acpi_device_id *ids); | 418 | const struct acpi_device_id *ids); |
@@ -390,6 +442,8 @@ struct acpi_bus_type { | |||
390 | int (*find_device) (struct device *, acpi_handle *); | 442 | int (*find_device) (struct device *, acpi_handle *); |
391 | /* For bridges, such as PCI root bridge, IDE controller */ | 443 | /* For bridges, such as PCI root bridge, IDE controller */ |
392 | int (*find_bridge) (struct device *, acpi_handle *); | 444 | int (*find_bridge) (struct device *, acpi_handle *); |
445 | void (*setup)(struct device *); | ||
446 | void (*cleanup)(struct device *); | ||
393 | }; | 447 | }; |
394 | int register_acpi_bus_type(struct acpi_bus_type *); | 448 | int register_acpi_bus_type(struct acpi_bus_type *); |
395 | int unregister_acpi_bus_type(struct acpi_bus_type *); | 449 | int unregister_acpi_bus_type(struct acpi_bus_type *); |
@@ -397,7 +451,6 @@ int unregister_acpi_bus_type(struct acpi_bus_type *); | |||
397 | struct acpi_pci_root { | 451 | struct acpi_pci_root { |
398 | struct list_head node; | 452 | struct list_head node; |
399 | struct acpi_device * device; | 453 | struct acpi_device * device; |
400 | struct acpi_pci_id id; | ||
401 | struct pci_bus *bus; | 454 | struct pci_bus *bus; |
402 | u16 segment; | 455 | u16 segment; |
403 | struct resource secondary; /* downstream bus range */ | 456 | struct resource secondary; /* downstream bus range */ |
@@ -410,7 +463,6 @@ struct acpi_pci_root { | |||
410 | /* helper */ | 463 | /* helper */ |
411 | acpi_handle acpi_get_child(acpi_handle, u64); | 464 | acpi_handle acpi_get_child(acpi_handle, u64); |
412 | int acpi_is_root_bridge(acpi_handle); | 465 | int acpi_is_root_bridge(acpi_handle); |
413 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | ||
414 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 466 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
415 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) | 467 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) |
416 | 468 | ||
@@ -425,6 +477,8 @@ acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | |||
425 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | 477 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, |
426 | u32 target_state, int d_max_in, int *d_min_p); | 478 | u32 target_state, int d_max_in, int *d_min_p); |
427 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 479 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
480 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | ||
481 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | ||
428 | #else | 482 | #else |
429 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 483 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
430 | acpi_notify_handler handler, | 484 | acpi_notify_handler handler, |
@@ -454,6 +508,10 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
454 | { | 508 | { |
455 | return __acpi_device_power_state(m, p); | 509 | return __acpi_device_power_state(m, p); |
456 | } | 510 | } |
511 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | ||
512 | struct device *depdev) {} | ||
513 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | ||
514 | struct device *depdev) {} | ||
457 | #endif | 515 | #endif |
458 | 516 | ||
459 | #ifdef CONFIG_PM_RUNTIME | 517 | #ifdef CONFIG_PM_RUNTIME |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 8b1d7a6a9695..627749af0ba7 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -90,11 +90,6 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, | |||
90 | int *polarity, char **name); | 90 | int *polarity, char **name); |
91 | int acpi_pci_link_free_irq(acpi_handle handle); | 91 | int acpi_pci_link_free_irq(acpi_handle handle); |
92 | 92 | ||
93 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | ||
94 | |||
95 | int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); | ||
96 | void acpi_pci_irq_del_prt(int segment, int bus); | ||
97 | |||
98 | /* ACPI PCI Device Binding (pci_bind.c) */ | 93 | /* ACPI PCI Device Binding (pci_bind.c) */ |
99 | 94 | ||
100 | struct pci_bus; | 95 | struct pci_bus; |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 43152742b46f..5b3d2bd4813a 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 - 2012, Intel Corp. | 10 | * Copyright (C) 2000 - 2013, 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 |
@@ -102,10 +102,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table, | |||
102 | /* | 102 | /* |
103 | * Spinlock primitives | 103 | * Spinlock primitives |
104 | */ | 104 | */ |
105 | |||
106 | #ifndef acpi_os_create_lock | 105 | #ifndef acpi_os_create_lock |
107 | acpi_status | 106 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); |
108 | acpi_os_create_lock(acpi_spinlock *out_handle); | ||
109 | #endif | 107 | #endif |
110 | 108 | ||
111 | void acpi_os_delete_lock(acpi_spinlock handle); | 109 | void acpi_os_delete_lock(acpi_spinlock handle); |
@@ -148,6 +146,8 @@ void acpi_os_release_mutex(acpi_mutex handle); | |||
148 | */ | 146 | */ |
149 | void *acpi_os_allocate(acpi_size size); | 147 | void *acpi_os_allocate(acpi_size size); |
150 | 148 | ||
149 | void acpi_os_free(void *memory); | ||
150 | |||
151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, | 151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, |
152 | acpi_size length); | 152 | acpi_size length); |
153 | 153 | ||
@@ -180,12 +180,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); | |||
180 | * Interrupt handlers | 180 | * Interrupt handlers |
181 | */ | 181 | */ |
182 | acpi_status | 182 | acpi_status |
183 | acpi_os_install_interrupt_handler(u32 gsi, | 183 | acpi_os_install_interrupt_handler(u32 interrupt_number, |
184 | acpi_osd_handler service_routine, | 184 | acpi_osd_handler service_routine, |
185 | void *context); | 185 | void *context); |
186 | 186 | ||
187 | acpi_status | 187 | acpi_status |
188 | acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); | 188 | acpi_os_remove_interrupt_handler(u32 interrupt_number, |
189 | acpi_osd_handler service_routine); | ||
189 | 190 | ||
190 | void acpi_os_gpe_count(u32 gpe_number); | 191 | void acpi_os_gpe_count(u32 gpe_number); |
191 | void acpi_os_fixed_event_count(u32 fixed_event_number); | 192 | void acpi_os_fixed_event_count(u32 fixed_event_number); |
@@ -193,8 +194,6 @@ void acpi_os_fixed_event_count(u32 fixed_event_number); | |||
193 | /* | 194 | /* |
194 | * Threads and Scheduling | 195 | * Threads and Scheduling |
195 | */ | 196 | */ |
196 | extern struct workqueue_struct *kacpi_hotplug_wq; | ||
197 | |||
198 | acpi_thread_id acpi_os_get_thread_id(void); | 197 | acpi_thread_id acpi_os_get_thread_id(void); |
199 | 198 | ||
200 | acpi_status | 199 | acpi_status |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 3d88395d4d6f..03322dddd88e 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 0x20121018 | 49 | #define ACPI_CA_VERSION 0x20130117 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -56,11 +56,20 @@ | |||
56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Globals that are publicly available, allowing for | 59 | * Globals that are publically available |
60 | * run time configuration | ||
61 | */ | 60 | */ |
61 | extern u32 acpi_current_gpe_count; | ||
62 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
63 | extern u8 acpi_gbl_system_awake_and_running; | ||
64 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
65 | |||
66 | /* Runtime configuration of debug print levels */ | ||
67 | |||
62 | extern u32 acpi_dbg_level; | 68 | extern u32 acpi_dbg_level; |
63 | extern u32 acpi_dbg_layer; | 69 | extern u32 acpi_dbg_layer; |
70 | |||
71 | /* ACPICA runtime options */ | ||
72 | |||
64 | extern u8 acpi_gbl_enable_interpreter_slack; | 73 | extern u8 acpi_gbl_enable_interpreter_slack; |
65 | extern u8 acpi_gbl_all_methods_serialized; | 74 | extern u8 acpi_gbl_all_methods_serialized; |
66 | extern u8 acpi_gbl_create_osi_method; | 75 | extern u8 acpi_gbl_create_osi_method; |
@@ -99,14 +108,9 @@ extern u8 acpi_gbl_disable_auto_repair; | |||
99 | 108 | ||
100 | #endif /* !ACPI_REDUCED_HARDWARE */ | 109 | #endif /* !ACPI_REDUCED_HARDWARE */ |
101 | 110 | ||
102 | extern u32 acpi_current_gpe_count; | ||
103 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
104 | extern u8 acpi_gbl_system_awake_and_running; | ||
105 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
106 | |||
107 | extern u32 acpi_rsdt_forced; | 111 | extern u32 acpi_rsdt_forced; |
108 | /* | 112 | /* |
109 | * Global interfaces | 113 | * Initialization |
110 | */ | 114 | */ |
111 | acpi_status | 115 | acpi_status |
112 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, | 116 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, |
@@ -120,13 +124,15 @@ acpi_status acpi_initialize_objects(u32 flags); | |||
120 | 124 | ||
121 | acpi_status acpi_terminate(void); | 125 | acpi_status acpi_terminate(void); |
122 | 126 | ||
127 | /* | ||
128 | * Miscellaneous global interfaces | ||
129 | */ | ||
130 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
131 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
123 | #ifdef ACPI_FUTURE_USAGE | 132 | #ifdef ACPI_FUTURE_USAGE |
124 | acpi_status acpi_subsystem_status(void); | 133 | acpi_status acpi_subsystem_status(void); |
125 | #endif | 134 | #endif |
126 | 135 | ||
127 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
128 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
129 | |||
130 | #ifdef ACPI_FUTURE_USAGE | 136 | #ifdef ACPI_FUTURE_USAGE |
131 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); | 137 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); |
132 | #endif | 138 | #endif |
@@ -191,9 +197,9 @@ acpi_status | |||
191 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); | 197 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); |
192 | 198 | ||
193 | acpi_status | 199 | acpi_status |
194 | acpi_install_table_handler(acpi_tbl_handler handler, void *context); | 200 | acpi_install_table_handler(acpi_table_handler handler, void *context); |
195 | 201 | ||
196 | acpi_status acpi_remove_table_handler(acpi_tbl_handler handler); | 202 | acpi_status acpi_remove_table_handler(acpi_table_handler handler); |
197 | 203 | ||
198 | /* | 204 | /* |
199 | * Namespace and name interfaces | 205 | * Namespace and name interfaces |
@@ -438,6 +444,11 @@ acpi_get_event_resources(acpi_handle device_handle, | |||
438 | struct acpi_buffer *ret_buffer); | 444 | struct acpi_buffer *ret_buffer); |
439 | 445 | ||
440 | acpi_status | 446 | acpi_status |
447 | acpi_walk_resource_buffer(struct acpi_buffer *buffer, | ||
448 | acpi_walk_resource_callback user_function, | ||
449 | void *context); | ||
450 | |||
451 | acpi_status | ||
441 | acpi_walk_resources(acpi_handle device, | 452 | acpi_walk_resources(acpi_handle device, |
442 | char *name, | 453 | char *name, |
443 | acpi_walk_resource_callback user_function, void *context); | 454 | acpi_walk_resource_callback user_function, void *context); |
@@ -462,6 +473,10 @@ acpi_buffer_to_resource(u8 *aml_buffer, | |||
462 | */ | 473 | */ |
463 | acpi_status acpi_reset(void); | 474 | acpi_status acpi_reset(void); |
464 | 475 | ||
476 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
477 | |||
478 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
479 | |||
465 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 480 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
466 | acpi_read_bit_register(u32 register_id, | 481 | acpi_read_bit_register(u32 register_id, |
467 | u32 *return_value)) | 482 | u32 *return_value)) |
@@ -470,20 +485,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
470 | acpi_write_bit_register(u32 register_id, | 485 | acpi_write_bit_register(u32 register_id, |
471 | u32 value)) | 486 | u32 value)) |
472 | 487 | ||
473 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
474 | acpi_set_firmware_waking_vector(u32 | ||
475 | physical_address)) | ||
476 | |||
477 | #if ACPI_MACHINE_WIDTH == 64 | ||
478 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
479 | acpi_set_firmware_waking_vector64(u64 | ||
480 | physical_address)) | ||
481 | #endif | ||
482 | |||
483 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
484 | |||
485 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
486 | |||
487 | /* | 488 | /* |
488 | * Sleep/Wake interfaces | 489 | * Sleep/Wake interfaces |
489 | */ | 490 | */ |
@@ -500,6 +501,15 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); | |||
500 | 501 | ||
501 | acpi_status acpi_leave_sleep_state(u8 sleep_state); | 502 | acpi_status acpi_leave_sleep_state(u8 sleep_state); |
502 | 503 | ||
504 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
505 | acpi_set_firmware_waking_vector(u32 | ||
506 | physical_address)) | ||
507 | |||
508 | #if ACPI_MACHINE_WIDTH == 64 | ||
509 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
510 | acpi_set_firmware_waking_vector64(u64 | ||
511 | physical_address)) | ||
512 | #endif | ||
503 | /* | 513 | /* |
504 | * ACPI Timer interfaces | 514 | * ACPI Timer interfaces |
505 | */ | 515 | */ |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 40349ae65464..cbf4bf977f75 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -102,8 +102,11 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
102 | 102 | ||
103 | #define ACPI_EXCLUSIVE (u8) 0x00 | 103 | #define ACPI_EXCLUSIVE (u8) 0x00 |
104 | #define ACPI_SHARED (u8) 0x01 | 104 | #define ACPI_SHARED (u8) 0x01 |
105 | #define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02 | 105 | |
106 | #define ACPI_SHARED_AND_WAKE (u8) 0x03 | 106 | /* Wake */ |
107 | |||
108 | #define ACPI_NOT_WAKE_CAPABLE (u8) 0x00 | ||
109 | #define ACPI_WAKE_CAPABLE (u8) 0x01 | ||
107 | 110 | ||
108 | /* | 111 | /* |
109 | * DMA Attributes | 112 | * DMA Attributes |
@@ -171,6 +174,7 @@ struct acpi_resource_irq { | |||
171 | u8 triggering; | 174 | u8 triggering; |
172 | u8 polarity; | 175 | u8 polarity; |
173 | u8 sharable; | 176 | u8 sharable; |
177 | u8 wake_capable; | ||
174 | u8 interrupt_count; | 178 | u8 interrupt_count; |
175 | u8 interrupts[1]; | 179 | u8 interrupts[1]; |
176 | }; | 180 | }; |
@@ -346,6 +350,7 @@ struct acpi_resource_extended_irq { | |||
346 | u8 triggering; | 350 | u8 triggering; |
347 | u8 polarity; | 351 | u8 polarity; |
348 | u8 sharable; | 352 | u8 sharable; |
353 | u8 wake_capable; | ||
349 | u8 interrupt_count; | 354 | u8 interrupt_count; |
350 | struct acpi_resource_source resource_source; | 355 | struct acpi_resource_source resource_source; |
351 | u32 interrupts[1]; | 356 | u32 interrupts[1]; |
@@ -365,6 +370,7 @@ struct acpi_resource_gpio { | |||
365 | u8 producer_consumer; /* For values, see Producer/Consumer above */ | 370 | u8 producer_consumer; /* For values, see Producer/Consumer above */ |
366 | u8 pin_config; | 371 | u8 pin_config; |
367 | u8 sharable; /* For values, see Interrupt Attributes above */ | 372 | u8 sharable; /* For values, see Interrupt Attributes above */ |
373 | u8 wake_capable; /* For values, see Interrupt Attributes above */ | ||
368 | u8 io_restriction; | 374 | u8 io_restriction; |
369 | u8 triggering; /* For values, see Interrupt Attributes above */ | 375 | u8 triggering; /* For values, see Interrupt Attributes above */ |
370 | u8 polarity; /* For values, see Interrupt Attributes above */ | 376 | u8 polarity; /* For values, see Interrupt Attributes above */ |
@@ -591,7 +597,10 @@ struct acpi_resource { | |||
591 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) | 597 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) |
592 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) | 598 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) |
593 | 599 | ||
594 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 600 | /* Macro for walking resource templates with multiple descriptors */ |
601 | |||
602 | #define ACPI_NEXT_RESOURCE(res) \ | ||
603 | ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length) | ||
595 | 604 | ||
596 | struct acpi_pci_routing_table { | 605 | struct acpi_pci_routing_table { |
597 | u32 length; | 606 | u32 length; |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 4f94b1d812d5..9b58a8f43771 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -326,8 +326,6 @@ enum acpi_preferred_pm_profiles { | |||
326 | 326 | ||
327 | #pragma pack() | 327 | #pragma pack() |
328 | 328 | ||
329 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
330 | |||
331 | /* | 329 | /* |
332 | * Internal table-related structures | 330 | * Internal table-related structures |
333 | */ | 331 | */ |
@@ -359,11 +357,14 @@ struct acpi_table_desc { | |||
359 | /* | 357 | /* |
360 | * Get the remaining ACPI tables | 358 | * Get the remaining ACPI tables |
361 | */ | 359 | */ |
362 | |||
363 | #include <acpi/actbl1.h> | 360 | #include <acpi/actbl1.h> |
364 | #include <acpi/actbl2.h> | 361 | #include <acpi/actbl2.h> |
365 | #include <acpi/actbl3.h> | 362 | #include <acpi/actbl3.h> |
366 | 363 | ||
364 | /* Macros used to generate offsets to specific table fields */ | ||
365 | |||
366 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
367 | |||
367 | /* | 368 | /* |
368 | * Sizes of the various flavors of FADT. We need to look closely | 369 | * Sizes of the various flavors of FADT. We need to look closely |
369 | * at the FADT length because the version number essentially tells | 370 | * at the FADT length because the version number essentially tells |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 280fc45b59dd..0bd750ebeb49 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -768,7 +768,7 @@ struct acpi_madt_interrupt_source { | |||
768 | 768 | ||
769 | struct acpi_madt_local_x2apic { | 769 | struct acpi_madt_local_x2apic { |
770 | struct acpi_subtable_header header; | 770 | struct acpi_subtable_header header; |
771 | u16 reserved; /* Reserved - must be zero */ | 771 | u16 reserved; /* reserved - must be zero */ |
772 | u32 local_apic_id; /* Processor x2APIC ID */ | 772 | u32 local_apic_id; /* Processor x2APIC ID */ |
773 | u32 lapic_flags; | 773 | u32 lapic_flags; |
774 | u32 uid; /* ACPI processor UID */ | 774 | u32 uid; /* ACPI processor UID */ |
@@ -781,14 +781,14 @@ struct acpi_madt_local_x2apic_nmi { | |||
781 | u16 inti_flags; | 781 | u16 inti_flags; |
782 | u32 uid; /* ACPI processor UID */ | 782 | u32 uid; /* ACPI processor UID */ |
783 | u8 lint; /* LINTn to which NMI is connected */ | 783 | u8 lint; /* LINTn to which NMI is connected */ |
784 | u8 reserved[3]; | 784 | u8 reserved[3]; /* reserved - must be zero */ |
785 | }; | 785 | }; |
786 | 786 | ||
787 | /* 11: Generic Interrupt (ACPI 5.0) */ | 787 | /* 11: Generic Interrupt (ACPI 5.0) */ |
788 | 788 | ||
789 | struct acpi_madt_generic_interrupt { | 789 | struct acpi_madt_generic_interrupt { |
790 | struct acpi_subtable_header header; | 790 | struct acpi_subtable_header header; |
791 | u16 reserved; /* Reserved - must be zero */ | 791 | u16 reserved; /* reserved - must be zero */ |
792 | u32 gic_id; | 792 | u32 gic_id; |
793 | u32 uid; | 793 | u32 uid; |
794 | u32 flags; | 794 | u32 flags; |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 1b2b356486d1..77dc7a4099a3 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -261,9 +261,28 @@ struct acpi_csrt_group { | |||
261 | u16 subdevice_id; | 261 | u16 subdevice_id; |
262 | u16 revision; | 262 | u16 revision; |
263 | u16 reserved; | 263 | u16 reserved; |
264 | u32 info_length; | 264 | u32 shared_info_length; |
265 | 265 | ||
266 | /* Shared data (length = info_length) immediately follows */ | 266 | /* Shared data immediately follows (Length = shared_info_length) */ |
267 | }; | ||
268 | |||
269 | /* Shared Info subtable */ | ||
270 | |||
271 | struct acpi_csrt_shared_info { | ||
272 | u16 major_version; | ||
273 | u16 minor_version; | ||
274 | u32 mmio_base_low; | ||
275 | u32 mmio_base_high; | ||
276 | u32 gsi_interrupt; | ||
277 | u8 interrupt_polarity; | ||
278 | u8 interrupt_mode; | ||
279 | u8 num_channels; | ||
280 | u8 dma_address_width; | ||
281 | u16 base_request_line; | ||
282 | u16 num_handshake_signals; | ||
283 | u32 max_block_size; | ||
284 | |||
285 | /* Resource descriptors immediately follow (Length = Group length - shared_info_length) */ | ||
267 | }; | 286 | }; |
268 | 287 | ||
269 | /* Resource Descriptor subtable */ | 288 | /* Resource Descriptor subtable */ |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 6585141e4b97..332b17e3bec8 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -68,13 +68,13 @@ | |||
68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ | 68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ |
69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ | 69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ |
70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ | 70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ |
71 | #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ | ||
71 | 72 | ||
72 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ | 73 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ |
73 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ | 74 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ |
74 | 75 | ||
75 | /* Reserved table signatures */ | 76 | /* Reserved table signatures */ |
76 | 77 | ||
77 | #define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */ | ||
78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ | 78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ |
79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ | 79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ |
80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ | 80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ |
@@ -550,6 +550,36 @@ enum acpi_rasf_status { | |||
550 | #define ACPI_RASF_ERROR (1<<2) | 550 | #define ACPI_RASF_ERROR (1<<2) |
551 | #define ACPI_RASF_STATUS (0x1F<<3) | 551 | #define ACPI_RASF_STATUS (0x1F<<3) |
552 | 552 | ||
553 | /******************************************************************************* | ||
554 | * | ||
555 | * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table | ||
556 | * Version 3 | ||
557 | * | ||
558 | * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 | ||
559 | * | ||
560 | ******************************************************************************/ | ||
561 | |||
562 | struct acpi_table_tpm2 { | ||
563 | struct acpi_table_header header; /* Common ACPI table header */ | ||
564 | u32 flags; | ||
565 | u64 control_address; | ||
566 | u32 start_method; | ||
567 | }; | ||
568 | |||
569 | /* Control area structure (not part of table, pointed to by control_address) */ | ||
570 | |||
571 | struct acpi_tpm2_control { | ||
572 | u32 reserved; | ||
573 | u32 error; | ||
574 | u32 cancel; | ||
575 | u32 start; | ||
576 | u64 interrupt_control; | ||
577 | u32 command_size; | ||
578 | u64 command_address; | ||
579 | u32 response_size; | ||
580 | u64 response_address; | ||
581 | }; | ||
582 | |||
553 | /* Reset to default packing */ | 583 | /* Reset to default packing */ |
554 | 584 | ||
555 | #pragma pack() | 585 | #pragma pack() |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 4f43f1fba132..845e75f1ffd8 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -341,7 +341,7 @@ typedef u32 acpi_physical_address; | |||
341 | 341 | ||
342 | /* PM Timer ticks per second (HZ) */ | 342 | /* PM Timer ticks per second (HZ) */ |
343 | 343 | ||
344 | #define PM_TIMER_FREQUENCY 3579545 | 344 | #define ACPI_PM_TIMER_FREQUENCY 3579545 |
345 | 345 | ||
346 | /******************************************************************************* | 346 | /******************************************************************************* |
347 | * | 347 | * |
@@ -373,6 +373,21 @@ typedef u32 acpi_name; /* 4-byte ACPI name */ | |||
373 | typedef char *acpi_string; /* Null terminated ASCII string */ | 373 | typedef char *acpi_string; /* Null terminated ASCII string */ |
374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ | 374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ |
375 | 375 | ||
376 | /* Time constants for timer calculations */ | ||
377 | |||
378 | #define ACPI_MSEC_PER_SEC 1000L | ||
379 | |||
380 | #define ACPI_USEC_PER_MSEC 1000L | ||
381 | #define ACPI_USEC_PER_SEC 1000000L | ||
382 | |||
383 | #define ACPI_100NSEC_PER_USEC 10L | ||
384 | #define ACPI_100NSEC_PER_MSEC 10000L | ||
385 | #define ACPI_100NSEC_PER_SEC 10000000L | ||
386 | |||
387 | #define ACPI_NSEC_PER_USEC 1000L | ||
388 | #define ACPI_NSEC_PER_MSEC 1000000L | ||
389 | #define ACPI_NSEC_PER_SEC 1000000000L | ||
390 | |||
376 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 391 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
377 | 392 | ||
378 | typedef u8 acpi_owner_id; | 393 | typedef u8 acpi_owner_id; |
@@ -390,10 +405,6 @@ typedef u8 acpi_owner_id; | |||
390 | #define ACPI_MAX16_DECIMAL_DIGITS 5 | 405 | #define ACPI_MAX16_DECIMAL_DIGITS 5 |
391 | #define ACPI_MAX8_DECIMAL_DIGITS 3 | 406 | #define ACPI_MAX8_DECIMAL_DIGITS 3 |
392 | 407 | ||
393 | /* PM Timer ticks per second (HZ) */ | ||
394 | |||
395 | #define PM_TIMER_FREQUENCY 3579545 | ||
396 | |||
397 | /* | 408 | /* |
398 | * Constants with special meanings | 409 | * Constants with special meanings |
399 | */ | 410 | */ |
@@ -474,6 +485,7 @@ typedef u64 acpi_integer; | |||
474 | */ | 485 | */ |
475 | #define ACPI_FULL_INITIALIZATION 0x00 | 486 | #define ACPI_FULL_INITIALIZATION 0x00 |
476 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 | 487 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 |
488 | #define ACPI_NO_HARDWARE_INIT 0x02 | ||
477 | #define ACPI_NO_EVENT_INIT 0x04 | 489 | #define ACPI_NO_EVENT_INIT 0x04 |
478 | #define ACPI_NO_HANDLER_INIT 0x08 | 490 | #define ACPI_NO_HANDLER_INIT 0x08 |
479 | #define ACPI_NO_ACPI_ENABLE 0x10 | 491 | #define ACPI_NO_ACPI_ENABLE 0x10 |
@@ -595,7 +607,7 @@ typedef u32 acpi_object_type; | |||
595 | 607 | ||
596 | /* | 608 | /* |
597 | * These are special object types that never appear in | 609 | * These are special object types that never appear in |
598 | * a Namespace node, only in a union acpi_operand_object | 610 | * a Namespace node, only in an object of union acpi_operand_object |
599 | */ | 611 | */ |
600 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C | 612 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C |
601 | #define ACPI_TYPE_LOCAL_DATA 0x1D | 613 | #define ACPI_TYPE_LOCAL_DATA 0x1D |
@@ -662,7 +674,7 @@ typedef u32 acpi_event_status; | |||
662 | #define ACPI_GPE_MAX 0xFF | 674 | #define ACPI_GPE_MAX 0xFF |
663 | #define ACPI_NUM_GPE 256 | 675 | #define ACPI_NUM_GPE 256 |
664 | 676 | ||
665 | /* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */ | 677 | /* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ |
666 | 678 | ||
667 | #define ACPI_GPE_ENABLE 0 | 679 | #define ACPI_GPE_ENABLE 0 |
668 | #define ACPI_GPE_DISABLE 1 | 680 | #define ACPI_GPE_DISABLE 1 |
@@ -880,6 +892,10 @@ struct acpi_buffer { | |||
880 | void *pointer; /* pointer to buffer */ | 892 | void *pointer; /* pointer to buffer */ |
881 | }; | 893 | }; |
882 | 894 | ||
895 | /* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */ | ||
896 | |||
897 | #define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer) | ||
898 | |||
883 | /* | 899 | /* |
884 | * name_type for acpi_get_name | 900 | * name_type for acpi_get_name |
885 | */ | 901 | */ |
@@ -968,7 +984,11 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status, | |||
968 | /* Table Event handler (Load, load_table, etc.) and types */ | 984 | /* Table Event handler (Load, load_table, etc.) and types */ |
969 | 985 | ||
970 | typedef | 986 | typedef |
971 | acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context); | 987 | acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); |
988 | |||
989 | #define ACPI_TABLE_LOAD 0x0 | ||
990 | #define ACPI_TABLE_UNLOAD 0x1 | ||
991 | #define ACPI_NUM_TABLE_EVENTS 2 | ||
972 | 992 | ||
973 | /* Address Spaces (For Operation Regions) */ | 993 | /* Address Spaces (For Operation Regions) */ |
974 | 994 | ||
diff --git a/include/acpi/container.h b/include/acpi/container.h deleted file mode 100644 index a703f14e049e..000000000000 --- a/include/acpi/container.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __ACPI_CONTAINER_H | ||
2 | #define __ACPI_CONTAINER_H | ||
3 | |||
4 | #include <linux/kernel.h> | ||
5 | |||
6 | struct acpi_container { | ||
7 | acpi_handle handle; | ||
8 | unsigned long sun; | ||
9 | int state; | ||
10 | }; | ||
11 | |||
12 | #endif /* __ACPI_CONTAINER_H */ | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 89cee88dd2a5..ef04b36ca6ed 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -1,11 +1,11 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: acenv.h - Generation environment specific items | 3 | * Name: acenv.h - Host and compiler configuration |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -44,6 +44,12 @@ | |||
44 | #ifndef __ACENV_H__ | 44 | #ifndef __ACENV_H__ |
45 | #define __ACENV_H__ | 45 | #define __ACENV_H__ |
46 | 46 | ||
47 | /* | ||
48 | * Environment configuration. The purpose of this file is to interface ACPICA | ||
49 | * to the local environment. This includes compiler-specific, OS-specific, | ||
50 | * and machine-specific configuration. | ||
51 | */ | ||
52 | |||
47 | /* Types for ACPI_MUTEX_TYPE */ | 53 | /* Types for ACPI_MUTEX_TYPE */ |
48 | 54 | ||
49 | #define ACPI_BINARY_SEMAPHORE 0 | 55 | #define ACPI_BINARY_SEMAPHORE 0 |
@@ -60,139 +66,170 @@ | |||
60 | * | 66 | * |
61 | *****************************************************************************/ | 67 | *****************************************************************************/ |
62 | 68 | ||
63 | #ifdef ACPI_LIBRARY | 69 | /* iASL configuration */ |
64 | /* | ||
65 | * Note: The non-debug version of the acpi_library does not contain any | ||
66 | * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG | ||
67 | */ | ||
68 | #define ACPI_USE_LOCAL_CACHE | ||
69 | #endif | ||
70 | 70 | ||
71 | #ifdef ACPI_ASL_COMPILER | 71 | #ifdef ACPI_ASL_COMPILER |
72 | #define ACPI_DEBUG_OUTPUT | ||
73 | #define ACPI_APPLICATION | 72 | #define ACPI_APPLICATION |
74 | #define ACPI_DISASSEMBLER | 73 | #define ACPI_DISASSEMBLER |
74 | #define ACPI_DEBUG_OUTPUT | ||
75 | #define ACPI_CONSTANT_EVAL_ONLY | 75 | #define ACPI_CONSTANT_EVAL_ONLY |
76 | #define ACPI_LARGE_NAMESPACE_NODE | 76 | #define ACPI_LARGE_NAMESPACE_NODE |
77 | #define ACPI_DATA_TABLE_DISASSEMBLY | 77 | #define ACPI_DATA_TABLE_DISASSEMBLY |
78 | #define ACPI_SINGLE_THREADED | ||
78 | #endif | 79 | #endif |
79 | 80 | ||
81 | /* acpi_exec configuration. Multithreaded with full AML debugger */ | ||
82 | |||
80 | #ifdef ACPI_EXEC_APP | 83 | #ifdef ACPI_EXEC_APP |
81 | #undef DEBUGGER_THREADING | ||
82 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED | ||
83 | #define ACPI_FULL_DEBUG | ||
84 | #define ACPI_APPLICATION | 84 | #define ACPI_APPLICATION |
85 | #define ACPI_DEBUGGER | 85 | #define ACPI_FULL_DEBUG |
86 | #define ACPI_MUTEX_DEBUG | 86 | #define ACPI_MUTEX_DEBUG |
87 | #define ACPI_DBG_TRACK_ALLOCATIONS | 87 | #define ACPI_DBG_TRACK_ALLOCATIONS |
88 | #endif | 88 | #endif |
89 | 89 | ||
90 | /* acpi_names configuration. Single threaded with debugger output enabled. */ | ||
91 | |||
92 | #ifdef ACPI_NAMES_APP | ||
93 | #define ACPI_DEBUGGER | ||
94 | #define ACPI_APPLICATION | ||
95 | #define ACPI_SINGLE_THREADED | ||
96 | #endif | ||
97 | |||
98 | /* | ||
99 | * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with | ||
100 | * no debug output. | ||
101 | */ | ||
102 | #if (defined ACPI_BIN_APP) || \ | ||
103 | (defined ACPI_SRC_APP) || \ | ||
104 | (defined ACPI_XTRACT_APP) | ||
105 | #define ACPI_APPLICATION | ||
106 | #define ACPI_SINGLE_THREADED | ||
107 | #endif | ||
108 | |||
109 | #ifdef ACPI_HELP_APP | ||
110 | #define ACPI_APPLICATION | ||
111 | #define ACPI_SINGLE_THREADED | ||
112 | #define ACPI_NO_ERROR_MESSAGES | ||
113 | #endif | ||
114 | |||
115 | /* Linkable ACPICA library */ | ||
116 | |||
117 | #ifdef ACPI_LIBRARY | ||
118 | #define ACPI_USE_LOCAL_CACHE | ||
119 | #define ACPI_FUTURE_USAGE | ||
120 | #endif | ||
121 | |||
122 | /* Common for all ACPICA applications */ | ||
123 | |||
90 | #ifdef ACPI_APPLICATION | 124 | #ifdef ACPI_APPLICATION |
91 | #define ACPI_USE_SYSTEM_CLIBRARY | 125 | #define ACPI_USE_SYSTEM_CLIBRARY |
92 | #define ACPI_USE_LOCAL_CACHE | 126 | #define ACPI_USE_LOCAL_CACHE |
93 | #endif | 127 | #endif |
94 | 128 | ||
129 | /* Common debug support */ | ||
130 | |||
95 | #ifdef ACPI_FULL_DEBUG | 131 | #ifdef ACPI_FULL_DEBUG |
96 | #define ACPI_DEBUGGER | 132 | #define ACPI_DEBUGGER |
97 | #define ACPI_DEBUG_OUTPUT | 133 | #define ACPI_DEBUG_OUTPUT |
98 | #define ACPI_DISASSEMBLER | 134 | #define ACPI_DISASSEMBLER |
99 | #endif | 135 | #endif |
100 | 136 | ||
101 | /* | ||
102 | * Environment configuration. The purpose of this file is to interface to the | ||
103 | * local generation environment. | ||
104 | * | ||
105 | * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. | ||
106 | * Otherwise, local versions of string/memory functions will be used. | ||
107 | * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
108 | * the standard header files may be used. | ||
109 | * | ||
110 | * The ACPI subsystem only uses low level C library functions that do not call | ||
111 | * operating system services and may therefore be inlined in the code. | ||
112 | * | ||
113 | * It may be necessary to tailor these include files to the target | ||
114 | * generation environment. | ||
115 | * | ||
116 | * | ||
117 | * Functions and constants used from each header: | ||
118 | * | ||
119 | * string.h: memcpy | ||
120 | * memset | ||
121 | * strcat | ||
122 | * strcmp | ||
123 | * strcpy | ||
124 | * strlen | ||
125 | * strncmp | ||
126 | * strncat | ||
127 | * strncpy | ||
128 | * | ||
129 | * stdlib.h: strtoul | ||
130 | * | ||
131 | * stdarg.h: va_list | ||
132 | * va_arg | ||
133 | * va_start | ||
134 | * va_end | ||
135 | * | ||
136 | */ | ||
137 | 137 | ||
138 | /*! [Begin] no source code translation */ | 138 | /*! [Begin] no source code translation */ |
139 | 139 | ||
140 | /****************************************************************************** | ||
141 | * | ||
142 | * Host configuration files. The compiler configuration files are included | ||
143 | * by the host files. | ||
144 | * | ||
145 | *****************************************************************************/ | ||
146 | |||
140 | #if defined(_LINUX) || defined(__linux__) | 147 | #if defined(_LINUX) || defined(__linux__) |
141 | #include <acpi/platform/aclinux.h> | 148 | #include <acpi/platform/aclinux.h> |
142 | 149 | ||
143 | #elif defined(_AED_EFI) | ||
144 | #include "acefi.h" | ||
145 | |||
146 | #elif defined(WIN32) | ||
147 | #include "acwin.h" | ||
148 | |||
149 | #elif defined(WIN64) | ||
150 | #include "acwin64.h" | ||
151 | |||
152 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | ||
153 | #include "acdos16.h" | ||
154 | |||
155 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | 150 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
156 | #include "acfreebsd.h" | 151 | #include "acfreebsd.h" |
157 | 152 | ||
158 | #elif defined(__NetBSD__) | 153 | #elif defined(__NetBSD__) |
159 | #include "acnetbsd.h" | 154 | #include "acnetbsd.h" |
160 | 155 | ||
156 | #elif defined(__sun) | ||
157 | #include "acsolaris.h" | ||
158 | |||
161 | #elif defined(MODESTO) | 159 | #elif defined(MODESTO) |
162 | #include "acmodesto.h" | 160 | #include "acmodesto.h" |
163 | 161 | ||
164 | #elif defined(NETWARE) | 162 | #elif defined(NETWARE) |
165 | #include "acnetware.h" | 163 | #include "acnetware.h" |
166 | 164 | ||
167 | #elif defined(__sun) | 165 | #elif defined(_CYGWIN) |
168 | #include "acsolaris.h" | 166 | #include "accygwin.h" |
169 | 167 | ||
170 | #else | 168 | #elif defined(WIN32) |
169 | #include "acwin.h" | ||
170 | |||
171 | #elif defined(WIN64) | ||
172 | #include "acwin64.h" | ||
171 | 173 | ||
172 | /* All other environments */ | 174 | #elif defined(_WRS_LIB_BUILD) |
175 | #include "acvxworks.h" | ||
173 | 176 | ||
174 | #define ACPI_USE_STANDARD_HEADERS | 177 | #elif defined(__OS2__) |
178 | #include "acos2.h" | ||
175 | 179 | ||
176 | #define COMPILER_DEPENDENT_INT64 long long | 180 | #elif defined(_AED_EFI) |
177 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | 181 | #include "acefi.h" |
182 | |||
183 | #elif defined(__HAIKU__) | ||
184 | #include "achaiku.h" | ||
178 | 185 | ||
186 | #else | ||
187 | |||
188 | /* Unknown environment */ | ||
189 | |||
190 | #error Unknown target environment | ||
179 | #endif | 191 | #endif |
180 | 192 | ||
181 | /*! [End] no source code translation !*/ | 193 | /*! [End] no source code translation !*/ |
182 | 194 | ||
183 | /****************************************************************************** | 195 | /****************************************************************************** |
184 | * | 196 | * |
185 | * Miscellaneous configuration | 197 | * Setup defaults for the required symbols that were not defined in one of |
198 | * the host/compiler files above. | ||
186 | * | 199 | * |
187 | *****************************************************************************/ | 200 | *****************************************************************************/ |
188 | 201 | ||
189 | /* | 202 | /* 64-bit data types */ |
190 | * Are mutexes supported by the host? default is no, use binary semaphores. | 203 | |
191 | */ | 204 | #ifndef COMPILER_DEPENDENT_INT64 |
205 | #define COMPILER_DEPENDENT_INT64 long long | ||
206 | #endif | ||
207 | |||
208 | #ifndef COMPILER_DEPENDENT_UINT64 | ||
209 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | ||
210 | #endif | ||
211 | |||
212 | /* Type of mutex supported by host. Default is binary semaphores. */ | ||
192 | #ifndef ACPI_MUTEX_TYPE | 213 | #ifndef ACPI_MUTEX_TYPE |
193 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE | 214 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE |
194 | #endif | 215 | #endif |
195 | 216 | ||
217 | /* Global Lock acquire/release */ | ||
218 | |||
219 | #ifndef ACPI_ACQUIRE_GLOBAL_LOCK | ||
220 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1 | ||
221 | #endif | ||
222 | |||
223 | #ifndef ACPI_RELEASE_GLOBAL_LOCK | ||
224 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0 | ||
225 | #endif | ||
226 | |||
227 | /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ | ||
228 | |||
229 | #ifndef ACPI_FLUSH_CPU_CACHE | ||
230 | #define ACPI_FLUSH_CPU_CACHE() | ||
231 | #endif | ||
232 | |||
196 | /* "inline" keywords - configurable since inline is not standardized */ | 233 | /* "inline" keywords - configurable since inline is not standardized */ |
197 | 234 | ||
198 | #ifndef ACPI_INLINE | 235 | #ifndef ACPI_INLINE |
@@ -200,6 +237,30 @@ | |||
200 | #endif | 237 | #endif |
201 | 238 | ||
202 | /* | 239 | /* |
240 | * Configurable calling conventions: | ||
241 | * | ||
242 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
243 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
244 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
245 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
246 | */ | ||
247 | #ifndef ACPI_SYSTEM_XFACE | ||
248 | #define ACPI_SYSTEM_XFACE | ||
249 | #endif | ||
250 | |||
251 | #ifndef ACPI_EXTERNAL_XFACE | ||
252 | #define ACPI_EXTERNAL_XFACE | ||
253 | #endif | ||
254 | |||
255 | #ifndef ACPI_INTERNAL_XFACE | ||
256 | #define ACPI_INTERNAL_XFACE | ||
257 | #endif | ||
258 | |||
259 | #ifndef ACPI_INTERNAL_VAR_XFACE | ||
260 | #define ACPI_INTERNAL_VAR_XFACE | ||
261 | #endif | ||
262 | |||
263 | /* | ||
203 | * Debugger threading model | 264 | * Debugger threading model |
204 | * Use single threaded if the entire subsystem is contained in an application | 265 | * Use single threaded if the entire subsystem is contained in an application |
205 | * Use multiple threaded when the subsystem is running in the kernel. | 266 | * Use multiple threaded when the subsystem is running in the kernel. |
@@ -222,17 +283,26 @@ | |||
222 | * | 283 | * |
223 | *****************************************************************************/ | 284 | *****************************************************************************/ |
224 | 285 | ||
225 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
226 | |||
227 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
228 | /* | 286 | /* |
229 | * Use the standard C library headers. | 287 | * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. |
230 | * We want to keep these to a minimum. | 288 | * Otherwise, local versions of string/memory functions will be used. |
289 | * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
290 | * the standard header files may be used. | ||
291 | * | ||
292 | * The ACPICA subsystem only uses low level C library functions that do not call | ||
293 | * operating system services and may therefore be inlined in the code. | ||
294 | * | ||
295 | * It may be necessary to tailor these include files to the target | ||
296 | * generation environment. | ||
231 | */ | 297 | */ |
298 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
299 | |||
300 | /* Use the standard C library headers. We want to keep these to a minimum. */ | ||
301 | |||
232 | #ifdef ACPI_USE_STANDARD_HEADERS | 302 | #ifdef ACPI_USE_STANDARD_HEADERS |
233 | /* | 303 | |
234 | * Use the standard headers from the standard locations | 304 | /* Use the standard headers from the standard locations */ |
235 | */ | 305 | |
236 | #include <stdarg.h> | 306 | #include <stdarg.h> |
237 | #include <stdlib.h> | 307 | #include <stdlib.h> |
238 | #include <string.h> | 308 | #include <string.h> |
@@ -240,9 +310,8 @@ | |||
240 | 310 | ||
241 | #endif /* ACPI_USE_STANDARD_HEADERS */ | 311 | #endif /* ACPI_USE_STANDARD_HEADERS */ |
242 | 312 | ||
243 | /* | 313 | /* We will be linking to the standard Clib functions */ |
244 | * We will be linking to the standard Clib functions | 314 | |
245 | */ | ||
246 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) | 315 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) |
247 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) | 316 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) |
248 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) | 317 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) |
@@ -274,13 +343,12 @@ | |||
274 | * | 343 | * |
275 | *****************************************************************************/ | 344 | *****************************************************************************/ |
276 | 345 | ||
277 | /* | 346 | /* |
278 | * Use local definitions of C library macros and functions | 347 | * Use local definitions of C library macros and functions. These function |
279 | * NOTE: The function implementations may not be as efficient | 348 | * implementations may not be as efficient as an inline or assembly code |
280 | * as an inline or assembly code implementation provided by a | 349 | * implementation provided by a native C library, but they are functionally |
281 | * native C library. | 350 | * equivalent. |
282 | */ | 351 | */ |
283 | |||
284 | #ifndef va_arg | 352 | #ifndef va_arg |
285 | 353 | ||
286 | #ifndef _VALIST | 354 | #ifndef _VALIST |
@@ -288,22 +356,22 @@ | |||
288 | typedef char *va_list; | 356 | typedef char *va_list; |
289 | #endif /* _VALIST */ | 357 | #endif /* _VALIST */ |
290 | 358 | ||
291 | /* | 359 | /* Storage alignment properties */ |
292 | * Storage alignment properties | 360 | |
293 | */ | ||
294 | #define _AUPBND (sizeof (acpi_native_int) - 1) | 361 | #define _AUPBND (sizeof (acpi_native_int) - 1) |
295 | #define _ADNBND (sizeof (acpi_native_int) - 1) | 362 | #define _ADNBND (sizeof (acpi_native_int) - 1) |
296 | 363 | ||
297 | /* | 364 | /* Variable argument list macro definitions */ |
298 | * Variable argument list macro definitions | 365 | |
299 | */ | ||
300 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) | 366 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) |
301 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) | 367 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) |
302 | #define va_end(ap) (void) 0 | 368 | #define va_end(ap) (ap = (va_list) NULL) |
303 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) | 369 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) |
304 | 370 | ||
305 | #endif /* va_arg */ | 371 | #endif /* va_arg */ |
306 | 372 | ||
373 | /* Use the local (ACPICA) definitions of the clib functions */ | ||
374 | |||
307 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) | 375 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) |
308 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) | 376 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) |
309 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) | 377 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) |
@@ -322,59 +390,4 @@ typedef char *va_list; | |||
322 | 390 | ||
323 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 391 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
324 | 392 | ||
325 | /****************************************************************************** | ||
326 | * | ||
327 | * Assembly code macros | ||
328 | * | ||
329 | *****************************************************************************/ | ||
330 | |||
331 | /* | ||
332 | * Handle platform- and compiler-specific assembly language differences. | ||
333 | * These should already have been defined by the platform includes above. | ||
334 | * | ||
335 | * Notes: | ||
336 | * 1) Interrupt 3 is used to break into a debugger | ||
337 | * 2) Interrupts are turned off during ACPI register setup | ||
338 | */ | ||
339 | |||
340 | /* Unrecognized compiler, use defaults */ | ||
341 | |||
342 | #ifndef ACPI_ASM_MACROS | ||
343 | |||
344 | /* | ||
345 | * Calling conventions: | ||
346 | * | ||
347 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
348 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
349 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
350 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
351 | */ | ||
352 | #define ACPI_SYSTEM_XFACE | ||
353 | #define ACPI_EXTERNAL_XFACE | ||
354 | #define ACPI_INTERNAL_XFACE | ||
355 | #define ACPI_INTERNAL_VAR_XFACE | ||
356 | |||
357 | #define ACPI_ASM_MACROS | ||
358 | #define BREAKPOINT3 | ||
359 | #define ACPI_DISABLE_IRQS() | ||
360 | #define ACPI_ENABLE_IRQS() | ||
361 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) | ||
362 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) | ||
363 | |||
364 | #endif /* ACPI_ASM_MACROS */ | ||
365 | |||
366 | #ifdef ACPI_APPLICATION | ||
367 | |||
368 | /* Don't want software interrupts within a ring3 application */ | ||
369 | |||
370 | #undef BREAKPOINT3 | ||
371 | #define BREAKPOINT3 | ||
372 | #endif | ||
373 | |||
374 | /****************************************************************************** | ||
375 | * | ||
376 | * Compiler-specific information is contained in the compiler-specific | ||
377 | * headers. | ||
378 | * | ||
379 | *****************************************************************************/ | ||
380 | #endif /* __ACENV_H__ */ | 393 | #endif /* __ACENV_H__ */ |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 72553b0c9f33..e077ce6c38ca 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -64,8 +64,4 @@ | |||
64 | */ | 64 | */ |
65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
66 | 66 | ||
67 | #ifdef _ANSI | ||
68 | #define inline | ||
69 | #endif | ||
70 | |||
71 | #endif /* __ACGCC_H__ */ | 67 | #endif /* __ACGCC_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 85d5d8f38452..68534ef86ec8 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -108,7 +108,6 @@ | |||
108 | 108 | ||
109 | #include <acpi/platform/acgcc.h> | 109 | #include <acpi/platform/acgcc.h> |
110 | 110 | ||
111 | |||
112 | #ifdef __KERNEL__ | 111 | #ifdef __KERNEL__ |
113 | #include <acpi/actypes.h> | 112 | #include <acpi/actypes.h> |
114 | /* | 113 | /* |
diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 2533fddd34a6..d8d4c898c1bb 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h | |||
@@ -21,7 +21,7 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, | |||
21 | if (size == 8 && sizeof(unsigned long) != 8) | 21 | if (size == 8 && sizeof(unsigned long) != 8) |
22 | wrong_size_cmpxchg(ptr); | 22 | wrong_size_cmpxchg(ptr); |
23 | 23 | ||
24 | local_irq_save(flags); | 24 | raw_local_irq_save(flags); |
25 | switch (size) { | 25 | switch (size) { |
26 | case 1: prev = *(u8 *)ptr; | 26 | case 1: prev = *(u8 *)ptr; |
27 | if (prev == old) | 27 | if (prev == old) |
@@ -42,7 +42,7 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, | |||
42 | default: | 42 | default: |
43 | wrong_size_cmpxchg(ptr); | 43 | wrong_size_cmpxchg(ptr); |
44 | } | 44 | } |
45 | local_irq_restore(flags); | 45 | raw_local_irq_restore(flags); |
46 | return prev; | 46 | return prev; |
47 | } | 47 | } |
48 | 48 | ||
@@ -55,11 +55,11 @@ static inline u64 __cmpxchg64_local_generic(volatile void *ptr, | |||
55 | u64 prev; | 55 | u64 prev; |
56 | unsigned long flags; | 56 | unsigned long flags; |
57 | 57 | ||
58 | local_irq_save(flags); | 58 | raw_local_irq_save(flags); |
59 | prev = *(u64 *)ptr; | 59 | prev = *(u64 *)ptr; |
60 | if (prev == old) | 60 | if (prev == old) |
61 | *(u64 *)ptr = new; | 61 | *(u64 *)ptr = new; |
62 | local_irq_restore(flags); | 62 | raw_local_irq_restore(flags); |
63 | return prev; | 63 | return prev; |
64 | } | 64 | } |
65 | 65 | ||
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 20ca7663975f..bde646995d10 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -47,12 +47,14 @@ struct gpio; | |||
47 | struct seq_file; | 47 | struct seq_file; |
48 | struct module; | 48 | struct module; |
49 | struct device_node; | 49 | struct device_node; |
50 | struct gpio_desc; | ||
50 | 51 | ||
51 | /** | 52 | /** |
52 | * struct gpio_chip - abstract a GPIO controller | 53 | * struct gpio_chip - abstract a GPIO controller |
53 | * @label: for diagnostics | 54 | * @label: for diagnostics |
54 | * @dev: optional device providing the GPIOs | 55 | * @dev: optional device providing the GPIOs |
55 | * @owner: helps prevent removal of modules exporting active GPIOs | 56 | * @owner: helps prevent removal of modules exporting active GPIOs |
57 | * @list: links gpio_chips together for traversal | ||
56 | * @request: optional hook for chip-specific activation, such as | 58 | * @request: optional hook for chip-specific activation, such as |
57 | * enabling module power and clock; may sleep | 59 | * enabling module power and clock; may sleep |
58 | * @free: optional hook for chip-specific deactivation, such as | 60 | * @free: optional hook for chip-specific deactivation, such as |
@@ -75,6 +77,7 @@ struct device_node; | |||
75 | * negative during registration, requests dynamic ID allocation. | 77 | * negative during registration, requests dynamic ID allocation. |
76 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 78 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
77 | * handled is (base + ngpio - 1). | 79 | * handled is (base + ngpio - 1). |
80 | * @desc: array of ngpio descriptors. Private. | ||
78 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | 81 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they |
79 | * must while accessing GPIO expander chips over I2C or SPI | 82 | * must while accessing GPIO expander chips over I2C or SPI |
80 | * @names: if set, must be an array of strings to use as alternative | 83 | * @names: if set, must be an array of strings to use as alternative |
@@ -98,6 +101,7 @@ struct gpio_chip { | |||
98 | const char *label; | 101 | const char *label; |
99 | struct device *dev; | 102 | struct device *dev; |
100 | struct module *owner; | 103 | struct module *owner; |
104 | struct list_head list; | ||
101 | 105 | ||
102 | int (*request)(struct gpio_chip *chip, | 106 | int (*request)(struct gpio_chip *chip, |
103 | unsigned offset); | 107 | unsigned offset); |
@@ -124,6 +128,7 @@ struct gpio_chip { | |||
124 | struct gpio_chip *chip); | 128 | struct gpio_chip *chip); |
125 | int base; | 129 | int base; |
126 | u16 ngpio; | 130 | u16 ngpio; |
131 | struct gpio_desc *desc; | ||
127 | const char *const *names; | 132 | const char *const *names; |
128 | unsigned can_sleep:1; | 133 | unsigned can_sleep:1; |
129 | unsigned exported:1; | 134 | unsigned exported:1; |
@@ -152,7 +157,6 @@ struct gpio_chip { | |||
152 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 157 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
153 | unsigned offset); | 158 | unsigned offset); |
154 | extern struct gpio_chip *gpio_to_chip(unsigned gpio); | 159 | extern struct gpio_chip *gpio_to_chip(unsigned gpio); |
155 | extern int __must_check gpiochip_reserve(int start, int ngpio); | ||
156 | 160 | ||
157 | /* add/remove chips */ | 161 | /* add/remove chips */ |
158 | extern int gpiochip_add(struct gpio_chip *chip); | 162 | extern int gpiochip_add(struct gpio_chip *chip); |
@@ -192,12 +196,6 @@ extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *labe | |||
192 | extern int gpio_request_array(const struct gpio *array, size_t num); | 196 | extern int gpio_request_array(const struct gpio *array, size_t num); |
193 | extern void gpio_free_array(const struct gpio *array, size_t num); | 197 | extern void gpio_free_array(const struct gpio *array, size_t num); |
194 | 198 | ||
195 | /* bindings for managed devices that want to request gpios */ | ||
196 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
197 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
198 | unsigned long flags, const char *label); | ||
199 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
200 | |||
201 | #ifdef CONFIG_GPIO_SYSFS | 199 | #ifdef CONFIG_GPIO_SYSFS |
202 | 200 | ||
203 | /* | 201 | /* |
@@ -212,6 +210,43 @@ extern void gpio_unexport(unsigned gpio); | |||
212 | 210 | ||
213 | #endif /* CONFIG_GPIO_SYSFS */ | 211 | #endif /* CONFIG_GPIO_SYSFS */ |
214 | 212 | ||
213 | #ifdef CONFIG_PINCTRL | ||
214 | |||
215 | /** | ||
216 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
217 | * @head: list for maintaining set of pin ranges, used internally | ||
218 | * @pctldev: pinctrl device which handles corresponding pins | ||
219 | * @range: actual range of pins controlled by a gpio controller | ||
220 | */ | ||
221 | |||
222 | struct gpio_pin_range { | ||
223 | struct list_head node; | ||
224 | struct pinctrl_dev *pctldev; | ||
225 | struct pinctrl_gpio_range range; | ||
226 | }; | ||
227 | |||
228 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
229 | unsigned int gpio_offset, unsigned int pin_offset, | ||
230 | unsigned int npins); | ||
231 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
232 | |||
233 | #else | ||
234 | |||
235 | static inline int | ||
236 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
237 | unsigned int gpio_offset, unsigned int pin_offset, | ||
238 | unsigned int npins) | ||
239 | { | ||
240 | return 0; | ||
241 | } | ||
242 | |||
243 | static inline void | ||
244 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
245 | { | ||
246 | } | ||
247 | |||
248 | #endif /* CONFIG_PINCTRL */ | ||
249 | |||
215 | #else /* !CONFIG_GPIOLIB */ | 250 | #else /* !CONFIG_GPIOLIB */ |
216 | 251 | ||
217 | static inline bool gpio_is_valid(int number) | 252 | static inline bool gpio_is_valid(int number) |
@@ -270,41 +305,4 @@ static inline void gpio_unexport(unsigned gpio) | |||
270 | } | 305 | } |
271 | #endif /* CONFIG_GPIO_SYSFS */ | 306 | #endif /* CONFIG_GPIO_SYSFS */ |
272 | 307 | ||
273 | #ifdef CONFIG_PINCTRL | ||
274 | |||
275 | /** | ||
276 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
277 | * @head: list for maintaining set of pin ranges, used internally | ||
278 | * @pctldev: pinctrl device which handles corresponding pins | ||
279 | * @range: actual range of pins controlled by a gpio controller | ||
280 | */ | ||
281 | |||
282 | struct gpio_pin_range { | ||
283 | struct list_head node; | ||
284 | struct pinctrl_dev *pctldev; | ||
285 | struct pinctrl_gpio_range range; | ||
286 | }; | ||
287 | |||
288 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
289 | unsigned int gpio_offset, unsigned int pin_offset, | ||
290 | unsigned int npins); | ||
291 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
292 | |||
293 | #else | ||
294 | |||
295 | static inline int | ||
296 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
297 | unsigned int gpio_offset, unsigned int pin_offset, | ||
298 | unsigned int npins) | ||
299 | { | ||
300 | return 0; | ||
301 | } | ||
302 | |||
303 | static inline void | ||
304 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
305 | { | ||
306 | } | ||
307 | |||
308 | #endif /* CONFIG_PINCTRL */ | ||
309 | |||
310 | #endif /* _ASM_GENERIC_GPIO_H */ | 308 | #endif /* _ASM_GENERIC_GPIO_H */ |
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 33bbbae4ddc6..8e260cf01351 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -53,8 +53,18 @@ static inline u32 __raw_readl(const volatile void __iomem *addr) | |||
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #define readb __raw_readb | 55 | #define readb __raw_readb |
56 | #define readw(addr) __le16_to_cpu(__raw_readw(addr)) | 56 | |
57 | #define readl(addr) __le32_to_cpu(__raw_readl(addr)) | 57 | #define readw readw |
58 | static inline u16 readw(const volatile void __iomem *addr) | ||
59 | { | ||
60 | return __le16_to_cpu(__raw_readw(addr)); | ||
61 | } | ||
62 | |||
63 | #define readl readl | ||
64 | static inline u32 readl(const volatile void __iomem *addr) | ||
65 | { | ||
66 | return __le32_to_cpu(__raw_readl(addr)); | ||
67 | } | ||
58 | 68 | ||
59 | #ifndef __raw_writeb | 69 | #ifndef __raw_writeb |
60 | static inline void __raw_writeb(u8 b, volatile void __iomem *addr) | 70 | static inline void __raw_writeb(u8 b, volatile void __iomem *addr) |
@@ -89,7 +99,11 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) | |||
89 | } | 99 | } |
90 | #endif | 100 | #endif |
91 | 101 | ||
92 | #define readq(addr) __le64_to_cpu(__raw_readq(addr)) | 102 | #define readq readq |
103 | static inline u64 readq(const volatile void __iomem *addr) | ||
104 | { | ||
105 | return __le64_to_cpu(__raw_readq(addr)); | ||
106 | } | ||
93 | 107 | ||
94 | #ifndef __raw_writeq | 108 | #ifndef __raw_writeq |
95 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) | 109 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 5cf680a98f9b..bfd87685fc1f 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -197,16 +197,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
197 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 197 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | ||
201 | #define page_test_and_clear_dirty(pfn, mapped) (0) | ||
202 | #endif | ||
203 | |||
204 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | ||
205 | #define pte_maybe_dirty(pte) pte_dirty(pte) | ||
206 | #else | ||
207 | #define pte_maybe_dirty(pte) (1) | ||
208 | #endif | ||
209 | |||
210 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 200 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |
211 | #define page_test_and_clear_young(pfn) (0) | 201 | #define page_test_and_clear_young(pfn) (0) |
212 | #endif | 202 | #endif |
diff --git a/include/asm-generic/syscalls.h b/include/asm-generic/syscalls.h index 1db51b8524e9..1f74be5113b2 100644 --- a/include/asm-generic/syscalls.h +++ b/include/asm-generic/syscalls.h | |||
@@ -21,24 +21,8 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | |||
21 | unsigned long fd, off_t pgoff); | 21 | unsigned long fd, off_t pgoff); |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #ifndef CONFIG_GENERIC_SIGALTSTACK | ||
25 | #ifndef sys_sigaltstack | ||
26 | asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *, | ||
27 | struct pt_regs *); | ||
28 | #endif | ||
29 | #endif | ||
30 | |||
31 | #ifndef sys_rt_sigreturn | 24 | #ifndef sys_rt_sigreturn |
32 | asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); | 25 | asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); |
33 | #endif | 26 | #endif |
34 | 27 | ||
35 | #ifndef sys_rt_sigsuspend | ||
36 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | ||
37 | #endif | ||
38 | |||
39 | #ifndef sys_rt_sigaction | ||
40 | asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
41 | struct sigaction __user *oact, size_t sigsetsize); | ||
42 | #endif | ||
43 | |||
44 | #endif /* __ASM_GENERIC_SYSCALLS_H */ | 28 | #endif /* __ASM_GENERIC_SYSCALLS_H */ |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index a36991ab334e..257c55ec4f77 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -9,9 +9,6 @@ | |||
9 | #define __ARCH_WANT_STAT64 | 9 | #define __ARCH_WANT_STAT64 |
10 | #define __ARCH_WANT_SYS_LLSEEK | 10 | #define __ARCH_WANT_SYS_LLSEEK |
11 | #endif | 11 | #endif |
12 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
13 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
14 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | ||
15 | 12 | ||
16 | /* | 13 | /* |
17 | * "Conditional" syscalls | 14 | * "Conditional" syscalls |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index d1ea7ce0b4cb..afa12c7a025c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -149,6 +149,33 @@ | |||
149 | #define TRACE_SYSCALLS() | 149 | #define TRACE_SYSCALLS() |
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #ifdef CONFIG_CLKSRC_OF | ||
153 | #define CLKSRC_OF_TABLES() . = ALIGN(8); \ | ||
154 | VMLINUX_SYMBOL(__clksrc_of_table) = .; \ | ||
155 | *(__clksrc_of_table) \ | ||
156 | *(__clksrc_of_table_end) | ||
157 | #else | ||
158 | #define CLKSRC_OF_TABLES() | ||
159 | #endif | ||
160 | |||
161 | #ifdef CONFIG_IRQCHIP | ||
162 | #define IRQCHIP_OF_MATCH_TABLE() \ | ||
163 | . = ALIGN(8); \ | ||
164 | VMLINUX_SYMBOL(__irqchip_begin) = .; \ | ||
165 | *(__irqchip_of_table) \ | ||
166 | *(__irqchip_of_end) | ||
167 | #else | ||
168 | #define IRQCHIP_OF_MATCH_TABLE() | ||
169 | #endif | ||
170 | |||
171 | #ifdef CONFIG_COMMON_CLK | ||
172 | #define CLK_OF_TABLES() . = ALIGN(8); \ | ||
173 | VMLINUX_SYMBOL(__clk_of_table) = .; \ | ||
174 | *(__clk_of_table) \ | ||
175 | *(__clk_of_table_end) | ||
176 | #else | ||
177 | #define CLK_OF_TABLES() | ||
178 | #endif | ||
152 | 179 | ||
153 | #define KERNEL_DTB() \ | 180 | #define KERNEL_DTB() \ |
154 | STRUCT_ALIGN(); \ | 181 | STRUCT_ALIGN(); \ |
@@ -493,7 +520,10 @@ | |||
493 | DEV_DISCARD(init.rodata) \ | 520 | DEV_DISCARD(init.rodata) \ |
494 | CPU_DISCARD(init.rodata) \ | 521 | CPU_DISCARD(init.rodata) \ |
495 | MEM_DISCARD(init.rodata) \ | 522 | MEM_DISCARD(init.rodata) \ |
496 | KERNEL_DTB() | 523 | CLK_OF_TABLES() \ |
524 | CLKSRC_OF_TABLES() \ | ||
525 | KERNEL_DTB() \ | ||
526 | IRQCHIP_OF_MATCH_TABLE() | ||
497 | 527 | ||
498 | #define INIT_TEXT \ | 528 | #define INIT_TEXT \ |
499 | *(.init.text) \ | 529 | *(.init.text) \ |
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h new file mode 100644 index 000000000000..2603267b1a29 --- /dev/null +++ b/include/clocksource/arm_arch_timer.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 ARM 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 | * 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 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #ifndef __CLKSOURCE_ARM_ARCH_TIMER_H | ||
17 | #define __CLKSOURCE_ARM_ARCH_TIMER_H | ||
18 | |||
19 | #include <linux/clocksource.h> | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | #define ARCH_TIMER_CTRL_ENABLE (1 << 0) | ||
23 | #define ARCH_TIMER_CTRL_IT_MASK (1 << 1) | ||
24 | #define ARCH_TIMER_CTRL_IT_STAT (1 << 2) | ||
25 | |||
26 | #define ARCH_TIMER_REG_CTRL 0 | ||
27 | #define ARCH_TIMER_REG_TVAL 1 | ||
28 | |||
29 | #define ARCH_TIMER_PHYS_ACCESS 0 | ||
30 | #define ARCH_TIMER_VIRT_ACCESS 1 | ||
31 | |||
32 | #ifdef CONFIG_ARM_ARCH_TIMER | ||
33 | |||
34 | extern int arch_timer_init(void); | ||
35 | extern u32 arch_timer_get_rate(void); | ||
36 | extern u64 (*arch_timer_read_counter)(void); | ||
37 | extern struct timecounter *arch_timer_get_timecounter(void); | ||
38 | |||
39 | #else | ||
40 | |||
41 | static inline int arch_timer_init(void) | ||
42 | { | ||
43 | return -ENXIO; | ||
44 | } | ||
45 | |||
46 | static inline u32 arch_timer_get_rate(void) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static inline u64 arch_timer_read_counter(void) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static inline struct timecounter *arch_timer_get_timecounter(void) | ||
57 | { | ||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | #endif | ||
62 | |||
63 | #endif | ||
diff --git a/include/clocksource/arm_generic.h b/include/clocksource/arm_generic.h deleted file mode 100644 index 5b41b0d27f0f..000000000000 --- a/include/clocksource/arm_generic.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 ARM 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 | * 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 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #ifndef __CLKSOURCE_ARM_GENERIC_H | ||
17 | #define __CLKSOURCE_ARM_GENERIC_H | ||
18 | |||
19 | extern int arm_generic_timer_init(void); | ||
20 | |||
21 | #endif | ||
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index fad21c927a38..2d94d7413d71 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -85,6 +85,9 @@ struct module; | |||
85 | struct drm_file; | 85 | struct drm_file; |
86 | struct drm_device; | 86 | struct drm_device; |
87 | 87 | ||
88 | struct device_node; | ||
89 | struct videomode; | ||
90 | |||
88 | #include <drm/drm_os_linux.h> | 91 | #include <drm/drm_os_linux.h> |
89 | #include <drm/drm_hashtab.h> | 92 | #include <drm/drm_hashtab.h> |
90 | #include <drm/drm_mm.h> | 93 | #include <drm/drm_mm.h> |
@@ -446,7 +449,15 @@ struct drm_file { | |||
446 | int is_master; /* this file private is a master for a minor */ | 449 | int is_master; /* this file private is a master for a minor */ |
447 | struct drm_master *master; /* master this node is currently associated with | 450 | struct drm_master *master; /* master this node is currently associated with |
448 | N.B. not always minor->master */ | 451 | N.B. not always minor->master */ |
452 | |||
453 | /** | ||
454 | * fbs - List of framebuffers associated with this file. | ||
455 | * | ||
456 | * Protected by fbs_lock. Note that the fbs list holds a reference on | ||
457 | * the fb object to prevent it from untimely disappearing. | ||
458 | */ | ||
449 | struct list_head fbs; | 459 | struct list_head fbs; |
460 | struct mutex fbs_lock; | ||
450 | 461 | ||
451 | wait_queue_head_t event_wait; | 462 | wait_queue_head_t event_wait; |
452 | struct list_head event_list; | 463 | struct list_head event_list; |
@@ -919,6 +930,14 @@ struct drm_driver { | |||
919 | /* import dmabuf -> GEM */ | 930 | /* import dmabuf -> GEM */ |
920 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, | 931 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, |
921 | struct dma_buf *dma_buf); | 932 | struct dma_buf *dma_buf); |
933 | /* low-level interface used by drm_gem_prime_{import,export} */ | ||
934 | int (*gem_prime_pin)(struct drm_gem_object *obj); | ||
935 | struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj); | ||
936 | struct drm_gem_object *(*gem_prime_import_sg_table)( | ||
937 | struct drm_device *dev, size_t size, | ||
938 | struct sg_table *sgt); | ||
939 | void *(*gem_prime_vmap)(struct drm_gem_object *obj); | ||
940 | void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); | ||
922 | 941 | ||
923 | /* vga arb irq handler */ | 942 | /* vga arb irq handler */ |
924 | void (*vgaarb_irq)(struct drm_device *dev, bool state); | 943 | void (*vgaarb_irq)(struct drm_device *dev, bool state); |
@@ -1276,6 +1295,11 @@ static inline int drm_device_is_unplugged(struct drm_device *dev) | |||
1276 | return ret; | 1295 | return ret; |
1277 | } | 1296 | } |
1278 | 1297 | ||
1298 | static inline bool drm_modeset_is_locked(struct drm_device *dev) | ||
1299 | { | ||
1300 | return mutex_is_locked(&dev->mode_config.mutex); | ||
1301 | } | ||
1302 | |||
1279 | /******************************************************************/ | 1303 | /******************************************************************/ |
1280 | /** \name Internal function definitions */ | 1304 | /** \name Internal function definitions */ |
1281 | /*@{*/ | 1305 | /*@{*/ |
@@ -1456,6 +1480,12 @@ extern struct drm_display_mode * | |||
1456 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, | 1480 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, |
1457 | struct drm_cmdline_mode *cmd); | 1481 | struct drm_cmdline_mode *cmd); |
1458 | 1482 | ||
1483 | extern int drm_display_mode_from_videomode(const struct videomode *vm, | ||
1484 | struct drm_display_mode *dmode); | ||
1485 | extern int of_get_drm_display_mode(struct device_node *np, | ||
1486 | struct drm_display_mode *dmode, | ||
1487 | int index); | ||
1488 | |||
1459 | /* Modesetting support */ | 1489 | /* Modesetting support */ |
1460 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1490 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
1461 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | 1491 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
@@ -1540,9 +1570,13 @@ extern int drm_clients_info(struct seq_file *m, void* data); | |||
1540 | extern int drm_gem_name_info(struct seq_file *m, void *data); | 1570 | extern int drm_gem_name_info(struct seq_file *m, void *data); |
1541 | 1571 | ||
1542 | 1572 | ||
1573 | extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev, | ||
1574 | struct drm_gem_object *obj, int flags); | ||
1543 | extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, | 1575 | extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, |
1544 | struct drm_file *file_priv, uint32_t handle, uint32_t flags, | 1576 | struct drm_file *file_priv, uint32_t handle, uint32_t flags, |
1545 | int *prime_fd); | 1577 | int *prime_fd); |
1578 | extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev, | ||
1579 | struct dma_buf *dma_buf); | ||
1546 | extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, | 1580 | extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, |
1547 | struct drm_file *file_priv, int prime_fd, uint32_t *handle); | 1581 | struct drm_file *file_priv, int prime_fd, uint32_t *handle); |
1548 | 1582 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 00d78b5161c0..8839b3a24660 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -38,7 +38,8 @@ struct drm_device; | |||
38 | struct drm_mode_set; | 38 | struct drm_mode_set; |
39 | struct drm_framebuffer; | 39 | struct drm_framebuffer; |
40 | struct drm_object_properties; | 40 | struct drm_object_properties; |
41 | 41 | struct drm_file; | |
42 | struct drm_clip_rect; | ||
42 | 43 | ||
43 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc | 44 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc |
44 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | 45 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 |
@@ -254,6 +255,10 @@ struct drm_framebuffer { | |||
254 | * userspace perspective. | 255 | * userspace perspective. |
255 | */ | 256 | */ |
256 | struct kref refcount; | 257 | struct kref refcount; |
258 | /* | ||
259 | * Place on the dev->mode_config.fb_list, access protected by | ||
260 | * dev->mode_config.fb_lock. | ||
261 | */ | ||
257 | struct list_head head; | 262 | struct list_head head; |
258 | struct drm_mode_object base; | 263 | struct drm_mode_object base; |
259 | const struct drm_framebuffer_funcs *funcs; | 264 | const struct drm_framebuffer_funcs *funcs; |
@@ -390,6 +395,15 @@ struct drm_crtc { | |||
390 | struct drm_device *dev; | 395 | struct drm_device *dev; |
391 | struct list_head head; | 396 | struct list_head head; |
392 | 397 | ||
398 | /** | ||
399 | * crtc mutex | ||
400 | * | ||
401 | * This provides a read lock for the overall crtc state (mode, dpms | ||
402 | * state, ...) and a write lock for everything which can be update | ||
403 | * without a full modeset (fb, cursor data, ...) | ||
404 | */ | ||
405 | struct mutex mutex; | ||
406 | |||
393 | struct drm_mode_object base; | 407 | struct drm_mode_object base; |
394 | 408 | ||
395 | /* framebuffer the connector is currently bound to */ | 409 | /* framebuffer the connector is currently bound to */ |
@@ -771,8 +785,18 @@ struct drm_mode_config { | |||
771 | struct mutex idr_mutex; /* for IDR management */ | 785 | struct mutex idr_mutex; /* for IDR management */ |
772 | struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ | 786 | struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ |
773 | /* this is limited to one for now */ | 787 | /* this is limited to one for now */ |
788 | |||
789 | |||
790 | /** | ||
791 | * fb_lock - mutex to protect fb state | ||
792 | * | ||
793 | * Besides the global fb list his also protects the fbs list in the | ||
794 | * file_priv | ||
795 | */ | ||
796 | struct mutex fb_lock; | ||
774 | int num_fb; | 797 | int num_fb; |
775 | struct list_head fb_list; | 798 | struct list_head fb_list; |
799 | |||
776 | int num_connector; | 800 | int num_connector; |
777 | struct list_head connector_list; | 801 | struct list_head connector_list; |
778 | int num_encoder; | 802 | int num_encoder; |
@@ -842,6 +866,10 @@ struct drm_prop_enum_list { | |||
842 | char *name; | 866 | char *name; |
843 | }; | 867 | }; |
844 | 868 | ||
869 | extern void drm_modeset_lock_all(struct drm_device *dev); | ||
870 | extern void drm_modeset_unlock_all(struct drm_device *dev); | ||
871 | extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); | ||
872 | |||
845 | extern int drm_crtc_init(struct drm_device *dev, | 873 | extern int drm_crtc_init(struct drm_device *dev, |
846 | struct drm_crtc *crtc, | 874 | struct drm_crtc *crtc, |
847 | const struct drm_crtc_funcs *funcs); | 875 | const struct drm_crtc_funcs *funcs); |
@@ -932,10 +960,13 @@ extern void drm_framebuffer_set_object(struct drm_device *dev, | |||
932 | extern int drm_framebuffer_init(struct drm_device *dev, | 960 | extern int drm_framebuffer_init(struct drm_device *dev, |
933 | struct drm_framebuffer *fb, | 961 | struct drm_framebuffer *fb, |
934 | const struct drm_framebuffer_funcs *funcs); | 962 | const struct drm_framebuffer_funcs *funcs); |
963 | extern struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev, | ||
964 | uint32_t id); | ||
935 | extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); | 965 | extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); |
936 | extern void drm_framebuffer_reference(struct drm_framebuffer *fb); | 966 | extern void drm_framebuffer_reference(struct drm_framebuffer *fb); |
937 | extern void drm_framebuffer_remove(struct drm_framebuffer *fb); | 967 | extern void drm_framebuffer_remove(struct drm_framebuffer *fb); |
938 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); | 968 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); |
969 | extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb); | ||
939 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); | 970 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); |
940 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); | 971 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); |
941 | extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); | 972 | extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); |
@@ -985,6 +1016,7 @@ extern int drm_mode_getcrtc(struct drm_device *dev, | |||
985 | void *data, struct drm_file *file_priv); | 1016 | void *data, struct drm_file *file_priv); |
986 | extern int drm_mode_getconnector(struct drm_device *dev, | 1017 | extern int drm_mode_getconnector(struct drm_device *dev, |
987 | void *data, struct drm_file *file_priv); | 1018 | void *data, struct drm_file *file_priv); |
1019 | extern int drm_mode_set_config_internal(struct drm_mode_set *set); | ||
988 | extern int drm_mode_setcrtc(struct drm_device *dev, | 1020 | extern int drm_mode_setcrtc(struct drm_device *dev, |
989 | void *data, struct drm_file *file_priv); | 1021 | void *data, struct drm_file *file_priv); |
990 | extern int drm_mode_getplane(struct drm_device *dev, | 1022 | extern int drm_mode_getplane(struct drm_device *dev, |
@@ -1030,9 +1062,10 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, | |||
1030 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, | 1062 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, |
1031 | void *data, struct drm_file *file_priv); | 1063 | void *data, struct drm_file *file_priv); |
1032 | extern u8 *drm_find_cea_extension(struct edid *edid); | 1064 | extern u8 *drm_find_cea_extension(struct edid *edid); |
1033 | extern u8 drm_match_cea_mode(struct drm_display_mode *to_match); | 1065 | extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); |
1034 | extern bool drm_detect_hdmi_monitor(struct edid *edid); | 1066 | extern bool drm_detect_hdmi_monitor(struct edid *edid); |
1035 | extern bool drm_detect_monitor_audio(struct edid *edid); | 1067 | extern bool drm_detect_monitor_audio(struct edid *edid); |
1068 | extern bool drm_rgb_quant_range_selectable(struct edid *edid); | ||
1036 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, | 1069 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, |
1037 | void *data, struct drm_file *file_priv); | 1070 | void *data, struct drm_file *file_priv); |
1038 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, | 1071 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, |
@@ -1047,7 +1080,6 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev, | |||
1047 | int GTF_2C, int GTF_K, int GTF_2J); | 1080 | int GTF_2C, int GTF_K, int GTF_2J); |
1048 | extern int drm_add_modes_noedid(struct drm_connector *connector, | 1081 | extern int drm_add_modes_noedid(struct drm_connector *connector, |
1049 | int hdisplay, int vdisplay); | 1082 | int hdisplay, int vdisplay); |
1050 | extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode); | ||
1051 | 1083 | ||
1052 | extern int drm_edid_header_is_valid(const u8 *raw_edid); | 1084 | extern int drm_edid_header_is_valid(const u8 *raw_edid); |
1053 | extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); | 1085 | extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 0cac551c5347..5da1b4ae7d84 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
@@ -247,6 +247,8 @@ struct edid { | |||
247 | struct drm_encoder; | 247 | struct drm_encoder; |
248 | struct drm_connector; | 248 | struct drm_connector; |
249 | struct drm_display_mode; | 249 | struct drm_display_mode; |
250 | struct hdmi_avi_infoframe; | ||
251 | |||
250 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); | 252 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); |
251 | int drm_av_sync_delay(struct drm_connector *connector, | 253 | int drm_av_sync_delay(struct drm_connector *connector, |
252 | struct drm_display_mode *mode); | 254 | struct drm_display_mode *mode); |
@@ -254,4 +256,8 @@ struct drm_connector *drm_select_eld(struct drm_encoder *encoder, | |||
254 | struct drm_display_mode *mode); | 256 | struct drm_display_mode *mode); |
255 | int drm_load_edid_firmware(struct drm_connector *connector); | 257 | int drm_load_edid_firmware(struct drm_connector *connector); |
256 | 258 | ||
259 | int | ||
260 | drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, | ||
261 | const struct drm_display_mode *mode); | ||
262 | |||
257 | #endif /* __DRM_EDID_H__ */ | 263 | #endif /* __DRM_EDID_H__ */ |
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h index b0c11a7809bb..8b9cc3671858 100644 --- a/include/drm/drm_encoder_slave.h +++ b/include/drm/drm_encoder_slave.h | |||
@@ -159,4 +159,24 @@ static inline void drm_i2c_encoder_unregister(struct drm_i2c_encoder_driver *dri | |||
159 | 159 | ||
160 | void drm_i2c_encoder_destroy(struct drm_encoder *encoder); | 160 | void drm_i2c_encoder_destroy(struct drm_encoder *encoder); |
161 | 161 | ||
162 | |||
163 | /* | ||
164 | * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: | ||
165 | */ | ||
166 | |||
167 | void drm_i2c_encoder_dpms(struct drm_encoder *encoder, int mode); | ||
168 | bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder, | ||
169 | const struct drm_display_mode *mode, | ||
170 | struct drm_display_mode *adjusted_mode); | ||
171 | void drm_i2c_encoder_prepare(struct drm_encoder *encoder); | ||
172 | void drm_i2c_encoder_commit(struct drm_encoder *encoder); | ||
173 | void drm_i2c_encoder_mode_set(struct drm_encoder *encoder, | ||
174 | struct drm_display_mode *mode, | ||
175 | struct drm_display_mode *adjusted_mode); | ||
176 | enum drm_connector_status drm_i2c_encoder_detect(struct drm_encoder *encoder, | ||
177 | struct drm_connector *connector); | ||
178 | void drm_i2c_encoder_save(struct drm_encoder *encoder); | ||
179 | void drm_i2c_encoder_restore(struct drm_encoder *encoder); | ||
180 | |||
181 | |||
162 | #endif | 182 | #endif |
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h index 76c709837543..4a3fc244301c 100644 --- a/include/drm/drm_fb_cma_helper.h +++ b/include/drm/drm_fb_cma_helper.h | |||
@@ -23,5 +23,10 @@ struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev, | |||
23 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, | 23 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, |
24 | unsigned int plane); | 24 | unsigned int plane); |
25 | 25 | ||
26 | #ifdef CONFIG_DEBUG_FS | ||
27 | void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m); | ||
28 | int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg); | ||
29 | #endif | ||
30 | |||
26 | #endif | 31 | #endif |
27 | 32 | ||
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 5120b01c2eeb..c09511625a11 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -48,6 +48,18 @@ struct drm_fb_helper_surface_size { | |||
48 | u32 surface_depth; | 48 | u32 surface_depth; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | /** | ||
52 | * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library | ||
53 | * @gamma_set: - Set the given gamma lut register on the given crtc. | ||
54 | * @gamma_get: - Read the given gamma lut register on the given crtc, used to | ||
55 | * save the current lut when force-restoring the fbdev for e.g. | ||
56 | * kdbg. | ||
57 | * @fb_probe: - Driver callback to allocate and initialize the fbdev info | ||
58 | * structure. Futhermore it also needs to allocate the drm | ||
59 | * framebuffer used to back the fbdev. | ||
60 | * | ||
61 | * Driver callbacks used by the fbdev emulation helper library. | ||
62 | */ | ||
51 | struct drm_fb_helper_funcs { | 63 | struct drm_fb_helper_funcs { |
52 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, | 64 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, |
53 | u16 blue, int regno); | 65 | u16 blue, int regno); |
@@ -65,9 +77,7 @@ struct drm_fb_helper_connector { | |||
65 | 77 | ||
66 | struct drm_fb_helper { | 78 | struct drm_fb_helper { |
67 | struct drm_framebuffer *fb; | 79 | struct drm_framebuffer *fb; |
68 | struct drm_framebuffer *saved_fb; | ||
69 | struct drm_device *dev; | 80 | struct drm_device *dev; |
70 | struct drm_display_mode *mode; | ||
71 | int crtc_count; | 81 | int crtc_count; |
72 | struct drm_fb_helper_crtc *crtc_info; | 82 | struct drm_fb_helper_crtc *crtc_info; |
73 | int connector_count; | 83 | int connector_count; |
@@ -82,9 +92,6 @@ struct drm_fb_helper { | |||
82 | bool delayed_hotplug; | 92 | bool delayed_hotplug; |
83 | }; | 93 | }; |
84 | 94 | ||
85 | int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, | ||
86 | int preferred_bpp); | ||
87 | |||
88 | int drm_fb_helper_init(struct drm_device *dev, | 95 | int drm_fb_helper_init(struct drm_device *dev, |
89 | struct drm_fb_helper *helper, int crtc_count, | 96 | struct drm_fb_helper *helper, int crtc_count, |
90 | int max_conn); | 97 | int max_conn); |
@@ -103,7 +110,6 @@ int drm_fb_helper_setcolreg(unsigned regno, | |||
103 | struct fb_info *info); | 110 | struct fb_info *info); |
104 | 111 | ||
105 | bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); | 112 | bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); |
106 | void drm_fb_helper_restore(void); | ||
107 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, | 113 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, |
108 | uint32_t fb_width, uint32_t fb_height); | 114 | uint32_t fb_width, uint32_t fb_height); |
109 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | 115 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, |
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index f0f6b1af25ad..63397ced9254 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h | |||
@@ -41,4 +41,8 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, | |||
41 | 41 | ||
42 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; | 42 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; |
43 | 43 | ||
44 | #ifdef CONFIG_DEBUG_FS | ||
45 | void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m); | ||
46 | #endif | ||
47 | |||
44 | #endif /* __DRM_GEM_CMA_HELPER_H__ */ | 48 | #endif /* __DRM_GEM_CMA_HELPER_H__ */ |
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 3527fb3f75bb..88591ef8fa24 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -89,6 +89,29 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) | |||
89 | { | 89 | { |
90 | return mm->hole_stack.next; | 90 | return mm->hole_stack.next; |
91 | } | 91 | } |
92 | |||
93 | static inline unsigned long __drm_mm_hole_node_start(struct drm_mm_node *hole_node) | ||
94 | { | ||
95 | return hole_node->start + hole_node->size; | ||
96 | } | ||
97 | |||
98 | static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node) | ||
99 | { | ||
100 | BUG_ON(!hole_node->hole_follows); | ||
101 | return __drm_mm_hole_node_start(hole_node); | ||
102 | } | ||
103 | |||
104 | static inline unsigned long __drm_mm_hole_node_end(struct drm_mm_node *hole_node) | ||
105 | { | ||
106 | return list_entry(hole_node->node_list.next, | ||
107 | struct drm_mm_node, node_list)->start; | ||
108 | } | ||
109 | |||
110 | static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node) | ||
111 | { | ||
112 | return __drm_mm_hole_node_end(hole_node); | ||
113 | } | ||
114 | |||
92 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ | 115 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ |
93 | &(mm)->head_node.node_list, \ | 116 | &(mm)->head_node.node_list, \ |
94 | node_list) | 117 | node_list) |
@@ -99,9 +122,26 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) | |||
99 | entry != NULL; entry = next, \ | 122 | entry != NULL; entry = next, \ |
100 | next = entry ? list_entry(entry->node_list.next, \ | 123 | next = entry ? list_entry(entry->node_list.next, \ |
101 | struct drm_mm_node, node_list) : NULL) \ | 124 | struct drm_mm_node, node_list) : NULL) \ |
125 | |||
126 | /* Note that we need to unroll list_for_each_entry in order to inline | ||
127 | * setting hole_start and hole_end on each iteration and keep the | ||
128 | * macro sane. | ||
129 | */ | ||
130 | #define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \ | ||
131 | for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \ | ||
132 | &entry->hole_stack != &(mm)->hole_stack ? \ | ||
133 | hole_start = drm_mm_hole_node_start(entry), \ | ||
134 | hole_end = drm_mm_hole_node_end(entry), \ | ||
135 | 1 : 0; \ | ||
136 | entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack)) | ||
137 | |||
102 | /* | 138 | /* |
103 | * Basic range manager support (drm_mm.c) | 139 | * Basic range manager support (drm_mm.c) |
104 | */ | 140 | */ |
141 | extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm, | ||
142 | unsigned long start, | ||
143 | unsigned long size, | ||
144 | bool atomic); | ||
105 | extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, | 145 | extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, |
106 | unsigned long size, | 146 | unsigned long size, |
107 | unsigned alignment, | 147 | unsigned alignment, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index c5c35e629426..a386b0b654cc 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -139,6 +139,19 @@ | |||
139 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 139 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
140 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 140 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
141 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 141 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
142 | {0x1002, 0x6600, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
143 | {0x1002, 0x6601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
144 | {0x1002, 0x6602, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
145 | {0x1002, 0x6603, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
146 | {0x1002, 0x6606, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
147 | {0x1002, 0x6607, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
148 | {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
149 | {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
150 | {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
151 | {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
152 | {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
153 | {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
154 | {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
142 | {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 155 | {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
143 | {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 156 | {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
144 | {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 157 | {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index 6eb76a1f11ab..b08bdade6002 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h | |||
@@ -3,26 +3,8 @@ | |||
3 | #ifndef _DRM_INTEL_GTT_H | 3 | #ifndef _DRM_INTEL_GTT_H |
4 | #define _DRM_INTEL_GTT_H | 4 | #define _DRM_INTEL_GTT_H |
5 | 5 | ||
6 | struct intel_gtt { | 6 | void intel_gtt_get(size_t *gtt_total, size_t *stolen_size, |
7 | /* Size of memory reserved for graphics by the BIOS */ | 7 | phys_addr_t *mappable_base, unsigned long *mappable_end); |
8 | unsigned int stolen_size; | ||
9 | /* Total number of gtt entries. */ | ||
10 | unsigned int gtt_total_entries; | ||
11 | /* Part of the gtt that is mappable by the cpu, for those chips where | ||
12 | * this is not the full gtt. */ | ||
13 | unsigned int gtt_mappable_entries; | ||
14 | /* Whether i915 needs to use the dmar apis or not. */ | ||
15 | unsigned int needs_dmar : 1; | ||
16 | /* Whether we idle the gpu before mapping/unmapping */ | ||
17 | unsigned int do_idle_maps : 1; | ||
18 | /* Share the scratch page dma with ppgtts. */ | ||
19 | dma_addr_t scratch_page_dma; | ||
20 | struct page *scratch_page; | ||
21 | /* for ppgtt PDE access */ | ||
22 | u32 __iomem *gtt; | ||
23 | /* needed for ioremap in drm/i915 */ | ||
24 | phys_addr_t gma_bus_addr; | ||
25 | } *intel_gtt_get(void); | ||
26 | 8 | ||
27 | int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, | 9 | int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, |
28 | struct agp_bridge_data *bridge); | 10 | struct agp_bridge_data *bridge); |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e3a43a47d78c..0fbd046e7c93 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -790,16 +790,7 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); | |||
790 | * to make room for a buffer already reserved. (Buffers are reserved before | 790 | * to make room for a buffer already reserved. (Buffers are reserved before |
791 | * they are evicted). The following algorithm prevents such deadlocks from | 791 | * they are evicted). The following algorithm prevents such deadlocks from |
792 | * occurring: | 792 | * occurring: |
793 | * 1) Buffers are reserved with the lru spinlock held. Upon successful | 793 | * Processes attempting to reserve multiple buffers other than for eviction, |
794 | * reservation they are removed from the lru list. This stops a reserved buffer | ||
795 | * from being evicted. However the lru spinlock is released between the time | ||
796 | * a buffer is selected for eviction and the time it is reserved. | ||
797 | * Therefore a check is made when a buffer is reserved for eviction, that it | ||
798 | * is still the first buffer in the lru list, before it is removed from the | ||
799 | * list. @check_lru == 1 forces this check. If it fails, the function returns | ||
800 | * -EINVAL, and the caller should then choose a new buffer to evict and repeat | ||
801 | * the procedure. | ||
802 | * 2) Processes attempting to reserve multiple buffers other than for eviction, | ||
803 | * (typically execbuf), should first obtain a unique 32-bit | 794 | * (typically execbuf), should first obtain a unique 32-bit |
804 | * validation sequence number, | 795 | * validation sequence number, |
805 | * and call this function with @use_sequence == 1 and @sequence == the unique | 796 | * and call this function with @use_sequence == 1 and @sequence == the unique |
@@ -830,9 +821,39 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
830 | bool interruptible, | 821 | bool interruptible, |
831 | bool no_wait, bool use_sequence, uint32_t sequence); | 822 | bool no_wait, bool use_sequence, uint32_t sequence); |
832 | 823 | ||
824 | /** | ||
825 | * ttm_bo_reserve_slowpath_nolru: | ||
826 | * @bo: A pointer to a struct ttm_buffer_object. | ||
827 | * @interruptible: Sleep interruptible if waiting. | ||
828 | * @sequence: Set (@bo)->sequence to this value after lock | ||
829 | * | ||
830 | * This is called after ttm_bo_reserve returns -EAGAIN and we backed off | ||
831 | * from all our other reservations. Because there are no other reservations | ||
832 | * held by us, this function cannot deadlock any more. | ||
833 | * | ||
834 | * Will not remove reserved buffers from the lru lists. | ||
835 | * Otherwise identical to ttm_bo_reserve_slowpath. | ||
836 | */ | ||
837 | extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo, | ||
838 | bool interruptible, | ||
839 | uint32_t sequence); | ||
840 | |||
833 | 841 | ||
834 | /** | 842 | /** |
835 | * ttm_bo_reserve_locked: | 843 | * ttm_bo_reserve_slowpath: |
844 | * @bo: A pointer to a struct ttm_buffer_object. | ||
845 | * @interruptible: Sleep interruptible if waiting. | ||
846 | * @sequence: Set (@bo)->sequence to this value after lock | ||
847 | * | ||
848 | * This is called after ttm_bo_reserve returns -EAGAIN and we backed off | ||
849 | * from all our other reservations. Because there are no other reservations | ||
850 | * held by us, this function cannot deadlock any more. | ||
851 | */ | ||
852 | extern int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo, | ||
853 | bool interruptible, uint32_t sequence); | ||
854 | |||
855 | /** | ||
856 | * ttm_bo_reserve_nolru: | ||
836 | * | 857 | * |
837 | * @bo: A pointer to a struct ttm_buffer_object. | 858 | * @bo: A pointer to a struct ttm_buffer_object. |
838 | * @interruptible: Sleep interruptible if waiting. | 859 | * @interruptible: Sleep interruptible if waiting. |
@@ -840,9 +861,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
840 | * @use_sequence: If @bo is already reserved, Only sleep waiting for | 861 | * @use_sequence: If @bo is already reserved, Only sleep waiting for |
841 | * it to become unreserved if @sequence < (@bo)->sequence. | 862 | * it to become unreserved if @sequence < (@bo)->sequence. |
842 | * | 863 | * |
843 | * Must be called with struct ttm_bo_global::lru_lock held, | 864 | * Will not remove reserved buffers from the lru lists. |
844 | * and will not remove reserved buffers from the lru lists. | ||
845 | * The function may release the LRU spinlock if it needs to sleep. | ||
846 | * Otherwise identical to ttm_bo_reserve. | 865 | * Otherwise identical to ttm_bo_reserve. |
847 | * | 866 | * |
848 | * Returns: | 867 | * Returns: |
@@ -855,7 +874,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
855 | * -EDEADLK: Bo already reserved using @sequence. This error code will only | 874 | * -EDEADLK: Bo already reserved using @sequence. This error code will only |
856 | * be returned if @use_sequence is set to true. | 875 | * be returned if @use_sequence is set to true. |
857 | */ | 876 | */ |
858 | extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | 877 | extern int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo, |
859 | bool interruptible, | 878 | bool interruptible, |
860 | bool no_wait, bool use_sequence, | 879 | bool no_wait, bool use_sequence, |
861 | uint32_t sequence); | 880 | uint32_t sequence); |
@@ -879,18 +898,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); | |||
879 | */ | 898 | */ |
880 | extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); | 899 | extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); |
881 | 900 | ||
882 | /** | ||
883 | * ttm_bo_wait_unreserved | ||
884 | * | ||
885 | * @bo: A pointer to a struct ttm_buffer_object. | ||
886 | * | ||
887 | * Wait for a struct ttm_buffer_object to become unreserved. | ||
888 | * This is typically used in the execbuf code to relax cpu-usage when | ||
889 | * a potential deadlock condition backoff. | ||
890 | */ | ||
891 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, | ||
892 | bool interruptible); | ||
893 | |||
894 | /* | 901 | /* |
895 | * ttm_bo_util.c | 902 | * ttm_bo_util.c |
896 | */ | 903 | */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3994d7790b23..f46cfd73a553 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -74,9 +74,10 @@ enum acpi_address_range_id { | |||
74 | 74 | ||
75 | /* Table Handlers */ | 75 | /* Table Handlers */ |
76 | 76 | ||
77 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); | 77 | typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table); |
78 | 78 | ||
79 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); | 79 | typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header, |
80 | const unsigned long end); | ||
80 | 81 | ||
81 | #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE | 82 | #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE |
82 | void acpi_initrd_override(void *data, size_t size); | 83 | void acpi_initrd_override(void *data, size_t size); |
@@ -95,10 +96,14 @@ int acpi_mps_check (void); | |||
95 | int acpi_numa_init (void); | 96 | int acpi_numa_init (void); |
96 | 97 | ||
97 | int acpi_table_init (void); | 98 | int acpi_table_init (void); |
98 | int acpi_table_parse (char *id, acpi_table_handler handler); | 99 | int acpi_table_parse(char *id, acpi_tbl_table_handler handler); |
99 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, | 100 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
100 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); | 101 | int entry_id, |
101 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); | 102 | acpi_tbl_entry_handler handler, |
103 | unsigned int max_entries); | ||
104 | int acpi_table_parse_madt(enum acpi_madt_type id, | ||
105 | acpi_tbl_entry_handler handler, | ||
106 | unsigned int max_entries); | ||
102 | int acpi_parse_mcfg (struct acpi_table_header *header); | 107 | int acpi_parse_mcfg (struct acpi_table_header *header); |
103 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); | 108 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); |
104 | 109 | ||
@@ -358,8 +363,7 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
358 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ | 363 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ |
359 | (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ | 364 | (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ |
360 | defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ | 365 | defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ |
361 | (defined(CONFIG_ACPI_CONTAINER) || \ | 366 | defined(CONFIG_ACPI_CONTAINER) |
362 | defined(CONFIG_ACPI_CONTAINER_MODULE)) | ||
363 | #define ACPI_HOTPLUG_OST | 367 | #define ACPI_HOTPLUG_OST |
364 | #endif | 368 | #endif |
365 | 369 | ||
@@ -481,6 +485,14 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
481 | 485 | ||
482 | #endif /* !CONFIG_ACPI */ | 486 | #endif /* !CONFIG_ACPI */ |
483 | 487 | ||
488 | #ifdef CONFIG_ACPI_NUMA | ||
489 | void __init early_parse_srat(void); | ||
490 | #else | ||
491 | static inline void early_parse_srat(void) | ||
492 | { | ||
493 | } | ||
494 | #endif | ||
495 | |||
484 | #ifdef CONFIG_ACPI | 496 | #ifdef CONFIG_ACPI |
485 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | 497 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, |
486 | u32 pm1a_ctrl, u32 pm1b_ctrl)); | 498 | u32 pm1a_ctrl, u32 pm1b_ctrl)); |
@@ -511,7 +523,7 @@ static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | |||
511 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 523 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
512 | #endif | 524 | #endif |
513 | 525 | ||
514 | #ifdef CONFIG_ACPI_SLEEP | 526 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
515 | int acpi_dev_suspend_late(struct device *dev); | 527 | int acpi_dev_suspend_late(struct device *dev); |
516 | int acpi_dev_resume_early(struct device *dev); | 528 | int acpi_dev_resume_early(struct device *dev); |
517 | int acpi_subsys_prepare(struct device *dev); | 529 | int acpi_subsys_prepare(struct device *dev); |
@@ -526,9 +538,14 @@ static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } | |||
526 | #endif | 538 | #endif |
527 | 539 | ||
528 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | 540 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) |
541 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
529 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | 542 | int acpi_dev_pm_attach(struct device *dev, bool power_on); |
530 | void acpi_dev_pm_detach(struct device *dev, bool power_off); | 543 | void acpi_dev_pm_detach(struct device *dev, bool power_off); |
531 | #else | 544 | #else |
545 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
546 | { | ||
547 | return NULL; | ||
548 | } | ||
532 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | 549 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) |
533 | { | 550 | { |
534 | return -ENODEV; | 551 | return -ENODEV; |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h index 91615a389b65..b76ebd08ff8e 100644 --- a/include/linux/acpi_gpio.h +++ b/include/linux/acpi_gpio.h | |||
@@ -2,10 +2,12 @@ | |||
2 | #define _LINUX_ACPI_GPIO_H_ | 2 | #define _LINUX_ACPI_GPIO_H_ |
3 | 3 | ||
4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
5 | #include <linux/gpio.h> | ||
5 | 6 | ||
6 | #ifdef CONFIG_GPIO_ACPI | 7 | #ifdef CONFIG_GPIO_ACPI |
7 | 8 | ||
8 | int acpi_get_gpio(char *path, int pin); | 9 | int acpi_get_gpio(char *path, int pin); |
10 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
9 | 11 | ||
10 | #else /* CONFIG_GPIO_ACPI */ | 12 | #else /* CONFIG_GPIO_ACPI */ |
11 | 13 | ||
@@ -14,6 +16,8 @@ static inline int acpi_get_gpio(char *path, int pin) | |||
14 | return -ENODEV; | 16 | return -ENODEV; |
15 | } | 17 | } |
16 | 18 | ||
19 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
20 | |||
17 | #endif /* CONFIG_GPIO_ACPI */ | 21 | #endif /* CONFIG_GPIO_ACPI */ |
18 | 22 | ||
19 | #endif /* _LINUX_ACPI_GPIO_H_ */ | 23 | #endif /* _LINUX_ACPI_GPIO_H_ */ |
diff --git a/include/linux/amba/pl080.h b/include/linux/amba/pl080.h new file mode 100644 index 000000000000..3e7b62fbefbd --- /dev/null +++ b/include/linux/amba/pl080.h | |||
@@ -0,0 +1,146 @@ | |||
1 | /* include/linux/amba/pl080.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * Ben Dooks <ben@simtec.co.uk> | ||
7 | * | ||
8 | * ARM PrimeCell PL080 DMA controller | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | /* Note, there are some Samsung updates to this controller block which | ||
16 | * make it not entierly compatible with the PL080 specification from | ||
17 | * ARM. When in doubt, check the Samsung documentation first. | ||
18 | * | ||
19 | * The Samsung defines are PL080S, and add an extra control register, | ||
20 | * the ability to move more than 2^11 counts of data and some extra | ||
21 | * OneNAND features. | ||
22 | */ | ||
23 | |||
24 | #ifndef ASM_PL080_H | ||
25 | #define ASM_PL080_H | ||
26 | |||
27 | #define PL080_INT_STATUS (0x00) | ||
28 | #define PL080_TC_STATUS (0x04) | ||
29 | #define PL080_TC_CLEAR (0x08) | ||
30 | #define PL080_ERR_STATUS (0x0C) | ||
31 | #define PL080_ERR_CLEAR (0x10) | ||
32 | #define PL080_RAW_TC_STATUS (0x14) | ||
33 | #define PL080_RAW_ERR_STATUS (0x18) | ||
34 | #define PL080_EN_CHAN (0x1c) | ||
35 | #define PL080_SOFT_BREQ (0x20) | ||
36 | #define PL080_SOFT_SREQ (0x24) | ||
37 | #define PL080_SOFT_LBREQ (0x28) | ||
38 | #define PL080_SOFT_LSREQ (0x2C) | ||
39 | |||
40 | #define PL080_CONFIG (0x30) | ||
41 | #define PL080_CONFIG_M2_BE (1 << 2) | ||
42 | #define PL080_CONFIG_M1_BE (1 << 1) | ||
43 | #define PL080_CONFIG_ENABLE (1 << 0) | ||
44 | |||
45 | #define PL080_SYNC (0x34) | ||
46 | |||
47 | /* Per channel configuration registers */ | ||
48 | |||
49 | #define PL080_Cx_STRIDE (0x20) | ||
50 | #define PL080_Cx_BASE(x) ((0x100 + (x * 0x20))) | ||
51 | #define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20))) | ||
52 | #define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20))) | ||
53 | #define PL080_Cx_LLI(x) ((0x108 + (x * 0x20))) | ||
54 | #define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20))) | ||
55 | #define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20))) | ||
56 | #define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20))) | ||
57 | #define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20))) | ||
58 | |||
59 | #define PL080_CH_SRC_ADDR (0x00) | ||
60 | #define PL080_CH_DST_ADDR (0x04) | ||
61 | #define PL080_CH_LLI (0x08) | ||
62 | #define PL080_CH_CONTROL (0x0C) | ||
63 | #define PL080_CH_CONFIG (0x10) | ||
64 | #define PL080S_CH_CONTROL2 (0x10) | ||
65 | #define PL080S_CH_CONFIG (0x14) | ||
66 | |||
67 | #define PL080_LLI_ADDR_MASK (0x3fffffff << 2) | ||
68 | #define PL080_LLI_ADDR_SHIFT (2) | ||
69 | #define PL080_LLI_LM_AHB2 (1 << 0) | ||
70 | |||
71 | #define PL080_CONTROL_TC_IRQ_EN (1 << 31) | ||
72 | #define PL080_CONTROL_PROT_MASK (0x7 << 28) | ||
73 | #define PL080_CONTROL_PROT_SHIFT (28) | ||
74 | #define PL080_CONTROL_PROT_CACHE (1 << 30) | ||
75 | #define PL080_CONTROL_PROT_BUFF (1 << 29) | ||
76 | #define PL080_CONTROL_PROT_SYS (1 << 28) | ||
77 | #define PL080_CONTROL_DST_INCR (1 << 27) | ||
78 | #define PL080_CONTROL_SRC_INCR (1 << 26) | ||
79 | #define PL080_CONTROL_DST_AHB2 (1 << 25) | ||
80 | #define PL080_CONTROL_SRC_AHB2 (1 << 24) | ||
81 | #define PL080_CONTROL_DWIDTH_MASK (0x7 << 21) | ||
82 | #define PL080_CONTROL_DWIDTH_SHIFT (21) | ||
83 | #define PL080_CONTROL_SWIDTH_MASK (0x7 << 18) | ||
84 | #define PL080_CONTROL_SWIDTH_SHIFT (18) | ||
85 | #define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15) | ||
86 | #define PL080_CONTROL_DB_SIZE_SHIFT (15) | ||
87 | #define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12) | ||
88 | #define PL080_CONTROL_SB_SIZE_SHIFT (12) | ||
89 | #define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0) | ||
90 | #define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0) | ||
91 | |||
92 | #define PL080_BSIZE_1 (0x0) | ||
93 | #define PL080_BSIZE_4 (0x1) | ||
94 | #define PL080_BSIZE_8 (0x2) | ||
95 | #define PL080_BSIZE_16 (0x3) | ||
96 | #define PL080_BSIZE_32 (0x4) | ||
97 | #define PL080_BSIZE_64 (0x5) | ||
98 | #define PL080_BSIZE_128 (0x6) | ||
99 | #define PL080_BSIZE_256 (0x7) | ||
100 | |||
101 | #define PL080_WIDTH_8BIT (0x0) | ||
102 | #define PL080_WIDTH_16BIT (0x1) | ||
103 | #define PL080_WIDTH_32BIT (0x2) | ||
104 | |||
105 | #define PL080N_CONFIG_ITPROT (1 << 20) | ||
106 | #define PL080N_CONFIG_SECPROT (1 << 19) | ||
107 | #define PL080_CONFIG_HALT (1 << 18) | ||
108 | #define PL080_CONFIG_ACTIVE (1 << 17) /* RO */ | ||
109 | #define PL080_CONFIG_LOCK (1 << 16) | ||
110 | #define PL080_CONFIG_TC_IRQ_MASK (1 << 15) | ||
111 | #define PL080_CONFIG_ERR_IRQ_MASK (1 << 14) | ||
112 | #define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11) | ||
113 | #define PL080_CONFIG_FLOW_CONTROL_SHIFT (11) | ||
114 | #define PL080_CONFIG_DST_SEL_MASK (0xf << 6) | ||
115 | #define PL080_CONFIG_DST_SEL_SHIFT (6) | ||
116 | #define PL080_CONFIG_SRC_SEL_MASK (0xf << 1) | ||
117 | #define PL080_CONFIG_SRC_SEL_SHIFT (1) | ||
118 | #define PL080_CONFIG_ENABLE (1 << 0) | ||
119 | |||
120 | #define PL080_FLOW_MEM2MEM (0x0) | ||
121 | #define PL080_FLOW_MEM2PER (0x1) | ||
122 | #define PL080_FLOW_PER2MEM (0x2) | ||
123 | #define PL080_FLOW_SRC2DST (0x3) | ||
124 | #define PL080_FLOW_SRC2DST_DST (0x4) | ||
125 | #define PL080_FLOW_MEM2PER_PER (0x5) | ||
126 | #define PL080_FLOW_PER2MEM_PER (0x6) | ||
127 | #define PL080_FLOW_SRC2DST_SRC (0x7) | ||
128 | |||
129 | /* DMA linked list chain structure */ | ||
130 | |||
131 | struct pl080_lli { | ||
132 | u32 src_addr; | ||
133 | u32 dst_addr; | ||
134 | u32 next_lli; | ||
135 | u32 control0; | ||
136 | }; | ||
137 | |||
138 | struct pl080s_lli { | ||
139 | u32 src_addr; | ||
140 | u32 dst_addr; | ||
141 | u32 next_lli; | ||
142 | u32 control0; | ||
143 | u32 control1; | ||
144 | }; | ||
145 | |||
146 | #endif /* ASM_PL080_H */ | ||
diff --git a/include/linux/amba/sp810.h b/include/linux/amba/sp810.h new file mode 100644 index 000000000000..6636430dd0e6 --- /dev/null +++ b/include/linux/amba/sp810.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/sp810.h | ||
3 | * | ||
4 | * ARM PrimeXsys System Controller SP810 header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar <viresh.linux@gmail.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_SP810_H | ||
15 | #define __ASM_ARM_SP810_H | ||
16 | |||
17 | #include <linux/io.h> | ||
18 | |||
19 | /* sysctl registers offset */ | ||
20 | #define SCCTRL 0x000 | ||
21 | #define SCSYSSTAT 0x004 | ||
22 | #define SCIMCTRL 0x008 | ||
23 | #define SCIMSTAT 0x00C | ||
24 | #define SCXTALCTRL 0x010 | ||
25 | #define SCPLLCTRL 0x014 | ||
26 | #define SCPLLFCTRL 0x018 | ||
27 | #define SCPERCTRL0 0x01C | ||
28 | #define SCPERCTRL1 0x020 | ||
29 | #define SCPEREN 0x024 | ||
30 | #define SCPERDIS 0x028 | ||
31 | #define SCPERCLKEN 0x02C | ||
32 | #define SCPERSTAT 0x030 | ||
33 | #define SCSYSID0 0xEE0 | ||
34 | #define SCSYSID1 0xEE4 | ||
35 | #define SCSYSID2 0xEE8 | ||
36 | #define SCSYSID3 0xEEC | ||
37 | #define SCITCR 0xF00 | ||
38 | #define SCITIR0 0xF04 | ||
39 | #define SCITIR1 0xF08 | ||
40 | #define SCITOR 0xF0C | ||
41 | #define SCCNTCTRL 0xF10 | ||
42 | #define SCCNTDATA 0xF14 | ||
43 | #define SCCNTSTEP 0xF18 | ||
44 | #define SCPERIPHID0 0xFE0 | ||
45 | #define SCPERIPHID1 0xFE4 | ||
46 | #define SCPERIPHID2 0xFE8 | ||
47 | #define SCPERIPHID3 0xFEC | ||
48 | #define SCPCELLID0 0xFF0 | ||
49 | #define SCPCELLID1 0xFF4 | ||
50 | #define SCPCELLID2 0xFF8 | ||
51 | #define SCPCELLID3 0xFFC | ||
52 | |||
53 | #define SCCTRL_TIMERENnSEL_SHIFT(n) (15 + ((n) * 2)) | ||
54 | |||
55 | static inline void sysctl_soft_reset(void __iomem *base) | ||
56 | { | ||
57 | /* switch to slow mode */ | ||
58 | writel(0x2, base + SCCTRL); | ||
59 | |||
60 | /* writing any value to SCSYSSTAT reg will reset system */ | ||
61 | writel(0, base + SCSYSSTAT); | ||
62 | } | ||
63 | |||
64 | #endif /* __ASM_ARM_SP810_H */ | ||
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 12731a19ef06..350459910fe1 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -254,6 +254,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
254 | #define BDI_CAP_EXEC_MAP 0x00000040 | 254 | #define BDI_CAP_EXEC_MAP 0x00000040 |
255 | #define BDI_CAP_NO_ACCT_WB 0x00000080 | 255 | #define BDI_CAP_NO_ACCT_WB 0x00000080 |
256 | #define BDI_CAP_SWAP_BACKED 0x00000100 | 256 | #define BDI_CAP_SWAP_BACKED 0x00000100 |
257 | #define BDI_CAP_STABLE_WRITES 0x00000200 | ||
257 | 258 | ||
258 | #define BDI_CAP_VMFLAGS \ | 259 | #define BDI_CAP_VMFLAGS \ |
259 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) | 260 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) |
@@ -308,6 +309,11 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout); | |||
308 | int pdflush_proc_obsolete(struct ctl_table *table, int write, | 309 | int pdflush_proc_obsolete(struct ctl_table *table, int write, |
309 | void __user *buffer, size_t *lenp, loff_t *ppos); | 310 | void __user *buffer, size_t *lenp, loff_t *ppos); |
310 | 311 | ||
312 | static inline bool bdi_cap_stable_pages_required(struct backing_dev_info *bdi) | ||
313 | { | ||
314 | return bdi->capabilities & BDI_CAP_STABLE_WRITES; | ||
315 | } | ||
316 | |||
311 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) | 317 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) |
312 | { | 318 | { |
313 | return !(bdi->capabilities & BDI_CAP_NO_WRITEBACK); | 319 | return !(bdi->capabilities & BDI_CAP_NO_WRITEBACK); |
diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h deleted file mode 100644 index 25680fe0903c..000000000000 --- a/include/linux/bcm2835_timer.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Simon Arlott | ||
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 __BCM2835_TIMER_H | ||
16 | #define __BCM2835_TIMER_H | ||
17 | |||
18 | #include <asm/mach/time.h> | ||
19 | |||
20 | extern struct sys_timer bcm2835_timer; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 9a0e3fa3ca95..1d002b58b60b 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ | 27 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ |
28 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ | 28 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ |
29 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ | 29 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ |
30 | #define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */ | 30 | #define BCMA_CC_FLASHT_NAND 0x00000300 /* NAND flash */ |
31 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ | 31 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ |
32 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ | 32 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ |
33 | #define BCMA_PLLTYPE_NONE 0x00000000 | 33 | #define BCMA_PLLTYPE_NONE 0x00000000 |
@@ -634,4 +634,6 @@ extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, | |||
634 | u32 offset, u32 mask, u32 set); | 634 | u32 offset, u32 mask, u32 set); |
635 | extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid); | 635 | extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid); |
636 | 636 | ||
637 | extern u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc); | ||
638 | |||
637 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ | 639 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h index 0baf8a56b794..fb61f3fb4ddb 100644 --- a/include/linux/bcma/bcma_driver_mips.h +++ b/include/linux/bcma/bcma_driver_mips.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define BCMA_MIPS_MIPS74K_GPIOEN 0x0048 | 28 | #define BCMA_MIPS_MIPS74K_GPIOEN 0x0048 |
29 | #define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0 | 29 | #define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0 |
30 | 30 | ||
31 | #define BCMA_MIPS_OOBSELINA74 0x004 | ||
31 | #define BCMA_MIPS_OOBSELOUTA30 0x100 | 32 | #define BCMA_MIPS_OOBSELOUTA30 0x100 |
32 | 33 | ||
33 | struct bcma_device; | 34 | struct bcma_device; |
@@ -36,19 +37,23 @@ struct bcma_drv_mips { | |||
36 | struct bcma_device *core; | 37 | struct bcma_device *core; |
37 | u8 setup_done:1; | 38 | u8 setup_done:1; |
38 | u8 early_setup_done:1; | 39 | u8 early_setup_done:1; |
39 | unsigned int assigned_irqs; | ||
40 | }; | 40 | }; |
41 | 41 | ||
42 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 42 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
43 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | 43 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); |
44 | extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore); | 44 | extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore); |
45 | |||
46 | extern unsigned int bcma_core_irq(struct bcma_device *core); | ||
45 | #else | 47 | #else |
46 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | 48 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } |
47 | static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } | 49 | static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } |
50 | |||
51 | static inline unsigned int bcma_core_irq(struct bcma_device *core) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
48 | #endif | 55 | #endif |
49 | 56 | ||
50 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); | 57 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); |
51 | 58 | ||
52 | extern unsigned int bcma_core_mips_irq(struct bcma_device *dev); | ||
53 | |||
54 | #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */ | 59 | #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */ |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index c48d98d27b77..424760f01b9d 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
@@ -179,6 +179,8 @@ struct pci_dev; | |||
179 | #define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */ | 179 | #define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */ |
180 | #define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */ | 180 | #define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */ |
181 | 181 | ||
182 | #define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8 | ||
183 | |||
182 | /* PCIE Root Capability Register bits (Host mode only) */ | 184 | /* PCIE Root Capability Register bits (Host mode only) */ |
183 | #define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 | 185 | #define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 |
184 | 186 | ||
diff --git a/include/linux/bma150.h b/include/linux/bma150.h index 7911fda23bb4..97ade7cdc870 100644 --- a/include/linux/bma150.h +++ b/include/linux/bma150.h | |||
@@ -22,6 +22,18 @@ | |||
22 | 22 | ||
23 | #define BMA150_DRIVER "bma150" | 23 | #define BMA150_DRIVER "bma150" |
24 | 24 | ||
25 | #define BMA150_RANGE_2G 0 | ||
26 | #define BMA150_RANGE_4G 1 | ||
27 | #define BMA150_RANGE_8G 2 | ||
28 | |||
29 | #define BMA150_BW_25HZ 0 | ||
30 | #define BMA150_BW_50HZ 1 | ||
31 | #define BMA150_BW_100HZ 2 | ||
32 | #define BMA150_BW_190HZ 3 | ||
33 | #define BMA150_BW_375HZ 4 | ||
34 | #define BMA150_BW_750HZ 5 | ||
35 | #define BMA150_BW_1500HZ 6 | ||
36 | |||
25 | struct bma150_cfg { | 37 | struct bma150_cfg { |
26 | bool any_motion_int; /* Set to enable any-motion interrupt */ | 38 | bool any_motion_int; /* Set to enable any-motion interrupt */ |
27 | bool hg_int; /* Set to enable high-G interrupt */ | 39 | bool hg_int; /* Set to enable high-G interrupt */ |
@@ -34,8 +46,8 @@ struct bma150_cfg { | |||
34 | unsigned char lg_hyst; /* Low-G hysterisis */ | 46 | unsigned char lg_hyst; /* Low-G hysterisis */ |
35 | unsigned char lg_dur; /* Low-G duration */ | 47 | unsigned char lg_dur; /* Low-G duration */ |
36 | unsigned char lg_thres; /* Low-G threshold */ | 48 | unsigned char lg_thres; /* Low-G threshold */ |
37 | unsigned char range; /* BMA0150_RANGE_xxx (in G) */ | 49 | unsigned char range; /* one of BMA0150_RANGE_xxx */ |
38 | unsigned char bandwidth; /* BMA0150_BW_xxx (in Hz) */ | 50 | unsigned char bandwidth; /* one of BMA0150_BW_xxx */ |
39 | }; | 51 | }; |
40 | 52 | ||
41 | struct bma150_platform_data { | 53 | struct bma150_platform_data { |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 3f778c27f825..cdc3bab01832 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
53 | unsigned long size); | 53 | unsigned long size); |
54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
56 | extern void __free_pages_bootmem(struct page *page, unsigned int order); | ||
56 | 57 | ||
57 | /* | 58 | /* |
58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 59 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
@@ -99,6 +100,9 @@ void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | |||
99 | extern void *__alloc_bootmem_low(unsigned long size, | 100 | extern void *__alloc_bootmem_low(unsigned long size, |
100 | unsigned long align, | 101 | unsigned long align, |
101 | unsigned long goal); | 102 | unsigned long goal); |
103 | void *__alloc_bootmem_low_nopanic(unsigned long size, | ||
104 | unsigned long align, | ||
105 | unsigned long goal); | ||
102 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | 106 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
103 | unsigned long size, | 107 | unsigned long size, |
104 | unsigned long align, | 108 | unsigned long align, |
@@ -132,6 +136,8 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
132 | 136 | ||
133 | #define alloc_bootmem_low(x) \ | 137 | #define alloc_bootmem_low(x) \ |
134 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) | 138 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
139 | #define alloc_bootmem_low_pages_nopanic(x) \ | ||
140 | __alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0) | ||
135 | #define alloc_bootmem_low_pages(x) \ | 141 | #define alloc_bootmem_low_pages(x) \ |
136 | __alloc_bootmem_low(x, PAGE_SIZE, 0) | 142 | __alloc_bootmem_low(x, PAGE_SIZE, 0) |
137 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 143 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
diff --git a/include/linux/bug.h b/include/linux/bug.h index b1cf40de847e..7f4818673c41 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_BUG_H | 2 | #define _LINUX_BUG_H |
3 | 3 | ||
4 | #include <asm/bug.h> | 4 | #include <asm/bug.h> |
5 | #include <linux/compiler.h> | ||
5 | 6 | ||
6 | enum bug_trap_type { | 7 | enum bug_trap_type { |
7 | BUG_TRAP_TYPE_NONE = 0, | 8 | BUG_TRAP_TYPE_NONE = 0, |
@@ -12,11 +13,12 @@ enum bug_trap_type { | |||
12 | struct pt_regs; | 13 | struct pt_regs; |
13 | 14 | ||
14 | #ifdef __CHECKER__ | 15 | #ifdef __CHECKER__ |
15 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | 16 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) |
16 | #define BUILD_BUG_ON_ZERO(e) (0) | 17 | #define BUILD_BUG_ON_ZERO(e) (0) |
17 | #define BUILD_BUG_ON_NULL(e) ((void*)0) | 18 | #define BUILD_BUG_ON_NULL(e) ((void*)0) |
18 | #define BUILD_BUG_ON_INVALID(e) (0) | 19 | #define BUILD_BUG_ON_INVALID(e) (0) |
19 | #define BUILD_BUG_ON(condition) | 20 | #define BUILD_BUG_ON_MSG(cond, msg) (0) |
21 | #define BUILD_BUG_ON(condition) (0) | ||
20 | #define BUILD_BUG() (0) | 22 | #define BUILD_BUG() (0) |
21 | #else /* __CHECKER__ */ | 23 | #else /* __CHECKER__ */ |
22 | 24 | ||
@@ -39,29 +41,37 @@ struct pt_regs; | |||
39 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) | 41 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) |
40 | 42 | ||
41 | /** | 43 | /** |
44 | * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied | ||
45 | * error message. | ||
46 | * @condition: the condition which the compiler should know is false. | ||
47 | * | ||
48 | * See BUILD_BUG_ON for description. | ||
49 | */ | ||
50 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ||
51 | |||
52 | /** | ||
42 | * BUILD_BUG_ON - break compile if a condition is true. | 53 | * BUILD_BUG_ON - break compile if a condition is true. |
43 | * @condition: the condition which the compiler should know is false. | 54 | * @condition: the condition which the compiler should know is false. |
44 | * | 55 | * |
45 | * If you have some code which relies on certain constants being equal, or | 56 | * If you have some code which relies on certain constants being equal, or |
46 | * other compile-time-evaluated condition, you should use BUILD_BUG_ON to | 57 | * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to |
47 | * detect if someone changes it. | 58 | * detect if someone changes it. |
48 | * | 59 | * |
49 | * The implementation uses gcc's reluctance to create a negative array, but | 60 | * The implementation uses gcc's reluctance to create a negative array, but gcc |
50 | * gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments | 61 | * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to |
51 | * to inline functions). So as a fallback we use the optimizer; if it can't | 62 | * inline functions). Luckily, in 4.3 they added the "error" function |
52 | * prove the condition is false, it will cause a link error on the undefined | 63 | * attribute just for this type of case. Thus, we use a negative sized array |
53 | * "__build_bug_on_failed". This error message can be harder to track down | 64 | * (should always create an error on gcc versions older than 4.4) and then call |
54 | * though, hence the two different methods. | 65 | * an undefined function with the error attribute (should always create an |
66 | * error on gcc 4.3 and later). If for some reason, neither creates a | ||
67 | * compile-time error, we'll still have a link-time error, which is harder to | ||
68 | * track down. | ||
55 | */ | 69 | */ |
56 | #ifndef __OPTIMIZE__ | 70 | #ifndef __OPTIMIZE__ |
57 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 71 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
58 | #else | 72 | #else |
59 | extern int __build_bug_on_failed; | 73 | #define BUILD_BUG_ON(condition) \ |
60 | #define BUILD_BUG_ON(condition) \ | 74 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) |
61 | do { \ | ||
62 | ((void)sizeof(char[1 - 2*!!(condition)])); \ | ||
63 | if (condition) __build_bug_on_failed = 1; \ | ||
64 | } while(0) | ||
65 | #endif | 75 | #endif |
66 | 76 | ||
67 | /** | 77 | /** |
@@ -71,12 +81,7 @@ extern int __build_bug_on_failed; | |||
71 | * build time, you should use BUILD_BUG to detect if it is | 81 | * build time, you should use BUILD_BUG to detect if it is |
72 | * unexpectedly used. | 82 | * unexpectedly used. |
73 | */ | 83 | */ |
74 | #define BUILD_BUG() \ | 84 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") |
75 | do { \ | ||
76 | extern void __build_bug_failed(void) \ | ||
77 | __linktime_error("BUILD_BUG failed"); \ | ||
78 | __build_bug_failed(); \ | ||
79 | } while (0) | ||
80 | 85 | ||
81 | #endif /* __CHECKER__ */ | 86 | #endif /* __CHECKER__ */ |
82 | 87 | ||
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 2b2fc345afca..fb0ab651a041 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/can.h> | 16 | #include <linux/can.h> |
17 | #include <linux/can/netlink.h> | 17 | #include <linux/can/netlink.h> |
18 | #include <linux/can/error.h> | 18 | #include <linux/can/error.h> |
19 | #include <linux/can/led.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * CAN mode | 22 | * CAN mode |
@@ -52,6 +53,13 @@ struct can_priv { | |||
52 | 53 | ||
53 | unsigned int echo_skb_max; | 54 | unsigned int echo_skb_max; |
54 | struct sk_buff **echo_skb; | 55 | struct sk_buff **echo_skb; |
56 | |||
57 | #ifdef CONFIG_CAN_LEDS | ||
58 | struct led_trigger *tx_led_trig; | ||
59 | char tx_led_trig_name[CAN_LED_NAME_SZ]; | ||
60 | struct led_trigger *rx_led_trig; | ||
61 | char rx_led_trig_name[CAN_LED_NAME_SZ]; | ||
62 | #endif | ||
55 | }; | 63 | }; |
56 | 64 | ||
57 | /* | 65 | /* |
@@ -98,6 +106,9 @@ u8 can_len2dlc(u8 len); | |||
98 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 106 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
99 | void free_candev(struct net_device *dev); | 107 | void free_candev(struct net_device *dev); |
100 | 108 | ||
109 | /* a candev safe wrapper around netdev_priv */ | ||
110 | struct can_priv *safe_candev_priv(struct net_device *dev); | ||
111 | |||
101 | int open_candev(struct net_device *dev); | 112 | int open_candev(struct net_device *dev); |
102 | void close_candev(struct net_device *dev); | 113 | void close_candev(struct net_device *dev); |
103 | 114 | ||
diff --git a/include/linux/can/led.h b/include/linux/can/led.h new file mode 100644 index 000000000000..9c1167baf273 --- /dev/null +++ b/include/linux/can/led.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright 2012, Fabio Baltieri <fabio.baltieri@gmail.com> | ||
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 CAN_LED_H | ||
10 | #define CAN_LED_H | ||
11 | |||
12 | #include <linux/if.h> | ||
13 | #include <linux/leds.h> | ||
14 | |||
15 | enum can_led_event { | ||
16 | CAN_LED_EVENT_OPEN, | ||
17 | CAN_LED_EVENT_STOP, | ||
18 | CAN_LED_EVENT_TX, | ||
19 | CAN_LED_EVENT_RX, | ||
20 | }; | ||
21 | |||
22 | #ifdef CONFIG_CAN_LEDS | ||
23 | |||
24 | /* keep space for interface name + "-tx"/"-rx" suffix and null terminator */ | ||
25 | #define CAN_LED_NAME_SZ (IFNAMSIZ + 4) | ||
26 | |||
27 | void can_led_event(struct net_device *netdev, enum can_led_event event); | ||
28 | void devm_can_led_init(struct net_device *netdev); | ||
29 | int __init can_led_notifier_init(void); | ||
30 | void __exit can_led_notifier_exit(void); | ||
31 | |||
32 | #else | ||
33 | |||
34 | static inline void can_led_event(struct net_device *netdev, | ||
35 | enum can_led_event event) | ||
36 | { | ||
37 | } | ||
38 | static inline void devm_can_led_init(struct net_device *netdev) | ||
39 | { | ||
40 | } | ||
41 | static inline int can_led_notifier_init(void) | ||
42 | { | ||
43 | return 0; | ||
44 | } | ||
45 | static inline void can_led_notifier_exit(void) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | #endif | ||
50 | |||
51 | #endif | ||
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h new file mode 100644 index 000000000000..2f0543f7510c --- /dev/null +++ b/include/linux/can/skb.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * linux/can/skb.h | ||
3 | * | ||
4 | * Definitions for the CAN network socket buffer | ||
5 | * | ||
6 | * Copyright (C) 2012 Oliver Hartkopp <socketcan@hartkopp.net> | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef CAN_SKB_H | ||
11 | #define CAN_SKB_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | #include <linux/can.h> | ||
15 | |||
16 | /* | ||
17 | * The struct can_skb_priv is used to transport additional information along | ||
18 | * with the stored struct can(fd)_frame that can not be contained in existing | ||
19 | * struct sk_buff elements. | ||
20 | * N.B. that this information must not be modified in cloned CAN sk_buffs. | ||
21 | * To modify the CAN frame content or the struct can_skb_priv content | ||
22 | * skb_copy() needs to be used instead of skb_clone(). | ||
23 | */ | ||
24 | |||
25 | /** | ||
26 | * struct can_skb_priv - private additional data inside CAN sk_buffs | ||
27 | * @ifindex: ifindex of the first interface the CAN frame appeared on | ||
28 | * @cf: align to the following CAN frame at skb->data | ||
29 | */ | ||
30 | struct can_skb_priv { | ||
31 | int ifindex; | ||
32 | struct can_frame cf[0]; | ||
33 | }; | ||
34 | |||
35 | static inline struct can_skb_priv *can_skb_prv(struct sk_buff *skb) | ||
36 | { | ||
37 | return (struct can_skb_priv *)(skb->head); | ||
38 | } | ||
39 | |||
40 | static inline void can_skb_reserve(struct sk_buff *skb) | ||
41 | { | ||
42 | skb_reserve(skb, sizeof(struct can_skb_priv)); | ||
43 | } | ||
44 | |||
45 | #endif /* CAN_SKB_H */ | ||
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 7d73905dcba2..900af5964f55 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -203,6 +203,7 @@ struct cgroup { | |||
203 | 203 | ||
204 | /* For RCU-protected deletion */ | 204 | /* For RCU-protected deletion */ |
205 | struct rcu_head rcu_head; | 205 | struct rcu_head rcu_head; |
206 | struct work_struct free_work; | ||
206 | 207 | ||
207 | /* List of events which userspace want to receive */ | 208 | /* List of events which userspace want to receive */ |
208 | struct list_head event_list; | 209 | struct list_head event_list; |
@@ -558,6 +559,7 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
558 | 559 | ||
559 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, | 560 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, |
560 | struct cgroup *cgroup); | 561 | struct cgroup *cgroup); |
562 | struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos); | ||
561 | 563 | ||
562 | /** | 564 | /** |
563 | * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants | 565 | * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants |
@@ -706,7 +708,6 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); | |||
706 | static inline int cgroup_init_early(void) { return 0; } | 708 | static inline int cgroup_init_early(void) { return 0; } |
707 | static inline int cgroup_init(void) { return 0; } | 709 | static inline int cgroup_init(void) { return 0; } |
708 | static inline void cgroup_fork(struct task_struct *p) {} | 710 | static inline void cgroup_fork(struct task_struct *p) {} |
709 | static inline void cgroup_fork_callbacks(struct task_struct *p) {} | ||
710 | static inline void cgroup_post_fork(struct task_struct *p) {} | 711 | static inline void cgroup_post_fork(struct task_struct *p) {} |
711 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} | 712 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} |
712 | 713 | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 4989b8a7bed1..7f197d7addb0 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -379,7 +379,13 @@ struct clk_onecell_data { | |||
379 | }; | 379 | }; |
380 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 380 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
381 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 381 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
382 | |||
382 | void of_clk_init(const struct of_device_id *matches); | 383 | void of_clk_init(const struct of_device_id *matches); |
383 | 384 | ||
385 | #define CLK_OF_DECLARE(name, compat, fn) \ | ||
386 | static const struct of_device_id __clk_of_table_##name \ | ||
387 | __used __section(__clk_of_table) \ | ||
388 | = { .compatible = compat, .data = fn }; | ||
389 | |||
384 | #endif /* CONFIG_COMMON_CLK */ | 390 | #endif /* CONFIG_COMMON_CLK */ |
385 | #endif /* CLK_PROVIDER_H */ | 391 | #endif /* CLK_PROVIDER_H */ |
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h deleted file mode 100644 index e074fdd5a236..000000000000 --- a/include/linux/clk/sunxi.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Maxime Ripard | ||
3 | * | ||
4 | * Maxime Ripard <maxime.ripard@free-electrons.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_CLK_SUNXI_H_ | ||
18 | #define __LINUX_CLK_SUNXI_H_ | ||
19 | |||
20 | void __init sunxi_init_clocks(void); | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h new file mode 100644 index 000000000000..404d6f940872 --- /dev/null +++ b/include/linux/clk/tegra.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_CLK_TEGRA_H_ | ||
18 | #define __LINUX_CLK_TEGRA_H_ | ||
19 | |||
20 | #include <linux/clk.h> | ||
21 | |||
22 | /* | ||
23 | * Tegra CPU clock and reset control ops | ||
24 | * | ||
25 | * wait_for_reset: | ||
26 | * keep waiting until the CPU in reset state | ||
27 | * put_in_reset: | ||
28 | * put the CPU in reset state | ||
29 | * out_of_reset: | ||
30 | * release the CPU from reset state | ||
31 | * enable_clock: | ||
32 | * CPU clock un-gate | ||
33 | * disable_clock: | ||
34 | * CPU clock gate | ||
35 | * rail_off_ready: | ||
36 | * CPU is ready for rail off | ||
37 | * suspend: | ||
38 | * save the clock settings when CPU go into low-power state | ||
39 | * resume: | ||
40 | * restore the clock settings when CPU exit low-power state | ||
41 | */ | ||
42 | struct tegra_cpu_car_ops { | ||
43 | void (*wait_for_reset)(u32 cpu); | ||
44 | void (*put_in_reset)(u32 cpu); | ||
45 | void (*out_of_reset)(u32 cpu); | ||
46 | void (*enable_clock)(u32 cpu); | ||
47 | void (*disable_clock)(u32 cpu); | ||
48 | #ifdef CONFIG_PM_SLEEP | ||
49 | bool (*rail_off_ready)(void); | ||
50 | void (*suspend)(void); | ||
51 | void (*resume)(void); | ||
52 | #endif | ||
53 | }; | ||
54 | |||
55 | extern struct tegra_cpu_car_ops *tegra_cpu_car_ops; | ||
56 | |||
57 | static inline void tegra_wait_cpu_in_reset(u32 cpu) | ||
58 | { | ||
59 | if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset)) | ||
60 | return; | ||
61 | |||
62 | tegra_cpu_car_ops->wait_for_reset(cpu); | ||
63 | } | ||
64 | |||
65 | static inline void tegra_put_cpu_in_reset(u32 cpu) | ||
66 | { | ||
67 | if (WARN_ON(!tegra_cpu_car_ops->put_in_reset)) | ||
68 | return; | ||
69 | |||
70 | tegra_cpu_car_ops->put_in_reset(cpu); | ||
71 | } | ||
72 | |||
73 | static inline void tegra_cpu_out_of_reset(u32 cpu) | ||
74 | { | ||
75 | if (WARN_ON(!tegra_cpu_car_ops->out_of_reset)) | ||
76 | return; | ||
77 | |||
78 | tegra_cpu_car_ops->out_of_reset(cpu); | ||
79 | } | ||
80 | |||
81 | static inline void tegra_enable_cpu_clock(u32 cpu) | ||
82 | { | ||
83 | if (WARN_ON(!tegra_cpu_car_ops->enable_clock)) | ||
84 | return; | ||
85 | |||
86 | tegra_cpu_car_ops->enable_clock(cpu); | ||
87 | } | ||
88 | |||
89 | static inline void tegra_disable_cpu_clock(u32 cpu) | ||
90 | { | ||
91 | if (WARN_ON(!tegra_cpu_car_ops->disable_clock)) | ||
92 | return; | ||
93 | |||
94 | tegra_cpu_car_ops->disable_clock(cpu); | ||
95 | } | ||
96 | |||
97 | #ifdef CONFIG_PM_SLEEP | ||
98 | static inline bool tegra_cpu_rail_off_ready(void) | ||
99 | { | ||
100 | if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready)) | ||
101 | return false; | ||
102 | |||
103 | return tegra_cpu_car_ops->rail_off_ready(); | ||
104 | } | ||
105 | |||
106 | static inline void tegra_cpu_clock_suspend(void) | ||
107 | { | ||
108 | if (WARN_ON(!tegra_cpu_car_ops->suspend)) | ||
109 | return; | ||
110 | |||
111 | tegra_cpu_car_ops->suspend(); | ||
112 | } | ||
113 | |||
114 | static inline void tegra_cpu_clock_resume(void) | ||
115 | { | ||
116 | if (WARN_ON(!tegra_cpu_car_ops->resume)) | ||
117 | return; | ||
118 | |||
119 | tegra_cpu_car_ops->resume(); | ||
120 | } | ||
121 | #endif | ||
122 | |||
123 | void tegra_periph_reset_deassert(struct clk *c); | ||
124 | void tegra_periph_reset_assert(struct clk *c); | ||
125 | void tegra_clocks_init(void); | ||
126 | |||
127 | #endif /* __LINUX_CLK_TEGRA_H_ */ | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 4dceaf8ae152..27cfda427dd9 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -332,4 +332,15 @@ extern int clocksource_mmio_init(void __iomem *, const char *, | |||
332 | 332 | ||
333 | extern int clocksource_i8253_init(void); | 333 | extern int clocksource_i8253_init(void); |
334 | 334 | ||
335 | #ifdef CONFIG_CLKSRC_OF | ||
336 | extern void clocksource_of_init(void); | ||
337 | |||
338 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \ | ||
339 | static const struct of_device_id __clksrc_of_table_##name \ | ||
340 | __used __section(__clksrc_of_table) \ | ||
341 | = { .compatible = compat, .data = fn }; | ||
342 | #else | ||
343 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) | ||
344 | #endif | ||
345 | |||
335 | #endif /* _LINUX_CLOCKSOURCE_H */ | 346 | #endif /* _LINUX_CLOCKSOURCE_H */ |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 8031d6eef102..5b8721efa948 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
@@ -34,7 +34,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, | |||
34 | const char *name, int length, int *type, | 34 | const char *name, int length, int *type, |
35 | struct CodaFid *resfid); | 35 | struct CodaFid *resfid); |
36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | 36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, |
37 | vuid_t uid); | 37 | kuid_t uid); |
38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, | 38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, |
39 | struct file **f); | 39 | struct file **f); |
40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, | 40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index cc7bddeaf553..091d72e70d8a 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -23,7 +23,7 @@ extern int fragmentation_index(struct zone *zone, unsigned int order); | |||
23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
24 | int order, gfp_t gfp_mask, nodemask_t *mask, | 24 | int order, gfp_t gfp_mask, nodemask_t *mask, |
25 | bool sync, bool *contended); | 25 | bool sync, bool *contended); |
26 | extern int compact_pgdat(pg_data_t *pgdat, int order); | 26 | extern void compact_pgdat(pg_data_t *pgdat, int order); |
27 | extern void reset_isolation_suitable(pg_data_t *pgdat); | 27 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
28 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 28 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
29 | 29 | ||
@@ -80,9 +80,8 @@ static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
80 | return COMPACT_CONTINUE; | 80 | return COMPACT_CONTINUE; |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline int compact_pgdat(pg_data_t *pgdat, int order) | 83 | static inline void compact_pgdat(pg_data_t *pgdat, int order) |
84 | { | 84 | { |
85 | return COMPACT_CONTINUE; | ||
86 | } | 85 | } |
87 | 86 | ||
88 | static inline void reset_isolation_suitable(pg_data_t *pgdat) | 87 | static inline void reset_isolation_suitable(pg_data_t *pgdat) |
diff --git a/include/linux/compat.h b/include/linux/compat.h index dec7e2d18875..de095b0462a7 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -68,7 +68,6 @@ | |||
68 | #ifndef compat_user_stack_pointer | 68 | #ifndef compat_user_stack_pointer |
69 | #define compat_user_stack_pointer() current_user_stack_pointer() | 69 | #define compat_user_stack_pointer() current_user_stack_pointer() |
70 | #endif | 70 | #endif |
71 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
72 | #ifndef compat_sigaltstack /* we'll need that for MIPS */ | 71 | #ifndef compat_sigaltstack /* we'll need that for MIPS */ |
73 | typedef struct compat_sigaltstack { | 72 | typedef struct compat_sigaltstack { |
74 | compat_uptr_t ss_sp; | 73 | compat_uptr_t ss_sp; |
@@ -76,7 +75,6 @@ typedef struct compat_sigaltstack { | |||
76 | compat_size_t ss_size; | 75 | compat_size_t ss_size; |
77 | } compat_stack_t; | 76 | } compat_stack_t; |
78 | #endif | 77 | #endif |
79 | #endif | ||
80 | 78 | ||
81 | #define compat_jiffies_to_clock_t(x) \ | 79 | #define compat_jiffies_to_clock_t(x) \ |
82 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 80 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
@@ -142,6 +140,20 @@ typedef struct { | |||
142 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 140 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
143 | } compat_sigset_t; | 141 | } compat_sigset_t; |
144 | 142 | ||
143 | struct compat_sigaction { | ||
144 | #ifndef __ARCH_HAS_ODD_SIGACTION | ||
145 | compat_uptr_t sa_handler; | ||
146 | compat_ulong_t sa_flags; | ||
147 | #else | ||
148 | compat_ulong_t sa_flags; | ||
149 | compat_uptr_t sa_handler; | ||
150 | #endif | ||
151 | #ifdef __ARCH_HAS_SA_RESTORER | ||
152 | compat_uptr_t sa_restorer; | ||
153 | #endif | ||
154 | compat_sigset_t sa_mask __packed; | ||
155 | }; | ||
156 | |||
145 | /* | 157 | /* |
146 | * These functions operate strictly on struct compat_time* | 158 | * These functions operate strictly on struct compat_time* |
147 | */ | 159 | */ |
@@ -283,6 +295,15 @@ struct compat_robust_list_head { | |||
283 | compat_uptr_t list_op_pending; | 295 | compat_uptr_t list_op_pending; |
284 | }; | 296 | }; |
285 | 297 | ||
298 | #ifdef CONFIG_COMPAT_OLD_SIGACTION | ||
299 | struct compat_old_sigaction { | ||
300 | compat_uptr_t sa_handler; | ||
301 | compat_old_sigset_t sa_mask; | ||
302 | compat_ulong_t sa_flags; | ||
303 | compat_uptr_t sa_restorer; | ||
304 | }; | ||
305 | #endif | ||
306 | |||
286 | struct compat_statfs; | 307 | struct compat_statfs; |
287 | struct compat_statfs64; | 308 | struct compat_statfs64; |
288 | struct compat_old_linux_dirent; | 309 | struct compat_old_linux_dirent; |
@@ -367,6 +388,11 @@ int get_compat_sigevent(struct sigevent *event, | |||
367 | const struct compat_sigevent __user *u_event); | 388 | const struct compat_sigevent __user *u_event); |
368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, | 389 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, |
369 | struct compat_siginfo __user *uinfo); | 390 | struct compat_siginfo __user *uinfo); |
391 | #ifdef CONFIG_COMPAT_OLD_SIGACTION | ||
392 | asmlinkage long compat_sys_sigaction(int sig, | ||
393 | const struct compat_old_sigaction __user *act, | ||
394 | struct compat_old_sigaction __user *oact); | ||
395 | #endif | ||
370 | 396 | ||
371 | static inline int compat_timeval_compare(struct compat_timeval *lhs, | 397 | static inline int compat_timeval_compare(struct compat_timeval *lhs, |
372 | struct compat_timeval *rhs) | 398 | struct compat_timeval *rhs) |
@@ -401,7 +427,8 @@ asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | |||
401 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 427 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
402 | 428 | ||
403 | extern int compat_printk(const char *fmt, ...); | 429 | extern int compat_printk(const char *fmt, ...); |
404 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | 430 | extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat); |
431 | extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set); | ||
405 | 432 | ||
406 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | 433 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, |
407 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, | 434 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, |
@@ -503,7 +530,7 @@ asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | |||
503 | unsigned int nr_segs, unsigned int flags); | 530 | unsigned int nr_segs, unsigned int flags); |
504 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 531 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
505 | umode_t mode); | 532 | umode_t mode); |
506 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 533 | asmlinkage long compat_sys_openat(int dfd, const char __user *filename, |
507 | int flags, umode_t mode); | 534 | int flags, umode_t mode); |
508 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | 535 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
509 | struct file_handle __user *handle, | 536 | struct file_handle __user *handle, |
@@ -592,6 +619,19 @@ asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, | |||
592 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | 619 | struct compat_timespec __user *uts, compat_size_t sigsetsize); |
593 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, | 620 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, |
594 | compat_size_t sigsetsize); | 621 | compat_size_t sigsetsize); |
622 | asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set, | ||
623 | compat_sigset_t __user *oset, | ||
624 | compat_size_t sigsetsize); | ||
625 | asmlinkage long compat_sys_rt_sigpending(compat_sigset_t __user *uset, | ||
626 | compat_size_t sigsetsize); | ||
627 | #ifndef CONFIG_ODD_RT_SIGACTION | ||
628 | asmlinkage long compat_sys_rt_sigaction(int, | ||
629 | const struct compat_sigaction __user *, | ||
630 | struct compat_sigaction __user *, | ||
631 | compat_size_t); | ||
632 | #endif | ||
633 | asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | ||
634 | struct compat_siginfo __user *uinfo); | ||
595 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | 635 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); |
596 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | 636 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, |
597 | unsigned long arg); | 637 | unsigned long arg); |
@@ -642,13 +682,11 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |||
642 | 682 | ||
643 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 683 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
644 | compat_off_t __user *offset, compat_size_t count); | 684 | compat_off_t __user *offset, compat_size_t count); |
645 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
646 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 685 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
647 | compat_stack_t __user *uoss_ptr); | 686 | compat_stack_t __user *uoss_ptr); |
648 | 687 | ||
649 | int compat_restore_altstack(const compat_stack_t __user *uss); | 688 | int compat_restore_altstack(const compat_stack_t __user *uss); |
650 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); | 689 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); |
651 | #endif | ||
652 | 690 | ||
653 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | 691 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, |
654 | struct compat_timespec __user *interval); | 692 | struct compat_timespec __user *interval); |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 6a6d7aefe12d..24545cd90a25 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -5,6 +5,9 @@ | |||
5 | /* | 5 | /* |
6 | * Common definitions for all gcc versions go here. | 6 | * Common definitions for all gcc versions go here. |
7 | */ | 7 | */ |
8 | #define GCC_VERSION (__GNUC__ * 10000 \ | ||
9 | + __GNUC_MINOR__ * 100 \ | ||
10 | + __GNUC_PATCHLEVEL__) | ||
8 | 11 | ||
9 | 12 | ||
10 | /* Optimization barrier */ | 13 | /* Optimization barrier */ |
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 37d412436d0f..7d89febe4d79 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -2,22 +2,22 @@ | |||
2 | #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." | 2 | #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #if __GNUC_MINOR__ < 2 | 5 | #if GCC_VERSION < 30200 |
6 | # error Sorry, your compiler is too old - please upgrade it. | 6 | # error Sorry, your compiler is too old - please upgrade it. |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | #if __GNUC_MINOR__ >= 3 | 9 | #if GCC_VERSION >= 30300 |
10 | # define __used __attribute__((__used__)) | 10 | # define __used __attribute__((__used__)) |
11 | #else | 11 | #else |
12 | # define __used __attribute__((__unused__)) | 12 | # define __used __attribute__((__unused__)) |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #if __GNUC_MINOR__ >= 4 | 15 | #if GCC_VERSION >= 30400 |
16 | #define __must_check __attribute__((warn_unused_result)) | 16 | #define __must_check __attribute__((warn_unused_result)) |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #ifdef CONFIG_GCOV_KERNEL | 19 | #ifdef CONFIG_GCOV_KERNEL |
20 | # if __GNUC_MINOR__ < 4 | 20 | # if GCC_VERSION < 30400 |
21 | # error "GCOV profiling support for gcc versions below 3.4 not included" | 21 | # error "GCOV profiling support for gcc versions below 3.4 not included" |
22 | # endif /* __GNUC_MINOR__ */ | 22 | # endif /* __GNUC_MINOR__ */ |
23 | #endif /* CONFIG_GCOV_KERNEL */ | 23 | #endif /* CONFIG_GCOV_KERNEL */ |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 662fd1b4c42a..68b162d92254 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | /* GCC 4.1.[01] miscompiles __weak */ | 5 | /* GCC 4.1.[01] miscompiles __weak */ |
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | # if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 | 7 | # if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 |
8 | # error Your version of gcc miscompiles the __weak directive | 8 | # error Your version of gcc miscompiles the __weak directive |
9 | # endif | 9 | # endif |
10 | #endif | 10 | #endif |
@@ -13,7 +13,11 @@ | |||
13 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
15 | 15 | ||
16 | #if __GNUC_MINOR__ >= 3 | 16 | #if GCC_VERSION >= 40100 |
17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
18 | #endif | ||
19 | |||
20 | #if GCC_VERSION >= 40300 | ||
17 | /* Mark functions as cold. gcc will assume any path leading to a call | 21 | /* Mark functions as cold. gcc will assume any path leading to a call |
18 | to them will be unlikely. This means a lot of manual unlikely()s | 22 | to them will be unlikely. This means a lot of manual unlikely()s |
19 | are unnecessary now for any paths leading to the usual suspects | 23 | are unnecessary now for any paths leading to the usual suspects |
@@ -29,11 +33,15 @@ | |||
29 | the kernel context */ | 33 | the kernel context */ |
30 | #define __cold __attribute__((__cold__)) | 34 | #define __cold __attribute__((__cold__)) |
31 | 35 | ||
32 | #define __linktime_error(message) __attribute__((__error__(message))) | ||
33 | |||
34 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | 36 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) |
35 | 37 | ||
36 | #if __GNUC_MINOR__ >= 5 | 38 | #ifndef __CHECKER__ |
39 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
40 | # define __compiletime_error(message) __attribute__((error(message))) | ||
41 | #endif /* __CHECKER__ */ | ||
42 | #endif /* GCC_VERSION >= 40300 */ | ||
43 | |||
44 | #if GCC_VERSION >= 40500 | ||
37 | /* | 45 | /* |
38 | * Mark a position in code as unreachable. This can be used to | 46 | * Mark a position in code as unreachable. This can be used to |
39 | * suppress control flow warnings after asm blocks that transfer | 47 | * suppress control flow warnings after asm blocks that transfer |
@@ -48,30 +56,22 @@ | |||
48 | /* Mark a function definition as prohibited from being cloned. */ | 56 | /* Mark a function definition as prohibited from being cloned. */ |
49 | #define __noclone __attribute__((__noclone__)) | 57 | #define __noclone __attribute__((__noclone__)) |
50 | 58 | ||
51 | #endif | 59 | #endif /* GCC_VERSION >= 40500 */ |
52 | #endif | ||
53 | 60 | ||
54 | #if __GNUC_MINOR__ >= 6 | 61 | #if GCC_VERSION >= 40600 |
55 | /* | 62 | /* |
56 | * Tell the optimizer that something else uses this function or variable. | 63 | * Tell the optimizer that something else uses this function or variable. |
57 | */ | 64 | */ |
58 | #define __visible __attribute__((externally_visible)) | 65 | #define __visible __attribute__((externally_visible)) |
59 | #endif | 66 | #endif |
60 | 67 | ||
61 | #if __GNUC_MINOR__ > 0 | ||
62 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
63 | #endif | ||
64 | #if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__) | ||
65 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
66 | #define __compiletime_error(message) __attribute__((error(message))) | ||
67 | #endif | ||
68 | 68 | ||
69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | 69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP |
70 | #if __GNUC_MINOR__ >= 4 | 70 | #if GCC_VERSION >= 40400 |
71 | #define __HAVE_BUILTIN_BSWAP32__ | 71 | #define __HAVE_BUILTIN_BSWAP32__ |
72 | #define __HAVE_BUILTIN_BSWAP64__ | 72 | #define __HAVE_BUILTIN_BSWAP64__ |
73 | #endif | 73 | #endif |
74 | #if __GNUC_MINOR__ >= 8 || (defined(__powerpc__) && __GNUC_MINOR__ >= 6) | 74 | #if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) |
75 | #define __HAVE_BUILTIN_BSWAP16__ | 75 | #define __HAVE_BUILTIN_BSWAP16__ |
76 | #endif | 76 | #endif |
77 | #endif | 77 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index dd852b73b286..10b8f23fab0f 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -307,10 +307,36 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
307 | #endif | 307 | #endif |
308 | #ifndef __compiletime_error | 308 | #ifndef __compiletime_error |
309 | # define __compiletime_error(message) | 309 | # define __compiletime_error(message) |
310 | # define __compiletime_error_fallback(condition) \ | ||
311 | do { ((void)sizeof(char[1 - 2 * condition])); } while (0) | ||
312 | #else | ||
313 | # define __compiletime_error_fallback(condition) do { } while (0) | ||
310 | #endif | 314 | #endif |
311 | #ifndef __linktime_error | 315 | |
312 | # define __linktime_error(message) | 316 | #define __compiletime_assert(condition, msg, prefix, suffix) \ |
313 | #endif | 317 | do { \ |
318 | bool __cond = !(condition); \ | ||
319 | extern void prefix ## suffix(void) __compiletime_error(msg); \ | ||
320 | if (__cond) \ | ||
321 | prefix ## suffix(); \ | ||
322 | __compiletime_error_fallback(__cond); \ | ||
323 | } while (0) | ||
324 | |||
325 | #define _compiletime_assert(condition, msg, prefix, suffix) \ | ||
326 | __compiletime_assert(condition, msg, prefix, suffix) | ||
327 | |||
328 | /** | ||
329 | * compiletime_assert - break build and emit msg if condition is false | ||
330 | * @condition: a compile-time constant condition to check | ||
331 | * @msg: a message to emit if condition is false | ||
332 | * | ||
333 | * In tradition of POSIX assert, this macro will break the build if the | ||
334 | * supplied condition is *false*, emitting the supplied error message if the | ||
335 | * compiler has support to do so. | ||
336 | */ | ||
337 | #define compiletime_assert(condition, msg) \ | ||
338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | ||
339 | |||
314 | /* | 340 | /* |
315 | * Prevent the compiler from merging or refetching accesses. The compiler | 341 | * Prevent the compiler from merging or refetching accesses. The compiler |
316 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/console.h b/include/linux/console.h index dedb082fe50f..29680a8cda99 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -77,7 +77,9 @@ extern const struct consw prom_con; /* SPARC PROM console */ | |||
77 | int con_is_bound(const struct consw *csw); | 77 | int con_is_bound(const struct consw *csw); |
78 | int register_con_driver(const struct consw *csw, int first, int last); | 78 | int register_con_driver(const struct consw *csw, int first, int last); |
79 | int unregister_con_driver(const struct consw *csw); | 79 | int unregister_con_driver(const struct consw *csw); |
80 | int do_unregister_con_driver(const struct consw *csw); | ||
80 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 81 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
82 | int do_take_over_console(const struct consw *sw, int first, int last, int deflt); | ||
81 | void give_up_console(const struct consw *sw); | 83 | void give_up_console(const struct consw *sw); |
82 | #ifdef CONFIG_HW_CONSOLE | 84 | #ifdef CONFIG_HW_CONSOLE |
83 | int con_debug_enter(struct vc_data *vc); | 85 | int con_debug_enter(struct vc_data *vc); |
@@ -157,7 +159,12 @@ extern int is_console_locked(void); | |||
157 | extern int braille_register_console(struct console *, int index, | 159 | extern int braille_register_console(struct console *, int index, |
158 | char *console_options, char *braille_options); | 160 | char *console_options, char *braille_options); |
159 | extern int braille_unregister_console(struct console *); | 161 | extern int braille_unregister_console(struct console *); |
162 | #ifdef CONFIG_TTY | ||
160 | extern void console_sysfs_notify(void); | 163 | extern void console_sysfs_notify(void); |
164 | #else | ||
165 | static inline void console_sysfs_notify(void) | ||
166 | { } | ||
167 | #endif | ||
161 | extern bool console_suspend_enabled; | 168 | extern bool console_suspend_enabled; |
162 | 169 | ||
163 | /* Suspend and resume console messages over PM events */ | 170 | /* Suspend and resume console messages over PM events */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a55b88eaf96a..a22944ca0526 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -89,11 +89,15 @@ struct cpufreq_real_policy { | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | struct cpufreq_policy { | 91 | struct cpufreq_policy { |
92 | cpumask_var_t cpus; /* CPUs requiring sw coordination */ | 92 | /* CPUs sharing clock, require sw coordination */ |
93 | cpumask_var_t related_cpus; /* CPUs with any coordination */ | 93 | cpumask_var_t cpus; /* Online CPUs only */ |
94 | unsigned int shared_type; /* ANY or ALL affected CPUs | 94 | cpumask_var_t related_cpus; /* Online + Offline CPUs */ |
95 | |||
96 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs | ||
95 | should set cpufreq */ | 97 | should set cpufreq */ |
96 | unsigned int cpu; /* cpu nr of registered CPU */ | 98 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
99 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | ||
100 | * this policy */ | ||
97 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 101 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
98 | 102 | ||
99 | unsigned int min; /* in kHz */ | 103 | unsigned int min; /* in kHz */ |
@@ -112,16 +116,23 @@ struct cpufreq_policy { | |||
112 | struct completion kobj_unregister; | 116 | struct completion kobj_unregister; |
113 | }; | 117 | }; |
114 | 118 | ||
115 | #define CPUFREQ_ADJUST (0) | 119 | #define CPUFREQ_ADJUST (0) |
116 | #define CPUFREQ_INCOMPATIBLE (1) | 120 | #define CPUFREQ_INCOMPATIBLE (1) |
117 | #define CPUFREQ_NOTIFY (2) | 121 | #define CPUFREQ_NOTIFY (2) |
118 | #define CPUFREQ_START (3) | 122 | #define CPUFREQ_START (3) |
123 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | ||
119 | 124 | ||
125 | /* Only for ACPI */ | ||
120 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ | 126 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ |
121 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ | 127 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ |
122 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ | 128 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ |
123 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ | 129 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ |
124 | 130 | ||
131 | static inline bool policy_is_shared(struct cpufreq_policy *policy) | ||
132 | { | ||
133 | return cpumask_weight(policy->cpus) > 1; | ||
134 | } | ||
135 | |||
125 | /******************** cpufreq transition notifiers *******************/ | 136 | /******************** cpufreq transition notifiers *******************/ |
126 | 137 | ||
127 | #define CPUFREQ_PRECHANGE (0) | 138 | #define CPUFREQ_PRECHANGE (0) |
@@ -173,6 +184,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu | |||
173 | 184 | ||
174 | struct cpufreq_governor { | 185 | struct cpufreq_governor { |
175 | char name[CPUFREQ_NAME_LEN]; | 186 | char name[CPUFREQ_NAME_LEN]; |
187 | int initialized; | ||
176 | int (*governor) (struct cpufreq_policy *policy, | 188 | int (*governor) (struct cpufreq_policy *policy, |
177 | unsigned int event); | 189 | unsigned int event); |
178 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, | 190 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, |
@@ -308,6 +320,9 @@ __ATTR(_name, 0444, show_##_name, NULL) | |||
308 | static struct global_attr _name = \ | 320 | static struct global_attr _name = \ |
309 | __ATTR(_name, 0644, show_##_name, store_##_name) | 321 | __ATTR(_name, 0644, show_##_name, store_##_name) |
310 | 322 | ||
323 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | ||
324 | void cpufreq_cpu_put(struct cpufreq_policy *data); | ||
325 | const char *cpufreq_get_current_driver(void); | ||
311 | 326 | ||
312 | /********************************************************************* | 327 | /********************************************************************* |
313 | * CPUFREQ 2.6. INTERFACE * | 328 | * CPUFREQ 2.6. INTERFACE * |
@@ -397,14 +412,13 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
397 | 412 | ||
398 | /* the following 3 funtions are for cpufreq core use only */ | 413 | /* the following 3 funtions are for cpufreq core use only */ |
399 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 414 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
400 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | ||
401 | void cpufreq_cpu_put(struct cpufreq_policy *data); | ||
402 | 415 | ||
403 | /* the following are really really optional */ | 416 | /* the following are really really optional */ |
404 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | 417 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; |
405 | 418 | ||
406 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | 419 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, |
407 | unsigned int cpu); | 420 | unsigned int cpu); |
421 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | ||
408 | 422 | ||
409 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 423 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
410 | #endif /* _LINUX_CPUFREQ_H */ | 424 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 24cd1037b6d6..480c14dc1ddd 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -32,8 +32,6 @@ struct cpuidle_driver; | |||
32 | ****************************/ | 32 | ****************************/ |
33 | 33 | ||
34 | struct cpuidle_state_usage { | 34 | struct cpuidle_state_usage { |
35 | void *driver_data; | ||
36 | |||
37 | unsigned long long disable; | 35 | unsigned long long disable; |
38 | unsigned long long usage; | 36 | unsigned long long usage; |
39 | unsigned long long time; /* in US */ | 37 | unsigned long long time; /* in US */ |
@@ -62,26 +60,6 @@ struct cpuidle_state { | |||
62 | 60 | ||
63 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 61 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
64 | 62 | ||
65 | /** | ||
66 | * cpuidle_get_statedata - retrieves private driver state data | ||
67 | * @st_usage: the state usage statistics | ||
68 | */ | ||
69 | static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage) | ||
70 | { | ||
71 | return st_usage->driver_data; | ||
72 | } | ||
73 | |||
74 | /** | ||
75 | * cpuidle_set_statedata - stores private driver state data | ||
76 | * @st_usage: the state usage statistics | ||
77 | * @data: the private data | ||
78 | */ | ||
79 | static inline void | ||
80 | cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) | ||
81 | { | ||
82 | st_usage->driver_data = data; | ||
83 | } | ||
84 | |||
85 | struct cpuidle_device { | 63 | struct cpuidle_device { |
86 | unsigned int registered:1; | 64 | unsigned int registered:1; |
87 | unsigned int enabled:1; | 65 | unsigned int enabled:1; |
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h deleted file mode 100644 index b88f7f428e58..000000000000 --- a/include/linux/cyclomx.h +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | #ifndef _CYCLOMX_H | ||
2 | #define _CYCLOMX_H | ||
3 | /* | ||
4 | * cyclomx.h Cyclom 2X WAN Link Driver. | ||
5 | * User-level API definitions. | ||
6 | * | ||
7 | * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
8 | * | ||
9 | * Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo | ||
10 | * | ||
11 | * Based on wanpipe.h by Gene Kozin <genek@compuserve.com> | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version | ||
16 | * 2 of the License, or (at your option) any later version. | ||
17 | * ============================================================================ | ||
18 | * 2000/07/13 acme remove crap #if KERNEL_VERSION > blah | ||
19 | * 2000/01/21 acme rename cyclomx_open to cyclomx_mod_inc_use_count | ||
20 | * and cyclomx_close to cyclomx_mod_dec_use_count | ||
21 | * 1999/05/19 acme wait_queue_head_t wait_stats(support for 2.3.*) | ||
22 | * 1999/01/03 acme judicious use of data types | ||
23 | * 1998/12/27 acme cleanup: PACKED not needed | ||
24 | * 1998/08/08 acme Version 0.0.1 | ||
25 | */ | ||
26 | |||
27 | #include <linux/wanrouter.h> | ||
28 | #include <linux/spinlock.h> | ||
29 | |||
30 | #ifdef __KERNEL__ | ||
31 | /* Kernel Interface */ | ||
32 | |||
33 | #include <linux/cycx_drv.h> /* Cyclom 2X support module API definitions */ | ||
34 | #include <linux/cycx_cfm.h> /* Cyclom 2X firmware module definitions */ | ||
35 | #ifdef CONFIG_CYCLOMX_X25 | ||
36 | #include <linux/cycx_x25.h> | ||
37 | #endif | ||
38 | |||
39 | /* Adapter Data Space. | ||
40 | * This structure is needed because we handle multiple cards, otherwise | ||
41 | * static data would do it. | ||
42 | */ | ||
43 | struct cycx_device { | ||
44 | char devname[WAN_DRVNAME_SZ + 1];/* card name */ | ||
45 | struct cycx_hw hw; /* hardware configuration */ | ||
46 | struct wan_device wandev; /* WAN device data space */ | ||
47 | u32 state_tick; /* link state timestamp */ | ||
48 | spinlock_t lock; | ||
49 | char in_isr; /* interrupt-in-service flag */ | ||
50 | char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ | ||
51 | wait_queue_head_t wait_stats; /* to wait for the STATS indication */ | ||
52 | void __iomem *mbox; /* -> mailbox */ | ||
53 | void (*isr)(struct cycx_device* card); /* interrupt service routine */ | ||
54 | int (*exec)(struct cycx_device* card, void* u_cmd, void* u_data); | ||
55 | union { | ||
56 | #ifdef CONFIG_CYCLOMX_X25 | ||
57 | struct { /* X.25 specific data */ | ||
58 | u32 lo_pvc; | ||
59 | u32 hi_pvc; | ||
60 | u32 lo_svc; | ||
61 | u32 hi_svc; | ||
62 | struct cycx_x25_stats stats; | ||
63 | spinlock_t lock; | ||
64 | u32 connection_keys; | ||
65 | } x; | ||
66 | #endif | ||
67 | } u; | ||
68 | }; | ||
69 | |||
70 | /* Public Functions */ | ||
71 | void cycx_set_state(struct cycx_device *card, int state); | ||
72 | |||
73 | #ifdef CONFIG_CYCLOMX_X25 | ||
74 | int cycx_x25_wan_init(struct cycx_device *card, wandev_conf_t *conf); | ||
75 | #endif | ||
76 | #endif /* __KERNEL__ */ | ||
77 | #endif /* _CYCLOMX_H */ | ||
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h deleted file mode 100644 index 12fe6b0bfcff..000000000000 --- a/include/linux/cycx_drv.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * cycx_drv.h CYCX Support Module. Kernel API Definitions. | ||
3 | * | ||
4 | * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
5 | * | ||
6 | * Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo | ||
7 | * | ||
8 | * Based on sdladrv.h by Gene Kozin <genek@compuserve.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | * ============================================================================ | ||
15 | * 1999/10/23 acme cycxhw_t cleanup | ||
16 | * 1999/01/03 acme more judicious use of data types... | ||
17 | * uclong, ucchar, etc deleted, the u8, u16, u32 | ||
18 | * types are the portable way to go. | ||
19 | * 1999/01/03 acme judicious use of data types... u16, u32, etc | ||
20 | * 1998/12/26 acme FIXED_BUFFERS, CONF_OFFSET, | ||
21 | * removal of cy_read{bwl} | ||
22 | * 1998/08/08 acme Initial version. | ||
23 | */ | ||
24 | #ifndef _CYCX_DRV_H | ||
25 | #define _CYCX_DRV_H | ||
26 | |||
27 | #define CYCX_WINDOWSIZE 0x4000 /* default dual-port memory window size */ | ||
28 | #define GEN_CYCX_INTR 0x02 | ||
29 | #define RST_ENABLE 0x04 | ||
30 | #define START_CPU 0x06 | ||
31 | #define RST_DISABLE 0x08 | ||
32 | #define FIXED_BUFFERS 0x08 | ||
33 | #define TEST_PATTERN 0xaa55 | ||
34 | #define CMD_OFFSET 0x20 | ||
35 | #define CONF_OFFSET 0x0380 | ||
36 | #define RESET_OFFSET 0x3c00 /* For reset file load */ | ||
37 | #define DATA_OFFSET 0x0100 /* For code and data files load */ | ||
38 | #define START_OFFSET 0x3ff0 /* 80186 starts here */ | ||
39 | |||
40 | /** | ||
41 | * struct cycx_hw - Adapter hardware configuration | ||
42 | * @fwid - firmware ID | ||
43 | * @irq - interrupt request level | ||
44 | * @dpmbase - dual-port memory base | ||
45 | * @dpmsize - dual-port memory size | ||
46 | * @reserved - reserved for future use | ||
47 | */ | ||
48 | struct cycx_hw { | ||
49 | u32 fwid; | ||
50 | int irq; | ||
51 | void __iomem *dpmbase; | ||
52 | u32 dpmsize; | ||
53 | u32 reserved[5]; | ||
54 | }; | ||
55 | |||
56 | /* Function Prototypes */ | ||
57 | extern int cycx_setup(struct cycx_hw *hw, void *sfm, u32 len, unsigned long base); | ||
58 | extern int cycx_down(struct cycx_hw *hw); | ||
59 | extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | ||
60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | ||
61 | extern int cycx_exec(void __iomem *addr); | ||
62 | |||
63 | extern void cycx_intr(struct cycx_hw *hw); | ||
64 | #endif /* _CYCX_DRV_H */ | ||
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 66c434f5dd1e..63f2465807d4 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -33,7 +33,7 @@ struct debugfs_reg32 { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct debugfs_regset32 { | 35 | struct debugfs_regset32 { |
36 | struct debugfs_reg32 *regs; | 36 | const struct debugfs_reg32 *regs; |
37 | int nregs; | 37 | int nregs; |
38 | void __iomem *base; | 38 | void __iomem *base; |
39 | }; | 39 | }; |
diff --git a/include/linux/device.h b/include/linux/device.h index 43dcda937ddf..9d6464ea99c6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/pinctrl/devinfo.h> | ||
24 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
25 | #include <linux/atomic.h> | 26 | #include <linux/atomic.h> |
26 | #include <linux/ratelimit.h> | 27 | #include <linux/ratelimit.h> |
@@ -395,8 +396,8 @@ extern int class_for_each_device(struct class *class, struct device *start, | |||
395 | void *data, | 396 | void *data, |
396 | int (*fn)(struct device *dev, void *data)); | 397 | int (*fn)(struct device *dev, void *data)); |
397 | extern struct device *class_find_device(struct class *class, | 398 | extern struct device *class_find_device(struct class *class, |
398 | struct device *start, void *data, | 399 | struct device *start, const void *data, |
399 | int (*match)(struct device *, void *)); | 400 | int (*match)(struct device *, const void *)); |
400 | 401 | ||
401 | struct class_attribute { | 402 | struct class_attribute { |
402 | struct attribute attr; | 403 | struct attribute attr; |
@@ -573,6 +574,7 @@ extern int devres_release_group(struct device *dev, void *id); | |||
573 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); | 574 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); |
574 | extern void devm_kfree(struct device *dev, void *p); | 575 | extern void devm_kfree(struct device *dev, void *p); |
575 | 576 | ||
577 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); | ||
576 | void __iomem *devm_request_and_ioremap(struct device *dev, | 578 | void __iomem *devm_request_and_ioremap(struct device *dev, |
577 | struct resource *res); | 579 | struct resource *res); |
578 | 580 | ||
@@ -620,6 +622,8 @@ struct acpi_dev_node { | |||
620 | * @pm_domain: Provide callbacks that are executed during system suspend, | 622 | * @pm_domain: Provide callbacks that are executed during system suspend, |
621 | * hibernation, system resume and during runtime PM transitions | 623 | * hibernation, system resume and during runtime PM transitions |
622 | * along with subsystem-level and driver-level callbacks. | 624 | * along with subsystem-level and driver-level callbacks. |
625 | * @pins: For device pin management. | ||
626 | * See Documentation/pinctrl.txt for details. | ||
623 | * @numa_node: NUMA node this device is close to. | 627 | * @numa_node: NUMA node this device is close to. |
624 | * @dma_mask: Dma mask (if dma'ble device). | 628 | * @dma_mask: Dma mask (if dma'ble device). |
625 | * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all | 629 | * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all |
@@ -672,6 +676,10 @@ struct device { | |||
672 | struct dev_pm_info power; | 676 | struct dev_pm_info power; |
673 | struct dev_pm_domain *pm_domain; | 677 | struct dev_pm_domain *pm_domain; |
674 | 678 | ||
679 | #ifdef CONFIG_PINCTRL | ||
680 | struct dev_pin_info *pins; | ||
681 | #endif | ||
682 | |||
675 | #ifdef CONFIG_NUMA | 683 | #ifdef CONFIG_NUMA |
676 | int numa_node; /* NUMA node this device is close to */ | 684 | int numa_node; /* NUMA node this device is close to */ |
677 | #endif | 685 | #endif |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index bd2e52ccc4f2..3d754a394e92 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
@@ -53,7 +53,7 @@ struct dma_buf_attachment; | |||
53 | * @begin_cpu_access: [optional] called before cpu access to invalidate cpu | 53 | * @begin_cpu_access: [optional] called before cpu access to invalidate cpu |
54 | * caches and allocate backing storage (if not yet done) | 54 | * caches and allocate backing storage (if not yet done) |
55 | * respectively pin the objet into memory. | 55 | * respectively pin the objet into memory. |
56 | * @end_cpu_access: [optional] called after cpu access to flush cashes. | 56 | * @end_cpu_access: [optional] called after cpu access to flush caches. |
57 | * @kmap_atomic: maps a page from the buffer into kernel address | 57 | * @kmap_atomic: maps a page from the buffer into kernel address |
58 | * space, users may not block until the subsequent unmap call. | 58 | * space, users may not block until the subsequent unmap call. |
59 | * This callback must not sleep. | 59 | * This callback must not sleep. |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index d3201e438d16..f5939999cb65 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -608,7 +608,10 @@ static inline int dmaengine_device_control(struct dma_chan *chan, | |||
608 | enum dma_ctrl_cmd cmd, | 608 | enum dma_ctrl_cmd cmd, |
609 | unsigned long arg) | 609 | unsigned long arg) |
610 | { | 610 | { |
611 | return chan->device->device_control(chan, cmd, arg); | 611 | if (chan->device->device_control) |
612 | return chan->device->device_control(chan, cmd, arg); | ||
613 | |||
614 | return -ENOSYS; | ||
612 | } | 615 | } |
613 | 616 | ||
614 | static inline int dmaengine_slave_config(struct dma_chan *chan, | 617 | static inline int dmaengine_slave_config(struct dma_chan *chan, |
@@ -618,6 +621,11 @@ static inline int dmaengine_slave_config(struct dma_chan *chan, | |||
618 | (unsigned long)config); | 621 | (unsigned long)config); |
619 | } | 622 | } |
620 | 623 | ||
624 | static inline bool is_slave_direction(enum dma_transfer_direction direction) | ||
625 | { | ||
626 | return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM); | ||
627 | } | ||
628 | |||
621 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( | 629 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( |
622 | struct dma_chan *chan, dma_addr_t buf, size_t len, | 630 | struct dma_chan *chan, dma_addr_t buf, size_t len, |
623 | enum dma_transfer_direction dir, unsigned long flags) | 631 | enum dma_transfer_direction dir, unsigned long flags) |
@@ -660,6 +668,13 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | |||
660 | period_len, dir, flags, NULL); | 668 | period_len, dir, flags, NULL); |
661 | } | 669 | } |
662 | 670 | ||
671 | static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma( | ||
672 | struct dma_chan *chan, struct dma_interleaved_template *xt, | ||
673 | unsigned long flags) | ||
674 | { | ||
675 | return chan->device->device_prep_interleaved_dma(chan, xt, flags); | ||
676 | } | ||
677 | |||
663 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | 678 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |
664 | { | 679 | { |
665 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); | 680 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); |
@@ -849,20 +864,6 @@ static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx) | |||
849 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; | 864 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; |
850 | } | 865 | } |
851 | 866 | ||
852 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) | ||
853 | static inline int __first_dma_cap(const dma_cap_mask_t *srcp) | ||
854 | { | ||
855 | return min_t(int, DMA_TX_TYPE_END, | ||
856 | find_first_bit(srcp->bits, DMA_TX_TYPE_END)); | ||
857 | } | ||
858 | |||
859 | #define next_dma_cap(n, mask) __next_dma_cap((n), &(mask)) | ||
860 | static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp) | ||
861 | { | ||
862 | return min_t(int, DMA_TX_TYPE_END, | ||
863 | find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1)); | ||
864 | } | ||
865 | |||
866 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) | 867 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) |
867 | static inline void | 868 | static inline void |
868 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | 869 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) |
@@ -891,9 +892,7 @@ __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) | |||
891 | } | 892 | } |
892 | 893 | ||
893 | #define for_each_dma_cap_mask(cap, mask) \ | 894 | #define for_each_dma_cap_mask(cap, mask) \ |
894 | for ((cap) = first_dma_cap(mask); \ | 895 | for_each_set_bit(cap, mask.bits, DMA_TX_TYPE_END) |
895 | (cap) < DMA_TX_TYPE_END; \ | ||
896 | (cap) = next_dma_cap((cap), (mask))) | ||
897 | 896 | ||
898 | /** | 897 | /** |
899 | * dma_async_issue_pending - flush pending transactions to HW | 898 | * dma_async_issue_pending - flush pending transactions to HW |
@@ -907,8 +906,6 @@ static inline void dma_async_issue_pending(struct dma_chan *chan) | |||
907 | chan->device->device_issue_pending(chan); | 906 | chan->device->device_issue_pending(chan); |
908 | } | 907 | } |
909 | 908 | ||
910 | #define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan) | ||
911 | |||
912 | /** | 909 | /** |
913 | * dma_async_is_tx_complete - poll for transaction completion | 910 | * dma_async_is_tx_complete - poll for transaction completion |
914 | * @chan: DMA channel | 911 | * @chan: DMA channel |
@@ -934,16 +931,13 @@ static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan, | |||
934 | return status; | 931 | return status; |
935 | } | 932 | } |
936 | 933 | ||
937 | #define dma_async_memcpy_complete(chan, cookie, last, used)\ | ||
938 | dma_async_is_tx_complete(chan, cookie, last, used) | ||
939 | |||
940 | /** | 934 | /** |
941 | * dma_async_is_complete - test a cookie against chan state | 935 | * dma_async_is_complete - test a cookie against chan state |
942 | * @cookie: transaction identifier to test status of | 936 | * @cookie: transaction identifier to test status of |
943 | * @last_complete: last know completed transaction | 937 | * @last_complete: last know completed transaction |
944 | * @last_used: last cookie value handed out | 938 | * @last_used: last cookie value handed out |
945 | * | 939 | * |
946 | * dma_async_is_complete() is used in dma_async_memcpy_complete() | 940 | * dma_async_is_complete() is used in dma_async_is_tx_complete() |
947 | * the test logic is separated for lightweight testing of multiple cookies | 941 | * the test logic is separated for lightweight testing of multiple cookies |
948 | */ | 942 | */ |
949 | static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | 943 | static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, |
@@ -974,6 +968,7 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | |||
974 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | 968 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); |
975 | void dma_issue_pending_all(void); | 969 | void dma_issue_pending_all(void); |
976 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | 970 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); |
971 | struct dma_chan *dma_request_slave_channel(struct device *dev, char *name); | ||
977 | void dma_release_channel(struct dma_chan *chan); | 972 | void dma_release_channel(struct dma_chan *chan); |
978 | #else | 973 | #else |
979 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | 974 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) |
@@ -988,6 +983,11 @@ static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, | |||
988 | { | 983 | { |
989 | return NULL; | 984 | return NULL; |
990 | } | 985 | } |
986 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | ||
987 | char *name) | ||
988 | { | ||
989 | return NULL; | ||
990 | } | ||
991 | static inline void dma_release_channel(struct dma_chan *chan) | 991 | static inline void dma_release_channel(struct dma_chan *chan) |
992 | { | 992 | { |
993 | } | 993 | } |
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index 1148575fd134..dd755ce2a5eb 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h | |||
@@ -53,5 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); | |||
53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); | 53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); |
54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); | 54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); |
55 | 55 | ||
56 | extern struct sys_timer dw_apb_timer; | 56 | extern void dw_apb_timer_init(void); |
57 | #endif /* __DW_APB_TIMER_H__ */ | 57 | #endif /* __DW_APB_TIMER_H__ */ |
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index e1c8c9e919ac..41766de66e33 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
@@ -15,14 +15,38 @@ | |||
15 | #include <linux/dmaengine.h> | 15 | #include <linux/dmaengine.h> |
16 | 16 | ||
17 | /** | 17 | /** |
18 | * struct dw_dma_slave - Controller-specific information about a slave | ||
19 | * | ||
20 | * @dma_dev: required DMA master device. Depricated. | ||
21 | * @bus_id: name of this device channel, not just a device name since | ||
22 | * devices may have more than one channel e.g. "foo_tx" | ||
23 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
24 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
25 | * @src_master: src master for transfers on allocated channel. | ||
26 | * @dst_master: dest master for transfers on allocated channel. | ||
27 | */ | ||
28 | struct dw_dma_slave { | ||
29 | struct device *dma_dev; | ||
30 | const char *bus_id; | ||
31 | u32 cfg_hi; | ||
32 | u32 cfg_lo; | ||
33 | u8 src_master; | ||
34 | u8 dst_master; | ||
35 | }; | ||
36 | |||
37 | /** | ||
18 | * struct dw_dma_platform_data - Controller configuration parameters | 38 | * struct dw_dma_platform_data - Controller configuration parameters |
19 | * @nr_channels: Number of channels supported by hardware (max 8) | 39 | * @nr_channels: Number of channels supported by hardware (max 8) |
20 | * @is_private: The device channels should be marked as private and not for | 40 | * @is_private: The device channels should be marked as private and not for |
21 | * by the general purpose DMA channel allocator. | 41 | * by the general purpose DMA channel allocator. |
42 | * @chan_allocation_order: Allocate channels starting from 0 or 7 | ||
43 | * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0. | ||
22 | * @block_size: Maximum block size supported by the controller | 44 | * @block_size: Maximum block size supported by the controller |
23 | * @nr_masters: Number of AHB masters supported by the controller | 45 | * @nr_masters: Number of AHB masters supported by the controller |
24 | * @data_width: Maximum data width supported by hardware per AHB master | 46 | * @data_width: Maximum data width supported by hardware per AHB master |
25 | * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits) | 47 | * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits) |
48 | * @sd: slave specific data. Used for configuring channels | ||
49 | * @sd_count: count of slave data structures passed. | ||
26 | */ | 50 | */ |
27 | struct dw_dma_platform_data { | 51 | struct dw_dma_platform_data { |
28 | unsigned int nr_channels; | 52 | unsigned int nr_channels; |
@@ -36,6 +60,9 @@ struct dw_dma_platform_data { | |||
36 | unsigned short block_size; | 60 | unsigned short block_size; |
37 | unsigned char nr_masters; | 61 | unsigned char nr_masters; |
38 | unsigned char data_width[4]; | 62 | unsigned char data_width[4]; |
63 | |||
64 | struct dw_dma_slave *sd; | ||
65 | unsigned int sd_count; | ||
39 | }; | 66 | }; |
40 | 67 | ||
41 | /* bursts size */ | 68 | /* bursts size */ |
@@ -50,23 +77,6 @@ enum dw_dma_msize { | |||
50 | DW_DMA_MSIZE_256, | 77 | DW_DMA_MSIZE_256, |
51 | }; | 78 | }; |
52 | 79 | ||
53 | /** | ||
54 | * struct dw_dma_slave - Controller-specific information about a slave | ||
55 | * | ||
56 | * @dma_dev: required DMA master device | ||
57 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
58 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
59 | * @src_master: src master for transfers on allocated channel. | ||
60 | * @dst_master: dest master for transfers on allocated channel. | ||
61 | */ | ||
62 | struct dw_dma_slave { | ||
63 | struct device *dma_dev; | ||
64 | u32 cfg_hi; | ||
65 | u32 cfg_lo; | ||
66 | u8 src_master; | ||
67 | u8 dst_master; | ||
68 | }; | ||
69 | |||
70 | /* Platform-configurable bits in CFG_HI */ | 80 | /* Platform-configurable bits in CFG_HI */ |
71 | #define DWC_CFGH_FCMODE (1 << 0) | 81 | #define DWC_CFGH_FCMODE (1 << 0) |
72 | #define DWC_CFGH_FIFO_MODE (1 << 1) | 82 | #define DWC_CFGH_FIFO_MODE (1 << 1) |
@@ -104,5 +114,6 @@ void dw_dma_cyclic_stop(struct dma_chan *chan); | |||
104 | dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan); | 114 | dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan); |
105 | 115 | ||
106 | dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan); | 116 | dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan); |
117 | bool dw_dma_generic_filter(struct dma_chan *chan, void *param); | ||
107 | 118 | ||
108 | #endif /* DW_DMAC_H */ | 119 | #endif /* DW_DMAC_H */ |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 6dd4787a798a..2fe93b26b42f 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -95,6 +95,17 @@ do { \ | |||
95 | ##__VA_ARGS__); \ | 95 | ##__VA_ARGS__); \ |
96 | } while (0) | 96 | } while (0) |
97 | 97 | ||
98 | #define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ | ||
99 | groupsize, buf, len, ascii) \ | ||
100 | do { \ | ||
101 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, \ | ||
102 | __builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\ | ||
103 | if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ | ||
104 | print_hex_dump(KERN_DEBUG, prefix_str, \ | ||
105 | prefix_type, rowsize, groupsize, \ | ||
106 | buf, len, ascii); \ | ||
107 | } while (0) | ||
108 | |||
98 | #else | 109 | #else |
99 | 110 | ||
100 | #include <linux/string.h> | 111 | #include <linux/string.h> |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 7a9498ab3c2d..9bf2f1fcae27 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -740,7 +740,8 @@ struct efivars { | |||
740 | * 1) ->list - adds, removals, reads, writes | 740 | * 1) ->list - adds, removals, reads, writes |
741 | * 2) ops.[gs]et_variable() calls. | 741 | * 2) ops.[gs]et_variable() calls. |
742 | * It must not be held when creating sysfs entries or calling kmalloc. | 742 | * It must not be held when creating sysfs entries or calling kmalloc. |
743 | * ops.get_next_variable() is only called from register_efivars(), | 743 | * ops.get_next_variable() is only called from register_efivars() |
744 | * or efivar_update_sysfs_entries(), | ||
744 | * which is protected by the BKL, so that path is safe. | 745 | * which is protected by the BKL, so that path is safe. |
745 | */ | 746 | */ |
746 | spinlock_t lock; | 747 | spinlock_t lock; |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 243eea1e33d8..c623861964e4 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -40,6 +40,8 @@ extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, | |||
40 | extern void eth_header_cache_update(struct hh_cache *hh, | 40 | extern void eth_header_cache_update(struct hh_cache *hh, |
41 | const struct net_device *dev, | 41 | const struct net_device *dev, |
42 | const unsigned char *haddr); | 42 | const unsigned char *haddr); |
43 | extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p); | ||
44 | extern void eth_commit_mac_addr_change(struct net_device *dev, void *p); | ||
43 | extern int eth_mac_addr(struct net_device *dev, void *p); | 45 | extern int eth_mac_addr(struct net_device *dev, void *p); |
44 | extern int eth_change_mtu(struct net_device *dev, int new_mtu); | 46 | extern int eth_change_mtu(struct net_device *dev, int new_mtu); |
45 | extern int eth_validate_addr(struct net_device *dev); | 47 | extern int eth_validate_addr(struct net_device *dev); |
@@ -192,7 +194,7 @@ static inline void eth_zero_addr(u8 *addr) | |||
192 | */ | 194 | */ |
193 | static inline void eth_hw_addr_random(struct net_device *dev) | 195 | static inline void eth_hw_addr_random(struct net_device *dev) |
194 | { | 196 | { |
195 | dev->addr_assign_type |= NET_ADDR_RANDOM; | 197 | dev->addr_assign_type = NET_ADDR_RANDOM; |
196 | eth_random_addr(dev->dev_addr); | 198 | eth_random_addr(dev->dev_addr); |
197 | } | 199 | } |
198 | 200 | ||
diff --git a/include/linux/extcon/extcon_gpio.h b/include/linux/extcon/extcon-gpio.h index 2d8307f7d67d..2d8307f7d67d 100644 --- a/include/linux/extcon/extcon_gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
diff --git a/include/linux/fb.h b/include/linux/fb.h index c7a95714b1fe..58b98606ac26 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -19,6 +19,8 @@ struct vm_area_struct; | |||
19 | struct fb_info; | 19 | struct fb_info; |
20 | struct device; | 20 | struct device; |
21 | struct file; | 21 | struct file; |
22 | struct videomode; | ||
23 | struct device_node; | ||
22 | 24 | ||
23 | /* Definitions below are used in the parsed monitor specs */ | 25 | /* Definitions below are used in the parsed monitor specs */ |
24 | #define FB_DPMS_ACTIVE_OFF 1 | 26 | #define FB_DPMS_ACTIVE_OFF 1 |
@@ -714,6 +716,12 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb); | |||
714 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 716 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
715 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | 717 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); |
716 | 718 | ||
719 | extern int of_get_fb_videomode(struct device_node *np, | ||
720 | struct fb_videomode *fb, | ||
721 | int index); | ||
722 | extern int fb_videomode_from_videomode(const struct videomode *vm, | ||
723 | struct fb_videomode *fbmode); | ||
724 | |||
717 | /* drivers/video/modedb.c */ | 725 | /* drivers/video/modedb.c */ |
718 | #define VESA_MODEDB_SIZE 34 | 726 | #define VESA_MODEDB_SIZE 34 |
719 | extern void fb_var_to_videomode(struct fb_videomode *mode, | 727 | extern void fb_var_to_videomode(struct fb_videomode *mode, |
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index 43fe52fcef0f..71d4fa721db9 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | int firmware_map_add_early(u64 start, u64 end, const char *type); | 26 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
27 | int firmware_map_add_hotplug(u64 start, u64 end, const char *type); | 27 | int firmware_map_add_hotplug(u64 start, u64 end, const char *type); |
28 | int firmware_map_remove(u64 start, u64 end, const char *type); | ||
28 | 29 | ||
29 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
30 | 31 | ||
@@ -38,6 +39,11 @@ static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type) | |||
38 | return 0; | 39 | return 0; |
39 | } | 40 | } |
40 | 41 | ||
42 | static inline int firmware_map_remove(u64 start, u64 end, const char *type) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
41 | #endif /* CONFIG_FIRMWARE_MEMMAP */ | 47 | #endif /* CONFIG_FIRMWARE_MEMMAP */ |
42 | 48 | ||
43 | #endif /* _LINUX_FIRMWARE_MAP_H */ | 49 | #endif /* _LINUX_FIRMWARE_MAP_H */ |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index e4238ceaa4d6..e70df40d84f6 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -13,6 +13,11 @@ extern bool pm_freezing; /* PM freezing in effect */ | |||
13 | extern bool pm_nosig_freezing; /* PM nosig freezing in effect */ | 13 | extern bool pm_nosig_freezing; /* PM nosig freezing in effect */ |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Timeout for stopping processes | ||
17 | */ | ||
18 | extern unsigned int freeze_timeout_msecs; | ||
19 | |||
20 | /* | ||
16 | * Check if a process has been frozen | 21 | * Check if a process has been frozen |
17 | */ | 22 | */ |
18 | static inline bool frozen(struct task_struct *p) | 23 | static inline bool frozen(struct task_struct *p) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7617ee04f066..7d2e893ec3d1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -301,7 +301,7 @@ size_t iov_iter_copy_from_user(struct page *page, | |||
301 | struct iov_iter *i, unsigned long offset, size_t bytes); | 301 | struct iov_iter *i, unsigned long offset, size_t bytes); |
302 | void iov_iter_advance(struct iov_iter *i, size_t bytes); | 302 | void iov_iter_advance(struct iov_iter *i, size_t bytes); |
303 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); | 303 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); |
304 | size_t iov_iter_single_seg_count(struct iov_iter *i); | 304 | size_t iov_iter_single_seg_count(const struct iov_iter *i); |
305 | 305 | ||
306 | static inline void iov_iter_init(struct iov_iter *i, | 306 | static inline void iov_iter_init(struct iov_iter *i, |
307 | const struct iovec *iov, unsigned long nr_segs, | 307 | const struct iovec *iov, unsigned long nr_segs, |
diff --git a/include/linux/fsl/bestcomm/ata.h b/include/linux/fsl/bestcomm/ata.h new file mode 100644 index 000000000000..0b2371811334 --- /dev/null +++ b/include/linux/fsl/bestcomm/ata.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Header for Bestcomm ATA task driver | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2006 Freescale - John Rigby | ||
6 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public License | ||
9 | * version 2. This program is licensed "as is" without any warranty of any | ||
10 | * kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #ifndef __BESTCOMM_ATA_H__ | ||
14 | #define __BESTCOMM_ATA_H__ | ||
15 | |||
16 | |||
17 | struct bcom_ata_bd { | ||
18 | u32 status; | ||
19 | u32 src_pa; | ||
20 | u32 dst_pa; | ||
21 | }; | ||
22 | |||
23 | extern struct bcom_task * bcom_ata_init(int queue_len, int maxbufsize); | ||
24 | extern void bcom_ata_rx_prepare(struct bcom_task *tsk); | ||
25 | extern void bcom_ata_tx_prepare(struct bcom_task *tsk); | ||
26 | extern void bcom_ata_reset_bd(struct bcom_task *tsk); | ||
27 | extern void bcom_ata_release(struct bcom_task *tsk); | ||
28 | |||
29 | #endif /* __BESTCOMM_ATA_H__ */ | ||
30 | |||
diff --git a/include/linux/fsl/bestcomm/bestcomm.h b/include/linux/fsl/bestcomm/bestcomm.h new file mode 100644 index 000000000000..a0e2e6b19b57 --- /dev/null +++ b/include/linux/fsl/bestcomm/bestcomm.h | |||
@@ -0,0 +1,213 @@ | |||
1 | /* | ||
2 | * Public header for the MPC52xx processor BestComm driver | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
6 | * Copyright (C) 2005 Varma Electronics Oy, | ||
7 | * ( by Andrey Volkov <avolkov@varma-el.com> ) | ||
8 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
9 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public License | ||
12 | * version 2. This program is licensed "as is" without any warranty of any | ||
13 | * kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #ifndef __BESTCOMM_H__ | ||
17 | #define __BESTCOMM_H__ | ||
18 | |||
19 | /** | ||
20 | * struct bcom_bd - Structure describing a generic BestComm buffer descriptor | ||
21 | * @status: The current status of this buffer. Exact meaning depends on the | ||
22 | * task type | ||
23 | * @data: An array of u32 extra data. Size of array is task dependent. | ||
24 | * | ||
25 | * Note: Don't dereference a bcom_bd pointer as an array. The size of the | ||
26 | * bcom_bd is variable. Use bcom_get_bd() instead. | ||
27 | */ | ||
28 | struct bcom_bd { | ||
29 | u32 status; | ||
30 | u32 data[0]; /* variable payload size */ | ||
31 | }; | ||
32 | |||
33 | /* ======================================================================== */ | ||
34 | /* Generic task management */ | ||
35 | /* ======================================================================== */ | ||
36 | |||
37 | /** | ||
38 | * struct bcom_task - Structure describing a loaded BestComm task | ||
39 | * | ||
40 | * This structure is never built by the driver it self. It's built and | ||
41 | * filled the intermediate layer of the BestComm API, the task dependent | ||
42 | * support code. | ||
43 | * | ||
44 | * Most likely you don't need to poke around inside this structure. The | ||
45 | * fields are exposed in the header just for the sake of inline functions | ||
46 | */ | ||
47 | struct bcom_task { | ||
48 | unsigned int tasknum; | ||
49 | unsigned int flags; | ||
50 | int irq; | ||
51 | |||
52 | struct bcom_bd *bd; | ||
53 | phys_addr_t bd_pa; | ||
54 | void **cookie; | ||
55 | unsigned short index; | ||
56 | unsigned short outdex; | ||
57 | unsigned int num_bd; | ||
58 | unsigned int bd_size; | ||
59 | |||
60 | void* priv; | ||
61 | }; | ||
62 | |||
63 | #define BCOM_FLAGS_NONE 0x00000000ul | ||
64 | #define BCOM_FLAGS_ENABLE_TASK (1ul << 0) | ||
65 | |||
66 | /** | ||
67 | * bcom_enable - Enable a BestComm task | ||
68 | * @tsk: The BestComm task structure | ||
69 | * | ||
70 | * This function makes sure the given task is enabled and can be run | ||
71 | * by the BestComm engine as needed | ||
72 | */ | ||
73 | extern void bcom_enable(struct bcom_task *tsk); | ||
74 | |||
75 | /** | ||
76 | * bcom_disable - Disable a BestComm task | ||
77 | * @tsk: The BestComm task structure | ||
78 | * | ||
79 | * This function disable a given task, making sure it's not executed | ||
80 | * by the BestComm engine. | ||
81 | */ | ||
82 | extern void bcom_disable(struct bcom_task *tsk); | ||
83 | |||
84 | |||
85 | /** | ||
86 | * bcom_get_task_irq - Returns the irq number of a BestComm task | ||
87 | * @tsk: The BestComm task structure | ||
88 | */ | ||
89 | static inline int | ||
90 | bcom_get_task_irq(struct bcom_task *tsk) { | ||
91 | return tsk->irq; | ||
92 | } | ||
93 | |||
94 | /* ======================================================================== */ | ||
95 | /* BD based tasks helpers */ | ||
96 | /* ======================================================================== */ | ||
97 | |||
98 | #define BCOM_BD_READY 0x40000000ul | ||
99 | |||
100 | /** _bcom_next_index - Get next input index. | ||
101 | * @tsk: pointer to task structure | ||
102 | * | ||
103 | * Support function; Device drivers should not call this | ||
104 | */ | ||
105 | static inline int | ||
106 | _bcom_next_index(struct bcom_task *tsk) | ||
107 | { | ||
108 | return ((tsk->index + 1) == tsk->num_bd) ? 0 : tsk->index + 1; | ||
109 | } | ||
110 | |||
111 | /** _bcom_next_outdex - Get next output index. | ||
112 | * @tsk: pointer to task structure | ||
113 | * | ||
114 | * Support function; Device drivers should not call this | ||
115 | */ | ||
116 | static inline int | ||
117 | _bcom_next_outdex(struct bcom_task *tsk) | ||
118 | { | ||
119 | return ((tsk->outdex + 1) == tsk->num_bd) ? 0 : tsk->outdex + 1; | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * bcom_queue_empty - Checks if a BestComm task BD queue is empty | ||
124 | * @tsk: The BestComm task structure | ||
125 | */ | ||
126 | static inline int | ||
127 | bcom_queue_empty(struct bcom_task *tsk) | ||
128 | { | ||
129 | return tsk->index == tsk->outdex; | ||
130 | } | ||
131 | |||
132 | /** | ||
133 | * bcom_queue_full - Checks if a BestComm task BD queue is full | ||
134 | * @tsk: The BestComm task structure | ||
135 | */ | ||
136 | static inline int | ||
137 | bcom_queue_full(struct bcom_task *tsk) | ||
138 | { | ||
139 | return tsk->outdex == _bcom_next_index(tsk); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * bcom_get_bd - Get a BD from the queue | ||
144 | * @tsk: The BestComm task structure | ||
145 | * index: Index of the BD to fetch | ||
146 | */ | ||
147 | static inline struct bcom_bd | ||
148 | *bcom_get_bd(struct bcom_task *tsk, unsigned int index) | ||
149 | { | ||
150 | /* A cast to (void*) so the address can be incremented by the | ||
151 | * real size instead of by sizeof(struct bcom_bd) */ | ||
152 | return ((void *)tsk->bd) + (index * tsk->bd_size); | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * bcom_buffer_done - Checks if a BestComm | ||
157 | * @tsk: The BestComm task structure | ||
158 | */ | ||
159 | static inline int | ||
160 | bcom_buffer_done(struct bcom_task *tsk) | ||
161 | { | ||
162 | struct bcom_bd *bd; | ||
163 | if (bcom_queue_empty(tsk)) | ||
164 | return 0; | ||
165 | |||
166 | bd = bcom_get_bd(tsk, tsk->outdex); | ||
167 | return !(bd->status & BCOM_BD_READY); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * bcom_prepare_next_buffer - clear status of next available buffer. | ||
172 | * @tsk: The BestComm task structure | ||
173 | * | ||
174 | * Returns pointer to next buffer descriptor | ||
175 | */ | ||
176 | static inline struct bcom_bd * | ||
177 | bcom_prepare_next_buffer(struct bcom_task *tsk) | ||
178 | { | ||
179 | struct bcom_bd *bd; | ||
180 | |||
181 | bd = bcom_get_bd(tsk, tsk->index); | ||
182 | bd->status = 0; /* cleanup last status */ | ||
183 | return bd; | ||
184 | } | ||
185 | |||
186 | static inline void | ||
187 | bcom_submit_next_buffer(struct bcom_task *tsk, void *cookie) | ||
188 | { | ||
189 | struct bcom_bd *bd = bcom_get_bd(tsk, tsk->index); | ||
190 | |||
191 | tsk->cookie[tsk->index] = cookie; | ||
192 | mb(); /* ensure the bd is really up-to-date */ | ||
193 | bd->status |= BCOM_BD_READY; | ||
194 | tsk->index = _bcom_next_index(tsk); | ||
195 | if (tsk->flags & BCOM_FLAGS_ENABLE_TASK) | ||
196 | bcom_enable(tsk); | ||
197 | } | ||
198 | |||
199 | static inline void * | ||
200 | bcom_retrieve_buffer(struct bcom_task *tsk, u32 *p_status, struct bcom_bd **p_bd) | ||
201 | { | ||
202 | void *cookie = tsk->cookie[tsk->outdex]; | ||
203 | struct bcom_bd *bd = bcom_get_bd(tsk, tsk->outdex); | ||
204 | |||
205 | if (p_status) | ||
206 | *p_status = bd->status; | ||
207 | if (p_bd) | ||
208 | *p_bd = bd; | ||
209 | tsk->outdex = _bcom_next_outdex(tsk); | ||
210 | return cookie; | ||
211 | } | ||
212 | |||
213 | #endif /* __BESTCOMM_H__ */ | ||
diff --git a/include/linux/fsl/bestcomm/bestcomm_priv.h b/include/linux/fsl/bestcomm/bestcomm_priv.h new file mode 100644 index 000000000000..3b52f3ffbdf8 --- /dev/null +++ b/include/linux/fsl/bestcomm/bestcomm_priv.h | |||
@@ -0,0 +1,350 @@ | |||
1 | /* | ||
2 | * Private header for the MPC52xx processor BestComm driver | ||
3 | * | ||
4 | * By private, we mean that driver should not use it directly. It's meant | ||
5 | * to be used by the BestComm engine driver itself and by the intermediate | ||
6 | * layer between the core and the drivers. | ||
7 | * | ||
8 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
9 | * Copyright (C) 2005 Varma Electronics Oy, | ||
10 | * ( by Andrey Volkov <avolkov@varma-el.com> ) | ||
11 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
12 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
13 | * | ||
14 | * This file is licensed under the terms of the GNU General Public License | ||
15 | * version 2. This program is licensed "as is" without any warranty of any | ||
16 | * kind, whether express or implied. | ||
17 | */ | ||
18 | |||
19 | #ifndef __BESTCOMM_PRIV_H__ | ||
20 | #define __BESTCOMM_PRIV_H__ | ||
21 | |||
22 | #include <linux/spinlock.h> | ||
23 | #include <linux/of.h> | ||
24 | #include <asm/io.h> | ||
25 | #include <asm/mpc52xx.h> | ||
26 | |||
27 | #include "sram.h" | ||
28 | |||
29 | |||
30 | /* ======================================================================== */ | ||
31 | /* Engine related stuff */ | ||
32 | /* ======================================================================== */ | ||
33 | |||
34 | /* Zones sizes and needed alignments */ | ||
35 | #define BCOM_MAX_TASKS 16 | ||
36 | #define BCOM_MAX_VAR 24 | ||
37 | #define BCOM_MAX_INC 8 | ||
38 | #define BCOM_MAX_FDT 64 | ||
39 | #define BCOM_MAX_CTX 20 | ||
40 | #define BCOM_CTX_SIZE (BCOM_MAX_CTX * sizeof(u32)) | ||
41 | #define BCOM_CTX_ALIGN 0x100 | ||
42 | #define BCOM_VAR_SIZE (BCOM_MAX_VAR * sizeof(u32)) | ||
43 | #define BCOM_INC_SIZE (BCOM_MAX_INC * sizeof(u32)) | ||
44 | #define BCOM_VAR_ALIGN 0x80 | ||
45 | #define BCOM_FDT_SIZE (BCOM_MAX_FDT * sizeof(u32)) | ||
46 | #define BCOM_FDT_ALIGN 0x100 | ||
47 | |||
48 | /** | ||
49 | * struct bcom_tdt - Task Descriptor Table Entry | ||
50 | * | ||
51 | */ | ||
52 | struct bcom_tdt { | ||
53 | u32 start; | ||
54 | u32 stop; | ||
55 | u32 var; | ||
56 | u32 fdt; | ||
57 | u32 exec_status; /* used internally by BestComm engine */ | ||
58 | u32 mvtp; /* used internally by BestComm engine */ | ||
59 | u32 context; | ||
60 | u32 litbase; | ||
61 | }; | ||
62 | |||
63 | /** | ||
64 | * struct bcom_engine | ||
65 | * | ||
66 | * This holds all info needed globaly to handle the engine | ||
67 | */ | ||
68 | struct bcom_engine { | ||
69 | struct device_node *ofnode; | ||
70 | struct mpc52xx_sdma __iomem *regs; | ||
71 | phys_addr_t regs_base; | ||
72 | |||
73 | struct bcom_tdt *tdt; | ||
74 | u32 *ctx; | ||
75 | u32 *var; | ||
76 | u32 *fdt; | ||
77 | |||
78 | spinlock_t lock; | ||
79 | }; | ||
80 | |||
81 | extern struct bcom_engine *bcom_eng; | ||
82 | |||
83 | |||
84 | /* ======================================================================== */ | ||
85 | /* Tasks related stuff */ | ||
86 | /* ======================================================================== */ | ||
87 | |||
88 | /* Tasks image header */ | ||
89 | #define BCOM_TASK_MAGIC 0x4243544B /* 'BCTK' */ | ||
90 | |||
91 | struct bcom_task_header { | ||
92 | u32 magic; | ||
93 | u8 desc_size; /* the size fields */ | ||
94 | u8 var_size; /* are given in number */ | ||
95 | u8 inc_size; /* of 32-bits words */ | ||
96 | u8 first_var; | ||
97 | u8 reserved[8]; | ||
98 | }; | ||
99 | |||
100 | /* Descriptors structure & co */ | ||
101 | #define BCOM_DESC_NOP 0x000001f8 | ||
102 | #define BCOM_LCD_MASK 0x80000000 | ||
103 | #define BCOM_DRD_EXTENDED 0x40000000 | ||
104 | #define BCOM_DRD_INITIATOR_SHIFT 21 | ||
105 | |||
106 | /* Tasks pragma */ | ||
107 | #define BCOM_PRAGMA_BIT_RSV 7 /* reserved pragma bit */ | ||
108 | #define BCOM_PRAGMA_BIT_PRECISE_INC 6 /* increment 0=when possible, */ | ||
109 | /* 1=iter end */ | ||
110 | #define BCOM_PRAGMA_BIT_RST_ERROR_NO 5 /* don't reset errors on */ | ||
111 | /* task enable */ | ||
112 | #define BCOM_PRAGMA_BIT_PACK 4 /* pack data enable */ | ||
113 | #define BCOM_PRAGMA_BIT_INTEGER 3 /* data alignment */ | ||
114 | /* 0=frac(msb), 1=int(lsb) */ | ||
115 | #define BCOM_PRAGMA_BIT_SPECREAD 2 /* XLB speculative read */ | ||
116 | #define BCOM_PRAGMA_BIT_CW 1 /* write line buffer enable */ | ||
117 | #define BCOM_PRAGMA_BIT_RL 0 /* read line buffer enable */ | ||
118 | |||
119 | /* Looks like XLB speculative read generates XLB errors when a buffer | ||
120 | * is at the end of the physical memory. i.e. when accessing the | ||
121 | * lasts words, the engine tries to prefetch the next but there is no | ||
122 | * next ... | ||
123 | */ | ||
124 | #define BCOM_STD_PRAGMA ((0 << BCOM_PRAGMA_BIT_RSV) | \ | ||
125 | (0 << BCOM_PRAGMA_BIT_PRECISE_INC) | \ | ||
126 | (0 << BCOM_PRAGMA_BIT_RST_ERROR_NO) | \ | ||
127 | (0 << BCOM_PRAGMA_BIT_PACK) | \ | ||
128 | (0 << BCOM_PRAGMA_BIT_INTEGER) | \ | ||
129 | (0 << BCOM_PRAGMA_BIT_SPECREAD) | \ | ||
130 | (1 << BCOM_PRAGMA_BIT_CW) | \ | ||
131 | (1 << BCOM_PRAGMA_BIT_RL)) | ||
132 | |||
133 | #define BCOM_PCI_PRAGMA ((0 << BCOM_PRAGMA_BIT_RSV) | \ | ||
134 | (0 << BCOM_PRAGMA_BIT_PRECISE_INC) | \ | ||
135 | (0 << BCOM_PRAGMA_BIT_RST_ERROR_NO) | \ | ||
136 | (0 << BCOM_PRAGMA_BIT_PACK) | \ | ||
137 | (1 << BCOM_PRAGMA_BIT_INTEGER) | \ | ||
138 | (0 << BCOM_PRAGMA_BIT_SPECREAD) | \ | ||
139 | (1 << BCOM_PRAGMA_BIT_CW) | \ | ||
140 | (1 << BCOM_PRAGMA_BIT_RL)) | ||
141 | |||
142 | #define BCOM_ATA_PRAGMA BCOM_STD_PRAGMA | ||
143 | #define BCOM_CRC16_DP_0_PRAGMA BCOM_STD_PRAGMA | ||
144 | #define BCOM_CRC16_DP_1_PRAGMA BCOM_STD_PRAGMA | ||
145 | #define BCOM_FEC_RX_BD_PRAGMA BCOM_STD_PRAGMA | ||
146 | #define BCOM_FEC_TX_BD_PRAGMA BCOM_STD_PRAGMA | ||
147 | #define BCOM_GEN_DP_0_PRAGMA BCOM_STD_PRAGMA | ||
148 | #define BCOM_GEN_DP_1_PRAGMA BCOM_STD_PRAGMA | ||
149 | #define BCOM_GEN_DP_2_PRAGMA BCOM_STD_PRAGMA | ||
150 | #define BCOM_GEN_DP_3_PRAGMA BCOM_STD_PRAGMA | ||
151 | #define BCOM_GEN_DP_BD_0_PRAGMA BCOM_STD_PRAGMA | ||
152 | #define BCOM_GEN_DP_BD_1_PRAGMA BCOM_STD_PRAGMA | ||
153 | #define BCOM_GEN_RX_BD_PRAGMA BCOM_STD_PRAGMA | ||
154 | #define BCOM_GEN_TX_BD_PRAGMA BCOM_STD_PRAGMA | ||
155 | #define BCOM_GEN_LPC_PRAGMA BCOM_STD_PRAGMA | ||
156 | #define BCOM_PCI_RX_PRAGMA BCOM_PCI_PRAGMA | ||
157 | #define BCOM_PCI_TX_PRAGMA BCOM_PCI_PRAGMA | ||
158 | |||
159 | /* Initiators number */ | ||
160 | #define BCOM_INITIATOR_ALWAYS 0 | ||
161 | #define BCOM_INITIATOR_SCTMR_0 1 | ||
162 | #define BCOM_INITIATOR_SCTMR_1 2 | ||
163 | #define BCOM_INITIATOR_FEC_RX 3 | ||
164 | #define BCOM_INITIATOR_FEC_TX 4 | ||
165 | #define BCOM_INITIATOR_ATA_RX 5 | ||
166 | #define BCOM_INITIATOR_ATA_TX 6 | ||
167 | #define BCOM_INITIATOR_SCPCI_RX 7 | ||
168 | #define BCOM_INITIATOR_SCPCI_TX 8 | ||
169 | #define BCOM_INITIATOR_PSC3_RX 9 | ||
170 | #define BCOM_INITIATOR_PSC3_TX 10 | ||
171 | #define BCOM_INITIATOR_PSC2_RX 11 | ||
172 | #define BCOM_INITIATOR_PSC2_TX 12 | ||
173 | #define BCOM_INITIATOR_PSC1_RX 13 | ||
174 | #define BCOM_INITIATOR_PSC1_TX 14 | ||
175 | #define BCOM_INITIATOR_SCTMR_2 15 | ||
176 | #define BCOM_INITIATOR_SCLPC 16 | ||
177 | #define BCOM_INITIATOR_PSC5_RX 17 | ||
178 | #define BCOM_INITIATOR_PSC5_TX 18 | ||
179 | #define BCOM_INITIATOR_PSC4_RX 19 | ||
180 | #define BCOM_INITIATOR_PSC4_TX 20 | ||
181 | #define BCOM_INITIATOR_I2C2_RX 21 | ||
182 | #define BCOM_INITIATOR_I2C2_TX 22 | ||
183 | #define BCOM_INITIATOR_I2C1_RX 23 | ||
184 | #define BCOM_INITIATOR_I2C1_TX 24 | ||
185 | #define BCOM_INITIATOR_PSC6_RX 25 | ||
186 | #define BCOM_INITIATOR_PSC6_TX 26 | ||
187 | #define BCOM_INITIATOR_IRDA_RX 25 | ||
188 | #define BCOM_INITIATOR_IRDA_TX 26 | ||
189 | #define BCOM_INITIATOR_SCTMR_3 27 | ||
190 | #define BCOM_INITIATOR_SCTMR_4 28 | ||
191 | #define BCOM_INITIATOR_SCTMR_5 29 | ||
192 | #define BCOM_INITIATOR_SCTMR_6 30 | ||
193 | #define BCOM_INITIATOR_SCTMR_7 31 | ||
194 | |||
195 | /* Initiators priorities */ | ||
196 | #define BCOM_IPR_ALWAYS 7 | ||
197 | #define BCOM_IPR_SCTMR_0 2 | ||
198 | #define BCOM_IPR_SCTMR_1 2 | ||
199 | #define BCOM_IPR_FEC_RX 6 | ||
200 | #define BCOM_IPR_FEC_TX 5 | ||
201 | #define BCOM_IPR_ATA_RX 7 | ||
202 | #define BCOM_IPR_ATA_TX 7 | ||
203 | #define BCOM_IPR_SCPCI_RX 2 | ||
204 | #define BCOM_IPR_SCPCI_TX 2 | ||
205 | #define BCOM_IPR_PSC3_RX 2 | ||
206 | #define BCOM_IPR_PSC3_TX 2 | ||
207 | #define BCOM_IPR_PSC2_RX 2 | ||
208 | #define BCOM_IPR_PSC2_TX 2 | ||
209 | #define BCOM_IPR_PSC1_RX 2 | ||
210 | #define BCOM_IPR_PSC1_TX 2 | ||
211 | #define BCOM_IPR_SCTMR_2 2 | ||
212 | #define BCOM_IPR_SCLPC 2 | ||
213 | #define BCOM_IPR_PSC5_RX 2 | ||
214 | #define BCOM_IPR_PSC5_TX 2 | ||
215 | #define BCOM_IPR_PSC4_RX 2 | ||
216 | #define BCOM_IPR_PSC4_TX 2 | ||
217 | #define BCOM_IPR_I2C2_RX 2 | ||
218 | #define BCOM_IPR_I2C2_TX 2 | ||
219 | #define BCOM_IPR_I2C1_RX 2 | ||
220 | #define BCOM_IPR_I2C1_TX 2 | ||
221 | #define BCOM_IPR_PSC6_RX 2 | ||
222 | #define BCOM_IPR_PSC6_TX 2 | ||
223 | #define BCOM_IPR_IRDA_RX 2 | ||
224 | #define BCOM_IPR_IRDA_TX 2 | ||
225 | #define BCOM_IPR_SCTMR_3 2 | ||
226 | #define BCOM_IPR_SCTMR_4 2 | ||
227 | #define BCOM_IPR_SCTMR_5 2 | ||
228 | #define BCOM_IPR_SCTMR_6 2 | ||
229 | #define BCOM_IPR_SCTMR_7 2 | ||
230 | |||
231 | |||
232 | /* ======================================================================== */ | ||
233 | /* API */ | ||
234 | /* ======================================================================== */ | ||
235 | |||
236 | extern struct bcom_task *bcom_task_alloc(int bd_count, int bd_size, int priv_size); | ||
237 | extern void bcom_task_free(struct bcom_task *tsk); | ||
238 | extern int bcom_load_image(int task, u32 *task_image); | ||
239 | extern void bcom_set_initiator(int task, int initiator); | ||
240 | |||
241 | |||
242 | #define TASK_ENABLE 0x8000 | ||
243 | |||
244 | /** | ||
245 | * bcom_disable_prefetch - Hook to disable bus prefetching | ||
246 | * | ||
247 | * ATA DMA and the original MPC5200 need this due to silicon bugs. At the | ||
248 | * moment disabling prefetch is a one-way street. There is no mechanism | ||
249 | * in place to turn prefetch back on after it has been disabled. There is | ||
250 | * no reason it couldn't be done, it would just be more complex to implement. | ||
251 | */ | ||
252 | static inline void bcom_disable_prefetch(void) | ||
253 | { | ||
254 | u16 regval; | ||
255 | |||
256 | regval = in_be16(&bcom_eng->regs->PtdCntrl); | ||
257 | out_be16(&bcom_eng->regs->PtdCntrl, regval | 1); | ||
258 | }; | ||
259 | |||
260 | static inline void | ||
261 | bcom_enable_task(int task) | ||
262 | { | ||
263 | u16 reg; | ||
264 | reg = in_be16(&bcom_eng->regs->tcr[task]); | ||
265 | out_be16(&bcom_eng->regs->tcr[task], reg | TASK_ENABLE); | ||
266 | } | ||
267 | |||
268 | static inline void | ||
269 | bcom_disable_task(int task) | ||
270 | { | ||
271 | u16 reg = in_be16(&bcom_eng->regs->tcr[task]); | ||
272 | out_be16(&bcom_eng->regs->tcr[task], reg & ~TASK_ENABLE); | ||
273 | } | ||
274 | |||
275 | |||
276 | static inline u32 * | ||
277 | bcom_task_desc(int task) | ||
278 | { | ||
279 | return bcom_sram_pa2va(bcom_eng->tdt[task].start); | ||
280 | } | ||
281 | |||
282 | static inline int | ||
283 | bcom_task_num_descs(int task) | ||
284 | { | ||
285 | return (bcom_eng->tdt[task].stop - bcom_eng->tdt[task].start)/sizeof(u32) + 1; | ||
286 | } | ||
287 | |||
288 | static inline u32 * | ||
289 | bcom_task_var(int task) | ||
290 | { | ||
291 | return bcom_sram_pa2va(bcom_eng->tdt[task].var); | ||
292 | } | ||
293 | |||
294 | static inline u32 * | ||
295 | bcom_task_inc(int task) | ||
296 | { | ||
297 | return &bcom_task_var(task)[BCOM_MAX_VAR]; | ||
298 | } | ||
299 | |||
300 | |||
301 | static inline int | ||
302 | bcom_drd_is_extended(u32 desc) | ||
303 | { | ||
304 | return (desc) & BCOM_DRD_EXTENDED; | ||
305 | } | ||
306 | |||
307 | static inline int | ||
308 | bcom_desc_is_drd(u32 desc) | ||
309 | { | ||
310 | return !(desc & BCOM_LCD_MASK) && desc != BCOM_DESC_NOP; | ||
311 | } | ||
312 | |||
313 | static inline int | ||
314 | bcom_desc_initiator(u32 desc) | ||
315 | { | ||
316 | return (desc >> BCOM_DRD_INITIATOR_SHIFT) & 0x1f; | ||
317 | } | ||
318 | |||
319 | static inline void | ||
320 | bcom_set_desc_initiator(u32 *desc, int initiator) | ||
321 | { | ||
322 | *desc = (*desc & ~(0x1f << BCOM_DRD_INITIATOR_SHIFT)) | | ||
323 | ((initiator & 0x1f) << BCOM_DRD_INITIATOR_SHIFT); | ||
324 | } | ||
325 | |||
326 | |||
327 | static inline void | ||
328 | bcom_set_task_pragma(int task, int pragma) | ||
329 | { | ||
330 | u32 *fdt = &bcom_eng->tdt[task].fdt; | ||
331 | *fdt = (*fdt & ~0xff) | pragma; | ||
332 | } | ||
333 | |||
334 | static inline void | ||
335 | bcom_set_task_auto_start(int task, int next_task) | ||
336 | { | ||
337 | u16 __iomem *tcr = &bcom_eng->regs->tcr[task]; | ||
338 | out_be16(tcr, (in_be16(tcr) & ~0xff) | 0x00c0 | next_task); | ||
339 | } | ||
340 | |||
341 | static inline void | ||
342 | bcom_set_tcr_initiator(int task, int initiator) | ||
343 | { | ||
344 | u16 __iomem *tcr = &bcom_eng->regs->tcr[task]; | ||
345 | out_be16(tcr, (in_be16(tcr) & ~0x1f00) | ((initiator & 0x1f) << 8)); | ||
346 | } | ||
347 | |||
348 | |||
349 | #endif /* __BESTCOMM_PRIV_H__ */ | ||
350 | |||
diff --git a/include/linux/fsl/bestcomm/fec.h b/include/linux/fsl/bestcomm/fec.h new file mode 100644 index 000000000000..ee565d94d503 --- /dev/null +++ b/include/linux/fsl/bestcomm/fec.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Header for Bestcomm FEC tasks driver | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2006-2007 Sylvain Munaut <tnt@246tNt.com> | ||
6 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
7 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public License | ||
10 | * version 2. This program is licensed "as is" without any warranty of any | ||
11 | * kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __BESTCOMM_FEC_H__ | ||
15 | #define __BESTCOMM_FEC_H__ | ||
16 | |||
17 | |||
18 | struct bcom_fec_bd { | ||
19 | u32 status; | ||
20 | u32 skb_pa; | ||
21 | }; | ||
22 | |||
23 | #define BCOM_FEC_TX_BD_TFD 0x08000000ul /* transmit frame done */ | ||
24 | #define BCOM_FEC_TX_BD_TC 0x04000000ul /* transmit CRC */ | ||
25 | #define BCOM_FEC_TX_BD_ABC 0x02000000ul /* append bad CRC */ | ||
26 | |||
27 | #define BCOM_FEC_RX_BD_L 0x08000000ul /* buffer is last in frame */ | ||
28 | #define BCOM_FEC_RX_BD_BC 0x00800000ul /* DA is broadcast */ | ||
29 | #define BCOM_FEC_RX_BD_MC 0x00400000ul /* DA is multicast and not broadcast */ | ||
30 | #define BCOM_FEC_RX_BD_LG 0x00200000ul /* Rx frame length violation */ | ||
31 | #define BCOM_FEC_RX_BD_NO 0x00100000ul /* Rx non-octet aligned frame */ | ||
32 | #define BCOM_FEC_RX_BD_CR 0x00040000ul /* Rx CRC error */ | ||
33 | #define BCOM_FEC_RX_BD_OV 0x00020000ul /* overrun */ | ||
34 | #define BCOM_FEC_RX_BD_TR 0x00010000ul /* Rx frame truncated */ | ||
35 | #define BCOM_FEC_RX_BD_LEN_MASK 0x000007fful /* mask for length of received frame */ | ||
36 | #define BCOM_FEC_RX_BD_ERRORS (BCOM_FEC_RX_BD_LG | BCOM_FEC_RX_BD_NO | \ | ||
37 | BCOM_FEC_RX_BD_CR | BCOM_FEC_RX_BD_OV | BCOM_FEC_RX_BD_TR) | ||
38 | |||
39 | |||
40 | extern struct bcom_task * | ||
41 | bcom_fec_rx_init(int queue_len, phys_addr_t fifo, int maxbufsize); | ||
42 | |||
43 | extern int | ||
44 | bcom_fec_rx_reset(struct bcom_task *tsk); | ||
45 | |||
46 | extern void | ||
47 | bcom_fec_rx_release(struct bcom_task *tsk); | ||
48 | |||
49 | |||
50 | extern struct bcom_task * | ||
51 | bcom_fec_tx_init(int queue_len, phys_addr_t fifo); | ||
52 | |||
53 | extern int | ||
54 | bcom_fec_tx_reset(struct bcom_task *tsk); | ||
55 | |||
56 | extern void | ||
57 | bcom_fec_tx_release(struct bcom_task *tsk); | ||
58 | |||
59 | |||
60 | #endif /* __BESTCOMM_FEC_H__ */ | ||
61 | |||
diff --git a/include/linux/fsl/bestcomm/gen_bd.h b/include/linux/fsl/bestcomm/gen_bd.h new file mode 100644 index 000000000000..de47260e69da --- /dev/null +++ b/include/linux/fsl/bestcomm/gen_bd.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Header for Bestcomm General Buffer Descriptor tasks driver | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2007 Sylvain Munaut <tnt@246tNt.com> | ||
6 | * Copyright (C) 2006 AppSpec Computer Technologies Corp. | ||
7 | * Jeff Gibbons <jeff.gibbons@appspec.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | * | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __BESTCOMM_GEN_BD_H__ | ||
17 | #define __BESTCOMM_GEN_BD_H__ | ||
18 | |||
19 | struct bcom_gen_bd { | ||
20 | u32 status; | ||
21 | u32 buf_pa; | ||
22 | }; | ||
23 | |||
24 | |||
25 | extern struct bcom_task * | ||
26 | bcom_gen_bd_rx_init(int queue_len, phys_addr_t fifo, | ||
27 | int initiator, int ipr, int maxbufsize); | ||
28 | |||
29 | extern int | ||
30 | bcom_gen_bd_rx_reset(struct bcom_task *tsk); | ||
31 | |||
32 | extern void | ||
33 | bcom_gen_bd_rx_release(struct bcom_task *tsk); | ||
34 | |||
35 | |||
36 | extern struct bcom_task * | ||
37 | bcom_gen_bd_tx_init(int queue_len, phys_addr_t fifo, | ||
38 | int initiator, int ipr); | ||
39 | |||
40 | extern int | ||
41 | bcom_gen_bd_tx_reset(struct bcom_task *tsk); | ||
42 | |||
43 | extern void | ||
44 | bcom_gen_bd_tx_release(struct bcom_task *tsk); | ||
45 | |||
46 | |||
47 | /* PSC support utility wrappers */ | ||
48 | struct bcom_task * bcom_psc_gen_bd_rx_init(unsigned psc_num, int queue_len, | ||
49 | phys_addr_t fifo, int maxbufsize); | ||
50 | struct bcom_task * bcom_psc_gen_bd_tx_init(unsigned psc_num, int queue_len, | ||
51 | phys_addr_t fifo); | ||
52 | #endif /* __BESTCOMM_GEN_BD_H__ */ | ||
53 | |||
diff --git a/include/linux/fsl/bestcomm/sram.h b/include/linux/fsl/bestcomm/sram.h new file mode 100644 index 000000000000..b6d668963cce --- /dev/null +++ b/include/linux/fsl/bestcomm/sram.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Handling of a sram zone for bestcomm | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2007 Sylvain Munaut <tnt@246tNt.com> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef __BESTCOMM_SRAM_H__ | ||
13 | #define __BESTCOMM_SRAM_H__ | ||
14 | |||
15 | #include <asm/rheap.h> | ||
16 | #include <asm/mmu.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | |||
19 | |||
20 | /* Structure used internally */ | ||
21 | /* The internals are here for the inline functions | ||
22 | * sake, certainly not for the user to mess with ! | ||
23 | */ | ||
24 | struct bcom_sram { | ||
25 | phys_addr_t base_phys; | ||
26 | void *base_virt; | ||
27 | unsigned int size; | ||
28 | rh_info_t *rh; | ||
29 | spinlock_t lock; | ||
30 | }; | ||
31 | |||
32 | extern struct bcom_sram *bcom_sram; | ||
33 | |||
34 | |||
35 | /* Public API */ | ||
36 | extern int bcom_sram_init(struct device_node *sram_node, char *owner); | ||
37 | extern void bcom_sram_cleanup(void); | ||
38 | |||
39 | extern void* bcom_sram_alloc(int size, int align, phys_addr_t *phys); | ||
40 | extern void bcom_sram_free(void *ptr); | ||
41 | |||
42 | static inline phys_addr_t bcom_sram_va2pa(void *va) { | ||
43 | return bcom_sram->base_phys + | ||
44 | (unsigned long)(va - bcom_sram->base_virt); | ||
45 | } | ||
46 | |||
47 | static inline void *bcom_sram_pa2va(phys_addr_t pa) { | ||
48 | return bcom_sram->base_virt + | ||
49 | (unsigned long)(pa - bcom_sram->base_phys); | ||
50 | } | ||
51 | |||
52 | |||
53 | #endif /* __BESTCOMM_SRAM_H__ */ | ||
54 | |||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 79b8bba19363..9f3c275e053e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -231,6 +231,12 @@ static inline void part_pack_uuid(const u8 *uuid_str, u8 *to) | |||
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
235 | { | ||
236 | part_pack_uuid(uuid_str, to); | ||
237 | return 0; | ||
238 | } | ||
239 | |||
234 | static inline int disk_max_parts(struct gendisk *disk) | 240 | static inline int disk_max_parts(struct gendisk *disk) |
235 | { | 241 | { |
236 | if (disk->flags & GENHD_FL_EXT_DEVT) | 242 | if (disk->flags & GENHD_FL_EXT_DEVT) |
@@ -718,6 +724,10 @@ static inline dev_t blk_lookup_devt(const char *name, int partno) | |||
718 | return devt; | 724 | return devt; |
719 | } | 725 | } |
720 | 726 | ||
727 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
728 | { | ||
729 | return -EINVAL; | ||
730 | } | ||
721 | #endif /* CONFIG_BLOCK */ | 731 | #endif /* CONFIG_BLOCK */ |
722 | 732 | ||
723 | #endif /* _LINUX_GENHD_H */ | 733 | #endif /* _LINUX_GENHD_H */ |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index bfe665621536..f6c7ae3e223b 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -94,24 +94,12 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
94 | return -ENOSYS; | 94 | return -ENOSYS; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline int devm_gpio_request(struct device *dev, unsigned gpio, | ||
98 | const char *label) | ||
99 | { | ||
100 | return -ENOSYS; | ||
101 | } | ||
102 | |||
103 | static inline int gpio_request_one(unsigned gpio, | 97 | static inline int gpio_request_one(unsigned gpio, |
104 | unsigned long flags, const char *label) | 98 | unsigned long flags, const char *label) |
105 | { | 99 | { |
106 | return -ENOSYS; | 100 | return -ENOSYS; |
107 | } | 101 | } |
108 | 102 | ||
109 | static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
110 | unsigned long flags, const char *label) | ||
111 | { | ||
112 | return -ENOSYS; | ||
113 | } | ||
114 | |||
115 | static inline int gpio_request_array(const struct gpio *array, size_t num) | 103 | static inline int gpio_request_array(const struct gpio *array, size_t num) |
116 | { | 104 | { |
117 | return -ENOSYS; | 105 | return -ENOSYS; |
@@ -125,14 +113,6 @@ static inline void gpio_free(unsigned gpio) | |||
125 | WARN_ON(1); | 113 | WARN_ON(1); |
126 | } | 114 | } |
127 | 115 | ||
128 | static inline void devm_gpio_free(struct device *dev, unsigned gpio) | ||
129 | { | ||
130 | might_sleep(); | ||
131 | |||
132 | /* GPIO can never have been requested */ | ||
133 | WARN_ON(1); | ||
134 | } | ||
135 | |||
136 | static inline void gpio_free_array(const struct gpio *array, size_t num) | 116 | static inline void gpio_free_array(const struct gpio *array, size_t num) |
137 | { | 117 | { |
138 | might_sleep(); | 118 | might_sleep(); |
@@ -248,4 +228,12 @@ gpiochip_remove_pin_ranges(struct gpio_chip *chip) | |||
248 | 228 | ||
249 | #endif /* ! CONFIG_GENERIC_GPIO */ | 229 | #endif /* ! CONFIG_GENERIC_GPIO */ |
250 | 230 | ||
231 | struct device; | ||
232 | |||
233 | /* bindings for managed devices that want to request gpios */ | ||
234 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
235 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
236 | unsigned long flags, const char *label); | ||
237 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
238 | |||
251 | #endif /* __LINUX_GPIO_H */ | 239 | #endif /* __LINUX_GPIO_H */ |
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h new file mode 100644 index 000000000000..3b589440ecfe --- /dev/null +++ b/include/linux/hdmi.h | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Avionic Design GmbH | ||
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_HDMI_H_ | ||
10 | #define __LINUX_HDMI_H_ | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | enum hdmi_infoframe_type { | ||
15 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, | ||
16 | HDMI_INFOFRAME_TYPE_AVI = 0x82, | ||
17 | HDMI_INFOFRAME_TYPE_SPD = 0x83, | ||
18 | HDMI_INFOFRAME_TYPE_AUDIO = 0x84, | ||
19 | }; | ||
20 | |||
21 | #define HDMI_INFOFRAME_HEADER_SIZE 4 | ||
22 | #define HDMI_AVI_INFOFRAME_SIZE 13 | ||
23 | #define HDMI_SPD_INFOFRAME_SIZE 25 | ||
24 | #define HDMI_AUDIO_INFOFRAME_SIZE 10 | ||
25 | |||
26 | enum hdmi_colorspace { | ||
27 | HDMI_COLORSPACE_RGB, | ||
28 | HDMI_COLORSPACE_YUV422, | ||
29 | HDMI_COLORSPACE_YUV444, | ||
30 | }; | ||
31 | |||
32 | enum hdmi_scan_mode { | ||
33 | HDMI_SCAN_MODE_NONE, | ||
34 | HDMI_SCAN_MODE_OVERSCAN, | ||
35 | HDMI_SCAN_MODE_UNDERSCAN, | ||
36 | }; | ||
37 | |||
38 | enum hdmi_colorimetry { | ||
39 | HDMI_COLORIMETRY_NONE, | ||
40 | HDMI_COLORIMETRY_ITU_601, | ||
41 | HDMI_COLORIMETRY_ITU_709, | ||
42 | HDMI_COLORIMETRY_EXTENDED, | ||
43 | }; | ||
44 | |||
45 | enum hdmi_picture_aspect { | ||
46 | HDMI_PICTURE_ASPECT_NONE, | ||
47 | HDMI_PICTURE_ASPECT_4_3, | ||
48 | HDMI_PICTURE_ASPECT_16_9, | ||
49 | }; | ||
50 | |||
51 | enum hdmi_active_aspect { | ||
52 | HDMI_ACTIVE_ASPECT_16_9_TOP = 2, | ||
53 | HDMI_ACTIVE_ASPECT_14_9_TOP = 3, | ||
54 | HDMI_ACTIVE_ASPECT_16_9_CENTER = 4, | ||
55 | HDMI_ACTIVE_ASPECT_PICTURE = 8, | ||
56 | HDMI_ACTIVE_ASPECT_4_3 = 9, | ||
57 | HDMI_ACTIVE_ASPECT_16_9 = 10, | ||
58 | HDMI_ACTIVE_ASPECT_14_9 = 11, | ||
59 | HDMI_ACTIVE_ASPECT_4_3_SP_14_9 = 13, | ||
60 | HDMI_ACTIVE_ASPECT_16_9_SP_14_9 = 14, | ||
61 | HDMI_ACTIVE_ASPECT_16_9_SP_4_3 = 15, | ||
62 | }; | ||
63 | |||
64 | enum hdmi_extended_colorimetry { | ||
65 | HDMI_EXTENDED_COLORIMETRY_XV_YCC_601, | ||
66 | HDMI_EXTENDED_COLORIMETRY_XV_YCC_709, | ||
67 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, | ||
68 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, | ||
69 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, | ||
70 | }; | ||
71 | |||
72 | enum hdmi_quantization_range { | ||
73 | HDMI_QUANTIZATION_RANGE_DEFAULT, | ||
74 | HDMI_QUANTIZATION_RANGE_LIMITED, | ||
75 | HDMI_QUANTIZATION_RANGE_FULL, | ||
76 | }; | ||
77 | |||
78 | /* non-uniform picture scaling */ | ||
79 | enum hdmi_nups { | ||
80 | HDMI_NUPS_UNKNOWN, | ||
81 | HDMI_NUPS_HORIZONTAL, | ||
82 | HDMI_NUPS_VERTICAL, | ||
83 | HDMI_NUPS_BOTH, | ||
84 | }; | ||
85 | |||
86 | enum hdmi_ycc_quantization_range { | ||
87 | HDMI_YCC_QUANTIZATION_RANGE_LIMITED, | ||
88 | HDMI_YCC_QUANTIZATION_RANGE_FULL, | ||
89 | }; | ||
90 | |||
91 | enum hdmi_content_type { | ||
92 | HDMI_CONTENT_TYPE_NONE, | ||
93 | HDMI_CONTENT_TYPE_PHOTO, | ||
94 | HDMI_CONTENT_TYPE_CINEMA, | ||
95 | HDMI_CONTENT_TYPE_GAME, | ||
96 | }; | ||
97 | |||
98 | struct hdmi_avi_infoframe { | ||
99 | enum hdmi_infoframe_type type; | ||
100 | unsigned char version; | ||
101 | unsigned char length; | ||
102 | enum hdmi_colorspace colorspace; | ||
103 | bool active_info_valid; | ||
104 | bool horizontal_bar_valid; | ||
105 | bool vertical_bar_valid; | ||
106 | enum hdmi_scan_mode scan_mode; | ||
107 | enum hdmi_colorimetry colorimetry; | ||
108 | enum hdmi_picture_aspect picture_aspect; | ||
109 | enum hdmi_active_aspect active_aspect; | ||
110 | bool itc; | ||
111 | enum hdmi_extended_colorimetry extended_colorimetry; | ||
112 | enum hdmi_quantization_range quantization_range; | ||
113 | enum hdmi_nups nups; | ||
114 | unsigned char video_code; | ||
115 | enum hdmi_ycc_quantization_range ycc_quantization_range; | ||
116 | enum hdmi_content_type content_type; | ||
117 | unsigned char pixel_repeat; | ||
118 | unsigned short top_bar; | ||
119 | unsigned short bottom_bar; | ||
120 | unsigned short left_bar; | ||
121 | unsigned short right_bar; | ||
122 | }; | ||
123 | |||
124 | int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); | ||
125 | ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, | ||
126 | size_t size); | ||
127 | |||
128 | enum hdmi_spd_sdi { | ||
129 | HDMI_SPD_SDI_UNKNOWN, | ||
130 | HDMI_SPD_SDI_DSTB, | ||
131 | HDMI_SPD_SDI_DVDP, | ||
132 | HDMI_SPD_SDI_DVHS, | ||
133 | HDMI_SPD_SDI_HDDVR, | ||
134 | HDMI_SPD_SDI_DVC, | ||
135 | HDMI_SPD_SDI_DSC, | ||
136 | HDMI_SPD_SDI_VCD, | ||
137 | HDMI_SPD_SDI_GAME, | ||
138 | HDMI_SPD_SDI_PC, | ||
139 | HDMI_SPD_SDI_BD, | ||
140 | HDMI_SPD_SDI_SACD, | ||
141 | HDMI_SPD_SDI_HDDVD, | ||
142 | HDMI_SPD_SDI_PMP, | ||
143 | }; | ||
144 | |||
145 | struct hdmi_spd_infoframe { | ||
146 | enum hdmi_infoframe_type type; | ||
147 | unsigned char version; | ||
148 | unsigned char length; | ||
149 | char vendor[8]; | ||
150 | char product[16]; | ||
151 | enum hdmi_spd_sdi sdi; | ||
152 | }; | ||
153 | |||
154 | int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame, | ||
155 | const char *vendor, const char *product); | ||
156 | ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer, | ||
157 | size_t size); | ||
158 | |||
159 | enum hdmi_audio_coding_type { | ||
160 | HDMI_AUDIO_CODING_TYPE_STREAM, | ||
161 | HDMI_AUDIO_CODING_TYPE_PCM, | ||
162 | HDMI_AUDIO_CODING_TYPE_AC3, | ||
163 | HDMI_AUDIO_CODING_TYPE_MPEG1, | ||
164 | HDMI_AUDIO_CODING_TYPE_MP3, | ||
165 | HDMI_AUDIO_CODING_TYPE_MPEG2, | ||
166 | HDMI_AUDIO_CODING_TYPE_AAC_LC, | ||
167 | HDMI_AUDIO_CODING_TYPE_DTS, | ||
168 | HDMI_AUDIO_CODING_TYPE_ATRAC, | ||
169 | HDMI_AUDIO_CODING_TYPE_DSD, | ||
170 | HDMI_AUDIO_CODING_TYPE_EAC3, | ||
171 | HDMI_AUDIO_CODING_TYPE_DTS_HD, | ||
172 | HDMI_AUDIO_CODING_TYPE_MLP, | ||
173 | HDMI_AUDIO_CODING_TYPE_DST, | ||
174 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, | ||
175 | }; | ||
176 | |||
177 | enum hdmi_audio_sample_size { | ||
178 | HDMI_AUDIO_SAMPLE_SIZE_STREAM, | ||
179 | HDMI_AUDIO_SAMPLE_SIZE_16, | ||
180 | HDMI_AUDIO_SAMPLE_SIZE_20, | ||
181 | HDMI_AUDIO_SAMPLE_SIZE_24, | ||
182 | }; | ||
183 | |||
184 | enum hdmi_audio_sample_frequency { | ||
185 | HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM, | ||
186 | HDMI_AUDIO_SAMPLE_FREQUENCY_32000, | ||
187 | HDMI_AUDIO_SAMPLE_FREQUENCY_44100, | ||
188 | HDMI_AUDIO_SAMPLE_FREQUENCY_48000, | ||
189 | HDMI_AUDIO_SAMPLE_FREQUENCY_88200, | ||
190 | HDMI_AUDIO_SAMPLE_FREQUENCY_96000, | ||
191 | HDMI_AUDIO_SAMPLE_FREQUENCY_176400, | ||
192 | HDMI_AUDIO_SAMPLE_FREQUENCY_192000, | ||
193 | }; | ||
194 | |||
195 | enum hdmi_audio_coding_type_ext { | ||
196 | HDMI_AUDIO_CODING_TYPE_EXT_STREAM, | ||
197 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, | ||
198 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, | ||
199 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, | ||
200 | }; | ||
201 | |||
202 | struct hdmi_audio_infoframe { | ||
203 | enum hdmi_infoframe_type type; | ||
204 | unsigned char version; | ||
205 | unsigned char length; | ||
206 | unsigned char channels; | ||
207 | enum hdmi_audio_coding_type coding_type; | ||
208 | enum hdmi_audio_sample_size sample_size; | ||
209 | enum hdmi_audio_sample_frequency sample_frequency; | ||
210 | enum hdmi_audio_coding_type_ext coding_type_ext; | ||
211 | unsigned char channel_allocation; | ||
212 | unsigned char level_shift_value; | ||
213 | bool downmix_inhibit; | ||
214 | |||
215 | }; | ||
216 | |||
217 | int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame); | ||
218 | ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, | ||
219 | void *buffer, size_t size); | ||
220 | |||
221 | struct hdmi_vendor_infoframe { | ||
222 | enum hdmi_infoframe_type type; | ||
223 | unsigned char version; | ||
224 | unsigned char length; | ||
225 | u8 data[27]; | ||
226 | }; | ||
227 | |||
228 | ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, | ||
229 | void *buffer, size_t size); | ||
230 | |||
231 | #endif /* _DRM_HDMI_H */ | ||
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 0aa5f4c42ae6..ecefb7311dd6 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
@@ -157,4 +157,42 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
157 | */ | 157 | */ |
158 | int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | 158 | int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, |
159 | u32 field_index, s32 *value); | 159 | u32 field_index, s32 *value); |
160 | |||
161 | /* hid-sensor-attributes */ | ||
162 | |||
163 | /* Common hid sensor iio structure */ | ||
164 | struct hid_sensor_common { | ||
165 | struct hid_sensor_hub_device *hsdev; | ||
166 | struct platform_device *pdev; | ||
167 | unsigned usage_id; | ||
168 | bool data_ready; | ||
169 | struct hid_sensor_hub_attribute_info poll; | ||
170 | struct hid_sensor_hub_attribute_info report_state; | ||
171 | struct hid_sensor_hub_attribute_info power_state; | ||
172 | struct hid_sensor_hub_attribute_info sensitivity; | ||
173 | }; | ||
174 | |||
175 | /*Convert from hid unit expo to regular exponent*/ | ||
176 | static inline int hid_sensor_convert_exponent(int unit_expo) | ||
177 | { | ||
178 | if (unit_expo < 0x08) | ||
179 | return unit_expo; | ||
180 | else if (unit_expo <= 0x0f) | ||
181 | return -(0x0f-unit_expo+1); | ||
182 | else | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, | ||
187 | u32 usage_id, | ||
188 | struct hid_sensor_common *st); | ||
189 | int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, | ||
190 | int val1, int val2); | ||
191 | int hid_sensor_read_raw_hyst_value(struct hid_sensor_common *st, | ||
192 | int *val1, int *val2); | ||
193 | int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, | ||
194 | int val1, int val2); | ||
195 | int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st, | ||
196 | int *val1, int *val2); | ||
197 | |||
160 | #endif | 198 | #endif |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 55f277372fed..6f24446e7669 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
@@ -66,6 +66,15 @@ | |||
66 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486 | 66 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486 |
67 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487 | 67 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487 |
68 | 68 | ||
69 | /* Time (2000a0) */ | ||
70 | #define HID_USAGE_SENSOR_TIME 0x2000a0 | ||
71 | #define HID_USAGE_SENSOR_TIME_YEAR 0x200521 | ||
72 | #define HID_USAGE_SENSOR_TIME_MONTH 0x200522 | ||
73 | #define HID_USAGE_SENSOR_TIME_DAY 0x200523 | ||
74 | #define HID_USAGE_SENSOR_TIME_HOUR 0x200525 | ||
75 | #define HID_USAGE_SENSOR_TIME_MINUTE 0x200526 | ||
76 | #define HID_USAGE_SENSOR_TIME_SECOND 0x200527 | ||
77 | |||
69 | /* Units */ | 78 | /* Units */ |
70 | #define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00 | 79 | #define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00 |
71 | #define HID_USAGE_SENSOR_UNITS_LUX 0x01 | 80 | #define HID_USAGE_SENSOR_UNITS_LUX 0x01 |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 7330a0fef0c0..e14b465b1146 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -589,6 +589,7 @@ struct hid_usage_id { | |||
589 | * @raw_event: if report in report_table, this hook is called (NULL means nop) | 589 | * @raw_event: if report in report_table, this hook is called (NULL means nop) |
590 | * @usage_table: on which events to call event (NULL means all) | 590 | * @usage_table: on which events to call event (NULL means all) |
591 | * @event: if usage in usage_table, this hook is called (NULL means nop) | 591 | * @event: if usage in usage_table, this hook is called (NULL means nop) |
592 | * @report: this hook is called after parsing a report (NULL means nop) | ||
592 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 593 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
593 | * @input_mapping: invoked on input registering before mapping an usage | 594 | * @input_mapping: invoked on input registering before mapping an usage |
594 | * @input_mapped: invoked on input registering after mapping an usage | 595 | * @input_mapped: invoked on input registering after mapping an usage |
@@ -627,6 +628,7 @@ struct hid_driver { | |||
627 | const struct hid_usage_id *usage_table; | 628 | const struct hid_usage_id *usage_table; |
628 | int (*event)(struct hid_device *hdev, struct hid_field *field, | 629 | int (*event)(struct hid_device *hdev, struct hid_field *field, |
629 | struct hid_usage *usage, __s32 value); | 630 | struct hid_usage *usage, __s32 value); |
631 | void (*report)(struct hid_device *hdev, struct hid_report *report); | ||
630 | 632 | ||
631 | __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, | 633 | __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, |
632 | unsigned int *size); | 634 | unsigned int *size); |
@@ -700,6 +702,18 @@ extern int __must_check __hid_register_driver(struct hid_driver *, | |||
700 | 702 | ||
701 | extern void hid_unregister_driver(struct hid_driver *); | 703 | extern void hid_unregister_driver(struct hid_driver *); |
702 | 704 | ||
705 | /** | ||
706 | * module_hid_driver() - Helper macro for registering a HID driver | ||
707 | * @__hid_driver: hid_driver struct | ||
708 | * | ||
709 | * Helper macro for HID drivers which do not do anything special in module | ||
710 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
711 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
712 | */ | ||
713 | #define module_hid_driver(__hid_driver) \ | ||
714 | module_driver(__hid_driver, hid_register_driver, \ | ||
715 | hid_unregister_driver) | ||
716 | |||
703 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 717 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |
704 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | 718 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); |
705 | extern int hidinput_connect(struct hid_device *hid, unsigned int force); | 719 | extern int hidinput_connect(struct hid_device *hid, unsigned int force); |
@@ -872,9 +886,6 @@ static inline int hid_hw_power(struct hid_device *hdev, int level) | |||
872 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 886 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
873 | int interrupt); | 887 | int interrupt); |
874 | 888 | ||
875 | extern int hid_generic_init(void); | ||
876 | extern void hid_generic_exit(void); | ||
877 | |||
878 | /* HID quirks API */ | 889 | /* HID quirks API */ |
879 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | 890 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); |
880 | int usbhid_quirks_init(char **quirks_param); | 891 | int usbhid_quirks_init(char **quirks_param); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index ef788b5b4a35..7fb31da45d03 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -219,12 +219,6 @@ static inline void zero_user(struct page *page, | |||
219 | zero_user_segments(page, start, start + size, 0, 0); | 219 | zero_user_segments(page, start, start + size, 0, 0); |
220 | } | 220 | } |
221 | 221 | ||
222 | static inline void __deprecated memclear_highpage_flush(struct page *page, | ||
223 | unsigned int offset, unsigned int size) | ||
224 | { | ||
225 | zero_user(page, offset, size); | ||
226 | } | ||
227 | |||
228 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE | 222 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE |
229 | 223 | ||
230 | static inline void copy_user_highpage(struct page *to, struct page *from, | 224 | static inline void copy_user_highpage(struct page *to, struct page *from, |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 1d76f8ca90f0..ee1c244a62a1 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -113,7 +113,7 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma, | |||
113 | do { \ | 113 | do { \ |
114 | pmd_t *____pmd = (__pmd); \ | 114 | pmd_t *____pmd = (__pmd); \ |
115 | anon_vma_lock_write(__anon_vma); \ | 115 | anon_vma_lock_write(__anon_vma); \ |
116 | anon_vma_unlock(__anon_vma); \ | 116 | anon_vma_unlock_write(__anon_vma); \ |
117 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | 117 | BUG_ON(pmd_trans_splitting(*____pmd) || \ |
118 | pmd_trans_huge(*____pmd)); \ | 118 | pmd_trans_huge(*____pmd)); \ |
119 | } while (0) | 119 | } while (0) |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 0c80d3f57a5b..eedc334fb6f5 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -43,9 +43,9 @@ int hugetlb_mempolicy_sysctl_handler(struct ctl_table *, int, | |||
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 45 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
46 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, | 46 | long follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
47 | struct page **, struct vm_area_struct **, | 47 | struct page **, struct vm_area_struct **, |
48 | unsigned long *, int *, int, unsigned int flags); | 48 | unsigned long *, unsigned long *, long, unsigned int); |
49 | void unmap_hugepage_range(struct vm_area_struct *, | 49 | void unmap_hugepage_range(struct vm_area_struct *, |
50 | unsigned long, unsigned long, struct page *); | 50 | unsigned long, unsigned long, struct page *); |
51 | void __unmap_hugepage_range_final(struct mmu_gather *tlb, | 51 | void __unmap_hugepage_range_final(struct mmu_gather *tlb, |
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 82b29ae6ebb0..b2514f70d591 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h | |||
@@ -20,16 +20,4 @@ struct device *hwmon_device_register(struct device *dev); | |||
20 | 20 | ||
21 | void hwmon_device_unregister(struct device *dev); | 21 | void hwmon_device_unregister(struct device *dev); |
22 | 22 | ||
23 | /* Scale user input to sensible values */ | ||
24 | static inline int SENSORS_LIMIT(long value, long low, long high) | ||
25 | { | ||
26 | if (value < low) | ||
27 | return low; | ||
28 | else if (value > high) | ||
29 | return high; | ||
30 | else | ||
31 | return value; | ||
32 | } | ||
33 | |||
34 | #endif | 23 | #endif |
35 | |||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index e73b852156b1..df77ba9a8166 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -325,14 +325,28 @@ struct hv_ring_buffer { | |||
325 | 325 | ||
326 | u32 interrupt_mask; | 326 | u32 interrupt_mask; |
327 | 327 | ||
328 | /* Pad it to PAGE_SIZE so that data starts on page boundary */ | 328 | /* |
329 | u8 reserved[4084]; | 329 | * Win8 uses some of the reserved bits to implement |
330 | 330 | * interrupt driven flow management. On the send side | |
331 | /* NOTE: | 331 | * we can request that the receiver interrupt the sender |
332 | * The interrupt_mask field is used only for channels but since our | 332 | * when the ring transitions from being full to being able |
333 | * vmbus connection also uses this data structure and its data starts | 333 | * to handle a message of size "pending_send_sz". |
334 | * here, we commented out this field. | 334 | * |
335 | * Add necessary state for this enhancement. | ||
335 | */ | 336 | */ |
337 | u32 pending_send_sz; | ||
338 | |||
339 | u32 reserved1[12]; | ||
340 | |||
341 | union { | ||
342 | struct { | ||
343 | u32 feat_pending_send_sz:1; | ||
344 | }; | ||
345 | u32 value; | ||
346 | } feature_bits; | ||
347 | |||
348 | /* Pad it to PAGE_SIZE so that data starts on page boundary */ | ||
349 | u8 reserved2[4028]; | ||
336 | 350 | ||
337 | /* | 351 | /* |
338 | * Ring data starts here + RingDataStartOffset | 352 | * Ring data starts here + RingDataStartOffset |
@@ -405,12 +419,22 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, | |||
405 | */ | 419 | */ |
406 | #define HV_DRV_VERSION "3.1" | 420 | #define HV_DRV_VERSION "3.1" |
407 | 421 | ||
408 | |||
409 | /* | 422 | /* |
410 | * A revision number of vmbus that is used for ensuring both ends on a | 423 | * VMBUS version is 32 bit entity broken up into |
411 | * partition are using compatible versions. | 424 | * two 16 bit quantities: major_number. minor_number. |
425 | * | ||
426 | * 0 . 13 (Windows Server 2008) | ||
427 | * 1 . 1 (Windows 7) | ||
428 | * 2 . 4 (Windows 8) | ||
412 | */ | 429 | */ |
413 | #define VMBUS_REVISION_NUMBER 13 | 430 | |
431 | #define VERSION_WS2008 ((0 << 16) | (13)) | ||
432 | #define VERSION_WIN7 ((1 << 16) | (1)) | ||
433 | #define VERSION_WIN8 ((2 << 16) | (4)) | ||
434 | |||
435 | #define VERSION_INVAL -1 | ||
436 | |||
437 | #define VERSION_CURRENT VERSION_WIN8 | ||
414 | 438 | ||
415 | /* Make maximum size of pipe payload of 16K */ | 439 | /* Make maximum size of pipe payload of 16K */ |
416 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384) | 440 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384) |
@@ -432,9 +456,13 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi, | |||
432 | struct vmbus_channel_offer { | 456 | struct vmbus_channel_offer { |
433 | uuid_le if_type; | 457 | uuid_le if_type; |
434 | uuid_le if_instance; | 458 | uuid_le if_instance; |
435 | u64 int_latency; /* in 100ns units */ | 459 | |
436 | u32 if_revision; | 460 | /* |
437 | u32 server_ctx_size; /* in bytes */ | 461 | * These two fields are not currently used. |
462 | */ | ||
463 | u64 reserved1; | ||
464 | u64 reserved2; | ||
465 | |||
438 | u16 chn_flags; | 466 | u16 chn_flags; |
439 | u16 mmio_megabytes; /* in bytes * 1024 * 1024 */ | 467 | u16 mmio_megabytes; /* in bytes * 1024 * 1024 */ |
440 | 468 | ||
@@ -456,7 +484,11 @@ struct vmbus_channel_offer { | |||
456 | unsigned char user_def[MAX_PIPE_USER_DEFINED_BYTES]; | 484 | unsigned char user_def[MAX_PIPE_USER_DEFINED_BYTES]; |
457 | } pipe; | 485 | } pipe; |
458 | } u; | 486 | } u; |
459 | u32 padding; | 487 | /* |
488 | * The sub_channel_index is defined in win8. | ||
489 | */ | ||
490 | u16 sub_channel_index; | ||
491 | u16 reserved3; | ||
460 | } __packed; | 492 | } __packed; |
461 | 493 | ||
462 | /* Server Flags */ | 494 | /* Server Flags */ |
@@ -652,7 +684,25 @@ struct vmbus_channel_offer_channel { | |||
652 | struct vmbus_channel_offer offer; | 684 | struct vmbus_channel_offer offer; |
653 | u32 child_relid; | 685 | u32 child_relid; |
654 | u8 monitorid; | 686 | u8 monitorid; |
655 | u8 monitor_allocated; | 687 | /* |
688 | * win7 and beyond splits this field into a bit field. | ||
689 | */ | ||
690 | u8 monitor_allocated:1; | ||
691 | u8 reserved:7; | ||
692 | /* | ||
693 | * These are new fields added in win7 and later. | ||
694 | * Do not access these fields without checking the | ||
695 | * negotiated protocol. | ||
696 | * | ||
697 | * If "is_dedicated_interrupt" is set, we must not set the | ||
698 | * associated bit in the channel bitmap while sending the | ||
699 | * interrupt to the host. | ||
700 | * | ||
701 | * connection_id is to be used in signaling the host. | ||
702 | */ | ||
703 | u16 is_dedicated_interrupt:1; | ||
704 | u16 reserved1:15; | ||
705 | u32 connection_id; | ||
656 | } __packed; | 706 | } __packed; |
657 | 707 | ||
658 | /* Rescind Offer parameters */ | 708 | /* Rescind Offer parameters */ |
@@ -683,8 +733,15 @@ struct vmbus_channel_open_channel { | |||
683 | /* GPADL for the channel's ring buffer. */ | 733 | /* GPADL for the channel's ring buffer. */ |
684 | u32 ringbuffer_gpadlhandle; | 734 | u32 ringbuffer_gpadlhandle; |
685 | 735 | ||
686 | /* GPADL for the channel's server context save area. */ | 736 | /* |
687 | u32 server_contextarea_gpadlhandle; | 737 | * Starting with win8, this field will be used to specify |
738 | * the target virtual processor on which to deliver the interrupt for | ||
739 | * the host to guest communication. | ||
740 | * Prior to win8, incoming channel interrupts would only | ||
741 | * be delivered on cpu 0. Setting this value to 0 would | ||
742 | * preserve the earlier behavior. | ||
743 | */ | ||
744 | u32 target_vp; | ||
688 | 745 | ||
689 | /* | 746 | /* |
690 | * The upstream ring buffer begins at offset zero in the memory | 747 | * The upstream ring buffer begins at offset zero in the memory |
@@ -848,6 +905,27 @@ struct vmbus_close_msg { | |||
848 | struct vmbus_channel_close_channel msg; | 905 | struct vmbus_channel_close_channel msg; |
849 | }; | 906 | }; |
850 | 907 | ||
908 | /* Define connection identifier type. */ | ||
909 | union hv_connection_id { | ||
910 | u32 asu32; | ||
911 | struct { | ||
912 | u32 id:24; | ||
913 | u32 reserved:8; | ||
914 | } u; | ||
915 | }; | ||
916 | |||
917 | /* Definition of the hv_signal_event hypercall input structure. */ | ||
918 | struct hv_input_signal_event { | ||
919 | union hv_connection_id connectionid; | ||
920 | u16 flag_number; | ||
921 | u16 rsvdz; | ||
922 | }; | ||
923 | |||
924 | struct hv_input_signal_event_buffer { | ||
925 | u64 align8; | ||
926 | struct hv_input_signal_event event; | ||
927 | }; | ||
928 | |||
851 | struct vmbus_channel { | 929 | struct vmbus_channel { |
852 | struct list_head listentry; | 930 | struct list_head listentry; |
853 | 931 | ||
@@ -882,8 +960,42 @@ struct vmbus_channel { | |||
882 | 960 | ||
883 | void (*onchannel_callback)(void *context); | 961 | void (*onchannel_callback)(void *context); |
884 | void *channel_callback_context; | 962 | void *channel_callback_context; |
963 | |||
964 | /* | ||
965 | * A channel can be marked for efficient (batched) | ||
966 | * reading: | ||
967 | * If batched_reading is set to "true", we read until the | ||
968 | * channel is empty and hold off interrupts from the host | ||
969 | * during the entire read process. | ||
970 | * If batched_reading is set to "false", the client is not | ||
971 | * going to perform batched reading. | ||
972 | * | ||
973 | * By default we will enable batched reading; specific | ||
974 | * drivers that don't want this behavior can turn it off. | ||
975 | */ | ||
976 | |||
977 | bool batched_reading; | ||
978 | |||
979 | bool is_dedicated_interrupt; | ||
980 | struct hv_input_signal_event_buffer sig_buf; | ||
981 | struct hv_input_signal_event *sig_event; | ||
982 | |||
983 | /* | ||
984 | * Starting with win8, this field will be used to specify | ||
985 | * the target virtual processor on which to deliver the interrupt for | ||
986 | * the host to guest communication. | ||
987 | * Prior to win8, incoming channel interrupts would only | ||
988 | * be delivered on cpu 0. Setting this value to 0 would | ||
989 | * preserve the earlier behavior. | ||
990 | */ | ||
991 | u32 target_vp; | ||
885 | }; | 992 | }; |
886 | 993 | ||
994 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) | ||
995 | { | ||
996 | c->batched_reading = state; | ||
997 | } | ||
998 | |||
887 | void vmbus_onmessage(void *context); | 999 | void vmbus_onmessage(void *context); |
888 | 1000 | ||
889 | int vmbus_request_offers(void); | 1001 | int vmbus_request_offers(void); |
@@ -1047,6 +1159,100 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
1047 | g8, g9, ga, gb, gc, gd, ge, gf }, | 1159 | g8, g9, ga, gb, gc, gd, ge, gf }, |
1048 | 1160 | ||
1049 | /* | 1161 | /* |
1162 | * GUID definitions of various offer types - services offered to the guest. | ||
1163 | */ | ||
1164 | |||
1165 | /* | ||
1166 | * Network GUID | ||
1167 | * {f8615163-df3e-46c5-913f-f2d2f965ed0e} | ||
1168 | */ | ||
1169 | #define HV_NIC_GUID \ | ||
1170 | .guid = { \ | ||
1171 | 0x63, 0x51, 0x61, 0xf8, 0x3e, 0xdf, 0xc5, 0x46, \ | ||
1172 | 0x91, 0x3f, 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e \ | ||
1173 | } | ||
1174 | |||
1175 | /* | ||
1176 | * IDE GUID | ||
1177 | * {32412632-86cb-44a2-9b5c-50d1417354f5} | ||
1178 | */ | ||
1179 | #define HV_IDE_GUID \ | ||
1180 | .guid = { \ | ||
1181 | 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, \ | ||
1182 | 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 \ | ||
1183 | } | ||
1184 | |||
1185 | /* | ||
1186 | * SCSI GUID | ||
1187 | * {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} | ||
1188 | */ | ||
1189 | #define HV_SCSI_GUID \ | ||
1190 | .guid = { \ | ||
1191 | 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, \ | ||
1192 | 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f \ | ||
1193 | } | ||
1194 | |||
1195 | /* | ||
1196 | * Shutdown GUID | ||
1197 | * {0e0b6031-5213-4934-818b-38d90ced39db} | ||
1198 | */ | ||
1199 | #define HV_SHUTDOWN_GUID \ | ||
1200 | .guid = { \ | ||
1201 | 0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49, \ | ||
1202 | 0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb \ | ||
1203 | } | ||
1204 | |||
1205 | /* | ||
1206 | * Time Synch GUID | ||
1207 | * {9527E630-D0AE-497b-ADCE-E80AB0175CAF} | ||
1208 | */ | ||
1209 | #define HV_TS_GUID \ | ||
1210 | .guid = { \ | ||
1211 | 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, \ | ||
1212 | 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf \ | ||
1213 | } | ||
1214 | |||
1215 | /* | ||
1216 | * Heartbeat GUID | ||
1217 | * {57164f39-9115-4e78-ab55-382f3bd5422d} | ||
1218 | */ | ||
1219 | #define HV_HEART_BEAT_GUID \ | ||
1220 | .guid = { \ | ||
1221 | 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, \ | ||
1222 | 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d \ | ||
1223 | } | ||
1224 | |||
1225 | /* | ||
1226 | * KVP GUID | ||
1227 | * {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6} | ||
1228 | */ | ||
1229 | #define HV_KVP_GUID \ | ||
1230 | .guid = { \ | ||
1231 | 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, \ | ||
1232 | 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 \ | ||
1233 | } | ||
1234 | |||
1235 | /* | ||
1236 | * Dynamic memory GUID | ||
1237 | * {525074dc-8985-46e2-8057-a307dc18a502} | ||
1238 | */ | ||
1239 | #define HV_DM_GUID \ | ||
1240 | .guid = { \ | ||
1241 | 0xdc, 0x74, 0x50, 0X52, 0x85, 0x89, 0xe2, 0x46, \ | ||
1242 | 0x80, 0x57, 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02 \ | ||
1243 | } | ||
1244 | |||
1245 | /* | ||
1246 | * Mouse GUID | ||
1247 | * {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a} | ||
1248 | */ | ||
1249 | #define HV_MOUSE_GUID \ | ||
1250 | .guid = { \ | ||
1251 | 0x9e, 0xb6, 0xa8, 0xcf, 0x4a, 0x5b, 0xc0, 0x4c, \ | ||
1252 | 0xb9, 0x8b, 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a \ | ||
1253 | } | ||
1254 | |||
1255 | /* | ||
1050 | * Common header for Hyper-V ICs | 1256 | * Common header for Hyper-V ICs |
1051 | */ | 1257 | */ |
1052 | 1258 | ||
@@ -1150,5 +1356,11 @@ int hv_kvp_init(struct hv_util_service *); | |||
1150 | void hv_kvp_deinit(void); | 1356 | void hv_kvp_deinit(void); |
1151 | void hv_kvp_onchannelcallback(void *); | 1357 | void hv_kvp_onchannelcallback(void *); |
1152 | 1358 | ||
1359 | /* | ||
1360 | * Negotiated version with the Host. | ||
1361 | */ | ||
1362 | |||
1363 | extern __u32 vmbus_proto_version; | ||
1364 | |||
1153 | #endif /* __KERNEL__ */ | 1365 | #endif /* __KERNEL__ */ |
1154 | #endif /* _HYPERV_H */ | 1366 | #endif /* _HYPERV_H */ |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 1ff54b114efc..488debbef895 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -39,51 +39,55 @@ | |||
39 | * address each module uses within a given i2c slave. | 39 | * address each module uses within a given i2c slave. |
40 | */ | 40 | */ |
41 | 41 | ||
42 | /* Module IDs for similar functionalities found in twl4030/twl6030 */ | ||
43 | enum twl_module_ids { | ||
44 | TWL_MODULE_USB, | ||
45 | TWL_MODULE_PIH, | ||
46 | TWL_MODULE_MAIN_CHARGE, | ||
47 | TWL_MODULE_PM_MASTER, | ||
48 | TWL_MODULE_PM_RECEIVER, | ||
49 | |||
50 | TWL_MODULE_RTC, | ||
51 | TWL_MODULE_PWM, | ||
52 | TWL_MODULE_LED, | ||
53 | TWL_MODULE_SECURED_REG, | ||
54 | |||
55 | TWL_MODULE_LAST, | ||
56 | }; | ||
57 | |||
58 | /* Modules only available in twl4030 series */ | ||
42 | enum twl4030_module_ids { | 59 | enum twl4030_module_ids { |
43 | TWL4030_MODULE_USB = 0, /* Slave 0 (i2c address 0x48) */ | 60 | TWL4030_MODULE_AUDIO_VOICE = TWL_MODULE_LAST, |
44 | TWL4030_MODULE_AUDIO_VOICE, /* Slave 1 (i2c address 0x49) */ | ||
45 | TWL4030_MODULE_GPIO, | 61 | TWL4030_MODULE_GPIO, |
46 | TWL4030_MODULE_INTBR, | 62 | TWL4030_MODULE_INTBR, |
47 | TWL4030_MODULE_PIH, | ||
48 | |||
49 | TWL4030_MODULE_TEST, | 63 | TWL4030_MODULE_TEST, |
50 | TWL4030_MODULE_KEYPAD, /* Slave 2 (i2c address 0x4a) */ | 64 | TWL4030_MODULE_KEYPAD, |
65 | |||
51 | TWL4030_MODULE_MADC, | 66 | TWL4030_MODULE_MADC, |
52 | TWL4030_MODULE_INTERRUPTS, | 67 | TWL4030_MODULE_INTERRUPTS, |
53 | TWL4030_MODULE_LED, | ||
54 | |||
55 | TWL4030_MODULE_MAIN_CHARGE, | ||
56 | TWL4030_MODULE_PRECHARGE, | 68 | TWL4030_MODULE_PRECHARGE, |
57 | TWL4030_MODULE_PWM0, | 69 | TWL4030_MODULE_BACKUP, |
58 | TWL4030_MODULE_PWM1, | 70 | TWL4030_MODULE_INT, |
59 | TWL4030_MODULE_PWMA, | ||
60 | 71 | ||
61 | TWL4030_MODULE_PWMB, | ||
62 | TWL5031_MODULE_ACCESSORY, | 72 | TWL5031_MODULE_ACCESSORY, |
63 | TWL5031_MODULE_INTERRUPTS, | 73 | TWL5031_MODULE_INTERRUPTS, |
64 | TWL4030_MODULE_BACKUP, /* Slave 3 (i2c address 0x4b) */ | ||
65 | TWL4030_MODULE_INT, | ||
66 | 74 | ||
67 | TWL4030_MODULE_PM_MASTER, | ||
68 | TWL4030_MODULE_PM_RECEIVER, | ||
69 | TWL4030_MODULE_RTC, | ||
70 | TWL4030_MODULE_SECURED_REG, | ||
71 | TWL4030_MODULE_LAST, | 75 | TWL4030_MODULE_LAST, |
72 | }; | 76 | }; |
73 | 77 | ||
74 | /* Similar functionalities implemented in TWL4030/6030 */ | 78 | /* Modules only available in twl6030 series */ |
75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | 79 | enum twl6030_module_ids { |
76 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | 80 | TWL6030_MODULE_ID0 = TWL_MODULE_LAST, |
77 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | 81 | TWL6030_MODULE_ID1, |
78 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | 82 | TWL6030_MODULE_ID2, |
79 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | 83 | TWL6030_MODULE_GPADC, |
80 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 84 | TWL6030_MODULE_GASGAUGE, |
81 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | 85 | |
82 | #define TWL_MODULE_LED TWL4030_MODULE_LED | 86 | TWL6030_MODULE_LAST, |
87 | }; | ||
83 | 88 | ||
84 | #define TWL6030_MODULE_ID0 13 | 89 | /* Until the clients has been converted to use TWL_MODULE_LED */ |
85 | #define TWL6030_MODULE_ID1 14 | 90 | #define TWL4030_MODULE_LED TWL_MODULE_LED |
86 | #define TWL6030_MODULE_ID2 15 | ||
87 | 91 | ||
88 | #define GPIO_INTR_OFFSET 0 | 92 | #define GPIO_INTR_OFFSET 0 |
89 | #define KEYPAD_INTR_OFFSET 1 | 93 | #define KEYPAD_INTR_OFFSET 1 |
@@ -171,20 +175,22 @@ TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | |||
171 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 175 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
172 | 176 | ||
173 | /* | 177 | /* |
174 | * Read and write single 8-bit registers | ||
175 | */ | ||
176 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | ||
177 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | ||
178 | |||
179 | /* | ||
180 | * Read and write several 8-bit registers at once. | 178 | * Read and write several 8-bit registers at once. |
181 | * | ||
182 | * IMPORTANT: For twl_i2c_write(), allocate num_bytes + 1 | ||
183 | * for the value, and populate your data starting at offset 1. | ||
184 | */ | 179 | */ |
185 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 180 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
186 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 181 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
187 | 182 | ||
183 | /* | ||
184 | * Read and write single 8-bit registers | ||
185 | */ | ||
186 | static inline int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg) { | ||
187 | return twl_i2c_write(mod_no, &val, reg, 1); | ||
188 | } | ||
189 | |||
190 | static inline int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg) { | ||
191 | return twl_i2c_read(mod_no, val, reg, 1); | ||
192 | } | ||
193 | |||
188 | int twl_get_type(void); | 194 | int twl_get_type(void); |
189 | int twl_get_version(void); | 195 | int twl_get_version(void); |
190 | int twl_get_hfclk_rate(void); | 196 | int twl_get_hfclk_rate(void); |
diff --git a/include/linux/idr.h b/include/linux/idr.h index de7e190f1af4..e5eb125effe6 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -136,7 +136,7 @@ struct ida { | |||
136 | struct ida_bitmap *free_bitmap; | 136 | struct ida_bitmap *free_bitmap; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | #define IDA_INIT(name) { .idr = IDR_INIT(name), .free_bitmap = NULL, } | 139 | #define IDA_INIT(name) { .idr = IDR_INIT((name).idr), .free_bitmap = NULL, } |
140 | #define DEFINE_IDA(name) struct ida name = IDA_INIT(name) | 140 | #define DEFINE_IDA(name) struct ida name = IDA_INIT(name) |
141 | 141 | ||
142 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); | 142 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index f0859cc73861..7e24fe0cfbcd 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -151,6 +151,11 @@ | |||
151 | /* Mesh Control 802.11s */ | 151 | /* Mesh Control 802.11s */ |
152 | #define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 | 152 | #define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 |
153 | 153 | ||
154 | /* Mesh Power Save Level */ | ||
155 | #define IEEE80211_QOS_CTL_MESH_PS_LEVEL 0x0200 | ||
156 | /* Mesh Receiver Service Period Initiated */ | ||
157 | #define IEEE80211_QOS_CTL_RSPI 0x0400 | ||
158 | |||
154 | /* U-APSD queue for WMM IEs sent by AP */ | 159 | /* U-APSD queue for WMM IEs sent by AP */ |
155 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | 160 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) |
156 | #define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f | 161 | #define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f |
@@ -180,7 +185,7 @@ struct ieee80211_hdr { | |||
180 | u8 addr3[6]; | 185 | u8 addr3[6]; |
181 | __le16 seq_ctrl; | 186 | __le16 seq_ctrl; |
182 | u8 addr4[6]; | 187 | u8 addr4[6]; |
183 | } __attribute__ ((packed)); | 188 | } __packed; |
184 | 189 | ||
185 | struct ieee80211_hdr_3addr { | 190 | struct ieee80211_hdr_3addr { |
186 | __le16 frame_control; | 191 | __le16 frame_control; |
@@ -189,7 +194,7 @@ struct ieee80211_hdr_3addr { | |||
189 | u8 addr2[6]; | 194 | u8 addr2[6]; |
190 | u8 addr3[6]; | 195 | u8 addr3[6]; |
191 | __le16 seq_ctrl; | 196 | __le16 seq_ctrl; |
192 | } __attribute__ ((packed)); | 197 | } __packed; |
193 | 198 | ||
194 | struct ieee80211_qos_hdr { | 199 | struct ieee80211_qos_hdr { |
195 | __le16 frame_control; | 200 | __le16 frame_control; |
@@ -199,7 +204,7 @@ struct ieee80211_qos_hdr { | |||
199 | u8 addr3[6]; | 204 | u8 addr3[6]; |
200 | __le16 seq_ctrl; | 205 | __le16 seq_ctrl; |
201 | __le16 qos_ctrl; | 206 | __le16 qos_ctrl; |
202 | } __attribute__ ((packed)); | 207 | } __packed; |
203 | 208 | ||
204 | /** | 209 | /** |
205 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set | 210 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set |
@@ -576,7 +581,7 @@ struct ieee80211s_hdr { | |||
576 | __le32 seqnum; | 581 | __le32 seqnum; |
577 | u8 eaddr1[6]; | 582 | u8 eaddr1[6]; |
578 | u8 eaddr2[6]; | 583 | u8 eaddr2[6]; |
579 | } __attribute__ ((packed)); | 584 | } __packed; |
580 | 585 | ||
581 | /* Mesh flags */ | 586 | /* Mesh flags */ |
582 | #define MESH_FLAGS_AE_A4 0x1 | 587 | #define MESH_FLAGS_AE_A4 0x1 |
@@ -614,7 +619,7 @@ struct ieee80211_quiet_ie { | |||
614 | u8 period; | 619 | u8 period; |
615 | __le16 duration; | 620 | __le16 duration; |
616 | __le16 offset; | 621 | __le16 offset; |
617 | } __attribute__ ((packed)); | 622 | } __packed; |
618 | 623 | ||
619 | /** | 624 | /** |
620 | * struct ieee80211_msrment_ie | 625 | * struct ieee80211_msrment_ie |
@@ -626,7 +631,7 @@ struct ieee80211_msrment_ie { | |||
626 | u8 mode; | 631 | u8 mode; |
627 | u8 type; | 632 | u8 type; |
628 | u8 request[0]; | 633 | u8 request[0]; |
629 | } __attribute__ ((packed)); | 634 | } __packed; |
630 | 635 | ||
631 | /** | 636 | /** |
632 | * struct ieee80211_channel_sw_ie | 637 | * struct ieee80211_channel_sw_ie |
@@ -637,7 +642,7 @@ struct ieee80211_channel_sw_ie { | |||
637 | u8 mode; | 642 | u8 mode; |
638 | u8 new_ch_num; | 643 | u8 new_ch_num; |
639 | u8 count; | 644 | u8 count; |
640 | } __attribute__ ((packed)); | 645 | } __packed; |
641 | 646 | ||
642 | /** | 647 | /** |
643 | * struct ieee80211_tim | 648 | * struct ieee80211_tim |
@@ -650,7 +655,7 @@ struct ieee80211_tim_ie { | |||
650 | u8 bitmap_ctrl; | 655 | u8 bitmap_ctrl; |
651 | /* variable size: 1 - 251 bytes */ | 656 | /* variable size: 1 - 251 bytes */ |
652 | u8 virtual_map[1]; | 657 | u8 virtual_map[1]; |
653 | } __attribute__ ((packed)); | 658 | } __packed; |
654 | 659 | ||
655 | /** | 660 | /** |
656 | * struct ieee80211_meshconf_ie | 661 | * struct ieee80211_meshconf_ie |
@@ -665,7 +670,7 @@ struct ieee80211_meshconf_ie { | |||
665 | u8 meshconf_auth; | 670 | u8 meshconf_auth; |
666 | u8 meshconf_form; | 671 | u8 meshconf_form; |
667 | u8 meshconf_cap; | 672 | u8 meshconf_cap; |
668 | } __attribute__ ((packed)); | 673 | } __packed; |
669 | 674 | ||
670 | /** | 675 | /** |
671 | * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags | 676 | * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags |
@@ -675,11 +680,14 @@ struct ieee80211_meshconf_ie { | |||
675 | * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs | 680 | * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs |
676 | * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure | 681 | * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure |
677 | * is ongoing | 682 | * is ongoing |
683 | * @IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL: STA is in deep sleep mode or has | ||
684 | * neighbors in deep sleep mode | ||
678 | */ | 685 | */ |
679 | enum mesh_config_capab_flags { | 686 | enum mesh_config_capab_flags { |
680 | IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, | 687 | IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, |
681 | IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, | 688 | IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, |
682 | IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, | 689 | IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, |
690 | IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL = 0x40, | ||
683 | }; | 691 | }; |
684 | 692 | ||
685 | /** | 693 | /** |
@@ -695,12 +703,41 @@ struct ieee80211_rann_ie { | |||
695 | __le32 rann_seq; | 703 | __le32 rann_seq; |
696 | __le32 rann_interval; | 704 | __le32 rann_interval; |
697 | __le32 rann_metric; | 705 | __le32 rann_metric; |
698 | } __attribute__ ((packed)); | 706 | } __packed; |
699 | 707 | ||
700 | enum ieee80211_rann_flags { | 708 | enum ieee80211_rann_flags { |
701 | RANN_FLAG_IS_GATE = 1 << 0, | 709 | RANN_FLAG_IS_GATE = 1 << 0, |
702 | }; | 710 | }; |
703 | 711 | ||
712 | enum ieee80211_ht_chanwidth_values { | ||
713 | IEEE80211_HT_CHANWIDTH_20MHZ = 0, | ||
714 | IEEE80211_HT_CHANWIDTH_ANY = 1, | ||
715 | }; | ||
716 | |||
717 | /** | ||
718 | * enum ieee80211_opmode_bits - VHT operating mode field bits | ||
719 | * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK: channel width mask | ||
720 | * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ: 20 MHz channel width | ||
721 | * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ: 40 MHz channel width | ||
722 | * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ: 80 MHz channel width | ||
723 | * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ: 160 MHz or 80+80 MHz channel width | ||
724 | * @IEEE80211_OPMODE_NOTIF_RX_NSS_MASK: number of spatial streams mask | ||
725 | * (the NSS value is the value of this field + 1) | ||
726 | * @IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT: number of spatial streams shift | ||
727 | * @IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF: indicates streams in SU-MIMO PPDU | ||
728 | * using a beamforming steering matrix | ||
729 | */ | ||
730 | enum ieee80211_vht_opmode_bits { | ||
731 | IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK = 3, | ||
732 | IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ = 0, | ||
733 | IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ = 1, | ||
734 | IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ = 2, | ||
735 | IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ = 3, | ||
736 | IEEE80211_OPMODE_NOTIF_RX_NSS_MASK = 0x70, | ||
737 | IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4, | ||
738 | IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF = 0x80, | ||
739 | }; | ||
740 | |||
704 | #define WLAN_SA_QUERY_TR_ID_LEN 2 | 741 | #define WLAN_SA_QUERY_TR_ID_LEN 2 |
705 | 742 | ||
706 | struct ieee80211_mgmt { | 743 | struct ieee80211_mgmt { |
@@ -717,33 +754,33 @@ struct ieee80211_mgmt { | |||
717 | __le16 status_code; | 754 | __le16 status_code; |
718 | /* possibly followed by Challenge text */ | 755 | /* possibly followed by Challenge text */ |
719 | u8 variable[0]; | 756 | u8 variable[0]; |
720 | } __attribute__ ((packed)) auth; | 757 | } __packed auth; |
721 | struct { | 758 | struct { |
722 | __le16 reason_code; | 759 | __le16 reason_code; |
723 | } __attribute__ ((packed)) deauth; | 760 | } __packed deauth; |
724 | struct { | 761 | struct { |
725 | __le16 capab_info; | 762 | __le16 capab_info; |
726 | __le16 listen_interval; | 763 | __le16 listen_interval; |
727 | /* followed by SSID and Supported rates */ | 764 | /* followed by SSID and Supported rates */ |
728 | u8 variable[0]; | 765 | u8 variable[0]; |
729 | } __attribute__ ((packed)) assoc_req; | 766 | } __packed assoc_req; |
730 | struct { | 767 | struct { |
731 | __le16 capab_info; | 768 | __le16 capab_info; |
732 | __le16 status_code; | 769 | __le16 status_code; |
733 | __le16 aid; | 770 | __le16 aid; |
734 | /* followed by Supported rates */ | 771 | /* followed by Supported rates */ |
735 | u8 variable[0]; | 772 | u8 variable[0]; |
736 | } __attribute__ ((packed)) assoc_resp, reassoc_resp; | 773 | } __packed assoc_resp, reassoc_resp; |
737 | struct { | 774 | struct { |
738 | __le16 capab_info; | 775 | __le16 capab_info; |
739 | __le16 listen_interval; | 776 | __le16 listen_interval; |
740 | u8 current_ap[6]; | 777 | u8 current_ap[6]; |
741 | /* followed by SSID and Supported rates */ | 778 | /* followed by SSID and Supported rates */ |
742 | u8 variable[0]; | 779 | u8 variable[0]; |
743 | } __attribute__ ((packed)) reassoc_req; | 780 | } __packed reassoc_req; |
744 | struct { | 781 | struct { |
745 | __le16 reason_code; | 782 | __le16 reason_code; |
746 | } __attribute__ ((packed)) disassoc; | 783 | } __packed disassoc; |
747 | struct { | 784 | struct { |
748 | __le64 timestamp; | 785 | __le64 timestamp; |
749 | __le16 beacon_int; | 786 | __le16 beacon_int; |
@@ -751,11 +788,11 @@ struct ieee80211_mgmt { | |||
751 | /* followed by some of SSID, Supported rates, | 788 | /* followed by some of SSID, Supported rates, |
752 | * FH Params, DS Params, CF Params, IBSS Params, TIM */ | 789 | * FH Params, DS Params, CF Params, IBSS Params, TIM */ |
753 | u8 variable[0]; | 790 | u8 variable[0]; |
754 | } __attribute__ ((packed)) beacon; | 791 | } __packed beacon; |
755 | struct { | 792 | struct { |
756 | /* only variable items: SSID, Supported rates */ | 793 | /* only variable items: SSID, Supported rates */ |
757 | u8 variable[0]; | 794 | u8 variable[0]; |
758 | } __attribute__ ((packed)) probe_req; | 795 | } __packed probe_req; |
759 | struct { | 796 | struct { |
760 | __le64 timestamp; | 797 | __le64 timestamp; |
761 | __le16 beacon_int; | 798 | __le16 beacon_int; |
@@ -763,7 +800,7 @@ struct ieee80211_mgmt { | |||
763 | /* followed by some of SSID, Supported rates, | 800 | /* followed by some of SSID, Supported rates, |
764 | * FH Params, DS Params, CF Params, IBSS Params */ | 801 | * FH Params, DS Params, CF Params, IBSS Params */ |
765 | u8 variable[0]; | 802 | u8 variable[0]; |
766 | } __attribute__ ((packed)) probe_resp; | 803 | } __packed probe_resp; |
767 | struct { | 804 | struct { |
768 | u8 category; | 805 | u8 category; |
769 | union { | 806 | union { |
@@ -772,65 +809,73 @@ struct ieee80211_mgmt { | |||
772 | u8 dialog_token; | 809 | u8 dialog_token; |
773 | u8 status_code; | 810 | u8 status_code; |
774 | u8 variable[0]; | 811 | u8 variable[0]; |
775 | } __attribute__ ((packed)) wme_action; | 812 | } __packed wme_action; |
776 | struct{ | 813 | struct{ |
777 | u8 action_code; | 814 | u8 action_code; |
778 | u8 element_id; | 815 | u8 element_id; |
779 | u8 length; | 816 | u8 length; |
780 | struct ieee80211_channel_sw_ie sw_elem; | 817 | struct ieee80211_channel_sw_ie sw_elem; |
781 | } __attribute__((packed)) chan_switch; | 818 | } __packed chan_switch; |
782 | struct{ | 819 | struct{ |
783 | u8 action_code; | 820 | u8 action_code; |
784 | u8 dialog_token; | 821 | u8 dialog_token; |
785 | u8 element_id; | 822 | u8 element_id; |
786 | u8 length; | 823 | u8 length; |
787 | struct ieee80211_msrment_ie msr_elem; | 824 | struct ieee80211_msrment_ie msr_elem; |
788 | } __attribute__((packed)) measurement; | 825 | } __packed measurement; |
789 | struct{ | 826 | struct{ |
790 | u8 action_code; | 827 | u8 action_code; |
791 | u8 dialog_token; | 828 | u8 dialog_token; |
792 | __le16 capab; | 829 | __le16 capab; |
793 | __le16 timeout; | 830 | __le16 timeout; |
794 | __le16 start_seq_num; | 831 | __le16 start_seq_num; |
795 | } __attribute__((packed)) addba_req; | 832 | } __packed addba_req; |
796 | struct{ | 833 | struct{ |
797 | u8 action_code; | 834 | u8 action_code; |
798 | u8 dialog_token; | 835 | u8 dialog_token; |
799 | __le16 status; | 836 | __le16 status; |
800 | __le16 capab; | 837 | __le16 capab; |
801 | __le16 timeout; | 838 | __le16 timeout; |
802 | } __attribute__((packed)) addba_resp; | 839 | } __packed addba_resp; |
803 | struct{ | 840 | struct{ |
804 | u8 action_code; | 841 | u8 action_code; |
805 | __le16 params; | 842 | __le16 params; |
806 | __le16 reason_code; | 843 | __le16 reason_code; |
807 | } __attribute__((packed)) delba; | 844 | } __packed delba; |
808 | struct { | 845 | struct { |
809 | u8 action_code; | 846 | u8 action_code; |
810 | u8 variable[0]; | 847 | u8 variable[0]; |
811 | } __attribute__((packed)) self_prot; | 848 | } __packed self_prot; |
812 | struct{ | 849 | struct{ |
813 | u8 action_code; | 850 | u8 action_code; |
814 | u8 variable[0]; | 851 | u8 variable[0]; |
815 | } __attribute__((packed)) mesh_action; | 852 | } __packed mesh_action; |
816 | struct { | 853 | struct { |
817 | u8 action; | 854 | u8 action; |
818 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; | 855 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; |
819 | } __attribute__ ((packed)) sa_query; | 856 | } __packed sa_query; |
820 | struct { | 857 | struct { |
821 | u8 action; | 858 | u8 action; |
822 | u8 smps_control; | 859 | u8 smps_control; |
823 | } __attribute__ ((packed)) ht_smps; | 860 | } __packed ht_smps; |
861 | struct { | ||
862 | u8 action_code; | ||
863 | u8 chanwidth; | ||
864 | } __packed ht_notify_cw; | ||
824 | struct { | 865 | struct { |
825 | u8 action_code; | 866 | u8 action_code; |
826 | u8 dialog_token; | 867 | u8 dialog_token; |
827 | __le16 capability; | 868 | __le16 capability; |
828 | u8 variable[0]; | 869 | u8 variable[0]; |
829 | } __packed tdls_discover_resp; | 870 | } __packed tdls_discover_resp; |
871 | struct { | ||
872 | u8 action_code; | ||
873 | u8 operating_mode; | ||
874 | } __packed vht_opmode_notif; | ||
830 | } u; | 875 | } u; |
831 | } __attribute__ ((packed)) action; | 876 | } __packed action; |
832 | } u; | 877 | } u; |
833 | } __attribute__ ((packed)); | 878 | } __packed; |
834 | 879 | ||
835 | /* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */ | 880 | /* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */ |
836 | #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 | 881 | #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 |
@@ -846,7 +891,7 @@ struct ieee80211_mmie { | |||
846 | __le16 key_id; | 891 | __le16 key_id; |
847 | u8 sequence_number[6]; | 892 | u8 sequence_number[6]; |
848 | u8 mic[8]; | 893 | u8 mic[8]; |
849 | } __attribute__ ((packed)); | 894 | } __packed; |
850 | 895 | ||
851 | struct ieee80211_vendor_ie { | 896 | struct ieee80211_vendor_ie { |
852 | u8 element_id; | 897 | u8 element_id; |
@@ -861,20 +906,20 @@ struct ieee80211_rts { | |||
861 | __le16 duration; | 906 | __le16 duration; |
862 | u8 ra[6]; | 907 | u8 ra[6]; |
863 | u8 ta[6]; | 908 | u8 ta[6]; |
864 | } __attribute__ ((packed)); | 909 | } __packed; |
865 | 910 | ||
866 | struct ieee80211_cts { | 911 | struct ieee80211_cts { |
867 | __le16 frame_control; | 912 | __le16 frame_control; |
868 | __le16 duration; | 913 | __le16 duration; |
869 | u8 ra[6]; | 914 | u8 ra[6]; |
870 | } __attribute__ ((packed)); | 915 | } __packed; |
871 | 916 | ||
872 | struct ieee80211_pspoll { | 917 | struct ieee80211_pspoll { |
873 | __le16 frame_control; | 918 | __le16 frame_control; |
874 | __le16 aid; | 919 | __le16 aid; |
875 | u8 bssid[6]; | 920 | u8 bssid[6]; |
876 | u8 ta[6]; | 921 | u8 ta[6]; |
877 | } __attribute__ ((packed)); | 922 | } __packed; |
878 | 923 | ||
879 | /* TDLS */ | 924 | /* TDLS */ |
880 | 925 | ||
@@ -967,7 +1012,7 @@ struct ieee80211_bar { | |||
967 | __u8 ta[6]; | 1012 | __u8 ta[6]; |
968 | __le16 control; | 1013 | __le16 control; |
969 | __le16 start_seq_num; | 1014 | __le16 start_seq_num; |
970 | } __attribute__((packed)); | 1015 | } __packed; |
971 | 1016 | ||
972 | /* 802.11 BAR control masks */ | 1017 | /* 802.11 BAR control masks */ |
973 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 | 1018 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
@@ -992,7 +1037,7 @@ struct ieee80211_mcs_info { | |||
992 | __le16 rx_highest; | 1037 | __le16 rx_highest; |
993 | u8 tx_params; | 1038 | u8 tx_params; |
994 | u8 reserved[3]; | 1039 | u8 reserved[3]; |
995 | } __attribute__((packed)); | 1040 | } __packed; |
996 | 1041 | ||
997 | /* 802.11n HT capability MSC set */ | 1042 | /* 802.11n HT capability MSC set */ |
998 | #define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff | 1043 | #define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff |
@@ -1031,7 +1076,7 @@ struct ieee80211_ht_cap { | |||
1031 | __le16 extended_ht_cap_info; | 1076 | __le16 extended_ht_cap_info; |
1032 | __le32 tx_BF_cap_info; | 1077 | __le32 tx_BF_cap_info; |
1033 | u8 antenna_selection_info; | 1078 | u8 antenna_selection_info; |
1034 | } __attribute__ ((packed)); | 1079 | } __packed; |
1035 | 1080 | ||
1036 | /* 802.11n HT capabilities masks (for cap_info) */ | 1081 | /* 802.11n HT capabilities masks (for cap_info) */ |
1037 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 | 1082 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 |
@@ -1102,7 +1147,7 @@ struct ieee80211_ht_operation { | |||
1102 | __le16 operation_mode; | 1147 | __le16 operation_mode; |
1103 | __le16 stbc_param; | 1148 | __le16 stbc_param; |
1104 | u8 basic_set[16]; | 1149 | u8 basic_set[16]; |
1105 | } __attribute__ ((packed)); | 1150 | } __packed; |
1106 | 1151 | ||
1107 | /* for ht_param */ | 1152 | /* for ht_param */ |
1108 | #define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03 | 1153 | #define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03 |
@@ -1256,6 +1301,7 @@ struct ieee80211_vht_operation { | |||
1256 | #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 | 1301 | #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 |
1257 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 | 1302 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 |
1258 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 | 1303 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 |
1304 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C | ||
1259 | #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 | 1305 | #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 |
1260 | #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 | 1306 | #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 |
1261 | #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 | 1307 | #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 |
@@ -1311,16 +1357,21 @@ struct ieee80211_vht_operation { | |||
1311 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | 1357 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) |
1312 | #define WLAN_CAPABILITY_QOS (1<<9) | 1358 | #define WLAN_CAPABILITY_QOS (1<<9) |
1313 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 1359 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
1360 | #define WLAN_CAPABILITY_APSD (1<<11) | ||
1361 | #define WLAN_CAPABILITY_RADIO_MEASURE (1<<12) | ||
1314 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 1362 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
1363 | #define WLAN_CAPABILITY_DEL_BACK (1<<14) | ||
1364 | #define WLAN_CAPABILITY_IMM_BACK (1<<15) | ||
1315 | 1365 | ||
1316 | /* DMG (60gHz) 802.11ad */ | 1366 | /* DMG (60gHz) 802.11ad */ |
1317 | /* type - bits 0..1 */ | 1367 | /* type - bits 0..1 */ |
1368 | #define WLAN_CAPABILITY_DMG_TYPE_MASK (3<<0) | ||
1318 | #define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */ | 1369 | #define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */ |
1319 | #define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */ | 1370 | #define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */ |
1320 | #define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */ | 1371 | #define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */ |
1321 | 1372 | ||
1322 | #define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2) | 1373 | #define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2) |
1323 | #define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3) | 1374 | #define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3) |
1324 | #define WLAN_CAPABILITY_DMG_PRIVACY (1<<4) | 1375 | #define WLAN_CAPABILITY_DMG_PRIVACY (1<<4) |
1325 | #define WLAN_CAPABILITY_DMG_ECPAC (1<<5) | 1376 | #define WLAN_CAPABILITY_DMG_ECPAC (1<<5) |
1326 | 1377 | ||
@@ -1576,6 +1627,7 @@ enum ieee80211_eid { | |||
1576 | 1627 | ||
1577 | WLAN_EID_VHT_CAPABILITY = 191, | 1628 | WLAN_EID_VHT_CAPABILITY = 191, |
1578 | WLAN_EID_VHT_OPERATION = 192, | 1629 | WLAN_EID_VHT_OPERATION = 192, |
1630 | WLAN_EID_OPMODE_NOTIF = 199, | ||
1579 | 1631 | ||
1580 | /* 802.11ad */ | 1632 | /* 802.11ad */ |
1581 | WLAN_EID_NON_TX_BSSID_CAP = 83, | 1633 | WLAN_EID_NON_TX_BSSID_CAP = 83, |
@@ -1630,6 +1682,7 @@ enum ieee80211_category { | |||
1630 | WLAN_CATEGORY_WMM = 17, | 1682 | WLAN_CATEGORY_WMM = 17, |
1631 | WLAN_CATEGORY_FST = 18, | 1683 | WLAN_CATEGORY_FST = 18, |
1632 | WLAN_CATEGORY_UNPROT_DMG = 20, | 1684 | WLAN_CATEGORY_UNPROT_DMG = 20, |
1685 | WLAN_CATEGORY_VHT = 21, | ||
1633 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1686 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
1634 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1687 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
1635 | }; | 1688 | }; |
@@ -1655,6 +1708,13 @@ enum ieee80211_ht_actioncode { | |||
1655 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, | 1708 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, |
1656 | }; | 1709 | }; |
1657 | 1710 | ||
1711 | /* VHT action codes */ | ||
1712 | enum ieee80211_vht_actioncode { | ||
1713 | WLAN_VHT_ACTION_COMPRESSED_BF = 0, | ||
1714 | WLAN_VHT_ACTION_GROUPID_MGMT = 1, | ||
1715 | WLAN_VHT_ACTION_OPMODE_NOTIF = 2, | ||
1716 | }; | ||
1717 | |||
1658 | /* Self Protected Action codes */ | 1718 | /* Self Protected Action codes */ |
1659 | enum ieee80211_self_protected_actioncode { | 1719 | enum ieee80211_self_protected_actioncode { |
1660 | WLAN_SP_RESERVED = 0, | 1720 | WLAN_SP_RESERVED = 0, |
@@ -1716,6 +1776,8 @@ enum ieee80211_tdls_actioncode { | |||
1716 | #define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) | 1776 | #define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) |
1717 | #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) | 1777 | #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) |
1718 | 1778 | ||
1779 | #define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) | ||
1780 | |||
1719 | /* TDLS specific payload type in the LLC/SNAP header */ | 1781 | /* TDLS specific payload type in the LLC/SNAP header */ |
1720 | #define WLAN_TDLS_SNAP_RFTYPE 0x2 | 1782 | #define WLAN_TDLS_SNAP_RFTYPE 0x2 |
1721 | 1783 | ||
@@ -1834,14 +1896,14 @@ struct ieee80211_country_ie_triplet { | |||
1834 | u8 first_channel; | 1896 | u8 first_channel; |
1835 | u8 num_channels; | 1897 | u8 num_channels; |
1836 | s8 max_power; | 1898 | s8 max_power; |
1837 | } __attribute__ ((packed)) chans; | 1899 | } __packed chans; |
1838 | struct { | 1900 | struct { |
1839 | u8 reg_extension_id; | 1901 | u8 reg_extension_id; |
1840 | u8 reg_class; | 1902 | u8 reg_class; |
1841 | u8 coverage_class; | 1903 | u8 coverage_class; |
1842 | } __attribute__ ((packed)) ext; | 1904 | } __packed ext; |
1843 | }; | 1905 | }; |
1844 | } __attribute__ ((packed)); | 1906 | } __packed; |
1845 | 1907 | ||
1846 | enum ieee80211_timeout_interval_type { | 1908 | enum ieee80211_timeout_interval_type { |
1847 | WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */, | 1909 | WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */, |
@@ -1884,7 +1946,10 @@ enum ieee80211_sa_query_action { | |||
1884 | /* AKM suite selectors */ | 1946 | /* AKM suite selectors */ |
1885 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 | 1947 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 |
1886 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 | 1948 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 |
1887 | #define WLAN_AKM_SUITE_SAE 0x000FAC08 | 1949 | #define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05 |
1950 | #define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06 | ||
1951 | #define WLAN_AKM_SUITE_TDLS 0x000FAC07 | ||
1952 | #define WLAN_AKM_SUITE_SAE 0x000FAC08 | ||
1888 | #define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09 | 1953 | #define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09 |
1889 | 1954 | ||
1890 | #define WLAN_MAX_KEY_LEN 32 | 1955 | #define WLAN_MAX_KEY_LEN 32 |
@@ -2089,7 +2154,7 @@ static inline unsigned long ieee80211_tu_to_usec(unsigned long tu) | |||
2089 | * @tim_len: length of the TIM IE | 2154 | * @tim_len: length of the TIM IE |
2090 | * @aid: the AID to look for | 2155 | * @aid: the AID to look for |
2091 | */ | 2156 | */ |
2092 | static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, | 2157 | static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim, |
2093 | u8 tim_len, u16 aid) | 2158 | u8 tim_len, u16 aid) |
2094 | { | 2159 | { |
2095 | u8 mask; | 2160 | u8 mask; |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index f65e8d250f7e..84dde1dd1da4 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -52,6 +52,9 @@ struct macvlan_pcpu_stats { | |||
52 | */ | 52 | */ |
53 | #define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16) | 53 | #define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16) |
54 | 54 | ||
55 | #define MACVLAN_MC_FILTER_BITS 8 | ||
56 | #define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) | ||
57 | |||
55 | struct macvlan_dev { | 58 | struct macvlan_dev { |
56 | struct net_device *dev; | 59 | struct net_device *dev; |
57 | struct list_head list; | 60 | struct list_head list; |
@@ -59,6 +62,9 @@ struct macvlan_dev { | |||
59 | struct macvlan_port *port; | 62 | struct macvlan_port *port; |
60 | struct net_device *lowerdev; | 63 | struct net_device *lowerdev; |
61 | struct macvlan_pcpu_stats __percpu *pcpu_stats; | 64 | struct macvlan_pcpu_stats __percpu *pcpu_stats; |
65 | |||
66 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); | ||
67 | |||
62 | enum macvlan_mode mode; | 68 | enum macvlan_mode mode; |
63 | u16 flags; | 69 | u16 flags; |
64 | int (*receive)(struct sk_buff *skb); | 70 | int (*receive)(struct sk_buff *skb); |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 0245def2aa93..4648d8021244 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -186,6 +186,7 @@ struct team { | |||
186 | 186 | ||
187 | const struct team_mode *mode; | 187 | const struct team_mode *mode; |
188 | struct team_mode_ops ops; | 188 | struct team_mode_ops ops; |
189 | bool user_carrier_enabled; | ||
189 | bool queue_override_enabled; | 190 | bool queue_override_enabled; |
190 | struct list_head *qom_lists; /* array of queue override mapping lists */ | 191 | struct list_head *qom_lists; /* array of queue override mapping lists */ |
191 | long mode_priv[TEAM_MODE_PRIV_LONGS]; | 192 | long mode_priv[TEAM_MODE_PRIV_LONGS]; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index d06cc5c8f58c..218a3b686d90 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -331,7 +331,7 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, | |||
331 | struct vlan_hdr *vhdr) | 331 | struct vlan_hdr *vhdr) |
332 | { | 332 | { |
333 | __be16 proto; | 333 | __be16 proto; |
334 | unsigned char *rawp; | 334 | unsigned short *rawp; |
335 | 335 | ||
336 | /* | 336 | /* |
337 | * Was a VLAN packet, grab the encapsulated protocol, which the layer | 337 | * Was a VLAN packet, grab the encapsulated protocol, which the layer |
@@ -344,8 +344,8 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, | |||
344 | return; | 344 | return; |
345 | } | 345 | } |
346 | 346 | ||
347 | rawp = skb->data; | 347 | rawp = (unsigned short *)(vhdr + 1); |
348 | if (*(unsigned short *) rawp == 0xFFFF) | 348 | if (*rawp == 0xFFFF) |
349 | /* | 349 | /* |
350 | * This is a magic hack to spot IPX packets. Older Novell | 350 | * This is a magic hack to spot IPX packets. Older Novell |
351 | * breaks the protocol design and runs IPX over 802.3 without | 351 | * breaks the protocol design and runs IPX over 802.3 without |
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index f3eea18fdf46..2bac0eb8948d 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
@@ -103,19 +103,6 @@ int iio_update_buffers(struct iio_dev *indio_dev, | |||
103 | **/ | 103 | **/ |
104 | void iio_buffer_init(struct iio_buffer *buffer); | 104 | void iio_buffer_init(struct iio_buffer *buffer); |
105 | 105 | ||
106 | /** | ||
107 | * __iio_update_buffer() - update common elements of buffers | ||
108 | * @buffer: buffer that is the event source | ||
109 | * @bytes_per_datum: size of individual datum including timestamp | ||
110 | * @length: number of datums in buffer | ||
111 | **/ | ||
112 | static inline void __iio_update_buffer(struct iio_buffer *buffer, | ||
113 | int bytes_per_datum, int length) | ||
114 | { | ||
115 | buffer->bytes_per_datum = bytes_per_datum; | ||
116 | buffer->length = length; | ||
117 | } | ||
118 | |||
119 | int iio_scan_mask_query(struct iio_dev *indio_dev, | 106 | int iio_scan_mask_query(struct iio_dev *indio_dev, |
120 | struct iio_buffer *buffer, int bit); | 107 | struct iio_buffer *buffer, int bit); |
121 | 108 | ||
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h new file mode 100644 index 000000000000..1f86a97ab2e2 --- /dev/null +++ b/include/linux/iio/common/st_sensors.h | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | * STMicroelectronics sensors library driver | ||
3 | * | ||
4 | * Copyright 2012-2013 STMicroelectronics Inc. | ||
5 | * | ||
6 | * Denis Ciocca <denis.ciocca@st.com> | ||
7 | * | ||
8 | * Licensed under the GPL-2. | ||
9 | */ | ||
10 | |||
11 | #ifndef ST_SENSORS_H | ||
12 | #define ST_SENSORS_H | ||
13 | |||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/spi/spi.h> | ||
16 | #include <linux/irqreturn.h> | ||
17 | #include <linux/iio/trigger.h> | ||
18 | |||
19 | #define ST_SENSORS_TX_MAX_LENGTH 2 | ||
20 | #define ST_SENSORS_RX_MAX_LENGTH 6 | ||
21 | |||
22 | #define ST_SENSORS_ODR_LIST_MAX 10 | ||
23 | #define ST_SENSORS_FULLSCALE_AVL_MAX 10 | ||
24 | |||
25 | #define ST_SENSORS_NUMBER_ALL_CHANNELS 4 | ||
26 | #define ST_SENSORS_NUMBER_DATA_CHANNELS 3 | ||
27 | #define ST_SENSORS_ENABLE_ALL_AXIS 0x07 | ||
28 | #define ST_SENSORS_BYTE_FOR_CHANNEL 2 | ||
29 | #define ST_SENSORS_SCAN_X 0 | ||
30 | #define ST_SENSORS_SCAN_Y 1 | ||
31 | #define ST_SENSORS_SCAN_Z 2 | ||
32 | #define ST_SENSORS_DEFAULT_12_REALBITS 12 | ||
33 | #define ST_SENSORS_DEFAULT_16_REALBITS 16 | ||
34 | #define ST_SENSORS_DEFAULT_POWER_ON_VALUE 0x01 | ||
35 | #define ST_SENSORS_DEFAULT_POWER_OFF_VALUE 0x00 | ||
36 | #define ST_SENSORS_DEFAULT_WAI_ADDRESS 0x0f | ||
37 | #define ST_SENSORS_DEFAULT_AXIS_ADDR 0x20 | ||
38 | #define ST_SENSORS_DEFAULT_AXIS_MASK 0x07 | ||
39 | #define ST_SENSORS_DEFAULT_AXIS_N_BIT 3 | ||
40 | |||
41 | #define ST_SENSORS_MAX_NAME 17 | ||
42 | #define ST_SENSORS_MAX_4WAI 7 | ||
43 | |||
44 | #define ST_SENSORS_LSM_CHANNELS(device_type, index, mod, endian, bits, addr) \ | ||
45 | { \ | ||
46 | .type = device_type, \ | ||
47 | .modified = 1, \ | ||
48 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
49 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | ||
50 | .scan_index = index, \ | ||
51 | .channel2 = mod, \ | ||
52 | .address = addr, \ | ||
53 | .scan_type = { \ | ||
54 | .sign = 's', \ | ||
55 | .realbits = bits, \ | ||
56 | .shift = 16 - bits, \ | ||
57 | .storagebits = 16, \ | ||
58 | .endianness = endian, \ | ||
59 | }, \ | ||
60 | } | ||
61 | |||
62 | #define ST_SENSOR_DEV_ATTR_SAMP_FREQ() \ | ||
63 | IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, \ | ||
64 | st_sensors_sysfs_get_sampling_frequency, \ | ||
65 | st_sensors_sysfs_set_sampling_frequency) | ||
66 | |||
67 | #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \ | ||
68 | IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \ | ||
69 | st_sensors_sysfs_sampling_frequency_avail) | ||
70 | |||
71 | #define ST_SENSORS_DEV_ATTR_SCALE_AVAIL(name) \ | ||
72 | IIO_DEVICE_ATTR(name, S_IRUGO, \ | ||
73 | st_sensors_sysfs_scale_avail, NULL , 0); | ||
74 | |||
75 | struct st_sensor_odr_avl { | ||
76 | unsigned int hz; | ||
77 | u8 value; | ||
78 | }; | ||
79 | |||
80 | struct st_sensor_odr { | ||
81 | u8 addr; | ||
82 | u8 mask; | ||
83 | struct st_sensor_odr_avl odr_avl[ST_SENSORS_ODR_LIST_MAX]; | ||
84 | }; | ||
85 | |||
86 | struct st_sensor_power { | ||
87 | u8 addr; | ||
88 | u8 mask; | ||
89 | u8 value_off; | ||
90 | u8 value_on; | ||
91 | }; | ||
92 | |||
93 | struct st_sensor_axis { | ||
94 | u8 addr; | ||
95 | u8 mask; | ||
96 | }; | ||
97 | |||
98 | struct st_sensor_fullscale_avl { | ||
99 | unsigned int num; | ||
100 | u8 value; | ||
101 | unsigned int gain; | ||
102 | unsigned int gain2; | ||
103 | }; | ||
104 | |||
105 | struct st_sensor_fullscale { | ||
106 | u8 addr; | ||
107 | u8 mask; | ||
108 | struct st_sensor_fullscale_avl fs_avl[ST_SENSORS_FULLSCALE_AVL_MAX]; | ||
109 | }; | ||
110 | |||
111 | /** | ||
112 | * struct st_sensor_bdu - ST sensor device block data update | ||
113 | * @addr: address of the register. | ||
114 | * @mask: mask to write the block data update flag. | ||
115 | */ | ||
116 | struct st_sensor_bdu { | ||
117 | u8 addr; | ||
118 | u8 mask; | ||
119 | }; | ||
120 | |||
121 | /** | ||
122 | * struct st_sensor_data_ready_irq - ST sensor device data-ready interrupt | ||
123 | * @addr: address of the register. | ||
124 | * @mask: mask to write the on/off value. | ||
125 | * struct ig1 - represents the Interrupt Generator 1 of sensors. | ||
126 | * @en_addr: address of the enable ig1 register. | ||
127 | * @en_mask: mask to write the on/off value for enable. | ||
128 | */ | ||
129 | struct st_sensor_data_ready_irq { | ||
130 | u8 addr; | ||
131 | u8 mask; | ||
132 | struct { | ||
133 | u8 en_addr; | ||
134 | u8 en_mask; | ||
135 | } ig1; | ||
136 | }; | ||
137 | |||
138 | /** | ||
139 | * struct st_sensor_transfer_buffer - ST sensor device I/O buffer | ||
140 | * @buf_lock: Mutex to protect rx and tx buffers. | ||
141 | * @tx_buf: Buffer used by SPI transfer function to send data to the sensors. | ||
142 | * This buffer is used to avoid DMA not-aligned issue. | ||
143 | * @rx_buf: Buffer used by SPI transfer to receive data from sensors. | ||
144 | * This buffer is used to avoid DMA not-aligned issue. | ||
145 | */ | ||
146 | struct st_sensor_transfer_buffer { | ||
147 | struct mutex buf_lock; | ||
148 | u8 rx_buf[ST_SENSORS_RX_MAX_LENGTH]; | ||
149 | u8 tx_buf[ST_SENSORS_TX_MAX_LENGTH] ____cacheline_aligned; | ||
150 | }; | ||
151 | |||
152 | /** | ||
153 | * struct st_sensor_transfer_function - ST sensor device I/O function | ||
154 | * @read_byte: Function used to read one byte. | ||
155 | * @write_byte: Function used to write one byte. | ||
156 | * @read_multiple_byte: Function used to read multiple byte. | ||
157 | */ | ||
158 | struct st_sensor_transfer_function { | ||
159 | int (*read_byte) (struct st_sensor_transfer_buffer *tb, | ||
160 | struct device *dev, u8 reg_addr, u8 *res_byte); | ||
161 | int (*write_byte) (struct st_sensor_transfer_buffer *tb, | ||
162 | struct device *dev, u8 reg_addr, u8 data); | ||
163 | int (*read_multiple_byte) (struct st_sensor_transfer_buffer *tb, | ||
164 | struct device *dev, u8 reg_addr, int len, u8 *data, | ||
165 | bool multiread_bit); | ||
166 | }; | ||
167 | |||
168 | /** | ||
169 | * struct st_sensors - ST sensors list | ||
170 | * @wai: Contents of WhoAmI register. | ||
171 | * @sensors_supported: List of supported sensors by struct itself. | ||
172 | * @ch: IIO channels for the sensor. | ||
173 | * @odr: Output data rate register and ODR list available. | ||
174 | * @pw: Power register of the sensor. | ||
175 | * @enable_axis: Enable one or more axis of the sensor. | ||
176 | * @fs: Full scale register and full scale list available. | ||
177 | * @bdu: Block data update register. | ||
178 | * @drdy_irq: Data ready register of the sensor. | ||
179 | * @multi_read_bit: Use or not particular bit for [I2C/SPI] multi-read. | ||
180 | * @bootime: samples to discard when sensor passing from power-down to power-up. | ||
181 | */ | ||
182 | struct st_sensors { | ||
183 | u8 wai; | ||
184 | char sensors_supported[ST_SENSORS_MAX_4WAI][ST_SENSORS_MAX_NAME]; | ||
185 | struct iio_chan_spec *ch; | ||
186 | struct st_sensor_odr odr; | ||
187 | struct st_sensor_power pw; | ||
188 | struct st_sensor_axis enable_axis; | ||
189 | struct st_sensor_fullscale fs; | ||
190 | struct st_sensor_bdu bdu; | ||
191 | struct st_sensor_data_ready_irq drdy_irq; | ||
192 | bool multi_read_bit; | ||
193 | unsigned int bootime; | ||
194 | }; | ||
195 | |||
196 | /** | ||
197 | * struct st_sensor_data - ST sensor device status | ||
198 | * @dev: Pointer to instance of struct device (I2C or SPI). | ||
199 | * @trig: The trigger in use by the core driver. | ||
200 | * @sensor: Pointer to the current sensor struct in use. | ||
201 | * @current_fullscale: Maximum range of measure by the sensor. | ||
202 | * @enabled: Status of the sensor (false->off, true->on). | ||
203 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. | ||
204 | * @buffer_data: Data used by buffer part. | ||
205 | * @odr: Output data rate of the sensor [Hz]. | ||
206 | * @get_irq_data_ready: Function to get the IRQ used for data ready signal. | ||
207 | * @tf: Transfer function structure used by I/O operations. | ||
208 | * @tb: Transfer buffers and mutex used by I/O operations. | ||
209 | */ | ||
210 | struct st_sensor_data { | ||
211 | struct device *dev; | ||
212 | struct iio_trigger *trig; | ||
213 | struct st_sensors *sensor; | ||
214 | struct st_sensor_fullscale_avl *current_fullscale; | ||
215 | |||
216 | bool enabled; | ||
217 | bool multiread_bit; | ||
218 | |||
219 | char *buffer_data; | ||
220 | |||
221 | unsigned int odr; | ||
222 | |||
223 | unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); | ||
224 | |||
225 | const struct st_sensor_transfer_function *tf; | ||
226 | struct st_sensor_transfer_buffer tb; | ||
227 | }; | ||
228 | |||
229 | #ifdef CONFIG_IIO_BUFFER | ||
230 | int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | ||
231 | const struct iio_trigger_ops *trigger_ops); | ||
232 | |||
233 | void st_sensors_deallocate_trigger(struct iio_dev *indio_dev); | ||
234 | |||
235 | irqreturn_t st_sensors_trigger_handler(int irq, void *p); | ||
236 | |||
237 | int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf); | ||
238 | #else | ||
239 | static inline int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | ||
240 | const struct iio_trigger_ops *trigger_ops) | ||
241 | { | ||
242 | return 0; | ||
243 | } | ||
244 | static inline void st_sensors_deallocate_trigger(struct iio_dev *indio_dev) | ||
245 | { | ||
246 | return; | ||
247 | } | ||
248 | #endif | ||
249 | |||
250 | int st_sensors_init_sensor(struct iio_dev *indio_dev); | ||
251 | |||
252 | int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable); | ||
253 | |||
254 | int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable); | ||
255 | |||
256 | int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr); | ||
257 | |||
258 | int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable); | ||
259 | |||
260 | int st_sensors_set_fullscale_by_gain(struct iio_dev *indio_dev, int scale); | ||
261 | |||
262 | int st_sensors_read_info_raw(struct iio_dev *indio_dev, | ||
263 | struct iio_chan_spec const *ch, int *val); | ||
264 | |||
265 | int st_sensors_check_device_support(struct iio_dev *indio_dev, | ||
266 | int num_sensors_list, const struct st_sensors *sensors); | ||
267 | |||
268 | ssize_t st_sensors_sysfs_get_sampling_frequency(struct device *dev, | ||
269 | struct device_attribute *attr, char *buf); | ||
270 | |||
271 | ssize_t st_sensors_sysfs_set_sampling_frequency(struct device *dev, | ||
272 | struct device_attribute *attr, const char *buf, size_t size); | ||
273 | |||
274 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, | ||
275 | struct device_attribute *attr, char *buf); | ||
276 | |||
277 | ssize_t st_sensors_sysfs_scale_avail(struct device *dev, | ||
278 | struct device_attribute *attr, char *buf); | ||
279 | |||
280 | #endif /* ST_SENSORS_H */ | ||
diff --git a/include/linux/iio/common/st_sensors_i2c.h b/include/linux/iio/common/st_sensors_i2c.h new file mode 100644 index 000000000000..67d845385ae2 --- /dev/null +++ b/include/linux/iio/common/st_sensors_i2c.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * STMicroelectronics sensors i2c library driver | ||
3 | * | ||
4 | * Copyright 2012-2013 STMicroelectronics Inc. | ||
5 | * | ||
6 | * Denis Ciocca <denis.ciocca@st.com> | ||
7 | * | ||
8 | * Licensed under the GPL-2. | ||
9 | */ | ||
10 | |||
11 | #ifndef ST_SENSORS_I2C_H | ||
12 | #define ST_SENSORS_I2C_H | ||
13 | |||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/iio/common/st_sensors.h> | ||
16 | |||
17 | void st_sensors_i2c_configure(struct iio_dev *indio_dev, | ||
18 | struct i2c_client *client, struct st_sensor_data *sdata); | ||
19 | |||
20 | #endif /* ST_SENSORS_I2C_H */ | ||
diff --git a/include/linux/iio/common/st_sensors_spi.h b/include/linux/iio/common/st_sensors_spi.h new file mode 100644 index 000000000000..d964a3563dc6 --- /dev/null +++ b/include/linux/iio/common/st_sensors_spi.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * STMicroelectronics sensors spi library driver | ||
3 | * | ||
4 | * Copyright 2012-2013 STMicroelectronics Inc. | ||
5 | * | ||
6 | * Denis Ciocca <denis.ciocca@st.com> | ||
7 | * | ||
8 | * Licensed under the GPL-2. | ||
9 | */ | ||
10 | |||
11 | #ifndef ST_SENSORS_SPI_H | ||
12 | #define ST_SENSORS_SPI_H | ||
13 | |||
14 | #include <linux/spi/spi.h> | ||
15 | #include <linux/iio/common/st_sensors.h> | ||
16 | |||
17 | void st_sensors_spi_configure(struct iio_dev *indio_dev, | ||
18 | struct spi_device *spi, struct st_sensor_data *sdata); | ||
19 | |||
20 | #endif /* ST_SENSORS_SPI_H */ | ||
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 16c35ac045bd..833926c91aa8 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | struct iio_dev; | 16 | struct iio_dev; |
17 | struct iio_chan_spec; | 17 | struct iio_chan_spec; |
18 | struct device; | ||
18 | 19 | ||
19 | /** | 20 | /** |
20 | * struct iio_channel - everything needed for a consumer to use a channel | 21 | * struct iio_channel - everything needed for a consumer to use a channel |
@@ -30,14 +31,15 @@ struct iio_channel { | |||
30 | 31 | ||
31 | /** | 32 | /** |
32 | * iio_channel_get() - get description of all that is needed to access channel. | 33 | * iio_channel_get() - get description of all that is needed to access channel. |
33 | * @name: Unique name of the device as provided in the iio_map | 34 | * @dev: Pointer to consumer device. Device name must match |
35 | * the name of the device as provided in the iio_map | ||
34 | * with which the desired provider to consumer mapping | 36 | * with which the desired provider to consumer mapping |
35 | * was registered. | 37 | * was registered. |
36 | * @consumer_channel: Unique name to identify the channel on the consumer | 38 | * @consumer_channel: Unique name to identify the channel on the consumer |
37 | * side. This typically describes the channels use within | 39 | * side. This typically describes the channels use within |
38 | * the consumer. E.g. 'battery_voltage' | 40 | * the consumer. E.g. 'battery_voltage' |
39 | */ | 41 | */ |
40 | struct iio_channel *iio_channel_get(const char *name, | 42 | struct iio_channel *iio_channel_get(struct device *dev, |
41 | const char *consumer_channel); | 43 | const char *consumer_channel); |
42 | 44 | ||
43 | /** | 45 | /** |
@@ -48,14 +50,14 @@ void iio_channel_release(struct iio_channel *chan); | |||
48 | 50 | ||
49 | /** | 51 | /** |
50 | * iio_channel_get_all() - get all channels associated with a client | 52 | * iio_channel_get_all() - get all channels associated with a client |
51 | * @name: name of consumer device. | 53 | * @dev: Pointer to consumer device. |
52 | * | 54 | * |
53 | * Returns an array of iio_channel structures terminated with one with | 55 | * Returns an array of iio_channel structures terminated with one with |
54 | * null iio_dev pointer. | 56 | * null iio_dev pointer. |
55 | * This function is used by fairly generic consumers to get all the | 57 | * This function is used by fairly generic consumers to get all the |
56 | * channels registered as having this consumer. | 58 | * channels registered as having this consumer. |
57 | */ | 59 | */ |
58 | struct iio_channel *iio_channel_get_all(const char *name); | 60 | struct iio_channel *iio_channel_get_all(struct device *dev); |
59 | 61 | ||
60 | /** | 62 | /** |
61 | * iio_channel_release_all() - reverse iio_channel_get_all | 63 | * iio_channel_release_all() - reverse iio_channel_get_all |
@@ -66,7 +68,7 @@ void iio_channel_release_all(struct iio_channel *chan); | |||
66 | struct iio_cb_buffer; | 68 | struct iio_cb_buffer; |
67 | /** | 69 | /** |
68 | * iio_channel_get_all_cb() - register callback for triggered capture | 70 | * iio_channel_get_all_cb() - register callback for triggered capture |
69 | * @name: Name of client device. | 71 | * @dev: Pointer to client device. |
70 | * @cb: Callback function. | 72 | * @cb: Callback function. |
71 | * @private: Private data passed to callback. | 73 | * @private: Private data passed to callback. |
72 | * | 74 | * |
@@ -74,7 +76,7 @@ struct iio_cb_buffer; | |||
74 | * So if the channels requested come from different devices this will | 76 | * So if the channels requested come from different devices this will |
75 | * fail. | 77 | * fail. |
76 | */ | 78 | */ |
77 | struct iio_cb_buffer *iio_channel_get_all_cb(const char *name, | 79 | struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, |
78 | int (*cb)(u8 *data, | 80 | int (*cb)(u8 *data, |
79 | void *private), | 81 | void *private), |
80 | void *private); | 82 | void *private); |
diff --git a/include/linux/iio/driver.h b/include/linux/iio/driver.h index a4f8b2e05af5..7dfb10ee2669 100644 --- a/include/linux/iio/driver.h +++ b/include/linux/iio/driver.h | |||
@@ -22,13 +22,10 @@ int iio_map_array_register(struct iio_dev *indio_dev, | |||
22 | struct iio_map *map); | 22 | struct iio_map *map); |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * iio_map_array_unregister() - tell the core to remove consumer mappings | 25 | * iio_map_array_unregister() - tell the core to remove consumer mappings for |
26 | * the given provider device | ||
26 | * @indio_dev: provider device | 27 | * @indio_dev: provider device |
27 | * @map: array of mappings to remove. Note these must have same memory | ||
28 | * addresses as those originally added not just equal parameter | ||
29 | * values. | ||
30 | */ | 28 | */ |
31 | int iio_map_array_unregister(struct iio_dev *indio_dev, | 29 | int iio_map_array_unregister(struct iio_dev *indio_dev); |
32 | struct iio_map *map); | ||
33 | 30 | ||
34 | #endif | 31 | #endif |
diff --git a/include/linux/iio/gyro/itg3200.h b/include/linux/iio/gyro/itg3200.h new file mode 100644 index 000000000000..c53f16914b77 --- /dev/null +++ b/include/linux/iio/gyro/itg3200.h | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * itg3200.h -- support InvenSense ITG3200 | ||
3 | * Digital 3-Axis Gyroscope driver | ||
4 | * | ||
5 | * Copyright (c) 2011 Christian Strobel <christian.strobel@iis.fraunhofer.de> | ||
6 | * Copyright (c) 2011 Manuel Stahl <manuel.stahl@iis.fraunhofer.de> | ||
7 | * Copyright (c) 2012 Thorsten Nowak <thorsten.nowak@iis.fraunhofer.de> | ||
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 I2C_ITG3200_H_ | ||
15 | #define I2C_ITG3200_H_ | ||
16 | |||
17 | #include <linux/iio/iio.h> | ||
18 | |||
19 | /* Register with I2C address (34h) */ | ||
20 | #define ITG3200_REG_ADDRESS 0x00 | ||
21 | |||
22 | /* Sample rate divider | ||
23 | * Range: 0 to 255 | ||
24 | * Default value: 0x00 */ | ||
25 | #define ITG3200_REG_SAMPLE_RATE_DIV 0x15 | ||
26 | |||
27 | /* Digital low pass filter settings */ | ||
28 | #define ITG3200_REG_DLPF 0x16 | ||
29 | /* DLPF full scale range */ | ||
30 | #define ITG3200_DLPF_FS_SEL_2000 0x18 | ||
31 | /* Bandwidth (Hz) and internal sample rate | ||
32 | * (kHz) of DLPF */ | ||
33 | #define ITG3200_DLPF_256_8 0x00 | ||
34 | #define ITG3200_DLPF_188_1 0x01 | ||
35 | #define ITG3200_DLPF_98_1 0x02 | ||
36 | #define ITG3200_DLPF_42_1 0x03 | ||
37 | #define ITG3200_DLPF_20_1 0x04 | ||
38 | #define ITG3200_DLPF_10_1 0x05 | ||
39 | #define ITG3200_DLPF_5_1 0x06 | ||
40 | |||
41 | #define ITG3200_DLPF_CFG_MASK 0x07 | ||
42 | |||
43 | /* Configuration for interrupt operations */ | ||
44 | #define ITG3200_REG_IRQ_CONFIG 0x17 | ||
45 | /* Logic level */ | ||
46 | #define ITG3200_IRQ_ACTIVE_LOW 0x80 | ||
47 | #define ITG3200_IRQ_ACTIVE_HIGH 0x00 | ||
48 | /* Drive type */ | ||
49 | #define ITG3200_IRQ_OPEN_DRAIN 0x40 | ||
50 | #define ITG3200_IRQ_PUSH_PULL 0x00 | ||
51 | /* Latch mode */ | ||
52 | #define ITG3200_IRQ_LATCH_UNTIL_CLEARED 0x20 | ||
53 | #define ITG3200_IRQ_LATCH_50US_PULSE 0x00 | ||
54 | /* Latch clear method */ | ||
55 | #define ITG3200_IRQ_LATCH_CLEAR_ANY 0x10 | ||
56 | #define ITG3200_IRQ_LATCH_CLEAR_STATUS 0x00 | ||
57 | /* Enable interrupt when device is ready */ | ||
58 | #define ITG3200_IRQ_DEVICE_RDY_ENABLE 0x04 | ||
59 | /* Enable interrupt when data is available */ | ||
60 | #define ITG3200_IRQ_DATA_RDY_ENABLE 0x01 | ||
61 | |||
62 | /* Determine the status of ITG-3200 interrupts */ | ||
63 | #define ITG3200_REG_IRQ_STATUS 0x1A | ||
64 | /* Status of 'device is ready'-interrupt */ | ||
65 | #define ITG3200_IRQ_DEVICE_RDY_STATUS 0x04 | ||
66 | /* Status of 'data is available'-interrupt */ | ||
67 | #define ITG3200_IRQ_DATA_RDY_STATUS 0x01 | ||
68 | |||
69 | /* Sensor registers */ | ||
70 | #define ITG3200_REG_TEMP_OUT_H 0x1B | ||
71 | #define ITG3200_REG_TEMP_OUT_L 0x1C | ||
72 | #define ITG3200_REG_GYRO_XOUT_H 0x1D | ||
73 | #define ITG3200_REG_GYRO_XOUT_L 0x1E | ||
74 | #define ITG3200_REG_GYRO_YOUT_H 0x1F | ||
75 | #define ITG3200_REG_GYRO_YOUT_L 0x20 | ||
76 | #define ITG3200_REG_GYRO_ZOUT_H 0x21 | ||
77 | #define ITG3200_REG_GYRO_ZOUT_L 0x22 | ||
78 | |||
79 | /* Power management */ | ||
80 | #define ITG3200_REG_POWER_MANAGEMENT 0x3E | ||
81 | /* Reset device and internal registers to the | ||
82 | * power-up-default settings */ | ||
83 | #define ITG3200_RESET 0x80 | ||
84 | /* Enable low power sleep mode */ | ||
85 | #define ITG3200_SLEEP 0x40 | ||
86 | /* Put according gyroscope in standby mode */ | ||
87 | #define ITG3200_STANDBY_GYRO_X 0x20 | ||
88 | #define ITG3200_STANDBY_GYRO_Y 0x10 | ||
89 | #define ITG3200_STANDBY_GYRO_Z 0x08 | ||
90 | /* Determine the device clock source */ | ||
91 | #define ITG3200_CLK_INTERNAL 0x00 | ||
92 | #define ITG3200_CLK_GYRO_X 0x01 | ||
93 | #define ITG3200_CLK_GYRO_Y 0x02 | ||
94 | #define ITG3200_CLK_GYRO_Z 0x03 | ||
95 | #define ITG3200_CLK_EXT_32K 0x04 | ||
96 | #define ITG3200_CLK_EXT_19M 0x05 | ||
97 | |||
98 | |||
99 | /** | ||
100 | * struct itg3200 - device instance specific data | ||
101 | * @i2c: actual i2c_client | ||
102 | * @trig: data ready trigger from itg3200 pin | ||
103 | **/ | ||
104 | struct itg3200 { | ||
105 | struct i2c_client *i2c; | ||
106 | struct iio_trigger *trig; | ||
107 | }; | ||
108 | |||
109 | enum ITG3200_SCAN_INDEX { | ||
110 | ITG3200_SCAN_TEMP, | ||
111 | ITG3200_SCAN_GYRO_X, | ||
112 | ITG3200_SCAN_GYRO_Y, | ||
113 | ITG3200_SCAN_GYRO_Z, | ||
114 | ITG3200_SCAN_ELEMENTS, | ||
115 | }; | ||
116 | |||
117 | int itg3200_write_reg_8(struct iio_dev *indio_dev, | ||
118 | u8 reg_address, u8 val); | ||
119 | |||
120 | int itg3200_read_reg_8(struct iio_dev *indio_dev, | ||
121 | u8 reg_address, u8 *val); | ||
122 | |||
123 | |||
124 | #ifdef CONFIG_IIO_BUFFER | ||
125 | |||
126 | void itg3200_remove_trigger(struct iio_dev *indio_dev); | ||
127 | int itg3200_probe_trigger(struct iio_dev *indio_dev); | ||
128 | |||
129 | int itg3200_buffer_configure(struct iio_dev *indio_dev); | ||
130 | void itg3200_buffer_unconfigure(struct iio_dev *indio_dev); | ||
131 | |||
132 | #else /* CONFIG_IIO_BUFFER */ | ||
133 | |||
134 | static inline void itg3200_remove_trigger(struct iio_dev *indio_dev) | ||
135 | { | ||
136 | } | ||
137 | |||
138 | static inline int itg3200_probe_trigger(struct iio_dev *indio_dev) | ||
139 | { | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static inline int itg3200_buffer_configure(struct iio_dev *indio_dev) | ||
144 | { | ||
145 | return 0; | ||
146 | } | ||
147 | |||
148 | static inline void itg3200_buffer_unconfigure(struct iio_dev *indio_dev) | ||
149 | { | ||
150 | } | ||
151 | |||
152 | #endif /* CONFIG_IIO_RING_BUFFER */ | ||
153 | |||
154 | #endif /* ITG3200_H_ */ | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 20239da1d0f7..c66e0a96f6e8 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifndef _IIO_TRIGGER_H_ | 12 | #ifndef _IIO_TRIGGER_H_ |
13 | #define _IIO_TRIGGER_H_ | 13 | #define _IIO_TRIGGER_H_ |
14 | 14 | ||
15 | #ifdef CONFIG_IIO_TRIGGER | ||
15 | struct iio_subirq { | 16 | struct iio_subirq { |
16 | bool enabled; | 17 | bool enabled; |
17 | }; | 18 | }; |
@@ -117,4 +118,8 @@ irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); | |||
117 | __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); | 118 | __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); |
118 | void iio_trigger_free(struct iio_trigger *trig); | 119 | void iio_trigger_free(struct iio_trigger *trig); |
119 | 120 | ||
121 | #else | ||
122 | struct iio_trigger; | ||
123 | struct iio_trigger_ops; | ||
124 | #endif | ||
120 | #endif /* _IIO_TRIGGER_H_ */ | 125 | #endif /* _IIO_TRIGGER_H_ */ |
diff --git a/include/linux/in6.h b/include/linux/in6.h index 9e2ae26fb598..34edf1f6c9a3 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -22,6 +22,10 @@ | |||
22 | 22 | ||
23 | #include <uapi/linux/in6.h> | 23 | #include <uapi/linux/in6.h> |
24 | 24 | ||
25 | /* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553 | ||
26 | * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined | ||
27 | * in network byte order, not in host byte order as are the IPv4 equivalents | ||
28 | */ | ||
25 | extern const struct in6_addr in6addr_any; | 29 | extern const struct in6_addr in6addr_any; |
26 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } | 30 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } |
27 | extern const struct in6_addr in6addr_loopback; | 31 | extern const struct in6_addr in6addr_loopback; |
@@ -32,4 +36,13 @@ extern const struct in6_addr in6addr_linklocal_allnodes; | |||
32 | extern const struct in6_addr in6addr_linklocal_allrouters; | 36 | extern const struct in6_addr in6addr_linklocal_allrouters; |
33 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ | 37 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ |
34 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | 38 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } |
39 | extern const struct in6_addr in6addr_interfacelocal_allnodes; | ||
40 | #define IN6ADDR_INTERFACELOCAL_ALLNODES_INIT \ | ||
41 | { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } | ||
42 | extern const struct in6_addr in6addr_interfacelocal_allrouters; | ||
43 | #define IN6ADDR_INTERFACELOCAL_ALLROUTERS_INIT \ | ||
44 | { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | ||
45 | extern const struct in6_addr in6addr_sitelocal_allrouters; | ||
46 | #define IN6ADDR_SITELOCAL_ALLROUTERS_INIT \ | ||
47 | { { { 0xff,5,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | ||
35 | #endif | 48 | #endif |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index a9d828976a77..ea1e3b863890 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -166,6 +166,12 @@ struct in_ifaddr { | |||
166 | unsigned char ifa_flags; | 166 | unsigned char ifa_flags; |
167 | unsigned char ifa_prefixlen; | 167 | unsigned char ifa_prefixlen; |
168 | char ifa_label[IFNAMSIZ]; | 168 | char ifa_label[IFNAMSIZ]; |
169 | |||
170 | /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ | ||
171 | __u32 ifa_valid_lft; | ||
172 | __u32 ifa_preferred_lft; | ||
173 | unsigned long ifa_cstamp; /* created timestamp */ | ||
174 | unsigned long ifa_tstamp; /* updated timestamp */ | ||
169 | }; | 175 | }; |
170 | 176 | ||
171 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 177 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h index 57e01a7cb006..010d98175efa 100644 --- a/include/linux/input/adxl34x.h +++ b/include/linux/input/adxl34x.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __LINUX_INPUT_ADXL34X_H__ | 13 | #ifndef __LINUX_INPUT_ADXL34X_H__ |
14 | #define __LINUX_INPUT_ADXL34X_H__ | 14 | #define __LINUX_INPUT_ADXL34X_H__ |
15 | 15 | ||
16 | #include <linux/input.h> | ||
17 | |||
16 | struct adxl34x_platform_data { | 18 | struct adxl34x_platform_data { |
17 | 19 | ||
18 | /* | 20 | /* |
diff --git a/include/linux/input/tegra_kbc.h b/include/linux/input/tegra_kbc.h deleted file mode 100644 index a13025612939..000000000000 --- a/include/linux/input/tegra_kbc.h +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Platform definitions for tegra-kbc keyboard input driver | ||
3 | * | ||
4 | * Copyright (c) 2010-2011, NVIDIA 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; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef ASMARM_ARCH_TEGRA_KBC_H | ||
22 | #define ASMARM_ARCH_TEGRA_KBC_H | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/input/matrix_keypad.h> | ||
26 | |||
27 | #define KBC_MAX_GPIO 24 | ||
28 | #define KBC_MAX_KPENT 8 | ||
29 | |||
30 | #define KBC_MAX_ROW 16 | ||
31 | #define KBC_MAX_COL 8 | ||
32 | #define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL) | ||
33 | |||
34 | enum tegra_pin_type { | ||
35 | PIN_CFG_IGNORE, | ||
36 | PIN_CFG_COL, | ||
37 | PIN_CFG_ROW, | ||
38 | }; | ||
39 | |||
40 | struct tegra_kbc_pin_cfg { | ||
41 | enum tegra_pin_type type; | ||
42 | unsigned char num; | ||
43 | }; | ||
44 | |||
45 | struct tegra_kbc_wake_key { | ||
46 | u8 row:4; | ||
47 | u8 col:4; | ||
48 | }; | ||
49 | |||
50 | struct tegra_kbc_platform_data { | ||
51 | unsigned int debounce_cnt; | ||
52 | unsigned int repeat_cnt; | ||
53 | |||
54 | struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO]; | ||
55 | const struct matrix_keymap_data *keymap_data; | ||
56 | |||
57 | u32 wakeup_key; | ||
58 | bool wakeup; | ||
59 | bool use_fn_map; | ||
60 | bool use_ghost_filter; | ||
61 | }; | ||
62 | #endif | ||
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1c1042..ba3b8a98a049 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -58,8 +58,10 @@ struct iommu_domain { | |||
58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
59 | 59 | ||
60 | enum iommu_attr { | 60 | enum iommu_attr { |
61 | DOMAIN_ATTR_MAX, | ||
62 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
62 | DOMAIN_ATTR_PAGING, | ||
63 | DOMAIN_ATTR_WINDOWS, | ||
64 | DOMAIN_ATTR_MAX, | ||
63 | }; | 65 | }; |
64 | 66 | ||
65 | #ifdef CONFIG_IOMMU_API | 67 | #ifdef CONFIG_IOMMU_API |
@@ -100,6 +102,16 @@ struct iommu_ops { | |||
100 | enum iommu_attr attr, void *data); | 102 | enum iommu_attr attr, void *data); |
101 | int (*domain_set_attr)(struct iommu_domain *domain, | 103 | int (*domain_set_attr)(struct iommu_domain *domain, |
102 | enum iommu_attr attr, void *data); | 104 | enum iommu_attr attr, void *data); |
105 | |||
106 | /* Window handling functions */ | ||
107 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, | ||
108 | phys_addr_t paddr, u64 size); | ||
109 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); | ||
110 | /* Set the numer of window per domain */ | ||
111 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); | ||
112 | /* Get the numer of window per domain */ | ||
113 | u32 (*domain_get_windows)(struct iommu_domain *domain); | ||
114 | |||
103 | unsigned long pgsize_bitmap; | 115 | unsigned long pgsize_bitmap; |
104 | }; | 116 | }; |
105 | 117 | ||
@@ -157,6 +169,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | |||
157 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 169 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
158 | void *data); | 170 | void *data); |
159 | 171 | ||
172 | /* Window handling function prototypes */ | ||
173 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | ||
174 | phys_addr_t offset, u64 size); | ||
175 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); | ||
160 | /** | 176 | /** |
161 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 177 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
162 | * @domain: the iommu domain where the fault has happened | 178 | * @domain: the iommu domain where the fault has happened |
@@ -239,6 +255,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
239 | return -ENODEV; | 255 | return -ENODEV; |
240 | } | 256 | } |
241 | 257 | ||
258 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | ||
259 | u32 wnd_nr, phys_addr_t paddr, | ||
260 | u64 size) | ||
261 | { | ||
262 | return -ENODEV; | ||
263 | } | ||
264 | |||
265 | static inline void iommu_domain_window_disable(struct iommu_domain *domain, | ||
266 | u32 wnd_nr) | ||
267 | { | ||
268 | } | ||
269 | |||
242 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 270 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
243 | unsigned long iova) | 271 | unsigned long iova) |
244 | { | 272 | { |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index faed1e357dd6..850e95bc766c 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -77,11 +77,6 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) | |||
77 | return (struct ipv6hdr *)skb_transport_header(skb); | 77 | return (struct ipv6hdr *)skb_transport_header(skb); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline __u8 ipv6_tclass(const struct ipv6hdr *iph) | ||
81 | { | ||
82 | return (ntohl(*(__be32 *)iph) >> 20) & 0xff; | ||
83 | } | ||
84 | |||
85 | /* | 80 | /* |
86 | This structure contains results of exthdrs parsing | 81 | This structure contains results of exthdrs parsing |
87 | as offsets from skb->nh. | 82 | as offsets from skb->nh. |
@@ -89,7 +84,7 @@ static inline __u8 ipv6_tclass(const struct ipv6hdr *iph) | |||
89 | 84 | ||
90 | struct inet6_skb_parm { | 85 | struct inet6_skb_parm { |
91 | int iif; | 86 | int iif; |
92 | __u16 ra; | 87 | __be16 ra; |
93 | __u16 hop; | 88 | __u16 hop; |
94 | __u16 dst0; | 89 | __u16 dst0; |
95 | __u16 srcrt; | 90 | __u16 srcrt; |
@@ -105,6 +100,7 @@ struct inet6_skb_parm { | |||
105 | #define IP6SKB_XFRM_TRANSFORMED 1 | 100 | #define IP6SKB_XFRM_TRANSFORMED 1 |
106 | #define IP6SKB_FORWARDED 2 | 101 | #define IP6SKB_FORWARDED 2 |
107 | #define IP6SKB_REROUTED 4 | 102 | #define IP6SKB_REROUTED 4 |
103 | #define IP6SKB_ROUTERALERT 8 | ||
108 | }; | 104 | }; |
109 | 105 | ||
110 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 106 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
@@ -218,7 +214,7 @@ struct ipv6_pinfo { | |||
218 | 214 | ||
219 | struct ipv6_mc_socklist __rcu *ipv6_mc_list; | 215 | struct ipv6_mc_socklist __rcu *ipv6_mc_list; |
220 | struct ipv6_ac_socklist *ipv6_ac_list; | 216 | struct ipv6_ac_socklist *ipv6_ac_list; |
221 | struct ipv6_fl_socklist *ipv6_fl_list; | 217 | struct ipv6_fl_socklist __rcu *ipv6_fl_list; |
222 | 218 | ||
223 | struct ipv6_txoptions *opt; | 219 | struct ipv6_txoptions *opt; |
224 | struct sk_buff *pktoptions; | 220 | struct sk_buff *pktoptions; |
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h new file mode 100644 index 000000000000..e0006f1d35a0 --- /dev/null +++ b/include/linux/irqchip.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Thomas Petazzoni | ||
3 | * | ||
4 | * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_IRQCHIP_H | ||
12 | #define _LINUX_IRQCHIP_H | ||
13 | |||
14 | void irqchip_init(void); | ||
15 | |||
16 | #endif | ||
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h new file mode 100644 index 000000000000..3fd8e4290a1c --- /dev/null +++ b/include/linux/irqchip/arm-gic.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * include/linux/irqchip/arm-gic.h | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Limited, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __LINUX_IRQCHIP_ARM_GIC_H | ||
11 | #define __LINUX_IRQCHIP_ARM_GIC_H | ||
12 | |||
13 | #define GIC_CPU_CTRL 0x00 | ||
14 | #define GIC_CPU_PRIMASK 0x04 | ||
15 | #define GIC_CPU_BINPOINT 0x08 | ||
16 | #define GIC_CPU_INTACK 0x0c | ||
17 | #define GIC_CPU_EOI 0x10 | ||
18 | #define GIC_CPU_RUNNINGPRI 0x14 | ||
19 | #define GIC_CPU_HIGHPRI 0x18 | ||
20 | |||
21 | #define GIC_DIST_CTRL 0x000 | ||
22 | #define GIC_DIST_CTR 0x004 | ||
23 | #define GIC_DIST_IGROUP 0x080 | ||
24 | #define GIC_DIST_ENABLE_SET 0x100 | ||
25 | #define GIC_DIST_ENABLE_CLEAR 0x180 | ||
26 | #define GIC_DIST_PENDING_SET 0x200 | ||
27 | #define GIC_DIST_PENDING_CLEAR 0x280 | ||
28 | #define GIC_DIST_ACTIVE_SET 0x300 | ||
29 | #define GIC_DIST_ACTIVE_CLEAR 0x380 | ||
30 | #define GIC_DIST_PRI 0x400 | ||
31 | #define GIC_DIST_TARGET 0x800 | ||
32 | #define GIC_DIST_CONFIG 0xc00 | ||
33 | #define GIC_DIST_SOFTINT 0xf00 | ||
34 | |||
35 | #define GICH_HCR 0x0 | ||
36 | #define GICH_VTR 0x4 | ||
37 | #define GICH_VMCR 0x8 | ||
38 | #define GICH_MISR 0x10 | ||
39 | #define GICH_EISR0 0x20 | ||
40 | #define GICH_EISR1 0x24 | ||
41 | #define GICH_ELRSR0 0x30 | ||
42 | #define GICH_ELRSR1 0x34 | ||
43 | #define GICH_APR 0xf0 | ||
44 | #define GICH_LR0 0x100 | ||
45 | |||
46 | #define GICH_HCR_EN (1 << 0) | ||
47 | #define GICH_HCR_UIE (1 << 1) | ||
48 | |||
49 | #define GICH_LR_VIRTUALID (0x3ff << 0) | ||
50 | #define GICH_LR_PHYSID_CPUID_SHIFT (10) | ||
51 | #define GICH_LR_PHYSID_CPUID (7 << GICH_LR_PHYSID_CPUID_SHIFT) | ||
52 | #define GICH_LR_STATE (3 << 28) | ||
53 | #define GICH_LR_PENDING_BIT (1 << 28) | ||
54 | #define GICH_LR_ACTIVE_BIT (1 << 29) | ||
55 | #define GICH_LR_EOI (1 << 19) | ||
56 | |||
57 | #define GICH_MISR_EOI (1 << 0) | ||
58 | #define GICH_MISR_U (1 << 1) | ||
59 | |||
60 | #ifndef __ASSEMBLY__ | ||
61 | |||
62 | struct device_node; | ||
63 | |||
64 | extern struct irq_chip gic_arch_extn; | ||
65 | |||
66 | void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *, | ||
67 | u32 offset, struct device_node *); | ||
68 | void gic_secondary_init(unsigned int); | ||
69 | void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); | ||
70 | |||
71 | static inline void gic_init(unsigned int nr, int start, | ||
72 | void __iomem *dist , void __iomem *cpu) | ||
73 | { | ||
74 | gic_init_bases(nr, start, dist, cpu, 0, NULL); | ||
75 | } | ||
76 | |||
77 | #endif /* __ASSEMBLY */ | ||
78 | |||
79 | #endif | ||
diff --git a/include/linux/irqchip/arm-vic.h b/include/linux/irqchip/arm-vic.h new file mode 100644 index 000000000000..e3c82dc95756 --- /dev/null +++ b/include/linux/irqchip/arm-vic.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/vic.h | ||
3 | * | ||
4 | * Copyright (c) ARM Limited 2003. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
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 | #ifndef __ASM_ARM_HARDWARE_VIC_H | ||
21 | #define __ASM_ARM_HARDWARE_VIC_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | #define VIC_RAW_STATUS 0x08 | ||
26 | #define VIC_INT_ENABLE 0x10 /* 1 = enable, 0 = disable */ | ||
27 | #define VIC_INT_ENABLE_CLEAR 0x14 | ||
28 | |||
29 | struct device_node; | ||
30 | struct pt_regs; | ||
31 | |||
32 | void __vic_init(void __iomem *base, int irq_start, u32 vic_sources, | ||
33 | u32 resume_sources, struct device_node *node); | ||
34 | void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index e30b66346942..50e5a5e6a712 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -20,7 +20,6 @@ | |||
20 | #ifndef __KERNEL__ | 20 | #ifndef __KERNEL__ |
21 | #include "jfs_compat.h" | 21 | #include "jfs_compat.h" |
22 | #define JBD2_DEBUG | 22 | #define JBD2_DEBUG |
23 | #define jfs_debug jbd_debug | ||
24 | #else | 23 | #else |
25 | 24 | ||
26 | #include <linux/types.h> | 25 | #include <linux/types.h> |
@@ -57,7 +56,7 @@ | |||
57 | * CONFIG_JBD2_DEBUG is on. | 56 | * CONFIG_JBD2_DEBUG is on. |
58 | */ | 57 | */ |
59 | #define JBD2_EXPENSIVE_CHECKING | 58 | #define JBD2_EXPENSIVE_CHECKING |
60 | extern u8 jbd2_journal_enable_debug; | 59 | extern ushort jbd2_journal_enable_debug; |
61 | 60 | ||
62 | #define jbd_debug(n, f, a...) \ | 61 | #define jbd_debug(n, f, a...) \ |
63 | do { \ | 62 | do { \ |
@@ -397,35 +396,18 @@ struct jbd2_journal_handle | |||
397 | int h_err; | 396 | int h_err; |
398 | 397 | ||
399 | /* Flags [no locking] */ | 398 | /* Flags [no locking] */ |
400 | unsigned int h_sync:1; /* sync-on-close */ | 399 | unsigned int h_sync: 1; /* sync-on-close */ |
401 | unsigned int h_jdata:1; /* force data journaling */ | 400 | unsigned int h_jdata: 1; /* force data journaling */ |
402 | unsigned int h_aborted:1; /* fatal error on handle */ | 401 | unsigned int h_aborted: 1; /* fatal error on handle */ |
403 | unsigned int h_cowing:1; /* COWing block to snapshot */ | 402 | unsigned int h_type: 8; /* for handle statistics */ |
404 | 403 | unsigned int h_line_no: 16; /* for handle statistics */ | |
405 | /* Number of buffers requested by user: | ||
406 | * (before adding the COW credits factor) */ | ||
407 | unsigned int h_base_credits:14; | ||
408 | |||
409 | /* Number of buffers the user is allowed to dirty: | ||
410 | * (counts only buffers dirtied when !h_cowing) */ | ||
411 | unsigned int h_user_credits:14; | ||
412 | 404 | ||
405 | unsigned long h_start_jiffies; | ||
406 | unsigned int h_requested_credits; | ||
413 | 407 | ||
414 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 408 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
415 | struct lockdep_map h_lockdep_map; | 409 | struct lockdep_map h_lockdep_map; |
416 | #endif | 410 | #endif |
417 | |||
418 | #ifdef CONFIG_JBD2_DEBUG | ||
419 | /* COW debugging counters: */ | ||
420 | unsigned int h_cow_moved; /* blocks moved to snapshot */ | ||
421 | unsigned int h_cow_copied; /* blocks copied to snapshot */ | ||
422 | unsigned int h_cow_ok_jh; /* blocks already COWed during current | ||
423 | transaction */ | ||
424 | unsigned int h_cow_ok_bitmap; /* blocks not set in COW bitmap */ | ||
425 | unsigned int h_cow_ok_mapped;/* blocks already mapped in snapshot */ | ||
426 | unsigned int h_cow_bitmaps; /* COW bitmaps created */ | ||
427 | unsigned int h_cow_excluded; /* blocks set in exclude bitmap */ | ||
428 | #endif | ||
429 | }; | 411 | }; |
430 | 412 | ||
431 | 413 | ||
@@ -581,6 +563,11 @@ struct transaction_s | |||
581 | unsigned long t_start; | 563 | unsigned long t_start; |
582 | 564 | ||
583 | /* | 565 | /* |
566 | * When commit was requested | ||
567 | */ | ||
568 | unsigned long t_requested; | ||
569 | |||
570 | /* | ||
584 | * Checkpointing stats [j_checkpoint_sem] | 571 | * Checkpointing stats [j_checkpoint_sem] |
585 | */ | 572 | */ |
586 | struct transaction_chp_stats_s t_chp_stats; | 573 | struct transaction_chp_stats_s t_chp_stats; |
@@ -637,6 +624,7 @@ struct transaction_s | |||
637 | 624 | ||
638 | struct transaction_run_stats_s { | 625 | struct transaction_run_stats_s { |
639 | unsigned long rs_wait; | 626 | unsigned long rs_wait; |
627 | unsigned long rs_request_delay; | ||
640 | unsigned long rs_running; | 628 | unsigned long rs_running; |
641 | unsigned long rs_locked; | 629 | unsigned long rs_locked; |
642 | unsigned long rs_flushing; | 630 | unsigned long rs_flushing; |
@@ -649,6 +637,7 @@ struct transaction_run_stats_s { | |||
649 | 637 | ||
650 | struct transaction_stats_s { | 638 | struct transaction_stats_s { |
651 | unsigned long ts_tid; | 639 | unsigned long ts_tid; |
640 | unsigned long ts_requested; | ||
652 | struct transaction_run_stats_s run; | 641 | struct transaction_run_stats_s run; |
653 | }; | 642 | }; |
654 | 643 | ||
@@ -1086,7 +1075,8 @@ static inline handle_t *journal_current_handle(void) | |||
1086 | */ | 1075 | */ |
1087 | 1076 | ||
1088 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1077 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
1089 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask); | 1078 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask, |
1079 | unsigned int type, unsigned int line_no); | ||
1090 | extern int jbd2_journal_restart(handle_t *, int nblocks); | 1080 | extern int jbd2_journal_restart(handle_t *, int nblocks); |
1091 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); | 1081 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); |
1092 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1082 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index c566927efcbd..80d36874689b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -398,7 +398,11 @@ extern int panic_on_unrecovered_nmi; | |||
398 | extern int panic_on_io_nmi; | 398 | extern int panic_on_io_nmi; |
399 | extern int sysctl_panic_on_stackoverflow; | 399 | extern int sysctl_panic_on_stackoverflow; |
400 | extern const char *print_tainted(void); | 400 | extern const char *print_tainted(void); |
401 | extern void add_taint(unsigned flag); | 401 | enum lockdep_ok { |
402 | LOCKDEP_STILL_OK, | ||
403 | LOCKDEP_NOW_UNRELIABLE | ||
404 | }; | ||
405 | extern void add_taint(unsigned flag, enum lockdep_ok); | ||
402 | extern int test_taint(unsigned flag); | 406 | extern int test_taint(unsigned flag); |
403 | extern unsigned long get_taint(void); | 407 | extern unsigned long get_taint(void); |
404 | extern int root_mountflags; | 408 | extern int root_mountflags; |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d0b8458a703a..d2e6927bbaae 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -191,6 +191,7 @@ extern struct kimage *kexec_crash_image; | |||
191 | /* Location of a reserved region to hold the crash kernel. | 191 | /* Location of a reserved region to hold the crash kernel. |
192 | */ | 192 | */ |
193 | extern struct resource crashk_res; | 193 | extern struct resource crashk_res; |
194 | extern struct resource crashk_low_res; | ||
194 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; | 195 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; |
195 | extern note_buf_t __percpu *crash_notes; | 196 | extern note_buf_t __percpu *crash_notes; |
196 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | 197 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; |
@@ -199,6 +200,8 @@ extern size_t vmcoreinfo_max_size; | |||
199 | 200 | ||
200 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
201 | unsigned long long *crash_size, unsigned long long *crash_base); | 202 | unsigned long long *crash_size, unsigned long long *crash_base); |
203 | int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, | ||
204 | unsigned long long *crash_size, unsigned long long *crash_base); | ||
202 | int crash_shrink_memory(unsigned long new_size); | 205 | int crash_shrink_memory(unsigned long new_size); |
203 | size_t crash_get_memory_size(void); | 206 | size_t crash_get_memory_size(void); |
204 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); | 207 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 4dff0c6ed58f..c6e091bf39a5 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #ifndef _KGDB_H_ | 13 | #ifndef _KGDB_H_ |
14 | #define _KGDB_H_ | 14 | #define _KGDB_H_ |
15 | 15 | ||
16 | #include <linux/serial_8250.h> | ||
17 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
19 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 3319a6967626..45c9b6a17bcb 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
@@ -16,9 +16,6 @@ | |||
16 | struct stable_node; | 16 | struct stable_node; |
17 | struct mem_cgroup; | 17 | struct mem_cgroup; |
18 | 18 | ||
19 | struct page *ksm_does_need_to_copy(struct page *page, | ||
20 | struct vm_area_struct *vma, unsigned long address); | ||
21 | |||
22 | #ifdef CONFIG_KSM | 19 | #ifdef CONFIG_KSM |
23 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | 20 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, |
24 | unsigned long end, int advice, unsigned long *vm_flags); | 21 | unsigned long end, int advice, unsigned long *vm_flags); |
@@ -73,15 +70,8 @@ static inline void set_page_stable_node(struct page *page, | |||
73 | * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, | 70 | * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, |
74 | * but what if the vma was unmerged while the page was swapped out? | 71 | * but what if the vma was unmerged while the page was swapped out? |
75 | */ | 72 | */ |
76 | static inline int ksm_might_need_to_copy(struct page *page, | 73 | struct page *ksm_might_need_to_copy(struct page *page, |
77 | struct vm_area_struct *vma, unsigned long address) | 74 | struct vm_area_struct *vma, unsigned long address); |
78 | { | ||
79 | struct anon_vma *anon_vma = page_anon_vma(page); | ||
80 | |||
81 | return anon_vma && | ||
82 | (anon_vma->root != vma->anon_vma->root || | ||
83 | page->index != linear_page_index(vma, address)); | ||
84 | } | ||
85 | 75 | ||
86 | int page_referenced_ksm(struct page *page, | 76 | int page_referenced_ksm(struct page *page, |
87 | struct mem_cgroup *memcg, unsigned long *vm_flags); | 77 | struct mem_cgroup *memcg, unsigned long *vm_flags); |
@@ -113,10 +103,10 @@ static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | |||
113 | return 0; | 103 | return 0; |
114 | } | 104 | } |
115 | 105 | ||
116 | static inline int ksm_might_need_to_copy(struct page *page, | 106 | static inline struct page *ksm_might_need_to_copy(struct page *page, |
117 | struct vm_area_struct *vma, unsigned long address) | 107 | struct vm_area_struct *vma, unsigned long address) |
118 | { | 108 | { |
119 | return 0; | 109 | return page; |
120 | } | 110 | } |
121 | 111 | ||
122 | static inline int page_referenced_ksm(struct page *page, | 112 | static inline int page_referenced_ksm(struct page *page, |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b7996a768eb2..cad77fe09d77 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -123,6 +123,8 @@ static inline bool is_error_page(struct page *page) | |||
123 | #define KVM_REQ_WATCHDOG 18 | 123 | #define KVM_REQ_WATCHDOG 18 |
124 | #define KVM_REQ_MASTERCLOCK_UPDATE 19 | 124 | #define KVM_REQ_MASTERCLOCK_UPDATE 19 |
125 | #define KVM_REQ_MCLOCK_INPROGRESS 20 | 125 | #define KVM_REQ_MCLOCK_INPROGRESS 20 |
126 | #define KVM_REQ_EPR_EXIT 21 | ||
127 | #define KVM_REQ_EOIBITMAP 22 | ||
126 | 128 | ||
127 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 129 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
128 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 | 130 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 |
@@ -267,12 +269,11 @@ static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu) | |||
267 | struct kvm_memory_slot { | 269 | struct kvm_memory_slot { |
268 | gfn_t base_gfn; | 270 | gfn_t base_gfn; |
269 | unsigned long npages; | 271 | unsigned long npages; |
270 | unsigned long flags; | ||
271 | unsigned long *dirty_bitmap; | 272 | unsigned long *dirty_bitmap; |
272 | struct kvm_arch_memory_slot arch; | 273 | struct kvm_arch_memory_slot arch; |
273 | unsigned long userspace_addr; | 274 | unsigned long userspace_addr; |
274 | int user_alloc; | 275 | u32 flags; |
275 | int id; | 276 | short id; |
276 | }; | 277 | }; |
277 | 278 | ||
278 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | 279 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) |
@@ -314,8 +315,12 @@ struct kvm_irq_routing_table {}; | |||
314 | 315 | ||
315 | #endif | 316 | #endif |
316 | 317 | ||
318 | #ifndef KVM_PRIVATE_MEM_SLOTS | ||
319 | #define KVM_PRIVATE_MEM_SLOTS 0 | ||
320 | #endif | ||
321 | |||
317 | #ifndef KVM_MEM_SLOTS_NUM | 322 | #ifndef KVM_MEM_SLOTS_NUM |
318 | #define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) | 323 | #define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS) |
319 | #endif | 324 | #endif |
320 | 325 | ||
321 | /* | 326 | /* |
@@ -327,7 +332,7 @@ struct kvm_memslots { | |||
327 | u64 generation; | 332 | u64 generation; |
328 | struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; | 333 | struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; |
329 | /* The mapping table from slot id to the index in memslots[]. */ | 334 | /* The mapping table from slot id to the index in memslots[]. */ |
330 | int id_to_index[KVM_MEM_SLOTS_NUM]; | 335 | short id_to_index[KVM_MEM_SLOTS_NUM]; |
331 | }; | 336 | }; |
332 | 337 | ||
333 | struct kvm { | 338 | struct kvm { |
@@ -425,7 +430,8 @@ void kvm_exit(void); | |||
425 | 430 | ||
426 | void kvm_get_kvm(struct kvm *kvm); | 431 | void kvm_get_kvm(struct kvm *kvm); |
427 | void kvm_put_kvm(struct kvm *kvm); | 432 | void kvm_put_kvm(struct kvm *kvm); |
428 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new); | 433 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new, |
434 | u64 last_generation); | ||
429 | 435 | ||
430 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 436 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |
431 | { | 437 | { |
@@ -448,10 +454,10 @@ id_to_memslot(struct kvm_memslots *slots, int id) | |||
448 | 454 | ||
449 | int kvm_set_memory_region(struct kvm *kvm, | 455 | int kvm_set_memory_region(struct kvm *kvm, |
450 | struct kvm_userspace_memory_region *mem, | 456 | struct kvm_userspace_memory_region *mem, |
451 | int user_alloc); | 457 | bool user_alloc); |
452 | int __kvm_set_memory_region(struct kvm *kvm, | 458 | int __kvm_set_memory_region(struct kvm *kvm, |
453 | struct kvm_userspace_memory_region *mem, | 459 | struct kvm_userspace_memory_region *mem, |
454 | int user_alloc); | 460 | bool user_alloc); |
455 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | 461 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, |
456 | struct kvm_memory_slot *dont); | 462 | struct kvm_memory_slot *dont); |
457 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | 463 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); |
@@ -459,11 +465,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
459 | struct kvm_memory_slot *memslot, | 465 | struct kvm_memory_slot *memslot, |
460 | struct kvm_memory_slot old, | 466 | struct kvm_memory_slot old, |
461 | struct kvm_userspace_memory_region *mem, | 467 | struct kvm_userspace_memory_region *mem, |
462 | int user_alloc); | 468 | bool user_alloc); |
463 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 469 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
464 | struct kvm_userspace_memory_region *mem, | 470 | struct kvm_userspace_memory_region *mem, |
465 | struct kvm_memory_slot old, | 471 | struct kvm_memory_slot old, |
466 | int user_alloc); | 472 | bool user_alloc); |
467 | bool kvm_largepages_enabled(void); | 473 | bool kvm_largepages_enabled(void); |
468 | void kvm_disable_largepages(void); | 474 | void kvm_disable_largepages(void); |
469 | /* flush all memory translations */ | 475 | /* flush all memory translations */ |
@@ -533,6 +539,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | |||
533 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 539 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
534 | void kvm_reload_remote_mmus(struct kvm *kvm); | 540 | void kvm_reload_remote_mmus(struct kvm *kvm); |
535 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); | 541 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); |
542 | void kvm_make_update_eoibitmap_request(struct kvm *kvm); | ||
536 | 543 | ||
537 | long kvm_arch_dev_ioctl(struct file *filp, | 544 | long kvm_arch_dev_ioctl(struct file *filp, |
538 | unsigned int ioctl, unsigned long arg); | 545 | unsigned int ioctl, unsigned long arg); |
@@ -550,7 +557,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
550 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | 557 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, |
551 | struct | 558 | struct |
552 | kvm_userspace_memory_region *mem, | 559 | kvm_userspace_memory_region *mem, |
553 | int user_alloc); | 560 | bool user_alloc); |
554 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); | 561 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); |
555 | long kvm_arch_vm_ioctl(struct file *filp, | 562 | long kvm_arch_vm_ioctl(struct file *filp, |
556 | unsigned int ioctl, unsigned long arg); | 563 | unsigned int ioctl, unsigned long arg); |
@@ -686,6 +693,7 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | |||
686 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 693 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
687 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | 694 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, |
688 | int irq_source_id, int level); | 695 | int irq_source_id, int level); |
696 | bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); | ||
689 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 697 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
690 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 698 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
691 | struct kvm_irq_ack_notifier *kian); | 699 | struct kvm_irq_ack_notifier *kian); |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h deleted file mode 100644 index 3f071ec019b2..000000000000 --- a/include/linux/leds-lp5521.h +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /* | ||
2 | * LP5521 LED chip driver. | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * 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, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5521_H | ||
24 | #define __LINUX_LP5521_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5521.txt */ | ||
27 | |||
28 | struct lp5521_led_config { | ||
29 | char *name; | ||
30 | u8 chan_nr; | ||
31 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
32 | u8 max_current; | ||
33 | }; | ||
34 | |||
35 | struct lp5521_led_pattern { | ||
36 | u8 *r; | ||
37 | u8 *g; | ||
38 | u8 *b; | ||
39 | u8 size_r; | ||
40 | u8 size_g; | ||
41 | u8 size_b; | ||
42 | }; | ||
43 | |||
44 | #define LP5521_CLOCK_AUTO 0 | ||
45 | #define LP5521_CLOCK_INT 1 | ||
46 | #define LP5521_CLOCK_EXT 2 | ||
47 | |||
48 | /* Bits in CONFIG register */ | ||
49 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
50 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
51 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
52 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
53 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
54 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
55 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
56 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
57 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
58 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
59 | |||
60 | struct lp5521_platform_data { | ||
61 | struct lp5521_led_config *led_config; | ||
62 | u8 num_channels; | ||
63 | u8 clock_mode; | ||
64 | int (*setup_resources)(void); | ||
65 | void (*release_resources)(void); | ||
66 | void (*enable)(bool state); | ||
67 | const char *label; | ||
68 | u8 update_config; | ||
69 | struct lp5521_led_pattern *patterns; | ||
70 | int num_patterns; | ||
71 | }; | ||
72 | |||
73 | #endif /* __LINUX_LP5521_H */ | ||
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h deleted file mode 100644 index 727877fb406d..000000000000 --- a/include/linux/leds-lp5523.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * LP5523 LED Driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * 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, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5523_H | ||
24 | #define __LINUX_LP5523_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5523.txt */ | ||
27 | |||
28 | struct lp5523_led_config { | ||
29 | const char *name; | ||
30 | u8 chan_nr; | ||
31 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
32 | u8 max_current; | ||
33 | }; | ||
34 | |||
35 | #define LP5523_CLOCK_AUTO 0 | ||
36 | #define LP5523_CLOCK_INT 1 | ||
37 | #define LP5523_CLOCK_EXT 2 | ||
38 | |||
39 | struct lp5523_platform_data { | ||
40 | struct lp5523_led_config *led_config; | ||
41 | u8 num_channels; | ||
42 | u8 clock_mode; | ||
43 | int (*setup_resources)(void); | ||
44 | void (*release_resources)(void); | ||
45 | void (*enable)(bool state); | ||
46 | const char *label; | ||
47 | }; | ||
48 | |||
49 | #endif /* __LINUX_LP5523_H */ | ||
diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h index 33a071167489..a65e9646e4b1 100644 --- a/include/linux/leds_pwm.h +++ b/include/linux/leds_pwm.h | |||
@@ -7,7 +7,7 @@ | |||
7 | struct led_pwm { | 7 | struct led_pwm { |
8 | const char *name; | 8 | const char *name; |
9 | const char *default_trigger; | 9 | const char *default_trigger; |
10 | unsigned pwm_id; | 10 | unsigned pwm_id __deprecated; |
11 | u8 active_low; | 11 | u8 active_low; |
12 | unsigned max_brightness; | 12 | unsigned max_brightness; |
13 | unsigned pwm_period_ns; | 13 | unsigned pwm_period_ns; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 649e5f86b5f0..91c9d109e5f1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -620,6 +620,9 @@ struct ata_device { | |||
620 | union acpi_object *gtf_cache; | 620 | union acpi_object *gtf_cache; |
621 | unsigned int gtf_filter; | 621 | unsigned int gtf_filter; |
622 | #endif | 622 | #endif |
623 | #ifdef CONFIG_SATA_ZPODD | ||
624 | void *zpodd; | ||
625 | #endif | ||
623 | struct device tdev; | 626 | struct device tdev; |
624 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ | 627 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
625 | u64 n_sectors; /* size of device, if ATA */ | 628 | u64 n_sectors; /* size of device, if ATA */ |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index 79603a6c356f..4ad06e824f76 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -36,7 +36,7 @@ struct ps2dev { | |||
36 | wait_queue_head_t wait; | 36 | wait_queue_head_t wait; |
37 | 37 | ||
38 | unsigned long flags; | 38 | unsigned long flags; |
39 | unsigned char cmdbuf[6]; | 39 | unsigned char cmdbuf[8]; |
40 | unsigned char cmdcnt; | 40 | unsigned char cmdcnt; |
41 | unsigned char nak; | 41 | unsigned char nak; |
42 | }; | 42 | }; |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 2bca44b0893c..f1e877b79ed8 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -359,7 +359,9 @@ extern void lockdep_trace_alloc(gfp_t mask); | |||
359 | 359 | ||
360 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) | 360 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
361 | 361 | ||
362 | #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) | 362 | #define lockdep_assert_held(l) do { \ |
363 | WARN_ON(debug_locks && !lockdep_is_held(l)); \ | ||
364 | } while (0) | ||
363 | 365 | ||
364 | #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) | 366 | #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) |
365 | 367 | ||
@@ -410,7 +412,7 @@ struct lock_class_key { }; | |||
410 | 412 | ||
411 | #define lockdep_depth(tsk) (0) | 413 | #define lockdep_depth(tsk) (0) |
412 | 414 | ||
413 | #define lockdep_assert_held(l) do { } while (0) | 415 | #define lockdep_assert_held(l) do { (void)(l); } while (0) |
414 | 416 | ||
415 | #define lockdep_recursing(tsk) (0) | 417 | #define lockdep_recursing(tsk) (0) |
416 | 418 | ||
diff --git a/include/linux/mailbox.h b/include/linux/mailbox.h new file mode 100644 index 000000000000..5161f63ec1c8 --- /dev/null +++ b/include/linux/mailbox.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms and conditions of the GNU General Public License, | ||
4 | * version 2, as published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
7 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
8 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
9 | * more details. | ||
10 | * | ||
11 | * You should have received a copy of the GNU General Public License along with | ||
12 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
13 | */ | ||
14 | |||
15 | int pl320_ipc_transmit(u32 *data); | ||
16 | int pl320_ipc_register_notifier(struct notifier_block *nb); | ||
17 | int pl320_ipc_unregister_notifier(struct notifier_block *nb); | ||
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index d452ee191066..3e5ecb2d790e 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -42,6 +42,7 @@ struct memblock { | |||
42 | 42 | ||
43 | extern struct memblock memblock; | 43 | extern struct memblock memblock; |
44 | extern int memblock_debug; | 44 | extern int memblock_debug; |
45 | extern struct movablemem_map movablemem_map; | ||
45 | 46 | ||
46 | #define memblock_dbg(fmt, ...) \ | 47 | #define memblock_dbg(fmt, ...) \ |
47 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 48 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
@@ -60,6 +61,7 @@ int memblock_reserve(phys_addr_t base, phys_addr_t size); | |||
60 | void memblock_trim_memory(phys_addr_t align); | 61 | void memblock_trim_memory(phys_addr_t align); |
61 | 62 | ||
62 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 63 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
64 | |||
63 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, | 65 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
64 | unsigned long *out_end_pfn, int *out_nid); | 66 | unsigned long *out_end_pfn, int *out_nid); |
65 | 67 | ||
@@ -155,6 +157,7 @@ phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, | |||
155 | phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, | 157 | phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, |
156 | phys_addr_t max_addr); | 158 | phys_addr_t max_addr); |
157 | phys_addr_t memblock_phys_mem_size(void); | 159 | phys_addr_t memblock_phys_mem_size(void); |
160 | phys_addr_t memblock_mem_size(unsigned long limit_pfn); | ||
158 | phys_addr_t memblock_start_of_DRAM(void); | 161 | phys_addr_t memblock_start_of_DRAM(void); |
159 | phys_addr_t memblock_end_of_DRAM(void); | 162 | phys_addr_t memblock_end_of_DRAM(void); |
160 | void memblock_enforce_memory_limit(phys_addr_t memory_limit); | 163 | void memblock_enforce_memory_limit(phys_addr_t memory_limit); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 28bd5fa2ff2e..d6183f06d8c1 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -116,7 +116,6 @@ void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | |||
116 | * For memory reclaim. | 116 | * For memory reclaim. |
117 | */ | 117 | */ |
118 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); | 118 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); |
119 | int mem_cgroup_inactive_file_is_low(struct lruvec *lruvec); | ||
120 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 119 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
121 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); | 120 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); |
122 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); | 121 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); |
@@ -321,12 +320,6 @@ mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec) | |||
321 | return 1; | 320 | return 1; |
322 | } | 321 | } |
323 | 322 | ||
324 | static inline int | ||
325 | mem_cgroup_inactive_file_is_low(struct lruvec *lruvec) | ||
326 | { | ||
327 | return 1; | ||
328 | } | ||
329 | |||
330 | static inline unsigned long | 323 | static inline unsigned long |
331 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) | 324 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
332 | { | 325 | { |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4a45c4e50025..b6a3be7d47bf 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -96,6 +96,7 @@ extern void __online_page_free(struct page *page); | |||
96 | 96 | ||
97 | #ifdef CONFIG_MEMORY_HOTREMOVE | 97 | #ifdef CONFIG_MEMORY_HOTREMOVE |
98 | extern bool is_pageblock_removable_nolock(struct page *page); | 98 | extern bool is_pageblock_removable_nolock(struct page *page); |
99 | extern int arch_remove_memory(u64 start, u64 size); | ||
99 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 100 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
100 | 101 | ||
101 | /* reasonably generic interface to expand the physical pages in a zone */ | 102 | /* reasonably generic interface to expand the physical pages in a zone */ |
@@ -173,17 +174,16 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | |||
173 | #endif /* CONFIG_NUMA */ | 174 | #endif /* CONFIG_NUMA */ |
174 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | 175 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ |
175 | 176 | ||
176 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 177 | #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE |
178 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
179 | #else | ||
177 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | 180 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) |
178 | { | 181 | { |
179 | } | 182 | } |
180 | static inline void put_page_bootmem(struct page *page) | ||
181 | { | ||
182 | } | ||
183 | #else | ||
184 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
185 | extern void put_page_bootmem(struct page *page); | ||
186 | #endif | 183 | #endif |
184 | extern void put_page_bootmem(struct page *page); | ||
185 | extern void get_page_bootmem(unsigned long ingo, struct page *page, | ||
186 | unsigned long type); | ||
187 | 187 | ||
188 | /* | 188 | /* |
189 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | 189 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug |
@@ -233,6 +233,7 @@ static inline void unlock_memory_hotplug(void) {} | |||
233 | #ifdef CONFIG_MEMORY_HOTREMOVE | 233 | #ifdef CONFIG_MEMORY_HOTREMOVE |
234 | 234 | ||
235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
236 | extern void try_offline_node(int nid); | ||
236 | 237 | ||
237 | #else | 238 | #else |
238 | static inline int is_mem_section_removable(unsigned long pfn, | 239 | static inline int is_mem_section_removable(unsigned long pfn, |
@@ -240,6 +241,8 @@ static inline int is_mem_section_removable(unsigned long pfn, | |||
240 | { | 241 | { |
241 | return 0; | 242 | return 0; |
242 | } | 243 | } |
244 | |||
245 | static inline void try_offline_node(int nid) {} | ||
243 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 246 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
244 | 247 | ||
245 | extern int mem_online_node(int nid); | 248 | extern int mem_online_node(int nid); |
@@ -247,7 +250,8 @@ extern int add_memory(int nid, u64 start, u64 size); | |||
247 | extern int arch_add_memory(int nid, u64 start, u64 size); | 250 | extern int arch_add_memory(int nid, u64 start, u64 size); |
248 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | 251 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); |
249 | extern int offline_memory_block(struct memory_block *mem); | 252 | extern int offline_memory_block(struct memory_block *mem); |
250 | extern int remove_memory(u64 start, u64 size); | 253 | extern bool is_memblock_offlined(struct memory_block *mem); |
254 | extern int remove_memory(int nid, u64 start, u64 size); | ||
251 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | 255 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, |
252 | int nr_pages); | 256 | int nr_pages); |
253 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); | 257 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); |
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index 478672ed0c3d..e94537befabd 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h | |||
@@ -365,5 +365,5 @@ static inline int pm80x_dev_resume(struct device *dev) | |||
365 | 365 | ||
366 | extern int pm80x_init(struct i2c_client *client, | 366 | extern int pm80x_init(struct i2c_client *client, |
367 | const struct i2c_device_id *id); | 367 | const struct i2c_device_id *id); |
368 | extern int pm80x_deinit(struct i2c_client *client); | 368 | extern int pm80x_deinit(void); |
369 | #endif /* __LINUX_MFD_88PM80X_H */ | 369 | #endif /* __LINUX_MFD_88PM80X_H */ |
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index e53dcfeaee69..9ead60bc66b7 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -131,7 +131,7 @@ struct abx500_maxim_parameters { | |||
131 | * @nominal_voltage: Nominal voltage of the battery in mV | 131 | * @nominal_voltage: Nominal voltage of the battery in mV |
132 | * @termination_vol: max voltage upto which battery can be charged | 132 | * @termination_vol: max voltage upto which battery can be charged |
133 | * @termination_curr battery charging termination current in mA | 133 | * @termination_curr battery charging termination current in mA |
134 | * @recharge_vol battery voltage limit that will trigger a new | 134 | * @recharge_cap battery capacity limit that will trigger a new |
135 | * full charging cycle in the case where maintenan- | 135 | * full charging cycle in the case where maintenan- |
136 | * -ce charging has been disabled | 136 | * -ce charging has been disabled |
137 | * @normal_cur_lvl: charger current in normal state in mA | 137 | * @normal_cur_lvl: charger current in normal state in mA |
@@ -160,7 +160,7 @@ struct abx500_battery_type { | |||
160 | int nominal_voltage; | 160 | int nominal_voltage; |
161 | int termination_vol; | 161 | int termination_vol; |
162 | int termination_curr; | 162 | int termination_curr; |
163 | int recharge_vol; | 163 | int recharge_cap; |
164 | int normal_cur_lvl; | 164 | int normal_cur_lvl; |
165 | int normal_vol_lvl; | 165 | int normal_vol_lvl; |
166 | int maint_a_cur_lvl; | 166 | int maint_a_cur_lvl; |
@@ -224,6 +224,7 @@ struct abx500_bm_charger_parameters { | |||
224 | * @bkup_bat_v voltage which we charge the backup battery with | 224 | * @bkup_bat_v voltage which we charge the backup battery with |
225 | * @bkup_bat_i current which we charge the backup battery with | 225 | * @bkup_bat_i current which we charge the backup battery with |
226 | * @no_maintenance indicates that maintenance charging is disabled | 226 | * @no_maintenance indicates that maintenance charging is disabled |
227 | * @capacity_scaling indicates whether capacity scaling is to be used | ||
227 | * @abx500_adc_therm placement of thermistor, batctrl or battemp adc | 228 | * @abx500_adc_therm placement of thermistor, batctrl or battemp adc |
228 | * @chg_unknown_bat flag to enable charging of unknown batteries | 229 | * @chg_unknown_bat flag to enable charging of unknown batteries |
229 | * @enable_overshoot flag to enable VBAT overshoot control | 230 | * @enable_overshoot flag to enable VBAT overshoot control |
@@ -253,7 +254,11 @@ struct abx500_bm_data { | |||
253 | int usb_safety_tmr_h; | 254 | int usb_safety_tmr_h; |
254 | int bkup_bat_v; | 255 | int bkup_bat_v; |
255 | int bkup_bat_i; | 256 | int bkup_bat_i; |
257 | bool autopower_cfg; | ||
258 | bool ac_enabled; | ||
259 | bool usb_enabled; | ||
256 | bool no_maintenance; | 260 | bool no_maintenance; |
261 | bool capacity_scaling; | ||
257 | bool chg_unknown_bat; | 262 | bool chg_unknown_bat; |
258 | bool enable_overshoot; | 263 | bool enable_overshoot; |
259 | bool auto_trig; | 264 | bool auto_trig; |
@@ -277,9 +282,9 @@ enum { | |||
277 | NTC_INTERNAL, | 282 | NTC_INTERNAL, |
278 | }; | 283 | }; |
279 | 284 | ||
280 | int bmdevs_of_probe(struct device *dev, | 285 | int ab8500_bm_of_probe(struct device *dev, |
281 | struct device_node *np, | 286 | struct device_node *np, |
282 | struct abx500_bm_data **battery); | 287 | struct abx500_bm_data *bm); |
283 | 288 | ||
284 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, | 289 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, |
285 | u8 value); | 290 | u8 value); |
@@ -306,6 +311,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, | |||
306 | int abx500_get_chip_id(struct device *dev); | 311 | int abx500_get_chip_id(struct device *dev); |
307 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); | 312 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); |
308 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); | 313 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); |
314 | void abx500_dump_all_banks(void); | ||
309 | 315 | ||
310 | struct abx500_ops { | 316 | struct abx500_ops { |
311 | int (*get_chip_id) (struct device *); | 317 | int (*get_chip_id) (struct device *); |
@@ -316,6 +322,7 @@ struct abx500_ops { | |||
316 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); | 322 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); |
317 | int (*event_registers_startup_state_get) (struct device *, u8 *); | 323 | int (*event_registers_startup_state_get) (struct device *, u8 *); |
318 | int (*startup_irq_enabled) (struct device *, unsigned int); | 324 | int (*startup_irq_enabled) (struct device *, unsigned int); |
325 | void (*dump_all_banks) (struct device *); | ||
319 | }; | 326 | }; |
320 | 327 | ||
321 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); | 328 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); |
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index 9bd037df97d9..8d35bfe164c8 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
@@ -23,6 +23,7 @@ | |||
23 | * Bank : 0x5 | 23 | * Bank : 0x5 |
24 | */ | 24 | */ |
25 | #define AB8500_USB_LINE_STAT_REG 0x80 | 25 | #define AB8500_USB_LINE_STAT_REG 0x80 |
26 | #define AB8500_USB_LINK1_STAT_REG 0x94 | ||
26 | 27 | ||
27 | /* | 28 | /* |
28 | * Charger / status register offfsets | 29 | * Charger / status register offfsets |
@@ -225,6 +226,8 @@ | |||
225 | /* BatCtrl Current Source Constants */ | 226 | /* BatCtrl Current Source Constants */ |
226 | #define BAT_CTRL_7U_ENA 0x01 | 227 | #define BAT_CTRL_7U_ENA 0x01 |
227 | #define BAT_CTRL_20U_ENA 0x02 | 228 | #define BAT_CTRL_20U_ENA 0x02 |
229 | #define BAT_CTRL_18U_ENA 0x01 | ||
230 | #define BAT_CTRL_16U_ENA 0x02 | ||
228 | #define BAT_CTRL_CMP_ENA 0x04 | 231 | #define BAT_CTRL_CMP_ENA 0x04 |
229 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 | 232 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 |
230 | #define BAT_CTRL_PULL_UP_ENA 0x10 | 233 | #define BAT_CTRL_PULL_UP_ENA 0x10 |
@@ -355,6 +358,7 @@ struct ab8500_bm_charger_parameters { | |||
355 | * @bkup_bat_v voltage which we charge the backup battery with | 358 | * @bkup_bat_v voltage which we charge the backup battery with |
356 | * @bkup_bat_i current which we charge the backup battery with | 359 | * @bkup_bat_i current which we charge the backup battery with |
357 | * @no_maintenance indicates that maintenance charging is disabled | 360 | * @no_maintenance indicates that maintenance charging is disabled |
361 | * @capacity_scaling indicates whether capacity scaling is to be used | ||
358 | * @adc_therm placement of thermistor, batctrl or battemp adc | 362 | * @adc_therm placement of thermistor, batctrl or battemp adc |
359 | * @chg_unknown_bat flag to enable charging of unknown batteries | 363 | * @chg_unknown_bat flag to enable charging of unknown batteries |
360 | * @enable_overshoot flag to enable VBAT overshoot control | 364 | * @enable_overshoot flag to enable VBAT overshoot control |
@@ -383,6 +387,7 @@ struct ab8500_bm_data { | |||
383 | int bkup_bat_v; | 387 | int bkup_bat_v; |
384 | int bkup_bat_i; | 388 | int bkup_bat_i; |
385 | bool no_maintenance; | 389 | bool no_maintenance; |
390 | bool capacity_scaling; | ||
386 | bool chg_unknown_bat; | 391 | bool chg_unknown_bat; |
387 | bool enable_overshoot; | 392 | bool enable_overshoot; |
388 | enum abx500_adc_therm adc_therm; | 393 | enum abx500_adc_therm adc_therm; |
@@ -399,26 +404,6 @@ struct ab8500_bm_data { | |||
399 | const struct ab8500_fg_parameters *fg_params; | 404 | const struct ab8500_fg_parameters *fg_params; |
400 | }; | 405 | }; |
401 | 406 | ||
402 | struct ab8500_charger_platform_data { | ||
403 | char **supplied_to; | ||
404 | size_t num_supplicants; | ||
405 | bool autopower_cfg; | ||
406 | }; | ||
407 | |||
408 | struct ab8500_btemp_platform_data { | ||
409 | char **supplied_to; | ||
410 | size_t num_supplicants; | ||
411 | }; | ||
412 | |||
413 | struct ab8500_fg_platform_data { | ||
414 | char **supplied_to; | ||
415 | size_t num_supplicants; | ||
416 | }; | ||
417 | |||
418 | struct ab8500_chargalg_platform_data { | ||
419 | char **supplied_to; | ||
420 | size_t num_supplicants; | ||
421 | }; | ||
422 | struct ab8500_btemp; | 407 | struct ab8500_btemp; |
423 | struct ab8500_gpadc; | 408 | struct ab8500_gpadc; |
424 | struct ab8500_fg; | 409 | struct ab8500_fg; |
@@ -434,20 +419,10 @@ struct ab8500_fg *ab8500_fg_get(void); | |||
434 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); | 419 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); |
435 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); | 420 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); |
436 | int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res); | 421 | int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res); |
422 | int ab8500_fg_inst_curr_started(struct ab8500_fg *di); | ||
437 | int ab8500_fg_inst_curr_done(struct ab8500_fg *di); | 423 | int ab8500_fg_inst_curr_done(struct ab8500_fg *di); |
438 | 424 | ||
439 | #else | 425 | #else |
440 | static struct abx500_bm_data ab8500_bm_data; | 426 | static struct abx500_bm_data ab8500_bm_data; |
441 | |||
442 | static inline int ab8500_fg_inst_curr_start(struct ab8500_fg *di) | ||
443 | { | ||
444 | return -ENODEV; | ||
445 | } | ||
446 | |||
447 | static inline int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res) | ||
448 | { | ||
449 | return -ENODEV; | ||
450 | } | ||
451 | |||
452 | #endif | 427 | #endif |
453 | #endif /* _AB8500_BM_H */ | 428 | #endif /* _AB8500_BM_H */ |
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h index 2387c207ea86..172b2f201ae0 100644 --- a/include/linux/mfd/abx500/ab8500-gpio.h +++ b/include/linux/mfd/abx500/ab8500-gpio.h | |||
@@ -14,10 +14,20 @@ | |||
14 | * registers. | 14 | * registers. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | struct ab8500_gpio_platform_data { | 17 | struct abx500_gpio_platform_data { |
18 | int gpio_base; | 18 | int gpio_base; |
19 | u32 irq_base; | 19 | }; |
20 | u8 config_reg[8]; | 20 | |
21 | enum abx500_gpio_pull_updown { | ||
22 | ABX500_GPIO_PULL_DOWN = 0x0, | ||
23 | ABX500_GPIO_PULL_NONE = 0x1, | ||
24 | ABX500_GPIO_PULL_UP = 0x3, | ||
25 | }; | ||
26 | |||
27 | enum abx500_gpio_vinsel { | ||
28 | ABX500_GPIO_VINSEL_VBAT = 0x0, | ||
29 | ABX500_GPIO_VINSEL_VIN_1V8 = 0x1, | ||
30 | ABX500_GPIO_VINSEL_VDD_BIF = 0x2, | ||
21 | }; | 31 | }; |
22 | 32 | ||
23 | #endif /* _AB8500_GPIO_H */ | 33 | #endif /* _AB8500_GPIO_H */ |
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 10eb50973c39..ebf12e793db9 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
@@ -37,6 +37,11 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits) | |||
37 | return ab8500_sysctrl_write(reg, bits, 0); | 37 | return ab8500_sysctrl_write(reg, bits, 0); |
38 | } | 38 | } |
39 | 39 | ||
40 | /* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ | ||
41 | struct ab8500_sysctrl_platform_data { | ||
42 | u8 initial_req_buf_config[8]; | ||
43 | }; | ||
44 | |||
40 | /* Registers */ | 45 | /* Registers */ |
41 | #define AB8500_TURNONSTATUS 0x100 | 46 | #define AB8500_TURNONSTATUS 0x100 |
42 | #define AB8500_RESETSTATUS 0x101 | 47 | #define AB8500_RESETSTATUS 0x101 |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 1cb5698b4d76..9db0bda446a0 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -24,7 +24,7 @@ enum ab8500_version { | |||
24 | AB8500_VERSION_AB8500 = 0x0, | 24 | AB8500_VERSION_AB8500 = 0x0, |
25 | AB8500_VERSION_AB8505 = 0x1, | 25 | AB8500_VERSION_AB8505 = 0x1, |
26 | AB8500_VERSION_AB9540 = 0x2, | 26 | AB8500_VERSION_AB9540 = 0x2, |
27 | AB8500_VERSION_AB8540 = 0x3, | 27 | AB8500_VERSION_AB8540 = 0x4, |
28 | AB8500_VERSION_UNDEFINED, | 28 | AB8500_VERSION_UNDEFINED, |
29 | }; | 29 | }; |
30 | 30 | ||
@@ -32,6 +32,7 @@ enum ab8500_version { | |||
32 | #define AB8500_CUTEARLY 0x00 | 32 | #define AB8500_CUTEARLY 0x00 |
33 | #define AB8500_CUT1P0 0x10 | 33 | #define AB8500_CUT1P0 0x10 |
34 | #define AB8500_CUT1P1 0x11 | 34 | #define AB8500_CUT1P1 0x11 |
35 | #define AB8500_CUT1P2 0x12 /* Only valid for AB8540 */ | ||
35 | #define AB8500_CUT2P0 0x20 | 36 | #define AB8500_CUT2P0 0x20 |
36 | #define AB8500_CUT3P0 0x30 | 37 | #define AB8500_CUT3P0 0x30 |
37 | #define AB8500_CUT3P3 0x33 | 38 | #define AB8500_CUT3P3 0x33 |
@@ -39,6 +40,7 @@ enum ab8500_version { | |||
39 | /* | 40 | /* |
40 | * AB8500 bank addresses | 41 | * AB8500 bank addresses |
41 | */ | 42 | */ |
43 | #define AB8500_M_FSM_RANK 0x0 | ||
42 | #define AB8500_SYS_CTRL1_BLOCK 0x1 | 44 | #define AB8500_SYS_CTRL1_BLOCK 0x1 |
43 | #define AB8500_SYS_CTRL2_BLOCK 0x2 | 45 | #define AB8500_SYS_CTRL2_BLOCK 0x2 |
44 | #define AB8500_REGU_CTRL1 0x3 | 46 | #define AB8500_REGU_CTRL1 0x3 |
@@ -58,6 +60,7 @@ enum ab8500_version { | |||
58 | #define AB8500_DEVELOPMENT 0x11 | 60 | #define AB8500_DEVELOPMENT 0x11 |
59 | #define AB8500_DEBUG 0x12 | 61 | #define AB8500_DEBUG 0x12 |
60 | #define AB8500_PROD_TEST 0x13 | 62 | #define AB8500_PROD_TEST 0x13 |
63 | #define AB8500_STE_TEST 0x14 | ||
61 | #define AB8500_OTP_EMUL 0x15 | 64 | #define AB8500_OTP_EMUL 0x15 |
62 | 65 | ||
63 | /* | 66 | /* |
@@ -65,11 +68,11 @@ enum ab8500_version { | |||
65 | * Values used to index into array ab8500_irq_regoffset[] defined in | 68 | * Values used to index into array ab8500_irq_regoffset[] defined in |
66 | * drivers/mdf/ab8500-core.c | 69 | * drivers/mdf/ab8500-core.c |
67 | */ | 70 | */ |
68 | /* Definitions for AB8500 and AB9540 */ | 71 | /* Definitions for AB8500, AB9540 and AB8540 */ |
69 | /* ab8500_irq_regoffset[0] -> IT[Source|Latch|Mask]1 */ | 72 | /* ab8500_irq_regoffset[0] -> IT[Source|Latch|Mask]1 */ |
70 | #define AB8500_INT_MAIN_EXT_CH_NOT_OK 0 /* not 8505/9540 */ | 73 | #define AB8500_INT_MAIN_EXT_CH_NOT_OK 0 /* not 8505/9540 */ |
71 | #define AB8500_INT_UN_PLUG_TV_DET 1 /* not 8505/9540 */ | 74 | #define AB8500_INT_UN_PLUG_TV_DET 1 /* not 8505/9540/8540 */ |
72 | #define AB8500_INT_PLUG_TV_DET 2 /* not 8505/9540 */ | 75 | #define AB8500_INT_PLUG_TV_DET 2 /* not 8505/9540/8540 */ |
73 | #define AB8500_INT_TEMP_WARM 3 | 76 | #define AB8500_INT_TEMP_WARM 3 |
74 | #define AB8500_INT_PON_KEY2DB_F 4 | 77 | #define AB8500_INT_PON_KEY2DB_F 4 |
75 | #define AB8500_INT_PON_KEY2DB_R 5 | 78 | #define AB8500_INT_PON_KEY2DB_R 5 |
@@ -77,18 +80,19 @@ enum ab8500_version { | |||
77 | #define AB8500_INT_PON_KEY1DB_R 7 | 80 | #define AB8500_INT_PON_KEY1DB_R 7 |
78 | /* ab8500_irq_regoffset[1] -> IT[Source|Latch|Mask]2 */ | 81 | /* ab8500_irq_regoffset[1] -> IT[Source|Latch|Mask]2 */ |
79 | #define AB8500_INT_BATT_OVV 8 | 82 | #define AB8500_INT_BATT_OVV 8 |
80 | #define AB8500_INT_MAIN_CH_UNPLUG_DET 10 /* not 8505 */ | 83 | #define AB8500_INT_MAIN_CH_UNPLUG_DET 10 /* not 8505/8540 */ |
81 | #define AB8500_INT_MAIN_CH_PLUG_DET 11 /* not 8505 */ | 84 | #define AB8500_INT_MAIN_CH_PLUG_DET 11 /* not 8505/8540 */ |
82 | #define AB8500_INT_VBUS_DET_F 14 | 85 | #define AB8500_INT_VBUS_DET_F 14 |
83 | #define AB8500_INT_VBUS_DET_R 15 | 86 | #define AB8500_INT_VBUS_DET_R 15 |
84 | /* ab8500_irq_regoffset[2] -> IT[Source|Latch|Mask]3 */ | 87 | /* ab8500_irq_regoffset[2] -> IT[Source|Latch|Mask]3 */ |
85 | #define AB8500_INT_VBUS_CH_DROP_END 16 | 88 | #define AB8500_INT_VBUS_CH_DROP_END 16 |
86 | #define AB8500_INT_RTC_60S 17 | 89 | #define AB8500_INT_RTC_60S 17 |
87 | #define AB8500_INT_RTC_ALARM 18 | 90 | #define AB8500_INT_RTC_ALARM 18 |
91 | #define AB8540_INT_BIF_INT 19 | ||
88 | #define AB8500_INT_BAT_CTRL_INDB 20 | 92 | #define AB8500_INT_BAT_CTRL_INDB 20 |
89 | #define AB8500_INT_CH_WD_EXP 21 | 93 | #define AB8500_INT_CH_WD_EXP 21 |
90 | #define AB8500_INT_VBUS_OVV 22 | 94 | #define AB8500_INT_VBUS_OVV 22 |
91 | #define AB8500_INT_MAIN_CH_DROP_END 23 /* not 8505/9540 */ | 95 | #define AB8500_INT_MAIN_CH_DROP_END 23 /* not 8505/9540/8540 */ |
92 | /* ab8500_irq_regoffset[3] -> IT[Source|Latch|Mask]4 */ | 96 | /* ab8500_irq_regoffset[3] -> IT[Source|Latch|Mask]4 */ |
93 | #define AB8500_INT_CCN_CONV_ACC 24 | 97 | #define AB8500_INT_CCN_CONV_ACC 24 |
94 | #define AB8500_INT_INT_AUD 25 | 98 | #define AB8500_INT_INT_AUD 25 |
@@ -99,7 +103,7 @@ enum ab8500_version { | |||
99 | #define AB8500_INT_BUP_CHG_NOT_OK 30 | 103 | #define AB8500_INT_BUP_CHG_NOT_OK 30 |
100 | #define AB8500_INT_BUP_CHG_OK 31 | 104 | #define AB8500_INT_BUP_CHG_OK 31 |
101 | /* ab8500_irq_regoffset[4] -> IT[Source|Latch|Mask]5 */ | 105 | /* ab8500_irq_regoffset[4] -> IT[Source|Latch|Mask]5 */ |
102 | #define AB8500_INT_GP_HW_ADC_CONV_END 32 /* not 8505 */ | 106 | #define AB8500_INT_GP_HW_ADC_CONV_END 32 /* not 8505/8540 */ |
103 | #define AB8500_INT_ACC_DETECT_1DB_F 33 | 107 | #define AB8500_INT_ACC_DETECT_1DB_F 33 |
104 | #define AB8500_INT_ACC_DETECT_1DB_R 34 | 108 | #define AB8500_INT_ACC_DETECT_1DB_R 34 |
105 | #define AB8500_INT_ACC_DETECT_22DB_F 35 | 109 | #define AB8500_INT_ACC_DETECT_22DB_F 35 |
@@ -108,23 +112,23 @@ enum ab8500_version { | |||
108 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | 112 | #define AB8500_INT_ACC_DETECT_21DB_R 38 |
109 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | 113 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 |
110 | /* ab8500_irq_regoffset[5] -> IT[Source|Latch|Mask]7 */ | 114 | /* ab8500_irq_regoffset[5] -> IT[Source|Latch|Mask]7 */ |
111 | #define AB8500_INT_GPIO6R 40 /* not 8505/9540 */ | 115 | #define AB8500_INT_GPIO6R 40 /* not 8505/9540/8540 */ |
112 | #define AB8500_INT_GPIO7R 41 /* not 8505/9540 */ | 116 | #define AB8500_INT_GPIO7R 41 /* not 8505/9540/8540 */ |
113 | #define AB8500_INT_GPIO8R 42 /* not 8505/9540 */ | 117 | #define AB8500_INT_GPIO8R 42 /* not 8505/9540/8540 */ |
114 | #define AB8500_INT_GPIO9R 43 /* not 8505/9540 */ | 118 | #define AB8500_INT_GPIO9R 43 /* not 8505/9540/8540 */ |
115 | #define AB8500_INT_GPIO10R 44 | 119 | #define AB8500_INT_GPIO10R 44 /* not 8540 */ |
116 | #define AB8500_INT_GPIO11R 45 | 120 | #define AB8500_INT_GPIO11R 45 /* not 8540 */ |
117 | #define AB8500_INT_GPIO12R 46 /* not 8505 */ | 121 | #define AB8500_INT_GPIO12R 46 /* not 8505/8540 */ |
118 | #define AB8500_INT_GPIO13R 47 | 122 | #define AB8500_INT_GPIO13R 47 /* not 8540 */ |
119 | /* ab8500_irq_regoffset[6] -> IT[Source|Latch|Mask]8 */ | 123 | /* ab8500_irq_regoffset[6] -> IT[Source|Latch|Mask]8 */ |
120 | #define AB8500_INT_GPIO24R 48 /* not 8505 */ | 124 | #define AB8500_INT_GPIO24R 48 /* not 8505/8540 */ |
121 | #define AB8500_INT_GPIO25R 49 /* not 8505 */ | 125 | #define AB8500_INT_GPIO25R 49 /* not 8505/8540 */ |
122 | #define AB8500_INT_GPIO36R 50 /* not 8505/9540 */ | 126 | #define AB8500_INT_GPIO36R 50 /* not 8505/9540/8540 */ |
123 | #define AB8500_INT_GPIO37R 51 /* not 8505/9540 */ | 127 | #define AB8500_INT_GPIO37R 51 /* not 8505/9540/8540 */ |
124 | #define AB8500_INT_GPIO38R 52 /* not 8505/9540 */ | 128 | #define AB8500_INT_GPIO38R 52 /* not 8505/9540/8540 */ |
125 | #define AB8500_INT_GPIO39R 53 /* not 8505/9540 */ | 129 | #define AB8500_INT_GPIO39R 53 /* not 8505/9540/8540 */ |
126 | #define AB8500_INT_GPIO40R 54 | 130 | #define AB8500_INT_GPIO40R 54 /* not 8540 */ |
127 | #define AB8500_INT_GPIO41R 55 | 131 | #define AB8500_INT_GPIO41R 55 /* not 8540 */ |
128 | /* ab8500_irq_regoffset[7] -> IT[Source|Latch|Mask]9 */ | 132 | /* ab8500_irq_regoffset[7] -> IT[Source|Latch|Mask]9 */ |
129 | #define AB8500_INT_GPIO6F 56 /* not 8505/9540 */ | 133 | #define AB8500_INT_GPIO6F 56 /* not 8505/9540 */ |
130 | #define AB8500_INT_GPIO7F 57 /* not 8505/9540 */ | 134 | #define AB8500_INT_GPIO7F 57 /* not 8505/9540 */ |
@@ -135,14 +139,14 @@ enum ab8500_version { | |||
135 | #define AB8500_INT_GPIO12F 62 /* not 8505 */ | 139 | #define AB8500_INT_GPIO12F 62 /* not 8505 */ |
136 | #define AB8500_INT_GPIO13F 63 | 140 | #define AB8500_INT_GPIO13F 63 |
137 | /* ab8500_irq_regoffset[8] -> IT[Source|Latch|Mask]10 */ | 141 | /* ab8500_irq_regoffset[8] -> IT[Source|Latch|Mask]10 */ |
138 | #define AB8500_INT_GPIO24F 64 /* not 8505 */ | 142 | #define AB8500_INT_GPIO24F 64 /* not 8505/8540 */ |
139 | #define AB8500_INT_GPIO25F 65 /* not 8505 */ | 143 | #define AB8500_INT_GPIO25F 65 /* not 8505/8540 */ |
140 | #define AB8500_INT_GPIO36F 66 /* not 8505/9540 */ | 144 | #define AB8500_INT_GPIO36F 66 /* not 8505/9540/8540 */ |
141 | #define AB8500_INT_GPIO37F 67 /* not 8505/9540 */ | 145 | #define AB8500_INT_GPIO37F 67 /* not 8505/9540/8540 */ |
142 | #define AB8500_INT_GPIO38F 68 /* not 8505/9540 */ | 146 | #define AB8500_INT_GPIO38F 68 /* not 8505/9540/8540 */ |
143 | #define AB8500_INT_GPIO39F 69 /* not 8505/9540 */ | 147 | #define AB8500_INT_GPIO39F 69 /* not 8505/9540/8540 */ |
144 | #define AB8500_INT_GPIO40F 70 | 148 | #define AB8500_INT_GPIO40F 70 /* not 8540 */ |
145 | #define AB8500_INT_GPIO41F 71 | 149 | #define AB8500_INT_GPIO41F 71 /* not 8540 */ |
146 | /* ab8500_irq_regoffset[9] -> IT[Source|Latch|Mask]12 */ | 150 | /* ab8500_irq_regoffset[9] -> IT[Source|Latch|Mask]12 */ |
147 | #define AB8500_INT_ADP_SOURCE_ERROR 72 | 151 | #define AB8500_INT_ADP_SOURCE_ERROR 72 |
148 | #define AB8500_INT_ADP_SINK_ERROR 73 | 152 | #define AB8500_INT_ADP_SINK_ERROR 73 |
@@ -160,42 +164,44 @@ enum ab8500_version { | |||
160 | #define AB8500_INT_SRP_DETECT 88 | 164 | #define AB8500_INT_SRP_DETECT 88 |
161 | #define AB8500_INT_USB_CHARGER_NOT_OKR 89 | 165 | #define AB8500_INT_USB_CHARGER_NOT_OKR 89 |
162 | #define AB8500_INT_ID_WAKEUP_R 90 | 166 | #define AB8500_INT_ID_WAKEUP_R 90 |
167 | #define AB8500_INT_ID_DET_PLUGR 91 /* 8505/9540 cut2.0 */ | ||
163 | #define AB8500_INT_ID_DET_R1R 92 | 168 | #define AB8500_INT_ID_DET_R1R 92 |
164 | #define AB8500_INT_ID_DET_R2R 93 | 169 | #define AB8500_INT_ID_DET_R2R 93 |
165 | #define AB8500_INT_ID_DET_R3R 94 | 170 | #define AB8500_INT_ID_DET_R3R 94 |
166 | #define AB8500_INT_ID_DET_R4R 95 | 171 | #define AB8500_INT_ID_DET_R4R 95 |
167 | /* ab8500_irq_regoffset[12] -> IT[Source|Latch|Mask]21 */ | 172 | /* ab8500_irq_regoffset[12] -> IT[Source|Latch|Mask]21 */ |
168 | #define AB8500_INT_ID_WAKEUP_F 96 | 173 | #define AB8500_INT_ID_WAKEUP_F 96 /* not 8505/9540 */ |
169 | #define AB8500_INT_ID_DET_R1F 98 | 174 | #define AB8500_INT_ID_DET_PLUGF 97 /* 8505/9540 cut2.0 */ |
170 | #define AB8500_INT_ID_DET_R2F 99 | 175 | #define AB8500_INT_ID_DET_R1F 98 /* not 8505/9540 */ |
171 | #define AB8500_INT_ID_DET_R3F 100 | 176 | #define AB8500_INT_ID_DET_R2F 99 /* not 8505/9540 */ |
172 | #define AB8500_INT_ID_DET_R4F 101 | 177 | #define AB8500_INT_ID_DET_R3F 100 /* not 8505/9540 */ |
173 | #define AB8500_INT_CHAUTORESTARTAFTSEC 102 | 178 | #define AB8500_INT_ID_DET_R4F 101 /* not 8505/9540 */ |
179 | #define AB8500_INT_CHAUTORESTARTAFTSEC 102 /* not 8505/9540 */ | ||
174 | #define AB8500_INT_CHSTOPBYSEC 103 | 180 | #define AB8500_INT_CHSTOPBYSEC 103 |
175 | /* ab8500_irq_regoffset[13] -> IT[Source|Latch|Mask]22 */ | 181 | /* ab8500_irq_regoffset[13] -> IT[Source|Latch|Mask]22 */ |
176 | #define AB8500_INT_USB_CH_TH_PROT_F 104 | 182 | #define AB8500_INT_USB_CH_TH_PROT_F 104 |
177 | #define AB8500_INT_USB_CH_TH_PROT_R 105 | 183 | #define AB8500_INT_USB_CH_TH_PROT_R 105 |
178 | #define AB8500_INT_MAIN_CH_TH_PROT_F 106 /* not 8505/9540 */ | 184 | #define AB8500_INT_MAIN_CH_TH_PROT_F 106 /* not 8505/9540 */ |
179 | #define AB8500_INT_MAIN_CH_TH_PROT_R 107 /* not 8505/9540 */ | 185 | #define AB8500_INT_MAIN_CH_TH_PROT_R 107 /* not 8505/9540 */ |
180 | #define AB8500_INT_CHCURLIMNOHSCHIRP 109 | 186 | #define AB8500_INT_CHCURLIMNOHSCHIRP 109 |
181 | #define AB8500_INT_CHCURLIMHSCHIRP 110 | 187 | #define AB8500_INT_CHCURLIMHSCHIRP 110 |
182 | #define AB8500_INT_XTAL32K_KO 111 | 188 | #define AB8500_INT_XTAL32K_KO 111 |
183 | 189 | ||
184 | /* Definitions for AB9540 */ | 190 | /* Definitions for AB9540 / AB8505 */ |
185 | /* ab8500_irq_regoffset[14] -> IT[Source|Latch|Mask]13 */ | 191 | /* ab8500_irq_regoffset[14] -> IT[Source|Latch|Mask]13 */ |
186 | #define AB9540_INT_GPIO50R 113 | 192 | #define AB9540_INT_GPIO50R 113 /* not 8540 */ |
187 | #define AB9540_INT_GPIO51R 114 /* not 8505 */ | 193 | #define AB9540_INT_GPIO51R 114 /* not 8505/8540 */ |
188 | #define AB9540_INT_GPIO52R 115 | 194 | #define AB9540_INT_GPIO52R 115 /* not 8540 */ |
189 | #define AB9540_INT_GPIO53R 116 | 195 | #define AB9540_INT_GPIO53R 116 /* not 8540 */ |
190 | #define AB9540_INT_GPIO54R 117 /* not 8505 */ | 196 | #define AB9540_INT_GPIO54R 117 /* not 8505/8540 */ |
191 | #define AB9540_INT_IEXT_CH_RF_BFN_R 118 | 197 | #define AB9540_INT_IEXT_CH_RF_BFN_R 118 |
192 | #define AB9540_INT_IEXT_CH_RF_BFN_F 119 | ||
193 | /* ab8500_irq_regoffset[15] -> IT[Source|Latch|Mask]14 */ | 198 | /* ab8500_irq_regoffset[15] -> IT[Source|Latch|Mask]14 */ |
194 | #define AB9540_INT_GPIO50F 121 | 199 | #define AB9540_INT_GPIO50F 121 /* not 8540 */ |
195 | #define AB9540_INT_GPIO51F 122 /* not 8505 */ | 200 | #define AB9540_INT_GPIO51F 122 /* not 8505/8540 */ |
196 | #define AB9540_INT_GPIO52F 123 | 201 | #define AB9540_INT_GPIO52F 123 /* not 8540 */ |
197 | #define AB9540_INT_GPIO53F 124 | 202 | #define AB9540_INT_GPIO53F 124 /* not 8540 */ |
198 | #define AB9540_INT_GPIO54F 125 /* not 8505 */ | 203 | #define AB9540_INT_GPIO54F 125 /* not 8505/8540 */ |
204 | #define AB9540_INT_IEXT_CH_RF_BFN_F 126 | ||
199 | /* ab8500_irq_regoffset[16] -> IT[Source|Latch|Mask]25 */ | 205 | /* ab8500_irq_regoffset[16] -> IT[Source|Latch|Mask]25 */ |
200 | #define AB8505_INT_KEYSTUCK 128 | 206 | #define AB8505_INT_KEYSTUCK 128 |
201 | #define AB8505_INT_IKR 129 | 207 | #define AB8505_INT_IKR 129 |
@@ -204,6 +210,87 @@ enum ab8500_version { | |||
204 | #define AB8505_INT_KEYDEGLITCH 132 | 210 | #define AB8505_INT_KEYDEGLITCH 132 |
205 | #define AB8505_INT_MODPWRSTATUSF 134 | 211 | #define AB8505_INT_MODPWRSTATUSF 134 |
206 | #define AB8505_INT_MODPWRSTATUSR 135 | 212 | #define AB8505_INT_MODPWRSTATUSR 135 |
213 | /* ab8500_irq_regoffset[17] -> IT[Source|Latch|Mask]6 */ | ||
214 | #define AB8500_INT_HOOK_DET_NEG_F 138 | ||
215 | #define AB8500_INT_HOOK_DET_NEG_R 139 | ||
216 | #define AB8500_INT_HOOK_DET_POS_F 140 | ||
217 | #define AB8500_INT_HOOK_DET_POS_R 141 | ||
218 | #define AB8500_INT_PLUG_DET_COMP_F 142 | ||
219 | #define AB8500_INT_PLUG_DET_COMP_R 143 | ||
220 | /* ab8500_irq_regoffset[18] -> IT[Source|Latch|Mask]23 */ | ||
221 | #define AB8505_INT_COLL 144 | ||
222 | #define AB8505_INT_RESERR 145 | ||
223 | #define AB8505_INT_FRAERR 146 | ||
224 | #define AB8505_INT_COMERR 147 | ||
225 | #define AB8505_INT_SPDSET 148 | ||
226 | #define AB8505_INT_DSENT 149 | ||
227 | #define AB8505_INT_DREC 150 | ||
228 | #define AB8505_INT_ACC_INT 151 | ||
229 | /* ab8500_irq_regoffset[19] -> IT[Source|Latch|Mask]24 */ | ||
230 | #define AB8505_INT_NOPINT 152 | ||
231 | /* ab8540_irq_regoffset[20] -> IT[Source|Latch|Mask]26 */ | ||
232 | #define AB8540_INT_IDPLUGDETCOMPF 160 | ||
233 | #define AB8540_INT_IDPLUGDETCOMPR 161 | ||
234 | #define AB8540_INT_FMDETCOMPLOF 162 | ||
235 | #define AB8540_INT_FMDETCOMPLOR 163 | ||
236 | #define AB8540_INT_FMDETCOMPHIF 164 | ||
237 | #define AB8540_INT_FMDETCOMPHIR 165 | ||
238 | #define AB8540_INT_ID5VDETCOMPF 166 | ||
239 | #define AB8540_INT_ID5VDETCOMPR 167 | ||
240 | /* ab8540_irq_regoffset[21] -> IT[Source|Latch|Mask]27 */ | ||
241 | #define AB8540_INT_GPIO43F 168 | ||
242 | #define AB8540_INT_GPIO43R 169 | ||
243 | #define AB8540_INT_GPIO44F 170 | ||
244 | #define AB8540_INT_GPIO44R 171 | ||
245 | #define AB8540_INT_KEYPOSDETCOMPF 172 | ||
246 | #define AB8540_INT_KEYPOSDETCOMPR 173 | ||
247 | #define AB8540_INT_KEYNEGDETCOMPF 174 | ||
248 | #define AB8540_INT_KEYNEGDETCOMPR 175 | ||
249 | /* ab8540_irq_regoffset[22] -> IT[Source|Latch|Mask]28 */ | ||
250 | #define AB8540_INT_GPIO1VBATF 176 | ||
251 | #define AB8540_INT_GPIO1VBATR 177 | ||
252 | #define AB8540_INT_GPIO2VBATF 178 | ||
253 | #define AB8540_INT_GPIO2VBATR 179 | ||
254 | #define AB8540_INT_GPIO3VBATF 180 | ||
255 | #define AB8540_INT_GPIO3VBATR 181 | ||
256 | #define AB8540_INT_GPIO4VBATF 182 | ||
257 | #define AB8540_INT_GPIO4VBATR 183 | ||
258 | /* ab8540_irq_regoffset[23] -> IT[Source|Latch|Mask]29 */ | ||
259 | #define AB8540_INT_SYSCLKREQ2F 184 | ||
260 | #define AB8540_INT_SYSCLKREQ2R 185 | ||
261 | #define AB8540_INT_SYSCLKREQ3F 186 | ||
262 | #define AB8540_INT_SYSCLKREQ3R 187 | ||
263 | #define AB8540_INT_SYSCLKREQ4F 188 | ||
264 | #define AB8540_INT_SYSCLKREQ4R 189 | ||
265 | #define AB8540_INT_SYSCLKREQ5F 190 | ||
266 | #define AB8540_INT_SYSCLKREQ5R 191 | ||
267 | /* ab8540_irq_regoffset[24] -> IT[Source|Latch|Mask]30 */ | ||
268 | #define AB8540_INT_PWMOUT1F 192 | ||
269 | #define AB8540_INT_PWMOUT1R 193 | ||
270 | #define AB8540_INT_PWMCTRL0F 194 | ||
271 | #define AB8540_INT_PWMCTRL0R 195 | ||
272 | #define AB8540_INT_PWMCTRL1F 196 | ||
273 | #define AB8540_INT_PWMCTRL1R 197 | ||
274 | #define AB8540_INT_SYSCLKREQ6F 198 | ||
275 | #define AB8540_INT_SYSCLKREQ6R 199 | ||
276 | /* ab8540_irq_regoffset[25] -> IT[Source|Latch|Mask]31 */ | ||
277 | #define AB8540_INT_PWMEXTVIBRA1F 200 | ||
278 | #define AB8540_INT_PWMEXTVIBRA1R 201 | ||
279 | #define AB8540_INT_PWMEXTVIBRA2F 202 | ||
280 | #define AB8540_INT_PWMEXTVIBRA2R 203 | ||
281 | #define AB8540_INT_PWMOUT2F 204 | ||
282 | #define AB8540_INT_PWMOUT2R 205 | ||
283 | #define AB8540_INT_PWMOUT3F 206 | ||
284 | #define AB8540_INT_PWMOUT3R 207 | ||
285 | /* ab8540_irq_regoffset[26] -> IT[Source|Latch|Mask]32 */ | ||
286 | #define AB8540_INT_ADDATA2F 208 | ||
287 | #define AB8540_INT_ADDATA2R 209 | ||
288 | #define AB8540_INT_DADATA2F 210 | ||
289 | #define AB8540_INT_DADATA2R 211 | ||
290 | #define AB8540_INT_FSYNC2F 212 | ||
291 | #define AB8540_INT_FSYNC2R 213 | ||
292 | #define AB8540_INT_BITCLK2F 214 | ||
293 | #define AB8540_INT_BITCLK2R 215 | ||
207 | 294 | ||
208 | /* | 295 | /* |
209 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the | 296 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the |
@@ -213,13 +300,24 @@ enum ab8500_version { | |||
213 | * which is larger. | 300 | * which is larger. |
214 | */ | 301 | */ |
215 | #define AB8500_NR_IRQS 112 | 302 | #define AB8500_NR_IRQS 112 |
216 | #define AB8505_NR_IRQS 136 | 303 | #define AB8505_NR_IRQS 153 |
217 | #define AB9540_NR_IRQS 136 | 304 | #define AB9540_NR_IRQS 153 |
305 | #define AB8540_NR_IRQS 216 | ||
218 | /* This is set to the roof of any AB8500 chip variant IRQ counts */ | 306 | /* This is set to the roof of any AB8500 chip variant IRQ counts */ |
219 | #define AB8500_MAX_NR_IRQS AB9540_NR_IRQS | 307 | #define AB8500_MAX_NR_IRQS AB8540_NR_IRQS |
220 | 308 | ||
221 | #define AB8500_NUM_IRQ_REGS 14 | 309 | #define AB8500_NUM_IRQ_REGS 14 |
222 | #define AB9540_NUM_IRQ_REGS 17 | 310 | #define AB9540_NUM_IRQ_REGS 20 |
311 | #define AB8540_NUM_IRQ_REGS 27 | ||
312 | |||
313 | /* Turn On Status Event */ | ||
314 | #define AB8500_POR_ON_VBAT 0x01 | ||
315 | #define AB8500_POW_KEY_1_ON 0x02 | ||
316 | #define AB8500_POW_KEY_2_ON 0x04 | ||
317 | #define AB8500_RTC_ALARM 0x08 | ||
318 | #define AB8500_MAIN_CH_DET 0x10 | ||
319 | #define AB8500_VBUS_DET 0x20 | ||
320 | #define AB8500_USB_ID_DET 0x40 | ||
223 | 321 | ||
224 | /** | 322 | /** |
225 | * struct ab8500 - ab8500 internal structure | 323 | * struct ab8500 - ab8500 internal structure |
@@ -270,10 +368,12 @@ struct regulator_reg_init; | |||
270 | struct regulator_init_data; | 368 | struct regulator_init_data; |
271 | struct ab8500_gpio_platform_data; | 369 | struct ab8500_gpio_platform_data; |
272 | struct ab8500_codec_platform_data; | 370 | struct ab8500_codec_platform_data; |
371 | struct ab8500_sysctrl_platform_data; | ||
273 | 372 | ||
274 | /** | 373 | /** |
275 | * struct ab8500_platform_data - AB8500 platform data | 374 | * struct ab8500_platform_data - AB8500 platform data |
276 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used | 375 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used |
376 | * @pm_power_off: Should machine pm power off hook be registered or not | ||
277 | * @init: board-specific initialization after detection of ab8500 | 377 | * @init: board-specific initialization after detection of ab8500 |
278 | * @num_regulator_reg_init: number of regulator init registers | 378 | * @num_regulator_reg_init: number of regulator init registers |
279 | * @regulator_reg_init: regulator init registers | 379 | * @regulator_reg_init: regulator init registers |
@@ -282,13 +382,15 @@ struct ab8500_codec_platform_data; | |||
282 | */ | 382 | */ |
283 | struct ab8500_platform_data { | 383 | struct ab8500_platform_data { |
284 | int irq_base; | 384 | int irq_base; |
385 | bool pm_power_off; | ||
285 | void (*init) (struct ab8500 *); | 386 | void (*init) (struct ab8500 *); |
286 | int num_regulator_reg_init; | 387 | int num_regulator_reg_init; |
287 | struct ab8500_regulator_reg_init *regulator_reg_init; | 388 | struct ab8500_regulator_reg_init *regulator_reg_init; |
288 | int num_regulator; | 389 | int num_regulator; |
289 | struct regulator_init_data *regulator; | 390 | struct regulator_init_data *regulator; |
290 | struct ab8500_gpio_platform_data *gpio; | 391 | struct abx500_gpio_platform_data *gpio; |
291 | struct ab8500_codec_platform_data *codec; | 392 | struct ab8500_codec_platform_data *codec; |
393 | struct ab8500_sysctrl_platform_data *sysctrl; | ||
292 | }; | 394 | }; |
293 | 395 | ||
294 | extern int ab8500_init(struct ab8500 *ab8500, | 396 | extern int ab8500_init(struct ab8500 *ab8500, |
@@ -335,10 +437,87 @@ static inline int is_ab8500_2p0_or_earlier(struct ab8500 *ab) | |||
335 | return (is_ab8500(ab) && (ab->chip_id <= AB8500_CUT2P0)); | 437 | return (is_ab8500(ab) && (ab->chip_id <= AB8500_CUT2P0)); |
336 | } | 438 | } |
337 | 439 | ||
440 | static inline int is_ab8500_3p3_or_earlier(struct ab8500 *ab) | ||
441 | { | ||
442 | return (is_ab8500(ab) && (ab->chip_id <= AB8500_CUT3P3)); | ||
443 | } | ||
444 | |||
338 | /* exclude also ab8505, ab9540... */ | 445 | /* exclude also ab8505, ab9540... */ |
339 | static inline int is_ab8500_2p0(struct ab8500 *ab) | 446 | static inline int is_ab8500_2p0(struct ab8500 *ab) |
340 | { | 447 | { |
341 | return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); | 448 | return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); |
342 | } | 449 | } |
343 | 450 | ||
451 | static inline int is_ab8505_1p0_or_earlier(struct ab8500 *ab) | ||
452 | { | ||
453 | return (is_ab8505(ab) && (ab->chip_id <= AB8500_CUT1P0)); | ||
454 | } | ||
455 | |||
456 | static inline int is_ab8505_2p0(struct ab8500 *ab) | ||
457 | { | ||
458 | return (is_ab8505(ab) && (ab->chip_id == AB8500_CUT2P0)); | ||
459 | } | ||
460 | |||
461 | static inline int is_ab9540_1p0_or_earlier(struct ab8500 *ab) | ||
462 | { | ||
463 | return (is_ab9540(ab) && (ab->chip_id <= AB8500_CUT1P0)); | ||
464 | } | ||
465 | |||
466 | static inline int is_ab9540_2p0(struct ab8500 *ab) | ||
467 | { | ||
468 | return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT2P0)); | ||
469 | } | ||
470 | |||
471 | /* | ||
472 | * Be careful, the marketing name for this chip is 2.1 | ||
473 | * but the value read from the chip is 3.0 (0x30) | ||
474 | */ | ||
475 | static inline int is_ab9540_3p0(struct ab8500 *ab) | ||
476 | { | ||
477 | return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT3P0)); | ||
478 | } | ||
479 | |||
480 | static inline int is_ab8540_1p0_or_earlier(struct ab8500 *ab) | ||
481 | { | ||
482 | return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P0); | ||
483 | } | ||
484 | |||
485 | static inline int is_ab8540_1p1_or_earlier(struct ab8500 *ab) | ||
486 | { | ||
487 | return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P1); | ||
488 | } | ||
489 | |||
490 | static inline int is_ab8540_1p2_or_earlier(struct ab8500 *ab) | ||
491 | { | ||
492 | return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT1P2); | ||
493 | } | ||
494 | |||
495 | static inline int is_ab8540_2p0_or_earlier(struct ab8500 *ab) | ||
496 | { | ||
497 | return is_ab8540(ab) && (ab->chip_id <= AB8500_CUT2P0); | ||
498 | } | ||
499 | |||
500 | static inline int is_ab8540_2p0(struct ab8500 *ab) | ||
501 | { | ||
502 | return is_ab8540(ab) && (ab->chip_id == AB8500_CUT2P0); | ||
503 | } | ||
504 | |||
505 | static inline int is_ab8505_2p0_earlier(struct ab8500 *ab) | ||
506 | { | ||
507 | return (is_ab8505(ab) && (ab->chip_id < AB8500_CUT2P0)); | ||
508 | } | ||
509 | |||
510 | static inline int is_ab9540_2p0_or_earlier(struct ab8500 *ab) | ||
511 | { | ||
512 | return (is_ab9540(ab) && (ab->chip_id < AB8500_CUT2P0)); | ||
513 | } | ||
514 | |||
515 | #ifdef CONFIG_AB8500_DEBUG | ||
516 | void ab8500_dump_all_banks(struct device *dev); | ||
517 | void ab8500_debug_register_interrupt(int line); | ||
518 | #else | ||
519 | static inline void ab8500_dump_all_banks(struct device *dev) {} | ||
520 | static inline void ab8500_debug_register_interrupt(int line) {} | ||
521 | #endif | ||
522 | |||
344 | #endif /* MFD_AB8500_H */ | 523 | #endif /* MFD_AB8500_H */ |
diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h index 9b07725750c9..d43ac0f35526 100644 --- a/include/linux/mfd/abx500/ux500_chargalg.h +++ b/include/linux/mfd/abx500/ux500_chargalg.h | |||
@@ -27,12 +27,17 @@ struct ux500_charger_ops { | |||
27 | * @ops ux500 charger operations | 27 | * @ops ux500 charger operations |
28 | * @max_out_volt maximum output charger voltage in mV | 28 | * @max_out_volt maximum output charger voltage in mV |
29 | * @max_out_curr maximum output charger current in mA | 29 | * @max_out_curr maximum output charger current in mA |
30 | * @enabled indicates if this charger is used or not | ||
31 | * @external external charger unit (pm2xxx) | ||
30 | */ | 32 | */ |
31 | struct ux500_charger { | 33 | struct ux500_charger { |
32 | struct power_supply psy; | 34 | struct power_supply psy; |
33 | struct ux500_charger_ops ops; | 35 | struct ux500_charger_ops ops; |
34 | int max_out_volt; | 36 | int max_out_volt; |
35 | int max_out_curr; | 37 | int max_out_curr; |
38 | int wdt_refresh; | ||
39 | bool enabled; | ||
40 | bool external; | ||
36 | }; | 41 | }; |
37 | 42 | ||
38 | #endif | 43 | #endif |
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h index a580363a7d29..a710255528d7 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h | |||
@@ -75,8 +75,10 @@ enum arizona_type { | |||
75 | #define ARIZONA_IRQ_DCS_HP_DONE 47 | 75 | #define ARIZONA_IRQ_DCS_HP_DONE 47 |
76 | #define ARIZONA_IRQ_FLL2_CLOCK_OK 48 | 76 | #define ARIZONA_IRQ_FLL2_CLOCK_OK 48 |
77 | #define ARIZONA_IRQ_FLL1_CLOCK_OK 49 | 77 | #define ARIZONA_IRQ_FLL1_CLOCK_OK 49 |
78 | #define ARIZONA_IRQ_MICD_CLAMP_RISE 50 | ||
79 | #define ARIZONA_IRQ_MICD_CLAMP_FALL 51 | ||
78 | 80 | ||
79 | #define ARIZONA_NUM_IRQ 50 | 81 | #define ARIZONA_NUM_IRQ 52 |
80 | 82 | ||
81 | struct snd_soc_dapm_context; | 83 | struct snd_soc_dapm_context; |
82 | 84 | ||
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 8b1d1daaae16..455c51d22d6b 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
@@ -56,12 +56,16 @@ | |||
56 | #define ARIZONA_DMIC_MICBIAS2 2 | 56 | #define ARIZONA_DMIC_MICBIAS2 2 |
57 | #define ARIZONA_DMIC_MICBIAS3 3 | 57 | #define ARIZONA_DMIC_MICBIAS3 3 |
58 | 58 | ||
59 | #define ARIZONA_MAX_MICBIAS 3 | ||
60 | |||
59 | #define ARIZONA_INMODE_DIFF 0 | 61 | #define ARIZONA_INMODE_DIFF 0 |
60 | #define ARIZONA_INMODE_SE 1 | 62 | #define ARIZONA_INMODE_SE 1 |
61 | #define ARIZONA_INMODE_DMIC 2 | 63 | #define ARIZONA_INMODE_DMIC 2 |
62 | 64 | ||
63 | #define ARIZONA_MAX_OUTPUT 6 | 65 | #define ARIZONA_MAX_OUTPUT 6 |
64 | 66 | ||
67 | #define ARIZONA_MAX_AIF 3 | ||
68 | |||
65 | #define ARIZONA_HAP_ACT_ERM 0 | 69 | #define ARIZONA_HAP_ACT_ERM 0 |
66 | #define ARIZONA_HAP_ACT_LRA 2 | 70 | #define ARIZONA_HAP_ACT_LRA 2 |
67 | 71 | ||
@@ -69,6 +73,13 @@ | |||
69 | 73 | ||
70 | struct regulator_init_data; | 74 | struct regulator_init_data; |
71 | 75 | ||
76 | struct arizona_micbias { | ||
77 | int mV; /** Regulated voltage */ | ||
78 | unsigned int ext_cap:1; /** External capacitor fitted */ | ||
79 | unsigned int discharge:1; /** Actively discharge */ | ||
80 | unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ | ||
81 | }; | ||
82 | |||
72 | struct arizona_micd_config { | 83 | struct arizona_micd_config { |
73 | unsigned int src; | 84 | unsigned int src; |
74 | unsigned int bias; | 85 | unsigned int bias; |
@@ -96,9 +107,37 @@ struct arizona_pdata { | |||
96 | /** Pin state for GPIO pins */ | 107 | /** Pin state for GPIO pins */ |
97 | int gpio_defaults[ARIZONA_MAX_GPIO]; | 108 | int gpio_defaults[ARIZONA_MAX_GPIO]; |
98 | 109 | ||
110 | /** | ||
111 | * Maximum number of channels clocks will be generated for, | ||
112 | * useful for systems where and I2S bus with multiple data | ||
113 | * lines is mastered. | ||
114 | */ | ||
115 | int max_channels_clocked[ARIZONA_MAX_AIF]; | ||
116 | |||
117 | /** GPIO5 is used for jack detection */ | ||
118 | bool jd_gpio5; | ||
119 | |||
120 | /** Use the headphone detect circuit to identify the accessory */ | ||
121 | bool hpdet_acc_id; | ||
122 | |||
123 | /** GPIO used for mic isolation with HPDET */ | ||
124 | int hpdet_id_gpio; | ||
125 | |||
99 | /** GPIO for mic detection polarity */ | 126 | /** GPIO for mic detection polarity */ |
100 | int micd_pol_gpio; | 127 | int micd_pol_gpio; |
101 | 128 | ||
129 | /** Mic detect ramp rate */ | ||
130 | int micd_bias_start_time; | ||
131 | |||
132 | /** Mic detect sample rate */ | ||
133 | int micd_rate; | ||
134 | |||
135 | /** Mic detect debounce level */ | ||
136 | int micd_dbtime; | ||
137 | |||
138 | /** Force MICBIAS on for mic detect */ | ||
139 | bool micd_force_micbias; | ||
140 | |||
102 | /** Headset polarity configurations */ | 141 | /** Headset polarity configurations */ |
103 | struct arizona_micd_config *micd_configs; | 142 | struct arizona_micd_config *micd_configs; |
104 | int num_micd_configs; | 143 | int num_micd_configs; |
@@ -106,6 +145,9 @@ struct arizona_pdata { | |||
106 | /** Reference voltage for DMIC inputs */ | 145 | /** Reference voltage for DMIC inputs */ |
107 | int dmic_ref[ARIZONA_MAX_INPUT]; | 146 | int dmic_ref[ARIZONA_MAX_INPUT]; |
108 | 147 | ||
148 | /** MICBIAS configurations */ | ||
149 | struct arizona_micbias micbias[ARIZONA_MAX_MICBIAS]; | ||
150 | |||
109 | /** Mode of input structures */ | 151 | /** Mode of input structures */ |
110 | int inmode[ARIZONA_MAX_INPUT]; | 152 | int inmode[ARIZONA_MAX_INPUT]; |
111 | 153 | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index 1f6fe31a4d5c..340355136069 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
@@ -119,6 +119,8 @@ | |||
119 | #define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 | 119 | #define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 |
120 | #define ARIZONA_HEADPHONE_DETECT_1 0x29B | 120 | #define ARIZONA_HEADPHONE_DETECT_1 0x29B |
121 | #define ARIZONA_HEADPHONE_DETECT_2 0x29C | 121 | #define ARIZONA_HEADPHONE_DETECT_2 0x29C |
122 | #define ARIZONA_HP_DACVAL 0x29F | ||
123 | #define ARIZONA_MICD_CLAMP_CONTROL 0x2A2 | ||
122 | #define ARIZONA_MIC_DETECT_1 0x2A3 | 124 | #define ARIZONA_MIC_DETECT_1 0x2A3 |
123 | #define ARIZONA_MIC_DETECT_2 0x2A4 | 125 | #define ARIZONA_MIC_DETECT_2 0x2A4 |
124 | #define ARIZONA_MIC_DETECT_3 0x2A5 | 126 | #define ARIZONA_MIC_DETECT_3 0x2A5 |
@@ -982,18 +984,34 @@ | |||
982 | #define ARIZONA_DSP1_STATUS_1 0x1104 | 984 | #define ARIZONA_DSP1_STATUS_1 0x1104 |
983 | #define ARIZONA_DSP1_STATUS_2 0x1105 | 985 | #define ARIZONA_DSP1_STATUS_2 0x1105 |
984 | #define ARIZONA_DSP1_STATUS_3 0x1106 | 986 | #define ARIZONA_DSP1_STATUS_3 0x1106 |
987 | #define ARIZONA_DSP1_SCRATCH_0 0x1140 | ||
988 | #define ARIZONA_DSP1_SCRATCH_1 0x1141 | ||
989 | #define ARIZONA_DSP1_SCRATCH_2 0x1142 | ||
990 | #define ARIZONA_DSP1_SCRATCH_3 0x1143 | ||
985 | #define ARIZONA_DSP2_CONTROL_1 0x1200 | 991 | #define ARIZONA_DSP2_CONTROL_1 0x1200 |
986 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 | 992 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 |
987 | #define ARIZONA_DSP2_STATUS_1 0x1204 | 993 | #define ARIZONA_DSP2_STATUS_1 0x1204 |
988 | #define ARIZONA_DSP2_STATUS_2 0x1205 | 994 | #define ARIZONA_DSP2_STATUS_2 0x1205 |
995 | #define ARIZONA_DSP2_SCRATCH_0 0x1240 | ||
996 | #define ARIZONA_DSP2_SCRATCH_1 0x1241 | ||
997 | #define ARIZONA_DSP2_SCRATCH_2 0x1242 | ||
998 | #define ARIZONA_DSP2_SCRATCH_3 0x1243 | ||
989 | #define ARIZONA_DSP3_CONTROL_1 0x1300 | 999 | #define ARIZONA_DSP3_CONTROL_1 0x1300 |
990 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 | 1000 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 |
991 | #define ARIZONA_DSP3_STATUS_1 0x1304 | 1001 | #define ARIZONA_DSP3_STATUS_1 0x1304 |
992 | #define ARIZONA_DSP3_STATUS_2 0x1305 | 1002 | #define ARIZONA_DSP3_STATUS_2 0x1305 |
1003 | #define ARIZONA_DSP3_SCRATCH_0 0x1340 | ||
1004 | #define ARIZONA_DSP3_SCRATCH_1 0x1341 | ||
1005 | #define ARIZONA_DSP3_SCRATCH_2 0x1342 | ||
1006 | #define ARIZONA_DSP3_SCRATCH_3 0x1343 | ||
993 | #define ARIZONA_DSP4_CONTROL_1 0x1400 | 1007 | #define ARIZONA_DSP4_CONTROL_1 0x1400 |
994 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 | 1008 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 |
995 | #define ARIZONA_DSP4_STATUS_1 0x1404 | 1009 | #define ARIZONA_DSP4_STATUS_1 0x1404 |
996 | #define ARIZONA_DSP4_STATUS_2 0x1405 | 1010 | #define ARIZONA_DSP4_STATUS_2 0x1405 |
1011 | #define ARIZONA_DSP4_SCRATCH_0 0x1440 | ||
1012 | #define ARIZONA_DSP4_SCRATCH_1 0x1441 | ||
1013 | #define ARIZONA_DSP4_SCRATCH_2 0x1442 | ||
1014 | #define ARIZONA_DSP4_SCRATCH_3 0x1443 | ||
997 | 1015 | ||
998 | /* | 1016 | /* |
999 | * Field Definitions. | 1017 | * Field Definitions. |
@@ -1194,6 +1212,14 @@ | |||
1194 | /* | 1212 | /* |
1195 | * R64 (0x40) - Wake control | 1213 | * R64 (0x40) - Wake control |
1196 | */ | 1214 | */ |
1215 | #define ARIZONA_WKUP_MICD_CLAMP_FALL 0x0080 /* WKUP_MICD_CLAMP_FALL */ | ||
1216 | #define ARIZONA_WKUP_MICD_CLAMP_FALL_MASK 0x0080 /* WKUP_MICD_CLAMP_FALL */ | ||
1217 | #define ARIZONA_WKUP_MICD_CLAMP_FALL_SHIFT 7 /* WKUP_MICD_CLAMP_FALL */ | ||
1218 | #define ARIZONA_WKUP_MICD_CLAMP_FALL_WIDTH 1 /* WKUP_MICD_CLAMP_FALL */ | ||
1219 | #define ARIZONA_WKUP_MICD_CLAMP_RISE 0x0040 /* WKUP_MICD_CLAMP_RISE */ | ||
1220 | #define ARIZONA_WKUP_MICD_CLAMP_RISE_MASK 0x0040 /* WKUP_MICD_CLAMP_RISE */ | ||
1221 | #define ARIZONA_WKUP_MICD_CLAMP_RISE_SHIFT 6 /* WKUP_MICD_CLAMP_RISE */ | ||
1222 | #define ARIZONA_WKUP_MICD_CLAMP_RISE_WIDTH 1 /* WKUP_MICD_CLAMP_RISE */ | ||
1197 | #define ARIZONA_WKUP_GP5_FALL 0x0020 /* WKUP_GP5_FALL */ | 1223 | #define ARIZONA_WKUP_GP5_FALL 0x0020 /* WKUP_GP5_FALL */ |
1198 | #define ARIZONA_WKUP_GP5_FALL_MASK 0x0020 /* WKUP_GP5_FALL */ | 1224 | #define ARIZONA_WKUP_GP5_FALL_MASK 0x0020 /* WKUP_GP5_FALL */ |
1199 | #define ARIZONA_WKUP_GP5_FALL_SHIFT 5 /* WKUP_GP5_FALL */ | 1225 | #define ARIZONA_WKUP_GP5_FALL_SHIFT 5 /* WKUP_GP5_FALL */ |
@@ -2035,6 +2061,9 @@ | |||
2035 | /* | 2061 | /* |
2036 | * R667 (0x29B) - Headphone Detect 1 | 2062 | * R667 (0x29B) - Headphone Detect 1 |
2037 | */ | 2063 | */ |
2064 | #define ARIZONA_HP_IMPEDANCE_RANGE_MASK 0x0600 /* HP_IMPEDANCE_RANGE - [10:9] */ | ||
2065 | #define ARIZONA_HP_IMPEDANCE_RANGE_SHIFT 9 /* HP_IMPEDANCE_RANGE - [10:9] */ | ||
2066 | #define ARIZONA_HP_IMPEDANCE_RANGE_WIDTH 2 /* HP_IMPEDANCE_RANGE - [10:9] */ | ||
2038 | #define ARIZONA_HP_STEP_SIZE 0x0100 /* HP_STEP_SIZE */ | 2067 | #define ARIZONA_HP_STEP_SIZE 0x0100 /* HP_STEP_SIZE */ |
2039 | #define ARIZONA_HP_STEP_SIZE_MASK 0x0100 /* HP_STEP_SIZE */ | 2068 | #define ARIZONA_HP_STEP_SIZE_MASK 0x0100 /* HP_STEP_SIZE */ |
2040 | #define ARIZONA_HP_STEP_SIZE_SHIFT 8 /* HP_STEP_SIZE */ | 2069 | #define ARIZONA_HP_STEP_SIZE_SHIFT 8 /* HP_STEP_SIZE */ |
@@ -2069,6 +2098,21 @@ | |||
2069 | #define ARIZONA_HP_LVL_SHIFT 0 /* HP_LVL - [6:0] */ | 2098 | #define ARIZONA_HP_LVL_SHIFT 0 /* HP_LVL - [6:0] */ |
2070 | #define ARIZONA_HP_LVL_WIDTH 7 /* HP_LVL - [6:0] */ | 2099 | #define ARIZONA_HP_LVL_WIDTH 7 /* HP_LVL - [6:0] */ |
2071 | 2100 | ||
2101 | #define ARIZONA_HP_DONE_B 0x8000 /* HP_DONE */ | ||
2102 | #define ARIZONA_HP_DONE_B_MASK 0x8000 /* HP_DONE */ | ||
2103 | #define ARIZONA_HP_DONE_B_SHIFT 15 /* HP_DONE */ | ||
2104 | #define ARIZONA_HP_DONE_B_WIDTH 1 /* HP_DONE */ | ||
2105 | #define ARIZONA_HP_LVL_B_MASK 0x7FFF /* HP_LVL - [14:0] */ | ||
2106 | #define ARIZONA_HP_LVL_B_SHIFT 0 /* HP_LVL - [14:0] */ | ||
2107 | #define ARIZONA_HP_LVL_B_WIDTH 15 /* HP_LVL - [14:0] */ | ||
2108 | |||
2109 | /* | ||
2110 | * R674 (0x2A2) - MICD clamp control | ||
2111 | */ | ||
2112 | #define ARIZONA_MICD_CLAMP_MODE_MASK 0x000F /* MICD_CLAMP_MODE - [3:0] */ | ||
2113 | #define ARIZONA_MICD_CLAMP_MODE_SHIFT 0 /* MICD_CLAMP_MODE - [3:0] */ | ||
2114 | #define ARIZONA_MICD_CLAMP_MODE_WIDTH 4 /* MICD_CLAMP_MODE - [3:0] */ | ||
2115 | |||
2072 | /* | 2116 | /* |
2073 | * R675 (0x2A3) - Mic Detect 1 | 2117 | * R675 (0x2A3) - Mic Detect 1 |
2074 | */ | 2118 | */ |
@@ -5239,6 +5283,14 @@ | |||
5239 | /* | 5283 | /* |
5240 | * R3408 (0xD50) - AOD wkup and trig | 5284 | * R3408 (0xD50) - AOD wkup and trig |
5241 | */ | 5285 | */ |
5286 | #define ARIZONA_MICD_CLAMP_FALL_TRIG_STS 0x0080 /* MICD_CLAMP_FALL_TRIG_STS */ | ||
5287 | #define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_MASK 0x0080 /* MICD_CLAMP_FALL_TRIG_STS */ | ||
5288 | #define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_SHIFT 7 /* MICD_CLAMP_FALL_TRIG_STS */ | ||
5289 | #define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_WIDTH 1 /* MICD_CLAMP_FALL_TRIG_STS */ | ||
5290 | #define ARIZONA_MICD_CLAMP_RISE_TRIG_STS 0x0040 /* MICD_CLAMP_RISE_TRIG_STS */ | ||
5291 | #define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_MASK 0x0040 /* MICD_CLAMP_RISE_TRIG_STS */ | ||
5292 | #define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_SHIFT 6 /* MICD_CLAMP_RISE_TRIG_STS */ | ||
5293 | #define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_WIDTH 1 /* MICD_CLAMP_RISE_TRIG_STS */ | ||
5242 | #define ARIZONA_GP5_FALL_TRIG_STS 0x0020 /* GP5_FALL_TRIG_STS */ | 5294 | #define ARIZONA_GP5_FALL_TRIG_STS 0x0020 /* GP5_FALL_TRIG_STS */ |
5243 | #define ARIZONA_GP5_FALL_TRIG_STS_MASK 0x0020 /* GP5_FALL_TRIG_STS */ | 5295 | #define ARIZONA_GP5_FALL_TRIG_STS_MASK 0x0020 /* GP5_FALL_TRIG_STS */ |
5244 | #define ARIZONA_GP5_FALL_TRIG_STS_SHIFT 5 /* GP5_FALL_TRIG_STS */ | 5296 | #define ARIZONA_GP5_FALL_TRIG_STS_SHIFT 5 /* GP5_FALL_TRIG_STS */ |
@@ -5267,6 +5319,12 @@ | |||
5267 | /* | 5319 | /* |
5268 | * R3409 (0xD51) - AOD IRQ1 | 5320 | * R3409 (0xD51) - AOD IRQ1 |
5269 | */ | 5321 | */ |
5322 | #define ARIZONA_MICD_CLAMP_FALL_EINT1 0x0080 /* MICD_CLAMP_FALL_EINT1 */ | ||
5323 | #define ARIZONA_MICD_CLAMP_FALL_EINT1_MASK 0x0080 /* MICD_CLAMP_FALL_EINT1 */ | ||
5324 | #define ARIZONA_MICD_CLAMP_FALL_EINT1_SHIFT 7 /* MICD_CLAMP_FALL_EINT1 */ | ||
5325 | #define ARIZONA_MICD_CLAMP_RISE_EINT1 0x0040 /* MICD_CLAMP_RISE_EINT1 */ | ||
5326 | #define ARIZONA_MICD_CLAMP_RISE_EINT1_MASK 0x0040 /* MICD_CLAMP_RISE_EINT1 */ | ||
5327 | #define ARIZONA_MICD_CLAMP_RISE_EINT1_SHIFT 6 /* MICD_CLAMP_RISE_EINT1 */ | ||
5270 | #define ARIZONA_GP5_FALL_EINT1 0x0020 /* GP5_FALL_EINT1 */ | 5328 | #define ARIZONA_GP5_FALL_EINT1 0x0020 /* GP5_FALL_EINT1 */ |
5271 | #define ARIZONA_GP5_FALL_EINT1_MASK 0x0020 /* GP5_FALL_EINT1 */ | 5329 | #define ARIZONA_GP5_FALL_EINT1_MASK 0x0020 /* GP5_FALL_EINT1 */ |
5272 | #define ARIZONA_GP5_FALL_EINT1_SHIFT 5 /* GP5_FALL_EINT1 */ | 5330 | #define ARIZONA_GP5_FALL_EINT1_SHIFT 5 /* GP5_FALL_EINT1 */ |
@@ -5295,6 +5353,12 @@ | |||
5295 | /* | 5353 | /* |
5296 | * R3410 (0xD52) - AOD IRQ2 | 5354 | * R3410 (0xD52) - AOD IRQ2 |
5297 | */ | 5355 | */ |
5356 | #define ARIZONA_MICD_CLAMP_FALL_EINT2 0x0080 /* MICD_CLAMP_FALL_EINT2 */ | ||
5357 | #define ARIZONA_MICD_CLAMP_FALL_EINT2_MASK 0x0080 /* MICD_CLAMP_FALL_EINT2 */ | ||
5358 | #define ARIZONA_MICD_CLAMP_FALL_EINT2_SHIFT 7 /* MICD_CLAMP_FALL_EINT2 */ | ||
5359 | #define ARIZONA_MICD_CLAMP_RISE_EINT2 0x0040 /* MICD_CLAMP_RISE_EINT2 */ | ||
5360 | #define ARIZONA_MICD_CLAMP_RISE_EINT2_MASK 0x0040 /* MICD_CLAMP_RISE_EINT2 */ | ||
5361 | #define ARIZONA_MICD_CLAMP_RISE_EINT2_SHIFT 6 /* MICD_CLAMP_RISE_EINT2 */ | ||
5298 | #define ARIZONA_GP5_FALL_EINT2 0x0020 /* GP5_FALL_EINT2 */ | 5362 | #define ARIZONA_GP5_FALL_EINT2 0x0020 /* GP5_FALL_EINT2 */ |
5299 | #define ARIZONA_GP5_FALL_EINT2_MASK 0x0020 /* GP5_FALL_EINT2 */ | 5363 | #define ARIZONA_GP5_FALL_EINT2_MASK 0x0020 /* GP5_FALL_EINT2 */ |
5300 | #define ARIZONA_GP5_FALL_EINT2_SHIFT 5 /* GP5_FALL_EINT2 */ | 5364 | #define ARIZONA_GP5_FALL_EINT2_SHIFT 5 /* GP5_FALL_EINT2 */ |
@@ -5379,6 +5443,10 @@ | |||
5379 | /* | 5443 | /* |
5380 | * R3413 (0xD55) - AOD IRQ Raw Status | 5444 | * R3413 (0xD55) - AOD IRQ Raw Status |
5381 | */ | 5445 | */ |
5446 | #define ARIZONA_MICD_CLAMP_STS 0x0008 /* MICD_CLAMP_STS */ | ||
5447 | #define ARIZONA_MICD_CLAMP_STS_MASK 0x0008 /* MICD_CLAMP_STS */ | ||
5448 | #define ARIZONA_MICD_CLAMP_STS_SHIFT 3 /* MICD_CLAMP_STS */ | ||
5449 | #define ARIZONA_MICD_CLAMP_STS_WIDTH 1 /* MICD_CLAMP_STS */ | ||
5382 | #define ARIZONA_GP5_STS 0x0004 /* GP5_STS */ | 5450 | #define ARIZONA_GP5_STS 0x0004 /* GP5_STS */ |
5383 | #define ARIZONA_GP5_STS_MASK 0x0004 /* GP5_STS */ | 5451 | #define ARIZONA_GP5_STS_MASK 0x0004 /* GP5_STS */ |
5384 | #define ARIZONA_GP5_STS_SHIFT 2 /* GP5_STS */ | 5452 | #define ARIZONA_GP5_STS_SHIFT 2 /* GP5_STS */ |
@@ -5395,6 +5463,10 @@ | |||
5395 | /* | 5463 | /* |
5396 | * R3414 (0xD56) - Jack detect debounce | 5464 | * R3414 (0xD56) - Jack detect debounce |
5397 | */ | 5465 | */ |
5466 | #define ARIZONA_MICD_CLAMP_DB 0x0008 /* MICD_CLAMP_DB */ | ||
5467 | #define ARIZONA_MICD_CLAMP_DB_MASK 0x0008 /* MICD_CLAMP_DB */ | ||
5468 | #define ARIZONA_MICD_CLAMP_DB_SHIFT 3 /* MICD_CLAMP_DB */ | ||
5469 | #define ARIZONA_MICD_CLAMP_DB_WIDTH 1 /* MICD_CLAMP_DB */ | ||
5398 | #define ARIZONA_JD2_DB 0x0002 /* JD2_DB */ | 5470 | #define ARIZONA_JD2_DB 0x0002 /* JD2_DB */ |
5399 | #define ARIZONA_JD2_DB_MASK 0x0002 /* JD2_DB */ | 5471 | #define ARIZONA_JD2_DB_MASK 0x0002 /* JD2_DB */ |
5400 | #define ARIZONA_JD2_DB_SHIFT 1 /* JD2_DB */ | 5472 | #define ARIZONA_JD2_DB_SHIFT 1 /* JD2_DB */ |
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 6ee4247df11e..77a46ae2fc17 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -16,12 +16,6 @@ | |||
16 | /* | 16 | /* |
17 | * Registers | 17 | * Registers |
18 | */ | 18 | */ |
19 | #define DB8500_PRCM_GPIOCR 0x138 | ||
20 | #define DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0 BIT(0) | ||
21 | #define DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD BIT(9) | ||
22 | #define DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 BIT(11) | ||
23 | #define DB8500_PRCM_GPIOCR_SPI2_SELECT BIT(23) | ||
24 | |||
25 | #define DB8500_PRCM_LINE_VALUE 0x170 | 19 | #define DB8500_PRCM_LINE_VALUE 0x170 |
26 | #define DB8500_PRCM_LINE_VALUE_HSI_CAWAKE0 BIT(3) | 20 | #define DB8500_PRCM_LINE_VALUE_HSI_CAWAKE0 BIT(3) |
27 | 21 | ||
@@ -493,20 +487,6 @@ struct prcmu_auto_pm_config { | |||
493 | u8 sva_policy; | 487 | u8 sva_policy; |
494 | }; | 488 | }; |
495 | 489 | ||
496 | #define PRCMU_FW_PROJECT_U8500 2 | ||
497 | #define PRCMU_FW_PROJECT_U9500 4 | ||
498 | #define PRCMU_FW_PROJECT_U8500_C2 7 | ||
499 | #define PRCMU_FW_PROJECT_U9500_C2 11 | ||
500 | #define PRCMU_FW_PROJECT_U8520 13 | ||
501 | #define PRCMU_FW_PROJECT_U8420 14 | ||
502 | |||
503 | struct prcmu_fw_version { | ||
504 | u8 project; | ||
505 | u8 api_version; | ||
506 | u8 func_version; | ||
507 | u8 errata; | ||
508 | }; | ||
509 | |||
510 | #ifdef CONFIG_MFD_DB8500_PRCMU | 490 | #ifdef CONFIG_MFD_DB8500_PRCMU |
511 | 491 | ||
512 | void db8500_prcmu_early_init(void); | 492 | void db8500_prcmu_early_init(void); |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index c202d6c4d879..3abcca91eecd 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -12,6 +12,10 @@ | |||
12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | 14 | ||
15 | /* Offset for the firmware version within the TCPM */ | ||
16 | #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4 | ||
17 | #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8 | ||
18 | |||
15 | /* PRCMU Wakeup defines */ | 19 | /* PRCMU Wakeup defines */ |
16 | enum prcmu_wakeup_index { | 20 | enum prcmu_wakeup_index { |
17 | PRCMU_WAKEUP_INDEX_RTC, | 21 | PRCMU_WAKEUP_INDEX_RTC, |
@@ -147,6 +151,18 @@ enum prcmu_clock { | |||
147 | }; | 151 | }; |
148 | 152 | ||
149 | /** | 153 | /** |
154 | * enum prcmu_wdog_id - PRCMU watchdog IDs | ||
155 | * @PRCMU_WDOG_ALL: use all timers | ||
156 | * @PRCMU_WDOG_CPU1: use first CPU timer only | ||
157 | * @PRCMU_WDOG_CPU2: use second CPU timer conly | ||
158 | */ | ||
159 | enum prcmu_wdog_id { | ||
160 | PRCMU_WDOG_ALL = 0x00, | ||
161 | PRCMU_WDOG_CPU1 = 0x01, | ||
162 | PRCMU_WDOG_CPU2 = 0x02, | ||
163 | }; | ||
164 | |||
165 | /** | ||
150 | * enum ape_opp - APE OPP states definition | 166 | * enum ape_opp - APE OPP states definition |
151 | * @APE_OPP_INIT: | 167 | * @APE_OPP_INIT: |
152 | * @APE_NO_CHANGE: The APE operating point is unchanged | 168 | * @APE_NO_CHANGE: The APE operating point is unchanged |
@@ -214,12 +230,52 @@ enum ddr_pwrst { | |||
214 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | 230 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 |
215 | }; | 231 | }; |
216 | 232 | ||
233 | #define DB8500_PRCMU_LEGACY_OFFSET 0xDD4 | ||
234 | |||
235 | struct prcmu_pdata | ||
236 | { | ||
237 | bool enable_set_ddr_opp; | ||
238 | bool enable_ape_opp_100_voltage; | ||
239 | struct ab8500_platform_data *ab_platdata; | ||
240 | u32 version_offset; | ||
241 | u32 legacy_offset; | ||
242 | u32 adt_offset; | ||
243 | }; | ||
244 | |||
245 | #define PRCMU_FW_PROJECT_U8500 2 | ||
246 | #define PRCMU_FW_PROJECT_U8400 3 | ||
247 | #define PRCMU_FW_PROJECT_U9500 4 /* Customer specific */ | ||
248 | #define PRCMU_FW_PROJECT_U8500_MBB 5 | ||
249 | #define PRCMU_FW_PROJECT_U8500_C1 6 | ||
250 | #define PRCMU_FW_PROJECT_U8500_C2 7 | ||
251 | #define PRCMU_FW_PROJECT_U8500_C3 8 | ||
252 | #define PRCMU_FW_PROJECT_U8500_C4 9 | ||
253 | #define PRCMU_FW_PROJECT_U9500_MBL 10 | ||
254 | #define PRCMU_FW_PROJECT_U8500_MBL 11 /* Customer specific */ | ||
255 | #define PRCMU_FW_PROJECT_U8500_MBL2 12 /* Customer specific */ | ||
256 | #define PRCMU_FW_PROJECT_U8520 13 | ||
257 | #define PRCMU_FW_PROJECT_U8420 14 | ||
258 | #define PRCMU_FW_PROJECT_A9420 20 | ||
259 | /* [32..63] 9540 and derivatives */ | ||
260 | #define PRCMU_FW_PROJECT_U9540 32 | ||
261 | /* [64..95] 8540 and derivatives */ | ||
262 | #define PRCMU_FW_PROJECT_L8540 64 | ||
263 | /* [96..126] 8580 and derivatives */ | ||
264 | #define PRCMU_FW_PROJECT_L8580 96 | ||
265 | |||
266 | #define PRCMU_FW_PROJECT_NAME_LEN 20 | ||
267 | struct prcmu_fw_version { | ||
268 | u32 project; /* Notice, project shifted with 8 on ux540 */ | ||
269 | u8 api_version; | ||
270 | u8 func_version; | ||
271 | u8 errata; | ||
272 | char project_name[PRCMU_FW_PROJECT_NAME_LEN]; | ||
273 | }; | ||
274 | |||
217 | #include <linux/mfd/db8500-prcmu.h> | 275 | #include <linux/mfd/db8500-prcmu.h> |
218 | 276 | ||
219 | #if defined(CONFIG_UX500_SOC_DB8500) | 277 | #if defined(CONFIG_UX500_SOC_DB8500) |
220 | 278 | ||
221 | #include <mach/id.h> | ||
222 | |||
223 | static inline void __init prcmu_early_init(void) | 279 | static inline void __init prcmu_early_init(void) |
224 | { | 280 | { |
225 | return db8500_prcmu_early_init(); | 281 | return db8500_prcmu_early_init(); |
@@ -626,85 +682,6 @@ static inline void prcmu_clear(unsigned int reg, u32 bits) | |||
626 | prcmu_write_masked(reg, bits, 0); | 682 | prcmu_write_masked(reg, bits, 0); |
627 | } | 683 | } |
628 | 684 | ||
629 | #if defined(CONFIG_UX500_SOC_DB8500) | ||
630 | |||
631 | /** | ||
632 | * prcmu_enable_spi2 - Enables pin muxing for SPI2 on OtherAlternateC1. | ||
633 | */ | ||
634 | static inline void prcmu_enable_spi2(void) | ||
635 | { | ||
636 | if (cpu_is_u8500()) | ||
637 | prcmu_set(DB8500_PRCM_GPIOCR, DB8500_PRCM_GPIOCR_SPI2_SELECT); | ||
638 | } | ||
639 | |||
640 | /** | ||
641 | * prcmu_disable_spi2 - Disables pin muxing for SPI2 on OtherAlternateC1. | ||
642 | */ | ||
643 | static inline void prcmu_disable_spi2(void) | ||
644 | { | ||
645 | if (cpu_is_u8500()) | ||
646 | prcmu_clear(DB8500_PRCM_GPIOCR, DB8500_PRCM_GPIOCR_SPI2_SELECT); | ||
647 | } | ||
648 | |||
649 | /** | ||
650 | * prcmu_enable_stm_mod_uart - Enables pin muxing for STMMOD | ||
651 | * and UARTMOD on OtherAlternateC3. | ||
652 | */ | ||
653 | static inline void prcmu_enable_stm_mod_uart(void) | ||
654 | { | ||
655 | if (cpu_is_u8500()) { | ||
656 | prcmu_set(DB8500_PRCM_GPIOCR, | ||
657 | (DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 | | ||
658 | DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0)); | ||
659 | } | ||
660 | } | ||
661 | |||
662 | /** | ||
663 | * prcmu_disable_stm_mod_uart - Disables pin muxing for STMMOD | ||
664 | * and UARTMOD on OtherAlternateC3. | ||
665 | */ | ||
666 | static inline void prcmu_disable_stm_mod_uart(void) | ||
667 | { | ||
668 | if (cpu_is_u8500()) { | ||
669 | prcmu_clear(DB8500_PRCM_GPIOCR, | ||
670 | (DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 | | ||
671 | DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0)); | ||
672 | } | ||
673 | } | ||
674 | |||
675 | /** | ||
676 | * prcmu_enable_stm_ape - Enables pin muxing for STM APE on OtherAlternateC1. | ||
677 | */ | ||
678 | static inline void prcmu_enable_stm_ape(void) | ||
679 | { | ||
680 | if (cpu_is_u8500()) { | ||
681 | prcmu_set(DB8500_PRCM_GPIOCR, | ||
682 | DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD); | ||
683 | } | ||
684 | } | ||
685 | |||
686 | /** | ||
687 | * prcmu_disable_stm_ape - Disables pin muxing for STM APE on OtherAlternateC1. | ||
688 | */ | ||
689 | static inline void prcmu_disable_stm_ape(void) | ||
690 | { | ||
691 | if (cpu_is_u8500()) { | ||
692 | prcmu_clear(DB8500_PRCM_GPIOCR, | ||
693 | DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD); | ||
694 | } | ||
695 | } | ||
696 | |||
697 | #else | ||
698 | |||
699 | static inline void prcmu_enable_spi2(void) {} | ||
700 | static inline void prcmu_disable_spi2(void) {} | ||
701 | static inline void prcmu_enable_stm_mod_uart(void) {} | ||
702 | static inline void prcmu_disable_stm_mod_uart(void) {} | ||
703 | static inline void prcmu_enable_stm_ape(void) {} | ||
704 | static inline void prcmu_disable_stm_ape(void) {} | ||
705 | |||
706 | #endif | ||
707 | |||
708 | /* PRCMU QoS APE OPP class */ | 685 | /* PRCMU QoS APE OPP class */ |
709 | #define PRCMU_QOS_APE_OPP 1 | 686 | #define PRCMU_QOS_APE_OPP 1 |
710 | #define PRCMU_QOS_DDR_OPP 2 | 687 | #define PRCMU_QOS_DDR_OPP 2 |
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 1eeae5c07915..5b18ecde69b5 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
@@ -106,6 +106,92 @@ enum max77693_muic_reg { | |||
106 | MAX77693_MUIC_REG_END, | 106 | MAX77693_MUIC_REG_END, |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* MAX77693 MUIC - STATUS1~3 Register */ | ||
110 | #define STATUS1_ADC_SHIFT (0) | ||
111 | #define STATUS1_ADCLOW_SHIFT (5) | ||
112 | #define STATUS1_ADCERR_SHIFT (6) | ||
113 | #define STATUS1_ADC1K_SHIFT (7) | ||
114 | #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT) | ||
115 | #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT) | ||
116 | #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT) | ||
117 | #define STATUS1_ADC1K_MASK (0x1 << STATUS1_ADC1K_SHIFT) | ||
118 | |||
119 | #define STATUS2_CHGTYP_SHIFT (0) | ||
120 | #define STATUS2_CHGDETRUN_SHIFT (3) | ||
121 | #define STATUS2_DCDTMR_SHIFT (4) | ||
122 | #define STATUS2_DXOVP_SHIFT (5) | ||
123 | #define STATUS2_VBVOLT_SHIFT (6) | ||
124 | #define STATUS2_VIDRM_SHIFT (7) | ||
125 | #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) | ||
126 | #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) | ||
127 | #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT) | ||
128 | #define STATUS2_DXOVP_MASK (0x1 << STATUS2_DXOVP_SHIFT) | ||
129 | #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) | ||
130 | #define STATUS2_VIDRM_MASK (0x1 << STATUS2_VIDRM_SHIFT) | ||
131 | |||
132 | #define STATUS3_OVP_SHIFT (2) | ||
133 | #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT) | ||
134 | |||
135 | /* MAX77693 CDETCTRL1~2 register */ | ||
136 | #define CDETCTRL1_CHGDETEN_SHIFT (0) | ||
137 | #define CDETCTRL1_CHGTYPMAN_SHIFT (1) | ||
138 | #define CDETCTRL1_DCDEN_SHIFT (2) | ||
139 | #define CDETCTRL1_DCD2SCT_SHIFT (3) | ||
140 | #define CDETCTRL1_CDDELAY_SHIFT (4) | ||
141 | #define CDETCTRL1_DCDCPL_SHIFT (5) | ||
142 | #define CDETCTRL1_CDPDET_SHIFT (7) | ||
143 | #define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT) | ||
144 | #define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT) | ||
145 | #define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT) | ||
146 | #define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT) | ||
147 | #define CDETCTRL1_CDDELAY_MASK (0x1 << CDETCTRL1_CDDELAY_SHIFT) | ||
148 | #define CDETCTRL1_DCDCPL_MASK (0x1 << CDETCTRL1_DCDCPL_SHIFT) | ||
149 | #define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT) | ||
150 | |||
151 | #define CDETCTRL2_VIDRMEN_SHIFT (1) | ||
152 | #define CDETCTRL2_DXOVPEN_SHIFT (3) | ||
153 | #define CDETCTRL2_VIDRMEN_MASK (0x1 << CDETCTRL2_VIDRMEN_SHIFT) | ||
154 | #define CDETCTRL2_DXOVPEN_MASK (0x1 << CDETCTRL2_DXOVPEN_SHIFT) | ||
155 | |||
156 | /* MAX77693 MUIC - CONTROL1~3 register */ | ||
157 | #define COMN1SW_SHIFT (0) | ||
158 | #define COMP2SW_SHIFT (3) | ||
159 | #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT) | ||
160 | #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT) | ||
161 | #define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK) | ||
162 | #define CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \ | ||
163 | | (1 << COMN1SW_SHIFT)) | ||
164 | #define CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \ | ||
165 | | (2 << COMN1SW_SHIFT)) | ||
166 | #define CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \ | ||
167 | | (3 << COMN1SW_SHIFT)) | ||
168 | #define CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \ | ||
169 | | (0 << COMN1SW_SHIFT)) | ||
170 | |||
171 | #define CONTROL2_LOWPWR_SHIFT (0) | ||
172 | #define CONTROL2_ADCEN_SHIFT (1) | ||
173 | #define CONTROL2_CPEN_SHIFT (2) | ||
174 | #define CONTROL2_SFOUTASRT_SHIFT (3) | ||
175 | #define CONTROL2_SFOUTORD_SHIFT (4) | ||
176 | #define CONTROL2_ACCDET_SHIFT (5) | ||
177 | #define CONTROL2_USBCPINT_SHIFT (6) | ||
178 | #define CONTROL2_RCPS_SHIFT (7) | ||
179 | #define CONTROL2_LOWPWR_MASK (0x1 << CONTROL2_LOWPWR_SHIFT) | ||
180 | #define CONTROL2_ADCEN_MASK (0x1 << CONTROL2_ADCEN_SHIFT) | ||
181 | #define CONTROL2_CPEN_MASK (0x1 << CONTROL2_CPEN_SHIFT) | ||
182 | #define CONTROL2_SFOUTASRT_MASK (0x1 << CONTROL2_SFOUTASRT_SHIFT) | ||
183 | #define CONTROL2_SFOUTORD_MASK (0x1 << CONTROL2_SFOUTORD_SHIFT) | ||
184 | #define CONTROL2_ACCDET_MASK (0x1 << CONTROL2_ACCDET_SHIFT) | ||
185 | #define CONTROL2_USBCPINT_MASK (0x1 << CONTROL2_USBCPINT_SHIFT) | ||
186 | #define CONTROL2_RCPS_MASK (0x1 << CONTROL2_RCPS_SHIFT) | ||
187 | |||
188 | #define CONTROL3_JIGSET_SHIFT (0) | ||
189 | #define CONTROL3_BTLDSET_SHIFT (2) | ||
190 | #define CONTROL3_ADCDBSET_SHIFT (4) | ||
191 | #define CONTROL3_JIGSET_MASK (0x3 << CONTROL3_JIGSET_SHIFT) | ||
192 | #define CONTROL3_BTLDSET_MASK (0x3 << CONTROL3_BTLDSET_SHIFT) | ||
193 | #define CONTROL3_ADCDBSET_MASK (0x3 << CONTROL3_ADCDBSET_SHIFT) | ||
194 | |||
109 | /* Slave addr = 0x90: Haptic */ | 195 | /* Slave addr = 0x90: Haptic */ |
110 | enum max77693_haptic_reg { | 196 | enum max77693_haptic_reg { |
111 | MAX77693_HAPTIC_REG_STATUS = 0x00, | 197 | MAX77693_HAPTIC_REG_STATUS = 0x00, |
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index fe03b2d35d4f..3109a6c5c948 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h | |||
@@ -38,6 +38,15 @@ struct max77693_reg_data { | |||
38 | struct max77693_muic_platform_data { | 38 | struct max77693_muic_platform_data { |
39 | struct max77693_reg_data *init_data; | 39 | struct max77693_reg_data *init_data; |
40 | int num_init_data; | 40 | int num_init_data; |
41 | |||
42 | int detcable_delay_ms; | ||
43 | |||
44 | /* | ||
45 | * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB | ||
46 | * h/w path of COMP2/COMN1 on CONTROL1 register. | ||
47 | */ | ||
48 | int path_usb; | ||
49 | int path_uart; | ||
41 | }; | 50 | }; |
42 | 51 | ||
43 | struct max77693_platform_data { | 52 | struct max77693_platform_data { |
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h index 74d8e2969630..ce8502e9e7dc 100644 --- a/include/linux/mfd/max8925.h +++ b/include/linux/mfd/max8925.h | |||
@@ -190,6 +190,8 @@ enum { | |||
190 | MAX8925_NR_IRQS, | 190 | MAX8925_NR_IRQS, |
191 | }; | 191 | }; |
192 | 192 | ||
193 | |||
194 | |||
193 | struct max8925_chip { | 195 | struct max8925_chip { |
194 | struct device *dev; | 196 | struct device *dev; |
195 | struct i2c_client *i2c; | 197 | struct i2c_client *i2c; |
@@ -201,7 +203,6 @@ struct max8925_chip { | |||
201 | int irq_base; | 203 | int irq_base; |
202 | int core_irq; | 204 | int core_irq; |
203 | int tsc_irq; | 205 | int tsc_irq; |
204 | |||
205 | unsigned int wakeup_flag; | 206 | unsigned int wakeup_flag; |
206 | }; | 207 | }; |
207 | 208 | ||
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index 6ae21bf47d64..fb465dfbb59e 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
@@ -194,6 +194,70 @@ enum max8997_muic_reg { | |||
194 | MAX8997_MUIC_REG_END = 0xf, | 194 | MAX8997_MUIC_REG_END = 0xf, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | /* MAX8997-MUIC STATUS1 register */ | ||
198 | #define STATUS1_ADC_SHIFT 0 | ||
199 | #define STATUS1_ADCLOW_SHIFT 5 | ||
200 | #define STATUS1_ADCERR_SHIFT 6 | ||
201 | #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT) | ||
202 | #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT) | ||
203 | #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT) | ||
204 | |||
205 | /* MAX8997-MUIC STATUS2 register */ | ||
206 | #define STATUS2_CHGTYP_SHIFT 0 | ||
207 | #define STATUS2_CHGDETRUN_SHIFT 3 | ||
208 | #define STATUS2_DCDTMR_SHIFT 4 | ||
209 | #define STATUS2_DBCHG_SHIFT 5 | ||
210 | #define STATUS2_VBVOLT_SHIFT 6 | ||
211 | #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) | ||
212 | #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) | ||
213 | #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT) | ||
214 | #define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT) | ||
215 | #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) | ||
216 | |||
217 | /* MAX8997-MUIC STATUS3 register */ | ||
218 | #define STATUS3_OVP_SHIFT 2 | ||
219 | #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT) | ||
220 | |||
221 | /* MAX8997-MUIC CONTROL1 register */ | ||
222 | #define COMN1SW_SHIFT 0 | ||
223 | #define COMP2SW_SHIFT 3 | ||
224 | #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT) | ||
225 | #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT) | ||
226 | #define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK) | ||
227 | |||
228 | #define CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \ | ||
229 | | (1 << COMN1SW_SHIFT)) | ||
230 | #define CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \ | ||
231 | | (2 << COMN1SW_SHIFT)) | ||
232 | #define CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \ | ||
233 | | (3 << COMN1SW_SHIFT)) | ||
234 | #define CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \ | ||
235 | | (0 << COMN1SW_SHIFT)) | ||
236 | |||
237 | #define CONTROL2_LOWPWR_SHIFT (0) | ||
238 | #define CONTROL2_ADCEN_SHIFT (1) | ||
239 | #define CONTROL2_CPEN_SHIFT (2) | ||
240 | #define CONTROL2_SFOUTASRT_SHIFT (3) | ||
241 | #define CONTROL2_SFOUTORD_SHIFT (4) | ||
242 | #define CONTROL2_ACCDET_SHIFT (5) | ||
243 | #define CONTROL2_USBCPINT_SHIFT (6) | ||
244 | #define CONTROL2_RCPS_SHIFT (7) | ||
245 | #define CONTROL2_LOWPWR_MASK (0x1 << CONTROL2_LOWPWR_SHIFT) | ||
246 | #define CONTROL2_ADCEN_MASK (0x1 << CONTROL2_ADCEN_SHIFT) | ||
247 | #define CONTROL2_CPEN_MASK (0x1 << CONTROL2_CPEN_SHIFT) | ||
248 | #define CONTROL2_SFOUTASRT_MASK (0x1 << CONTROL2_SFOUTASRT_SHIFT) | ||
249 | #define CONTROL2_SFOUTORD_MASK (0x1 << CONTROL2_SFOUTORD_SHIFT) | ||
250 | #define CONTROL2_ACCDET_MASK (0x1 << CONTROL2_ACCDET_SHIFT) | ||
251 | #define CONTROL2_USBCPINT_MASK (0x1 << CONTROL2_USBCPINT_SHIFT) | ||
252 | #define CONTROL2_RCPS_MASK (0x1 << CONTROL2_RCPS_SHIFT) | ||
253 | |||
254 | #define CONTROL3_JIGSET_SHIFT (0) | ||
255 | #define CONTROL3_BTLDSET_SHIFT (2) | ||
256 | #define CONTROL3_ADCDBSET_SHIFT (4) | ||
257 | #define CONTROL3_JIGSET_MASK (0x3 << CONTROL3_JIGSET_SHIFT) | ||
258 | #define CONTROL3_BTLDSET_MASK (0x3 << CONTROL3_BTLDSET_SHIFT) | ||
259 | #define CONTROL3_ADCDBSET_MASK (0x3 << CONTROL3_ADCDBSET_SHIFT) | ||
260 | |||
197 | enum max8997_haptic_reg { | 261 | enum max8997_haptic_reg { |
198 | MAX8997_HAPTIC_REG_GENERAL = 0x00, | 262 | MAX8997_HAPTIC_REG_GENERAL = 0x00, |
199 | MAX8997_HAPTIC_REG_CONF1 = 0x01, | 263 | MAX8997_HAPTIC_REG_CONF1 = 0x01, |
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h index 1d4a4fe6ac33..cf815577bd68 100644 --- a/include/linux/mfd/max8997.h +++ b/include/linux/mfd/max8997.h | |||
@@ -78,21 +78,6 @@ struct max8997_regulator_data { | |||
78 | struct device_node *reg_node; | 78 | struct device_node *reg_node; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | enum max8997_muic_usb_type { | ||
82 | MAX8997_USB_HOST, | ||
83 | MAX8997_USB_DEVICE, | ||
84 | }; | ||
85 | |||
86 | enum max8997_muic_charger_type { | ||
87 | MAX8997_CHARGER_TYPE_NONE = 0, | ||
88 | MAX8997_CHARGER_TYPE_USB, | ||
89 | MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT, | ||
90 | MAX8997_CHARGER_TYPE_DEDICATED_CHG, | ||
91 | MAX8997_CHARGER_TYPE_500MA, | ||
92 | MAX8997_CHARGER_TYPE_1A, | ||
93 | MAX8997_CHARGER_TYPE_DEAD_BATTERY = 7, | ||
94 | }; | ||
95 | |||
96 | struct max8997_muic_reg_data { | 81 | struct max8997_muic_reg_data { |
97 | u8 addr; | 82 | u8 addr; |
98 | u8 data; | 83 | u8 data; |
@@ -107,6 +92,16 @@ struct max8997_muic_reg_data { | |||
107 | struct max8997_muic_platform_data { | 92 | struct max8997_muic_platform_data { |
108 | struct max8997_muic_reg_data *init_data; | 93 | struct max8997_muic_reg_data *init_data; |
109 | int num_init_data; | 94 | int num_init_data; |
95 | |||
96 | /* Check cable state after certain delay */ | ||
97 | int detcable_delay_ms; | ||
98 | |||
99 | /* | ||
100 | * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB | ||
101 | * h/w path of COMP2/COMN1 on CONTROL1 register. | ||
102 | */ | ||
103 | int path_usb; | ||
104 | int path_uart; | ||
110 | }; | 105 | }; |
111 | 106 | ||
112 | enum max8997_haptic_motor_type { | 107 | enum max8997_haptic_motor_type { |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 29f6616e12f0..a4d13d7cd001 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
@@ -2789,4 +2789,56 @@ enum usb_irq_events { | |||
2789 | #define PALMAS_GPADC_TRIM15 0xE | 2789 | #define PALMAS_GPADC_TRIM15 0xE |
2790 | #define PALMAS_GPADC_TRIM16 0xF | 2790 | #define PALMAS_GPADC_TRIM16 0xF |
2791 | 2791 | ||
2792 | static inline int palmas_read(struct palmas *palmas, unsigned int base, | ||
2793 | unsigned int reg, unsigned int *val) | ||
2794 | { | ||
2795 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
2796 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
2797 | |||
2798 | return regmap_read(palmas->regmap[slave_id], addr, val); | ||
2799 | } | ||
2800 | |||
2801 | static inline int palmas_write(struct palmas *palmas, unsigned int base, | ||
2802 | unsigned int reg, unsigned int value) | ||
2803 | { | ||
2804 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
2805 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
2806 | |||
2807 | return regmap_write(palmas->regmap[slave_id], addr, value); | ||
2808 | } | ||
2809 | |||
2810 | static inline int palmas_bulk_write(struct palmas *palmas, unsigned int base, | ||
2811 | unsigned int reg, const void *val, size_t val_count) | ||
2812 | { | ||
2813 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
2814 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
2815 | |||
2816 | return regmap_bulk_write(palmas->regmap[slave_id], addr, | ||
2817 | val, val_count); | ||
2818 | } | ||
2819 | |||
2820 | static inline int palmas_bulk_read(struct palmas *palmas, unsigned int base, | ||
2821 | unsigned int reg, void *val, size_t val_count) | ||
2822 | { | ||
2823 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
2824 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
2825 | |||
2826 | return regmap_bulk_read(palmas->regmap[slave_id], addr, | ||
2827 | val, val_count); | ||
2828 | } | ||
2829 | |||
2830 | static inline int palmas_update_bits(struct palmas *palmas, unsigned int base, | ||
2831 | unsigned int reg, unsigned int mask, unsigned int val) | ||
2832 | { | ||
2833 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
2834 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
2835 | |||
2836 | return regmap_update_bits(palmas->regmap[slave_id], addr, mask, val); | ||
2837 | } | ||
2838 | |||
2839 | static inline int palmas_irq_get_virq(struct palmas *palmas, int irq) | ||
2840 | { | ||
2841 | return regmap_irq_get_virq(palmas->irq_data, irq); | ||
2842 | } | ||
2843 | |||
2792 | #endif /* __LINUX_MFD_PALMAS_H */ | 2844 | #endif /* __LINUX_MFD_PALMAS_H */ |
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 4b117a3f54d4..26ea7f1b7caf 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h | |||
@@ -465,7 +465,7 @@ | |||
465 | #define SD_RSP_TYPE_R6 0x01 | 465 | #define SD_RSP_TYPE_R6 0x01 |
466 | #define SD_RSP_TYPE_R7 0x01 | 466 | #define SD_RSP_TYPE_R7 0x01 |
467 | 467 | ||
468 | /* SD_CONFIURE3 */ | 468 | /* SD_CONFIGURE3 */ |
469 | #define SD_RSP_80CLK_TIMEOUT_EN 0x01 | 469 | #define SD_RSP_80CLK_TIMEOUT_EN 0x01 |
470 | 470 | ||
471 | /* Card Transfer Reset Register */ | 471 | /* Card Transfer Reset Register */ |
@@ -581,8 +581,11 @@ | |||
581 | #define CARD_GPIO_DIR 0xFD57 | 581 | #define CARD_GPIO_DIR 0xFD57 |
582 | #define CARD_GPIO 0xFD58 | 582 | #define CARD_GPIO 0xFD58 |
583 | #define CARD_DATA_SOURCE 0xFD5B | 583 | #define CARD_DATA_SOURCE 0xFD5B |
584 | #define SD30_CLK_DRIVE_SEL 0xFD5A | ||
584 | #define CARD_SELECT 0xFD5C | 585 | #define CARD_SELECT 0xFD5C |
585 | #define SD30_DRIVE_SEL 0xFD5E | 586 | #define SD30_DRIVE_SEL 0xFD5E |
587 | #define SD30_CMD_DRIVE_SEL 0xFD5E | ||
588 | #define SD30_DAT_DRIVE_SEL 0xFD5F | ||
586 | #define CARD_CLK_EN 0xFD69 | 589 | #define CARD_CLK_EN 0xFD69 |
587 | #define SDIO_CTRL 0xFD6B | 590 | #define SDIO_CTRL 0xFD6B |
588 | #define CD_PAD_CTL 0xFD73 | 591 | #define CD_PAD_CTL 0xFD73 |
@@ -655,6 +658,8 @@ | |||
655 | #define MSGTXDATA3 0xFE47 | 658 | #define MSGTXDATA3 0xFE47 |
656 | #define MSGTXCTL 0xFE48 | 659 | #define MSGTXCTL 0xFE48 |
657 | #define PETXCFG 0xFE49 | 660 | #define PETXCFG 0xFE49 |
661 | #define LTR_CTL 0xFE4A | ||
662 | #define OBFF_CFG 0xFE4C | ||
658 | 663 | ||
659 | #define CDRESUMECTL 0xFE52 | 664 | #define CDRESUMECTL 0xFE52 |
660 | #define WAKE_SEL_CTL 0xFE54 | 665 | #define WAKE_SEL_CTL 0xFE54 |
@@ -735,6 +740,7 @@ struct rtsx_pcr { | |||
735 | 740 | ||
736 | unsigned int card_inserted; | 741 | unsigned int card_inserted; |
737 | unsigned int card_removed; | 742 | unsigned int card_removed; |
743 | unsigned int card_exist; | ||
738 | 744 | ||
739 | struct delayed_work carddet_work; | 745 | struct delayed_work carddet_work; |
740 | struct delayed_work idle_work; | 746 | struct delayed_work idle_work; |
@@ -799,6 +805,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, | |||
799 | u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk); | 805 | u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk); |
800 | int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card); | 806 | int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card); |
801 | int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card); | 807 | int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card); |
808 | int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card); | ||
802 | int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage); | 809 | int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage); |
803 | unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr); | 810 | unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr); |
804 | void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr); | 811 | void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr); |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index b50c38f8bc48..f0f4de3b4ccc 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
@@ -26,6 +26,7 @@ enum sec_device_type { | |||
26 | /** | 26 | /** |
27 | * struct sec_pmic_dev - s5m87xx master device for sub-drivers | 27 | * struct sec_pmic_dev - s5m87xx master device for sub-drivers |
28 | * @dev: master device of the chip (can be used to access platform data) | 28 | * @dev: master device of the chip (can be used to access platform data) |
29 | * @pdata: pointer to private data used to pass platform data to child | ||
29 | * @i2c: i2c client private data for regulator | 30 | * @i2c: i2c client private data for regulator |
30 | * @rtc: i2c client private data for rtc | 31 | * @rtc: i2c client private data for rtc |
31 | * @iolock: mutex for serializing io access | 32 | * @iolock: mutex for serializing io access |
@@ -39,6 +40,7 @@ enum sec_device_type { | |||
39 | */ | 40 | */ |
40 | struct sec_pmic_dev { | 41 | struct sec_pmic_dev { |
41 | struct device *dev; | 42 | struct device *dev; |
43 | struct sec_platform_data *pdata; | ||
42 | struct regmap *regmap; | 44 | struct regmap *regmap; |
43 | struct i2c_client *i2c; | 45 | struct i2c_client *i2c; |
44 | struct i2c_client *rtc; | 46 | struct i2c_client *rtc; |
@@ -82,11 +84,11 @@ struct sec_platform_data { | |||
82 | 84 | ||
83 | int buck_gpios[3]; | 85 | int buck_gpios[3]; |
84 | int buck_ds[3]; | 86 | int buck_ds[3]; |
85 | int buck2_voltage[8]; | 87 | unsigned int buck2_voltage[8]; |
86 | bool buck2_gpiodvs; | 88 | bool buck2_gpiodvs; |
87 | int buck3_voltage[8]; | 89 | unsigned int buck3_voltage[8]; |
88 | bool buck3_gpiodvs; | 90 | bool buck3_gpiodvs; |
89 | int buck4_voltage[8]; | 91 | unsigned int buck4_voltage[8]; |
90 | bool buck4_gpiodvs; | 92 | bool buck4_gpiodvs; |
91 | 93 | ||
92 | int buck_set1; | 94 | int buck_set1; |
@@ -127,6 +129,7 @@ struct sec_platform_data { | |||
127 | struct sec_regulator_data { | 129 | struct sec_regulator_data { |
128 | int id; | 130 | int id; |
129 | struct regulator_init_data *initdata; | 131 | struct regulator_init_data *initdata; |
132 | struct device_node *reg_node; | ||
130 | }; | 133 | }; |
131 | 134 | ||
132 | /* | 135 | /* |
@@ -136,7 +139,7 @@ struct sec_regulator_data { | |||
136 | */ | 139 | */ |
137 | struct sec_opmode_data { | 140 | struct sec_opmode_data { |
138 | int id; | 141 | int id; |
139 | int mode; | 142 | unsigned int mode; |
140 | }; | 143 | }; |
141 | 144 | ||
142 | /* | 145 | /* |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index d83af39815ab..99bf3e665997 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -65,12 +65,6 @@ | |||
65 | */ | 65 | */ |
66 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | 66 | #define TMIO_MMC_SDIO_IRQ (1 << 2) |
67 | /* | 67 | /* |
68 | * Some platforms can detect card insertion events with controller powered | ||
69 | * down, using a GPIO IRQ, in which case they have to fill in cd_irq, cd_gpio, | ||
70 | * and cd_flags fields of struct tmio_mmc_data. | ||
71 | */ | ||
72 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | ||
73 | /* | ||
74 | * Some controllers require waiting for the SD bus to become | 68 | * Some controllers require waiting for the SD bus to become |
75 | * idle before writing to some registers. | 69 | * idle before writing to some registers. |
76 | */ | 70 | */ |
@@ -117,18 +111,6 @@ struct tmio_mmc_data { | |||
117 | }; | 111 | }; |
118 | 112 | ||
119 | /* | 113 | /* |
120 | * This function is deprecated and will be removed soon. Please, convert your | ||
121 | * platform to use drivers/mmc/core/cd-gpio.c | ||
122 | */ | ||
123 | #include <linux/mmc/host.h> | ||
124 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | ||
125 | { | ||
126 | if (pdata) | ||
127 | mmc_detect_change(dev_get_drvdata(pdata->dev), | ||
128 | msecs_to_jiffies(100)); | ||
129 | } | ||
130 | |||
131 | /* | ||
132 | * data for the NAND controller | 114 | * data for the NAND controller |
133 | */ | 115 | */ |
134 | struct tmio_nand_data { | 116 | struct tmio_nand_data { |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index adfe8c058f29..9dbb41a4e250 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
@@ -21,8 +21,15 @@ | |||
21 | #define PHY_ID_KSZ8021 0x00221555 | 21 | #define PHY_ID_KSZ8021 0x00221555 |
22 | #define PHY_ID_KSZ8041 0x00221510 | 22 | #define PHY_ID_KSZ8041 0x00221510 |
23 | #define PHY_ID_KSZ8051 0x00221550 | 23 | #define PHY_ID_KSZ8051 0x00221550 |
24 | /* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ | 24 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
25 | #define PHY_ID_KSZ8001 0x0022161A | 25 | #define PHY_ID_KSZ8001 0x0022161A |
26 | /* same id: KS8081, KS8091 */ | ||
27 | #define PHY_ID_KSZ8081 0x00221560 | ||
28 | #define PHY_ID_KSZ8061 0x00221570 | ||
29 | #define PHY_ID_KSZ9031 0x00221620 | ||
30 | |||
31 | #define PHY_ID_KSZ886X 0x00221430 | ||
32 | #define PHY_ID_KSZ8863 0x00221435 | ||
26 | 33 | ||
27 | /* struct phy_device dev_flags definitions */ | 34 | /* struct phy_device dev_flags definitions */ |
28 | #define MICREL_PHY_50MHZ_CLK 0x00000001 | 35 | #define MICREL_PHY_50MHZ_CLK 0x00000001 |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 1e9f627967a3..a405d3dc0f61 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -40,11 +40,9 @@ extern void putback_movable_pages(struct list_head *l); | |||
40 | extern int migrate_page(struct address_space *, | 40 | extern int migrate_page(struct address_space *, |
41 | struct page *, struct page *, enum migrate_mode); | 41 | struct page *, struct page *, enum migrate_mode); |
42 | extern int migrate_pages(struct list_head *l, new_page_t x, | 42 | extern int migrate_pages(struct list_head *l, new_page_t x, |
43 | unsigned long private, bool offlining, | 43 | unsigned long private, enum migrate_mode mode, int reason); |
44 | enum migrate_mode mode, int reason); | ||
45 | extern int migrate_huge_page(struct page *, new_page_t x, | 44 | extern int migrate_huge_page(struct page *, new_page_t x, |
46 | unsigned long private, bool offlining, | 45 | unsigned long private, enum migrate_mode mode); |
47 | enum migrate_mode mode); | ||
48 | 46 | ||
49 | extern int fail_migrate_page(struct address_space *, | 47 | extern int fail_migrate_page(struct address_space *, |
50 | struct page *, struct page *); | 48 | struct page *, struct page *); |
@@ -62,11 +60,11 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
62 | static inline void putback_lru_pages(struct list_head *l) {} | 60 | static inline void putback_lru_pages(struct list_head *l) {} |
63 | static inline void putback_movable_pages(struct list_head *l) {} | 61 | static inline void putback_movable_pages(struct list_head *l) {} |
64 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 62 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
65 | unsigned long private, bool offlining, | 63 | unsigned long private, enum migrate_mode mode, int reason) |
66 | enum migrate_mode mode, int reason) { return -ENOSYS; } | 64 | { return -ENOSYS; } |
67 | static inline int migrate_huge_page(struct page *page, new_page_t x, | 65 | static inline int migrate_huge_page(struct page *page, new_page_t x, |
68 | unsigned long private, bool offlining, | 66 | unsigned long private, enum migrate_mode mode) |
69 | enum migrate_mode mode) { return -ENOSYS; } | 67 | { return -ENOSYS; } |
70 | 68 | ||
71 | static inline int migrate_prep(void) { return -ENOSYS; } | 69 | static inline int migrate_prep(void) { return -ENOSYS; } |
72 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 70 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 20ea939c22a6..811f91cf5e8c 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -150,7 +150,8 @@ enum { | |||
150 | MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, | 150 | MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, |
151 | MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, | 151 | MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, |
152 | MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, | 152 | MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, |
153 | MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3 | 153 | MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3, |
154 | MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4 | ||
154 | }; | 155 | }; |
155 | 156 | ||
156 | enum { | 157 | enum { |
@@ -170,6 +171,7 @@ enum { | |||
170 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | 171 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) |
171 | 172 | ||
172 | enum { | 173 | enum { |
174 | MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, | ||
173 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, | 175 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, |
174 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, | 176 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, |
175 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 177 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
@@ -237,7 +239,8 @@ enum { | |||
237 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | 239 | MLX4_PERM_LOCAL_WRITE = 1 << 11, |
238 | MLX4_PERM_REMOTE_READ = 1 << 12, | 240 | MLX4_PERM_REMOTE_READ = 1 << 12, |
239 | MLX4_PERM_REMOTE_WRITE = 1 << 13, | 241 | MLX4_PERM_REMOTE_WRITE = 1 << 13, |
240 | MLX4_PERM_ATOMIC = 1 << 14 | 242 | MLX4_PERM_ATOMIC = 1 << 14, |
243 | MLX4_PERM_BIND_MW = 1 << 15, | ||
241 | }; | 244 | }; |
242 | 245 | ||
243 | enum { | 246 | enum { |
@@ -503,6 +506,18 @@ struct mlx4_mr { | |||
503 | int enabled; | 506 | int enabled; |
504 | }; | 507 | }; |
505 | 508 | ||
509 | enum mlx4_mw_type { | ||
510 | MLX4_MW_TYPE_1 = 1, | ||
511 | MLX4_MW_TYPE_2 = 2, | ||
512 | }; | ||
513 | |||
514 | struct mlx4_mw { | ||
515 | u32 key; | ||
516 | u32 pd; | ||
517 | enum mlx4_mw_type type; | ||
518 | int enabled; | ||
519 | }; | ||
520 | |||
506 | struct mlx4_fmr { | 521 | struct mlx4_fmr { |
507 | struct mlx4_mr mr; | 522 | struct mlx4_mr mr; |
508 | struct mlx4_mpt_entry *mpt; | 523 | struct mlx4_mpt_entry *mpt; |
@@ -801,8 +816,12 @@ u64 mlx4_mtt_addr(struct mlx4_dev *dev, struct mlx4_mtt *mtt); | |||
801 | 816 | ||
802 | int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | 817 | int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, |
803 | int npages, int page_shift, struct mlx4_mr *mr); | 818 | int npages, int page_shift, struct mlx4_mr *mr); |
804 | void mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); | 819 | int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); |
805 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); | 820 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); |
821 | int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type, | ||
822 | struct mlx4_mw *mw); | ||
823 | void mlx4_mw_free(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
824 | int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
806 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 825 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
807 | int start_index, int npages, u64 *page_list); | 826 | int start_index, int npages, u64 *page_list); |
808 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 827 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
@@ -955,9 +974,8 @@ int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mo | |||
955 | 974 | ||
956 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac); | 975 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac); |
957 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); | 976 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); |
958 | int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); | 977 | int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port); |
959 | int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); | 978 | int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); |
960 | void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); | ||
961 | void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); | 979 | void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); |
962 | int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, | 980 | int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, |
963 | u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); | 981 | u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 4b4ad6ffef92..67f46ad6920a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -265,6 +265,11 @@ struct mlx4_wqe_lso_seg { | |||
265 | __be32 header[0]; | 265 | __be32 header[0]; |
266 | }; | 266 | }; |
267 | 267 | ||
268 | enum mlx4_wqe_bind_seg_flags2 { | ||
269 | MLX4_WQE_BIND_ZERO_BASED = (1 << 30), | ||
270 | MLX4_WQE_BIND_TYPE_2 = (1 << 31), | ||
271 | }; | ||
272 | |||
268 | struct mlx4_wqe_bind_seg { | 273 | struct mlx4_wqe_bind_seg { |
269 | __be32 flags1; | 274 | __be32 flags1; |
270 | __be32 flags2; | 275 | __be32 flags2; |
@@ -277,9 +282,9 @@ struct mlx4_wqe_bind_seg { | |||
277 | enum { | 282 | enum { |
278 | MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27, | 283 | MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27, |
279 | MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, | 284 | MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, |
280 | MLX4_WQE_FMR_PERM_REMOTE_READ = 1 << 29, | 285 | MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_READ = 1 << 29, |
281 | MLX4_WQE_FMR_PERM_REMOTE_WRITE = 1 << 30, | 286 | MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_WRITE = 1 << 30, |
282 | MLX4_WQE_FMR_PERM_ATOMIC = 1 << 31 | 287 | MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC = 1 << 31 |
283 | }; | 288 | }; |
284 | 289 | ||
285 | struct mlx4_wqe_fmr_seg { | 290 | struct mlx4_wqe_fmr_seg { |
@@ -304,12 +309,10 @@ struct mlx4_wqe_fmr_ext_seg { | |||
304 | }; | 309 | }; |
305 | 310 | ||
306 | struct mlx4_wqe_local_inval_seg { | 311 | struct mlx4_wqe_local_inval_seg { |
307 | __be32 flags; | 312 | u64 reserved1; |
308 | u32 reserved1; | ||
309 | __be32 mem_key; | 313 | __be32 mem_key; |
310 | u32 reserved2[2]; | 314 | u32 reserved2; |
311 | __be32 guest_id; | 315 | u64 reserved3[2]; |
312 | __be64 pa; | ||
313 | }; | 316 | }; |
314 | 317 | ||
315 | struct mlx4_wqe_raddr_seg { | 318 | struct mlx4_wqe_raddr_seg { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 66e2f7c61e5c..e7c3f9a0111a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -87,6 +87,7 @@ extern unsigned int kobjsize(const void *objp); | |||
87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
89 | 89 | ||
90 | #define VM_POPULATE 0x00001000 | ||
90 | #define VM_LOCKED 0x00002000 | 91 | #define VM_LOCKED 0x00002000 |
91 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ | 92 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ |
92 | 93 | ||
@@ -366,7 +367,7 @@ static inline struct page *compound_head(struct page *page) | |||
366 | * both from it and to it can be tracked, using atomic_inc_and_test | 367 | * both from it and to it can be tracked, using atomic_inc_and_test |
367 | * and atomic_add_negative(-1). | 368 | * and atomic_add_negative(-1). |
368 | */ | 369 | */ |
369 | static inline void reset_page_mapcount(struct page *page) | 370 | static inline void page_mapcount_reset(struct page *page) |
370 | { | 371 | { |
371 | atomic_set(&(page)->_mapcount, -1); | 372 | atomic_set(&(page)->_mapcount, -1); |
372 | } | 373 | } |
@@ -580,50 +581,11 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
580 | * sets it, so none of the operations on it need to be atomic. | 581 | * sets it, so none of the operations on it need to be atomic. |
581 | */ | 582 | */ |
582 | 583 | ||
583 | 584 | /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_NID] | ... | FLAGS | */ | |
584 | /* | ||
585 | * page->flags layout: | ||
586 | * | ||
587 | * There are three possibilities for how page->flags get | ||
588 | * laid out. The first is for the normal case, without | ||
589 | * sparsemem. The second is for sparsemem when there is | ||
590 | * plenty of space for node and section. The last is when | ||
591 | * we have run out of space and have to fall back to an | ||
592 | * alternate (slower) way of determining the node. | ||
593 | * | ||
594 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | | ||
595 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | | ||
596 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | | ||
597 | */ | ||
598 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
599 | #define SECTIONS_WIDTH SECTIONS_SHIFT | ||
600 | #else | ||
601 | #define SECTIONS_WIDTH 0 | ||
602 | #endif | ||
603 | |||
604 | #define ZONES_WIDTH ZONES_SHIFT | ||
605 | |||
606 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
607 | #define NODES_WIDTH NODES_SHIFT | ||
608 | #else | ||
609 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
610 | #error "Vmemmap: No space for nodes field in page flags" | ||
611 | #endif | ||
612 | #define NODES_WIDTH 0 | ||
613 | #endif | ||
614 | |||
615 | /* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */ | ||
616 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) | 585 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) |
617 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) | 586 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) |
618 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) | 587 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) |
619 | 588 | #define LAST_NID_PGOFF (ZONES_PGOFF - LAST_NID_WIDTH) | |
620 | /* | ||
621 | * We are going to use the flags for the page to node mapping if its in | ||
622 | * there. This includes the case where there is no node, so it is implicit. | ||
623 | */ | ||
624 | #if !(NODES_WIDTH > 0 || NODES_SHIFT == 0) | ||
625 | #define NODE_NOT_IN_PAGE_FLAGS | ||
626 | #endif | ||
627 | 589 | ||
628 | /* | 590 | /* |
629 | * Define the bit shifts to access each section. For non-existent | 591 | * Define the bit shifts to access each section. For non-existent |
@@ -633,6 +595,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
633 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) | 595 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) |
634 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) | 596 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) |
635 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) | 597 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) |
598 | #define LAST_NID_PGSHIFT (LAST_NID_PGOFF * (LAST_NID_WIDTH != 0)) | ||
636 | 599 | ||
637 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ | 600 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ |
638 | #ifdef NODE_NOT_IN_PAGE_FLAGS | 601 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
@@ -654,6 +617,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
654 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) | 617 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) |
655 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) | 618 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) |
656 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 619 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
620 | #define LAST_NID_MASK ((1UL << LAST_NID_WIDTH) - 1) | ||
657 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) | 621 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) |
658 | 622 | ||
659 | static inline enum zone_type page_zonenum(const struct page *page) | 623 | static inline enum zone_type page_zonenum(const struct page *page) |
@@ -661,6 +625,10 @@ static inline enum zone_type page_zonenum(const struct page *page) | |||
661 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 625 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
662 | } | 626 | } |
663 | 627 | ||
628 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
629 | #define SECTION_IN_PAGE_FLAGS | ||
630 | #endif | ||
631 | |||
664 | /* | 632 | /* |
665 | * The identification function is only used by the buddy allocator for | 633 | * The identification function is only used by the buddy allocator for |
666 | * determining if two pages could be buddies. We are not really | 634 | * determining if two pages could be buddies. We are not really |
@@ -693,31 +661,48 @@ static inline int page_to_nid(const struct page *page) | |||
693 | #endif | 661 | #endif |
694 | 662 | ||
695 | #ifdef CONFIG_NUMA_BALANCING | 663 | #ifdef CONFIG_NUMA_BALANCING |
696 | static inline int page_xchg_last_nid(struct page *page, int nid) | 664 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS |
665 | static inline int page_nid_xchg_last(struct page *page, int nid) | ||
697 | { | 666 | { |
698 | return xchg(&page->_last_nid, nid); | 667 | return xchg(&page->_last_nid, nid); |
699 | } | 668 | } |
700 | 669 | ||
701 | static inline int page_last_nid(struct page *page) | 670 | static inline int page_nid_last(struct page *page) |
702 | { | 671 | { |
703 | return page->_last_nid; | 672 | return page->_last_nid; |
704 | } | 673 | } |
705 | static inline void reset_page_last_nid(struct page *page) | 674 | static inline void page_nid_reset_last(struct page *page) |
706 | { | 675 | { |
707 | page->_last_nid = -1; | 676 | page->_last_nid = -1; |
708 | } | 677 | } |
709 | #else | 678 | #else |
710 | static inline int page_xchg_last_nid(struct page *page, int nid) | 679 | static inline int page_nid_last(struct page *page) |
680 | { | ||
681 | return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK; | ||
682 | } | ||
683 | |||
684 | extern int page_nid_xchg_last(struct page *page, int nid); | ||
685 | |||
686 | static inline void page_nid_reset_last(struct page *page) | ||
687 | { | ||
688 | int nid = (1 << LAST_NID_SHIFT) - 1; | ||
689 | |||
690 | page->flags &= ~(LAST_NID_MASK << LAST_NID_PGSHIFT); | ||
691 | page->flags |= (nid & LAST_NID_MASK) << LAST_NID_PGSHIFT; | ||
692 | } | ||
693 | #endif /* LAST_NID_NOT_IN_PAGE_FLAGS */ | ||
694 | #else | ||
695 | static inline int page_nid_xchg_last(struct page *page, int nid) | ||
711 | { | 696 | { |
712 | return page_to_nid(page); | 697 | return page_to_nid(page); |
713 | } | 698 | } |
714 | 699 | ||
715 | static inline int page_last_nid(struct page *page) | 700 | static inline int page_nid_last(struct page *page) |
716 | { | 701 | { |
717 | return page_to_nid(page); | 702 | return page_to_nid(page); |
718 | } | 703 | } |
719 | 704 | ||
720 | static inline void reset_page_last_nid(struct page *page) | 705 | static inline void page_nid_reset_last(struct page *page) |
721 | { | 706 | { |
722 | } | 707 | } |
723 | #endif | 708 | #endif |
@@ -727,7 +712,7 @@ static inline struct zone *page_zone(const struct page *page) | |||
727 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 712 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
728 | } | 713 | } |
729 | 714 | ||
730 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 715 | #ifdef SECTION_IN_PAGE_FLAGS |
731 | static inline void set_page_section(struct page *page, unsigned long section) | 716 | static inline void set_page_section(struct page *page, unsigned long section) |
732 | { | 717 | { |
733 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | 718 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); |
@@ -757,7 +742,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
757 | { | 742 | { |
758 | set_page_zone(page, zone); | 743 | set_page_zone(page, zone); |
759 | set_page_node(page, node); | 744 | set_page_node(page, node); |
760 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 745 | #ifdef SECTION_IN_PAGE_FLAGS |
761 | set_page_section(page, pfn_to_section_nr(pfn)); | 746 | set_page_section(page, pfn_to_section_nr(pfn)); |
762 | #endif | 747 | #endif |
763 | } | 748 | } |
@@ -817,18 +802,7 @@ void page_address_init(void); | |||
817 | #define PAGE_MAPPING_KSM 2 | 802 | #define PAGE_MAPPING_KSM 2 |
818 | #define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM) | 803 | #define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM) |
819 | 804 | ||
820 | extern struct address_space swapper_space; | 805 | extern struct address_space *page_mapping(struct page *page); |
821 | static inline struct address_space *page_mapping(struct page *page) | ||
822 | { | ||
823 | struct address_space *mapping = page->mapping; | ||
824 | |||
825 | VM_BUG_ON(PageSlab(page)); | ||
826 | if (unlikely(PageSwapCache(page))) | ||
827 | mapping = &swapper_space; | ||
828 | else if ((unsigned long)mapping & PAGE_MAPPING_ANON) | ||
829 | mapping = NULL; | ||
830 | return mapping; | ||
831 | } | ||
832 | 806 | ||
833 | /* Neutral page->mapping pointer to address_space or anon_vma or other */ | 807 | /* Neutral page->mapping pointer to address_space or anon_vma or other */ |
834 | static inline void *page_rmapping(struct page *page) | 808 | static inline void *page_rmapping(struct page *page) |
@@ -1035,18 +1009,18 @@ static inline int fixup_user_fault(struct task_struct *tsk, | |||
1035 | } | 1009 | } |
1036 | #endif | 1010 | #endif |
1037 | 1011 | ||
1038 | extern int make_pages_present(unsigned long addr, unsigned long end); | ||
1039 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 1012 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
1040 | extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, | 1013 | extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, |
1041 | void *buf, int len, int write); | 1014 | void *buf, int len, int write); |
1042 | 1015 | ||
1043 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 1016 | long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
1044 | unsigned long start, int len, unsigned int foll_flags, | 1017 | unsigned long start, unsigned long nr_pages, |
1045 | struct page **pages, struct vm_area_struct **vmas, | 1018 | unsigned int foll_flags, struct page **pages, |
1046 | int *nonblocking); | 1019 | struct vm_area_struct **vmas, int *nonblocking); |
1047 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 1020 | long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
1048 | unsigned long start, int nr_pages, int write, int force, | 1021 | unsigned long start, unsigned long nr_pages, |
1049 | struct page **pages, struct vm_area_struct **vmas); | 1022 | int write, int force, struct page **pages, |
1023 | struct vm_area_struct **vmas); | ||
1050 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 1024 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
1051 | struct page **pages); | 1025 | struct page **pages); |
1052 | struct kvec; | 1026 | struct kvec; |
@@ -1359,6 +1333,24 @@ extern void free_bootmem_with_active_regions(int nid, | |||
1359 | unsigned long max_low_pfn); | 1333 | unsigned long max_low_pfn); |
1360 | extern void sparse_memory_present_with_active_regions(int nid); | 1334 | extern void sparse_memory_present_with_active_regions(int nid); |
1361 | 1335 | ||
1336 | #define MOVABLEMEM_MAP_MAX MAX_NUMNODES | ||
1337 | struct movablemem_entry { | ||
1338 | unsigned long start_pfn; /* start pfn of memory segment */ | ||
1339 | unsigned long end_pfn; /* end pfn of memory segment (exclusive) */ | ||
1340 | }; | ||
1341 | |||
1342 | struct movablemem_map { | ||
1343 | bool acpi; /* true if using SRAT info */ | ||
1344 | int nr_map; | ||
1345 | struct movablemem_entry map[MOVABLEMEM_MAP_MAX]; | ||
1346 | nodemask_t numa_nodes_hotplug; /* on which nodes we specify memory */ | ||
1347 | nodemask_t numa_nodes_kernel; /* on which nodes kernel resides in */ | ||
1348 | }; | ||
1349 | |||
1350 | extern void __init insert_movablemem_map(unsigned long start_pfn, | ||
1351 | unsigned long end_pfn); | ||
1352 | extern int __init movablemem_map_overlap(unsigned long start_pfn, | ||
1353 | unsigned long end_pfn); | ||
1362 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 1354 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
1363 | 1355 | ||
1364 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ | 1356 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ |
@@ -1386,7 +1378,6 @@ extern void __init mmap_init(void); | |||
1386 | extern void show_mem(unsigned int flags); | 1378 | extern void show_mem(unsigned int flags); |
1387 | extern void si_meminfo(struct sysinfo * val); | 1379 | extern void si_meminfo(struct sysinfo * val); |
1388 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1380 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
1389 | extern int after_bootmem; | ||
1390 | 1381 | ||
1391 | extern __printf(3, 4) | 1382 | extern __printf(3, 4) |
1392 | void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | 1383 | void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); |
@@ -1396,6 +1387,9 @@ extern void setup_per_cpu_pageset(void); | |||
1396 | extern void zone_pcp_update(struct zone *zone); | 1387 | extern void zone_pcp_update(struct zone *zone); |
1397 | extern void zone_pcp_reset(struct zone *zone); | 1388 | extern void zone_pcp_reset(struct zone *zone); |
1398 | 1389 | ||
1390 | /* page_alloc.c */ | ||
1391 | extern int min_free_kbytes; | ||
1392 | |||
1399 | /* nommu.c */ | 1393 | /* nommu.c */ |
1400 | extern atomic_long_t mmap_pages_allocated; | 1394 | extern atomic_long_t mmap_pages_allocated; |
1401 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | 1395 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); |
@@ -1473,13 +1467,24 @@ extern int install_special_mapping(struct mm_struct *mm, | |||
1473 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1467 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
1474 | 1468 | ||
1475 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1469 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
1476 | unsigned long len, unsigned long flags, | 1470 | unsigned long len, vm_flags_t vm_flags, unsigned long pgoff); |
1477 | vm_flags_t vm_flags, unsigned long pgoff); | 1471 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, |
1478 | extern unsigned long do_mmap_pgoff(struct file *, unsigned long, | 1472 | unsigned long len, unsigned long prot, unsigned long flags, |
1479 | unsigned long, unsigned long, | 1473 | unsigned long pgoff, unsigned long *populate); |
1480 | unsigned long, unsigned long); | ||
1481 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); | 1474 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); |
1482 | 1475 | ||
1476 | #ifdef CONFIG_MMU | ||
1477 | extern int __mm_populate(unsigned long addr, unsigned long len, | ||
1478 | int ignore_errors); | ||
1479 | static inline void mm_populate(unsigned long addr, unsigned long len) | ||
1480 | { | ||
1481 | /* Ignore errors */ | ||
1482 | (void) __mm_populate(addr, len, 1); | ||
1483 | } | ||
1484 | #else | ||
1485 | static inline void mm_populate(unsigned long addr, unsigned long len) {} | ||
1486 | #endif | ||
1487 | |||
1483 | /* These take the mm semaphore themselves */ | 1488 | /* These take the mm semaphore themselves */ |
1484 | extern unsigned long vm_brk(unsigned long, unsigned long); | 1489 | extern unsigned long vm_brk(unsigned long, unsigned long); |
1485 | extern int vm_munmap(unsigned long, size_t); | 1490 | extern int vm_munmap(unsigned long, size_t); |
@@ -1624,8 +1629,17 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1624 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, | 1629 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, |
1625 | unsigned long pfn); | 1630 | unsigned long pfn); |
1626 | 1631 | ||
1627 | struct page *follow_page(struct vm_area_struct *, unsigned long address, | 1632 | struct page *follow_page_mask(struct vm_area_struct *vma, |
1628 | unsigned int foll_flags); | 1633 | unsigned long address, unsigned int foll_flags, |
1634 | unsigned int *page_mask); | ||
1635 | |||
1636 | static inline struct page *follow_page(struct vm_area_struct *vma, | ||
1637 | unsigned long address, unsigned int foll_flags) | ||
1638 | { | ||
1639 | unsigned int unused_page_mask; | ||
1640 | return follow_page_mask(vma, address, foll_flags, &unused_page_mask); | ||
1641 | } | ||
1642 | |||
1629 | #define FOLL_WRITE 0x01 /* check pte is writable */ | 1643 | #define FOLL_WRITE 0x01 /* check pte is writable */ |
1630 | #define FOLL_TOUCH 0x02 /* mark page accessed */ | 1644 | #define FOLL_TOUCH 0x02 /* mark page accessed */ |
1631 | #define FOLL_GET 0x04 /* do get_page on page */ | 1645 | #define FOLL_GET 0x04 /* do get_page on page */ |
@@ -1637,6 +1651,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1637 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | 1651 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ |
1638 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ | 1652 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ |
1639 | #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ | 1653 | #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ |
1654 | #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ | ||
1640 | 1655 | ||
1641 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1656 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1642 | void *data); | 1657 | void *data); |
@@ -1708,7 +1723,11 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
1708 | unsigned long pages, int node); | 1723 | unsigned long pages, int node); |
1709 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1724 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1710 | void vmemmap_populate_print_last(void); | 1725 | void vmemmap_populate_print_last(void); |
1711 | 1726 | #ifdef CONFIG_MEMORY_HOTPLUG | |
1727 | void vmemmap_free(struct page *memmap, unsigned long nr_pages); | ||
1728 | #endif | ||
1729 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, | ||
1730 | unsigned long size); | ||
1712 | 1731 | ||
1713 | enum mf_flags { | 1732 | enum mf_flags { |
1714 | MF_COUNT_INCREASED = 1 << 0, | 1733 | MF_COUNT_INCREASED = 1 << 0, |
@@ -1721,7 +1740,7 @@ extern int unpoison_memory(unsigned long pfn); | |||
1721 | extern int sysctl_memory_failure_early_kill; | 1740 | extern int sysctl_memory_failure_early_kill; |
1722 | extern int sysctl_memory_failure_recovery; | 1741 | extern int sysctl_memory_failure_recovery; |
1723 | extern void shake_page(struct page *p, int access); | 1742 | extern void shake_page(struct page *p, int access); |
1724 | extern atomic_long_t mce_bad_pages; | 1743 | extern atomic_long_t num_poisoned_pages; |
1725 | extern int soft_offline_page(struct page *page, int flags); | 1744 | extern int soft_offline_page(struct page *page, int flags); |
1726 | 1745 | ||
1727 | extern void dump_page(struct page *page); | 1746 | extern void dump_page(struct page *page); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index f8f5162a3571..ace9a5f01c64 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/page-debug-flags.h> | 13 | #include <linux/page-debug-flags.h> |
14 | #include <linux/uprobes.h> | 14 | #include <linux/uprobes.h> |
15 | #include <linux/page-flags-layout.h> | ||
15 | #include <asm/page.h> | 16 | #include <asm/page.h> |
16 | #include <asm/mmu.h> | 17 | #include <asm/mmu.h> |
17 | 18 | ||
@@ -173,7 +174,7 @@ struct page { | |||
173 | void *shadow; | 174 | void *shadow; |
174 | #endif | 175 | #endif |
175 | 176 | ||
176 | #ifdef CONFIG_NUMA_BALANCING | 177 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS |
177 | int _last_nid; | 178 | int _last_nid; |
178 | #endif | 179 | #endif |
179 | } | 180 | } |
@@ -414,9 +415,9 @@ struct mm_struct { | |||
414 | #endif | 415 | #endif |
415 | #ifdef CONFIG_NUMA_BALANCING | 416 | #ifdef CONFIG_NUMA_BALANCING |
416 | /* | 417 | /* |
417 | * numa_next_scan is the next time when the PTEs will me marked | 418 | * numa_next_scan is the next time that the PTEs will be marked |
418 | * pte_numa to gather statistics and migrate pages to new nodes | 419 | * pte_numa. NUMA hinting faults will gather statistics and migrate |
419 | * if necessary | 420 | * pages to new nodes if necessary. |
420 | */ | 421 | */ |
421 | unsigned long numa_next_scan; | 422 | unsigned long numa_next_scan; |
422 | 423 | ||
diff --git a/include/linux/mman.h b/include/linux/mman.h index 9aa863da287f..61c7a87e5d2b 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -79,6 +79,8 @@ calc_vm_flag_bits(unsigned long flags) | |||
79 | { | 79 | { |
80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | | 80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | |
81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | | 81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | |
82 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); | 82 | ((flags & MAP_LOCKED) ? (VM_LOCKED | VM_POPULATE) : 0) | |
83 | (((flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE) ? | ||
84 | VM_POPULATE : 0); | ||
83 | } | 85 | } |
84 | #endif /* _LINUX_MMAN_H */ | 86 | #endif /* _LINUX_MMAN_H */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 5c69315d60cc..61b2c30c903b 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -53,6 +53,9 @@ struct mmc_ext_csd { | |||
53 | u8 part_config; | 53 | u8 part_config; |
54 | u8 cache_ctrl; | 54 | u8 cache_ctrl; |
55 | u8 rst_n_function; | 55 | u8 rst_n_function; |
56 | u8 max_packed_writes; | ||
57 | u8 max_packed_reads; | ||
58 | u8 packed_event_en; | ||
56 | unsigned int part_time; /* Units: ms */ | 59 | unsigned int part_time; /* Units: ms */ |
57 | unsigned int sa_timeout; /* Units: 100ns */ | 60 | unsigned int sa_timeout; /* Units: 100ns */ |
58 | unsigned int generic_cmd6_time; /* Units: 10ms */ | 61 | unsigned int generic_cmd6_time; /* Units: 10ms */ |
@@ -83,7 +86,7 @@ struct mmc_ext_csd { | |||
83 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 86 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
84 | unsigned int boot_ro_lock; /* ro lock support */ | 87 | unsigned int boot_ro_lock; /* ro lock support */ |
85 | bool boot_ro_lockable; | 88 | bool boot_ro_lockable; |
86 | u8 raw_exception_status; /* 53 */ | 89 | u8 raw_exception_status; /* 54 */ |
87 | u8 raw_partition_support; /* 160 */ | 90 | u8 raw_partition_support; /* 160 */ |
88 | u8 raw_rpmb_size_mult; /* 168 */ | 91 | u8 raw_rpmb_size_mult; /* 168 */ |
89 | u8 raw_erased_mem_count; /* 181 */ | 92 | u8 raw_erased_mem_count; /* 181 */ |
@@ -187,6 +190,18 @@ struct sdio_func_tuple; | |||
187 | 190 | ||
188 | #define SDIO_MAX_FUNCS 7 | 191 | #define SDIO_MAX_FUNCS 7 |
189 | 192 | ||
193 | enum mmc_blk_status { | ||
194 | MMC_BLK_SUCCESS = 0, | ||
195 | MMC_BLK_PARTIAL, | ||
196 | MMC_BLK_CMD_ERR, | ||
197 | MMC_BLK_RETRY, | ||
198 | MMC_BLK_ABORT, | ||
199 | MMC_BLK_DATA_ERR, | ||
200 | MMC_BLK_ECC_ERR, | ||
201 | MMC_BLK_NOMEDIUM, | ||
202 | MMC_BLK_NEW_REQUEST, | ||
203 | }; | ||
204 | |||
190 | /* The number of MMC physical partitions. These consist of: | 205 | /* The number of MMC physical partitions. These consist of: |
191 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | 206 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. |
192 | */ | 207 | */ |
@@ -295,6 +310,11 @@ static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | |||
295 | card->nr_parts++; | 310 | card->nr_parts++; |
296 | } | 311 | } |
297 | 312 | ||
313 | static inline bool mmc_large_sector(struct mmc_card *card) | ||
314 | { | ||
315 | return card->ext_csd.data_sector_size == 4096; | ||
316 | } | ||
317 | |||
298 | /* | 318 | /* |
299 | * The world is not perfect and supplies us with broken mmc/sdio devices. | 319 | * The world is not perfect and supplies us with broken mmc/sdio devices. |
300 | * For at least some of these bugs we need a work-around. | 320 | * For at least some of these bugs we need a work-around. |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 5bf7c2274fcb..39613b9a6fc5 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -18,6 +18,9 @@ struct mmc_request; | |||
18 | struct mmc_command { | 18 | struct mmc_command { |
19 | u32 opcode; | 19 | u32 opcode; |
20 | u32 arg; | 20 | u32 arg; |
21 | #define MMC_CMD23_ARG_REL_WR (1 << 31) | ||
22 | #define MMC_CMD23_ARG_PACKED ((0 << 31) | (1 << 30)) | ||
23 | #define MMC_CMD23_ARG_TAG_REQ (1 << 29) | ||
21 | u32 resp[4]; | 24 | u32 resp[4]; |
22 | unsigned int flags; /* expected response type */ | 25 | unsigned int flags; /* expected response type */ |
23 | #define MMC_RSP_PRESENT (1 << 0) | 26 | #define MMC_RSP_PRESENT (1 << 0) |
@@ -120,6 +123,7 @@ struct mmc_data { | |||
120 | s32 host_cookie; /* host private data */ | 123 | s32 host_cookie; /* host private data */ |
121 | }; | 124 | }; |
122 | 125 | ||
126 | struct mmc_host; | ||
123 | struct mmc_request { | 127 | struct mmc_request { |
124 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ | 128 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ |
125 | struct mmc_command *cmd; | 129 | struct mmc_command *cmd; |
@@ -128,9 +132,9 @@ struct mmc_request { | |||
128 | 132 | ||
129 | struct completion completion; | 133 | struct completion completion; |
130 | void (*done)(struct mmc_request *);/* completion function */ | 134 | void (*done)(struct mmc_request *);/* completion function */ |
135 | struct mmc_host *host; | ||
131 | }; | 136 | }; |
132 | 137 | ||
133 | struct mmc_host; | ||
134 | struct mmc_card; | 138 | struct mmc_card; |
135 | struct mmc_async_req; | 139 | struct mmc_async_req; |
136 | 140 | ||
@@ -147,6 +151,7 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | |||
147 | extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); | 151 | extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); |
148 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool); | 152 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool); |
149 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | 153 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); |
154 | extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); | ||
150 | 155 | ||
151 | #define MMC_ERASE_ARG 0x00000000 | 156 | #define MMC_ERASE_ARG 0x00000000 |
152 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 157 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 34be4f47293c..198f0fa44e9f 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -209,8 +209,10 @@ struct dw_mci_dma_ops { | |||
209 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) | 209 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) |
210 | /* Unreliable card detection */ | 210 | /* Unreliable card detection */ |
211 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) | 211 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) |
212 | /* Write Protect detection not available */ | 212 | |
213 | #define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) | 213 | /* Slot level quirks */ |
214 | /* This slot has no write protect */ | ||
215 | #define DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT BIT(0) | ||
214 | 216 | ||
215 | struct dma_pdata; | 217 | struct dma_pdata; |
216 | 218 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 61a10c17aabd..d6f20cc6415e 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -131,9 +131,11 @@ struct mmc_host_ops { | |||
131 | 131 | ||
132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
133 | 133 | ||
134 | /* Check if the card is pulling dat[0:3] low */ | ||
135 | int (*card_busy)(struct mmc_host *host); | ||
136 | |||
134 | /* The tuning command opcode value is different for SD and eMMC cards */ | 137 | /* The tuning command opcode value is different for SD and eMMC cards */ |
135 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); | 138 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); |
136 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | ||
137 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 139 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
138 | void (*hw_reset)(struct mmc_host *host); | 140 | void (*hw_reset)(struct mmc_host *host); |
139 | void (*card_event)(struct mmc_host *host); | 141 | void (*card_event)(struct mmc_host *host); |
@@ -170,6 +172,22 @@ struct mmc_slot { | |||
170 | void *handler_priv; | 172 | void *handler_priv; |
171 | }; | 173 | }; |
172 | 174 | ||
175 | /** | ||
176 | * mmc_context_info - synchronization details for mmc context | ||
177 | * @is_done_rcv wake up reason was done request | ||
178 | * @is_new_req wake up reason was new request | ||
179 | * @is_waiting_last_req mmc context waiting for single running request | ||
180 | * @wait wait queue | ||
181 | * @lock lock to protect data fields | ||
182 | */ | ||
183 | struct mmc_context_info { | ||
184 | bool is_done_rcv; | ||
185 | bool is_new_req; | ||
186 | bool is_waiting_last_req; | ||
187 | wait_queue_head_t wait; | ||
188 | spinlock_t lock; | ||
189 | }; | ||
190 | |||
173 | struct regulator; | 191 | struct regulator; |
174 | 192 | ||
175 | struct mmc_supply { | 193 | struct mmc_supply { |
@@ -258,6 +276,10 @@ struct mmc_host { | |||
258 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ | 276 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ |
259 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ | 277 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ |
260 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ | 278 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ |
279 | #define MMC_CAP2_PACKED_RD (1 << 12) /* Allow packed read */ | ||
280 | #define MMC_CAP2_PACKED_WR (1 << 13) /* Allow packed write */ | ||
281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ | ||
282 | MMC_CAP2_PACKED_WR) | ||
261 | 283 | ||
262 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 284 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
263 | 285 | ||
@@ -331,6 +353,7 @@ struct mmc_host { | |||
331 | struct dentry *debugfs_root; | 353 | struct dentry *debugfs_root; |
332 | 354 | ||
333 | struct mmc_async_req *areq; /* active async req */ | 355 | struct mmc_async_req *areq; /* active async req */ |
356 | struct mmc_context_info context_info; /* async synchronization info */ | ||
334 | 357 | ||
335 | #ifdef CONFIG_FAIL_MMC_REQUEST | 358 | #ifdef CONFIG_FAIL_MMC_REQUEST |
336 | struct fault_attr fail_mmc_request; | 359 | struct fault_attr fail_mmc_request; |
@@ -341,10 +364,11 @@ struct mmc_host { | |||
341 | unsigned long private[0] ____cacheline_aligned; | 364 | unsigned long private[0] ____cacheline_aligned; |
342 | }; | 365 | }; |
343 | 366 | ||
344 | extern struct mmc_host *mmc_alloc_host(int extra, struct device *); | 367 | struct mmc_host *mmc_alloc_host(int extra, struct device *); |
345 | extern int mmc_add_host(struct mmc_host *); | 368 | int mmc_add_host(struct mmc_host *); |
346 | extern void mmc_remove_host(struct mmc_host *); | 369 | void mmc_remove_host(struct mmc_host *); |
347 | extern void mmc_free_host(struct mmc_host *); | 370 | void mmc_free_host(struct mmc_host *); |
371 | void mmc_of_parse(struct mmc_host *host); | ||
348 | 372 | ||
349 | static inline void *mmc_priv(struct mmc_host *host) | 373 | static inline void *mmc_priv(struct mmc_host *host) |
350 | { | 374 | { |
@@ -357,16 +381,16 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
357 | #define mmc_classdev(x) (&(x)->class_dev) | 381 | #define mmc_classdev(x) (&(x)->class_dev) |
358 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) | 382 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) |
359 | 383 | ||
360 | extern int mmc_suspend_host(struct mmc_host *); | 384 | int mmc_suspend_host(struct mmc_host *); |
361 | extern int mmc_resume_host(struct mmc_host *); | 385 | int mmc_resume_host(struct mmc_host *); |
362 | 386 | ||
363 | extern int mmc_power_save_host(struct mmc_host *host); | 387 | int mmc_power_save_host(struct mmc_host *host); |
364 | extern int mmc_power_restore_host(struct mmc_host *host); | 388 | int mmc_power_restore_host(struct mmc_host *host); |
365 | 389 | ||
366 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 390 | void mmc_detect_change(struct mmc_host *, unsigned long delay); |
367 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 391 | void mmc_request_done(struct mmc_host *, struct mmc_request *); |
368 | 392 | ||
369 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | 393 | int mmc_cache_ctrl(struct mmc_host *, u8); |
370 | 394 | ||
371 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 395 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
372 | { | 396 | { |
@@ -434,6 +458,19 @@ static inline int mmc_boot_partition_access(struct mmc_host *host) | |||
434 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | 458 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); |
435 | } | 459 | } |
436 | 460 | ||
461 | static inline int mmc_host_uhs(struct mmc_host *host) | ||
462 | { | ||
463 | return host->caps & | ||
464 | (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | | ||
465 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | | ||
466 | MMC_CAP_UHS_DDR50); | ||
467 | } | ||
468 | |||
469 | static inline int mmc_host_packed_wr(struct mmc_host *host) | ||
470 | { | ||
471 | return host->caps2 & MMC_CAP2_PACKED_WR; | ||
472 | } | ||
473 | |||
437 | #ifdef CONFIG_MMC_CLKGATE | 474 | #ifdef CONFIG_MMC_CLKGATE |
438 | void mmc_host_clk_hold(struct mmc_host *host); | 475 | void mmc_host_clk_hold(struct mmc_host *host); |
439 | void mmc_host_clk_release(struct mmc_host *host); | 476 | void mmc_host_clk_release(struct mmc_host *host); |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 94d532e41c61..50bcde3677ca 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -139,7 +139,7 @@ static inline bool mmc_op_multi(u32 opcode) | |||
139 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | 139 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
140 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | 140 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ |
141 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | 141 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ |
142 | #define R1_EXCEPTION_EVENT (1 << 6) /* sx, a */ | 142 | #define R1_EXCEPTION_EVENT (1 << 6) /* sr, a */ |
143 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 143 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
144 | 144 | ||
145 | #define R1_STATE_IDLE 0 | 145 | #define R1_STATE_IDLE 0 |
@@ -275,7 +275,10 @@ struct _mmc_csd { | |||
275 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ | 275 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ |
276 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ | 276 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ |
277 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | 277 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ |
278 | #define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO */ | 278 | #define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */ |
279 | #define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ | ||
280 | #define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ | ||
281 | #define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ | ||
279 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ | 282 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ |
280 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | 283 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ |
281 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 284 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
@@ -324,6 +327,8 @@ struct _mmc_csd { | |||
324 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | 327 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ |
325 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ | 328 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ |
326 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ | 329 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ |
330 | #define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ | ||
331 | #define EXT_CSD_MAX_PACKED_READS 501 /* RO */ | ||
327 | #define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ | 332 | #define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ |
328 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ | 333 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ |
329 | 334 | ||
@@ -385,6 +390,9 @@ struct _mmc_csd { | |||
385 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ | 390 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ |
386 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 | 391 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 |
387 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 | 392 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 |
393 | |||
394 | #define EXT_CSD_PACKED_EVENT_EN BIT(3) | ||
395 | |||
388 | /* | 396 | /* |
389 | * EXCEPTION_EVENT_STATUS field | 397 | * EXCEPTION_EVENT_STATUS field |
390 | */ | 398 | */ |
@@ -393,6 +401,9 @@ struct _mmc_csd { | |||
393 | #define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) | 401 | #define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) |
394 | #define EXT_CSD_PACKED_FAILURE BIT(3) | 402 | #define EXT_CSD_PACKED_FAILURE BIT(3) |
395 | 403 | ||
404 | #define EXT_CSD_PACKED_GENERIC_ERROR BIT(0) | ||
405 | #define EXT_CSD_PACKED_INDEXED_ERROR BIT(1) | ||
406 | |||
396 | /* | 407 | /* |
397 | * BKOPS status level | 408 | * BKOPS status level |
398 | */ | 409 | */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 4bbc3301fbbf..b838ffc49e4a 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -94,6 +94,7 @@ struct sdhci_host { | |||
94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) | 94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) |
95 | /* The system physically doesn't support 1.8v, even if the host does */ | 95 | /* The system physically doesn't support 1.8v, even if the host does */ |
96 | #define SDHCI_QUIRK2_NO_1_8_V (1<<2) | 96 | #define SDHCI_QUIRK2_NO_1_8_V (1<<2) |
97 | #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3) | ||
97 | 98 | ||
98 | int irq; /* Device IRQ */ | 99 | int irq; /* Device IRQ */ |
99 | void __iomem *ioaddr; /* Mapped address */ | 100 | void __iomem *ioaddr; /* Mapped address */ |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index b65679ffa880..b76bcf0621f6 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct platform_device; | 6 | struct platform_device; |
7 | struct tmio_mmc_data; | ||
8 | 7 | ||
9 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | 8 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" |
10 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | 9 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" |
@@ -26,7 +25,6 @@ struct sh_mobile_sdhi_info { | |||
26 | unsigned long tmio_caps2; | 25 | unsigned long tmio_caps2; |
27 | u32 tmio_ocr_mask; /* available MMC voltages */ | 26 | u32 tmio_ocr_mask; /* available MMC voltages */ |
28 | unsigned int cd_gpio; | 27 | unsigned int cd_gpio; |
29 | struct tmio_mmc_data *pdata; | ||
30 | void (*set_pwr)(struct platform_device *pdev, int state); | 28 | void (*set_pwr)(struct platform_device *pdev, int state); |
31 | int (*get_cd)(struct platform_device *pdev); | 29 | int (*get_cd)(struct platform_device *pdev); |
32 | 30 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 73b64a38b984..ede274957e05 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/pageblock-flags.h> | 17 | #include <linux/pageblock-flags.h> |
18 | #include <generated/bounds.h> | 18 | #include <linux/page-flags-layout.h> |
19 | #include <linux/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | 21 | ||
@@ -57,7 +57,9 @@ enum { | |||
57 | */ | 57 | */ |
58 | MIGRATE_CMA, | 58 | MIGRATE_CMA, |
59 | #endif | 59 | #endif |
60 | #ifdef CONFIG_MEMORY_ISOLATION | ||
60 | MIGRATE_ISOLATE, /* can't allocate from here */ | 61 | MIGRATE_ISOLATE, /* can't allocate from here */ |
62 | #endif | ||
61 | MIGRATE_TYPES | 63 | MIGRATE_TYPES |
62 | }; | 64 | }; |
63 | 65 | ||
@@ -308,24 +310,6 @@ enum zone_type { | |||
308 | 310 | ||
309 | #ifndef __GENERATING_BOUNDS_H | 311 | #ifndef __GENERATING_BOUNDS_H |
310 | 312 | ||
311 | /* | ||
312 | * When a memory allocation must conform to specific limitations (such | ||
313 | * as being suitable for DMA) the caller will pass in hints to the | ||
314 | * allocator in the gfp_mask, in the zone modifier bits. These bits | ||
315 | * are used to select a priority ordered list of memory zones which | ||
316 | * match the requested limits. See gfp_zone() in include/linux/gfp.h | ||
317 | */ | ||
318 | |||
319 | #if MAX_NR_ZONES < 2 | ||
320 | #define ZONES_SHIFT 0 | ||
321 | #elif MAX_NR_ZONES <= 2 | ||
322 | #define ZONES_SHIFT 1 | ||
323 | #elif MAX_NR_ZONES <= 4 | ||
324 | #define ZONES_SHIFT 2 | ||
325 | #else | ||
326 | #error ZONES_SHIFT -- too many zones configured adjust calculation | ||
327 | #endif | ||
328 | |||
329 | struct zone { | 313 | struct zone { |
330 | /* Fields commonly accessed by the page allocator */ | 314 | /* Fields commonly accessed by the page allocator */ |
331 | 315 | ||
@@ -543,6 +527,26 @@ static inline int zone_is_oom_locked(const struct zone *zone) | |||
543 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | 527 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); |
544 | } | 528 | } |
545 | 529 | ||
530 | static inline unsigned zone_end_pfn(const struct zone *zone) | ||
531 | { | ||
532 | return zone->zone_start_pfn + zone->spanned_pages; | ||
533 | } | ||
534 | |||
535 | static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) | ||
536 | { | ||
537 | return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); | ||
538 | } | ||
539 | |||
540 | static inline bool zone_is_initialized(struct zone *zone) | ||
541 | { | ||
542 | return !!zone->wait_table; | ||
543 | } | ||
544 | |||
545 | static inline bool zone_is_empty(struct zone *zone) | ||
546 | { | ||
547 | return zone->spanned_pages == 0; | ||
548 | } | ||
549 | |||
546 | /* | 550 | /* |
547 | * The "priority" of VM scanning is how much of the queues we will scan in one | 551 | * The "priority" of VM scanning is how much of the queues we will scan in one |
548 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the | 552 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the |
@@ -752,11 +756,17 @@ typedef struct pglist_data { | |||
752 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) | 756 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) |
753 | 757 | ||
754 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 758 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
759 | #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid)) | ||
755 | 760 | ||
756 | #define node_end_pfn(nid) ({\ | 761 | static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat) |
757 | pg_data_t *__pgdat = NODE_DATA(nid);\ | 762 | { |
758 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\ | 763 | return pgdat->node_start_pfn + pgdat->node_spanned_pages; |
759 | }) | 764 | } |
765 | |||
766 | static inline bool pgdat_is_empty(pg_data_t *pgdat) | ||
767 | { | ||
768 | return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; | ||
769 | } | ||
760 | 770 | ||
761 | #include <linux/memory_hotplug.h> | 771 | #include <linux/memory_hotplug.h> |
762 | 772 | ||
@@ -1053,8 +1063,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
1053 | * PA_SECTION_SHIFT physical address to/from section number | 1063 | * PA_SECTION_SHIFT physical address to/from section number |
1054 | * PFN_SECTION_SHIFT pfn to/from section number | 1064 | * PFN_SECTION_SHIFT pfn to/from section number |
1055 | */ | 1065 | */ |
1056 | #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) | ||
1057 | |||
1058 | #define PA_SECTION_SHIFT (SECTION_SIZE_BITS) | 1066 | #define PA_SECTION_SHIFT (SECTION_SIZE_BITS) |
1059 | #define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT) | 1067 | #define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT) |
1060 | 1068 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 1375ee3f03aa..ead1b5719a12 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -396,13 +396,13 @@ bool is_module_address(unsigned long addr); | |||
396 | bool is_module_percpu_address(unsigned long addr); | 396 | bool is_module_percpu_address(unsigned long addr); |
397 | bool is_module_text_address(unsigned long addr); | 397 | bool is_module_text_address(unsigned long addr); |
398 | 398 | ||
399 | static inline int within_module_core(unsigned long addr, struct module *mod) | 399 | static inline int within_module_core(unsigned long addr, const struct module *mod) |
400 | { | 400 | { |
401 | return (unsigned long)mod->module_core <= addr && | 401 | return (unsigned long)mod->module_core <= addr && |
402 | addr < (unsigned long)mod->module_core + mod->core_size; | 402 | addr < (unsigned long)mod->module_core + mod->core_size; |
403 | } | 403 | } |
404 | 404 | ||
405 | static inline int within_module_init(unsigned long addr, struct module *mod) | 405 | static inline int within_module_init(unsigned long addr, const struct module *mod) |
406 | { | 406 | { |
407 | return (unsigned long)mod->module_init <= addr && | 407 | return (unsigned long)mod->module_init <= addr && |
408 | addr < (unsigned long)mod->module_init + mod->init_size; | 408 | addr < (unsigned long)mod->module_init + mod->init_size; |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index ea00d9162ee5..79aaa9fc1a15 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifdef CONFIG_IP_MROUTE | 9 | #ifdef CONFIG_IP_MROUTE |
10 | static inline int ip_mroute_opt(int opt) | 10 | static inline int ip_mroute_opt(int opt) |
11 | { | 11 | { |
12 | return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10); | 12 | return (opt >= MRT_BASE) && (opt <= MRT_MAX); |
13 | } | 13 | } |
14 | #else | 14 | #else |
15 | static inline int ip_mroute_opt(int opt) | 15 | static inline int ip_mroute_opt(int opt) |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index a223561ba12e..66982e764051 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifdef CONFIG_IPV6_MROUTE | 10 | #ifdef CONFIG_IPV6_MROUTE |
11 | static inline int ip6_mroute_opt(int opt) | 11 | static inline int ip6_mroute_opt(int opt) |
12 | { | 12 | { |
13 | return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10); | 13 | return (opt >= MRT6_BASE) && (opt <= MRT6_MAX); |
14 | } | 14 | } |
15 | #else | 15 | #else |
16 | static inline int ip6_mroute_opt(int opt) | 16 | static inline int ip6_mroute_opt(int opt) |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 5ac32123035a..3dd39340430e 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -41,7 +41,7 @@ enum { | |||
41 | NETIF_F_TSO_ECN_BIT, /* ... TCP ECN support */ | 41 | NETIF_F_TSO_ECN_BIT, /* ... TCP ECN support */ |
42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ | 42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ |
43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ | 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ |
44 | NETIF_F_GSO_RESERVED1, /* ... free (fill GSO_MASK to 8 bits) */ | 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ |
45 | /**/NETIF_F_GSO_LAST, /* [can't be last bit, see GSO_MASK] */ | 45 | /**/NETIF_F_GSO_LAST, /* [can't be last bit, see GSO_MASK] */ |
46 | NETIF_F_GSO_RESERVED2 /* ... free (fill GSO_MASK to 8 bits) */ | 46 | NETIF_F_GSO_RESERVED2 /* ... free (fill GSO_MASK to 8 bits) */ |
47 | = NETIF_F_GSO_LAST, | 47 | = NETIF_F_GSO_LAST, |
@@ -102,6 +102,7 @@ enum { | |||
102 | #define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) | 102 | #define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) |
103 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) | 103 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) |
104 | #define NETIF_F_RXALL __NETIF_F(RXALL) | 104 | #define NETIF_F_RXALL __NETIF_F(RXALL) |
105 | #define NETIF_F_GRE_GSO __NETIF_F(GSO_GRE) | ||
105 | 106 | ||
106 | /* Features valid for ethtool to change */ | 107 | /* Features valid for ethtool to change */ |
107 | /* = all defined minus driver/device-class-related */ | 108 | /* = all defined minus driver/device-class-related */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9ef07d0868b6..b3d00fa4b314 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -67,6 +67,8 @@ extern void netdev_set_default_ethtool_ops(struct net_device *dev, | |||
67 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ | 67 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ |
68 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ | 68 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ |
69 | #define NET_ADDR_STOLEN 2 /* address is stolen from other device */ | 69 | #define NET_ADDR_STOLEN 2 /* address is stolen from other device */ |
70 | #define NET_ADDR_SET 3 /* address is set using | ||
71 | * dev_set_mac_address() */ | ||
70 | 72 | ||
71 | /* Backlog congestion levels */ | 73 | /* Backlog congestion levels */ |
72 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 74 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
@@ -859,8 +861,7 @@ struct netdev_fcoe_hbainfo { | |||
859 | * flow_id is a flow ID to be passed to rps_may_expire_flow() later. | 861 | * flow_id is a flow ID to be passed to rps_may_expire_flow() later. |
860 | * Return the filter ID on success, or a negative error code. | 862 | * Return the filter ID on success, or a negative error code. |
861 | * | 863 | * |
862 | * Slave management functions (for bridge, bonding, etc). User should | 864 | * Slave management functions (for bridge, bonding, etc). |
863 | * call netdev_set_master() to set dev->master properly. | ||
864 | * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev); | 865 | * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev); |
865 | * Called to make another netdev an underling. | 866 | * Called to make another netdev an underling. |
866 | * | 867 | * |
@@ -883,7 +884,8 @@ struct netdev_fcoe_hbainfo { | |||
883 | * struct net_device *dev, | 884 | * struct net_device *dev, |
884 | * const unsigned char *addr, u16 flags) | 885 | * const unsigned char *addr, u16 flags) |
885 | * Adds an FDB entry to dev for addr. | 886 | * Adds an FDB entry to dev for addr. |
886 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, | 887 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[], |
888 | * struct net_device *dev, | ||
887 | * const unsigned char *addr) | 889 | * const unsigned char *addr) |
888 | * Deletes the FDB entry from dev coresponding to addr. | 890 | * Deletes the FDB entry from dev coresponding to addr. |
889 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, | 891 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, |
@@ -894,6 +896,14 @@ struct netdev_fcoe_hbainfo { | |||
894 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) | 896 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) |
895 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, | 897 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, |
896 | * struct net_device *dev) | 898 | * struct net_device *dev) |
899 | * | ||
900 | * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); | ||
901 | * Called to change device carrier. Soft-devices (like dummy, team, etc) | ||
902 | * which do not represent real hardware may define this to allow their | ||
903 | * userspace components to manage their virtual carrier state. Devices | ||
904 | * that determine carrier state from physical hardware properties (eg | ||
905 | * network cables) or protocol-dependent mechanisms (eg | ||
906 | * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. | ||
897 | */ | 907 | */ |
898 | struct net_device_ops { | 908 | struct net_device_ops { |
899 | int (*ndo_init)(struct net_device *dev); | 909 | int (*ndo_init)(struct net_device *dev); |
@@ -999,6 +1009,7 @@ struct net_device_ops { | |||
999 | const unsigned char *addr, | 1009 | const unsigned char *addr, |
1000 | u16 flags); | 1010 | u16 flags); |
1001 | int (*ndo_fdb_del)(struct ndmsg *ndm, | 1011 | int (*ndo_fdb_del)(struct ndmsg *ndm, |
1012 | struct nlattr *tb[], | ||
1002 | struct net_device *dev, | 1013 | struct net_device *dev, |
1003 | const unsigned char *addr); | 1014 | const unsigned char *addr); |
1004 | int (*ndo_fdb_dump)(struct sk_buff *skb, | 1015 | int (*ndo_fdb_dump)(struct sk_buff *skb, |
@@ -1010,7 +1021,12 @@ struct net_device_ops { | |||
1010 | struct nlmsghdr *nlh); | 1021 | struct nlmsghdr *nlh); |
1011 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | 1022 | int (*ndo_bridge_getlink)(struct sk_buff *skb, |
1012 | u32 pid, u32 seq, | 1023 | u32 pid, u32 seq, |
1013 | struct net_device *dev); | 1024 | struct net_device *dev, |
1025 | u32 filter_mask); | ||
1026 | int (*ndo_bridge_dellink)(struct net_device *dev, | ||
1027 | struct nlmsghdr *nlh); | ||
1028 | int (*ndo_change_carrier)(struct net_device *dev, | ||
1029 | bool new_carrier); | ||
1014 | }; | 1030 | }; |
1015 | 1031 | ||
1016 | /* | 1032 | /* |
@@ -1161,9 +1177,7 @@ struct net_device { | |||
1161 | * avoid dirtying this cache line. | 1177 | * avoid dirtying this cache line. |
1162 | */ | 1178 | */ |
1163 | 1179 | ||
1164 | struct net_device *master; /* Pointer to master device of a group, | 1180 | struct list_head upper_dev_list; /* List of upper devices */ |
1165 | * which this device is member of. | ||
1166 | */ | ||
1167 | 1181 | ||
1168 | /* Interface address info used in eth_type_trans() */ | 1182 | /* Interface address info used in eth_type_trans() */ |
1169 | unsigned char *dev_addr; /* hw address, (before bcast | 1183 | unsigned char *dev_addr; /* hw address, (before bcast |
@@ -1263,7 +1277,7 @@ struct net_device { | |||
1263 | void (*destructor)(struct net_device *dev); | 1277 | void (*destructor)(struct net_device *dev); |
1264 | 1278 | ||
1265 | #ifdef CONFIG_NETPOLL | 1279 | #ifdef CONFIG_NETPOLL |
1266 | struct netpoll_info *npinfo; | 1280 | struct netpoll_info __rcu *npinfo; |
1267 | #endif | 1281 | #endif |
1268 | 1282 | ||
1269 | #ifdef CONFIG_NET_NS | 1283 | #ifdef CONFIG_NET_NS |
@@ -1277,9 +1291,12 @@ struct net_device { | |||
1277 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ | 1291 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ |
1278 | struct pcpu_tstats __percpu *tstats; /* tunnel stats */ | 1292 | struct pcpu_tstats __percpu *tstats; /* tunnel stats */ |
1279 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | 1293 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ |
1294 | struct pcpu_vstats __percpu *vstats; /* veth stats */ | ||
1280 | }; | 1295 | }; |
1281 | /* GARP */ | 1296 | /* GARP */ |
1282 | struct garp_port __rcu *garp_port; | 1297 | struct garp_port __rcu *garp_port; |
1298 | /* MRP */ | ||
1299 | struct mrp_port __rcu *mrp_port; | ||
1283 | 1300 | ||
1284 | /* class/net/name entry */ | 1301 | /* class/net/name entry */ |
1285 | struct device dev; | 1302 | struct device dev; |
@@ -1396,6 +1413,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1396 | 1413 | ||
1397 | extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1414 | extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
1398 | struct sk_buff *skb); | 1415 | struct sk_buff *skb); |
1416 | extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | ||
1399 | 1417 | ||
1400 | /* | 1418 | /* |
1401 | * Net namespace inlines | 1419 | * Net namespace inlines |
@@ -2095,6 +2113,18 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
2095 | __netif_schedule(txq->qdisc); | 2113 | __netif_schedule(txq->qdisc); |
2096 | } | 2114 | } |
2097 | 2115 | ||
2116 | #ifdef CONFIG_XPS | ||
2117 | extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, | ||
2118 | u16 index); | ||
2119 | #else | ||
2120 | static inline int netif_set_xps_queue(struct net_device *dev, | ||
2121 | struct cpumask *mask, | ||
2122 | u16 index) | ||
2123 | { | ||
2124 | return 0; | ||
2125 | } | ||
2126 | #endif | ||
2127 | |||
2098 | /* | 2128 | /* |
2099 | * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used | 2129 | * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used |
2100 | * as a distribution range limit for the returned value. | 2130 | * as a distribution range limit for the returned value. |
@@ -2197,6 +2227,8 @@ extern int dev_set_mtu(struct net_device *, int); | |||
2197 | extern void dev_set_group(struct net_device *, int); | 2227 | extern void dev_set_group(struct net_device *, int); |
2198 | extern int dev_set_mac_address(struct net_device *, | 2228 | extern int dev_set_mac_address(struct net_device *, |
2199 | struct sockaddr *); | 2229 | struct sockaddr *); |
2230 | extern int dev_change_carrier(struct net_device *, | ||
2231 | bool new_carrier); | ||
2200 | extern int dev_hard_start_xmit(struct sk_buff *skb, | 2232 | extern int dev_hard_start_xmit(struct sk_buff *skb, |
2201 | struct net_device *dev, | 2233 | struct net_device *dev, |
2202 | struct netdev_queue *txq); | 2234 | struct netdev_queue *txq); |
@@ -2614,7 +2646,6 @@ extern void netdev_notify_peers(struct net_device *dev); | |||
2614 | extern void netdev_features_change(struct net_device *dev); | 2646 | extern void netdev_features_change(struct net_device *dev); |
2615 | /* Load a device via the kmod */ | 2647 | /* Load a device via the kmod */ |
2616 | extern void dev_load(struct net *net, const char *name); | 2648 | extern void dev_load(struct net *net, const char *name); |
2617 | extern void dev_mcast_init(void); | ||
2618 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | 2649 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, |
2619 | struct rtnl_link_stats64 *storage); | 2650 | struct rtnl_link_stats64 *storage); |
2620 | extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, | 2651 | extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, |
@@ -2624,12 +2655,30 @@ extern int netdev_max_backlog; | |||
2624 | extern int netdev_tstamp_prequeue; | 2655 | extern int netdev_tstamp_prequeue; |
2625 | extern int weight_p; | 2656 | extern int weight_p; |
2626 | extern int bpf_jit_enable; | 2657 | extern int bpf_jit_enable; |
2627 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 2658 | |
2628 | extern int netdev_set_bond_master(struct net_device *dev, | 2659 | extern bool netdev_has_upper_dev(struct net_device *dev, |
2629 | struct net_device *master); | 2660 | struct net_device *upper_dev); |
2661 | extern bool netdev_has_any_upper_dev(struct net_device *dev); | ||
2662 | extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); | ||
2663 | extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); | ||
2664 | extern int netdev_upper_dev_link(struct net_device *dev, | ||
2665 | struct net_device *upper_dev); | ||
2666 | extern int netdev_master_upper_dev_link(struct net_device *dev, | ||
2667 | struct net_device *upper_dev); | ||
2668 | extern void netdev_upper_dev_unlink(struct net_device *dev, | ||
2669 | struct net_device *upper_dev); | ||
2630 | extern int skb_checksum_help(struct sk_buff *skb); | 2670 | extern int skb_checksum_help(struct sk_buff *skb); |
2631 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, | 2671 | extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb, |
2632 | netdev_features_t features); | 2672 | netdev_features_t features, bool tx_path); |
2673 | extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | ||
2674 | netdev_features_t features); | ||
2675 | |||
2676 | static inline | ||
2677 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | ||
2678 | { | ||
2679 | return __skb_gso_segment(skb, features, true); | ||
2680 | } | ||
2681 | |||
2633 | #ifdef CONFIG_BUG | 2682 | #ifdef CONFIG_BUG |
2634 | extern void netdev_rx_csum_fault(struct net_device *dev); | 2683 | extern void netdev_rx_csum_fault(struct net_device *dev); |
2635 | #else | 2684 | #else |
@@ -2642,9 +2691,9 @@ extern void net_enable_timestamp(void); | |||
2642 | extern void net_disable_timestamp(void); | 2691 | extern void net_disable_timestamp(void); |
2643 | 2692 | ||
2644 | #ifdef CONFIG_PROC_FS | 2693 | #ifdef CONFIG_PROC_FS |
2645 | extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); | 2694 | extern int __init dev_proc_init(void); |
2646 | extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); | 2695 | #else |
2647 | extern void dev_seq_stop(struct seq_file *seq, void *v); | 2696 | #define dev_proc_init() 0 |
2648 | #endif | 2697 | #endif |
2649 | 2698 | ||
2650 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 2699 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
@@ -2846,4 +2895,34 @@ do { \ | |||
2846 | }) | 2895 | }) |
2847 | #endif | 2896 | #endif |
2848 | 2897 | ||
2898 | /* | ||
2899 | * The list of packet types we will receive (as opposed to discard) | ||
2900 | * and the routines to invoke. | ||
2901 | * | ||
2902 | * Why 16. Because with 16 the only overlap we get on a hash of the | ||
2903 | * low nibble of the protocol value is RARP/SNAP/X.25. | ||
2904 | * | ||
2905 | * NOTE: That is no longer true with the addition of VLAN tags. Not | ||
2906 | * sure which should go first, but I bet it won't make much | ||
2907 | * difference if we are running VLANs. The good news is that | ||
2908 | * this protocol won't be in the list unless compiled in, so | ||
2909 | * the average user (w/out VLANs) will not be adversely affected. | ||
2910 | * --BLG | ||
2911 | * | ||
2912 | * 0800 IP | ||
2913 | * 8100 802.1Q VLAN | ||
2914 | * 0001 802.3 | ||
2915 | * 0002 AX.25 | ||
2916 | * 0004 802.2 | ||
2917 | * 8035 RARP | ||
2918 | * 0005 SNAP | ||
2919 | * 0805 X.25 | ||
2920 | * 0806 ARP | ||
2921 | * 8137 IPX | ||
2922 | * 0009 Localtalk | ||
2923 | * 86DD IPv6 | ||
2924 | */ | ||
2925 | #define PTYPE_HASH_SIZE (16) | ||
2926 | #define PTYPE_HASH_MASK (PTYPE_HASH_SIZE - 1) | ||
2927 | |||
2849 | #endif /* _LINUX_NETDEVICE_H */ | 2928 | #endif /* _LINUX_NETDEVICE_H */ |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 387bdd02945d..ba7f571a2b1c 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -4,12 +4,15 @@ | |||
4 | 4 | ||
5 | #include <net/netfilter/nf_conntrack_expect.h> | 5 | #include <net/netfilter/nf_conntrack_expect.h> |
6 | 6 | ||
7 | #include <linux/types.h> | ||
8 | |||
7 | #define SIP_PORT 5060 | 9 | #define SIP_PORT 5060 |
8 | #define SIP_TIMEOUT 3600 | 10 | #define SIP_TIMEOUT 3600 |
9 | 11 | ||
10 | struct nf_ct_sip_master { | 12 | struct nf_ct_sip_master { |
11 | unsigned int register_cseq; | 13 | unsigned int register_cseq; |
12 | unsigned int invite_cseq; | 14 | unsigned int invite_cseq; |
15 | __be16 forced_dport; | ||
13 | }; | 16 | }; |
14 | 17 | ||
15 | enum sip_expectation_classes { | 18 | enum sip_expectation_classes { |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 4966ddec039b..ecbb8e495912 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -34,8 +34,8 @@ extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigne | |||
34 | extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); | 34 | extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); |
35 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); | 35 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); |
36 | 36 | ||
37 | extern void nfnl_lock(void); | 37 | extern void nfnl_lock(__u8 subsys_id); |
38 | extern void nfnl_unlock(void); | 38 | extern void nfnl_unlock(__u8 subsys_id); |
39 | 39 | ||
40 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | 40 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ |
41 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | 41 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 66d5379c305e..9d7d8c64f7c8 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -12,28 +12,38 @@ | |||
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | 14 | ||
15 | union inet_addr { | ||
16 | __u32 all[4]; | ||
17 | __be32 ip; | ||
18 | __be32 ip6[4]; | ||
19 | struct in_addr in; | ||
20 | struct in6_addr in6; | ||
21 | }; | ||
22 | |||
15 | struct netpoll { | 23 | struct netpoll { |
16 | struct net_device *dev; | 24 | struct net_device *dev; |
17 | char dev_name[IFNAMSIZ]; | 25 | char dev_name[IFNAMSIZ]; |
18 | const char *name; | 26 | const char *name; |
19 | void (*rx_hook)(struct netpoll *, int, char *, int); | 27 | void (*rx_hook)(struct netpoll *, int, char *, int); |
20 | 28 | ||
21 | __be32 local_ip, remote_ip; | 29 | union inet_addr local_ip, remote_ip; |
30 | bool ipv6; | ||
22 | u16 local_port, remote_port; | 31 | u16 local_port, remote_port; |
23 | u8 remote_mac[ETH_ALEN]; | 32 | u8 remote_mac[ETH_ALEN]; |
24 | 33 | ||
25 | struct list_head rx; /* rx_np list element */ | 34 | struct list_head rx; /* rx_np list element */ |
26 | struct rcu_head rcu; | 35 | struct work_struct cleanup_work; |
27 | }; | 36 | }; |
28 | 37 | ||
29 | struct netpoll_info { | 38 | struct netpoll_info { |
30 | atomic_t refcnt; | 39 | atomic_t refcnt; |
31 | 40 | ||
32 | int rx_flags; | 41 | unsigned long rx_flags; |
33 | spinlock_t rx_lock; | 42 | spinlock_t rx_lock; |
43 | struct mutex dev_lock; | ||
34 | struct list_head rx_np; /* netpolls that registered an rx_hook */ | 44 | struct list_head rx_np; /* netpolls that registered an rx_hook */ |
35 | 45 | ||
36 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 46 | struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ |
37 | struct sk_buff_head txq; | 47 | struct sk_buff_head txq; |
38 | 48 | ||
39 | struct delayed_work tx_work; | 49 | struct delayed_work tx_work; |
@@ -42,6 +52,14 @@ struct netpoll_info { | |||
42 | struct rcu_head rcu; | 52 | struct rcu_head rcu; |
43 | }; | 53 | }; |
44 | 54 | ||
55 | #ifdef CONFIG_NETPOLL | ||
56 | extern int netpoll_rx_disable(struct net_device *dev); | ||
57 | extern void netpoll_rx_enable(struct net_device *dev); | ||
58 | #else | ||
59 | static inline int netpoll_rx_disable(struct net_device *dev) { return 0; } | ||
60 | static inline void netpoll_rx_enable(struct net_device *dev) { return; } | ||
61 | #endif | ||
62 | |||
45 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 63 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
46 | void netpoll_print_options(struct netpoll *np); | 64 | void netpoll_print_options(struct netpoll *np); |
47 | int netpoll_parse_options(struct netpoll *np, char *opt); | 65 | int netpoll_parse_options(struct netpoll *np, char *opt); |
@@ -50,7 +68,7 @@ int netpoll_setup(struct netpoll *np); | |||
50 | int netpoll_trap(void); | 68 | int netpoll_trap(void); |
51 | void netpoll_set_trap(int trap); | 69 | void netpoll_set_trap(int trap); |
52 | void __netpoll_cleanup(struct netpoll *np); | 70 | void __netpoll_cleanup(struct netpoll *np); |
53 | void __netpoll_free_rcu(struct netpoll *np); | 71 | void __netpoll_free_async(struct netpoll *np); |
54 | void netpoll_cleanup(struct netpoll *np); | 72 | void netpoll_cleanup(struct netpoll *np); |
55 | int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo); | 73 | int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo); |
56 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, | 74 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index e111fa419a4e..7b8fc73810ad 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define _LINUX_NFS4_H | 13 | #define _LINUX_NFS4_H |
14 | 14 | ||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/uidgid.h> | ||
16 | #include <uapi/linux/nfs4.h> | 17 | #include <uapi/linux/nfs4.h> |
17 | 18 | ||
18 | struct nfs4_ace { | 19 | struct nfs4_ace { |
@@ -20,7 +21,10 @@ struct nfs4_ace { | |||
20 | uint32_t flag; | 21 | uint32_t flag; |
21 | uint32_t access_mask; | 22 | uint32_t access_mask; |
22 | int whotype; | 23 | int whotype; |
23 | uid_t who; | 24 | union { |
25 | kuid_t who_uid; | ||
26 | kgid_t who_gid; | ||
27 | }; | ||
24 | }; | 28 | }; |
25 | 29 | ||
26 | struct nfs4_acl { | 30 | struct nfs4_acl { |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 2dcef3ab58b6..0f4b79da6584 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #ifndef NFS_IDMAP_H | 36 | #ifndef NFS_IDMAP_H |
37 | #define NFS_IDMAP_H | 37 | #define NFS_IDMAP_H |
38 | 38 | ||
39 | #include <linux/uidgid.h> | ||
39 | #include <uapi/linux/nfs_idmap.h> | 40 | #include <uapi/linux/nfs_idmap.h> |
40 | 41 | ||
41 | 42 | ||
@@ -67,10 +68,10 @@ void nfs_fattr_init_names(struct nfs_fattr *fattr, | |||
67 | void nfs_fattr_free_names(struct nfs_fattr *); | 68 | void nfs_fattr_free_names(struct nfs_fattr *); |
68 | void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); | 69 | void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); |
69 | 70 | ||
70 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *); | 71 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, kuid_t *); |
71 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *); | 72 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, kgid_t *); |
72 | int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t); | 73 | int nfs_map_uid_to_name(const struct nfs_server *, kuid_t, char *, size_t); |
73 | int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t); | 74 | int nfs_map_gid_to_group(const struct nfs_server *, kgid_t, char *, size_t); |
74 | 75 | ||
75 | extern unsigned int nfs_idmap_cache_timeout; | 76 | extern unsigned int nfs_idmap_cache_timeout; |
76 | #endif /* NFS_IDMAP_H */ | 77 | #endif /* NFS_IDMAP_H */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 29adb12c7ecf..13441ddac33d 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -48,8 +48,8 @@ struct nfs_fattr { | |||
48 | unsigned int valid; /* which fields are valid */ | 48 | unsigned int valid; /* which fields are valid */ |
49 | umode_t mode; | 49 | umode_t mode; |
50 | __u32 nlink; | 50 | __u32 nlink; |
51 | __u32 uid; | 51 | kuid_t uid; |
52 | __u32 gid; | 52 | kgid_t gid; |
53 | dev_t rdev; | 53 | dev_t rdev; |
54 | __u64 size; | 54 | __u64 size; |
55 | union { | 55 | union { |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 24c139288db4..7898c997dfea 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -49,8 +49,8 @@ struct svc_export { | |||
49 | struct auth_domain * ex_client; | 49 | struct auth_domain * ex_client; |
50 | int ex_flags; | 50 | int ex_flags; |
51 | struct path ex_path; | 51 | struct path ex_path; |
52 | uid_t ex_anon_uid; | 52 | kuid_t ex_anon_uid; |
53 | gid_t ex_anon_gid; | 53 | kgid_t ex_anon_gid; |
54 | int ex_fsid; | 54 | int ex_fsid; |
55 | unsigned char * ex_uuid; /* 16 byte fsid */ | 55 | unsigned char * ex_uuid; /* 16 byte fsid */ |
56 | struct nfsd4_fs_locations ex_fslocs; | 56 | struct nfsd4_fs_locations ex_fslocs; |
diff --git a/include/linux/ntb.h b/include/linux/ntb.h new file mode 100644 index 000000000000..f6a15205853b --- /dev/null +++ b/include/linux/ntb.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | * redistributing this file, you may do so under either license. | ||
4 | * | ||
5 | * GPL LICENSE SUMMARY | ||
6 | * | ||
7 | * Copyright(c) 2012 Intel Corporation. All rights reserved. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of version 2 of the GNU General Public License as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * BSD LICENSE | ||
14 | * | ||
15 | * Copyright(c) 2012 Intel Corporation. All rights reserved. | ||
16 | * | ||
17 | * Redistribution and use in source and binary forms, with or without | ||
18 | * modification, are permitted provided that the following conditions | ||
19 | * are met: | ||
20 | * | ||
21 | * * Redistributions of source code must retain the above copyright | ||
22 | * notice, this list of conditions and the following disclaimer. | ||
23 | * * Redistributions in binary form must reproduce the above copy | ||
24 | * notice, this list of conditions and the following disclaimer in | ||
25 | * the documentation and/or other materials provided with the | ||
26 | * distribution. | ||
27 | * * Neither the name of Intel Corporation nor the names of its | ||
28 | * contributors may be used to endorse or promote products derived | ||
29 | * from this software without specific prior written permission. | ||
30 | * | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
36 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
37 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
38 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
39 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
40 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
41 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
42 | * | ||
43 | * Intel PCIe NTB Linux driver | ||
44 | * | ||
45 | * Contact Information: | ||
46 | * Jon Mason <jon.mason@intel.com> | ||
47 | */ | ||
48 | |||
49 | struct ntb_transport_qp; | ||
50 | |||
51 | struct ntb_client { | ||
52 | struct device_driver driver; | ||
53 | int (*probe) (struct pci_dev *pdev); | ||
54 | void (*remove) (struct pci_dev *pdev); | ||
55 | }; | ||
56 | |||
57 | int ntb_register_client(struct ntb_client *drvr); | ||
58 | void ntb_unregister_client(struct ntb_client *drvr); | ||
59 | int ntb_register_client_dev(char *device_name); | ||
60 | void ntb_unregister_client_dev(char *device_name); | ||
61 | |||
62 | struct ntb_queue_handlers { | ||
63 | void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, | ||
64 | void *data, int len); | ||
65 | void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, | ||
66 | void *data, int len); | ||
67 | void (*event_handler) (void *data, int status); | ||
68 | }; | ||
69 | |||
70 | unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); | ||
71 | unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); | ||
72 | struct ntb_transport_qp * | ||
73 | ntb_transport_create_queue(void *data, struct pci_dev *pdev, | ||
74 | const struct ntb_queue_handlers *handlers); | ||
75 | void ntb_transport_free_queue(struct ntb_transport_qp *qp); | ||
76 | int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, | ||
77 | unsigned int len); | ||
78 | int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, | ||
79 | unsigned int len); | ||
80 | void *ntb_transport_rx_remove(struct ntb_transport_qp *qp, unsigned int *len); | ||
81 | void ntb_transport_link_up(struct ntb_transport_qp *qp); | ||
82 | void ntb_transport_link_down(struct ntb_transport_qp *qp); | ||
83 | bool ntb_transport_link_query(struct ntb_transport_qp *qp); | ||
diff --git a/include/linux/of.h b/include/linux/of.h index 5ebcc5c8e423..a0f129284948 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -92,7 +92,7 @@ static inline void of_node_put(struct device_node *node) { } | |||
92 | extern struct device_node *of_allnodes; | 92 | extern struct device_node *of_allnodes; |
93 | extern struct device_node *of_chosen; | 93 | extern struct device_node *of_chosen; |
94 | extern struct device_node *of_aliases; | 94 | extern struct device_node *of_aliases; |
95 | extern rwlock_t devtree_lock; | 95 | extern raw_spinlock_t devtree_lock; |
96 | 96 | ||
97 | static inline bool of_have_populated_dt(void) | 97 | static inline bool of_have_populated_dt(void) |
98 | { | 98 | { |
@@ -160,7 +160,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
160 | 160 | ||
161 | #define OF_BAD_ADDR ((u64)-1) | 161 | #define OF_BAD_ADDR ((u64)-1) |
162 | 162 | ||
163 | static inline const char* of_node_full_name(struct device_node *np) | 163 | static inline const char *of_node_full_name(const struct device_node *np) |
164 | { | 164 | { |
165 | return np ? np->full_name : "<no-node>"; | 165 | return np ? np->full_name : "<no-node>"; |
166 | } | 166 | } |
@@ -277,6 +277,8 @@ extern struct device_node *of_parse_phandle(const struct device_node *np, | |||
277 | extern int of_parse_phandle_with_args(const struct device_node *np, | 277 | extern int of_parse_phandle_with_args(const struct device_node *np, |
278 | const char *list_name, const char *cells_name, int index, | 278 | const char *list_name, const char *cells_name, int index, |
279 | struct of_phandle_args *out_args); | 279 | struct of_phandle_args *out_args); |
280 | extern int of_count_phandle_with_args(const struct device_node *np, | ||
281 | const char *list_name, const char *cells_name); | ||
280 | 282 | ||
281 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); | 283 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); |
282 | extern int of_alias_get_id(struct device_node *np, const char *stem); | 284 | extern int of_alias_get_id(struct device_node *np, const char *stem); |
@@ -467,6 +469,13 @@ static inline int of_parse_phandle_with_args(struct device_node *np, | |||
467 | return -ENOSYS; | 469 | return -ENOSYS; |
468 | } | 470 | } |
469 | 471 | ||
472 | static inline int of_count_phandle_with_args(struct device_node *np, | ||
473 | const char *list_name, | ||
474 | const char *cells_name) | ||
475 | { | ||
476 | return -ENOSYS; | ||
477 | } | ||
478 | |||
470 | static inline int of_alias_get_id(struct device_node *np, const char *stem) | 479 | static inline int of_alias_get_id(struct device_node *np, const char *stem) |
471 | { | 480 | { |
472 | return -ENOSYS; | 481 | return -ENOSYS; |
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h new file mode 100644 index 000000000000..d15073e080dd --- /dev/null +++ b/include/linux/of_dma.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * OF helpers for DMA request / controller | ||
3 | * | ||
4 | * Based on of_gpio.h | ||
5 | * | ||
6 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.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 __LINUX_OF_DMA_H | ||
14 | #define __LINUX_OF_DMA_H | ||
15 | |||
16 | #include <linux/of.h> | ||
17 | #include <linux/dmaengine.h> | ||
18 | |||
19 | struct device_node; | ||
20 | |||
21 | struct of_dma { | ||
22 | struct list_head of_dma_controllers; | ||
23 | struct device_node *of_node; | ||
24 | int of_dma_nbcells; | ||
25 | struct dma_chan *(*of_dma_xlate) | ||
26 | (struct of_phandle_args *, struct of_dma *); | ||
27 | void *of_dma_data; | ||
28 | int use_count; | ||
29 | }; | ||
30 | |||
31 | struct of_dma_filter_info { | ||
32 | dma_cap_mask_t dma_cap; | ||
33 | dma_filter_fn filter_fn; | ||
34 | }; | ||
35 | |||
36 | #ifdef CONFIG_OF | ||
37 | extern int of_dma_controller_register(struct device_node *np, | ||
38 | struct dma_chan *(*of_dma_xlate) | ||
39 | (struct of_phandle_args *, struct of_dma *), | ||
40 | void *data); | ||
41 | extern int of_dma_controller_free(struct device_node *np); | ||
42 | extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | ||
43 | char *name); | ||
44 | extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, | ||
45 | struct of_dma *ofdma); | ||
46 | #else | ||
47 | static inline int of_dma_controller_register(struct device_node *np, | ||
48 | struct dma_chan *(*of_dma_xlate) | ||
49 | (struct of_phandle_args *, struct of_dma *), | ||
50 | void *data) | ||
51 | { | ||
52 | return -ENODEV; | ||
53 | } | ||
54 | |||
55 | static inline int of_dma_controller_free(struct device_node *np) | ||
56 | { | ||
57 | return -ENODEV; | ||
58 | } | ||
59 | |||
60 | static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | ||
61 | char *name) | ||
62 | { | ||
63 | return NULL; | ||
64 | } | ||
65 | |||
66 | static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, | ||
67 | struct of_dma *ofdma) | ||
68 | { | ||
69 | return NULL; | ||
70 | } | ||
71 | |||
72 | #endif | ||
73 | |||
74 | #endif /* __LINUX_OF_DMA_H */ | ||
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index c454f5796747..a83dc6f5008e 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
@@ -50,9 +50,6 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | |||
50 | extern int of_get_named_gpio_flags(struct device_node *np, | 50 | extern int of_get_named_gpio_flags(struct device_node *np, |
51 | const char *list_name, int index, enum of_gpio_flags *flags); | 51 | const char *list_name, int index, enum of_gpio_flags *flags); |
52 | 52 | ||
53 | extern unsigned int of_gpio_named_count(struct device_node *np, | ||
54 | const char* propname); | ||
55 | |||
56 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
57 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
58 | 55 | ||
@@ -71,12 +68,6 @@ static inline int of_get_named_gpio_flags(struct device_node *np, | |||
71 | return -ENOSYS; | 68 | return -ENOSYS; |
72 | } | 69 | } |
73 | 70 | ||
74 | static inline unsigned int of_gpio_named_count(struct device_node *np, | ||
75 | const char* propname) | ||
76 | { | ||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static inline int of_gpio_simple_xlate(struct gpio_chip *gc, | 71 | static inline int of_gpio_simple_xlate(struct gpio_chip *gc, |
81 | const struct of_phandle_args *gpiospec, | 72 | const struct of_phandle_args *gpiospec, |
82 | u32 *flags) | 73 | u32 *flags) |
@@ -90,22 +81,37 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | |||
90 | #endif /* CONFIG_OF_GPIO */ | 81 | #endif /* CONFIG_OF_GPIO */ |
91 | 82 | ||
92 | /** | 83 | /** |
93 | * of_gpio_count - Count GPIOs for a device | 84 | * of_gpio_named_count() - Count GPIOs for a device |
94 | * @np: device node to count GPIOs for | 85 | * @np: device node to count GPIOs for |
86 | * @propname: property name containing gpio specifier(s) | ||
95 | * | 87 | * |
96 | * The function returns the count of GPIOs specified for a node. | 88 | * The function returns the count of GPIOs specified for a node. |
89 | * Note that the empty GPIO specifiers count too. Returns either | ||
90 | * Number of gpios defined in property, | ||
91 | * -EINVAL for an incorrectly formed gpios property, or | ||
92 | * -ENOENT for a missing gpios property | ||
97 | * | 93 | * |
98 | * Note that the empty GPIO specifiers counts too. For example, | 94 | * Example: |
99 | * | ||
100 | * gpios = <0 | 95 | * gpios = <0 |
101 | * &pio1 1 2 | 96 | * &gpio1 1 2 |
102 | * 0 | 97 | * 0 |
103 | * &pio2 3 4>; | 98 | * &gpio2 3 4>; |
99 | * | ||
100 | * The above example defines four GPIOs, two of which are not specified. | ||
101 | * This function will return '4' | ||
102 | */ | ||
103 | static inline int of_gpio_named_count(struct device_node *np, const char* propname) | ||
104 | { | ||
105 | return of_count_phandle_with_args(np, propname, "#gpio-cells"); | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * of_gpio_count() - Count GPIOs for a device | ||
110 | * @np: device node to count GPIOs for | ||
104 | * | 111 | * |
105 | * defines four GPIOs (so this function will return 4), two of which | 112 | * Same as of_gpio_named_count, but hard coded to use the 'gpios' property |
106 | * are not specified. | ||
107 | */ | 113 | */ |
108 | static inline unsigned int of_gpio_count(struct device_node *np) | 114 | static inline int of_gpio_count(struct device_node *np) |
109 | { | 115 | { |
110 | return of_gpio_named_count(np, "gpios"); | 116 | return of_gpio_named_count(np, "gpios"); |
111 | } | 117 | } |
diff --git a/include/linux/of_serial.h b/include/linux/of_serial.h deleted file mode 100644 index 4a73ed80b4c0..000000000000 --- a/include/linux/of_serial.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef __LINUX_OF_SERIAL_H | ||
2 | #define __LINUX_OF_SERIAL_H | ||
3 | |||
4 | /* | ||
5 | * FIXME remove this file when tegra finishes conversion to open firmware, | ||
6 | * expectation is that all quirks will then be self-contained in | ||
7 | * drivers/tty/serial/of_serial.c. | ||
8 | */ | ||
9 | #ifdef CONFIG_ARCH_TEGRA | ||
10 | extern void tegra_serial_handle_break(struct uart_port *port); | ||
11 | #else | ||
12 | static inline void tegra_serial_handle_break(struct uart_port *port) | ||
13 | { | ||
14 | } | ||
15 | #endif | ||
16 | |||
17 | #endif /* __LINUX_OF_SERIAL */ | ||
diff --git a/include/linux/opp.h b/include/linux/opp.h index 214e0ebcb84d..3aca2b8def33 100644 --- a/include/linux/opp.h +++ b/include/linux/opp.h | |||
@@ -47,15 +47,6 @@ int opp_enable(struct device *dev, unsigned long freq); | |||
47 | int opp_disable(struct device *dev, unsigned long freq); | 47 | int opp_disable(struct device *dev, unsigned long freq); |
48 | 48 | ||
49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); | 49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); |
50 | |||
51 | #ifdef CONFIG_OF | ||
52 | int of_init_opp_table(struct device *dev); | ||
53 | #else | ||
54 | static inline int of_init_opp_table(struct device *dev) | ||
55 | { | ||
56 | return -EINVAL; | ||
57 | } | ||
58 | #endif /* CONFIG_OF */ | ||
59 | #else | 50 | #else |
60 | static inline unsigned long opp_get_voltage(struct opp *opp) | 51 | static inline unsigned long opp_get_voltage(struct opp *opp) |
61 | { | 52 | { |
@@ -112,6 +103,15 @@ static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev) | |||
112 | } | 103 | } |
113 | #endif /* CONFIG_PM_OPP */ | 104 | #endif /* CONFIG_PM_OPP */ |
114 | 105 | ||
106 | #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) | ||
107 | int of_init_opp_table(struct device *dev); | ||
108 | #else | ||
109 | static inline int of_init_opp_table(struct device *dev) | ||
110 | { | ||
111 | return -EINVAL; | ||
112 | } | ||
113 | #endif | ||
114 | |||
115 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) | 115 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) |
116 | int opp_init_cpufreq_table(struct device *dev, | 116 | int opp_init_cpufreq_table(struct device *dev, |
117 | struct cpufreq_frequency_table **table); | 117 | struct cpufreq_frequency_table **table); |
diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h new file mode 100644 index 000000000000..93506a114034 --- /dev/null +++ b/include/linux/page-flags-layout.h | |||
@@ -0,0 +1,88 @@ | |||
1 | #ifndef PAGE_FLAGS_LAYOUT_H | ||
2 | #define PAGE_FLAGS_LAYOUT_H | ||
3 | |||
4 | #include <linux/numa.h> | ||
5 | #include <generated/bounds.h> | ||
6 | |||
7 | /* | ||
8 | * When a memory allocation must conform to specific limitations (such | ||
9 | * as being suitable for DMA) the caller will pass in hints to the | ||
10 | * allocator in the gfp_mask, in the zone modifier bits. These bits | ||
11 | * are used to select a priority ordered list of memory zones which | ||
12 | * match the requested limits. See gfp_zone() in include/linux/gfp.h | ||
13 | */ | ||
14 | #if MAX_NR_ZONES < 2 | ||
15 | #define ZONES_SHIFT 0 | ||
16 | #elif MAX_NR_ZONES <= 2 | ||
17 | #define ZONES_SHIFT 1 | ||
18 | #elif MAX_NR_ZONES <= 4 | ||
19 | #define ZONES_SHIFT 2 | ||
20 | #else | ||
21 | #error ZONES_SHIFT -- too many zones configured adjust calculation | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_SPARSEMEM | ||
25 | #include <asm/sparsemem.h> | ||
26 | |||
27 | /* SECTION_SHIFT #bits space required to store a section # */ | ||
28 | #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) | ||
29 | |||
30 | #endif /* CONFIG_SPARSEMEM */ | ||
31 | |||
32 | /* | ||
33 | * page->flags layout: | ||
34 | * | ||
35 | * There are five possibilities for how page->flags get laid out. The first | ||
36 | * pair is for the normal case without sparsemem. The second pair is for | ||
37 | * sparsemem when there is plenty of space for node and section information. | ||
38 | * The last is when there is insufficient space in page->flags and a separate | ||
39 | * lookup is necessary. | ||
40 | * | ||
41 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | | ||
42 | * " plus space for last_nid: | NODE | ZONE | LAST_NID ... | FLAGS | | ||
43 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | | ||
44 | * " plus space for last_nid: | SECTION | NODE | ZONE | LAST_NID ... | FLAGS | | ||
45 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | | ||
46 | */ | ||
47 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
48 | #define SECTIONS_WIDTH SECTIONS_SHIFT | ||
49 | #else | ||
50 | #define SECTIONS_WIDTH 0 | ||
51 | #endif | ||
52 | |||
53 | #define ZONES_WIDTH ZONES_SHIFT | ||
54 | |||
55 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
56 | #define NODES_WIDTH NODES_SHIFT | ||
57 | #else | ||
58 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
59 | #error "Vmemmap: No space for nodes field in page flags" | ||
60 | #endif | ||
61 | #define NODES_WIDTH 0 | ||
62 | #endif | ||
63 | |||
64 | #ifdef CONFIG_NUMA_BALANCING | ||
65 | #define LAST_NID_SHIFT NODES_SHIFT | ||
66 | #else | ||
67 | #define LAST_NID_SHIFT 0 | ||
68 | #endif | ||
69 | |||
70 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_NID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
71 | #define LAST_NID_WIDTH LAST_NID_SHIFT | ||
72 | #else | ||
73 | #define LAST_NID_WIDTH 0 | ||
74 | #endif | ||
75 | |||
76 | /* | ||
77 | * We are going to use the flags for the page to node mapping if its in | ||
78 | * there. This includes the case where there is no node, so it is implicit. | ||
79 | */ | ||
80 | #if !(NODES_WIDTH > 0 || NODES_SHIFT == 0) | ||
81 | #define NODE_NOT_IN_PAGE_FLAGS | ||
82 | #endif | ||
83 | |||
84 | #if defined(CONFIG_NUMA_BALANCING) && LAST_NID_WIDTH == 0 | ||
85 | #define LAST_NID_NOT_IN_PAGE_FLAGS | ||
86 | #endif | ||
87 | |||
88 | #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 70473da47b3f..6d53675c2b54 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -303,21 +303,13 @@ static inline void __SetPageUptodate(struct page *page) | |||
303 | 303 | ||
304 | static inline void SetPageUptodate(struct page *page) | 304 | static inline void SetPageUptodate(struct page *page) |
305 | { | 305 | { |
306 | #ifdef CONFIG_S390 | ||
307 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | ||
308 | page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY, 0); | ||
309 | #else | ||
310 | /* | 306 | /* |
311 | * Memory barrier must be issued before setting the PG_uptodate bit, | 307 | * Memory barrier must be issued before setting the PG_uptodate bit, |
312 | * so that all previous stores issued in order to bring the page | 308 | * so that all previous stores issued in order to bring the page |
313 | * uptodate are actually visible before PageUptodate becomes true. | 309 | * uptodate are actually visible before PageUptodate becomes true. |
314 | * | ||
315 | * s390 doesn't need an explicit smp_wmb here because the test and | ||
316 | * set bit already provides full barriers. | ||
317 | */ | 310 | */ |
318 | smp_wmb(); | 311 | smp_wmb(); |
319 | set_bit(PG_uptodate, &(page)->flags); | 312 | set_bit(PG_uptodate, &(page)->flags); |
320 | #endif | ||
321 | } | 313 | } |
322 | 314 | ||
323 | CLEARPAGEFLAG(Uptodate, uptodate) | 315 | CLEARPAGEFLAG(Uptodate, uptodate) |
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index a92061e08d48..3fff8e774067 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
@@ -1,6 +1,25 @@ | |||
1 | #ifndef __LINUX_PAGEISOLATION_H | 1 | #ifndef __LINUX_PAGEISOLATION_H |
2 | #define __LINUX_PAGEISOLATION_H | 2 | #define __LINUX_PAGEISOLATION_H |
3 | 3 | ||
4 | #ifdef CONFIG_MEMORY_ISOLATION | ||
5 | static inline bool is_migrate_isolate_page(struct page *page) | ||
6 | { | ||
7 | return get_pageblock_migratetype(page) == MIGRATE_ISOLATE; | ||
8 | } | ||
9 | static inline bool is_migrate_isolate(int migratetype) | ||
10 | { | ||
11 | return migratetype == MIGRATE_ISOLATE; | ||
12 | } | ||
13 | #else | ||
14 | static inline bool is_migrate_isolate_page(struct page *page) | ||
15 | { | ||
16 | return false; | ||
17 | } | ||
18 | static inline bool is_migrate_isolate(int migratetype) | ||
19 | { | ||
20 | return false; | ||
21 | } | ||
22 | #endif | ||
4 | 23 | ||
5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, | 24 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, |
6 | bool skip_hwpoisoned_pages); | 25 | bool skip_hwpoisoned_pages); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 6da609d14c15..0e38e13eb249 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -414,6 +414,7 @@ static inline void wait_on_page_writeback(struct page *page) | |||
414 | } | 414 | } |
415 | 415 | ||
416 | extern void end_page_writeback(struct page *page); | 416 | extern void end_page_writeback(struct page *page); |
417 | void wait_for_stable_page(struct page *page); | ||
417 | 418 | ||
418 | /* | 419 | /* |
419 | * Add an arbitrary waiter to a page's wait queue | 420 | * Add an arbitrary waiter to a page's wait queue |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6fa4dd2a3b9e..2461033a7987 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -286,6 +286,7 @@ struct pci_dev { | |||
286 | unsigned int irq; | 286 | unsigned int irq; |
287 | struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ | 287 | struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ |
288 | 288 | ||
289 | bool match_driver; /* Skip attaching driver */ | ||
289 | /* These fields are used by common fixups */ | 290 | /* These fields are used by common fixups */ |
290 | unsigned int transparent:1; /* Transparent PCI bridge */ | 291 | unsigned int transparent:1; /* Transparent PCI bridge */ |
291 | unsigned int multifunction:1;/* Part of multi-function device */ | 292 | unsigned int multifunction:1;/* Part of multi-function device */ |
@@ -378,6 +379,8 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge, | |||
378 | void (*release_fn)(struct pci_host_bridge *), | 379 | void (*release_fn)(struct pci_host_bridge *), |
379 | void *release_data); | 380 | void *release_data); |
380 | 381 | ||
382 | int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge); | ||
383 | |||
381 | /* | 384 | /* |
382 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond | 385 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond |
383 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for | 386 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for |
@@ -674,6 +677,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ | |||
674 | /* Some device drivers need know if pci is initiated */ | 677 | /* Some device drivers need know if pci is initiated */ |
675 | extern int no_pci_devices(void); | 678 | extern int no_pci_devices(void); |
676 | 679 | ||
680 | void pcibios_resource_survey_bus(struct pci_bus *bus); | ||
677 | void pcibios_fixup_bus(struct pci_bus *); | 681 | void pcibios_fixup_bus(struct pci_bus *); |
678 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 682 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
679 | /* Architecture specific versions may override this (weak) */ | 683 | /* Architecture specific versions may override this (weak) */ |
@@ -1700,12 +1704,21 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
1700 | } | 1704 | } |
1701 | 1705 | ||
1702 | /** | 1706 | /** |
1707 | * pcie_caps_reg - get the PCIe Capabilities Register | ||
1708 | * @dev: PCI device | ||
1709 | */ | ||
1710 | static inline u16 pcie_caps_reg(const struct pci_dev *dev) | ||
1711 | { | ||
1712 | return dev->pcie_flags_reg; | ||
1713 | } | ||
1714 | |||
1715 | /** | ||
1703 | * pci_pcie_type - get the PCIe device/port type | 1716 | * pci_pcie_type - get the PCIe device/port type |
1704 | * @dev: PCI device | 1717 | * @dev: PCI device |
1705 | */ | 1718 | */ |
1706 | static inline int pci_pcie_type(const struct pci_dev *dev) | 1719 | static inline int pci_pcie_type(const struct pci_dev *dev) |
1707 | { | 1720 | { |
1708 | return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; | 1721 | return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; |
1709 | } | 1722 | } |
1710 | 1723 | ||
1711 | void pci_request_acs(void); | 1724 | void pci_request_acs(void); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 0eb65796bcb9..31717bd287fd 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1807,6 +1807,8 @@ | |||
1807 | #define PCI_VENDOR_ID_ESDGMBH 0x12fe | 1807 | #define PCI_VENDOR_ID_ESDGMBH 0x12fe |
1808 | #define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111 | 1808 | #define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111 |
1809 | 1809 | ||
1810 | #define PCI_VENDOR_ID_CB 0x1307 /* Measurement Computing */ | ||
1811 | |||
1810 | #define PCI_VENDOR_ID_SIIG 0x131f | 1812 | #define PCI_VENDOR_ID_SIIG 0x131f |
1811 | #define PCI_SUBVENDOR_ID_SIIG 0x131f | 1813 | #define PCI_SUBVENDOR_ID_SIIG 0x131f |
1812 | #define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 | 1814 | #define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 |
@@ -1868,8 +1870,23 @@ | |||
1868 | #define PCI_VENDOR_ID_QUATECH 0x135C | 1870 | #define PCI_VENDOR_ID_QUATECH 0x135C |
1869 | #define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 | 1871 | #define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 |
1870 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 | 1872 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 |
1873 | #define PCI_DEVICE_ID_QUATECH_DSC200 0x0030 | ||
1874 | #define PCI_DEVICE_ID_QUATECH_QSC200 0x0040 | ||
1871 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 | 1875 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 |
1872 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 | 1876 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 |
1877 | #define PCI_DEVICE_ID_QUATECH_QSCP100 0x0120 | ||
1878 | #define PCI_DEVICE_ID_QUATECH_DSCP100 0x0130 | ||
1879 | #define PCI_DEVICE_ID_QUATECH_QSCP200 0x0140 | ||
1880 | #define PCI_DEVICE_ID_QUATECH_DSCP200 0x0150 | ||
1881 | #define PCI_DEVICE_ID_QUATECH_QSCLP100 0x0170 | ||
1882 | #define PCI_DEVICE_ID_QUATECH_DSCLP100 0x0180 | ||
1883 | #define PCI_DEVICE_ID_QUATECH_DSC100E 0x0181 | ||
1884 | #define PCI_DEVICE_ID_QUATECH_SSCLP100 0x0190 | ||
1885 | #define PCI_DEVICE_ID_QUATECH_QSCLP200 0x01A0 | ||
1886 | #define PCI_DEVICE_ID_QUATECH_DSCLP200 0x01B0 | ||
1887 | #define PCI_DEVICE_ID_QUATECH_DSC200E 0x01B1 | ||
1888 | #define PCI_DEVICE_ID_QUATECH_SSCLP200 0x01C0 | ||
1889 | #define PCI_DEVICE_ID_QUATECH_ESCLP100 0x01E0 | ||
1873 | #define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278 | 1890 | #define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278 |
1874 | 1891 | ||
1875 | #define PCI_VENDOR_ID_SEALEVEL 0x135e | 1892 | #define PCI_VENDOR_ID_SEALEVEL 0x135e |
@@ -2013,6 +2030,10 @@ | |||
2013 | #define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111 | 2030 | #define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111 |
2014 | #define PCI_DEVICE_ID_CMEDIA_CM8738B 0x0112 | 2031 | #define PCI_DEVICE_ID_CMEDIA_CM8738B 0x0112 |
2015 | 2032 | ||
2033 | #define PCI_VENDOR_ID_ADVANTECH 0x13fe | ||
2034 | |||
2035 | #define PCI_VENDOR_ID_MEILHAUS 0x1402 | ||
2036 | |||
2016 | #define PCI_VENDOR_ID_LAVA 0x1407 | 2037 | #define PCI_VENDOR_ID_LAVA 0x1407 |
2017 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ | 2038 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ |
2018 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ | 2039 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ |
@@ -2058,6 +2079,8 @@ | |||
2058 | 2079 | ||
2059 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 2080 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
2060 | 2081 | ||
2082 | #define PCI_VENDOR_ID_ADLINK 0x144a | ||
2083 | |||
2061 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 2084 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
2062 | 2085 | ||
2063 | #define PCI_VENDOR_ID_GIGABYTE 0x1458 | 2086 | #define PCI_VENDOR_ID_GIGABYTE 0x1458 |
@@ -2091,6 +2114,8 @@ | |||
2091 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 | 2114 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 |
2092 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 | 2115 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 |
2093 | 2116 | ||
2117 | #define PCI_VENDOR_ID_AMPLICON 0x14dc | ||
2118 | |||
2094 | #define PCI_VENDOR_ID_BCM_GVC 0x14a4 | 2119 | #define PCI_VENDOR_ID_BCM_GVC 0x14a4 |
2095 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 2120 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
2096 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 2121 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
@@ -2127,6 +2152,7 @@ | |||
2127 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 2152 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
2128 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | 2153 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 |
2129 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 | 2154 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 |
2155 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | ||
2130 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 2156 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
2131 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 2157 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
2132 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | 2158 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index b9df9ed1adc0..d5dd4657c8d6 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -83,7 +83,7 @@ static inline int percpu_counter_initialized(struct percpu_counter *fbc) | |||
83 | return (fbc->counters != NULL); | 83 | return (fbc->counters != NULL); |
84 | } | 84 | } |
85 | 85 | ||
86 | #else | 86 | #else /* !CONFIG_SMP */ |
87 | 87 | ||
88 | struct percpu_counter { | 88 | struct percpu_counter { |
89 | s64 count; | 89 | s64 count; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 93b3cf77f564..33999adbf8c8 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -506,13 +506,13 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | |||
506 | int phy_device_register(struct phy_device *phy); | 506 | int phy_device_register(struct phy_device *phy); |
507 | int phy_init_hw(struct phy_device *phydev); | 507 | int phy_init_hw(struct phy_device *phydev); |
508 | struct phy_device * phy_attach(struct net_device *dev, | 508 | struct phy_device * phy_attach(struct net_device *dev, |
509 | const char *bus_id, u32 flags, phy_interface_t interface); | 509 | const char *bus_id, phy_interface_t interface); |
510 | struct phy_device *phy_find_first(struct mii_bus *bus); | 510 | struct phy_device *phy_find_first(struct mii_bus *bus); |
511 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | 511 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, |
512 | void (*handler)(struct net_device *), u32 flags, | 512 | void (*handler)(struct net_device *), |
513 | phy_interface_t interface); | 513 | phy_interface_t interface); |
514 | struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, | 514 | struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, |
515 | void (*handler)(struct net_device *), u32 flags, | 515 | void (*handler)(struct net_device *), |
516 | phy_interface_t interface); | 516 | phy_interface_t interface); |
517 | void phy_disconnect(struct phy_device *phydev); | 517 | void phy_disconnect(struct phy_device *phydev); |
518 | void phy_detach(struct phy_device *phydev); | 518 | void phy_detach(struct phy_device *phydev); |
diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h new file mode 100644 index 000000000000..6e5f8a985ea7 --- /dev/null +++ b/include/linux/pinctrl/devinfo.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Per-device information from the pin control system. | ||
3 | * This is the stuff that get included into the device | ||
4 | * core. | ||
5 | * | ||
6 | * Copyright (C) 2012 ST-Ericsson SA | ||
7 | * Written on behalf of Linaro for ST-Ericsson | ||
8 | * This interface is used in the core to keep track of pins. | ||
9 | * | ||
10 | * Author: Linus Walleij <linus.walleij@linaro.org> | ||
11 | * | ||
12 | * License terms: GNU General Public License (GPL) version 2 | ||
13 | */ | ||
14 | |||
15 | #ifndef PINCTRL_DEVINFO_H | ||
16 | #define PINCTRL_DEVINFO_H | ||
17 | |||
18 | #ifdef CONFIG_PINCTRL | ||
19 | |||
20 | /* The device core acts as a consumer toward pinctrl */ | ||
21 | #include <linux/pinctrl/consumer.h> | ||
22 | |||
23 | /** | ||
24 | * struct dev_pin_info - pin state container for devices | ||
25 | * @p: pinctrl handle for the containing device | ||
26 | * @default_state: the default state for the handle, if found | ||
27 | */ | ||
28 | struct dev_pin_info { | ||
29 | struct pinctrl *p; | ||
30 | struct pinctrl_state *default_state; | ||
31 | }; | ||
32 | |||
33 | extern int pinctrl_bind_pins(struct device *dev); | ||
34 | |||
35 | #else | ||
36 | |||
37 | /* Stubs if we're not using pinctrl */ | ||
38 | |||
39 | static inline int pinctrl_bind_pins(struct device *dev) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | #endif /* CONFIG_PINCTRL */ | ||
45 | #endif /* PINCTRL_DEVINFO_H */ | ||
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 47a1bdd88878..72474e18f1e0 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -46,7 +46,11 @@ | |||
46 | * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source | 46 | * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source |
47 | * (open emitter). Sending this config will enabale open drain mode, the | 47 | * (open emitter). Sending this config will enabale open drain mode, the |
48 | * argument is ignored. | 48 | * argument is ignored. |
49 | * @PIN_CONFIG_INPUT_SCHMITT_DISABLE: disable schmitt-trigger mode on the pin. | 49 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will output the current passed as |
50 | * argument. The argument is in mA. | ||
51 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. | ||
52 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, | ||
53 | * schmitt-trigger mode is disabled. | ||
50 | * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in | 54 | * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in |
51 | * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, | 55 | * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, |
52 | * the threshold value is given on a custom format as argument when | 56 | * the threshold value is given on a custom format as argument when |
@@ -58,10 +62,15 @@ | |||
58 | * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power | 62 | * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power |
59 | * supplies, the argument to this parameter (on a custom format) tells | 63 | * supplies, the argument to this parameter (on a custom format) tells |
60 | * the driver which alternative power source to use. | 64 | * the driver which alternative power source to use. |
65 | * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to | ||
66 | * this parameter (on a custom format) tells the driver which alternative | ||
67 | * slew rate to use. | ||
61 | * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power | 68 | * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power |
62 | * operation, if several modes of operation are supported these can be | 69 | * operation, if several modes of operation are supported these can be |
63 | * passed in the argument on a custom form, else just use argument 1 | 70 | * passed in the argument on a custom form, else just use argument 1 |
64 | * to indicate low power mode, argument 0 turns low power mode off. | 71 | * to indicate low power mode, argument 0 turns low power mode off. |
72 | * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument | ||
73 | * 1 to indicate high level, argument 0 to indicate low level. | ||
65 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if | 74 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if |
66 | * you need to pass in custom configurations to the pin controller, use | 75 | * you need to pass in custom configurations to the pin controller, use |
67 | * PIN_CONFIG_END+1 as the base offset. | 76 | * PIN_CONFIG_END+1 as the base offset. |
@@ -74,11 +83,14 @@ enum pin_config_param { | |||
74 | PIN_CONFIG_DRIVE_PUSH_PULL, | 83 | PIN_CONFIG_DRIVE_PUSH_PULL, |
75 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 84 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
76 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 85 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
77 | PIN_CONFIG_INPUT_SCHMITT_DISABLE, | 86 | PIN_CONFIG_DRIVE_STRENGTH, |
87 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, | ||
78 | PIN_CONFIG_INPUT_SCHMITT, | 88 | PIN_CONFIG_INPUT_SCHMITT, |
79 | PIN_CONFIG_INPUT_DEBOUNCE, | 89 | PIN_CONFIG_INPUT_DEBOUNCE, |
80 | PIN_CONFIG_POWER_SOURCE, | 90 | PIN_CONFIG_POWER_SOURCE, |
91 | PIN_CONFIG_SLEW_RATE, | ||
81 | PIN_CONFIG_LOW_POWER_MODE, | 92 | PIN_CONFIG_LOW_POWER_MODE, |
93 | PIN_CONFIG_OUTPUT, | ||
82 | PIN_CONFIG_END = 0x7FFF, | 94 | PIN_CONFIG_END = 0x7FFF, |
83 | }; | 95 | }; |
84 | 96 | ||
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 04d6700d99af..778804df293f 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -154,6 +154,7 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) | |||
154 | #endif /* CONFIG_OF */ | 154 | #endif /* CONFIG_OF */ |
155 | 155 | ||
156 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); | 156 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); |
157 | extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); | ||
157 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | 158 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); |
158 | #else | 159 | #else |
159 | 160 | ||
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h index 24368a2e8b87..798fb80b024b 100644 --- a/include/linux/platform_data/cpsw.h +++ b/include/linux/platform_data/cpsw.h | |||
@@ -21,6 +21,8 @@ struct cpsw_slave_data { | |||
21 | char phy_id[MII_BUS_ID_SIZE]; | 21 | char phy_id[MII_BUS_ID_SIZE]; |
22 | int phy_if; | 22 | int phy_if; |
23 | u8 mac_addr[ETH_ALEN]; | 23 | u8 mac_addr[ETH_ALEN]; |
24 | u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */ | ||
25 | |||
24 | }; | 26 | }; |
25 | 27 | ||
26 | struct cpsw_platform_data { | 28 | struct cpsw_platform_data { |
@@ -35,6 +37,8 @@ struct cpsw_platform_data { | |||
35 | u32 bd_ram_size; /*buffer descriptor ram size */ | 37 | u32 bd_ram_size; /*buffer descriptor ram size */ |
36 | u32 rx_descs; /* Number of Rx Descriptios */ | 38 | u32 rx_descs; /* Number of Rx Descriptios */ |
37 | u32 mac_control; /* Mac control register */ | 39 | u32 mac_control; /* Mac control register */ |
40 | u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/ | ||
41 | bool dual_emac; /* Enable Dual EMAC mode */ | ||
38 | }; | 42 | }; |
39 | 43 | ||
40 | #endif /* __CPSW_H__ */ | 44 | #endif /* __CPSW_H__ */ |
diff --git a/include/linux/platform_data/dma-coh901318.h b/include/linux/platform_data/dma-coh901318.h new file mode 100644 index 000000000000..c4cb9590d115 --- /dev/null +++ b/include/linux/platform_data/dma-coh901318.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Platform data for the COH901318 DMA controller | ||
3 | * Copyright (C) 2007-2013 ST-Ericsson | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef PLAT_COH901318_H | ||
8 | #define PLAT_COH901318_H | ||
9 | |||
10 | #ifdef CONFIG_COH901318 | ||
11 | |||
12 | /* We only support the U300 DMA channels */ | ||
13 | #define U300_DMA_MSL_TX_0 0 | ||
14 | #define U300_DMA_MSL_TX_1 1 | ||
15 | #define U300_DMA_MSL_TX_2 2 | ||
16 | #define U300_DMA_MSL_TX_3 3 | ||
17 | #define U300_DMA_MSL_TX_4 4 | ||
18 | #define U300_DMA_MSL_TX_5 5 | ||
19 | #define U300_DMA_MSL_TX_6 6 | ||
20 | #define U300_DMA_MSL_RX_0 7 | ||
21 | #define U300_DMA_MSL_RX_1 8 | ||
22 | #define U300_DMA_MSL_RX_2 9 | ||
23 | #define U300_DMA_MSL_RX_3 10 | ||
24 | #define U300_DMA_MSL_RX_4 11 | ||
25 | #define U300_DMA_MSL_RX_5 12 | ||
26 | #define U300_DMA_MSL_RX_6 13 | ||
27 | #define U300_DMA_MMCSD_RX_TX 14 | ||
28 | #define U300_DMA_MSPRO_TX 15 | ||
29 | #define U300_DMA_MSPRO_RX 16 | ||
30 | #define U300_DMA_UART0_TX 17 | ||
31 | #define U300_DMA_UART0_RX 18 | ||
32 | #define U300_DMA_APEX_TX 19 | ||
33 | #define U300_DMA_APEX_RX 20 | ||
34 | #define U300_DMA_PCM_I2S0_TX 21 | ||
35 | #define U300_DMA_PCM_I2S0_RX 22 | ||
36 | #define U300_DMA_PCM_I2S1_TX 23 | ||
37 | #define U300_DMA_PCM_I2S1_RX 24 | ||
38 | #define U300_DMA_XGAM_CDI 25 | ||
39 | #define U300_DMA_XGAM_PDI 26 | ||
40 | #define U300_DMA_SPI_TX 27 | ||
41 | #define U300_DMA_SPI_RX 28 | ||
42 | #define U300_DMA_GENERAL_PURPOSE_0 29 | ||
43 | #define U300_DMA_GENERAL_PURPOSE_1 30 | ||
44 | #define U300_DMA_GENERAL_PURPOSE_2 31 | ||
45 | #define U300_DMA_GENERAL_PURPOSE_3 32 | ||
46 | #define U300_DMA_GENERAL_PURPOSE_4 33 | ||
47 | #define U300_DMA_GENERAL_PURPOSE_5 34 | ||
48 | #define U300_DMA_GENERAL_PURPOSE_6 35 | ||
49 | #define U300_DMA_GENERAL_PURPOSE_7 36 | ||
50 | #define U300_DMA_GENERAL_PURPOSE_8 37 | ||
51 | #define U300_DMA_UART1_TX 38 | ||
52 | #define U300_DMA_UART1_RX 39 | ||
53 | |||
54 | #define U300_DMA_DEVICE_CHANNELS 32 | ||
55 | #define U300_DMA_CHANNELS 40 | ||
56 | |||
57 | /** | ||
58 | * coh901318_filter_id() - DMA channel filter function | ||
59 | * @chan: dma channel handle | ||
60 | * @chan_id: id of dma channel to be filter out | ||
61 | * | ||
62 | * In dma_request_channel() it specifies what channel id to be requested | ||
63 | */ | ||
64 | bool coh901318_filter_id(struct dma_chan *chan, void *chan_id); | ||
65 | #else | ||
66 | static inline bool coh901318_filter_id(struct dma_chan *chan, void *chan_id) | ||
67 | { | ||
68 | return false; | ||
69 | } | ||
70 | #endif | ||
71 | |||
72 | #endif /* PLAT_COH901318_H */ | ||
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 9ff93b065686..4b781014b0a0 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -147,6 +147,16 @@ struct stedma40_chan_cfg { | |||
147 | * @memcpy_conf_log: default configuration of logical channel memcpy | 147 | * @memcpy_conf_log: default configuration of logical channel memcpy |
148 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 148 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
149 | * that are for different reasons not available for the driver. | 149 | * that are for different reasons not available for the driver. |
150 | * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW | ||
151 | * which avoids HW bug that exists in some versions of the controller. | ||
152 | * SoftLLI introduces relink overhead that could impact performace for | ||
153 | * certain use cases. | ||
154 | * @num_of_soft_lli_chans: The number of channels that needs to be configured | ||
155 | * to use SoftLLI. | ||
156 | * @use_esram_lcla: flag for mapping the lcla into esram region | ||
157 | * @num_of_phy_chans: The number of physical channels implemented in HW. | ||
158 | * 0 means reading the number of channels from DMA HW but this is only valid | ||
159 | * for 'multiple of 4' channels, like 8. | ||
150 | */ | 160 | */ |
151 | struct stedma40_platform_data { | 161 | struct stedma40_platform_data { |
152 | u32 dev_len; | 162 | u32 dev_len; |
@@ -157,7 +167,10 @@ struct stedma40_platform_data { | |||
157 | struct stedma40_chan_cfg *memcpy_conf_phy; | 167 | struct stedma40_chan_cfg *memcpy_conf_phy; |
158 | struct stedma40_chan_cfg *memcpy_conf_log; | 168 | struct stedma40_chan_cfg *memcpy_conf_log; |
159 | int disabled_channels[STEDMA40_MAX_PHYS]; | 169 | int disabled_channels[STEDMA40_MAX_PHYS]; |
170 | int *soft_lli_chans; | ||
171 | int num_of_soft_lli_chans; | ||
160 | bool use_esram_lcla; | 172 | bool use_esram_lcla; |
173 | int num_of_phy_chans; | ||
161 | }; | 174 | }; |
162 | 175 | ||
163 | #ifdef CONFIG_STE_DMA40 | 176 | #ifdef CONFIG_STE_DMA40 |
diff --git a/include/linux/platform_data/i2c-s3c2410.h b/include/linux/platform_data/i2c-s3c2410.h index 51d52e767a19..2a50048c1c44 100644 --- a/include/linux/platform_data/i2c-s3c2410.h +++ b/include/linux/platform_data/i2c-s3c2410.h | |||
@@ -15,6 +15,8 @@ | |||
15 | 15 | ||
16 | #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */ | 16 | #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */ |
17 | 17 | ||
18 | struct platform_device; | ||
19 | |||
18 | /** | 20 | /** |
19 | * struct s3c2410_platform_i2c - Platform data for s3c I2C. | 21 | * struct s3c2410_platform_i2c - Platform data for s3c I2C. |
20 | * @bus_num: The bus number to use (if possible). | 22 | * @bus_num: The bus number to use (if possible). |
diff --git a/include/linux/platform_data/invensense_mpu6050.h b/include/linux/platform_data/invensense_mpu6050.h new file mode 100644 index 000000000000..ad3aa7b95f35 --- /dev/null +++ b/include/linux/platform_data/invensense_mpu6050.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Invensense, Inc. | ||
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 __INV_MPU6050_PLATFORM_H_ | ||
15 | #define __INV_MPU6050_PLATFORM_H_ | ||
16 | |||
17 | /** | ||
18 | * struct inv_mpu6050_platform_data - Platform data for the mpu driver | ||
19 | * @orientation: Orientation matrix of the chip | ||
20 | * | ||
21 | * Contains platform specific information on how to configure the MPU6050 to | ||
22 | * work on this platform. The orientation matricies are 3x3 rotation matricies | ||
23 | * that are applied to the data to rotate from the mounting orientation to the | ||
24 | * platform orientation. The values must be one of 0, 1, or -1 and each row and | ||
25 | * column should have exactly 1 non-zero value. | ||
26 | */ | ||
27 | struct inv_mpu6050_platform_data { | ||
28 | __s8 orientation[9]; | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h new file mode 100644 index 000000000000..1509570d5a3f --- /dev/null +++ b/include/linux/platform_data/leds-lp55xx.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * LP55XX Platform Data Header | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments | ||
5 | * | ||
6 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * Derived from leds-lp5521.h, leds-lp5523.h | ||
13 | */ | ||
14 | |||
15 | #ifndef _LEDS_LP55XX_H | ||
16 | #define _LEDS_LP55XX_H | ||
17 | |||
18 | /* Clock configuration */ | ||
19 | #define LP55XX_CLOCK_AUTO 0 | ||
20 | #define LP55XX_CLOCK_INT 1 | ||
21 | #define LP55XX_CLOCK_EXT 2 | ||
22 | |||
23 | /* Bits in LP5521 CONFIG register. 'update_config' in lp55xx_platform_data */ | ||
24 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
25 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
26 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
27 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
28 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
29 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
30 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
31 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
32 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
33 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
34 | |||
35 | struct lp55xx_led_config { | ||
36 | const char *name; | ||
37 | u8 chan_nr; | ||
38 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
39 | u8 max_current; | ||
40 | }; | ||
41 | |||
42 | struct lp55xx_predef_pattern { | ||
43 | u8 *r; | ||
44 | u8 *g; | ||
45 | u8 *b; | ||
46 | u8 size_r; | ||
47 | u8 size_g; | ||
48 | u8 size_b; | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * struct lp55xx_platform_data | ||
53 | * @led_config : Configurable led class device | ||
54 | * @num_channels : Number of LED channels | ||
55 | * @label : Used for naming LEDs | ||
56 | * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT | ||
57 | * @setup_resources : Platform specific function before enabling the chip | ||
58 | * @release_resources : Platform specific function after disabling the chip | ||
59 | * @enable : EN pin control by platform side | ||
60 | * @patterns : Predefined pattern data for RGB channels | ||
61 | * @num_patterns : Number of patterns | ||
62 | * @update_config : Value of CONFIG register | ||
63 | */ | ||
64 | struct lp55xx_platform_data { | ||
65 | |||
66 | /* LED channel configuration */ | ||
67 | struct lp55xx_led_config *led_config; | ||
68 | u8 num_channels; | ||
69 | const char *label; | ||
70 | |||
71 | /* Clock configuration */ | ||
72 | u8 clock_mode; | ||
73 | |||
74 | /* Platform specific functions */ | ||
75 | int (*setup_resources)(void); | ||
76 | void (*release_resources)(void); | ||
77 | void (*enable)(bool state); | ||
78 | |||
79 | /* Predefined pattern data */ | ||
80 | struct lp55xx_predef_pattern *patterns; | ||
81 | unsigned int num_patterns; | ||
82 | |||
83 | /* _CONFIG register */ | ||
84 | u8 update_config; | ||
85 | }; | ||
86 | |||
87 | #endif /* _LEDS_LP55XX_H */ | ||
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index e81f62d24ee2..20ee8b221dbd 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
@@ -49,12 +49,24 @@ | |||
49 | #define LP8556_FAST_CONFIG BIT(7) /* use it if EPROMs should be maintained | 49 | #define LP8556_FAST_CONFIG BIT(7) /* use it if EPROMs should be maintained |
50 | when exiting the low power mode */ | 50 | when exiting the low power mode */ |
51 | 51 | ||
52 | /* CONFIG register - LP8557 */ | ||
53 | #define LP8557_PWM_STANDBY BIT(7) | ||
54 | #define LP8557_PWM_FILTER BIT(6) | ||
55 | #define LP8557_RELOAD_EPROM BIT(3) /* use it if EPROMs should be reset | ||
56 | when the backlight turns on */ | ||
57 | #define LP8557_OFF_OPENLEDS BIT(2) | ||
58 | #define LP8557_PWM_CONFIG LP8557_PWM_ONLY | ||
59 | #define LP8557_I2C_CONFIG LP8557_I2C_ONLY | ||
60 | #define LP8557_COMB1_CONFIG LP8557_COMBINED1 | ||
61 | #define LP8557_COMB2_CONFIG LP8557_COMBINED2 | ||
62 | |||
52 | enum lp855x_chip_id { | 63 | enum lp855x_chip_id { |
53 | LP8550, | 64 | LP8550, |
54 | LP8551, | 65 | LP8551, |
55 | LP8552, | 66 | LP8552, |
56 | LP8553, | 67 | LP8553, |
57 | LP8556, | 68 | LP8556, |
69 | LP8557, | ||
58 | }; | 70 | }; |
59 | 71 | ||
60 | enum lp855x_brightness_ctrl_mode { | 72 | enum lp855x_brightness_ctrl_mode { |
@@ -89,6 +101,13 @@ enum lp8556_brightness_source { | |||
89 | LP8556_COMBINED2, /* pwm + i2c after the shaper block */ | 101 | LP8556_COMBINED2, /* pwm + i2c after the shaper block */ |
90 | }; | 102 | }; |
91 | 103 | ||
104 | enum lp8557_brightness_source { | ||
105 | LP8557_PWM_ONLY, | ||
106 | LP8557_I2C_ONLY, | ||
107 | LP8557_COMBINED1, /* pwm + i2c after the shaper block */ | ||
108 | LP8557_COMBINED2, /* pwm + i2c before the shaper block */ | ||
109 | }; | ||
110 | |||
92 | struct lp855x_rom_data { | 111 | struct lp855x_rom_data { |
93 | u8 addr; | 112 | u8 addr; |
94 | u8 val; | 113 | u8 val; |
diff --git a/include/linux/platform_data/lp8755.h b/include/linux/platform_data/lp8755.h new file mode 100644 index 000000000000..a7fd0776c9bf --- /dev/null +++ b/include/linux/platform_data/lp8755.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * LP8755 High Performance Power Management Unit Driver:System Interface Driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments | ||
5 | * | ||
6 | * Author: Daniel(Geon Si) Jeong <daniel.jeong@ti.com> | ||
7 | * G.Shark Jeong <gshark.jeong@gmail.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 | |||
15 | #ifndef _LP8755_H | ||
16 | #define _LP8755_H | ||
17 | |||
18 | #include <linux/regulator/consumer.h> | ||
19 | |||
20 | #define LP8755_NAME "lp8755-regulator" | ||
21 | /* | ||
22 | *PWR FAULT : power fault detected | ||
23 | *OCP : over current protect activated | ||
24 | *OVP : over voltage protect activated | ||
25 | *TEMP_WARN : thermal warning | ||
26 | *TEMP_SHDN : thermal shutdonw detected | ||
27 | *I_LOAD : current measured | ||
28 | */ | ||
29 | #define LP8755_EVENT_PWR_FAULT REGULATOR_EVENT_FAIL | ||
30 | #define LP8755_EVENT_OCP REGULATOR_EVENT_OVER_CURRENT | ||
31 | #define LP8755_EVENT_OVP 0x10000 | ||
32 | #define LP8755_EVENT_TEMP_WARN 0x2000 | ||
33 | #define LP8755_EVENT_TEMP_SHDN REGULATOR_EVENT_OVER_TEMP | ||
34 | #define LP8755_EVENT_I_LOAD 0x40000 | ||
35 | |||
36 | enum lp8755_bucks { | ||
37 | LP8755_BUCK0 = 0, | ||
38 | LP8755_BUCK1, | ||
39 | LP8755_BUCK2, | ||
40 | LP8755_BUCK3, | ||
41 | LP8755_BUCK4, | ||
42 | LP8755_BUCK5, | ||
43 | LP8755_BUCK_MAX, | ||
44 | }; | ||
45 | |||
46 | /** | ||
47 | * multiphase configuration options | ||
48 | */ | ||
49 | enum lp8755_mphase_config { | ||
50 | MPHASE_CONF0, | ||
51 | MPHASE_CONF1, | ||
52 | MPHASE_CONF2, | ||
53 | MPHASE_CONF3, | ||
54 | MPHASE_CONF4, | ||
55 | MPHASE_CONF5, | ||
56 | MPHASE_CONF6, | ||
57 | MPHASE_CONF7, | ||
58 | MPHASE_CONF8, | ||
59 | MPHASE_CONF_MAX | ||
60 | }; | ||
61 | |||
62 | /** | ||
63 | * struct lp8755_platform_data | ||
64 | * @mphase_type : Multiphase Switcher Configurations. | ||
65 | * @buck_data : buck0~6 init voltage in uV | ||
66 | */ | ||
67 | struct lp8755_platform_data { | ||
68 | int mphase; | ||
69 | struct regulator_init_data *buck_data[LP8755_BUCK_MAX]; | ||
70 | }; | ||
71 | #endif | ||
diff --git a/include/linux/platform_data/max6697.h b/include/linux/platform_data/max6697.h new file mode 100644 index 000000000000..ed9d3b3daf02 --- /dev/null +++ b/include/linux/platform_data/max6697.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * max6697.h | ||
3 | * Copyright (c) 2012 Guenter Roeck <linux@roeck-us.net> | ||
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 MAX6697_H | ||
11 | #define MAX6697_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | /* | ||
16 | * For all bit masks: | ||
17 | * bit 0: local temperature | ||
18 | * bit 1..7: remote temperatures | ||
19 | */ | ||
20 | struct max6697_platform_data { | ||
21 | bool smbus_timeout_disable; /* set to disable SMBus timeouts */ | ||
22 | bool extended_range_enable; /* set to enable extended temp range */ | ||
23 | bool beta_compensation; /* set to enable beta compensation */ | ||
24 | u8 alert_mask; /* set bit to 1 to disable alert */ | ||
25 | u8 over_temperature_mask; /* set bit to 1 to disable */ | ||
26 | u8 resistance_cancellation; /* set bit to 0 to disable | ||
27 | * bit mask for MAX6581, | ||
28 | * boolean for other chips | ||
29 | */ | ||
30 | u8 ideality_mask; /* set bit to 0 to disable */ | ||
31 | u8 ideality_value; /* transistor ideality as per | ||
32 | * MAX6581 datasheet | ||
33 | */ | ||
34 | }; | ||
35 | |||
36 | #endif /* MAX6697_H */ | ||
diff --git a/include/linux/platform_data/microread.h b/include/linux/platform_data/microread.h new file mode 100644 index 000000000000..cfda59b226ee --- /dev/null +++ b/include/linux/platform_data/microread.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) 2011 Tieto Poland | ||
5 | * Copyright (C) 2012 Intel Corporation. All rights reserved. | ||
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 | * version 2 as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * 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 | |||
21 | #ifndef _MICROREAD_H | ||
22 | #define _MICROREAD_H | ||
23 | |||
24 | #include <linux/i2c.h> | ||
25 | |||
26 | #define MICROREAD_DRIVER_NAME "microread" | ||
27 | |||
28 | /* board config platform data for microread */ | ||
29 | struct microread_nfc_platform_data { | ||
30 | unsigned int rst_gpio; | ||
31 | unsigned int irq_gpio; | ||
32 | unsigned int ioh_gpio; | ||
33 | }; | ||
34 | |||
35 | #endif /* _MICROREAD_H */ | ||
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index aaf97481f413..b4a0521ce411 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h | |||
@@ -39,5 +39,6 @@ struct esdhc_platform_data { | |||
39 | unsigned int cd_gpio; | 39 | unsigned int cd_gpio; |
40 | enum wp_types wp_type; | 40 | enum wp_types wp_type; |
41 | enum cd_types cd_type; | 41 | enum cd_types cd_type; |
42 | int max_bus_width; | ||
42 | }; | 43 | }; |
43 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | 44 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ |
diff --git a/include/linux/platform_data/mmc-sdhci-tegra.h b/include/linux/platform_data/mmc-sdhci-tegra.h deleted file mode 100644 index 8f8430697686..000000000000 --- a/include/linux/platform_data/mmc-sdhci-tegra.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Palm, Inc. | ||
3 | * Author: Yvonne Yip <y@palm.com> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | #ifndef __PLATFORM_DATA_TEGRA_SDHCI_H | ||
16 | #define __PLATFORM_DATA_TEGRA_SDHCI_H | ||
17 | |||
18 | #include <linux/mmc/host.h> | ||
19 | |||
20 | struct tegra_sdhci_platform_data { | ||
21 | int cd_gpio; | ||
22 | int wp_gpio; | ||
23 | int power_gpio; | ||
24 | int is_8bit; | ||
25 | int pm_flags; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 24d32ca34bef..6bf9ef43ddb1 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
@@ -60,6 +60,8 @@ struct omap_nand_platform_data { | |||
60 | int devsize; | 60 | int devsize; |
61 | enum omap_ecc ecc_opt; | 61 | enum omap_ecc ecc_opt; |
62 | struct gpmc_nand_regs reg; | 62 | struct gpmc_nand_regs reg; |
63 | }; | ||
64 | 63 | ||
64 | /* for passing the partitions */ | ||
65 | struct device_node *of_node; | ||
66 | }; | ||
65 | #endif | 67 | #endif |
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h index 685af7e8b120..e9a9fb188f97 100644 --- a/include/linux/platform_data/mtd-onenand-omap2.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
@@ -29,5 +29,8 @@ struct omap_onenand_platform_data { | |||
29 | u8 flags; | 29 | u8 flags; |
30 | u8 regulator_can_sleep; | 30 | u8 regulator_can_sleep; |
31 | u8 skip_initial_unlocking; | 31 | u8 skip_initial_unlocking; |
32 | |||
33 | /* for passing the partitions */ | ||
34 | struct device_node *of_node; | ||
32 | }; | 35 | }; |
33 | #endif | 36 | #endif |
diff --git a/include/linux/platform_data/s3c-hsotg.h b/include/linux/platform_data/s3c-hsotg.h index 8b79e0967f9c..3f1cbf95ec3b 100644 --- a/include/linux/platform_data/s3c-hsotg.h +++ b/include/linux/platform_data/s3c-hsotg.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __LINUX_USB_S3C_HSOTG_H | 15 | #ifndef __LINUX_USB_S3C_HSOTG_H |
16 | #define __LINUX_USB_S3C_HSOTG_H | 16 | #define __LINUX_USB_S3C_HSOTG_H |
17 | 17 | ||
18 | struct platform_device; | ||
19 | |||
18 | enum s3c_hsotg_dmamode { | 20 | enum s3c_hsotg_dmamode { |
19 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ | 21 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ |
20 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ | 22 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ |
diff --git a/include/linux/platform_data/samsung-usbphy.h b/include/linux/platform_data/samsung-usbphy.h new file mode 100644 index 000000000000..1bd24cba982b --- /dev/null +++ b/include/linux/platform_data/samsung-usbphy.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Samsung Electronics Co.Ltd | ||
3 | * http://www.samsung.com/ | ||
4 | * Author: Praveen Paneri <p.paneri@samsung.com> | ||
5 | * | ||
6 | * Defines platform data for samsung usb phy driver. | ||
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 __SAMSUNG_USBPHY_PLATFORM_H | ||
15 | #define __SAMSUNG_USBPHY_PLATFORM_H | ||
16 | |||
17 | /** | ||
18 | * samsung_usbphy_data - Platform data for USB PHY driver. | ||
19 | * @pmu_isolation: Function to control usb phy isolation in PMU. | ||
20 | */ | ||
21 | struct samsung_usbphy_data { | ||
22 | void (*pmu_isolation)(int on); | ||
23 | }; | ||
24 | |||
25 | extern void samsung_usbphy_set_pdata(struct samsung_usbphy_data *pd); | ||
26 | |||
27 | #endif /* __SAMSUNG_USBPHY_PLATFORM_H */ | ||
diff --git a/include/linux/platform_data/sccnxp.h b/include/linux/platform_data/serial-sccnxp.h index 7311ccd3217f..215574d1e81d 100644 --- a/include/linux/platform_data/sccnxp.h +++ b/include/linux/platform_data/serial-sccnxp.h | |||
@@ -11,8 +11,8 @@ | |||
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef __SCCNXP_H | 14 | #ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_ |
15 | #define __SCCNXP_H | 15 | #define _PLATFORM_DATA_SERIAL_SCCNXP_H_ |
16 | 16 | ||
17 | #define SCCNXP_MAX_UARTS 2 | 17 | #define SCCNXP_MAX_UARTS 2 |
18 | 18 | ||
@@ -84,6 +84,8 @@ struct sccnxp_pdata { | |||
84 | const u8 reg_shift; | 84 | const u8 reg_shift; |
85 | /* Modem control lines configuration */ | 85 | /* Modem control lines configuration */ |
86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; | 86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; |
87 | /* Timer value for polling mode (usecs) */ | ||
88 | const unsigned int poll_time_us; | ||
87 | /* Called during startup */ | 89 | /* Called during startup */ |
88 | void (*init)(void); | 90 | void (*init)(void); |
89 | /* Called before finish */ | 91 | /* Called before finish */ |
diff --git a/include/linux/platform_data/sh_ipmmu.h b/include/linux/platform_data/sh_ipmmu.h new file mode 100644 index 000000000000..39f7405cdac5 --- /dev/null +++ b/include/linux/platform_data/sh_ipmmu.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* sh_ipmmu.h | ||
2 | * | ||
3 | * Copyright (C) 2012 Hideki EIRAKU | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; version 2 of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef __SH_IPMMU_H__ | ||
11 | #define __SH_IPMMU_H__ | ||
12 | |||
13 | struct shmobile_ipmmu_platform_data { | ||
14 | const char * const *dev_names; | ||
15 | unsigned int num_dev_names; | ||
16 | }; | ||
17 | |||
18 | #endif /* __SH_IPMMU_H__ */ | ||
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h index a65572d53211..c100456eab17 100644 --- a/include/linux/platform_data/spi-omap2-mcspi.h +++ b/include/linux/platform_data/spi-omap2-mcspi.h | |||
@@ -22,6 +22,9 @@ struct omap2_mcspi_dev_attr { | |||
22 | 22 | ||
23 | struct omap2_mcspi_device_config { | 23 | struct omap2_mcspi_device_config { |
24 | unsigned turbo_mode:1; | 24 | unsigned turbo_mode:1; |
25 | |||
26 | /* toggle chip select after every word */ | ||
27 | unsigned cs_per_word:1; | ||
25 | }; | 28 | }; |
26 | 29 | ||
27 | #endif | 30 | #endif |
diff --git a/include/linux/platform_data/tsl2563.h b/include/linux/platform_data/tsl2563.h new file mode 100644 index 000000000000..c90d7a09dda7 --- /dev/null +++ b/include/linux/platform_data/tsl2563.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __LINUX_TSL2563_H | ||
2 | #define __LINUX_TSL2563_H | ||
3 | |||
4 | struct tsl2563_platform_data { | ||
5 | int cover_comp_gain; | ||
6 | }; | ||
7 | |||
8 | #endif /* __LINUX_TSL2563_H */ | ||
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h index ef65b67c56c3..fa579b4c666b 100644 --- a/include/linux/platform_data/usb-omap.h +++ b/include/linux/platform_data/usb-omap.h | |||
@@ -55,13 +55,18 @@ struct ohci_hcd_omap_platform_data { | |||
55 | }; | 55 | }; |
56 | 56 | ||
57 | struct usbhs_omap_platform_data { | 57 | struct usbhs_omap_platform_data { |
58 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | 58 | int nports; |
59 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
60 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; | ||
61 | struct regulator *regulator[OMAP3_HS_USB_PORTS]; | ||
59 | 62 | ||
60 | struct ehci_hcd_omap_platform_data *ehci_data; | 63 | struct ehci_hcd_omap_platform_data *ehci_data; |
61 | struct ohci_hcd_omap_platform_data *ohci_data; | 64 | struct ohci_hcd_omap_platform_data *ohci_data; |
62 | 65 | ||
63 | /* OMAP3 <= ES2.1 have a single ulpi bypass control bit */ | 66 | /* OMAP3 <= ES2.1 have a single ulpi bypass control bit */ |
64 | unsigned single_ulpi_bypass:1; | 67 | unsigned single_ulpi_bypass:1; |
68 | unsigned es2_compatibility:1; | ||
69 | unsigned phy_reset:1; | ||
65 | }; | 70 | }; |
66 | 71 | ||
67 | /*-------------------------------------------------------------------------*/ | 72 | /*-------------------------------------------------------------------------*/ |
diff --git a/include/linux/platform_data/usb3503.h b/include/linux/platform_data/usb3503.h new file mode 100644 index 000000000000..85dcc709f7e9 --- /dev/null +++ b/include/linux/platform_data/usb3503.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef __USB3503_H__ | ||
2 | #define __USB3503_H__ | ||
3 | |||
4 | #define USB3503_I2C_NAME "usb3503" | ||
5 | |||
6 | enum usb3503_mode { | ||
7 | USB3503_MODE_UNKNOWN, | ||
8 | USB3503_MODE_HUB, | ||
9 | USB3503_MODE_STANDBY, | ||
10 | }; | ||
11 | |||
12 | struct usb3503_platform_data { | ||
13 | enum usb3503_mode initial_mode; | ||
14 | int gpio_intn; | ||
15 | int gpio_connect; | ||
16 | int gpio_reset; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/platform_data/ux500_wdt.h b/include/linux/platform_data/ux500_wdt.h new file mode 100644 index 000000000000..1689ff4c3bfd --- /dev/null +++ b/include/linux/platform_data/ux500_wdt.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST Ericsson SA 2011 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * STE Ux500 Watchdog platform data | ||
7 | */ | ||
8 | #ifndef __UX500_WDT_H | ||
9 | #define __UX500_WDT_H | ||
10 | |||
11 | /** | ||
12 | * struct ux500_wdt_data | ||
13 | */ | ||
14 | struct ux500_wdt_data { | ||
15 | unsigned int timeout; | ||
16 | bool has_28_bits_resolution; | ||
17 | }; | ||
18 | |||
19 | #endif /* __UX500_WDT_H */ | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index a9ded9a3c175..c082c71f7225 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -204,6 +204,24 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data | |||
204 | module_driver(__platform_driver, platform_driver_register, \ | 204 | module_driver(__platform_driver, platform_driver_register, \ |
205 | platform_driver_unregister) | 205 | platform_driver_unregister) |
206 | 206 | ||
207 | /* module_platform_driver_probe() - Helper macro for drivers that don't do | ||
208 | * anything special in module init/exit. This eliminates a lot of | ||
209 | * boilerplate. Each module may only use this macro once, and | ||
210 | * calling it replaces module_init() and module_exit() | ||
211 | */ | ||
212 | #define module_platform_driver_probe(__platform_driver, __platform_probe) \ | ||
213 | static int __init __platform_driver##_init(void) \ | ||
214 | { \ | ||
215 | return platform_driver_probe(&(__platform_driver), \ | ||
216 | __platform_probe); \ | ||
217 | } \ | ||
218 | module_init(__platform_driver##_init); \ | ||
219 | static void __exit __platform_driver##_exit(void) \ | ||
220 | { \ | ||
221 | platform_driver_unregister(&(__platform_driver)); \ | ||
222 | } \ | ||
223 | module_exit(__platform_driver##_exit); | ||
224 | |||
207 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 225 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
208 | int (*probe)(struct platform_device *), | 226 | int (*probe)(struct platform_device *), |
209 | struct resource *res, unsigned int n_res, | 227 | struct resource *res, unsigned int n_res, |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 03d7bb145311..e5d7230332a4 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -31,7 +31,6 @@ | |||
31 | /* | 31 | /* |
32 | * Callbacks for platform drivers to implement. | 32 | * Callbacks for platform drivers to implement. |
33 | */ | 33 | */ |
34 | extern void (*pm_idle)(void); | ||
35 | extern void (*pm_power_off)(void); | 34 | extern void (*pm_power_off)(void); |
36 | extern void (*pm_power_off_prepare)(void); | 35 | extern void (*pm_power_off_prepare)(void); |
37 | 36 | ||
@@ -538,6 +537,7 @@ struct dev_pm_info { | |||
538 | unsigned int irq_safe:1; | 537 | unsigned int irq_safe:1; |
539 | unsigned int use_autosuspend:1; | 538 | unsigned int use_autosuspend:1; |
540 | unsigned int timer_autosuspends:1; | 539 | unsigned int timer_autosuspends:1; |
540 | unsigned int memalloc_noio:1; | ||
541 | enum rpm_request request; | 541 | enum rpm_request request; |
542 | enum rpm_status runtime_status; | 542 | enum rpm_status runtime_status; |
543 | int runtime_error; | 543 | int runtime_error; |
diff --git a/include/linux/pm2301_charger.h b/include/linux/pm2301_charger.h new file mode 100644 index 000000000000..fc3f026922ae --- /dev/null +++ b/include/linux/pm2301_charger.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * PM2301 charger driver. | ||
3 | * | ||
4 | * Copyright (C) 2012 ST Ericsson Corporation | ||
5 | * | ||
6 | * Contact: Olivier LAUNAY (olivier.launay@stericsson.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * 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, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_PM2301_H | ||
24 | #define __LINUX_PM2301_H | ||
25 | |||
26 | /** | ||
27 | * struct pm2xxx_bm_charger_parameters - Charger specific parameters | ||
28 | * @ac_volt_max: maximum allowed AC charger voltage in mV | ||
29 | * @ac_curr_max: maximum allowed AC charger current in mA | ||
30 | */ | ||
31 | struct pm2xxx_bm_charger_parameters { | ||
32 | int ac_volt_max; | ||
33 | int ac_curr_max; | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * struct pm2xxx_bm_data - pm2xxx battery management data | ||
38 | * @enable_overshoot flag to enable VBAT overshoot control | ||
39 | * @chg_params charger parameters | ||
40 | */ | ||
41 | struct pm2xxx_bm_data { | ||
42 | bool enable_overshoot; | ||
43 | const struct pm2xxx_bm_charger_parameters *chg_params; | ||
44 | }; | ||
45 | |||
46 | struct pm2xxx_charger_platform_data { | ||
47 | char **supplied_to; | ||
48 | size_t num_supplicants; | ||
49 | int i2c_bus; | ||
50 | const char *label; | ||
51 | int irq_number; | ||
52 | unsigned int lpn_gpio; | ||
53 | int irq_type; | ||
54 | }; | ||
55 | |||
56 | struct pm2xxx_platform_data { | ||
57 | struct pm2xxx_charger_platform_data *wall_charger; | ||
58 | struct pm2xxx_bm_data *battery; | ||
59 | }; | ||
60 | |||
61 | #endif /* __LINUX_PM2301_H */ | ||
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index f271860c78d5..7d7e09efff9b 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -47,6 +47,7 @@ extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | |||
47 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | 47 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); |
48 | extern void pm_runtime_update_max_time_suspended(struct device *dev, | 48 | extern void pm_runtime_update_max_time_suspended(struct device *dev, |
49 | s64 delta_ns); | 49 | s64 delta_ns); |
50 | extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable); | ||
50 | 51 | ||
51 | static inline bool pm_children_suspended(struct device *dev) | 52 | static inline bool pm_children_suspended(struct device *dev) |
52 | { | 53 | { |
@@ -80,6 +81,12 @@ static inline bool pm_runtime_suspended(struct device *dev) | |||
80 | && !dev->power.disable_depth; | 81 | && !dev->power.disable_depth; |
81 | } | 82 | } |
82 | 83 | ||
84 | static inline bool pm_runtime_active(struct device *dev) | ||
85 | { | ||
86 | return dev->power.runtime_status == RPM_ACTIVE | ||
87 | || dev->power.disable_depth; | ||
88 | } | ||
89 | |||
83 | static inline bool pm_runtime_status_suspended(struct device *dev) | 90 | static inline bool pm_runtime_status_suspended(struct device *dev) |
84 | { | 91 | { |
85 | return dev->power.runtime_status == RPM_SUSPENDED; | 92 | return dev->power.runtime_status == RPM_SUSPENDED; |
@@ -132,6 +139,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {} | |||
132 | static inline bool device_run_wake(struct device *dev) { return false; } | 139 | static inline bool device_run_wake(struct device *dev) { return false; } |
133 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 140 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
134 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 141 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
142 | static inline bool pm_runtime_active(struct device *dev) { return true; } | ||
135 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 143 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
136 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 144 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
137 | 145 | ||
@@ -149,6 +157,8 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev, | |||
149 | int delay) {} | 157 | int delay) {} |
150 | static inline unsigned long pm_runtime_autosuspend_expiration( | 158 | static inline unsigned long pm_runtime_autosuspend_expiration( |
151 | struct device *dev) { return 0; } | 159 | struct device *dev) { return 0; } |
160 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, | ||
161 | bool enable){} | ||
152 | 162 | ||
153 | #endif /* !CONFIG_PM_RUNTIME */ | 163 | #endif /* !CONFIG_PM_RUNTIME */ |
154 | 164 | ||
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h index 97a1665eaeaf..8dcc0f46fc0a 100644 --- a/include/linux/power/bq2415x_charger.h +++ b/include/linux/power/bq2415x_charger.h | |||
@@ -75,7 +75,8 @@ | |||
75 | 75 | ||
76 | /* Supported modes with maximal current limit */ | 76 | /* Supported modes with maximal current limit */ |
77 | enum bq2415x_mode { | 77 | enum bq2415x_mode { |
78 | BQ2415X_MODE_NONE, /* unknown or no charger (100mA) */ | 78 | BQ2415X_MODE_OFF, /* offline mode (charger disabled) */ |
79 | BQ2415X_MODE_NONE, /* unknown charger (100mA) */ | ||
79 | BQ2415X_MODE_HOST_CHARGER, /* usb host/hub charger (500mA) */ | 80 | BQ2415X_MODE_HOST_CHARGER, /* usb host/hub charger (500mA) */ |
80 | BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */ | 81 | BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */ |
81 | BQ2415X_MODE_BOOST, /* boost mode (charging disabled) */ | 82 | BQ2415X_MODE_BOOST, /* boost mode (charging disabled) */ |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 1f0ab90aff00..002a99f96331 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -54,6 +54,8 @@ enum { | |||
54 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, | 54 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, |
55 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, | 55 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, |
56 | POWER_SUPPLY_HEALTH_COLD, | 56 | POWER_SUPPLY_HEALTH_COLD, |
57 | POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE, | ||
58 | POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE, | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | enum { | 61 | enum { |
@@ -224,7 +226,7 @@ struct power_supply_info { | |||
224 | int use_for_apm; | 226 | int use_for_apm; |
225 | }; | 227 | }; |
226 | 228 | ||
227 | extern struct power_supply *power_supply_get_by_name(char *name); | 229 | extern struct power_supply *power_supply_get_by_name(const char *name); |
228 | extern void power_supply_changed(struct power_supply *psy); | 230 | extern void power_supply_changed(struct power_supply *psy); |
229 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 231 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
230 | extern int power_supply_set_battery_charged(struct power_supply *psy); | 232 | extern int power_supply_set_battery_charged(struct power_supply *psy); |
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index 0cc45ae1afd5..7db3eb93a079 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -43,7 +43,7 @@ struct pps_source_info { | |||
43 | int event, void *data); /* PPS echo function */ | 43 | int event, void *data); /* PPS echo function */ |
44 | 44 | ||
45 | struct module *owner; | 45 | struct module *owner; |
46 | struct device *dev; | 46 | struct device *dev; /* Parent device for device_create */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | struct pps_event_time { | 49 | struct pps_event_time { |
@@ -69,6 +69,7 @@ struct pps_device { | |||
69 | wait_queue_head_t queue; /* PPS event queue */ | 69 | wait_queue_head_t queue; /* PPS event queue */ |
70 | 70 | ||
71 | unsigned int id; /* PPS source unique ID */ | 71 | unsigned int id; /* PPS source unique ID */ |
72 | void const *lookup_cookie; /* pps_lookup_dev only */ | ||
72 | struct cdev cdev; | 73 | struct cdev cdev; |
73 | struct device *dev; | 74 | struct device *dev; |
74 | struct fasync_struct *async_queue; /* fasync method */ | 75 | struct fasync_struct *async_queue; /* fasync method */ |
@@ -82,16 +83,26 @@ struct pps_device { | |||
82 | extern struct device_attribute pps_attrs[]; | 83 | extern struct device_attribute pps_attrs[]; |
83 | 84 | ||
84 | /* | 85 | /* |
86 | * Internal functions. | ||
87 | * | ||
88 | * These are not actually part of the exported API, but this is a | ||
89 | * convenient header file to put them in. | ||
90 | */ | ||
91 | |||
92 | extern int pps_register_cdev(struct pps_device *pps); | ||
93 | extern void pps_unregister_cdev(struct pps_device *pps); | ||
94 | |||
95 | /* | ||
85 | * Exported functions | 96 | * Exported functions |
86 | */ | 97 | */ |
87 | 98 | ||
88 | extern struct pps_device *pps_register_source( | 99 | extern struct pps_device *pps_register_source( |
89 | struct pps_source_info *info, int default_params); | 100 | struct pps_source_info *info, int default_params); |
90 | extern void pps_unregister_source(struct pps_device *pps); | 101 | extern void pps_unregister_source(struct pps_device *pps); |
91 | extern int pps_register_cdev(struct pps_device *pps); | ||
92 | extern void pps_unregister_cdev(struct pps_device *pps); | ||
93 | extern void pps_event(struct pps_device *pps, | 102 | extern void pps_event(struct pps_device *pps, |
94 | struct pps_event_time *ts, int event, void *data); | 103 | struct pps_event_time *ts, int event, void *data); |
104 | /* Look up a pps device by magic cookie */ | ||
105 | struct pps_device *pps_lookup_dev(void const *cookie); | ||
95 | 106 | ||
96 | static inline void timespec_to_pps_ktime(struct pps_ktime *kt, | 107 | static inline void timespec_to_pps_ktime(struct pps_ktime *kt, |
97 | struct timespec ts) | 108 | struct timespec ts) |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 86c4b6294713..1249a54d17e0 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -252,6 +252,15 @@ extern void dump_stack(void) __cold; | |||
252 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 252 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
253 | #define pr_cont_once(fmt, ...) \ | 253 | #define pr_cont_once(fmt, ...) \ |
254 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) | 254 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) |
255 | |||
256 | #if defined(DEBUG) | ||
257 | #define pr_devel_once(fmt, ...) \ | ||
258 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
259 | #else | ||
260 | #define pr_devel_once(fmt, ...) \ | ||
261 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
262 | #endif | ||
263 | |||
255 | /* If you are writing a driver, please use dev_dbg instead */ | 264 | /* If you are writing a driver, please use dev_dbg instead */ |
256 | #if defined(DEBUG) | 265 | #if defined(DEBUG) |
257 | #define pr_debug_once(fmt, ...) \ | 266 | #define pr_debug_once(fmt, ...) \ |
@@ -295,6 +304,15 @@ extern void dump_stack(void) __cold; | |||
295 | #define pr_info_ratelimited(fmt, ...) \ | 304 | #define pr_info_ratelimited(fmt, ...) \ |
296 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 305 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
297 | /* no pr_cont_ratelimited, don't do that... */ | 306 | /* no pr_cont_ratelimited, don't do that... */ |
307 | |||
308 | #if defined(DEBUG) | ||
309 | #define pr_devel_ratelimited(fmt, ...) \ | ||
310 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
311 | #else | ||
312 | #define pr_devel_ratelimited(fmt, ...) \ | ||
313 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
314 | #endif | ||
315 | |||
298 | /* If you are writing a driver, please use dev_dbg instead */ | 316 | /* If you are writing a driver, please use dev_dbg instead */ |
299 | #if defined(DEBUG) | 317 | #if defined(DEBUG) |
300 | #define pr_debug_ratelimited(fmt, ...) \ | 318 | #define pr_debug_ratelimited(fmt, ...) \ |
@@ -318,8 +336,13 @@ extern void hex_dump_to_buffer(const void *buf, size_t len, | |||
318 | extern void print_hex_dump(const char *level, const char *prefix_str, | 336 | extern void print_hex_dump(const char *level, const char *prefix_str, |
319 | int prefix_type, int rowsize, int groupsize, | 337 | int prefix_type, int rowsize, int groupsize, |
320 | const void *buf, size_t len, bool ascii); | 338 | const void *buf, size_t len, bool ascii); |
339 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
340 | #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \ | ||
341 | dynamic_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, true) | ||
342 | #else | ||
321 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | 343 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
322 | const void *buf, size_t len); | 344 | const void *buf, size_t len); |
345 | #endif /* defined(CONFIG_DYNAMIC_DEBUG) */ | ||
323 | #else | 346 | #else |
324 | static inline void print_hex_dump(const char *level, const char *prefix_str, | 347 | static inline void print_hex_dump(const char *level, const char *prefix_str, |
325 | int prefix_type, int rowsize, int groupsize, | 348 | int prefix_type, int rowsize, int groupsize, |
@@ -333,4 +356,16 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
333 | 356 | ||
334 | #endif | 357 | #endif |
335 | 358 | ||
359 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
360 | #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ | ||
361 | groupsize, buf, len, ascii) \ | ||
362 | dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ | ||
363 | groupsize, buf, len, ascii) | ||
364 | #else | ||
365 | #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ | ||
366 | groupsize, buf, len, ascii) \ | ||
367 | print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ | ||
368 | groupsize, buf, len, ascii) | ||
369 | #endif /* defined(CONFIG_DYNAMIC_DEBUG) */ | ||
370 | |||
336 | #endif | 371 | #endif |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 32676b35d2f5..8307f2f94d86 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -127,7 +127,12 @@ extern void pid_ns_release_proc(struct pid_namespace *ns); | |||
127 | * proc_tty.c | 127 | * proc_tty.c |
128 | */ | 128 | */ |
129 | struct tty_driver; | 129 | struct tty_driver; |
130 | #ifdef CONFIG_TTY | ||
130 | extern void proc_tty_init(void); | 131 | extern void proc_tty_init(void); |
132 | #else | ||
133 | static inline void proc_tty_init(void) | ||
134 | { } | ||
135 | #endif | ||
131 | extern void proc_tty_register_driver(struct tty_driver *driver); | 136 | extern void proc_tty_register_driver(struct tty_driver *driver); |
132 | extern void proc_tty_unregister_driver(struct tty_driver *driver); | 137 | extern void proc_tty_unregister_driver(struct tty_driver *driver); |
133 | 138 | ||
@@ -171,9 +176,6 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name, | |||
171 | return res; | 176 | return res; |
172 | } | 177 | } |
173 | 178 | ||
174 | extern struct proc_dir_entry *proc_net_fops_create(struct net *net, | ||
175 | const char *name, umode_t mode, const struct file_operations *fops); | ||
176 | extern void proc_net_remove(struct net *net, const char *name); | ||
177 | extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, | 179 | extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, |
178 | struct proc_dir_entry *parent); | 180 | struct proc_dir_entry *parent); |
179 | 181 | ||
@@ -184,21 +186,15 @@ extern int proc_alloc_inum(unsigned int *pino); | |||
184 | extern void proc_free_inum(unsigned int inum); | 186 | extern void proc_free_inum(unsigned int inum); |
185 | #else | 187 | #else |
186 | 188 | ||
187 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) | ||
188 | static inline void proc_net_remove(struct net *net, const char *name) {} | ||
189 | |||
190 | static inline void proc_flush_task(struct task_struct *task) | 189 | static inline void proc_flush_task(struct task_struct *task) |
191 | { | 190 | { |
192 | } | 191 | } |
193 | 192 | ||
194 | static inline struct proc_dir_entry *create_proc_entry(const char *name, | 193 | static inline struct proc_dir_entry *create_proc_entry(const char *name, |
195 | umode_t mode, struct proc_dir_entry *parent) { return NULL; } | 194 | umode_t mode, struct proc_dir_entry *parent) { return NULL; } |
196 | static inline struct proc_dir_entry *proc_create(const char *name, | 195 | |
197 | umode_t mode, struct proc_dir_entry *parent, | 196 | #define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; }) |
198 | const struct file_operations *proc_fops) | 197 | |
199 | { | ||
200 | return NULL; | ||
201 | } | ||
202 | static inline struct proc_dir_entry *proc_create_data(const char *name, | 198 | static inline struct proc_dir_entry *proc_create_data(const char *name, |
203 | umode_t mode, struct proc_dir_entry *parent, | 199 | umode_t mode, struct proc_dir_entry *parent, |
204 | const struct file_operations *proc_fops, void *data) | 200 | const struct file_operations *proc_fops, void *data) |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 1788909d9a99..75d01760c911 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -68,12 +68,18 @@ struct pstore_info { | |||
68 | 68 | ||
69 | #ifdef CONFIG_PSTORE | 69 | #ifdef CONFIG_PSTORE |
70 | extern int pstore_register(struct pstore_info *); | 70 | extern int pstore_register(struct pstore_info *); |
71 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); | ||
71 | #else | 72 | #else |
72 | static inline int | 73 | static inline int |
73 | pstore_register(struct pstore_info *psi) | 74 | pstore_register(struct pstore_info *psi) |
74 | { | 75 | { |
75 | return -ENODEV; | 76 | return -ENODEV; |
76 | } | 77 | } |
78 | static inline bool | ||
79 | pstore_cannot_block_path(enum kmsg_dump_reason reason) | ||
80 | { | ||
81 | return false; | ||
82 | } | ||
77 | #endif | 83 | #endif |
78 | 84 | ||
79 | #endif /*_LINUX_PSTORE_H*/ | 85 | #endif /*_LINUX_PSTORE_H*/ |
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 6d661f32e0e4..a4df2042b79c 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h | |||
@@ -146,6 +146,8 @@ struct pwm_ops { | |||
146 | * @base: number of first PWM controlled by this chip | 146 | * @base: number of first PWM controlled by this chip |
147 | * @npwm: number of PWMs controlled by this chip | 147 | * @npwm: number of PWMs controlled by this chip |
148 | * @pwms: array of PWM devices allocated by the framework | 148 | * @pwms: array of PWM devices allocated by the framework |
149 | * @can_sleep: must be true if the .config(), .enable() or .disable() | ||
150 | * operations may sleep | ||
149 | */ | 151 | */ |
150 | struct pwm_chip { | 152 | struct pwm_chip { |
151 | struct device *dev; | 153 | struct device *dev; |
@@ -159,6 +161,7 @@ struct pwm_chip { | |||
159 | struct pwm_device * (*of_xlate)(struct pwm_chip *pc, | 161 | struct pwm_device * (*of_xlate)(struct pwm_chip *pc, |
160 | const struct of_phandle_args *args); | 162 | const struct of_phandle_args *args); |
161 | unsigned int of_pwm_n_cells; | 163 | unsigned int of_pwm_n_cells; |
164 | bool can_sleep; | ||
162 | }; | 165 | }; |
163 | 166 | ||
164 | #if IS_ENABLED(CONFIG_PWM) | 167 | #if IS_ENABLED(CONFIG_PWM) |
@@ -174,11 +177,16 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, | |||
174 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, | 177 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, |
175 | const struct of_phandle_args *args); | 178 | const struct of_phandle_args *args); |
176 | 179 | ||
177 | struct pwm_device *pwm_get(struct device *dev, const char *consumer); | 180 | struct pwm_device *pwm_get(struct device *dev, const char *con_id); |
181 | struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id); | ||
178 | void pwm_put(struct pwm_device *pwm); | 182 | void pwm_put(struct pwm_device *pwm); |
179 | 183 | ||
180 | struct pwm_device *devm_pwm_get(struct device *dev, const char *consumer); | 184 | struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id); |
185 | struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, | ||
186 | const char *con_id); | ||
181 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); | 187 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); |
188 | |||
189 | bool pwm_can_sleep(struct pwm_device *pwm); | ||
182 | #else | 190 | #else |
183 | static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) | 191 | static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) |
184 | { | 192 | { |
@@ -213,6 +221,12 @@ static inline struct pwm_device *pwm_get(struct device *dev, | |||
213 | return ERR_PTR(-ENODEV); | 221 | return ERR_PTR(-ENODEV); |
214 | } | 222 | } |
215 | 223 | ||
224 | static inline struct pwm_device *of_pwm_get(struct device_node *np, | ||
225 | const char *con_id) | ||
226 | { | ||
227 | return ERR_PTR(-ENODEV); | ||
228 | } | ||
229 | |||
216 | static inline void pwm_put(struct pwm_device *pwm) | 230 | static inline void pwm_put(struct pwm_device *pwm) |
217 | { | 231 | { |
218 | } | 232 | } |
@@ -223,9 +237,21 @@ static inline struct pwm_device *devm_pwm_get(struct device *dev, | |||
223 | return ERR_PTR(-ENODEV); | 237 | return ERR_PTR(-ENODEV); |
224 | } | 238 | } |
225 | 239 | ||
240 | static inline struct pwm_device *devm_of_pwm_get(struct device *dev, | ||
241 | struct device_node *np, | ||
242 | const char *con_id) | ||
243 | { | ||
244 | return ERR_PTR(-ENODEV); | ||
245 | } | ||
246 | |||
226 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) | 247 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) |
227 | { | 248 | { |
228 | } | 249 | } |
250 | |||
251 | static inline bool pwm_can_sleep(struct pwm_device *pwm) | ||
252 | { | ||
253 | return false; | ||
254 | } | ||
229 | #endif | 255 | #endif |
230 | 256 | ||
231 | struct pwm_lookup { | 257 | struct pwm_lookup { |
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index f36632061c66..467cc6307b62 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h | |||
@@ -155,6 +155,14 @@ | |||
155 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | 155 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ |
156 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ | 156 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ |
157 | 157 | ||
158 | /* LPSS SSP */ | ||
159 | #define SSITF 0x44 /* TX FIFO trigger level */ | ||
160 | #define SSITF_TxLoThresh(x) (((x) - 1) << 8) | ||
161 | #define SSITF_TxHiThresh(x) ((x) - 1) | ||
162 | |||
163 | #define SSIRF 0x48 /* RX FIFO trigger level */ | ||
164 | #define SSIRF_RxThresh(x) ((x) - 1) | ||
165 | |||
158 | enum pxa_ssp_type { | 166 | enum pxa_ssp_type { |
159 | SSP_UNDEFINED = 0, | 167 | SSP_UNDEFINED = 0, |
160 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | 168 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ |
@@ -164,6 +172,7 @@ enum pxa_ssp_type { | |||
164 | PXA168_SSP, | 172 | PXA168_SSP, |
165 | PXA910_SSP, | 173 | PXA910_SSP, |
166 | CE4100_SSP, | 174 | CE4100_SSP, |
175 | LPSS_SSP, | ||
167 | }; | 176 | }; |
168 | 177 | ||
169 | struct ssp_device { | 178 | struct ssp_device { |
@@ -206,6 +215,15 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) | |||
206 | return __raw_readl(dev->mmio_base + reg); | 215 | return __raw_readl(dev->mmio_base + reg); |
207 | } | 216 | } |
208 | 217 | ||
218 | #ifdef CONFIG_ARCH_PXA | ||
209 | struct ssp_device *pxa_ssp_request(int port, const char *label); | 219 | struct ssp_device *pxa_ssp_request(int port, const char *label); |
210 | void pxa_ssp_free(struct ssp_device *); | 220 | void pxa_ssp_free(struct ssp_device *); |
221 | #else | ||
222 | static inline struct ssp_device *pxa_ssp_request(int port, const char *label) | ||
223 | { | ||
224 | return NULL; | ||
225 | } | ||
226 | static inline void pxa_ssp_free(struct ssp_device *ssp) {} | ||
227 | #endif | ||
228 | |||
211 | #endif | 229 | #endif |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 58fdef125252..d13371134c59 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -405,6 +405,7 @@ struct quota_module_name { | |||
405 | #define INIT_QUOTA_MODULE_NAMES {\ | 405 | #define INIT_QUOTA_MODULE_NAMES {\ |
406 | {QFMT_VFS_OLD, "quota_v1"},\ | 406 | {QFMT_VFS_OLD, "quota_v1"},\ |
407 | {QFMT_VFS_V0, "quota_v2"},\ | 407 | {QFMT_VFS_V0, "quota_v2"},\ |
408 | {QFMT_VFS_V1, "quota_v2"},\ | ||
408 | {0, NULL}} | 409 | {0, NULL}} |
409 | 410 | ||
410 | #endif /* _QUOTA_ */ | 411 | #endif /* _QUOTA_ */ |
diff --git a/include/linux/random.h b/include/linux/random.h index d9846088c2c5..347ce553a306 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -74,4 +74,10 @@ static inline int arch_get_random_int(unsigned int *v) | |||
74 | } | 74 | } |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | /* Pseudo random number generator from numerical recipes. */ | ||
78 | static inline u32 next_pseudo_random32(u32 seed) | ||
79 | { | ||
80 | return seed * 1664525 + 1013904223; | ||
81 | } | ||
82 | |||
77 | #endif /* _LINUX_RANDOM_H */ | 83 | #endif /* _LINUX_RANDOM_H */ |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index b7e95bf942c9..bf77dfdabef9 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -28,7 +28,8 @@ struct regmap_range_cfg; | |||
28 | enum regcache_type { | 28 | enum regcache_type { |
29 | REGCACHE_NONE, | 29 | REGCACHE_NONE, |
30 | REGCACHE_RBTREE, | 30 | REGCACHE_RBTREE, |
31 | REGCACHE_COMPRESSED | 31 | REGCACHE_COMPRESSED, |
32 | REGCACHE_FLAT, | ||
32 | }; | 33 | }; |
33 | 34 | ||
34 | /** | 35 | /** |
@@ -127,7 +128,18 @@ typedef void (*regmap_unlock)(void *); | |||
127 | * @lock_arg: this field is passed as the only argument of lock/unlock | 128 | * @lock_arg: this field is passed as the only argument of lock/unlock |
128 | * functions (ignored in case regular lock/unlock functions | 129 | * functions (ignored in case regular lock/unlock functions |
129 | * are not overridden). | 130 | * are not overridden). |
130 | * | 131 | * @reg_read: Optional callback that if filled will be used to perform |
132 | * all the reads from the registers. Should only be provided for | ||
133 | * devices whos read operation cannot be represented as a simple read | ||
134 | * operation on a bus such as SPI, I2C, etc. Most of the devices do | ||
135 | * not need this. | ||
136 | * @reg_write: Same as above for writing. | ||
137 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex | ||
138 | * to perform locking. This field is ignored if custom lock/unlock | ||
139 | * functions are used (see fields lock/unlock of struct regmap_config). | ||
140 | * This field is a duplicate of a similar file in | ||
141 | * 'struct regmap_bus' and serves exact same purpose. | ||
142 | * Use it only for "no-bus" cases. | ||
131 | * @max_register: Optional, specifies the maximum valid register index. | 143 | * @max_register: Optional, specifies the maximum valid register index. |
132 | * @wr_table: Optional, points to a struct regmap_access_table specifying | 144 | * @wr_table: Optional, points to a struct regmap_access_table specifying |
133 | * valid ranges for write access. | 145 | * valid ranges for write access. |
@@ -177,6 +189,11 @@ struct regmap_config { | |||
177 | regmap_unlock unlock; | 189 | regmap_unlock unlock; |
178 | void *lock_arg; | 190 | void *lock_arg; |
179 | 191 | ||
192 | int (*reg_read)(void *context, unsigned int reg, unsigned int *val); | ||
193 | int (*reg_write)(void *context, unsigned int reg, unsigned int val); | ||
194 | |||
195 | bool fast_io; | ||
196 | |||
180 | unsigned int max_register; | 197 | unsigned int max_register; |
181 | const struct regmap_access_table *wr_table; | 198 | const struct regmap_access_table *wr_table; |
182 | const struct regmap_access_table *rd_table; | 199 | const struct regmap_access_table *rd_table; |
@@ -235,14 +252,21 @@ struct regmap_range_cfg { | |||
235 | unsigned int window_len; | 252 | unsigned int window_len; |
236 | }; | 253 | }; |
237 | 254 | ||
255 | struct regmap_async; | ||
256 | |||
238 | typedef int (*regmap_hw_write)(void *context, const void *data, | 257 | typedef int (*regmap_hw_write)(void *context, const void *data, |
239 | size_t count); | 258 | size_t count); |
240 | typedef int (*regmap_hw_gather_write)(void *context, | 259 | typedef int (*regmap_hw_gather_write)(void *context, |
241 | const void *reg, size_t reg_len, | 260 | const void *reg, size_t reg_len, |
242 | const void *val, size_t val_len); | 261 | const void *val, size_t val_len); |
262 | typedef int (*regmap_hw_async_write)(void *context, | ||
263 | const void *reg, size_t reg_len, | ||
264 | const void *val, size_t val_len, | ||
265 | struct regmap_async *async); | ||
243 | typedef int (*regmap_hw_read)(void *context, | 266 | typedef int (*regmap_hw_read)(void *context, |
244 | const void *reg_buf, size_t reg_size, | 267 | const void *reg_buf, size_t reg_size, |
245 | void *val_buf, size_t val_size); | 268 | void *val_buf, size_t val_size); |
269 | typedef struct regmap_async *(*regmap_hw_async_alloc)(void); | ||
246 | typedef void (*regmap_hw_free_context)(void *context); | 270 | typedef void (*regmap_hw_free_context)(void *context); |
247 | 271 | ||
248 | /** | 272 | /** |
@@ -255,8 +279,11 @@ typedef void (*regmap_hw_free_context)(void *context); | |||
255 | * @write: Write operation. | 279 | * @write: Write operation. |
256 | * @gather_write: Write operation with split register/value, return -ENOTSUPP | 280 | * @gather_write: Write operation with split register/value, return -ENOTSUPP |
257 | * if not implemented on a given device. | 281 | * if not implemented on a given device. |
282 | * @async_write: Write operation which completes asynchronously, optional and | ||
283 | * must serialise with respect to non-async I/O. | ||
258 | * @read: Read operation. Data is returned in the buffer used to transmit | 284 | * @read: Read operation. Data is returned in the buffer used to transmit |
259 | * data. | 285 | * data. |
286 | * @async_alloc: Allocate a regmap_async() structure. | ||
260 | * @read_flag_mask: Mask to be set in the top byte of the register when doing | 287 | * @read_flag_mask: Mask to be set in the top byte of the register when doing |
261 | * a read. | 288 | * a read. |
262 | * @reg_format_endian_default: Default endianness for formatted register | 289 | * @reg_format_endian_default: Default endianness for formatted register |
@@ -265,13 +292,16 @@ typedef void (*regmap_hw_free_context)(void *context); | |||
265 | * @val_format_endian_default: Default endianness for formatted register | 292 | * @val_format_endian_default: Default endianness for formatted register |
266 | * values. Used when the regmap_config specifies DEFAULT. If this is | 293 | * values. Used when the regmap_config specifies DEFAULT. If this is |
267 | * DEFAULT, BIG is assumed. | 294 | * DEFAULT, BIG is assumed. |
295 | * @async_size: Size of struct used for async work. | ||
268 | */ | 296 | */ |
269 | struct regmap_bus { | 297 | struct regmap_bus { |
270 | bool fast_io; | 298 | bool fast_io; |
271 | regmap_hw_write write; | 299 | regmap_hw_write write; |
272 | regmap_hw_gather_write gather_write; | 300 | regmap_hw_gather_write gather_write; |
301 | regmap_hw_async_write async_write; | ||
273 | regmap_hw_read read; | 302 | regmap_hw_read read; |
274 | regmap_hw_free_context free_context; | 303 | regmap_hw_free_context free_context; |
304 | regmap_hw_async_alloc async_alloc; | ||
275 | u8 read_flag_mask; | 305 | u8 read_flag_mask; |
276 | enum regmap_endian reg_format_endian_default; | 306 | enum regmap_endian reg_format_endian_default; |
277 | enum regmap_endian val_format_endian_default; | 307 | enum regmap_endian val_format_endian_default; |
@@ -285,9 +315,9 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, | |||
285 | const struct regmap_config *config); | 315 | const struct regmap_config *config); |
286 | struct regmap *regmap_init_spi(struct spi_device *dev, | 316 | struct regmap *regmap_init_spi(struct spi_device *dev, |
287 | const struct regmap_config *config); | 317 | const struct regmap_config *config); |
288 | struct regmap *regmap_init_mmio(struct device *dev, | 318 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
289 | void __iomem *regs, | 319 | void __iomem *regs, |
290 | const struct regmap_config *config); | 320 | const struct regmap_config *config); |
291 | 321 | ||
292 | struct regmap *devm_regmap_init(struct device *dev, | 322 | struct regmap *devm_regmap_init(struct device *dev, |
293 | const struct regmap_bus *bus, | 323 | const struct regmap_bus *bus, |
@@ -297,9 +327,44 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, | |||
297 | const struct regmap_config *config); | 327 | const struct regmap_config *config); |
298 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, | 328 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, |
299 | const struct regmap_config *config); | 329 | const struct regmap_config *config); |
300 | struct regmap *devm_regmap_init_mmio(struct device *dev, | 330 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
301 | void __iomem *regs, | 331 | void __iomem *regs, |
302 | const struct regmap_config *config); | 332 | const struct regmap_config *config); |
333 | |||
334 | /** | ||
335 | * regmap_init_mmio(): Initialise register map | ||
336 | * | ||
337 | * @dev: Device that will be interacted with | ||
338 | * @regs: Pointer to memory-mapped IO region | ||
339 | * @config: Configuration for register map | ||
340 | * | ||
341 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
342 | * a struct regmap. | ||
343 | */ | ||
344 | static inline struct regmap *regmap_init_mmio(struct device *dev, | ||
345 | void __iomem *regs, | ||
346 | const struct regmap_config *config) | ||
347 | { | ||
348 | return regmap_init_mmio_clk(dev, NULL, regs, config); | ||
349 | } | ||
350 | |||
351 | /** | ||
352 | * devm_regmap_init_mmio(): Initialise managed register map | ||
353 | * | ||
354 | * @dev: Device that will be interacted with | ||
355 | * @regs: Pointer to memory-mapped IO region | ||
356 | * @config: Configuration for register map | ||
357 | * | ||
358 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
359 | * to a struct regmap. The regmap will be automatically freed by the | ||
360 | * device management code. | ||
361 | */ | ||
362 | static inline struct regmap *devm_regmap_init_mmio(struct device *dev, | ||
363 | void __iomem *regs, | ||
364 | const struct regmap_config *config) | ||
365 | { | ||
366 | return devm_regmap_init_mmio_clk(dev, NULL, regs, config); | ||
367 | } | ||
303 | 368 | ||
304 | void regmap_exit(struct regmap *map); | 369 | void regmap_exit(struct regmap *map); |
305 | int regmap_reinit_cache(struct regmap *map, | 370 | int regmap_reinit_cache(struct regmap *map, |
@@ -310,6 +375,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg, | |||
310 | const void *val, size_t val_len); | 375 | const void *val, size_t val_len); |
311 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, | 376 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, |
312 | size_t val_count); | 377 | size_t val_count); |
378 | int regmap_raw_write_async(struct regmap *map, unsigned int reg, | ||
379 | const void *val, size_t val_len); | ||
313 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); | 380 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); |
314 | int regmap_raw_read(struct regmap *map, unsigned int reg, | 381 | int regmap_raw_read(struct regmap *map, unsigned int reg, |
315 | void *val, size_t val_len); | 382 | void *val, size_t val_len); |
@@ -321,6 +388,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg, | |||
321 | unsigned int mask, unsigned int val, | 388 | unsigned int mask, unsigned int val, |
322 | bool *change); | 389 | bool *change); |
323 | int regmap_get_val_bytes(struct regmap *map); | 390 | int regmap_get_val_bytes(struct regmap *map); |
391 | int regmap_async_complete(struct regmap *map); | ||
324 | 392 | ||
325 | int regcache_sync(struct regmap *map); | 393 | int regcache_sync(struct regmap *map); |
326 | int regcache_sync_region(struct regmap *map, unsigned int min, | 394 | int regcache_sync_region(struct regmap *map, unsigned int min, |
@@ -381,6 +449,7 @@ struct regmap_irq_chip { | |||
381 | unsigned int wake_base; | 449 | unsigned int wake_base; |
382 | unsigned int irq_reg_stride; | 450 | unsigned int irq_reg_stride; |
383 | unsigned int mask_invert; | 451 | unsigned int mask_invert; |
452 | unsigned int wake_invert; | ||
384 | bool runtime_pm; | 453 | bool runtime_pm; |
385 | 454 | ||
386 | int num_regs; | 455 | int num_regs; |
@@ -422,6 +491,13 @@ static inline int regmap_raw_write(struct regmap *map, unsigned int reg, | |||
422 | return -EINVAL; | 491 | return -EINVAL; |
423 | } | 492 | } |
424 | 493 | ||
494 | static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg, | ||
495 | const void *val, size_t val_len) | ||
496 | { | ||
497 | WARN_ONCE(1, "regmap API is disabled"); | ||
498 | return -EINVAL; | ||
499 | } | ||
500 | |||
425 | static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, | 501 | static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, |
426 | const void *val, size_t val_count) | 502 | const void *val, size_t val_count) |
427 | { | 503 | { |
@@ -500,6 +576,11 @@ static inline void regcache_mark_dirty(struct regmap *map) | |||
500 | WARN_ONCE(1, "regmap API is disabled"); | 576 | WARN_ONCE(1, "regmap API is disabled"); |
501 | } | 577 | } |
502 | 578 | ||
579 | static inline void regmap_async_complete(struct regmap *map) | ||
580 | { | ||
581 | WARN_ONCE(1, "regmap API is disabled"); | ||
582 | } | ||
583 | |||
503 | static inline int regmap_register_patch(struct regmap *map, | 584 | static inline int regmap_register_patch(struct regmap *map, |
504 | const struct reg_default *regs, | 585 | const struct reg_default *regs, |
505 | int num_regs) | 586 | int num_regs) |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d10bb0f39c5e..23070fd83872 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -193,6 +193,10 @@ enum regulator_type { | |||
193 | * | 193 | * |
194 | * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_ | 194 | * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_ |
195 | * @vsel_mask: Mask for register bitfield used for selector | 195 | * @vsel_mask: Mask for register bitfield used for selector |
196 | * @apply_reg: Register for initiate voltage change on the output when | ||
197 | * using regulator_set_voltage_sel_regmap | ||
198 | * @apply_bit: Register bitfield used for initiate voltage change on the | ||
199 | * output when using regulator_set_voltage_sel_regmap | ||
196 | * @enable_reg: Register for control when using regmap enable/disable ops | 200 | * @enable_reg: Register for control when using regmap enable/disable ops |
197 | * @enable_mask: Mask for control when using regmap enable/disable ops | 201 | * @enable_mask: Mask for control when using regmap enable/disable ops |
198 | * | 202 | * |
@@ -218,6 +222,8 @@ struct regulator_desc { | |||
218 | 222 | ||
219 | unsigned int vsel_reg; | 223 | unsigned int vsel_reg; |
220 | unsigned int vsel_mask; | 224 | unsigned int vsel_mask; |
225 | unsigned int apply_reg; | ||
226 | unsigned int apply_bit; | ||
221 | unsigned int enable_reg; | 227 | unsigned int enable_reg; |
222 | unsigned int enable_mask; | 228 | unsigned int enable_mask; |
223 | unsigned int bypass_reg; | 229 | unsigned int bypass_reg; |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index c20635c527a9..6dacb93a6d94 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -123,7 +123,7 @@ static inline void anon_vma_lock_write(struct anon_vma *anon_vma) | |||
123 | down_write(&anon_vma->root->rwsem); | 123 | down_write(&anon_vma->root->rwsem); |
124 | } | 124 | } |
125 | 125 | ||
126 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) | 126 | static inline void anon_vma_unlock_write(struct anon_vma *anon_vma) |
127 | { | 127 | { |
128 | up_write(&anon_vma->root->rwsem); | 128 | up_write(&anon_vma->root->rwsem); |
129 | } | 129 | } |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 11d05f9fe8b6..580b24c8b8ca 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -149,7 +149,7 @@ extern int rtc_initialize_alarm(struct rtc_device *rtc, | |||
149 | extern void rtc_update_irq(struct rtc_device *rtc, | 149 | extern void rtc_update_irq(struct rtc_device *rtc, |
150 | unsigned long num, unsigned long events); | 150 | unsigned long num, unsigned long events); |
151 | 151 | ||
152 | extern struct rtc_device *rtc_class_open(char *name); | 152 | extern struct rtc_device *rtc_class_open(const char *name); |
153 | extern void rtc_class_close(struct rtc_device *rtc); | 153 | extern void rtc_class_close(struct rtc_device *rtc); |
154 | 154 | ||
155 | extern int rtc_irq_register(struct rtc_device *rtc, | 155 | extern int rtc_irq_register(struct rtc_device *rtc, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index f9ca237df7e8..6853bf947fde 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -51,6 +51,7 @@ struct sched_param { | |||
51 | #include <linux/cred.h> | 51 | #include <linux/cred.h> |
52 | #include <linux/llist.h> | 52 | #include <linux/llist.h> |
53 | #include <linux/uidgid.h> | 53 | #include <linux/uidgid.h> |
54 | #include <linux/gfp.h> | ||
54 | 55 | ||
55 | #include <asm/processor.h> | 56 | #include <asm/processor.h> |
56 | 57 | ||
@@ -1790,6 +1791,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
1790 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1791 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1791 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1792 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
1792 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1793 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1794 | #define PF_MEMALLOC_NOIO 0x00080000 /* Allocating memory without IO involved */ | ||
1793 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1795 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1794 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1796 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1795 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1797 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
@@ -1827,6 +1829,26 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
1827 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) | 1829 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) |
1828 | #define used_math() tsk_used_math(current) | 1830 | #define used_math() tsk_used_math(current) |
1829 | 1831 | ||
1832 | /* __GFP_IO isn't allowed if PF_MEMALLOC_NOIO is set in current->flags */ | ||
1833 | static inline gfp_t memalloc_noio_flags(gfp_t flags) | ||
1834 | { | ||
1835 | if (unlikely(current->flags & PF_MEMALLOC_NOIO)) | ||
1836 | flags &= ~__GFP_IO; | ||
1837 | return flags; | ||
1838 | } | ||
1839 | |||
1840 | static inline unsigned int memalloc_noio_save(void) | ||
1841 | { | ||
1842 | unsigned int flags = current->flags & PF_MEMALLOC_NOIO; | ||
1843 | current->flags |= PF_MEMALLOC_NOIO; | ||
1844 | return flags; | ||
1845 | } | ||
1846 | |||
1847 | static inline void memalloc_noio_restore(unsigned int flags) | ||
1848 | { | ||
1849 | current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; | ||
1850 | } | ||
1851 | |||
1830 | /* | 1852 | /* |
1831 | * task->jobctl flags | 1853 | * task->jobctl flags |
1832 | */ | 1854 | */ |
@@ -2159,7 +2181,6 @@ extern struct sigqueue *sigqueue_alloc(void); | |||
2159 | extern void sigqueue_free(struct sigqueue *); | 2181 | extern void sigqueue_free(struct sigqueue *); |
2160 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); | 2182 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); |
2161 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | 2183 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
2162 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); | ||
2163 | 2184 | ||
2164 | static inline void restore_saved_sigmask(void) | 2185 | static inline void restore_saved_sigmask(void) |
2165 | { | 2186 | { |
@@ -2205,6 +2226,17 @@ static inline int sas_ss_flags(unsigned long sp) | |||
2205 | : on_sig_stack(sp) ? SS_ONSTACK : 0); | 2226 | : on_sig_stack(sp) ? SS_ONSTACK : 0); |
2206 | } | 2227 | } |
2207 | 2228 | ||
2229 | static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig) | ||
2230 | { | ||
2231 | if (unlikely((ksig->ka.sa.sa_flags & SA_ONSTACK)) && ! sas_ss_flags(sp)) | ||
2232 | #ifdef CONFIG_STACK_GROWSUP | ||
2233 | return current->sas_ss_sp; | ||
2234 | #else | ||
2235 | return current->sas_ss_sp + current->sas_ss_size; | ||
2236 | #endif | ||
2237 | return sp; | ||
2238 | } | ||
2239 | |||
2208 | /* | 2240 | /* |
2209 | * Routines for handling mm_structs | 2241 | * Routines for handling mm_structs |
2210 | */ | 2242 | */ |
@@ -2658,7 +2690,10 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask); | |||
2658 | extern struct task_group root_task_group; | 2690 | extern struct task_group root_task_group; |
2659 | 2691 | ||
2660 | extern struct task_group *sched_create_group(struct task_group *parent); | 2692 | extern struct task_group *sched_create_group(struct task_group *parent); |
2693 | extern void sched_online_group(struct task_group *tg, | ||
2694 | struct task_group *parent); | ||
2661 | extern void sched_destroy_group(struct task_group *tg); | 2695 | extern void sched_destroy_group(struct task_group *tg); |
2696 | extern void sched_offline_group(struct task_group *tg); | ||
2662 | extern void sched_move_task(struct task_struct *tsk); | 2697 | extern void sched_move_task(struct task_struct *tsk); |
2663 | #ifdef CONFIG_FAIR_GROUP_SCHED | 2698 | #ifdef CONFIG_FAIR_GROUP_SCHED |
2664 | extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); | 2699 | extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 600060e25ec6..18299057402f 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -30,92 +30,12 @@ | |||
30 | #include <linux/preempt.h> | 30 | #include <linux/preempt.h> |
31 | #include <asm/processor.h> | 31 | #include <asm/processor.h> |
32 | 32 | ||
33 | typedef struct { | ||
34 | unsigned sequence; | ||
35 | spinlock_t lock; | ||
36 | } seqlock_t; | ||
37 | |||
38 | /* | ||
39 | * These macros triggered gcc-3.x compile-time problems. We think these are | ||
40 | * OK now. Be cautious. | ||
41 | */ | ||
42 | #define __SEQLOCK_UNLOCKED(lockname) \ | ||
43 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } | ||
44 | |||
45 | #define seqlock_init(x) \ | ||
46 | do { \ | ||
47 | (x)->sequence = 0; \ | ||
48 | spin_lock_init(&(x)->lock); \ | ||
49 | } while (0) | ||
50 | |||
51 | #define DEFINE_SEQLOCK(x) \ | ||
52 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | ||
53 | |||
54 | /* Lock out other writers and update the count. | ||
55 | * Acts like a normal spin_lock/unlock. | ||
56 | * Don't need preempt_disable() because that is in the spin_lock already. | ||
57 | */ | ||
58 | static inline void write_seqlock(seqlock_t *sl) | ||
59 | { | ||
60 | spin_lock(&sl->lock); | ||
61 | ++sl->sequence; | ||
62 | smp_wmb(); | ||
63 | } | ||
64 | |||
65 | static inline void write_sequnlock(seqlock_t *sl) | ||
66 | { | ||
67 | smp_wmb(); | ||
68 | sl->sequence++; | ||
69 | spin_unlock(&sl->lock); | ||
70 | } | ||
71 | |||
72 | static inline int write_tryseqlock(seqlock_t *sl) | ||
73 | { | ||
74 | int ret = spin_trylock(&sl->lock); | ||
75 | |||
76 | if (ret) { | ||
77 | ++sl->sequence; | ||
78 | smp_wmb(); | ||
79 | } | ||
80 | return ret; | ||
81 | } | ||
82 | |||
83 | /* Start of read calculation -- fetch last complete writer token */ | ||
84 | static __always_inline unsigned read_seqbegin(const seqlock_t *sl) | ||
85 | { | ||
86 | unsigned ret; | ||
87 | |||
88 | repeat: | ||
89 | ret = ACCESS_ONCE(sl->sequence); | ||
90 | if (unlikely(ret & 1)) { | ||
91 | cpu_relax(); | ||
92 | goto repeat; | ||
93 | } | ||
94 | smp_rmb(); | ||
95 | |||
96 | return ret; | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * Test if reader processed invalid data. | ||
101 | * | ||
102 | * If sequence value changed then writer changed data while in section. | ||
103 | */ | ||
104 | static __always_inline int read_seqretry(const seqlock_t *sl, unsigned start) | ||
105 | { | ||
106 | smp_rmb(); | ||
107 | |||
108 | return unlikely(sl->sequence != start); | ||
109 | } | ||
110 | |||
111 | |||
112 | /* | 33 | /* |
113 | * Version using sequence counter only. | 34 | * Version using sequence counter only. |
114 | * This can be used when code has its own mutex protecting the | 35 | * This can be used when code has its own mutex protecting the |
115 | * updating starting before the write_seqcountbeqin() and ending | 36 | * updating starting before the write_seqcountbeqin() and ending |
116 | * after the write_seqcount_end(). | 37 | * after the write_seqcount_end(). |
117 | */ | 38 | */ |
118 | |||
119 | typedef struct seqcount { | 39 | typedef struct seqcount { |
120 | unsigned sequence; | 40 | unsigned sequence; |
121 | } seqcount_t; | 41 | } seqcount_t; |
@@ -218,7 +138,6 @@ static inline int __read_seqcount_retry(const seqcount_t *s, unsigned start) | |||
218 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | 138 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) |
219 | { | 139 | { |
220 | smp_rmb(); | 140 | smp_rmb(); |
221 | |||
222 | return __read_seqcount_retry(s, start); | 141 | return __read_seqcount_retry(s, start); |
223 | } | 142 | } |
224 | 143 | ||
@@ -252,31 +171,101 @@ static inline void write_seqcount_barrier(seqcount_t *s) | |||
252 | s->sequence+=2; | 171 | s->sequence+=2; |
253 | } | 172 | } |
254 | 173 | ||
174 | typedef struct { | ||
175 | struct seqcount seqcount; | ||
176 | spinlock_t lock; | ||
177 | } seqlock_t; | ||
178 | |||
255 | /* | 179 | /* |
256 | * Possible sw/hw IRQ protected versions of the interfaces. | 180 | * These macros triggered gcc-3.x compile-time problems. We think these are |
181 | * OK now. Be cautious. | ||
257 | */ | 182 | */ |
258 | #define write_seqlock_irqsave(lock, flags) \ | 183 | #define __SEQLOCK_UNLOCKED(lockname) \ |
259 | do { local_irq_save(flags); write_seqlock(lock); } while (0) | 184 | { \ |
260 | #define write_seqlock_irq(lock) \ | 185 | .seqcount = SEQCNT_ZERO, \ |
261 | do { local_irq_disable(); write_seqlock(lock); } while (0) | 186 | .lock = __SPIN_LOCK_UNLOCKED(lockname) \ |
262 | #define write_seqlock_bh(lock) \ | 187 | } |
263 | do { local_bh_disable(); write_seqlock(lock); } while (0) | 188 | |
189 | #define seqlock_init(x) \ | ||
190 | do { \ | ||
191 | seqcount_init(&(x)->seqcount); \ | ||
192 | spin_lock_init(&(x)->lock); \ | ||
193 | } while (0) | ||
264 | 194 | ||
265 | #define write_sequnlock_irqrestore(lock, flags) \ | 195 | #define DEFINE_SEQLOCK(x) \ |
266 | do { write_sequnlock(lock); local_irq_restore(flags); } while(0) | 196 | seqlock_t x = __SEQLOCK_UNLOCKED(x) |
267 | #define write_sequnlock_irq(lock) \ | ||
268 | do { write_sequnlock(lock); local_irq_enable(); } while(0) | ||
269 | #define write_sequnlock_bh(lock) \ | ||
270 | do { write_sequnlock(lock); local_bh_enable(); } while(0) | ||
271 | 197 | ||
272 | #define read_seqbegin_irqsave(lock, flags) \ | 198 | /* |
273 | ({ local_irq_save(flags); read_seqbegin(lock); }) | 199 | * Read side functions for starting and finalizing a read side section. |
200 | */ | ||
201 | static inline unsigned read_seqbegin(const seqlock_t *sl) | ||
202 | { | ||
203 | return read_seqcount_begin(&sl->seqcount); | ||
204 | } | ||
274 | 205 | ||
275 | #define read_seqretry_irqrestore(lock, iv, flags) \ | 206 | static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) |
276 | ({ \ | 207 | { |
277 | int ret = read_seqretry(lock, iv); \ | 208 | return read_seqcount_retry(&sl->seqcount, start); |
278 | local_irq_restore(flags); \ | 209 | } |
279 | ret; \ | 210 | |
280 | }) | 211 | /* |
212 | * Lock out other writers and update the count. | ||
213 | * Acts like a normal spin_lock/unlock. | ||
214 | * Don't need preempt_disable() because that is in the spin_lock already. | ||
215 | */ | ||
216 | static inline void write_seqlock(seqlock_t *sl) | ||
217 | { | ||
218 | spin_lock(&sl->lock); | ||
219 | write_seqcount_begin(&sl->seqcount); | ||
220 | } | ||
221 | |||
222 | static inline void write_sequnlock(seqlock_t *sl) | ||
223 | { | ||
224 | write_seqcount_end(&sl->seqcount); | ||
225 | spin_unlock(&sl->lock); | ||
226 | } | ||
227 | |||
228 | static inline void write_seqlock_bh(seqlock_t *sl) | ||
229 | { | ||
230 | spin_lock_bh(&sl->lock); | ||
231 | write_seqcount_begin(&sl->seqcount); | ||
232 | } | ||
233 | |||
234 | static inline void write_sequnlock_bh(seqlock_t *sl) | ||
235 | { | ||
236 | write_seqcount_end(&sl->seqcount); | ||
237 | spin_unlock_bh(&sl->lock); | ||
238 | } | ||
239 | |||
240 | static inline void write_seqlock_irq(seqlock_t *sl) | ||
241 | { | ||
242 | spin_lock_irq(&sl->lock); | ||
243 | write_seqcount_begin(&sl->seqcount); | ||
244 | } | ||
245 | |||
246 | static inline void write_sequnlock_irq(seqlock_t *sl) | ||
247 | { | ||
248 | write_seqcount_end(&sl->seqcount); | ||
249 | spin_unlock_irq(&sl->lock); | ||
250 | } | ||
251 | |||
252 | static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) | ||
253 | { | ||
254 | unsigned long flags; | ||
255 | |||
256 | spin_lock_irqsave(&sl->lock, flags); | ||
257 | write_seqcount_begin(&sl->seqcount); | ||
258 | return flags; | ||
259 | } | ||
260 | |||
261 | #define write_seqlock_irqsave(lock, flags) \ | ||
262 | do { flags = __write_seqlock_irqsave(lock); } while (0) | ||
263 | |||
264 | static inline void | ||
265 | write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags) | ||
266 | { | ||
267 | write_seqcount_end(&sl->seqcount); | ||
268 | spin_unlock_irqrestore(&sl->lock, flags); | ||
269 | } | ||
281 | 270 | ||
282 | #endif /* __LINUX_SEQLOCK_H */ | 271 | #endif /* __LINUX_SEQLOCK_H */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index c490d20b3fb8..af47a8af6024 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -59,6 +59,8 @@ enum { | |||
59 | PLAT8250_DEV_SM501, | 59 | PLAT8250_DEV_SM501, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | struct uart_8250_dma; | ||
63 | |||
62 | /* | 64 | /* |
63 | * This should be used by drivers which want to register | 65 | * This should be used by drivers which want to register |
64 | * their own 8250 ports without registering their own | 66 | * their own 8250 ports without registering their own |
@@ -91,6 +93,8 @@ struct uart_8250_port { | |||
91 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA | 93 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA |
92 | unsigned char msr_saved_flags; | 94 | unsigned char msr_saved_flags; |
93 | 95 | ||
96 | struct uart_8250_dma *dma; | ||
97 | |||
94 | /* 8250 specific callbacks */ | 98 | /* 8250 specific callbacks */ |
95 | int (*dl_read)(struct uart_8250_port *); | 99 | int (*dl_read)(struct uart_8250_port *); |
96 | void (*dl_write)(struct uart_8250_port *, int); | 100 | void (*dl_write)(struct uart_8250_port *, int); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index c6690a2a27fb..87d4bbc773fc 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
31 | #include <linux/sysrq.h> | 31 | #include <linux/sysrq.h> |
32 | #include <linux/pps_kernel.h> | ||
33 | #include <uapi/linux/serial_core.h> | 32 | #include <uapi/linux/serial_core.h> |
34 | 33 | ||
35 | struct uart_port; | 34 | struct uart_port; |
@@ -37,8 +36,8 @@ struct serial_struct; | |||
37 | struct device; | 36 | struct device; |
38 | 37 | ||
39 | /* | 38 | /* |
40 | * This structure describes all the operations that can be | 39 | * This structure describes all the operations that can be done on the |
41 | * done on the physical hardware. | 40 | * physical hardware. See Documentation/serial/driver for details. |
42 | */ | 41 | */ |
43 | struct uart_ops { | 42 | struct uart_ops { |
44 | unsigned int (*tx_empty)(struct uart_port *); | 43 | unsigned int (*tx_empty)(struct uart_port *); |
@@ -65,7 +64,7 @@ struct uart_ops { | |||
65 | /* | 64 | /* |
66 | * Return a string describing the type of the port | 65 | * Return a string describing the type of the port |
67 | */ | 66 | */ |
68 | const char *(*type)(struct uart_port *); | 67 | const char *(*type)(struct uart_port *); |
69 | 68 | ||
70 | /* | 69 | /* |
71 | * Release IO and memory resources used by the port. | 70 | * Release IO and memory resources used by the port. |
@@ -83,7 +82,7 @@ struct uart_ops { | |||
83 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); | 82 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); |
84 | #ifdef CONFIG_CONSOLE_POLL | 83 | #ifdef CONFIG_CONSOLE_POLL |
85 | int (*poll_init)(struct uart_port *); | 84 | int (*poll_init)(struct uart_port *); |
86 | void (*poll_put_char)(struct uart_port *, unsigned char); | 85 | void (*poll_put_char)(struct uart_port *, unsigned char); |
87 | int (*poll_get_char)(struct uart_port *); | 86 | int (*poll_get_char)(struct uart_port *); |
88 | #endif | 87 | #endif |
89 | }; | 88 | }; |
@@ -134,9 +133,8 @@ struct uart_port { | |||
134 | #define UPIO_HUB6 (1) | 133 | #define UPIO_HUB6 (1) |
135 | #define UPIO_MEM (2) | 134 | #define UPIO_MEM (2) |
136 | #define UPIO_MEM32 (3) | 135 | #define UPIO_MEM32 (3) |
137 | #define UPIO_AU (4) /* Au1x00 type IO */ | 136 | #define UPIO_AU (4) /* Au1x00 and RT288x type IO */ |
138 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | 137 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ |
139 | #define UPIO_RM9000 (6) /* RM9000 type IO */ | ||
140 | 138 | ||
141 | unsigned int read_status_mask; /* driver specific */ | 139 | unsigned int read_status_mask; /* driver specific */ |
142 | unsigned int ignore_status_mask; /* driver specific */ | 140 | unsigned int ignore_status_mask; /* driver specific */ |
@@ -208,13 +206,25 @@ static inline void serial_port_out(struct uart_port *up, int offset, int value) | |||
208 | up->serial_out(up, offset, value); | 206 | up->serial_out(up, offset, value); |
209 | } | 207 | } |
210 | 208 | ||
209 | /** | ||
210 | * enum uart_pm_state - power states for UARTs | ||
211 | * @UART_PM_STATE_ON: UART is powered, up and operational | ||
212 | * @UART_PM_STATE_OFF: UART is powered off | ||
213 | * @UART_PM_STATE_UNDEFINED: sentinel | ||
214 | */ | ||
215 | enum uart_pm_state { | ||
216 | UART_PM_STATE_ON = 0, | ||
217 | UART_PM_STATE_OFF = 3, /* number taken from ACPI */ | ||
218 | UART_PM_STATE_UNDEFINED, | ||
219 | }; | ||
220 | |||
211 | /* | 221 | /* |
212 | * This is the state information which is persistent across opens. | 222 | * This is the state information which is persistent across opens. |
213 | */ | 223 | */ |
214 | struct uart_state { | 224 | struct uart_state { |
215 | struct tty_port port; | 225 | struct tty_port port; |
216 | 226 | ||
217 | int pm_state; | 227 | enum uart_pm_state pm_state; |
218 | struct circ_buf xmit; | 228 | struct circ_buf xmit; |
219 | 229 | ||
220 | struct uart_port *uart_port; | 230 | struct uart_port *uart_port; |
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h deleted file mode 100644 index c19a0925829a..000000000000 --- a/include/linux/sh_pfc.h +++ /dev/null | |||
@@ -1,236 +0,0 @@ | |||
1 | /* | ||
2 | * SuperH Pin Function Controller Support | ||
3 | * | ||
4 | * Copyright (c) 2008 Magnus Damm | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef __SH_PFC_H | ||
12 | #define __SH_PFC_H | ||
13 | |||
14 | #include <linux/stringify.h> | ||
15 | #include <asm-generic/gpio.h> | ||
16 | |||
17 | typedef unsigned short pinmux_enum_t; | ||
18 | typedef unsigned short pinmux_flag_t; | ||
19 | |||
20 | enum { | ||
21 | PINMUX_TYPE_NONE, | ||
22 | |||
23 | PINMUX_TYPE_FUNCTION, | ||
24 | PINMUX_TYPE_GPIO, | ||
25 | PINMUX_TYPE_OUTPUT, | ||
26 | PINMUX_TYPE_INPUT, | ||
27 | PINMUX_TYPE_INPUT_PULLUP, | ||
28 | PINMUX_TYPE_INPUT_PULLDOWN, | ||
29 | |||
30 | PINMUX_FLAG_TYPE, /* must be last */ | ||
31 | }; | ||
32 | |||
33 | #define PINMUX_FLAG_DBIT_SHIFT 5 | ||
34 | #define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT) | ||
35 | #define PINMUX_FLAG_DREG_SHIFT 10 | ||
36 | #define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT) | ||
37 | |||
38 | struct pinmux_gpio { | ||
39 | pinmux_enum_t enum_id; | ||
40 | pinmux_flag_t flags; | ||
41 | const char *name; | ||
42 | }; | ||
43 | |||
44 | #define PINMUX_GPIO(gpio, data_or_mark) \ | ||
45 | [gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE } | ||
46 | |||
47 | #define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0 | ||
48 | |||
49 | struct pinmux_cfg_reg { | ||
50 | unsigned long reg, reg_width, field_width; | ||
51 | unsigned long *cnt; | ||
52 | pinmux_enum_t *enum_ids; | ||
53 | unsigned long *var_field_width; | ||
54 | }; | ||
55 | |||
56 | #define PINMUX_CFG_REG(name, r, r_width, f_width) \ | ||
57 | .reg = r, .reg_width = r_width, .field_width = f_width, \ | ||
58 | .cnt = (unsigned long [r_width / f_width]) {}, \ | ||
59 | .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) | ||
60 | |||
61 | #define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \ | ||
62 | .reg = r, .reg_width = r_width, \ | ||
63 | .cnt = (unsigned long [r_width]) {}, \ | ||
64 | .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \ | ||
65 | .enum_ids = (pinmux_enum_t []) | ||
66 | |||
67 | struct pinmux_data_reg { | ||
68 | unsigned long reg, reg_width, reg_shadow; | ||
69 | pinmux_enum_t *enum_ids; | ||
70 | void __iomem *mapped_reg; | ||
71 | }; | ||
72 | |||
73 | #define PINMUX_DATA_REG(name, r, r_width) \ | ||
74 | .reg = r, .reg_width = r_width, \ | ||
75 | .enum_ids = (pinmux_enum_t [r_width]) \ | ||
76 | |||
77 | struct pinmux_irq { | ||
78 | int irq; | ||
79 | pinmux_enum_t *enum_ids; | ||
80 | }; | ||
81 | |||
82 | #define PINMUX_IRQ(irq_nr, ids...) \ | ||
83 | { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } } \ | ||
84 | |||
85 | struct pinmux_range { | ||
86 | pinmux_enum_t begin; | ||
87 | pinmux_enum_t end; | ||
88 | pinmux_enum_t force; | ||
89 | }; | ||
90 | |||
91 | struct pfc_window { | ||
92 | phys_addr_t phys; | ||
93 | void __iomem *virt; | ||
94 | unsigned long size; | ||
95 | }; | ||
96 | |||
97 | struct sh_pfc { | ||
98 | char *name; | ||
99 | pinmux_enum_t reserved_id; | ||
100 | struct pinmux_range data; | ||
101 | struct pinmux_range input; | ||
102 | struct pinmux_range input_pd; | ||
103 | struct pinmux_range input_pu; | ||
104 | struct pinmux_range output; | ||
105 | struct pinmux_range mark; | ||
106 | struct pinmux_range function; | ||
107 | |||
108 | unsigned first_gpio, last_gpio; | ||
109 | |||
110 | struct pinmux_gpio *gpios; | ||
111 | struct pinmux_cfg_reg *cfg_regs; | ||
112 | struct pinmux_data_reg *data_regs; | ||
113 | |||
114 | pinmux_enum_t *gpio_data; | ||
115 | unsigned int gpio_data_size; | ||
116 | |||
117 | struct pinmux_irq *gpio_irq; | ||
118 | unsigned int gpio_irq_size; | ||
119 | |||
120 | spinlock_t lock; | ||
121 | |||
122 | struct resource *resource; | ||
123 | unsigned int num_resources; | ||
124 | struct pfc_window *window; | ||
125 | |||
126 | unsigned long unlock_reg; | ||
127 | }; | ||
128 | |||
129 | /* XXX compat for now */ | ||
130 | #define pinmux_info sh_pfc | ||
131 | |||
132 | /* drivers/sh/pfc/gpio.c */ | ||
133 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); | ||
134 | |||
135 | /* drivers/sh/pfc/pinctrl.c */ | ||
136 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); | ||
137 | |||
138 | /* drivers/sh/pfc/core.c */ | ||
139 | int register_sh_pfc(struct sh_pfc *pfc); | ||
140 | |||
141 | int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos); | ||
142 | void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, | ||
143 | unsigned long value); | ||
144 | int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio, | ||
145 | struct pinmux_data_reg **drp, int *bitp); | ||
146 | int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos, | ||
147 | pinmux_enum_t *enum_idp); | ||
148 | int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, | ||
149 | int cfg_mode); | ||
150 | |||
151 | /* xxx */ | ||
152 | static inline int register_pinmux(struct pinmux_info *pip) | ||
153 | { | ||
154 | struct sh_pfc *pfc = pip; | ||
155 | return register_sh_pfc(pfc); | ||
156 | } | ||
157 | |||
158 | enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE }; | ||
159 | |||
160 | /* helper macro for port */ | ||
161 | #define PORT_1(fn, pfx, sfx) fn(pfx, sfx) | ||
162 | |||
163 | #define PORT_10(fn, pfx, sfx) \ | ||
164 | PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \ | ||
165 | PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \ | ||
166 | PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \ | ||
167 | PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \ | ||
168 | PORT_1(fn, pfx##8, sfx), PORT_1(fn, pfx##9, sfx) | ||
169 | |||
170 | #define PORT_90(fn, pfx, sfx) \ | ||
171 | PORT_10(fn, pfx##1, sfx), PORT_10(fn, pfx##2, sfx), \ | ||
172 | PORT_10(fn, pfx##3, sfx), PORT_10(fn, pfx##4, sfx), \ | ||
173 | PORT_10(fn, pfx##5, sfx), PORT_10(fn, pfx##6, sfx), \ | ||
174 | PORT_10(fn, pfx##7, sfx), PORT_10(fn, pfx##8, sfx), \ | ||
175 | PORT_10(fn, pfx##9, sfx) | ||
176 | |||
177 | #define _PORT_ALL(pfx, sfx) pfx##_##sfx | ||
178 | #define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA) | ||
179 | #define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str) | ||
180 | #define GPIO_PORT_ALL() CPU_ALL_PORT(_GPIO_PORT, , unused) | ||
181 | #define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK) | ||
182 | |||
183 | /* helper macro for pinmux_enum_t */ | ||
184 | #define PORT_DATA_I(nr) \ | ||
185 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN) | ||
186 | |||
187 | #define PORT_DATA_I_PD(nr) \ | ||
188 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
189 | PORT##nr##_IN, PORT##nr##_IN_PD) | ||
190 | |||
191 | #define PORT_DATA_I_PU(nr) \ | ||
192 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
193 | PORT##nr##_IN, PORT##nr##_IN_PU) | ||
194 | |||
195 | #define PORT_DATA_I_PU_PD(nr) \ | ||
196 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
197 | PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU) | ||
198 | |||
199 | #define PORT_DATA_O(nr) \ | ||
200 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT) | ||
201 | |||
202 | #define PORT_DATA_IO(nr) \ | ||
203 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
204 | PORT##nr##_IN) | ||
205 | |||
206 | #define PORT_DATA_IO_PD(nr) \ | ||
207 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
208 | PORT##nr##_IN, PORT##nr##_IN_PD) | ||
209 | |||
210 | #define PORT_DATA_IO_PU(nr) \ | ||
211 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
212 | PORT##nr##_IN, PORT##nr##_IN_PU) | ||
213 | |||
214 | #define PORT_DATA_IO_PU_PD(nr) \ | ||
215 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
216 | PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU) | ||
217 | |||
218 | /* helper macro for top 4 bits in PORTnCR */ | ||
219 | #define _PCRH(in, in_pd, in_pu, out) \ | ||
220 | 0, (out), (in), 0, \ | ||
221 | 0, 0, 0, 0, \ | ||
222 | 0, 0, (in_pd), 0, \ | ||
223 | 0, 0, (in_pu), 0 | ||
224 | |||
225 | #define PORTCR(nr, reg) \ | ||
226 | { \ | ||
227 | PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \ | ||
228 | _PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \ | ||
229 | PORT##nr##_IN_PU, PORT##nr##_OUT), \ | ||
230 | PORT##nr##_FN0, PORT##nr##_FN1, \ | ||
231 | PORT##nr##_FN2, PORT##nr##_FN3, \ | ||
232 | PORT##nr##_FN4, PORT##nr##_FN5, \ | ||
233 | PORT##nr##_FN6, PORT##nr##_FN7 } \ | ||
234 | } | ||
235 | |||
236 | #endif /* __SH_PFC_H */ | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a89ffc48466..a2dcb94ea49d 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -241,9 +241,6 @@ extern int do_send_sig_info(int sig, struct siginfo *info, | |||
241 | struct task_struct *p, bool group); | 241 | struct task_struct *p, bool group); |
242 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 242 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
243 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 243 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
244 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | ||
245 | siginfo_t *info); | ||
246 | extern long do_sigpending(void __user *, unsigned long); | ||
247 | extern int do_sigtimedwait(const sigset_t *, siginfo_t *, | 244 | extern int do_sigtimedwait(const sigset_t *, siginfo_t *, |
248 | const struct timespec *); | 245 | const struct timespec *); |
249 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 246 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
@@ -252,10 +249,59 @@ extern void __set_current_blocked(const sigset_t *); | |||
252 | extern int show_unhandled_signals; | 249 | extern int show_unhandled_signals; |
253 | extern int sigsuspend(sigset_t *); | 250 | extern int sigsuspend(sigset_t *); |
254 | 251 | ||
252 | struct sigaction { | ||
253 | #ifndef __ARCH_HAS_ODD_SIGACTION | ||
254 | __sighandler_t sa_handler; | ||
255 | unsigned long sa_flags; | ||
256 | #else | ||
257 | unsigned long sa_flags; | ||
258 | __sighandler_t sa_handler; | ||
259 | #endif | ||
260 | #ifdef __ARCH_HAS_SA_RESTORER | ||
261 | __sigrestore_t sa_restorer; | ||
262 | #endif | ||
263 | sigset_t sa_mask; /* mask last for extensibility */ | ||
264 | }; | ||
265 | |||
266 | struct k_sigaction { | ||
267 | struct sigaction sa; | ||
268 | #ifdef __ARCH_HAS_KA_RESTORER | ||
269 | __sigrestore_t ka_restorer; | ||
270 | #endif | ||
271 | }; | ||
272 | |||
273 | #ifdef CONFIG_OLD_SIGACTION | ||
274 | struct old_sigaction { | ||
275 | __sighandler_t sa_handler; | ||
276 | old_sigset_t sa_mask; | ||
277 | unsigned long sa_flags; | ||
278 | __sigrestore_t sa_restorer; | ||
279 | }; | ||
280 | #endif | ||
281 | |||
282 | struct ksignal { | ||
283 | struct k_sigaction ka; | ||
284 | siginfo_t info; | ||
285 | int sig; | ||
286 | }; | ||
287 | |||
255 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 288 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
289 | extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); | ||
256 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); | 290 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); |
257 | extern void exit_signals(struct task_struct *tsk); | 291 | extern void exit_signals(struct task_struct *tsk); |
258 | 292 | ||
293 | /* | ||
294 | * Eventually that'll replace get_signal_to_deliver(); macro for now, | ||
295 | * to avoid nastiness with include order. | ||
296 | */ | ||
297 | #define get_signal(ksig) \ | ||
298 | ({ \ | ||
299 | struct ksignal *p = (ksig); \ | ||
300 | p->sig = get_signal_to_deliver(&p->info, &p->ka, \ | ||
301 | signal_pt_regs(), NULL);\ | ||
302 | p->sig > 0; \ | ||
303 | }) | ||
304 | |||
259 | extern struct kmem_cache *sighand_cachep; | 305 | extern struct kmem_cache *sighand_cachep; |
260 | 306 | ||
261 | int unhandled_signal(struct task_struct *tsk, int sig); | 307 | int unhandled_signal(struct task_struct *tsk, int sig); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 320e976d5ab8..821c7f45d2a7 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -230,6 +230,13 @@ enum { | |||
230 | 230 | ||
231 | /* generate wifi status information (where possible) */ | 231 | /* generate wifi status information (where possible) */ |
232 | SKBTX_WIFI_STATUS = 1 << 4, | 232 | SKBTX_WIFI_STATUS = 1 << 4, |
233 | |||
234 | /* This indicates at least one fragment might be overwritten | ||
235 | * (as in vmsplice(), sendfile() ...) | ||
236 | * If we need to compute a TX checksum, we'll need to copy | ||
237 | * all frags to avoid possible bad checksum | ||
238 | */ | ||
239 | SKBTX_SHARED_FRAG = 1 << 5, | ||
233 | }; | 240 | }; |
234 | 241 | ||
235 | /* | 242 | /* |
@@ -307,6 +314,8 @@ enum { | |||
307 | SKB_GSO_TCPV6 = 1 << 4, | 314 | SKB_GSO_TCPV6 = 1 << 4, |
308 | 315 | ||
309 | SKB_GSO_FCOE = 1 << 5, | 316 | SKB_GSO_FCOE = 1 << 5, |
317 | |||
318 | SKB_GSO_GRE = 1 << 6, | ||
310 | }; | 319 | }; |
311 | 320 | ||
312 | #if BITS_PER_LONG > 32 | 321 | #if BITS_PER_LONG > 32 |
@@ -797,6 +806,16 @@ static inline int skb_cloned(const struct sk_buff *skb) | |||
797 | (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; | 806 | (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; |
798 | } | 807 | } |
799 | 808 | ||
809 | static inline int skb_unclone(struct sk_buff *skb, gfp_t pri) | ||
810 | { | ||
811 | might_sleep_if(pri & __GFP_WAIT); | ||
812 | |||
813 | if (skb_cloned(skb)) | ||
814 | return pskb_expand_head(skb, 0, 0, pri); | ||
815 | |||
816 | return 0; | ||
817 | } | ||
818 | |||
800 | /** | 819 | /** |
801 | * skb_header_cloned - is the header a clone | 820 | * skb_header_cloned - is the header a clone |
802 | * @skb: buffer to check | 821 | * @skb: buffer to check |
@@ -1492,6 +1511,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb, | |||
1492 | skb->inner_network_header += offset; | 1511 | skb->inner_network_header += offset; |
1493 | } | 1512 | } |
1494 | 1513 | ||
1514 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | ||
1515 | { | ||
1516 | return skb->transport_header != ~0U; | ||
1517 | } | ||
1518 | |||
1495 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1519 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
1496 | { | 1520 | { |
1497 | return skb->head + skb->transport_header; | 1521 | return skb->head + skb->transport_header; |
@@ -1580,6 +1604,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb, | |||
1580 | skb->inner_network_header = skb->data + offset; | 1604 | skb->inner_network_header = skb->data + offset; |
1581 | } | 1605 | } |
1582 | 1606 | ||
1607 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | ||
1608 | { | ||
1609 | return skb->transport_header != NULL; | ||
1610 | } | ||
1611 | |||
1583 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1612 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
1584 | { | 1613 | { |
1585 | return skb->transport_header; | 1614 | return skb->transport_header; |
@@ -1815,6 +1844,10 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
1815 | kfree_skb(skb); | 1844 | kfree_skb(skb); |
1816 | } | 1845 | } |
1817 | 1846 | ||
1847 | #define NETDEV_FRAG_PAGE_MAX_ORDER get_order(32768) | ||
1848 | #define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER) | ||
1849 | #define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE | ||
1850 | |||
1818 | extern void *netdev_alloc_frag(unsigned int fragsz); | 1851 | extern void *netdev_alloc_frag(unsigned int fragsz); |
1819 | 1852 | ||
1820 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | 1853 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, |
@@ -2191,6 +2224,19 @@ static inline int skb_linearize(struct sk_buff *skb) | |||
2191 | } | 2224 | } |
2192 | 2225 | ||
2193 | /** | 2226 | /** |
2227 | * skb_has_shared_frag - can any frag be overwritten | ||
2228 | * @skb: buffer to test | ||
2229 | * | ||
2230 | * Return true if the skb has at least one frag that might be modified | ||
2231 | * by an external entity (as in vmsplice()/sendfile()) | ||
2232 | */ | ||
2233 | static inline bool skb_has_shared_frag(const struct sk_buff *skb) | ||
2234 | { | ||
2235 | return skb_is_nonlinear(skb) && | ||
2236 | skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG; | ||
2237 | } | ||
2238 | |||
2239 | /** | ||
2194 | * skb_linearize_cow - make sure skb is linear and writable | 2240 | * skb_linearize_cow - make sure skb is linear and writable |
2195 | * @skb: buffer to process | 2241 | * @skb: buffer to process |
2196 | * | 2242 | * |
@@ -2688,6 +2734,21 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
2688 | } | 2734 | } |
2689 | #endif | 2735 | #endif |
2690 | 2736 | ||
2737 | /* Keeps track of mac header offset relative to skb->head. | ||
2738 | * It is useful for TSO of Tunneling protocol. e.g. GRE. | ||
2739 | * For non-tunnel skb it points to skb_mac_header() and for | ||
2740 | * tunnel skb it points to outer mac header. */ | ||
2741 | struct skb_gso_cb { | ||
2742 | int mac_offset; | ||
2743 | }; | ||
2744 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | ||
2745 | |||
2746 | static inline int skb_tnl_header_len(const struct sk_buff *inner_skb) | ||
2747 | { | ||
2748 | return (skb_mac_header(inner_skb) - inner_skb->head) - | ||
2749 | SKB_GSO_CB(inner_skb)->mac_offset; | ||
2750 | } | ||
2751 | |||
2691 | static inline bool skb_is_gso(const struct sk_buff *skb) | 2752 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2692 | { | 2753 | { |
2693 | return skb_shinfo(skb)->gso_size; | 2754 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index dd6f06be3c9f..3e07a7df6478 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -89,7 +89,8 @@ void kick_all_cpus_sync(void); | |||
89 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | 89 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS |
90 | void __init call_function_init(void); | 90 | void __init call_function_init(void); |
91 | void generic_smp_call_function_single_interrupt(void); | 91 | void generic_smp_call_function_single_interrupt(void); |
92 | void generic_smp_call_function_interrupt(void); | 92 | #define generic_smp_call_function_interrupt \ |
93 | generic_smp_call_function_single_interrupt | ||
93 | #else | 94 | #else |
94 | static inline void call_function_init(void) { } | 95 | static inline void call_function_init(void) { } |
95 | #endif | 96 | #endif |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 9a546ff853dc..2b9f74b0ffea 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -178,7 +178,8 @@ struct ucred { | |||
178 | #define AF_CAIF 37 /* CAIF sockets */ | 178 | #define AF_CAIF 37 /* CAIF sockets */ |
179 | #define AF_ALG 38 /* Algorithm sockets */ | 179 | #define AF_ALG 38 /* Algorithm sockets */ |
180 | #define AF_NFC 39 /* NFC sockets */ | 180 | #define AF_NFC 39 /* NFC sockets */ |
181 | #define AF_MAX 40 /* For now.. */ | 181 | #define AF_VSOCK 40 /* vSockets */ |
182 | #define AF_MAX 41 /* For now.. */ | ||
182 | 183 | ||
183 | /* Protocol families, same as address families. */ | 184 | /* Protocol families, same as address families. */ |
184 | #define PF_UNSPEC AF_UNSPEC | 185 | #define PF_UNSPEC AF_UNSPEC |
@@ -221,6 +222,7 @@ struct ucred { | |||
221 | #define PF_CAIF AF_CAIF | 222 | #define PF_CAIF AF_CAIF |
222 | #define PF_ALG AF_ALG | 223 | #define PF_ALG AF_ALG |
223 | #define PF_NFC AF_NFC | 224 | #define PF_NFC AF_NFC |
225 | #define PF_VSOCK AF_VSOCK | ||
224 | #define PF_MAX AF_MAX | 226 | #define PF_MAX AF_MAX |
225 | 227 | ||
226 | /* Maximum queue length specifiable by listen. */ | 228 | /* Maximum queue length specifiable by listen. */ |
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h index c73d1445c77e..82d5111cd0c2 100644 --- a/include/linux/spi/pxa2xx_spi.h +++ b/include/linux/spi/pxa2xx_spi.h | |||
@@ -28,6 +28,15 @@ struct pxa2xx_spi_master { | |||
28 | u32 clock_enable; | 28 | u32 clock_enable; |
29 | u16 num_chipselect; | 29 | u16 num_chipselect; |
30 | u8 enable_dma; | 30 | u8 enable_dma; |
31 | |||
32 | /* DMA engine specific config */ | ||
33 | int rx_chan_id; | ||
34 | int tx_chan_id; | ||
35 | int rx_slave_id; | ||
36 | int tx_slave_id; | ||
37 | |||
38 | /* For non-PXA arches */ | ||
39 | struct ssp_device ssp; | ||
31 | }; | 40 | }; |
32 | 41 | ||
33 | /* spi_board_info.controller_data for SPI slave devices, | 42 | /* spi_board_info.controller_data for SPI slave devices, |
@@ -35,6 +44,7 @@ struct pxa2xx_spi_master { | |||
35 | */ | 44 | */ |
36 | struct pxa2xx_spi_chip { | 45 | struct pxa2xx_spi_chip { |
37 | u8 tx_threshold; | 46 | u8 tx_threshold; |
47 | u8 tx_hi_threshold; | ||
38 | u8 rx_threshold; | 48 | u8 rx_threshold; |
39 | u8 dma_burst_size; | 49 | u8 dma_burst_size; |
40 | u32 timeout; | 50 | u32 timeout; |
@@ -50,103 +60,5 @@ struct pxa2xx_spi_chip { | |||
50 | 60 | ||
51 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | 61 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); |
52 | 62 | ||
53 | #else | ||
54 | /* | ||
55 | * This is the implemtation for CE4100 on x86. ARM defines them in mach/ or | ||
56 | * plat/ include path. | ||
57 | * The CE4100 does not provide DMA support. This bits are here to let the driver | ||
58 | * compile and will never be used. Maybe we get DMA support at a later point in | ||
59 | * time. | ||
60 | */ | ||
61 | |||
62 | #define DCSR(n) (n) | ||
63 | #define DSADR(n) (n) | ||
64 | #define DTADR(n) (n) | ||
65 | #define DCMD(n) (n) | ||
66 | #define DRCMR(n) (n) | ||
67 | |||
68 | #define DCSR_RUN (1 << 31) /* Run Bit */ | ||
69 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch */ | ||
70 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable */ | ||
71 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
72 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
73 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt */ | ||
74 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt */ | ||
75 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt */ | ||
76 | |||
77 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable */ | ||
78 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
79 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
80 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
81 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
82 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
83 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
84 | |||
85 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid */ | ||
86 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number */ | ||
87 | |||
88 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor */ | ||
89 | #define DDADR_STOP (1 << 0) /* Stop */ | ||
90 | |||
91 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
92 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
93 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
94 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
95 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
96 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
97 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
98 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
99 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
100 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
101 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
102 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
103 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
104 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
105 | |||
106 | /* | ||
107 | * Descriptor structure for PXA's DMA engine | ||
108 | * Note: this structure must always be aligned to a 16-byte boundary. | ||
109 | */ | ||
110 | |||
111 | typedef enum { | ||
112 | DMA_PRIO_HIGH = 0, | ||
113 | DMA_PRIO_MEDIUM = 1, | ||
114 | DMA_PRIO_LOW = 2 | ||
115 | } pxa_dma_prio; | ||
116 | |||
117 | /* | ||
118 | * DMA registration | ||
119 | */ | ||
120 | |||
121 | static inline int pxa_request_dma(char *name, | ||
122 | pxa_dma_prio prio, | ||
123 | void (*irq_handler)(int, void *), | ||
124 | void *data) | ||
125 | { | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | static inline void pxa_free_dma(int dma_ch) | ||
130 | { | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * The CE4100 does not have the clk framework implemented and SPI clock can | ||
135 | * not be switched on/off or the divider changed. | ||
136 | */ | ||
137 | static inline void clk_disable(struct clk *clk) | ||
138 | { | ||
139 | } | ||
140 | |||
141 | static inline int clk_enable(struct clk *clk) | ||
142 | { | ||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | static inline unsigned long clk_get_rate(struct clk *clk) | ||
147 | { | ||
148 | return 3686400; | ||
149 | } | ||
150 | |||
151 | #endif | 63 | #endif |
152 | #endif | 64 | #endif |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index f62918946d86..38c2b925923d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -57,6 +57,8 @@ extern struct bus_type spi_bus_type; | |||
57 | * @modalias: Name of the driver to use with this device, or an alias | 57 | * @modalias: Name of the driver to use with this device, or an alias |
58 | * for that name. This appears in the sysfs "modalias" attribute | 58 | * for that name. This appears in the sysfs "modalias" attribute |
59 | * for driver coldplugging, and in uevents used for hotplugging | 59 | * for driver coldplugging, and in uevents used for hotplugging |
60 | * @cs_gpio: gpio number of the chipselect line (optional, -EINVAL when | ||
61 | * when not using a GPIO line) | ||
60 | * | 62 | * |
61 | * A @spi_device is used to interchange data between an SPI slave | 63 | * A @spi_device is used to interchange data between an SPI slave |
62 | * (usually a discrete chip) and CPU memory. | 64 | * (usually a discrete chip) and CPU memory. |
@@ -258,6 +260,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
258 | * @unprepare_transfer_hardware: there are currently no more messages on the | 260 | * @unprepare_transfer_hardware: there are currently no more messages on the |
259 | * queue so the subsystem notifies the driver that it may relax the | 261 | * queue so the subsystem notifies the driver that it may relax the |
260 | * hardware by issuing this call | 262 | * hardware by issuing this call |
263 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS | ||
264 | * number. Any individual value may be -EINVAL for CS lines that | ||
265 | * are not GPIOs (driven by the SPI controller itself). | ||
261 | * | 266 | * |
262 | * Each SPI master controller can communicate with one or more @spi_device | 267 | * Each SPI master controller can communicate with one or more @spi_device |
263 | * children. These make a small bus, sharing MOSI, MISO and SCK signals | 268 | * children. These make a small bus, sharing MOSI, MISO and SCK signals |
@@ -591,6 +596,26 @@ spi_transfer_del(struct spi_transfer *t) | |||
591 | list_del(&t->transfer_list); | 596 | list_del(&t->transfer_list); |
592 | } | 597 | } |
593 | 598 | ||
599 | /** | ||
600 | * spi_message_init_with_transfers - Initialize spi_message and append transfers | ||
601 | * @m: spi_message to be initialized | ||
602 | * @xfers: An array of spi transfers | ||
603 | * @num_xfers: Number of items in the xfer array | ||
604 | * | ||
605 | * This function initializes the given spi_message and adds each spi_transfer in | ||
606 | * the given array to the message. | ||
607 | */ | ||
608 | static inline void | ||
609 | spi_message_init_with_transfers(struct spi_message *m, | ||
610 | struct spi_transfer *xfers, unsigned int num_xfers) | ||
611 | { | ||
612 | unsigned int i; | ||
613 | |||
614 | spi_message_init(m); | ||
615 | for (i = 0; i < num_xfers; ++i) | ||
616 | spi_message_add_tail(&xfers[i], m); | ||
617 | } | ||
618 | |||
594 | /* It's fine to embed message and transaction structures in other data | 619 | /* It's fine to embed message and transaction structures in other data |
595 | * structures so long as you don't free them while they're in use. | 620 | * structures so long as you don't free them while they're in use. |
596 | */ | 621 | */ |
@@ -683,6 +708,30 @@ spi_read(struct spi_device *spi, void *buf, size_t len) | |||
683 | return spi_sync(spi, &m); | 708 | return spi_sync(spi, &m); |
684 | } | 709 | } |
685 | 710 | ||
711 | /** | ||
712 | * spi_sync_transfer - synchronous SPI data transfer | ||
713 | * @spi: device with which data will be exchanged | ||
714 | * @xfers: An array of spi_transfers | ||
715 | * @num_xfers: Number of items in the xfer array | ||
716 | * Context: can sleep | ||
717 | * | ||
718 | * Does a synchronous SPI data transfer of the given spi_transfer array. | ||
719 | * | ||
720 | * For more specific semantics see spi_sync(). | ||
721 | * | ||
722 | * It returns zero on success, else a negative error code. | ||
723 | */ | ||
724 | static inline int | ||
725 | spi_sync_transfer(struct spi_device *spi, struct spi_transfer *xfers, | ||
726 | unsigned int num_xfers) | ||
727 | { | ||
728 | struct spi_message msg; | ||
729 | |||
730 | spi_message_init_with_transfers(&msg, xfers, num_xfers); | ||
731 | |||
732 | return spi_sync(spi, &msg); | ||
733 | } | ||
734 | |||
686 | /* this copies txbuf and rxbuf data; for small transfers only! */ | 735 | /* this copies txbuf and rxbuf data; for small transfers only! */ |
687 | extern int spi_write_then_read(struct spi_device *spi, | 736 | extern int spi_write_then_read(struct spi_device *spi, |
688 | const void *txbuf, unsigned n_tx, | 737 | const void *txbuf, unsigned n_tx, |
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h index 369b3d7d5b95..1634ce31c06d 100644 --- a/include/linux/spi/spi_gpio.h +++ b/include/linux/spi/spi_gpio.h | |||
@@ -62,8 +62,8 @@ | |||
62 | */ | 62 | */ |
63 | struct spi_gpio_platform_data { | 63 | struct spi_gpio_platform_data { |
64 | unsigned sck; | 64 | unsigned sck; |
65 | unsigned mosi; | 65 | unsigned long mosi; |
66 | unsigned miso; | 66 | unsigned long miso; |
67 | 67 | ||
68 | u16 num_chipselect; | 68 | u16 num_chipselect; |
69 | }; | 69 | }; |
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h index 6b05dcd927ff..86a12b0cb239 100644 --- a/include/linux/ssb/ssb_driver_gige.h +++ b/include/linux/ssb/ssb_driver_gige.h | |||
@@ -97,21 +97,16 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev) | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | #ifdef CONFIG_BCM47XX | ||
101 | #include <asm/mach-bcm47xx/nvram.h> | ||
102 | /* Get the device MAC address */ | 100 | /* Get the device MAC address */ |
103 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | 101 | static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) |
104 | { | ||
105 | char buf[20]; | ||
106 | if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0) | ||
107 | return; | ||
108 | nvram_parse_macaddr(buf, macaddr); | ||
109 | } | ||
110 | #else | ||
111 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | ||
112 | { | 102 | { |
103 | struct ssb_gige *dev = pdev_to_ssb_gige(pdev); | ||
104 | if (!dev) | ||
105 | return -ENODEV; | ||
106 | |||
107 | memcpy(macaddr, dev->dev->bus->sprom.et0mac, 6); | ||
108 | return 0; | ||
113 | } | 109 | } |
114 | #endif | ||
115 | 110 | ||
116 | extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, | 111 | extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, |
117 | struct pci_dev *pdev); | 112 | struct pci_dev *pdev); |
@@ -175,6 +170,10 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev) | |||
175 | { | 170 | { |
176 | return 0; | 171 | return 0; |
177 | } | 172 | } |
173 | static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | ||
174 | { | ||
175 | return -ENODEV; | ||
176 | } | ||
178 | 177 | ||
179 | #endif /* CONFIG_SSB_DRIVER_GIGE */ | 178 | #endif /* CONFIG_SSB_DRIVER_GIGE */ |
180 | #endif /* LINUX_SSB_DRIVER_GIGE_H_ */ | 179 | #endif /* LINUX_SSB_DRIVER_GIGE_H_ */ |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index 07a9c7a2e088..afe79d40a99e 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -45,6 +45,11 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore) | |||
45 | { | 45 | { |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline unsigned int ssb_mips_irq(struct ssb_device *dev) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | |||
48 | #endif /* CONFIG_SSB_DRIVER_MIPS */ | 53 | #endif /* CONFIG_SSB_DRIVER_MIPS */ |
49 | 54 | ||
50 | #endif /* LINUX_SSB_MIPSCORE_H_ */ | 55 | #endif /* LINUX_SSB_MIPSCORE_H_ */ |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index f25ba922baaf..58fda1c3c783 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -17,14 +17,15 @@ | |||
17 | 17 | ||
18 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
19 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
20 | #include <linux/uidgid.h> | ||
20 | 21 | ||
21 | /* size of the nodename buffer */ | 22 | /* size of the nodename buffer */ |
22 | #define UNX_MAXNODENAME 32 | 23 | #define UNX_MAXNODENAME 32 |
23 | 24 | ||
24 | /* Work around the lack of a VFS credential */ | 25 | /* Work around the lack of a VFS credential */ |
25 | struct auth_cred { | 26 | struct auth_cred { |
26 | uid_t uid; | 27 | kuid_t uid; |
27 | gid_t gid; | 28 | kgid_t gid; |
28 | struct group_info *group_info; | 29 | struct group_info *group_info; |
29 | const char *principal; | 30 | const char *principal; |
30 | unsigned char machine_cred : 1; | 31 | unsigned char machine_cred : 1; |
@@ -48,7 +49,7 @@ struct rpc_cred { | |||
48 | unsigned long cr_flags; /* various flags */ | 49 | unsigned long cr_flags; /* various flags */ |
49 | atomic_t cr_count; /* ref count */ | 50 | atomic_t cr_count; /* ref count */ |
50 | 51 | ||
51 | uid_t cr_uid; | 52 | kuid_t cr_uid; |
52 | 53 | ||
53 | /* per-flavor data */ | 54 | /* per-flavor data */ |
54 | }; | 55 | }; |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index b64f8eb0b973..84ca436b76c2 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -87,7 +87,6 @@ struct rpc_task { | |||
87 | tk_cred_retry : 2, | 87 | tk_cred_retry : 2, |
88 | tk_rebind_retry : 2; | 88 | tk_rebind_retry : 2; |
89 | }; | 89 | }; |
90 | #define tk_xprt tk_client->cl_xprt | ||
91 | 90 | ||
92 | /* support walking a list of tasks on a wait queue */ | 91 | /* support walking a list of tasks on a wait queue */ |
93 | #define task_for_each(task, pos, head) \ | 92 | #define task_for_each(task, pos, head) \ |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index dd74084a9799..ff374ab30839 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/cred.h> | 18 | #include <linux/cred.h> |
19 | 19 | ||
20 | struct svc_cred { | 20 | struct svc_cred { |
21 | uid_t cr_uid; | 21 | kuid_t cr_uid; |
22 | gid_t cr_gid; | 22 | kgid_t cr_gid; |
23 | struct group_info *cr_group_info; | 23 | struct group_info *cr_group_info; |
24 | u32 cr_flavor; /* pseudoflavor */ | 24 | u32 cr_flavor; /* pseudoflavor */ |
25 | char *cr_principal; /* for gss */ | 25 | char *cr_principal; /* for gss */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 951cb9b7d02b..30834be03011 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -117,12 +117,12 @@ struct rpc_xprt_ops { | |||
117 | void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); | 117 | void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); |
118 | void (*rpcbind)(struct rpc_task *task); | 118 | void (*rpcbind)(struct rpc_task *task); |
119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
120 | void (*connect)(struct rpc_task *task); | 120 | void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task); |
121 | void * (*buf_alloc)(struct rpc_task *task, size_t size); | 121 | void * (*buf_alloc)(struct rpc_task *task, size_t size); |
122 | void (*buf_free)(void *buffer); | 122 | void (*buf_free)(void *buffer); |
123 | int (*send_request)(struct rpc_task *task); | 123 | int (*send_request)(struct rpc_task *task); |
124 | void (*set_retrans_timeout)(struct rpc_task *task); | 124 | void (*set_retrans_timeout)(struct rpc_task *task); |
125 | void (*timer)(struct rpc_task *task); | 125 | void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task); |
126 | void (*release_request)(struct rpc_task *task); | 126 | void (*release_request)(struct rpc_task *task); |
127 | void (*close)(struct rpc_xprt *xprt); | 127 | void (*close)(struct rpc_xprt *xprt); |
128 | void (*destroy)(struct rpc_xprt *xprt); | 128 | void (*destroy)(struct rpc_xprt *xprt); |
@@ -313,7 +313,7 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | |||
313 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 313 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
314 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); | 314 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); |
315 | void xprt_write_space(struct rpc_xprt *xprt); | 315 | void xprt_write_space(struct rpc_xprt *xprt); |
316 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 316 | void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result); |
317 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); | 317 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
318 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 318 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
319 | void xprt_release_rqst_cong(struct rpc_task *task); | 319 | void xprt_release_rqst_cong(struct rpc_task *task); |
diff --git a/include/linux/sunserialcore.h b/include/linux/sunserialcore.h index 68e7430bb0fe..dbe4d7fca1b8 100644 --- a/include/linux/sunserialcore.h +++ b/include/linux/sunserialcore.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #ifndef _SERIAL_SUN_H | 13 | #ifndef _SERIAL_SUN_H |
14 | #define _SERIAL_SUN_H | 14 | #define _SERIAL_SUN_H |
15 | 15 | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/serial_core.h> | ||
18 | #include <linux/console.h> | ||
19 | |||
16 | /* Serial keyboard defines for L1-A processing... */ | 20 | /* Serial keyboard defines for L1-A processing... */ |
17 | #define SUNKBD_RESET 0xff | 21 | #define SUNKBD_RESET 0xff |
18 | #define SUNKBD_L1 0x01 | 22 | #define SUNKBD_L1 0x01 |
diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h index b9165bba6e61..18081787e5f3 100644 --- a/include/linux/sunxi_timer.h +++ b/include/linux/sunxi_timer.h | |||
@@ -19,6 +19,6 @@ | |||
19 | 19 | ||
20 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
21 | 21 | ||
22 | extern struct sys_timer sunxi_timer; | 22 | void sunxi_timer_init(void); |
23 | 23 | ||
24 | #endif | 24 | #endif |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 0c808d7fa579..d4e3f16d5e89 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -34,8 +34,10 @@ static inline void pm_restore_console(void) | |||
34 | typedef int __bitwise suspend_state_t; | 34 | typedef int __bitwise suspend_state_t; |
35 | 35 | ||
36 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) | 36 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) |
37 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) | 37 | #define PM_SUSPEND_FREEZE ((__force suspend_state_t) 1) |
38 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 2) | ||
38 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) | 39 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) |
40 | #define PM_SUSPEND_MIN PM_SUSPEND_FREEZE | ||
39 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) | 41 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
40 | 42 | ||
41 | enum suspend_stat_step { | 43 | enum suspend_stat_step { |
@@ -192,6 +194,7 @@ struct platform_suspend_ops { | |||
192 | */ | 194 | */ |
193 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); | 195 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
194 | extern int suspend_valid_only_mem(suspend_state_t state); | 196 | extern int suspend_valid_only_mem(suspend_state_t state); |
197 | extern void freeze_wake(void); | ||
195 | 198 | ||
196 | /** | 199 | /** |
197 | * arch_suspend_disable_irqs - disable IRQs for suspend | 200 | * arch_suspend_disable_irqs - disable IRQs for suspend |
@@ -217,6 +220,7 @@ extern int pm_suspend(suspend_state_t state); | |||
217 | 220 | ||
218 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} | 221 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
219 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 222 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
223 | static inline void freeze_wake(void) {} | ||
220 | #endif /* !CONFIG_SUSPEND */ | 224 | #endif /* !CONFIG_SUSPEND */ |
221 | 225 | ||
222 | /* struct pbe is used for creating lists of pages that should be restored | 226 | /* struct pbe is used for creating lists of pages that should be restored |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 68df9c17fbbb..2818a123f3ea 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/memcontrol.h> | 8 | #include <linux/memcontrol.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/node.h> | 10 | #include <linux/node.h> |
11 | 11 | #include <linux/fs.h> | |
12 | #include <linux/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | 14 | ||
@@ -156,7 +156,7 @@ enum { | |||
156 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 156 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ |
157 | }; | 157 | }; |
158 | 158 | ||
159 | #define SWAP_CLUSTER_MAX 32 | 159 | #define SWAP_CLUSTER_MAX 32UL |
160 | #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX | 160 | #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX |
161 | 161 | ||
162 | /* | 162 | /* |
@@ -202,6 +202,18 @@ struct swap_info_struct { | |||
202 | unsigned long *frontswap_map; /* frontswap in-use, one bit per page */ | 202 | unsigned long *frontswap_map; /* frontswap in-use, one bit per page */ |
203 | atomic_t frontswap_pages; /* frontswap pages in-use counter */ | 203 | atomic_t frontswap_pages; /* frontswap pages in-use counter */ |
204 | #endif | 204 | #endif |
205 | spinlock_t lock; /* | ||
206 | * protect map scan related fields like | ||
207 | * swap_map, lowest_bit, highest_bit, | ||
208 | * inuse_pages, cluster_next, | ||
209 | * cluster_nr, lowest_alloc and | ||
210 | * highest_alloc. other fields are only | ||
211 | * changed at swapon/swapoff, so are | ||
212 | * protected by swap_lock. changing | ||
213 | * flags need hold this lock and | ||
214 | * swap_lock. If both locks need hold, | ||
215 | * hold swap_lock first. | ||
216 | */ | ||
205 | }; | 217 | }; |
206 | 218 | ||
207 | struct swap_list_t { | 219 | struct swap_list_t { |
@@ -209,15 +221,12 @@ struct swap_list_t { | |||
209 | int next; /* swapfile to be used next */ | 221 | int next; /* swapfile to be used next */ |
210 | }; | 222 | }; |
211 | 223 | ||
212 | /* Swap 50% full? Release swapcache more aggressively.. */ | ||
213 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | ||
214 | |||
215 | /* linux/mm/page_alloc.c */ | 224 | /* linux/mm/page_alloc.c */ |
216 | extern unsigned long totalram_pages; | 225 | extern unsigned long totalram_pages; |
217 | extern unsigned long totalreserve_pages; | 226 | extern unsigned long totalreserve_pages; |
218 | extern unsigned long dirty_balance_reserve; | 227 | extern unsigned long dirty_balance_reserve; |
219 | extern unsigned int nr_free_buffer_pages(void); | 228 | extern unsigned long nr_free_buffer_pages(void); |
220 | extern unsigned int nr_free_pagecache_pages(void); | 229 | extern unsigned long nr_free_pagecache_pages(void); |
221 | 230 | ||
222 | /* Definition of global_page_state not available yet */ | 231 | /* Definition of global_page_state not available yet */ |
223 | #define nr_free_pages() global_page_state(NR_FREE_PAGES) | 232 | #define nr_free_pages() global_page_state(NR_FREE_PAGES) |
@@ -266,7 +275,7 @@ extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | |||
266 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 275 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
267 | extern int vm_swappiness; | 276 | extern int vm_swappiness; |
268 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 277 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
269 | extern long vm_total_pages; | 278 | extern unsigned long vm_total_pages; |
270 | 279 | ||
271 | #ifdef CONFIG_NUMA | 280 | #ifdef CONFIG_NUMA |
272 | extern int zone_reclaim_mode; | 281 | extern int zone_reclaim_mode; |
@@ -330,8 +339,9 @@ int generic_swapfile_activate(struct swap_info_struct *, struct file *, | |||
330 | sector_t *); | 339 | sector_t *); |
331 | 340 | ||
332 | /* linux/mm/swap_state.c */ | 341 | /* linux/mm/swap_state.c */ |
333 | extern struct address_space swapper_space; | 342 | extern struct address_space swapper_spaces[]; |
334 | #define total_swapcache_pages swapper_space.nrpages | 343 | #define swap_address_space(entry) (&swapper_spaces[swp_type(entry)]) |
344 | extern unsigned long total_swapcache_pages(void); | ||
335 | extern void show_swap_cache_info(void); | 345 | extern void show_swap_cache_info(void); |
336 | extern int add_to_swap(struct page *); | 346 | extern int add_to_swap(struct page *); |
337 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 347 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
@@ -346,8 +356,20 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t, | |||
346 | struct vm_area_struct *vma, unsigned long addr); | 356 | struct vm_area_struct *vma, unsigned long addr); |
347 | 357 | ||
348 | /* linux/mm/swapfile.c */ | 358 | /* linux/mm/swapfile.c */ |
349 | extern long nr_swap_pages; | 359 | extern atomic_long_t nr_swap_pages; |
350 | extern long total_swap_pages; | 360 | extern long total_swap_pages; |
361 | |||
362 | /* Swap 50% full? Release swapcache more aggressively.. */ | ||
363 | static inline bool vm_swap_full(void) | ||
364 | { | ||
365 | return atomic_long_read(&nr_swap_pages) * 2 < total_swap_pages; | ||
366 | } | ||
367 | |||
368 | static inline long get_nr_swap_pages(void) | ||
369 | { | ||
370 | return atomic_long_read(&nr_swap_pages); | ||
371 | } | ||
372 | |||
351 | extern void si_swapinfo(struct sysinfo *); | 373 | extern void si_swapinfo(struct sysinfo *); |
352 | extern swp_entry_t get_swap_page(void); | 374 | extern swp_entry_t get_swap_page(void); |
353 | extern swp_entry_t get_swap_page_of_type(int); | 375 | extern swp_entry_t get_swap_page_of_type(int); |
@@ -380,9 +402,10 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | |||
380 | 402 | ||
381 | #else /* CONFIG_SWAP */ | 403 | #else /* CONFIG_SWAP */ |
382 | 404 | ||
383 | #define nr_swap_pages 0L | 405 | #define get_nr_swap_pages() 0L |
384 | #define total_swap_pages 0L | 406 | #define total_swap_pages 0L |
385 | #define total_swapcache_pages 0UL | 407 | #define total_swapcache_pages() 0UL |
408 | #define vm_swap_full() 0 | ||
386 | 409 | ||
387 | #define si_swapinfo(val) \ | 410 | #define si_swapinfo(val) \ |
388 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) | 411 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 071d62c214a6..2de42f9401d2 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -23,7 +23,7 @@ extern int swiotlb_force; | |||
23 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
24 | 24 | ||
25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | 26 | int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); |
27 | extern unsigned long swiotlb_nr_tbl(void); | 27 | extern unsigned long swiotlb_nr_tbl(void); |
28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); | 28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); |
29 | 29 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 45e2db270255..313a8e0a6553 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -68,11 +68,11 @@ struct sigaltstack; | |||
68 | #include <linux/types.h> | 68 | #include <linux/types.h> |
69 | #include <linux/aio_abi.h> | 69 | #include <linux/aio_abi.h> |
70 | #include <linux/capability.h> | 70 | #include <linux/capability.h> |
71 | #include <linux/signal.h> | ||
71 | #include <linux/list.h> | 72 | #include <linux/list.h> |
72 | #include <linux/bug.h> | 73 | #include <linux/bug.h> |
73 | #include <linux/sem.h> | 74 | #include <linux/sem.h> |
74 | #include <asm/siginfo.h> | 75 | #include <asm/siginfo.h> |
75 | #include <asm/signal.h> | ||
76 | #include <linux/unistd.h> | 76 | #include <linux/unistd.h> |
77 | #include <linux/quota.h> | 77 | #include <linux/quota.h> |
78 | #include <linux/key.h> | 78 | #include <linux/key.h> |
@@ -300,10 +300,8 @@ asmlinkage long sys_personality(unsigned int personality); | |||
300 | asmlinkage long sys_sigpending(old_sigset_t __user *set); | 300 | asmlinkage long sys_sigpending(old_sigset_t __user *set); |
301 | asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, | 301 | asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, |
302 | old_sigset_t __user *oset); | 302 | old_sigset_t __user *oset); |
303 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
304 | asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss, | 303 | asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss, |
305 | struct sigaltstack __user *uoss); | 304 | struct sigaltstack __user *uoss); |
306 | #endif | ||
307 | 305 | ||
308 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value); | 306 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value); |
309 | asmlinkage long sys_setitimer(int which, | 307 | asmlinkage long sys_setitimer(int which, |
@@ -377,6 +375,27 @@ asmlinkage long sys_init_module(void __user *umod, unsigned long len, | |||
377 | asmlinkage long sys_delete_module(const char __user *name_user, | 375 | asmlinkage long sys_delete_module(const char __user *name_user, |
378 | unsigned int flags); | 376 | unsigned int flags); |
379 | 377 | ||
378 | #ifdef CONFIG_OLD_SIGSUSPEND | ||
379 | asmlinkage long sys_sigsuspend(old_sigset_t mask); | ||
380 | #endif | ||
381 | |||
382 | #ifdef CONFIG_OLD_SIGSUSPEND3 | ||
383 | asmlinkage long sys_sigsuspend(int unused1, int unused2, old_sigset_t mask); | ||
384 | #endif | ||
385 | |||
386 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | ||
387 | |||
388 | #ifdef CONFIG_OLD_SIGACTION | ||
389 | asmlinkage long sys_sigaction(int, const struct old_sigaction __user *, | ||
390 | struct old_sigaction __user *); | ||
391 | #endif | ||
392 | |||
393 | #ifndef CONFIG_ODD_RT_SIGACTION | ||
394 | asmlinkage long sys_rt_sigaction(int, | ||
395 | const struct sigaction __user *, | ||
396 | struct sigaction __user *, | ||
397 | size_t); | ||
398 | #endif | ||
380 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, | 399 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, |
381 | sigset_t __user *oset, size_t sigsetsize); | 400 | sigset_t __user *oset, size_t sigsetsize); |
382 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); | 401 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 381f06db2fe5..e2cee22f578a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -181,6 +181,10 @@ int sysfs_merge_group(struct kobject *kobj, | |||
181 | const struct attribute_group *grp); | 181 | const struct attribute_group *grp); |
182 | void sysfs_unmerge_group(struct kobject *kobj, | 182 | void sysfs_unmerge_group(struct kobject *kobj, |
183 | const struct attribute_group *grp); | 183 | const struct attribute_group *grp); |
184 | int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name, | ||
185 | struct kobject *target, const char *link_name); | ||
186 | void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | ||
187 | const char *link_name); | ||
184 | 188 | ||
185 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 189 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
186 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 190 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
@@ -326,6 +330,18 @@ static inline void sysfs_unmerge_group(struct kobject *kobj, | |||
326 | { | 330 | { |
327 | } | 331 | } |
328 | 332 | ||
333 | static inline int sysfs_add_link_to_group(struct kobject *kobj, | ||
334 | const char *group_name, struct kobject *target, | ||
335 | const char *link_name) | ||
336 | { | ||
337 | return 0; | ||
338 | } | ||
339 | |||
340 | static inline void sysfs_remove_link_from_group(struct kobject *kobj, | ||
341 | const char *group_name, const char *link_name) | ||
342 | { | ||
343 | } | ||
344 | |||
329 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, | 345 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, |
330 | const char *attr) | 346 | const char *attr) |
331 | { | 347 | { |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 4e1d2283e3cc..f28408c07dc2 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -162,6 +162,8 @@ struct tcp_sock { | |||
162 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 162 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
163 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 163 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
164 | 164 | ||
165 | u32 tsoffset; /* timestamp offset */ | ||
166 | |||
165 | struct list_head tsq_node; /* anchor in tsq_tasklet.head list */ | 167 | struct list_head tsq_node; /* anchor in tsq_tasklet.head list */ |
166 | unsigned long tsq_flags; | 168 | unsigned long tsq_flags; |
167 | 169 | ||
@@ -246,7 +248,6 @@ struct tcp_sock { | |||
246 | u32 sacked_out; /* SACK'd packets */ | 248 | u32 sacked_out; /* SACK'd packets */ |
247 | u32 fackets_out; /* FACK'd packets */ | 249 | u32 fackets_out; /* FACK'd packets */ |
248 | u32 tso_deferred; | 250 | u32 tso_deferred; |
249 | u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ | ||
250 | 251 | ||
251 | /* from STCP, retrans queue hinting */ | 252 | /* from STCP, retrans queue hinting */ |
252 | struct sk_buff* lost_skb_hint; | 253 | struct sk_buff* lost_skb_hint; |
@@ -354,6 +355,7 @@ struct tcp_timewait_sock { | |||
354 | u32 tw_rcv_nxt; | 355 | u32 tw_rcv_nxt; |
355 | u32 tw_snd_nxt; | 356 | u32 tw_snd_nxt; |
356 | u32 tw_rcv_wnd; | 357 | u32 tw_rcv_wnd; |
358 | u32 tw_ts_offset; | ||
357 | u32 tw_ts_recent; | 359 | u32 tw_ts_recent; |
358 | long tw_ts_recent_stamp; | 360 | long tw_ts_recent_stamp; |
359 | #ifdef CONFIG_TCP_MD5SIG | 361 | #ifdef CONFIG_TCP_MD5SIG |
diff --git a/include/linux/tegra-soc.h b/include/linux/tegra-soc.h new file mode 100644 index 000000000000..95f611d78f3a --- /dev/null +++ b/include/linux/tegra-soc.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_TEGRA_SOC_H_ | ||
18 | #define __LINUX_TEGRA_SOC_H_ | ||
19 | |||
20 | u32 tegra_read_chipid(void); | ||
21 | |||
22 | #endif /* __LINUX_TEGRA_SOC_H_ */ | ||
diff --git a/include/linux/time.h b/include/linux/time.h index a3ab6a814a9c..d4835dfdf25e 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -154,9 +154,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta); | |||
154 | * finer then tick granular time. | 154 | * finer then tick granular time. |
155 | */ | 155 | */ |
156 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | 156 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
157 | extern u32 arch_gettimeoffset(void); | 157 | extern u32 (*arch_gettimeoffset)(void); |
158 | #else | ||
159 | static inline u32 arch_gettimeoffset(void) { return 0; } | ||
160 | #endif | 158 | #endif |
161 | 159 | ||
162 | extern void do_gettimeofday(struct timeval *tv); | 160 | extern void do_gettimeofday(struct timeval *tv); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 8db1b569c37a..c75d886b0307 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -202,7 +202,8 @@ struct tty_port { | |||
202 | unsigned long iflags; /* TTYP_ internal flags */ | 202 | unsigned long iflags; /* TTYP_ internal flags */ |
203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ | 203 | #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ |
204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ | 204 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ |
205 | unsigned char console:1; /* port is a console */ | 205 | unsigned char console:1, /* port is a console */ |
206 | low_latency:1; /* direct buffer flush */ | ||
206 | struct mutex mutex; /* Locking */ | 207 | struct mutex mutex; /* Locking */ |
207 | struct mutex buf_mutex; /* Buffer alloc lock */ | 208 | struct mutex buf_mutex; /* Buffer alloc lock */ |
208 | unsigned char *xmit_buf; /* Optional buffer */ | 209 | unsigned char *xmit_buf; /* Optional buffer */ |
@@ -254,7 +255,7 @@ struct tty_struct { | |||
254 | int count; | 255 | int count; |
255 | struct winsize winsize; /* termios mutex */ | 256 | struct winsize winsize; /* termios mutex */ |
256 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; | 257 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; |
257 | unsigned char low_latency:1, warned:1; | 258 | unsigned char warned:1; |
258 | unsigned char ctrl_status; /* ctrl_lock */ | 259 | unsigned char ctrl_status; /* ctrl_lock */ |
259 | unsigned int receive_room; /* Bytes free for queue */ | 260 | unsigned int receive_room; /* Bytes free for queue */ |
260 | 261 | ||
@@ -317,11 +318,43 @@ struct tty_file_private { | |||
317 | 318 | ||
318 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 319 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
319 | 320 | ||
321 | #ifdef CONFIG_TTY | ||
322 | extern void console_init(void); | ||
323 | extern void tty_kref_put(struct tty_struct *tty); | ||
324 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | ||
325 | extern void tty_vhangup_self(void); | ||
326 | extern void disassociate_ctty(int priv); | ||
327 | extern dev_t tty_devnum(struct tty_struct *tty); | ||
328 | extern void proc_clear_tty(struct task_struct *p); | ||
329 | extern struct tty_struct *get_current_tty(void); | ||
330 | /* tty_io.c */ | ||
331 | extern int __init tty_init(void); | ||
332 | #else | ||
333 | static inline void console_init(void) | ||
334 | { } | ||
335 | static inline void tty_kref_put(struct tty_struct *tty) | ||
336 | { } | ||
337 | static inline struct pid *tty_get_pgrp(struct tty_struct *tty) | ||
338 | { return NULL; } | ||
339 | static inline void tty_vhangup_self(void) | ||
340 | { } | ||
341 | static inline void disassociate_ctty(int priv) | ||
342 | { } | ||
343 | static inline dev_t tty_devnum(struct tty_struct *tty) | ||
344 | { return 0; } | ||
345 | static inline void proc_clear_tty(struct task_struct *p) | ||
346 | { } | ||
347 | static inline struct tty_struct *get_current_tty(void) | ||
348 | { return NULL; } | ||
349 | /* tty_io.c */ | ||
350 | static inline int __init tty_init(void) | ||
351 | { return 0; } | ||
352 | #endif | ||
353 | |||
320 | extern void tty_write_flush(struct tty_struct *); | 354 | extern void tty_write_flush(struct tty_struct *); |
321 | 355 | ||
322 | extern struct ktermios tty_std_termios; | 356 | extern struct ktermios tty_std_termios; |
323 | 357 | ||
324 | extern void console_init(void); | ||
325 | extern int vcs_init(void); | 358 | extern int vcs_init(void); |
326 | 359 | ||
327 | extern struct class *tty_class; | 360 | extern struct class *tty_class; |
@@ -341,7 +374,6 @@ static inline struct tty_struct *tty_kref_get(struct tty_struct *tty) | |||
341 | kref_get(&tty->kref); | 374 | kref_get(&tty->kref); |
342 | return tty; | 375 | return tty; |
343 | } | 376 | } |
344 | extern void tty_kref_put(struct tty_struct *tty); | ||
345 | 377 | ||
346 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, | 378 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, |
347 | const char *routine); | 379 | const char *routine); |
@@ -373,20 +405,16 @@ extern void tty_driver_remove_tty(struct tty_driver *driver, | |||
373 | struct tty_struct *tty); | 405 | struct tty_struct *tty); |
374 | extern void tty_free_termios(struct tty_struct *tty); | 406 | extern void tty_free_termios(struct tty_struct *tty); |
375 | extern int is_current_pgrp_orphaned(void); | 407 | extern int is_current_pgrp_orphaned(void); |
376 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | ||
377 | extern int is_ignored(int sig); | 408 | extern int is_ignored(int sig); |
378 | extern int tty_signal(int sig, struct tty_struct *tty); | 409 | extern int tty_signal(int sig, struct tty_struct *tty); |
379 | extern void tty_hangup(struct tty_struct *tty); | 410 | extern void tty_hangup(struct tty_struct *tty); |
380 | extern void tty_vhangup(struct tty_struct *tty); | 411 | extern void tty_vhangup(struct tty_struct *tty); |
381 | extern void tty_vhangup_locked(struct tty_struct *tty); | 412 | extern void tty_vhangup_locked(struct tty_struct *tty); |
382 | extern void tty_vhangup_self(void); | ||
383 | extern void tty_unhangup(struct file *filp); | 413 | extern void tty_unhangup(struct file *filp); |
384 | extern int tty_hung_up_p(struct file *filp); | 414 | extern int tty_hung_up_p(struct file *filp); |
385 | extern void do_SAK(struct tty_struct *tty); | 415 | extern void do_SAK(struct tty_struct *tty); |
386 | extern void __do_SAK(struct tty_struct *tty); | 416 | extern void __do_SAK(struct tty_struct *tty); |
387 | extern void disassociate_ctty(int priv); | ||
388 | extern void no_tty(void); | 417 | extern void no_tty(void); |
389 | extern void tty_flip_buffer_push(struct tty_struct *tty); | ||
390 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | 418 | extern void tty_flush_to_ldisc(struct tty_struct *tty); |
391 | extern void tty_buffer_free_all(struct tty_port *port); | 419 | extern void tty_buffer_free_all(struct tty_port *port); |
392 | extern void tty_buffer_flush(struct tty_struct *tty); | 420 | extern void tty_buffer_flush(struct tty_struct *tty); |
@@ -415,9 +443,6 @@ extern long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | |||
415 | extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | 443 | extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, |
416 | unsigned int cmd, unsigned long arg); | 444 | unsigned int cmd, unsigned long arg); |
417 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); | 445 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); |
418 | extern dev_t tty_devnum(struct tty_struct *tty); | ||
419 | extern void proc_clear_tty(struct task_struct *p); | ||
420 | extern struct tty_struct *get_current_tty(void); | ||
421 | extern void tty_default_fops(struct file_operations *fops); | 446 | extern void tty_default_fops(struct file_operations *fops); |
422 | extern struct tty_struct *alloc_tty_struct(void); | 447 | extern struct tty_struct *alloc_tty_struct(void); |
423 | extern int tty_alloc_file(struct file *file); | 448 | extern int tty_alloc_file(struct file *file); |
@@ -543,9 +568,6 @@ static inline int tty_audit_push_task(struct task_struct *tsk, | |||
543 | } | 568 | } |
544 | #endif | 569 | #endif |
545 | 570 | ||
546 | /* tty_io.c */ | ||
547 | extern int __init tty_init(void); | ||
548 | |||
549 | /* tty_ioctl.c */ | 571 | /* tty_ioctl.c */ |
550 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, | 572 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, |
551 | unsigned int cmd, unsigned long arg); | 573 | unsigned int cmd, unsigned long arg); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index dd976cfb6131..756a60989294 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -40,6 +40,7 @@ | |||
40 | * void (*close)(struct tty_struct * tty, struct file * filp); | 40 | * void (*close)(struct tty_struct * tty, struct file * filp); |
41 | * | 41 | * |
42 | * This routine is called when a particular tty device is closed. | 42 | * This routine is called when a particular tty device is closed. |
43 | * Note: called even if the corresponding open() failed. | ||
43 | * | 44 | * |
44 | * Required method. | 45 | * Required method. |
45 | * | 46 | * |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 2002344ed36a..e0f252633b47 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -1,28 +1,34 @@ | |||
1 | #ifndef _LINUX_TTY_FLIP_H | 1 | #ifndef _LINUX_TTY_FLIP_H |
2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
3 | 3 | ||
4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); | 4 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); |
5 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); | 5 | extern int tty_insert_flip_string_flags(struct tty_port *port, |
6 | extern int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, const unsigned char *chars, char flag, size_t size); | 6 | const unsigned char *chars, const char *flags, size_t size); |
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_insert_flip_string_fixed_flag(struct tty_port *port, |
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | const unsigned char *chars, char flag, size_t size); |
9 | void tty_schedule_flip(struct tty_struct *tty); | 9 | extern int tty_prepare_flip_string(struct tty_port *port, |
10 | unsigned char **chars, size_t size); | ||
11 | extern int tty_prepare_flip_string_flags(struct tty_port *port, | ||
12 | unsigned char **chars, char **flags, size_t size); | ||
13 | extern void tty_flip_buffer_push(struct tty_port *port); | ||
14 | void tty_schedule_flip(struct tty_port *port); | ||
10 | 15 | ||
11 | static inline int tty_insert_flip_char(struct tty_struct *tty, | 16 | static inline int tty_insert_flip_char(struct tty_port *port, |
12 | unsigned char ch, char flag) | 17 | unsigned char ch, char flag) |
13 | { | 18 | { |
14 | struct tty_buffer *tb = tty->port->buf.tail; | 19 | struct tty_buffer *tb = port->buf.tail; |
15 | if (tb && tb->used < tb->size) { | 20 | if (tb && tb->used < tb->size) { |
16 | tb->flag_buf_ptr[tb->used] = flag; | 21 | tb->flag_buf_ptr[tb->used] = flag; |
17 | tb->char_buf_ptr[tb->used++] = ch; | 22 | tb->char_buf_ptr[tb->used++] = ch; |
18 | return 1; | 23 | return 1; |
19 | } | 24 | } |
20 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 25 | return tty_insert_flip_string_flags(port, &ch, &flag, 1); |
21 | } | 26 | } |
22 | 27 | ||
23 | static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size) | 28 | static inline int tty_insert_flip_string(struct tty_port *port, |
29 | const unsigned char *chars, size_t size) | ||
24 | { | 30 | { |
25 | return tty_insert_flip_string_fixed_flag(tty, chars, TTY_NORMAL, size); | 31 | return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size); |
26 | } | 32 | } |
27 | 33 | ||
28 | #endif /* _LINUX_TTY_FLIP_H */ | 34 | #endif /* _LINUX_TTY_FLIP_H */ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index fb79dd8d1537..455a0d7bf220 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -100,16 +100,14 @@ | |||
100 | * seek to perform this action quickly but should wait until | 100 | * seek to perform this action quickly but should wait until |
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, | 103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status) |
104 | * struct pps_event_time *ts) | ||
105 | * | 104 | * |
106 | * Tells the discipline that the DCD pin has changed its status and | 105 | * Tells the discipline that the DCD pin has changed its status. |
107 | * the relative timestamp. Pointer ts cannot be NULL. | 106 | * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline. |
108 | */ | 107 | */ |
109 | 108 | ||
110 | #include <linux/fs.h> | 109 | #include <linux/fs.h> |
111 | #include <linux/wait.h> | 110 | #include <linux/wait.h> |
112 | #include <linux/pps_kernel.h> | ||
113 | #include <linux/wait.h> | 111 | #include <linux/wait.h> |
114 | 112 | ||
115 | struct tty_ldisc_ops { | 113 | struct tty_ldisc_ops { |
@@ -144,8 +142,7 @@ struct tty_ldisc_ops { | |||
144 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 142 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, |
145 | char *fp, int count); | 143 | char *fp, int count); |
146 | void (*write_wakeup)(struct tty_struct *); | 144 | void (*write_wakeup)(struct tty_struct *); |
147 | void (*dcd_change)(struct tty_struct *, unsigned int, | 145 | void (*dcd_change)(struct tty_struct *, unsigned int); |
148 | struct pps_event_time *); | ||
149 | 146 | ||
150 | struct module *owner; | 147 | struct module *owner; |
151 | 148 | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index b09c37e04a91..3c671c1b37f6 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -77,6 +77,8 @@ struct usb_configuration; | |||
77 | * in interface or class descriptors; endpoints; I/O buffers; and so on. | 77 | * in interface or class descriptors; endpoints; I/O buffers; and so on. |
78 | * @unbind: Reverses @bind; called as a side effect of unregistering the | 78 | * @unbind: Reverses @bind; called as a side effect of unregistering the |
79 | * driver which added this function. | 79 | * driver which added this function. |
80 | * @free_func: free the struct usb_function. | ||
81 | * @mod: (internal) points to the module that created this structure. | ||
80 | * @set_alt: (REQUIRED) Reconfigures altsettings; function drivers may | 82 | * @set_alt: (REQUIRED) Reconfigures altsettings; function drivers may |
81 | * initialize usb_ep.driver data at this time (when it is used). | 83 | * initialize usb_ep.driver data at this time (when it is used). |
82 | * Note that setting an interface to its current altsetting resets | 84 | * Note that setting an interface to its current altsetting resets |
@@ -116,6 +118,7 @@ struct usb_configuration; | |||
116 | * two or more distinct instances within the same configuration, providing | 118 | * two or more distinct instances within the same configuration, providing |
117 | * several independent logical data links to a USB host. | 119 | * several independent logical data links to a USB host. |
118 | */ | 120 | */ |
121 | |||
119 | struct usb_function { | 122 | struct usb_function { |
120 | const char *name; | 123 | const char *name; |
121 | struct usb_gadget_strings **strings; | 124 | struct usb_gadget_strings **strings; |
@@ -136,6 +139,8 @@ struct usb_function { | |||
136 | struct usb_function *); | 139 | struct usb_function *); |
137 | void (*unbind)(struct usb_configuration *, | 140 | void (*unbind)(struct usb_configuration *, |
138 | struct usb_function *); | 141 | struct usb_function *); |
142 | void (*free_func)(struct usb_function *f); | ||
143 | struct module *mod; | ||
139 | 144 | ||
140 | /* runtime state management */ | 145 | /* runtime state management */ |
141 | int (*set_alt)(struct usb_function *, | 146 | int (*set_alt)(struct usb_function *, |
@@ -156,6 +161,7 @@ struct usb_function { | |||
156 | /* internals */ | 161 | /* internals */ |
157 | struct list_head list; | 162 | struct list_head list; |
158 | DECLARE_BITMAP(endpoints, 32); | 163 | DECLARE_BITMAP(endpoints, 32); |
164 | const struct usb_function_instance *fi; | ||
159 | }; | 165 | }; |
160 | 166 | ||
161 | int usb_add_function(struct usb_configuration *, struct usb_function *); | 167 | int usb_add_function(struct usb_configuration *, struct usb_function *); |
@@ -184,7 +190,8 @@ int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f, | |||
184 | * @bConfigurationValue: Copied into configuration descriptor. | 190 | * @bConfigurationValue: Copied into configuration descriptor. |
185 | * @iConfiguration: Copied into configuration descriptor. | 191 | * @iConfiguration: Copied into configuration descriptor. |
186 | * @bmAttributes: Copied into configuration descriptor. | 192 | * @bmAttributes: Copied into configuration descriptor. |
187 | * @bMaxPower: Copied into configuration descriptor. | 193 | * @MaxPower: Power consumtion in mA. Used to compute bMaxPower in the |
194 | * configuration descriptor after considering the bus speed. | ||
188 | * @cdev: assigned by @usb_add_config() before calling @bind(); this is | 195 | * @cdev: assigned by @usb_add_config() before calling @bind(); this is |
189 | * the device associated with this configuration. | 196 | * the device associated with this configuration. |
190 | * | 197 | * |
@@ -230,7 +237,7 @@ struct usb_configuration { | |||
230 | u8 bConfigurationValue; | 237 | u8 bConfigurationValue; |
231 | u8 iConfiguration; | 238 | u8 iConfiguration; |
232 | u8 bmAttributes; | 239 | u8 bmAttributes; |
233 | u8 bMaxPower; | 240 | u16 MaxPower; |
234 | 241 | ||
235 | struct usb_composite_dev *cdev; | 242 | struct usb_composite_dev *cdev; |
236 | 243 | ||
@@ -316,7 +323,15 @@ struct usb_composite_driver { | |||
316 | extern int usb_composite_probe(struct usb_composite_driver *driver); | 323 | extern int usb_composite_probe(struct usb_composite_driver *driver); |
317 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 324 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
318 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 325 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
326 | extern int composite_dev_prepare(struct usb_composite_driver *composite, | ||
327 | struct usb_composite_dev *cdev); | ||
328 | void composite_dev_cleanup(struct usb_composite_dev *cdev); | ||
319 | 329 | ||
330 | static inline struct usb_composite_driver *to_cdriver( | ||
331 | struct usb_gadget_driver *gdrv) | ||
332 | { | ||
333 | return container_of(gdrv, struct usb_composite_driver, gadget_driver); | ||
334 | } | ||
320 | 335 | ||
321 | /** | 336 | /** |
322 | * struct usb_composite_device - represents one composite usb gadget | 337 | * struct usb_composite_device - represents one composite usb gadget |
@@ -360,6 +375,7 @@ struct usb_composite_dev { | |||
360 | unsigned int suspended:1; | 375 | unsigned int suspended:1; |
361 | struct usb_device_descriptor desc; | 376 | struct usb_device_descriptor desc; |
362 | struct list_head configs; | 377 | struct list_head configs; |
378 | struct list_head gstrings; | ||
363 | struct usb_composite_driver *driver; | 379 | struct usb_composite_driver *driver; |
364 | u8 next_string_id; | 380 | u8 next_string_id; |
365 | char *def_manufacturer; | 381 | char *def_manufacturer; |
@@ -381,8 +397,15 @@ struct usb_composite_dev { | |||
381 | extern int usb_string_id(struct usb_composite_dev *c); | 397 | extern int usb_string_id(struct usb_composite_dev *c); |
382 | extern int usb_string_ids_tab(struct usb_composite_dev *c, | 398 | extern int usb_string_ids_tab(struct usb_composite_dev *c, |
383 | struct usb_string *str); | 399 | struct usb_string *str); |
400 | extern struct usb_string *usb_gstrings_attach(struct usb_composite_dev *cdev, | ||
401 | struct usb_gadget_strings **sp, unsigned n_strings); | ||
402 | |||
384 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | 403 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); |
385 | 404 | ||
405 | extern void composite_disconnect(struct usb_gadget *gadget); | ||
406 | extern int composite_setup(struct usb_gadget *gadget, | ||
407 | const struct usb_ctrlrequest *ctrl); | ||
408 | |||
386 | /* | 409 | /* |
387 | * Some systems will need runtime overrides for the product identifiers | 410 | * Some systems will need runtime overrides for the product identifiers |
388 | * published in the device descriptor, either numbers or strings or both. | 411 | * published in the device descriptor, either numbers or strings or both. |
@@ -431,6 +454,54 @@ static inline u16 get_default_bcdDevice(void) | |||
431 | return bcdDevice; | 454 | return bcdDevice; |
432 | } | 455 | } |
433 | 456 | ||
457 | struct usb_function_driver { | ||
458 | const char *name; | ||
459 | struct module *mod; | ||
460 | struct list_head list; | ||
461 | struct usb_function_instance *(*alloc_inst)(void); | ||
462 | struct usb_function *(*alloc_func)(struct usb_function_instance *inst); | ||
463 | }; | ||
464 | |||
465 | struct usb_function_instance { | ||
466 | struct usb_function_driver *fd; | ||
467 | void (*free_func_inst)(struct usb_function_instance *inst); | ||
468 | }; | ||
469 | |||
470 | void usb_function_unregister(struct usb_function_driver *f); | ||
471 | int usb_function_register(struct usb_function_driver *newf); | ||
472 | void usb_put_function_instance(struct usb_function_instance *fi); | ||
473 | void usb_put_function(struct usb_function *f); | ||
474 | struct usb_function_instance *usb_get_function_instance(const char *name); | ||
475 | struct usb_function *usb_get_function(struct usb_function_instance *fi); | ||
476 | |||
477 | struct usb_configuration *usb_get_config(struct usb_composite_dev *cdev, | ||
478 | int val); | ||
479 | int usb_add_config_only(struct usb_composite_dev *cdev, | ||
480 | struct usb_configuration *config); | ||
481 | void usb_remove_function(struct usb_configuration *c, struct usb_function *f); | ||
482 | |||
483 | #define DECLARE_USB_FUNCTION(_name, _inst_alloc, _func_alloc) \ | ||
484 | static struct usb_function_driver _name ## usb_func = { \ | ||
485 | .name = __stringify(_name), \ | ||
486 | .mod = THIS_MODULE, \ | ||
487 | .alloc_inst = _inst_alloc, \ | ||
488 | .alloc_func = _func_alloc, \ | ||
489 | }; \ | ||
490 | MODULE_ALIAS("usbfunc:"__stringify(_name)); | ||
491 | |||
492 | #define DECLARE_USB_FUNCTION_INIT(_name, _inst_alloc, _func_alloc) \ | ||
493 | DECLARE_USB_FUNCTION(_name, _inst_alloc, _func_alloc) \ | ||
494 | static int __init _name ## mod_init(void) \ | ||
495 | { \ | ||
496 | return usb_function_register(&_name ## usb_func); \ | ||
497 | } \ | ||
498 | static void __exit _name ## mod_exit(void) \ | ||
499 | { \ | ||
500 | usb_function_unregister(&_name ## usb_func); \ | ||
501 | } \ | ||
502 | module_init(_name ## mod_init); \ | ||
503 | module_exit(_name ## mod_exit) | ||
504 | |||
434 | /* messaging utils */ | 505 | /* messaging utils */ |
435 | #define DBG(d, fmt, args...) \ | 506 | #define DBG(d, fmt, args...) \ |
436 | dev_dbg(&(d)->gadget->dev , fmt , ## args) | 507 | dev_dbg(&(d)->gadget->dev , fmt , ## args) |
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h new file mode 100644 index 000000000000..51eae14477f7 --- /dev/null +++ b/include/linux/usb/dwc3-omap.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 by Texas Instruments | ||
3 | * | ||
4 | * The Inventra Controller Driver for Linux is free software; you | ||
5 | * can redistribute it and/or modify it under the terms of the GNU | ||
6 | * General Public License version 2 as published by the Free Software | ||
7 | * Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __DWC3_OMAP_H__ | ||
11 | #define __DWC3_OMAP_H__ | ||
12 | |||
13 | enum omap_dwc3_vbus_id_status { | ||
14 | OMAP_DWC3_UNKNOWN = 0, | ||
15 | OMAP_DWC3_ID_GROUND, | ||
16 | OMAP_DWC3_ID_FLOAT, | ||
17 | OMAP_DWC3_VBUS_VALID, | ||
18 | OMAP_DWC3_VBUS_OFF, | ||
19 | }; | ||
20 | |||
21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) | ||
22 | extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); | ||
23 | #else | ||
24 | static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) | ||
25 | { | ||
26 | return; | ||
27 | } | ||
28 | #endif | ||
29 | |||
30 | #endif /* __DWC3_OMAP_H__ */ | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 0af6569b8cc6..2e297e80d59a 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -471,12 +471,6 @@ struct usb_gadget_ops { | |||
471 | struct usb_gadget_driver *); | 471 | struct usb_gadget_driver *); |
472 | int (*udc_stop)(struct usb_gadget *, | 472 | int (*udc_stop)(struct usb_gadget *, |
473 | struct usb_gadget_driver *); | 473 | struct usb_gadget_driver *); |
474 | |||
475 | /* Those two are deprecated */ | ||
476 | int (*start)(struct usb_gadget_driver *, | ||
477 | int (*bind)(struct usb_gadget *, | ||
478 | struct usb_gadget_driver *driver)); | ||
479 | int (*stop)(struct usb_gadget_driver *); | ||
480 | }; | 474 | }; |
481 | 475 | ||
482 | /** | 476 | /** |
@@ -880,6 +874,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); | |||
880 | 874 | ||
881 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | 875 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); |
882 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | 876 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); |
877 | extern int udc_attach_driver(const char *name, | ||
878 | struct usb_gadget_driver *driver); | ||
883 | 879 | ||
884 | /*-------------------------------------------------------------------------*/ | 880 | /*-------------------------------------------------------------------------*/ |
885 | 881 | ||
@@ -911,6 +907,11 @@ struct usb_gadget_strings { | |||
911 | struct usb_string *strings; | 907 | struct usb_string *strings; |
912 | }; | 908 | }; |
913 | 909 | ||
910 | struct usb_gadget_string_container { | ||
911 | struct list_head list; | ||
912 | u8 *stash[0]; | ||
913 | }; | ||
914 | |||
914 | /* put descriptor for string with that id into buf (buflen >= 256) */ | 915 | /* put descriptor for string with that id into buf (buflen >= 256) */ |
915 | int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); | 916 | int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); |
916 | 917 | ||
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb505250940a..053c26841cc3 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -99,6 +99,8 @@ struct musb_hdrc_platform_data { | |||
99 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ | 99 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ |
100 | u8 mode; | 100 | u8 mode; |
101 | 101 | ||
102 | u8 has_mailbox:1; | ||
103 | |||
102 | /* for clk_get() */ | 104 | /* for clk_get() */ |
103 | const char *clock; | 105 | const char *clock; |
104 | 106 | ||
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h new file mode 100644 index 000000000000..27b5b8c931b0 --- /dev/null +++ b/include/linux/usb/omap_control_usb.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * omap_control_usb.h - Header file for the USB part of control module. | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com | ||
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 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
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 | */ | ||
18 | |||
19 | #ifndef __OMAP_CONTROL_USB_H__ | ||
20 | #define __OMAP_CONTROL_USB_H__ | ||
21 | |||
22 | struct omap_control_usb { | ||
23 | struct device *dev; | ||
24 | |||
25 | u32 __iomem *dev_conf; | ||
26 | u32 __iomem *otghs_control; | ||
27 | u32 __iomem *phy_power; | ||
28 | |||
29 | struct clk *sys_clk; | ||
30 | |||
31 | u32 type; | ||
32 | }; | ||
33 | |||
34 | struct omap_control_usb_platform_data { | ||
35 | u8 type; | ||
36 | }; | ||
37 | |||
38 | enum omap_control_usb_mode { | ||
39 | USB_MODE_UNDEFINED = 0, | ||
40 | USB_MODE_HOST, | ||
41 | USB_MODE_DEVICE, | ||
42 | USB_MODE_DISCONNECT, | ||
43 | }; | ||
44 | |||
45 | /* To differentiate ctrl module IP having either mailbox or USB3 PHY power */ | ||
46 | #define OMAP_CTRL_DEV_TYPE1 0x1 | ||
47 | #define OMAP_CTRL_DEV_TYPE2 0x2 | ||
48 | |||
49 | #define OMAP_CTRL_DEV_PHY_PD BIT(0) | ||
50 | |||
51 | #define OMAP_CTRL_DEV_AVALID BIT(0) | ||
52 | #define OMAP_CTRL_DEV_BVALID BIT(1) | ||
53 | #define OMAP_CTRL_DEV_VBUSVALID BIT(2) | ||
54 | #define OMAP_CTRL_DEV_SESSEND BIT(3) | ||
55 | #define OMAP_CTRL_DEV_IDDIG BIT(4) | ||
56 | |||
57 | #define OMAP_CTRL_USB_PWRCTL_CLK_CMD_MASK 0x003FC000 | ||
58 | #define OMAP_CTRL_USB_PWRCTL_CLK_CMD_SHIFT 0xE | ||
59 | |||
60 | #define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_MASK 0xFFC00000 | ||
61 | #define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_SHIFT 0x16 | ||
62 | |||
63 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 | ||
64 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 | ||
65 | |||
66 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | ||
67 | extern struct device *omap_get_control_dev(void); | ||
68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | ||
69 | extern void omap_control_usb3_phy_power(struct device *dev, bool on); | ||
70 | extern void omap_control_usb_set_mode(struct device *dev, | ||
71 | enum omap_control_usb_mode mode); | ||
72 | #else | ||
73 | static inline struct device *omap_get_control_dev(void) | ||
74 | { | ||
75 | return ERR_PTR(-ENODEV); | ||
76 | } | ||
77 | |||
78 | static inline void omap_control_usb_phy_power(struct device *dev, int on) | ||
79 | { | ||
80 | } | ||
81 | |||
82 | static inline void omap_control_usb3_phy_power(struct device *dev, int on) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | static inline void omap_control_usb_set_mode(struct device *dev, | ||
87 | enum omap_control_usb_mode mode) | ||
88 | { | ||
89 | } | ||
90 | #endif | ||
91 | |||
92 | #endif /* __OMAP_CONTROL_USB_H__ */ | ||
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h index 0ea17f8ae820..6ae29360e1d2 100644 --- a/include/linux/usb/omap_usb.h +++ b/include/linux/usb/omap_usb.h | |||
@@ -19,19 +19,29 @@ | |||
19 | #ifndef __DRIVERS_OMAP_USB2_H | 19 | #ifndef __DRIVERS_OMAP_USB2_H |
20 | #define __DRIVERS_OMAP_USB2_H | 20 | #define __DRIVERS_OMAP_USB2_H |
21 | 21 | ||
22 | #include <linux/io.h> | ||
22 | #include <linux/usb/otg.h> | 23 | #include <linux/usb/otg.h> |
23 | 24 | ||
25 | struct usb_dpll_params { | ||
26 | u16 m; | ||
27 | u8 n; | ||
28 | u8 freq:3; | ||
29 | u8 sd; | ||
30 | u32 mf; | ||
31 | }; | ||
32 | |||
24 | struct omap_usb { | 33 | struct omap_usb { |
25 | struct usb_phy phy; | 34 | struct usb_phy phy; |
26 | struct phy_companion *comparator; | 35 | struct phy_companion *comparator; |
36 | void __iomem *pll_ctrl_base; | ||
27 | struct device *dev; | 37 | struct device *dev; |
28 | u32 __iomem *control_dev; | 38 | struct device *control_dev; |
29 | struct clk *wkupclk; | 39 | struct clk *wkupclk; |
40 | struct clk *sys_clk; | ||
41 | struct clk *optclk; | ||
30 | u8 is_suspended:1; | 42 | u8 is_suspended:1; |
31 | }; | 43 | }; |
32 | 44 | ||
33 | #define PHY_PD 0x1 | ||
34 | |||
35 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) | 45 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) |
36 | 46 | ||
37 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) | 47 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) |
@@ -43,4 +53,15 @@ static inline int omap_usb2_set_comparator(struct phy_companion *comparator) | |||
43 | } | 53 | } |
44 | #endif | 54 | #endif |
45 | 55 | ||
56 | static inline u32 omap_usb_readl(void __iomem *addr, unsigned offset) | ||
57 | { | ||
58 | return __raw_readl(addr + offset); | ||
59 | } | ||
60 | |||
61 | static inline void omap_usb_writel(void __iomem *addr, unsigned offset, | ||
62 | u32 data) | ||
63 | { | ||
64 | __raw_writel(data, addr + offset); | ||
65 | } | ||
66 | |||
46 | #endif /* __DRIVERS_OMAP_USB_H */ | 67 | #endif /* __DRIVERS_OMAP_USB_H */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index a29ae1eb9346..15847cbdb512 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -106,9 +106,25 @@ struct usb_phy { | |||
106 | enum usb_device_speed speed); | 106 | enum usb_device_speed speed); |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /** | ||
110 | * struct usb_phy_bind - represent the binding for the phy | ||
111 | * @dev_name: the device name of the device that will bind to the phy | ||
112 | * @phy_dev_name: the device name of the phy | ||
113 | * @index: used if a single controller uses multiple phys | ||
114 | * @phy: reference to the phy | ||
115 | * @list: to maintain a linked list of the binding information | ||
116 | */ | ||
117 | struct usb_phy_bind { | ||
118 | const char *dev_name; | ||
119 | const char *phy_dev_name; | ||
120 | u8 index; | ||
121 | struct usb_phy *phy; | ||
122 | struct list_head list; | ||
123 | }; | ||
109 | 124 | ||
110 | /* for board-specific init logic */ | 125 | /* for board-specific init logic */ |
111 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | 126 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); |
127 | extern int usb_add_phy_dev(struct usb_phy *); | ||
112 | extern void usb_remove_phy(struct usb_phy *); | 128 | extern void usb_remove_phy(struct usb_phy *); |
113 | 129 | ||
114 | /* helpers for direct access thru low-level io interface */ | 130 | /* helpers for direct access thru low-level io interface */ |
@@ -149,8 +165,14 @@ usb_phy_shutdown(struct usb_phy *x) | |||
149 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | 165 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
150 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | 166 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, |
151 | enum usb_phy_type type); | 167 | enum usb_phy_type type); |
168 | extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index); | ||
169 | extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index); | ||
170 | extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | ||
171 | const char *phandle, u8 index); | ||
152 | extern void usb_put_phy(struct usb_phy *); | 172 | extern void usb_put_phy(struct usb_phy *); |
153 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | 173 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); |
174 | extern int usb_bind_phy(const char *dev_name, u8 index, | ||
175 | const char *phy_dev_name); | ||
154 | #else | 176 | #else |
155 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 177 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
156 | { | 178 | { |
@@ -163,6 +185,22 @@ static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | |||
163 | return NULL; | 185 | return NULL; |
164 | } | 186 | } |
165 | 187 | ||
188 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) | ||
189 | { | ||
190 | return NULL; | ||
191 | } | ||
192 | |||
193 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) | ||
194 | { | ||
195 | return NULL; | ||
196 | } | ||
197 | |||
198 | static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | ||
199 | const char *phandle, u8 index) | ||
200 | { | ||
201 | return NULL; | ||
202 | } | ||
203 | |||
166 | static inline void usb_put_phy(struct usb_phy *x) | 204 | static inline void usb_put_phy(struct usb_phy *x) |
167 | { | 205 | { |
168 | } | 206 | } |
@@ -171,6 +209,11 @@ static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | |||
171 | { | 209 | { |
172 | } | 210 | } |
173 | 211 | ||
212 | static inline int usb_bind_phy(const char *dev_name, u8 index, | ||
213 | const char *phy_dev_name) | ||
214 | { | ||
215 | return -EOPNOTSUPP; | ||
216 | } | ||
174 | #endif | 217 | #endif |
175 | 218 | ||
176 | static inline int | 219 | static inline int |
diff --git a/include/linux/usb/samsung_usb_phy.h b/include/linux/usb/samsung_usb_phy.h new file mode 100644 index 000000000000..916782699f1c --- /dev/null +++ b/include/linux/usb/samsung_usb_phy.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Samsung Electronics Co.Ltd | ||
3 | * http://www.samsung.com/ | ||
4 | * | ||
5 | * Defines phy types for samsung usb phy controllers - HOST or DEIVCE. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | enum samsung_usb_phy_type { | ||
14 | USB_PHY_TYPE_DEVICE, | ||
15 | USB_PHY_TYPE_HOST, | ||
16 | }; | ||
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 176b1ca06ae4..9ebebe906925 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h | |||
@@ -59,22 +59,24 @@ struct tegra_usb_phy { | |||
59 | struct usb_phy *ulpi; | 59 | struct usb_phy *ulpi; |
60 | struct usb_phy u_phy; | 60 | struct usb_phy u_phy; |
61 | struct device *dev; | 61 | struct device *dev; |
62 | bool is_legacy_phy; | ||
63 | bool is_ulpi_phy; | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | 66 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, |
65 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); | 67 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); |
66 | 68 | ||
67 | void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy); | 69 | void tegra_usb_phy_preresume(struct usb_phy *phy); |
68 | 70 | ||
69 | void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy); | 71 | void tegra_usb_phy_postresume(struct usb_phy *phy); |
70 | 72 | ||
71 | void tegra_usb_phy_preresume(struct tegra_usb_phy *phy); | 73 | void tegra_ehci_phy_restore_start(struct usb_phy *phy, |
74 | enum tegra_usb_phy_port_speed port_speed); | ||
72 | 75 | ||
73 | void tegra_usb_phy_postresume(struct tegra_usb_phy *phy); | 76 | void tegra_ehci_phy_restore_end(struct usb_phy *phy); |
74 | 77 | ||
75 | void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, | 78 | void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val); |
76 | enum tegra_usb_phy_port_speed port_speed); | ||
77 | 79 | ||
78 | void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy); | 80 | void tegra_ehci_set_phcd(struct usb_phy *x, bool enable); |
79 | 81 | ||
80 | #endif /* __TEGRA_USB_PHY_H */ | 82 | #endif /* __TEGRA_USB_PHY_H */ |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index b9bd2e6c73cc..4ce009324933 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -21,7 +21,7 @@ struct user_namespace { | |||
21 | struct uid_gid_map uid_map; | 21 | struct uid_gid_map uid_map; |
22 | struct uid_gid_map gid_map; | 22 | struct uid_gid_map gid_map; |
23 | struct uid_gid_map projid_map; | 23 | struct uid_gid_map projid_map; |
24 | struct kref kref; | 24 | atomic_t count; |
25 | struct user_namespace *parent; | 25 | struct user_namespace *parent; |
26 | kuid_t owner; | 26 | kuid_t owner; |
27 | kgid_t group; | 27 | kgid_t group; |
@@ -35,18 +35,18 @@ extern struct user_namespace init_user_ns; | |||
35 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | 35 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) |
36 | { | 36 | { |
37 | if (ns) | 37 | if (ns) |
38 | kref_get(&ns->kref); | 38 | atomic_inc(&ns->count); |
39 | return ns; | 39 | return ns; |
40 | } | 40 | } |
41 | 41 | ||
42 | extern int create_user_ns(struct cred *new); | 42 | extern int create_user_ns(struct cred *new); |
43 | extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred); | 43 | extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred); |
44 | extern void free_user_ns(struct kref *kref); | 44 | extern void free_user_ns(struct user_namespace *ns); |
45 | 45 | ||
46 | static inline void put_user_ns(struct user_namespace *ns) | 46 | static inline void put_user_ns(struct user_namespace *ns) |
47 | { | 47 | { |
48 | if (ns) | 48 | if (ns && atomic_dec_and_test(&ns->count)) |
49 | kref_put(&ns->kref, free_user_ns); | 49 | free_user_ns(ns); |
50 | } | 50 | } |
51 | 51 | ||
52 | struct seq_operations; | 52 | struct seq_operations; |
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index c52215ff4245..75818744ab59 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h | |||
@@ -27,6 +27,14 @@ | |||
27 | #define VEXPRESS_GPIO_MMC_CARDIN 0 | 27 | #define VEXPRESS_GPIO_MMC_CARDIN 0 |
28 | #define VEXPRESS_GPIO_MMC_WPROT 1 | 28 | #define VEXPRESS_GPIO_MMC_WPROT 1 |
29 | #define VEXPRESS_GPIO_FLASH_WPn 2 | 29 | #define VEXPRESS_GPIO_FLASH_WPn 2 |
30 | #define VEXPRESS_GPIO_LED0 3 | ||
31 | #define VEXPRESS_GPIO_LED1 4 | ||
32 | #define VEXPRESS_GPIO_LED2 5 | ||
33 | #define VEXPRESS_GPIO_LED3 6 | ||
34 | #define VEXPRESS_GPIO_LED4 7 | ||
35 | #define VEXPRESS_GPIO_LED5 8 | ||
36 | #define VEXPRESS_GPIO_LED6 9 | ||
37 | #define VEXPRESS_GPIO_LED7 10 | ||
30 | 38 | ||
31 | #define VEXPRESS_RES_FUNC(_site, _func) \ | 39 | #define VEXPRESS_RES_FUNC(_site, _func) \ |
32 | { \ | 40 | { \ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index cf8adb1f5b2c..ff6714e6d0f5 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -78,7 +78,7 @@ struct virtio_device { | |||
78 | int index; | 78 | int index; |
79 | struct device dev; | 79 | struct device dev; |
80 | struct virtio_device_id id; | 80 | struct virtio_device_id id; |
81 | struct virtio_config_ops *config; | 81 | const struct virtio_config_ops *config; |
82 | struct list_head vqs; | 82 | struct list_head vqs; |
83 | /* Note that this is a Linux set_bit-style bitmap. */ | 83 | /* Note that this is a Linux set_bit-style bitmap. */ |
84 | unsigned long features[1]; | 84 | unsigned long features[1]; |
@@ -126,4 +126,13 @@ static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv) | |||
126 | 126 | ||
127 | int register_virtio_driver(struct virtio_driver *drv); | 127 | int register_virtio_driver(struct virtio_driver *drv); |
128 | void unregister_virtio_driver(struct virtio_driver *drv); | 128 | void unregister_virtio_driver(struct virtio_driver *drv); |
129 | |||
130 | /* module_virtio_driver() - Helper macro for drivers that don't do | ||
131 | * anything special in module init/exit. This eliminates a lot of | ||
132 | * boilerplate. Each module may only use this macro once, and | ||
133 | * calling it replaces module_init() and module_exit() | ||
134 | */ | ||
135 | #define module_virtio_driver(__virtio_driver) \ | ||
136 | module_driver(__virtio_driver, register_virtio_driver, \ | ||
137 | unregister_virtio_driver) | ||
129 | #endif /* _LINUX_VIRTIO_H */ | 138 | #endif /* _LINUX_VIRTIO_H */ |
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index fce0a2799d43..bd6cf61142be 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
@@ -36,7 +36,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
36 | #endif | 36 | #endif |
37 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, | 37 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, |
38 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, | 38 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, |
39 | KSWAPD_SKIP_CONGESTION_WAIT, | ||
40 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 39 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
41 | #ifdef CONFIG_NUMA_BALANCING | 40 | #ifdef CONFIG_NUMA_BALANCING |
42 | NUMA_PTE_UPDATES, | 41 | NUMA_PTE_UPDATES, |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index a13291f7da88..5fd71a7d0dfd 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -85,7 +85,7 @@ static inline void vm_events_fold_cpu(int cpu) | |||
85 | #define count_vm_numa_events(x, y) count_vm_events(x, y) | 85 | #define count_vm_numa_events(x, y) count_vm_events(x, y) |
86 | #else | 86 | #else |
87 | #define count_vm_numa_event(x) do {} while (0) | 87 | #define count_vm_numa_event(x) do {} while (0) |
88 | #define count_vm_numa_events(x, y) do {} while (0) | 88 | #define count_vm_numa_events(x, y) do { (void)(y); } while (0) |
89 | #endif /* CONFIG_NUMA_BALANCING */ | 89 | #endif /* CONFIG_NUMA_BALANCING */ |
90 | 90 | ||
91 | #define __count_zone_vm_events(item, zone, delta) \ | 91 | #define __count_zone_vm_events(item, zone, delta) \ |
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h new file mode 100644 index 000000000000..023430e265fe --- /dev/null +++ b/include/linux/vmw_vmci_api.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * VMware VMCI Driver | ||
3 | * | ||
4 | * Copyright (C) 2012 VMware, Inc. All rights reserved. | ||
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 version 2 and no later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
12 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
13 | * for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __VMW_VMCI_API_H__ | ||
17 | #define __VMW_VMCI_API_H__ | ||
18 | |||
19 | #include <linux/uidgid.h> | ||
20 | #include <linux/vmw_vmci_defs.h> | ||
21 | |||
22 | #undef VMCI_KERNEL_API_VERSION | ||
23 | #define VMCI_KERNEL_API_VERSION_1 1 | ||
24 | #define VMCI_KERNEL_API_VERSION_2 2 | ||
25 | #define VMCI_KERNEL_API_VERSION VMCI_KERNEL_API_VERSION_2 | ||
26 | |||
27 | typedef void (vmci_device_shutdown_fn) (void *device_registration, | ||
28 | void *user_data); | ||
29 | |||
30 | int vmci_datagram_create_handle(u32 resource_id, u32 flags, | ||
31 | vmci_datagram_recv_cb recv_cb, | ||
32 | void *client_data, | ||
33 | struct vmci_handle *out_handle); | ||
34 | int vmci_datagram_create_handle_priv(u32 resource_id, u32 flags, u32 priv_flags, | ||
35 | vmci_datagram_recv_cb recv_cb, | ||
36 | void *client_data, | ||
37 | struct vmci_handle *out_handle); | ||
38 | int vmci_datagram_destroy_handle(struct vmci_handle handle); | ||
39 | int vmci_datagram_send(struct vmci_datagram *msg); | ||
40 | int vmci_doorbell_create(struct vmci_handle *handle, u32 flags, | ||
41 | u32 priv_flags, | ||
42 | vmci_callback notify_cb, void *client_data); | ||
43 | int vmci_doorbell_destroy(struct vmci_handle handle); | ||
44 | int vmci_doorbell_notify(struct vmci_handle handle, u32 priv_flags); | ||
45 | u32 vmci_get_context_id(void); | ||
46 | bool vmci_is_context_owner(u32 context_id, kuid_t uid); | ||
47 | |||
48 | int vmci_event_subscribe(u32 event, | ||
49 | vmci_event_cb callback, void *callback_data, | ||
50 | u32 *subid); | ||
51 | int vmci_event_unsubscribe(u32 subid); | ||
52 | u32 vmci_context_get_priv_flags(u32 context_id); | ||
53 | int vmci_qpair_alloc(struct vmci_qp **qpair, | ||
54 | struct vmci_handle *handle, | ||
55 | u64 produce_qsize, | ||
56 | u64 consume_qsize, | ||
57 | u32 peer, u32 flags, u32 priv_flags); | ||
58 | int vmci_qpair_detach(struct vmci_qp **qpair); | ||
59 | int vmci_qpair_get_produce_indexes(const struct vmci_qp *qpair, | ||
60 | u64 *producer_tail, | ||
61 | u64 *consumer_head); | ||
62 | int vmci_qpair_get_consume_indexes(const struct vmci_qp *qpair, | ||
63 | u64 *consumer_tail, | ||
64 | u64 *producer_head); | ||
65 | s64 vmci_qpair_produce_free_space(const struct vmci_qp *qpair); | ||
66 | s64 vmci_qpair_produce_buf_ready(const struct vmci_qp *qpair); | ||
67 | s64 vmci_qpair_consume_free_space(const struct vmci_qp *qpair); | ||
68 | s64 vmci_qpair_consume_buf_ready(const struct vmci_qp *qpair); | ||
69 | ssize_t vmci_qpair_enqueue(struct vmci_qp *qpair, | ||
70 | const void *buf, size_t buf_size, int mode); | ||
71 | ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair, | ||
72 | void *buf, size_t buf_size, int mode); | ||
73 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, | ||
74 | int mode); | ||
75 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, | ||
76 | void *iov, size_t iov_size, int mode); | ||
77 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | ||
78 | void *iov, size_t iov_size, int mode); | ||
79 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, void *iov, size_t iov_size, | ||
80 | int mode); | ||
81 | |||
82 | #endif /* !__VMW_VMCI_API_H__ */ | ||
diff --git a/include/linux/vmw_vmci_defs.h b/include/linux/vmw_vmci_defs.h new file mode 100644 index 000000000000..65ac54c61c18 --- /dev/null +++ b/include/linux/vmw_vmci_defs.h | |||
@@ -0,0 +1,880 @@ | |||
1 | /* | ||
2 | * VMware VMCI Driver | ||
3 | * | ||
4 | * Copyright (C) 2012 VMware, Inc. All rights reserved. | ||
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 version 2 and no later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
12 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
13 | * for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _VMW_VMCI_DEF_H_ | ||
17 | #define _VMW_VMCI_DEF_H_ | ||
18 | |||
19 | #include <linux/atomic.h> | ||
20 | |||
21 | /* Register offsets. */ | ||
22 | #define VMCI_STATUS_ADDR 0x00 | ||
23 | #define VMCI_CONTROL_ADDR 0x04 | ||
24 | #define VMCI_ICR_ADDR 0x08 | ||
25 | #define VMCI_IMR_ADDR 0x0c | ||
26 | #define VMCI_DATA_OUT_ADDR 0x10 | ||
27 | #define VMCI_DATA_IN_ADDR 0x14 | ||
28 | #define VMCI_CAPS_ADDR 0x18 | ||
29 | #define VMCI_RESULT_LOW_ADDR 0x1c | ||
30 | #define VMCI_RESULT_HIGH_ADDR 0x20 | ||
31 | |||
32 | /* Max number of devices. */ | ||
33 | #define VMCI_MAX_DEVICES 1 | ||
34 | |||
35 | /* Status register bits. */ | ||
36 | #define VMCI_STATUS_INT_ON 0x1 | ||
37 | |||
38 | /* Control register bits. */ | ||
39 | #define VMCI_CONTROL_RESET 0x1 | ||
40 | #define VMCI_CONTROL_INT_ENABLE 0x2 | ||
41 | #define VMCI_CONTROL_INT_DISABLE 0x4 | ||
42 | |||
43 | /* Capabilities register bits. */ | ||
44 | #define VMCI_CAPS_HYPERCALL 0x1 | ||
45 | #define VMCI_CAPS_GUESTCALL 0x2 | ||
46 | #define VMCI_CAPS_DATAGRAM 0x4 | ||
47 | #define VMCI_CAPS_NOTIFICATIONS 0x8 | ||
48 | |||
49 | /* Interrupt Cause register bits. */ | ||
50 | #define VMCI_ICR_DATAGRAM 0x1 | ||
51 | #define VMCI_ICR_NOTIFICATION 0x2 | ||
52 | |||
53 | /* Interrupt Mask register bits. */ | ||
54 | #define VMCI_IMR_DATAGRAM 0x1 | ||
55 | #define VMCI_IMR_NOTIFICATION 0x2 | ||
56 | |||
57 | /* Interrupt type. */ | ||
58 | enum { | ||
59 | VMCI_INTR_TYPE_INTX = 0, | ||
60 | VMCI_INTR_TYPE_MSI = 1, | ||
61 | VMCI_INTR_TYPE_MSIX = 2, | ||
62 | }; | ||
63 | |||
64 | /* Maximum MSI/MSI-X interrupt vectors in the device. */ | ||
65 | #define VMCI_MAX_INTRS 2 | ||
66 | |||
67 | /* | ||
68 | * Supported interrupt vectors. There is one for each ICR value above, | ||
69 | * but here they indicate the position in the vector array/message ID. | ||
70 | */ | ||
71 | enum { | ||
72 | VMCI_INTR_DATAGRAM = 0, | ||
73 | VMCI_INTR_NOTIFICATION = 1, | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * A single VMCI device has an upper limit of 128MB on the amount of | ||
78 | * memory that can be used for queue pairs. | ||
79 | */ | ||
80 | #define VMCI_MAX_GUEST_QP_MEMORY (128 * 1024 * 1024) | ||
81 | |||
82 | /* | ||
83 | * Queues with pre-mapped data pages must be small, so that we don't pin | ||
84 | * too much kernel memory (especially on vmkernel). We limit a queuepair to | ||
85 | * 32 KB, or 16 KB per queue for symmetrical pairs. | ||
86 | */ | ||
87 | #define VMCI_MAX_PINNED_QP_MEMORY (32 * 1024) | ||
88 | |||
89 | /* | ||
90 | * We have a fixed set of resource IDs available in the VMX. | ||
91 | * This allows us to have a very simple implementation since we statically | ||
92 | * know how many will create datagram handles. If a new caller arrives and | ||
93 | * we have run out of slots we can manually increment the maximum size of | ||
94 | * available resource IDs. | ||
95 | * | ||
96 | * VMCI reserved hypervisor datagram resource IDs. | ||
97 | */ | ||
98 | enum { | ||
99 | VMCI_RESOURCES_QUERY = 0, | ||
100 | VMCI_GET_CONTEXT_ID = 1, | ||
101 | VMCI_SET_NOTIFY_BITMAP = 2, | ||
102 | VMCI_DOORBELL_LINK = 3, | ||
103 | VMCI_DOORBELL_UNLINK = 4, | ||
104 | VMCI_DOORBELL_NOTIFY = 5, | ||
105 | /* | ||
106 | * VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP are | ||
107 | * obsoleted by the removal of VM to VM communication. | ||
108 | */ | ||
109 | VMCI_DATAGRAM_REQUEST_MAP = 6, | ||
110 | VMCI_DATAGRAM_REMOVE_MAP = 7, | ||
111 | VMCI_EVENT_SUBSCRIBE = 8, | ||
112 | VMCI_EVENT_UNSUBSCRIBE = 9, | ||
113 | VMCI_QUEUEPAIR_ALLOC = 10, | ||
114 | VMCI_QUEUEPAIR_DETACH = 11, | ||
115 | |||
116 | /* | ||
117 | * VMCI_VSOCK_VMX_LOOKUP was assigned to 12 for Fusion 3.0/3.1, | ||
118 | * WS 7.0/7.1 and ESX 4.1 | ||
119 | */ | ||
120 | VMCI_HGFS_TRANSPORT = 13, | ||
121 | VMCI_UNITY_PBRPC_REGISTER = 14, | ||
122 | VMCI_RPC_PRIVILEGED = 15, | ||
123 | VMCI_RPC_UNPRIVILEGED = 16, | ||
124 | VMCI_RESOURCE_MAX = 17, | ||
125 | }; | ||
126 | |||
127 | /* | ||
128 | * struct vmci_handle - Ownership information structure | ||
129 | * @context: The VMX context ID. | ||
130 | * @resource: The resource ID (used for locating in resource hash). | ||
131 | * | ||
132 | * The vmci_handle structure is used to track resources used within | ||
133 | * vmw_vmci. | ||
134 | */ | ||
135 | struct vmci_handle { | ||
136 | u32 context; | ||
137 | u32 resource; | ||
138 | }; | ||
139 | |||
140 | #define vmci_make_handle(_cid, _rid) \ | ||
141 | (struct vmci_handle){ .context = _cid, .resource = _rid } | ||
142 | |||
143 | static inline bool vmci_handle_is_equal(struct vmci_handle h1, | ||
144 | struct vmci_handle h2) | ||
145 | { | ||
146 | return h1.context == h2.context && h1.resource == h2.resource; | ||
147 | } | ||
148 | |||
149 | #define VMCI_INVALID_ID ~0 | ||
150 | static const struct vmci_handle VMCI_INVALID_HANDLE = { | ||
151 | .context = VMCI_INVALID_ID, | ||
152 | .resource = VMCI_INVALID_ID | ||
153 | }; | ||
154 | |||
155 | static inline bool vmci_handle_is_invalid(struct vmci_handle h) | ||
156 | { | ||
157 | return vmci_handle_is_equal(h, VMCI_INVALID_HANDLE); | ||
158 | } | ||
159 | |||
160 | /* | ||
161 | * The below defines can be used to send anonymous requests. | ||
162 | * This also indicates that no response is expected. | ||
163 | */ | ||
164 | #define VMCI_ANON_SRC_CONTEXT_ID VMCI_INVALID_ID | ||
165 | #define VMCI_ANON_SRC_RESOURCE_ID VMCI_INVALID_ID | ||
166 | static const struct vmci_handle VMCI_ANON_SRC_HANDLE = { | ||
167 | .context = VMCI_ANON_SRC_CONTEXT_ID, | ||
168 | .resource = VMCI_ANON_SRC_RESOURCE_ID | ||
169 | }; | ||
170 | |||
171 | /* The lowest 16 context ids are reserved for internal use. */ | ||
172 | #define VMCI_RESERVED_CID_LIMIT ((u32) 16) | ||
173 | |||
174 | /* | ||
175 | * Hypervisor context id, used for calling into hypervisor | ||
176 | * supplied services from the VM. | ||
177 | */ | ||
178 | #define VMCI_HYPERVISOR_CONTEXT_ID 0 | ||
179 | |||
180 | /* | ||
181 | * Well-known context id, a logical context that contains a set of | ||
182 | * well-known services. This context ID is now obsolete. | ||
183 | */ | ||
184 | #define VMCI_WELL_KNOWN_CONTEXT_ID 1 | ||
185 | |||
186 | /* | ||
187 | * Context ID used by host endpoints. | ||
188 | */ | ||
189 | #define VMCI_HOST_CONTEXT_ID 2 | ||
190 | |||
191 | #define VMCI_CONTEXT_IS_VM(_cid) (VMCI_INVALID_ID != (_cid) && \ | ||
192 | (_cid) > VMCI_HOST_CONTEXT_ID) | ||
193 | |||
194 | /* | ||
195 | * The VMCI_CONTEXT_RESOURCE_ID is used together with vmci_make_handle to make | ||
196 | * handles that refer to a specific context. | ||
197 | */ | ||
198 | #define VMCI_CONTEXT_RESOURCE_ID 0 | ||
199 | |||
200 | /* | ||
201 | * VMCI error codes. | ||
202 | */ | ||
203 | enum { | ||
204 | VMCI_SUCCESS_QUEUEPAIR_ATTACH = 5, | ||
205 | VMCI_SUCCESS_QUEUEPAIR_CREATE = 4, | ||
206 | VMCI_SUCCESS_LAST_DETACH = 3, | ||
207 | VMCI_SUCCESS_ACCESS_GRANTED = 2, | ||
208 | VMCI_SUCCESS_ENTRY_DEAD = 1, | ||
209 | VMCI_SUCCESS = 0, | ||
210 | VMCI_ERROR_INVALID_RESOURCE = (-1), | ||
211 | VMCI_ERROR_INVALID_ARGS = (-2), | ||
212 | VMCI_ERROR_NO_MEM = (-3), | ||
213 | VMCI_ERROR_DATAGRAM_FAILED = (-4), | ||
214 | VMCI_ERROR_MORE_DATA = (-5), | ||
215 | VMCI_ERROR_NO_MORE_DATAGRAMS = (-6), | ||
216 | VMCI_ERROR_NO_ACCESS = (-7), | ||
217 | VMCI_ERROR_NO_HANDLE = (-8), | ||
218 | VMCI_ERROR_DUPLICATE_ENTRY = (-9), | ||
219 | VMCI_ERROR_DST_UNREACHABLE = (-10), | ||
220 | VMCI_ERROR_PAYLOAD_TOO_LARGE = (-11), | ||
221 | VMCI_ERROR_INVALID_PRIV = (-12), | ||
222 | VMCI_ERROR_GENERIC = (-13), | ||
223 | VMCI_ERROR_PAGE_ALREADY_SHARED = (-14), | ||
224 | VMCI_ERROR_CANNOT_SHARE_PAGE = (-15), | ||
225 | VMCI_ERROR_CANNOT_UNSHARE_PAGE = (-16), | ||
226 | VMCI_ERROR_NO_PROCESS = (-17), | ||
227 | VMCI_ERROR_NO_DATAGRAM = (-18), | ||
228 | VMCI_ERROR_NO_RESOURCES = (-19), | ||
229 | VMCI_ERROR_UNAVAILABLE = (-20), | ||
230 | VMCI_ERROR_NOT_FOUND = (-21), | ||
231 | VMCI_ERROR_ALREADY_EXISTS = (-22), | ||
232 | VMCI_ERROR_NOT_PAGE_ALIGNED = (-23), | ||
233 | VMCI_ERROR_INVALID_SIZE = (-24), | ||
234 | VMCI_ERROR_REGION_ALREADY_SHARED = (-25), | ||
235 | VMCI_ERROR_TIMEOUT = (-26), | ||
236 | VMCI_ERROR_DATAGRAM_INCOMPLETE = (-27), | ||
237 | VMCI_ERROR_INCORRECT_IRQL = (-28), | ||
238 | VMCI_ERROR_EVENT_UNKNOWN = (-29), | ||
239 | VMCI_ERROR_OBSOLETE = (-30), | ||
240 | VMCI_ERROR_QUEUEPAIR_MISMATCH = (-31), | ||
241 | VMCI_ERROR_QUEUEPAIR_NOTSET = (-32), | ||
242 | VMCI_ERROR_QUEUEPAIR_NOTOWNER = (-33), | ||
243 | VMCI_ERROR_QUEUEPAIR_NOTATTACHED = (-34), | ||
244 | VMCI_ERROR_QUEUEPAIR_NOSPACE = (-35), | ||
245 | VMCI_ERROR_QUEUEPAIR_NODATA = (-36), | ||
246 | VMCI_ERROR_BUSMEM_INVALIDATION = (-37), | ||
247 | VMCI_ERROR_MODULE_NOT_LOADED = (-38), | ||
248 | VMCI_ERROR_DEVICE_NOT_FOUND = (-39), | ||
249 | VMCI_ERROR_QUEUEPAIR_NOT_READY = (-40), | ||
250 | VMCI_ERROR_WOULD_BLOCK = (-41), | ||
251 | |||
252 | /* VMCI clients should return error code within this range */ | ||
253 | VMCI_ERROR_CLIENT_MIN = (-500), | ||
254 | VMCI_ERROR_CLIENT_MAX = (-550), | ||
255 | |||
256 | /* Internal error codes. */ | ||
257 | VMCI_SHAREDMEM_ERROR_BAD_CONTEXT = (-1000), | ||
258 | }; | ||
259 | |||
260 | /* VMCI reserved events. */ | ||
261 | enum { | ||
262 | /* Only applicable to guest endpoints */ | ||
263 | VMCI_EVENT_CTX_ID_UPDATE = 0, | ||
264 | |||
265 | /* Applicable to guest and host */ | ||
266 | VMCI_EVENT_CTX_REMOVED = 1, | ||
267 | |||
268 | /* Only applicable to guest endpoints */ | ||
269 | VMCI_EVENT_QP_RESUMED = 2, | ||
270 | |||
271 | /* Applicable to guest and host */ | ||
272 | VMCI_EVENT_QP_PEER_ATTACH = 3, | ||
273 | |||
274 | /* Applicable to guest and host */ | ||
275 | VMCI_EVENT_QP_PEER_DETACH = 4, | ||
276 | |||
277 | /* | ||
278 | * Applicable to VMX and vmk. On vmk, | ||
279 | * this event has the Context payload type. | ||
280 | */ | ||
281 | VMCI_EVENT_MEM_ACCESS_ON = 5, | ||
282 | |||
283 | /* | ||
284 | * Applicable to VMX and vmk. Same as | ||
285 | * above for the payload type. | ||
286 | */ | ||
287 | VMCI_EVENT_MEM_ACCESS_OFF = 6, | ||
288 | VMCI_EVENT_MAX = 7, | ||
289 | }; | ||
290 | |||
291 | /* | ||
292 | * Of the above events, a few are reserved for use in the VMX, and | ||
293 | * other endpoints (guest and host kernel) should not use them. For | ||
294 | * the rest of the events, we allow both host and guest endpoints to | ||
295 | * subscribe to them, to maintain the same API for host and guest | ||
296 | * endpoints. | ||
297 | */ | ||
298 | #define VMCI_EVENT_VALID_VMX(_event) ((_event) == VMCI_EVENT_MEM_ACCESS_ON || \ | ||
299 | (_event) == VMCI_EVENT_MEM_ACCESS_OFF) | ||
300 | |||
301 | #define VMCI_EVENT_VALID(_event) ((_event) < VMCI_EVENT_MAX && \ | ||
302 | !VMCI_EVENT_VALID_VMX(_event)) | ||
303 | |||
304 | /* Reserved guest datagram resource ids. */ | ||
305 | #define VMCI_EVENT_HANDLER 0 | ||
306 | |||
307 | /* | ||
308 | * VMCI coarse-grained privileges (per context or host | ||
309 | * process/endpoint. An entity with the restricted flag is only | ||
310 | * allowed to interact with the hypervisor and trusted entities. | ||
311 | */ | ||
312 | enum { | ||
313 | VMCI_NO_PRIVILEGE_FLAGS = 0, | ||
314 | VMCI_PRIVILEGE_FLAG_RESTRICTED = 1, | ||
315 | VMCI_PRIVILEGE_FLAG_TRUSTED = 2, | ||
316 | VMCI_PRIVILEGE_ALL_FLAGS = (VMCI_PRIVILEGE_FLAG_RESTRICTED | | ||
317 | VMCI_PRIVILEGE_FLAG_TRUSTED), | ||
318 | VMCI_DEFAULT_PROC_PRIVILEGE_FLAGS = VMCI_NO_PRIVILEGE_FLAGS, | ||
319 | VMCI_LEAST_PRIVILEGE_FLAGS = VMCI_PRIVILEGE_FLAG_RESTRICTED, | ||
320 | VMCI_MAX_PRIVILEGE_FLAGS = VMCI_PRIVILEGE_FLAG_TRUSTED, | ||
321 | }; | ||
322 | |||
323 | /* 0 through VMCI_RESERVED_RESOURCE_ID_MAX are reserved. */ | ||
324 | #define VMCI_RESERVED_RESOURCE_ID_MAX 1023 | ||
325 | |||
326 | /* | ||
327 | * Driver version. | ||
328 | * | ||
329 | * Increment major version when you make an incompatible change. | ||
330 | * Compatibility goes both ways (old driver with new executable | ||
331 | * as well as new driver with old executable). | ||
332 | */ | ||
333 | |||
334 | /* Never change VMCI_VERSION_SHIFT_WIDTH */ | ||
335 | #define VMCI_VERSION_SHIFT_WIDTH 16 | ||
336 | #define VMCI_MAKE_VERSION(_major, _minor) \ | ||
337 | ((_major) << VMCI_VERSION_SHIFT_WIDTH | (u16) (_minor)) | ||
338 | |||
339 | #define VMCI_VERSION_MAJOR(v) ((u32) (v) >> VMCI_VERSION_SHIFT_WIDTH) | ||
340 | #define VMCI_VERSION_MINOR(v) ((u16) (v)) | ||
341 | |||
342 | /* | ||
343 | * VMCI_VERSION is always the current version. Subsequently listed | ||
344 | * versions are ways of detecting previous versions of the connecting | ||
345 | * application (i.e., VMX). | ||
346 | * | ||
347 | * VMCI_VERSION_NOVMVM: This version removed support for VM to VM | ||
348 | * communication. | ||
349 | * | ||
350 | * VMCI_VERSION_NOTIFY: This version introduced doorbell notification | ||
351 | * support. | ||
352 | * | ||
353 | * VMCI_VERSION_HOSTQP: This version introduced host end point support | ||
354 | * for hosted products. | ||
355 | * | ||
356 | * VMCI_VERSION_PREHOSTQP: This is the version prior to the adoption of | ||
357 | * support for host end-points. | ||
358 | * | ||
359 | * VMCI_VERSION_PREVERS2: This fictional version number is intended to | ||
360 | * represent the version of a VMX which doesn't call into the driver | ||
361 | * with ioctl VERSION2 and thus doesn't establish its version with the | ||
362 | * driver. | ||
363 | */ | ||
364 | |||
365 | #define VMCI_VERSION VMCI_VERSION_NOVMVM | ||
366 | #define VMCI_VERSION_NOVMVM VMCI_MAKE_VERSION(11, 0) | ||
367 | #define VMCI_VERSION_NOTIFY VMCI_MAKE_VERSION(10, 0) | ||
368 | #define VMCI_VERSION_HOSTQP VMCI_MAKE_VERSION(9, 0) | ||
369 | #define VMCI_VERSION_PREHOSTQP VMCI_MAKE_VERSION(8, 0) | ||
370 | #define VMCI_VERSION_PREVERS2 VMCI_MAKE_VERSION(1, 0) | ||
371 | |||
372 | #define VMCI_SOCKETS_MAKE_VERSION(_p) \ | ||
373 | ((((_p)[0] & 0xFF) << 24) | (((_p)[1] & 0xFF) << 16) | ((_p)[2])) | ||
374 | |||
375 | /* | ||
376 | * The VMCI IOCTLs. We use identity code 7, as noted in ioctl-number.h, and | ||
377 | * we start at sequence 9f. This gives us the same values that our shipping | ||
378 | * products use, starting at 1951, provided we leave out the direction and | ||
379 | * structure size. Note that VMMon occupies the block following us, starting | ||
380 | * at 2001. | ||
381 | */ | ||
382 | #define IOCTL_VMCI_VERSION _IO(7, 0x9f) /* 1951 */ | ||
383 | #define IOCTL_VMCI_INIT_CONTEXT _IO(7, 0xa0) | ||
384 | #define IOCTL_VMCI_QUEUEPAIR_SETVA _IO(7, 0xa4) | ||
385 | #define IOCTL_VMCI_NOTIFY_RESOURCE _IO(7, 0xa5) | ||
386 | #define IOCTL_VMCI_NOTIFICATIONS_RECEIVE _IO(7, 0xa6) | ||
387 | #define IOCTL_VMCI_VERSION2 _IO(7, 0xa7) | ||
388 | #define IOCTL_VMCI_QUEUEPAIR_ALLOC _IO(7, 0xa8) | ||
389 | #define IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE _IO(7, 0xa9) | ||
390 | #define IOCTL_VMCI_QUEUEPAIR_DETACH _IO(7, 0xaa) | ||
391 | #define IOCTL_VMCI_DATAGRAM_SEND _IO(7, 0xab) | ||
392 | #define IOCTL_VMCI_DATAGRAM_RECEIVE _IO(7, 0xac) | ||
393 | #define IOCTL_VMCI_CTX_ADD_NOTIFICATION _IO(7, 0xaf) | ||
394 | #define IOCTL_VMCI_CTX_REMOVE_NOTIFICATION _IO(7, 0xb0) | ||
395 | #define IOCTL_VMCI_CTX_GET_CPT_STATE _IO(7, 0xb1) | ||
396 | #define IOCTL_VMCI_CTX_SET_CPT_STATE _IO(7, 0xb2) | ||
397 | #define IOCTL_VMCI_GET_CONTEXT_ID _IO(7, 0xb3) | ||
398 | #define IOCTL_VMCI_SOCKETS_VERSION _IO(7, 0xb4) | ||
399 | #define IOCTL_VMCI_SOCKETS_GET_AF_VALUE _IO(7, 0xb8) | ||
400 | #define IOCTL_VMCI_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) | ||
401 | #define IOCTL_VMCI_SET_NOTIFY _IO(7, 0xcb) /* 1995 */ | ||
402 | /*IOCTL_VMMON_START _IO(7, 0xd1)*/ /* 2001 */ | ||
403 | |||
404 | /* | ||
405 | * struct vmci_queue_header - VMCI Queue Header information. | ||
406 | * | ||
407 | * A Queue cannot stand by itself as designed. Each Queue's header | ||
408 | * contains a pointer into itself (the producer_tail) and into its peer | ||
409 | * (consumer_head). The reason for the separation is one of | ||
410 | * accessibility: Each end-point can modify two things: where the next | ||
411 | * location to enqueue is within its produce_q (producer_tail); and | ||
412 | * where the next dequeue location is in its consume_q (consumer_head). | ||
413 | * | ||
414 | * An end-point cannot modify the pointers of its peer (guest to | ||
415 | * guest; NOTE that in the host both queue headers are mapped r/w). | ||
416 | * But, each end-point needs read access to both Queue header | ||
417 | * structures in order to determine how much space is used (or left) | ||
418 | * in the Queue. This is because for an end-point to know how full | ||
419 | * its produce_q is, it needs to use the consumer_head that points into | ||
420 | * the produce_q but -that- consumer_head is in the Queue header for | ||
421 | * that end-points consume_q. | ||
422 | * | ||
423 | * Thoroughly confused? Sorry. | ||
424 | * | ||
425 | * producer_tail: the point to enqueue new entrants. When you approach | ||
426 | * a line in a store, for example, you walk up to the tail. | ||
427 | * | ||
428 | * consumer_head: the point in the queue from which the next element is | ||
429 | * dequeued. In other words, who is next in line is he who is at the | ||
430 | * head of the line. | ||
431 | * | ||
432 | * Also, producer_tail points to an empty byte in the Queue, whereas | ||
433 | * consumer_head points to a valid byte of data (unless producer_tail == | ||
434 | * consumer_head in which case consumer_head does not point to a valid | ||
435 | * byte of data). | ||
436 | * | ||
437 | * For a queue of buffer 'size' bytes, the tail and head pointers will be in | ||
438 | * the range [0, size-1]. | ||
439 | * | ||
440 | * If produce_q_header->producer_tail == consume_q_header->consumer_head | ||
441 | * then the produce_q is empty. | ||
442 | */ | ||
443 | struct vmci_queue_header { | ||
444 | /* All fields are 64bit and aligned. */ | ||
445 | struct vmci_handle handle; /* Identifier. */ | ||
446 | atomic64_t producer_tail; /* Offset in this queue. */ | ||
447 | atomic64_t consumer_head; /* Offset in peer queue. */ | ||
448 | }; | ||
449 | |||
450 | /* | ||
451 | * struct vmci_datagram - Base struct for vmci datagrams. | ||
452 | * @dst: A vmci_handle that tracks the destination of the datagram. | ||
453 | * @src: A vmci_handle that tracks the source of the datagram. | ||
454 | * @payload_size: The size of the payload. | ||
455 | * | ||
456 | * vmci_datagram structs are used when sending vmci datagrams. They include | ||
457 | * the necessary source and destination information to properly route | ||
458 | * the information along with the size of the package. | ||
459 | */ | ||
460 | struct vmci_datagram { | ||
461 | struct vmci_handle dst; | ||
462 | struct vmci_handle src; | ||
463 | u64 payload_size; | ||
464 | }; | ||
465 | |||
466 | /* | ||
467 | * Second flag is for creating a well-known handle instead of a per context | ||
468 | * handle. Next flag is for deferring datagram delivery, so that the | ||
469 | * datagram callback is invoked in a delayed context (not interrupt context). | ||
470 | */ | ||
471 | #define VMCI_FLAG_DG_NONE 0 | ||
472 | #define VMCI_FLAG_WELLKNOWN_DG_HND 0x1 | ||
473 | #define VMCI_FLAG_ANYCID_DG_HND 0x2 | ||
474 | #define VMCI_FLAG_DG_DELAYED_CB 0x4 | ||
475 | |||
476 | /* | ||
477 | * Maximum supported size of a VMCI datagram for routable datagrams. | ||
478 | * Datagrams going to the hypervisor are allowed to be larger. | ||
479 | */ | ||
480 | #define VMCI_MAX_DG_SIZE (17 * 4096) | ||
481 | #define VMCI_MAX_DG_PAYLOAD_SIZE (VMCI_MAX_DG_SIZE - \ | ||
482 | sizeof(struct vmci_datagram)) | ||
483 | #define VMCI_DG_PAYLOAD(_dg) (void *)((char *)(_dg) + \ | ||
484 | sizeof(struct vmci_datagram)) | ||
485 | #define VMCI_DG_HEADERSIZE sizeof(struct vmci_datagram) | ||
486 | #define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payload_size) | ||
487 | #define VMCI_DG_SIZE_ALIGNED(_dg) ((VMCI_DG_SIZE(_dg) + 7) & (~((size_t) 0x7))) | ||
488 | #define VMCI_MAX_DATAGRAM_QUEUE_SIZE (VMCI_MAX_DG_SIZE * 2) | ||
489 | |||
490 | struct vmci_event_payload_qp { | ||
491 | struct vmci_handle handle; /* queue_pair handle. */ | ||
492 | u32 peer_id; /* Context id of attaching/detaching VM. */ | ||
493 | u32 _pad; | ||
494 | }; | ||
495 | |||
496 | /* Flags for VMCI queue_pair API. */ | ||
497 | enum { | ||
498 | /* Fail alloc if QP not created by peer. */ | ||
499 | VMCI_QPFLAG_ATTACH_ONLY = 1 << 0, | ||
500 | |||
501 | /* Only allow attaches from local context. */ | ||
502 | VMCI_QPFLAG_LOCAL = 1 << 1, | ||
503 | |||
504 | /* Host won't block when guest is quiesced. */ | ||
505 | VMCI_QPFLAG_NONBLOCK = 1 << 2, | ||
506 | |||
507 | /* Pin data pages in ESX. Used with NONBLOCK */ | ||
508 | VMCI_QPFLAG_PINNED = 1 << 3, | ||
509 | |||
510 | /* Update the following flag when adding new flags. */ | ||
511 | VMCI_QP_ALL_FLAGS = (VMCI_QPFLAG_ATTACH_ONLY | VMCI_QPFLAG_LOCAL | | ||
512 | VMCI_QPFLAG_NONBLOCK | VMCI_QPFLAG_PINNED), | ||
513 | |||
514 | /* Convenience flags */ | ||
515 | VMCI_QP_ASYMM = (VMCI_QPFLAG_NONBLOCK | VMCI_QPFLAG_PINNED), | ||
516 | VMCI_QP_ASYMM_PEER = (VMCI_QPFLAG_ATTACH_ONLY | VMCI_QP_ASYMM), | ||
517 | }; | ||
518 | |||
519 | /* | ||
520 | * We allow at least 1024 more event datagrams from the hypervisor past the | ||
521 | * normally allowed datagrams pending for a given context. We define this | ||
522 | * limit on event datagrams from the hypervisor to guard against DoS attack | ||
523 | * from a malicious VM which could repeatedly attach to and detach from a queue | ||
524 | * pair, causing events to be queued at the destination VM. However, the rate | ||
525 | * at which such events can be generated is small since it requires a VM exit | ||
526 | * and handling of queue pair attach/detach call at the hypervisor. Event | ||
527 | * datagrams may be queued up at the destination VM if it has interrupts | ||
528 | * disabled or if it is not draining events for some other reason. 1024 | ||
529 | * datagrams is a grossly conservative estimate of the time for which | ||
530 | * interrupts may be disabled in the destination VM, but at the same time does | ||
531 | * not exacerbate the memory pressure problem on the host by much (size of each | ||
532 | * event datagram is small). | ||
533 | */ | ||
534 | #define VMCI_MAX_DATAGRAM_AND_EVENT_QUEUE_SIZE \ | ||
535 | (VMCI_MAX_DATAGRAM_QUEUE_SIZE + \ | ||
536 | 1024 * (sizeof(struct vmci_datagram) + \ | ||
537 | sizeof(struct vmci_event_data_max))) | ||
538 | |||
539 | /* | ||
540 | * Struct used for querying, via VMCI_RESOURCES_QUERY, the availability of | ||
541 | * hypervisor resources. Struct size is 16 bytes. All fields in struct are | ||
542 | * aligned to their natural alignment. | ||
543 | */ | ||
544 | struct vmci_resource_query_hdr { | ||
545 | struct vmci_datagram hdr; | ||
546 | u32 num_resources; | ||
547 | u32 _padding; | ||
548 | }; | ||
549 | |||
550 | /* | ||
551 | * Convenience struct for negotiating vectors. Must match layout of | ||
552 | * VMCIResourceQueryHdr minus the struct vmci_datagram header. | ||
553 | */ | ||
554 | struct vmci_resource_query_msg { | ||
555 | u32 num_resources; | ||
556 | u32 _padding; | ||
557 | u32 resources[1]; | ||
558 | }; | ||
559 | |||
560 | /* | ||
561 | * The maximum number of resources that can be queried using | ||
562 | * VMCI_RESOURCE_QUERY is 31, as the result is encoded in the lower 31 | ||
563 | * bits of a positive return value. Negative values are reserved for | ||
564 | * errors. | ||
565 | */ | ||
566 | #define VMCI_RESOURCE_QUERY_MAX_NUM 31 | ||
567 | |||
568 | /* Maximum size for the VMCI_RESOURCE_QUERY request. */ | ||
569 | #define VMCI_RESOURCE_QUERY_MAX_SIZE \ | ||
570 | (sizeof(struct vmci_resource_query_hdr) + \ | ||
571 | sizeof(u32) * VMCI_RESOURCE_QUERY_MAX_NUM) | ||
572 | |||
573 | /* | ||
574 | * Struct used for setting the notification bitmap. All fields in | ||
575 | * struct are aligned to their natural alignment. | ||
576 | */ | ||
577 | struct vmci_notify_bm_set_msg { | ||
578 | struct vmci_datagram hdr; | ||
579 | u32 bitmap_ppn; | ||
580 | u32 _pad; | ||
581 | }; | ||
582 | |||
583 | /* | ||
584 | * Struct used for linking a doorbell handle with an index in the | ||
585 | * notify bitmap. All fields in struct are aligned to their natural | ||
586 | * alignment. | ||
587 | */ | ||
588 | struct vmci_doorbell_link_msg { | ||
589 | struct vmci_datagram hdr; | ||
590 | struct vmci_handle handle; | ||
591 | u64 notify_idx; | ||
592 | }; | ||
593 | |||
594 | /* | ||
595 | * Struct used for unlinking a doorbell handle from an index in the | ||
596 | * notify bitmap. All fields in struct are aligned to their natural | ||
597 | * alignment. | ||
598 | */ | ||
599 | struct vmci_doorbell_unlink_msg { | ||
600 | struct vmci_datagram hdr; | ||
601 | struct vmci_handle handle; | ||
602 | }; | ||
603 | |||
604 | /* | ||
605 | * Struct used for generating a notification on a doorbell handle. All | ||
606 | * fields in struct are aligned to their natural alignment. | ||
607 | */ | ||
608 | struct vmci_doorbell_notify_msg { | ||
609 | struct vmci_datagram hdr; | ||
610 | struct vmci_handle handle; | ||
611 | }; | ||
612 | |||
613 | /* | ||
614 | * This struct is used to contain data for events. Size of this struct is a | ||
615 | * multiple of 8 bytes, and all fields are aligned to their natural alignment. | ||
616 | */ | ||
617 | struct vmci_event_data { | ||
618 | u32 event; /* 4 bytes. */ | ||
619 | u32 _pad; | ||
620 | /* Event payload is put here. */ | ||
621 | }; | ||
622 | |||
623 | /* | ||
624 | * Define the different VMCI_EVENT payload data types here. All structs must | ||
625 | * be a multiple of 8 bytes, and fields must be aligned to their natural | ||
626 | * alignment. | ||
627 | */ | ||
628 | struct vmci_event_payld_ctx { | ||
629 | u32 context_id; /* 4 bytes. */ | ||
630 | u32 _pad; | ||
631 | }; | ||
632 | |||
633 | struct vmci_event_payld_qp { | ||
634 | struct vmci_handle handle; /* queue_pair handle. */ | ||
635 | u32 peer_id; /* Context id of attaching/detaching VM. */ | ||
636 | u32 _pad; | ||
637 | }; | ||
638 | |||
639 | /* | ||
640 | * We define the following struct to get the size of the maximum event | ||
641 | * data the hypervisor may send to the guest. If adding a new event | ||
642 | * payload type above, add it to the following struct too (inside the | ||
643 | * union). | ||
644 | */ | ||
645 | struct vmci_event_data_max { | ||
646 | struct vmci_event_data event_data; | ||
647 | union { | ||
648 | struct vmci_event_payld_ctx context_payload; | ||
649 | struct vmci_event_payld_qp qp_payload; | ||
650 | } ev_data_payload; | ||
651 | }; | ||
652 | |||
653 | /* | ||
654 | * Struct used for VMCI_EVENT_SUBSCRIBE/UNSUBSCRIBE and | ||
655 | * VMCI_EVENT_HANDLER messages. Struct size is 32 bytes. All fields | ||
656 | * in struct are aligned to their natural alignment. | ||
657 | */ | ||
658 | struct vmci_event_msg { | ||
659 | struct vmci_datagram hdr; | ||
660 | |||
661 | /* Has event type and payload. */ | ||
662 | struct vmci_event_data event_data; | ||
663 | |||
664 | /* Payload gets put here. */ | ||
665 | }; | ||
666 | |||
667 | /* Event with context payload. */ | ||
668 | struct vmci_event_ctx { | ||
669 | struct vmci_event_msg msg; | ||
670 | struct vmci_event_payld_ctx payload; | ||
671 | }; | ||
672 | |||
673 | /* Event with QP payload. */ | ||
674 | struct vmci_event_qp { | ||
675 | struct vmci_event_msg msg; | ||
676 | struct vmci_event_payld_qp payload; | ||
677 | }; | ||
678 | |||
679 | /* | ||
680 | * Structs used for queue_pair alloc and detach messages. We align fields of | ||
681 | * these structs to 64bit boundaries. | ||
682 | */ | ||
683 | struct vmci_qp_alloc_msg { | ||
684 | struct vmci_datagram hdr; | ||
685 | struct vmci_handle handle; | ||
686 | u32 peer; | ||
687 | u32 flags; | ||
688 | u64 produce_size; | ||
689 | u64 consume_size; | ||
690 | u64 num_ppns; | ||
691 | |||
692 | /* List of PPNs placed here. */ | ||
693 | }; | ||
694 | |||
695 | struct vmci_qp_detach_msg { | ||
696 | struct vmci_datagram hdr; | ||
697 | struct vmci_handle handle; | ||
698 | }; | ||
699 | |||
700 | /* VMCI Doorbell API. */ | ||
701 | #define VMCI_FLAG_DELAYED_CB 0x01 | ||
702 | |||
703 | typedef void (*vmci_callback) (void *client_data); | ||
704 | |||
705 | /* | ||
706 | * struct vmci_qp - A vmw_vmci queue pair handle. | ||
707 | * | ||
708 | * This structure is used as a handle to a queue pair created by | ||
709 | * VMCI. It is intentionally left opaque to clients. | ||
710 | */ | ||
711 | struct vmci_qp; | ||
712 | |||
713 | /* Callback needed for correctly waiting on events. */ | ||
714 | typedef int (*vmci_datagram_recv_cb) (void *client_data, | ||
715 | struct vmci_datagram *msg); | ||
716 | |||
717 | /* VMCI Event API. */ | ||
718 | typedef void (*vmci_event_cb) (u32 sub_id, const struct vmci_event_data *ed, | ||
719 | void *client_data); | ||
720 | |||
721 | /* | ||
722 | * We use the following inline function to access the payload data | ||
723 | * associated with an event data. | ||
724 | */ | ||
725 | static inline const void * | ||
726 | vmci_event_data_const_payload(const struct vmci_event_data *ev_data) | ||
727 | { | ||
728 | return (const char *)ev_data + sizeof(*ev_data); | ||
729 | } | ||
730 | |||
731 | static inline void *vmci_event_data_payload(struct vmci_event_data *ev_data) | ||
732 | { | ||
733 | return (void *)vmci_event_data_const_payload(ev_data); | ||
734 | } | ||
735 | |||
736 | /* | ||
737 | * Helper to add a given offset to a head or tail pointer. Wraps the | ||
738 | * value of the pointer around the max size of the queue. | ||
739 | */ | ||
740 | static inline void vmci_qp_add_pointer(atomic64_t *var, | ||
741 | size_t add, | ||
742 | u64 size) | ||
743 | { | ||
744 | u64 new_val = atomic64_read(var); | ||
745 | |||
746 | if (new_val >= size - add) | ||
747 | new_val -= size; | ||
748 | |||
749 | new_val += add; | ||
750 | |||
751 | atomic64_set(var, new_val); | ||
752 | } | ||
753 | |||
754 | /* | ||
755 | * Helper routine to get the Producer Tail from the supplied queue. | ||
756 | */ | ||
757 | static inline u64 | ||
758 | vmci_q_header_producer_tail(const struct vmci_queue_header *q_header) | ||
759 | { | ||
760 | struct vmci_queue_header *qh = (struct vmci_queue_header *)q_header; | ||
761 | return atomic64_read(&qh->producer_tail); | ||
762 | } | ||
763 | |||
764 | /* | ||
765 | * Helper routine to get the Consumer Head from the supplied queue. | ||
766 | */ | ||
767 | static inline u64 | ||
768 | vmci_q_header_consumer_head(const struct vmci_queue_header *q_header) | ||
769 | { | ||
770 | struct vmci_queue_header *qh = (struct vmci_queue_header *)q_header; | ||
771 | return atomic64_read(&qh->consumer_head); | ||
772 | } | ||
773 | |||
774 | /* | ||
775 | * Helper routine to increment the Producer Tail. Fundamentally, | ||
776 | * vmci_qp_add_pointer() is used to manipulate the tail itself. | ||
777 | */ | ||
778 | static inline void | ||
779 | vmci_q_header_add_producer_tail(struct vmci_queue_header *q_header, | ||
780 | size_t add, | ||
781 | u64 queue_size) | ||
782 | { | ||
783 | vmci_qp_add_pointer(&q_header->producer_tail, add, queue_size); | ||
784 | } | ||
785 | |||
786 | /* | ||
787 | * Helper routine to increment the Consumer Head. Fundamentally, | ||
788 | * vmci_qp_add_pointer() is used to manipulate the head itself. | ||
789 | */ | ||
790 | static inline void | ||
791 | vmci_q_header_add_consumer_head(struct vmci_queue_header *q_header, | ||
792 | size_t add, | ||
793 | u64 queue_size) | ||
794 | { | ||
795 | vmci_qp_add_pointer(&q_header->consumer_head, add, queue_size); | ||
796 | } | ||
797 | |||
798 | /* | ||
799 | * Helper routine for getting the head and the tail pointer for a queue. | ||
800 | * Both the VMCIQueues are needed to get both the pointers for one queue. | ||
801 | */ | ||
802 | static inline void | ||
803 | vmci_q_header_get_pointers(const struct vmci_queue_header *produce_q_header, | ||
804 | const struct vmci_queue_header *consume_q_header, | ||
805 | u64 *producer_tail, | ||
806 | u64 *consumer_head) | ||
807 | { | ||
808 | if (producer_tail) | ||
809 | *producer_tail = vmci_q_header_producer_tail(produce_q_header); | ||
810 | |||
811 | if (consumer_head) | ||
812 | *consumer_head = vmci_q_header_consumer_head(consume_q_header); | ||
813 | } | ||
814 | |||
815 | static inline void vmci_q_header_init(struct vmci_queue_header *q_header, | ||
816 | const struct vmci_handle handle) | ||
817 | { | ||
818 | q_header->handle = handle; | ||
819 | atomic64_set(&q_header->producer_tail, 0); | ||
820 | atomic64_set(&q_header->consumer_head, 0); | ||
821 | } | ||
822 | |||
823 | /* | ||
824 | * Finds available free space in a produce queue to enqueue more | ||
825 | * data or reports an error if queue pair corruption is detected. | ||
826 | */ | ||
827 | static s64 | ||
828 | vmci_q_header_free_space(const struct vmci_queue_header *produce_q_header, | ||
829 | const struct vmci_queue_header *consume_q_header, | ||
830 | const u64 produce_q_size) | ||
831 | { | ||
832 | u64 tail; | ||
833 | u64 head; | ||
834 | u64 free_space; | ||
835 | |||
836 | tail = vmci_q_header_producer_tail(produce_q_header); | ||
837 | head = vmci_q_header_consumer_head(consume_q_header); | ||
838 | |||
839 | if (tail >= produce_q_size || head >= produce_q_size) | ||
840 | return VMCI_ERROR_INVALID_SIZE; | ||
841 | |||
842 | /* | ||
843 | * Deduct 1 to avoid tail becoming equal to head which causes | ||
844 | * ambiguity. If head and tail are equal it means that the | ||
845 | * queue is empty. | ||
846 | */ | ||
847 | if (tail >= head) | ||
848 | free_space = produce_q_size - (tail - head) - 1; | ||
849 | else | ||
850 | free_space = head - tail - 1; | ||
851 | |||
852 | return free_space; | ||
853 | } | ||
854 | |||
855 | /* | ||
856 | * vmci_q_header_free_space() does all the heavy lifting of | ||
857 | * determing the number of free bytes in a Queue. This routine, | ||
858 | * then subtracts that size from the full size of the Queue so | ||
859 | * the caller knows how many bytes are ready to be dequeued. | ||
860 | * Results: | ||
861 | * On success, available data size in bytes (up to MAX_INT64). | ||
862 | * On failure, appropriate error code. | ||
863 | */ | ||
864 | static inline s64 | ||
865 | vmci_q_header_buf_ready(const struct vmci_queue_header *consume_q_header, | ||
866 | const struct vmci_queue_header *produce_q_header, | ||
867 | const u64 consume_q_size) | ||
868 | { | ||
869 | s64 free_space; | ||
870 | |||
871 | free_space = vmci_q_header_free_space(consume_q_header, | ||
872 | produce_q_header, consume_q_size); | ||
873 | if (free_space < VMCI_SUCCESS) | ||
874 | return free_space; | ||
875 | |||
876 | return consume_q_size - free_space - 1; | ||
877 | } | ||
878 | |||
879 | |||
880 | #endif /* _VMW_VMCI_DEF_H_ */ | ||
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 50ae7d0c279e..e8d65718560b 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -47,6 +47,7 @@ int con_set_cmap(unsigned char __user *cmap); | |||
47 | int con_get_cmap(unsigned char __user *cmap); | 47 | int con_get_cmap(unsigned char __user *cmap); |
48 | void scrollback(struct vc_data *vc, int lines); | 48 | void scrollback(struct vc_data *vc, int lines); |
49 | void scrollfront(struct vc_data *vc, int lines); | 49 | void scrollfront(struct vc_data *vc, int lines); |
50 | void clear_buffer_attributes(struct vc_data *vc); | ||
50 | void update_region(struct vc_data *vc, unsigned long start, int count); | 51 | void update_region(struct vc_data *vc, unsigned long start, int count); |
51 | void redraw_screen(struct vc_data *vc, int is_switch); | 52 | void redraw_screen(struct vc_data *vc, int is_switch); |
52 | #define update_screen(x) redraw_screen(x, 0) | 53 | #define update_screen(x) redraw_screen(x, 0) |
@@ -130,6 +131,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new); | |||
130 | int vt_waitactive(int n); | 131 | int vt_waitactive(int n); |
131 | void change_console(struct vc_data *new_vc); | 132 | void change_console(struct vc_data *new_vc); |
132 | void reset_vc(struct vc_data *vc); | 133 | void reset_vc(struct vc_data *vc); |
134 | extern int do_unbind_con_driver(const struct consw *csw, int first, int last, | ||
135 | int deflt); | ||
133 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | 136 | extern int unbind_con_driver(const struct consw *csw, int first, int last, |
134 | int deflt); | 137 | int deflt); |
135 | int vty_init(const struct file_operations *console_fops); | 138 | int vty_init(const struct file_operations *console_fops); |
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index cec4b4159767..8198a63cf459 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h | |||
@@ -1,129 +1,10 @@ | |||
1 | /***************************************************************************** | 1 | /* |
2 | * wanrouter.h Definitions for the WAN Multiprotocol Router Module. | 2 | * wanrouter.h Legacy declarations kept around until X25 is removed |
3 | * This module provides API and common services for WAN Link | 3 | */ |
4 | * Drivers and is completely hardware-independent. | 4 | |
5 | * | ||
6 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
7 | * Gideon Hack | ||
8 | * Additions: Arnaldo Melo | ||
9 | * | ||
10 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version | ||
15 | * 2 of the License, or (at your option) any later version. | ||
16 | * ============================================================================ | ||
17 | * Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State | ||
18 | * Feb 24, 2000 Nenad Corbic Added support for socket based x25api | ||
19 | * Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol. | ||
20 | * Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release | ||
21 | * Jun 02, 1999 Gideon Hack Added support for the S514 adapter. | ||
22 | * May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t | ||
23 | * WAN_DISCONNECTING state added | ||
24 | * Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t' | ||
25 | * Jun 12, 1998 David Fong Added Cisco HDLC support. | ||
26 | * Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to | ||
27 | * 'wanif_conf_t' | ||
28 | * Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t' | ||
29 | * Added 'authenticator' to 'wan_ppp_conf_t' | ||
30 | * Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0 | ||
31 | * Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t' | ||
32 | * Added 'enable_IPX' and 'network_number' to | ||
33 | * 'wan_device_t'. Also added defines for | ||
34 | * UDP PACKET TYPE, Interrupt test, critical values | ||
35 | * for RACE conditions. | ||
36 | * Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to | ||
37 | * 'wan_fr_conf_t' to configure a list of dlci(s) | ||
38 | * for a NODE | ||
39 | * Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t' | ||
40 | * May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t' | ||
41 | * May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t' | ||
42 | * Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t' | ||
43 | * Jan 16, 1997 Gene Kozin router_devlist made public | ||
44 | * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). | ||
45 | *****************************************************************************/ | ||
46 | #ifndef _ROUTER_H | 5 | #ifndef _ROUTER_H |
47 | #define _ROUTER_H | 6 | #define _ROUTER_H |
48 | 7 | ||
49 | #include <uapi/linux/wanrouter.h> | 8 | #include <uapi/linux/wanrouter.h> |
50 | 9 | ||
51 | /****** Kernel Interface ****************************************************/ | ||
52 | |||
53 | #include <linux/fs.h> /* support for device drivers */ | ||
54 | #include <linux/proc_fs.h> /* proc filesystem pragmatics */ | ||
55 | #include <linux/netdevice.h> /* support for network drivers */ | ||
56 | #include <linux/spinlock.h> /* Support for SMP Locking */ | ||
57 | |||
58 | /*---------------------------------------------------------------------------- | ||
59 | * WAN device data space. | ||
60 | */ | ||
61 | struct wan_device { | ||
62 | unsigned magic; /* magic number */ | ||
63 | char* name; /* -> WAN device name (ASCIIZ) */ | ||
64 | void* private; /* -> driver private data */ | ||
65 | unsigned config_id; /* Configuration ID */ | ||
66 | /****** hardware configuration ******/ | ||
67 | unsigned ioport; /* adapter I/O port base #1 */ | ||
68 | char S514_cpu_no[1]; /* PCI CPU Number */ | ||
69 | unsigned char S514_slot_no; /* PCI Slot Number */ | ||
70 | unsigned long maddr; /* dual-port memory address */ | ||
71 | unsigned msize; /* dual-port memory size */ | ||
72 | int irq; /* interrupt request level */ | ||
73 | int dma; /* DMA request level */ | ||
74 | unsigned bps; /* data transfer rate */ | ||
75 | unsigned mtu; /* max physical transmit unit size */ | ||
76 | unsigned udp_port; /* UDP port for management */ | ||
77 | unsigned char ttl; /* Time To Live for UDP security */ | ||
78 | unsigned enable_tx_int; /* Transmit Interrupt enabled or not */ | ||
79 | char interface; /* RS-232/V.35, etc. */ | ||
80 | char clocking; /* external/internal */ | ||
81 | char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ | ||
82 | char station; /* DTE/DCE, primary/secondary, etc. */ | ||
83 | char connection; /* permanent/switched/on-demand */ | ||
84 | char signalling; /* Signalling RS232 or V35 */ | ||
85 | char read_mode; /* read mode: Polling or interrupt */ | ||
86 | char new_if_cnt; /* Number of interfaces per wanpipe */ | ||
87 | char del_if_cnt; /* Number of times del_if() gets called */ | ||
88 | unsigned char piggyback; /* Piggibacking a port */ | ||
89 | unsigned hw_opt[4]; /* other hardware options */ | ||
90 | /****** status and statistics *******/ | ||
91 | char state; /* device state */ | ||
92 | char api_status; /* device api status */ | ||
93 | struct net_device_stats stats; /* interface statistics */ | ||
94 | unsigned reserved[16]; /* reserved for future use */ | ||
95 | unsigned long critical; /* critical section flag */ | ||
96 | spinlock_t lock; /* Support for SMP Locking */ | ||
97 | |||
98 | /****** device management methods ***/ | ||
99 | int (*setup) (struct wan_device *wandev, wandev_conf_t *conf); | ||
100 | int (*shutdown) (struct wan_device *wandev); | ||
101 | int (*update) (struct wan_device *wandev); | ||
102 | int (*ioctl) (struct wan_device *wandev, unsigned cmd, | ||
103 | unsigned long arg); | ||
104 | int (*new_if)(struct wan_device *wandev, struct net_device *dev, | ||
105 | wanif_conf_t *conf); | ||
106 | int (*del_if)(struct wan_device *wandev, struct net_device *dev); | ||
107 | /****** maintained by the router ****/ | ||
108 | struct wan_device* next; /* -> next device */ | ||
109 | struct net_device* dev; /* list of network interfaces */ | ||
110 | unsigned ndev; /* number of interfaces */ | ||
111 | struct proc_dir_entry *dent; /* proc filesystem entry */ | ||
112 | }; | ||
113 | |||
114 | /* Public functions available for device drivers */ | ||
115 | extern int register_wan_device(struct wan_device *wandev); | ||
116 | extern int unregister_wan_device(char *name); | ||
117 | |||
118 | /* Proc interface functions. These must not be called by the drivers! */ | ||
119 | extern int wanrouter_proc_init(void); | ||
120 | extern void wanrouter_proc_cleanup(void); | ||
121 | extern int wanrouter_proc_add(struct wan_device *wandev); | ||
122 | extern int wanrouter_proc_delete(struct wan_device *wandev); | ||
123 | extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | ||
124 | |||
125 | /* Public Data */ | ||
126 | /* list of registered devices */ | ||
127 | extern struct wan_device *wanrouter_router_devlist; | ||
128 | |||
129 | #endif /* _ROUTER_H */ | 10 | #endif /* _ROUTER_H */ |
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h index 0d6373195d32..a54fe82e704b 100644 --- a/include/linux/wl12xx.h +++ b/include/linux/wl12xx.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #ifndef _LINUX_WL12XX_H | 24 | #ifndef _LINUX_WL12XX_H |
25 | #define _LINUX_WL12XX_H | 25 | #define _LINUX_WL12XX_H |
26 | 26 | ||
27 | #include <linux/err.h> | ||
28 | |||
27 | /* Reference clock values */ | 29 | /* Reference clock values */ |
28 | enum { | 30 | enum { |
29 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ | 31 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ |
@@ -55,17 +57,17 @@ struct wl12xx_platform_data { | |||
55 | int board_tcxo_clock; | 57 | int board_tcxo_clock; |
56 | unsigned long platform_quirks; | 58 | unsigned long platform_quirks; |
57 | bool pwr_in_suspend; | 59 | bool pwr_in_suspend; |
58 | |||
59 | struct wl1271_if_operations *ops; | ||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* Platform does not support level trigger interrupts */ | 62 | /* Platform does not support level trigger interrupts */ |
63 | #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) | 63 | #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) |
64 | 64 | ||
65 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | 65 | #ifdef CONFIG_WILINK_PLATFORM_DATA |
66 | 66 | ||
67 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); | 67 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); |
68 | 68 | ||
69 | struct wl12xx_platform_data *wl12xx_get_platform_data(void); | ||
70 | |||
69 | #else | 71 | #else |
70 | 72 | ||
71 | static inline | 73 | static inline |
@@ -74,8 +76,12 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data) | |||
74 | return -ENOSYS; | 76 | return -ENOSYS; |
75 | } | 77 | } |
76 | 78 | ||
77 | #endif | 79 | static inline |
80 | struct wl12xx_platform_data *wl12xx_get_platform_data(void) | ||
81 | { | ||
82 | return ERR_PTR(-ENODATA); | ||
83 | } | ||
78 | 84 | ||
79 | struct wl12xx_platform_data *wl12xx_get_platform_data(void); | 85 | #endif |
80 | 86 | ||
81 | #endif | 87 | #endif |
diff --git a/include/media/adv7343.h b/include/media/adv7343.h index d6f8a4e1a1fc..944757be49bb 100644 --- a/include/media/adv7343.h +++ b/include/media/adv7343.h | |||
@@ -20,4 +20,56 @@ | |||
20 | #define ADV7343_COMPONENT_ID (1) | 20 | #define ADV7343_COMPONENT_ID (1) |
21 | #define ADV7343_SVIDEO_ID (2) | 21 | #define ADV7343_SVIDEO_ID (2) |
22 | 22 | ||
23 | /** | ||
24 | * adv7343_power_mode - power mode configuration. | ||
25 | * @sleep_mode: on enable the current consumption is reduced to micro ampere | ||
26 | * level. All DACs and the internal PLL circuit are disabled. | ||
27 | * Registers can be read from and written in sleep mode. | ||
28 | * @pll_control: PLL and oversampling control. This control allows internal | ||
29 | * PLL 1 circuit to be powered down and the oversampling to be | ||
30 | * switched off. | ||
31 | * @dac_1: power on/off DAC 1. | ||
32 | * @dac_2: power on/off DAC 2. | ||
33 | * @dac_3: power on/off DAC 3. | ||
34 | * @dac_4: power on/off DAC 4. | ||
35 | * @dac_5: power on/off DAC 5. | ||
36 | * @dac_6: power on/off DAC 6. | ||
37 | * | ||
38 | * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS | ||
39 | * section of datasheet[1], table 17 page no 30. | ||
40 | * | ||
41 | * [1] http://www.analog.com/static/imported-files/data_sheets/ADV7342_7343.pdf | ||
42 | */ | ||
43 | struct adv7343_power_mode { | ||
44 | bool sleep_mode; | ||
45 | bool pll_control; | ||
46 | bool dac_1; | ||
47 | bool dac_2; | ||
48 | bool dac_3; | ||
49 | bool dac_4; | ||
50 | bool dac_5; | ||
51 | bool dac_6; | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * struct adv7343_sd_config - SD Only Output Configuration. | ||
56 | * @sd_dac_out1: Configure SD DAC Output 1. | ||
57 | * @sd_dac_out2: Configure SD DAC Output 2. | ||
58 | */ | ||
59 | struct adv7343_sd_config { | ||
60 | /* SD only Output Configuration */ | ||
61 | bool sd_dac_out1; | ||
62 | bool sd_dac_out2; | ||
63 | }; | ||
64 | |||
65 | /** | ||
66 | * struct adv7343_platform_data - Platform data values and access functions. | ||
67 | * @mode_config: Configuration for power mode. | ||
68 | * @sd_config: SD Only Configuration. | ||
69 | */ | ||
70 | struct adv7343_platform_data { | ||
71 | struct adv7343_power_mode mode_config; | ||
72 | struct adv7343_sd_config sd_config; | ||
73 | }; | ||
74 | |||
23 | #endif /* End of #ifndef ADV7343_H */ | 75 | #endif /* End of #ifndef ADV7343_H */ |
diff --git a/include/media/blackfin/bfin_capture.h b/include/media/blackfin/bfin_capture.h index 2038a8a3f8aa..56b9ce4472fc 100644 --- a/include/media/blackfin/bfin_capture.h +++ b/include/media/blackfin/bfin_capture.h | |||
@@ -9,6 +9,7 @@ struct ppi_info; | |||
9 | struct bcap_route { | 9 | struct bcap_route { |
10 | u32 input; | 10 | u32 input; |
11 | u32 output; | 11 | u32 output; |
12 | u32 ppi_control; | ||
12 | }; | 13 | }; |
13 | 14 | ||
14 | struct bfin_capture_config { | 15 | struct bfin_capture_config { |
@@ -30,8 +31,8 @@ struct bfin_capture_config { | |||
30 | unsigned long ppi_control; | 31 | unsigned long ppi_control; |
31 | /* ppi interrupt mask */ | 32 | /* ppi interrupt mask */ |
32 | u32 int_mask; | 33 | u32 int_mask; |
33 | /* horizontal blanking clocks */ | 34 | /* horizontal blanking pixels */ |
34 | int blank_clocks; | 35 | int blank_pixels; |
35 | }; | 36 | }; |
36 | 37 | ||
37 | #endif | 38 | #endif |
diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h index 8f72f8a0b3d0..d0697f4edf87 100644 --- a/include/media/blackfin/ppi.h +++ b/include/media/blackfin/ppi.h | |||
@@ -21,22 +21,42 @@ | |||
21 | #define _PPI_H_ | 21 | #define _PPI_H_ |
22 | 22 | ||
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <asm/blackfin.h> | ||
25 | #include <asm/bfin_ppi.h> | ||
24 | 26 | ||
27 | /* EPPI */ | ||
25 | #ifdef EPPI_EN | 28 | #ifdef EPPI_EN |
26 | #define PORT_EN EPPI_EN | 29 | #define PORT_EN EPPI_EN |
30 | #define PORT_DIR EPPI_DIR | ||
27 | #define DMA32 0 | 31 | #define DMA32 0 |
28 | #define PACK_EN PACKEN | 32 | #define PACK_EN PACKEN |
29 | #endif | 33 | #endif |
30 | 34 | ||
35 | /* EPPI3 */ | ||
36 | #ifdef EPPI0_CTL2 | ||
37 | #define PORT_EN EPPI_CTL_EN | ||
38 | #define PORT_DIR EPPI_CTL_DIR | ||
39 | #define PACK_EN EPPI_CTL_PACKEN | ||
40 | #define DMA32 0 | ||
41 | #define DLEN_8 EPPI_CTL_DLEN08 | ||
42 | #define DLEN_16 EPPI_CTL_DLEN16 | ||
43 | #endif | ||
44 | |||
31 | struct ppi_if; | 45 | struct ppi_if; |
32 | 46 | ||
33 | struct ppi_params { | 47 | struct ppi_params { |
34 | int width; | 48 | u32 width; /* width in pixels */ |
35 | int height; | 49 | u32 height; /* height in lines */ |
36 | int bpp; | 50 | u32 hdelay; /* delay after the HSYNC in pixels */ |
37 | unsigned long ppi_control; | 51 | u32 vdelay; /* delay after the VSYNC in lines */ |
38 | u32 int_mask; | 52 | u32 line; /* total pixels per line */ |
39 | int blank_clocks; | 53 | u32 frame; /* total lines per frame */ |
54 | u32 hsync; /* HSYNC length in pixels */ | ||
55 | u32 vsync; /* VSYNC length in lines */ | ||
56 | int bpp; /* bits per pixel */ | ||
57 | int dlen; /* data length for ppi in bits */ | ||
58 | u32 ppi_control; /* ppi configuration */ | ||
59 | u32 int_mask; /* interrupt mask */ | ||
40 | }; | 60 | }; |
41 | 61 | ||
42 | struct ppi_ops { | 62 | struct ppi_ops { |
@@ -51,6 +71,7 @@ struct ppi_ops { | |||
51 | enum ppi_type { | 71 | enum ppi_type { |
52 | PPI_TYPE_PPI, | 72 | PPI_TYPE_PPI, |
53 | PPI_TYPE_EPPI, | 73 | PPI_TYPE_EPPI, |
74 | PPI_TYPE_EPPI3, | ||
54 | }; | 75 | }; |
55 | 76 | ||
56 | struct ppi_info { | 77 | struct ppi_info { |
@@ -65,7 +86,8 @@ struct ppi_if { | |||
65 | unsigned long ppi_control; | 86 | unsigned long ppi_control; |
66 | const struct ppi_ops *ops; | 87 | const struct ppi_ops *ops; |
67 | const struct ppi_info *info; | 88 | const struct ppi_info *info; |
68 | bool err_int; | 89 | bool err_int; /* if we need request error interrupt */ |
90 | bool err; /* if ppi has fifo error */ | ||
69 | void *priv; | 91 | void *priv; |
70 | }; | 92 | }; |
71 | 93 | ||
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h index 5ab0d8d41f68..42628fcfe1bd 100644 --- a/include/media/davinci/vpbe_osd.h +++ b/include/media/davinci/vpbe_osd.h | |||
@@ -26,7 +26,9 @@ | |||
26 | 26 | ||
27 | #include <media/davinci/vpbe_types.h> | 27 | #include <media/davinci/vpbe_types.h> |
28 | 28 | ||
29 | #define VPBE_OSD_SUBDEV_NAME "vpbe-osd" | 29 | #define DM644X_VPBE_OSD_SUBDEV_NAME "dm644x,vpbe-osd" |
30 | #define DM365_VPBE_OSD_SUBDEV_NAME "dm365,vpbe-osd" | ||
31 | #define DM355_VPBE_OSD_SUBDEV_NAME "dm355,vpbe-osd" | ||
30 | 32 | ||
31 | /** | 33 | /** |
32 | * enum osd_layer | 34 | * enum osd_layer |
@@ -387,7 +389,6 @@ struct osd_state { | |||
387 | }; | 389 | }; |
388 | 390 | ||
389 | struct osd_platform_data { | 391 | struct osd_platform_data { |
390 | enum vpbe_version vpbe_type; | ||
391 | int field_inv_wa_enable; | 392 | int field_inv_wa_enable; |
392 | }; | 393 | }; |
393 | 394 | ||
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h index cc78c2eb16da..476fafc2f522 100644 --- a/include/media/davinci/vpbe_venc.h +++ b/include/media/davinci/vpbe_venc.h | |||
@@ -20,7 +20,9 @@ | |||
20 | #include <media/v4l2-subdev.h> | 20 | #include <media/v4l2-subdev.h> |
21 | #include <media/davinci/vpbe_types.h> | 21 | #include <media/davinci/vpbe_types.h> |
22 | 22 | ||
23 | #define VPBE_VENC_SUBDEV_NAME "vpbe-venc" | 23 | #define DM644X_VPBE_VENC_SUBDEV_NAME "dm644x,vpbe-venc" |
24 | #define DM365_VPBE_VENC_SUBDEV_NAME "dm365,vpbe-venc" | ||
25 | #define DM355_VPBE_VENC_SUBDEV_NAME "dm355,vpbe-venc" | ||
24 | 26 | ||
25 | /* venc events */ | 27 | /* venc events */ |
26 | #define VENC_END_OF_FRAME BIT(0) | 28 | #define VENC_END_OF_FRAME BIT(0) |
@@ -28,7 +30,6 @@ | |||
28 | #define VENC_SECOND_FIELD BIT(2) | 30 | #define VENC_SECOND_FIELD BIT(2) |
29 | 31 | ||
30 | struct venc_platform_data { | 32 | struct venc_platform_data { |
31 | enum vpbe_version venc_type; | ||
32 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, | 33 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, |
33 | int field); | 34 | int field); |
34 | int (*setup_clock)(enum vpbe_enc_timings_type type, | 35 | int (*setup_clock)(enum vpbe_enc_timings_type type, |
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index b586495bcd53..153473daaa32 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
@@ -105,4 +105,20 @@ enum vpss_wbl_sel { | |||
105 | }; | 105 | }; |
106 | /* clear wbl overflow flag for DM6446 */ | 106 | /* clear wbl overflow flag for DM6446 */ |
107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); | 107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); |
108 | |||
109 | /* set sync polarity*/ | ||
110 | void vpss_set_sync_pol(struct vpss_sync_pol sync); | ||
111 | /* set the PG_FRAME_SIZE register */ | ||
112 | void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size); | ||
113 | /* | ||
114 | * vpss_check_and_clear_interrupt - check and clear interrupt | ||
115 | * @irq - common enumerator for IRQ | ||
116 | * | ||
117 | * Following return values used:- | ||
118 | * 0 - interrupt occurred and cleared | ||
119 | * 1 - interrupt not occurred | ||
120 | * 2 - interrupt status not available | ||
121 | */ | ||
122 | int vpss_dma_complete_interrupt(void); | ||
123 | |||
108 | #endif | 124 | #endif |
diff --git a/include/media/ov7670.h b/include/media/ov7670.h index b133bc123031..1913d5123072 100644 --- a/include/media/ov7670.h +++ b/include/media/ov7670.h | |||
@@ -15,6 +15,8 @@ struct ov7670_config { | |||
15 | int min_height; /* Filter out smaller sizes */ | 15 | int min_height; /* Filter out smaller sizes */ |
16 | int clock_speed; /* External clock speed (MHz) */ | 16 | int clock_speed; /* External clock speed (MHz) */ |
17 | bool use_smbus; /* Use smbus I/O instead of I2C */ | 17 | bool use_smbus; /* Use smbus I/O instead of I2C */ |
18 | bool pll_bypass; /* Choose whether to bypass the PLL */ | ||
19 | bool pclk_hb_disable; /* Disable toggling pixclk during horizontal blanking */ | ||
18 | }; | 20 | }; |
19 | 21 | ||
20 | #endif | 22 | #endif |
diff --git a/include/media/ov9650.h b/include/media/ov9650.h new file mode 100644 index 000000000000..d630cf9e028d --- /dev/null +++ b/include/media/ov9650.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * OV9650/OV9652 camera sensors driver | ||
3 | * | ||
4 | * Copyright (C) 2013 Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef OV9650_H_ | ||
11 | #define OV9650_H_ | ||
12 | |||
13 | /** | ||
14 | * struct ov9650_platform_data - ov9650 driver platform data | ||
15 | * @mclk_frequency: the sensor's master clock frequency in Hz | ||
16 | * @gpio_pwdn: number of a GPIO connected to OV965X PWDN pin | ||
17 | * @gpio_reset: number of a GPIO connected to OV965X RESET pin | ||
18 | * | ||
19 | * If any of @gpio_pwdn or @gpio_reset are unused then they should be | ||
20 | * set to a negative value. @mclk_frequency must always be specified. | ||
21 | */ | ||
22 | struct ov9650_platform_data { | ||
23 | unsigned long mclk_frequency; | ||
24 | int gpio_pwdn; | ||
25 | int gpio_reset; | ||
26 | }; | ||
27 | #endif /* OV9650_H_ */ | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 74f55a3f14eb..f74ee6f89711 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -182,6 +182,7 @@ void rc_map_init(void); | |||
182 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" | 182 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" |
183 | #define RC_MAP_TIVO "rc-tivo" | 183 | #define RC_MAP_TIVO "rc-tivo" |
184 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" | 184 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" |
185 | #define RC_MAP_TOTAL_MEDIA_IN_HAND_02 "rc-total-media-in-hand-02" | ||
185 | #define RC_MAP_TREKSTOR "rc-trekstor" | 186 | #define RC_MAP_TREKSTOR "rc-trekstor" |
186 | #define RC_MAP_TT_1500 "rc-tt-1500" | 187 | #define RC_MAP_TT_1500 "rc-tt-1500" |
187 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" | 188 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" |
diff --git a/include/media/s5c73m3.h b/include/media/s5c73m3.h new file mode 100644 index 000000000000..ccb9e5448762 --- /dev/null +++ b/include/media/s5c73m3.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Samsung LSI S5C73M3 8M pixel camera driver | ||
3 | * | ||
4 | * Copyright (C) 2012, Samsung Electronics, Co., Ltd. | ||
5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
6 | * Andrzej Hajda <a.hajda@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | */ | ||
17 | #ifndef MEDIA_S5C73M3__ | ||
18 | #define MEDIA_S5C73M3__ | ||
19 | |||
20 | #include <linux/videodev2.h> | ||
21 | #include <media/v4l2-mediabus.h> | ||
22 | |||
23 | /** | ||
24 | * struct s5c73m3_gpio - data structure describing a GPIO | ||
25 | * @gpio: GPIO number | ||
26 | * @level: indicates active state of the @gpio | ||
27 | */ | ||
28 | struct s5c73m3_gpio { | ||
29 | int gpio; | ||
30 | int level; | ||
31 | }; | ||
32 | |||
33 | /** | ||
34 | * struct s5c73m3_platform_data - s5c73m3 driver platform data | ||
35 | * @mclk_frequency: sensor's master clock frequency in Hz | ||
36 | * @gpio_reset: GPIO driving RESET pin | ||
37 | * @gpio_stby: GPIO driving STBY pin | ||
38 | * @nlanes: maximum number of MIPI-CSI lanes used | ||
39 | * @horiz_flip: default horizontal image flip value, non zero to enable | ||
40 | * @vert_flip: default vertical image flip value, non zero to enable | ||
41 | */ | ||
42 | |||
43 | struct s5c73m3_platform_data { | ||
44 | unsigned long mclk_frequency; | ||
45 | |||
46 | struct s5c73m3_gpio gpio_reset; | ||
47 | struct s5c73m3_gpio gpio_stby; | ||
48 | |||
49 | enum v4l2_mbus_type bus_type; | ||
50 | u8 nlanes; | ||
51 | u8 horiz_flip; | ||
52 | u8 vert_flip; | ||
53 | }; | ||
54 | |||
55 | #endif /* MEDIA_S5C73M3__ */ | ||
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index eaea62a382f8..28f3590aa031 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Samsung S5P SoC camera interface driver header | 2 | * Samsung S5P/Exynos4 SoC series camera interface driver header |
3 | * | 3 | * |
4 | * Copyright (c) 2010 Samsung Electronics Co., Ltd | 4 | * Copyright (C) 2010 - 2013 Samsung Electronics Co., Ltd. |
5 | * Author: Sylwester Nawrocki, <s.nawrocki@samsung.com> | 5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> |
6 | * | 6 | * |
7 | * 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 |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -14,45 +14,58 @@ | |||
14 | 14 | ||
15 | #include <media/media-entity.h> | 15 | #include <media/media-entity.h> |
16 | 16 | ||
17 | enum cam_bus_type { | 17 | /* |
18 | FIMC_ITU_601 = 1, | 18 | * Enumeration of the FIMC data bus types. |
19 | FIMC_ITU_656, | 19 | */ |
20 | FIMC_MIPI_CSI2, | 20 | enum fimc_bus_type { |
21 | FIMC_LCD_WB, /* FIFO link from LCD mixer */ | 21 | /* Camera parallel bus */ |
22 | FIMC_BUS_TYPE_ITU_601 = 1, | ||
23 | /* Camera parallel bus with embedded synchronization */ | ||
24 | FIMC_BUS_TYPE_ITU_656, | ||
25 | /* Camera MIPI-CSI2 serial bus */ | ||
26 | FIMC_BUS_TYPE_MIPI_CSI2, | ||
27 | /* FIFO link from LCD controller (WriteBack A) */ | ||
28 | FIMC_BUS_TYPE_LCD_WRITEBACK_A, | ||
29 | /* FIFO link from LCD controller (WriteBack B) */ | ||
30 | FIMC_BUS_TYPE_LCD_WRITEBACK_B, | ||
31 | /* FIFO link from FIMC-IS */ | ||
32 | FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B, | ||
22 | }; | 33 | }; |
23 | 34 | ||
24 | struct i2c_board_info; | 35 | struct i2c_board_info; |
25 | 36 | ||
26 | /** | 37 | /** |
27 | * struct s5p_fimc_isp_info - image sensor information required for host | 38 | * struct fimc_source_info - video source description required for the host |
28 | * interace configuration. | 39 | * interface configuration |
29 | * | 40 | * |
30 | * @board_info: pointer to I2C subdevice's board info | 41 | * @board_info: pointer to I2C subdevice's board info |
31 | * @clk_frequency: frequency of the clock the host interface provides to sensor | 42 | * @clk_frequency: frequency of the clock the host interface provides to sensor |
32 | * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. | 43 | * @fimc_bus_type: FIMC camera input type |
44 | * @sensor_bus_type: image sensor bus type, MIPI, ITU-R BT.601 etc. | ||
45 | * @flags: the parallel sensor bus flags defining signals polarity (V4L2_MBUS_*) | ||
33 | * @i2c_bus_num: i2c control bus id the sensor is attached to | 46 | * @i2c_bus_num: i2c control bus id the sensor is attached to |
34 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) | 47 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) |
35 | * @clk_id: index of the SoC peripheral clock for sensors | 48 | * @clk_id: index of the SoC peripheral clock for sensors |
36 | * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*) | ||
37 | */ | 49 | */ |
38 | struct s5p_fimc_isp_info { | 50 | struct fimc_source_info { |
39 | struct i2c_board_info *board_info; | 51 | struct i2c_board_info *board_info; |
40 | unsigned long clk_frequency; | 52 | unsigned long clk_frequency; |
41 | enum cam_bus_type bus_type; | 53 | enum fimc_bus_type fimc_bus_type; |
54 | enum fimc_bus_type sensor_bus_type; | ||
55 | u16 flags; | ||
42 | u16 i2c_bus_num; | 56 | u16 i2c_bus_num; |
43 | u16 mux_id; | 57 | u16 mux_id; |
44 | u16 flags; | ||
45 | u8 clk_id; | 58 | u8 clk_id; |
46 | }; | 59 | }; |
47 | 60 | ||
48 | /** | 61 | /** |
49 | * struct s5p_platform_fimc - camera host interface platform data | 62 | * struct s5p_platform_fimc - camera host interface platform data |
50 | * | 63 | * |
51 | * @isp_info: properties of camera sensor required for host interface setup | 64 | * @source_info: properties of an image source for the host interface setup |
52 | * @num_clients: the number of attached image sensors | 65 | * @num_clients: the number of attached image sources |
53 | */ | 66 | */ |
54 | struct s5p_platform_fimc { | 67 | struct s5p_platform_fimc { |
55 | struct s5p_fimc_isp_info *isp_info; | 68 | struct fimc_source_info *source_info; |
56 | int num_clients; | 69 | int num_clients; |
57 | }; | 70 | }; |
58 | 71 | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 6442edc2a151..2cc70cf318bf 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -23,11 +23,11 @@ | |||
23 | #include <media/v4l2-device.h> | 23 | #include <media/v4l2-device.h> |
24 | 24 | ||
25 | struct file; | 25 | struct file; |
26 | struct soc_camera_link; | 26 | struct soc_camera_desc; |
27 | 27 | ||
28 | struct soc_camera_device { | 28 | struct soc_camera_device { |
29 | struct list_head list; /* list of all registered devices */ | 29 | struct list_head list; /* list of all registered devices */ |
30 | struct soc_camera_link *link; | 30 | struct soc_camera_desc *sdesc; |
31 | struct device *pdev; /* Platform device */ | 31 | struct device *pdev; /* Platform device */ |
32 | struct device *parent; /* Camera host device */ | 32 | struct device *parent; /* Camera host device */ |
33 | struct device *control; /* E.g., the i2c client */ | 33 | struct device *control; /* E.g., the i2c client */ |
@@ -46,9 +46,8 @@ struct soc_camera_device { | |||
46 | int num_user_formats; | 46 | int num_user_formats; |
47 | enum v4l2_field field; /* Preserve field over close() */ | 47 | enum v4l2_field field; /* Preserve field over close() */ |
48 | void *host_priv; /* Per-device host private data */ | 48 | void *host_priv; /* Per-device host private data */ |
49 | /* soc_camera.c private count. Only accessed with .video_lock held */ | 49 | /* soc_camera.c private count. Only accessed with .host_lock held */ |
50 | int use_count; | 50 | int use_count; |
51 | struct mutex video_lock; /* Protects device data */ | ||
52 | struct file *streamer; /* stream owner */ | 51 | struct file *streamer; /* stream owner */ |
53 | union { | 52 | union { |
54 | struct videobuf_queue vb_vidq; | 53 | struct videobuf_queue vb_vidq; |
@@ -62,7 +61,7 @@ struct soc_camera_device { | |||
62 | struct soc_camera_host { | 61 | struct soc_camera_host { |
63 | struct v4l2_device v4l2_dev; | 62 | struct v4l2_device v4l2_dev; |
64 | struct list_head list; | 63 | struct list_head list; |
65 | struct mutex host_lock; /* Protect during probing */ | 64 | struct mutex host_lock; /* Protect pipeline modifications */ |
66 | unsigned char nr; /* Host number */ | 65 | unsigned char nr; /* Host number */ |
67 | u32 capabilities; | 66 | u32 capabilities; |
68 | void *priv; | 67 | void *priv; |
@@ -117,26 +116,72 @@ struct soc_camera_host_ops { | |||
117 | struct i2c_board_info; | 116 | struct i2c_board_info; |
118 | struct regulator_bulk_data; | 117 | struct regulator_bulk_data; |
119 | 118 | ||
120 | struct soc_camera_link { | 119 | struct soc_camera_subdev_desc { |
121 | /* Camera bus id, used to match a camera and a bus */ | ||
122 | int bus_id; | ||
123 | /* Per camera SOCAM_SENSOR_* bus flags */ | 120 | /* Per camera SOCAM_SENSOR_* bus flags */ |
124 | unsigned long flags; | 121 | unsigned long flags; |
125 | int i2c_adapter_id; | 122 | |
126 | struct i2c_board_info *board_info; | 123 | /* sensor driver private platform data */ |
127 | const char *module_name; | 124 | void *drv_priv; |
128 | void *priv; | ||
129 | 125 | ||
130 | /* Optional regulators that have to be managed on power on/off events */ | 126 | /* Optional regulators that have to be managed on power on/off events */ |
131 | struct regulator_bulk_data *regulators; | 127 | struct regulator_bulk_data *regulators; |
132 | int num_regulators; | 128 | int num_regulators; |
133 | 129 | ||
130 | /* Optional callbacks to power on or off and reset the sensor */ | ||
131 | int (*power)(struct device *, int); | ||
132 | int (*reset)(struct device *); | ||
133 | |||
134 | /* | ||
135 | * some platforms may support different data widths than the sensors | ||
136 | * native ones due to different data line routing. Let the board code | ||
137 | * overwrite the width flags. | ||
138 | */ | ||
139 | int (*set_bus_param)(struct soc_camera_subdev_desc *, unsigned long flags); | ||
140 | unsigned long (*query_bus_param)(struct soc_camera_subdev_desc *); | ||
141 | void (*free_bus)(struct soc_camera_subdev_desc *); | ||
142 | }; | ||
143 | |||
144 | struct soc_camera_host_desc { | ||
145 | /* Camera bus id, used to match a camera and a bus */ | ||
146 | int bus_id; | ||
147 | int i2c_adapter_id; | ||
148 | struct i2c_board_info *board_info; | ||
149 | const char *module_name; | ||
150 | |||
134 | /* | 151 | /* |
135 | * For non-I2C devices platform has to provide methods to add a device | 152 | * For non-I2C devices platform has to provide methods to add a device |
136 | * to the system and to remove it | 153 | * to the system and to remove it |
137 | */ | 154 | */ |
138 | int (*add_device)(struct soc_camera_device *); | 155 | int (*add_device)(struct soc_camera_device *); |
139 | void (*del_device)(struct soc_camera_device *); | 156 | void (*del_device)(struct soc_camera_device *); |
157 | }; | ||
158 | |||
159 | /* | ||
160 | * This MUST be kept binary-identical to struct soc_camera_link below, until | ||
161 | * it is completely replaced by this one, after which we can split it into its | ||
162 | * two components. | ||
163 | */ | ||
164 | struct soc_camera_desc { | ||
165 | struct soc_camera_subdev_desc subdev_desc; | ||
166 | struct soc_camera_host_desc host_desc; | ||
167 | }; | ||
168 | |||
169 | /* Prepare to replace this struct: don't change its layout any more! */ | ||
170 | struct soc_camera_link { | ||
171 | /* | ||
172 | * Subdevice part - keep at top and compatible to | ||
173 | * struct soc_camera_subdev_desc | ||
174 | */ | ||
175 | |||
176 | /* Per camera SOCAM_SENSOR_* bus flags */ | ||
177 | unsigned long flags; | ||
178 | |||
179 | void *priv; | ||
180 | |||
181 | /* Optional regulators that have to be managed on power on/off events */ | ||
182 | struct regulator_bulk_data *regulators; | ||
183 | int num_regulators; | ||
184 | |||
140 | /* Optional callbacks to power on or off and reset the sensor */ | 185 | /* Optional callbacks to power on or off and reset the sensor */ |
141 | int (*power)(struct device *, int); | 186 | int (*power)(struct device *, int); |
142 | int (*reset)(struct device *); | 187 | int (*reset)(struct device *); |
@@ -148,6 +193,24 @@ struct soc_camera_link { | |||
148 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); | 193 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); |
149 | unsigned long (*query_bus_param)(struct soc_camera_link *); | 194 | unsigned long (*query_bus_param)(struct soc_camera_link *); |
150 | void (*free_bus)(struct soc_camera_link *); | 195 | void (*free_bus)(struct soc_camera_link *); |
196 | |||
197 | /* | ||
198 | * Host part - keep at bottom and compatible to | ||
199 | * struct soc_camera_host_desc | ||
200 | */ | ||
201 | |||
202 | /* Camera bus id, used to match a camera and a bus */ | ||
203 | int bus_id; | ||
204 | int i2c_adapter_id; | ||
205 | struct i2c_board_info *board_info; | ||
206 | const char *module_name; | ||
207 | |||
208 | /* | ||
209 | * For non-I2C devices platform has to provide methods to add a device | ||
210 | * to the system and to remove it | ||
211 | */ | ||
212 | int (*add_device)(struct soc_camera_device *); | ||
213 | void (*del_device)(struct soc_camera_device *); | ||
151 | }; | 214 | }; |
152 | 215 | ||
153 | static inline struct soc_camera_host *to_soc_camera_host( | 216 | static inline struct soc_camera_host *to_soc_camera_host( |
@@ -158,10 +221,10 @@ static inline struct soc_camera_host *to_soc_camera_host( | |||
158 | return container_of(v4l2_dev, struct soc_camera_host, v4l2_dev); | 221 | return container_of(v4l2_dev, struct soc_camera_host, v4l2_dev); |
159 | } | 222 | } |
160 | 223 | ||
161 | static inline struct soc_camera_link *to_soc_camera_link( | 224 | static inline struct soc_camera_desc *to_soc_camera_desc( |
162 | const struct soc_camera_device *icd) | 225 | const struct soc_camera_device *icd) |
163 | { | 226 | { |
164 | return icd->link; | 227 | return icd->sdesc; |
165 | } | 228 | } |
166 | 229 | ||
167 | static inline struct device *to_soc_camera_control( | 230 | static inline struct device *to_soc_camera_control( |
@@ -251,19 +314,17 @@ static inline void soc_camera_limit_side(int *start, int *length, | |||
251 | *start = start_min + length_max - *length; | 314 | *start = start_min + length_max - *length; |
252 | } | 315 | } |
253 | 316 | ||
254 | unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 317 | unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, |
255 | unsigned long flags); | ||
256 | unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, | ||
257 | const struct v4l2_mbus_config *cfg); | 318 | const struct v4l2_mbus_config *cfg); |
258 | 319 | ||
259 | int soc_camera_power_on(struct device *dev, struct soc_camera_link *icl); | 320 | int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd); |
260 | int soc_camera_power_off(struct device *dev, struct soc_camera_link *icl); | 321 | int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd); |
261 | 322 | ||
262 | static inline int soc_camera_set_power(struct device *dev, | 323 | static inline int soc_camera_set_power(struct device *dev, |
263 | struct soc_camera_link *icl, bool on) | 324 | struct soc_camera_subdev_desc *ssdd, bool on) |
264 | { | 325 | { |
265 | return on ? soc_camera_power_on(dev, icl) | 326 | return on ? soc_camera_power_on(dev, ssdd) |
266 | : soc_camera_power_off(dev, icl); | 327 | : soc_camera_power_off(dev, ssdd); |
267 | } | 328 | } |
268 | 329 | ||
269 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ | 330 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ |
@@ -275,7 +336,7 @@ static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_clien | |||
275 | return icd ? icd->vdev : NULL; | 336 | return icd ? icd->vdev : NULL; |
276 | } | 337 | } |
277 | 338 | ||
278 | static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client) | 339 | static inline struct soc_camera_subdev_desc *soc_camera_i2c_to_desc(const struct i2c_client *client) |
279 | { | 340 | { |
280 | return client->dev.platform_data; | 341 | return client->dev.platform_data; |
281 | } | 342 | } |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 8aa4200a0b1d..1e5065dab430 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -38,10 +38,12 @@ static inline int soc_camera_platform_add(struct soc_camera_device *icd, | |||
38 | void (*release)(struct device *dev), | 38 | void (*release)(struct device *dev), |
39 | int id) | 39 | int id) |
40 | { | 40 | { |
41 | struct soc_camera_platform_info *info = plink->priv; | 41 | struct soc_camera_subdev_desc *ssdd = |
42 | (struct soc_camera_subdev_desc *)plink; | ||
43 | struct soc_camera_platform_info *info = ssdd->drv_priv; | ||
42 | int ret; | 44 | int ret; |
43 | 45 | ||
44 | if (icd->link != plink) | 46 | if (&icd->sdesc->subdev_desc != ssdd) |
45 | return -ENODEV; | 47 | return -ENODEV; |
46 | 48 | ||
47 | if (*pdev) | 49 | if (*pdev) |
@@ -70,7 +72,9 @@ static inline void soc_camera_platform_del(const struct soc_camera_device *icd, | |||
70 | struct platform_device *pdev, | 72 | struct platform_device *pdev, |
71 | const struct soc_camera_link *plink) | 73 | const struct soc_camera_link *plink) |
72 | { | 74 | { |
73 | if (icd->link != plink || !pdev) | 75 | const struct soc_camera_subdev_desc *ssdd = |
76 | (const struct soc_camera_subdev_desc *)plink; | ||
77 | if (&icd->sdesc->subdev_desc != ssdd || !pdev) | ||
74 | return; | 78 | return; |
75 | 79 | ||
76 | platform_device_unregister(pdev); | 80 | platform_device_unregister(pdev); |
diff --git a/include/media/tvp514x.h b/include/media/tvp514x.h index 74387e83f5b9..86ed7e806830 100644 --- a/include/media/tvp514x.h +++ b/include/media/tvp514x.h | |||
@@ -96,12 +96,9 @@ enum tvp514x_output { | |||
96 | 96 | ||
97 | /** | 97 | /** |
98 | * struct tvp514x_platform_data - Platform data values and access functions. | 98 | * struct tvp514x_platform_data - Platform data values and access functions. |
99 | * @power_set: Power state access function, zero is off, non-zero is on. | ||
100 | * @ifparm: Interface parameters access function. | ||
101 | * @priv_data_set: Device private data (pointer) access function. | ||
102 | * @clk_polarity: Clock polarity of the current interface. | 99 | * @clk_polarity: Clock polarity of the current interface. |
103 | * @ hs_polarity: HSYNC Polarity configuration for current interface. | 100 | * @hs_polarity: HSYNC Polarity configuration for current interface. |
104 | * @ vs_polarity: VSYNC Polarity configuration for current interface. | 101 | * @vs_polarity: VSYNC Polarity configuration for current interface. |
105 | */ | 102 | */ |
106 | struct tvp514x_platform_data { | 103 | struct tvp514x_platform_data { |
107 | /* Interface control params */ | 104 | /* Interface control params */ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1a0b2db4c5d3..ec7c9c00b256 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -225,4 +225,6 @@ bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync, | |||
225 | 225 | ||
226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); | 226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); |
227 | 227 | ||
228 | void v4l2_get_timestamp(struct timeval *tv); | ||
229 | |||
228 | #endif /* V4L2_COMMON_H_ */ | 230 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 96509119f28f..f00d42bc01a6 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -53,6 +53,8 @@ struct v4l2_ctrl_ops { | |||
53 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); | 53 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); |
54 | }; | 54 | }; |
55 | 55 | ||
56 | typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | ||
57 | |||
56 | /** struct v4l2_ctrl - The control structure. | 58 | /** struct v4l2_ctrl - The control structure. |
57 | * @node: The list node. | 59 | * @node: The list node. |
58 | * @ev_subs: The list of control event subscriptions. | 60 | * @ev_subs: The list of control event subscriptions. |
@@ -72,6 +74,8 @@ struct v4l2_ctrl_ops { | |||
72 | * set this flag directly. | 74 | * set this flag directly. |
73 | * @has_volatiles: If set, then one or more members of the cluster are volatile. | 75 | * @has_volatiles: If set, then one or more members of the cluster are volatile. |
74 | * Drivers should never touch this flag. | 76 | * Drivers should never touch this flag. |
77 | * @call_notify: If set, then call the handler's notify function whenever the | ||
78 | * control's value changes. | ||
75 | * @manual_mode_value: If the is_auto flag is set, then this is the value | 79 | * @manual_mode_value: If the is_auto flag is set, then this is the value |
76 | * of the auto control that determines if that control is in | 80 | * of the auto control that determines if that control is in |
77 | * manual mode. So if the value of the auto control equals this | 81 | * manual mode. So if the value of the auto control equals this |
@@ -119,6 +123,7 @@ struct v4l2_ctrl { | |||
119 | unsigned int is_private:1; | 123 | unsigned int is_private:1; |
120 | unsigned int is_auto:1; | 124 | unsigned int is_auto:1; |
121 | unsigned int has_volatiles:1; | 125 | unsigned int has_volatiles:1; |
126 | unsigned int call_notify:1; | ||
122 | unsigned int manual_mode_value:8; | 127 | unsigned int manual_mode_value:8; |
123 | 128 | ||
124 | const struct v4l2_ctrl_ops *ops; | 129 | const struct v4l2_ctrl_ops *ops; |
@@ -177,6 +182,10 @@ struct v4l2_ctrl_ref { | |||
177 | * control is needed multiple times, so this is a simple | 182 | * control is needed multiple times, so this is a simple |
178 | * optimization. | 183 | * optimization. |
179 | * @buckets: Buckets for the hashing. Allows for quick control lookup. | 184 | * @buckets: Buckets for the hashing. Allows for quick control lookup. |
185 | * @notify: A notify callback that is called whenever the control changes value. | ||
186 | * Note that the handler's lock is held when the notify function | ||
187 | * is called! | ||
188 | * @notify_priv: Passed as argument to the v4l2_ctrl notify callback. | ||
180 | * @nr_of_buckets: Total number of buckets in the array. | 189 | * @nr_of_buckets: Total number of buckets in the array. |
181 | * @error: The error code of the first failed control addition. | 190 | * @error: The error code of the first failed control addition. |
182 | */ | 191 | */ |
@@ -187,6 +196,8 @@ struct v4l2_ctrl_handler { | |||
187 | struct list_head ctrl_refs; | 196 | struct list_head ctrl_refs; |
188 | struct v4l2_ctrl_ref *cached; | 197 | struct v4l2_ctrl_ref *cached; |
189 | struct v4l2_ctrl_ref **buckets; | 198 | struct v4l2_ctrl_ref **buckets; |
199 | v4l2_ctrl_notify_fnc notify; | ||
200 | void *notify_priv; | ||
190 | u16 nr_of_buckets; | 201 | u16 nr_of_buckets; |
191 | int error; | 202 | int error; |
192 | }; | 203 | }; |
@@ -507,6 +518,26 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); | |||
507 | */ | 518 | */ |
508 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | 519 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); |
509 | 520 | ||
521 | /** v4l2_ctrl_modify_range() - Update the range of a control. | ||
522 | * @ctrl: The control to update. | ||
523 | * @min: The control's minimum value. | ||
524 | * @max: The control's maximum value. | ||
525 | * @step: The control's step value | ||
526 | * @def: The control's default value. | ||
527 | * | ||
528 | * Update the range of a control on the fly. This works for control types | ||
529 | * INTEGER, BOOLEAN, MENU, INTEGER MENU and BITMASK. For menu controls the | ||
530 | * @step value is interpreted as a menu_skip_mask. | ||
531 | * | ||
532 | * An error is returned if one of the range arguments is invalid for this | ||
533 | * control type. | ||
534 | * | ||
535 | * This function assumes that the control handler is not locked and will | ||
536 | * take the lock itself. | ||
537 | */ | ||
538 | int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, | ||
539 | s32 min, s32 max, u32 step, s32 def); | ||
540 | |||
510 | /** v4l2_ctrl_lock() - Helper function to lock the handler | 541 | /** v4l2_ctrl_lock() - Helper function to lock the handler |
511 | * associated with the control. | 542 | * associated with the control. |
512 | * @ctrl: The control to lock. | 543 | * @ctrl: The control to lock. |
@@ -525,6 +556,20 @@ static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | |||
525 | mutex_unlock(ctrl->handler->lock); | 556 | mutex_unlock(ctrl->handler->lock); |
526 | } | 557 | } |
527 | 558 | ||
559 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. | ||
560 | * @ctrl: The control. | ||
561 | * @notify: The callback function. | ||
562 | * @priv: The callback private handle, passed as argument to the callback. | ||
563 | * | ||
564 | * This function sets a callback function for the control. If @ctrl is NULL, | ||
565 | * then it will do nothing. If @notify is NULL, then the notify callback will | ||
566 | * be removed. | ||
567 | * | ||
568 | * There can be only one notify. If another already exists, then a WARN_ON | ||
569 | * will be issued and the function will do nothing. | ||
570 | */ | ||
571 | void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, void *priv); | ||
572 | |||
528 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. | 573 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. |
529 | * @ctrl: The control. | 574 | * @ctrl: The control. |
530 | * | 575 | * |
@@ -609,4 +654,12 @@ int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs | |||
609 | int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 654 | int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
610 | int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 655 | int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
611 | 656 | ||
657 | /* Can be used as a subscribe_event function that just subscribes control | ||
658 | events. */ | ||
659 | int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, | ||
660 | struct v4l2_event_subscription *sub); | ||
661 | |||
662 | /* Log all controls owned by subdev's control handler. */ | ||
663 | int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd); | ||
664 | |||
612 | #endif | 665 | #endif |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index eff85f934b24..be05d019de25 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
@@ -64,6 +64,7 @@ | |||
64 | */ | 64 | */ |
65 | 65 | ||
66 | struct v4l2_fh; | 66 | struct v4l2_fh; |
67 | struct v4l2_subdev; | ||
67 | struct v4l2_subscribed_event; | 68 | struct v4l2_subscribed_event; |
68 | struct video_device; | 69 | struct video_device; |
69 | 70 | ||
@@ -129,5 +130,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, | |||
129 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 130 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
130 | const struct v4l2_event_subscription *sub); | 131 | const struct v4l2_event_subscription *sub); |
131 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); | 132 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); |
132 | 133 | int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh, | |
134 | struct v4l2_event_subscription *sub); | ||
133 | #endif /* V4L2_EVENT_H */ | 135 | #endif /* V4L2_EVENT_H */ |
diff --git a/include/media/v4l2-image-sizes.h b/include/media/v4l2-image-sizes.h new file mode 100644 index 000000000000..10daf92ff1ab --- /dev/null +++ b/include/media/v4l2-image-sizes.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Standard image size definitions | ||
3 | * | ||
4 | * Copyright (C) 2013, Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef _IMAGE_SIZES_H | ||
11 | #define _IMAGE_SIZES_H | ||
12 | |||
13 | #define CIF_WIDTH 352 | ||
14 | #define CIF_HEIGHT 288 | ||
15 | |||
16 | #define QCIF_WIDTH 176 | ||
17 | #define QCIF_HEIGHT 144 | ||
18 | |||
19 | #define QQCIF_WIDTH 88 | ||
20 | #define QQCIF_HEIGHT 72 | ||
21 | |||
22 | #define QQVGA_WIDTH 160 | ||
23 | #define QQVGA_HEIGHT 120 | ||
24 | |||
25 | #define QVGA_WIDTH 320 | ||
26 | #define QVGA_HEIGHT 240 | ||
27 | |||
28 | #define SXGA_WIDTH 1280 | ||
29 | #define SXGA_HEIGHT 1024 | ||
30 | |||
31 | #define VGA_WIDTH 640 | ||
32 | #define VGA_HEIGHT 480 | ||
33 | |||
34 | #endif /* _IMAGE_SIZES_H */ | ||
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 7e82d2b193d5..d3eef01da648 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
@@ -125,7 +125,7 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
125 | int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 125 | int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
126 | struct vm_area_struct *vma); | 126 | struct vm_area_struct *vma); |
127 | 127 | ||
128 | struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops); | 128 | struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops); |
129 | void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev); | 129 | void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev); |
130 | 130 | ||
131 | struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, | 131 | struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 7184853ca360..27dfe85772b1 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -407,17 +407,17 @@ struct p9_wstat { | |||
407 | char *gid; | 407 | char *gid; |
408 | char *muid; | 408 | char *muid; |
409 | char *extension; /* 9p2000.u extensions */ | 409 | char *extension; /* 9p2000.u extensions */ |
410 | u32 n_uid; /* 9p2000.u extensions */ | 410 | kuid_t n_uid; /* 9p2000.u extensions */ |
411 | u32 n_gid; /* 9p2000.u extensions */ | 411 | kgid_t n_gid; /* 9p2000.u extensions */ |
412 | u32 n_muid; /* 9p2000.u extensions */ | 412 | kuid_t n_muid; /* 9p2000.u extensions */ |
413 | }; | 413 | }; |
414 | 414 | ||
415 | struct p9_stat_dotl { | 415 | struct p9_stat_dotl { |
416 | u64 st_result_mask; | 416 | u64 st_result_mask; |
417 | struct p9_qid qid; | 417 | struct p9_qid qid; |
418 | u32 st_mode; | 418 | u32 st_mode; |
419 | u32 st_uid; | 419 | kuid_t st_uid; |
420 | u32 st_gid; | 420 | kgid_t st_gid; |
421 | u64 st_nlink; | 421 | u64 st_nlink; |
422 | u64 st_rdev; | 422 | u64 st_rdev; |
423 | u64 st_size; | 423 | u64 st_size; |
@@ -471,8 +471,8 @@ struct p9_stat_dotl { | |||
471 | struct p9_iattr_dotl { | 471 | struct p9_iattr_dotl { |
472 | u32 valid; | 472 | u32 valid; |
473 | u32 mode; | 473 | u32 mode; |
474 | u32 uid; | 474 | kuid_t uid; |
475 | u32 gid; | 475 | kgid_t gid; |
476 | u64 size; | 476 | u64 size; |
477 | u64 atime_sec; | 477 | u64 atime_sec; |
478 | u64 atime_nsec; | 478 | u64 atime_nsec; |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index fc9b90b0c052..5ff70f433e87 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -187,7 +187,7 @@ struct p9_fid { | |||
187 | int mode; | 187 | int mode; |
188 | struct p9_qid qid; | 188 | struct p9_qid qid; |
189 | u32 iounit; | 189 | u32 iounit; |
190 | uid_t uid; | 190 | kuid_t uid; |
191 | 191 | ||
192 | void *rdir; | 192 | void *rdir; |
193 | 193 | ||
@@ -220,17 +220,17 @@ void p9_client_destroy(struct p9_client *clnt); | |||
220 | void p9_client_disconnect(struct p9_client *clnt); | 220 | void p9_client_disconnect(struct p9_client *clnt); |
221 | void p9_client_begin_disconnect(struct p9_client *clnt); | 221 | void p9_client_begin_disconnect(struct p9_client *clnt); |
222 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 222 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
223 | char *uname, u32 n_uname, char *aname); | 223 | char *uname, kuid_t n_uname, char *aname); |
224 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, | 224 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, |
225 | char **wnames, int clone); | 225 | char **wnames, int clone); |
226 | int p9_client_open(struct p9_fid *fid, int mode); | 226 | int p9_client_open(struct p9_fid *fid, int mode); |
227 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, | 227 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, |
228 | char *extension); | 228 | char *extension); |
229 | int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); | 229 | int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); |
230 | int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, | 230 | int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, kgid_t gid, |
231 | struct p9_qid *qid); | 231 | struct p9_qid *qid); |
232 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | 232 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, |
233 | gid_t gid, struct p9_qid *qid); | 233 | kgid_t gid, struct p9_qid *qid); |
234 | int p9_client_clunk(struct p9_fid *fid); | 234 | int p9_client_clunk(struct p9_fid *fid); |
235 | int p9_client_fsync(struct p9_fid *fid, int datasync); | 235 | int p9_client_fsync(struct p9_fid *fid, int datasync); |
236 | int p9_client_remove(struct p9_fid *fid); | 236 | int p9_client_remove(struct p9_fid *fid); |
@@ -250,9 +250,9 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid, | |||
250 | u64 request_mask); | 250 | u64 request_mask); |
251 | 251 | ||
252 | int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, | 252 | int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, |
253 | dev_t rdev, gid_t gid, struct p9_qid *); | 253 | dev_t rdev, kgid_t gid, struct p9_qid *); |
254 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, | 254 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, |
255 | gid_t gid, struct p9_qid *); | 255 | kgid_t gid, struct p9_qid *); |
256 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); | 256 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); |
257 | int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); | 257 | int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); |
258 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); | 258 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); |
diff --git a/include/net/act_api.h b/include/net/act_api.h index c739531e1564..06ef7e926a66 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
@@ -35,21 +35,6 @@ struct tcf_common { | |||
35 | #define tcf_lock common.tcfc_lock | 35 | #define tcf_lock common.tcfc_lock |
36 | #define tcf_rcu common.tcfc_rcu | 36 | #define tcf_rcu common.tcfc_rcu |
37 | 37 | ||
38 | struct tcf_police { | ||
39 | struct tcf_common common; | ||
40 | int tcfp_result; | ||
41 | u32 tcfp_ewma_rate; | ||
42 | u32 tcfp_burst; | ||
43 | u32 tcfp_mtu; | ||
44 | u32 tcfp_toks; | ||
45 | u32 tcfp_ptoks; | ||
46 | psched_time_t tcfp_t_c; | ||
47 | struct qdisc_rate_table *tcfp_R_tab; | ||
48 | struct qdisc_rate_table *tcfp_P_tab; | ||
49 | }; | ||
50 | #define to_police(pc) \ | ||
51 | container_of(pc, struct tcf_police, common) | ||
52 | |||
53 | struct tcf_hashinfo { | 38 | struct tcf_hashinfo { |
54 | struct tcf_common **htab; | 39 | struct tcf_common **htab; |
55 | unsigned int hmask; | 40 | unsigned int hmask; |
@@ -91,7 +76,9 @@ struct tc_action_ops { | |||
91 | int (*dump)(struct sk_buff *, struct tc_action *, int, int); | 76 | int (*dump)(struct sk_buff *, struct tc_action *, int, int); |
92 | int (*cleanup)(struct tc_action *, int bind); | 77 | int (*cleanup)(struct tc_action *, int bind); |
93 | int (*lookup)(struct tc_action *, u32); | 78 | int (*lookup)(struct tc_action *, u32); |
94 | int (*init)(struct nlattr *, struct nlattr *, struct tc_action *, int , int); | 79 | int (*init)(struct net *net, struct nlattr *nla, |
80 | struct nlattr *est, struct tc_action *act, int ovr, | ||
81 | int bind); | ||
95 | int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); | 82 | int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); |
96 | }; | 83 | }; |
97 | 84 | ||
@@ -116,8 +103,12 @@ extern int tcf_register_action(struct tc_action_ops *a); | |||
116 | extern int tcf_unregister_action(struct tc_action_ops *a); | 103 | extern int tcf_unregister_action(struct tc_action_ops *a); |
117 | extern void tcf_action_destroy(struct tc_action *a, int bind); | 104 | extern void tcf_action_destroy(struct tc_action *a, int bind); |
118 | extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); | 105 | extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); |
119 | extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); | 106 | extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, |
120 | extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); | 107 | struct nlattr *est, char *n, int ovr, |
108 | int bind); | ||
109 | extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, | ||
110 | struct nlattr *est, char *n, int ovr, | ||
111 | int bind); | ||
121 | extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); | 112 | extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); |
122 | extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); | 113 | extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); |
123 | extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); | 114 | extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index df4ef9453384..40be2a0d8ae1 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -15,6 +15,10 @@ | |||
15 | 15 | ||
16 | #define IPV6_MAX_ADDRESSES 16 | 16 | #define IPV6_MAX_ADDRESSES 16 |
17 | 17 | ||
18 | #define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ / 50 : 1) | ||
19 | #define ADDRCONF_TIMER_FUZZ (HZ / 4) | ||
20 | #define ADDRCONF_TIMER_FUZZ_MAX (HZ) | ||
21 | |||
18 | #include <linux/in.h> | 22 | #include <linux/in.h> |
19 | #include <linux/in6.h> | 23 | #include <linux/in6.h> |
20 | 24 | ||
@@ -150,7 +154,31 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); | |||
150 | extern bool ipv6_chk_mcast_addr(struct net_device *dev, | 154 | extern bool ipv6_chk_mcast_addr(struct net_device *dev, |
151 | const struct in6_addr *group, | 155 | const struct in6_addr *group, |
152 | const struct in6_addr *src_addr); | 156 | const struct in6_addr *src_addr); |
153 | extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr); | 157 | |
158 | /* | ||
159 | * identify MLD packets for MLD filter exceptions | ||
160 | */ | ||
161 | static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset) | ||
162 | { | ||
163 | struct icmp6hdr *hdr; | ||
164 | |||
165 | if (nexthdr != IPPROTO_ICMPV6 || | ||
166 | !pskb_network_may_pull(skb, offset + sizeof(struct icmp6hdr))) | ||
167 | return false; | ||
168 | |||
169 | hdr = (struct icmp6hdr *)(skb_network_header(skb) + offset); | ||
170 | |||
171 | switch (hdr->icmp6_type) { | ||
172 | case ICMPV6_MGM_QUERY: | ||
173 | case ICMPV6_MGM_REPORT: | ||
174 | case ICMPV6_MGM_REDUCTION: | ||
175 | case ICMPV6_MLD2_REPORT: | ||
176 | return true; | ||
177 | default: | ||
178 | break; | ||
179 | } | ||
180 | return false; | ||
181 | } | ||
154 | 182 | ||
155 | extern void addrconf_prefix_rcv(struct net_device *dev, | 183 | extern void addrconf_prefix_rcv(struct net_device *dev, |
156 | u8 *opt, int len, bool sllao); | 184 | u8 *opt, int len, bool sllao); |
@@ -257,30 +285,55 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr, | |||
257 | htonl(0xFF000000) | addr->s6_addr32[3]); | 285 | htonl(0xFF000000) | addr->s6_addr32[3]); |
258 | } | 286 | } |
259 | 287 | ||
260 | static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) | 288 | static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr) |
261 | { | 289 | { |
262 | return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); | 290 | return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); |
263 | } | 291 | } |
264 | 292 | ||
265 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) | 293 | static inline bool ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) |
266 | { | 294 | { |
295 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
296 | __u64 *p = (__u64 *)addr; | ||
297 | return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | (p[1] ^ cpu_to_be64(1))) == 0UL; | ||
298 | #else | ||
267 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | | 299 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
268 | addr->s6_addr32[1] | addr->s6_addr32[2] | | 300 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
269 | (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0; | 301 | (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0; |
302 | #endif | ||
270 | } | 303 | } |
271 | 304 | ||
272 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | 305 | static inline bool ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) |
273 | { | 306 | { |
307 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
308 | __u64 *p = (__u64 *)addr; | ||
309 | return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | (p[1] ^ cpu_to_be64(2))) == 0UL; | ||
310 | #else | ||
274 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | | 311 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
275 | addr->s6_addr32[1] | addr->s6_addr32[2] | | 312 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
276 | (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0; | 313 | (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0; |
314 | #endif | ||
277 | } | 315 | } |
278 | 316 | ||
279 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | 317 | static inline bool ipv6_addr_is_isatap(const struct in6_addr *addr) |
280 | { | 318 | { |
281 | return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); | 319 | return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); |
282 | } | 320 | } |
283 | 321 | ||
322 | static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) | ||
323 | { | ||
324 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
325 | __u64 *p = (__u64 *)addr; | ||
326 | return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | | ||
327 | ((p[1] ^ cpu_to_be64(0x00000001ff000000UL)) & | ||
328 | cpu_to_be64(0xffffffffff000000UL))) == 0UL; | ||
329 | #else | ||
330 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | | ||
331 | addr->s6_addr32[1] | | ||
332 | (addr->s6_addr32[2] ^ htonl(0x00000001)) | | ||
333 | (addr->s6_addr[12] ^ 0xff)) == 0; | ||
334 | #endif | ||
335 | } | ||
336 | |||
284 | #ifdef CONFIG_PROC_FS | 337 | #ifdef CONFIG_PROC_FS |
285 | extern int if6_proc_init(void); | 338 | extern int if6_proc_init(void); |
286 | extern void if6_proc_exit(void); | 339 | extern void if6_proc_exit(void); |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index 42f21766c538..487b54c1308f 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -23,6 +23,7 @@ enum amp_mgr_state { | |||
23 | READ_LOC_AMP_INFO, | 23 | READ_LOC_AMP_INFO, |
24 | READ_LOC_AMP_ASSOC, | 24 | READ_LOC_AMP_ASSOC, |
25 | READ_LOC_AMP_ASSOC_FINAL, | 25 | READ_LOC_AMP_ASSOC_FINAL, |
26 | WRITE_REMOTE_AMP_ASSOC, | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | struct amp_mgr { | 29 | struct amp_mgr { |
@@ -33,7 +34,7 @@ struct amp_mgr { | |||
33 | struct kref kref; | 34 | struct kref kref; |
34 | __u8 ident; | 35 | __u8 ident; |
35 | __u8 handle; | 36 | __u8 handle; |
36 | enum amp_mgr_state state; | 37 | unsigned long state; |
37 | unsigned long flags; | 38 | unsigned long flags; |
38 | 39 | ||
39 | struct list_head amp_ctrls; | 40 | struct list_head amp_ctrls; |
@@ -144,5 +145,6 @@ void a2mp_discover_amp(struct l2cap_chan *chan); | |||
144 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | 145 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); |
145 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | 146 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); |
146 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | 147 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); |
148 | void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status); | ||
147 | 149 | ||
148 | #endif /* __A2MP_H */ | 150 | #endif /* __A2MP_H */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 2554b3f5222a..9531beee09b5 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -166,6 +166,29 @@ typedef struct { | |||
166 | #define BDADDR_LE_PUBLIC 0x01 | 166 | #define BDADDR_LE_PUBLIC 0x01 |
167 | #define BDADDR_LE_RANDOM 0x02 | 167 | #define BDADDR_LE_RANDOM 0x02 |
168 | 168 | ||
169 | static inline bool bdaddr_type_is_valid(__u8 type) | ||
170 | { | ||
171 | switch (type) { | ||
172 | case BDADDR_BREDR: | ||
173 | case BDADDR_LE_PUBLIC: | ||
174 | case BDADDR_LE_RANDOM: | ||
175 | return true; | ||
176 | } | ||
177 | |||
178 | return false; | ||
179 | } | ||
180 | |||
181 | static inline bool bdaddr_type_is_le(__u8 type) | ||
182 | { | ||
183 | switch (type) { | ||
184 | case BDADDR_LE_PUBLIC: | ||
185 | case BDADDR_LE_RANDOM: | ||
186 | return true; | ||
187 | } | ||
188 | |||
189 | return false; | ||
190 | } | ||
191 | |||
169 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) | 192 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) |
170 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) | 193 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
171 | 194 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 45eee08157bb..7f12c25f1fca 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -943,6 +943,12 @@ struct hci_rp_le_read_buffer_size { | |||
943 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
944 | } __packed; | 944 | } __packed; |
945 | 945 | ||
946 | #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 | ||
947 | struct hci_rp_le_read_local_features { | ||
948 | __u8 status; | ||
949 | __u8 features[8]; | ||
950 | } __packed; | ||
951 | |||
946 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | 952 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 |
947 | struct hci_rp_le_read_adv_tx_power { | 953 | struct hci_rp_le_read_adv_tx_power { |
948 | __u8 status; | 954 | __u8 status; |
@@ -995,6 +1001,12 @@ struct hci_cp_le_create_conn { | |||
995 | 1001 | ||
996 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e | 1002 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e |
997 | 1003 | ||
1004 | #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f | ||
1005 | struct hci_rp_le_read_white_list_size { | ||
1006 | __u8 status; | ||
1007 | __u8 size; | ||
1008 | } __packed; | ||
1009 | |||
998 | #define HCI_OP_LE_CONN_UPDATE 0x2013 | 1010 | #define HCI_OP_LE_CONN_UPDATE 0x2013 |
999 | struct hci_cp_le_conn_update { | 1011 | struct hci_cp_le_conn_update { |
1000 | __le16 handle; | 1012 | __le16 handle; |
@@ -1033,6 +1045,12 @@ struct hci_rp_le_ltk_neg_reply { | |||
1033 | __le16 handle; | 1045 | __le16 handle; |
1034 | } __packed; | 1046 | } __packed; |
1035 | 1047 | ||
1048 | #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c | ||
1049 | struct hci_rp_le_read_supported_states { | ||
1050 | __u8 status; | ||
1051 | __u8 le_states[8]; | ||
1052 | } __packed; | ||
1053 | |||
1036 | /* ---- HCI Events ---- */ | 1054 | /* ---- HCI Events ---- */ |
1037 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 1055 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
1038 | 1056 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 014a2eaa5389..90cf75afcb02 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -86,6 +86,7 @@ struct bdaddr_list { | |||
86 | struct bt_uuid { | 86 | struct bt_uuid { |
87 | struct list_head list; | 87 | struct list_head list; |
88 | u8 uuid[16]; | 88 | u8 uuid[16]; |
89 | u8 size; | ||
89 | u8 svc_hint; | 90 | u8 svc_hint; |
90 | }; | 91 | }; |
91 | 92 | ||
@@ -152,6 +153,9 @@ struct hci_dev { | |||
152 | __u8 minor_class; | 153 | __u8 minor_class; |
153 | __u8 features[8]; | 154 | __u8 features[8]; |
154 | __u8 host_features[8]; | 155 | __u8 host_features[8]; |
156 | __u8 le_features[8]; | ||
157 | __u8 le_white_list_size; | ||
158 | __u8 le_states[8]; | ||
155 | __u8 commands[64]; | 159 | __u8 commands[64]; |
156 | __u8 hci_ver; | 160 | __u8 hci_ver; |
157 | __u16 hci_rev; | 161 | __u16 hci_rev; |
@@ -216,6 +220,7 @@ struct hci_dev { | |||
216 | unsigned long le_last_tx; | 220 | unsigned long le_last_tx; |
217 | 221 | ||
218 | struct workqueue_struct *workqueue; | 222 | struct workqueue_struct *workqueue; |
223 | struct workqueue_struct *req_workqueue; | ||
219 | 224 | ||
220 | struct work_struct power_on; | 225 | struct work_struct power_on; |
221 | struct delayed_work power_off; | 226 | struct delayed_work power_off; |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7588ef44ebaf..cdd33021f831 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -496,7 +496,6 @@ struct l2cap_chan { | |||
496 | __u16 frames_sent; | 496 | __u16 frames_sent; |
497 | __u16 unacked_frames; | 497 | __u16 unacked_frames; |
498 | __u8 retry_count; | 498 | __u8 retry_count; |
499 | __u16 srej_queue_next; | ||
500 | __u16 sdu_len; | 499 | __u16 sdu_len; |
501 | struct sk_buff *sdu; | 500 | struct sk_buff *sdu; |
502 | struct sk_buff *sdu_last_frag; | 501 | struct sk_buff *sdu_last_frag; |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 8e6a6b73b9c9..d581c6de5d64 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/nl80211.h> | 19 | #include <linux/nl80211.h> |
20 | #include <linux/if_ether.h> | 20 | #include <linux/if_ether.h> |
21 | #include <linux/ieee80211.h> | 21 | #include <linux/ieee80211.h> |
22 | #include <linux/net.h> | ||
22 | #include <net/regulatory.h> | 23 | #include <net/regulatory.h> |
23 | 24 | ||
24 | /** | 25 | /** |
@@ -99,6 +100,16 @@ enum ieee80211_band { | |||
99 | * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel | 100 | * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel |
100 | * is not permitted. | 101 | * is not permitted. |
101 | * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. | 102 | * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. |
103 | * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band, | ||
104 | * this flag indicates that an 80 MHz channel cannot use this | ||
105 | * channel as the control or any of the secondary channels. | ||
106 | * This may be due to the driver or due to regulatory bandwidth | ||
107 | * restrictions. | ||
108 | * @IEEE80211_CHAN_NO_160MHZ: If the driver supports 160 MHz on the band, | ||
109 | * this flag indicates that an 160 MHz channel cannot use this | ||
110 | * channel as the control or any of the secondary channels. | ||
111 | * This may be due to the driver or due to regulatory bandwidth | ||
112 | * restrictions. | ||
102 | */ | 113 | */ |
103 | enum ieee80211_channel_flags { | 114 | enum ieee80211_channel_flags { |
104 | IEEE80211_CHAN_DISABLED = 1<<0, | 115 | IEEE80211_CHAN_DISABLED = 1<<0, |
@@ -108,11 +119,16 @@ enum ieee80211_channel_flags { | |||
108 | IEEE80211_CHAN_NO_HT40PLUS = 1<<4, | 119 | IEEE80211_CHAN_NO_HT40PLUS = 1<<4, |
109 | IEEE80211_CHAN_NO_HT40MINUS = 1<<5, | 120 | IEEE80211_CHAN_NO_HT40MINUS = 1<<5, |
110 | IEEE80211_CHAN_NO_OFDM = 1<<6, | 121 | IEEE80211_CHAN_NO_OFDM = 1<<6, |
122 | IEEE80211_CHAN_NO_80MHZ = 1<<7, | ||
123 | IEEE80211_CHAN_NO_160MHZ = 1<<8, | ||
111 | }; | 124 | }; |
112 | 125 | ||
113 | #define IEEE80211_CHAN_NO_HT40 \ | 126 | #define IEEE80211_CHAN_NO_HT40 \ |
114 | (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) | 127 | (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) |
115 | 128 | ||
129 | #define IEEE80211_DFS_MIN_CAC_TIME_MS 60000 | ||
130 | #define IEEE80211_DFS_MIN_NOP_TIME_MS (30 * 60 * 1000) | ||
131 | |||
116 | /** | 132 | /** |
117 | * struct ieee80211_channel - channel definition | 133 | * struct ieee80211_channel - channel definition |
118 | * | 134 | * |
@@ -133,6 +149,9 @@ enum ieee80211_channel_flags { | |||
133 | * to enable this, this is useful only on 5 GHz band. | 149 | * to enable this, this is useful only on 5 GHz band. |
134 | * @orig_mag: internal use | 150 | * @orig_mag: internal use |
135 | * @orig_mpwr: internal use | 151 | * @orig_mpwr: internal use |
152 | * @dfs_state: current state of this channel. Only relevant if radar is required | ||
153 | * on this channel. | ||
154 | * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered. | ||
136 | */ | 155 | */ |
137 | struct ieee80211_channel { | 156 | struct ieee80211_channel { |
138 | enum ieee80211_band band; | 157 | enum ieee80211_band band; |
@@ -145,6 +164,8 @@ struct ieee80211_channel { | |||
145 | bool beacon_found; | 164 | bool beacon_found; |
146 | u32 orig_flags; | 165 | u32 orig_flags; |
147 | int orig_mag, orig_mpwr; | 166 | int orig_mag, orig_mpwr; |
167 | enum nl80211_dfs_state dfs_state; | ||
168 | unsigned long dfs_state_entered; | ||
148 | }; | 169 | }; |
149 | 170 | ||
150 | /** | 171 | /** |
@@ -281,9 +302,13 @@ struct ieee80211_supported_band { | |||
281 | /** | 302 | /** |
282 | * struct vif_params - describes virtual interface parameters | 303 | * struct vif_params - describes virtual interface parameters |
283 | * @use_4addr: use 4-address frames | 304 | * @use_4addr: use 4-address frames |
305 | * @macaddr: address to use for this virtual interface. This will only | ||
306 | * be used for non-netdevice interfaces. If this parameter is set | ||
307 | * to zero address the driver may determine the address as needed. | ||
284 | */ | 308 | */ |
285 | struct vif_params { | 309 | struct vif_params { |
286 | int use_4addr; | 310 | int use_4addr; |
311 | u8 macaddr[ETH_ALEN]; | ||
287 | }; | 312 | }; |
288 | 313 | ||
289 | /** | 314 | /** |
@@ -326,7 +351,7 @@ struct cfg80211_chan_def { | |||
326 | * cfg80211_get_chandef_type - return old channel type from chandef | 351 | * cfg80211_get_chandef_type - return old channel type from chandef |
327 | * @chandef: the channel definition | 352 | * @chandef: the channel definition |
328 | * | 353 | * |
329 | * Returns the old channel type (NOHT, HT20, HT40+/-) from a given | 354 | * Return: The old channel type (NOHT, HT20, HT40+/-) from a given |
330 | * chandef, which must have a bandwidth allowing this conversion. | 355 | * chandef, which must have a bandwidth allowing this conversion. |
331 | */ | 356 | */ |
332 | static inline enum nl80211_channel_type | 357 | static inline enum nl80211_channel_type |
@@ -364,7 +389,7 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, | |||
364 | * @chandef1: first channel definition | 389 | * @chandef1: first channel definition |
365 | * @chandef2: second channel definition | 390 | * @chandef2: second channel definition |
366 | * | 391 | * |
367 | * Returns %true if the channels defined by the channel definitions are | 392 | * Return: %true if the channels defined by the channel definitions are |
368 | * identical, %false otherwise. | 393 | * identical, %false otherwise. |
369 | */ | 394 | */ |
370 | static inline bool | 395 | static inline bool |
@@ -382,7 +407,7 @@ cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, | |||
382 | * @chandef1: first channel definition | 407 | * @chandef1: first channel definition |
383 | * @chandef2: second channel definition | 408 | * @chandef2: second channel definition |
384 | * | 409 | * |
385 | * Returns %NULL if the given channel definitions are incompatible, | 410 | * Return: %NULL if the given channel definitions are incompatible, |
386 | * chandef1 or chandef2 otherwise. | 411 | * chandef1 or chandef2 otherwise. |
387 | */ | 412 | */ |
388 | const struct cfg80211_chan_def * | 413 | const struct cfg80211_chan_def * |
@@ -392,6 +417,7 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, | |||
392 | /** | 417 | /** |
393 | * cfg80211_chandef_valid - check if a channel definition is valid | 418 | * cfg80211_chandef_valid - check if a channel definition is valid |
394 | * @chandef: the channel definition to check | 419 | * @chandef: the channel definition to check |
420 | * Return: %true if the channel definition is valid. %false otherwise. | ||
395 | */ | 421 | */ |
396 | bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef); | 422 | bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef); |
397 | 423 | ||
@@ -399,7 +425,8 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef); | |||
399 | * cfg80211_chandef_usable - check if secondary channels can be used | 425 | * cfg80211_chandef_usable - check if secondary channels can be used |
400 | * @wiphy: the wiphy to validate against | 426 | * @wiphy: the wiphy to validate against |
401 | * @chandef: the channel definition to check | 427 | * @chandef: the channel definition to check |
402 | * @prohibited_flags: the regulatory chanenl flags that must not be set | 428 | * @prohibited_flags: the regulatory channel flags that must not be set |
429 | * Return: %true if secondary channels are usable. %false otherwise. | ||
403 | */ | 430 | */ |
404 | bool cfg80211_chandef_usable(struct wiphy *wiphy, | 431 | bool cfg80211_chandef_usable(struct wiphy *wiphy, |
405 | const struct cfg80211_chan_def *chandef, | 432 | const struct cfg80211_chan_def *chandef, |
@@ -521,6 +548,26 @@ struct cfg80211_beacon_data { | |||
521 | size_t probe_resp_len; | 548 | size_t probe_resp_len; |
522 | }; | 549 | }; |
523 | 550 | ||
551 | struct mac_address { | ||
552 | u8 addr[ETH_ALEN]; | ||
553 | }; | ||
554 | |||
555 | /** | ||
556 | * struct cfg80211_acl_data - Access control list data | ||
557 | * | ||
558 | * @acl_policy: ACL policy to be applied on the station's | ||
559 | * entry specified by mac_addr | ||
560 | * @n_acl_entries: Number of MAC address entries passed | ||
561 | * @mac_addrs: List of MAC addresses of stations to be used for ACL | ||
562 | */ | ||
563 | struct cfg80211_acl_data { | ||
564 | enum nl80211_acl_policy acl_policy; | ||
565 | int n_acl_entries; | ||
566 | |||
567 | /* Keep it last */ | ||
568 | struct mac_address mac_addrs[]; | ||
569 | }; | ||
570 | |||
524 | /** | 571 | /** |
525 | * struct cfg80211_ap_settings - AP configuration | 572 | * struct cfg80211_ap_settings - AP configuration |
526 | * | 573 | * |
@@ -540,6 +587,9 @@ struct cfg80211_beacon_data { | |||
540 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 587 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
541 | * @p2p_ctwindow: P2P CT Window | 588 | * @p2p_ctwindow: P2P CT Window |
542 | * @p2p_opp_ps: P2P opportunistic PS | 589 | * @p2p_opp_ps: P2P opportunistic PS |
590 | * @acl: ACL configuration used by the drivers which has support for | ||
591 | * MAC address based access control | ||
592 | * @radar_required: set if radar detection is required | ||
543 | */ | 593 | */ |
544 | struct cfg80211_ap_settings { | 594 | struct cfg80211_ap_settings { |
545 | struct cfg80211_chan_def chandef; | 595 | struct cfg80211_chan_def chandef; |
@@ -556,6 +606,8 @@ struct cfg80211_ap_settings { | |||
556 | int inactivity_timeout; | 606 | int inactivity_timeout; |
557 | u8 p2p_ctwindow; | 607 | u8 p2p_ctwindow; |
558 | bool p2p_opp_ps; | 608 | bool p2p_opp_ps; |
609 | const struct cfg80211_acl_data *acl; | ||
610 | bool radar_required; | ||
559 | }; | 611 | }; |
560 | 612 | ||
561 | /** | 613 | /** |
@@ -574,12 +626,14 @@ enum plink_actions { | |||
574 | /** | 626 | /** |
575 | * enum station_parameters_apply_mask - station parameter values to apply | 627 | * enum station_parameters_apply_mask - station parameter values to apply |
576 | * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) | 628 | * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) |
629 | * @STATION_PARAM_APPLY_CAPABILITY: apply new capability | ||
577 | * | 630 | * |
578 | * Not all station parameters have in-band "no change" signalling, | 631 | * Not all station parameters have in-band "no change" signalling, |
579 | * for those that don't these flags will are used. | 632 | * for those that don't these flags will are used. |
580 | */ | 633 | */ |
581 | enum station_parameters_apply_mask { | 634 | enum station_parameters_apply_mask { |
582 | STATION_PARAM_APPLY_UAPSD = BIT(0), | 635 | STATION_PARAM_APPLY_UAPSD = BIT(0), |
636 | STATION_PARAM_APPLY_CAPABILITY = BIT(1), | ||
583 | }; | 637 | }; |
584 | 638 | ||
585 | /** | 639 | /** |
@@ -608,6 +662,11 @@ enum station_parameters_apply_mask { | |||
608 | * @sta_modify_mask: bitmap indicating which parameters changed | 662 | * @sta_modify_mask: bitmap indicating which parameters changed |
609 | * (for those that don't have a natural "no change" value), | 663 | * (for those that don't have a natural "no change" value), |
610 | * see &enum station_parameters_apply_mask | 664 | * see &enum station_parameters_apply_mask |
665 | * @local_pm: local link-specific mesh power save mode (no change when set | ||
666 | * to unknown) | ||
667 | * @capability: station capability | ||
668 | * @ext_capab: extended capabilities of the station | ||
669 | * @ext_capab_len: number of extended capabilities | ||
611 | */ | 670 | */ |
612 | struct station_parameters { | 671 | struct station_parameters { |
613 | u8 *supported_rates; | 672 | u8 *supported_rates; |
@@ -623,6 +682,10 @@ struct station_parameters { | |||
623 | struct ieee80211_vht_cap *vht_capa; | 682 | struct ieee80211_vht_cap *vht_capa; |
624 | u8 uapsd_queues; | 683 | u8 uapsd_queues; |
625 | u8 max_sp; | 684 | u8 max_sp; |
685 | enum nl80211_mesh_power_mode local_pm; | ||
686 | u16 capability; | ||
687 | u8 *ext_capab; | ||
688 | u8 ext_capab_len; | ||
626 | }; | 689 | }; |
627 | 690 | ||
628 | /** | 691 | /** |
@@ -634,14 +697,16 @@ struct station_parameters { | |||
634 | * @STATION_INFO_INACTIVE_TIME: @inactive_time filled | 697 | * @STATION_INFO_INACTIVE_TIME: @inactive_time filled |
635 | * @STATION_INFO_RX_BYTES: @rx_bytes filled | 698 | * @STATION_INFO_RX_BYTES: @rx_bytes filled |
636 | * @STATION_INFO_TX_BYTES: @tx_bytes filled | 699 | * @STATION_INFO_TX_BYTES: @tx_bytes filled |
700 | * @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value | ||
701 | * @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value | ||
637 | * @STATION_INFO_LLID: @llid filled | 702 | * @STATION_INFO_LLID: @llid filled |
638 | * @STATION_INFO_PLID: @plid filled | 703 | * @STATION_INFO_PLID: @plid filled |
639 | * @STATION_INFO_PLINK_STATE: @plink_state filled | 704 | * @STATION_INFO_PLINK_STATE: @plink_state filled |
640 | * @STATION_INFO_SIGNAL: @signal filled | 705 | * @STATION_INFO_SIGNAL: @signal filled |
641 | * @STATION_INFO_TX_BITRATE: @txrate fields are filled | 706 | * @STATION_INFO_TX_BITRATE: @txrate fields are filled |
642 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) | 707 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) |
643 | * @STATION_INFO_RX_PACKETS: @rx_packets filled | 708 | * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value |
644 | * @STATION_INFO_TX_PACKETS: @tx_packets filled | 709 | * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value |
645 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | 710 | * @STATION_INFO_TX_RETRIES: @tx_retries filled |
646 | * @STATION_INFO_TX_FAILED: @tx_failed filled | 711 | * @STATION_INFO_TX_FAILED: @tx_failed filled |
647 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | 712 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled |
@@ -653,6 +718,9 @@ struct station_parameters { | |||
653 | * @STATION_INFO_STA_FLAGS: @sta_flags filled | 718 | * @STATION_INFO_STA_FLAGS: @sta_flags filled |
654 | * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled | 719 | * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled |
655 | * @STATION_INFO_T_OFFSET: @t_offset filled | 720 | * @STATION_INFO_T_OFFSET: @t_offset filled |
721 | * @STATION_INFO_LOCAL_PM: @local_pm filled | ||
722 | * @STATION_INFO_PEER_PM: @peer_pm filled | ||
723 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled | ||
656 | */ | 724 | */ |
657 | enum station_info_flags { | 725 | enum station_info_flags { |
658 | STATION_INFO_INACTIVE_TIME = 1<<0, | 726 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -676,6 +744,11 @@ enum station_info_flags { | |||
676 | STATION_INFO_STA_FLAGS = 1<<18, | 744 | STATION_INFO_STA_FLAGS = 1<<18, |
677 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19, | 745 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19, |
678 | STATION_INFO_T_OFFSET = 1<<20, | 746 | STATION_INFO_T_OFFSET = 1<<20, |
747 | STATION_INFO_LOCAL_PM = 1<<21, | ||
748 | STATION_INFO_PEER_PM = 1<<22, | ||
749 | STATION_INFO_NONPEER_PM = 1<<23, | ||
750 | STATION_INFO_RX_BYTES64 = 1<<24, | ||
751 | STATION_INFO_TX_BYTES64 = 1<<25, | ||
679 | }; | 752 | }; |
680 | 753 | ||
681 | /** | 754 | /** |
@@ -789,13 +862,16 @@ struct sta_bss_parameters { | |||
789 | * @sta_flags: station flags mask & values | 862 | * @sta_flags: station flags mask & values |
790 | * @beacon_loss_count: Number of times beacon loss event has triggered. | 863 | * @beacon_loss_count: Number of times beacon loss event has triggered. |
791 | * @t_offset: Time offset of the station relative to this host. | 864 | * @t_offset: Time offset of the station relative to this host. |
865 | * @local_pm: local mesh STA power save mode | ||
866 | * @peer_pm: peer mesh STA power save mode | ||
867 | * @nonpeer_pm: non-peer mesh STA power save mode | ||
792 | */ | 868 | */ |
793 | struct station_info { | 869 | struct station_info { |
794 | u32 filled; | 870 | u32 filled; |
795 | u32 connected_time; | 871 | u32 connected_time; |
796 | u32 inactive_time; | 872 | u32 inactive_time; |
797 | u32 rx_bytes; | 873 | u64 rx_bytes; |
798 | u32 tx_bytes; | 874 | u64 tx_bytes; |
799 | u16 llid; | 875 | u16 llid; |
800 | u16 plid; | 876 | u16 plid; |
801 | u8 plink_state; | 877 | u8 plink_state; |
@@ -818,6 +894,9 @@ struct station_info { | |||
818 | 894 | ||
819 | u32 beacon_loss_count; | 895 | u32 beacon_loss_count; |
820 | s64 t_offset; | 896 | s64 t_offset; |
897 | enum nl80211_mesh_power_mode local_pm; | ||
898 | enum nl80211_mesh_power_mode peer_pm; | ||
899 | enum nl80211_mesh_power_mode nonpeer_pm; | ||
821 | 900 | ||
822 | /* | 901 | /* |
823 | * Note: Add a new enum station_info_flags value for each new field and | 902 | * Note: Add a new enum station_info_flags value for each new field and |
@@ -993,6 +1072,10 @@ struct bss_parameters { | |||
993 | * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs) | 1072 | * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs) |
994 | * during which a mesh STA can send only one Action frame containing | 1073 | * during which a mesh STA can send only one Action frame containing |
995 | * a PREQ element for root path confirmation. | 1074 | * a PREQ element for root path confirmation. |
1075 | * @power_mode: The default mesh power save mode which will be the initial | ||
1076 | * setting for new peer links. | ||
1077 | * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake | ||
1078 | * after transmitting its beacon. | ||
996 | */ | 1079 | */ |
997 | struct mesh_config { | 1080 | struct mesh_config { |
998 | u16 dot11MeshRetryTimeout; | 1081 | u16 dot11MeshRetryTimeout; |
@@ -1020,6 +1103,8 @@ struct mesh_config { | |||
1020 | u32 dot11MeshHWMPactivePathToRootTimeout; | 1103 | u32 dot11MeshHWMPactivePathToRootTimeout; |
1021 | u16 dot11MeshHWMProotInterval; | 1104 | u16 dot11MeshHWMProotInterval; |
1022 | u16 dot11MeshHWMPconfirmationInterval; | 1105 | u16 dot11MeshHWMPconfirmationInterval; |
1106 | enum nl80211_mesh_power_mode power_mode; | ||
1107 | u16 dot11MeshAwakeWindowDuration; | ||
1023 | }; | 1108 | }; |
1024 | 1109 | ||
1025 | /** | 1110 | /** |
@@ -1034,6 +1119,8 @@ struct mesh_config { | |||
1034 | * @ie_len: length of vendor information elements | 1119 | * @ie_len: length of vendor information elements |
1035 | * @is_authenticated: this mesh requires authentication | 1120 | * @is_authenticated: this mesh requires authentication |
1036 | * @is_secure: this mesh uses security | 1121 | * @is_secure: this mesh uses security |
1122 | * @dtim_period: DTIM period to use | ||
1123 | * @beacon_interval: beacon interval to use | ||
1037 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] | 1124 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] |
1038 | * | 1125 | * |
1039 | * These parameters are fixed when the mesh is created. | 1126 | * These parameters are fixed when the mesh is created. |
@@ -1049,6 +1136,8 @@ struct mesh_setup { | |||
1049 | u8 ie_len; | 1136 | u8 ie_len; |
1050 | bool is_authenticated; | 1137 | bool is_authenticated; |
1051 | bool is_secure; | 1138 | bool is_secure; |
1139 | u8 dtim_period; | ||
1140 | u16 beacon_interval; | ||
1052 | int mcast_rate[IEEE80211_NUM_BANDS]; | 1141 | int mcast_rate[IEEE80211_NUM_BANDS]; |
1053 | }; | 1142 | }; |
1054 | 1143 | ||
@@ -1168,6 +1257,7 @@ struct cfg80211_match_set { | |||
1168 | * @n_match_sets: number of match sets | 1257 | * @n_match_sets: number of match sets |
1169 | * @wiphy: the wiphy this was for | 1258 | * @wiphy: the wiphy this was for |
1170 | * @dev: the interface | 1259 | * @dev: the interface |
1260 | * @scan_start: start time of the scheduled scan | ||
1171 | * @channels: channels to scan | 1261 | * @channels: channels to scan |
1172 | * @rssi_thold: don't report scan results below this threshold (in s32 dBm) | 1262 | * @rssi_thold: don't report scan results below this threshold (in s32 dBm) |
1173 | */ | 1263 | */ |
@@ -1207,11 +1297,13 @@ enum cfg80211_signal_type { | |||
1207 | 1297 | ||
1208 | /** | 1298 | /** |
1209 | * struct cfg80211_bss_ie_data - BSS entry IE data | 1299 | * struct cfg80211_bss_ie_data - BSS entry IE data |
1300 | * @tsf: TSF contained in the frame that carried these IEs | ||
1210 | * @rcu_head: internal use, for freeing | 1301 | * @rcu_head: internal use, for freeing |
1211 | * @len: length of the IEs | 1302 | * @len: length of the IEs |
1212 | * @data: IE data | 1303 | * @data: IE data |
1213 | */ | 1304 | */ |
1214 | struct cfg80211_bss_ies { | 1305 | struct cfg80211_bss_ies { |
1306 | u64 tsf; | ||
1215 | struct rcu_head rcu_head; | 1307 | struct rcu_head rcu_head; |
1216 | int len; | 1308 | int len; |
1217 | u8 data[]; | 1309 | u8 data[]; |
@@ -1225,29 +1317,32 @@ struct cfg80211_bss_ies { | |||
1225 | * | 1317 | * |
1226 | * @channel: channel this BSS is on | 1318 | * @channel: channel this BSS is on |
1227 | * @bssid: BSSID of the BSS | 1319 | * @bssid: BSSID of the BSS |
1228 | * @tsf: timestamp of last received update | ||
1229 | * @beacon_interval: the beacon interval as from the frame | 1320 | * @beacon_interval: the beacon interval as from the frame |
1230 | * @capability: the capability field in host byte order | 1321 | * @capability: the capability field in host byte order |
1231 | * @ies: the information elements (Note that there | 1322 | * @ies: the information elements (Note that there is no guarantee that these |
1232 | * is no guarantee that these are well-formed!); this is a pointer to | 1323 | * are well-formed!); this is a pointer to either the beacon_ies or |
1233 | * either the beacon_ies or proberesp_ies depending on whether Probe | 1324 | * proberesp_ies depending on whether Probe Response frame has been |
1234 | * Response frame has been received | 1325 | * received. It is always non-%NULL. |
1235 | * @beacon_ies: the information elements from the last Beacon frame | 1326 | * @beacon_ies: the information elements from the last Beacon frame |
1327 | * (implementation note: if @hidden_beacon_bss is set this struct doesn't | ||
1328 | * own the beacon_ies, but they're just pointers to the ones from the | ||
1329 | * @hidden_beacon_bss struct) | ||
1236 | * @proberesp_ies: the information elements from the last Probe Response frame | 1330 | * @proberesp_ies: the information elements from the last Probe Response frame |
1331 | * @hidden_beacon_bss: in case this BSS struct represents a probe response from | ||
1332 | * a BSS that hides the SSID in its beacon, this points to the BSS struct | ||
1333 | * that holds the beacon data. @beacon_ies is still valid, of course, and | ||
1334 | * points to the same data as hidden_beacon_bss->beacon_ies in that case. | ||
1237 | * @signal: signal strength value (type depends on the wiphy's signal_type) | 1335 | * @signal: signal strength value (type depends on the wiphy's signal_type) |
1238 | * @free_priv: function pointer to free private data | ||
1239 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes | 1336 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes |
1240 | */ | 1337 | */ |
1241 | struct cfg80211_bss { | 1338 | struct cfg80211_bss { |
1242 | u64 tsf; | ||
1243 | |||
1244 | struct ieee80211_channel *channel; | 1339 | struct ieee80211_channel *channel; |
1245 | 1340 | ||
1246 | const struct cfg80211_bss_ies __rcu *ies; | 1341 | const struct cfg80211_bss_ies __rcu *ies; |
1247 | const struct cfg80211_bss_ies __rcu *beacon_ies; | 1342 | const struct cfg80211_bss_ies __rcu *beacon_ies; |
1248 | const struct cfg80211_bss_ies __rcu *proberesp_ies; | 1343 | const struct cfg80211_bss_ies __rcu *proberesp_ies; |
1249 | 1344 | ||
1250 | void (*free_priv)(struct cfg80211_bss *bss); | 1345 | struct cfg80211_bss *hidden_beacon_bss; |
1251 | 1346 | ||
1252 | s32 signal; | 1347 | s32 signal; |
1253 | 1348 | ||
@@ -1256,7 +1351,7 @@ struct cfg80211_bss { | |||
1256 | 1351 | ||
1257 | u8 bssid[ETH_ALEN]; | 1352 | u8 bssid[ETH_ALEN]; |
1258 | 1353 | ||
1259 | u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); | 1354 | u8 priv[0] __aligned(sizeof(void *)); |
1260 | }; | 1355 | }; |
1261 | 1356 | ||
1262 | /** | 1357 | /** |
@@ -1266,7 +1361,7 @@ struct cfg80211_bss { | |||
1266 | * | 1361 | * |
1267 | * Note that the return value is an RCU-protected pointer, so | 1362 | * Note that the return value is an RCU-protected pointer, so |
1268 | * rcu_read_lock() must be held when calling this function. | 1363 | * rcu_read_lock() must be held when calling this function. |
1269 | * Returns %NULL if not found. | 1364 | * Return: %NULL if not found. |
1270 | */ | 1365 | */ |
1271 | const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | 1366 | const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); |
1272 | 1367 | ||
@@ -1349,6 +1444,8 @@ struct cfg80211_assoc_request { | |||
1349 | * @ie: Extra IEs to add to Deauthentication frame or %NULL | 1444 | * @ie: Extra IEs to add to Deauthentication frame or %NULL |
1350 | * @ie_len: Length of ie buffer in octets | 1445 | * @ie_len: Length of ie buffer in octets |
1351 | * @reason_code: The reason code for the deauthentication | 1446 | * @reason_code: The reason code for the deauthentication |
1447 | * @local_state_change: if set, change local state only and | ||
1448 | * do not set a deauth frame | ||
1352 | */ | 1449 | */ |
1353 | struct cfg80211_deauth_request { | 1450 | struct cfg80211_deauth_request { |
1354 | const u8 *bssid; | 1451 | const u8 *bssid; |
@@ -1434,6 +1531,7 @@ struct cfg80211_ibss_params { | |||
1434 | * @ie: IEs for association request | 1531 | * @ie: IEs for association request |
1435 | * @ie_len: Length of assoc_ie in octets | 1532 | * @ie_len: Length of assoc_ie in octets |
1436 | * @privacy: indicates whether privacy-enabled APs should be used | 1533 | * @privacy: indicates whether privacy-enabled APs should be used |
1534 | * @mfp: indicate whether management frame protection is used | ||
1437 | * @crypto: crypto settings | 1535 | * @crypto: crypto settings |
1438 | * @key_len: length of WEP key for shared key authentication | 1536 | * @key_len: length of WEP key for shared key authentication |
1439 | * @key_idx: index of WEP key for shared key authentication | 1537 | * @key_idx: index of WEP key for shared key authentication |
@@ -1454,6 +1552,7 @@ struct cfg80211_connect_params { | |||
1454 | u8 *ie; | 1552 | u8 *ie; |
1455 | size_t ie_len; | 1553 | size_t ie_len; |
1456 | bool privacy; | 1554 | bool privacy; |
1555 | enum nl80211_mfp mfp; | ||
1457 | struct cfg80211_crypto_settings crypto; | 1556 | struct cfg80211_crypto_settings crypto; |
1458 | const u8 *key; | 1557 | const u8 *key; |
1459 | u8 key_len, key_idx; | 1558 | u8 key_len, key_idx; |
@@ -1508,6 +1607,7 @@ struct cfg80211_pmksa { | |||
1508 | * one bit per byte, in same format as nl80211 | 1607 | * one bit per byte, in same format as nl80211 |
1509 | * @pattern: bytes to match where bitmask is 1 | 1608 | * @pattern: bytes to match where bitmask is 1 |
1510 | * @pattern_len: length of pattern (in bytes) | 1609 | * @pattern_len: length of pattern (in bytes) |
1610 | * @pkt_offset: packet offset (in bytes) | ||
1511 | * | 1611 | * |
1512 | * Internal note: @mask and @pattern are allocated in one chunk of | 1612 | * Internal note: @mask and @pattern are allocated in one chunk of |
1513 | * memory, free @mask only! | 1613 | * memory, free @mask only! |
@@ -1515,6 +1615,42 @@ struct cfg80211_pmksa { | |||
1515 | struct cfg80211_wowlan_trig_pkt_pattern { | 1615 | struct cfg80211_wowlan_trig_pkt_pattern { |
1516 | u8 *mask, *pattern; | 1616 | u8 *mask, *pattern; |
1517 | int pattern_len; | 1617 | int pattern_len; |
1618 | int pkt_offset; | ||
1619 | }; | ||
1620 | |||
1621 | /** | ||
1622 | * struct cfg80211_wowlan_tcp - TCP connection parameters | ||
1623 | * | ||
1624 | * @sock: (internal) socket for source port allocation | ||
1625 | * @src: source IP address | ||
1626 | * @dst: destination IP address | ||
1627 | * @dst_mac: destination MAC address | ||
1628 | * @src_port: source port | ||
1629 | * @dst_port: destination port | ||
1630 | * @payload_len: data payload length | ||
1631 | * @payload: data payload buffer | ||
1632 | * @payload_seq: payload sequence stamping configuration | ||
1633 | * @data_interval: interval at which to send data packets | ||
1634 | * @wake_len: wakeup payload match length | ||
1635 | * @wake_data: wakeup payload match data | ||
1636 | * @wake_mask: wakeup payload match mask | ||
1637 | * @tokens_size: length of the tokens buffer | ||
1638 | * @payload_tok: payload token usage configuration | ||
1639 | */ | ||
1640 | struct cfg80211_wowlan_tcp { | ||
1641 | struct socket *sock; | ||
1642 | __be32 src, dst; | ||
1643 | u16 src_port, dst_port; | ||
1644 | u8 dst_mac[ETH_ALEN]; | ||
1645 | int payload_len; | ||
1646 | const u8 *payload; | ||
1647 | struct nl80211_wowlan_tcp_data_seq payload_seq; | ||
1648 | u32 data_interval; | ||
1649 | u32 wake_len; | ||
1650 | const u8 *wake_data, *wake_mask; | ||
1651 | u32 tokens_size; | ||
1652 | /* must be last, variable member */ | ||
1653 | struct nl80211_wowlan_tcp_data_token payload_tok; | ||
1518 | }; | 1654 | }; |
1519 | 1655 | ||
1520 | /** | 1656 | /** |
@@ -1531,16 +1667,49 @@ struct cfg80211_wowlan_trig_pkt_pattern { | |||
1531 | * @eap_identity_req: wake up on EAP identity request packet | 1667 | * @eap_identity_req: wake up on EAP identity request packet |
1532 | * @four_way_handshake: wake up on 4-way handshake | 1668 | * @four_way_handshake: wake up on 4-way handshake |
1533 | * @rfkill_release: wake up when rfkill is released | 1669 | * @rfkill_release: wake up when rfkill is released |
1670 | * @tcp: TCP connection establishment/wakeup parameters, see nl80211.h. | ||
1671 | * NULL if not configured. | ||
1534 | */ | 1672 | */ |
1535 | struct cfg80211_wowlan { | 1673 | struct cfg80211_wowlan { |
1536 | bool any, disconnect, magic_pkt, gtk_rekey_failure, | 1674 | bool any, disconnect, magic_pkt, gtk_rekey_failure, |
1537 | eap_identity_req, four_way_handshake, | 1675 | eap_identity_req, four_way_handshake, |
1538 | rfkill_release; | 1676 | rfkill_release; |
1539 | struct cfg80211_wowlan_trig_pkt_pattern *patterns; | 1677 | struct cfg80211_wowlan_trig_pkt_pattern *patterns; |
1678 | struct cfg80211_wowlan_tcp *tcp; | ||
1540 | int n_patterns; | 1679 | int n_patterns; |
1541 | }; | 1680 | }; |
1542 | 1681 | ||
1543 | /** | 1682 | /** |
1683 | * struct cfg80211_wowlan_wakeup - wakeup report | ||
1684 | * @disconnect: woke up by getting disconnected | ||
1685 | * @magic_pkt: woke up by receiving magic packet | ||
1686 | * @gtk_rekey_failure: woke up by GTK rekey failure | ||
1687 | * @eap_identity_req: woke up by EAP identity request packet | ||
1688 | * @four_way_handshake: woke up by 4-way handshake | ||
1689 | * @rfkill_release: woke up by rfkill being released | ||
1690 | * @pattern_idx: pattern that caused wakeup, -1 if not due to pattern | ||
1691 | * @packet_present_len: copied wakeup packet data | ||
1692 | * @packet_len: original wakeup packet length | ||
1693 | * @packet: The packet causing the wakeup, if any. | ||
1694 | * @packet_80211: For pattern match, magic packet and other data | ||
1695 | * frame triggers an 802.3 frame should be reported, for | ||
1696 | * disconnect due to deauth 802.11 frame. This indicates which | ||
1697 | * it is. | ||
1698 | * @tcp_match: TCP wakeup packet received | ||
1699 | * @tcp_connlost: TCP connection lost or failed to establish | ||
1700 | * @tcp_nomoretokens: TCP data ran out of tokens | ||
1701 | */ | ||
1702 | struct cfg80211_wowlan_wakeup { | ||
1703 | bool disconnect, magic_pkt, gtk_rekey_failure, | ||
1704 | eap_identity_req, four_way_handshake, | ||
1705 | rfkill_release, packet_80211, | ||
1706 | tcp_match, tcp_connlost, tcp_nomoretokens; | ||
1707 | s32 pattern_idx; | ||
1708 | u32 packet_present_len, packet_len; | ||
1709 | const void *packet; | ||
1710 | }; | ||
1711 | |||
1712 | /** | ||
1544 | * struct cfg80211_gtk_rekey_data - rekey data | 1713 | * struct cfg80211_gtk_rekey_data - rekey data |
1545 | * @kek: key encryption key | 1714 | * @kek: key encryption key |
1546 | * @kck: key confirmation key | 1715 | * @kck: key confirmation key |
@@ -1763,6 +1932,15 @@ struct cfg80211_gtk_rekey_data { | |||
1763 | * | 1932 | * |
1764 | * @start_p2p_device: Start the given P2P device. | 1933 | * @start_p2p_device: Start the given P2P device. |
1765 | * @stop_p2p_device: Stop the given P2P device. | 1934 | * @stop_p2p_device: Stop the given P2P device. |
1935 | * | ||
1936 | * @set_mac_acl: Sets MAC address control list in AP and P2P GO mode. | ||
1937 | * Parameters include ACL policy, an array of MAC address of stations | ||
1938 | * and the number of MAC addresses. If there is already a list in driver | ||
1939 | * this new list replaces the existing one. Driver has to clear its ACL | ||
1940 | * when number of MAC addresses entries is passed as 0. Drivers which | ||
1941 | * advertise the support for MAC based ACL have to implement this callback. | ||
1942 | * | ||
1943 | * @start_radar_detection: Start radar detection in the driver. | ||
1766 | */ | 1944 | */ |
1767 | struct cfg80211_ops { | 1945 | struct cfg80211_ops { |
1768 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1946 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
@@ -1983,6 +2161,13 @@ struct cfg80211_ops { | |||
1983 | struct wireless_dev *wdev); | 2161 | struct wireless_dev *wdev); |
1984 | void (*stop_p2p_device)(struct wiphy *wiphy, | 2162 | void (*stop_p2p_device)(struct wiphy *wiphy, |
1985 | struct wireless_dev *wdev); | 2163 | struct wireless_dev *wdev); |
2164 | |||
2165 | int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev, | ||
2166 | const struct cfg80211_acl_data *params); | ||
2167 | |||
2168 | int (*start_radar_detection)(struct wiphy *wiphy, | ||
2169 | struct net_device *dev, | ||
2170 | struct cfg80211_chan_def *chandef); | ||
1986 | }; | 2171 | }; |
1987 | 2172 | ||
1988 | /* | 2173 | /* |
@@ -2092,6 +2277,7 @@ struct ieee80211_iface_limit { | |||
2092 | * @beacon_int_infra_match: In this combination, the beacon intervals | 2277 | * @beacon_int_infra_match: In this combination, the beacon intervals |
2093 | * between infrastructure and AP types must match. This is required | 2278 | * between infrastructure and AP types must match. This is required |
2094 | * only in special cases. | 2279 | * only in special cases. |
2280 | * @radar_detect_widths: bitmap of channel widths supported for radar detection | ||
2095 | * | 2281 | * |
2096 | * These examples can be expressed as follows: | 2282 | * These examples can be expressed as follows: |
2097 | * | 2283 | * |
@@ -2144,10 +2330,7 @@ struct ieee80211_iface_combination { | |||
2144 | u16 max_interfaces; | 2330 | u16 max_interfaces; |
2145 | u8 n_limits; | 2331 | u8 n_limits; |
2146 | bool beacon_int_infra_match; | 2332 | bool beacon_int_infra_match; |
2147 | }; | 2333 | u8 radar_detect_widths; |
2148 | |||
2149 | struct mac_address { | ||
2150 | u8 addr[ETH_ALEN]; | ||
2151 | }; | 2334 | }; |
2152 | 2335 | ||
2153 | struct ieee80211_txrx_stypes { | 2336 | struct ieee80211_txrx_stypes { |
@@ -2181,6 +2364,14 @@ enum wiphy_wowlan_support_flags { | |||
2181 | WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), | 2364 | WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), |
2182 | }; | 2365 | }; |
2183 | 2366 | ||
2367 | struct wiphy_wowlan_tcp_support { | ||
2368 | const struct nl80211_wowlan_tcp_data_token_feature *tok; | ||
2369 | u32 data_payload_max; | ||
2370 | u32 data_interval_max; | ||
2371 | u32 wake_payload_max; | ||
2372 | bool seq; | ||
2373 | }; | ||
2374 | |||
2184 | /** | 2375 | /** |
2185 | * struct wiphy_wowlan_support - WoWLAN support data | 2376 | * struct wiphy_wowlan_support - WoWLAN support data |
2186 | * @flags: see &enum wiphy_wowlan_support_flags | 2377 | * @flags: see &enum wiphy_wowlan_support_flags |
@@ -2188,12 +2379,16 @@ enum wiphy_wowlan_support_flags { | |||
2188 | * (see nl80211.h for the pattern definition) | 2379 | * (see nl80211.h for the pattern definition) |
2189 | * @pattern_max_len: maximum length of each pattern | 2380 | * @pattern_max_len: maximum length of each pattern |
2190 | * @pattern_min_len: minimum length of each pattern | 2381 | * @pattern_min_len: minimum length of each pattern |
2382 | * @max_pkt_offset: maximum Rx packet offset | ||
2383 | * @tcp: TCP wakeup support information | ||
2191 | */ | 2384 | */ |
2192 | struct wiphy_wowlan_support { | 2385 | struct wiphy_wowlan_support { |
2193 | u32 flags; | 2386 | u32 flags; |
2194 | int n_patterns; | 2387 | int n_patterns; |
2195 | int pattern_max_len; | 2388 | int pattern_max_len; |
2196 | int pattern_min_len; | 2389 | int pattern_min_len; |
2390 | int max_pkt_offset; | ||
2391 | const struct wiphy_wowlan_tcp_support *tcp; | ||
2197 | }; | 2392 | }; |
2198 | 2393 | ||
2199 | /** | 2394 | /** |
@@ -2290,6 +2485,17 @@ struct wiphy_wowlan_support { | |||
2290 | * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. | 2485 | * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. |
2291 | * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. | 2486 | * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. |
2292 | * If null, then none can be over-ridden. | 2487 | * If null, then none can be over-ridden. |
2488 | * | ||
2489 | * @max_acl_mac_addrs: Maximum number of MAC addresses that the device | ||
2490 | * supports for ACL. | ||
2491 | * | ||
2492 | * @extended_capabilities: extended capabilities supported by the driver, | ||
2493 | * additional capabilities might be supported by userspace; these are | ||
2494 | * the 802.11 extended capabilities ("Extended Capabilities element") | ||
2495 | * and are in the same format as in the information element. See | ||
2496 | * 802.11-2012 8.4.2.29 for the defined fields. | ||
2497 | * @extended_capabilities_mask: mask of the valid values | ||
2498 | * @extended_capabilities_len: length of the extended capabilities | ||
2293 | */ | 2499 | */ |
2294 | struct wiphy { | 2500 | struct wiphy { |
2295 | /* assign these fields before you register the wiphy */ | 2501 | /* assign these fields before you register the wiphy */ |
@@ -2311,6 +2517,8 @@ struct wiphy { | |||
2311 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 2517 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
2312 | u16 interface_modes; | 2518 | u16 interface_modes; |
2313 | 2519 | ||
2520 | u16 max_acl_mac_addrs; | ||
2521 | |||
2314 | u32 flags, features; | 2522 | u32 flags, features; |
2315 | 2523 | ||
2316 | u32 ap_sme_capa; | 2524 | u32 ap_sme_capa; |
@@ -2333,7 +2541,7 @@ struct wiphy { | |||
2333 | u32 rts_threshold; | 2541 | u32 rts_threshold; |
2334 | u8 coverage_class; | 2542 | u8 coverage_class; |
2335 | 2543 | ||
2336 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 2544 | char fw_version[ETHTOOL_FWVERS_LEN]; |
2337 | u32 hw_version; | 2545 | u32 hw_version; |
2338 | 2546 | ||
2339 | #ifdef CONFIG_PM | 2547 | #ifdef CONFIG_PM |
@@ -2354,6 +2562,9 @@ struct wiphy { | |||
2354 | */ | 2562 | */ |
2355 | u32 probe_resp_offload; | 2563 | u32 probe_resp_offload; |
2356 | 2564 | ||
2565 | const u8 *extended_capabilities, *extended_capabilities_mask; | ||
2566 | u8 extended_capabilities_len; | ||
2567 | |||
2357 | /* If multiple wiphys are registered and you're handed e.g. | 2568 | /* If multiple wiphys are registered and you're handed e.g. |
2358 | * a regular netdev with assigned ieee80211_ptr, you won't | 2569 | * a regular netdev with assigned ieee80211_ptr, you won't |
2359 | * know whether it points to a wiphy your driver has registered | 2570 | * know whether it points to a wiphy your driver has registered |
@@ -2364,12 +2575,12 @@ struct wiphy { | |||
2364 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; | 2575 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; |
2365 | 2576 | ||
2366 | /* Lets us get back the wiphy on the callback */ | 2577 | /* Lets us get back the wiphy on the callback */ |
2367 | int (*reg_notifier)(struct wiphy *wiphy, | 2578 | void (*reg_notifier)(struct wiphy *wiphy, |
2368 | struct regulatory_request *request); | 2579 | struct regulatory_request *request); |
2369 | 2580 | ||
2370 | /* fields below are read-only, assigned by cfg80211 */ | 2581 | /* fields below are read-only, assigned by cfg80211 */ |
2371 | 2582 | ||
2372 | const struct ieee80211_regdomain *regd; | 2583 | const struct ieee80211_regdomain __rcu *regd; |
2373 | 2584 | ||
2374 | /* the item in /sys/class/ieee80211/ points to this, | 2585 | /* the item in /sys/class/ieee80211/ points to this, |
2375 | * you need use set_wiphy_dev() (see below) */ | 2586 | * you need use set_wiphy_dev() (see below) */ |
@@ -2392,7 +2603,7 @@ struct wiphy { | |||
2392 | const struct iw_handler_def *wext; | 2603 | const struct iw_handler_def *wext; |
2393 | #endif | 2604 | #endif |
2394 | 2605 | ||
2395 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 2606 | char priv[0] __aligned(NETDEV_ALIGN); |
2396 | }; | 2607 | }; |
2397 | 2608 | ||
2398 | static inline struct net *wiphy_net(struct wiphy *wiphy) | 2609 | static inline struct net *wiphy_net(struct wiphy *wiphy) |
@@ -2409,6 +2620,7 @@ static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | |||
2409 | * wiphy_priv - return priv from wiphy | 2620 | * wiphy_priv - return priv from wiphy |
2410 | * | 2621 | * |
2411 | * @wiphy: the wiphy whose priv pointer to return | 2622 | * @wiphy: the wiphy whose priv pointer to return |
2623 | * Return: The priv of @wiphy. | ||
2412 | */ | 2624 | */ |
2413 | static inline void *wiphy_priv(struct wiphy *wiphy) | 2625 | static inline void *wiphy_priv(struct wiphy *wiphy) |
2414 | { | 2626 | { |
@@ -2420,6 +2632,7 @@ static inline void *wiphy_priv(struct wiphy *wiphy) | |||
2420 | * priv_to_wiphy - return the wiphy containing the priv | 2632 | * priv_to_wiphy - return the wiphy containing the priv |
2421 | * | 2633 | * |
2422 | * @priv: a pointer previously returned by wiphy_priv | 2634 | * @priv: a pointer previously returned by wiphy_priv |
2635 | * Return: The wiphy of @priv. | ||
2423 | */ | 2636 | */ |
2424 | static inline struct wiphy *priv_to_wiphy(void *priv) | 2637 | static inline struct wiphy *priv_to_wiphy(void *priv) |
2425 | { | 2638 | { |
@@ -2442,6 +2655,7 @@ static inline void set_wiphy_dev(struct wiphy *wiphy, struct device *dev) | |||
2442 | * wiphy_dev - get wiphy dev pointer | 2655 | * wiphy_dev - get wiphy dev pointer |
2443 | * | 2656 | * |
2444 | * @wiphy: The wiphy whose device struct to look up | 2657 | * @wiphy: The wiphy whose device struct to look up |
2658 | * Return: The dev of @wiphy. | ||
2445 | */ | 2659 | */ |
2446 | static inline struct device *wiphy_dev(struct wiphy *wiphy) | 2660 | static inline struct device *wiphy_dev(struct wiphy *wiphy) |
2447 | { | 2661 | { |
@@ -2452,6 +2666,7 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy) | |||
2452 | * wiphy_name - get wiphy name | 2666 | * wiphy_name - get wiphy name |
2453 | * | 2667 | * |
2454 | * @wiphy: The wiphy whose name to return | 2668 | * @wiphy: The wiphy whose name to return |
2669 | * Return: The name of @wiphy. | ||
2455 | */ | 2670 | */ |
2456 | static inline const char *wiphy_name(const struct wiphy *wiphy) | 2671 | static inline const char *wiphy_name(const struct wiphy *wiphy) |
2457 | { | 2672 | { |
@@ -2467,8 +2682,8 @@ static inline const char *wiphy_name(const struct wiphy *wiphy) | |||
2467 | * Create a new wiphy and associate the given operations with it. | 2682 | * Create a new wiphy and associate the given operations with it. |
2468 | * @sizeof_priv bytes are allocated for private use. | 2683 | * @sizeof_priv bytes are allocated for private use. |
2469 | * | 2684 | * |
2470 | * The returned pointer must be assigned to each netdev's | 2685 | * Return: A pointer to the new wiphy. This pointer must be |
2471 | * ieee80211_ptr for proper operation. | 2686 | * assigned to each netdev's ieee80211_ptr for proper operation. |
2472 | */ | 2687 | */ |
2473 | struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv); | 2688 | struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv); |
2474 | 2689 | ||
@@ -2477,7 +2692,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv); | |||
2477 | * | 2692 | * |
2478 | * @wiphy: The wiphy to register. | 2693 | * @wiphy: The wiphy to register. |
2479 | * | 2694 | * |
2480 | * Returns a non-negative wiphy index or a negative error code. | 2695 | * Return: A non-negative wiphy index or a negative error code. |
2481 | */ | 2696 | */ |
2482 | extern int wiphy_register(struct wiphy *wiphy); | 2697 | extern int wiphy_register(struct wiphy *wiphy); |
2483 | 2698 | ||
@@ -2529,7 +2744,6 @@ struct cfg80211_cached_keys; | |||
2529 | * the user-set AP, monitor and WDS channel | 2744 | * the user-set AP, monitor and WDS channel |
2530 | * @preset_chan: (private) Used by the internal configuration code to | 2745 | * @preset_chan: (private) Used by the internal configuration code to |
2531 | * track the channel to be used for AP later | 2746 | * track the channel to be used for AP later |
2532 | * @preset_chantype: (private) the corresponding channel type | ||
2533 | * @bssid: (private) Used by the internal configuration code | 2747 | * @bssid: (private) Used by the internal configuration code |
2534 | * @ssid: (private) Used by the internal configuration code | 2748 | * @ssid: (private) Used by the internal configuration code |
2535 | * @ssid_len: (private) Used by the internal configuration code | 2749 | * @ssid_len: (private) Used by the internal configuration code |
@@ -2548,6 +2762,8 @@ struct cfg80211_cached_keys; | |||
2548 | * beacons, 0 when not valid | 2762 | * beacons, 0 when not valid |
2549 | * @address: The address for this device, valid only if @netdev is %NULL | 2763 | * @address: The address for this device, valid only if @netdev is %NULL |
2550 | * @p2p_started: true if this is a P2P Device that has been started | 2764 | * @p2p_started: true if this is a P2P Device that has been started |
2765 | * @cac_started: true if DFS channel availability check has been started | ||
2766 | * @cac_start_time: timestamp (jiffies) when the dfs state was entered. | ||
2551 | */ | 2767 | */ |
2552 | struct wireless_dev { | 2768 | struct wireless_dev { |
2553 | struct wiphy *wiphy; | 2769 | struct wiphy *wiphy; |
@@ -2599,6 +2815,9 @@ struct wireless_dev { | |||
2599 | 2815 | ||
2600 | u32 ap_unexpected_nlportid; | 2816 | u32 ap_unexpected_nlportid; |
2601 | 2817 | ||
2818 | bool cac_started; | ||
2819 | unsigned long cac_start_time; | ||
2820 | |||
2602 | #ifdef CONFIG_CFG80211_WEXT | 2821 | #ifdef CONFIG_CFG80211_WEXT |
2603 | /* wext data */ | 2822 | /* wext data */ |
2604 | struct { | 2823 | struct { |
@@ -2626,6 +2845,7 @@ static inline u8 *wdev_address(struct wireless_dev *wdev) | |||
2626 | * wdev_priv - return wiphy priv from wireless_dev | 2845 | * wdev_priv - return wiphy priv from wireless_dev |
2627 | * | 2846 | * |
2628 | * @wdev: The wireless device whose wiphy's priv pointer to return | 2847 | * @wdev: The wireless device whose wiphy's priv pointer to return |
2848 | * Return: The wiphy priv of @wdev. | ||
2629 | */ | 2849 | */ |
2630 | static inline void *wdev_priv(struct wireless_dev *wdev) | 2850 | static inline void *wdev_priv(struct wireless_dev *wdev) |
2631 | { | 2851 | { |
@@ -2643,12 +2863,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
2643 | * ieee80211_channel_to_frequency - convert channel number to frequency | 2863 | * ieee80211_channel_to_frequency - convert channel number to frequency |
2644 | * @chan: channel number | 2864 | * @chan: channel number |
2645 | * @band: band, necessary due to channel number overlap | 2865 | * @band: band, necessary due to channel number overlap |
2866 | * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. | ||
2646 | */ | 2867 | */ |
2647 | extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); | 2868 | extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); |
2648 | 2869 | ||
2649 | /** | 2870 | /** |
2650 | * ieee80211_frequency_to_channel - convert frequency to channel number | 2871 | * ieee80211_frequency_to_channel - convert frequency to channel number |
2651 | * @freq: center frequency | 2872 | * @freq: center frequency |
2873 | * Return: The corresponding channel, or 0 if the conversion failed. | ||
2652 | */ | 2874 | */ |
2653 | extern int ieee80211_frequency_to_channel(int freq); | 2875 | extern int ieee80211_frequency_to_channel(int freq); |
2654 | 2876 | ||
@@ -2665,6 +2887,7 @@ extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |||
2665 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency | 2887 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
2666 | * @wiphy: the struct wiphy to get the channel for | 2888 | * @wiphy: the struct wiphy to get the channel for |
2667 | * @freq: the center frequency of the channel | 2889 | * @freq: the center frequency of the channel |
2890 | * Return: The channel struct from @wiphy at @freq. | ||
2668 | */ | 2891 | */ |
2669 | static inline struct ieee80211_channel * | 2892 | static inline struct ieee80211_channel * |
2670 | ieee80211_get_channel(struct wiphy *wiphy, int freq) | 2893 | ieee80211_get_channel(struct wiphy *wiphy, int freq) |
@@ -2679,10 +2902,10 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq) | |||
2679 | * @basic_rates: bitmap of basic rates | 2902 | * @basic_rates: bitmap of basic rates |
2680 | * @bitrate: the bitrate for which to find the basic rate | 2903 | * @bitrate: the bitrate for which to find the basic rate |
2681 | * | 2904 | * |
2682 | * This function returns the basic rate corresponding to a given | 2905 | * Return: The basic rate corresponding to a given bitrate, that |
2683 | * bitrate, that is the next lower bitrate contained in the basic | 2906 | * is the next lower bitrate contained in the basic rate map, |
2684 | * rate map, which is, for this function, given as a bitmap of | 2907 | * which is, for this function, given as a bitmap of indices of |
2685 | * indices of rates in the band's bitrate table. | 2908 | * rates in the band's bitrate table. |
2686 | */ | 2909 | */ |
2687 | struct ieee80211_rate * | 2910 | struct ieee80211_rate * |
2688 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, | 2911 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, |
@@ -2775,18 +2998,21 @@ extern const unsigned char bridge_tunnel_header[6]; | |||
2775 | /** | 2998 | /** |
2776 | * ieee80211_get_hdrlen_from_skb - get header length from data | 2999 | * ieee80211_get_hdrlen_from_skb - get header length from data |
2777 | * | 3000 | * |
3001 | * @skb: the frame | ||
3002 | * | ||
2778 | * Given an skb with a raw 802.11 header at the data pointer this function | 3003 | * Given an skb with a raw 802.11 header at the data pointer this function |
2779 | * returns the 802.11 header length in bytes (not including encryption | 3004 | * returns the 802.11 header length. |
2780 | * headers). If the data in the sk_buff is too short to contain a valid 802.11 | ||
2781 | * header the function returns 0. | ||
2782 | * | 3005 | * |
2783 | * @skb: the frame | 3006 | * Return: The 802.11 header length in bytes (not including encryption |
3007 | * headers). Or 0 if the data in the sk_buff is too short to contain a valid | ||
3008 | * 802.11 header. | ||
2784 | */ | 3009 | */ |
2785 | unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | 3010 | unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); |
2786 | 3011 | ||
2787 | /** | 3012 | /** |
2788 | * ieee80211_hdrlen - get header length in bytes from frame control | 3013 | * ieee80211_hdrlen - get header length in bytes from frame control |
2789 | * @fc: frame control field in little-endian format | 3014 | * @fc: frame control field in little-endian format |
3015 | * Return: The header length in bytes. | ||
2790 | */ | 3016 | */ |
2791 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | 3017 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
2792 | 3018 | ||
@@ -2794,7 +3020,7 @@ unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | |||
2794 | * ieee80211_get_mesh_hdrlen - get mesh extension header length | 3020 | * ieee80211_get_mesh_hdrlen - get mesh extension header length |
2795 | * @meshhdr: the mesh extension header, only the flags field | 3021 | * @meshhdr: the mesh extension header, only the flags field |
2796 | * (first byte) will be accessed | 3022 | * (first byte) will be accessed |
2797 | * Returns the length of the extension header, which is always at | 3023 | * Return: The length of the extension header, which is always at |
2798 | * least 6 bytes and at most 18 if address 5 and 6 are present. | 3024 | * least 6 bytes and at most 18 if address 5 and 6 are present. |
2799 | */ | 3025 | */ |
2800 | unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | 3026 | unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); |
@@ -2812,6 +3038,7 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | |||
2812 | * @skb: the 802.11 data frame | 3038 | * @skb: the 802.11 data frame |
2813 | * @addr: the device MAC address | 3039 | * @addr: the device MAC address |
2814 | * @iftype: the virtual interface type | 3040 | * @iftype: the virtual interface type |
3041 | * Return: 0 on success. Non-zero on error. | ||
2815 | */ | 3042 | */ |
2816 | int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, | 3043 | int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, |
2817 | enum nl80211_iftype iftype); | 3044 | enum nl80211_iftype iftype); |
@@ -2823,6 +3050,7 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, | |||
2823 | * @iftype: the virtual interface type | 3050 | * @iftype: the virtual interface type |
2824 | * @bssid: the network bssid (used only for iftype STATION and ADHOC) | 3051 | * @bssid: the network bssid (used only for iftype STATION and ADHOC) |
2825 | * @qos: build 802.11 QoS data frame | 3052 | * @qos: build 802.11 QoS data frame |
3053 | * Return: 0 on success, or a negative error code. | ||
2826 | */ | 3054 | */ |
2827 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | 3055 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, |
2828 | enum nl80211_iftype iftype, u8 *bssid, bool qos); | 3056 | enum nl80211_iftype iftype, u8 *bssid, bool qos); |
@@ -2850,6 +3078,7 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, | |||
2850 | /** | 3078 | /** |
2851 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame | 3079 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame |
2852 | * @skb: the data frame | 3080 | * @skb: the data frame |
3081 | * Return: The 802.1p/1d tag. | ||
2853 | */ | 3082 | */ |
2854 | unsigned int cfg80211_classify8021d(struct sk_buff *skb); | 3083 | unsigned int cfg80211_classify8021d(struct sk_buff *skb); |
2855 | 3084 | ||
@@ -2860,12 +3089,13 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
2860 | * @ies: data consisting of IEs | 3089 | * @ies: data consisting of IEs |
2861 | * @len: length of data | 3090 | * @len: length of data |
2862 | * | 3091 | * |
2863 | * This function will return %NULL if the element ID could | 3092 | * Return: %NULL if the element ID could not be found or if |
2864 | * not be found or if the element is invalid (claims to be | 3093 | * the element is invalid (claims to be longer than the given |
2865 | * longer than the given data), or a pointer to the first byte | 3094 | * data), or a pointer to the first byte of the requested |
2866 | * of the requested element, that is the byte containing the | 3095 | * element, that is the byte containing the element ID. |
2867 | * element ID. There are no checks on the element length | 3096 | * |
2868 | * other than having to fit into the given data. | 3097 | * Note: There are no checks on the element length other than |
3098 | * having to fit into the given data. | ||
2869 | */ | 3099 | */ |
2870 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | 3100 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
2871 | 3101 | ||
@@ -2877,12 +3107,13 @@ const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | |||
2877 | * @ies: data consisting of IEs | 3107 | * @ies: data consisting of IEs |
2878 | * @len: length of data | 3108 | * @len: length of data |
2879 | * | 3109 | * |
2880 | * This function will return %NULL if the vendor specific element ID | 3110 | * Return: %NULL if the vendor specific element ID could not be found or if the |
2881 | * could not be found or if the element is invalid (claims to be | 3111 | * element is invalid (claims to be longer than the given data), or a pointer to |
2882 | * longer than the given data), or a pointer to the first byte | 3112 | * the first byte of the requested element, that is the byte containing the |
2883 | * of the requested element, that is the byte containing the | 3113 | * element ID. |
2884 | * element ID. There are no checks on the element length | 3114 | * |
2885 | * other than having to fit into the given data. | 3115 | * Note: There are no checks on the element length other than having to fit into |
3116 | * the given data. | ||
2886 | */ | 3117 | */ |
2887 | const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, | 3118 | const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, |
2888 | const u8 *ies, int len); | 3119 | const u8 *ies, int len); |
@@ -2915,6 +3146,8 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, | |||
2915 | * | 3146 | * |
2916 | * Drivers should check the return value, its possible you can get | 3147 | * Drivers should check the return value, its possible you can get |
2917 | * an -ENOMEM. | 3148 | * an -ENOMEM. |
3149 | * | ||
3150 | * Return: 0 on success. -ENOMEM. | ||
2918 | */ | 3151 | */ |
2919 | extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); | 3152 | extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); |
2920 | 3153 | ||
@@ -2938,28 +3171,22 @@ extern void wiphy_apply_custom_regulatory( | |||
2938 | * freq_reg_info - get regulatory information for the given frequency | 3171 | * freq_reg_info - get regulatory information for the given frequency |
2939 | * @wiphy: the wiphy for which we want to process this rule for | 3172 | * @wiphy: the wiphy for which we want to process this rule for |
2940 | * @center_freq: Frequency in KHz for which we want regulatory information for | 3173 | * @center_freq: Frequency in KHz for which we want regulatory information for |
2941 | * @desired_bw_khz: the desired max bandwidth you want to use per | ||
2942 | * channel. Note that this is still 20 MHz if you want to use HT40 | ||
2943 | * as HT40 makes use of two channels for its 40 MHz width bandwidth. | ||
2944 | * If set to 0 we'll assume you want the standard 20 MHz. | ||
2945 | * @reg_rule: the regulatory rule which we have for this frequency | ||
2946 | * | 3174 | * |
2947 | * Use this function to get the regulatory rule for a specific frequency on | 3175 | * Use this function to get the regulatory rule for a specific frequency on |
2948 | * a given wireless device. If the device has a specific regulatory domain | 3176 | * a given wireless device. If the device has a specific regulatory domain |
2949 | * it wants to follow we respect that unless a country IE has been received | 3177 | * it wants to follow we respect that unless a country IE has been received |
2950 | * and processed already. | 3178 | * and processed already. |
2951 | * | 3179 | * |
2952 | * Returns 0 if it was able to find a valid regulatory rule which does | 3180 | * Return: A valid pointer, or, when an error occurs, for example if no rule |
2953 | * apply to the given center_freq otherwise it returns non-zero. It will | 3181 | * can be found, the return value is encoded using ERR_PTR(). Use IS_ERR() to |
2954 | * also return -ERANGE if we determine the given center_freq does not even have | 3182 | * check and PTR_ERR() to obtain the numeric return value. The numeric return |
2955 | * a regulatory rule for a frequency range in the center_freq's band. See | 3183 | * value will be -ERANGE if we determine the given center_freq does not even |
2956 | * freq_in_rule_band() for our current definition of a band -- this is purely | 3184 | * have a regulatory rule for a frequency range in the center_freq's band. |
2957 | * subjective and right now its 802.11 specific. | 3185 | * See freq_in_rule_band() for our current definition of a band -- this is |
3186 | * purely subjective and right now it's 802.11 specific. | ||
2958 | */ | 3187 | */ |
2959 | extern int freq_reg_info(struct wiphy *wiphy, | 3188 | const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy, |
2960 | u32 center_freq, | 3189 | u32 center_freq); |
2961 | u32 desired_bw_khz, | ||
2962 | const struct ieee80211_reg_rule **reg_rule); | ||
2963 | 3190 | ||
2964 | /* | 3191 | /* |
2965 | * callbacks for asynchronous cfg80211 methods, notification | 3192 | * callbacks for asynchronous cfg80211 methods, notification |
@@ -3006,7 +3233,8 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy); | |||
3006 | * This informs cfg80211 that BSS information was found and | 3233 | * This informs cfg80211 that BSS information was found and |
3007 | * the BSS should be updated/added. | 3234 | * the BSS should be updated/added. |
3008 | * | 3235 | * |
3009 | * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()! | 3236 | * Return: A referenced struct, must be released with cfg80211_put_bss()! |
3237 | * Or %NULL on error. | ||
3010 | */ | 3238 | */ |
3011 | struct cfg80211_bss * __must_check | 3239 | struct cfg80211_bss * __must_check |
3012 | cfg80211_inform_bss_frame(struct wiphy *wiphy, | 3240 | cfg80211_inform_bss_frame(struct wiphy *wiphy, |
@@ -3031,7 +3259,8 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
3031 | * This informs cfg80211 that BSS information was found and | 3259 | * This informs cfg80211 that BSS information was found and |
3032 | * the BSS should be updated/added. | 3260 | * the BSS should be updated/added. |
3033 | * | 3261 | * |
3034 | * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()! | 3262 | * Return: A referenced struct, must be released with cfg80211_put_bss()! |
3263 | * Or %NULL on error. | ||
3035 | */ | 3264 | */ |
3036 | struct cfg80211_bss * __must_check | 3265 | struct cfg80211_bss * __must_check |
3037 | cfg80211_inform_bss(struct wiphy *wiphy, | 3266 | cfg80211_inform_bss(struct wiphy *wiphy, |
@@ -3054,25 +3283,23 @@ cfg80211_get_ibss(struct wiphy *wiphy, | |||
3054 | WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); | 3283 | WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); |
3055 | } | 3284 | } |
3056 | 3285 | ||
3057 | struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy, | ||
3058 | struct ieee80211_channel *channel, | ||
3059 | const u8 *meshid, size_t meshidlen, | ||
3060 | const u8 *meshcfg); | ||
3061 | /** | 3286 | /** |
3062 | * cfg80211_ref_bss - reference BSS struct | 3287 | * cfg80211_ref_bss - reference BSS struct |
3288 | * @wiphy: the wiphy this BSS struct belongs to | ||
3063 | * @bss: the BSS struct to reference | 3289 | * @bss: the BSS struct to reference |
3064 | * | 3290 | * |
3065 | * Increments the refcount of the given BSS struct. | 3291 | * Increments the refcount of the given BSS struct. |
3066 | */ | 3292 | */ |
3067 | void cfg80211_ref_bss(struct cfg80211_bss *bss); | 3293 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
3068 | 3294 | ||
3069 | /** | 3295 | /** |
3070 | * cfg80211_put_bss - unref BSS struct | 3296 | * cfg80211_put_bss - unref BSS struct |
3297 | * @wiphy: the wiphy this BSS struct belongs to | ||
3071 | * @bss: the BSS struct | 3298 | * @bss: the BSS struct |
3072 | * | 3299 | * |
3073 | * Decrements the refcount of the given BSS struct. | 3300 | * Decrements the refcount of the given BSS struct. |
3074 | */ | 3301 | */ |
3075 | void cfg80211_put_bss(struct cfg80211_bss *bss); | 3302 | void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
3076 | 3303 | ||
3077 | /** | 3304 | /** |
3078 | * cfg80211_unlink_bss - unlink BSS from internal data structures | 3305 | * cfg80211_unlink_bss - unlink BSS from internal data structures |
@@ -3308,16 +3535,18 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | |||
3308 | * the testmode command. Since it is intended for a reply, calling | 3535 | * the testmode command. Since it is intended for a reply, calling |
3309 | * it outside of the @testmode_cmd operation is invalid. | 3536 | * it outside of the @testmode_cmd operation is invalid. |
3310 | * | 3537 | * |
3311 | * The returned skb (or %NULL if any errors happen) is pre-filled | 3538 | * The returned skb is pre-filled with the wiphy index and set up in |
3312 | * with the wiphy index and set up in a way that any data that is | 3539 | * a way that any data that is put into the skb (with skb_put(), |
3313 | * put into the skb (with skb_put(), nla_put() or similar) will end | 3540 | * nla_put() or similar) will end up being within the |
3314 | * up being within the %NL80211_ATTR_TESTDATA attribute, so all that | 3541 | * %NL80211_ATTR_TESTDATA attribute, so all that needs to be done |
3315 | * needs to be done with the skb is adding data for the corresponding | 3542 | * with the skb is adding data for the corresponding userspace tool |
3316 | * userspace tool which can then read that data out of the testdata | 3543 | * which can then read that data out of the testdata attribute. You |
3317 | * attribute. You must not modify the skb in any other way. | 3544 | * must not modify the skb in any other way. |
3318 | * | 3545 | * |
3319 | * When done, call cfg80211_testmode_reply() with the skb and return | 3546 | * When done, call cfg80211_testmode_reply() with the skb and return |
3320 | * its error code as the result of the @testmode_cmd operation. | 3547 | * its error code as the result of the @testmode_cmd operation. |
3548 | * | ||
3549 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | ||
3321 | */ | 3550 | */ |
3322 | struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | 3551 | struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, |
3323 | int approxlen); | 3552 | int approxlen); |
@@ -3327,11 +3556,12 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | |||
3327 | * @skb: The skb, must have been allocated with | 3556 | * @skb: The skb, must have been allocated with |
3328 | * cfg80211_testmode_alloc_reply_skb() | 3557 | * cfg80211_testmode_alloc_reply_skb() |
3329 | * | 3558 | * |
3330 | * Returns an error code or 0 on success, since calling this | 3559 | * Since calling this function will usually be the last thing |
3331 | * function will usually be the last thing before returning | 3560 | * before returning from the @testmode_cmd you should return |
3332 | * from the @testmode_cmd you should return the error code. | 3561 | * the error code. Note that this function consumes the skb |
3333 | * Note that this function consumes the skb regardless of the | 3562 | * regardless of the return value. |
3334 | * return value. | 3563 | * |
3564 | * Return: An error code or 0 on success. | ||
3335 | */ | 3565 | */ |
3336 | int cfg80211_testmode_reply(struct sk_buff *skb); | 3566 | int cfg80211_testmode_reply(struct sk_buff *skb); |
3337 | 3567 | ||
@@ -3345,14 +3575,16 @@ int cfg80211_testmode_reply(struct sk_buff *skb); | |||
3345 | * This function allocates and pre-fills an skb for an event on the | 3575 | * This function allocates and pre-fills an skb for an event on the |
3346 | * testmode multicast group. | 3576 | * testmode multicast group. |
3347 | * | 3577 | * |
3348 | * The returned skb (or %NULL if any errors happen) is set up in the | 3578 | * The returned skb is set up in the same way as with |
3349 | * same way as with cfg80211_testmode_alloc_reply_skb() but prepared | 3579 | * cfg80211_testmode_alloc_reply_skb() but prepared for an event. As |
3350 | * for an event. As there, you should simply add data to it that will | 3580 | * there, you should simply add data to it that will then end up in the |
3351 | * then end up in the %NL80211_ATTR_TESTDATA attribute. Again, you must | 3581 | * %NL80211_ATTR_TESTDATA attribute. Again, you must not modify the skb |
3352 | * not modify the skb in any other way. | 3582 | * in any other way. |
3353 | * | 3583 | * |
3354 | * When done filling the skb, call cfg80211_testmode_event() with the | 3584 | * When done filling the skb, call cfg80211_testmode_event() with the |
3355 | * skb to send the event. | 3585 | * skb to send the event. |
3586 | * | ||
3587 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | ||
3356 | */ | 3588 | */ |
3357 | struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, | 3589 | struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, |
3358 | int approxlen, gfp_t gfp); | 3590 | int approxlen, gfp_t gfp); |
@@ -3533,13 +3765,13 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | |||
3533 | * @len: length of the frame data | 3765 | * @len: length of the frame data |
3534 | * @gfp: context flags | 3766 | * @gfp: context flags |
3535 | * | 3767 | * |
3536 | * Returns %true if a user space application has registered for this frame. | 3768 | * This function is called whenever an Action frame is received for a station |
3769 | * mode interface, but is not processed in kernel. | ||
3770 | * | ||
3771 | * Return: %true if a user space application has registered for this frame. | ||
3537 | * For action frames, that makes it responsible for rejecting unrecognized | 3772 | * For action frames, that makes it responsible for rejecting unrecognized |
3538 | * action frames; %false otherwise, in which case for action frames the | 3773 | * action frames; %false otherwise, in which case for action frames the |
3539 | * driver is responsible for rejecting the frame. | 3774 | * driver is responsible for rejecting the frame. |
3540 | * | ||
3541 | * This function is called whenever an Action frame is received for a station | ||
3542 | * mode interface, but is not processed in kernel. | ||
3543 | */ | 3775 | */ |
3544 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, | 3776 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
3545 | const u8 *buf, size_t len, gfp_t gfp); | 3777 | const u8 *buf, size_t len, gfp_t gfp); |
@@ -3575,6 +3807,31 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
3575 | gfp_t gfp); | 3807 | gfp_t gfp); |
3576 | 3808 | ||
3577 | /** | 3809 | /** |
3810 | * cfg80211_radar_event - radar detection event | ||
3811 | * @wiphy: the wiphy | ||
3812 | * @chandef: chandef for the current channel | ||
3813 | * @gfp: context flags | ||
3814 | * | ||
3815 | * This function is called when a radar is detected on the current chanenl. | ||
3816 | */ | ||
3817 | void cfg80211_radar_event(struct wiphy *wiphy, | ||
3818 | struct cfg80211_chan_def *chandef, gfp_t gfp); | ||
3819 | |||
3820 | /** | ||
3821 | * cfg80211_cac_event - Channel availability check (CAC) event | ||
3822 | * @netdev: network device | ||
3823 | * @event: type of event | ||
3824 | * @gfp: context flags | ||
3825 | * | ||
3826 | * This function is called when a Channel availability check (CAC) is finished | ||
3827 | * or aborted. This must be called to notify the completion of a CAC process, | ||
3828 | * also by full-MAC drivers. | ||
3829 | */ | ||
3830 | void cfg80211_cac_event(struct net_device *netdev, | ||
3831 | enum nl80211_radar_event event, gfp_t gfp); | ||
3832 | |||
3833 | |||
3834 | /** | ||
3578 | * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer | 3835 | * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer |
3579 | * @dev: network device | 3836 | * @dev: network device |
3580 | * @peer: peer's MAC address | 3837 | * @peer: peer's MAC address |
@@ -3631,7 +3888,7 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index, | |||
3631 | * This function is used in AP mode (only!) to inform userspace that | 3888 | * This function is used in AP mode (only!) to inform userspace that |
3632 | * a spurious class 3 frame was received, to be able to deauth the | 3889 | * a spurious class 3 frame was received, to be able to deauth the |
3633 | * sender. | 3890 | * sender. |
3634 | * Returns %true if the frame was passed to userspace (or this failed | 3891 | * Return: %true if the frame was passed to userspace (or this failed |
3635 | * for a reason other than not having a subscription.) | 3892 | * for a reason other than not having a subscription.) |
3636 | */ | 3893 | */ |
3637 | bool cfg80211_rx_spurious_frame(struct net_device *dev, | 3894 | bool cfg80211_rx_spurious_frame(struct net_device *dev, |
@@ -3647,7 +3904,7 @@ bool cfg80211_rx_spurious_frame(struct net_device *dev, | |||
3647 | * an associated station sent a 4addr frame but that wasn't expected. | 3904 | * an associated station sent a 4addr frame but that wasn't expected. |
3648 | * It is allowed and desirable to send this event only once for each | 3905 | * It is allowed and desirable to send this event only once for each |
3649 | * station to avoid event flooding. | 3906 | * station to avoid event flooding. |
3650 | * Returns %true if the frame was passed to userspace (or this failed | 3907 | * Return: %true if the frame was passed to userspace (or this failed |
3651 | * for a reason other than not having a subscription.) | 3908 | * for a reason other than not having a subscription.) |
3652 | */ | 3909 | */ |
3653 | bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, | 3910 | bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, |
@@ -3685,8 +3942,8 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
3685 | * @wiphy: the wiphy | 3942 | * @wiphy: the wiphy |
3686 | * @chandef: the channel definition | 3943 | * @chandef: the channel definition |
3687 | * | 3944 | * |
3688 | * This function returns true if there is no secondary channel or the secondary | 3945 | * Return: %true if there is no secondary channel or the secondary channel(s) |
3689 | * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) | 3946 | * can be used for beaconing (i.e. is not a radar channel etc.) |
3690 | */ | 3947 | */ |
3691 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, | 3948 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3692 | struct cfg80211_chan_def *chandef); | 3949 | struct cfg80211_chan_def *chandef); |
@@ -3756,14 +4013,29 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev); | |||
3756 | * The function finds a given P2P attribute in the (vendor) IEs and | 4013 | * The function finds a given P2P attribute in the (vendor) IEs and |
3757 | * copies its contents to the given buffer. | 4014 | * copies its contents to the given buffer. |
3758 | * | 4015 | * |
3759 | * The return value is a negative error code (-%EILSEQ or -%ENOENT) if | 4016 | * Return: A negative error code (-%EILSEQ or -%ENOENT) if the data is |
3760 | * the data is malformed or the attribute can't be found (respectively), | 4017 | * malformed or the attribute can't be found (respectively), or the |
3761 | * or the length of the found attribute (which can be zero). | 4018 | * length of the found attribute (which can be zero). |
3762 | */ | 4019 | */ |
3763 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | 4020 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, |
3764 | enum ieee80211_p2p_attr_id attr, | 4021 | enum ieee80211_p2p_attr_id attr, |
3765 | u8 *buf, unsigned int bufsize); | 4022 | u8 *buf, unsigned int bufsize); |
3766 | 4023 | ||
4024 | /** | ||
4025 | * cfg80211_report_wowlan_wakeup - report wakeup from WoWLAN | ||
4026 | * @wdev: the wireless device reporting the wakeup | ||
4027 | * @wakeup: the wakeup report | ||
4028 | * @gfp: allocation flags | ||
4029 | * | ||
4030 | * This function reports that the given device woke up. If it | ||
4031 | * caused the wakeup, report the reason(s), otherwise you may | ||
4032 | * pass %NULL as the @wakeup parameter to advertise that something | ||
4033 | * else caused the wakeup. | ||
4034 | */ | ||
4035 | void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | ||
4036 | struct cfg80211_wowlan_wakeup *wakeup, | ||
4037 | gfp_t gfp); | ||
4038 | |||
3767 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4039 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3768 | 4040 | ||
3769 | /* wiphy_printk helpers, similar to dev_printk */ | 4041 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 4f7d6a182381..2e9d317c82dc 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
@@ -16,7 +16,7 @@ | |||
16 | *******************************************************************************/ | 16 | *******************************************************************************/ |
17 | 17 | ||
18 | extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); | 18 | extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); |
19 | extern int dn_route_output_sock(struct dst_entry **pprt, struct flowidn *, struct sock *sk, int flags); | 19 | extern int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *, struct sock *sk, int flags); |
20 | extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); | 20 | extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); |
21 | extern void dn_rt_cache_flush(int delay); | 21 | extern void dn_rt_cache_flush(int delay); |
22 | 22 | ||
diff --git a/include/net/dsfield.h b/include/net/dsfield.h index 8a8d4e06900d..e1ad903a8d6a 100644 --- a/include/net/dsfield.h +++ b/include/net/dsfield.h | |||
@@ -43,11 +43,9 @@ static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, | |||
43 | static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask, | 43 | static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask, |
44 | __u8 value) | 44 | __u8 value) |
45 | { | 45 | { |
46 | __u16 tmp; | 46 | __be16 *p = (__force __be16 *)ipv6h; |
47 | 47 | ||
48 | tmp = ntohs(*(__be16 *) ipv6h); | 48 | *p = (*p & htons((((u16)mask << 4) | 0xf00f))) | htons((u16)value << 4); |
49 | tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4); | ||
50 | *(__be16 *) ipv6h = htons(tmp); | ||
51 | } | 49 | } |
52 | 50 | ||
53 | 51 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 9a7881066fb3..853cda11e518 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -36,13 +36,9 @@ struct dst_entry { | |||
36 | struct net_device *dev; | 36 | struct net_device *dev; |
37 | struct dst_ops *ops; | 37 | struct dst_ops *ops; |
38 | unsigned long _metrics; | 38 | unsigned long _metrics; |
39 | union { | 39 | unsigned long expires; |
40 | unsigned long expires; | ||
41 | /* point to where the dst_entry copied from */ | ||
42 | struct dst_entry *from; | ||
43 | }; | ||
44 | struct dst_entry *path; | 40 | struct dst_entry *path; |
45 | void *__pad0; | 41 | struct dst_entry *from; |
46 | #ifdef CONFIG_XFRM | 42 | #ifdef CONFIG_XFRM |
47 | struct xfrm_state *xfrm; | 43 | struct xfrm_state *xfrm; |
48 | #else | 44 | #else |
@@ -61,6 +57,7 @@ struct dst_entry { | |||
61 | #define DST_NOPEER 0x0040 | 57 | #define DST_NOPEER 0x0040 |
62 | #define DST_FAKE_RTABLE 0x0080 | 58 | #define DST_FAKE_RTABLE 0x0080 |
63 | #define DST_XFRM_TUNNEL 0x0100 | 59 | #define DST_XFRM_TUNNEL 0x0100 |
60 | #define DST_XFRM_QUEUE 0x0200 | ||
64 | 61 | ||
65 | unsigned short pending_confirm; | 62 | unsigned short pending_confirm; |
66 | 63 | ||
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h index e5062c955ea6..734d9b5f577a 100644 --- a/include/net/gro_cells.h +++ b/include/net/gro_cells.h | |||
@@ -73,8 +73,8 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de | |||
73 | int i; | 73 | int i; |
74 | 74 | ||
75 | gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; | 75 | gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; |
76 | gcells->cells = kcalloc(sizeof(struct gro_cell), | 76 | gcells->cells = kcalloc(gcells->gro_cells_mask + 1, |
77 | gcells->gro_cells_mask + 1, | 77 | sizeof(struct gro_cell), |
78 | GFP_KERNEL); | 78 | GFP_KERNEL); |
79 | if (!gcells->cells) | 79 | if (!gcells->cells) |
80 | return -ENOMEM; | 80 | return -ENOMEM; |
diff --git a/include/net/icmp.h b/include/net/icmp.h index 9ac2524d1402..081439fd070e 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
@@ -41,6 +41,7 @@ struct net; | |||
41 | 41 | ||
42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); | 42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); |
43 | extern int icmp_rcv(struct sk_buff *skb); | 43 | extern int icmp_rcv(struct sk_buff *skb); |
44 | extern void icmp_err(struct sk_buff *, u32 info); | ||
44 | extern int icmp_init(void); | 45 | extern int icmp_init(void); |
45 | extern void icmp_out_count(struct net *net, unsigned char type); | 46 | extern void icmp_out_count(struct net *net, unsigned char type); |
46 | 47 | ||
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 9e34c877a770..fd4ee016ba5c 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -28,16 +28,16 @@ | |||
28 | 28 | ||
29 | struct inet_hashinfo; | 29 | struct inet_hashinfo; |
30 | 30 | ||
31 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ | ||
32 | static inline unsigned int inet6_ehashfn(struct net *net, | 31 | static inline unsigned int inet6_ehashfn(struct net *net, |
33 | const struct in6_addr *laddr, const u16 lport, | 32 | const struct in6_addr *laddr, const u16 lport, |
34 | const struct in6_addr *faddr, const __be16 fport) | 33 | const struct in6_addr *faddr, const __be16 fport) |
35 | { | 34 | { |
36 | u32 ports = (lport ^ (__force u16)fport); | 35 | u32 ports = (((u32)lport) << 16) | (__force u32)fport; |
37 | 36 | ||
38 | return jhash_3words((__force u32)laddr->s6_addr32[3], | 37 | return jhash_3words((__force u32)laddr->s6_addr32[3], |
39 | (__force u32)faddr->s6_addr32[3], | 38 | ipv6_addr_jhash(faddr), |
40 | ports, inet_ehash_secret + net_hash_mix(net)); | 39 | ports, |
40 | inet_ehash_secret + net_hash_mix(net)); | ||
41 | } | 41 | } |
42 | 42 | ||
43 | static inline int inet6_sk_ehashfn(const struct sock *sk) | 43 | static inline int inet6_sk_ehashfn(const struct sock *sk) |
@@ -71,6 +71,8 @@ extern struct sock *__inet6_lookup_established(struct net *net, | |||
71 | 71 | ||
72 | extern struct sock *inet6_lookup_listener(struct net *net, | 72 | extern struct sock *inet6_lookup_listener(struct net *net, |
73 | struct inet_hashinfo *hashinfo, | 73 | struct inet_hashinfo *hashinfo, |
74 | const struct in6_addr *saddr, | ||
75 | const __be16 sport, | ||
74 | const struct in6_addr *daddr, | 76 | const struct in6_addr *daddr, |
75 | const unsigned short hnum, | 77 | const unsigned short hnum, |
76 | const int dif); | 78 | const int dif); |
@@ -88,7 +90,8 @@ static inline struct sock *__inet6_lookup(struct net *net, | |||
88 | if (sk) | 90 | if (sk) |
89 | return sk; | 91 | return sk; |
90 | 92 | ||
91 | return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif); | 93 | return inet6_lookup_listener(net, hashinfo, saddr, sport, |
94 | daddr, hnum, dif); | ||
92 | } | 95 | } |
93 | 96 | ||
94 | static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, | 97 | static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 32786a044718..76c3fe5ecc2e 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -1,10 +1,17 @@ | |||
1 | #ifndef __NET_FRAG_H__ | 1 | #ifndef __NET_FRAG_H__ |
2 | #define __NET_FRAG_H__ | 2 | #define __NET_FRAG_H__ |
3 | 3 | ||
4 | #include <linux/percpu_counter.h> | ||
5 | |||
4 | struct netns_frags { | 6 | struct netns_frags { |
5 | int nqueues; | 7 | int nqueues; |
6 | atomic_t mem; | ||
7 | struct list_head lru_list; | 8 | struct list_head lru_list; |
9 | spinlock_t lru_lock; | ||
10 | |||
11 | /* The percpu_counter "mem" need to be cacheline aligned. | ||
12 | * mem.count must not share cacheline with other writers | ||
13 | */ | ||
14 | struct percpu_counter mem ____cacheline_aligned_in_smp; | ||
8 | 15 | ||
9 | /* sysctls */ | 16 | /* sysctls */ |
10 | int timeout; | 17 | int timeout; |
@@ -13,12 +20,11 @@ struct netns_frags { | |||
13 | }; | 20 | }; |
14 | 21 | ||
15 | struct inet_frag_queue { | 22 | struct inet_frag_queue { |
16 | struct hlist_node list; | ||
17 | struct netns_frags *net; | ||
18 | struct list_head lru_list; /* lru list member */ | ||
19 | spinlock_t lock; | 23 | spinlock_t lock; |
20 | atomic_t refcnt; | ||
21 | struct timer_list timer; /* when will this queue expire? */ | 24 | struct timer_list timer; /* when will this queue expire? */ |
25 | struct list_head lru_list; /* lru list member */ | ||
26 | struct hlist_node list; | ||
27 | atomic_t refcnt; | ||
22 | struct sk_buff *fragments; /* list of received fragments */ | 28 | struct sk_buff *fragments; /* list of received fragments */ |
23 | struct sk_buff *fragments_tail; | 29 | struct sk_buff *fragments_tail; |
24 | ktime_t stamp; | 30 | ktime_t stamp; |
@@ -31,24 +37,29 @@ struct inet_frag_queue { | |||
31 | #define INET_FRAG_LAST_IN 1 | 37 | #define INET_FRAG_LAST_IN 1 |
32 | 38 | ||
33 | u16 max_size; | 39 | u16 max_size; |
40 | |||
41 | struct netns_frags *net; | ||
34 | }; | 42 | }; |
35 | 43 | ||
36 | #define INETFRAGS_HASHSZ 64 | 44 | #define INETFRAGS_HASHSZ 64 |
37 | 45 | ||
38 | struct inet_frags { | 46 | struct inet_frags { |
39 | struct hlist_head hash[INETFRAGS_HASHSZ]; | 47 | struct hlist_head hash[INETFRAGS_HASHSZ]; |
40 | rwlock_t lock; | 48 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and |
41 | u32 rnd; | 49 | * netfilter). Important to keep this on a seperate cacheline. |
42 | int qsize; | 50 | */ |
51 | rwlock_t lock ____cacheline_aligned_in_smp; | ||
43 | int secret_interval; | 52 | int secret_interval; |
44 | struct timer_list secret_timer; | 53 | struct timer_list secret_timer; |
54 | u32 rnd; | ||
55 | int qsize; | ||
45 | 56 | ||
46 | unsigned int (*hashfn)(struct inet_frag_queue *); | 57 | unsigned int (*hashfn)(struct inet_frag_queue *); |
58 | bool (*match)(struct inet_frag_queue *q, void *arg); | ||
47 | void (*constructor)(struct inet_frag_queue *q, | 59 | void (*constructor)(struct inet_frag_queue *q, |
48 | void *arg); | 60 | void *arg); |
49 | void (*destructor)(struct inet_frag_queue *); | 61 | void (*destructor)(struct inet_frag_queue *); |
50 | void (*skb_free)(struct sk_buff *); | 62 | void (*skb_free)(struct sk_buff *); |
51 | bool (*match)(struct inet_frag_queue *q, void *arg); | ||
52 | void (*frag_expire)(unsigned long data); | 63 | void (*frag_expire)(unsigned long data); |
53 | }; | 64 | }; |
54 | 65 | ||
@@ -72,4 +83,65 @@ static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f | |||
72 | inet_frag_destroy(q, f, NULL); | 83 | inet_frag_destroy(q, f, NULL); |
73 | } | 84 | } |
74 | 85 | ||
86 | /* Memory Tracking Functions. */ | ||
87 | |||
88 | /* The default percpu_counter batch size is not big enough to scale to | ||
89 | * fragmentation mem acct sizes. | ||
90 | * The mem size of a 64K fragment is approx: | ||
91 | * (44 fragments * 2944 truesize) + frag_queue struct(200) = 129736 bytes | ||
92 | */ | ||
93 | static unsigned int frag_percpu_counter_batch = 130000; | ||
94 | |||
95 | static inline int frag_mem_limit(struct netns_frags *nf) | ||
96 | { | ||
97 | return percpu_counter_read(&nf->mem); | ||
98 | } | ||
99 | |||
100 | static inline void sub_frag_mem_limit(struct inet_frag_queue *q, int i) | ||
101 | { | ||
102 | __percpu_counter_add(&q->net->mem, -i, frag_percpu_counter_batch); | ||
103 | } | ||
104 | |||
105 | static inline void add_frag_mem_limit(struct inet_frag_queue *q, int i) | ||
106 | { | ||
107 | __percpu_counter_add(&q->net->mem, i, frag_percpu_counter_batch); | ||
108 | } | ||
109 | |||
110 | static inline void init_frag_mem_limit(struct netns_frags *nf) | ||
111 | { | ||
112 | percpu_counter_init(&nf->mem, 0); | ||
113 | } | ||
114 | |||
115 | static inline int sum_frag_mem_limit(struct netns_frags *nf) | ||
116 | { | ||
117 | int res; | ||
118 | |||
119 | local_bh_disable(); | ||
120 | res = percpu_counter_sum_positive(&nf->mem); | ||
121 | local_bh_enable(); | ||
122 | |||
123 | return res; | ||
124 | } | ||
125 | |||
126 | static inline void inet_frag_lru_move(struct inet_frag_queue *q) | ||
127 | { | ||
128 | spin_lock(&q->net->lru_lock); | ||
129 | list_move_tail(&q->lru_list, &q->net->lru_list); | ||
130 | spin_unlock(&q->net->lru_lock); | ||
131 | } | ||
132 | |||
133 | static inline void inet_frag_lru_del(struct inet_frag_queue *q) | ||
134 | { | ||
135 | spin_lock(&q->net->lru_lock); | ||
136 | list_del(&q->lru_list); | ||
137 | spin_unlock(&q->net->lru_lock); | ||
138 | } | ||
139 | |||
140 | static inline void inet_frag_lru_add(struct netns_frags *nf, | ||
141 | struct inet_frag_queue *q) | ||
142 | { | ||
143 | spin_lock(&nf->lru_lock); | ||
144 | list_add_tail(&q->lru_list, &nf->lru_list); | ||
145 | spin_unlock(&nf->lru_lock); | ||
146 | } | ||
75 | #endif | 147 | #endif |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 67a8fa098e3a..7b2ae9d37076 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -81,7 +81,9 @@ struct inet_bind_bucket { | |||
81 | struct net *ib_net; | 81 | struct net *ib_net; |
82 | #endif | 82 | #endif |
83 | unsigned short port; | 83 | unsigned short port; |
84 | signed short fastreuse; | 84 | signed char fastreuse; |
85 | signed char fastreuseport; | ||
86 | kuid_t fastuid; | ||
85 | int num_owners; | 87 | int num_owners; |
86 | struct hlist_node node; | 88 | struct hlist_node node; |
87 | struct hlist_head owners; | 89 | struct hlist_head owners; |
@@ -257,15 +259,19 @@ extern void inet_unhash(struct sock *sk); | |||
257 | 259 | ||
258 | extern struct sock *__inet_lookup_listener(struct net *net, | 260 | extern struct sock *__inet_lookup_listener(struct net *net, |
259 | struct inet_hashinfo *hashinfo, | 261 | struct inet_hashinfo *hashinfo, |
262 | const __be32 saddr, | ||
263 | const __be16 sport, | ||
260 | const __be32 daddr, | 264 | const __be32 daddr, |
261 | const unsigned short hnum, | 265 | const unsigned short hnum, |
262 | const int dif); | 266 | const int dif); |
263 | 267 | ||
264 | static inline struct sock *inet_lookup_listener(struct net *net, | 268 | static inline struct sock *inet_lookup_listener(struct net *net, |
265 | struct inet_hashinfo *hashinfo, | 269 | struct inet_hashinfo *hashinfo, |
270 | __be32 saddr, __be16 sport, | ||
266 | __be32 daddr, __be16 dport, int dif) | 271 | __be32 daddr, __be16 dport, int dif) |
267 | { | 272 | { |
268 | return __inet_lookup_listener(net, hashinfo, daddr, ntohs(dport), dif); | 273 | return __inet_lookup_listener(net, hashinfo, saddr, sport, |
274 | daddr, ntohs(dport), dif); | ||
269 | } | 275 | } |
270 | 276 | ||
271 | /* Socket demux engine toys. */ | 277 | /* Socket demux engine toys. */ |
@@ -358,7 +364,8 @@ static inline struct sock *__inet_lookup(struct net *net, | |||
358 | struct sock *sk = __inet_lookup_established(net, hashinfo, | 364 | struct sock *sk = __inet_lookup_established(net, hashinfo, |
359 | saddr, sport, daddr, hnum, dif); | 365 | saddr, sport, daddr, hnum, dif); |
360 | 366 | ||
361 | return sk ? : __inet_lookup_listener(net, hashinfo, daddr, hnum, dif); | 367 | return sk ? : __inet_lookup_listener(net, hashinfo, saddr, sport, |
368 | daddr, hnum, dif); | ||
362 | } | 369 | } |
363 | 370 | ||
364 | static inline struct sock *inet_lookup(struct net *net, | 371 | static inline struct sock *inet_lookup(struct net *net, |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a4196cbc84ec..7235ae73a1e8 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -203,6 +203,7 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
203 | extern int inet_sk_rebuild_header(struct sock *sk); | 203 | extern int inet_sk_rebuild_header(struct sock *sk); |
204 | 204 | ||
205 | extern u32 inet_ehash_secret; | 205 | extern u32 inet_ehash_secret; |
206 | extern u32 ipv6_hash_secret; | ||
206 | extern void build_ehash_secret(void); | 207 | extern void build_ehash_secret(void); |
207 | 208 | ||
208 | static inline unsigned int inet_ehashfn(struct net *net, | 209 | static inline unsigned int inet_ehashfn(struct net *net, |
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index 652d3d309357..7686e3f5033d 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -35,63 +35,10 @@ | |||
35 | #include <linux/ipv6.h> | 35 | #include <linux/ipv6.h> |
36 | 36 | ||
37 | #ifndef _HAVE_ARCH_IPV6_CSUM | 37 | #ifndef _HAVE_ARCH_IPV6_CSUM |
38 | 38 | __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |
39 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | 39 | const struct in6_addr *daddr, |
40 | const struct in6_addr *daddr, | 40 | __u32 len, unsigned short proto, |
41 | __u32 len, unsigned short proto, | 41 | __wsum csum); |
42 | __wsum csum) | ||
43 | { | ||
44 | |||
45 | int carry; | ||
46 | __u32 ulen; | ||
47 | __u32 uproto; | ||
48 | __u32 sum = (__force u32)csum; | ||
49 | |||
50 | sum += (__force u32)saddr->s6_addr32[0]; | ||
51 | carry = (sum < (__force u32)saddr->s6_addr32[0]); | ||
52 | sum += carry; | ||
53 | |||
54 | sum += (__force u32)saddr->s6_addr32[1]; | ||
55 | carry = (sum < (__force u32)saddr->s6_addr32[1]); | ||
56 | sum += carry; | ||
57 | |||
58 | sum += (__force u32)saddr->s6_addr32[2]; | ||
59 | carry = (sum < (__force u32)saddr->s6_addr32[2]); | ||
60 | sum += carry; | ||
61 | |||
62 | sum += (__force u32)saddr->s6_addr32[3]; | ||
63 | carry = (sum < (__force u32)saddr->s6_addr32[3]); | ||
64 | sum += carry; | ||
65 | |||
66 | sum += (__force u32)daddr->s6_addr32[0]; | ||
67 | carry = (sum < (__force u32)daddr->s6_addr32[0]); | ||
68 | sum += carry; | ||
69 | |||
70 | sum += (__force u32)daddr->s6_addr32[1]; | ||
71 | carry = (sum < (__force u32)daddr->s6_addr32[1]); | ||
72 | sum += carry; | ||
73 | |||
74 | sum += (__force u32)daddr->s6_addr32[2]; | ||
75 | carry = (sum < (__force u32)daddr->s6_addr32[2]); | ||
76 | sum += carry; | ||
77 | |||
78 | sum += (__force u32)daddr->s6_addr32[3]; | ||
79 | carry = (sum < (__force u32)daddr->s6_addr32[3]); | ||
80 | sum += carry; | ||
81 | |||
82 | ulen = (__force u32)htonl((__u32) len); | ||
83 | sum += ulen; | ||
84 | carry = (sum < ulen); | ||
85 | sum += carry; | ||
86 | |||
87 | uproto = (__force u32)htonl(proto); | ||
88 | sum += uproto; | ||
89 | carry = (sum < uproto); | ||
90 | sum += carry; | ||
91 | |||
92 | return csum_fold((__force __wsum)sum); | ||
93 | } | ||
94 | |||
95 | #endif | 42 | #endif |
96 | 43 | ||
97 | static __inline__ __sum16 tcp_v6_check(int len, | 44 | static __inline__ __sum16 tcp_v6_check(int len, |
@@ -126,4 +73,5 @@ static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) | |||
126 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); | 73 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); |
127 | } | 74 | } |
128 | 75 | ||
76 | int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto); | ||
129 | #endif | 77 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index fdc48a94a063..2a601e7da1bf 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -89,8 +89,6 @@ struct fib6_table; | |||
89 | struct rt6_info { | 89 | struct rt6_info { |
90 | struct dst_entry dst; | 90 | struct dst_entry dst; |
91 | 91 | ||
92 | struct neighbour *n; | ||
93 | |||
94 | /* | 92 | /* |
95 | * Tail elements of dst_entry (__refcnt etc.) | 93 | * Tail elements of dst_entry (__refcnt etc.) |
96 | * and these elements (rarely used in hot path) are in | 94 | * and these elements (rarely used in hot path) are in |
@@ -166,50 +164,35 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | |||
166 | 164 | ||
167 | static inline void rt6_clean_expires(struct rt6_info *rt) | 165 | static inline void rt6_clean_expires(struct rt6_info *rt) |
168 | { | 166 | { |
169 | if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) | ||
170 | dst_release(rt->dst.from); | ||
171 | |||
172 | rt->rt6i_flags &= ~RTF_EXPIRES; | 167 | rt->rt6i_flags &= ~RTF_EXPIRES; |
173 | rt->dst.from = NULL; | ||
174 | } | 168 | } |
175 | 169 | ||
176 | static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) | 170 | static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) |
177 | { | 171 | { |
178 | if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) | ||
179 | dst_release(rt->dst.from); | ||
180 | |||
181 | rt->rt6i_flags |= RTF_EXPIRES; | ||
182 | rt->dst.expires = expires; | 172 | rt->dst.expires = expires; |
173 | rt->rt6i_flags |= RTF_EXPIRES; | ||
183 | } | 174 | } |
184 | 175 | ||
185 | static inline void rt6_update_expires(struct rt6_info *rt, int timeout) | 176 | static inline void rt6_update_expires(struct rt6_info *rt0, int timeout) |
186 | { | 177 | { |
187 | if (!(rt->rt6i_flags & RTF_EXPIRES)) { | 178 | struct rt6_info *rt; |
188 | if (rt->dst.from) | 179 | |
189 | dst_release(rt->dst.from); | 180 | for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES); |
190 | /* dst_set_expires relies on expires == 0 | 181 | rt = (struct rt6_info *)rt->dst.from); |
191 | * if it has not been set previously. | 182 | if (rt && rt != rt0) |
192 | */ | 183 | rt0->dst.expires = rt->dst.expires; |
193 | rt->dst.expires = 0; | 184 | |
194 | } | 185 | dst_set_expires(&rt0->dst, timeout); |
195 | 186 | rt0->rt6i_flags |= RTF_EXPIRES; | |
196 | dst_set_expires(&rt->dst, timeout); | ||
197 | rt->rt6i_flags |= RTF_EXPIRES; | ||
198 | } | 187 | } |
199 | 188 | ||
200 | static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) | 189 | static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) |
201 | { | 190 | { |
202 | struct dst_entry *new = (struct dst_entry *) from; | 191 | struct dst_entry *new = (struct dst_entry *) from; |
203 | 192 | ||
204 | if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) { | ||
205 | if (new == rt->dst.from) | ||
206 | return; | ||
207 | dst_release(rt->dst.from); | ||
208 | } | ||
209 | |||
210 | rt->rt6i_flags &= ~RTF_EXPIRES; | 193 | rt->rt6i_flags &= ~RTF_EXPIRES; |
211 | rt->dst.from = new; | ||
212 | dst_hold(new); | 194 | dst_hold(new); |
195 | rt->dst.from = new; | ||
213 | } | 196 | } |
214 | 197 | ||
215 | static inline void ip6_rt_put(struct rt6_info *rt) | 198 | static inline void ip6_rt_put(struct rt6_info *rt) |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 27d83183e615..260f83f16bcf 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -23,6 +23,7 @@ struct route_info { | |||
23 | #include <net/sock.h> | 23 | #include <net/sock.h> |
24 | #include <linux/ip.h> | 24 | #include <linux/ip.h> |
25 | #include <linux/ipv6.h> | 25 | #include <linux/ipv6.h> |
26 | #include <linux/route.h> | ||
26 | 27 | ||
27 | #define RT6_LOOKUP_F_IFACE 0x00000001 | 28 | #define RT6_LOOKUP_F_IFACE 0x00000001 |
28 | #define RT6_LOOKUP_F_REACHABLE 0x00000002 | 29 | #define RT6_LOOKUP_F_REACHABLE 0x00000002 |
@@ -102,7 +103,6 @@ extern struct rt6_info *rt6_lookup(struct net *net, | |||
102 | int oif, int flags); | 103 | int oif, int flags); |
103 | 104 | ||
104 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | 105 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, |
105 | struct neighbour *neigh, | ||
106 | struct flowi6 *fl6); | 106 | struct flowi6 *fl6); |
107 | extern int icmp6_dst_gc(void); | 107 | extern int icmp6_dst_gc(void); |
108 | 108 | ||
@@ -194,4 +194,11 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
195 | } | 195 | } |
196 | 196 | ||
197 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) | ||
198 | { | ||
199 | if (rt->rt6i_flags & RTF_GATEWAY) | ||
200 | return &rt->rt6i_gateway; | ||
201 | return dest; | ||
202 | } | ||
203 | |||
197 | #endif | 204 | #endif |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 21947cf4fa46..fd19625ff99d 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -71,4 +71,21 @@ static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void tunnel_ip_select_ident(struct sk_buff *skb, | ||
75 | const struct iphdr *old_iph, | ||
76 | struct dst_entry *dst) | ||
77 | { | ||
78 | struct iphdr *iph = ip_hdr(skb); | ||
79 | |||
80 | if (iph->frag_off & htons(IP_DF)) | ||
81 | iph->id = 0; | ||
82 | else { | ||
83 | /* Use inner packet iph-id if possible. */ | ||
84 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) | ||
85 | iph->id = old_iph->id; | ||
86 | else | ||
87 | __ip_select_ident(iph, dst, | ||
88 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); | ||
89 | } | ||
90 | } | ||
74 | #endif | 91 | #endif |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 5af66b26ebdd..64d12e77719a 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/ipv6.h> | 16 | #include <linux/ipv6.h> |
17 | #include <linux/hardirq.h> | 17 | #include <linux/hardirq.h> |
18 | #include <linux/jhash.h> | ||
18 | #include <net/if_inet6.h> | 19 | #include <net/if_inet6.h> |
19 | #include <net/ndisc.h> | 20 | #include <net/ndisc.h> |
20 | #include <net/flow.h> | 21 | #include <net/flow.h> |
@@ -222,6 +223,7 @@ struct ip6_flowlabel { | |||
222 | struct in6_addr dst; | 223 | struct in6_addr dst; |
223 | struct ipv6_txoptions *opt; | 224 | struct ipv6_txoptions *opt; |
224 | unsigned long linger; | 225 | unsigned long linger; |
226 | struct rcu_head rcu; | ||
225 | u8 share; | 227 | u8 share; |
226 | union { | 228 | union { |
227 | struct pid *pid; | 229 | struct pid *pid; |
@@ -238,6 +240,7 @@ struct ip6_flowlabel { | |||
238 | struct ipv6_fl_socklist { | 240 | struct ipv6_fl_socklist { |
239 | struct ipv6_fl_socklist *next; | 241 | struct ipv6_fl_socklist *next; |
240 | struct ip6_flowlabel *fl; | 242 | struct ip6_flowlabel *fl; |
243 | struct rcu_head rcu; | ||
241 | }; | 244 | }; |
242 | 245 | ||
243 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); | 246 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); |
@@ -288,12 +291,12 @@ static inline int ip6_frag_nqueues(struct net *net) | |||
288 | 291 | ||
289 | static inline int ip6_frag_mem(struct net *net) | 292 | static inline int ip6_frag_mem(struct net *net) |
290 | { | 293 | { |
291 | return atomic_read(&net->ipv6.frags.mem); | 294 | return sum_frag_mem_limit(&net->ipv6.frags); |
292 | } | 295 | } |
293 | #endif | 296 | #endif |
294 | 297 | ||
295 | #define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */ | 298 | #define IPV6_FRAG_HIGH_THRESH (4 * 1024*1024) /* 4194304 */ |
296 | #define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */ | 299 | #define IPV6_FRAG_LOW_THRESH (3 * 1024*1024) /* 3145728 */ |
297 | #define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */ | 300 | #define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */ |
298 | 301 | ||
299 | extern int __ipv6_addr_type(const struct in6_addr *addr); | 302 | extern int __ipv6_addr_type(const struct in6_addr *addr); |
@@ -355,14 +358,32 @@ static inline void ipv6_addr_prefix(struct in6_addr *pfx, | |||
355 | pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b); | 358 | pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b); |
356 | } | 359 | } |
357 | 360 | ||
361 | static inline void __ipv6_addr_set_half(__be32 *addr, | ||
362 | __be32 wh, __be32 wl) | ||
363 | { | ||
364 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
365 | #if defined(__BIG_ENDIAN) | ||
366 | if (__builtin_constant_p(wh) && __builtin_constant_p(wl)) { | ||
367 | *(__force u64 *)addr = ((__force u64)(wh) << 32 | (__force u64)(wl)); | ||
368 | return; | ||
369 | } | ||
370 | #elif defined(__LITTLE_ENDIAN) | ||
371 | if (__builtin_constant_p(wl) && __builtin_constant_p(wh)) { | ||
372 | *(__force u64 *)addr = ((__force u64)(wl) << 32 | (__force u64)(wh)); | ||
373 | return; | ||
374 | } | ||
375 | #endif | ||
376 | #endif | ||
377 | addr[0] = wh; | ||
378 | addr[1] = wl; | ||
379 | } | ||
380 | |||
358 | static inline void ipv6_addr_set(struct in6_addr *addr, | 381 | static inline void ipv6_addr_set(struct in6_addr *addr, |
359 | __be32 w1, __be32 w2, | 382 | __be32 w1, __be32 w2, |
360 | __be32 w3, __be32 w4) | 383 | __be32 w3, __be32 w4) |
361 | { | 384 | { |
362 | addr->s6_addr32[0] = w1; | 385 | __ipv6_addr_set_half(&addr->s6_addr32[0], w1, w2); |
363 | addr->s6_addr32[1] = w2; | 386 | __ipv6_addr_set_half(&addr->s6_addr32[2], w3, w4); |
364 | addr->s6_addr32[2] = w3; | ||
365 | addr->s6_addr32[3] = w4; | ||
366 | } | 387 | } |
367 | 388 | ||
368 | static inline bool ipv6_addr_equal(const struct in6_addr *a1, | 389 | static inline bool ipv6_addr_equal(const struct in6_addr *a1, |
@@ -381,9 +402,37 @@ static inline bool ipv6_addr_equal(const struct in6_addr *a1, | |||
381 | #endif | 402 | #endif |
382 | } | 403 | } |
383 | 404 | ||
384 | static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 405 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
385 | unsigned int prefixlen) | 406 | static inline bool __ipv6_prefix_equal64_half(const __be64 *a1, |
407 | const __be64 *a2, | ||
408 | unsigned int len) | ||
409 | { | ||
410 | if (len && ((*a1 ^ *a2) & cpu_to_be64((~0UL) << (64 - len)))) | ||
411 | return false; | ||
412 | return true; | ||
413 | } | ||
414 | |||
415 | static inline bool ipv6_prefix_equal(const struct in6_addr *addr1, | ||
416 | const struct in6_addr *addr2, | ||
417 | unsigned int prefixlen) | ||
418 | { | ||
419 | const __be64 *a1 = (const __be64 *)addr1; | ||
420 | const __be64 *a2 = (const __be64 *)addr2; | ||
421 | |||
422 | if (prefixlen >= 64) { | ||
423 | if (a1[0] ^ a2[0]) | ||
424 | return false; | ||
425 | return __ipv6_prefix_equal64_half(a1 + 1, a2 + 1, prefixlen - 64); | ||
426 | } | ||
427 | return __ipv6_prefix_equal64_half(a1, a2, prefixlen); | ||
428 | } | ||
429 | #else | ||
430 | static inline bool ipv6_prefix_equal(const struct in6_addr *addr1, | ||
431 | const struct in6_addr *addr2, | ||
432 | unsigned int prefixlen) | ||
386 | { | 433 | { |
434 | const __be32 *a1 = addr1->s6_addr32; | ||
435 | const __be32 *a2 = addr2->s6_addr32; | ||
387 | unsigned int pdw, pbi; | 436 | unsigned int pdw, pbi; |
388 | 437 | ||
389 | /* check complete u32 in prefix */ | 438 | /* check complete u32 in prefix */ |
@@ -398,14 +447,7 @@ static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | |||
398 | 447 | ||
399 | return true; | 448 | return true; |
400 | } | 449 | } |
401 | 450 | #endif | |
402 | static inline bool ipv6_prefix_equal(const struct in6_addr *a1, | ||
403 | const struct in6_addr *a2, | ||
404 | unsigned int prefixlen) | ||
405 | { | ||
406 | return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32, | ||
407 | prefixlen); | ||
408 | } | ||
409 | 451 | ||
410 | struct inet_frag_queue; | 452 | struct inet_frag_queue; |
411 | 453 | ||
@@ -473,16 +515,38 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) | |||
473 | #endif | 515 | #endif |
474 | } | 516 | } |
475 | 517 | ||
518 | /* more secured version of ipv6_addr_hash() */ | ||
519 | static inline u32 ipv6_addr_jhash(const struct in6_addr *a) | ||
520 | { | ||
521 | u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1]; | ||
522 | |||
523 | return jhash_3words(v, | ||
524 | (__force u32)a->s6_addr32[2], | ||
525 | (__force u32)a->s6_addr32[3], | ||
526 | ipv6_hash_secret); | ||
527 | } | ||
528 | |||
476 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) | 529 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
477 | { | 530 | { |
531 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
532 | const unsigned long *ul = (const unsigned long *)a; | ||
533 | |||
534 | return (ul[0] | (ul[1] ^ cpu_to_be64(1))) == 0UL; | ||
535 | #else | ||
478 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 536 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
479 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; | 537 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; |
538 | #endif | ||
480 | } | 539 | } |
481 | 540 | ||
482 | static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) | 541 | static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) |
483 | { | 542 | { |
484 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 543 | return ( |
485 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; | 544 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
545 | *(__be64 *)a | | ||
546 | #else | ||
547 | (a->s6_addr32[0] | a->s6_addr32[1]) | | ||
548 | #endif | ||
549 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0UL; | ||
486 | } | 550 | } |
487 | 551 | ||
488 | /* | 552 | /* |
@@ -507,7 +571,7 @@ static inline void ipv6_addr_set_v4mapped(const __be32 addr, | |||
507 | * find the first different bit between two addresses | 571 | * find the first different bit between two addresses |
508 | * length of address must be a multiple of 32bits | 572 | * length of address must be a multiple of 32bits |
509 | */ | 573 | */ |
510 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) | 574 | static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) |
511 | { | 575 | { |
512 | const __be32 *a1 = token1, *a2 = token2; | 576 | const __be32 *a1 = token1, *a2 = token2; |
513 | int i; | 577 | int i; |
@@ -539,6 +603,33 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a | |||
539 | return addrlen << 5; | 603 | return addrlen << 5; |
540 | } | 604 | } |
541 | 605 | ||
606 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
607 | static inline int __ipv6_addr_diff64(const void *token1, const void *token2, int addrlen) | ||
608 | { | ||
609 | const __be64 *a1 = token1, *a2 = token2; | ||
610 | int i; | ||
611 | |||
612 | addrlen >>= 3; | ||
613 | |||
614 | for (i = 0; i < addrlen; i++) { | ||
615 | __be64 xb = a1[i] ^ a2[i]; | ||
616 | if (xb) | ||
617 | return i * 64 + 63 - __fls(be64_to_cpu(xb)); | ||
618 | } | ||
619 | |||
620 | return addrlen << 6; | ||
621 | } | ||
622 | #endif | ||
623 | |||
624 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) | ||
625 | { | ||
626 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
627 | if (__builtin_constant_p(addrlen) && !(addrlen & 7)) | ||
628 | return __ipv6_addr_diff64(token1, token2, addrlen); | ||
629 | #endif | ||
630 | return __ipv6_addr_diff32(token1, token2, addrlen); | ||
631 | } | ||
632 | |||
542 | static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) | 633 | static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) |
543 | { | 634 | { |
544 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); | 635 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); |
@@ -547,6 +638,20 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add | |||
547 | extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); | 638 | extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); |
548 | 639 | ||
549 | /* | 640 | /* |
641 | * Header manipulation | ||
642 | */ | ||
643 | static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, | ||
644 | __be32 flowlabel) | ||
645 | { | ||
646 | *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel; | ||
647 | } | ||
648 | |||
649 | static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) | ||
650 | { | ||
651 | return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; | ||
652 | } | ||
653 | |||
654 | /* | ||
550 | * Prototypes exported by ipv6 | 655 | * Prototypes exported by ipv6 |
551 | */ | 656 | */ |
552 | 657 | ||
@@ -570,13 +675,6 @@ extern int ip6_xmit(struct sock *sk, | |||
570 | struct ipv6_txoptions *opt, | 675 | struct ipv6_txoptions *opt, |
571 | int tclass); | 676 | int tclass); |
572 | 677 | ||
573 | extern int ip6_nd_hdr(struct sock *sk, | ||
574 | struct sk_buff *skb, | ||
575 | struct net_device *dev, | ||
576 | const struct in6_addr *saddr, | ||
577 | const struct in6_addr *daddr, | ||
578 | int proto, int len); | ||
579 | |||
580 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | 678 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); |
581 | 679 | ||
582 | extern int ip6_append_data(struct sock *sk, | 680 | extern int ip6_append_data(struct sock *sk, |
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index 591f78631f13..f74109144d3f 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h | |||
@@ -278,7 +278,7 @@ static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | /* After doing a irlmp_dup(), this get one of the two socket back into | 280 | /* After doing a irlmp_dup(), this get one of the two socket back into |
281 | * a state where it's waiting incomming connections. | 281 | * a state where it's waiting incoming connections. |
282 | * Note : this can be used *only* if the socket is not yet connected | 282 | * Note : this can be used *only* if the socket is not yet connected |
283 | * (i.e. NO irlmp_connect_response() done on this socket). | 283 | * (i.e. NO irlmp_connect_response() done on this socket). |
284 | * - Jean II */ | 284 | * - Jean II */ |
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h index af4b87721d13..98682d4bae8f 100644 --- a/include/net/irda/irttp.h +++ b/include/net/irda/irttp.h | |||
@@ -185,7 +185,7 @@ static inline __u32 irttp_get_max_seg_size(struct tsap_cb *self) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /* After doing a irttp_dup(), this get one of the two socket back into | 187 | /* After doing a irttp_dup(), this get one of the two socket back into |
188 | * a state where it's waiting incomming connections. | 188 | * a state where it's waiting incoming connections. |
189 | * Note : this can be used *only* if the socket is not yet connected | 189 | * Note : this can be used *only* if the socket is not yet connected |
190 | * (i.e. NO irttp_connect_response() done on this socket). | 190 | * (i.e. NO irttp_connect_response() done on this socket). |
191 | * - Jean II */ | 191 | * - Jean II */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index ee50c5eba50c..f7eba1300d82 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -147,10 +147,12 @@ struct ieee80211_low_level_stats { | |||
147 | * enum ieee80211_chanctx_change - change flag for channel context | 147 | * enum ieee80211_chanctx_change - change flag for channel context |
148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed | 148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed |
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | 149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed |
150 | * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed | ||
150 | */ | 151 | */ |
151 | enum ieee80211_chanctx_change { | 152 | enum ieee80211_chanctx_change { |
152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | 153 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), |
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | 154 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), |
155 | IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), | ||
154 | }; | 156 | }; |
155 | 157 | ||
156 | /** | 158 | /** |
@@ -165,6 +167,7 @@ enum ieee80211_chanctx_change { | |||
165 | * @rx_chains_dynamic: The number of RX chains that must be enabled | 167 | * @rx_chains_dynamic: The number of RX chains that must be enabled |
166 | * after RTS/CTS handshake to receive SMPS MIMO transmissions; | 168 | * after RTS/CTS handshake to receive SMPS MIMO transmissions; |
167 | * this will always be >= @rx_chains_static. | 169 | * this will always be >= @rx_chains_static. |
170 | * @radar_enabled: whether radar detection is enabled on this channel. | ||
168 | * @drv_priv: data area for driver use, will always be aligned to | 171 | * @drv_priv: data area for driver use, will always be aligned to |
169 | * sizeof(void *), size is determined in hw information. | 172 | * sizeof(void *), size is determined in hw information. |
170 | */ | 173 | */ |
@@ -173,7 +176,9 @@ struct ieee80211_chanctx_conf { | |||
173 | 176 | ||
174 | u8 rx_chains_static, rx_chains_dynamic; | 177 | u8 rx_chains_static, rx_chains_dynamic; |
175 | 178 | ||
176 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 179 | bool radar_enabled; |
180 | |||
181 | u8 drv_priv[0] __aligned(sizeof(void *)); | ||
177 | }; | 182 | }; |
178 | 183 | ||
179 | /** | 184 | /** |
@@ -208,6 +213,11 @@ struct ieee80211_chanctx_conf { | |||
208 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | 213 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface |
209 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) | 214 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) |
210 | * changed (currently only in P2P client mode, GO mode will be later) | 215 | * changed (currently only in P2P client mode, GO mode will be later) |
216 | * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when | ||
217 | * it becomes valid, managed mode only) | ||
218 | * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed, | ||
219 | * note that this is only called when it changes after the channel | ||
220 | * context had been assigned. | ||
211 | */ | 221 | */ |
212 | enum ieee80211_bss_change { | 222 | enum ieee80211_bss_change { |
213 | BSS_CHANGED_ASSOC = 1<<0, | 223 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -230,6 +240,8 @@ enum ieee80211_bss_change { | |||
230 | BSS_CHANGED_PS = 1<<17, | 240 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | 241 | BSS_CHANGED_TXPOWER = 1<<18, |
232 | BSS_CHANGED_P2P_PS = 1<<19, | 242 | BSS_CHANGED_P2P_PS = 1<<19, |
243 | BSS_CHANGED_DTIM_PERIOD = 1<<20, | ||
244 | BSS_CHANGED_BANDWIDTH = 1<<21, | ||
233 | 245 | ||
234 | /* when adding here, make sure to change ieee80211_reconfig */ | 246 | /* when adding here, make sure to change ieee80211_reconfig */ |
235 | }; | 247 | }; |
@@ -271,13 +283,19 @@ enum ieee80211_rssi_event { | |||
271 | * if the hardware cannot handle this it must set the | 283 | * if the hardware cannot handle this it must set the |
272 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag | 284 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag |
273 | * @dtim_period: num of beacons before the next DTIM, for beaconing, | 285 | * @dtim_period: num of beacons before the next DTIM, for beaconing, |
274 | * valid in station mode only while @assoc is true and if also | 286 | * valid in station mode only if after the driver was notified |
275 | * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf | 287 | * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then. |
276 | * @ps_dtim_period) | ||
277 | * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old | 288 | * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old |
278 | * as it may have been received during scanning long ago) | 289 | * as it may have been received during scanning long ago). If the |
290 | * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can | ||
291 | * only come from a beacon, but might not become valid until after | ||
292 | * association when a beacon is received (which is notified with the | ||
293 | * %BSS_CHANGED_DTIM flag.) | ||
279 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, | 294 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, |
280 | * the driver/device can use this to calculate synchronisation | 295 | * the driver/device can use this to calculate synchronisation |
296 | * (see @sync_tsf) | ||
297 | * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY | ||
298 | * is requested, see @sync_tsf/@sync_device_ts. | ||
281 | * @beacon_int: beacon interval | 299 | * @beacon_int: beacon interval |
282 | * @assoc_capability: capabilities taken from assoc resp | 300 | * @assoc_capability: capabilities taken from assoc resp |
283 | * @basic_rates: bitmap of basic rates, each bit stands for an | 301 | * @basic_rates: bitmap of basic rates, each bit stands for an |
@@ -297,11 +315,9 @@ enum ieee80211_rssi_event { | |||
297 | * may filter ARP queries targeted for other addresses than listed here. | 315 | * may filter ARP queries targeted for other addresses than listed here. |
298 | * The driver must allow ARP queries targeted for all address listed here | 316 | * The driver must allow ARP queries targeted for all address listed here |
299 | * to pass through. An empty list implies no ARP queries need to pass. | 317 | * to pass through. An empty list implies no ARP queries need to pass. |
300 | * @arp_addr_cnt: Number of addresses currently on the list. | 318 | * @arp_addr_cnt: Number of addresses currently on the list. Note that this |
301 | * @arp_filter_enabled: Enable ARP filtering - if enabled, the hardware may | 319 | * may be larger than %IEEE80211_BSS_ARP_ADDR_LIST_LEN (the arp_addr_list |
302 | * filter ARP queries based on the @arp_addr_list, if disabled, the | 320 | * array size), it's up to the driver what to do in that case. |
303 | * hardware must not perform any ARP filtering. Note, that the filter will | ||
304 | * be enabled also in promiscuous mode. | ||
305 | * @qos: This is a QoS-enabled BSS. | 321 | * @qos: This is a QoS-enabled BSS. |
306 | * @idle: This interface is idle. There's also a global idle flag in the | 322 | * @idle: This interface is idle. There's also a global idle flag in the |
307 | * hardware config which may be more appropriate depending on what | 323 | * hardware config which may be more appropriate depending on what |
@@ -331,6 +347,7 @@ struct ieee80211_bss_conf { | |||
331 | u16 assoc_capability; | 347 | u16 assoc_capability; |
332 | u64 sync_tsf; | 348 | u64 sync_tsf; |
333 | u32 sync_device_ts; | 349 | u32 sync_device_ts; |
350 | u8 sync_dtim_count; | ||
334 | u32 basic_rates; | 351 | u32 basic_rates; |
335 | int mcast_rate[IEEE80211_NUM_BANDS]; | 352 | int mcast_rate[IEEE80211_NUM_BANDS]; |
336 | u16 ht_operation_mode; | 353 | u16 ht_operation_mode; |
@@ -338,8 +355,7 @@ struct ieee80211_bss_conf { | |||
338 | u32 cqm_rssi_hyst; | 355 | u32 cqm_rssi_hyst; |
339 | struct cfg80211_chan_def chandef; | 356 | struct cfg80211_chan_def chandef; |
340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 357 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
341 | u8 arp_addr_cnt; | 358 | int arp_addr_cnt; |
342 | bool arp_filter_enabled; | ||
343 | bool qos; | 359 | bool qos; |
344 | bool idle; | 360 | bool idle; |
345 | bool ps; | 361 | bool ps; |
@@ -392,6 +408,9 @@ struct ieee80211_bss_conf { | |||
392 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be | 408 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be |
393 | * set by rate control algorithms to indicate probe rate, will | 409 | * set by rate control algorithms to indicate probe rate, will |
394 | * be cleared for fragmented frames (except on the last fragment) | 410 | * be cleared for fragmented frames (except on the last fragment) |
411 | * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate | ||
412 | * that a frame can be transmitted while the queues are stopped for | ||
413 | * off-channel operation. | ||
395 | * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, | 414 | * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, |
396 | * used to indicate that a pending frame requires TX processing before | 415 | * used to indicate that a pending frame requires TX processing before |
397 | * it can be sent out. | 416 | * it can be sent out. |
@@ -409,6 +428,9 @@ struct ieee80211_bss_conf { | |||
409 | * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted | 428 | * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted |
410 | * after TX status because the destination was asleep, it must not | 429 | * after TX status because the destination was asleep, it must not |
411 | * be modified again (no seqno assignment, crypto, etc.) | 430 | * be modified again (no seqno assignment, crypto, etc.) |
431 | * @IEEE80211_TX_INTFL_MLME_CONN_TX: This frame was transmitted by the MLME | ||
432 | * code for connection establishment, this indicates that its status | ||
433 | * should kick the MLME state machine. | ||
412 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | 434 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 |
413 | * MLME command (internal to mac80211 to figure out whether to send TX | 435 | * MLME command (internal to mac80211 to figure out whether to send TX |
414 | * status to user space) | 436 | * status to user space) |
@@ -454,13 +476,14 @@ enum mac80211_tx_control_flags { | |||
454 | IEEE80211_TX_STAT_AMPDU = BIT(10), | 476 | IEEE80211_TX_STAT_AMPDU = BIT(10), |
455 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), | 477 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), |
456 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), | 478 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), |
479 | IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13), | ||
457 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), | 480 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), |
458 | IEEE80211_TX_INTFL_RETRIED = BIT(15), | 481 | IEEE80211_TX_INTFL_RETRIED = BIT(15), |
459 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), | 482 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), |
460 | IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), | 483 | IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), |
461 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), | 484 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), |
462 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | 485 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), |
463 | /* hole at 20, use later */ | 486 | IEEE80211_TX_INTFL_MLME_CONN_TX = BIT(20), |
464 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 487 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
465 | IEEE80211_TX_CTL_LDPC = BIT(22), | 488 | IEEE80211_TX_CTL_LDPC = BIT(22), |
466 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 489 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
@@ -953,6 +976,7 @@ enum ieee80211_smps_mode { | |||
953 | * | 976 | * |
954 | * @channel: the channel to tune to | 977 | * @channel: the channel to tune to |
955 | * @channel_type: the channel (HT) type | 978 | * @channel_type: the channel (HT) type |
979 | * @radar_enabled: whether radar detection is enabled | ||
956 | * | 980 | * |
957 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame | 981 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame |
958 | * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, | 982 | * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, |
@@ -979,6 +1003,7 @@ struct ieee80211_conf { | |||
979 | 1003 | ||
980 | struct ieee80211_channel *channel; | 1004 | struct ieee80211_channel *channel; |
981 | enum nl80211_channel_type channel_type; | 1005 | enum nl80211_channel_type channel_type; |
1006 | bool radar_enabled; | ||
982 | enum ieee80211_smps_mode smps_mode; | 1007 | enum ieee80211_smps_mode smps_mode; |
983 | }; | 1008 | }; |
984 | 1009 | ||
@@ -1059,7 +1084,7 @@ struct ieee80211_vif { | |||
1059 | u32 driver_flags; | 1084 | u32 driver_flags; |
1060 | 1085 | ||
1061 | /* must be last */ | 1086 | /* must be last */ |
1062 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 1087 | u8 drv_priv[0] __aligned(sizeof(void *)); |
1063 | }; | 1088 | }; |
1064 | 1089 | ||
1065 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | 1090 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) |
@@ -1176,6 +1201,24 @@ enum ieee80211_sta_state { | |||
1176 | }; | 1201 | }; |
1177 | 1202 | ||
1178 | /** | 1203 | /** |
1204 | * enum ieee80211_sta_rx_bandwidth - station RX bandwidth | ||
1205 | * @IEEE80211_STA_RX_BW_20: station can only receive 20 MHz | ||
1206 | * @IEEE80211_STA_RX_BW_40: station can receive up to 40 MHz | ||
1207 | * @IEEE80211_STA_RX_BW_80: station can receive up to 80 MHz | ||
1208 | * @IEEE80211_STA_RX_BW_160: station can receive up to 160 MHz | ||
1209 | * (including 80+80 MHz) | ||
1210 | * | ||
1211 | * Implementation note: 20 must be zero to be initialized | ||
1212 | * correctly, the values must be sorted. | ||
1213 | */ | ||
1214 | enum ieee80211_sta_rx_bandwidth { | ||
1215 | IEEE80211_STA_RX_BW_20 = 0, | ||
1216 | IEEE80211_STA_RX_BW_40, | ||
1217 | IEEE80211_STA_RX_BW_80, | ||
1218 | IEEE80211_STA_RX_BW_160, | ||
1219 | }; | ||
1220 | |||
1221 | /** | ||
1179 | * struct ieee80211_sta - station table entry | 1222 | * struct ieee80211_sta - station table entry |
1180 | * | 1223 | * |
1181 | * A station table entry represents a station we are possibly | 1224 | * A station table entry represents a station we are possibly |
@@ -1197,6 +1240,12 @@ enum ieee80211_sta_state { | |||
1197 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid | 1240 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid |
1198 | * if wme is supported. | 1241 | * if wme is supported. |
1199 | * @max_sp: max Service Period. Only valid if wme is supported. | 1242 | * @max_sp: max Service Period. Only valid if wme is supported. |
1243 | * @bandwidth: current bandwidth the station can receive with | ||
1244 | * @rx_nss: in HT/VHT, the maximum number of spatial streams the | ||
1245 | * station can receive at the moment, changed by operating mode | ||
1246 | * notifications and capabilities. The value is only valid after | ||
1247 | * the station moves to associated state. | ||
1248 | * @smps_mode: current SMPS mode (off, static or dynamic) | ||
1200 | */ | 1249 | */ |
1201 | struct ieee80211_sta { | 1250 | struct ieee80211_sta { |
1202 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 1251 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
@@ -1207,9 +1256,12 @@ struct ieee80211_sta { | |||
1207 | bool wme; | 1256 | bool wme; |
1208 | u8 uapsd_queues; | 1257 | u8 uapsd_queues; |
1209 | u8 max_sp; | 1258 | u8 max_sp; |
1259 | u8 rx_nss; | ||
1260 | enum ieee80211_sta_rx_bandwidth bandwidth; | ||
1261 | enum ieee80211_smps_mode smps_mode; | ||
1210 | 1262 | ||
1211 | /* must be last */ | 1263 | /* must be last */ |
1212 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 1264 | u8 drv_priv[0] __aligned(sizeof(void *)); |
1213 | }; | 1265 | }; |
1214 | 1266 | ||
1215 | /** | 1267 | /** |
@@ -1331,9 +1383,9 @@ struct ieee80211_tx_control { | |||
1331 | * When this flag is set, signaling beacon-loss will cause an immediate | 1383 | * When this flag is set, signaling beacon-loss will cause an immediate |
1332 | * change to disassociated state. | 1384 | * change to disassociated state. |
1333 | * | 1385 | * |
1334 | * @IEEE80211_HW_NEED_DTIM_PERIOD: | 1386 | * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC: |
1335 | * This device needs to know the DTIM period for the BSS before | 1387 | * This device needs to get data from beacon before association (i.e. |
1336 | * associating. | 1388 | * dtim_period). |
1337 | * | 1389 | * |
1338 | * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports | 1390 | * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports |
1339 | * per-station GTKs as used by IBSS RSN or during fast transition. If | 1391 | * per-station GTKs as used by IBSS RSN or during fast transition. If |
@@ -1353,10 +1405,6 @@ struct ieee80211_tx_control { | |||
1353 | * setup strictly in HW. mac80211 should not attempt to do this in | 1405 | * setup strictly in HW. mac80211 should not attempt to do this in |
1354 | * software. | 1406 | * software. |
1355 | * | 1407 | * |
1356 | * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while | ||
1357 | * being idle (i.e. mac80211 doesn't have to go idle-off during the | ||
1358 | * the scan). | ||
1359 | * | ||
1360 | * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of | 1408 | * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of |
1361 | * a virtual monitor interface when monitor interfaces are the only | 1409 | * a virtual monitor interface when monitor interfaces are the only |
1362 | * active interfaces. | 1410 | * active interfaces. |
@@ -1370,9 +1418,8 @@ struct ieee80211_tx_control { | |||
1370 | * P2P Interface. This will be honoured even if more than one interface | 1418 | * P2P Interface. This will be honoured even if more than one interface |
1371 | * is supported. | 1419 | * is supported. |
1372 | * | 1420 | * |
1373 | * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session | 1421 | * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames |
1374 | * should be tear down once BAR frame will not be acked. | 1422 | * only, to allow getting TBTT of a DTIM beacon. |
1375 | * | ||
1376 | */ | 1423 | */ |
1377 | enum ieee80211_hw_flags { | 1424 | enum ieee80211_hw_flags { |
1378 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1425 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1382,7 +1429,7 @@ enum ieee80211_hw_flags { | |||
1382 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 1429 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
1383 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 1430 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
1384 | IEEE80211_HW_SIGNAL_DBM = 1<<6, | 1431 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
1385 | IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, | 1432 | IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7, |
1386 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, | 1433 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
1387 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, | 1434 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
1388 | IEEE80211_HW_SUPPORTS_PS = 1<<10, | 1435 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
@@ -1399,9 +1446,8 @@ enum ieee80211_hw_flags { | |||
1399 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1446 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
1400 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1447 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
1401 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | 1448 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, |
1402 | IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, | ||
1403 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, | 1449 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, |
1404 | IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26, | 1450 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, |
1405 | }; | 1451 | }; |
1406 | 1452 | ||
1407 | /** | 1453 | /** |
@@ -1522,6 +1568,8 @@ struct ieee80211_hw { | |||
1522 | * structure can then access it via hw->priv. Note that mac802111 drivers should | 1568 | * structure can then access it via hw->priv. Note that mac802111 drivers should |
1523 | * not use wiphy_priv() to try to get their private driver structure as this | 1569 | * not use wiphy_priv() to try to get their private driver structure as this |
1524 | * is already used internally by mac80211. | 1570 | * is already used internally by mac80211. |
1571 | * | ||
1572 | * Return: The mac80211 driver hw struct of @wiphy. | ||
1525 | */ | 1573 | */ |
1526 | struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); | 1574 | struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); |
1527 | 1575 | ||
@@ -1628,6 +1676,10 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1628 | * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is | 1676 | * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is |
1629 | * provided by update_tkip_key only. The trigger that makes mac80211 call this | 1677 | * provided by update_tkip_key only. The trigger that makes mac80211 call this |
1630 | * handler is software decryption with wrap around of iv16. | 1678 | * handler is software decryption with wrap around of iv16. |
1679 | * | ||
1680 | * The set_default_unicast_key() call updates the default WEP key index | ||
1681 | * configured to the hardware for WEP encryption type. This is required | ||
1682 | * for devices that support offload of data packets (e.g. ARP responses). | ||
1631 | */ | 1683 | */ |
1632 | 1684 | ||
1633 | /** | 1685 | /** |
@@ -1680,15 +1732,6 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1680 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS | 1732 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS |
1681 | * enabled whenever user has enabled powersave. | 1733 | * enabled whenever user has enabled powersave. |
1682 | * | 1734 | * |
1683 | * Some hardware need to toggle a single shared antenna between WLAN and | ||
1684 | * Bluetooth to facilitate co-existence. These types of hardware set | ||
1685 | * limitations on the use of host controlled dynamic powersave whenever there | ||
1686 | * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the | ||
1687 | * driver may request temporarily going into full power save, in order to | ||
1688 | * enable toggling the antenna between BT and WLAN. If the driver requests | ||
1689 | * disabling dynamic powersave, the @dynamic_ps_timeout value will be | ||
1690 | * temporarily set to zero until the driver re-enables dynamic powersave. | ||
1691 | * | ||
1692 | * Driver informs U-APSD client support by enabling | 1735 | * Driver informs U-APSD client support by enabling |
1693 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the | 1736 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the |
1694 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS | 1737 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS |
@@ -2033,17 +2076,29 @@ enum ieee80211_filter_flags { | |||
2033 | * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer | 2076 | * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer |
2034 | * might receive the addBA frame and send a delBA right away! | 2077 | * might receive the addBA frame and send a delBA right away! |
2035 | * | 2078 | * |
2036 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 2079 | * @IEEE80211_AMPDU_RX_START: start RX aggregation |
2037 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation | 2080 | * @IEEE80211_AMPDU_RX_STOP: stop RX aggregation |
2038 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation | 2081 | * @IEEE80211_AMPDU_TX_START: start TX aggregation |
2039 | * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation | ||
2040 | * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational | 2082 | * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational |
2083 | * @IEEE80211_AMPDU_TX_STOP_CONT: stop TX aggregation but continue transmitting | ||
2084 | * queued packets, now unaggregated. After all packets are transmitted the | ||
2085 | * driver has to call ieee80211_stop_tx_ba_cb_irqsafe(). | ||
2086 | * @IEEE80211_AMPDU_TX_STOP_FLUSH: stop TX aggregation and flush all packets, | ||
2087 | * called when the station is removed. There's no need or reason to call | ||
2088 | * ieee80211_stop_tx_ba_cb_irqsafe() in this case as mac80211 assumes the | ||
2089 | * session is gone and removes the station. | ||
2090 | * @IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: called when TX aggregation is stopped | ||
2091 | * but the driver hasn't called ieee80211_stop_tx_ba_cb_irqsafe() yet and | ||
2092 | * now the connection is dropped and the station will be removed. Drivers | ||
2093 | * should clean up and drop remaining packets when this is called. | ||
2041 | */ | 2094 | */ |
2042 | enum ieee80211_ampdu_mlme_action { | 2095 | enum ieee80211_ampdu_mlme_action { |
2043 | IEEE80211_AMPDU_RX_START, | 2096 | IEEE80211_AMPDU_RX_START, |
2044 | IEEE80211_AMPDU_RX_STOP, | 2097 | IEEE80211_AMPDU_RX_STOP, |
2045 | IEEE80211_AMPDU_TX_START, | 2098 | IEEE80211_AMPDU_TX_START, |
2046 | IEEE80211_AMPDU_TX_STOP, | 2099 | IEEE80211_AMPDU_TX_STOP_CONT, |
2100 | IEEE80211_AMPDU_TX_STOP_FLUSH, | ||
2101 | IEEE80211_AMPDU_TX_STOP_FLUSH_CONT, | ||
2047 | IEEE80211_AMPDU_TX_OPERATIONAL, | 2102 | IEEE80211_AMPDU_TX_OPERATIONAL, |
2048 | }; | 2103 | }; |
2049 | 2104 | ||
@@ -2062,16 +2117,21 @@ enum ieee80211_frame_release_type { | |||
2062 | * enum ieee80211_rate_control_changed - flags to indicate what changed | 2117 | * enum ieee80211_rate_control_changed - flags to indicate what changed |
2063 | * | 2118 | * |
2064 | * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit | 2119 | * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit |
2065 | * to this station changed. | 2120 | * to this station changed. The actual bandwidth is in the station |
2121 | * information -- for HT20/40 the IEEE80211_HT_CAP_SUP_WIDTH_20_40 | ||
2122 | * flag changes, for HT and VHT the bandwidth field changes. | ||
2066 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. | 2123 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. |
2067 | * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer | 2124 | * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer |
2068 | * changed (in IBSS mode) due to discovering more information about | 2125 | * changed (in IBSS mode) due to discovering more information about |
2069 | * the peer. | 2126 | * the peer. |
2127 | * @IEEE80211_RC_NSS_CHANGED: N_SS (number of spatial streams) was changed | ||
2128 | * by the peer | ||
2070 | */ | 2129 | */ |
2071 | enum ieee80211_rate_control_changed { | 2130 | enum ieee80211_rate_control_changed { |
2072 | IEEE80211_RC_BW_CHANGED = BIT(0), | 2131 | IEEE80211_RC_BW_CHANGED = BIT(0), |
2073 | IEEE80211_RC_SMPS_CHANGED = BIT(1), | 2132 | IEEE80211_RC_SMPS_CHANGED = BIT(1), |
2074 | IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), | 2133 | IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), |
2134 | IEEE80211_RC_NSS_CHANGED = BIT(3), | ||
2075 | }; | 2135 | }; |
2076 | 2136 | ||
2077 | /** | 2137 | /** |
@@ -2152,6 +2212,18 @@ enum ieee80211_rate_control_changed { | |||
2152 | * MAC address of the device going away. | 2212 | * MAC address of the device going away. |
2153 | * Hence, this callback must be implemented. It can sleep. | 2213 | * Hence, this callback must be implemented. It can sleep. |
2154 | * | 2214 | * |
2215 | * @add_interface_debugfs: Drivers can use this callback to add debugfs files | ||
2216 | * when a vif is added to mac80211. This callback and | ||
2217 | * @remove_interface_debugfs should be within a CONFIG_MAC80211_DEBUGFS | ||
2218 | * conditional. @remove_interface_debugfs must be provided for cleanup. | ||
2219 | * This callback can sleep. | ||
2220 | * | ||
2221 | * @remove_interface_debugfs: Remove the debugfs files which were added using | ||
2222 | * @add_interface_debugfs. This callback must remove all debugfs entries | ||
2223 | * that were added because mac80211 only removes interface debugfs when the | ||
2224 | * interface is destroyed, not when it is removed from the driver. | ||
2225 | * This callback can sleep. | ||
2226 | * | ||
2155 | * @config: Handler for configuration requests. IEEE 802.11 code calls this | 2227 | * @config: Handler for configuration requests. IEEE 802.11 code calls this |
2156 | * function to change hardware configuration, e.g., channel. | 2228 | * function to change hardware configuration, e.g., channel. |
2157 | * This function should never fail but returns a negative error code | 2229 | * This function should never fail but returns a negative error code |
@@ -2194,6 +2266,10 @@ enum ieee80211_rate_control_changed { | |||
2194 | * After rekeying was done it should (for example during resume) notify | 2266 | * After rekeying was done it should (for example during resume) notify |
2195 | * userspace of the new replay counter using ieee80211_gtk_rekey_notify(). | 2267 | * userspace of the new replay counter using ieee80211_gtk_rekey_notify(). |
2196 | * | 2268 | * |
2269 | * @set_default_unicast_key: Set the default (unicast) key index, useful for | ||
2270 | * WEP when the device sends data packets autonomously, e.g. for ARP | ||
2271 | * offloading. The index can be 0-3, or -1 for unsetting it. | ||
2272 | * | ||
2197 | * @hw_scan: Ask the hardware to service the scan request, no need to start | 2273 | * @hw_scan: Ask the hardware to service the scan request, no need to start |
2198 | * the scan state machine in stack. The scan must honour the channel | 2274 | * the scan state machine in stack. The scan must honour the channel |
2199 | * configuration done by the regulatory agent in the wiphy's | 2275 | * configuration done by the regulatory agent in the wiphy's |
@@ -2474,7 +2550,13 @@ enum ieee80211_rate_control_changed { | |||
2474 | * | 2550 | * |
2475 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the | 2551 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the |
2476 | * reconfiguration has completed. This can help the driver implement the | 2552 | * reconfiguration has completed. This can help the driver implement the |
2477 | * reconfiguration step. This callback may sleep. | 2553 | * reconfiguration step. Also called when reconfiguring because the |
2554 | * driver's resume function returned 1, as this is just like an "inline" | ||
2555 | * hardware restart. This callback may sleep. | ||
2556 | * | ||
2557 | * @ipv6_addr_change: IPv6 address assignment on the given interface changed. | ||
2558 | * Currently, this is only called for managed or P2P client interfaces. | ||
2559 | * This callback is optional; it must not sleep. | ||
2478 | */ | 2560 | */ |
2479 | struct ieee80211_ops { | 2561 | struct ieee80211_ops { |
2480 | void (*tx)(struct ieee80211_hw *hw, | 2562 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2522,6 +2604,8 @@ struct ieee80211_ops { | |||
2522 | void (*set_rekey_data)(struct ieee80211_hw *hw, | 2604 | void (*set_rekey_data)(struct ieee80211_hw *hw, |
2523 | struct ieee80211_vif *vif, | 2605 | struct ieee80211_vif *vif, |
2524 | struct cfg80211_gtk_rekey_data *data); | 2606 | struct cfg80211_gtk_rekey_data *data); |
2607 | void (*set_default_unicast_key)(struct ieee80211_hw *hw, | ||
2608 | struct ieee80211_vif *vif, int idx); | ||
2525 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2609 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2526 | struct cfg80211_scan_request *req); | 2610 | struct cfg80211_scan_request *req); |
2527 | void (*cancel_hw_scan)(struct ieee80211_hw *hw, | 2611 | void (*cancel_hw_scan)(struct ieee80211_hw *hw, |
@@ -2553,6 +2637,12 @@ struct ieee80211_ops { | |||
2553 | struct ieee80211_vif *vif, | 2637 | struct ieee80211_vif *vif, |
2554 | struct ieee80211_sta *sta, | 2638 | struct ieee80211_sta *sta, |
2555 | struct dentry *dir); | 2639 | struct dentry *dir); |
2640 | void (*add_interface_debugfs)(struct ieee80211_hw *hw, | ||
2641 | struct ieee80211_vif *vif, | ||
2642 | struct dentry *dir); | ||
2643 | void (*remove_interface_debugfs)(struct ieee80211_hw *hw, | ||
2644 | struct ieee80211_vif *vif, | ||
2645 | struct dentry *dir); | ||
2556 | #endif | 2646 | #endif |
2557 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2647 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2558 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2648 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
@@ -2606,6 +2696,7 @@ struct ieee80211_ops { | |||
2606 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2696 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2607 | const struct cfg80211_bitrate_mask *mask); | 2697 | const struct cfg80211_bitrate_mask *mask); |
2608 | void (*rssi_callback)(struct ieee80211_hw *hw, | 2698 | void (*rssi_callback)(struct ieee80211_hw *hw, |
2699 | struct ieee80211_vif *vif, | ||
2609 | enum ieee80211_rssi_event rssi_event); | 2700 | enum ieee80211_rssi_event rssi_event); |
2610 | 2701 | ||
2611 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, | 2702 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, |
@@ -2648,6 +2739,12 @@ struct ieee80211_ops { | |||
2648 | struct ieee80211_chanctx_conf *ctx); | 2739 | struct ieee80211_chanctx_conf *ctx); |
2649 | 2740 | ||
2650 | void (*restart_complete)(struct ieee80211_hw *hw); | 2741 | void (*restart_complete)(struct ieee80211_hw *hw); |
2742 | |||
2743 | #if IS_ENABLED(CONFIG_IPV6) | ||
2744 | void (*ipv6_addr_change)(struct ieee80211_hw *hw, | ||
2745 | struct ieee80211_vif *vif, | ||
2746 | struct inet6_dev *idev); | ||
2747 | #endif | ||
2651 | }; | 2748 | }; |
2652 | 2749 | ||
2653 | /** | 2750 | /** |
@@ -2661,6 +2758,8 @@ struct ieee80211_ops { | |||
2661 | * | 2758 | * |
2662 | * @priv_data_len: length of private data | 2759 | * @priv_data_len: length of private data |
2663 | * @ops: callbacks for this device | 2760 | * @ops: callbacks for this device |
2761 | * | ||
2762 | * Return: A pointer to the new hardware device, or %NULL on error. | ||
2664 | */ | 2763 | */ |
2665 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | 2764 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, |
2666 | const struct ieee80211_ops *ops); | 2765 | const struct ieee80211_ops *ops); |
@@ -2673,6 +2772,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
2673 | * need to fill the contained wiphy's information. | 2772 | * need to fill the contained wiphy's information. |
2674 | * | 2773 | * |
2675 | * @hw: the device to register as returned by ieee80211_alloc_hw() | 2774 | * @hw: the device to register as returned by ieee80211_alloc_hw() |
2775 | * | ||
2776 | * Return: 0 on success. An error code otherwise. | ||
2676 | */ | 2777 | */ |
2677 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 2778 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
2678 | 2779 | ||
@@ -2719,6 +2820,8 @@ extern char *__ieee80211_create_tpt_led_trigger( | |||
2719 | * of the trigger so you can automatically link the LED device. | 2820 | * of the trigger so you can automatically link the LED device. |
2720 | * | 2821 | * |
2721 | * @hw: the hardware to get the LED trigger name for | 2822 | * @hw: the hardware to get the LED trigger name for |
2823 | * | ||
2824 | * Return: The name of the LED trigger. %NULL if not configured for LEDs. | ||
2722 | */ | 2825 | */ |
2723 | static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw) | 2826 | static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw) |
2724 | { | 2827 | { |
@@ -2738,6 +2841,8 @@ static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw) | |||
2738 | * of the trigger so you can automatically link the LED device. | 2841 | * of the trigger so you can automatically link the LED device. |
2739 | * | 2842 | * |
2740 | * @hw: the hardware to get the LED trigger name for | 2843 | * @hw: the hardware to get the LED trigger name for |
2844 | * | ||
2845 | * Return: The name of the LED trigger. %NULL if not configured for LEDs. | ||
2741 | */ | 2846 | */ |
2742 | static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw) | 2847 | static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw) |
2743 | { | 2848 | { |
@@ -2757,6 +2862,8 @@ static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw) | |||
2757 | * of the trigger so you can automatically link the LED device. | 2862 | * of the trigger so you can automatically link the LED device. |
2758 | * | 2863 | * |
2759 | * @hw: the hardware to get the LED trigger name for | 2864 | * @hw: the hardware to get the LED trigger name for |
2865 | * | ||
2866 | * Return: The name of the LED trigger. %NULL if not configured for LEDs. | ||
2760 | */ | 2867 | */ |
2761 | static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) | 2868 | static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) |
2762 | { | 2869 | { |
@@ -2776,6 +2883,8 @@ static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) | |||
2776 | * of the trigger so you can automatically link the LED device. | 2883 | * of the trigger so you can automatically link the LED device. |
2777 | * | 2884 | * |
2778 | * @hw: the hardware to get the LED trigger name for | 2885 | * @hw: the hardware to get the LED trigger name for |
2886 | * | ||
2887 | * Return: The name of the LED trigger. %NULL if not configured for LEDs. | ||
2779 | */ | 2888 | */ |
2780 | static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | 2889 | static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) |
2781 | { | 2890 | { |
@@ -2793,9 +2902,10 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
2793 | * @blink_table: the blink table -- needs to be ordered by throughput | 2902 | * @blink_table: the blink table -- needs to be ordered by throughput |
2794 | * @blink_table_len: size of the blink table | 2903 | * @blink_table_len: size of the blink table |
2795 | * | 2904 | * |
2796 | * This function returns %NULL (in case of error, or if no LED | 2905 | * Return: %NULL (in case of error, or if no LED triggers are |
2797 | * triggers are configured) or the name of the new trigger. | 2906 | * configured) or the name of the new trigger. |
2798 | * This function must be called before ieee80211_register_hw(). | 2907 | * |
2908 | * Note: This function must be called before ieee80211_register_hw(). | ||
2799 | */ | 2909 | */ |
2800 | static inline char * | 2910 | static inline char * |
2801 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, | 2911 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, |
@@ -2928,10 +3038,10 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
2928 | * Calls to this function for a single hardware must be synchronized against | 3038 | * Calls to this function for a single hardware must be synchronized against |
2929 | * each other. | 3039 | * each other. |
2930 | * | 3040 | * |
2931 | * The function returns -EINVAL when the requested PS mode is already set. | ||
2932 | * | ||
2933 | * @sta: currently connected sta | 3041 | * @sta: currently connected sta |
2934 | * @start: start or stop PS | 3042 | * @start: start or stop PS |
3043 | * | ||
3044 | * Return: 0 on success. -EINVAL when the requested PS mode is already set. | ||
2935 | */ | 3045 | */ |
2936 | int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); | 3046 | int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); |
2937 | 3047 | ||
@@ -2945,6 +3055,8 @@ int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); | |||
2945 | * | 3055 | * |
2946 | * @sta: currently connected sta | 3056 | * @sta: currently connected sta |
2947 | * @start: start or stop PS | 3057 | * @start: start or stop PS |
3058 | * | ||
3059 | * Return: Like ieee80211_sta_ps_transition(). | ||
2948 | */ | 3060 | */ |
2949 | static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, | 3061 | static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, |
2950 | bool start) | 3062 | bool start) |
@@ -3082,6 +3194,8 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); | |||
3082 | * according to the current DTIM parameters/TIM bitmap. | 3194 | * according to the current DTIM parameters/TIM bitmap. |
3083 | * | 3195 | * |
3084 | * The driver is responsible for freeing the returned skb. | 3196 | * The driver is responsible for freeing the returned skb. |
3197 | * | ||
3198 | * Return: The beacon template. %NULL on error. | ||
3085 | */ | 3199 | */ |
3086 | struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | 3200 | struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, |
3087 | struct ieee80211_vif *vif, | 3201 | struct ieee80211_vif *vif, |
@@ -3093,6 +3207,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
3093 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3207 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
3094 | * | 3208 | * |
3095 | * See ieee80211_beacon_get_tim(). | 3209 | * See ieee80211_beacon_get_tim(). |
3210 | * | ||
3211 | * Return: See ieee80211_beacon_get_tim(). | ||
3096 | */ | 3212 | */ |
3097 | static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 3213 | static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, |
3098 | struct ieee80211_vif *vif) | 3214 | struct ieee80211_vif *vif) |
@@ -3109,6 +3225,8 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
3109 | * hardware. The destination address should be set by the caller. | 3225 | * hardware. The destination address should be set by the caller. |
3110 | * | 3226 | * |
3111 | * Can only be called in AP mode. | 3227 | * Can only be called in AP mode. |
3228 | * | ||
3229 | * Return: The Probe Response template. %NULL on error. | ||
3112 | */ | 3230 | */ |
3113 | struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw, | 3231 | struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw, |
3114 | struct ieee80211_vif *vif); | 3232 | struct ieee80211_vif *vif); |
@@ -3124,6 +3242,8 @@ struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw, | |||
3124 | * | 3242 | * |
3125 | * Note: Caller (or hardware) is responsible for setting the | 3243 | * Note: Caller (or hardware) is responsible for setting the |
3126 | * &IEEE80211_FCTL_PM bit. | 3244 | * &IEEE80211_FCTL_PM bit. |
3245 | * | ||
3246 | * Return: The PS Poll template. %NULL on error. | ||
3127 | */ | 3247 | */ |
3128 | struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, | 3248 | struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, |
3129 | struct ieee80211_vif *vif); | 3249 | struct ieee80211_vif *vif); |
@@ -3139,6 +3259,8 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, | |||
3139 | * | 3259 | * |
3140 | * Note: Caller (or hardware) is responsible for setting the | 3260 | * Note: Caller (or hardware) is responsible for setting the |
3141 | * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. | 3261 | * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. |
3262 | * | ||
3263 | * Return: The nullfunc template. %NULL on error. | ||
3142 | */ | 3264 | */ |
3143 | struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, | 3265 | struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, |
3144 | struct ieee80211_vif *vif); | 3266 | struct ieee80211_vif *vif); |
@@ -3153,6 +3275,8 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, | |||
3153 | * | 3275 | * |
3154 | * Creates a Probe Request template which can, for example, be uploaded to | 3276 | * Creates a Probe Request template which can, for example, be uploaded to |
3155 | * hardware. | 3277 | * hardware. |
3278 | * | ||
3279 | * Return: The Probe Request template. %NULL on error. | ||
3156 | */ | 3280 | */ |
3157 | struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, | 3281 | struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, |
3158 | struct ieee80211_vif *vif, | 3282 | struct ieee80211_vif *vif, |
@@ -3188,6 +3312,8 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
3188 | * If the RTS is generated in firmware, but the host system must provide | 3312 | * If the RTS is generated in firmware, but the host system must provide |
3189 | * the duration field, the low-level driver uses this function to receive | 3313 | * the duration field, the low-level driver uses this function to receive |
3190 | * the duration field value in little-endian byteorder. | 3314 | * the duration field value in little-endian byteorder. |
3315 | * | ||
3316 | * Return: The duration. | ||
3191 | */ | 3317 | */ |
3192 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | 3318 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, |
3193 | struct ieee80211_vif *vif, size_t frame_len, | 3319 | struct ieee80211_vif *vif, size_t frame_len, |
@@ -3223,6 +3349,8 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
3223 | * If the CTS-to-self is generated in firmware, but the host system must provide | 3349 | * If the CTS-to-self is generated in firmware, but the host system must provide |
3224 | * the duration field, the low-level driver uses this function to receive | 3350 | * the duration field, the low-level driver uses this function to receive |
3225 | * the duration field value in little-endian byteorder. | 3351 | * the duration field value in little-endian byteorder. |
3352 | * | ||
3353 | * Return: The duration. | ||
3226 | */ | 3354 | */ |
3227 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | 3355 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, |
3228 | struct ieee80211_vif *vif, | 3356 | struct ieee80211_vif *vif, |
@@ -3239,6 +3367,8 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | |||
3239 | * | 3367 | * |
3240 | * Calculate the duration field of some generic frame, given its | 3368 | * Calculate the duration field of some generic frame, given its |
3241 | * length and transmission rate (in 100kbps). | 3369 | * length and transmission rate (in 100kbps). |
3370 | * | ||
3371 | * Return: The duration. | ||
3242 | */ | 3372 | */ |
3243 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | 3373 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, |
3244 | struct ieee80211_vif *vif, | 3374 | struct ieee80211_vif *vif, |
@@ -3255,9 +3385,10 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | |||
3255 | * hardware/firmware does not implement buffering of broadcast/multicast | 3385 | * hardware/firmware does not implement buffering of broadcast/multicast |
3256 | * frames when power saving is used, 802.11 code buffers them in the host | 3386 | * frames when power saving is used, 802.11 code buffers them in the host |
3257 | * memory. The low-level driver uses this function to fetch next buffered | 3387 | * memory. The low-level driver uses this function to fetch next buffered |
3258 | * frame. In most cases, this is used when generating beacon frame. This | 3388 | * frame. In most cases, this is used when generating beacon frame. |
3259 | * function returns a pointer to the next buffered skb or NULL if no more | 3389 | * |
3260 | * buffered frames are available. | 3390 | * Return: A pointer to the next buffered skb or NULL if no more buffered |
3391 | * frames are available. | ||
3261 | * | 3392 | * |
3262 | * Note: buffered frames are returned only after DTIM beacon frame was | 3393 | * Note: buffered frames are returned only after DTIM beacon frame was |
3263 | * generated with ieee80211_beacon_get() and the low-level driver must thus | 3394 | * generated with ieee80211_beacon_get() and the low-level driver must thus |
@@ -3437,6 +3568,8 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); | |||
3437 | * @queue: queue number (counted from zero). | 3568 | * @queue: queue number (counted from zero). |
3438 | * | 3569 | * |
3439 | * Drivers should use this function instead of netif_stop_queue. | 3570 | * Drivers should use this function instead of netif_stop_queue. |
3571 | * | ||
3572 | * Return: %true if the queue is stopped. %false otherwise. | ||
3440 | */ | 3573 | */ |
3441 | 3574 | ||
3442 | int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue); | 3575 | int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue); |
@@ -3634,7 +3767,9 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | |||
3634 | * @vif: virtual interface to look for station on | 3767 | * @vif: virtual interface to look for station on |
3635 | * @addr: station's address | 3768 | * @addr: station's address |
3636 | * | 3769 | * |
3637 | * This function must be called under RCU lock and the | 3770 | * Return: The station, if found. %NULL otherwise. |
3771 | * | ||
3772 | * Note: This function must be called under RCU lock and the | ||
3638 | * resulting pointer is only valid under RCU lock as well. | 3773 | * resulting pointer is only valid under RCU lock as well. |
3639 | */ | 3774 | */ |
3640 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, | 3775 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, |
@@ -3647,7 +3782,9 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, | |||
3647 | * @addr: remote station's address | 3782 | * @addr: remote station's address |
3648 | * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. | 3783 | * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. |
3649 | * | 3784 | * |
3650 | * This function must be called under RCU lock and the | 3785 | * Return: The station, if found. %NULL otherwise. |
3786 | * | ||
3787 | * Note: This function must be called under RCU lock and the | ||
3651 | * resulting pointer is only valid under RCU lock as well. | 3788 | * resulting pointer is only valid under RCU lock as well. |
3652 | * | 3789 | * |
3653 | * NOTE: You may pass NULL for localaddr, but then you will just get | 3790 | * NOTE: You may pass NULL for localaddr, but then you will just get |
@@ -3754,6 +3891,11 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw, | |||
3754 | * The iterator will not find a context that's being added (during | 3891 | * The iterator will not find a context that's being added (during |
3755 | * the driver callback to add it) but will find it while it's being | 3892 | * the driver callback to add it) but will find it while it's being |
3756 | * removed. | 3893 | * removed. |
3894 | * | ||
3895 | * Note that during hardware restart, all contexts that existed | ||
3896 | * before the restart are considered already present so will be | ||
3897 | * found while iterating, whether they've been re-added already | ||
3898 | * or not. | ||
3757 | */ | 3899 | */ |
3758 | void ieee80211_iter_chan_contexts_atomic( | 3900 | void ieee80211_iter_chan_contexts_atomic( |
3759 | struct ieee80211_hw *hw, | 3901 | struct ieee80211_hw *hw, |
@@ -3772,7 +3914,9 @@ void ieee80211_iter_chan_contexts_atomic( | |||
3772 | * information. This function must only be called from within the | 3914 | * information. This function must only be called from within the |
3773 | * .bss_info_changed callback function and only in managed mode. The function | 3915 | * .bss_info_changed callback function and only in managed mode. The function |
3774 | * is only useful when the interface is associated, otherwise it will return | 3916 | * is only useful when the interface is associated, otherwise it will return |
3775 | * NULL. | 3917 | * %NULL. |
3918 | * | ||
3919 | * Return: The Probe Request template. %NULL on error. | ||
3776 | */ | 3920 | */ |
3777 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | 3921 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, |
3778 | struct ieee80211_vif *vif); | 3922 | struct ieee80211_vif *vif); |
@@ -3796,6 +3940,8 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif); | |||
3796 | * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and | 3940 | * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and |
3797 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | 3941 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver |
3798 | * needs to inform if the connection to the AP has been lost. | 3942 | * needs to inform if the connection to the AP has been lost. |
3943 | * The function may also be called if the connection needs to be terminated | ||
3944 | * for some other reason, even if %IEEE80211_HW_CONNECTION_MONITOR isn't set. | ||
3799 | * | 3945 | * |
3800 | * This function will cause immediate change to disassociated state, | 3946 | * This function will cause immediate change to disassociated state, |
3801 | * without connection recovery attempts. | 3947 | * without connection recovery attempts. |
@@ -3826,36 +3972,6 @@ void ieee80211_connection_loss(struct ieee80211_vif *vif); | |||
3826 | void ieee80211_resume_disconnect(struct ieee80211_vif *vif); | 3972 | void ieee80211_resume_disconnect(struct ieee80211_vif *vif); |
3827 | 3973 | ||
3828 | /** | 3974 | /** |
3829 | * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm | ||
3830 | * | ||
3831 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3832 | * | ||
3833 | * Some hardware require full power save to manage simultaneous BT traffic | ||
3834 | * on the WLAN frequency. Full PSM is required periodically, whenever there are | ||
3835 | * burst of BT traffic. The hardware gets information of BT traffic via | ||
3836 | * hardware co-existence lines, and consequentially requests mac80211 to | ||
3837 | * (temporarily) enter full psm. | ||
3838 | * This function will only temporarily disable dynamic PS, not enable PSM if | ||
3839 | * it was not already enabled. | ||
3840 | * The driver must make sure to re-enable dynamic PS using | ||
3841 | * ieee80211_enable_dyn_ps() if the driver has disabled it. | ||
3842 | * | ||
3843 | */ | ||
3844 | void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif); | ||
3845 | |||
3846 | /** | ||
3847 | * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled | ||
3848 | * | ||
3849 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3850 | * | ||
3851 | * This function restores dynamic PS after being temporarily disabled via | ||
3852 | * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must | ||
3853 | * be coupled with an eventual call to this function. | ||
3854 | * | ||
3855 | */ | ||
3856 | void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif); | ||
3857 | |||
3858 | /** | ||
3859 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring | 3975 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring |
3860 | * rssi threshold triggered | 3976 | * rssi threshold triggered |
3861 | * | 3977 | * |
@@ -3872,6 +3988,13 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
3872 | gfp_t gfp); | 3988 | gfp_t gfp); |
3873 | 3989 | ||
3874 | /** | 3990 | /** |
3991 | * ieee80211_radar_detected - inform that a radar was detected | ||
3992 | * | ||
3993 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
3994 | */ | ||
3995 | void ieee80211_radar_detected(struct ieee80211_hw *hw); | ||
3996 | |||
3997 | /** | ||
3875 | * ieee80211_chswitch_done - Complete channel switch process | 3998 | * ieee80211_chswitch_done - Complete channel switch process |
3876 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3999 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
3877 | * @success: make the channel switch successful or not | 4000 | * @success: make the channel switch successful or not |
@@ -4119,13 +4242,27 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif, | |||
4119 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); | 4242 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); |
4120 | 4243 | ||
4121 | /** | 4244 | /** |
4122 | * ieee80211_ave_rssi - report the average rssi for the specified interface | 4245 | * ieee80211_ave_rssi - report the average RSSI for the specified interface |
4123 | * | 4246 | * |
4124 | * @vif: the specified virtual interface | 4247 | * @vif: the specified virtual interface |
4125 | * | 4248 | * |
4126 | * This function return the average rssi value for the requested interface. | 4249 | * Note: This function assumes that the given vif is valid. |
4127 | * It assumes that the given vif is valid. | 4250 | * |
4251 | * Return: The average RSSI value for the requested interface, or 0 if not | ||
4252 | * applicable. | ||
4128 | */ | 4253 | */ |
4129 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); | 4254 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); |
4130 | 4255 | ||
4256 | /** | ||
4257 | * ieee80211_report_wowlan_wakeup - report WoWLAN wakeup | ||
4258 | * @vif: virtual interface | ||
4259 | * @wakeup: wakeup reason(s) | ||
4260 | * @gfp: allocation flags | ||
4261 | * | ||
4262 | * See cfg80211_report_wowlan_wakeup(). | ||
4263 | */ | ||
4264 | void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, | ||
4265 | struct cfg80211_wowlan_wakeup *wakeup, | ||
4266 | gfp_t gfp); | ||
4267 | |||
4131 | #endif /* MAC80211_H */ | 4268 | #endif /* MAC80211_H */ |
diff --git a/include/net/mrp.h b/include/net/mrp.h new file mode 100644 index 000000000000..4fbf02aa2ec1 --- /dev/null +++ b/include/net/mrp.h | |||
@@ -0,0 +1,143 @@ | |||
1 | #ifndef _NET_MRP_H | ||
2 | #define _NET_MRP_H | ||
3 | |||
4 | #define MRP_END_MARK 0x0 | ||
5 | |||
6 | struct mrp_pdu_hdr { | ||
7 | u8 version; | ||
8 | }; | ||
9 | |||
10 | struct mrp_msg_hdr { | ||
11 | u8 attrtype; | ||
12 | u8 attrlen; | ||
13 | }; | ||
14 | |||
15 | struct mrp_vecattr_hdr { | ||
16 | __be16 lenflags; | ||
17 | unsigned char firstattrvalue[]; | ||
18 | #define MRP_VECATTR_HDR_LEN_MASK cpu_to_be16(0x1FFF) | ||
19 | #define MRP_VECATTR_HDR_FLAG_LA cpu_to_be16(0x2000) | ||
20 | }; | ||
21 | |||
22 | enum mrp_vecattr_event { | ||
23 | MRP_VECATTR_EVENT_NEW, | ||
24 | MRP_VECATTR_EVENT_JOIN_IN, | ||
25 | MRP_VECATTR_EVENT_IN, | ||
26 | MRP_VECATTR_EVENT_JOIN_MT, | ||
27 | MRP_VECATTR_EVENT_MT, | ||
28 | MRP_VECATTR_EVENT_LV, | ||
29 | __MRP_VECATTR_EVENT_MAX | ||
30 | }; | ||
31 | |||
32 | struct mrp_skb_cb { | ||
33 | struct mrp_msg_hdr *mh; | ||
34 | struct mrp_vecattr_hdr *vah; | ||
35 | unsigned char attrvalue[]; | ||
36 | }; | ||
37 | |||
38 | static inline struct mrp_skb_cb *mrp_cb(struct sk_buff *skb) | ||
39 | { | ||
40 | BUILD_BUG_ON(sizeof(struct mrp_skb_cb) > | ||
41 | FIELD_SIZEOF(struct sk_buff, cb)); | ||
42 | return (struct mrp_skb_cb *)skb->cb; | ||
43 | } | ||
44 | |||
45 | enum mrp_applicant_state { | ||
46 | MRP_APPLICANT_INVALID, | ||
47 | MRP_APPLICANT_VO, | ||
48 | MRP_APPLICANT_VP, | ||
49 | MRP_APPLICANT_VN, | ||
50 | MRP_APPLICANT_AN, | ||
51 | MRP_APPLICANT_AA, | ||
52 | MRP_APPLICANT_QA, | ||
53 | MRP_APPLICANT_LA, | ||
54 | MRP_APPLICANT_AO, | ||
55 | MRP_APPLICANT_QO, | ||
56 | MRP_APPLICANT_AP, | ||
57 | MRP_APPLICANT_QP, | ||
58 | __MRP_APPLICANT_MAX | ||
59 | }; | ||
60 | #define MRP_APPLICANT_MAX (__MRP_APPLICANT_MAX - 1) | ||
61 | |||
62 | enum mrp_event { | ||
63 | MRP_EVENT_NEW, | ||
64 | MRP_EVENT_JOIN, | ||
65 | MRP_EVENT_LV, | ||
66 | MRP_EVENT_TX, | ||
67 | MRP_EVENT_R_NEW, | ||
68 | MRP_EVENT_R_JOIN_IN, | ||
69 | MRP_EVENT_R_IN, | ||
70 | MRP_EVENT_R_JOIN_MT, | ||
71 | MRP_EVENT_R_MT, | ||
72 | MRP_EVENT_R_LV, | ||
73 | MRP_EVENT_R_LA, | ||
74 | MRP_EVENT_REDECLARE, | ||
75 | MRP_EVENT_PERIODIC, | ||
76 | __MRP_EVENT_MAX | ||
77 | }; | ||
78 | #define MRP_EVENT_MAX (__MRP_EVENT_MAX - 1) | ||
79 | |||
80 | enum mrp_tx_action { | ||
81 | MRP_TX_ACTION_NONE, | ||
82 | MRP_TX_ACTION_S_NEW, | ||
83 | MRP_TX_ACTION_S_JOIN_IN, | ||
84 | MRP_TX_ACTION_S_JOIN_IN_OPTIONAL, | ||
85 | MRP_TX_ACTION_S_IN_OPTIONAL, | ||
86 | MRP_TX_ACTION_S_LV, | ||
87 | }; | ||
88 | |||
89 | struct mrp_attr { | ||
90 | struct rb_node node; | ||
91 | enum mrp_applicant_state state; | ||
92 | u8 type; | ||
93 | u8 len; | ||
94 | unsigned char value[]; | ||
95 | }; | ||
96 | |||
97 | enum mrp_applications { | ||
98 | MRP_APPLICATION_MVRP, | ||
99 | __MRP_APPLICATION_MAX | ||
100 | }; | ||
101 | #define MRP_APPLICATION_MAX (__MRP_APPLICATION_MAX - 1) | ||
102 | |||
103 | struct mrp_application { | ||
104 | enum mrp_applications type; | ||
105 | unsigned int maxattr; | ||
106 | struct packet_type pkttype; | ||
107 | unsigned char group_address[ETH_ALEN]; | ||
108 | u8 version; | ||
109 | }; | ||
110 | |||
111 | struct mrp_applicant { | ||
112 | struct mrp_application *app; | ||
113 | struct net_device *dev; | ||
114 | struct timer_list join_timer; | ||
115 | |||
116 | spinlock_t lock; | ||
117 | struct sk_buff_head queue; | ||
118 | struct sk_buff *pdu; | ||
119 | struct rb_root mad; | ||
120 | struct rcu_head rcu; | ||
121 | }; | ||
122 | |||
123 | struct mrp_port { | ||
124 | struct mrp_applicant __rcu *applicants[MRP_APPLICATION_MAX + 1]; | ||
125 | struct rcu_head rcu; | ||
126 | }; | ||
127 | |||
128 | extern int mrp_register_application(struct mrp_application *app); | ||
129 | extern void mrp_unregister_application(struct mrp_application *app); | ||
130 | |||
131 | extern int mrp_init_applicant(struct net_device *dev, | ||
132 | struct mrp_application *app); | ||
133 | extern void mrp_uninit_applicant(struct net_device *dev, | ||
134 | struct mrp_application *app); | ||
135 | |||
136 | extern int mrp_request_join(const struct net_device *dev, | ||
137 | const struct mrp_application *app, | ||
138 | const void *value, u8 len, u8 type); | ||
139 | extern void mrp_request_leave(const struct net_device *dev, | ||
140 | const struct mrp_application *app, | ||
141 | const void *value, u8 len, u8 type); | ||
142 | |||
143 | #endif /* _NET_MRP_H */ | ||
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 23b3a7c58783..745bf741e029 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -127,13 +127,19 @@ static int ndisc_addr_option_pad(unsigned short type) | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline int ndisc_opt_addr_space(struct net_device *dev) | ||
131 | { | ||
132 | return NDISC_OPT_SPACE(dev->addr_len + | ||
133 | ndisc_addr_option_pad(dev->type)); | ||
134 | } | ||
135 | |||
130 | static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p, | 136 | static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p, |
131 | struct net_device *dev) | 137 | struct net_device *dev) |
132 | { | 138 | { |
133 | u8 *lladdr = (u8 *)(p + 1); | 139 | u8 *lladdr = (u8 *)(p + 1); |
134 | int lladdrlen = p->nd_opt_len << 3; | 140 | int lladdrlen = p->nd_opt_len << 3; |
135 | int prepad = ndisc_addr_option_pad(dev->type); | 141 | int prepad = ndisc_addr_option_pad(dev->type); |
136 | if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) | 142 | if (lladdrlen != ndisc_opt_addr_space(dev)) |
137 | return NULL; | 143 | return NULL; |
138 | return lladdr + prepad; | 144 | return lladdr + prepad; |
139 | } | 145 | } |
@@ -148,15 +154,14 @@ static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, _ | |||
148 | (p32[3] * hash_rnd[3])); | 154 | (p32[3] * hash_rnd[3])); |
149 | } | 155 | } |
150 | 156 | ||
151 | static inline struct neighbour *__ipv6_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, const void *pkey) | 157 | static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey) |
152 | { | 158 | { |
153 | struct neigh_hash_table *nht; | 159 | struct neigh_hash_table *nht; |
154 | const u32 *p32 = pkey; | 160 | const u32 *p32 = pkey; |
155 | struct neighbour *n; | 161 | struct neighbour *n; |
156 | u32 hash_val; | 162 | u32 hash_val; |
157 | 163 | ||
158 | rcu_read_lock_bh(); | 164 | nht = rcu_dereference_bh(nd_tbl.nht); |
159 | nht = rcu_dereference_bh(tbl->nht); | ||
160 | hash_val = ndisc_hashfn(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift); | 165 | hash_val = ndisc_hashfn(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift); |
161 | for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); | 166 | for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); |
162 | n != NULL; | 167 | n != NULL; |
@@ -164,12 +169,21 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct neigh_table *tbl, str | |||
164 | u32 *n32 = (u32 *) n->primary_key; | 169 | u32 *n32 = (u32 *) n->primary_key; |
165 | if (n->dev == dev && | 170 | if (n->dev == dev && |
166 | ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) | | 171 | ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) | |
167 | (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0) { | 172 | (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0) |
168 | if (!atomic_inc_not_zero(&n->refcnt)) | 173 | return n; |
169 | n = NULL; | ||
170 | break; | ||
171 | } | ||
172 | } | 174 | } |
175 | |||
176 | return NULL; | ||
177 | } | ||
178 | |||
179 | static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, const void *pkey) | ||
180 | { | ||
181 | struct neighbour *n; | ||
182 | |||
183 | rcu_read_lock_bh(); | ||
184 | n = __ipv6_neigh_lookup_noref(dev, pkey); | ||
185 | if (n && !atomic_inc_not_zero(&n->refcnt)) | ||
186 | n = NULL; | ||
173 | rcu_read_unlock_bh(); | 187 | rcu_read_unlock_bh(); |
174 | 188 | ||
175 | return n; | 189 | return n; |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 0dab173e27da..7e748ad8b50c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -181,10 +181,11 @@ struct neigh_table { | |||
181 | }; | 181 | }; |
182 | 182 | ||
183 | #define NEIGH_PRIV_ALIGN sizeof(long long) | 183 | #define NEIGH_PRIV_ALIGN sizeof(long long) |
184 | #define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) | ||
184 | 185 | ||
185 | static inline void *neighbour_priv(const struct neighbour *n) | 186 | static inline void *neighbour_priv(const struct neighbour *n) |
186 | { | 187 | { |
187 | return (char *)n + ALIGN(sizeof(*n) + n->tbl->key_len, NEIGH_PRIV_ALIGN); | 188 | return (char *)n + n->tbl->entry_size; |
188 | } | 189 | } |
189 | 190 | ||
190 | /* flags for neigh_update() */ | 191 | /* flags for neigh_update() */ |
diff --git a/include/net/netevent.h b/include/net/netevent.h index 3ce4988c9c08..fe630dde35c3 100644 --- a/include/net/netevent.h +++ b/include/net/netevent.h | |||
@@ -16,9 +16,8 @@ struct neighbour; | |||
16 | 16 | ||
17 | struct netevent_redirect { | 17 | struct netevent_redirect { |
18 | struct dst_entry *old; | 18 | struct dst_entry *old; |
19 | struct neighbour *old_neigh; | ||
20 | struct dst_entry *new; | 19 | struct dst_entry *new; |
21 | struct neighbour *new_neigh; | 20 | struct neighbour *neigh; |
22 | const void *daddr; | 21 | const void *daddr; |
23 | }; | 22 | }; |
24 | 23 | ||
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h index 463ae8e16696..2bdb7a15fe06 100644 --- a/include/net/netfilter/nf_conntrack_acct.h +++ b/include/net/netfilter/nf_conntrack_acct.h | |||
@@ -57,7 +57,9 @@ static inline void nf_ct_set_acct(struct net *net, bool enable) | |||
57 | net->ct.sysctl_acct = enable; | 57 | net->ct.sysctl_acct = enable; |
58 | } | 58 | } |
59 | 59 | ||
60 | extern int nf_conntrack_acct_init(struct net *net); | 60 | extern int nf_conntrack_acct_pernet_init(struct net *net); |
61 | extern void nf_conntrack_acct_fini(struct net *net); | 61 | extern void nf_conntrack_acct_pernet_fini(struct net *net); |
62 | 62 | ||
63 | extern int nf_conntrack_acct_init(void); | ||
64 | extern void nf_conntrack_acct_fini(void); | ||
63 | #endif /* _NF_CONNTRACK_ACCT_H */ | 65 | #endif /* _NF_CONNTRACK_ACCT_H */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index e98aeb3da033..930275fa2ea6 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -25,12 +25,19 @@ extern unsigned int nf_conntrack_in(struct net *net, | |||
25 | unsigned int hooknum, | 25 | unsigned int hooknum, |
26 | struct sk_buff *skb); | 26 | struct sk_buff *skb); |
27 | 27 | ||
28 | extern int nf_conntrack_init(struct net *net); | 28 | extern int nf_conntrack_init_net(struct net *net); |
29 | extern void nf_conntrack_cleanup(struct net *net); | 29 | extern void nf_conntrack_cleanup_net(struct net *net); |
30 | 30 | ||
31 | extern int nf_conntrack_proto_init(struct net *net); | 31 | extern int nf_conntrack_proto_pernet_init(struct net *net); |
32 | extern void nf_conntrack_proto_fini(struct net *net); | 32 | extern void nf_conntrack_proto_pernet_fini(struct net *net); |
33 | 33 | ||
34 | extern int nf_conntrack_proto_init(void); | ||
35 | extern void nf_conntrack_proto_fini(void); | ||
36 | |||
37 | extern int nf_conntrack_init_start(void); | ||
38 | extern void nf_conntrack_cleanup_start(void); | ||
39 | |||
40 | extern void nf_conntrack_init_end(void); | ||
34 | extern void nf_conntrack_cleanup_end(void); | 41 | extern void nf_conntrack_cleanup_end(void); |
35 | 42 | ||
36 | extern bool | 43 | extern bool |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 5654d292efd4..092dc651689f 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -207,9 +207,11 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event, | |||
207 | nf_ct_expect_event_report(event, exp, 0, 0); | 207 | nf_ct_expect_event_report(event, exp, 0, 0); |
208 | } | 208 | } |
209 | 209 | ||
210 | extern int nf_conntrack_ecache_init(struct net *net); | 210 | extern int nf_conntrack_ecache_pernet_init(struct net *net); |
211 | extern void nf_conntrack_ecache_fini(struct net *net); | 211 | extern void nf_conntrack_ecache_pernet_fini(struct net *net); |
212 | 212 | ||
213 | extern int nf_conntrack_ecache_init(void); | ||
214 | extern void nf_conntrack_ecache_fini(void); | ||
213 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | 215 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ |
214 | 216 | ||
215 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | 217 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, |
@@ -232,12 +234,21 @@ static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e, | |||
232 | u32 portid, | 234 | u32 portid, |
233 | int report) {} | 235 | int report) {} |
234 | 236 | ||
235 | static inline int nf_conntrack_ecache_init(struct net *net) | 237 | static inline int nf_conntrack_ecache_pernet_init(struct net *net) |
236 | { | 238 | { |
237 | return 0; | 239 | return 0; |
238 | } | 240 | } |
239 | 241 | ||
240 | static inline void nf_conntrack_ecache_fini(struct net *net) | 242 | static inline void nf_conntrack_ecache_pernet_fini(struct net *net) |
243 | { | ||
244 | } | ||
245 | |||
246 | static inline int nf_conntrack_ecache_init(void) | ||
247 | { | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | static inline void nf_conntrack_ecache_fini(void) | ||
241 | { | 252 | { |
242 | } | 253 | } |
243 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 254 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index cc13f377a705..cbbae7621e22 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -69,8 +69,11 @@ struct nf_conntrack_expect_policy { | |||
69 | 69 | ||
70 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 70 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
71 | 71 | ||
72 | int nf_conntrack_expect_init(struct net *net); | 72 | int nf_conntrack_expect_pernet_init(struct net *net); |
73 | void nf_conntrack_expect_fini(struct net *net); | 73 | void nf_conntrack_expect_pernet_fini(struct net *net); |
74 | |||
75 | int nf_conntrack_expect_init(void); | ||
76 | void nf_conntrack_expect_fini(void); | ||
74 | 77 | ||
75 | struct nf_conntrack_expect * | 78 | struct nf_conntrack_expect * |
76 | __nf_ct_expect_find(struct net *net, u16 zone, | 79 | __nf_ct_expect_find(struct net *net, u16 zone, |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 8b4d1fc29096..977bc8a46444 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -23,6 +23,9 @@ enum nf_ct_ext_id { | |||
23 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT | 23 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT |
24 | NF_CT_EXT_TIMEOUT, | 24 | NF_CT_EXT_TIMEOUT, |
25 | #endif | 25 | #endif |
26 | #ifdef CONFIG_NF_CONNTRACK_LABELS | ||
27 | NF_CT_EXT_LABELS, | ||
28 | #endif | ||
26 | NF_CT_EXT_NUM, | 29 | NF_CT_EXT_NUM, |
27 | }; | 30 | }; |
28 | 31 | ||
@@ -33,6 +36,7 @@ enum nf_ct_ext_id { | |||
33 | #define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone | 36 | #define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone |
34 | #define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp | 37 | #define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp |
35 | #define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout | 38 | #define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout |
39 | #define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels | ||
36 | 40 | ||
37 | /* Extensions: optional stuff which isn't permanently in struct. */ | 41 | /* Extensions: optional stuff which isn't permanently in struct. */ |
38 | struct nf_ct_ext { | 42 | struct nf_ct_ext { |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 9aad956d1008..26c4ae5bfbb8 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -82,8 +82,11 @@ static inline void *nfct_help_data(const struct nf_conn *ct) | |||
82 | return (void *)help->data; | 82 | return (void *)help->data; |
83 | } | 83 | } |
84 | 84 | ||
85 | extern int nf_conntrack_helper_init(struct net *net); | 85 | extern int nf_conntrack_helper_pernet_init(struct net *net); |
86 | extern void nf_conntrack_helper_fini(struct net *net); | 86 | extern void nf_conntrack_helper_pernet_fini(struct net *net); |
87 | |||
88 | extern int nf_conntrack_helper_init(void); | ||
89 | extern void nf_conntrack_helper_fini(void); | ||
87 | 90 | ||
88 | extern int nf_conntrack_broadcast_help(struct sk_buff *skb, | 91 | extern int nf_conntrack_broadcast_help(struct sk_buff *skb, |
89 | unsigned int protoff, | 92 | unsigned int protoff, |
@@ -97,6 +100,10 @@ struct nf_ct_helper_expectfn { | |||
97 | void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp); | 100 | void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp); |
98 | }; | 101 | }; |
99 | 102 | ||
103 | __printf(3,4) | ||
104 | void nf_ct_helper_log(struct sk_buff *skb, const struct nf_conn *ct, | ||
105 | const char *fmt, ...); | ||
106 | |||
100 | void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n); | 107 | void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n); |
101 | void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n); | 108 | void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n); |
102 | struct nf_ct_helper_expectfn * | 109 | struct nf_ct_helper_expectfn * |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 6f7c13f4ac03..3bb89eac3fa1 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -76,11 +76,16 @@ struct nf_conntrack_l3proto { | |||
76 | 76 | ||
77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; | 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; |
78 | 78 | ||
79 | /* Protocol registration. */ | 79 | /* Protocol pernet registration. */ |
80 | extern int nf_conntrack_l3proto_register(struct net *net, | 80 | extern int nf_ct_l3proto_pernet_register(struct net *net, |
81 | struct nf_conntrack_l3proto *proto); | 81 | struct nf_conntrack_l3proto *proto); |
82 | extern void nf_conntrack_l3proto_unregister(struct net *net, | 82 | extern void nf_ct_l3proto_pernet_unregister(struct net *net, |
83 | struct nf_conntrack_l3proto *proto); | 83 | struct nf_conntrack_l3proto *proto); |
84 | |||
85 | /* Protocol global registration. */ | ||
86 | extern int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto); | ||
87 | extern void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); | ||
88 | |||
84 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 89 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
85 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 90 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
86 | 91 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index c3be4aef6bf7..914d8d900798 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -121,12 +121,16 @@ extern struct nf_conntrack_l4proto * | |||
121 | nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); | 121 | nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); |
122 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); | 122 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
123 | 123 | ||
124 | /* Protocol registration. */ | 124 | /* Protocol pernet registration. */ |
125 | extern int nf_conntrack_l4proto_register(struct net *net, | 125 | extern int nf_ct_l4proto_pernet_register(struct net *net, |
126 | struct nf_conntrack_l4proto *proto); | 126 | struct nf_conntrack_l4proto *proto); |
127 | extern void nf_conntrack_l4proto_unregister(struct net *net, | 127 | extern void nf_ct_l4proto_pernet_unregister(struct net *net, |
128 | struct nf_conntrack_l4proto *proto); | 128 | struct nf_conntrack_l4proto *proto); |
129 | 129 | ||
130 | /* Protocol global registration. */ | ||
131 | extern int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto); | ||
132 | extern void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto); | ||
133 | |||
130 | static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) | 134 | static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) |
131 | { | 135 | { |
132 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) | 136 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) |
diff --git a/include/net/netfilter/nf_conntrack_labels.h b/include/net/netfilter/nf_conntrack_labels.h new file mode 100644 index 000000000000..c985695283b3 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_labels.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #include <linux/types.h> | ||
2 | #include <net/net_namespace.h> | ||
3 | #include <linux/netfilter/nf_conntrack_common.h> | ||
4 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
5 | #include <net/netfilter/nf_conntrack.h> | ||
6 | #include <net/netfilter/nf_conntrack_extend.h> | ||
7 | |||
8 | #include <uapi/linux/netfilter/xt_connlabel.h> | ||
9 | |||
10 | struct nf_conn_labels { | ||
11 | u8 words; | ||
12 | unsigned long bits[]; | ||
13 | }; | ||
14 | |||
15 | static inline struct nf_conn_labels *nf_ct_labels_find(const struct nf_conn *ct) | ||
16 | { | ||
17 | #ifdef CONFIG_NF_CONNTRACK_LABELS | ||
18 | return nf_ct_ext_find(ct, NF_CT_EXT_LABELS); | ||
19 | #else | ||
20 | return NULL; | ||
21 | #endif | ||
22 | } | ||
23 | |||
24 | static inline struct nf_conn_labels *nf_ct_labels_ext_add(struct nf_conn *ct) | ||
25 | { | ||
26 | #ifdef CONFIG_NF_CONNTRACK_LABELS | ||
27 | struct nf_conn_labels *cl_ext; | ||
28 | struct net *net = nf_ct_net(ct); | ||
29 | u8 words; | ||
30 | |||
31 | words = ACCESS_ONCE(net->ct.label_words); | ||
32 | if (words == 0 || WARN_ON_ONCE(words > 8)) | ||
33 | return NULL; | ||
34 | |||
35 | cl_ext = nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS, | ||
36 | words * sizeof(long), GFP_ATOMIC); | ||
37 | if (cl_ext != NULL) | ||
38 | cl_ext->words = words; | ||
39 | |||
40 | return cl_ext; | ||
41 | #else | ||
42 | return NULL; | ||
43 | #endif | ||
44 | } | ||
45 | |||
46 | bool nf_connlabel_match(const struct nf_conn *ct, u16 bit); | ||
47 | int nf_connlabel_set(struct nf_conn *ct, u16 bit); | ||
48 | |||
49 | int nf_connlabels_replace(struct nf_conn *ct, | ||
50 | const u32 *data, const u32 *mask, unsigned int words); | ||
51 | |||
52 | #ifdef CONFIG_NF_CONNTRACK_LABELS | ||
53 | int nf_conntrack_labels_init(void); | ||
54 | void nf_conntrack_labels_fini(void); | ||
55 | #else | ||
56 | static inline int nf_conntrack_labels_init(void) { return 0; } | ||
57 | static inline void nf_conntrack_labels_fini(void) {} | ||
58 | #endif | ||
diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h index e41e472d08f2..d23aceb16d94 100644 --- a/include/net/netfilter/nf_conntrack_timeout.h +++ b/include/net/netfilter/nf_conntrack_timeout.h | |||
@@ -76,15 +76,15 @@ nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct, | |||
76 | } | 76 | } |
77 | 77 | ||
78 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT | 78 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT |
79 | extern int nf_conntrack_timeout_init(struct net *net); | 79 | extern int nf_conntrack_timeout_init(void); |
80 | extern void nf_conntrack_timeout_fini(struct net *net); | 80 | extern void nf_conntrack_timeout_fini(void); |
81 | #else | 81 | #else |
82 | static inline int nf_conntrack_timeout_init(struct net *net) | 82 | static inline int nf_conntrack_timeout_init(void) |
83 | { | 83 | { |
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | 86 | ||
87 | static inline void nf_conntrack_timeout_fini(struct net *net) | 87 | static inline void nf_conntrack_timeout_fini(void) |
88 | { | 88 | { |
89 | return; | 89 | return; |
90 | } | 90 | } |
diff --git a/include/net/netfilter/nf_conntrack_timestamp.h b/include/net/netfilter/nf_conntrack_timestamp.h index fc9c82b1f06b..b00461413efd 100644 --- a/include/net/netfilter/nf_conntrack_timestamp.h +++ b/include/net/netfilter/nf_conntrack_timestamp.h | |||
@@ -48,15 +48,28 @@ static inline void nf_ct_set_tstamp(struct net *net, bool enable) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP | 50 | #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP |
51 | extern int nf_conntrack_tstamp_init(struct net *net); | 51 | extern int nf_conntrack_tstamp_pernet_init(struct net *net); |
52 | extern void nf_conntrack_tstamp_fini(struct net *net); | 52 | extern void nf_conntrack_tstamp_pernet_fini(struct net *net); |
53 | |||
54 | extern int nf_conntrack_tstamp_init(void); | ||
55 | extern void nf_conntrack_tstamp_fini(void); | ||
53 | #else | 56 | #else |
54 | static inline int nf_conntrack_tstamp_init(struct net *net) | 57 | static inline int nf_conntrack_tstamp_pernet_init(struct net *net) |
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static inline void nf_conntrack_tstamp_pernet_fini(struct net *net) | ||
63 | { | ||
64 | return; | ||
65 | } | ||
66 | |||
67 | static inline int nf_conntrack_tstamp_init(void) | ||
55 | { | 68 | { |
56 | return 0; | 69 | return 0; |
57 | } | 70 | } |
58 | 71 | ||
59 | static inline void nf_conntrack_tstamp_fini(struct net *net) | 72 | static inline void nf_conntrack_tstamp_fini(void) |
60 | { | 73 | { |
61 | return; | 74 | return; |
62 | } | 75 | } |
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h index 75ca9291cf2c..36d9379d4c4b 100644 --- a/include/net/netfilter/nf_tproxy_core.h +++ b/include/net/netfilter/nf_tproxy_core.h | |||
@@ -82,6 +82,7 @@ nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, | |||
82 | break; | 82 | break; |
83 | case NFT_LOOKUP_LISTENER: | 83 | case NFT_LOOKUP_LISTENER: |
84 | sk = inet_lookup_listener(net, &tcp_hashinfo, | 84 | sk = inet_lookup_listener(net, &tcp_hashinfo, |
85 | saddr, sport, | ||
85 | daddr, dport, | 86 | daddr, dport, |
86 | in->ifindex); | 87 | in->ifindex); |
87 | 88 | ||
@@ -151,6 +152,7 @@ nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, | |||
151 | break; | 152 | break; |
152 | case NFT_LOOKUP_LISTENER: | 153 | case NFT_LOOKUP_LISTENER: |
153 | sk = inet6_lookup_listener(net, &tcp_hashinfo, | 154 | sk = inet6_lookup_listener(net, &tcp_hashinfo, |
155 | saddr, sport, | ||
154 | daddr, ntohs(dport), | 156 | daddr, ntohs(dport), |
155 | in->ifindex); | 157 | in->ifindex); |
156 | 158 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 923cb20051ed..c9c0c538b68b 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -84,6 +84,10 @@ struct netns_ct { | |||
84 | int sysctl_auto_assign_helper; | 84 | int sysctl_auto_assign_helper; |
85 | bool auto_assign_helper_warned; | 85 | bool auto_assign_helper_warned; |
86 | struct nf_ip_net nf_ct_proto; | 86 | struct nf_ip_net nf_ct_proto; |
87 | #if defined(CONFIG_NF_CONNTRACK_LABELS) | ||
88 | unsigned int labels_used; | ||
89 | u8 label_words; | ||
90 | #endif | ||
87 | #ifdef CONFIG_NF_NAT_NEEDED | 91 | #ifdef CONFIG_NF_NAT_NEEDED |
88 | struct hlist_head *nat_bysource; | 92 | struct hlist_head *nat_bysource; |
89 | unsigned int nat_htable_size; | 93 | unsigned int nat_htable_size; |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2ae2b8372cfd..2ba9de89e8ec 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -22,6 +22,7 @@ struct netns_ipv4 { | |||
22 | struct ctl_table_header *frags_hdr; | 22 | struct ctl_table_header *frags_hdr; |
23 | struct ctl_table_header *ipv4_hdr; | 23 | struct ctl_table_header *ipv4_hdr; |
24 | struct ctl_table_header *route_hdr; | 24 | struct ctl_table_header *route_hdr; |
25 | struct ctl_table_header *xfrm4_hdr; | ||
25 | #endif | 26 | #endif |
26 | struct ipv4_devconf *devconf_all; | 27 | struct ipv4_devconf *devconf_all; |
27 | struct ipv4_devconf *devconf_dflt; | 28 | struct ipv4_devconf *devconf_dflt; |
@@ -61,6 +62,8 @@ struct netns_ipv4 { | |||
61 | int sysctl_icmp_ratemask; | 62 | int sysctl_icmp_ratemask; |
62 | int sysctl_icmp_errors_use_inbound_ifaddr; | 63 | int sysctl_icmp_errors_use_inbound_ifaddr; |
63 | 64 | ||
65 | int sysctl_tcp_ecn; | ||
66 | |||
64 | kgid_t sysctl_ping_group_range[2]; | 67 | kgid_t sysctl_ping_group_range[2]; |
65 | long sysctl_tcp_mem[3]; | 68 | long sysctl_tcp_mem[3]; |
66 | 69 | ||
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 214cb0a53359..1242f371718b 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -16,6 +16,7 @@ struct netns_sysctl_ipv6 { | |||
16 | struct ctl_table_header *route_hdr; | 16 | struct ctl_table_header *route_hdr; |
17 | struct ctl_table_header *icmp_hdr; | 17 | struct ctl_table_header *icmp_hdr; |
18 | struct ctl_table_header *frags_hdr; | 18 | struct ctl_table_header *frags_hdr; |
19 | struct ctl_table_header *xfrm6_hdr; | ||
19 | #endif | 20 | #endif |
20 | int bindv6only; | 21 | int bindv6only; |
21 | int flush_delay; | 22 | int flush_delay; |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 671953e11575..b87a1692b086 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -57,8 +57,10 @@ struct nfc_hci_ops { | |||
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | 57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); |
58 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
59 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 60 | int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
61 | struct sk_buff *skb); | 61 | struct sk_buff *skb); |
62 | int (*enable_se)(struct nfc_dev *dev, u32 secure_element); | ||
63 | int (*disable_se)(struct nfc_dev *dev, u32 secure_element); | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | /* Pipes */ | 66 | /* Pipes */ |
@@ -82,11 +84,23 @@ typedef int (*xmit) (struct sk_buff *skb, void *cb_data); | |||
82 | 84 | ||
83 | #define NFC_HCI_MAX_GATES 256 | 85 | #define NFC_HCI_MAX_GATES 256 |
84 | 86 | ||
87 | /* | ||
88 | * These values can be specified by a driver to indicate it requires some | ||
89 | * adaptation of the HCI standard. | ||
90 | * | ||
91 | * NFC_HCI_QUIRK_SHORT_CLEAR - send HCI_ADM_CLEAR_ALL_PIPE cmd with no params | ||
92 | */ | ||
93 | enum { | ||
94 | NFC_HCI_QUIRK_SHORT_CLEAR = 0, | ||
95 | }; | ||
96 | |||
85 | struct nfc_hci_dev { | 97 | struct nfc_hci_dev { |
86 | struct nfc_dev *ndev; | 98 | struct nfc_dev *ndev; |
87 | 99 | ||
88 | u32 max_data_link_payload; | 100 | u32 max_data_link_payload; |
89 | 101 | ||
102 | bool shutting_down; | ||
103 | |||
90 | struct mutex msg_tx_mutex; | 104 | struct mutex msg_tx_mutex; |
91 | 105 | ||
92 | struct list_head msg_tx_queue; | 106 | struct list_head msg_tx_queue; |
@@ -129,12 +143,16 @@ struct nfc_hci_dev { | |||
129 | 143 | ||
130 | u8 *gb; | 144 | u8 *gb; |
131 | size_t gb_len; | 145 | size_t gb_len; |
146 | |||
147 | unsigned long quirks; | ||
132 | }; | 148 | }; |
133 | 149 | ||
134 | /* hci device allocation */ | 150 | /* hci device allocation */ |
135 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | 151 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, |
136 | struct nfc_hci_init_data *init_data, | 152 | struct nfc_hci_init_data *init_data, |
153 | unsigned long quirks, | ||
137 | u32 protocols, | 154 | u32 protocols, |
155 | u32 supported_se, | ||
138 | const char *llc_name, | 156 | const char *llc_name, |
139 | int tx_headroom, | 157 | int tx_headroom, |
140 | int tx_tailroom, | 158 | int tx_tailroom, |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index d705d8674949..5bc0c460edc0 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
@@ -147,6 +147,7 @@ struct nci_dev { | |||
147 | /* ----- NCI Devices ----- */ | 147 | /* ----- NCI Devices ----- */ |
148 | struct nci_dev *nci_allocate_device(struct nci_ops *ops, | 148 | struct nci_dev *nci_allocate_device(struct nci_ops *ops, |
149 | __u32 supported_protocols, | 149 | __u32 supported_protocols, |
150 | __u32 supported_se, | ||
150 | int tx_headroom, | 151 | int tx_headroom, |
151 | int tx_tailroom); | 152 | int tx_tailroom); |
152 | void nci_free_device(struct nci_dev *ndev); | 153 | void nci_free_device(struct nci_dev *ndev); |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index fce80b2f9be7..87a6417fc934 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -68,6 +68,8 @@ struct nfc_ops { | |||
68 | void *cb_context); | 68 | void *cb_context); |
69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); | 69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); |
70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); | 70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); |
71 | int (*enable_se)(struct nfc_dev *dev, u32 secure_element); | ||
72 | int (*disable_se)(struct nfc_dev *dev, u32 secure_element); | ||
71 | }; | 73 | }; |
72 | 74 | ||
73 | #define NFC_TARGET_IDX_ANY -1 | 75 | #define NFC_TARGET_IDX_ANY -1 |
@@ -109,12 +111,17 @@ struct nfc_dev { | |||
109 | struct nfc_genl_data genl_data; | 111 | struct nfc_genl_data genl_data; |
110 | u32 supported_protocols; | 112 | u32 supported_protocols; |
111 | 113 | ||
114 | u32 supported_se; | ||
115 | u32 active_se; | ||
116 | |||
112 | int tx_headroom; | 117 | int tx_headroom; |
113 | int tx_tailroom; | 118 | int tx_tailroom; |
114 | 119 | ||
115 | struct timer_list check_pres_timer; | 120 | struct timer_list check_pres_timer; |
116 | struct work_struct check_pres_work; | 121 | struct work_struct check_pres_work; |
117 | 122 | ||
123 | bool shutting_down; | ||
124 | |||
118 | struct nfc_ops *ops; | 125 | struct nfc_ops *ops; |
119 | }; | 126 | }; |
120 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) | 127 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) |
@@ -123,6 +130,7 @@ extern struct class nfc_class; | |||
123 | 130 | ||
124 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, | 131 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, |
125 | u32 supported_protocols, | 132 | u32 supported_protocols, |
133 | u32 supported_se, | ||
126 | int tx_headroom, | 134 | int tx_headroom, |
127 | int tx_tailroom); | 135 | int tx_tailroom); |
128 | 136 | ||
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 9fcc680ab6b9..13174509cdfd 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -126,9 +126,10 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts, | |||
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | extern int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, | 129 | extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp, |
130 | struct nlattr *rate_tlv, struct tcf_exts *exts, | 130 | struct nlattr **tb, struct nlattr *rate_tlv, |
131 | const struct tcf_ext_map *map); | 131 | struct tcf_exts *exts, |
132 | const struct tcf_ext_map *map); | ||
132 | extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); | 133 | extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); |
133 | extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, | 134 | extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, |
134 | struct tcf_exts *src); | 135 | struct tcf_exts *src); |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 66f5ac370f92..388bf8b6d060 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -65,8 +65,14 @@ struct qdisc_watchdog { | |||
65 | }; | 65 | }; |
66 | 66 | ||
67 | extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); | 67 | extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); |
68 | extern void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, | 68 | extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires); |
69 | psched_time_t expires); | 69 | |
70 | static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, | ||
71 | psched_time_t expires) | ||
72 | { | ||
73 | qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires)); | ||
74 | } | ||
75 | |||
70 | extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); | 76 | extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); |
71 | 77 | ||
72 | extern struct Qdisc_ops pfifo_qdisc_ops; | 78 | extern struct Qdisc_ops pfifo_qdisc_ops; |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 7dcaa2794fde..f17ed590d64a 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -18,6 +18,7 @@ | |||
18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/rcupdate.h> | ||
21 | 22 | ||
22 | /** | 23 | /** |
23 | * enum environment_cap - Environment parsed from country IE | 24 | * enum environment_cap - Environment parsed from country IE |
@@ -35,6 +36,7 @@ enum environment_cap { | |||
35 | /** | 36 | /** |
36 | * struct regulatory_request - used to keep track of regulatory requests | 37 | * struct regulatory_request - used to keep track of regulatory requests |
37 | * | 38 | * |
39 | * @rcu_head: RCU head struct used to free the request | ||
38 | * @wiphy_idx: this is set if this request's initiator is | 40 | * @wiphy_idx: this is set if this request's initiator is |
39 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This | 41 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This |
40 | * can be used by the wireless core to deal with conflicts | 42 | * can be used by the wireless core to deal with conflicts |
@@ -72,6 +74,7 @@ enum environment_cap { | |||
72 | * @list: used to insert into the reg_requests_list linked list | 74 | * @list: used to insert into the reg_requests_list linked list |
73 | */ | 75 | */ |
74 | struct regulatory_request { | 76 | struct regulatory_request { |
77 | struct rcu_head rcu_head; | ||
75 | int wiphy_idx; | 78 | int wiphy_idx; |
76 | enum nl80211_reg_initiator initiator; | 79 | enum nl80211_reg_initiator initiator; |
77 | enum nl80211_user_reg_hint_type user_reg_hint_type; | 80 | enum nl80211_user_reg_hint_type user_reg_hint_type; |
@@ -101,6 +104,7 @@ struct ieee80211_reg_rule { | |||
101 | }; | 104 | }; |
102 | 105 | ||
103 | struct ieee80211_regdomain { | 106 | struct ieee80211_regdomain { |
107 | struct rcu_head rcu_head; | ||
104 | u32 n_reg_rules; | 108 | u32 n_reg_rules; |
105 | char alpha2[2]; | 109 | char alpha2[2]; |
106 | u8 dfs_region; | 110 | u8 dfs_region; |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 1540f9c2fcf4..2761c905504e 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -195,7 +195,7 @@ struct tcf_proto_ops { | |||
195 | 195 | ||
196 | unsigned long (*get)(struct tcf_proto*, u32 handle); | 196 | unsigned long (*get)(struct tcf_proto*, u32 handle); |
197 | void (*put)(struct tcf_proto*, unsigned long); | 197 | void (*put)(struct tcf_proto*, unsigned long); |
198 | int (*change)(struct sk_buff *, | 198 | int (*change)(struct net *net, struct sk_buff *, |
199 | struct tcf_proto*, unsigned long, | 199 | struct tcf_proto*, unsigned long, |
200 | u32 handle, struct nlattr **, | 200 | u32 handle, struct nlattr **, |
201 | unsigned long *); | 201 | unsigned long *); |
@@ -679,4 +679,23 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
679 | } | 679 | } |
680 | #endif | 680 | #endif |
681 | 681 | ||
682 | struct psched_ratecfg { | ||
683 | u64 rate_bps; | ||
684 | u32 mult; | ||
685 | u32 shift; | ||
686 | }; | ||
687 | |||
688 | static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, | ||
689 | unsigned int len) | ||
690 | { | ||
691 | return ((u64)len * r->mult) >> r->shift; | ||
692 | } | ||
693 | |||
694 | extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate); | ||
695 | |||
696 | static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r) | ||
697 | { | ||
698 | return r->rate_bps >> 3; | ||
699 | } | ||
700 | |||
682 | #endif | 701 | #endif |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index c29707d654c0..a7dd5c50df79 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -303,7 +303,7 @@ enum { SCTP_MAX_GABS = 16 }; | |||
303 | * to which we will raise the P-MTU. | 303 | * to which we will raise the P-MTU. |
304 | */ | 304 | */ |
305 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ | 305 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ |
306 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ | 306 | |
307 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ | 307 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ |
308 | 308 | ||
309 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ | 309 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index fdeb85a970fc..0e0f9d2322e3 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -1236,10 +1236,7 @@ struct sctp_endpoint { | |||
1236 | * Discussion in [RFC1750] can be helpful in | 1236 | * Discussion in [RFC1750] can be helpful in |
1237 | * selection of the key. | 1237 | * selection of the key. |
1238 | */ | 1238 | */ |
1239 | __u8 secret_key[SCTP_HOW_MANY_SECRETS][SCTP_SECRET_SIZE]; | 1239 | __u8 secret_key[SCTP_SECRET_SIZE]; |
1240 | int current_key; | ||
1241 | int last_key; | ||
1242 | int key_changed_at; | ||
1243 | 1240 | ||
1244 | /* digest: This is a digest of the sctp cookie. This field is | 1241 | /* digest: This is a digest of the sctp cookie. This field is |
1245 | * only used on the receive path when we try to validate | 1242 | * only used on the receive path when we try to validate |
diff --git a/include/net/sock.h b/include/net/sock.h index 182ca99405ad..a66caa223d18 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -140,6 +140,7 @@ typedef __u64 __bitwise __addrpair; | |||
140 | * @skc_family: network address family | 140 | * @skc_family: network address family |
141 | * @skc_state: Connection state | 141 | * @skc_state: Connection state |
142 | * @skc_reuse: %SO_REUSEADDR setting | 142 | * @skc_reuse: %SO_REUSEADDR setting |
143 | * @skc_reuseport: %SO_REUSEPORT setting | ||
143 | * @skc_bound_dev_if: bound device index if != 0 | 144 | * @skc_bound_dev_if: bound device index if != 0 |
144 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 145 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
145 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | 146 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol |
@@ -179,7 +180,8 @@ struct sock_common { | |||
179 | 180 | ||
180 | unsigned short skc_family; | 181 | unsigned short skc_family; |
181 | volatile unsigned char skc_state; | 182 | volatile unsigned char skc_state; |
182 | unsigned char skc_reuse; | 183 | unsigned char skc_reuse:4; |
184 | unsigned char skc_reuseport:4; | ||
183 | int skc_bound_dev_if; | 185 | int skc_bound_dev_if; |
184 | union { | 186 | union { |
185 | struct hlist_node skc_bind_node; | 187 | struct hlist_node skc_bind_node; |
@@ -297,6 +299,7 @@ struct sock { | |||
297 | #define sk_family __sk_common.skc_family | 299 | #define sk_family __sk_common.skc_family |
298 | #define sk_state __sk_common.skc_state | 300 | #define sk_state __sk_common.skc_state |
299 | #define sk_reuse __sk_common.skc_reuse | 301 | #define sk_reuse __sk_common.skc_reuse |
302 | #define sk_reuseport __sk_common.skc_reuseport | ||
300 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if | 303 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if |
301 | #define sk_bind_node __sk_common.skc_bind_node | 304 | #define sk_bind_node __sk_common.skc_bind_node |
302 | #define sk_prot __sk_common.skc_prot | 305 | #define sk_prot __sk_common.skc_prot |
@@ -337,7 +340,7 @@ struct sock { | |||
337 | #endif | 340 | #endif |
338 | unsigned long sk_flags; | 341 | unsigned long sk_flags; |
339 | struct dst_entry *sk_rx_dst; | 342 | struct dst_entry *sk_rx_dst; |
340 | struct dst_entry *sk_dst_cache; | 343 | struct dst_entry __rcu *sk_dst_cache; |
341 | spinlock_t sk_dst_lock; | 344 | spinlock_t sk_dst_lock; |
342 | atomic_t sk_wmem_alloc; | 345 | atomic_t sk_wmem_alloc; |
343 | atomic_t sk_omem_alloc; | 346 | atomic_t sk_omem_alloc; |
@@ -664,6 +667,7 @@ enum sock_flags { | |||
664 | * Will use last 4 bytes of packet sent from | 667 | * Will use last 4 bytes of packet sent from |
665 | * user-space instead. | 668 | * user-space instead. |
666 | */ | 669 | */ |
670 | SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */ | ||
667 | }; | 671 | }; |
668 | 672 | ||
669 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 673 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
@@ -1037,7 +1041,7 @@ static inline void sk_refcnt_debug_dec(struct sock *sk) | |||
1037 | sk->sk_prot->name, sk, atomic_read(&sk->sk_prot->socks)); | 1041 | sk->sk_prot->name, sk, atomic_read(&sk->sk_prot->socks)); |
1038 | } | 1042 | } |
1039 | 1043 | ||
1040 | inline void sk_refcnt_debug_release(const struct sock *sk) | 1044 | static inline void sk_refcnt_debug_release(const struct sock *sk) |
1041 | { | 1045 | { |
1042 | if (atomic_read(&sk->sk_refcnt) != 1) | 1046 | if (atomic_read(&sk->sk_refcnt) != 1) |
1043 | printk(KERN_DEBUG "Destruction of the %s socket %p delayed, refcnt=%d\n", | 1047 | printk(KERN_DEBUG "Destruction of the %s socket %p delayed, refcnt=%d\n", |
diff --git a/include/net/tcp.h b/include/net/tcp.h index aed42c785153..23f2e98d4b65 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -266,7 +266,6 @@ extern int sysctl_tcp_abort_on_overflow; | |||
266 | extern int sysctl_tcp_max_orphans; | 266 | extern int sysctl_tcp_max_orphans; |
267 | extern int sysctl_tcp_fack; | 267 | extern int sysctl_tcp_fack; |
268 | extern int sysctl_tcp_reordering; | 268 | extern int sysctl_tcp_reordering; |
269 | extern int sysctl_tcp_ecn; | ||
270 | extern int sysctl_tcp_dsack; | 269 | extern int sysctl_tcp_dsack; |
271 | extern int sysctl_tcp_wmem[3]; | 270 | extern int sysctl_tcp_wmem[3]; |
272 | extern int sysctl_tcp_rmem[3]; | 271 | extern int sysctl_tcp_rmem[3]; |
@@ -280,7 +279,6 @@ extern int sysctl_tcp_dma_copybreak; | |||
280 | extern int sysctl_tcp_nometrics_save; | 279 | extern int sysctl_tcp_nometrics_save; |
281 | extern int sysctl_tcp_moderate_rcvbuf; | 280 | extern int sysctl_tcp_moderate_rcvbuf; |
282 | extern int sysctl_tcp_tso_win_divisor; | 281 | extern int sysctl_tcp_tso_win_divisor; |
283 | extern int sysctl_tcp_abc; | ||
284 | extern int sysctl_tcp_mtu_probing; | 282 | extern int sysctl_tcp_mtu_probing; |
285 | extern int sysctl_tcp_base_mss; | 283 | extern int sysctl_tcp_base_mss; |
286 | extern int sysctl_tcp_workaround_signed_windows; | 284 | extern int sysctl_tcp_workaround_signed_windows; |
@@ -504,7 +502,8 @@ static inline __u32 cookie_v4_init_sequence(struct sock *sk, | |||
504 | #endif | 502 | #endif |
505 | 503 | ||
506 | extern __u32 cookie_init_timestamp(struct request_sock *req); | 504 | extern __u32 cookie_init_timestamp(struct request_sock *req); |
507 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); | 505 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, |
506 | struct net *net, bool *ecn_ok); | ||
508 | 507 | ||
509 | /* From net/ipv6/syncookies.c */ | 508 | /* From net/ipv6/syncookies.c */ |
510 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 509 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
@@ -728,11 +727,12 @@ struct tcp_skb_cb { | |||
728 | * notifications, we disable TCP ECN negociation. | 727 | * notifications, we disable TCP ECN negociation. |
729 | */ | 728 | */ |
730 | static inline void | 729 | static inline void |
731 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb) | 730 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb, |
731 | struct net *net) | ||
732 | { | 732 | { |
733 | const struct tcphdr *th = tcp_hdr(skb); | 733 | const struct tcphdr *th = tcp_hdr(skb); |
734 | 734 | ||
735 | if (sysctl_tcp_ecn && th->ece && th->cwr && | 735 | if (net->ipv4.sysctl_tcp_ecn && th->ece && th->cwr && |
736 | INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) | 736 | INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) |
737 | inet_rsk(req)->ecn_ok = 1; | 737 | inet_rsk(req)->ecn_ok = 1; |
738 | } | 738 | } |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 63445ede48bb..24c8886fd969 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -501,6 +501,12 @@ struct xfrm_policy_walk { | |||
501 | u32 seq; | 501 | u32 seq; |
502 | }; | 502 | }; |
503 | 503 | ||
504 | struct xfrm_policy_queue { | ||
505 | struct sk_buff_head hold_queue; | ||
506 | struct timer_list hold_timer; | ||
507 | unsigned long timeout; | ||
508 | }; | ||
509 | |||
504 | struct xfrm_policy { | 510 | struct xfrm_policy { |
505 | #ifdef CONFIG_NET_NS | 511 | #ifdef CONFIG_NET_NS |
506 | struct net *xp_net; | 512 | struct net *xp_net; |
@@ -522,6 +528,7 @@ struct xfrm_policy { | |||
522 | struct xfrm_lifetime_cfg lft; | 528 | struct xfrm_lifetime_cfg lft; |
523 | struct xfrm_lifetime_cur curlft; | 529 | struct xfrm_lifetime_cur curlft; |
524 | struct xfrm_policy_walk_entry walk; | 530 | struct xfrm_policy_walk_entry walk; |
531 | struct xfrm_policy_queue polq; | ||
525 | u8 type; | 532 | u8 type; |
526 | u8 action; | 533 | u8 action; |
527 | u8 flags; | 534 | u8 flags; |
@@ -557,10 +564,6 @@ struct xfrm_migrate { | |||
557 | }; | 564 | }; |
558 | 565 | ||
559 | #define XFRM_KM_TIMEOUT 30 | 566 | #define XFRM_KM_TIMEOUT 30 |
560 | /* which seqno */ | ||
561 | #define XFRM_REPLAY_SEQ 1 | ||
562 | #define XFRM_REPLAY_OSEQ 2 | ||
563 | #define XFRM_REPLAY_SEQ_MASK 3 | ||
564 | /* what happened */ | 567 | /* what happened */ |
565 | #define XFRM_REPLAY_UPDATE XFRM_AE_CR | 568 | #define XFRM_REPLAY_UPDATE XFRM_AE_CR |
566 | #define XFRM_REPLAY_TIMEOUT XFRM_AE_CE | 569 | #define XFRM_REPLAY_TIMEOUT XFRM_AE_CE |
@@ -1036,7 +1039,7 @@ static inline int | |||
1036 | __xfrm6_state_addr_cmp(const struct xfrm_tmpl *tmpl, const struct xfrm_state *x) | 1039 | __xfrm6_state_addr_cmp(const struct xfrm_tmpl *tmpl, const struct xfrm_state *x) |
1037 | { | 1040 | { |
1038 | return (!ipv6_addr_any((struct in6_addr*)&tmpl->saddr) && | 1041 | return (!ipv6_addr_any((struct in6_addr*)&tmpl->saddr) && |
1039 | ipv6_addr_cmp((struct in6_addr *)&tmpl->saddr, (struct in6_addr*)&x->props.saddr)); | 1042 | !ipv6_addr_equal((struct in6_addr *)&tmpl->saddr, (struct in6_addr*)&x->props.saddr)); |
1040 | } | 1043 | } |
1041 | 1044 | ||
1042 | static inline int | 1045 | static inline int |
@@ -1247,8 +1250,8 @@ static __inline__ int | |||
1247 | __xfrm6_state_addr_check(const struct xfrm_state *x, | 1250 | __xfrm6_state_addr_check(const struct xfrm_state *x, |
1248 | const xfrm_address_t *daddr, const xfrm_address_t *saddr) | 1251 | const xfrm_address_t *daddr, const xfrm_address_t *saddr) |
1249 | { | 1252 | { |
1250 | if (!ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) && | 1253 | if (ipv6_addr_equal((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) && |
1251 | (!ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr)|| | 1254 | (ipv6_addr_equal((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr) || |
1252 | ipv6_addr_any((struct in6_addr *)saddr) || | 1255 | ipv6_addr_any((struct in6_addr *)saddr) || |
1253 | ipv6_addr_any((struct in6_addr *)&x->props.saddr))) | 1256 | ipv6_addr_any((struct in6_addr *)&x->props.saddr))) |
1254 | return 1; | 1257 | return 1; |
@@ -1324,6 +1327,7 @@ struct xfrm_algo_desc { | |||
1324 | char *name; | 1327 | char *name; |
1325 | char *compat; | 1328 | char *compat; |
1326 | u8 available:1; | 1329 | u8 available:1; |
1330 | u8 pfkey_supported:1; | ||
1327 | union { | 1331 | union { |
1328 | struct xfrm_algo_aead_info aead; | 1332 | struct xfrm_algo_aead_info aead; |
1329 | struct xfrm_algo_auth_info auth; | 1333 | struct xfrm_algo_auth_info auth; |
@@ -1565,8 +1569,8 @@ extern void xfrm_input_init(void); | |||
1565 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); | 1569 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); |
1566 | 1570 | ||
1567 | extern void xfrm_probe_algs(void); | 1571 | extern void xfrm_probe_algs(void); |
1568 | extern int xfrm_count_auth_supported(void); | 1572 | extern int xfrm_count_pfkey_auth_supported(void); |
1569 | extern int xfrm_count_enc_supported(void); | 1573 | extern int xfrm_count_pfkey_enc_supported(void); |
1570 | extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); | 1574 | extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); |
1571 | extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); | 1575 | extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); |
1572 | extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); | 1576 | extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); |
@@ -1578,17 +1582,23 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe); | |||
1578 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, | 1582 | extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, |
1579 | int probe); | 1583 | int probe); |
1580 | 1584 | ||
1581 | static inline int xfrm_addr_cmp(const xfrm_address_t *a, | 1585 | static inline bool xfrm6_addr_equal(const xfrm_address_t *a, |
1582 | const xfrm_address_t *b, | 1586 | const xfrm_address_t *b) |
1583 | int family) | 1587 | { |
1588 | return ipv6_addr_equal((const struct in6_addr *)a, | ||
1589 | (const struct in6_addr *)b); | ||
1590 | } | ||
1591 | |||
1592 | static inline bool xfrm_addr_equal(const xfrm_address_t *a, | ||
1593 | const xfrm_address_t *b, | ||
1594 | sa_family_t family) | ||
1584 | { | 1595 | { |
1585 | switch (family) { | 1596 | switch (family) { |
1586 | default: | 1597 | default: |
1587 | case AF_INET: | 1598 | case AF_INET: |
1588 | return (__force u32)a->a4 - (__force u32)b->a4; | 1599 | return ((__force u32)a->a4 ^ (__force u32)b->a4) == 0; |
1589 | case AF_INET6: | 1600 | case AF_INET6: |
1590 | return ipv6_addr_cmp((const struct in6_addr *)a, | 1601 | return xfrm6_addr_equal(a, b); |
1591 | (const struct in6_addr *)b); | ||
1592 | } | 1602 | } |
1593 | } | 1603 | } |
1594 | 1604 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 46bc045bbe15..98cc4b29fc5b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -115,6 +115,8 @@ enum ib_device_cap_flags { | |||
115 | IB_DEVICE_XRC = (1<<20), | 115 | IB_DEVICE_XRC = (1<<20), |
116 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), | 116 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), |
117 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), | 117 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), |
118 | IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23), | ||
119 | IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24) | ||
118 | }; | 120 | }; |
119 | 121 | ||
120 | enum ib_atomic_cap { | 122 | enum ib_atomic_cap { |
@@ -715,6 +717,11 @@ enum ib_mig_state { | |||
715 | IB_MIG_ARMED | 717 | IB_MIG_ARMED |
716 | }; | 718 | }; |
717 | 719 | ||
720 | enum ib_mw_type { | ||
721 | IB_MW_TYPE_1 = 1, | ||
722 | IB_MW_TYPE_2 = 2 | ||
723 | }; | ||
724 | |||
718 | struct ib_qp_attr { | 725 | struct ib_qp_attr { |
719 | enum ib_qp_state qp_state; | 726 | enum ib_qp_state qp_state; |
720 | enum ib_qp_state cur_qp_state; | 727 | enum ib_qp_state cur_qp_state; |
@@ -758,6 +765,7 @@ enum ib_wr_opcode { | |||
758 | IB_WR_FAST_REG_MR, | 765 | IB_WR_FAST_REG_MR, |
759 | IB_WR_MASKED_ATOMIC_CMP_AND_SWP, | 766 | IB_WR_MASKED_ATOMIC_CMP_AND_SWP, |
760 | IB_WR_MASKED_ATOMIC_FETCH_AND_ADD, | 767 | IB_WR_MASKED_ATOMIC_FETCH_AND_ADD, |
768 | IB_WR_BIND_MW, | ||
761 | }; | 769 | }; |
762 | 770 | ||
763 | enum ib_send_flags { | 771 | enum ib_send_flags { |
@@ -780,6 +788,23 @@ struct ib_fast_reg_page_list { | |||
780 | unsigned int max_page_list_len; | 788 | unsigned int max_page_list_len; |
781 | }; | 789 | }; |
782 | 790 | ||
791 | /** | ||
792 | * struct ib_mw_bind_info - Parameters for a memory window bind operation. | ||
793 | * @mr: A memory region to bind the memory window to. | ||
794 | * @addr: The address where the memory window should begin. | ||
795 | * @length: The length of the memory window, in bytes. | ||
796 | * @mw_access_flags: Access flags from enum ib_access_flags for the window. | ||
797 | * | ||
798 | * This struct contains the shared parameters for type 1 and type 2 | ||
799 | * memory window bind operations. | ||
800 | */ | ||
801 | struct ib_mw_bind_info { | ||
802 | struct ib_mr *mr; | ||
803 | u64 addr; | ||
804 | u64 length; | ||
805 | int mw_access_flags; | ||
806 | }; | ||
807 | |||
783 | struct ib_send_wr { | 808 | struct ib_send_wr { |
784 | struct ib_send_wr *next; | 809 | struct ib_send_wr *next; |
785 | u64 wr_id; | 810 | u64 wr_id; |
@@ -823,6 +848,12 @@ struct ib_send_wr { | |||
823 | int access_flags; | 848 | int access_flags; |
824 | u32 rkey; | 849 | u32 rkey; |
825 | } fast_reg; | 850 | } fast_reg; |
851 | struct { | ||
852 | struct ib_mw *mw; | ||
853 | /* The new rkey for the memory window. */ | ||
854 | u32 rkey; | ||
855 | struct ib_mw_bind_info bind_info; | ||
856 | } bind_mw; | ||
826 | } wr; | 857 | } wr; |
827 | u32 xrc_remote_srq_num; /* XRC TGT QPs only */ | 858 | u32 xrc_remote_srq_num; /* XRC TGT QPs only */ |
828 | }; | 859 | }; |
@@ -839,7 +870,8 @@ enum ib_access_flags { | |||
839 | IB_ACCESS_REMOTE_WRITE = (1<<1), | 870 | IB_ACCESS_REMOTE_WRITE = (1<<1), |
840 | IB_ACCESS_REMOTE_READ = (1<<2), | 871 | IB_ACCESS_REMOTE_READ = (1<<2), |
841 | IB_ACCESS_REMOTE_ATOMIC = (1<<3), | 872 | IB_ACCESS_REMOTE_ATOMIC = (1<<3), |
842 | IB_ACCESS_MW_BIND = (1<<4) | 873 | IB_ACCESS_MW_BIND = (1<<4), |
874 | IB_ZERO_BASED = (1<<5) | ||
843 | }; | 875 | }; |
844 | 876 | ||
845 | struct ib_phys_buf { | 877 | struct ib_phys_buf { |
@@ -862,13 +894,16 @@ enum ib_mr_rereg_flags { | |||
862 | IB_MR_REREG_ACCESS = (1<<2) | 894 | IB_MR_REREG_ACCESS = (1<<2) |
863 | }; | 895 | }; |
864 | 896 | ||
897 | /** | ||
898 | * struct ib_mw_bind - Parameters for a type 1 memory window bind operation. | ||
899 | * @wr_id: Work request id. | ||
900 | * @send_flags: Flags from ib_send_flags enum. | ||
901 | * @bind_info: More parameters of the bind operation. | ||
902 | */ | ||
865 | struct ib_mw_bind { | 903 | struct ib_mw_bind { |
866 | struct ib_mr *mr; | 904 | u64 wr_id; |
867 | u64 wr_id; | 905 | int send_flags; |
868 | u64 addr; | 906 | struct ib_mw_bind_info bind_info; |
869 | u32 length; | ||
870 | int send_flags; | ||
871 | int mw_access_flags; | ||
872 | }; | 907 | }; |
873 | 908 | ||
874 | struct ib_fmr_attr { | 909 | struct ib_fmr_attr { |
@@ -991,6 +1026,7 @@ struct ib_mw { | |||
991 | struct ib_pd *pd; | 1026 | struct ib_pd *pd; |
992 | struct ib_uobject *uobject; | 1027 | struct ib_uobject *uobject; |
993 | u32 rkey; | 1028 | u32 rkey; |
1029 | enum ib_mw_type type; | ||
994 | }; | 1030 | }; |
995 | 1031 | ||
996 | struct ib_fmr { | 1032 | struct ib_fmr { |
@@ -1202,7 +1238,8 @@ struct ib_device { | |||
1202 | int num_phys_buf, | 1238 | int num_phys_buf, |
1203 | int mr_access_flags, | 1239 | int mr_access_flags, |
1204 | u64 *iova_start); | 1240 | u64 *iova_start); |
1205 | struct ib_mw * (*alloc_mw)(struct ib_pd *pd); | 1241 | struct ib_mw * (*alloc_mw)(struct ib_pd *pd, |
1242 | enum ib_mw_type type); | ||
1206 | int (*bind_mw)(struct ib_qp *qp, | 1243 | int (*bind_mw)(struct ib_qp *qp, |
1207 | struct ib_mw *mw, | 1244 | struct ib_mw *mw, |
1208 | struct ib_mw_bind *mw_bind); | 1245 | struct ib_mw_bind *mw_bind); |
@@ -2019,6 +2056,8 @@ int ib_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr); | |||
2019 | * ib_dereg_mr - Deregisters a memory region and removes it from the | 2056 | * ib_dereg_mr - Deregisters a memory region and removes it from the |
2020 | * HCA translation table. | 2057 | * HCA translation table. |
2021 | * @mr: The memory region to deregister. | 2058 | * @mr: The memory region to deregister. |
2059 | * | ||
2060 | * This function can fail, if the memory region has memory windows bound to it. | ||
2022 | */ | 2061 | */ |
2023 | int ib_dereg_mr(struct ib_mr *mr); | 2062 | int ib_dereg_mr(struct ib_mr *mr); |
2024 | 2063 | ||
@@ -2071,10 +2110,22 @@ static inline void ib_update_fast_reg_key(struct ib_mr *mr, u8 newkey) | |||
2071 | } | 2110 | } |
2072 | 2111 | ||
2073 | /** | 2112 | /** |
2113 | * ib_inc_rkey - increments the key portion of the given rkey. Can be used | ||
2114 | * for calculating a new rkey for type 2 memory windows. | ||
2115 | * @rkey - the rkey to increment. | ||
2116 | */ | ||
2117 | static inline u32 ib_inc_rkey(u32 rkey) | ||
2118 | { | ||
2119 | const u32 mask = 0x000000ff; | ||
2120 | return ((rkey + 1) & mask) | (rkey & ~mask); | ||
2121 | } | ||
2122 | |||
2123 | /** | ||
2074 | * ib_alloc_mw - Allocates a memory window. | 2124 | * ib_alloc_mw - Allocates a memory window. |
2075 | * @pd: The protection domain associated with the memory window. | 2125 | * @pd: The protection domain associated with the memory window. |
2126 | * @type: The type of the memory window (1 or 2). | ||
2076 | */ | 2127 | */ |
2077 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd); | 2128 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd, enum ib_mw_type type); |
2078 | 2129 | ||
2079 | /** | 2130 | /** |
2080 | * ib_bind_mw - Posts a work request to the send queue of the specified | 2131 | * ib_bind_mw - Posts a work request to the send queue of the specified |
@@ -2084,6 +2135,10 @@ struct ib_mw *ib_alloc_mw(struct ib_pd *pd); | |||
2084 | * @mw: The memory window to bind. | 2135 | * @mw: The memory window to bind. |
2085 | * @mw_bind: Specifies information about the memory window, including | 2136 | * @mw_bind: Specifies information about the memory window, including |
2086 | * its address range, remote access rights, and associated memory region. | 2137 | * its address range, remote access rights, and associated memory region. |
2138 | * | ||
2139 | * If there is no immediate error, the function will update the rkey member | ||
2140 | * of the mw parameter to its new value. The bind operation can still fail | ||
2141 | * asynchronously. | ||
2087 | */ | 2142 | */ |
2088 | static inline int ib_bind_mw(struct ib_qp *qp, | 2143 | static inline int ib_bind_mw(struct ib_qp *qp, |
2089 | struct ib_mw *mw, | 2144 | struct ib_mw *mw, |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e82c5a..a7f9cba275e9 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -157,10 +157,11 @@ struct scsi_device { | |||
157 | unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */ | 157 | unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */ |
158 | unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ | 158 | unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ |
159 | unsigned is_visible:1; /* is the device visible in sysfs */ | 159 | unsigned is_visible:1; /* is the device visible in sysfs */ |
160 | unsigned can_power_off:1; /* Device supports runtime power off */ | ||
161 | unsigned wce_default_on:1; /* Cache is ON by default */ | 160 | unsigned wce_default_on:1; /* Cache is ON by default */ |
162 | unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ | 161 | unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ |
163 | 162 | ||
163 | atomic_t disk_events_disable_depth; /* disable depth for disk events */ | ||
164 | |||
164 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 165 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
165 | struct list_head event_list; /* asserted events */ | 166 | struct list_head event_list; /* asserted events */ |
166 | struct work_struct event_work; | 167 | struct work_struct event_work; |
@@ -397,6 +398,8 @@ extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, | |||
397 | int data_direction, void *buffer, unsigned bufflen, | 398 | int data_direction, void *buffer, unsigned bufflen, |
398 | struct scsi_sense_hdr *, int timeout, int retries, | 399 | struct scsi_sense_hdr *, int timeout, int retries, |
399 | int *resid); | 400 | int *resid); |
401 | extern void sdev_disable_disk_events(struct scsi_device *sdev); | ||
402 | extern void sdev_enable_disk_events(struct scsi_device *sdev); | ||
400 | 403 | ||
401 | #ifdef CONFIG_PM_RUNTIME | 404 | #ifdef CONFIG_PM_RUNTIME |
402 | extern int scsi_autopm_get_device(struct scsi_device *); | 405 | extern int scsi_autopm_get_device(struct scsi_device *); |
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index f2912abacdf3..ff6c74153fa1 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h | |||
@@ -71,6 +71,8 @@ struct snd_compr_runtime { | |||
71 | * @runtime: pointer to runtime structure | 71 | * @runtime: pointer to runtime structure |
72 | * @device: device pointer | 72 | * @device: device pointer |
73 | * @direction: stream direction, playback/recording | 73 | * @direction: stream direction, playback/recording |
74 | * @metadata_set: metadata set flag, true when set | ||
75 | * @next_track: has userspace signall next track transistion, true when set | ||
74 | * @private_data: pointer to DSP private data | 76 | * @private_data: pointer to DSP private data |
75 | */ | 77 | */ |
76 | struct snd_compr_stream { | 78 | struct snd_compr_stream { |
@@ -79,6 +81,8 @@ struct snd_compr_stream { | |||
79 | struct snd_compr_runtime *runtime; | 81 | struct snd_compr_runtime *runtime; |
80 | struct snd_compr *device; | 82 | struct snd_compr *device; |
81 | enum snd_compr_direction direction; | 83 | enum snd_compr_direction direction; |
84 | bool metadata_set; | ||
85 | bool next_track; | ||
82 | void *private_data; | 86 | void *private_data; |
83 | }; | 87 | }; |
84 | 88 | ||
@@ -110,6 +114,10 @@ struct snd_compr_ops { | |||
110 | struct snd_compr_params *params); | 114 | struct snd_compr_params *params); |
111 | int (*get_params)(struct snd_compr_stream *stream, | 115 | int (*get_params)(struct snd_compr_stream *stream, |
112 | struct snd_codec *params); | 116 | struct snd_codec *params); |
117 | int (*set_metadata)(struct snd_compr_stream *stream, | ||
118 | struct snd_compr_metadata *metadata); | ||
119 | int (*get_metadata)(struct snd_compr_stream *stream, | ||
120 | struct snd_compr_metadata *metadata); | ||
113 | int (*trigger)(struct snd_compr_stream *stream, int cmd); | 121 | int (*trigger)(struct snd_compr_stream *stream, int cmd); |
114 | int (*pointer)(struct snd_compr_stream *stream, | 122 | int (*pointer)(struct snd_compr_stream *stream, |
115 | struct snd_compr_tstamp *tstamp); | 123 | struct snd_compr_tstamp *tstamp); |
diff --git a/include/sound/core.h b/include/sound/core.h index 93896ad1fcdd..7cede2d6aa86 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -394,8 +394,11 @@ void __snd_printk(unsigned int level, const char *file, int line, | |||
394 | 394 | ||
395 | #else /* !CONFIG_SND_DEBUG */ | 395 | #else /* !CONFIG_SND_DEBUG */ |
396 | 396 | ||
397 | #define snd_printd(fmt, args...) do { } while (0) | 397 | __printf(1, 2) |
398 | #define _snd_printd(level, fmt, args...) do { } while (0) | 398 | static inline void snd_printd(const char *format, ...) {} |
399 | __printf(2, 3) | ||
400 | static inline void _snd_printd(int level, const char *format, ...) {} | ||
401 | |||
399 | #define snd_BUG() do { } while (0) | 402 | #define snd_BUG() do { } while (0) |
400 | static inline int __snd_bug_on(int cond) | 403 | static inline int __snd_bug_on(int cond) |
401 | { | 404 | { |
@@ -416,7 +419,8 @@ static inline int __snd_bug_on(int cond) | |||
416 | #define snd_printdd(format, args...) \ | 419 | #define snd_printdd(format, args...) \ |
417 | __snd_printk(2, __FILE__, __LINE__, format, ##args) | 420 | __snd_printk(2, __FILE__, __LINE__, format, ##args) |
418 | #else | 421 | #else |
419 | #define snd_printdd(format, args...) do { } while (0) | 422 | __printf(1, 2) |
423 | static inline void snd_printdd(const char *format, ...) {} | ||
420 | #endif | 424 | #endif |
421 | 425 | ||
422 | 426 | ||
@@ -454,6 +458,7 @@ struct snd_pci_quirk { | |||
454 | #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \ | 458 | #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \ |
455 | {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \ | 459 | {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \ |
456 | .value = (val), .name = (xname)} | 460 | .value = (val), .name = (xname)} |
461 | #define snd_pci_quirk_name(q) ((q)->name) | ||
457 | #else | 462 | #else |
458 | #define SND_PCI_QUIRK(vend,dev,xname,val) \ | 463 | #define SND_PCI_QUIRK(vend,dev,xname,val) \ |
459 | {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)} | 464 | {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)} |
@@ -461,6 +466,7 @@ struct snd_pci_quirk { | |||
461 | {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)} | 466 | {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)} |
462 | #define SND_PCI_QUIRK_VENDOR(vend, xname, val) \ | 467 | #define SND_PCI_QUIRK_VENDOR(vend, xname, val) \ |
463 | {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)} | 468 | {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)} |
469 | #define snd_pci_quirk_name(q) "" | ||
464 | #endif | 470 | #endif |
465 | 471 | ||
466 | const struct snd_pci_quirk * | 472 | const struct snd_pci_quirk * |
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h index dd8c48d14ed9..70f45355acaa 100644 --- a/include/sound/cs4271.h +++ b/include/sound/cs4271.h | |||
@@ -20,6 +20,21 @@ | |||
20 | struct cs4271_platform_data { | 20 | struct cs4271_platform_data { |
21 | int gpio_nreset; /* GPIO driving Reset pin, if any */ | 21 | int gpio_nreset; /* GPIO driving Reset pin, if any */ |
22 | bool amutec_eq_bmutec; /* flag to enable AMUTEC=BMUTEC */ | 22 | bool amutec_eq_bmutec; /* flag to enable AMUTEC=BMUTEC */ |
23 | |||
24 | /* | ||
25 | * The CS4271 requires its LRCLK and MCLK to be stable before its RESET | ||
26 | * line is de-asserted. That also means that clocks cannot be changed | ||
27 | * without putting the chip back into hardware reset, which also requires | ||
28 | * a complete re-initialization of all registers. | ||
29 | * | ||
30 | * One (undocumented) workaround is to assert and de-assert the PDN bit | ||
31 | * in the MODE2 register. This workaround can be enabled with the | ||
32 | * following flag. | ||
33 | * | ||
34 | * Note that this is not needed in case the clocks are stable | ||
35 | * throughout the entire runtime of the codec. | ||
36 | */ | ||
37 | bool enable_soft_reset; | ||
23 | }; | 38 | }; |
24 | 39 | ||
25 | #endif /* __CS4271_H */ | 40 | #endif /* __CS4271_H */ |
diff --git a/include/sound/da7213.h b/include/sound/da7213.h new file mode 100644 index 000000000000..673f5c39cbf2 --- /dev/null +++ b/include/sound/da7213.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * da7213.h - DA7213 ASoC Codec Driver Platform Data | ||
3 | * | ||
4 | * Copyright (c) 2013 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 | ||
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 _DA7213_PDATA_H | ||
14 | #define _DA7213_PDATA_H | ||
15 | |||
16 | enum da7213_micbias_voltage { | ||
17 | DA7213_MICBIAS_1_6V = 0, | ||
18 | DA7213_MICBIAS_2_2V = 1, | ||
19 | DA7213_MICBIAS_2_5V = 2, | ||
20 | DA7213_MICBIAS_3_0V = 3, | ||
21 | }; | ||
22 | |||
23 | enum da7213_dmic_data_sel { | ||
24 | DA7213_DMIC_DATA_LRISE_RFALL = 0, | ||
25 | DA7213_DMIC_DATA_LFALL_RRISE = 1, | ||
26 | }; | ||
27 | |||
28 | enum da7213_dmic_samplephase { | ||
29 | DA7213_DMIC_SAMPLE_ON_CLKEDGE = 0, | ||
30 | DA7213_DMIC_SAMPLE_BETWEEN_CLKEDGE = 1, | ||
31 | }; | ||
32 | |||
33 | enum da7213_dmic_clk_rate { | ||
34 | DA7213_DMIC_CLK_3_0MHZ = 0, | ||
35 | DA7213_DMIC_CLK_1_5MHZ = 1, | ||
36 | }; | ||
37 | |||
38 | struct da7213_platform_data { | ||
39 | /* Mic Bias voltage */ | ||
40 | enum da7213_micbias_voltage micbias1_lvl; | ||
41 | enum da7213_micbias_voltage micbias2_lvl; | ||
42 | |||
43 | /* DMIC config */ | ||
44 | enum da7213_dmic_data_sel dmic_data_sel; | ||
45 | enum da7213_dmic_samplephase dmic_samplephase; | ||
46 | enum da7213_dmic_clk_rate dmic_clk_rate; | ||
47 | |||
48 | /* MCLK squaring config */ | ||
49 | bool mclk_squaring; | ||
50 | }; | ||
51 | |||
52 | #endif /* _DA7213_PDATA_H */ | ||
diff --git a/include/sound/max98090.h b/include/sound/max98090.h new file mode 100755 index 000000000000..95efb13f8478 --- /dev/null +++ b/include/sound/max98090.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Platform data for MAX98090 | ||
3 | * | ||
4 | * Copyright 2011-2012 Maxim Integrated Products | ||
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 | |||
13 | #ifndef __SOUND_MAX98090_PDATA_H__ | ||
14 | #define __SOUND_MAX98090_PDATA_H__ | ||
15 | |||
16 | /* codec platform data */ | ||
17 | struct max98090_pdata { | ||
18 | |||
19 | /* Analog/digital microphone configuration: | ||
20 | * 0 = analog microphone input (normal setting) | ||
21 | * 1 = digital microphone input | ||
22 | */ | ||
23 | unsigned int digmic_left_mode:1; | ||
24 | unsigned int digmic_right_mode:1; | ||
25 | unsigned int digmic_3_mode:1; | ||
26 | unsigned int digmic_4_mode:1; | ||
27 | }; | ||
28 | |||
29 | #endif | ||
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 844af65af626..cf15b8213df7 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -37,7 +37,7 @@ struct snd_dma_device { | |||
37 | #ifndef snd_dma_pci_data | 37 | #ifndef snd_dma_pci_data |
38 | #define snd_dma_pci_data(pci) (&(pci)->dev) | 38 | #define snd_dma_pci_data(pci) (&(pci)->dev) |
39 | #define snd_dma_isa_data() NULL | 39 | #define snd_dma_isa_data() NULL |
40 | #define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x)) | 40 | #define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x)) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | 43 | ||
diff --git a/include/sound/saif.h b/include/sound/saif.h deleted file mode 100644 index f22f3e16edf4..000000000000 --- a/include/sound/saif.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Freescale Semiconductor, Inc. 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 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __SOUND_SAIF_H__ | ||
10 | #define __SOUND_SAIF_H__ | ||
11 | |||
12 | struct mxs_saif_platform_data { | ||
13 | bool master_mode; /* if true use master mode */ | ||
14 | int master_id; /* id of the master if in slave mode */ | ||
15 | }; | ||
16 | #endif | ||
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index cc1c919c6436..7a9710b4b799 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h | |||
@@ -11,82 +11,20 @@ | |||
11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | |||
15 | #define FSI_PORT_A 0 | ||
16 | #define FSI_PORT_B 1 | ||
17 | |||
18 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
19 | #include <sound/soc.h> | 15 | #include <sound/soc.h> |
20 | 16 | ||
21 | /* | 17 | /* |
22 | * flags format | 18 | * flags |
23 | * | ||
24 | * 0x00000CBA | ||
25 | * | ||
26 | * A: inversion | ||
27 | * B: format mode | ||
28 | * C: chip specific | ||
29 | * D: clock selecter if master mode | ||
30 | */ | 19 | */ |
31 | 20 | #define SH_FSI_FMT_SPDIF (1 << 0) /* spdif for HDMI */ | |
32 | /* A: clock inversion */ | 21 | #define SH_FSI_ENABLE_STREAM_MODE (1 << 1) /* for 16bit data */ |
33 | #define SH_FSI_INVERSION_MASK 0x0000000F | 22 | #define SH_FSI_CLK_CPG (1 << 2) /* FSIxCK + FSI-DIV */ |
34 | #define SH_FSI_LRM_INV (1 << 0) | ||
35 | #define SH_FSI_BRM_INV (1 << 1) | ||
36 | #define SH_FSI_LRS_INV (1 << 2) | ||
37 | #define SH_FSI_BRS_INV (1 << 3) | ||
38 | |||
39 | /* B: format mode */ | ||
40 | #define SH_FSI_FMT_MASK 0x000000F0 | ||
41 | #define SH_FSI_FMT_DAI (0 << 4) | ||
42 | #define SH_FSI_FMT_SPDIF (1 << 4) | ||
43 | |||
44 | /* C: chip specific */ | ||
45 | #define SH_FSI_OPTION_MASK 0x00000F00 | ||
46 | #define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */ | ||
47 | |||
48 | /* D: clock selecter if master mode */ | ||
49 | #define SH_FSI_CLK_MASK 0x0000F000 | ||
50 | #define SH_FSI_CLK_EXTERNAL (0 << 12) | ||
51 | #define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */ | ||
52 | |||
53 | /* | ||
54 | * set_rate return value | ||
55 | * | ||
56 | * see ACKMD/BPFMD on | ||
57 | * ACK_MD (FSI2) | ||
58 | * CKG1 (FSI) | ||
59 | * | ||
60 | * err : return value < 0 | ||
61 | * no change : return value == 0 | ||
62 | * change xMD : return value > 0 | ||
63 | * | ||
64 | * 0x-00000AB | ||
65 | * | ||
66 | * A: ACKMD value | ||
67 | * B: BPFMD value | ||
68 | */ | ||
69 | |||
70 | #define SH_FSI_ACKMD_MASK (0xF << 0) | ||
71 | #define SH_FSI_ACKMD_512 (1 << 0) | ||
72 | #define SH_FSI_ACKMD_256 (2 << 0) | ||
73 | #define SH_FSI_ACKMD_128 (3 << 0) | ||
74 | #define SH_FSI_ACKMD_64 (4 << 0) | ||
75 | #define SH_FSI_ACKMD_32 (5 << 0) | ||
76 | |||
77 | #define SH_FSI_BPFMD_MASK (0xF << 4) | ||
78 | #define SH_FSI_BPFMD_512 (1 << 4) | ||
79 | #define SH_FSI_BPFMD_256 (2 << 4) | ||
80 | #define SH_FSI_BPFMD_128 (3 << 4) | ||
81 | #define SH_FSI_BPFMD_64 (4 << 4) | ||
82 | #define SH_FSI_BPFMD_32 (5 << 4) | ||
83 | #define SH_FSI_BPFMD_16 (6 << 4) | ||
84 | 23 | ||
85 | struct sh_fsi_port_info { | 24 | struct sh_fsi_port_info { |
86 | unsigned long flags; | 25 | unsigned long flags; |
87 | int tx_id; | 26 | int tx_id; |
88 | int rx_id; | 27 | int rx_id; |
89 | int (*set_rate)(struct device *dev, int rate, int enable); | ||
90 | }; | 28 | }; |
91 | 29 | ||
92 | struct sh_fsi_platform_info { | 30 | struct sh_fsi_platform_info { |
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h index 4b62b8dc6a4f..6c74527d4926 100644 --- a/include/sound/simple_card.h +++ b/include/sound/simple_card.h | |||
@@ -14,21 +14,21 @@ | |||
14 | 14 | ||
15 | #include <sound/soc.h> | 15 | #include <sound/soc.h> |
16 | 16 | ||
17 | struct asoc_simple_dai_init_info { | 17 | struct asoc_simple_dai { |
18 | const char *name; | ||
18 | unsigned int fmt; | 19 | unsigned int fmt; |
19 | unsigned int cpu_daifmt; | ||
20 | unsigned int codec_daifmt; | ||
21 | unsigned int sysclk; | 20 | unsigned int sysclk; |
22 | }; | 21 | }; |
23 | 22 | ||
24 | struct asoc_simple_card_info { | 23 | struct asoc_simple_card_info { |
25 | const char *name; | 24 | const char *name; |
26 | const char *card; | 25 | const char *card; |
27 | const char *cpu_dai; | ||
28 | const char *codec; | 26 | const char *codec; |
29 | const char *platform; | 27 | const char *platform; |
30 | const char *codec_dai; | 28 | |
31 | struct asoc_simple_dai_init_info *init; /* for snd_link.init */ | 29 | unsigned int daifmt; |
30 | struct asoc_simple_dai cpu_dai; | ||
31 | struct asoc_simple_dai codec_dai; | ||
32 | 32 | ||
33 | /* used in simple-card.c */ | 33 | /* used in simple-card.c */ |
34 | struct snd_soc_dai_link snd_link; | 34 | struct snd_soc_dai_link snd_link; |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 3953cea0ecfb..3d84808952b9 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -45,7 +45,7 @@ struct snd_compr_stream; | |||
45 | * sending or receiving PCM data in a frame. This can be used to save power. | 45 | * sending or receiving PCM data in a frame. This can be used to save power. |
46 | */ | 46 | */ |
47 | #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ | 47 | #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ |
48 | #define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */ | 48 | #define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */ |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * DAI hardware signal inversions. | 51 | * DAI hardware signal inversions. |
@@ -53,7 +53,7 @@ struct snd_compr_stream; | |||
53 | * Specifies whether the DAI can also support inverted clocks for the specified | 53 | * Specifies whether the DAI can also support inverted clocks for the specified |
54 | * format. | 54 | * format. |
55 | */ | 55 | */ |
56 | #define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */ | 56 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
57 | #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ | 57 | #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ |
58 | #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ | 58 | #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ |
59 | #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ | 59 | #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ |
@@ -126,7 +126,8 @@ int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, | |||
126 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 126 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
127 | 127 | ||
128 | /* Digital Audio Interface mute */ | 128 | /* Digital Audio Interface mute */ |
129 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | 129 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, |
130 | int direction); | ||
130 | 131 | ||
131 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
132 | /* | 133 | /* |
@@ -157,6 +158,7 @@ struct snd_soc_dai_ops { | |||
157 | * Called by soc-core to minimise any pops. | 158 | * Called by soc-core to minimise any pops. |
158 | */ | 159 | */ |
159 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); | 160 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); |
161 | int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream); | ||
160 | 162 | ||
161 | /* | 163 | /* |
162 | * ALSA PCM audio operations - all optional. | 164 | * ALSA PCM audio operations - all optional. |
diff --git a/include/sound/soc.h b/include/sound/soc.h index bc56738cb109..a6a059ca3874 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -906,8 +906,8 @@ struct snd_soc_dai_link { | |||
906 | struct snd_pcm_hw_params *params); | 906 | struct snd_pcm_hw_params *params); |
907 | 907 | ||
908 | /* machine stream operations */ | 908 | /* machine stream operations */ |
909 | struct snd_soc_ops *ops; | 909 | const struct snd_soc_ops *ops; |
910 | struct snd_soc_compr_ops *compr_ops; | 910 | const struct snd_soc_compr_ops *compr_ops; |
911 | }; | 911 | }; |
912 | 912 | ||
913 | struct snd_soc_codec_conf { | 913 | struct snd_soc_codec_conf { |
@@ -1171,6 +1171,8 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, | |||
1171 | const char *propname); | 1171 | const char *propname); |
1172 | int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, | 1172 | int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, |
1173 | const char *propname); | 1173 | const char *propname); |
1174 | unsigned int snd_soc_of_parse_daifmt(struct device_node *np, | ||
1175 | const char *prefix); | ||
1174 | 1176 | ||
1175 | #include <sound/soc-dai.h> | 1177 | #include <sound/soc-dai.h> |
1176 | 1178 | ||
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h index ffd9bc793105..9407fd00363b 100644 --- a/include/sound/tlv320aic3x.h +++ b/include/sound/tlv320aic3x.h | |||
@@ -46,6 +46,13 @@ enum { | |||
46 | AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 | 46 | AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 |
47 | }; | 47 | }; |
48 | 48 | ||
49 | enum aic3x_micbias_voltage { | ||
50 | AIC3X_MICBIAS_OFF = 0, | ||
51 | AIC3X_MICBIAS_2_0V = 1, | ||
52 | AIC3X_MICBIAS_2_5V = 2, | ||
53 | AIC3X_MICBIAS_AVDDV = 3, | ||
54 | }; | ||
55 | |||
49 | struct aic3x_setup_data { | 56 | struct aic3x_setup_data { |
50 | unsigned int gpio_func[2]; | 57 | unsigned int gpio_func[2]; |
51 | }; | 58 | }; |
@@ -53,6 +60,9 @@ struct aic3x_setup_data { | |||
53 | struct aic3x_pdata { | 60 | struct aic3x_pdata { |
54 | int gpio_reset; /* < 0 if not used */ | 61 | int gpio_reset; /* < 0 if not used */ |
55 | struct aic3x_setup_data *setup; | 62 | struct aic3x_setup_data *setup; |
63 | |||
64 | /* Selects the micbias voltage */ | ||
65 | enum aic3x_micbias_voltage micbias_vg; | ||
56 | }; | 66 | }; |
57 | 67 | ||
58 | #endif | 68 | #endif |
diff --git a/include/sound/wm2000.h b/include/sound/wm2000.h index aa388ca9ec64..4de81f41c90f 100644 --- a/include/sound/wm2000.h +++ b/include/sound/wm2000.h | |||
@@ -15,9 +15,6 @@ struct wm2000_platform_data { | |||
15 | /** Filename for system-specific image to download to device. */ | 15 | /** Filename for system-specific image to download to device. */ |
16 | const char *download_file; | 16 | const char *download_file; |
17 | 17 | ||
18 | /** Divide MCLK by 2 for system clock? */ | ||
19 | unsigned int mclkdiv2:1; | ||
20 | |||
21 | /** Disable speech clarity enhancement, for use when an | 18 | /** Disable speech clarity enhancement, for use when an |
22 | * external algorithm is used. */ | 19 | * external algorithm is used. */ |
23 | unsigned int speech_enh_disable:1; | 20 | unsigned int speech_enh_disable:1; |
diff --git a/include/sound/wm2200.h b/include/sound/wm2200.h index 79bf55be7ffa..bc7ab1a4b480 100644 --- a/include/sound/wm2200.h +++ b/include/sound/wm2200.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define __LINUX_SND_WM2200_H | 12 | #define __LINUX_SND_WM2200_H |
13 | 13 | ||
14 | #define WM2200_GPIO_SET 0x10000 | 14 | #define WM2200_GPIO_SET 0x10000 |
15 | #define WM2200_MAX_MICBIAS 2 | ||
15 | 16 | ||
16 | enum wm2200_in_mode { | 17 | enum wm2200_in_mode { |
17 | WM2200_IN_SE = 0, | 18 | WM2200_IN_SE = 0, |
@@ -25,6 +26,24 @@ enum wm2200_dmic_sup { | |||
25 | WM2200_DMIC_SUP_MICBIAS2 = 2, | 26 | WM2200_DMIC_SUP_MICBIAS2 = 2, |
26 | }; | 27 | }; |
27 | 28 | ||
29 | enum wm2200_mbias_lvl { | ||
30 | WM2200_MBIAS_LVL_1V5 = 1, | ||
31 | WM2200_MBIAS_LVL_1V8 = 2, | ||
32 | WM2200_MBIAS_LVL_1V9 = 3, | ||
33 | WM2200_MBIAS_LVL_2V0 = 4, | ||
34 | WM2200_MBIAS_LVL_2V2 = 5, | ||
35 | WM2200_MBIAS_LVL_2V4 = 6, | ||
36 | WM2200_MBIAS_LVL_2V5 = 7, | ||
37 | WM2200_MBIAS_LVL_2V6 = 8, | ||
38 | }; | ||
39 | |||
40 | struct wm2200_micbias { | ||
41 | enum wm2200_mbias_lvl mb_lvl; /** Regulated voltage */ | ||
42 | unsigned int discharge:1; /** Actively discharge */ | ||
43 | unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ | ||
44 | unsigned int bypass:1; /** Use bypass mode */ | ||
45 | }; | ||
46 | |||
28 | struct wm2200_pdata { | 47 | struct wm2200_pdata { |
29 | int reset; /** GPIO controlling /RESET, if any */ | 48 | int reset; /** GPIO controlling /RESET, if any */ |
30 | int ldo_ena; /** GPIO controlling LODENA, if any */ | 49 | int ldo_ena; /** GPIO controlling LODENA, if any */ |
@@ -35,7 +54,8 @@ struct wm2200_pdata { | |||
35 | enum wm2200_in_mode in_mode[3]; | 54 | enum wm2200_in_mode in_mode[3]; |
36 | enum wm2200_dmic_sup dmic_sup[3]; | 55 | enum wm2200_dmic_sup dmic_sup[3]; |
37 | 56 | ||
38 | int micbias_cfg[2]; /** Register value to configure MICBIAS */ | 57 | /** MICBIAS configurations */ |
58 | struct wm2200_micbias micbias[WM2200_MAX_MICBIAS]; | ||
39 | }; | 59 | }; |
40 | 60 | ||
41 | #endif | 61 | #endif |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 507910992c59..b128c20770bc 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
@@ -35,6 +35,7 @@ struct se_subsystem_api { | |||
35 | u32 (*get_device_type)(struct se_device *); | 35 | u32 (*get_device_type)(struct se_device *); |
36 | sector_t (*get_blocks)(struct se_device *); | 36 | sector_t (*get_blocks)(struct se_device *); |
37 | unsigned char *(*get_sense_buffer)(struct se_cmd *); | 37 | unsigned char *(*get_sense_buffer)(struct se_cmd *); |
38 | bool (*get_write_cache)(struct se_device *); | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | struct sbc_ops { | 41 | struct sbc_ops { |
@@ -52,11 +53,13 @@ void target_complete_cmd(struct se_cmd *, u8); | |||
52 | 53 | ||
53 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); | 54 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); |
54 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); | 55 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); |
55 | sector_t spc_get_write_same_sectors(struct se_cmd *cmd); | 56 | sense_reason_t spc_emulate_inquiry_std(struct se_cmd *, unsigned char *); |
57 | sense_reason_t spc_emulate_evpd_83(struct se_cmd *, unsigned char *); | ||
56 | 58 | ||
57 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); | 59 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); |
58 | u32 sbc_get_device_rev(struct se_device *dev); | 60 | u32 sbc_get_device_rev(struct se_device *dev); |
59 | u32 sbc_get_device_type(struct se_device *dev); | 61 | u32 sbc_get_device_type(struct se_device *dev); |
62 | sector_t sbc_get_write_same_sectors(struct se_cmd *cmd); | ||
60 | 63 | ||
61 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); | 64 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); |
62 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); | 65 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 663e34a5383f..c4af592f7057 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -44,7 +44,7 @@ | |||
44 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ | 44 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ |
45 | #define TG_PT_GROUP_NAME_BUF 256 | 45 | #define TG_PT_GROUP_NAME_BUF 256 |
46 | /* Used to parse VPD into struct t10_vpd */ | 46 | /* Used to parse VPD into struct t10_vpd */ |
47 | #define VPD_TMP_BUF_SIZE 128 | 47 | #define VPD_TMP_BUF_SIZE 254 |
48 | /* Used by transport_generic_cmd_sequencer() */ | 48 | /* Used by transport_generic_cmd_sequencer() */ |
49 | #define READ_BLOCK_LEN 6 | 49 | #define READ_BLOCK_LEN 6 |
50 | #define READ_CAP_LEN 8 | 50 | #define READ_CAP_LEN 8 |
@@ -75,6 +75,8 @@ | |||
75 | #define DA_MAX_WRITE_SAME_LEN 0 | 75 | #define DA_MAX_WRITE_SAME_LEN 0 |
76 | /* Default max transfer length */ | 76 | /* Default max transfer length */ |
77 | #define DA_FABRIC_MAX_SECTORS 8192 | 77 | #define DA_FABRIC_MAX_SECTORS 8192 |
78 | /* Use a model alias based on the configfs backend device name */ | ||
79 | #define DA_EMULATE_MODEL_ALIAS 0 | ||
78 | /* Emulation for Direct Page Out */ | 80 | /* Emulation for Direct Page Out */ |
79 | #define DA_EMULATE_DPO 0 | 81 | #define DA_EMULATE_DPO 0 |
80 | /* Emulation for Forced Unit Access WRITEs */ | 82 | /* Emulation for Forced Unit Access WRITEs */ |
@@ -193,6 +195,7 @@ enum tcm_sense_reason_table { | |||
193 | TCM_RESERVATION_CONFLICT = R(0x10), | 195 | TCM_RESERVATION_CONFLICT = R(0x10), |
194 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), | 196 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), |
195 | TCM_OUT_OF_RESOURCES = R(0x12), | 197 | TCM_OUT_OF_RESOURCES = R(0x12), |
198 | TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), | ||
196 | #undef R | 199 | #undef R |
197 | }; | 200 | }; |
198 | 201 | ||
@@ -211,7 +214,6 @@ enum tcm_tmreq_table { | |||
211 | TMR_LUN_RESET = 5, | 214 | TMR_LUN_RESET = 5, |
212 | TMR_TARGET_WARM_RESET = 6, | 215 | TMR_TARGET_WARM_RESET = 6, |
213 | TMR_TARGET_COLD_RESET = 7, | 216 | TMR_TARGET_COLD_RESET = 7, |
214 | TMR_FABRIC_TMR = 255, | ||
215 | }; | 217 | }; |
216 | 218 | ||
217 | /* fabric independent task management response values */ | 219 | /* fabric independent task management response values */ |
@@ -592,6 +594,7 @@ struct se_dev_entry { | |||
592 | }; | 594 | }; |
593 | 595 | ||
594 | struct se_dev_attrib { | 596 | struct se_dev_attrib { |
597 | int emulate_model_alias; | ||
595 | int emulate_dpo; | 598 | int emulate_dpo; |
596 | int emulate_fua_write; | 599 | int emulate_fua_write; |
597 | int emulate_fua_read; | 600 | int emulate_fua_read; |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 7e8c36bc7082..c0457c0d1a68 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -1324,6 +1324,31 @@ TRACE_EVENT(ext4_fallocate_exit, | |||
1324 | __entry->ret) | 1324 | __entry->ret) |
1325 | ); | 1325 | ); |
1326 | 1326 | ||
1327 | TRACE_EVENT(ext4_punch_hole, | ||
1328 | TP_PROTO(struct inode *inode, loff_t offset, loff_t len), | ||
1329 | |||
1330 | TP_ARGS(inode, offset, len), | ||
1331 | |||
1332 | TP_STRUCT__entry( | ||
1333 | __field( dev_t, dev ) | ||
1334 | __field( ino_t, ino ) | ||
1335 | __field( loff_t, offset ) | ||
1336 | __field( loff_t, len ) | ||
1337 | ), | ||
1338 | |||
1339 | TP_fast_assign( | ||
1340 | __entry->dev = inode->i_sb->s_dev; | ||
1341 | __entry->ino = inode->i_ino; | ||
1342 | __entry->offset = offset; | ||
1343 | __entry->len = len; | ||
1344 | ), | ||
1345 | |||
1346 | TP_printk("dev %d,%d ino %lu offset %lld len %lld", | ||
1347 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1348 | (unsigned long) __entry->ino, | ||
1349 | __entry->offset, __entry->len) | ||
1350 | ); | ||
1351 | |||
1327 | TRACE_EVENT(ext4_unlink_enter, | 1352 | TRACE_EVENT(ext4_unlink_enter, |
1328 | TP_PROTO(struct inode *parent, struct dentry *dentry), | 1353 | TP_PROTO(struct inode *parent, struct dentry *dentry), |
1329 | 1354 | ||
@@ -2068,103 +2093,226 @@ TRACE_EVENT(ext4_ext_remove_space_done, | |||
2068 | ); | 2093 | ); |
2069 | 2094 | ||
2070 | TRACE_EVENT(ext4_es_insert_extent, | 2095 | TRACE_EVENT(ext4_es_insert_extent, |
2071 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | 2096 | TP_PROTO(struct inode *inode, struct extent_status *es), |
2072 | 2097 | ||
2073 | TP_ARGS(inode, start, len), | 2098 | TP_ARGS(inode, es), |
2074 | 2099 | ||
2075 | TP_STRUCT__entry( | 2100 | TP_STRUCT__entry( |
2076 | __field( dev_t, dev ) | 2101 | __field( dev_t, dev ) |
2077 | __field( ino_t, ino ) | 2102 | __field( ino_t, ino ) |
2078 | __field( loff_t, start ) | 2103 | __field( ext4_lblk_t, lblk ) |
2079 | __field( loff_t, len ) | 2104 | __field( ext4_lblk_t, len ) |
2105 | __field( ext4_fsblk_t, pblk ) | ||
2106 | __field( unsigned long long, status ) | ||
2080 | ), | 2107 | ), |
2081 | 2108 | ||
2082 | TP_fast_assign( | 2109 | TP_fast_assign( |
2083 | __entry->dev = inode->i_sb->s_dev; | 2110 | __entry->dev = inode->i_sb->s_dev; |
2084 | __entry->ino = inode->i_ino; | 2111 | __entry->ino = inode->i_ino; |
2085 | __entry->start = start; | 2112 | __entry->lblk = es->es_lblk; |
2086 | __entry->len = len; | 2113 | __entry->len = es->es_len; |
2114 | __entry->pblk = ext4_es_pblock(es); | ||
2115 | __entry->status = ext4_es_status(es); | ||
2087 | ), | 2116 | ), |
2088 | 2117 | ||
2089 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | 2118 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", |
2090 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2091 | (unsigned long) __entry->ino, | 2120 | (unsigned long) __entry->ino, |
2092 | __entry->start, __entry->len) | 2121 | __entry->lblk, __entry->len, |
2122 | __entry->pblk, __entry->status) | ||
2093 | ); | 2123 | ); |
2094 | 2124 | ||
2095 | TRACE_EVENT(ext4_es_remove_extent, | 2125 | TRACE_EVENT(ext4_es_remove_extent, |
2096 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | 2126 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), |
2097 | 2127 | ||
2098 | TP_ARGS(inode, start, len), | 2128 | TP_ARGS(inode, lblk, len), |
2099 | 2129 | ||
2100 | TP_STRUCT__entry( | 2130 | TP_STRUCT__entry( |
2101 | __field( dev_t, dev ) | 2131 | __field( dev_t, dev ) |
2102 | __field( ino_t, ino ) | 2132 | __field( ino_t, ino ) |
2103 | __field( loff_t, start ) | 2133 | __field( loff_t, lblk ) |
2104 | __field( loff_t, len ) | 2134 | __field( loff_t, len ) |
2105 | ), | 2135 | ), |
2106 | 2136 | ||
2107 | TP_fast_assign( | 2137 | TP_fast_assign( |
2108 | __entry->dev = inode->i_sb->s_dev; | 2138 | __entry->dev = inode->i_sb->s_dev; |
2109 | __entry->ino = inode->i_ino; | 2139 | __entry->ino = inode->i_ino; |
2110 | __entry->start = start; | 2140 | __entry->lblk = lblk; |
2111 | __entry->len = len; | 2141 | __entry->len = len; |
2112 | ), | 2142 | ), |
2113 | 2143 | ||
2114 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | 2144 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", |
2115 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2145 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2116 | (unsigned long) __entry->ino, | 2146 | (unsigned long) __entry->ino, |
2117 | __entry->start, __entry->len) | 2147 | __entry->lblk, __entry->len) |
2118 | ); | 2148 | ); |
2119 | 2149 | ||
2120 | TRACE_EVENT(ext4_es_find_extent_enter, | 2150 | TRACE_EVENT(ext4_es_find_delayed_extent_enter, |
2121 | TP_PROTO(struct inode *inode, ext4_lblk_t start), | 2151 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk), |
2122 | 2152 | ||
2123 | TP_ARGS(inode, start), | 2153 | TP_ARGS(inode, lblk), |
2124 | 2154 | ||
2125 | TP_STRUCT__entry( | 2155 | TP_STRUCT__entry( |
2126 | __field( dev_t, dev ) | 2156 | __field( dev_t, dev ) |
2127 | __field( ino_t, ino ) | 2157 | __field( ino_t, ino ) |
2128 | __field( ext4_lblk_t, start ) | 2158 | __field( ext4_lblk_t, lblk ) |
2129 | ), | 2159 | ), |
2130 | 2160 | ||
2131 | TP_fast_assign( | 2161 | TP_fast_assign( |
2132 | __entry->dev = inode->i_sb->s_dev; | 2162 | __entry->dev = inode->i_sb->s_dev; |
2133 | __entry->ino = inode->i_ino; | 2163 | __entry->ino = inode->i_ino; |
2134 | __entry->start = start; | 2164 | __entry->lblk = lblk; |
2135 | ), | 2165 | ), |
2136 | 2166 | ||
2137 | TP_printk("dev %d,%d ino %lu start %u", | 2167 | TP_printk("dev %d,%d ino %lu lblk %u", |
2138 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2168 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2139 | (unsigned long) __entry->ino, __entry->start) | 2169 | (unsigned long) __entry->ino, __entry->lblk) |
2140 | ); | 2170 | ); |
2141 | 2171 | ||
2142 | TRACE_EVENT(ext4_es_find_extent_exit, | 2172 | TRACE_EVENT(ext4_es_find_delayed_extent_exit, |
2143 | TP_PROTO(struct inode *inode, struct extent_status *es, | 2173 | TP_PROTO(struct inode *inode, struct extent_status *es), |
2144 | ext4_lblk_t ret), | ||
2145 | 2174 | ||
2146 | TP_ARGS(inode, es, ret), | 2175 | TP_ARGS(inode, es), |
2147 | 2176 | ||
2148 | TP_STRUCT__entry( | 2177 | TP_STRUCT__entry( |
2149 | __field( dev_t, dev ) | 2178 | __field( dev_t, dev ) |
2150 | __field( ino_t, ino ) | 2179 | __field( ino_t, ino ) |
2151 | __field( ext4_lblk_t, start ) | 2180 | __field( ext4_lblk_t, lblk ) |
2152 | __field( ext4_lblk_t, len ) | 2181 | __field( ext4_lblk_t, len ) |
2153 | __field( ext4_lblk_t, ret ) | 2182 | __field( ext4_fsblk_t, pblk ) |
2183 | __field( unsigned long long, status ) | ||
2154 | ), | 2184 | ), |
2155 | 2185 | ||
2156 | TP_fast_assign( | 2186 | TP_fast_assign( |
2157 | __entry->dev = inode->i_sb->s_dev; | 2187 | __entry->dev = inode->i_sb->s_dev; |
2158 | __entry->ino = inode->i_ino; | 2188 | __entry->ino = inode->i_ino; |
2159 | __entry->start = es->start; | 2189 | __entry->lblk = es->es_lblk; |
2160 | __entry->len = es->len; | 2190 | __entry->len = es->es_len; |
2161 | __entry->ret = ret; | 2191 | __entry->pblk = ext4_es_pblock(es); |
2192 | __entry->status = ext4_es_status(es); | ||
2162 | ), | 2193 | ), |
2163 | 2194 | ||
2164 | TP_printk("dev %d,%d ino %lu es [%u/%u) ret %u", | 2195 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", |
2165 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2196 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2166 | (unsigned long) __entry->ino, | 2197 | (unsigned long) __entry->ino, |
2167 | __entry->start, __entry->len, __entry->ret) | 2198 | __entry->lblk, __entry->len, |
2199 | __entry->pblk, __entry->status) | ||
2200 | ); | ||
2201 | |||
2202 | TRACE_EVENT(ext4_es_lookup_extent_enter, | ||
2203 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk), | ||
2204 | |||
2205 | TP_ARGS(inode, lblk), | ||
2206 | |||
2207 | TP_STRUCT__entry( | ||
2208 | __field( dev_t, dev ) | ||
2209 | __field( ino_t, ino ) | ||
2210 | __field( ext4_lblk_t, lblk ) | ||
2211 | ), | ||
2212 | |||
2213 | TP_fast_assign( | ||
2214 | __entry->dev = inode->i_sb->s_dev; | ||
2215 | __entry->ino = inode->i_ino; | ||
2216 | __entry->lblk = lblk; | ||
2217 | ), | ||
2218 | |||
2219 | TP_printk("dev %d,%d ino %lu lblk %u", | ||
2220 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2221 | (unsigned long) __entry->ino, __entry->lblk) | ||
2222 | ); | ||
2223 | |||
2224 | TRACE_EVENT(ext4_es_lookup_extent_exit, | ||
2225 | TP_PROTO(struct inode *inode, struct extent_status *es, | ||
2226 | int found), | ||
2227 | |||
2228 | TP_ARGS(inode, es, found), | ||
2229 | |||
2230 | TP_STRUCT__entry( | ||
2231 | __field( dev_t, dev ) | ||
2232 | __field( ino_t, ino ) | ||
2233 | __field( ext4_lblk_t, lblk ) | ||
2234 | __field( ext4_lblk_t, len ) | ||
2235 | __field( ext4_fsblk_t, pblk ) | ||
2236 | __field( unsigned long long, status ) | ||
2237 | __field( int, found ) | ||
2238 | ), | ||
2239 | |||
2240 | TP_fast_assign( | ||
2241 | __entry->dev = inode->i_sb->s_dev; | ||
2242 | __entry->ino = inode->i_ino; | ||
2243 | __entry->lblk = es->es_lblk; | ||
2244 | __entry->len = es->es_len; | ||
2245 | __entry->pblk = ext4_es_pblock(es); | ||
2246 | __entry->status = ext4_es_status(es); | ||
2247 | __entry->found = found; | ||
2248 | ), | ||
2249 | |||
2250 | TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %llx", | ||
2251 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2252 | (unsigned long) __entry->ino, __entry->found, | ||
2253 | __entry->lblk, __entry->len, | ||
2254 | __entry->found ? __entry->pblk : 0, | ||
2255 | __entry->found ? __entry->status : 0) | ||
2256 | ); | ||
2257 | |||
2258 | TRACE_EVENT(ext4_es_reclaim_extents_count, | ||
2259 | TP_PROTO(struct super_block *sb, int nr_cached), | ||
2260 | |||
2261 | TP_ARGS(sb, nr_cached), | ||
2262 | |||
2263 | TP_STRUCT__entry( | ||
2264 | __field( dev_t, dev ) | ||
2265 | __field( int, nr_cached ) | ||
2266 | ), | ||
2267 | |||
2268 | TP_fast_assign( | ||
2269 | __entry->dev = sb->s_dev; | ||
2270 | __entry->nr_cached = nr_cached; | ||
2271 | ), | ||
2272 | |||
2273 | TP_printk("dev %d,%d cached objects nr %d", | ||
2274 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2275 | __entry->nr_cached) | ||
2276 | ); | ||
2277 | |||
2278 | TRACE_EVENT(ext4_es_shrink_enter, | ||
2279 | TP_PROTO(struct super_block *sb, int nr_to_scan), | ||
2280 | |||
2281 | TP_ARGS(sb, nr_to_scan), | ||
2282 | |||
2283 | TP_STRUCT__entry( | ||
2284 | __field( dev_t, dev ) | ||
2285 | __field( int, nr_to_scan ) | ||
2286 | ), | ||
2287 | |||
2288 | TP_fast_assign( | ||
2289 | __entry->dev = sb->s_dev; | ||
2290 | __entry->nr_to_scan = nr_to_scan; | ||
2291 | ), | ||
2292 | |||
2293 | TP_printk("dev %d,%d nr to scan %d", | ||
2294 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2295 | __entry->nr_to_scan) | ||
2296 | ); | ||
2297 | |||
2298 | TRACE_EVENT(ext4_es_shrink_exit, | ||
2299 | TP_PROTO(struct super_block *sb, int shrunk_nr), | ||
2300 | |||
2301 | TP_ARGS(sb, shrunk_nr), | ||
2302 | |||
2303 | TP_STRUCT__entry( | ||
2304 | __field( dev_t, dev ) | ||
2305 | __field( int, shrunk_nr ) | ||
2306 | ), | ||
2307 | |||
2308 | TP_fast_assign( | ||
2309 | __entry->dev = sb->s_dev; | ||
2310 | __entry->shrunk_nr = shrunk_nr; | ||
2311 | ), | ||
2312 | |||
2313 | TP_printk("dev %d,%d nr to scan %d", | ||
2314 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2315 | __entry->shrunk_nr) | ||
2168 | ); | 2316 | ); |
2169 | 2317 | ||
2170 | #endif /* _TRACE_EXT4_H */ | 2318 | #endif /* _TRACE_EXT4_H */ |
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 127993dbf322..070df49e4a1d 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -132,6 +132,104 @@ TRACE_EVENT(jbd2_submit_inode_data, | |||
132 | (unsigned long) __entry->ino) | 132 | (unsigned long) __entry->ino) |
133 | ); | 133 | ); |
134 | 134 | ||
135 | TRACE_EVENT(jbd2_handle_start, | ||
136 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
137 | unsigned int line_no, int requested_blocks), | ||
138 | |||
139 | TP_ARGS(dev, tid, type, line_no, requested_blocks), | ||
140 | |||
141 | TP_STRUCT__entry( | ||
142 | __field( dev_t, dev ) | ||
143 | __field( unsigned long, tid ) | ||
144 | __field( unsigned int, type ) | ||
145 | __field( unsigned int, line_no ) | ||
146 | __field( int, requested_blocks) | ||
147 | ), | ||
148 | |||
149 | TP_fast_assign( | ||
150 | __entry->dev = dev; | ||
151 | __entry->tid = tid; | ||
152 | __entry->type = type; | ||
153 | __entry->line_no = line_no; | ||
154 | __entry->requested_blocks = requested_blocks; | ||
155 | ), | ||
156 | |||
157 | TP_printk("dev %d,%d tid %lu type %u line_no %u " | ||
158 | "requested_blocks %d", | ||
159 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
160 | __entry->type, __entry->line_no, __entry->requested_blocks) | ||
161 | ); | ||
162 | |||
163 | TRACE_EVENT(jbd2_handle_extend, | ||
164 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
165 | unsigned int line_no, int buffer_credits, | ||
166 | int requested_blocks), | ||
167 | |||
168 | TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), | ||
169 | |||
170 | TP_STRUCT__entry( | ||
171 | __field( dev_t, dev ) | ||
172 | __field( unsigned long, tid ) | ||
173 | __field( unsigned int, type ) | ||
174 | __field( unsigned int, line_no ) | ||
175 | __field( int, buffer_credits ) | ||
176 | __field( int, requested_blocks) | ||
177 | ), | ||
178 | |||
179 | TP_fast_assign( | ||
180 | __entry->dev = dev; | ||
181 | __entry->tid = tid; | ||
182 | __entry->type = type; | ||
183 | __entry->line_no = line_no; | ||
184 | __entry->buffer_credits = buffer_credits; | ||
185 | __entry->requested_blocks = requested_blocks; | ||
186 | ), | ||
187 | |||
188 | TP_printk("dev %d,%d tid %lu type %u line_no %u " | ||
189 | "buffer_credits %d requested_blocks %d", | ||
190 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
191 | __entry->type, __entry->line_no, __entry->buffer_credits, | ||
192 | __entry->requested_blocks) | ||
193 | ); | ||
194 | |||
195 | TRACE_EVENT(jbd2_handle_stats, | ||
196 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
197 | unsigned int line_no, int interval, int sync, | ||
198 | int requested_blocks, int dirtied_blocks), | ||
199 | |||
200 | TP_ARGS(dev, tid, type, line_no, interval, sync, | ||
201 | requested_blocks, dirtied_blocks), | ||
202 | |||
203 | TP_STRUCT__entry( | ||
204 | __field( dev_t, dev ) | ||
205 | __field( unsigned long, tid ) | ||
206 | __field( unsigned int, type ) | ||
207 | __field( unsigned int, line_no ) | ||
208 | __field( int, interval ) | ||
209 | __field( int, sync ) | ||
210 | __field( int, requested_blocks) | ||
211 | __field( int, dirtied_blocks ) | ||
212 | ), | ||
213 | |||
214 | TP_fast_assign( | ||
215 | __entry->dev = dev; | ||
216 | __entry->tid = tid; | ||
217 | __entry->type = type; | ||
218 | __entry->line_no = line_no; | ||
219 | __entry->interval = interval; | ||
220 | __entry->sync = sync; | ||
221 | __entry->requested_blocks = requested_blocks; | ||
222 | __entry->dirtied_blocks = dirtied_blocks; | ||
223 | ), | ||
224 | |||
225 | TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d " | ||
226 | "sync %d requested_blocks %d dirtied_blocks %d", | ||
227 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
228 | __entry->type, __entry->line_no, __entry->interval, | ||
229 | __entry->sync, __entry->requested_blocks, | ||
230 | __entry->dirtied_blocks) | ||
231 | ); | ||
232 | |||
135 | TRACE_EVENT(jbd2_run_stats, | 233 | TRACE_EVENT(jbd2_run_stats, |
136 | TP_PROTO(dev_t dev, unsigned long tid, | 234 | TP_PROTO(dev_t dev, unsigned long tid, |
137 | struct transaction_run_stats_s *stats), | 235 | struct transaction_run_stats_s *stats), |
@@ -142,6 +240,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
142 | __field( dev_t, dev ) | 240 | __field( dev_t, dev ) |
143 | __field( unsigned long, tid ) | 241 | __field( unsigned long, tid ) |
144 | __field( unsigned long, wait ) | 242 | __field( unsigned long, wait ) |
243 | __field( unsigned long, request_delay ) | ||
145 | __field( unsigned long, running ) | 244 | __field( unsigned long, running ) |
146 | __field( unsigned long, locked ) | 245 | __field( unsigned long, locked ) |
147 | __field( unsigned long, flushing ) | 246 | __field( unsigned long, flushing ) |
@@ -155,6 +254,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
155 | __entry->dev = dev; | 254 | __entry->dev = dev; |
156 | __entry->tid = tid; | 255 | __entry->tid = tid; |
157 | __entry->wait = stats->rs_wait; | 256 | __entry->wait = stats->rs_wait; |
257 | __entry->request_delay = stats->rs_request_delay; | ||
158 | __entry->running = stats->rs_running; | 258 | __entry->running = stats->rs_running; |
159 | __entry->locked = stats->rs_locked; | 259 | __entry->locked = stats->rs_locked; |
160 | __entry->flushing = stats->rs_flushing; | 260 | __entry->flushing = stats->rs_flushing; |
@@ -164,10 +264,12 @@ TRACE_EVENT(jbd2_run_stats, | |||
164 | __entry->blocks_logged = stats->rs_blocks_logged; | 264 | __entry->blocks_logged = stats->rs_blocks_logged; |
165 | ), | 265 | ), |
166 | 266 | ||
167 | TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u " | 267 | TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " |
168 | "logging %u handle_count %u blocks %u blocks_logged %u", | 268 | "locked %u flushing %u logging %u handle_count %u " |
269 | "blocks %u blocks_logged %u", | ||
169 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | 270 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
170 | jiffies_to_msecs(__entry->wait), | 271 | jiffies_to_msecs(__entry->wait), |
272 | jiffies_to_msecs(__entry->request_delay), | ||
171 | jiffies_to_msecs(__entry->running), | 273 | jiffies_to_msecs(__entry->running), |
172 | jiffies_to_msecs(__entry->locked), | 274 | jiffies_to_msecs(__entry->locked), |
173 | jiffies_to_msecs(__entry->flushing), | 275 | jiffies_to_msecs(__entry->flushing), |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 7ef9e759f499..19911dddaeb7 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -14,7 +14,7 @@ | |||
14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ |
15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ |
16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ | 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ |
17 | ERSN(S390_UCONTROL) | 17 | ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH) |
18 | 18 | ||
19 | TRACE_EVENT(kvm_userspace_exit, | 19 | TRACE_EVENT(kvm_userspace_exit, |
20 | TP_PROTO(__u32 reason, int errno), | 20 | TP_PROTO(__u32 reason, int errno), |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 0c9783841a30..427acab5d69a 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -99,98 +99,6 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate, | |||
99 | TP_ARGS(name, state) | 99 | TP_ARGS(name, state) |
100 | ); | 100 | ); |
101 | 101 | ||
102 | #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED | ||
103 | |||
104 | /* | ||
105 | * The power events are used for cpuidle & suspend (power_start, power_end) | ||
106 | * and for cpufreq (power_frequency) | ||
107 | */ | ||
108 | DECLARE_EVENT_CLASS(power, | ||
109 | |||
110 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
111 | |||
112 | TP_ARGS(type, state, cpu_id), | ||
113 | |||
114 | TP_STRUCT__entry( | ||
115 | __field( u64, type ) | ||
116 | __field( u64, state ) | ||
117 | __field( u64, cpu_id ) | ||
118 | ), | ||
119 | |||
120 | TP_fast_assign( | ||
121 | __entry->type = type; | ||
122 | __entry->state = state; | ||
123 | __entry->cpu_id = cpu_id; | ||
124 | ), | ||
125 | |||
126 | TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type, | ||
127 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(power, power_start, | ||
131 | |||
132 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
133 | |||
134 | TP_ARGS(type, state, cpu_id) | ||
135 | ); | ||
136 | |||
137 | DEFINE_EVENT(power, power_frequency, | ||
138 | |||
139 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
140 | |||
141 | TP_ARGS(type, state, cpu_id) | ||
142 | ); | ||
143 | |||
144 | TRACE_EVENT(power_end, | ||
145 | |||
146 | TP_PROTO(unsigned int cpu_id), | ||
147 | |||
148 | TP_ARGS(cpu_id), | ||
149 | |||
150 | TP_STRUCT__entry( | ||
151 | __field( u64, cpu_id ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->cpu_id = cpu_id; | ||
156 | ), | ||
157 | |||
158 | TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) | ||
159 | |||
160 | ); | ||
161 | |||
162 | /* Deprecated dummy functions must be protected against multi-declartion */ | ||
163 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
164 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
165 | |||
166 | enum { | ||
167 | POWER_NONE = 0, | ||
168 | POWER_CSTATE = 1, | ||
169 | POWER_PSTATE = 2, | ||
170 | }; | ||
171 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
172 | |||
173 | #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
174 | |||
175 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
176 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
177 | enum { | ||
178 | POWER_NONE = 0, | ||
179 | POWER_CSTATE = 1, | ||
180 | POWER_PSTATE = 2, | ||
181 | }; | ||
182 | |||
183 | /* These dummy declaration have to be ripped out when the deprecated | ||
184 | events get removed */ | ||
185 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | ||
186 | static inline void trace_power_end(u64 cpuid) {}; | ||
187 | static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; | ||
188 | static inline void trace_power_end_rcuidle(u64 cpuid) {}; | ||
189 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | ||
190 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
191 | |||
192 | #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
193 | |||
194 | /* | 102 | /* |
195 | * The clock events are used for clock enable/disable and for | 103 | * The clock events are used for clock enable/disable and for |
196 | * clock rate change | 104 | * clock rate change |
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h index 6fae30fd16ab..9df61f1edb0f 100644 --- a/include/uapi/asm-generic/signal.h +++ b/include/uapi/asm-generic/signal.h | |||
@@ -93,6 +93,11 @@ typedef unsigned long old_sigset_t; | |||
93 | 93 | ||
94 | #include <asm-generic/signal-defs.h> | 94 | #include <asm-generic/signal-defs.h> |
95 | 95 | ||
96 | #ifdef SA_RESTORER | ||
97 | #define __ARCH_HAS_SA_RESTORER | ||
98 | #endif | ||
99 | |||
100 | #ifndef __KERNEL__ | ||
96 | struct sigaction { | 101 | struct sigaction { |
97 | __sighandler_t sa_handler; | 102 | __sighandler_t sa_handler; |
98 | unsigned long sa_flags; | 103 | unsigned long sa_flags; |
@@ -101,10 +106,7 @@ struct sigaction { | |||
101 | #endif | 106 | #endif |
102 | sigset_t sa_mask; /* mask last for extensibility */ | 107 | sigset_t sa_mask; /* mask last for extensibility */ |
103 | }; | 108 | }; |
104 | 109 | #endif | |
105 | struct k_sigaction { | ||
106 | struct sigaction sa; | ||
107 | }; | ||
108 | 110 | ||
109 | typedef struct sigaltstack { | 111 | typedef struct sigaltstack { |
110 | void __user *ss_sp; | 112 | void __user *ss_sp; |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index 2d32d073a6f9..4ef3acbba5da 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
@@ -22,8 +22,7 @@ | |||
22 | #define SO_PRIORITY 12 | 22 | #define SO_PRIORITY 12 |
23 | #define SO_LINGER 13 | 23 | #define SO_LINGER 13 |
24 | #define SO_BSDCOMPAT 14 | 24 | #define SO_BSDCOMPAT 14 |
25 | /* To add :#define SO_REUSEPORT 15 */ | 25 | #define SO_REUSEPORT 15 |
26 | |||
27 | #ifndef SO_PASSCRED /* powerpc only differs in these */ | 26 | #ifndef SO_PASSCRED /* powerpc only differs in these */ |
28 | #define SO_PASSCRED 16 | 27 | #define SO_PASSCRED 16 |
29 | #define SO_PEERCRED 17 | 28 | #define SO_PEERCRED 17 |
@@ -73,4 +72,6 @@ | |||
73 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ | 72 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ |
74 | #define SO_NOFCS 43 | 73 | #define SO_NOFCS 43 |
75 | 74 | ||
75 | #define SO_LOCK_FILTER 44 | ||
76 | |||
76 | #endif /* __ASM_GENERIC_SOCKET_H */ | 77 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 2c531f478410..0cc74c4403e4 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h | |||
@@ -402,9 +402,9 @@ __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) | |||
402 | #define __NR_rt_sigaction 134 | 402 | #define __NR_rt_sigaction 134 |
403 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) | 403 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) |
404 | #define __NR_rt_sigprocmask 135 | 404 | #define __NR_rt_sigprocmask 135 |
405 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) | 405 | __SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask) |
406 | #define __NR_rt_sigpending 136 | 406 | #define __NR_rt_sigpending 136 |
407 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) | 407 | __SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending) |
408 | #define __NR_rt_sigtimedwait 137 | 408 | #define __NR_rt_sigtimedwait 137 |
409 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ | 409 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ |
410 | compat_sys_rt_sigtimedwait) | 410 | compat_sys_rt_sigtimedwait) |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index c4d2e9c74002..07d59419fe6b 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
@@ -308,6 +308,8 @@ typedef struct drm_i915_irq_wait { | |||
308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 | 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 |
309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 | 309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 |
310 | #define I915_PARAM_HAS_PINNED_BATCHES 24 | 310 | #define I915_PARAM_HAS_PINNED_BATCHES 24 |
311 | #define I915_PARAM_HAS_EXEC_NO_RELOC 25 | ||
312 | #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 | ||
311 | 313 | ||
312 | typedef struct drm_i915_getparam { | 314 | typedef struct drm_i915_getparam { |
313 | int param; | 315 | int param; |
@@ -628,7 +630,11 @@ struct drm_i915_gem_exec_object2 { | |||
628 | __u64 offset; | 630 | __u64 offset; |
629 | 631 | ||
630 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | 632 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) |
633 | #define EXEC_OBJECT_NEEDS_GTT (1<<1) | ||
634 | #define EXEC_OBJECT_WRITE (1<<2) | ||
635 | #define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1) | ||
631 | __u64 flags; | 636 | __u64 flags; |
637 | |||
632 | __u64 rsvd1; | 638 | __u64 rsvd1; |
633 | __u64 rsvd2; | 639 | __u64 rsvd2; |
634 | }; | 640 | }; |
@@ -687,6 +693,20 @@ struct drm_i915_gem_execbuffer2 { | |||
687 | */ | 693 | */ |
688 | #define I915_EXEC_IS_PINNED (1<<10) | 694 | #define I915_EXEC_IS_PINNED (1<<10) |
689 | 695 | ||
696 | /** Provide a hint to the kernel that the command stream and auxilliary | ||
697 | * state buffers already holds the correct presumed addresses and so the | ||
698 | * relocation process may be skipped if no buffers need to be moved in | ||
699 | * preparation for the execbuffer. | ||
700 | */ | ||
701 | #define I915_EXEC_NO_RELOC (1<<11) | ||
702 | |||
703 | /** Use the reloc.handle as an index into the exec object array rather | ||
704 | * than as the per-file handle. | ||
705 | */ | ||
706 | #define I915_EXEC_HANDLE_LUT (1<<12) | ||
707 | |||
708 | #define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) | ||
709 | |||
690 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | 710 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
691 | #define i915_execbuffer2_set_context_id(eb2, context) \ | 711 | #define i915_execbuffer2_set_context_id(eb2, context) \ |
692 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK | 712 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK |
diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h new file mode 100644 index 000000000000..1d0b1172664e --- /dev/null +++ b/include/uapi/drm/omap_drm.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /* | ||
2 | * include/uapi/drm/omap_drm.h | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments | ||
5 | * Author: Rob Clark <rob@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __OMAP_DRM_H__ | ||
21 | #define __OMAP_DRM_H__ | ||
22 | |||
23 | #include <drm/drm.h> | ||
24 | |||
25 | /* Please note that modifications to all structs defined here are | ||
26 | * subject to backwards-compatibility constraints. | ||
27 | */ | ||
28 | |||
29 | #define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */ | ||
30 | |||
31 | struct drm_omap_param { | ||
32 | uint64_t param; /* in */ | ||
33 | uint64_t value; /* in (set_param), out (get_param) */ | ||
34 | }; | ||
35 | |||
36 | #define OMAP_BO_SCANOUT 0x00000001 /* scanout capable (phys contiguous) */ | ||
37 | #define OMAP_BO_CACHE_MASK 0x00000006 /* cache type mask, see cache modes */ | ||
38 | #define OMAP_BO_TILED_MASK 0x00000f00 /* tiled mapping mask, see tiled modes */ | ||
39 | |||
40 | /* cache modes */ | ||
41 | #define OMAP_BO_CACHED 0x00000000 /* default */ | ||
42 | #define OMAP_BO_WC 0x00000002 /* write-combine */ | ||
43 | #define OMAP_BO_UNCACHED 0x00000004 /* strongly-ordered (uncached) */ | ||
44 | |||
45 | /* tiled modes */ | ||
46 | #define OMAP_BO_TILED_8 0x00000100 | ||
47 | #define OMAP_BO_TILED_16 0x00000200 | ||
48 | #define OMAP_BO_TILED_32 0x00000300 | ||
49 | #define OMAP_BO_TILED (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | OMAP_BO_TILED_32) | ||
50 | |||
51 | union omap_gem_size { | ||
52 | uint32_t bytes; /* (for non-tiled formats) */ | ||
53 | struct { | ||
54 | uint16_t width; | ||
55 | uint16_t height; | ||
56 | } tiled; /* (for tiled formats) */ | ||
57 | }; | ||
58 | |||
59 | struct drm_omap_gem_new { | ||
60 | union omap_gem_size size; /* in */ | ||
61 | uint32_t flags; /* in */ | ||
62 | uint32_t handle; /* out */ | ||
63 | uint32_t __pad; | ||
64 | }; | ||
65 | |||
66 | /* mask of operations: */ | ||
67 | enum omap_gem_op { | ||
68 | OMAP_GEM_READ = 0x01, | ||
69 | OMAP_GEM_WRITE = 0x02, | ||
70 | }; | ||
71 | |||
72 | struct drm_omap_gem_cpu_prep { | ||
73 | uint32_t handle; /* buffer handle (in) */ | ||
74 | uint32_t op; /* mask of omap_gem_op (in) */ | ||
75 | }; | ||
76 | |||
77 | struct drm_omap_gem_cpu_fini { | ||
78 | uint32_t handle; /* buffer handle (in) */ | ||
79 | uint32_t op; /* mask of omap_gem_op (in) */ | ||
80 | /* TODO maybe here we pass down info about what regions are touched | ||
81 | * by sw so we can be clever about cache ops? For now a placeholder, | ||
82 | * set to zero and we just do full buffer flush.. | ||
83 | */ | ||
84 | uint32_t nregions; | ||
85 | uint32_t __pad; | ||
86 | }; | ||
87 | |||
88 | struct drm_omap_gem_info { | ||
89 | uint32_t handle; /* buffer handle (in) */ | ||
90 | uint32_t pad; | ||
91 | uint64_t offset; /* mmap offset (out) */ | ||
92 | /* note: in case of tiled buffers, the user virtual size can be | ||
93 | * different from the physical size (ie. how many pages are needed | ||
94 | * to back the object) which is returned in DRM_IOCTL_GEM_OPEN.. | ||
95 | * This size here is the one that should be used if you want to | ||
96 | * mmap() the buffer: | ||
97 | */ | ||
98 | uint32_t size; /* virtual size for mmap'ing (out) */ | ||
99 | uint32_t __pad; | ||
100 | }; | ||
101 | |||
102 | #define DRM_OMAP_GET_PARAM 0x00 | ||
103 | #define DRM_OMAP_SET_PARAM 0x01 | ||
104 | /* placeholder for plugin-api | ||
105 | #define DRM_OMAP_GET_BASE 0x02 | ||
106 | */ | ||
107 | #define DRM_OMAP_GEM_NEW 0x03 | ||
108 | #define DRM_OMAP_GEM_CPU_PREP 0x04 | ||
109 | #define DRM_OMAP_GEM_CPU_FINI 0x05 | ||
110 | #define DRM_OMAP_GEM_INFO 0x06 | ||
111 | #define DRM_OMAP_NUM_IOCTLS 0x07 | ||
112 | |||
113 | #define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param) | ||
114 | #define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param) | ||
115 | /* placeholder for plugin-api | ||
116 | #define DRM_IOCTL_OMAP_GET_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_BASE, struct drm_omap_get_base) | ||
117 | */ | ||
118 | #define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new) | ||
119 | #define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep) | ||
120 | #define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini) | ||
121 | #define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info) | ||
122 | |||
123 | #endif /* __OMAP_DRM_H__ */ | ||
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h index 8e1db18c3cb6..ae07bec74f4b 100644 --- a/include/uapi/linux/can/gw.h +++ b/include/uapi/linux/can/gw.h | |||
@@ -44,6 +44,7 @@ enum { | |||
44 | CGW_SRC_IF, /* ifindex of source network interface */ | 44 | CGW_SRC_IF, /* ifindex of source network interface */ |
45 | CGW_DST_IF, /* ifindex of destination network interface */ | 45 | CGW_DST_IF, /* ifindex of destination network interface */ |
46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ | 46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ |
47 | CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ | ||
47 | __CGW_MAX | 48 | __CGW_MAX |
48 | }; | 49 | }; |
49 | 50 | ||
@@ -51,6 +52,7 @@ enum { | |||
51 | 52 | ||
52 | #define CGW_FLAGS_CAN_ECHO 0x01 | 53 | #define CGW_FLAGS_CAN_ECHO 0x01 |
53 | #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 | 54 | #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 |
55 | #define CGW_FLAGS_CAN_IIF_TX_OK 0x04 | ||
54 | 56 | ||
55 | #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ | 57 | #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ |
56 | 58 | ||
diff --git a/include/uapi/linux/cdrom.h b/include/uapi/linux/cdrom.h index 898b866b300c..bd17ad5aa06d 100644 --- a/include/uapi/linux/cdrom.h +++ b/include/uapi/linux/cdrom.h | |||
@@ -908,5 +908,39 @@ struct mode_page_header { | |||
908 | __be16 desc_length; | 908 | __be16 desc_length; |
909 | }; | 909 | }; |
910 | 910 | ||
911 | /* removable medium feature descriptor */ | ||
912 | struct rm_feature_desc { | ||
913 | __be16 feature_code; | ||
914 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
915 | __u8 reserved1:2; | ||
916 | __u8 feature_version:4; | ||
917 | __u8 persistent:1; | ||
918 | __u8 curr:1; | ||
919 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
920 | __u8 curr:1; | ||
921 | __u8 persistent:1; | ||
922 | __u8 feature_version:4; | ||
923 | __u8 reserved1:2; | ||
924 | #endif | ||
925 | __u8 add_len; | ||
926 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
927 | __u8 mech_type:3; | ||
928 | __u8 load:1; | ||
929 | __u8 eject:1; | ||
930 | __u8 pvnt_jmpr:1; | ||
931 | __u8 dbml:1; | ||
932 | __u8 lock:1; | ||
933 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
934 | __u8 lock:1; | ||
935 | __u8 dbml:1; | ||
936 | __u8 pvnt_jmpr:1; | ||
937 | __u8 eject:1; | ||
938 | __u8 load:1; | ||
939 | __u8 mech_type:3; | ||
940 | #endif | ||
941 | __u8 reserved2; | ||
942 | __u8 reserved3; | ||
943 | __u8 reserved4; | ||
944 | }; | ||
911 | 945 | ||
912 | #endif /* _UAPI_LINUX_CDROM_H */ | 946 | #endif /* _UAPI_LINUX_CDROM_H */ |
diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c12d452cb40d..c56d77c496a5 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h | |||
@@ -365,7 +365,17 @@ struct dvb_frontend_event { | |||
365 | #define DTV_INTERLEAVING 60 | 365 | #define DTV_INTERLEAVING 60 |
366 | #define DTV_LNA 61 | 366 | #define DTV_LNA 61 |
367 | 367 | ||
368 | #define DTV_MAX_COMMAND DTV_LNA | 368 | /* Quality parameters */ |
369 | #define DTV_STAT_SIGNAL_STRENGTH 62 | ||
370 | #define DTV_STAT_CNR 63 | ||
371 | #define DTV_STAT_PRE_ERROR_BIT_COUNT 64 | ||
372 | #define DTV_STAT_PRE_TOTAL_BIT_COUNT 65 | ||
373 | #define DTV_STAT_POST_ERROR_BIT_COUNT 66 | ||
374 | #define DTV_STAT_POST_TOTAL_BIT_COUNT 67 | ||
375 | #define DTV_STAT_ERROR_BLOCK_COUNT 68 | ||
376 | #define DTV_STAT_TOTAL_BLOCK_COUNT 69 | ||
377 | |||
378 | #define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT | ||
369 | 379 | ||
370 | typedef enum fe_pilot { | 380 | typedef enum fe_pilot { |
371 | PILOT_ON, | 381 | PILOT_ON, |
@@ -452,11 +462,78 @@ struct dtv_cmds_h { | |||
452 | __u32 reserved:30; /* Align */ | 462 | __u32 reserved:30; /* Align */ |
453 | }; | 463 | }; |
454 | 464 | ||
465 | /** | ||
466 | * Scale types for the quality parameters. | ||
467 | * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That | ||
468 | * could indicate a temporary or a permanent | ||
469 | * condition. | ||
470 | * @FE_SCALE_DECIBEL: The scale is measured in 0.0001 dB steps, typically | ||
471 | * used on signal measures. | ||
472 | * @FE_SCALE_RELATIVE: The scale is a relative percentual measure, | ||
473 | * ranging from 0 (0%) to 0xffff (100%). | ||
474 | * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like | ||
475 | * bit error, block error, lapsed time. | ||
476 | */ | ||
477 | enum fecap_scale_params { | ||
478 | FE_SCALE_NOT_AVAILABLE = 0, | ||
479 | FE_SCALE_DECIBEL, | ||
480 | FE_SCALE_RELATIVE, | ||
481 | FE_SCALE_COUNTER | ||
482 | }; | ||
483 | |||
484 | /** | ||
485 | * struct dtv_stats - Used for reading a DTV status property | ||
486 | * | ||
487 | * @value: value of the measure. Should range from 0 to 0xffff; | ||
488 | * @scale: Filled with enum fecap_scale_params - the scale | ||
489 | * in usage for that parameter | ||
490 | * | ||
491 | * For most delivery systems, this will return a single value for each | ||
492 | * parameter. | ||
493 | * It should be noticed, however, that new OFDM delivery systems like | ||
494 | * ISDB can use different modulation types for each group of carriers. | ||
495 | * On such standards, up to 8 groups of statistics can be provided, one | ||
496 | * for each carrier group (called "layer" on ISDB). | ||
497 | * In order to be consistent with other delivery systems, the first | ||
498 | * value refers to the entire set of carriers ("global"). | ||
499 | * dtv_status:scale should use the value FE_SCALE_NOT_AVAILABLE when | ||
500 | * the value for the entire group of carriers or from one specific layer | ||
501 | * is not provided by the hardware. | ||
502 | * st.len should be filled with the latest filled status + 1. | ||
503 | * | ||
504 | * In other words, for ISDB, those values should be filled like: | ||
505 | * u.st.stat.svalue[0] = global statistics; | ||
506 | * u.st.stat.scale[0] = FE_SCALE_DECIBELS; | ||
507 | * u.st.stat.value[1] = layer A statistics; | ||
508 | * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available); | ||
509 | * u.st.stat.svalue[2] = layer B statistics; | ||
510 | * u.st.stat.scale[2] = FE_SCALE_DECIBELS; | ||
511 | * u.st.stat.svalue[3] = layer C statistics; | ||
512 | * u.st.stat.scale[3] = FE_SCALE_DECIBELS; | ||
513 | * u.st.len = 4; | ||
514 | */ | ||
515 | struct dtv_stats { | ||
516 | __u8 scale; /* enum fecap_scale_params type */ | ||
517 | union { | ||
518 | __u64 uvalue; /* for counters and relative scales */ | ||
519 | __s64 svalue; /* for 0.0001 dB measures */ | ||
520 | }; | ||
521 | } __attribute__ ((packed)); | ||
522 | |||
523 | |||
524 | #define MAX_DTV_STATS 4 | ||
525 | |||
526 | struct dtv_fe_stats { | ||
527 | __u8 len; | ||
528 | struct dtv_stats stat[MAX_DTV_STATS]; | ||
529 | } __attribute__ ((packed)); | ||
530 | |||
455 | struct dtv_property { | 531 | struct dtv_property { |
456 | __u32 cmd; | 532 | __u32 cmd; |
457 | __u32 reserved[3]; | 533 | __u32 reserved[3]; |
458 | union { | 534 | union { |
459 | __u32 data; | 535 | __u32 data; |
536 | struct dtv_fe_stats st; | ||
460 | struct { | 537 | struct { |
461 | __u8 data[32]; | 538 | __u8 data[32]; |
462 | __u32 len; | 539 | __u32 len; |
diff --git a/include/uapi/linux/dvb/version.h b/include/uapi/linux/dvb/version.h index 827cce7e33e3..e53e2ad4444f 100644 --- a/include/uapi/linux/dvb/version.h +++ b/include/uapi/linux/dvb/version.h | |||
@@ -24,6 +24,6 @@ | |||
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
27 | #define DVB_API_VERSION_MINOR 9 | 27 | #define DVB_API_VERSION_MINOR 10 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 126a8175e3e2..900b9484445b 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h | |||
@@ -49,14 +49,14 @@ typedef __s64 Elf64_Sxword; | |||
49 | * | 49 | * |
50 | * Specifications are available in: | 50 | * Specifications are available in: |
51 | * | 51 | * |
52 | * - Sun microsystems: Linker and Libraries. | 52 | * - Oracle: Linker and Libraries. |
53 | * Part No: 817-1984-17, September 2008. | 53 | * Part No: 817–1984–19, August 2011. |
54 | * URL: http://docs.sun.com/app/docs/doc/817-1984 | 54 | * http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf |
55 | * | 55 | * |
56 | * - System V ABI AMD64 Architecture Processor Supplement | 56 | * - System V ABI AMD64 Architecture Processor Supplement |
57 | * Draft Version 0.99., | 57 | * Draft Version 0.99.4, |
58 | * May 11, 2009. | 58 | * January 13, 2010. |
59 | * URL: http://www.x86-64.org/ | 59 | * http://www.cs.washington.edu/education/courses/cse351/12wi/supp-docs/abi.pdf |
60 | */ | 60 | */ |
61 | #define PN_XNUM 0xffff | 61 | #define PN_XNUM 0xffff |
62 | 62 | ||
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 780d4c6093eb..c7fc1e6517c3 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h | |||
@@ -86,6 +86,9 @@ struct inodes_stat_t { | |||
86 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 86 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
87 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 87 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
88 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 88 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
89 | |||
90 | /* These sb flags are internal to the kernel */ | ||
91 | #define MS_SNAP_STABLE (1<<27) /* Snapshot pages during writeback, if needed */ | ||
89 | #define MS_NOSEC (1<<28) | 92 | #define MS_NOSEC (1<<28) |
90 | #define MS_BORN (1<<29) | 93 | #define MS_BORN (1<<29) |
91 | #define MS_ACTIVE (1<<30) | 94 | #define MS_ACTIVE (1<<30) |
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index d8c713e148e3..4c43b4448792 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h | |||
@@ -1,9 +1,35 @@ | |||
1 | /* | 1 | /* |
2 | FUSE: Filesystem in Userspace | 2 | This file defines the kernel interface of FUSE |
3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
4 | 4 | ||
5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
6 | See the file COPYING. | 6 | See the file COPYING. |
7 | |||
8 | This -- and only this -- header file may also be distributed under | ||
9 | the terms of the BSD Licence as follows: | ||
10 | |||
11 | Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved. | ||
12 | |||
13 | Redistribution and use in source and binary forms, with or without | ||
14 | modification, are permitted provided that the following conditions | ||
15 | are met: | ||
16 | 1. Redistributions of source code must retain the above copyright | ||
17 | notice, this list of conditions and the following disclaimer. | ||
18 | 2. Redistributions in binary form must reproduce the above copyright | ||
19 | notice, this list of conditions and the following disclaimer in the | ||
20 | documentation and/or other materials provided with the distribution. | ||
21 | |||
22 | THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE | ||
26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
28 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
31 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
32 | SUCH DAMAGE. | ||
7 | */ | 33 | */ |
8 | 34 | ||
9 | /* | 35 | /* |
@@ -60,12 +86,25 @@ | |||
60 | * | 86 | * |
61 | * 7.20 | 87 | * 7.20 |
62 | * - add FUSE_AUTO_INVAL_DATA | 88 | * - add FUSE_AUTO_INVAL_DATA |
89 | * | ||
90 | * 7.21 | ||
91 | * - add FUSE_READDIRPLUS | ||
92 | * - send the requested events in POLL request | ||
63 | */ | 93 | */ |
64 | 94 | ||
65 | #ifndef _LINUX_FUSE_H | 95 | #ifndef _LINUX_FUSE_H |
66 | #define _LINUX_FUSE_H | 96 | #define _LINUX_FUSE_H |
67 | 97 | ||
98 | #ifdef __linux__ | ||
68 | #include <linux/types.h> | 99 | #include <linux/types.h> |
100 | #else | ||
101 | #include <stdint.h> | ||
102 | #define __u64 uint64_t | ||
103 | #define __s64 int64_t | ||
104 | #define __u32 uint32_t | ||
105 | #define __s32 int32_t | ||
106 | #define __u16 uint16_t | ||
107 | #endif | ||
69 | 108 | ||
70 | /* | 109 | /* |
71 | * Version negotiation: | 110 | * Version negotiation: |
@@ -91,7 +130,7 @@ | |||
91 | #define FUSE_KERNEL_VERSION 7 | 130 | #define FUSE_KERNEL_VERSION 7 |
92 | 131 | ||
93 | /** Minor version number of this interface */ | 132 | /** Minor version number of this interface */ |
94 | #define FUSE_KERNEL_MINOR_VERSION 20 | 133 | #define FUSE_KERNEL_MINOR_VERSION 21 |
95 | 134 | ||
96 | /** The node ID of the root inode */ | 135 | /** The node ID of the root inode */ |
97 | #define FUSE_ROOT_ID 1 | 136 | #define FUSE_ROOT_ID 1 |
@@ -179,6 +218,8 @@ struct fuse_file_lock { | |||
179 | * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks | 218 | * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks |
180 | * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories | 219 | * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories |
181 | * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages | 220 | * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages |
221 | * FUSE_DO_READDIRPLUS: do READDIRPLUS (READDIR+LOOKUP in one) | ||
222 | * FUSE_READDIRPLUS_AUTO: adaptive readdirplus | ||
182 | */ | 223 | */ |
183 | #define FUSE_ASYNC_READ (1 << 0) | 224 | #define FUSE_ASYNC_READ (1 << 0) |
184 | #define FUSE_POSIX_LOCKS (1 << 1) | 225 | #define FUSE_POSIX_LOCKS (1 << 1) |
@@ -193,6 +234,8 @@ struct fuse_file_lock { | |||
193 | #define FUSE_FLOCK_LOCKS (1 << 10) | 234 | #define FUSE_FLOCK_LOCKS (1 << 10) |
194 | #define FUSE_HAS_IOCTL_DIR (1 << 11) | 235 | #define FUSE_HAS_IOCTL_DIR (1 << 11) |
195 | #define FUSE_AUTO_INVAL_DATA (1 << 12) | 236 | #define FUSE_AUTO_INVAL_DATA (1 << 12) |
237 | #define FUSE_DO_READDIRPLUS (1 << 13) | ||
238 | #define FUSE_READDIRPLUS_AUTO (1 << 14) | ||
196 | 239 | ||
197 | /** | 240 | /** |
198 | * CUSE INIT request/reply flags | 241 | * CUSE INIT request/reply flags |
@@ -299,6 +342,7 @@ enum fuse_opcode { | |||
299 | FUSE_NOTIFY_REPLY = 41, | 342 | FUSE_NOTIFY_REPLY = 41, |
300 | FUSE_BATCH_FORGET = 42, | 343 | FUSE_BATCH_FORGET = 42, |
301 | FUSE_FALLOCATE = 43, | 344 | FUSE_FALLOCATE = 43, |
345 | FUSE_READDIRPLUS = 44, | ||
302 | 346 | ||
303 | /* CUSE specific operations */ | 347 | /* CUSE specific operations */ |
304 | CUSE_INIT = 4096, | 348 | CUSE_INIT = 4096, |
@@ -580,7 +624,7 @@ struct fuse_poll_in { | |||
580 | __u64 fh; | 624 | __u64 fh; |
581 | __u64 kh; | 625 | __u64 kh; |
582 | __u32 flags; | 626 | __u32 flags; |
583 | __u32 padding; | 627 | __u32 events; |
584 | }; | 628 | }; |
585 | 629 | ||
586 | struct fuse_poll_out { | 630 | struct fuse_poll_out { |
@@ -630,6 +674,16 @@ struct fuse_dirent { | |||
630 | #define FUSE_DIRENT_SIZE(d) \ | 674 | #define FUSE_DIRENT_SIZE(d) \ |
631 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 675 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
632 | 676 | ||
677 | struct fuse_direntplus { | ||
678 | struct fuse_entry_out entry_out; | ||
679 | struct fuse_dirent dirent; | ||
680 | }; | ||
681 | |||
682 | #define FUSE_NAME_OFFSET_DIRENTPLUS \ | ||
683 | offsetof(struct fuse_direntplus, dirent.name) | ||
684 | #define FUSE_DIRENTPLUS_SIZE(d) \ | ||
685 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen) | ||
686 | |||
633 | struct fuse_notify_inval_inode_out { | 687 | struct fuse_notify_inval_inode_out { |
634 | __u64 ino; | 688 | __u64 ino; |
635 | __s64 off; | 689 | __s64 off; |
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index 5db297514aec..2d70d79ce2fd 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
@@ -108,15 +108,26 @@ struct __fdb_entry { | |||
108 | * [IFLA_AF_SPEC] = { | 108 | * [IFLA_AF_SPEC] = { |
109 | * [IFLA_BRIDGE_FLAGS] | 109 | * [IFLA_BRIDGE_FLAGS] |
110 | * [IFLA_BRIDGE_MODE] | 110 | * [IFLA_BRIDGE_MODE] |
111 | * [IFLA_BRIDGE_VLAN_INFO] | ||
111 | * } | 112 | * } |
112 | */ | 113 | */ |
113 | enum { | 114 | enum { |
114 | IFLA_BRIDGE_FLAGS, | 115 | IFLA_BRIDGE_FLAGS, |
115 | IFLA_BRIDGE_MODE, | 116 | IFLA_BRIDGE_MODE, |
117 | IFLA_BRIDGE_VLAN_INFO, | ||
116 | __IFLA_BRIDGE_MAX, | 118 | __IFLA_BRIDGE_MAX, |
117 | }; | 119 | }; |
118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | 120 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) |
119 | 121 | ||
122 | #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */ | ||
123 | #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */ | ||
124 | #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */ | ||
125 | |||
126 | struct bridge_vlan_info { | ||
127 | __u16 flags; | ||
128 | __u16 vid; | ||
129 | }; | ||
130 | |||
120 | /* Bridge multicast database attributes | 131 | /* Bridge multicast database attributes |
121 | * [MDBA_MDB] = { | 132 | * [MDBA_MDB] = { |
122 | * [MDBA_MDB_ENTRY] = { | 133 | * [MDBA_MDB_ENTRY] = { |
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 67fb87ca1094..798032d01112 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h | |||
@@ -83,6 +83,7 @@ | |||
83 | #define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */ | 83 | #define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */ |
84 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 84 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
85 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ | 85 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ |
86 | #define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */ | ||
86 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ | 87 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ |
87 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 88 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
88 | #define ETH_P_TDLS 0x890D /* TDLS */ | 89 | #define ETH_P_TDLS 0x890D /* TDLS */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 60f3b6b90602..c4edfe11f1f7 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -142,6 +142,7 @@ enum { | |||
142 | #define IFLA_PROMISCUITY IFLA_PROMISCUITY | 142 | #define IFLA_PROMISCUITY IFLA_PROMISCUITY |
143 | IFLA_NUM_TX_QUEUES, | 143 | IFLA_NUM_TX_QUEUES, |
144 | IFLA_NUM_RX_QUEUES, | 144 | IFLA_NUM_RX_QUEUES, |
145 | IFLA_CARRIER, | ||
145 | __IFLA_MAX | 146 | __IFLA_MAX |
146 | }; | 147 | }; |
147 | 148 | ||
diff --git a/include/uapi/linux/if_vlan.h b/include/uapi/linux/if_vlan.h index 0744f8e65d15..7e5e6b397332 100644 --- a/include/uapi/linux/if_vlan.h +++ b/include/uapi/linux/if_vlan.h | |||
@@ -34,6 +34,7 @@ enum vlan_flags { | |||
34 | VLAN_FLAG_REORDER_HDR = 0x1, | 34 | VLAN_FLAG_REORDER_HDR = 0x1, |
35 | VLAN_FLAG_GVRP = 0x2, | 35 | VLAN_FLAG_GVRP = 0x2, |
36 | VLAN_FLAG_LOOSE_BINDING = 0x4, | 36 | VLAN_FLAG_LOOSE_BINDING = 0x4, |
37 | VLAN_FLAG_MVRP = 0x8, | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | enum vlan_name_types { | 40 | enum vlan_name_types { |
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index f79c3721da6e..53b1d56a6e7f 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
@@ -38,11 +38,6 @@ struct in6_addr { | |||
38 | #define s6_addr32 in6_u.u6_addr32 | 38 | #define s6_addr32 in6_u.u6_addr32 |
39 | }; | 39 | }; |
40 | 40 | ||
41 | /* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553 | ||
42 | * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined | ||
43 | * in network byte order, not in host byte order as are the IPv4 equivalents | ||
44 | */ | ||
45 | |||
46 | struct sockaddr_in6 { | 41 | struct sockaddr_in6 { |
47 | unsigned short int sin6_family; /* AF_INET6 */ | 42 | unsigned short int sin6_family; /* AF_INET6 */ |
48 | __be16 sin6_port; /* Transport layer port # */ | 43 | __be16 sin6_port; /* Transport layer port # */ |
@@ -264,17 +259,10 @@ struct in6_flowlabel_req { | |||
264 | 259 | ||
265 | /* | 260 | /* |
266 | * Multicast Routing: | 261 | * Multicast Routing: |
267 | * see include/linux/mroute6.h. | 262 | * see include/uapi/linux/mroute6.h. |
268 | * | 263 | * |
269 | * MRT6_INIT 200 | 264 | * MRT6_BASE 200 |
270 | * MRT6_DONE 201 | 265 | * ... |
271 | * MRT6_ADD_MIF 202 | 266 | * MRT6_MAX |
272 | * MRT6_DEL_MIF 203 | ||
273 | * MRT6_ADD_MFC 204 | ||
274 | * MRT6_DEL_MFC 205 | ||
275 | * MRT6_VERSION 206 | ||
276 | * MRT6_ASSERT 207 | ||
277 | * MRT6_PIM 208 | ||
278 | * (reserved) 209 | ||
279 | */ | 267 | */ |
280 | #endif /* _UAPI_LINUX_IN6_H */ | 268 | #endif /* _UAPI_LINUX_IN6_H */ |
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index 5a2991cf0251..4bda4cf5b0f5 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
@@ -63,6 +63,8 @@ struct ipv6_opt_hdr { | |||
63 | #define ipv6_destopt_hdr ipv6_opt_hdr | 63 | #define ipv6_destopt_hdr ipv6_opt_hdr |
64 | #define ipv6_hopopt_hdr ipv6_opt_hdr | 64 | #define ipv6_hopopt_hdr ipv6_opt_hdr |
65 | 65 | ||
66 | /* Router Alert option values (RFC2711) */ | ||
67 | #define IPV6_OPT_ROUTERALERT_MLD 0x0000 /* MLD(RFC2710) */ | ||
66 | 68 | ||
67 | /* | 69 | /* |
68 | * routing header type 0 (used in cmsghdr struct) | 70 | * routing header type 0 (used in cmsghdr struct) |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index e6e5d4b13708..3c56ba3d80c1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -115,6 +115,7 @@ struct kvm_irq_level { | |||
115 | * ACPI gsi notion of irq. | 115 | * ACPI gsi notion of irq. |
116 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. | 116 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. |
117 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. | 117 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. |
118 | * For ARM: See Documentation/virtual/kvm/api.txt | ||
118 | */ | 119 | */ |
119 | union { | 120 | union { |
120 | __u32 irq; | 121 | __u32 irq; |
@@ -168,6 +169,8 @@ struct kvm_pit_config { | |||
168 | #define KVM_EXIT_PAPR_HCALL 19 | 169 | #define KVM_EXIT_PAPR_HCALL 19 |
169 | #define KVM_EXIT_S390_UCONTROL 20 | 170 | #define KVM_EXIT_S390_UCONTROL 20 |
170 | #define KVM_EXIT_WATCHDOG 21 | 171 | #define KVM_EXIT_WATCHDOG 21 |
172 | #define KVM_EXIT_S390_TSCH 22 | ||
173 | #define KVM_EXIT_EPR 23 | ||
171 | 174 | ||
172 | /* For KVM_EXIT_INTERNAL_ERROR */ | 175 | /* For KVM_EXIT_INTERNAL_ERROR */ |
173 | /* Emulate instruction failed. */ | 176 | /* Emulate instruction failed. */ |
@@ -285,6 +288,19 @@ struct kvm_run { | |||
285 | __u64 ret; | 288 | __u64 ret; |
286 | __u64 args[9]; | 289 | __u64 args[9]; |
287 | } papr_hcall; | 290 | } papr_hcall; |
291 | /* KVM_EXIT_S390_TSCH */ | ||
292 | struct { | ||
293 | __u16 subchannel_id; | ||
294 | __u16 subchannel_nr; | ||
295 | __u32 io_int_parm; | ||
296 | __u32 io_int_word; | ||
297 | __u32 ipb; | ||
298 | __u8 dequeued; | ||
299 | } s390_tsch; | ||
300 | /* KVM_EXIT_EPR */ | ||
301 | struct { | ||
302 | __u32 epr; | ||
303 | } epr; | ||
288 | /* Fix the size of the union. */ | 304 | /* Fix the size of the union. */ |
289 | char padding[256]; | 305 | char padding[256]; |
290 | }; | 306 | }; |
@@ -397,10 +413,20 @@ struct kvm_s390_psw { | |||
397 | #define KVM_S390_PROGRAM_INT 0xfffe0001u | 413 | #define KVM_S390_PROGRAM_INT 0xfffe0001u |
398 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u | 414 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u |
399 | #define KVM_S390_RESTART 0xfffe0003u | 415 | #define KVM_S390_RESTART 0xfffe0003u |
416 | #define KVM_S390_MCHK 0xfffe1000u | ||
400 | #define KVM_S390_INT_VIRTIO 0xffff2603u | 417 | #define KVM_S390_INT_VIRTIO 0xffff2603u |
401 | #define KVM_S390_INT_SERVICE 0xffff2401u | 418 | #define KVM_S390_INT_SERVICE 0xffff2401u |
402 | #define KVM_S390_INT_EMERGENCY 0xffff1201u | 419 | #define KVM_S390_INT_EMERGENCY 0xffff1201u |
403 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u | 420 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u |
421 | /* Anything below 0xfffe0000u is taken by INT_IO */ | ||
422 | #define KVM_S390_INT_IO(ai,cssid,ssid,schid) \ | ||
423 | (((schid)) | \ | ||
424 | ((ssid) << 16) | \ | ||
425 | ((cssid) << 18) | \ | ||
426 | ((ai) << 26)) | ||
427 | #define KVM_S390_INT_IO_MIN 0x00000000u | ||
428 | #define KVM_S390_INT_IO_MAX 0xfffdffffu | ||
429 | |||
404 | 430 | ||
405 | struct kvm_s390_interrupt { | 431 | struct kvm_s390_interrupt { |
406 | __u32 type; | 432 | __u32 type; |
@@ -635,6 +661,10 @@ struct kvm_ppc_smmu_info { | |||
635 | #define KVM_CAP_IRQFD_RESAMPLE 82 | 661 | #define KVM_CAP_IRQFD_RESAMPLE 82 |
636 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 | 662 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 |
637 | #define KVM_CAP_PPC_HTAB_FD 84 | 663 | #define KVM_CAP_PPC_HTAB_FD 84 |
664 | #define KVM_CAP_S390_CSS_SUPPORT 85 | ||
665 | #define KVM_CAP_PPC_EPR 86 | ||
666 | #define KVM_CAP_ARM_PSCI 87 | ||
667 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 | ||
638 | 668 | ||
639 | #ifdef KVM_CAP_IRQ_ROUTING | 669 | #ifdef KVM_CAP_IRQ_ROUTING |
640 | 670 | ||
@@ -764,6 +794,11 @@ struct kvm_dirty_tlb { | |||
764 | #define KVM_REG_SIZE_U512 0x0060000000000000ULL | 794 | #define KVM_REG_SIZE_U512 0x0060000000000000ULL |
765 | #define KVM_REG_SIZE_U1024 0x0070000000000000ULL | 795 | #define KVM_REG_SIZE_U1024 0x0070000000000000ULL |
766 | 796 | ||
797 | struct kvm_reg_list { | ||
798 | __u64 n; /* number of regs */ | ||
799 | __u64 reg[0]; | ||
800 | }; | ||
801 | |||
767 | struct kvm_one_reg { | 802 | struct kvm_one_reg { |
768 | __u64 id; | 803 | __u64 id; |
769 | __u64 addr; | 804 | __u64 addr; |
@@ -777,6 +812,11 @@ struct kvm_msi { | |||
777 | __u8 pad[16]; | 812 | __u8 pad[16]; |
778 | }; | 813 | }; |
779 | 814 | ||
815 | struct kvm_arm_device_addr { | ||
816 | __u64 id; | ||
817 | __u64 addr; | ||
818 | }; | ||
819 | |||
780 | /* | 820 | /* |
781 | * ioctls for VM fds | 821 | * ioctls for VM fds |
782 | */ | 822 | */ |
@@ -862,6 +902,8 @@ struct kvm_s390_ucas_mapping { | |||
862 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) | 902 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) |
863 | /* Available with KVM_CAP_PPC_HTAB_FD */ | 903 | /* Available with KVM_CAP_PPC_HTAB_FD */ |
864 | #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd) | 904 | #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd) |
905 | /* Available with KVM_CAP_ARM_SET_DEVICE_ADDR */ | ||
906 | #define KVM_ARM_SET_DEVICE_ADDR _IOW(KVMIO, 0xab, struct kvm_arm_device_addr) | ||
865 | 907 | ||
866 | /* | 908 | /* |
867 | * ioctls for vcpu fds | 909 | * ioctls for vcpu fds |
@@ -932,6 +974,8 @@ struct kvm_s390_ucas_mapping { | |||
932 | #define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg) | 974 | #define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg) |
933 | /* VM is being stopped by host */ | 975 | /* VM is being stopped by host */ |
934 | #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad) | 976 | #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad) |
977 | #define KVM_ARM_VCPU_INIT _IOW(KVMIO, 0xae, struct kvm_vcpu_init) | ||
978 | #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list) | ||
935 | 979 | ||
936 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 980 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
937 | #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) | 981 | #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) |
diff --git a/include/uapi/linux/meye.h b/include/uapi/linux/meye.h index 0dd49954f746..8ff50fe9e481 100644 --- a/include/uapi/linux/meye.h +++ b/include/uapi/linux/meye.h | |||
@@ -57,10 +57,8 @@ struct meye_params { | |||
57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int) | 57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int) |
58 | 58 | ||
59 | /* V4L2 private controls */ | 59 | /* V4L2 private controls */ |
60 | #define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE | 60 | #define V4L2_CID_MEYE_AGC (V4L2_CID_USER_MEYE_BASE + 0) |
61 | #define V4L2_CID_MEYE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1) | 61 | #define V4L2_CID_MEYE_PICTURE (V4L2_CID_USER_MEYE_BASE + 1) |
62 | #define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2) | 62 | #define V4L2_CID_MEYE_FRAMERATE (V4L2_CID_USER_MEYE_BASE + 2) |
63 | #define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3) | ||
64 | #define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4) | ||
65 | 63 | ||
66 | #endif | 64 | #endif |
diff --git a/include/uapi/linux/mroute.h b/include/uapi/linux/mroute.h index 16929993acc4..a382d2c04a42 100644 --- a/include/uapi/linux/mroute.h +++ b/include/uapi/linux/mroute.h | |||
@@ -26,6 +26,9 @@ | |||
26 | #define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ | 26 | #define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ |
27 | #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ | 27 | #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ |
28 | #define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */ | 28 | #define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */ |
29 | #define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */ | ||
30 | #define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */ | ||
31 | #define MRT_MAX (MRT_BASE+11) | ||
29 | 32 | ||
30 | #define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ | 33 | #define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ |
31 | #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) | 34 | #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) |
diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h index 3e89b5e7f9e3..ce91215cf7e6 100644 --- a/include/uapi/linux/mroute6.h +++ b/include/uapi/linux/mroute6.h | |||
@@ -26,6 +26,9 @@ | |||
26 | #define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ | 26 | #define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ |
27 | #define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ | 27 | #define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ |
28 | #define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */ | 28 | #define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */ |
29 | #define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */ | ||
30 | #define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */ | ||
31 | #define MRT6_MAX (MRT6_BASE+11) | ||
29 | 32 | ||
30 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ | 33 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ |
31 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) | 34 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) |
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h index 275e5d65dcb2..adb068c53c4e 100644 --- a/include/uapi/linux/neighbour.h +++ b/include/uapi/linux/neighbour.h | |||
@@ -20,6 +20,7 @@ enum { | |||
20 | NDA_LLADDR, | 20 | NDA_LLADDR, |
21 | NDA_CACHEINFO, | 21 | NDA_CACHEINFO, |
22 | NDA_PROBES, | 22 | NDA_PROBES, |
23 | NDA_VLAN, | ||
23 | __NDA_MAX | 24 | __NDA_MAX |
24 | }; | 25 | }; |
25 | 26 | ||
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild index 08f555fef13f..41115776d76f 100644 --- a/include/uapi/linux/netfilter/Kbuild +++ b/include/uapi/linux/netfilter/Kbuild | |||
@@ -35,9 +35,11 @@ header-y += xt_TCPOPTSTRIP.h | |||
35 | header-y += xt_TEE.h | 35 | header-y += xt_TEE.h |
36 | header-y += xt_TPROXY.h | 36 | header-y += xt_TPROXY.h |
37 | header-y += xt_addrtype.h | 37 | header-y += xt_addrtype.h |
38 | header-y += xt_bpf.h | ||
38 | header-y += xt_cluster.h | 39 | header-y += xt_cluster.h |
39 | header-y += xt_comment.h | 40 | header-y += xt_comment.h |
40 | header-y += xt_connbytes.h | 41 | header-y += xt_connbytes.h |
42 | header-y += xt_connlabel.h | ||
41 | header-y += xt_connlimit.h | 43 | header-y += xt_connlimit.h |
42 | header-y += xt_connmark.h | 44 | header-y += xt_connmark.h |
43 | header-y += xt_conntrack.h | 45 | header-y += xt_conntrack.h |
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h index 1644cdd8be91..d69483fb3825 100644 --- a/include/uapi/linux/netfilter/nf_conntrack_common.h +++ b/include/uapi/linux/netfilter/nf_conntrack_common.h | |||
@@ -101,6 +101,7 @@ enum ip_conntrack_events { | |||
101 | IPCT_MARK, /* new mark has been set */ | 101 | IPCT_MARK, /* new mark has been set */ |
102 | IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ | 102 | IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ |
103 | IPCT_SECMARK, /* new security mark has been set */ | 103 | IPCT_SECMARK, /* new security mark has been set */ |
104 | IPCT_LABEL, /* new connlabel has been set */ | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | enum ip_conntrack_expect_events { | 107 | enum ip_conntrack_expect_events { |
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h index 86e930cf3dfb..08fabc6c93f3 100644 --- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h +++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -49,6 +49,8 @@ enum ctattr_type { | |||
49 | CTA_SECCTX, | 49 | CTA_SECCTX, |
50 | CTA_TIMESTAMP, | 50 | CTA_TIMESTAMP, |
51 | CTA_MARK_MASK, | 51 | CTA_MARK_MASK, |
52 | CTA_LABELS, | ||
53 | CTA_LABELS_MASK, | ||
52 | __CTA_MAX | 54 | __CTA_MAX |
53 | }; | 55 | }; |
54 | #define CTA_MAX (__CTA_MAX - 1) | 56 | #define CTA_MAX (__CTA_MAX - 1) |
diff --git a/include/uapi/linux/netfilter/xt_CT.h b/include/uapi/linux/netfilter/xt_CT.h index a064b8af360c..5a688c1ca4d7 100644 --- a/include/uapi/linux/netfilter/xt_CT.h +++ b/include/uapi/linux/netfilter/xt_CT.h | |||
@@ -3,7 +3,11 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | #define XT_CT_NOTRACK 0x1 | 6 | enum { |
7 | XT_CT_NOTRACK = 1 << 0, | ||
8 | XT_CT_NOTRACK_ALIAS = 1 << 1, | ||
9 | XT_CT_MASK = XT_CT_NOTRACK | XT_CT_NOTRACK_ALIAS, | ||
10 | }; | ||
7 | 11 | ||
8 | struct xt_ct_target_info { | 12 | struct xt_ct_target_info { |
9 | __u16 flags; | 13 | __u16 flags; |
diff --git a/include/uapi/linux/netfilter/xt_bpf.h b/include/uapi/linux/netfilter/xt_bpf.h new file mode 100644 index 000000000000..5dda450eb55b --- /dev/null +++ b/include/uapi/linux/netfilter/xt_bpf.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _XT_BPF_H | ||
2 | #define _XT_BPF_H | ||
3 | |||
4 | #include <linux/filter.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | #define XT_BPF_MAX_NUM_INSTR 64 | ||
8 | |||
9 | struct xt_bpf_info { | ||
10 | __u16 bpf_program_num_elem; | ||
11 | struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR]; | ||
12 | |||
13 | /* only used in the kernel */ | ||
14 | struct sk_filter *filter __attribute__((aligned(8))); | ||
15 | }; | ||
16 | |||
17 | #endif /*_XT_BPF_H */ | ||
diff --git a/include/uapi/linux/netfilter/xt_connlabel.h b/include/uapi/linux/netfilter/xt_connlabel.h new file mode 100644 index 000000000000..c4bc9ee9b330 --- /dev/null +++ b/include/uapi/linux/netfilter/xt_connlabel.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #include <linux/types.h> | ||
2 | |||
3 | #define XT_CONNLABEL_MAXBIT 127 | ||
4 | enum xt_connlabel_mtopts { | ||
5 | XT_CONNLABEL_OP_INVERT = 1 << 0, | ||
6 | XT_CONNLABEL_OP_SET = 1 << 1, | ||
7 | }; | ||
8 | |||
9 | struct xt_connlabel_mtinfo { | ||
10 | __u16 bit; | ||
11 | __u16 options; | ||
12 | }; | ||
diff --git a/include/uapi/linux/netfilter/xt_conntrack.h b/include/uapi/linux/netfilter/xt_conntrack.h index e3c041d54020..e5bd3083a843 100644 --- a/include/uapi/linux/netfilter/xt_conntrack.h +++ b/include/uapi/linux/netfilter/xt_conntrack.h | |||
@@ -31,6 +31,7 @@ enum { | |||
31 | XT_CONNTRACK_REPLSRC_PORT = 1 << 10, | 31 | XT_CONNTRACK_REPLSRC_PORT = 1 << 10, |
32 | XT_CONNTRACK_REPLDST_PORT = 1 << 11, | 32 | XT_CONNTRACK_REPLDST_PORT = 1 << 11, |
33 | XT_CONNTRACK_DIRECTION = 1 << 12, | 33 | XT_CONNTRACK_DIRECTION = 1 << 12, |
34 | XT_CONNTRACK_STATE_ALIAS = 1 << 13, | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | struct xt_conntrack_mtinfo1 { | 37 | struct xt_conntrack_mtinfo1 { |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 0e63cee8d810..7969f46f1bb3 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -5,20 +5,17 @@ | |||
5 | * Lauro Ramos Venancio <lauro.venancio@openbossa.org> | 5 | * Lauro Ramos Venancio <lauro.venancio@openbossa.org> |
6 | * Aloisio Almeida Jr <aloisio.almeida@openbossa.org> | 6 | * Aloisio Almeida Jr <aloisio.almeida@openbossa.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * Permission to use, copy, modify, and/or distribute this software for any |
9 | * it under the terms of the GNU General Public License as published by | 9 | * purpose with or without fee is hereby granted, provided that the above |
10 | * the Free Software Foundation; either version 2 of the License, or | 10 | * copyright notice and this permission notice appear in all copies. |
11 | * (at your option) any later version. | ||
12 | * | 11 | * |
13 | * This program is distributed in the hope that it will be useful, | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
16 | * GNU General Public License for more details. | 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
17 | * | 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
18 | * You should have received a copy of the GNU General Public License | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
19 | * along with this program; if not, write to the | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
20 | * Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | 19 | */ |
23 | 20 | ||
24 | #ifndef __LINUX_NFC_H | 21 | #ifndef __LINUX_NFC_H |
@@ -67,6 +64,11 @@ | |||
67 | * subsequent CONNECT and CC messages. | 64 | * subsequent CONNECT and CC messages. |
68 | * If one of the passed parameters is wrong none is set and -EINVAL is | 65 | * If one of the passed parameters is wrong none is set and -EINVAL is |
69 | * returned. | 66 | * returned. |
67 | * @NFC_CMD_ENABLE_SE: Enable the physical link to a specific secure element. | ||
68 | * Once enabled a secure element will handle card emulation mode, i.e. | ||
69 | * starting a poll from a device which has a secure element enabled means | ||
70 | * we want to do SE based card emulation. | ||
71 | * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. | ||
70 | */ | 72 | */ |
71 | enum nfc_commands { | 73 | enum nfc_commands { |
72 | NFC_CMD_UNSPEC, | 74 | NFC_CMD_UNSPEC, |
@@ -86,6 +88,8 @@ enum nfc_commands { | |||
86 | NFC_EVENT_TM_DEACTIVATED, | 88 | NFC_EVENT_TM_DEACTIVATED, |
87 | NFC_CMD_LLC_GET_PARAMS, | 89 | NFC_CMD_LLC_GET_PARAMS, |
88 | NFC_CMD_LLC_SET_PARAMS, | 90 | NFC_CMD_LLC_SET_PARAMS, |
91 | NFC_CMD_ENABLE_SE, | ||
92 | NFC_CMD_DISABLE_SE, | ||
89 | /* private: internal use only */ | 93 | /* private: internal use only */ |
90 | __NFC_CMD_AFTER_LAST | 94 | __NFC_CMD_AFTER_LAST |
91 | }; | 95 | }; |
@@ -114,6 +118,7 @@ enum nfc_commands { | |||
114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | 118 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter |
115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | 119 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter |
116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | 120 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter |
121 | * @NFC_ATTR_SE: Available Secure Elements | ||
117 | */ | 122 | */ |
118 | enum nfc_attrs { | 123 | enum nfc_attrs { |
119 | NFC_ATTR_UNSPEC, | 124 | NFC_ATTR_UNSPEC, |
@@ -134,6 +139,7 @@ enum nfc_attrs { | |||
134 | NFC_ATTR_LLC_PARAM_LTO, | 139 | NFC_ATTR_LLC_PARAM_LTO, |
135 | NFC_ATTR_LLC_PARAM_RW, | 140 | NFC_ATTR_LLC_PARAM_RW, |
136 | NFC_ATTR_LLC_PARAM_MIUX, | 141 | NFC_ATTR_LLC_PARAM_MIUX, |
142 | NFC_ATTR_SE, | ||
137 | /* private: internal use only */ | 143 | /* private: internal use only */ |
138 | __NFC_ATTR_AFTER_LAST | 144 | __NFC_ATTR_AFTER_LAST |
139 | }; | 145 | }; |
@@ -172,6 +178,11 @@ enum nfc_attrs { | |||
172 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) | 178 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) |
173 | #define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) | 179 | #define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) |
174 | 180 | ||
181 | /* NFC Secure Elements */ | ||
182 | #define NFC_SE_NONE 0x0 | ||
183 | #define NFC_SE_UICC 0x1 | ||
184 | #define NFC_SE_EMBEDDED 0x2 | ||
185 | |||
175 | struct sockaddr_nfc { | 186 | struct sockaddr_nfc { |
176 | sa_family_t sa_family; | 187 | sa_family_t sa_family; |
177 | __u32 dev_idx; | 188 | __u32 dev_idx; |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index e3e19f8b16f2..c46bb016f4e4 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -170,7 +170,8 @@ | |||
170 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, | 170 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, |
171 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 171 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
172 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 172 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
173 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 173 | * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, |
174 | * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. | ||
174 | * The channel to use can be set on the interface or be given using the | 175 | * The channel to use can be set on the interface or be given using the |
175 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. | 176 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. |
176 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 177 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
@@ -374,8 +375,8 @@ | |||
374 | * requests to connect to a specified network but without separating | 375 | * requests to connect to a specified network but without separating |
375 | * auth and assoc steps. For this, you need to specify the SSID in a | 376 | * auth and assoc steps. For this, you need to specify the SSID in a |
376 | * %NL80211_ATTR_SSID attribute, and can optionally specify the association | 377 | * %NL80211_ATTR_SSID attribute, and can optionally specify the association |
377 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, | 378 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, |
378 | * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, | 379 | * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, |
379 | * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and | 380 | * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and |
380 | * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. | 381 | * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. |
381 | * Background scan period can optionally be | 382 | * Background scan period can optionally be |
@@ -512,6 +513,12 @@ | |||
512 | * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For | 513 | * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For |
513 | * more background information, see | 514 | * more background information, see |
514 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. | 515 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. |
516 | * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification | ||
517 | * from the driver reporting the wakeup reason. In this case, the | ||
518 | * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason | ||
519 | * for the wakeup, if it was caused by wireless. If it is not present | ||
520 | * in the wakeup notification, the wireless device didn't cause the | ||
521 | * wakeup but reports that it was woken up. | ||
515 | * | 522 | * |
516 | * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver | 523 | * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver |
517 | * the necessary information for supporting GTK rekey offload. This | 524 | * the necessary information for supporting GTK rekey offload. This |
@@ -586,6 +593,24 @@ | |||
586 | * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames | 593 | * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames |
587 | * for IBSS or MESH vif. | 594 | * for IBSS or MESH vif. |
588 | * | 595 | * |
596 | * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control. | ||
597 | * This is to be used with the drivers advertising the support of MAC | ||
598 | * address based access control. List of MAC addresses is passed in | ||
599 | * %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in | ||
600 | * %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it | ||
601 | * is not already done. The new list will replace any existing list. Driver | ||
602 | * will clear its ACL when the list of MAC addresses passed is empty. This | ||
603 | * command is used in AP/P2P GO mode. Driver has to make sure to clear its | ||
604 | * ACL list during %NL80211_CMD_STOP_AP. | ||
605 | * | ||
606 | * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once | ||
607 | * a radar is detected or the channel availability scan (CAC) has finished | ||
608 | * or was aborted, or a radar was detected, usermode will be notified with | ||
609 | * this event. This command is also used to notify userspace about radars | ||
610 | * while operating on this channel. | ||
611 | * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the | ||
612 | * event. | ||
613 | * | ||
589 | * @NL80211_CMD_MAX: highest used command number | 614 | * @NL80211_CMD_MAX: highest used command number |
590 | * @__NL80211_CMD_AFTER_LAST: internal use | 615 | * @__NL80211_CMD_AFTER_LAST: internal use |
591 | */ | 616 | */ |
@@ -736,6 +761,10 @@ enum nl80211_commands { | |||
736 | 761 | ||
737 | NL80211_CMD_SET_MCAST_RATE, | 762 | NL80211_CMD_SET_MCAST_RATE, |
738 | 763 | ||
764 | NL80211_CMD_SET_MAC_ACL, | ||
765 | |||
766 | NL80211_CMD_RADAR_DETECT, | ||
767 | |||
739 | /* add new commands above here */ | 768 | /* add new commands above here */ |
740 | 769 | ||
741 | /* used to define NL80211_CMD_MAX below */ | 770 | /* used to define NL80211_CMD_MAX below */ |
@@ -958,7 +987,7 @@ enum nl80211_commands { | |||
958 | * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is | 987 | * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is |
959 | * used for the association (&enum nl80211_mfp, represented as a u32); | 988 | * used for the association (&enum nl80211_mfp, represented as a u32); |
960 | * this attribute can be used | 989 | * this attribute can be used |
961 | * with %NL80211_CMD_ASSOCIATE request | 990 | * with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests |
962 | * | 991 | * |
963 | * @NL80211_ATTR_STA_FLAGS2: Attribute containing a | 992 | * @NL80211_ATTR_STA_FLAGS2: Attribute containing a |
964 | * &struct nl80211_sta_flag_update. | 993 | * &struct nl80211_sta_flag_update. |
@@ -1310,6 +1339,35 @@ enum nl80211_commands { | |||
1310 | * if not given in START_AP 0 is assumed, if not given in SET_BSS | 1339 | * if not given in START_AP 0 is assumed, if not given in SET_BSS |
1311 | * no change is made. | 1340 | * no change is made. |
1312 | * | 1341 | * |
1342 | * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode | ||
1343 | * defined in &enum nl80211_mesh_power_mode. | ||
1344 | * | ||
1345 | * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy, | ||
1346 | * carried in a u32 attribute | ||
1347 | * | ||
1348 | * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for | ||
1349 | * MAC ACL. | ||
1350 | * | ||
1351 | * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum | ||
1352 | * number of MAC addresses that a device can support for MAC | ||
1353 | * ACL. | ||
1354 | * | ||
1355 | * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace, | ||
1356 | * contains a value of enum nl80211_radar_event (u32). | ||
1357 | * | ||
1358 | * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver | ||
1359 | * has and handles. The format is the same as the IE contents. See | ||
1360 | * 802.11-2012 8.4.2.29 for more information. | ||
1361 | * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver | ||
1362 | * has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields. | ||
1363 | * | ||
1364 | * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to | ||
1365 | * the driver, e.g., to enable TDLS power save (PU-APSD). | ||
1366 | * | ||
1367 | * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are | ||
1368 | * advertised to the driver, e.g., to enable TDLS off channel operations | ||
1369 | * and PU-APSD. | ||
1370 | * | ||
1313 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1371 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1314 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1372 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1315 | */ | 1373 | */ |
@@ -1580,6 +1638,22 @@ enum nl80211_attrs { | |||
1580 | NL80211_ATTR_P2P_CTWINDOW, | 1638 | NL80211_ATTR_P2P_CTWINDOW, |
1581 | NL80211_ATTR_P2P_OPPPS, | 1639 | NL80211_ATTR_P2P_OPPPS, |
1582 | 1640 | ||
1641 | NL80211_ATTR_LOCAL_MESH_POWER_MODE, | ||
1642 | |||
1643 | NL80211_ATTR_ACL_POLICY, | ||
1644 | |||
1645 | NL80211_ATTR_MAC_ADDRS, | ||
1646 | |||
1647 | NL80211_ATTR_MAC_ACL_MAX, | ||
1648 | |||
1649 | NL80211_ATTR_RADAR_EVENT, | ||
1650 | |||
1651 | NL80211_ATTR_EXT_CAPA, | ||
1652 | NL80211_ATTR_EXT_CAPA_MASK, | ||
1653 | |||
1654 | NL80211_ATTR_STA_CAPABILITY, | ||
1655 | NL80211_ATTR_STA_EXT_CAPABILITY, | ||
1656 | |||
1583 | /* add attributes here, update the policy in nl80211.c */ | 1657 | /* add attributes here, update the policy in nl80211.c */ |
1584 | 1658 | ||
1585 | __NL80211_ATTR_AFTER_LAST, | 1659 | __NL80211_ATTR_AFTER_LAST, |
@@ -1697,6 +1771,9 @@ enum nl80211_iftype { | |||
1697 | * flag can't be changed, it is only valid while adding a station, and | 1771 | * flag can't be changed, it is only valid while adding a station, and |
1698 | * attempts to change it will silently be ignored (rather than rejected | 1772 | * attempts to change it will silently be ignored (rather than rejected |
1699 | * as errors.) | 1773 | * as errors.) |
1774 | * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers | ||
1775 | * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a | ||
1776 | * previously added station into associated state | ||
1700 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined | 1777 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined |
1701 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use | 1778 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use |
1702 | */ | 1779 | */ |
@@ -1708,6 +1785,7 @@ enum nl80211_sta_flags { | |||
1708 | NL80211_STA_FLAG_MFP, | 1785 | NL80211_STA_FLAG_MFP, |
1709 | NL80211_STA_FLAG_AUTHENTICATED, | 1786 | NL80211_STA_FLAG_AUTHENTICATED, |
1710 | NL80211_STA_FLAG_TDLS_PEER, | 1787 | NL80211_STA_FLAG_TDLS_PEER, |
1788 | NL80211_STA_FLAG_ASSOCIATED, | ||
1711 | 1789 | ||
1712 | /* keep last */ | 1790 | /* keep last */ |
1713 | __NL80211_STA_FLAG_AFTER_LAST, | 1791 | __NL80211_STA_FLAG_AFTER_LAST, |
@@ -1813,6 +1891,8 @@ enum nl80211_sta_bss_param { | |||
1813 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) | 1891 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) |
1814 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) | 1892 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) |
1815 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 1893 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
1894 | * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station) | ||
1895 | * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station) | ||
1816 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | 1896 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) |
1817 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | 1897 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute |
1818 | * containing info as possible, see &enum nl80211_rate_info | 1898 | * containing info as possible, see &enum nl80211_rate_info |
@@ -1834,6 +1914,10 @@ enum nl80211_sta_bss_param { | |||
1834 | * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. | 1914 | * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. |
1835 | * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) | 1915 | * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) |
1836 | * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) | 1916 | * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) |
1917 | * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode | ||
1918 | * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode | ||
1919 | * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards | ||
1920 | * non-peer STA | ||
1837 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 1921 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
1838 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 1922 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
1839 | */ | 1923 | */ |
@@ -1858,6 +1942,11 @@ enum nl80211_sta_info { | |||
1858 | NL80211_STA_INFO_STA_FLAGS, | 1942 | NL80211_STA_INFO_STA_FLAGS, |
1859 | NL80211_STA_INFO_BEACON_LOSS, | 1943 | NL80211_STA_INFO_BEACON_LOSS, |
1860 | NL80211_STA_INFO_T_OFFSET, | 1944 | NL80211_STA_INFO_T_OFFSET, |
1945 | NL80211_STA_INFO_LOCAL_PM, | ||
1946 | NL80211_STA_INFO_PEER_PM, | ||
1947 | NL80211_STA_INFO_NONPEER_PM, | ||
1948 | NL80211_STA_INFO_RX_BYTES64, | ||
1949 | NL80211_STA_INFO_TX_BYTES64, | ||
1861 | 1950 | ||
1862 | /* keep last */ | 1951 | /* keep last */ |
1863 | __NL80211_STA_INFO_AFTER_LAST, | 1952 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -1967,6 +2056,20 @@ enum nl80211_band_attr { | |||
1967 | * on this channel in current regulatory domain. | 2056 | * on this channel in current regulatory domain. |
1968 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm | 2057 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm |
1969 | * (100 * dBm). | 2058 | * (100 * dBm). |
2059 | * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS | ||
2060 | * (enum nl80211_dfs_state) | ||
2061 | * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long | ||
2062 | * this channel is in this DFS state. | ||
2063 | * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this | ||
2064 | * channel as the control channel | ||
2065 | * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this | ||
2066 | * channel as the control channel | ||
2067 | * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel | ||
2068 | * as the primary or any of the secondary channels isn't possible, | ||
2069 | * this includes 80+80 channels | ||
2070 | * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel | ||
2071 | * using this channel as the primary or any of the secondary channels | ||
2072 | * isn't possible | ||
1970 | * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number | 2073 | * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number |
1971 | * currently defined | 2074 | * currently defined |
1972 | * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use | 2075 | * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use |
@@ -1979,6 +2082,12 @@ enum nl80211_frequency_attr { | |||
1979 | NL80211_FREQUENCY_ATTR_NO_IBSS, | 2082 | NL80211_FREQUENCY_ATTR_NO_IBSS, |
1980 | NL80211_FREQUENCY_ATTR_RADAR, | 2083 | NL80211_FREQUENCY_ATTR_RADAR, |
1981 | NL80211_FREQUENCY_ATTR_MAX_TX_POWER, | 2084 | NL80211_FREQUENCY_ATTR_MAX_TX_POWER, |
2085 | NL80211_FREQUENCY_ATTR_DFS_STATE, | ||
2086 | NL80211_FREQUENCY_ATTR_DFS_TIME, | ||
2087 | NL80211_FREQUENCY_ATTR_NO_HT40_MINUS, | ||
2088 | NL80211_FREQUENCY_ATTR_NO_HT40_PLUS, | ||
2089 | NL80211_FREQUENCY_ATTR_NO_80MHZ, | ||
2090 | NL80211_FREQUENCY_ATTR_NO_160MHZ, | ||
1982 | 2091 | ||
1983 | /* keep last */ | 2092 | /* keep last */ |
1984 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, | 2093 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, |
@@ -2249,6 +2358,34 @@ enum nl80211_mntr_flags { | |||
2249 | }; | 2358 | }; |
2250 | 2359 | ||
2251 | /** | 2360 | /** |
2361 | * enum nl80211_mesh_power_mode - mesh power save modes | ||
2362 | * | ||
2363 | * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is | ||
2364 | * not known or has not been set yet. | ||
2365 | * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is | ||
2366 | * in Awake state all the time. | ||
2367 | * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will | ||
2368 | * alternate between Active and Doze states, but will wake up for | ||
2369 | * neighbor's beacons. | ||
2370 | * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will | ||
2371 | * alternate between Active and Doze states, but may not wake up | ||
2372 | * for neighbor's beacons. | ||
2373 | * | ||
2374 | * @__NL80211_MESH_POWER_AFTER_LAST - internal use | ||
2375 | * @NL80211_MESH_POWER_MAX - highest possible power save level | ||
2376 | */ | ||
2377 | |||
2378 | enum nl80211_mesh_power_mode { | ||
2379 | NL80211_MESH_POWER_UNKNOWN, | ||
2380 | NL80211_MESH_POWER_ACTIVE, | ||
2381 | NL80211_MESH_POWER_LIGHT_SLEEP, | ||
2382 | NL80211_MESH_POWER_DEEP_SLEEP, | ||
2383 | |||
2384 | __NL80211_MESH_POWER_AFTER_LAST, | ||
2385 | NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1 | ||
2386 | }; | ||
2387 | |||
2388 | /** | ||
2252 | * enum nl80211_meshconf_params - mesh configuration parameters | 2389 | * enum nl80211_meshconf_params - mesh configuration parameters |
2253 | * | 2390 | * |
2254 | * Mesh configuration parameters. These can be changed while the mesh is | 2391 | * Mesh configuration parameters. These can be changed while the mesh is |
@@ -2342,6 +2479,11 @@ enum nl80211_mntr_flags { | |||
2342 | * (in TUs) during which a mesh STA can send only one Action frame | 2479 | * (in TUs) during which a mesh STA can send only one Action frame |
2343 | * containing a PREQ element for root path confirmation. | 2480 | * containing a PREQ element for root path confirmation. |
2344 | * | 2481 | * |
2482 | * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links. | ||
2483 | * type &enum nl80211_mesh_power_mode (u32) | ||
2484 | * | ||
2485 | * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) | ||
2486 | * | ||
2345 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 2487 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
2346 | */ | 2488 | */ |
2347 | enum nl80211_meshconf_params { | 2489 | enum nl80211_meshconf_params { |
@@ -2371,6 +2513,8 @@ enum nl80211_meshconf_params { | |||
2371 | NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, | 2513 | NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, |
2372 | NL80211_MESHCONF_HWMP_ROOT_INTERVAL, | 2514 | NL80211_MESHCONF_HWMP_ROOT_INTERVAL, |
2373 | NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, | 2515 | NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, |
2516 | NL80211_MESHCONF_POWER_MODE, | ||
2517 | NL80211_MESHCONF_AWAKE_WINDOW, | ||
2374 | 2518 | ||
2375 | /* keep last */ | 2519 | /* keep last */ |
2376 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 2520 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
@@ -2816,10 +2960,12 @@ enum nl80211_tx_power_setting { | |||
2816 | * corresponds to the lowest-order bit in the second byte of the mask. | 2960 | * corresponds to the lowest-order bit in the second byte of the mask. |
2817 | * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where | 2961 | * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where |
2818 | * xx indicates "don't care") would be represented by a pattern of | 2962 | * xx indicates "don't care") would be represented by a pattern of |
2819 | * twelve zero bytes, and a mask of "0xed,0x07". | 2963 | * twelve zero bytes, and a mask of "0xed,0x01". |
2820 | * Note that the pattern matching is done as though frames were not | 2964 | * Note that the pattern matching is done as though frames were not |
2821 | * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked | 2965 | * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked |
2822 | * first (including SNAP header unpacking) and then matched. | 2966 | * first (including SNAP header unpacking) and then matched. |
2967 | * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after | ||
2968 | * these fixed number of bytes of received packet | ||
2823 | * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes | 2969 | * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes |
2824 | * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number | 2970 | * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number |
2825 | */ | 2971 | */ |
@@ -2827,6 +2973,7 @@ enum nl80211_wowlan_packet_pattern_attr { | |||
2827 | __NL80211_WOWLAN_PKTPAT_INVALID, | 2973 | __NL80211_WOWLAN_PKTPAT_INVALID, |
2828 | NL80211_WOWLAN_PKTPAT_MASK, | 2974 | NL80211_WOWLAN_PKTPAT_MASK, |
2829 | NL80211_WOWLAN_PKTPAT_PATTERN, | 2975 | NL80211_WOWLAN_PKTPAT_PATTERN, |
2976 | NL80211_WOWLAN_PKTPAT_OFFSET, | ||
2830 | 2977 | ||
2831 | NUM_NL80211_WOWLAN_PKTPAT, | 2978 | NUM_NL80211_WOWLAN_PKTPAT, |
2832 | MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, | 2979 | MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, |
@@ -2837,6 +2984,7 @@ enum nl80211_wowlan_packet_pattern_attr { | |||
2837 | * @max_patterns: maximum number of patterns supported | 2984 | * @max_patterns: maximum number of patterns supported |
2838 | * @min_pattern_len: minimum length of each pattern | 2985 | * @min_pattern_len: minimum length of each pattern |
2839 | * @max_pattern_len: maximum length of each pattern | 2986 | * @max_pattern_len: maximum length of each pattern |
2987 | * @max_pkt_offset: maximum Rx packet offset | ||
2840 | * | 2988 | * |
2841 | * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when | 2989 | * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when |
2842 | * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the | 2990 | * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the |
@@ -2846,6 +2994,7 @@ struct nl80211_wowlan_pattern_support { | |||
2846 | __u32 max_patterns; | 2994 | __u32 max_patterns; |
2847 | __u32 min_pattern_len; | 2995 | __u32 min_pattern_len; |
2848 | __u32 max_pattern_len; | 2996 | __u32 max_pattern_len; |
2997 | __u32 max_pkt_offset; | ||
2849 | } __attribute__((packed)); | 2998 | } __attribute__((packed)); |
2850 | 2999 | ||
2851 | /** | 3000 | /** |
@@ -2861,12 +3010,17 @@ struct nl80211_wowlan_pattern_support { | |||
2861 | * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns | 3010 | * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns |
2862 | * which are passed in an array of nested attributes, each nested attribute | 3011 | * which are passed in an array of nested attributes, each nested attribute |
2863 | * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. | 3012 | * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. |
2864 | * Each pattern defines a wakeup packet. The matching is done on the MSDU, | 3013 | * Each pattern defines a wakeup packet. Packet offset is associated with |
2865 | * i.e. as though the packet was an 802.3 packet, so the pattern matching | 3014 | * each pattern which is used while matching the pattern. The matching is |
2866 | * is done after the packet is converted to the MSDU. | 3015 | * done on the MSDU, i.e. as though the packet was an 802.3 packet, so the |
3016 | * pattern matching is done after the packet is converted to the MSDU. | ||
2867 | * | 3017 | * |
2868 | * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute | 3018 | * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute |
2869 | * carrying a &struct nl80211_wowlan_pattern_support. | 3019 | * carrying a &struct nl80211_wowlan_pattern_support. |
3020 | * | ||
3021 | * When reporting wakeup. it is a u32 attribute containing the 0-based | ||
3022 | * index of the pattern that caused the wakeup, in the patterns passed | ||
3023 | * to the kernel when configuring. | ||
2870 | * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be | 3024 | * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be |
2871 | * used when setting, used only to indicate that GTK rekeying is supported | 3025 | * used when setting, used only to indicate that GTK rekeying is supported |
2872 | * by the device (flag) | 3026 | * by the device (flag) |
@@ -2877,8 +3031,36 @@ struct nl80211_wowlan_pattern_support { | |||
2877 | * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) | 3031 | * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) |
2878 | * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released | 3032 | * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released |
2879 | * (on devices that have rfkill in the device) (flag) | 3033 | * (on devices that have rfkill in the device) (flag) |
3034 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains | ||
3035 | * the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame | ||
3036 | * may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN | ||
3037 | * attribute contains the original length. | ||
3038 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11 | ||
3039 | * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 | ||
3040 | * attribute if the packet was truncated somewhere. | ||
3041 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the | ||
3042 | * 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may | ||
3043 | * be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute | ||
3044 | * contains the original length. | ||
3045 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 | ||
3046 | * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 | ||
3047 | * attribute if the packet was truncated somewhere. | ||
3048 | * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section | ||
3049 | * "TCP connection wakeup" for more details. This is a nested attribute | ||
3050 | * containing the exact information for establishing and keeping alive | ||
3051 | * the TCP connection. | ||
3052 | * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the | ||
3053 | * wakeup packet was received on the TCP connection | ||
3054 | * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the | ||
3055 | * TCP connection was lost or failed to be established | ||
3056 | * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only, | ||
3057 | * the TCP connection ran out of tokens to use for data to send to the | ||
3058 | * service | ||
2880 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers | 3059 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers |
2881 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number | 3060 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number |
3061 | * | ||
3062 | * These nested attributes are used to configure the wakeup triggers and | ||
3063 | * to report the wakeup reason(s). | ||
2882 | */ | 3064 | */ |
2883 | enum nl80211_wowlan_triggers { | 3065 | enum nl80211_wowlan_triggers { |
2884 | __NL80211_WOWLAN_TRIG_INVALID, | 3066 | __NL80211_WOWLAN_TRIG_INVALID, |
@@ -2891,6 +3073,14 @@ enum nl80211_wowlan_triggers { | |||
2891 | NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, | 3073 | NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, |
2892 | NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, | 3074 | NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, |
2893 | NL80211_WOWLAN_TRIG_RFKILL_RELEASE, | 3075 | NL80211_WOWLAN_TRIG_RFKILL_RELEASE, |
3076 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211, | ||
3077 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, | ||
3078 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, | ||
3079 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, | ||
3080 | NL80211_WOWLAN_TRIG_TCP_CONNECTION, | ||
3081 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH, | ||
3082 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST, | ||
3083 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS, | ||
2894 | 3084 | ||
2895 | /* keep last */ | 3085 | /* keep last */ |
2896 | NUM_NL80211_WOWLAN_TRIG, | 3086 | NUM_NL80211_WOWLAN_TRIG, |
@@ -2898,6 +3088,116 @@ enum nl80211_wowlan_triggers { | |||
2898 | }; | 3088 | }; |
2899 | 3089 | ||
2900 | /** | 3090 | /** |
3091 | * DOC: TCP connection wakeup | ||
3092 | * | ||
3093 | * Some devices can establish a TCP connection in order to be woken up by a | ||
3094 | * packet coming in from outside their network segment, or behind NAT. If | ||
3095 | * configured, the device will establish a TCP connection to the given | ||
3096 | * service, and periodically send data to that service. The first data | ||
3097 | * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK. | ||
3098 | * The data packets can optionally include a (little endian) sequence | ||
3099 | * number (in the TCP payload!) that is generated by the device, and, also | ||
3100 | * optionally, a token from a list of tokens. This serves as a keep-alive | ||
3101 | * with the service, and for NATed connections, etc. | ||
3102 | * | ||
3103 | * During this keep-alive period, the server doesn't send any data to the | ||
3104 | * client. When receiving data, it is compared against the wakeup pattern | ||
3105 | * (and mask) and if it matches, the host is woken up. Similarly, if the | ||
3106 | * connection breaks or cannot be established to start with, the host is | ||
3107 | * also woken up. | ||
3108 | * | ||
3109 | * Developer's note: ARP offload is required for this, otherwise TCP | ||
3110 | * response packets might not go through correctly. | ||
3111 | */ | ||
3112 | |||
3113 | /** | ||
3114 | * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence | ||
3115 | * @start: starting value | ||
3116 | * @offset: offset of sequence number in packet | ||
3117 | * @len: length of the sequence value to write, 1 through 4 | ||
3118 | * | ||
3119 | * Note: don't confuse with the TCP sequence number(s), this is for the | ||
3120 | * keepalive packet payload. The actual value is written into the packet | ||
3121 | * in little endian. | ||
3122 | */ | ||
3123 | struct nl80211_wowlan_tcp_data_seq { | ||
3124 | __u32 start, offset, len; | ||
3125 | }; | ||
3126 | |||
3127 | /** | ||
3128 | * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config | ||
3129 | * @offset: offset of token in packet | ||
3130 | * @len: length of each token | ||
3131 | * @token_stream: stream of data to be used for the tokens, the length must | ||
3132 | * be a multiple of @len for this to make sense | ||
3133 | */ | ||
3134 | struct nl80211_wowlan_tcp_data_token { | ||
3135 | __u32 offset, len; | ||
3136 | __u8 token_stream[]; | ||
3137 | }; | ||
3138 | |||
3139 | /** | ||
3140 | * struct nl80211_wowlan_tcp_data_token_feature - data token features | ||
3141 | * @min_len: minimum token length | ||
3142 | * @max_len: maximum token length | ||
3143 | * @bufsize: total available token buffer size (max size of @token_stream) | ||
3144 | */ | ||
3145 | struct nl80211_wowlan_tcp_data_token_feature { | ||
3146 | __u32 min_len, max_len, bufsize; | ||
3147 | }; | ||
3148 | |||
3149 | /** | ||
3150 | * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters | ||
3151 | * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes | ||
3152 | * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order) | ||
3153 | * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address | ||
3154 | * (in network byte order) | ||
3155 | * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because | ||
3156 | * route lookup when configured might be invalid by the time we suspend, | ||
3157 | * and doing a route lookup when suspending is no longer possible as it | ||
3158 | * might require ARP querying. | ||
3159 | * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a | ||
3160 | * socket and port will be allocated | ||
3161 | * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16) | ||
3162 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte. | ||
3163 | * For feature advertising, a u32 attribute holding the maximum length | ||
3164 | * of the data payload. | ||
3165 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration | ||
3166 | * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature | ||
3167 | * advertising it is just a flag | ||
3168 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration, | ||
3169 | * see &struct nl80211_wowlan_tcp_data_token and for advertising see | ||
3170 | * &struct nl80211_wowlan_tcp_data_token_feature. | ||
3171 | * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum | ||
3172 | * interval in feature advertising (u32) | ||
3173 | * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a | ||
3174 | * u32 attribute holding the maximum length | ||
3175 | * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for | ||
3176 | * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK | ||
3177 | * but on the TCP payload only. | ||
3178 | * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes | ||
3179 | * @MAX_NL80211_WOWLAN_TCP: highest attribute number | ||
3180 | */ | ||
3181 | enum nl80211_wowlan_tcp_attrs { | ||
3182 | __NL80211_WOWLAN_TCP_INVALID, | ||
3183 | NL80211_WOWLAN_TCP_SRC_IPV4, | ||
3184 | NL80211_WOWLAN_TCP_DST_IPV4, | ||
3185 | NL80211_WOWLAN_TCP_DST_MAC, | ||
3186 | NL80211_WOWLAN_TCP_SRC_PORT, | ||
3187 | NL80211_WOWLAN_TCP_DST_PORT, | ||
3188 | NL80211_WOWLAN_TCP_DATA_PAYLOAD, | ||
3189 | NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, | ||
3190 | NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, | ||
3191 | NL80211_WOWLAN_TCP_DATA_INTERVAL, | ||
3192 | NL80211_WOWLAN_TCP_WAKE_PAYLOAD, | ||
3193 | NL80211_WOWLAN_TCP_WAKE_MASK, | ||
3194 | |||
3195 | /* keep last */ | ||
3196 | NUM_NL80211_WOWLAN_TCP, | ||
3197 | MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1 | ||
3198 | }; | ||
3199 | |||
3200 | /** | ||
2901 | * enum nl80211_iface_limit_attrs - limit attributes | 3201 | * enum nl80211_iface_limit_attrs - limit attributes |
2902 | * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) | 3202 | * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) |
2903 | * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that | 3203 | * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that |
@@ -2933,6 +3233,8 @@ enum nl80211_iface_limit_attrs { | |||
2933 | * the infrastructure network's beacon interval. | 3233 | * the infrastructure network's beacon interval. |
2934 | * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many | 3234 | * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many |
2935 | * different channels may be used within this group. | 3235 | * different channels may be used within this group. |
3236 | * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap | ||
3237 | * of supported channel widths for radar detection. | ||
2936 | * @NUM_NL80211_IFACE_COMB: number of attributes | 3238 | * @NUM_NL80211_IFACE_COMB: number of attributes |
2937 | * @MAX_NL80211_IFACE_COMB: highest attribute number | 3239 | * @MAX_NL80211_IFACE_COMB: highest attribute number |
2938 | * | 3240 | * |
@@ -2965,6 +3267,7 @@ enum nl80211_if_combination_attrs { | |||
2965 | NL80211_IFACE_COMB_MAXNUM, | 3267 | NL80211_IFACE_COMB_MAXNUM, |
2966 | NL80211_IFACE_COMB_STA_AP_BI_MATCH, | 3268 | NL80211_IFACE_COMB_STA_AP_BI_MATCH, |
2967 | NL80211_IFACE_COMB_NUM_CHANNELS, | 3269 | NL80211_IFACE_COMB_NUM_CHANNELS, |
3270 | NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, | ||
2968 | 3271 | ||
2969 | /* keep last */ | 3272 | /* keep last */ |
2970 | NUM_NL80211_IFACE_COMB, | 3273 | NUM_NL80211_IFACE_COMB, |
@@ -3140,6 +3443,19 @@ enum nl80211_ap_sme_features { | |||
3140 | * setting | 3443 | * setting |
3141 | * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic | 3444 | * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic |
3142 | * powersave | 3445 | * powersave |
3446 | * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state | ||
3447 | * transitions for AP clients. Without this flag (and if the driver | ||
3448 | * doesn't have the AP SME in the device) the driver supports adding | ||
3449 | * stations only when they're associated and adds them in associated | ||
3450 | * state (to later be transitioned into authorized), with this flag | ||
3451 | * they should be added before even sending the authentication reply | ||
3452 | * and then transitioned into authenticated, associated and authorized | ||
3453 | * states using station flags. | ||
3454 | * Note that even for drivers that support this, the default is to add | ||
3455 | * stations in authenticated/associated state, so to add unauthenticated | ||
3456 | * stations the authenticated/associated bits have to be set in the mask. | ||
3457 | * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits | ||
3458 | * (HT40, VHT 80/160 MHz) if this flag is set | ||
3143 | */ | 3459 | */ |
3144 | enum nl80211_feature_flags { | 3460 | enum nl80211_feature_flags { |
3145 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3461 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
@@ -3155,6 +3471,9 @@ enum nl80211_feature_flags { | |||
3155 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, | 3471 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, |
3156 | NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, | 3472 | NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, |
3157 | NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, | 3473 | NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, |
3474 | /* bit 13 is reserved */ | ||
3475 | NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, | ||
3476 | NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, | ||
3158 | }; | 3477 | }; |
3159 | 3478 | ||
3160 | /** | 3479 | /** |
@@ -3182,7 +3501,7 @@ enum nl80211_probe_resp_offload_support_attr { | |||
3182 | * enum nl80211_connect_failed_reason - connection request failed reasons | 3501 | * enum nl80211_connect_failed_reason - connection request failed reasons |
3183 | * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be | 3502 | * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be |
3184 | * handled by the AP is reached. | 3503 | * handled by the AP is reached. |
3185 | * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist. | 3504 | * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL. |
3186 | */ | 3505 | */ |
3187 | enum nl80211_connect_failed_reason { | 3506 | enum nl80211_connect_failed_reason { |
3188 | NL80211_CONN_FAIL_MAX_CLIENTS, | 3507 | NL80211_CONN_FAIL_MAX_CLIENTS, |
@@ -3210,4 +3529,62 @@ enum nl80211_scan_flags { | |||
3210 | NL80211_SCAN_FLAG_AP = 1<<2, | 3529 | NL80211_SCAN_FLAG_AP = 1<<2, |
3211 | }; | 3530 | }; |
3212 | 3531 | ||
3532 | /** | ||
3533 | * enum nl80211_acl_policy - access control policy | ||
3534 | * | ||
3535 | * Access control policy is applied on a MAC list set by | ||
3536 | * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to | ||
3537 | * be used with %NL80211_ATTR_ACL_POLICY. | ||
3538 | * | ||
3539 | * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are | ||
3540 | * listed in ACL, i.e. allow all the stations which are not listed | ||
3541 | * in ACL to authenticate. | ||
3542 | * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed | ||
3543 | * in ACL, i.e. deny all the stations which are not listed in ACL. | ||
3544 | */ | ||
3545 | enum nl80211_acl_policy { | ||
3546 | NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED, | ||
3547 | NL80211_ACL_POLICY_DENY_UNLESS_LISTED, | ||
3548 | }; | ||
3549 | |||
3550 | /** | ||
3551 | * enum nl80211_radar_event - type of radar event for DFS operation | ||
3552 | * | ||
3553 | * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace | ||
3554 | * about detected radars or success of the channel available check (CAC) | ||
3555 | * | ||
3556 | * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is | ||
3557 | * now unusable. | ||
3558 | * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished, | ||
3559 | * the channel is now available. | ||
3560 | * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no | ||
3561 | * change to the channel status. | ||
3562 | * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is | ||
3563 | * over, channel becomes usable. | ||
3564 | */ | ||
3565 | enum nl80211_radar_event { | ||
3566 | NL80211_RADAR_DETECTED, | ||
3567 | NL80211_RADAR_CAC_FINISHED, | ||
3568 | NL80211_RADAR_CAC_ABORTED, | ||
3569 | NL80211_RADAR_NOP_FINISHED, | ||
3570 | }; | ||
3571 | |||
3572 | /** | ||
3573 | * enum nl80211_dfs_state - DFS states for channels | ||
3574 | * | ||
3575 | * Channel states used by the DFS code. | ||
3576 | * | ||
3577 | * @IEEE80211_DFS_USABLE: The channel can be used, but channel availability | ||
3578 | * check (CAC) must be performed before using it for AP or IBSS. | ||
3579 | * @IEEE80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it | ||
3580 | * is therefore marked as not available. | ||
3581 | * @IEEE80211_DFS_AVAILABLE: The channel has been CAC checked and is available. | ||
3582 | */ | ||
3583 | |||
3584 | enum nl80211_dfs_state { | ||
3585 | NL80211_DFS_USABLE, | ||
3586 | NL80211_DFS_UNAVAILABLE, | ||
3587 | NL80211_DFS_AVAILABLE, | ||
3588 | }; | ||
3589 | |||
3213 | #endif /* __LINUX_NL80211_H */ | 3590 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 7a5eb196ade9..7a2144e1afae 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -630,6 +630,7 @@ struct tcamsg { | |||
630 | 630 | ||
631 | /* New extended info filters for IFLA_EXT_MASK */ | 631 | /* New extended info filters for IFLA_EXT_MASK */ |
632 | #define RTEXT_FILTER_VF (1 << 0) | 632 | #define RTEXT_FILTER_VF (1 << 0) |
633 | #define RTEXT_FILTER_BRVLAN (1 << 1) | ||
633 | 634 | ||
634 | /* End of information exported to user level */ | 635 | /* End of information exported to user level */ |
635 | 636 | ||
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 2c6c85f18ea0..b6a23a483d74 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -50,7 +50,7 @@ | |||
50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ | 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ |
51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ | 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ |
53 | #define PORT_BRCM_TRUMANAGE 24 | 53 | #define PORT_BRCM_TRUMANAGE 25 |
54 | #define PORT_MAX_8250 25 /* max port ID */ | 54 | #define PORT_MAX_8250 25 /* max port ID */ |
55 | 55 | ||
56 | /* | 56 | /* |
@@ -220,4 +220,7 @@ | |||
220 | /* ARC (Synopsys) on-chip UART */ | 220 | /* ARC (Synopsys) on-chip UART */ |
221 | #define PORT_ARC 101 | 221 | #define PORT_ARC 101 |
222 | 222 | ||
223 | /* Rocketport EXPRESS/INFINITY */ | ||
224 | #define PORT_RP2 102 | ||
225 | |||
223 | #endif /* _UAPILINUX_SERIAL_CORE_H */ | 226 | #endif /* _UAPILINUX_SERIAL_CORE_H */ |
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index fdfba235f9f1..b49eab89c9fd 100644 --- a/include/uapi/linux/snmp.h +++ b/include/uapi/linux/snmp.h | |||
@@ -278,6 +278,7 @@ enum | |||
278 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ | 278 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ |
279 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ | 279 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ |
280 | LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ | 280 | LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ |
281 | LINUX_MIB_XFRMOUTSTATEINVALID, /* XfrmOutStateInvalid */ | ||
281 | __LINUX_MIB_XFRMMAX | 282 | __LINUX_MIB_XFRMMAX |
282 | }; | 283 | }; |
283 | 284 | ||
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index e962faa5ab0d..6b1ead0b0c9d 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h | |||
@@ -111,6 +111,7 @@ enum { | |||
111 | #define TCP_QUEUE_SEQ 21 | 111 | #define TCP_QUEUE_SEQ 21 |
112 | #define TCP_REPAIR_OPTIONS 22 | 112 | #define TCP_REPAIR_OPTIONS 22 |
113 | #define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ | 113 | #define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ |
114 | #define TCP_TIMESTAMP 24 | ||
114 | 115 | ||
115 | struct tcp_repair_opt { | 116 | struct tcp_repair_opt { |
116 | __u32 opt_code; | 117 | __u32 opt_code; |
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h index 9c6974f16966..e9ed951e2b09 100644 --- a/include/uapi/linux/uhid.h +++ b/include/uapi/linux/uhid.h | |||
@@ -86,7 +86,7 @@ struct uhid_feature_answer_req { | |||
86 | __u16 err; | 86 | __u16 err; |
87 | __u16 size; | 87 | __u16 size; |
88 | __u8 data[UHID_DATA_MAX]; | 88 | __u8 data[UHID_DATA_MAX]; |
89 | }; | 89 | } __attribute__((__packed__)); |
90 | 90 | ||
91 | struct uhid_event { | 91 | struct uhid_event { |
92 | __u32 type; | 92 | __u32 type; |
diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h index ac90037894d9..d2314be4f0c0 100644 --- a/include/uapi/linux/usb/audio.h +++ b/include/uapi/linux/usb/audio.h | |||
@@ -384,14 +384,16 @@ static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_de | |||
384 | int protocol) | 384 | int protocol) |
385 | { | 385 | { |
386 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | 386 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); |
387 | return desc->baSourceID[desc->bNrInPins + control_size]; | 387 | return *(uac_processing_unit_bmControls(desc, protocol) |
388 | + control_size); | ||
388 | } | 389 | } |
389 | 390 | ||
390 | static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc, | 391 | static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc, |
391 | int protocol) | 392 | int protocol) |
392 | { | 393 | { |
393 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | 394 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); |
394 | return &desc->baSourceID[desc->bNrInPins + control_size + 1]; | 395 | return uac_processing_unit_bmControls(desc, protocol) |
396 | + control_size + 1; | ||
395 | } | 397 | } |
396 | 398 | ||
397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 399 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index f56c945cecd4..dcd63745e83a 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
@@ -88,10 +88,6 @@ | |||
88 | #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) | 88 | #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) |
89 | #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) | 89 | #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) |
90 | 90 | ||
91 | /* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */ | ||
92 | #define V4L2_CID_HCENTER (V4L2_CID_BASE+22) | ||
93 | #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) | ||
94 | |||
95 | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24) | 91 | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24) |
96 | enum v4l2_power_line_frequency { | 92 | enum v4l2_power_line_frequency { |
97 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, | 93 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, |
@@ -144,6 +140,11 @@ enum v4l2_colorfx { | |||
144 | /* last CID + 1 */ | 140 | /* last CID + 1 */ |
145 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) | 141 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) |
146 | 142 | ||
143 | /* USER-class private control IDs */ | ||
144 | |||
145 | /* The base for the meye driver controls. See linux/meye.h for the list | ||
146 | * of controls. We reserve 16 controls for this driver. */ | ||
147 | #define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000) | ||
147 | 148 | ||
148 | /* MPEG-class control IDs */ | 149 | /* MPEG-class control IDs */ |
149 | 150 | ||
@@ -782,6 +783,7 @@ enum v4l2_jpeg_chroma_subsampling { | |||
782 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) | 783 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) |
783 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) | 784 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) |
784 | 785 | ||
786 | |||
785 | /* Image source controls */ | 787 | /* Image source controls */ |
786 | #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900) | 788 | #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900) |
787 | #define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1) | 789 | #define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1) |
@@ -800,4 +802,27 @@ enum v4l2_jpeg_chroma_subsampling { | |||
800 | #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) | 802 | #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) |
801 | #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) | 803 | #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) |
802 | 804 | ||
805 | |||
806 | /* DV-class control IDs defined by V4L2 */ | ||
807 | #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900) | ||
808 | #define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1) | ||
809 | |||
810 | #define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1) | ||
811 | #define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2) | ||
812 | #define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3) | ||
813 | #define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4) | ||
814 | enum v4l2_dv_tx_mode { | ||
815 | V4L2_DV_TX_MODE_DVI_D = 0, | ||
816 | V4L2_DV_TX_MODE_HDMI = 1, | ||
817 | }; | ||
818 | #define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5) | ||
819 | enum v4l2_dv_rgb_range { | ||
820 | V4L2_DV_RGB_RANGE_AUTO = 0, | ||
821 | V4L2_DV_RGB_RANGE_LIMITED = 1, | ||
822 | V4L2_DV_RGB_RANGE_FULL = 2, | ||
823 | }; | ||
824 | |||
825 | #define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100) | ||
826 | #define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101) | ||
827 | |||
803 | #endif | 828 | #endif |
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index 7d64e0e1a18b..b9b7bea04537 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h | |||
@@ -47,8 +47,9 @@ enum v4l2_mbus_pixelcode { | |||
47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, | 47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, |
48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, | 48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, |
49 | 49 | ||
50 | /* YUV (including grey) - next is 0x2014 */ | 50 | /* YUV (including grey) - next is 0x2017 */ |
51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, | 51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, |
52 | V4L2_MBUS_FMT_UV8_1X8 = 0x2015, | ||
52 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, | 53 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, |
53 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, | 54 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, |
54 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, | 55 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, |
@@ -65,14 +66,20 @@ enum v4l2_mbus_pixelcode { | |||
65 | V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, | 66 | V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, |
66 | V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, | 67 | V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, |
67 | V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012, | 68 | V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012, |
69 | V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 0x2014, | ||
68 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, | 70 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, |
69 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, | 71 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, |
72 | V4L2_MBUS_FMT_YUV10_1X30 = 0x2016, | ||
70 | 73 | ||
71 | /* Bayer - next is 0x3015 */ | 74 | /* Bayer - next is 0x3019 */ |
72 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, | 75 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, |
73 | V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013, | 76 | V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013, |
74 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, | 77 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, |
75 | V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014, | 78 | V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014, |
79 | V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 = 0x3015, | ||
80 | V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 = 0x3016, | ||
81 | V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 = 0x3017, | ||
82 | V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 = 0x3018, | ||
76 | V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, | 83 | V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, |
77 | V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, | 84 | V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, |
78 | V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009, | 85 | V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009, |
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 4758d1bfcf41..4f41f309911e 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h | |||
@@ -303,6 +303,15 @@ enum { | |||
303 | VFIO_PCI_BAR5_REGION_INDEX, | 303 | VFIO_PCI_BAR5_REGION_INDEX, |
304 | VFIO_PCI_ROM_REGION_INDEX, | 304 | VFIO_PCI_ROM_REGION_INDEX, |
305 | VFIO_PCI_CONFIG_REGION_INDEX, | 305 | VFIO_PCI_CONFIG_REGION_INDEX, |
306 | /* | ||
307 | * Expose VGA regions defined for PCI base class 03, subclass 00. | ||
308 | * This includes I/O port ranges 0x3b0 to 0x3bb and 0x3c0 to 0x3df | ||
309 | * as well as the MMIO range 0xa0000 to 0xbffff. Each implemented | ||
310 | * range is found at it's identity mapped offset from the region | ||
311 | * offset, for example 0x3b0 is region_info.offset + 0x3b0. Areas | ||
312 | * between described ranges are unimplemented. | ||
313 | */ | ||
314 | VFIO_PCI_VGA_REGION_INDEX, | ||
306 | VFIO_PCI_NUM_REGIONS | 315 | VFIO_PCI_NUM_REGIONS |
307 | }; | 316 | }; |
308 | 317 | ||
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 3cf3e946e331..234d1d870914 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
@@ -334,6 +334,9 @@ struct v4l2_pix_format { | |||
334 | /* Palette formats */ | 334 | /* Palette formats */ |
335 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ | 335 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
336 | 336 | ||
337 | /* Chrominance formats */ | ||
338 | #define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /* 8 UV 4:4 */ | ||
339 | |||
337 | /* Luminance+Chrominance formats */ | 340 | /* Luminance+Chrominance formats */ |
338 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ | 341 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ |
339 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ | 342 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
@@ -386,6 +389,11 @@ struct v4l2_pix_format { | |||
386 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ | 389 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ |
387 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ | 390 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ |
388 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ | 391 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ |
392 | /* 10bit raw bayer a-law compressed to 8 bits */ | ||
393 | #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8') | ||
394 | #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8') | ||
395 | #define V4L2_PIX_FMT_SGRBG10ALAW8 v4l2_fourcc('a', 'g', 'A', '8') | ||
396 | #define V4L2_PIX_FMT_SRGGB10ALAW8 v4l2_fourcc('a', 'R', 'A', '8') | ||
389 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 397 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
390 | #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8') | 398 | #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8') |
391 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') | 399 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') |
@@ -693,6 +701,10 @@ struct v4l2_buffer { | |||
693 | /* Cache handling flags */ | 701 | /* Cache handling flags */ |
694 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 | 702 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 |
695 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 | 703 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 |
704 | /* Timestamp type */ | ||
705 | #define V4L2_BUF_FLAG_TIMESTAMP_MASK 0xe000 | ||
706 | #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x0000 | ||
707 | #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000 | ||
696 | 708 | ||
697 | /** | 709 | /** |
698 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor | 710 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor |
@@ -1342,28 +1354,6 @@ struct v4l2_querymenu { | |||
1342 | #define V4L2_CID_PRIVATE_BASE 0x08000000 | 1354 | #define V4L2_CID_PRIVATE_BASE 0x08000000 |
1343 | 1355 | ||
1344 | 1356 | ||
1345 | /* DV-class control IDs defined by V4L2 */ | ||
1346 | #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900) | ||
1347 | #define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1) | ||
1348 | |||
1349 | #define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1) | ||
1350 | #define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2) | ||
1351 | #define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3) | ||
1352 | #define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4) | ||
1353 | enum v4l2_dv_tx_mode { | ||
1354 | V4L2_DV_TX_MODE_DVI_D = 0, | ||
1355 | V4L2_DV_TX_MODE_HDMI = 1, | ||
1356 | }; | ||
1357 | #define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5) | ||
1358 | enum v4l2_dv_rgb_range { | ||
1359 | V4L2_DV_RGB_RANGE_AUTO = 0, | ||
1360 | V4L2_DV_RGB_RANGE_LIMITED = 1, | ||
1361 | V4L2_DV_RGB_RANGE_FULL = 2, | ||
1362 | }; | ||
1363 | |||
1364 | #define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100) | ||
1365 | #define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101) | ||
1366 | |||
1367 | /* | 1357 | /* |
1368 | * T U N I N G | 1358 | * T U N I N G |
1369 | */ | 1359 | */ |
@@ -1810,6 +1800,7 @@ struct v4l2_event_vsync { | |||
1810 | /* Payload for V4L2_EVENT_CTRL */ | 1800 | /* Payload for V4L2_EVENT_CTRL */ |
1811 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) | 1801 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) |
1812 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) | 1802 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) |
1803 | #define V4L2_EVENT_CTRL_CH_RANGE (1 << 2) | ||
1813 | 1804 | ||
1814 | struct v4l2_event_ctrl { | 1805 | struct v4l2_event_ctrl { |
1815 | __u32 changes; | 1806 | __u32 changes; |
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 848e3584d7c8..a5a8c88753b9 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h | |||
@@ -53,6 +53,7 @@ | |||
53 | * network */ | 53 | * network */ |
54 | #define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow | 54 | #define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow |
55 | * Steering */ | 55 | * Steering */ |
56 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ | ||
56 | 57 | ||
57 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 58 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
58 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ | 59 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ |
@@ -127,7 +128,7 @@ typedef __u8 virtio_net_ctrl_ack; | |||
127 | #define VIRTIO_NET_CTRL_RX_NOBCAST 5 | 128 | #define VIRTIO_NET_CTRL_RX_NOBCAST 5 |
128 | 129 | ||
129 | /* | 130 | /* |
130 | * Control the MAC filter table. | 131 | * Control the MAC |
131 | * | 132 | * |
132 | * The MAC filter table is managed by the hypervisor, the guest should | 133 | * The MAC filter table is managed by the hypervisor, the guest should |
133 | * assume the size is infinite. Filtering should be considered | 134 | * assume the size is infinite. Filtering should be considered |
@@ -140,6 +141,10 @@ typedef __u8 virtio_net_ctrl_ack; | |||
140 | * first sg list contains unicast addresses, the second is for multicast. | 141 | * first sg list contains unicast addresses, the second is for multicast. |
141 | * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature | 142 | * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature |
142 | * is available. | 143 | * is available. |
144 | * | ||
145 | * The ADDR_SET command requests one out scatterlist, it contains a | ||
146 | * 6 bytes MAC address. This functionality is present if the | ||
147 | * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available. | ||
143 | */ | 148 | */ |
144 | struct virtio_net_ctrl_mac { | 149 | struct virtio_net_ctrl_mac { |
145 | __u32 entries; | 150 | __u32 entries; |
@@ -148,6 +153,7 @@ struct virtio_net_ctrl_mac { | |||
148 | 153 | ||
149 | #define VIRTIO_NET_CTRL_MAC 1 | 154 | #define VIRTIO_NET_CTRL_MAC 1 |
150 | #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0 | 155 | #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0 |
156 | #define VIRTIO_NET_CTRL_MAC_ADDR_SET 1 | ||
151 | 157 | ||
152 | /* | 158 | /* |
153 | * Control VLAN filtering | 159 | * Control VLAN filtering |
diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h new file mode 100644 index 000000000000..df91301847ec --- /dev/null +++ b/include/uapi/linux/vm_sockets.h | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | * VMware vSockets Driver | ||
3 | * | ||
4 | * Copyright (C) 2007-2013 VMware, Inc. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation version 2 and no later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _VM_SOCKETS_H_ | ||
17 | #define _VM_SOCKETS_H_ | ||
18 | |||
19 | #if !defined(__KERNEL__) | ||
20 | #include <sys/socket.h> | ||
21 | #endif | ||
22 | |||
23 | /* Option name for STREAM socket buffer size. Use as the option name in | ||
24 | * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that | ||
25 | * specifies the size of the buffer underlying a vSockets STREAM socket. | ||
26 | * Value is clamped to the MIN and MAX. | ||
27 | */ | ||
28 | |||
29 | #define SO_VM_SOCKETS_BUFFER_SIZE 0 | ||
30 | |||
31 | /* Option name for STREAM socket minimum buffer size. Use as the option name | ||
32 | * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long that | ||
33 | * specifies the minimum size allowed for the buffer underlying a vSockets | ||
34 | * STREAM socket. | ||
35 | */ | ||
36 | |||
37 | #define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1 | ||
38 | |||
39 | /* Option name for STREAM socket maximum buffer size. Use as the option name | ||
40 | * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long | ||
41 | * that specifies the maximum size allowed for the buffer underlying a | ||
42 | * vSockets STREAM socket. | ||
43 | */ | ||
44 | |||
45 | #define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2 | ||
46 | |||
47 | /* Option name for socket peer's host-specific VM ID. Use as the option name | ||
48 | * in getsockopt(3) to get a host-specific identifier for the peer endpoint's | ||
49 | * VM. The identifier is a signed integer. | ||
50 | * Only available for hypervisor endpoints. | ||
51 | */ | ||
52 | |||
53 | #define SO_VM_SOCKETS_PEER_HOST_VM_ID 3 | ||
54 | |||
55 | /* Option name for determining if a socket is trusted. Use as the option name | ||
56 | * in getsockopt(3) to determine if a socket is trusted. The value is a | ||
57 | * signed integer. | ||
58 | */ | ||
59 | |||
60 | #define SO_VM_SOCKETS_TRUSTED 5 | ||
61 | |||
62 | /* Option name for STREAM socket connection timeout. Use as the option name | ||
63 | * in setsockopt(3) or getsockopt(3) to set or get the connection | ||
64 | * timeout for a STREAM socket. | ||
65 | */ | ||
66 | |||
67 | #define SO_VM_SOCKETS_CONNECT_TIMEOUT 6 | ||
68 | |||
69 | /* Option name for using non-blocking send/receive. Use as the option name | ||
70 | * for setsockopt(3) or getsockopt(3) to set or get the non-blocking | ||
71 | * transmit/receive flag for a STREAM socket. This flag determines whether | ||
72 | * send() and recv() can be called in non-blocking contexts for the given | ||
73 | * socket. The value is a signed integer. | ||
74 | * | ||
75 | * This option is only relevant to kernel endpoints, where descheduling the | ||
76 | * thread of execution is not allowed, for example, while holding a spinlock. | ||
77 | * It is not to be confused with conventional non-blocking socket operations. | ||
78 | * | ||
79 | * Only available for hypervisor endpoints. | ||
80 | */ | ||
81 | |||
82 | #define SO_VM_SOCKETS_NONBLOCK_TXRX 7 | ||
83 | |||
84 | /* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of | ||
85 | * sockaddr_vm and indicates the context ID of the current endpoint. | ||
86 | */ | ||
87 | |||
88 | #define VMADDR_CID_ANY -1U | ||
89 | |||
90 | /* Bind to any available port. Works for the svm_port field of | ||
91 | * sockaddr_vm. | ||
92 | */ | ||
93 | |||
94 | #define VMADDR_PORT_ANY -1U | ||
95 | |||
96 | /* Use this as the destination CID in an address when referring to the | ||
97 | * hypervisor. VMCI relies on it being 0, but this would be useful for other | ||
98 | * transports too. | ||
99 | */ | ||
100 | |||
101 | #define VMADDR_CID_HYPERVISOR 0 | ||
102 | |||
103 | /* This CID is specific to VMCI and can be considered reserved (even VMCI | ||
104 | * doesn't use it anymore, it's a legacy value from an older release). | ||
105 | */ | ||
106 | |||
107 | #define VMADDR_CID_RESERVED 1 | ||
108 | |||
109 | /* Use this as the destination CID in an address when referring to the host | ||
110 | * (any process other than the hypervisor). VMCI relies on it being 2, but | ||
111 | * this would be useful for other transports too. | ||
112 | */ | ||
113 | |||
114 | #define VMADDR_CID_HOST 2 | ||
115 | |||
116 | /* Invalid vSockets version. */ | ||
117 | |||
118 | #define VM_SOCKETS_INVALID_VERSION -1U | ||
119 | |||
120 | /* The epoch (first) component of the vSockets version. A single byte | ||
121 | * representing the epoch component of the vSockets version. | ||
122 | */ | ||
123 | |||
124 | #define VM_SOCKETS_VERSION_EPOCH(_v) (((_v) & 0xFF000000) >> 24) | ||
125 | |||
126 | /* The major (second) component of the vSockets version. A single byte | ||
127 | * representing the major component of the vSockets version. Typically | ||
128 | * changes for every major release of a product. | ||
129 | */ | ||
130 | |||
131 | #define VM_SOCKETS_VERSION_MAJOR(_v) (((_v) & 0x00FF0000) >> 16) | ||
132 | |||
133 | /* The minor (third) component of the vSockets version. Two bytes representing | ||
134 | * the minor component of the vSockets version. | ||
135 | */ | ||
136 | |||
137 | #define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF)) | ||
138 | |||
139 | /* Address structure for vSockets. The address family should be set to | ||
140 | * whatever vmci_sock_get_af_value_fd() returns. The structure members should | ||
141 | * all align on their natural boundaries without resorting to compiler packing | ||
142 | * directives. The total size of this structure should be exactly the same as | ||
143 | * that of struct sockaddr. | ||
144 | */ | ||
145 | |||
146 | struct sockaddr_vm { | ||
147 | sa_family_t svm_family; | ||
148 | unsigned short svm_reserved1; | ||
149 | unsigned int svm_port; | ||
150 | unsigned int svm_cid; | ||
151 | unsigned char svm_zero[sizeof(struct sockaddr) - | ||
152 | sizeof(sa_family_t) - | ||
153 | sizeof(unsigned short) - | ||
154 | sizeof(unsigned int) - sizeof(unsigned int)]; | ||
155 | }; | ||
156 | |||
157 | #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) | ||
158 | |||
159 | #if defined(__KERNEL__) | ||
160 | int vm_sockets_get_local_cid(void); | ||
161 | #endif | ||
162 | |||
163 | #endif | ||
diff --git a/include/uapi/linux/wanrouter.h b/include/uapi/linux/wanrouter.h index 7617df2833d5..498d6c12c666 100644 --- a/include/uapi/linux/wanrouter.h +++ b/include/uapi/linux/wanrouter.h | |||
@@ -1,363 +1,9 @@ | |||
1 | /***************************************************************************** | ||
2 | * wanrouter.h Definitions for the WAN Multiprotocol Router Module. | ||
3 | * This module provides API and common services for WAN Link | ||
4 | * Drivers and is completely hardware-independent. | ||
5 | * | ||
6 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
7 | * Gideon Hack | ||
8 | * Additions: Arnaldo Melo | ||
9 | * | ||
10 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version | ||
15 | * 2 of the License, or (at your option) any later version. | ||
16 | * ============================================================================ | ||
17 | * Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State | ||
18 | * Feb 24, 2000 Nenad Corbic Added support for socket based x25api | ||
19 | * Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol. | ||
20 | * Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release | ||
21 | * Jun 02, 1999 Gideon Hack Added support for the S514 adapter. | ||
22 | * May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t | ||
23 | * WAN_DISCONNECTING state added | ||
24 | * Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t' | ||
25 | * Jun 12, 1998 David Fong Added Cisco HDLC support. | ||
26 | * Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to | ||
27 | * 'wanif_conf_t' | ||
28 | * Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t' | ||
29 | * Added 'authenticator' to 'wan_ppp_conf_t' | ||
30 | * Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0 | ||
31 | * Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t' | ||
32 | * Added 'enable_IPX' and 'network_number' to | ||
33 | * 'wan_device_t'. Also added defines for | ||
34 | * UDP PACKET TYPE, Interrupt test, critical values | ||
35 | * for RACE conditions. | ||
36 | * Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to | ||
37 | * 'wan_fr_conf_t' to configure a list of dlci(s) | ||
38 | * for a NODE | ||
39 | * Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t' | ||
40 | * May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t' | ||
41 | * May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t' | ||
42 | * Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t' | ||
43 | * Jan 16, 1997 Gene Kozin router_devlist made public | ||
44 | * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). | ||
45 | *****************************************************************************/ | ||
46 | |||
47 | #ifndef _UAPI_ROUTER_H | ||
48 | #define _UAPI_ROUTER_H | ||
49 | |||
50 | #define ROUTER_NAME "wanrouter" /* in case we ever change it */ | ||
51 | #define ROUTER_VERSION 1 /* version number */ | ||
52 | #define ROUTER_RELEASE 1 /* release (minor version) number */ | ||
53 | #define ROUTER_IOCTL 'W' /* for IOCTL calls */ | ||
54 | #define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */ | ||
55 | |||
56 | /* IOCTL codes for /proc/router/<device> entries (up to 255) */ | ||
57 | enum router_ioctls | ||
58 | { | ||
59 | ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */ | ||
60 | ROUTER_DOWN, /* shut down device */ | ||
61 | ROUTER_STAT, /* get device status */ | ||
62 | ROUTER_IFNEW, /* add interface */ | ||
63 | ROUTER_IFDEL, /* delete interface */ | ||
64 | ROUTER_IFSTAT, /* get interface status */ | ||
65 | ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */ | ||
66 | ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31 | ||
67 | }; | ||
68 | |||
69 | /* identifiers for displaying proc file data for dual port adapters */ | ||
70 | #define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */ | ||
71 | #define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */ | ||
72 | |||
73 | /* NLPID for packet encapsulation (ISO/IEC TR 9577) */ | ||
74 | #define NLPID_IP 0xCC /* Internet Protocol Datagram */ | ||
75 | #define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */ | ||
76 | #define NLPID_CLNP 0x81 /* ISO/IEC 8473 */ | ||
77 | #define NLPID_ESIS 0x82 /* ISO/IEC 9542 */ | ||
78 | #define NLPID_ISIS 0x83 /* ISO/IEC ISIS */ | ||
79 | #define NLPID_Q933 0x08 /* CCITT Q.933 */ | ||
80 | |||
81 | /* Miscellaneous */ | ||
82 | #define WAN_IFNAME_SZ 15 /* max length of the interface name */ | ||
83 | #define WAN_DRVNAME_SZ 15 /* max length of the link driver name */ | ||
84 | #define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */ | ||
85 | #define USED_BY_FIELD 8 /* max length of the used by field */ | ||
86 | |||
87 | /* Defines for UDP PACKET TYPE */ | ||
88 | #define UDP_PTPIPE_TYPE 0x01 | ||
89 | #define UDP_FPIPE_TYPE 0x02 | ||
90 | #define UDP_CPIPE_TYPE 0x03 | ||
91 | #define UDP_DRVSTATS_TYPE 0x04 | ||
92 | #define UDP_INVALID_TYPE 0x05 | ||
93 | |||
94 | /* Command return code */ | ||
95 | #define CMD_OK 0 /* normal firmware return code */ | ||
96 | #define CMD_TIMEOUT 0xFF /* firmware command timed out */ | ||
97 | |||
98 | /* UDP Packet Management */ | ||
99 | #define UDP_PKT_FRM_STACK 0x00 | ||
100 | #define UDP_PKT_FRM_NETWORK 0x01 | ||
101 | |||
102 | /* Maximum interrupt test counter */ | ||
103 | #define MAX_INTR_TEST_COUNTER 100 | ||
104 | |||
105 | /* Critical Values for RACE conditions*/ | ||
106 | #define CRITICAL_IN_ISR 0xA1 | ||
107 | #define CRITICAL_INTR_HANDLED 0xB1 | ||
108 | |||
109 | /****** Data Types **********************************************************/ | ||
110 | |||
111 | /*---------------------------------------------------------------------------- | ||
112 | * X.25-specific link-level configuration. | ||
113 | */ | ||
114 | typedef struct wan_x25_conf | ||
115 | { | ||
116 | unsigned lo_pvc; /* lowest permanent circuit number */ | ||
117 | unsigned hi_pvc; /* highest permanent circuit number */ | ||
118 | unsigned lo_svc; /* lowest switched circuit number */ | ||
119 | unsigned hi_svc; /* highest switched circuit number */ | ||
120 | unsigned hdlc_window; /* HDLC window size (1..7) */ | ||
121 | unsigned pkt_window; /* X.25 packet window size (1..7) */ | ||
122 | unsigned t1; /* HDLC timer T1, sec (1..30) */ | ||
123 | unsigned t2; /* HDLC timer T2, sec (0..29) */ | ||
124 | unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */ | ||
125 | unsigned n2; /* HDLC retransmission limit (1..30) */ | ||
126 | unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */ | ||
127 | unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */ | ||
128 | unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */ | ||
129 | unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */ | ||
130 | unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */ | ||
131 | unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */ | ||
132 | unsigned r10_r20; /* RESTART retransmission limit (0..250) */ | ||
133 | unsigned r12_r22; /* RESET retransmission limit (0..250) */ | ||
134 | unsigned r13_r23; /* CLEAR retransmission limit (0..250) */ | ||
135 | unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */ | ||
136 | unsigned x25_conf_opt; /* User defined x25 config optoins */ | ||
137 | unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */ | ||
138 | unsigned char logging; /* Control connection logging */ | ||
139 | unsigned char oob_on_modem; /* Whether to send modem status to the user app */ | ||
140 | } wan_x25_conf_t; | ||
141 | |||
142 | /*---------------------------------------------------------------------------- | ||
143 | * Frame relay specific link-level configuration. | ||
144 | */ | ||
145 | typedef struct wan_fr_conf | ||
146 | { | ||
147 | unsigned signalling; /* local in-channel signalling type */ | ||
148 | unsigned t391; /* link integrity verification timer */ | ||
149 | unsigned t392; /* polling verification timer */ | ||
150 | unsigned n391; /* full status polling cycle counter */ | ||
151 | unsigned n392; /* error threshold counter */ | ||
152 | unsigned n393; /* monitored events counter */ | ||
153 | unsigned dlci_num; /* number of DLCs (access node) */ | ||
154 | unsigned dlci[100]; /* List of all DLCIs */ | ||
155 | } wan_fr_conf_t; | ||
156 | |||
157 | /*---------------------------------------------------------------------------- | ||
158 | * PPP-specific link-level configuration. | ||
159 | */ | ||
160 | typedef struct wan_ppp_conf | ||
161 | { | ||
162 | unsigned restart_tmr; /* restart timer */ | ||
163 | unsigned auth_rsrt_tmr; /* authentication timer */ | ||
164 | unsigned auth_wait_tmr; /* authentication timer */ | ||
165 | unsigned mdm_fail_tmr; /* modem failure timer */ | ||
166 | unsigned dtr_drop_tmr; /* DTR drop timer */ | ||
167 | unsigned connect_tmout; /* connection timeout */ | ||
168 | unsigned conf_retry; /* max. retry */ | ||
169 | unsigned term_retry; /* max. retry */ | ||
170 | unsigned fail_retry; /* max. retry */ | ||
171 | unsigned auth_retry; /* max. retry */ | ||
172 | unsigned auth_options; /* authentication opt. */ | ||
173 | unsigned ip_options; /* IP options */ | ||
174 | char authenticator; /* AUTHENTICATOR or not */ | ||
175 | char ip_mode; /* Static/Host/Peer */ | ||
176 | } wan_ppp_conf_t; | ||
177 | |||
178 | /*---------------------------------------------------------------------------- | ||
179 | * CHDLC-specific link-level configuration. | ||
180 | */ | ||
181 | typedef struct wan_chdlc_conf | ||
182 | { | ||
183 | unsigned char ignore_dcd; /* Protocol options: */ | ||
184 | unsigned char ignore_cts; /* Ignore these to determine */ | ||
185 | unsigned char ignore_keepalive; /* link status (Yes or No) */ | ||
186 | unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */ | ||
187 | unsigned char receive_only; /* no transmit buffering (Y/N) */ | ||
188 | unsigned keepalive_tx_tmr; /* transmit keepalive timer */ | ||
189 | unsigned keepalive_rx_tmr; /* receive keepalive timer */ | ||
190 | unsigned keepalive_err_margin; /* keepalive_error_tolerance */ | ||
191 | unsigned slarp_timer; /* SLARP request timer */ | ||
192 | } wan_chdlc_conf_t; | ||
193 | |||
194 | |||
195 | /*---------------------------------------------------------------------------- | ||
196 | * WAN device configuration. Passed to ROUTER_SETUP IOCTL. | ||
197 | */ | ||
198 | typedef struct wandev_conf | ||
199 | { | ||
200 | unsigned magic; /* magic number (for verification) */ | ||
201 | unsigned config_id; /* configuration structure identifier */ | ||
202 | /****** hardware configuration ******/ | ||
203 | unsigned ioport; /* adapter I/O port base */ | ||
204 | unsigned long maddr; /* dual-port memory address */ | ||
205 | unsigned msize; /* dual-port memory size */ | ||
206 | int irq; /* interrupt request level */ | ||
207 | int dma; /* DMA request level */ | ||
208 | char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */ | ||
209 | unsigned PCI_slot_no; /* S514 PCI adapter slot number */ | ||
210 | char auto_pci_cfg; /* S515 PCI automatic slot detection */ | ||
211 | char comm_port; /* Communication Port (PRI=0, SEC=1) */ | ||
212 | unsigned bps; /* data transfer rate */ | ||
213 | unsigned mtu; /* maximum transmit unit size */ | ||
214 | unsigned udp_port; /* UDP port for management */ | ||
215 | unsigned char ttl; /* Time To Live for UDP security */ | ||
216 | unsigned char ft1; /* FT1 Configurator Option */ | ||
217 | char interface; /* RS-232/V.35, etc. */ | ||
218 | char clocking; /* external/internal */ | ||
219 | char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ | ||
220 | char station; /* DTE/DCE, primary/secondary, etc. */ | ||
221 | char connection; /* permanent/switched/on-demand */ | ||
222 | char read_mode; /* read mode: Polling or interrupt */ | ||
223 | char receive_only; /* disable tx buffers */ | ||
224 | char tty; /* Create a fake tty device */ | ||
225 | unsigned tty_major; /* Major number for wanpipe tty device */ | ||
226 | unsigned tty_minor; /* Minor number for wanpipe tty device */ | ||
227 | unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */ | ||
228 | char backup; /* Backup Mode */ | ||
229 | unsigned hw_opt[4]; /* other hardware options */ | ||
230 | unsigned reserved[4]; | ||
231 | /****** arbitrary data ***************/ | ||
232 | unsigned data_size; /* data buffer size */ | ||
233 | void* data; /* data buffer, e.g. firmware */ | ||
234 | union /****** protocol-specific ************/ | ||
235 | { | ||
236 | wan_x25_conf_t x25; /* X.25 configuration */ | ||
237 | wan_ppp_conf_t ppp; /* PPP configuration */ | ||
238 | wan_fr_conf_t fr; /* frame relay configuration */ | ||
239 | wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */ | ||
240 | } u; | ||
241 | } wandev_conf_t; | ||
242 | |||
243 | /* 'config_id' definitions */ | ||
244 | #define WANCONFIG_X25 101 /* X.25 link */ | ||
245 | #define WANCONFIG_FR 102 /* frame relay link */ | ||
246 | #define WANCONFIG_PPP 103 /* synchronous PPP link */ | ||
247 | #define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */ | ||
248 | #define WANCONFIG_BSC 105 /* BiSync Streaming */ | ||
249 | #define WANCONFIG_HDLC 106 /* HDLC Support */ | ||
250 | #define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */ | ||
251 | |||
252 | /* | 1 | /* |
253 | * Configuration options defines. | 2 | * wanrouter.h Legacy declarations kept around until X25 is removed |
254 | */ | 3 | */ |
255 | /* general options */ | ||
256 | #define WANOPT_OFF 0 | ||
257 | #define WANOPT_ON 1 | ||
258 | #define WANOPT_NO 0 | ||
259 | #define WANOPT_YES 1 | ||
260 | |||
261 | /* intercace options */ | ||
262 | #define WANOPT_RS232 0 | ||
263 | #define WANOPT_V35 1 | ||
264 | |||
265 | /* data encoding options */ | ||
266 | #define WANOPT_NRZ 0 | ||
267 | #define WANOPT_NRZI 1 | ||
268 | #define WANOPT_FM0 2 | ||
269 | #define WANOPT_FM1 3 | ||
270 | |||
271 | /* link type options */ | ||
272 | #define WANOPT_POINTTOPOINT 0 /* RTS always active */ | ||
273 | #define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */ | ||
274 | |||
275 | /* clocking options */ | ||
276 | #define WANOPT_EXTERNAL 0 | ||
277 | #define WANOPT_INTERNAL 1 | ||
278 | |||
279 | /* station options */ | ||
280 | #define WANOPT_DTE 0 | ||
281 | #define WANOPT_DCE 1 | ||
282 | #define WANOPT_CPE 0 | ||
283 | #define WANOPT_NODE 1 | ||
284 | #define WANOPT_SECONDARY 0 | ||
285 | #define WANOPT_PRIMARY 1 | ||
286 | |||
287 | /* connection options */ | ||
288 | #define WANOPT_PERMANENT 0 /* DTR always active */ | ||
289 | #define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */ | ||
290 | #define WANOPT_ONDEMAND 2 /* activate DTR only before sending */ | ||
291 | |||
292 | /* frame relay in-channel signalling */ | ||
293 | #define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */ | ||
294 | #define WANOPT_FR_Q933 2 /* ITU Q.933A */ | ||
295 | #define WANOPT_FR_LMI 3 /* LMI */ | ||
296 | |||
297 | /* PPP IP Mode Options */ | ||
298 | #define WANOPT_PPP_STATIC 0 | ||
299 | #define WANOPT_PPP_HOST 1 | ||
300 | #define WANOPT_PPP_PEER 2 | ||
301 | |||
302 | /* ASY Mode Options */ | ||
303 | #define WANOPT_ONE 1 | ||
304 | #define WANOPT_TWO 2 | ||
305 | #define WANOPT_ONE_AND_HALF 3 | ||
306 | |||
307 | #define WANOPT_NONE 0 | ||
308 | #define WANOPT_ODD 1 | ||
309 | #define WANOPT_EVEN 2 | ||
310 | |||
311 | /* CHDLC Protocol Options */ | ||
312 | /* DF Commented out for now. | ||
313 | |||
314 | #define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT | ||
315 | #define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT | ||
316 | #define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT | ||
317 | */ | ||
318 | |||
319 | /* Port options */ | ||
320 | #define WANOPT_PRI 0 | ||
321 | #define WANOPT_SEC 1 | ||
322 | /* read mode */ | ||
323 | #define WANOPT_INTR 0 | ||
324 | #define WANOPT_POLL 1 | ||
325 | 4 | ||
326 | 5 | #ifndef _UAPI_ROUTER_H | |
327 | #define WANOPT_TTY_SYNC 0 | 6 | #define _UAPI_ROUTER_H |
328 | #define WANOPT_TTY_ASYNC 1 | ||
329 | /*---------------------------------------------------------------------------- | ||
330 | * WAN Link Status Info (for ROUTER_STAT IOCTL). | ||
331 | */ | ||
332 | typedef struct wandev_stat | ||
333 | { | ||
334 | unsigned state; /* link state */ | ||
335 | unsigned ndev; /* number of configured interfaces */ | ||
336 | |||
337 | /* link/interface configuration */ | ||
338 | unsigned connection; /* permanent/switched/on-demand */ | ||
339 | unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */ | ||
340 | unsigned mtu; /* max. transmit unit for this device */ | ||
341 | |||
342 | /* physical level statistics */ | ||
343 | unsigned modem_status; /* modem status */ | ||
344 | unsigned rx_frames; /* received frames count */ | ||
345 | unsigned rx_overruns; /* receiver overrun error count */ | ||
346 | unsigned rx_crc_err; /* receive CRC error count */ | ||
347 | unsigned rx_aborts; /* received aborted frames count */ | ||
348 | unsigned rx_bad_length; /* unexpetedly long/short frames count */ | ||
349 | unsigned rx_dropped; /* frames discarded at device level */ | ||
350 | unsigned tx_frames; /* transmitted frames count */ | ||
351 | unsigned tx_underruns; /* aborted transmissions (underruns) count */ | ||
352 | unsigned tx_timeouts; /* transmission timeouts */ | ||
353 | unsigned tx_rejects; /* other transmit errors */ | ||
354 | |||
355 | /* media level statistics */ | ||
356 | unsigned rx_bad_format; /* frames with invalid format */ | ||
357 | unsigned rx_bad_addr; /* frames with invalid media address */ | ||
358 | unsigned tx_retries; /* frames re-transmitted */ | ||
359 | unsigned reserved[16]; /* reserved for future use */ | ||
360 | } wandev_stat_t; | ||
361 | 7 | ||
362 | /* 'state' defines */ | 8 | /* 'state' defines */ |
363 | enum wan_states | 9 | enum wan_states |
@@ -365,88 +11,7 @@ enum wan_states | |||
365 | WAN_UNCONFIGURED, /* link/channel is not configured */ | 11 | WAN_UNCONFIGURED, /* link/channel is not configured */ |
366 | WAN_DISCONNECTED, /* link/channel is disconnected */ | 12 | WAN_DISCONNECTED, /* link/channel is disconnected */ |
367 | WAN_CONNECTING, /* connection is in progress */ | 13 | WAN_CONNECTING, /* connection is in progress */ |
368 | WAN_CONNECTED, /* link/channel is operational */ | 14 | WAN_CONNECTED /* link/channel is operational */ |
369 | WAN_LIMIT, /* for verification only */ | ||
370 | WAN_DUALPORT, /* for Dual Port cards */ | ||
371 | WAN_DISCONNECTING, | ||
372 | WAN_FT1_READY /* FT1 Configurator Ready */ | ||
373 | }; | 15 | }; |
374 | 16 | ||
375 | enum { | ||
376 | WAN_LOCAL_IP, | ||
377 | WAN_POINTOPOINT_IP, | ||
378 | WAN_NETMASK_IP, | ||
379 | WAN_BROADCAST_IP | ||
380 | }; | ||
381 | |||
382 | /* 'modem_status' masks */ | ||
383 | #define WAN_MODEM_CTS 0x0001 /* CTS line active */ | ||
384 | #define WAN_MODEM_DCD 0x0002 /* DCD line active */ | ||
385 | #define WAN_MODEM_DTR 0x0010 /* DTR line active */ | ||
386 | #define WAN_MODEM_RTS 0x0020 /* RTS line active */ | ||
387 | |||
388 | /*---------------------------------------------------------------------------- | ||
389 | * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL). | ||
390 | */ | ||
391 | typedef struct wanif_conf | ||
392 | { | ||
393 | unsigned magic; /* magic number */ | ||
394 | unsigned config_id; /* configuration identifier */ | ||
395 | char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */ | ||
396 | char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */ | ||
397 | char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */ | ||
398 | unsigned idle_timeout; /* sec, before disconnecting */ | ||
399 | unsigned hold_timeout; /* sec, before re-connecting */ | ||
400 | unsigned cir; /* Committed Information Rate fwd,bwd*/ | ||
401 | unsigned bc; /* Committed Burst Size fwd, bwd */ | ||
402 | unsigned be; /* Excess Burst Size fwd, bwd */ | ||
403 | unsigned char enable_IPX; /* Enable or Disable IPX */ | ||
404 | unsigned char inarp; /* Send Inverse ARP requests Y/N */ | ||
405 | unsigned inarp_interval; /* sec, between InARP requests */ | ||
406 | unsigned long network_number; /* Network Number for IPX */ | ||
407 | char mc; /* Multicast on or off */ | ||
408 | char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */ | ||
409 | unsigned char port; /* board port */ | ||
410 | unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */ | ||
411 | char pap; /* PAP enabled or disabled */ | ||
412 | char chap; /* CHAP enabled or disabled */ | ||
413 | unsigned char userid[511]; /* List of User Id */ | ||
414 | unsigned char passwd[511]; /* List of passwords */ | ||
415 | unsigned char sysname[31]; /* Name of the system */ | ||
416 | unsigned char ignore_dcd; /* Protocol options: */ | ||
417 | unsigned char ignore_cts; /* Ignore these to determine */ | ||
418 | unsigned char ignore_keepalive; /* link status (Yes or No) */ | ||
419 | unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */ | ||
420 | unsigned keepalive_tx_tmr; /* transmit keepalive timer */ | ||
421 | unsigned keepalive_rx_tmr; /* receive keepalive timer */ | ||
422 | unsigned keepalive_err_margin; /* keepalive_error_tolerance */ | ||
423 | unsigned slarp_timer; /* SLARP request timer */ | ||
424 | unsigned char ttl; /* Time To Live for UDP security */ | ||
425 | char interface; /* RS-232/V.35, etc. */ | ||
426 | char clocking; /* external/internal */ | ||
427 | unsigned bps; /* data transfer rate */ | ||
428 | unsigned mtu; /* maximum transmit unit size */ | ||
429 | unsigned char if_down; /* brind down interface when disconnected */ | ||
430 | unsigned char gateway; /* Is this interface a gateway */ | ||
431 | unsigned char true_if_encoding; /* Set the dev->type to true board protocol */ | ||
432 | |||
433 | unsigned char asy_data_trans; /* async API options */ | ||
434 | unsigned char rts_hs_for_receive; /* async Protocol options */ | ||
435 | unsigned char xon_xoff_hs_for_receive; | ||
436 | unsigned char xon_xoff_hs_for_transmit; | ||
437 | unsigned char dcd_hs_for_transmit; | ||
438 | unsigned char cts_hs_for_transmit; | ||
439 | unsigned char async_mode; | ||
440 | unsigned tx_bits_per_char; | ||
441 | unsigned rx_bits_per_char; | ||
442 | unsigned stop_bits; | ||
443 | unsigned char parity; | ||
444 | unsigned break_timer; | ||
445 | unsigned inter_char_timer; | ||
446 | unsigned rx_complete_length; | ||
447 | unsigned xon_char; | ||
448 | unsigned xoff_char; | ||
449 | unsigned char receive_only; /* no transmit buffering (Y/N) */ | ||
450 | } wanif_conf_t; | ||
451 | |||
452 | #endif /* _UAPI_ROUTER_H */ | 17 | #endif /* _UAPI_ROUTER_H */ |
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 81aba3a73aa3..805711ea2005 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
@@ -261,6 +261,22 @@ struct ib_uverbs_dereg_mr { | |||
261 | __u32 mr_handle; | 261 | __u32 mr_handle; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | struct ib_uverbs_alloc_mw { | ||
265 | __u64 response; | ||
266 | __u32 pd_handle; | ||
267 | __u8 mw_type; | ||
268 | __u8 reserved[3]; | ||
269 | }; | ||
270 | |||
271 | struct ib_uverbs_alloc_mw_resp { | ||
272 | __u32 mw_handle; | ||
273 | __u32 rkey; | ||
274 | }; | ||
275 | |||
276 | struct ib_uverbs_dealloc_mw { | ||
277 | __u32 mw_handle; | ||
278 | }; | ||
279 | |||
264 | struct ib_uverbs_create_comp_channel { | 280 | struct ib_uverbs_create_comp_channel { |
265 | __u64 response; | 281 | __u64 response; |
266 | }; | 282 | }; |
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h index 05341a43fedf..d630163b9a2e 100644 --- a/include/uapi/sound/compress_offload.h +++ b/include/uapi/sound/compress_offload.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <sound/compress_params.h> | 30 | #include <sound/compress_params.h> |
31 | 31 | ||
32 | 32 | ||
33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0) | 33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 1) |
34 | /** | 34 | /** |
35 | * struct snd_compressed_buffer: compressed buffer | 35 | * struct snd_compressed_buffer: compressed buffer |
36 | * @fragment_size: size of buffer fragment in bytes | 36 | * @fragment_size: size of buffer fragment in bytes |
@@ -122,6 +122,27 @@ struct snd_compr_codec_caps { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | /** | 124 | /** |
125 | * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the | ||
126 | * end of the track | ||
127 | * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the | ||
128 | * beginning of the track | ||
129 | */ | ||
130 | enum { | ||
131 | SNDRV_COMPRESS_ENCODER_PADDING = 1, | ||
132 | SNDRV_COMPRESS_ENCODER_DELAY = 2, | ||
133 | }; | ||
134 | |||
135 | /** | ||
136 | * struct snd_compr_metadata: compressed stream metadata | ||
137 | * @key: key id | ||
138 | * @value: key value | ||
139 | */ | ||
140 | struct snd_compr_metadata { | ||
141 | __u32 key; | ||
142 | __u32 value[8]; | ||
143 | }; | ||
144 | |||
145 | /** | ||
125 | * compress path ioctl definitions | 146 | * compress path ioctl definitions |
126 | * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP | 147 | * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP |
127 | * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec | 148 | * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec |
@@ -145,6 +166,10 @@ struct snd_compr_codec_caps { | |||
145 | struct snd_compr_codec_caps) | 166 | struct snd_compr_codec_caps) |
146 | #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) | 167 | #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) |
147 | #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) | 168 | #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) |
169 | #define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14,\ | ||
170 | struct snd_compr_metadata) | ||
171 | #define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15,\ | ||
172 | struct snd_compr_metadata) | ||
148 | #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) | 173 | #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) |
149 | #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) | 174 | #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) |
150 | #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) | 175 | #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) |
@@ -152,10 +177,14 @@ struct snd_compr_codec_caps { | |||
152 | #define SNDRV_COMPRESS_START _IO('C', 0x32) | 177 | #define SNDRV_COMPRESS_START _IO('C', 0x32) |
153 | #define SNDRV_COMPRESS_STOP _IO('C', 0x33) | 178 | #define SNDRV_COMPRESS_STOP _IO('C', 0x33) |
154 | #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) | 179 | #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) |
180 | #define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35) | ||
181 | #define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36) | ||
155 | /* | 182 | /* |
156 | * TODO | 183 | * TODO |
157 | * 1. add mmap support | 184 | * 1. add mmap support |
158 | * | 185 | * |
159 | */ | 186 | */ |
160 | #define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */ | 187 | #define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */ |
188 | #define SND_COMPR_TRIGGER_NEXT_TRACK 8 | ||
189 | #define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9 | ||
161 | #endif | 190 | #endif |
diff --git a/include/video/display_timing.h b/include/video/display_timing.h new file mode 100644 index 000000000000..71e9a383a981 --- /dev/null +++ b/include/video/display_timing.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
3 | * | ||
4 | * description of display timings | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_DISPLAY_TIMING_H | ||
10 | #define __LINUX_DISPLAY_TIMING_H | ||
11 | |||
12 | #include <linux/bitops.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | /* VESA display monitor timing parameters */ | ||
16 | #define VESA_DMT_HSYNC_LOW BIT(0) | ||
17 | #define VESA_DMT_HSYNC_HIGH BIT(1) | ||
18 | #define VESA_DMT_VSYNC_LOW BIT(2) | ||
19 | #define VESA_DMT_VSYNC_HIGH BIT(3) | ||
20 | |||
21 | /* display specific flags */ | ||
22 | #define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ | ||
23 | #define DISPLAY_FLAGS_DE_HIGH BIT(1) | ||
24 | #define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ | ||
25 | #define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ | ||
26 | #define DISPLAY_FLAGS_INTERLACED BIT(4) | ||
27 | #define DISPLAY_FLAGS_DOUBLESCAN BIT(5) | ||
28 | |||
29 | /* | ||
30 | * A single signal can be specified via a range of minimal and maximal values | ||
31 | * with a typical value, that lies somewhere inbetween. | ||
32 | */ | ||
33 | struct timing_entry { | ||
34 | u32 min; | ||
35 | u32 typ; | ||
36 | u32 max; | ||
37 | }; | ||
38 | |||
39 | enum timing_entry_index { | ||
40 | TE_MIN = 0, | ||
41 | TE_TYP = 1, | ||
42 | TE_MAX = 2, | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * Single "mode" entry. This describes one set of signal timings a display can | ||
47 | * have in one setting. This struct can later be converted to struct videomode | ||
48 | * (see include/video/videomode.h). As each timing_entry can be defined as a | ||
49 | * range, one struct display_timing may become multiple struct videomodes. | ||
50 | * | ||
51 | * Example: hsync active high, vsync active low | ||
52 | * | ||
53 | * Active Video | ||
54 | * Video ______________________XXXXXXXXXXXXXXXXXXXXXX_____________________ | ||
55 | * |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync.. | ||
56 | * | | porch | | porch | | ||
57 | * | ||
58 | * HSync _|¯¯¯¯¯¯¯¯¯¯|___________________________________________|¯¯¯¯¯¯¯¯¯ | ||
59 | * | ||
60 | * VSync ¯|__________|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|_________ | ||
61 | */ | ||
62 | struct display_timing { | ||
63 | struct timing_entry pixelclock; | ||
64 | |||
65 | struct timing_entry hactive; /* hor. active video */ | ||
66 | struct timing_entry hfront_porch; /* hor. front porch */ | ||
67 | struct timing_entry hback_porch; /* hor. back porch */ | ||
68 | struct timing_entry hsync_len; /* hor. sync len */ | ||
69 | |||
70 | struct timing_entry vactive; /* ver. active video */ | ||
71 | struct timing_entry vfront_porch; /* ver. front porch */ | ||
72 | struct timing_entry vback_porch; /* ver. back porch */ | ||
73 | struct timing_entry vsync_len; /* ver. sync len */ | ||
74 | |||
75 | unsigned int dmt_flags; /* VESA DMT flags */ | ||
76 | unsigned int data_flags; /* video data flags */ | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * This describes all timing settings a display provides. | ||
81 | * The native_mode is the default setting for this display. | ||
82 | * Drivers that can handle multiple videomodes should work with this struct and | ||
83 | * convert each entry to the desired end result. | ||
84 | */ | ||
85 | struct display_timings { | ||
86 | unsigned int num_timings; | ||
87 | unsigned int native_mode; | ||
88 | |||
89 | struct display_timing **timings; | ||
90 | }; | ||
91 | |||
92 | /* get value specified by index from struct timing_entry */ | ||
93 | static inline u32 display_timing_get_value(const struct timing_entry *te, | ||
94 | enum timing_entry_index index) | ||
95 | { | ||
96 | switch (index) { | ||
97 | case TE_MIN: | ||
98 | return te->min; | ||
99 | break; | ||
100 | case TE_TYP: | ||
101 | return te->typ; | ||
102 | break; | ||
103 | case TE_MAX: | ||
104 | return te->max; | ||
105 | break; | ||
106 | default: | ||
107 | return te->typ; | ||
108 | } | ||
109 | } | ||
110 | |||
111 | /* get one entry from struct display_timings */ | ||
112 | static inline struct display_timing *display_timings_get(const struct | ||
113 | display_timings *disp, | ||
114 | unsigned int index) | ||
115 | { | ||
116 | if (disp->num_timings > index) | ||
117 | return disp->timings[index]; | ||
118 | else | ||
119 | return NULL; | ||
120 | } | ||
121 | |||
122 | void display_timings_release(struct display_timings *disp); | ||
123 | |||
124 | #endif | ||
diff --git a/include/video/exynos_mipi_dsim.h b/include/video/exynos_mipi_dsim.h index 83ce5e667d47..89dc88a171af 100644 --- a/include/video/exynos_mipi_dsim.h +++ b/include/video/exynos_mipi_dsim.h | |||
@@ -220,7 +220,6 @@ struct mipi_dsim_config { | |||
220 | struct mipi_dsim_device { | 220 | struct mipi_dsim_device { |
221 | struct device *dev; | 221 | struct device *dev; |
222 | int id; | 222 | int id; |
223 | struct resource *res; | ||
224 | struct clk *clock; | 223 | struct clk *clock; |
225 | unsigned int irq; | 224 | unsigned int irq; |
226 | void __iomem *reg_base; | 225 | void __iomem *reg_base; |
diff --git a/include/video/mmp_disp.h b/include/video/mmp_disp.h new file mode 100644 index 000000000000..b9dd1fbb0082 --- /dev/null +++ b/include/video/mmp_disp.h | |||
@@ -0,0 +1,352 @@ | |||
1 | /* | ||
2 | * linux/include/video/mmp_disp.h | ||
3 | * Header file for Marvell MMP Display Controller | ||
4 | * | ||
5 | * Copyright (C) 2012 Marvell Technology Group Ltd. | ||
6 | * Authors: Zhou Zhu <zzhu3@marvell.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 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along with | ||
19 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef _MMP_DISP_H_ | ||
24 | #define _MMP_DISP_H_ | ||
25 | #include <linux/kthread.h> | ||
26 | |||
27 | enum { | ||
28 | PIXFMT_UYVY = 0, | ||
29 | PIXFMT_VYUY, | ||
30 | PIXFMT_YUYV, | ||
31 | PIXFMT_YUV422P, | ||
32 | PIXFMT_YVU422P, | ||
33 | PIXFMT_YUV420P, | ||
34 | PIXFMT_YVU420P, | ||
35 | PIXFMT_RGB565 = 0x100, | ||
36 | PIXFMT_BGR565, | ||
37 | PIXFMT_RGB1555, | ||
38 | PIXFMT_BGR1555, | ||
39 | PIXFMT_RGB888PACK, | ||
40 | PIXFMT_BGR888PACK, | ||
41 | PIXFMT_RGB888UNPACK, | ||
42 | PIXFMT_BGR888UNPACK, | ||
43 | PIXFMT_RGBA888, | ||
44 | PIXFMT_BGRA888, | ||
45 | PIXFMT_RGB666, /* for output usage */ | ||
46 | PIXFMT_PSEUDOCOLOR = 0x200, | ||
47 | }; | ||
48 | |||
49 | static inline int pixfmt_to_stride(int pix_fmt) | ||
50 | { | ||
51 | switch (pix_fmt) { | ||
52 | case PIXFMT_RGB565: | ||
53 | case PIXFMT_BGR565: | ||
54 | case PIXFMT_RGB1555: | ||
55 | case PIXFMT_BGR1555: | ||
56 | case PIXFMT_UYVY: | ||
57 | case PIXFMT_VYUY: | ||
58 | case PIXFMT_YUYV: | ||
59 | return 2; | ||
60 | case PIXFMT_RGB888UNPACK: | ||
61 | case PIXFMT_BGR888UNPACK: | ||
62 | case PIXFMT_RGBA888: | ||
63 | case PIXFMT_BGRA888: | ||
64 | return 4; | ||
65 | case PIXFMT_RGB888PACK: | ||
66 | case PIXFMT_BGR888PACK: | ||
67 | return 3; | ||
68 | case PIXFMT_YUV422P: | ||
69 | case PIXFMT_YVU422P: | ||
70 | case PIXFMT_YUV420P: | ||
71 | case PIXFMT_YVU420P: | ||
72 | case PIXFMT_PSEUDOCOLOR: | ||
73 | return 1; | ||
74 | default: | ||
75 | return 0; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | /* parameters used by path/overlay */ | ||
80 | /* overlay related para: win/addr */ | ||
81 | struct mmp_win { | ||
82 | /* position/size of window */ | ||
83 | u16 xsrc; | ||
84 | u16 ysrc; | ||
85 | u16 xdst; | ||
86 | u16 ydst; | ||
87 | u16 xpos; | ||
88 | u16 ypos; | ||
89 | u16 left_crop; | ||
90 | u16 right_crop; | ||
91 | u16 up_crop; | ||
92 | u16 bottom_crop; | ||
93 | int pix_fmt; | ||
94 | }; | ||
95 | |||
96 | struct mmp_addr { | ||
97 | /* phys address */ | ||
98 | u32 phys[6]; | ||
99 | }; | ||
100 | |||
101 | /* path related para: mode */ | ||
102 | struct mmp_mode { | ||
103 | const char *name; | ||
104 | u32 refresh; | ||
105 | u32 xres; | ||
106 | u32 yres; | ||
107 | u32 left_margin; | ||
108 | u32 right_margin; | ||
109 | u32 upper_margin; | ||
110 | u32 lower_margin; | ||
111 | u32 hsync_len; | ||
112 | u32 vsync_len; | ||
113 | u32 hsync_invert; | ||
114 | u32 vsync_invert; | ||
115 | u32 invert_pixclock; | ||
116 | u32 pixclock_freq; | ||
117 | int pix_fmt_out; | ||
118 | }; | ||
119 | |||
120 | /* main structures */ | ||
121 | struct mmp_path; | ||
122 | struct mmp_overlay; | ||
123 | struct mmp_panel; | ||
124 | |||
125 | /* status types */ | ||
126 | enum { | ||
127 | MMP_OFF = 0, | ||
128 | MMP_ON, | ||
129 | }; | ||
130 | |||
131 | static inline const char *stat_name(int stat) | ||
132 | { | ||
133 | switch (stat) { | ||
134 | case MMP_OFF: | ||
135 | return "OFF"; | ||
136 | case MMP_ON: | ||
137 | return "ON"; | ||
138 | default: | ||
139 | return "UNKNOWNSTAT"; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | struct mmp_overlay_ops { | ||
144 | /* should be provided by driver */ | ||
145 | void (*set_fetch)(struct mmp_overlay *overlay, int fetch_id); | ||
146 | void (*set_onoff)(struct mmp_overlay *overlay, int status); | ||
147 | void (*set_win)(struct mmp_overlay *overlay, struct mmp_win *win); | ||
148 | int (*set_addr)(struct mmp_overlay *overlay, struct mmp_addr *addr); | ||
149 | }; | ||
150 | |||
151 | /* overlay describes a z-order indexed slot in each path. */ | ||
152 | struct mmp_overlay { | ||
153 | int id; | ||
154 | const char *name; | ||
155 | struct mmp_path *path; | ||
156 | |||
157 | /* overlay info: private data */ | ||
158 | int dmafetch_id; | ||
159 | struct mmp_addr addr; | ||
160 | struct mmp_win win; | ||
161 | |||
162 | /* state */ | ||
163 | int open_count; | ||
164 | int status; | ||
165 | struct mutex access_ok; | ||
166 | |||
167 | struct mmp_overlay_ops *ops; | ||
168 | }; | ||
169 | |||
170 | /* panel type */ | ||
171 | enum { | ||
172 | PANELTYPE_ACTIVE = 0, | ||
173 | PANELTYPE_SMART, | ||
174 | PANELTYPE_TV, | ||
175 | PANELTYPE_DSI_CMD, | ||
176 | PANELTYPE_DSI_VIDEO, | ||
177 | }; | ||
178 | |||
179 | struct mmp_panel { | ||
180 | /* use node to register to list */ | ||
181 | struct list_head node; | ||
182 | const char *name; | ||
183 | /* path name used to connect to proper path configed */ | ||
184 | const char *plat_path_name; | ||
185 | struct device *dev; | ||
186 | int panel_type; | ||
187 | void *plat_data; | ||
188 | int (*get_modelist)(struct mmp_panel *panel, | ||
189 | struct mmp_mode **modelist); | ||
190 | void (*set_mode)(struct mmp_panel *panel, | ||
191 | struct mmp_mode *mode); | ||
192 | void (*set_onoff)(struct mmp_panel *panel, | ||
193 | int status); | ||
194 | }; | ||
195 | |||
196 | struct mmp_path_ops { | ||
197 | int (*check_status)(struct mmp_path *path); | ||
198 | struct mmp_overlay *(*get_overlay)(struct mmp_path *path, | ||
199 | int overlay_id); | ||
200 | int (*get_modelist)(struct mmp_path *path, | ||
201 | struct mmp_mode **modelist); | ||
202 | |||
203 | /* follow ops should be provided by driver */ | ||
204 | void (*set_mode)(struct mmp_path *path, struct mmp_mode *mode); | ||
205 | void (*set_onoff)(struct mmp_path *path, int status); | ||
206 | /* todo: add query */ | ||
207 | }; | ||
208 | |||
209 | /* path output types */ | ||
210 | enum { | ||
211 | PATH_OUT_PARALLEL, | ||
212 | PATH_OUT_DSI, | ||
213 | PATH_OUT_HDMI, | ||
214 | }; | ||
215 | |||
216 | /* path is main part of mmp-disp */ | ||
217 | struct mmp_path { | ||
218 | /* use node to register to list */ | ||
219 | struct list_head node; | ||
220 | |||
221 | /* init data */ | ||
222 | struct device *dev; | ||
223 | |||
224 | int id; | ||
225 | const char *name; | ||
226 | int output_type; | ||
227 | struct mmp_panel *panel; | ||
228 | void *plat_data; | ||
229 | |||
230 | /* dynamic use */ | ||
231 | struct mmp_mode mode; | ||
232 | |||
233 | /* state */ | ||
234 | int open_count; | ||
235 | int status; | ||
236 | struct mutex access_ok; | ||
237 | |||
238 | struct mmp_path_ops ops; | ||
239 | |||
240 | /* layers */ | ||
241 | int overlay_num; | ||
242 | struct mmp_overlay overlays[0]; | ||
243 | }; | ||
244 | |||
245 | extern struct mmp_path *mmp_get_path(const char *name); | ||
246 | static inline void mmp_path_set_mode(struct mmp_path *path, | ||
247 | struct mmp_mode *mode) | ||
248 | { | ||
249 | if (path) | ||
250 | path->ops.set_mode(path, mode); | ||
251 | } | ||
252 | static inline void mmp_path_set_onoff(struct mmp_path *path, int status) | ||
253 | { | ||
254 | if (path) | ||
255 | path->ops.set_onoff(path, status); | ||
256 | } | ||
257 | static inline int mmp_path_get_modelist(struct mmp_path *path, | ||
258 | struct mmp_mode **modelist) | ||
259 | { | ||
260 | if (path) | ||
261 | return path->ops.get_modelist(path, modelist); | ||
262 | return 0; | ||
263 | } | ||
264 | static inline struct mmp_overlay *mmp_path_get_overlay( | ||
265 | struct mmp_path *path, int overlay_id) | ||
266 | { | ||
267 | if (path) | ||
268 | return path->ops.get_overlay(path, overlay_id); | ||
269 | return NULL; | ||
270 | } | ||
271 | static inline void mmp_overlay_set_fetch(struct mmp_overlay *overlay, | ||
272 | int fetch_id) | ||
273 | { | ||
274 | if (overlay) | ||
275 | overlay->ops->set_fetch(overlay, fetch_id); | ||
276 | } | ||
277 | static inline void mmp_overlay_set_onoff(struct mmp_overlay *overlay, | ||
278 | int status) | ||
279 | { | ||
280 | if (overlay) | ||
281 | overlay->ops->set_onoff(overlay, status); | ||
282 | } | ||
283 | static inline void mmp_overlay_set_win(struct mmp_overlay *overlay, | ||
284 | struct mmp_win *win) | ||
285 | { | ||
286 | if (overlay) | ||
287 | overlay->ops->set_win(overlay, win); | ||
288 | } | ||
289 | static inline int mmp_overlay_set_addr(struct mmp_overlay *overlay, | ||
290 | struct mmp_addr *addr) | ||
291 | { | ||
292 | if (overlay) | ||
293 | return overlay->ops->set_addr(overlay, addr); | ||
294 | return 0; | ||
295 | } | ||
296 | |||
297 | /* | ||
298 | * driver data is set from each detailed ctrl driver for path usage | ||
299 | * it defined a common interface that plat driver need to implement | ||
300 | */ | ||
301 | struct mmp_path_info { | ||
302 | /* driver data, set when registed*/ | ||
303 | const char *name; | ||
304 | struct device *dev; | ||
305 | int id; | ||
306 | int output_type; | ||
307 | int overlay_num; | ||
308 | void (*set_mode)(struct mmp_path *path, struct mmp_mode *mode); | ||
309 | void (*set_onoff)(struct mmp_path *path, int status); | ||
310 | struct mmp_overlay_ops *overlay_ops; | ||
311 | void *plat_data; | ||
312 | }; | ||
313 | |||
314 | extern struct mmp_path *mmp_register_path( | ||
315 | struct mmp_path_info *info); | ||
316 | extern void mmp_unregister_path(struct mmp_path *path); | ||
317 | extern void mmp_register_panel(struct mmp_panel *panel); | ||
318 | extern void mmp_unregister_panel(struct mmp_panel *panel); | ||
319 | |||
320 | /* defintions for platform data */ | ||
321 | /* interface for buffer driver */ | ||
322 | struct mmp_buffer_driver_mach_info { | ||
323 | const char *name; | ||
324 | const char *path_name; | ||
325 | int overlay_id; | ||
326 | int dmafetch_id; | ||
327 | int default_pixfmt; | ||
328 | }; | ||
329 | |||
330 | /* interface for controllers driver */ | ||
331 | struct mmp_mach_path_config { | ||
332 | const char *name; | ||
333 | int overlay_num; | ||
334 | int output_type; | ||
335 | u32 path_config; | ||
336 | u32 link_config; | ||
337 | }; | ||
338 | |||
339 | struct mmp_mach_plat_info { | ||
340 | const char *name; | ||
341 | const char *clk_name; | ||
342 | int path_num; | ||
343 | struct mmp_mach_path_config *paths; | ||
344 | }; | ||
345 | |||
346 | /* interface for panel drivers */ | ||
347 | struct mmp_mach_panel_info { | ||
348 | const char *name; | ||
349 | void (*plat_set_onoff)(int status); | ||
350 | const char *plat_path_name; | ||
351 | }; | ||
352 | #endif /* _MMP_DISP_H_ */ | ||
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h new file mode 100644 index 000000000000..8016eb727cf3 --- /dev/null +++ b/include/video/of_display_timing.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
3 | * | ||
4 | * display timings of helpers | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_DISPLAY_TIMING_H | ||
10 | #define __LINUX_OF_DISPLAY_TIMING_H | ||
11 | |||
12 | struct device_node; | ||
13 | struct display_timings; | ||
14 | |||
15 | #define OF_USE_NATIVE_MODE -1 | ||
16 | |||
17 | struct display_timings *of_get_display_timings(struct device_node *np); | ||
18 | int of_display_timings_exist(struct device_node *np); | ||
19 | |||
20 | #endif | ||
diff --git a/include/video/of_videomode.h b/include/video/of_videomode.h new file mode 100644 index 000000000000..a07efcc51424 --- /dev/null +++ b/include/video/of_videomode.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
3 | * | ||
4 | * videomode of-helpers | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_VIDEOMODE_H | ||
10 | #define __LINUX_OF_VIDEOMODE_H | ||
11 | |||
12 | struct device_node; | ||
13 | struct videomode; | ||
14 | |||
15 | int of_get_videomode(struct device_node *np, struct videomode *vm, | ||
16 | int index); | ||
17 | |||
18 | #endif /* __LINUX_OF_VIDEOMODE_H */ | ||
diff --git a/include/video/samsung_fimd.h b/include/video/samsung_fimd.h index e7554486a2b7..b0393209679b 100644 --- a/include/video/samsung_fimd.h +++ b/include/video/samsung_fimd.h | |||
@@ -8,12 +8,8 @@ | |||
8 | * S3C Platform - new-style fimd and framebuffer register definitions | 8 | * S3C Platform - new-style fimd and framebuffer register definitions |
9 | * | 9 | * |
10 | * This is the register set for the fimd and new style framebuffer interface | 10 | * This is the register set for the fimd and new style framebuffer interface |
11 | * found from the S3C2443 onwards into the S3C2416, S3C2450 and the | 11 | * found from the S3C2443 onwards into the S3C2416, S3C2450, the |
12 | * S3C64XX series such as the S3C6400 and S3C6410. | 12 | * S3C64XX series such as the S3C6400 and S3C6410, and EXYNOS series. |
13 | * | ||
14 | * The file does not contain the cpu specific items which are based on | ||
15 | * whichever architecture is selected, it only contains the core of the | ||
16 | * register set. See <mach/regs-fb.h> to get the specifics. | ||
17 | * | 13 | * |
18 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License version 2 as | 15 | * it under the terms of the GNU General Public License version 2 as |
@@ -22,10 +18,10 @@ | |||
22 | 18 | ||
23 | /* VIDCON0 */ | 19 | /* VIDCON0 */ |
24 | 20 | ||
25 | #define VIDCON0 (0x00) | 21 | #define VIDCON0 0x00 |
26 | #define VIDCON0_INTERLACE (1 << 29) | 22 | #define VIDCON0_INTERLACE (1 << 29) |
27 | #define VIDCON0_VIDOUT_MASK (0x7 << 26) | 23 | #define VIDCON0_VIDOUT_MASK (0x7 << 26) |
28 | #define VIDCON0_VIDOUT_SHIFT (26) | 24 | #define VIDCON0_VIDOUT_SHIFT 26 |
29 | #define VIDCON0_VIDOUT_RGB (0x0 << 26) | 25 | #define VIDCON0_VIDOUT_RGB (0x0 << 26) |
30 | #define VIDCON0_VIDOUT_TV (0x1 << 26) | 26 | #define VIDCON0_VIDOUT_TV (0x1 << 26) |
31 | #define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26) | 27 | #define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26) |
@@ -35,7 +31,7 @@ | |||
35 | #define VIDCON0_VIDOUT_WB_I80_LDI1 (0x7 << 26) | 31 | #define VIDCON0_VIDOUT_WB_I80_LDI1 (0x7 << 26) |
36 | 32 | ||
37 | #define VIDCON0_L1_DATA_MASK (0x7 << 23) | 33 | #define VIDCON0_L1_DATA_MASK (0x7 << 23) |
38 | #define VIDCON0_L1_DATA_SHIFT (23) | 34 | #define VIDCON0_L1_DATA_SHIFT 23 |
39 | #define VIDCON0_L1_DATA_16BPP (0x0 << 23) | 35 | #define VIDCON0_L1_DATA_16BPP (0x0 << 23) |
40 | #define VIDCON0_L1_DATA_18BPP16 (0x1 << 23) | 36 | #define VIDCON0_L1_DATA_18BPP16 (0x1 << 23) |
41 | #define VIDCON0_L1_DATA_18BPP9 (0x2 << 23) | 37 | #define VIDCON0_L1_DATA_18BPP9 (0x2 << 23) |
@@ -44,7 +40,7 @@ | |||
44 | #define VIDCON0_L1_DATA_16BPP8 (0x5 << 23) | 40 | #define VIDCON0_L1_DATA_16BPP8 (0x5 << 23) |
45 | 41 | ||
46 | #define VIDCON0_L0_DATA_MASK (0x7 << 20) | 42 | #define VIDCON0_L0_DATA_MASK (0x7 << 20) |
47 | #define VIDCON0_L0_DATA_SHIFT (20) | 43 | #define VIDCON0_L0_DATA_SHIFT 20 |
48 | #define VIDCON0_L0_DATA_16BPP (0x0 << 20) | 44 | #define VIDCON0_L0_DATA_16BPP (0x0 << 20) |
49 | #define VIDCON0_L0_DATA_18BPP16 (0x1 << 20) | 45 | #define VIDCON0_L0_DATA_18BPP16 (0x1 << 20) |
50 | #define VIDCON0_L0_DATA_18BPP9 (0x2 << 20) | 46 | #define VIDCON0_L0_DATA_18BPP9 (0x2 << 20) |
@@ -53,7 +49,7 @@ | |||
53 | #define VIDCON0_L0_DATA_16BPP8 (0x5 << 20) | 49 | #define VIDCON0_L0_DATA_16BPP8 (0x5 << 20) |
54 | 50 | ||
55 | #define VIDCON0_PNRMODE_MASK (0x3 << 17) | 51 | #define VIDCON0_PNRMODE_MASK (0x3 << 17) |
56 | #define VIDCON0_PNRMODE_SHIFT (17) | 52 | #define VIDCON0_PNRMODE_SHIFT 17 |
57 | #define VIDCON0_PNRMODE_RGB (0x0 << 17) | 53 | #define VIDCON0_PNRMODE_RGB (0x0 << 17) |
58 | #define VIDCON0_PNRMODE_BGR (0x1 << 17) | 54 | #define VIDCON0_PNRMODE_BGR (0x1 << 17) |
59 | #define VIDCON0_PNRMODE_SERIAL_RGB (0x2 << 17) | 55 | #define VIDCON0_PNRMODE_SERIAL_RGB (0x2 << 17) |
@@ -61,14 +57,14 @@ | |||
61 | 57 | ||
62 | #define VIDCON0_CLKVALUP (1 << 16) | 58 | #define VIDCON0_CLKVALUP (1 << 16) |
63 | #define VIDCON0_CLKVAL_F_MASK (0xff << 6) | 59 | #define VIDCON0_CLKVAL_F_MASK (0xff << 6) |
64 | #define VIDCON0_CLKVAL_F_SHIFT (6) | 60 | #define VIDCON0_CLKVAL_F_SHIFT 6 |
65 | #define VIDCON0_CLKVAL_F_LIMIT (0xff) | 61 | #define VIDCON0_CLKVAL_F_LIMIT 0xff |
66 | #define VIDCON0_CLKVAL_F(_x) ((_x) << 6) | 62 | #define VIDCON0_CLKVAL_F(_x) ((_x) << 6) |
67 | #define VIDCON0_VLCKFREE (1 << 5) | 63 | #define VIDCON0_VLCKFREE (1 << 5) |
68 | #define VIDCON0_CLKDIR (1 << 4) | 64 | #define VIDCON0_CLKDIR (1 << 4) |
69 | 65 | ||
70 | #define VIDCON0_CLKSEL_MASK (0x3 << 2) | 66 | #define VIDCON0_CLKSEL_MASK (0x3 << 2) |
71 | #define VIDCON0_CLKSEL_SHIFT (2) | 67 | #define VIDCON0_CLKSEL_SHIFT 2 |
72 | #define VIDCON0_CLKSEL_HCLK (0x0 << 2) | 68 | #define VIDCON0_CLKSEL_HCLK (0x0 << 2) |
73 | #define VIDCON0_CLKSEL_LCD (0x1 << 2) | 69 | #define VIDCON0_CLKSEL_LCD (0x1 << 2) |
74 | #define VIDCON0_CLKSEL_27M (0x3 << 2) | 70 | #define VIDCON0_CLKSEL_27M (0x3 << 2) |
@@ -76,17 +72,17 @@ | |||
76 | #define VIDCON0_ENVID (1 << 1) | 72 | #define VIDCON0_ENVID (1 << 1) |
77 | #define VIDCON0_ENVID_F (1 << 0) | 73 | #define VIDCON0_ENVID_F (1 << 0) |
78 | 74 | ||
79 | #define VIDCON1 (0x04) | 75 | #define VIDCON1 0x04 |
80 | #define VIDCON1_LINECNT_MASK (0x7ff << 16) | 76 | #define VIDCON1_LINECNT_MASK (0x7ff << 16) |
81 | #define VIDCON1_LINECNT_SHIFT (16) | 77 | #define VIDCON1_LINECNT_SHIFT 16 |
82 | #define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff) | 78 | #define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff) |
83 | #define VIDCON1_FSTATUS_EVEN (1 << 15) | 79 | #define VIDCON1_FSTATUS_EVEN (1 << 15) |
84 | #define VIDCON1_VSTATUS_MASK (0x3 << 13) | 80 | #define VIDCON1_VSTATUS_MASK (0x3 << 13) |
85 | #define VIDCON1_VSTATUS_SHIFT (13) | 81 | #define VIDCON1_VSTATUS_SHIFT 13 |
86 | #define VIDCON1_VSTATUS_VSYNC (0x0 << 13) | 82 | #define VIDCON1_VSTATUS_VSYNC (0x0 << 13) |
87 | #define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13) | 83 | #define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13) |
88 | #define VIDCON1_VSTATUS_ACTIVE (0x2 << 13) | 84 | #define VIDCON1_VSTATUS_ACTIVE (0x2 << 13) |
89 | #define VIDCON1_VSTATUS_FRONTPORCH (0x0 << 13) | 85 | #define VIDCON1_VSTATUS_FRONTPORCH (0x3 << 13) |
90 | #define VIDCON1_VCLK_MASK (0x3 << 9) | 86 | #define VIDCON1_VCLK_MASK (0x3 << 9) |
91 | #define VIDCON1_VCLK_HOLD (0x0 << 9) | 87 | #define VIDCON1_VCLK_HOLD (0x0 << 9) |
92 | #define VIDCON1_VCLK_RUN (0x1 << 9) | 88 | #define VIDCON1_VCLK_RUN (0x1 << 9) |
@@ -98,12 +94,12 @@ | |||
98 | 94 | ||
99 | /* VIDCON2 */ | 95 | /* VIDCON2 */ |
100 | 96 | ||
101 | #define VIDCON2 (0x08) | 97 | #define VIDCON2 0x08 |
102 | #define VIDCON2_EN601 (1 << 23) | 98 | #define VIDCON2_EN601 (1 << 23) |
103 | #define VIDCON2_TVFMTSEL_SW (1 << 14) | 99 | #define VIDCON2_TVFMTSEL_SW (1 << 14) |
104 | 100 | ||
105 | #define VIDCON2_TVFMTSEL1_MASK (0x3 << 12) | 101 | #define VIDCON2_TVFMTSEL1_MASK (0x3 << 12) |
106 | #define VIDCON2_TVFMTSEL1_SHIFT (12) | 102 | #define VIDCON2_TVFMTSEL1_SHIFT 12 |
107 | #define VIDCON2_TVFMTSEL1_RGB (0x0 << 12) | 103 | #define VIDCON2_TVFMTSEL1_RGB (0x0 << 12) |
108 | #define VIDCON2_TVFMTSEL1_YUV422 (0x1 << 12) | 104 | #define VIDCON2_TVFMTSEL1_YUV422 (0x1 << 12) |
109 | #define VIDCON2_TVFMTSEL1_YUV444 (0x2 << 12) | 105 | #define VIDCON2_TVFMTSEL1_YUV444 (0x2 << 12) |
@@ -115,74 +111,75 @@ | |||
115 | * Might not be present in the S3C6410 documentation, | 111 | * Might not be present in the S3C6410 documentation, |
116 | * but tests prove it's there almost for sure; shouldn't hurt in any case. | 112 | * but tests prove it's there almost for sure; shouldn't hurt in any case. |
117 | */ | 113 | */ |
118 | #define PRTCON (0x0c) | 114 | #define PRTCON 0x0c |
119 | #define PRTCON_PROTECT (1 << 11) | 115 | #define PRTCON_PROTECT (1 << 11) |
120 | 116 | ||
121 | /* VIDTCON0 */ | 117 | /* VIDTCON0 */ |
122 | 118 | ||
123 | #define VIDTCON0 (0x10) | 119 | #define VIDTCON0 0x10 |
124 | #define VIDTCON0_VBPDE_MASK (0xff << 24) | 120 | #define VIDTCON0_VBPDE_MASK (0xff << 24) |
125 | #define VIDTCON0_VBPDE_SHIFT (24) | 121 | #define VIDTCON0_VBPDE_SHIFT 24 |
126 | #define VIDTCON0_VBPDE_LIMIT (0xff) | 122 | #define VIDTCON0_VBPDE_LIMIT 0xff |
127 | #define VIDTCON0_VBPDE(_x) ((_x) << 24) | 123 | #define VIDTCON0_VBPDE(_x) ((_x) << 24) |
128 | 124 | ||
129 | #define VIDTCON0_VBPD_MASK (0xff << 16) | 125 | #define VIDTCON0_VBPD_MASK (0xff << 16) |
130 | #define VIDTCON0_VBPD_SHIFT (16) | 126 | #define VIDTCON0_VBPD_SHIFT 16 |
131 | #define VIDTCON0_VBPD_LIMIT (0xff) | 127 | #define VIDTCON0_VBPD_LIMIT 0xff |
132 | #define VIDTCON0_VBPD(_x) ((_x) << 16) | 128 | #define VIDTCON0_VBPD(_x) ((_x) << 16) |
133 | 129 | ||
134 | #define VIDTCON0_VFPD_MASK (0xff << 8) | 130 | #define VIDTCON0_VFPD_MASK (0xff << 8) |
135 | #define VIDTCON0_VFPD_SHIFT (8) | 131 | #define VIDTCON0_VFPD_SHIFT 8 |
136 | #define VIDTCON0_VFPD_LIMIT (0xff) | 132 | #define VIDTCON0_VFPD_LIMIT 0xff |
137 | #define VIDTCON0_VFPD(_x) ((_x) << 8) | 133 | #define VIDTCON0_VFPD(_x) ((_x) << 8) |
138 | 134 | ||
139 | #define VIDTCON0_VSPW_MASK (0xff << 0) | 135 | #define VIDTCON0_VSPW_MASK (0xff << 0) |
140 | #define VIDTCON0_VSPW_SHIFT (0) | 136 | #define VIDTCON0_VSPW_SHIFT 0 |
141 | #define VIDTCON0_VSPW_LIMIT (0xff) | 137 | #define VIDTCON0_VSPW_LIMIT 0xff |
142 | #define VIDTCON0_VSPW(_x) ((_x) << 0) | 138 | #define VIDTCON0_VSPW(_x) ((_x) << 0) |
143 | 139 | ||
144 | /* VIDTCON1 */ | 140 | /* VIDTCON1 */ |
145 | 141 | ||
146 | #define VIDTCON1 (0x14) | 142 | #define VIDTCON1 0x14 |
147 | #define VIDTCON1_VFPDE_MASK (0xff << 24) | 143 | #define VIDTCON1_VFPDE_MASK (0xff << 24) |
148 | #define VIDTCON1_VFPDE_SHIFT (24) | 144 | #define VIDTCON1_VFPDE_SHIFT 24 |
149 | #define VIDTCON1_VFPDE_LIMIT (0xff) | 145 | #define VIDTCON1_VFPDE_LIMIT 0xff |
150 | #define VIDTCON1_VFPDE(_x) ((_x) << 24) | 146 | #define VIDTCON1_VFPDE(_x) ((_x) << 24) |
151 | 147 | ||
152 | #define VIDTCON1_HBPD_MASK (0xff << 16) | 148 | #define VIDTCON1_HBPD_MASK (0xff << 16) |
153 | #define VIDTCON1_HBPD_SHIFT (16) | 149 | #define VIDTCON1_HBPD_SHIFT 16 |
154 | #define VIDTCON1_HBPD_LIMIT (0xff) | 150 | #define VIDTCON1_HBPD_LIMIT 0xff |
155 | #define VIDTCON1_HBPD(_x) ((_x) << 16) | 151 | #define VIDTCON1_HBPD(_x) ((_x) << 16) |
156 | 152 | ||
157 | #define VIDTCON1_HFPD_MASK (0xff << 8) | 153 | #define VIDTCON1_HFPD_MASK (0xff << 8) |
158 | #define VIDTCON1_HFPD_SHIFT (8) | 154 | #define VIDTCON1_HFPD_SHIFT 8 |
159 | #define VIDTCON1_HFPD_LIMIT (0xff) | 155 | #define VIDTCON1_HFPD_LIMIT 0xff |
160 | #define VIDTCON1_HFPD(_x) ((_x) << 8) | 156 | #define VIDTCON1_HFPD(_x) ((_x) << 8) |
161 | 157 | ||
162 | #define VIDTCON1_HSPW_MASK (0xff << 0) | 158 | #define VIDTCON1_HSPW_MASK (0xff << 0) |
163 | #define VIDTCON1_HSPW_SHIFT (0) | 159 | #define VIDTCON1_HSPW_SHIFT 0 |
164 | #define VIDTCON1_HSPW_LIMIT (0xff) | 160 | #define VIDTCON1_HSPW_LIMIT 0xff |
165 | #define VIDTCON1_HSPW(_x) ((_x) << 0) | 161 | #define VIDTCON1_HSPW(_x) ((_x) << 0) |
166 | 162 | ||
167 | #define VIDTCON2 (0x18) | 163 | #define VIDTCON2 0x18 |
168 | #define VIDTCON2 (0x18) | ||
169 | #define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23) | 164 | #define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23) |
170 | #define VIDTCON2_LINEVAL_MASK (0x7ff << 11) | 165 | #define VIDTCON2_LINEVAL_MASK (0x7ff << 11) |
171 | #define VIDTCON2_LINEVAL_SHIFT (11) | 166 | #define VIDTCON2_LINEVAL_SHIFT 11 |
172 | #define VIDTCON2_LINEVAL_LIMIT (0x7ff) | 167 | #define VIDTCON2_LINEVAL_LIMIT 0x7ff |
173 | #define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11) | 168 | #define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11) |
174 | 169 | ||
175 | #define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22) | 170 | #define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22) |
176 | #define VIDTCON2_HOZVAL_MASK (0x7ff << 0) | 171 | #define VIDTCON2_HOZVAL_MASK (0x7ff << 0) |
177 | #define VIDTCON2_HOZVAL_SHIFT (0) | 172 | #define VIDTCON2_HOZVAL_SHIFT 0 |
178 | #define VIDTCON2_HOZVAL_LIMIT (0x7ff) | 173 | #define VIDTCON2_HOZVAL_LIMIT 0x7ff |
179 | #define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0) | 174 | #define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0) |
180 | 175 | ||
181 | /* WINCONx */ | 176 | /* WINCONx */ |
182 | 177 | ||
183 | #define WINCON(_win) (0x20 + ((_win) * 4)) | 178 | #define WINCON(_win) (0x20 + ((_win) * 4)) |
179 | #define WINCONx_CSCCON_EQ601 (0x0 << 28) | ||
180 | #define WINCONx_CSCCON_EQ709 (0x1 << 28) | ||
184 | #define WINCONx_CSCWIDTH_MASK (0x3 << 26) | 181 | #define WINCONx_CSCWIDTH_MASK (0x3 << 26) |
185 | #define WINCONx_CSCWIDTH_SHIFT (26) | 182 | #define WINCONx_CSCWIDTH_SHIFT 26 |
186 | #define WINCONx_CSCWIDTH_WIDE (0x0 << 26) | 183 | #define WINCONx_CSCWIDTH_WIDE (0x0 << 26) |
187 | #define WINCONx_CSCWIDTH_NARROW (0x3 << 26) | 184 | #define WINCONx_CSCWIDTH_NARROW (0x3 << 26) |
188 | #define WINCONx_ENLOCAL (1 << 22) | 185 | #define WINCONx_ENLOCAL (1 << 22) |
@@ -195,14 +192,14 @@ | |||
195 | #define WINCONx_WSWP (1 << 15) | 192 | #define WINCONx_WSWP (1 << 15) |
196 | #define WINCONx_YCbCr (1 << 13) | 193 | #define WINCONx_YCbCr (1 << 13) |
197 | #define WINCONx_BURSTLEN_MASK (0x3 << 9) | 194 | #define WINCONx_BURSTLEN_MASK (0x3 << 9) |
198 | #define WINCONx_BURSTLEN_SHIFT (9) | 195 | #define WINCONx_BURSTLEN_SHIFT 9 |
199 | #define WINCONx_BURSTLEN_16WORD (0x0 << 9) | 196 | #define WINCONx_BURSTLEN_16WORD (0x0 << 9) |
200 | #define WINCONx_BURSTLEN_8WORD (0x1 << 9) | 197 | #define WINCONx_BURSTLEN_8WORD (0x1 << 9) |
201 | #define WINCONx_BURSTLEN_4WORD (0x2 << 9) | 198 | #define WINCONx_BURSTLEN_4WORD (0x2 << 9) |
202 | #define WINCONx_ENWIN (1 << 0) | 199 | #define WINCONx_ENWIN (1 << 0) |
203 | 200 | ||
204 | #define WINCON0_BPPMODE_MASK (0xf << 2) | 201 | #define WINCON0_BPPMODE_MASK (0xf << 2) |
205 | #define WINCON0_BPPMODE_SHIFT (2) | 202 | #define WINCON0_BPPMODE_SHIFT 2 |
206 | #define WINCON0_BPPMODE_1BPP (0x0 << 2) | 203 | #define WINCON0_BPPMODE_1BPP (0x0 << 2) |
207 | #define WINCON0_BPPMODE_2BPP (0x1 << 2) | 204 | #define WINCON0_BPPMODE_2BPP (0x1 << 2) |
208 | #define WINCON0_BPPMODE_4BPP (0x2 << 2) | 205 | #define WINCON0_BPPMODE_4BPP (0x2 << 2) |
@@ -215,7 +212,7 @@ | |||
215 | #define WINCON1_LOCALSEL_CAMIF (1 << 23) | 212 | #define WINCON1_LOCALSEL_CAMIF (1 << 23) |
216 | #define WINCON1_BLD_PIX (1 << 6) | 213 | #define WINCON1_BLD_PIX (1 << 6) |
217 | #define WINCON1_BPPMODE_MASK (0xf << 2) | 214 | #define WINCON1_BPPMODE_MASK (0xf << 2) |
218 | #define WINCON1_BPPMODE_SHIFT (2) | 215 | #define WINCON1_BPPMODE_SHIFT 2 |
219 | #define WINCON1_BPPMODE_1BPP (0x0 << 2) | 216 | #define WINCON1_BPPMODE_1BPP (0x0 << 2) |
220 | #define WINCON1_BPPMODE_2BPP (0x1 << 2) | 217 | #define WINCON1_BPPMODE_2BPP (0x1 << 2) |
221 | #define WINCON1_BPPMODE_4BPP (0x2 << 2) | 218 | #define WINCON1_BPPMODE_4BPP (0x2 << 2) |
@@ -234,7 +231,7 @@ | |||
234 | #define WINCON1_ALPHA_SEL (1 << 1) | 231 | #define WINCON1_ALPHA_SEL (1 << 1) |
235 | 232 | ||
236 | /* S5PV210 */ | 233 | /* S5PV210 */ |
237 | #define SHADOWCON (0x34) | 234 | #define SHADOWCON 0x34 |
238 | #define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win))) | 235 | #define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win))) |
239 | /* DMA channels (all windows) */ | 236 | /* DMA channels (all windows) */ |
240 | #define SHADOWCON_CHx_ENABLE(_win) (1 << (_win)) | 237 | #define SHADOWCON_CHx_ENABLE(_win) (1 << (_win)) |
@@ -243,52 +240,52 @@ | |||
243 | 240 | ||
244 | /* VIDOSDx */ | 241 | /* VIDOSDx */ |
245 | 242 | ||
246 | #define VIDOSD_BASE (0x40) | 243 | #define VIDOSD_BASE 0x40 |
247 | #define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23) | 244 | #define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23) |
248 | #define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) | 245 | #define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) |
249 | #define VIDOSDxA_TOPLEFT_X_SHIFT (11) | 246 | #define VIDOSDxA_TOPLEFT_X_SHIFT 11 |
250 | #define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff) | 247 | #define VIDOSDxA_TOPLEFT_X_LIMIT 0x7ff |
251 | #define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11) | 248 | #define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11) |
252 | 249 | ||
253 | #define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22) | 250 | #define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22) |
254 | #define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0) | 251 | #define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0) |
255 | #define VIDOSDxA_TOPLEFT_Y_SHIFT (0) | 252 | #define VIDOSDxA_TOPLEFT_Y_SHIFT 0 |
256 | #define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff) | 253 | #define VIDOSDxA_TOPLEFT_Y_LIMIT 0x7ff |
257 | #define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0) | 254 | #define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0) |
258 | 255 | ||
259 | #define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23) | 256 | #define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23) |
260 | #define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11) | 257 | #define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11) |
261 | #define VIDOSDxB_BOTRIGHT_X_SHIFT (11) | 258 | #define VIDOSDxB_BOTRIGHT_X_SHIFT 11 |
262 | #define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff) | 259 | #define VIDOSDxB_BOTRIGHT_X_LIMIT 0x7ff |
263 | #define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11) | 260 | #define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11) |
264 | 261 | ||
265 | #define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22) | 262 | #define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22) |
266 | #define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0) | 263 | #define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0) |
267 | #define VIDOSDxB_BOTRIGHT_Y_SHIFT (0) | 264 | #define VIDOSDxB_BOTRIGHT_Y_SHIFT 0 |
268 | #define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff) | 265 | #define VIDOSDxB_BOTRIGHT_Y_LIMIT 0x7ff |
269 | #define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0) | 266 | #define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0) |
270 | 267 | ||
271 | /* For VIDOSD[1..4]C */ | 268 | /* For VIDOSD[1..4]C */ |
272 | #define VIDISD14C_ALPHA0_R(_x) ((_x) << 20) | 269 | #define VIDISD14C_ALPHA0_R(_x) ((_x) << 20) |
273 | #define VIDISD14C_ALPHA0_G_MASK (0xf << 16) | 270 | #define VIDISD14C_ALPHA0_G_MASK (0xf << 16) |
274 | #define VIDISD14C_ALPHA0_G_SHIFT (16) | 271 | #define VIDISD14C_ALPHA0_G_SHIFT 16 |
275 | #define VIDISD14C_ALPHA0_G_LIMIT (0xf) | 272 | #define VIDISD14C_ALPHA0_G_LIMIT 0xf |
276 | #define VIDISD14C_ALPHA0_G(_x) ((_x) << 16) | 273 | #define VIDISD14C_ALPHA0_G(_x) ((_x) << 16) |
277 | #define VIDISD14C_ALPHA0_B_MASK (0xf << 12) | 274 | #define VIDISD14C_ALPHA0_B_MASK (0xf << 12) |
278 | #define VIDISD14C_ALPHA0_B_SHIFT (12) | 275 | #define VIDISD14C_ALPHA0_B_SHIFT 12 |
279 | #define VIDISD14C_ALPHA0_B_LIMIT (0xf) | 276 | #define VIDISD14C_ALPHA0_B_LIMIT 0xf |
280 | #define VIDISD14C_ALPHA0_B(_x) ((_x) << 12) | 277 | #define VIDISD14C_ALPHA0_B(_x) ((_x) << 12) |
281 | #define VIDISD14C_ALPHA1_R_MASK (0xf << 8) | 278 | #define VIDISD14C_ALPHA1_R_MASK (0xf << 8) |
282 | #define VIDISD14C_ALPHA1_R_SHIFT (8) | 279 | #define VIDISD14C_ALPHA1_R_SHIFT 8 |
283 | #define VIDISD14C_ALPHA1_R_LIMIT (0xf) | 280 | #define VIDISD14C_ALPHA1_R_LIMIT 0xf |
284 | #define VIDISD14C_ALPHA1_R(_x) ((_x) << 8) | 281 | #define VIDISD14C_ALPHA1_R(_x) ((_x) << 8) |
285 | #define VIDISD14C_ALPHA1_G_MASK (0xf << 4) | 282 | #define VIDISD14C_ALPHA1_G_MASK (0xf << 4) |
286 | #define VIDISD14C_ALPHA1_G_SHIFT (4) | 283 | #define VIDISD14C_ALPHA1_G_SHIFT 4 |
287 | #define VIDISD14C_ALPHA1_G_LIMIT (0xf) | 284 | #define VIDISD14C_ALPHA1_G_LIMIT 0xf |
288 | #define VIDISD14C_ALPHA1_G(_x) ((_x) << 4) | 285 | #define VIDISD14C_ALPHA1_G(_x) ((_x) << 4) |
289 | #define VIDISD14C_ALPHA1_B_MASK (0xf << 0) | 286 | #define VIDISD14C_ALPHA1_B_MASK (0xf << 0) |
290 | #define VIDISD14C_ALPHA1_B_SHIFT (0) | 287 | #define VIDISD14C_ALPHA1_B_SHIFT 0 |
291 | #define VIDISD14C_ALPHA1_B_LIMIT (0xf) | 288 | #define VIDISD14C_ALPHA1_B_LIMIT 0xf |
292 | #define VIDISD14C_ALPHA1_B(_x) ((_x) << 0) | 289 | #define VIDISD14C_ALPHA1_B(_x) ((_x) << 0) |
293 | 290 | ||
294 | /* Video buffer addresses */ | 291 | /* Video buffer addresses */ |
@@ -300,22 +297,22 @@ | |||
300 | 297 | ||
301 | #define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27) | 298 | #define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27) |
302 | #define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13) | 299 | #define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13) |
303 | #define VIDW_BUF_SIZE_OFFSET_SHIFT (13) | 300 | #define VIDW_BUF_SIZE_OFFSET_SHIFT 13 |
304 | #define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff) | 301 | #define VIDW_BUF_SIZE_OFFSET_LIMIT 0x1fff |
305 | #define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13) | 302 | #define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13) |
306 | 303 | ||
307 | #define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26) | 304 | #define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26) |
308 | #define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0) | 305 | #define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0) |
309 | #define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0) | 306 | #define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT 0 |
310 | #define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff) | 307 | #define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT 0x1fff |
311 | #define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0) | 308 | #define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0) |
312 | 309 | ||
313 | /* Interrupt controls and status */ | 310 | /* Interrupt controls and status */ |
314 | 311 | ||
315 | #define VIDINTCON0 (0x130) | 312 | #define VIDINTCON0 0x130 |
316 | #define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20) | 313 | #define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20) |
317 | #define VIDINTCON0_FIFOINTERVAL_SHIFT (20) | 314 | #define VIDINTCON0_FIFOINTERVAL_SHIFT 20 |
318 | #define VIDINTCON0_FIFOINTERVAL_LIMIT (0x3f) | 315 | #define VIDINTCON0_FIFOINTERVAL_LIMIT 0x3f |
319 | #define VIDINTCON0_FIFOINTERVAL(_x) ((_x) << 20) | 316 | #define VIDINTCON0_FIFOINTERVAL(_x) ((_x) << 20) |
320 | 317 | ||
321 | #define VIDINTCON0_INT_SYSMAINCON (1 << 19) | 318 | #define VIDINTCON0_INT_SYSMAINCON (1 << 19) |
@@ -323,7 +320,7 @@ | |||
323 | #define VIDINTCON0_INT_I80IFDONE (1 << 17) | 320 | #define VIDINTCON0_INT_I80IFDONE (1 << 17) |
324 | 321 | ||
325 | #define VIDINTCON0_FRAMESEL0_MASK (0x3 << 15) | 322 | #define VIDINTCON0_FRAMESEL0_MASK (0x3 << 15) |
326 | #define VIDINTCON0_FRAMESEL0_SHIFT (15) | 323 | #define VIDINTCON0_FRAMESEL0_SHIFT 15 |
327 | #define VIDINTCON0_FRAMESEL0_BACKPORCH (0x0 << 15) | 324 | #define VIDINTCON0_FRAMESEL0_BACKPORCH (0x0 << 15) |
328 | #define VIDINTCON0_FRAMESEL0_VSYNC (0x1 << 15) | 325 | #define VIDINTCON0_FRAMESEL0_VSYNC (0x1 << 15) |
329 | #define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15) | 326 | #define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15) |
@@ -338,7 +335,7 @@ | |||
338 | 335 | ||
339 | #define VIDINTCON0_INT_FRAME (1 << 12) | 336 | #define VIDINTCON0_INT_FRAME (1 << 12) |
340 | #define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5) | 337 | #define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5) |
341 | #define VIDINTCON0_FIFIOSEL_SHIFT (5) | 338 | #define VIDINTCON0_FIFIOSEL_SHIFT 5 |
342 | #define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5) | 339 | #define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5) |
343 | #define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5) | 340 | #define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5) |
344 | #define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5) | 341 | #define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5) |
@@ -346,7 +343,7 @@ | |||
346 | #define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5) | 343 | #define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5) |
347 | 344 | ||
348 | #define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2) | 345 | #define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2) |
349 | #define VIDINTCON0_FIFOLEVEL_SHIFT (2) | 346 | #define VIDINTCON0_FIFOLEVEL_SHIFT 2 |
350 | #define VIDINTCON0_FIFOLEVEL_TO25PC (0x0 << 2) | 347 | #define VIDINTCON0_FIFOLEVEL_TO25PC (0x0 << 2) |
351 | #define VIDINTCON0_FIFOLEVEL_TO50PC (0x1 << 2) | 348 | #define VIDINTCON0_FIFOLEVEL_TO50PC (0x1 << 2) |
352 | #define VIDINTCON0_FIFOLEVEL_TO75PC (0x2 << 2) | 349 | #define VIDINTCON0_FIFOLEVEL_TO75PC (0x2 << 2) |
@@ -354,46 +351,46 @@ | |||
354 | #define VIDINTCON0_FIFOLEVEL_FULL (0x4 << 2) | 351 | #define VIDINTCON0_FIFOLEVEL_FULL (0x4 << 2) |
355 | 352 | ||
356 | #define VIDINTCON0_INT_FIFO_MASK (0x3 << 0) | 353 | #define VIDINTCON0_INT_FIFO_MASK (0x3 << 0) |
357 | #define VIDINTCON0_INT_FIFO_SHIFT (0) | 354 | #define VIDINTCON0_INT_FIFO_SHIFT 0 |
358 | #define VIDINTCON0_INT_ENABLE (1 << 0) | 355 | #define VIDINTCON0_INT_ENABLE (1 << 0) |
359 | 356 | ||
360 | #define VIDINTCON1 (0x134) | 357 | #define VIDINTCON1 0x134 |
361 | #define VIDINTCON1_INT_I180 (1 << 2) | 358 | #define VIDINTCON1_INT_I180 (1 << 2) |
362 | #define VIDINTCON1_INT_FRAME (1 << 1) | 359 | #define VIDINTCON1_INT_FRAME (1 << 1) |
363 | #define VIDINTCON1_INT_FIFO (1 << 0) | 360 | #define VIDINTCON1_INT_FIFO (1 << 0) |
364 | 361 | ||
365 | /* Window colour-key control registers */ | 362 | /* Window colour-key control registers */ |
366 | #define WKEYCON (0x140) /* 6410,V210 */ | 363 | #define WKEYCON 0x140 |
367 | 364 | ||
368 | #define WKEYCON0 (0x00) | 365 | #define WKEYCON0 0x00 |
369 | #define WKEYCON1 (0x04) | 366 | #define WKEYCON1 0x04 |
370 | 367 | ||
371 | #define WxKEYCON0_KEYBL_EN (1 << 26) | 368 | #define WxKEYCON0_KEYBL_EN (1 << 26) |
372 | #define WxKEYCON0_KEYEN_F (1 << 25) | 369 | #define WxKEYCON0_KEYEN_F (1 << 25) |
373 | #define WxKEYCON0_DIRCON (1 << 24) | 370 | #define WxKEYCON0_DIRCON (1 << 24) |
374 | #define WxKEYCON0_COMPKEY_MASK (0xffffff << 0) | 371 | #define WxKEYCON0_COMPKEY_MASK (0xffffff << 0) |
375 | #define WxKEYCON0_COMPKEY_SHIFT (0) | 372 | #define WxKEYCON0_COMPKEY_SHIFT 0 |
376 | #define WxKEYCON0_COMPKEY_LIMIT (0xffffff) | 373 | #define WxKEYCON0_COMPKEY_LIMIT 0xffffff |
377 | #define WxKEYCON0_COMPKEY(_x) ((_x) << 0) | 374 | #define WxKEYCON0_COMPKEY(_x) ((_x) << 0) |
378 | #define WxKEYCON1_COLVAL_MASK (0xffffff << 0) | 375 | #define WxKEYCON1_COLVAL_MASK (0xffffff << 0) |
379 | #define WxKEYCON1_COLVAL_SHIFT (0) | 376 | #define WxKEYCON1_COLVAL_SHIFT 0 |
380 | #define WxKEYCON1_COLVAL_LIMIT (0xffffff) | 377 | #define WxKEYCON1_COLVAL_LIMIT 0xffffff |
381 | #define WxKEYCON1_COLVAL(_x) ((_x) << 0) | 378 | #define WxKEYCON1_COLVAL(_x) ((_x) << 0) |
382 | 379 | ||
383 | /* Dithering control */ | 380 | /* Dithering control */ |
384 | #define DITHMODE (0x170) | 381 | #define DITHMODE 0x170 |
385 | #define DITHMODE_R_POS_MASK (0x3 << 5) | 382 | #define DITHMODE_R_POS_MASK (0x3 << 5) |
386 | #define DITHMODE_R_POS_SHIFT (5) | 383 | #define DITHMODE_R_POS_SHIFT 5 |
387 | #define DITHMODE_R_POS_8BIT (0x0 << 5) | 384 | #define DITHMODE_R_POS_8BIT (0x0 << 5) |
388 | #define DITHMODE_R_POS_6BIT (0x1 << 5) | 385 | #define DITHMODE_R_POS_6BIT (0x1 << 5) |
389 | #define DITHMODE_R_POS_5BIT (0x2 << 5) | 386 | #define DITHMODE_R_POS_5BIT (0x2 << 5) |
390 | #define DITHMODE_G_POS_MASK (0x3 << 3) | 387 | #define DITHMODE_G_POS_MASK (0x3 << 3) |
391 | #define DITHMODE_G_POS_SHIFT (3) | 388 | #define DITHMODE_G_POS_SHIFT 3 |
392 | #define DITHMODE_G_POS_8BIT (0x0 << 3) | 389 | #define DITHMODE_G_POS_8BIT (0x0 << 3) |
393 | #define DITHMODE_G_POS_6BIT (0x1 << 3) | 390 | #define DITHMODE_G_POS_6BIT (0x1 << 3) |
394 | #define DITHMODE_G_POS_5BIT (0x2 << 3) | 391 | #define DITHMODE_G_POS_5BIT (0x2 << 3) |
395 | #define DITHMODE_B_POS_MASK (0x3 << 1) | 392 | #define DITHMODE_B_POS_MASK (0x3 << 1) |
396 | #define DITHMODE_B_POS_SHIFT (1) | 393 | #define DITHMODE_B_POS_SHIFT 1 |
397 | #define DITHMODE_B_POS_8BIT (0x0 << 1) | 394 | #define DITHMODE_B_POS_8BIT (0x0 << 1) |
398 | #define DITHMODE_B_POS_6BIT (0x1 << 1) | 395 | #define DITHMODE_B_POS_6BIT (0x1 << 1) |
399 | #define DITHMODE_B_POS_5BIT (0x2 << 1) | 396 | #define DITHMODE_B_POS_5BIT (0x2 << 1) |
@@ -403,18 +400,18 @@ | |||
403 | #define WINxMAP(_win) (0x180 + ((_win) * 4)) | 400 | #define WINxMAP(_win) (0x180 + ((_win) * 4)) |
404 | #define WINxMAP_MAP (1 << 24) | 401 | #define WINxMAP_MAP (1 << 24) |
405 | #define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0) | 402 | #define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0) |
406 | #define WINxMAP_MAP_COLOUR_SHIFT (0) | 403 | #define WINxMAP_MAP_COLOUR_SHIFT 0 |
407 | #define WINxMAP_MAP_COLOUR_LIMIT (0xffffff) | 404 | #define WINxMAP_MAP_COLOUR_LIMIT 0xffffff |
408 | #define WINxMAP_MAP_COLOUR(_x) ((_x) << 0) | 405 | #define WINxMAP_MAP_COLOUR(_x) ((_x) << 0) |
409 | 406 | ||
410 | /* Winodw palette control */ | 407 | /* Winodw palette control */ |
411 | #define WPALCON (0x1A0) | 408 | #define WPALCON 0x1A0 |
412 | #define WPALCON_PAL_UPDATE (1 << 9) | 409 | #define WPALCON_PAL_UPDATE (1 << 9) |
413 | #define WPALCON_W4PAL_16BPP_A555 (1 << 8) | 410 | #define WPALCON_W4PAL_16BPP_A555 (1 << 8) |
414 | #define WPALCON_W3PAL_16BPP_A555 (1 << 7) | 411 | #define WPALCON_W3PAL_16BPP_A555 (1 << 7) |
415 | #define WPALCON_W2PAL_16BPP_A555 (1 << 6) | 412 | #define WPALCON_W2PAL_16BPP_A555 (1 << 6) |
416 | #define WPALCON_W1PAL_MASK (0x7 << 3) | 413 | #define WPALCON_W1PAL_MASK (0x7 << 3) |
417 | #define WPALCON_W1PAL_SHIFT (3) | 414 | #define WPALCON_W1PAL_SHIFT 3 |
418 | #define WPALCON_W1PAL_25BPP_A888 (0x0 << 3) | 415 | #define WPALCON_W1PAL_25BPP_A888 (0x0 << 3) |
419 | #define WPALCON_W1PAL_24BPP (0x1 << 3) | 416 | #define WPALCON_W1PAL_24BPP (0x1 << 3) |
420 | #define WPALCON_W1PAL_19BPP_A666 (0x2 << 3) | 417 | #define WPALCON_W1PAL_19BPP_A666 (0x2 << 3) |
@@ -423,7 +420,7 @@ | |||
423 | #define WPALCON_W1PAL_16BPP_A555 (0x5 << 3) | 420 | #define WPALCON_W1PAL_16BPP_A555 (0x5 << 3) |
424 | #define WPALCON_W1PAL_16BPP_565 (0x6 << 3) | 421 | #define WPALCON_W1PAL_16BPP_565 (0x6 << 3) |
425 | #define WPALCON_W0PAL_MASK (0x7 << 0) | 422 | #define WPALCON_W0PAL_MASK (0x7 << 0) |
426 | #define WPALCON_W0PAL_SHIFT (0) | 423 | #define WPALCON_W0PAL_SHIFT 0 |
427 | #define WPALCON_W0PAL_25BPP_A888 (0x0 << 0) | 424 | #define WPALCON_W0PAL_25BPP_A888 (0x0 << 0) |
428 | #define WPALCON_W0PAL_24BPP (0x1 << 0) | 425 | #define WPALCON_W0PAL_24BPP (0x1 << 0) |
429 | #define WPALCON_W0PAL_19BPP_A666 (0x2 << 0) | 426 | #define WPALCON_W0PAL_19BPP_A666 (0x2 << 0) |
@@ -433,13 +430,11 @@ | |||
433 | #define WPALCON_W0PAL_16BPP_565 (0x6 << 0) | 430 | #define WPALCON_W0PAL_16BPP_565 (0x6 << 0) |
434 | 431 | ||
435 | /* Blending equation control */ | 432 | /* Blending equation control */ |
436 | #define BLENDCON (0x260) | 433 | #define BLENDCON 0x260 |
437 | #define BLENDCON_NEW_MASK (1 << 0) | 434 | #define BLENDCON_NEW_MASK (1 << 0) |
438 | #define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0) | 435 | #define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0) |
439 | #define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0) | 436 | #define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0) |
440 | 437 | ||
441 | #define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */ | ||
442 | |||
443 | /* Notes on per-window bpp settings | 438 | /* Notes on per-window bpp settings |
444 | * | 439 | * |
445 | * Value Win0 Win1 Win2 Win3 Win 4 | 440 | * Value Win0 Win1 Win2 Win3 Win 4 |
@@ -462,8 +457,8 @@ | |||
462 | */ | 457 | */ |
463 | 458 | ||
464 | /* FIMD Version 8 register offset definitions */ | 459 | /* FIMD Version 8 register offset definitions */ |
465 | #define FIMD_V8_VIDTCON0 (0x20010) | 460 | #define FIMD_V8_VIDTCON0 0x20010 |
466 | #define FIMD_V8_VIDTCON1 (0x20014) | 461 | #define FIMD_V8_VIDTCON1 0x20014 |
467 | #define FIMD_V8_VIDTCON2 (0x20018) | 462 | #define FIMD_V8_VIDTCON2 0x20018 |
468 | #define FIMD_V8_VIDTCON3 (0x2001C) | 463 | #define FIMD_V8_VIDTCON3 0x2001C |
469 | #define FIMD_V8_VIDCON1 (0x20004) | 464 | #define FIMD_V8_VIDCON1 0x20004 |
diff --git a/include/video/videomode.h b/include/video/videomode.h new file mode 100644 index 000000000000..a42156234dd4 --- /dev/null +++ b/include/video/videomode.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
3 | * | ||
4 | * generic videomode description | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_VIDEOMODE_H | ||
10 | #define __LINUX_VIDEOMODE_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | #include <video/display_timing.h> | ||
14 | |||
15 | /* | ||
16 | * Subsystem independent description of a videomode. | ||
17 | * Can be generated from struct display_timing. | ||
18 | */ | ||
19 | struct videomode { | ||
20 | unsigned long pixelclock; /* pixelclock in Hz */ | ||
21 | |||
22 | u32 hactive; | ||
23 | u32 hfront_porch; | ||
24 | u32 hback_porch; | ||
25 | u32 hsync_len; | ||
26 | |||
27 | u32 vactive; | ||
28 | u32 vfront_porch; | ||
29 | u32 vback_porch; | ||
30 | u32 vsync_len; | ||
31 | |||
32 | unsigned int dmt_flags; /* VESA DMT flags */ | ||
33 | unsigned int data_flags; /* video data flags */ | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * videomode_from_timing - convert display timing to videomode | ||
38 | * @disp: structure with all possible timing entries | ||
39 | * @vm: return value | ||
40 | * @index: index into the list of display timings in devicetree | ||
41 | * | ||
42 | * DESCRIPTION: | ||
43 | * This function converts a struct display_timing to a struct videomode. | ||
44 | */ | ||
45 | int videomode_from_timing(const struct display_timings *disp, | ||
46 | struct videomode *vm, unsigned int index); | ||
47 | |||
48 | #endif | ||
diff --git a/include/xen/acpi.h b/include/xen/acpi.h index 48a9c0171b65..68d73d09b770 100644 --- a/include/xen/acpi.h +++ b/include/xen/acpi.h | |||
@@ -40,6 +40,41 @@ | |||
40 | #include <xen/xen.h> | 40 | #include <xen/xen.h> |
41 | #include <linux/acpi.h> | 41 | #include <linux/acpi.h> |
42 | 42 | ||
43 | #define ACPI_MEMORY_DEVICE_CLASS "memory" | ||
44 | #define ACPI_MEMORY_DEVICE_HID "PNP0C80" | ||
45 | #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" | ||
46 | |||
47 | int xen_stub_memory_device_init(void); | ||
48 | void xen_stub_memory_device_exit(void); | ||
49 | |||
50 | #define ACPI_PROCESSOR_CLASS "processor" | ||
51 | #define ACPI_PROCESSOR_DEVICE_HID "ACPI0007" | ||
52 | #define ACPI_PROCESSOR_DEVICE_NAME "Processor" | ||
53 | |||
54 | int xen_stub_processor_init(void); | ||
55 | void xen_stub_processor_exit(void); | ||
56 | |||
57 | void xen_pcpu_hotplug_sync(void); | ||
58 | int xen_pcpu_id(uint32_t acpi_id); | ||
59 | |||
60 | static inline int xen_acpi_get_pxm(acpi_handle h) | ||
61 | { | ||
62 | unsigned long long pxm; | ||
63 | acpi_status status; | ||
64 | acpi_handle handle; | ||
65 | acpi_handle phandle = h; | ||
66 | |||
67 | do { | ||
68 | handle = phandle; | ||
69 | status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm); | ||
70 | if (ACPI_SUCCESS(status)) | ||
71 | return pxm; | ||
72 | status = acpi_get_parent(handle, &phandle); | ||
73 | } while (ACPI_SUCCESS(status)); | ||
74 | |||
75 | return -ENXIO; | ||
76 | } | ||
77 | |||
43 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, | 78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, |
44 | u32 pm1a_cnt, u32 pm1b_cnd); | 79 | u32 pm1a_cnt, u32 pm1b_cnd); |
45 | 80 | ||
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index b40a4315cb8b..2ecfe4f700d9 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -190,6 +190,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | |||
190 | 190 | ||
191 | #define XENMEM_add_to_physmap_range 23 | 191 | #define XENMEM_add_to_physmap_range 23 |
192 | struct xen_add_to_physmap_range { | 192 | struct xen_add_to_physmap_range { |
193 | /* IN */ | ||
193 | /* Which domain to change the mapping for. */ | 194 | /* Which domain to change the mapping for. */ |
194 | domid_t domid; | 195 | domid_t domid; |
195 | uint16_t space; /* => enum phys_map_space */ | 196 | uint16_t space; /* => enum phys_map_space */ |
@@ -203,6 +204,11 @@ struct xen_add_to_physmap_range { | |||
203 | 204 | ||
204 | /* GPFN in domid where the source mapping page should appear. */ | 205 | /* GPFN in domid where the source mapping page should appear. */ |
205 | GUEST_HANDLE(xen_pfn_t) gpfns; | 206 | GUEST_HANDLE(xen_pfn_t) gpfns; |
207 | |||
208 | /* OUT */ | ||
209 | |||
210 | /* Per index error code. */ | ||
211 | GUEST_HANDLE(int) errs; | ||
206 | }; | 212 | }; |
207 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); | 213 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); |
208 | 214 | ||
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 5e36932ab407..c57d5f67f702 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
@@ -324,10 +324,21 @@ struct xenpf_cpu_ol { | |||
324 | }; | 324 | }; |
325 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); | 325 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); |
326 | 326 | ||
327 | /* | 327 | #define XENPF_cpu_hotadd 58 |
328 | * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd, | 328 | struct xenpf_cpu_hotadd { |
329 | * which are already occupied at Xen hypervisor side. | 329 | uint32_t apic_id; |
330 | */ | 330 | uint32_t acpi_id; |
331 | uint32_t pxm; | ||
332 | }; | ||
333 | |||
334 | #define XENPF_mem_hotadd 59 | ||
335 | struct xenpf_mem_hotadd { | ||
336 | uint64_t spfn; | ||
337 | uint64_t epfn; | ||
338 | uint32_t pxm; | ||
339 | uint32_t flags; | ||
340 | }; | ||
341 | |||
331 | #define XENPF_core_parking 60 | 342 | #define XENPF_core_parking 60 |
332 | struct xenpf_core_parking { | 343 | struct xenpf_core_parking { |
333 | /* IN variables */ | 344 | /* IN variables */ |
@@ -357,6 +368,8 @@ struct xen_platform_op { | |||
357 | struct xenpf_set_processor_pminfo set_pminfo; | 368 | struct xenpf_set_processor_pminfo set_pminfo; |
358 | struct xenpf_pcpuinfo pcpu_info; | 369 | struct xenpf_pcpuinfo pcpu_info; |
359 | struct xenpf_cpu_ol cpu_ol; | 370 | struct xenpf_cpu_ol cpu_ol; |
371 | struct xenpf_cpu_hotadd cpu_add; | ||
372 | struct xenpf_mem_hotadd mem_add; | ||
360 | struct xenpf_core_parking core_parking; | 373 | struct xenpf_core_parking core_parking; |
361 | uint8_t pad[128]; | 374 | uint8_t pad[128]; |
362 | } u; | 375 | } u; |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 886a5d80a18f..53ec4167bd0b 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -285,7 +285,7 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); | |||
285 | * Event channel endpoints per domain: | 285 | * Event channel endpoints per domain: |
286 | * 1024 if a long is 32 bits; 4096 if a long is 64 bits. | 286 | * 1024 if a long is 32 bits; 4096 if a long is 64 bits. |
287 | */ | 287 | */ |
288 | #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) | 288 | #define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64) |
289 | 289 | ||
290 | struct vcpu_time_info { | 290 | struct vcpu_time_info { |
291 | /* | 291 | /* |
@@ -341,7 +341,7 @@ struct vcpu_info { | |||
341 | */ | 341 | */ |
342 | uint8_t evtchn_upcall_pending; | 342 | uint8_t evtchn_upcall_pending; |
343 | uint8_t evtchn_upcall_mask; | 343 | uint8_t evtchn_upcall_mask; |
344 | unsigned long evtchn_pending_sel; | 344 | xen_ulong_t evtchn_pending_sel; |
345 | struct arch_vcpu_info arch; | 345 | struct arch_vcpu_info arch; |
346 | struct pvclock_vcpu_time_info time; | 346 | struct pvclock_vcpu_time_info time; |
347 | }; /* 64 bytes (x86) */ | 347 | }; /* 64 bytes (x86) */ |
@@ -384,8 +384,8 @@ struct shared_info { | |||
384 | * per-vcpu selector word to be set. Each bit in the selector covers a | 384 | * per-vcpu selector word to be set. Each bit in the selector covers a |
385 | * 'C long' in the PENDING bitfield array. | 385 | * 'C long' in the PENDING bitfield array. |
386 | */ | 386 | */ |
387 | unsigned long evtchn_pending[sizeof(unsigned long) * 8]; | 387 | xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8]; |
388 | unsigned long evtchn_mask[sizeof(unsigned long) * 8]; | 388 | xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8]; |
389 | 389 | ||
390 | /* | 390 | /* |
391 | * Wallclock time: updated only by control software. Guests should base | 391 | * Wallclock time: updated only by control software. Guests should base |